

#include "BUILTIN.h"

#include "Nat.h"

#include "Char.h"

#include "NatConv.h"

#include "Denotation.h"
extern OBJ _ASeqReduce_3(OBJ,OBJ,OBJ);extern OBJ __ASeqReduce_3;

#include "Int.h"

#include "Real.h"
OBJ __AOcPos_2; /* unknownP */
extern OBJ _AOcPos_3(OBJ);OBJ __AOcPos_3; /* unknownP? */
OBJ __AOcPos_4; /* implementation */
extern OBJ _AOcPos_5(OBJ);OBJ __AOcPos_5; /* implementation? */
OBJ __AOcPos_6; /* signature */
extern OBJ _AOcPos_7(OBJ);OBJ __AOcPos_7; /* signature? */
OBJ __AOcPos_9; /* unknown */
OBJ __AOcPos_10; /* initPos */
extern OBJ _AOcPos_11(OBJ,OBJ);OBJ __AOcPos_11; /* mkPos */
extern OBJ _AOcPos_12(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __AOcPos_12; /* mkReg */
extern OBJ _AOcPos_13(OBJ,OBJ);OBJ __AOcPos_13; /* mkPosS */
extern OBJ _AOcPos_14(OBJ,OBJ);OBJ __AOcPos_14; /* nextPos */
extern OBJ _AOcPos_15(OBJ);OBJ __AOcPos_15; /* nextLine */
extern OBJ _AOcPos_16(OBJ,OBJ);OBJ __AOcPos_16; /* extend */
extern OBJ _AOcPos_17(OBJ,OBJ);OBJ __AOcPos_17; /* + */
extern OBJ _AOcPos_18(OBJ);OBJ __AOcPos_18; /* +/ */
extern OBJ _AOcPos_19(OBJ,OBJ);OBJ __AOcPos_19; /* +! */
extern OBJ _AOcPos_20(OBJ);OBJ __AOcPos_20; /* lin */
extern OBJ _AOcPos_21(OBJ);OBJ __AOcPos_21; /* col */
extern OBJ _AOcPos_22(OBJ);OBJ __AOcPos_22; /* eLin */
extern OBJ _AOcPos_23(OBJ);OBJ __AOcPos_23; /* eCol */
extern OBJ _AOcPos_24(OBJ);OBJ __AOcPos_24; /* signature?,1 */
extern OBJ _AOcPos_25(OBJ);OBJ __AOcPos_25; /* implementation?,1 */
extern OBJ _AOcPos_26(OBJ);OBJ __AOcPos_26; /* unknown? */
extern OBJ _AOcPos_27(OBJ);OBJ __AOcPos_27; /* region? */
extern OBJ _AOcPos_28(OBJ,OBJ);OBJ __AOcPos_28; /* > */
extern OBJ _AOcPos_29(OBJ,OBJ);OBJ __AOcPos_29; /* < */
extern OBJ _AOcPos_30(OBJ,OBJ);OBJ __AOcPos_30; /* >= */
extern OBJ _AOcPos_31(OBJ,OBJ);OBJ __AOcPos_31; /* <= */
extern OBJ _AOcPos_32(OBJ,OBJ);OBJ __AOcPos_32; /* = */
extern OBJ _AOcPos_33(OBJ,OBJ);OBJ __AOcPos_33; /* |= */
extern OBJ _AOcPos_34(OBJ);OBJ __AOcPos_34; /* ` */
OBJ __AOcPos_35; /* firstPos */
extern OBJ _AOcPos_42(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __AOcPos_42; /* region */
extern OBJ _AOcPos_48(OBJ);OBJ __AOcPos_48; /* part */
extern OBJ _AOcPos_49(OBJ,OBJ,OBJ);OBJ __AOcPos_49; /* pos */
extern OBJ _AOcPos_50(OBJ);OBJ __AOcPos_50; /* pos? */
extern OBJ _AOcPos_56(OBJ,OBJ);OBJ __AOcPos_56; /* max */
OBJ __AOcPos_57; /* tabWidth */
extern TUP2 _AOcPos_58(OBJ,OBJ,OBJ,OBJ);OBJ __AOcPos_58; /* min */
extern TUP2 _AOcPos_59(OBJ,OBJ,OBJ,OBJ);OBJ __AOcPos_59; /* max,1 */
OBJ __AOcPos_60; /* `'60 */
OBJ __AOcPos_61; /* `'61 */
OBJ __AOcPos_62; /* `'62 */
OBJ __AOcPos_63; /* `'63 */
OBJ __AOcPos_64; /* `'64 */

extern OBJ _AOcPos_3(OBJ x1) /* unknownP? */
{OBJ r;
 if(ISTGPRM(x1,2)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_5(OBJ x1) /* implementation? */
{OBJ r;
 if(ISTGPRM(x1,1)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_7(OBJ x1) /* signature? */
{OBJ r;
 if(ISTGPRM(x1,0)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_11(OBJ x1,OBJ x2) /* mkPos */
{OBJ r;
 PRDF(3,1,r);FLD(r,1)=__AOcPos_2;FLD(r,2)=x1;FLD(r,3)=x2;
 return r;}

extern OBJ _AOcPos_12(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* mkReg */
{OBJ r;
 PRDF(5,2,r);FLD(r,1)=x1;FLD(r,2)=x2;FLD(r,3)=x3;FLD(r,4)=x4;FLD(r,5)=x5;
 return r;}

extern OBJ _AOcPos_13(OBJ x1,OBJ x2) /* mkPosS */
{OBJ r;
 PRDF(3,1,r);FLD(r,1)=__AOcPos_6;FLD(r,2)=x1;FLD(r,3)=x2;
 return r;}

extern OBJ _AOcPos_14(OBJ x1,OBJ x2) /* nextPos */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,1))){
  {OBJ x58=FLD(x1,1);OBJ x59=FLD(x1,2);OBJ x60=FLD(x1,3);FLAG x_x1=EXPRD(x1,1);
   if(x_x1){
   }else{}
   {OBJ x61;
    AChar_15(x2,__AChar_6,x61);
    if(ISTGPRM(x61,1)){
     {OBJ x63;OBJ x64;
      ANat_66(x60,__AOcPos_57,x63);
      ANat_62(__AOcPos_57,x63,x64);
      if(x_x1){
       RPRDF(x1,r);
      }else{
       FRPRD(x1,1);PRDF(3,1,r);FLD(r,1)=x58;FLD(r,2)=x59;}
      ANat_61(x60,x64,FLD(r,3));}
    }else{
     {OBJ x66;
      AChar_15(x2,__AChar_7,x66);
      if(ISTGPRM(x66,1)){
       {
	if(x_x1){
	 RPRDF(x1,r);FLD(r,3)=__ANat_8;
	}else{
	 FRPRD(x1,1);PRDF(3,1,r);FLD(r,1)=x58;FLD(r,3)=__ANat_8;}
	ANat_2(x59,FLD(r,2));}
      }else{
       {
	if(x_x1){
	 RPRDF(x1,r);
	}else{
	 FRPRD(x1,1);PRDF(3,1,r);FLD(r,1)=x58;FLD(r,2)=x59;}
	ANat_2(x60,FLD(r,3));}}}}}}
 }else{
  r=x1;}
 return r;}

extern OBJ _AOcPos_15(OBJ x1) /* nextLine */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,1))){
  {OBJ x42;OBJ x43=FLD(x1,2);
   if(EXPRD(x1,1)){
    {
     RPRDF(x1,r);FLD(r,3)=__ANat_8;
     ANat_2(x43,FLD(r,2));}
   }else{
    x42=FLD(x1,1);
    {
     FRPRD(x1,1);PRDF(3,1,r);FLD(r,1)=x42;FLD(r,3)=__ANat_8;
     ANat_2(x43,FLD(r,2));}}}
 }else{
  r=x1;}
 return r;}

extern OBJ _AOcPos_16(OBJ x1,OBJ x2) /* extend */
{OBJ r;
 if(ISPRM(x1)){
  r=__AOcPos_9;
 }else{
  if(ISTGPRD(x1,2)){
   {OBJ x125;OBJ x126;OBJ x127;OBJ x128;OBJ x129=FLD(x1,5);
    if(EXPRD(x1,1)){
     {
      RPRDF(x1,r);
      ANat_61(x129,x2,FLD(r,5));}
    }else{
     x125=FLD(x1,1);x126=FLD(x1,2);x127=FLD(x1,3);x128=FLD(x1,4);
     {
      FRPRD(x1,1);PRDF(5,2,r);FLD(r,1)=x125;FLD(r,2)=x126;FLD(r,3)=x127;FLD(r,4)=x128;
      ANat_61(x129,x2,FLD(r,5));}}}
  }else{
   {OBJ x131=FLD(x1,1);OBJ x132=FLD(x1,2);OBJ x133=FLD(x1,3);
    if(EXPRD(x1,1)){
     DSPRDF(x1);
    }else{
     FRPRD(x1,1);}
    {
     PRDF(5,2,r);FLD(r,1)=x131;FLD(r,2)=x132;FLD(r,3)=x133;FLD(r,4)=x132;
     ANat_61(x133,x2,FLD(r,5));}}}}
 return r;}

extern OBJ _AOcPos_17(OBJ x1,OBJ x2) /* + */
{OBJ r;
 if(ISPRM(x1)){
  if(ISPRM(x2)){
   r=__AOcPos_9;
  }else{
   r=x2;}
 }else{
  if(ISTGPRD(x1,2)){
   {OBJ x838=FLD(x1,1);OBJ x839=FLD(x1,2);OBJ x840=FLD(x1,3);OBJ x841=FLD(x1,4);OBJ x842=FLD(x1,5);
    if(ISPRM(x2)){
     r=x1;
    }else{
     if(ISTGPRD(x2,2)){
      {OBJ x843=FLD(x2,1);OBJ x844=FLD(x2,2);OBJ x845=FLD(x2,3);OBJ x846=FLD(x2,4);OBJ x847=FLD(x2,5);
       if(EXPRD(x2,1)){
	if(EXPRD(x1,1)){
	 DSPRDF(x1);
	}else{
	 DCPRD(x1,1);}
	{OBJ x850;TUP2 x851;
	 x850=_AOcPos_56(x838,x843);
	 x851=_AOcPos_58(x839,x840,x844,x845);
	 RPRDF(x2,r);FLD(r,1)=x850;FLD(r,2)=x851.c1;FLD(r,3)=x851.c2;
	 {TUP2 t=_AOcPos_59(x841,x842,x846,x847);
	  FLD(r,4)=t.c1;
	  FLD(r,5)=t.c2;}}
       }else{
	if(EXPRD(x1,1)){
	 DSPRDF(x1);
	}else{
	 DCPRD(x1,1);}
	{OBJ x850;TUP2 x851;
	 x850=_AOcPos_56(x838,x843);
	 x851=_AOcPos_58(x839,x840,x844,x845);
	 FRPRD(x2,1);PRDF(5,2,r);FLD(r,1)=x850;FLD(r,2)=x851.c1;FLD(r,3)=x851.c2;
	 {TUP2 t=_AOcPos_59(x841,x842,x846,x847);
	  FLD(r,4)=t.c1;
	  FLD(r,5)=t.c2;}}}}
     }else{
      {OBJ x856=FLD(x2,1);OBJ x857=FLD(x2,2);OBJ x858=FLD(x2,3);
       if(EXPRD(x2,1)){
	DSPRDF(x2);
       }else{
	FRPRD(x2,1);}
       if(EXPRD(x1,1)){
	DSPRDF(x1);
       }else{
	DCPRD(x1,1);}
       {OBJ x860;OBJ x861;OBJ x862;OBJ x863;
	ANat_73(x842,x858,x860);
	ANat_73(x841,x857,x861);
	ANat_72(x840,x858,x862);
	ANat_72(x839,x857,x863);
	PRDF(5,2,r);FLD(r,2)=x863;FLD(r,3)=x862;FLD(r,4)=x861;FLD(r,5)=x860;
	FLD(r,1)=_AOcPos_56(x838,x856);}}}}}
  }else{
   {OBJ x865=FLD(x1,1);OBJ x866=FLD(x1,2);OBJ x867=FLD(x1,3);
    if(ISPRM(x2)){
     r=x1;
    }else{
     if(ISTGPRD(x2,2)){
      {OBJ x868=FLD(x2,1);OBJ x869=FLD(x2,2);OBJ x870=FLD(x2,3);OBJ x871=FLD(x2,4);OBJ x872=FLD(x2,5);
       if(EXPRD(x2,1)){
	if(EXPRD(x1,1)){
	 DSPRDF(x1);
	}else{
	 DCPRD(x1,1);}
	{OBJ x874;OBJ x875;OBJ x876;OBJ x877;
	 x874=_AOcPos_56(x865,x868);
	 ANat_72(x866,x869,x875);
	 ANat_72(x867,x870,x876);
	 ANat_73(x866,x871,x877);
	 RPRDF(x2,r);FLD(r,1)=x874;FLD(r,2)=x875;FLD(r,3)=x876;FLD(r,4)=x877;
	 ANat_73(x867,x872,FLD(r,5));}
       }else{
	if(EXPRD(x1,1)){
	 DSPRDF(x1);
	}else{
	 DCPRD(x1,1);}
	{OBJ x874;OBJ x875;OBJ x876;OBJ x877;
	 x874=_AOcPos_56(x865,x868);
	 ANat_72(x866,x869,x875);
	 ANat_72(x867,x870,x876);
	 ANat_73(x866,x871,x877);
	 FRPRD(x2,1);PRDF(5,2,r);FLD(r,1)=x874;FLD(r,2)=x875;FLD(r,3)=x876;FLD(r,4)=x877;
	 ANat_73(x867,x872,FLD(r,5));}}}
     }else{
      {OBJ x879=FLD(x2,1);OBJ x880=FLD(x2,2);OBJ x881=FLD(x2,3);FLAG x_x2=EXPRD(x2,1);
       if(x_x2){
       }else{}
       if(EXPRD(x1,1)){
	DSPRDF(x1);
       }else{
	DCPRD(x1,1);}
       {OBJ x884;OBJ x885;OBJ x886;
	ANat_76(x866,x880,x884);
	x885=_AOcPos_56(x865,x879);
	if(ISTGPRM(x884,1)){
	 ANat_76(x867,x881,x886);
	}else{
	 x886=__ABUILTIN_3;}
	if(ISTGPRM(x886,1)){
	 if(x_x2){
	  RPRDF(x2,r);FLD(r,1)=x885;FLD(r,2)=x866;FLD(r,3)=x867;
	 }else{
	  FRPRD(x2,1);PRDF(3,1,r);FLD(r,1)=x885;FLD(r,2)=x866;FLD(r,3)=x867;}
	}else{
	 if(x_x2){
	  DSPRDF(x2);
	 }else{
	  FRPRD(x2,1);}
	 {OBJ x887;OBJ x888;OBJ x889;
	  ANat_73(x867,x881,x887);
	  ANat_73(x866,x880,x888);
	  ANat_72(x867,x881,x889);
	  PRDF(5,2,r);FLD(r,1)=x885;FLD(r,3)=x889;FLD(r,4)=x888;FLD(r,5)=x887;
	  ANat_72(x866,x880,FLD(r,2));}}}}}}}}}
 return r;}

extern OBJ _AOcPos_18(OBJ x1) /* +/ */
{OBJ r;
 CPCLS(__AOcPos_17,1);
 r=_ASeqReduce_3(__AOcPos_17,__AOcPos_9,x1);
 return r;}

extern OBJ _AOcPos_19(OBJ x1,OBJ x2) /* +! */
{OBJ r;
 if(ISPRD(x2)&&(ISTGPRD(x2,1))){
  {OBJ x54=FLD(x2,1);OBJ x55=FLD(x2,2);OBJ x56=FLD(x2,3);
   {OBJ x57;
    ANat_3(x56,x57);
    if(ISTGPRM(x57,1)){
     if(EXPRD(x2,1)){
      DSPRDF(x2);
     }else{
      DCPRD(x2,1);}
     {OBJ x59;OBJ x60;
      ANat_4(x56,x59);
      PRDF(3,1,x60);FLD(x60,1)=x54;FLD(x60,2)=x55;FLD(x60,3)=x59;
      r=_AOcPos_17(x1,x60);}
    }else{
     r=_AOcPos_17(x1,x2);}}}
 }else{
  r=_AOcPos_17(x1,x2);}
 return r;}

extern OBJ _AOcPos_20(OBJ x1) /* lin */
{OBJ r;
 if(ISPRM(x1)){
  HLT("OcPos at <unknown> : undefined selection lin\'OcPos:pos->nat");
 }else{
  {OBJ x3=FLD(x1,2);
   if(EXPRD(x1,1)){
    r=x3;
    DSPRD(x1);
   }else{
    r=x3;
    FRPRD(x1,1);}}}
 return r;}

extern OBJ _AOcPos_21(OBJ x1) /* col */
{OBJ r;
 if(ISPRM(x1)){
  HLT("OcPos at <unknown> : undefined selection col\'OcPos:pos->nat");
 }else{
  {OBJ x4=FLD(x1,3);
   if(EXPRD(x1,1)){
    r=x4;
    DSPRD(x1);
   }else{
    r=x4;
    FRPRD(x1,1);}}}
 return r;}

extern OBJ _AOcPos_22(OBJ x1) /* eLin */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,2))){
  {OBJ x5=FLD(x1,4);
   if(EXPRD(x1,1)){
    r=x5;
    DSPRDF(x1);
   }else{
    r=x5;
    FRPRD(x1,1);}}
 }else{
  HLT("OcPos at <unknown> : undefined selection eLin\'OcPos:pos->nat");}
 return r;}

