

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ __ANatMap_3;
extern OBJ _ANatMap_4(OBJ,OBJ,OBJ);extern OBJ __ANatMap_4;
extern OBJ _ANatMap_14(OBJ,OBJ);extern OBJ __ANatMap_14;
extern OBJ _ASeqReduce_4(OBJ,OBJ,OBJ);extern OBJ __ASeqReduce_4;

#include "Array.h"
extern OBJ _AInterOpalVars_2(OBJ);OBJ __AInterOpalVars_2; /* vars */
extern OBJ _AInterOpalVars_3(OBJ);OBJ __AInterOpalVars_3; /* maxVar */
extern OBJ _AInterOpalVars_4(OBJ,OBJ);OBJ __AInterOpalVars_4; /* fct */
extern OBJ _AInterOpalVars_5(OBJ,OBJ);OBJ __AInterOpalVars_5; /* locSig */
extern OBJ _AInterOpalVars_6(OBJ);OBJ __AInterOpalVars_6; /* locSig? */
extern OBJ _AInterOpalVars_8(OBJ);OBJ __AInterOpalVars_8; /* vars,1 */
OBJ __AInterOpalVars_9; /* empty */
extern OBJ _AInterOpalVars_12(OBJ,OBJ);OBJ __AInterOpalVars_12; /* vars,2 */
extern OBJ _AInterOpalVars_13(OBJ,OBJ);OBJ __AInterOpalVars_13; /* vars,3 */
extern OBJ _AInterOpalVars_14(OBJ,OBJ);OBJ __AInterOpalVars_14; /* vars,4 */
extern OBJ _AInterOpalVars_15(OBJ,OBJ);OBJ __AInterOpalVars_15; /* vars,5 */
extern OBJ _AInterOpalVars_16(OBJ,OBJ);OBJ __AInterOpalVars_16; /* vars,6 */

extern OBJ _AInterOpalVars_2(OBJ x1) /* vars */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,5))){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    DSPRDF(x1);
   }else{
    COPY(x2,1);
    FRPRD(x1,1);}
   CPPRD(__AInterOpalVars_9,1);
   CPCLS(__AInterOpalVars_12,1);
   {OBJ x3;
    x3=x2;
    r=_ASeqReduce_4(__AInterOpalVars_12,__AInterOpalVars_9,x3);}}
 }else{
  HLT("InterOpal at <unknown> : undefined selection eqns\'InterOpal:impl->seq");}
 return r;}

