

#include "BUILTIN.h"

#include "Nat.h"
OBJ __AIndexingOfTrees_1; /* root */
extern OBJ _AIndexingOfTrees_2(OBJ);OBJ __AIndexingOfTrees_2; /* up */
extern OBJ _AIndexingOfTrees_3(OBJ);OBJ __AIndexingOfTrees_3; /* left */
extern OBJ _AIndexingOfTrees_4(OBJ);OBJ __AIndexingOfTrees_4; /* right */
extern OBJ _AIndexingOfTrees_5(OBJ);OBJ __AIndexingOfTrees_5; /* root? */
extern OBJ _AIndexingOfTrees_6(OBJ);OBJ __AIndexingOfTrees_6; /* left? */
extern OBJ _AIndexingOfTrees_7(OBJ);OBJ __AIndexingOfTrees_7; /* right? */
extern OBJ _AIndexingOfTrees_8(OBJ);OBJ __AIndexingOfTrees_8; /* unleft */
extern OBJ _AIndexingOfTrees_9(OBJ);OBJ __AIndexingOfTrees_9; /* unright */

extern OBJ _AIndexingOfTrees_2(OBJ x1) /* up */
{OBJ r;
 {OBJ x2;
  ANat_6(x1,x2);
  if(ISTGPRM(x2,0)){
   {OBJ x3;
    ANat_4(x1,x3);
    ANat_89(x3,__ANat_9,r);}
  }else{
   HLT("up\'IndexingOfTrees: no index above root");}}
 return r;}

extern OBJ _AIndexingOfTrees_3(OBJ x1) /* left */
{OBJ r;
 {OBJ x2;
  ANat_70(x1,x2);
  ANat_2(x2,r);}
 return r;}

extern OBJ _AIndexingOfTrees_4(OBJ x1) /* right */
{OBJ r;
 {OBJ x2;
  ANat_2(x1,x2);
  ANat_70(x2,r);}
 return r;}

extern OBJ _AIndexingOfTrees_5(OBJ x1) /* root? */
{OBJ r;
 ANat_6(x1,r);
 return r;}

extern OBJ _AIndexingOfTrees_6(register OBJ x1) /* left? */
{OBJ r;
 for(;;){
  {OBJ x2;
   ANat_6(x1,x2);
   if(ISTGPRM(x2,1)){
    r=__ABUILTIN_3;
   }else{
    {OBJ x3;
     ANat_3(x1,x3);
     if(ISTGPRM(x3,1)){
      {OBJ x4;OBJ x5;
       ANat_4(x1,x4);
       ANat_6(x4,x5);
       if(ISTGPRM(x5,1)){
	r=__ABUILTIN_5;
       }else{
	{OBJ x6;
	 x6=_AIndexingOfTrees_2(x1);
	 x1=x6;continue;}}}
     }else{
      HLT("IndexingOfTrees at <unknown> : missing else in left\?\'IndexingOfTrees:nat->bool");}}}}
  break;}
 return r;}

extern OBJ _AIndexingOfTrees_7(register OBJ x1) /* right? */
{OBJ r;
 for(;;){
  {OBJ x2;
   ANat_6(x1,x2);
   if(ISTGPRM(x2,1)){
    r=__ABUILTIN_3;
   }else{
    {OBJ x3;
     ANat_3(x1,x3);
     if(ISTGPRM(x3,1)){
      {OBJ x4;OBJ x5;
       ANat_4(x1,x4);
       ANat_6(x4,x5);
       if(ISTGPRM(x5,1)){
	r=__ABUILTIN_3;
       }else{
	{OBJ x6;
	 ANat_3(x4,x6);
	 if(ISTGPRM(x6,1)){
	  {OBJ x7;OBJ x8;
	   ANat_4(x4,x7);
	   ANat_6(x7,x8);
	   if(ISTGPRM(x8,1)){
	    r=__ABUILTIN_5;
	   }else{
	    {OBJ x9;
	     x9=_AIndexingOfTrees_2(x1);
	     x1=x9;continue;}}}
	 }else{
	  HLT("IndexingOfTrees at <unknown> : missing else in right\?\'IndexingOfTrees:nat->bool");}}}}
     }else{
      HLT("IndexingOfTrees at <unknown> : missing else in right\?\'IndexingOfTrees:nat->bool");}}}}
  break;}
 return r;}