extern OBJ _AOcPos_23(OBJ x1) /* eCol */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,2))){
  {OBJ x6=FLD(x1,5);
   if(EXPRD(x1,1)){
    r=x6;
    DSPRDF(x1);
   }else{
    r=x6;
    FRPRD(x1,1);}}
 }else{
  HLT("OcPos at <unknown> : undefined selection eCol\'OcPos:pos->nat");}
 return r;}

extern OBJ _AOcPos_24(OBJ x1) /* signature?,1 */
{OBJ r;
 if(ISPRM(x1)){
  r=__ABUILTIN_3;
 }else{
  {OBJ x20;
   {OBJ x12=FLD(x1,1);
    if(EXPRD(x1,1)){
     x20=x12;
     DSPRD(x1);
    }else{
     x20=x12;
     FRPRD(x1,1);}}
   if(ISTGPRM(x20,0)){
    r=__ABUILTIN_5;
   }else{
    r=__ABUILTIN_3;}}}
 return r;}

extern OBJ _AOcPos_25(OBJ x1) /* implementation?,1 */
{OBJ r;
 if(ISPRM(x1)){
  r=__ABUILTIN_3;
 }else{
  {OBJ x20;
   {OBJ x12=FLD(x1,1);
    if(EXPRD(x1,1)){
     x20=x12;
     DSPRD(x1);
    }else{
     x20=x12;
     FRPRD(x1,1);}}
   if(ISTGPRM(x20,1)){
    r=__ABUILTIN_5;
   }else{
    r=__ABUILTIN_3;}}}
 return r;}