extern OBJ _AInterOpalVars_3(OBJ x1) /* maxVar */
{OBJ r;
 {OBJ x3=FLD1(x1,2);
  if(EXPRD(x1,1)){
   r=x3;
   FRPRD(FLD1(x1,1),1);DSPRDF(x1);
  }else{
   r=x3;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _AInterOpalVars_4(OBJ x1,OBJ x2) /* fct */
{OBJ r;
 {OBJ x3=FLD1(x2,1);
  if(EXPRD(x2,1)){
   DSPRDF(x2);
  }else{
   CPPRD(x3,1);
   FRPRD(x2,1);}
  {OBJ x5;OBJ x6;
   x5=x3;
   x6=_ANatMap_14(x5,x1);
   {OBJ x10=FLD1(x6,4);
    if(EXPRD(x6,1)){
     r=x10;
     FLD1(x6,4)=NIL;DSPRD(x6);
    }else{
     CPPRD(x10,1);
     r=x10;
     FRPRD(x6,1);}}}}
 return r;}

extern OBJ _AInterOpalVars_5(OBJ x1,OBJ x2) /* locSig */
{OBJ r;
 PRD1(2,r);FLD1(r,1)=x1;FLD1(r,2)=x2;
 return r;}

extern OBJ _AInterOpalVars_6(OBJ x1) /* locSig? */
{OBJ r;
 FRPRD(x1,1);
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AInterOpalVars_8(OBJ x1) /* vars,1 */
{OBJ r;
 {OBJ x2=FLD1(x1,1);
  if(EXPRD(x1,1)){
   r=x2;
   DSPRDF(x1);
  }else{
   CPPRD(x2,1);
   r=x2;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _AInterOpalVars_12(OBJ x1,OBJ x2) /* vars,2 */
{OBJ r;
 {OBJ x15=FLD1(x1,2);OBJ x17=FLD1(x1,4);
  if(EXPRD(x1,1)){
   FLD1(x1,2)=NIL;FLD1(x1,4)=NIL;DSPRD(x1);
  }else{
   CPPRD(x15,1);CPPRD(x17,1);
   FRPRD(x1,1);}
  {OBJ x18;
   x18=_AInterOpalVars_13(x15,x2);
   r=_AInterOpalVars_15(x17,x18);}}
 return r;}

extern OBJ _AInterOpalVars_13(register OBJ x1,register OBJ x2) /* vars,3 */
{OBJ r;
 for(;;){
  if(ISTGPRD(x1,2)){
   {OBJ x73=FLD(x1,2);
    if(EXPRD(x1,1)){
     FREE(FLD(x1,1),1);DSPRDF(x1);
    }else{
     CPPRD(x73,1);
     FRPRD(x1,1);}
    r=_AInterOpalVars_14(x73,x2);}
  }else{
   if(ISTGPRD(x1,3)){
    {OBJ x75=FLD(x1,2);OBJ x76=FLD(x1,3);
     if(EXPRD(x1,1)){
      FREE(FLD(x1,1),1);DSPRDF(x1);
     }else{
      CPPRD(x75,1);CPPRD(x76,1);
      FRPRD(x1,1);}
     {OBJ x77;
      x77=_AInterOpalVars_14(x75,x2);
      x1=x76;x2=x77;continue;}}
   }else{
    if(ISTGPRD(x1,4)){
     {OBJ x79=FLD(x1,2);OBJ x80=FLD(x1,3);
      if(EXPRD(x1,1)){
       FREE(FLD(x1,1),1);DSPRDF(x1);
      }else{
       CPPRD(x79,1);CPPRD(x80,1);
       FRPRD(x1,1);}
      {OBJ x81;
       x81=_AInterOpalVars_13(x79,x2);
       x1=x80;x2=x81;continue;}}
    }else{
     if(ISTGPRD(x1,5)){
      {OBJ x83=FLD(x1,2);
       if(EXPRD(x1,1)){
	FREE(FLD(x1,1),1);DSPRDF(x1);
       }else{
	COPY(x83,1);
	FRPRD(x1,1);}
       CPCLS(__AInterOpalVars_13,1);
       r=_ASeqReduce_4(__AInterOpalVars_13,x2,x83);}
     }else{
      FRPRD(x1,1);
      r=x2;}}}}
  break;}
 return r;}

extern OBJ _AInterOpalVars_14(OBJ x1,OBJ x2) /* vars,4 */
{OBJ r;
 {OBJ x18=FLD1(x1,2);
  {OBJ x30=FLD1(x2,1);OBJ x31=FLD1(x2,2);
   if(EXPRD(x2,1)){
    {OBJ x32;OBJ x33;OBJ x34;
     ANat_81(x18,x31,x32);
     x33=_ANatMap_4(x18,x1,x30);
     if(ISTGPRM(x32,1)){
      x34=x18;
     }else{
      x34=x31;}
     RSOME(x2,r);FLD1(r,1)=x33;FLD1(r,2)=x34;}
   }else{
    CPPRD(x30,1);
    {OBJ x32;OBJ x33;OBJ x34;
     ANat_81(x18,x31,x32);
     x33=_ANatMap_4(x18,x1,x30);
     if(ISTGPRM(x32,1)){
      x34=x18;
     }else{
      x34=x31;}
     FRPRD(x2,1);PRD1(2,r);FLD1(r,1)=x33;FLD1(r,2)=x34;}}}}
 return r;}

extern OBJ _AInterOpalVars_15(register OBJ x1,register OBJ x2) /* vars,5 */
{OBJ r;
 for(;;){
  if(ISTGPRD(x1,2)){
   {OBJ x132=FLD(x1,2);
    if(EXPRD(x1,1)){
     FREE(FLD(x1,1),1);DSPRDF(x1);
    }else{
     COPY(x132,1);
     FRPRD(x1,1);}
    CPCLS(__AInterOpalVars_15,1);
    r=_ASeqReduce_4(__AInterOpalVars_15,x2,x132);}
  }else{
   if(ISTGPRD(x1,3)){
    {OBJ x134=FLD(x1,2);OBJ x135=FLD(x1,3);
     if(EXPRD(x1,1)){
      FREE(FLD(x1,1),1);DSPRDF(x1);
     }else{
      CPPRD(x134,1);CPPRD(x135,1);
      FRPRD(x1,1);}
     {OBJ x136;
      x136=_AInterOpalVars_15(x134,x2);
      x1=x135;x2=x136;continue;}}
   }else{
    if(ISTGPRD(x1,4)){
     {OBJ x138=FLD(x1,2);OBJ x139=FLD(x1,3);
      if(EXPRD(x1,1)){
       FREE(FLD(x1,1),1);DSPRDF(x1);
      }else{
       COPY(x138,1);COPY(x139,1);
       FRPRD(x1,1);}
      CPCLS(__AInterOpalVars_16,1);
      {OBJ x140;
       x140=_ASeqReduce_4(__AInterOpalVars_16,x2,x138);
       if(ISPRM(x139)){
	r=x140;
       }else{
	{OBJ x141=FLD1(x139,1);
	 if(EXPRD(x139,1)){
	  DSPRDF(x139);
	 }else{
	  CPPRD(x141,1);
	  FRPRD(x139,1);}
	 x1=x141;x2=x140;continue;}}}}
    }else{
     if(ISTGPRD(x1,5)){
      {OBJ x143=FLD(x1,2);OBJ x144=FLD(x1,3);
       if(EXPRD(x1,1)){
	FREE(FLD(x1,1),1);DSPRDF(x1);
       }else{
	COPY(x143,1);CPPRD(x144,1);
	FRPRD(x1,1);}
       CPCLS(__AInterOpalVars_14,1);
       {OBJ x145;
	x145=_ASeqReduce_4(__AInterOpalVars_14,x2,x143);
	x1=x144;x2=x145;continue;}}
     }else{
      if(ISTGPRD(x1,6)){
       {OBJ x147=FLD(x1,2);OBJ x148=FLD(x1,3);
	if(EXPRD(x1,1)){
	 FREE(FLD(x1,1),1);DSPRDF(x1);
	}else{
	 COPY(x147,1);CPPRD(x148,1);
	 FRPRD(x1,1);}
	CPCLS(__AInterOpalVars_12,1);
	{OBJ x149;
	 x149=_ASeqReduce_4(__AInterOpalVars_12,x2,x147);
	 x1=x148;x2=x149;continue;}}
      }else{
       FRPRD(x1,1);
       r=x2;}}}}}
  break;}
 return r;}

extern OBJ _AInterOpalVars_16(OBJ x1,OBJ x2) /* vars,6 */
{OBJ r;
 {OBJ x13=FLD1(x1,2);OBJ x14=FLD1(x1,3);
  if(EXPRD(x1,1)){
   FREE(FLD1(x1,1),1);DSPRDF(x1);
  }else{
   CPPRD(x13,1);CPPRD(x14,1);
   FRPRD(x1,1);}
  {OBJ x15;
   x15=_AInterOpalVars_15(x13,x2);
   r=_AInterOpalVars_15(x14,x15);}}
 return r;}


init_AInterOpalVars()
{
 static int visited=0; if(visited) return; visited=1;
 init_AInterOpal();
 init_ANat();
 init_AMap();
 init_AOption();
 init_ASeq();
 init_ADyn();
 init_ASet();
 init_APair();
 init_ANatMap();
 init_ASeqReduce();
 init_ASetByBST();
 init_ABSTree();
 init_ATree();
 init_AArray();
 CLS(2,_AInterOpalVars_16,__AInterOpalVars_16);
 CLS(2,_AInterOpalVars_15,__AInterOpalVars_15);
 CLS(2,_AInterOpalVars_14,__AInterOpalVars_14);
 CLS(2,_AInterOpalVars_13,__AInterOpalVars_13);
 CLS(2,_AInterOpalVars_12,__AInterOpalVars_12);
 CLS(1,_AInterOpalVars_8,__AInterOpalVars_8);
 CLS(1,_AInterOpalVars_6,__AInterOpalVars_6);
 CLS(2,_AInterOpalVars_5,__AInterOpalVars_5);
 CLS(2,_AInterOpalVars_4,__AInterOpalVars_4);
 CLS(1,_AInterOpalVars_3,__AInterOpalVars_3);
 CLS(1,_AInterOpalVars_2,__AInterOpalVars_2);
 CPPRD(__ANatMap_3,1);
 PRD1(2,__AInterOpalVars_9);FLD1(__AInterOpalVars_9,1)=__ANatMap_3;FLD1(__AInterOpalVars_9,2)=__ANat_5;}