extern OBJ _AIndexingOfTrees_8(OBJ x1) /* unleft */
{OBJ r;
 {OBJ x2;
  ANat_6(x1,x2);
  if(ISTGPRM(x2,0)){
   {OBJ x3;
    ANat_3(x1,x3);
    if(ISTGPRM(x3,1)){
     {OBJ x4;OBJ x5;
      ANat_4(x1,x4);
      ANat_6(x4,x5);
      if(ISTGPRM(x5,1)){
       r=__ANat_5;
      }else{
       {OBJ x6;
	ANat_75(x1,x6);
	if(ISTGPRM(x6,1)){
	 {OBJ x7;OBJ x8;OBJ x9;
	  x7=_AIndexingOfTrees_2(x1);
	  x8=_AIndexingOfTrees_8(x7);
	  ANat_70(x8,x9);
	  ANat_2(x9,r);}
	}else{
	 {OBJ x10;
	  ANat_74(x1,x10);
	  if(ISTGPRM(x10,1)){
	   {OBJ x11;OBJ x12;OBJ x13;
	    x11=_AIndexingOfTrees_2(x1);
	    x12=_AIndexingOfTrees_8(x11);
	    ANat_2(x12,x13);
	    ANat_70(x13,r);}
	  }else{
	   HLT("IndexingOfTrees at <48,21-49,50> : missing else in unleft\'IndexingOfTrees:nat->nat");}}}}}}
    }else{
     HLT("IndexingOfTrees at <unknown> : missing else in unleft\'IndexingOfTrees:nat->nat");}}
  }else{
   HLT("unleft\'IndexingOfTrees: no left index");}}
 return r;}

extern OBJ _AIndexingOfTrees_9(OBJ x1) /* unright */
{OBJ r;
 {OBJ x2;
  ANat_6(x1,x2);
  if(ISTGPRM(x2,0)){
   {OBJ x3;
    ANat_3(x1,x3);
    if(ISTGPRM(x3,1)){
     {OBJ x4;OBJ x5;
      ANat_4(x1,x4);
      ANat_6(x4,x5);
      if(ISTGPRM(x5,0)){
       {OBJ x6;
	ANat_3(x4,x6);
	if(ISTGPRM(x6,1)){
	 {OBJ x7;OBJ x8;
	  ANat_4(x4,x7);
	  ANat_6(x7,x8);
	  if(ISTGPRM(x8,1)){
	   r=__ANat_5;
	  }else{
	   {OBJ x9;
	    ANat_75(x1,x9);
	    if(ISTGPRM(x9,1)){
	     {OBJ x10;OBJ x11;OBJ x12;
	      x10=_AIndexingOfTrees_2(x1);
	      x11=_AIndexingOfTrees_9(x10);
	      ANat_70(x11,x12);
	      ANat_2(x12,r);}
	    }else{
	     {OBJ x13;
	      ANat_74(x1,x13);
	      if(ISTGPRM(x13,1)){
	       {OBJ x14;OBJ x15;OBJ x16;
		x14=_AIndexingOfTrees_2(x1);
		x15=_AIndexingOfTrees_9(x14);
		ANat_2(x15,x16);
		ANat_70(x16,r);}
	      }else{
	       HLT("IndexingOfTrees at <56,22-57,52> : missing else in unright\'IndexingOfTrees:nat->nat");}}}}}}
	}else{
	 HLT("IndexingOfTrees at <unknown> : missing else in unright\'IndexingOfTrees:nat->nat");}}
      }else{
       HLT("unright\'IndexingOfTrees: no right index");}}
    }else{
     HLT("IndexingOfTrees at <unknown> : missing else in unright\'IndexingOfTrees:nat->nat");}}
  }else{
   HLT("unright\'IndexingOfTrees: no right index");}}
 return r;}


init_AIndexingOfTrees()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 CLS(1,_AIndexingOfTrees_9,__AIndexingOfTrees_9);
 CLS(1,_AIndexingOfTrees_8,__AIndexingOfTrees_8);
 CLS(1,_AIndexingOfTrees_7,__AIndexingOfTrees_7);
 CLS(1,_AIndexingOfTrees_6,__AIndexingOfTrees_6);
 CLS(1,_AIndexingOfTrees_5,__AIndexingOfTrees_5);
 CLS(1,_AIndexingOfTrees_4,__AIndexingOfTrees_4);
 CLS(1,_AIndexingOfTrees_3,__AIndexingOfTrees_3);
 CLS(1,_AIndexingOfTrees_2,__AIndexingOfTrees_2);
 __AIndexingOfTrees_1=__ANat_5;}