extern OBJ _AOcPos_26(OBJ x1) /* unknown? */
{OBJ r;
 if(ISPRM(x1)){
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_27(OBJ x1) /* region? */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,2))){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_28(OBJ x1,OBJ x2) /* > */
{OBJ r;
 if(ISPRM(x1)){
  if(ISPRM(x2)){
   r=__ABUILTIN_3;
  }else{
   FREE(x2,1);
   r=__ABUILTIN_3;}
 }else{
  if(ISPRM(x2)){
   FREE(x1,1);
   r=__ABUILTIN_5;
  }else{
   if(ISTGPRD(x1,1)){
    {OBJ x386=FLD(x1,2);OBJ x387=FLD(x1,3);
     if(EXPRD(x1,1)){
      DSPRDF(x1);
     }else{
      FRPRD(x1,1);}
     {OBJ x390=FLD(x2,2);OBJ x391=FLD(x2,3);
      if(EXPRD(x2,1)){
       DSPRD(x2);
      }else{
       FRPRD(x2,1);}
      {OBJ x393;
       ANat_81(x386,x390,x393);
       if(ISTGPRM(x393,1)){
	r=__ABUILTIN_5;
       }else{
	{OBJ x394;
	 ANat_80(x386,x390,x394);
	 if(ISTGPRM(x394,1)){
	  r=__ABUILTIN_3;
	 }else{
	  {OBJ x395;
	   ANat_81(x387,x391,x395);
	   if(ISTGPRM(x395,1)){
	    r=__ABUILTIN_5;
	   }else{
	    {OBJ x396;
	     ANat_76(x387,x391,x396);
	     r=__ABUILTIN_3;}}}}}}}}}
   }else{
    {OBJ x408=FLD(x1,2);OBJ x409=FLD(x1,3);OBJ x410=FLD(x1,4);OBJ x411=FLD(x1,5);
     if(EXPRD(x1,1)){
      DSPRDF(x1);
     }else{
      FRPRD(x1,1);}
     if(ISTGPRD(x2,1)){
      {OBJ x414=FLD(x2,2);OBJ x415=FLD(x2,3);
       if(EXPRD(x2,1)){
	DSPRDF(x2);
       }else{
	FRPRD(x2,1);}
       {OBJ x417;
	ANat_81(x408,x414,x417);
	if(ISTGPRM(x417,1)){
	 r=__ABUILTIN_5;
	}else{
	 {OBJ x418;
	  ANat_80(x408,x414,x418);
	  if(ISTGPRM(x418,1)){
	   r=__ABUILTIN_3;
	  }else{
	   {OBJ x419;
	    ANat_81(x409,x415,x419);
	    if(ISTGPRM(x419,1)){
	     r=__ABUILTIN_5;
	    }else{
	     {OBJ x420;
	      ANat_76(x409,x415,x420);
	      if(ISTGPRM(x420,1)){
	       r=__ABUILTIN_5;
	      }else{
	       r=__ABUILTIN_3;}}}}}}}}}
     }else{
      {OBJ x422=FLD(x2,2);OBJ x423=FLD(x2,3);OBJ x424=FLD(x2,4);OBJ x425=FLD(x2,5);
       if(EXPRD(x2,1)){
	DSPRDF(x2);
       }else{
	FRPRD(x2,1);}
       {OBJ x427;
	ANat_81(x408,x422,x427);
	if(ISTGPRM(x427,1)){
	 r=__ABUILTIN_5;
	}else{
	 {OBJ x428;
	  ANat_80(x408,x422,x428);
	  if(ISTGPRM(x428,1)){
	   r=__ABUILTIN_3;
	  }else{
	   {OBJ x429;
	    ANat_81(x409,x423,x429);
	    if(ISTGPRM(x429,1)){
	     r=__ABUILTIN_5;
	    }else{
	     {OBJ x430;
	      ANat_76(x409,x423,x430);
	      if(ISTGPRM(x430,1)){
	       {OBJ x431;
		ANat_81(x410,x424,x431);
		if(ISTGPRM(x431,1)){
		 r=__ABUILTIN_5;
		}else{
		 {OBJ x432;
		  ANat_80(x410,x424,x432);
		  if(ISTGPRM(x432,1)){
		   r=__ABUILTIN_3;
		  }else{
		   {OBJ x433;
		    ANat_81(x411,x425,x433);
		    if(ISTGPRM(x433,1)){
		     r=__ABUILTIN_5;
		    }else{
		     r=__ABUILTIN_3;}}}}}}
	      }else{
	       r=__ABUILTIN_3;}}}}}}}}}}}}}}
 return r;}

extern OBJ _AOcPos_29(OBJ x1,OBJ x2) /* < */
{OBJ r;
 r=_AOcPos_28(x2,x1);
 return r;}

extern OBJ _AOcPos_30(OBJ x1,OBJ x2) /* >= */
{OBJ r;
 {OBJ x3;
  x3=_AOcPos_28(x2,x1);
  if(ISTGPRM(x3,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

extern OBJ _AOcPos_31(OBJ x1,OBJ x2) /* <= */
{OBJ r;
 {OBJ x3;
  x3=_AOcPos_28(x1,x2);
  if(ISTGPRM(x3,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

extern OBJ _AOcPos_32(OBJ x1,OBJ x2) /* = */
{OBJ r;
 if(ISPRM(x1)){
  if(ISPRM(x2)){
   r=__ABUILTIN_5;
  }else{
   FREE(x2,1);
   r=__ABUILTIN_3;}
 }else{
  if(ISTGPRD(x1,2)){
   {OBJ x275=FLD(x1,2);OBJ x276=FLD(x1,3);OBJ x277=FLD(x1,4);OBJ x278=FLD(x1,5);
    if(EXPRD(x1,1)){
     DSPRDF(x1);
    }else{
     FRPRD(x1,1);}
    if(ISPRD(x2)&&(ISTGPRD(x2,2))){
     {OBJ x280=FLD(x2,2);OBJ x281=FLD(x2,3);OBJ x282=FLD(x2,4);OBJ x283=FLD(x2,5);
      if(EXPRD(x2,1)){
       DSPRDF(x2);
      }else{
       FRPRD(x2,1);}
      {OBJ x284;
       ANat_76(x275,x280,x284);
       if(ISTGPRM(x284,1)){
	{OBJ x285;
	 ANat_76(x276,x281,x285);
	 if(ISTGPRM(x285,1)){
	  {OBJ x286;
	   ANat_76(x277,x282,x286);
	   if(ISTGPRM(x286,1)){
	    ANat_76(x278,x283,r);
	   }else{
	    r=__ABUILTIN_3;}}
	 }else{
	  r=__ABUILTIN_3;}}
       }else{
	r=__ABUILTIN_3;}}}
    }else{
     FREE(x2,1);
     r=__ABUILTIN_3;}}
  }else{
   {OBJ x288=FLD(x1,2);OBJ x289=FLD(x1,3);
    if(EXPRD(x1,1)){
     DSPRDF(x1);
    }else{
     FRPRD(x1,1);}
    if(ISPRD(x2)&&(ISTGPRD(x2,1))){
     {OBJ x291=FLD(x2,2);OBJ x292=FLD(x2,3);
      if(EXPRD(x2,1)){
       DSPRDF(x2);
      }else{
       FRPRD(x2,1);}
      {OBJ x295;
       ANat_76(x288,x291,x295);
       if(ISTGPRM(x295,1)){
	ANat_76(x289,x292,r);
       }else{
	r=__ABUILTIN_3;}}}
    }else{
     FREE(x2,1);
     r=__ABUILTIN_3;}}}}
 return r;}

extern OBJ _AOcPos_33(OBJ x1,OBJ x2) /* |= */
{OBJ r;
 {OBJ x3;
  x3=_AOcPos_32(x1,x2);
  if(ISTGPRM(x3,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

extern OBJ _AOcPos_34(OBJ x1) /* ` */
{OBJ r;
 if(ISPRM(x1)){
  CPPRD(__AOcPos_64,1);
  r=__AOcPos_64;
 }else{
  if(ISTGPRD(x1,2)){
   {OBJ x161=FLD(x1,2);OBJ x162=FLD(x1,3);OBJ x163=FLD(x1,4);OBJ x164=FLD(x1,5);
    if(EXPRD(x1,1)){
     DSPRDF(x1);
    }else{
     FRPRD(x1,1);}
    {OBJ x165;OBJ x166;OBJ x167;
     ANat_76(x161,x163,x165);
     ANatConv_1(x161,x166);
     ANatConv_1(x162,x167);
     if(ISTGPRM(x165,1)){
      {OBJ x168;
       ANat_76(x162,x164,x168);
       if(ISTGPRM(x168,1)){
	CPPRD(__AOcPos_60,1);
	CPPRD(__AOcPos_61,1);
	CPPRD(__AOcPos_62,1);
	{OBJ x169;OBJ x170;OBJ x171;
	 ADenotation_4(x167,__AOcPos_60,x169);
	 ADenotation_4(__AOcPos_61,x169,x170);
	 ADenotation_4(x166,x170,x171);
	 ADenotation_4(__AOcPos_62,x171,r);}
       }else{
	CPPRD(__AOcPos_60,1);
	CPPRD(__AOcPos_61,1);
	CPPRD(__AOcPos_62,1);
	CPPRD(__AOcPos_63,1);
	{OBJ x172;OBJ x173;OBJ x174;OBJ x175;OBJ x176;OBJ x177;
	 ANatConv_1(x164,x172);
	 ADenotation_4(x172,__AOcPos_60,x173);
	 ADenotation_4(__AOcPos_63,x173,x174);
	 ADenotation_4(x167,x174,x175);
	 ADenotation_4(__AOcPos_61,x175,x176);
	 ADenotation_4(x166,x176,x177);
	 ADenotation_4(__AOcPos_62,x177,r);}}}
     }else{
      CPPRD(__AOcPos_60,1);
      CPPRD(__AOcPos_61,2);
      CPPRD(__AOcPos_62,1);
      CPPRD(__AOcPos_63,1);
      {OBJ x178;OBJ x179;OBJ x180;OBJ x181;OBJ x182;OBJ x183;OBJ x184;OBJ x185;OBJ x186;
       ANatConv_1(x164,x178);
       ANatConv_1(x163,x179);
       ADenotation_4(x178,__AOcPos_60,x180);
       ADenotation_4(__AOcPos_61,x180,x181);
       ADenotation_4(x179,x181,x182);
       ADenotation_4(__AOcPos_63,x182,x183);
       ADenotation_4(x167,x183,x184);
       ADenotation_4(__AOcPos_61,x184,x185);
       ADenotation_4(x166,x185,x186);
       ADenotation_4(__AOcPos_62,x186,r);}}}}
  }else{
   {OBJ x188=FLD(x1,2);OBJ x189=FLD(x1,3);
    if(EXPRD(x1,1)){
     DSPRDF(x1);
    }else{
     FRPRD(x1,1);}
    CPPRD(__AOcPos_60,1);
    CPPRD(__AOcPos_61,1);
    CPPRD(__AOcPos_62,1);
    {OBJ x191;OBJ x192;OBJ x193;OBJ x194;OBJ x195;
     ANatConv_1(x189,x191);
     ANatConv_1(x188,x192);
     ADenotation_4(x191,__AOcPos_60,x193);
     ADenotation_4(__AOcPos_61,x193,x194);
     ADenotation_4(x192,x194,x195);
     ADenotation_4(__AOcPos_62,x195,r);}}}}
 return r;}

extern OBJ _AOcPos_42(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* region */
{OBJ r;
 PRDF(5,2,r);FLD(r,1)=x1;FLD(r,2)=x2;FLD(r,3)=x3;FLD(r,4)=x4;FLD(r,5)=x5;
 return r;}

extern OBJ _AOcPos_48(OBJ x1) /* part */
{OBJ r;
 if(ISPRM(x1)){
  HLT("OcPos at <26,20-23> : undefined selection part\'OcPos:pos->part");
 }else{
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRD(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}}
 return r;}

extern OBJ _AOcPos_49(OBJ x1,OBJ x2,OBJ x3) /* pos */
{OBJ r;
 PRDF(3,1,r);FLD(r,1)=x1;FLD(r,2)=x2;FLD(r,3)=x3;
 return r;}

extern OBJ _AOcPos_50(OBJ x1) /* pos? */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,1))){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AOcPos_56(OBJ x1,OBJ x2) /* max */
{OBJ r;
 if(ISTGPRM(x1,2)){
  if(ISTGPRM(x2,2)){
   r=__AOcPos_2;
  }else{
   r=x2;}
 }else{
  if(ISTGPRM(x2,2)){
   r=x1;
  }else{
   r=x1;}}
 return r;}

extern TUP2 _AOcPos_58(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* min */
{TUP2 r;
 {OBJ x5;
  ANat_80(x1,x3,x5);
  if(ISTGPRM(x5,1)){
   r.c1=x1;r.c2=x2;
  }else{
   {OBJ x6;
    ANat_76(x1,x3,x6);
    if(ISTGPRM(x6,1)){
     {OBJ x7;
      ANat_80(x2,x4,x7);
      if(ISTGPRM(x7,1)){
       r.c1=x1;r.c2=x2;
      }else{
       r.c1=x3;r.c2=x4;}}
    }else{
     {OBJ x8;
      ANat_81(x1,x3,x8);
      if(ISTGPRM(x8,1)){
       r.c1=x3;r.c2=x4;
      }else{
       HLT("OcPos at <91,6-93,25> : missing else in min\'OcPos:nat**nat**nat**nat->nat**nat");}}}}}}
 return r;}
extern OBJ _AOcPos_58_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* min */
{OBJ r;
 {TUP2 t=_AOcPos_58(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern TUP2 _AOcPos_59(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* max,1 */
{TUP2 r;
 {OBJ x5;
  ANat_81(x1,x3,x5);
  if(ISTGPRM(x5,1)){
   r.c1=x1;r.c2=x2;
  }else{
   {OBJ x6;
    ANat_76(x1,x3,x6);
    if(ISTGPRM(x6,1)){
     {OBJ x7;
      ANat_81(x2,x4,x7);
      if(ISTGPRM(x7,1)){
       r.c1=x1;r.c2=x2;
      }else{
       r.c1=x3;r.c2=x4;}}
    }else{
     {OBJ x8;
      ANat_80(x1,x3,x8);
      if(ISTGPRM(x8,1)){
       r.c1=x3;r.c2=x4;
      }else{
       HLT("OcPos at <96,6-98,25> : missing else in max\'OcPos:nat**nat**nat**nat->nat**nat");}}}}}}
 return r;}
extern OBJ _AOcPos_59_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* max,1 */
{OBJ r;
 {TUP2 t=_AOcPos_59(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}








static OBJ _mt_4_0_4(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4);
 return r;}

static OBJ _mt_5_0_5(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4,OBJ t5) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4,t5);
 return r;}

init_AOcPos()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_AChar();
 init_ASeq();
 init_AOption();
 init_ANatConv();
 init_ADenotation();
 init_ASeqReduce();
 init_AInt();
 init_AReal();
 DEN("-",__AOcPos_63);
 CLS(2,_AOcPos_31,__AOcPos_31);
 DEN("<",__AOcPos_62);
 CLS(2,_AOcPos_30,__AOcPos_30);
 DEN(",",__AOcPos_61);
 CLS(2,_AOcPos_29,__AOcPos_29);
 DEN(">",__AOcPos_60);
 CLS(2,_AOcPos_28,__AOcPos_28);
 CLS(1,_AOcPos_27,__AOcPos_27);
 CLS(4,_AOcPos_59_c,__AOcPos_59);
 CLS(1,_AOcPos_26,__AOcPos_26);
 CLS(4,_AOcPos_58_c,__AOcPos_58);
 CLS(1,_AOcPos_25,__AOcPos_25);
 CLS(1,_AOcPos_24,__AOcPos_24);
 CLS(2,_AOcPos_56,__AOcPos_56);
 CLS(1,_AOcPos_23,__AOcPos_23);
 CLS(1,_AOcPos_22,__AOcPos_22);
 CLS(1,_AOcPos_21,__AOcPos_21);
 CLS(1,_AOcPos_20,__AOcPos_20);
 CLS(2,_AOcPos_19,__AOcPos_19);
 CLS(1,_AOcPos_50,__AOcPos_50);
 CLS(1,_AOcPos_18,__AOcPos_18);
 CLS(3,_AOcPos_49,__AOcPos_49);
 CLS(2,_AOcPos_17,__AOcPos_17);
 CLS(1,_AOcPos_48,__AOcPos_48);
 CLS(2,_AOcPos_16,__AOcPos_16);
 CLS(1,_AOcPos_15,__AOcPos_15);
 CLS(2,_AOcPos_14,__AOcPos_14);
 CLS(2,_AOcPos_13,__AOcPos_13);
 CLS(5,_AOcPos_12,__AOcPos_12);
 CLS(2,_AOcPos_11,__AOcPos_11);
 CLS(5,_AOcPos_42,__AOcPos_42);
 CLS(1,_AOcPos_7,__AOcPos_7);
 CLS(1,_AOcPos_5,__AOcPos_5);
 CLS(1,_AOcPos_3,__AOcPos_3);
 CLS(1,_AOcPos_34,__AOcPos_34);
 CLS(2,_AOcPos_33,__AOcPos_33);
 DEN("<unknown>",__AOcPos_64);
 CLS(2,_AOcPos_32,__AOcPos_32);
 MTH(4,0,4,_mt_4_0_4);LZYMTH(4,0,4,_mt_4_0_4);
 MTH(5,0,5,_mt_5_0_5);LZYMTH(5,0,5,_mt_5_0_5);
 PRM(2,__AOcPos_2);
 PRM(1,__AOcPos_4);
 PRM(0,__AOcPos_6);
 PRM1(__AOcPos_9);
 PRDF(3,1,__AOcPos_10);FLD(__AOcPos_10,1)=__AOcPos_2;FLD(__AOcPos_10,2)=__ANat_8;FLD(__AOcPos_10,3)=__ANat_8;
 __AOcPos_35=__AOcPos_9;
 __AOcPos_57=__ANat_15;}

