

#include "BUILTIN.h"
extern OBJ __AInterOpal_27;
extern OBJ __AInterOpal_191;
extern OBJ __AInterOpal_193;
extern OBJ _AInterOpal_314(OBJ,OBJ);extern OBJ __AInterOpal_314;
extern OBJ _AAnalyzedGlobSig_2(OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_2;
extern OBJ _AAnalyzedGlobSig_8(OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_8;
extern OBJ _AAnalyzedGlobSig_12(OBJ);extern OBJ __AAnalyzedGlobSig_12;
extern OBJ _AAnalyzedGlobSig_66(OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_66;

#include "Array.h"

#include "Nat.h"
extern OBJ __ASeq_6;
extern OBJ _AAGSig_5(OBJ,OBJ);extern OBJ __AAGSig_5;
extern OBJ _AAGSig_9(OBJ,OBJ);extern OBJ __AAGSig_9;
extern OBJ _AAGSig_13(OBJ,OBJ);extern OBJ __AAGSig_13;
extern TUP2 _ANameGeneration_1(OBJ,OBJ,OBJ);extern OBJ __ANameGeneration_1;
extern OBJ _ABaseGeneration_7(OBJ,OBJ,OBJ);extern OBJ __ABaseGeneration_7;
extern OBJ _ABaseGeneration_10(OBJ,OBJ);extern OBJ __ABaseGeneration_10;
extern OBJ _ABaseGeneration_17(OBJ,OBJ);extern OBJ __ABaseGeneration_17;
extern OBJ _ABaseGeneration_18(OBJ,OBJ,OBJ);extern OBJ __ABaseGeneration_18;
extern TUP2 _AFctGeneration_1(OBJ,OBJ,OBJ);extern OBJ __AFctGeneration_1;
extern TUP2 _AExprGeneration_1(OBJ,OBJ,OBJ,OBJ);extern OBJ __AExprGeneration_1;

#include "Char.h"
extern TUP2 _ASeqMapEnv_4(OBJ,OBJ,OBJ);extern OBJ __ASeqMapEnv_4;

#include "Denotation.h"
extern OBJ _ARep_119(OBJ);extern OBJ __ARep_119;

#include "Bitset.h"
extern OBJ _ASeqFilter_2(OBJ,OBJ);extern OBJ __ASeqFilter_2;
extern OBJ _AMap_16(OBJ,OBJ,OBJ);extern OBJ __AMap_16;

#include "Int.h"
extern TUP2 _AImplGeneration_1(OBJ,OBJ,OBJ,OBJ);OBJ __AImplGeneration_1; /* impl2Impl */
extern TUP2 _AImplGeneration_2(OBJ,OBJ,OBJ,OBJ);OBJ __AImplGeneration_2; /* variant2Variant */
extern TUP2 _AImplGeneration_5(OBJ,OBJ,OBJ,OBJ);OBJ __AImplGeneration_5; /* comp2Comp */
extern OBJ _AImplGeneration_6(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __AImplGeneration_6; /* mkInducedObj */
extern OBJ _AImplGeneration_7(OBJ,OBJ);OBJ __AImplGeneration_7; /* impl2Impl'7 */

extern TUP2 _AImplGeneration_1(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* impl2Impl */
{TUP2 r;
 if(ISPRD(x4)&&(ISTGPRD(x4,2))){
  if(EXPRD(x4,1)){
   FREE(FLD(x4,1),1);DSPRDF(x4);
  }else{
   DCPRD(x4,1);}
  FREE(x1,1);
  FREE(x2,1);
  r.c1=x3;r.c2=__AInterOpal_193;
 }else{
  if(ISPRD(x4)&&(ISTGPRD(x4,3))){
   {OBJ x267=FLD(x4,1);FLAG x_x4=EXPRD(x4,1);
    if(x_x4){
    }else{
     CPPRD(x267,1);}
    FREE(x2,1);
    {OBJ x268=FLD1(x267,1);OBJ x269=FLD1(x267,2);
     if(EXPRD(x267,1)){
      FREE(FLD1(x267,3),1);DSPRDF(x267);
     }else{
      COPY(x268,1);COPY(x269,1);
      FRPRD(x267,1);}
     COPY(x1,1);
     CPCLS(__AImplGeneration_2,1);
     CPCLS(__AImplGeneration_7,1);
     {OBJ x271;OBJ x272;OBJ x273;
      x271=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AImplGeneration_2,2))(__AImplGeneration_2,x1,x268);
      x272=(*(OBJ(*)(OBJ,OBJ))METHOD(__AImplGeneration_7,1))(__AImplGeneration_7,x1);
      x273=_ASeqFilter_2(x272,x269);
      if(x_x4){
       RPRD(x4,r.c2);CHGTG(r.c2,4);
      }else{
       FRPRD(x4,1);PRD(1,4,r.c2);}
      {TUP2 t=_ASeqMapEnv_4(x271,x3,x273);
       r.c1=t.c1;
       FLD(r.c2,1)=t.c2;}}}}
  }else{
   if(ISPRD(x4)&&(ISTGPRD(x4,5))){
    {OBJ x279=FLD(x4,2);OBJ x282=FLD(x4,5);
     if(EXPRD(x4,1)){
      FLD(x4,2)=NIL;FLD(x4,5)=NIL;DSPRD(x4);
     }else{
      CPPRD(x279,1);CPPRD(x282,1);
      FRPRD(x4,1);}
     FREE(x2,1);
     {OBJ x283;TUP2 x286;OBJ x287;
      PRD1(2,x283);FLD1(x283,1)=x282;FLD1(x283,2)=__ASeq_6;
      x286=_AExprGeneration_1(x1,x279,x3,x283);r.c1=x286.c1;
      PRD1(2,x287);FLD1(x287,1)=x286.c2;FLD1(x287,2)=__ASeq_6;
      PRD(1,5,r.c2);FLD(r.c2,1)=x287;}}
   }else{
    {OBJ x289=FLD1(x3,1);
     CPPRD(x289,1);
     {OBJ x291;
      if(ISPRM(x4)&&(ISTGPRM(x4,0))){
       x291=__ABUILTIN_5;
      }else{
       x291=__ABUILTIN_3;}
      {OBJ x292=FLD1(x289,1);
       if(EXPRD(x289,1)){
	FREE(FLD1(x289,2),1);DSPRDF(x289);
       }else{
	DCPRD(x289,1);}
       if(ISTGPRM(x291,1)){
	FREE(x4,1);
	if(ISPRD(x2)&&(ISTGPRD(x2,1))){
	 if(EXPRD(x2,1)){
	  DSPRDF(x2);
	 }else{
	  DCPRD(x2,1);}
	 FREE(x1,1);
	 r.c1=x3;r.c2=__AInterOpal_193;
	}else{
	 COPY(x2,1);
	 {OBJ x295;
	  x295=_AAnalyzedGlobSig_12(x2);
	  if(ISTGPRM(x295,1)){
	   COPY(x1,1);
	   COPY(x2,1);
	   {OBJ x296;
	    x296=_AAGSig_9(x1,x2);
	    if(ISTGPRM(x296,1)){
	     COPY(x1,1);
	     COPY(x2,1);
	     {OBJ x297;OBJ x298;OBJ x301;OBJ x302;
	      x297=_AAGSig_5(x1,x2);
	      x298=_ABaseGeneration_18(x1,x2,x292);
	      if(ISPRM(x298)){
	       HLT("Seq at <unknown> : undefined selection ft\'Seq:seq->data");
	      }else{
	       {OBJ x299=FLD1(x298,1);
		if(EXPRD(x298,1)){
		 x301=x299;
		 FREE(FLD1(x298,2),1);DSPRDF(x298);
		}else{
		 COPY(x299,1);
		 x301=x299;
		 FRPRD(x298,1);}}}
	      PRD(2,2,r.c2);FLD(r.c2,1)=x301;FLD(r.c2,2)=x297;
	      r.c1=x3;}
	    }else{
	     FREE(x1,1);
	     FREE(x2,1);
	     r.c1=x3;r.c2=__AInterOpal_191;}}
	  }else{
	   HLT("ImplGeneration at <65,12-71,33> : missing else in impl2Impl\'ImplGeneration:globSig**name->envIO**impl->envIO**impl");}}}
       }else{
	{OBJ x304;OBJ x303;OBJ x305;OBJ x308;
	 if(ISPRM(x4)&&(ISTGPRM(x4,1))){
	  COPY(x1,1);
	  COPY(x2,1);
	  x304=__ABUILTIN_5;
	 }else{
	  FREE(x4,1);
	  COPY(x1,1);
	  COPY(x2,1);
	  x304=__ABUILTIN_3;}
	 x303=_AAnalyzedGlobSig_66(x1,x2);
	 x305=_ABaseGeneration_18(x1,x2,x292);
	 if(ISPRM(x305)){
	  HLT("Seq at <unknown> : undefined selection ft\'Seq:seq->data");
	 }else{
	  {OBJ x306=FLD1(x305,1);
	   if(EXPRD(x305,1)){
	    x308=x306;
	    FREE(FLD1(x305,2),1);DSPRDF(x305);
	   }else{
	    COPY(x306,1);
	    x308=x306;
	    FRPRD(x305,1);}}}
	 if(ISTGPRM(x304,1)){
	  PRD(2,2,r.c2);FLD(r.c2,1)=x308;FLD(r.c2,2)=x303;
	  r.c1=x3;
	 }else{
	  HLT("ImplGeneration at <79,12-80,28> : missing else in impl2Impl\'ImplGeneration:globSig**name->envIO**impl->envIO**impl");}}}}}}}}}
 return r;}
extern OBJ _AImplGeneration_1_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* impl2Impl */
{OBJ r;
 {TUP2 t=_AImplGeneration_1(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern TUP2 _AImplGeneration_2(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* variant2Variant */
{TUP2 r;
 CPCLS(__AImplGeneration_5,1);
 COPY(x1,1);
 COPY(x2,1);
 {OBJ x31;
  x31=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AImplGeneration_5,2))(__AImplGeneration_5,x1,x2);
  {OBJ x65=FLD1(x3,1);
   CPPRD(x65,1);
   {OBJ x102=FLD1(x4,1);OBJ x103=FLD1(x4,2);OBJ x104=FLD1(x4,3);OBJ x105=FLD1(x4,4);FLAG x_x4=EXPRD(x4,1);
    if(x_x4){
    }else{
     COPY(x102,1);COPY(x103,1);COPY(x104,1);COPY(x105,1);}
    {OBJ x107=FLD1(x65,1);
     if(EXPRD(x65,1)){
      FREE(FLD1(x65,2),1);DSPRDF(x65);
     }else{
      DCPRD(x65,1);}
     COPY(x1,3);
     COPY(x2,1);
     COPY(x102,1);
     COPY(x103,1);
     {OBJ x109;TUP2 x110;TUP2 x113;OBJ x115;OBJ x116;
      x109=_ABaseGeneration_17(x105,x107);
      COPY(x109,2);
      x110=_ANameGeneration_1(x1,x3,x102);
      CPPRD(x110.c2,1);
      x113=_ANameGeneration_1(x1,x110.c1,x103);
      CPPRD(x113.c2,1);
      x115=_AImplGeneration_6(x1,x2,x113.c1,x103,x109,x113.c2);
      x116=_AImplGeneration_6(x1,x2,x115,x102,x109,x110.c2);
      if(x_x4){
       RSOME(x4,r.c2);FLD1(r.c2,1)=x109;FLD1(r.c2,2)=x110.c2;FLD1(r.c2,3)=x113.c2;
      }else{
       FRPRD(x4,1);PRD1(4,r.c2);FLD1(r.c2,1)=x109;FLD1(r.c2,2)=x110.c2;FLD1(r.c2,3)=x113.c2;}
      {TUP2 t=_ASeqMapEnv_4(x31,x116,x104);
       r.c1=t.c1;
       FLD1(r.c2,4)=t.c2;}}}}}}
 return r;}
extern OBJ _AImplGeneration_2_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* variant2Variant */
{OBJ r;
 {TUP2 t=_AImplGeneration_2(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern TUP2 _AImplGeneration_5(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* comp2Comp */
{TUP2 r;
 {OBJ x42=FLD1(x3,1);
  CPPRD(x42,1);
  {OBJ x64=FLD1(x4,1);OBJ x66=FLD1(x4,3);
   if(EXPRD(x4,1)){
    FREE(FLD1(x4,2),1);DSPRDF(x4);
   }else{
    COPY(x64,1);COPY(x66,1);
    FRPRD(x4,1);}
   {OBJ x68=FLD1(x42,1);
    COPY(x1,1);
    COPY(x64,1);
    {OBJ x70;TUP2 x71;
     x70=_ABaseGeneration_17(x66,x68);
     COPY(x70,1);
     x71=_ANameGeneration_1(x1,x3,x64);
     CPPRD(x71.c2,1);
     if(EXPRD(x42,1)){
      RSOME(x42,r.c2);FLD1(r.c2,1)=x70;FREE(FLD1(r.c2,2),1);FLD1(r.c2,2)=x71.c2;
     }else{
      DCPRD(x42,1);PRD1(2,r.c2);FLD1(r.c2,1)=x70;FLD1(r.c2,2)=x71.c2;}
     r.c1=_AImplGeneration_6(x1,x2,x71.c1,x64,x70,x71.c2);}}}}
 return r;}
extern OBJ _AImplGeneration_5_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* comp2Comp */
{OBJ r;
 {TUP2 t=_AImplGeneration_5(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AImplGeneration_6(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5,OBJ x6) /* mkInducedObj */
{OBJ r;
 COPY(x1,2);
 COPY(x4,2);
 COPY(x5,1);
 {OBJ x7;OBJ x9;OBJ x14;
  x7=_AAnalyzedGlobSig_8(x1,x4);
  x9=_AAnalyzedGlobSig_2(x1,x4);
  PRD1(2,x14);FLD1(x14,1)=x5;FLD1(x14,2)=__ASeq_6;
  {OBJ x10=FLD1(x6,1);
   if(EXPRD(x6,1)){
    DSPRD(x6);
   }else{
    FRPRD(x6,1);}
   {OBJ x13;OBJ x15;OBJ x16;OBJ x17;OBJ x18;OBJ x19;OBJ x21;OBJ x22;OBJ x26;
    x13=x10;
    ANat_76(x7,__ANat_5,x15);
    x16=_ARep_119(x9);
    if(ISTGPRM(x15,1)){
     COPY(x1,1);
     x17=__AInterOpal_27;
    }else{
     COPY(x1,1);
     PRD1F(1,x17);FLD1(x17,1)=x7;}
    {TUP2 t=_AFctGeneration_1(x1,x3,x4);
     x18=t.c1;
     x19=t.c2;}
    {TUP2 t=_ANameGeneration_1(x1,x18,x2);
     x21=t.c1;
     x22=t.c2;}
    PRD(2,3,x26);FLD(x26,1)=x5;FLD(x26,2)=x22;
    {OBJ x37=FLD1(x21,1);OBJ x38=FLD1(x21,2);FLAG x_x21=EXPRD(x21,1);
     if(x_x21){
     }else{
      CPPRD(x37,1);COPY(x38,1);}
     {OBJ x40=FLD1(x37,2);
      COPY(x40,1);
      COPY(x17,1);
      CPCLS(__AInterOpal_314,1);
      {OBJ x41;OBJ x42;OBJ x43;
       PRD1(7,x41);FLD1(x41,1)=x14;FLD1(x41,2)=x13;FLD1(x41,3)=x16;FLD1(x41,4)=x19;FLD1(x41,5)=x26;FLD1(x41,6)=__ASeq_6;FLD1(x41,7)=__ASeq_6;
       x42=_AMap_16(__AInterOpal_314,x40,x17);
       x43=_ABaseGeneration_10(x41,x42);
       if(x_x21){
	RSOME(x21,r);
       }else{
	FRPRD(x21,1);PRD1(2,r);FLD1(r,2)=x38;}
       FLD1(r,1)=_ABaseGeneration_7(x17,x43,x37);}}}}}}
 return r;}

extern OBJ _AImplGeneration_7(OBJ x1,OBJ x2) /* impl2Impl'7 */
{OBJ r;
 {OBJ x3=FLD1(x2,1);
  if(EXPRD(x2,1)){
   FLD1(x2,1)=NIL;DSPRD(x2);
  }else{
   COPY(x3,1);
   FRPRD(x2,1);}
  {OBJ x7;
   x7=x3;
   r=_AAGSig_13(x1,x7);}}
 return r;}

static OBJ _mt_6_0_2(OBJ t,OBJ t1,OBJ t2) 
{OBJ r;
 DPCLS(t,r);
 INCCLS(r,0,2);
 FLDCLS(r,1)=t1;
 FLDCLS(r,2)=t2;
 return r;}

static OBJ _mt_6_2_4(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4) 
{OBJ r;
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  COPY(FLDCLS(t,1),1);
  COPY(FLDCLS(t,2),1);
  DCCLS(t,1);}
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1,t2,t3,t4);
 return r;}

init_AImplGeneration()
{
 static int visited=0; if(visited) return; visited=1;
 init_ASeqReduce();
 init_ATable();
 init_ALexem();
 init_AUniqueTable();
 init_ADeclEntry();
 init_APartNameEntry();
 init_AInterOpal();
 init_AImpExpEntry();
 init_AEnvIO();
 init_APragma();
 init_AGlobSig();
 init_AAttributes();
 init_AAnalyzedGlobSig();
 init_ADArray();
 init_AImpl();
 init_ANatMap();
 init_AName();
 init_AArray();
 init_ANat();
 init_APartName();
 init_ASeq();
 init_ADyn();
 init_AGlobSigImpl();
 init_AAGSig();
 init_AOption();
 init_ANameGeneration();
 init_AObjects();
 init_ABaseGeneration();
 init_AFct();
 init_AFctGeneration();
 init_AOcPos();
 init_AExprGeneration();
 init_AChar();
 init_ASeqMapEnv();
 init_APair();
 init_ADenotation();
 init_ARep();
 init_ASeqMap();
 init_ABitset();
 init_ASeqFilter();
 init_AGlobPragma();
 init_ASeqZip();
 init_APatterns();
 init_ASetByBST();
 init_AMap();
 init_ABSTree();
 init_AOcError();
 init_ATree();
 init_ACom();
 init_AAbsyFun3();
 init_AVoid();
 init_AAnalyzedGlobSigH();
 init_AString();
 init_AGlobSigToText();
 init_AOcOptions();
 init_AImpDecl4SigAna();
 init_AStream();
 init_AMySeqFun1();
 init_AFile();
 init_AName4SigAna();
 init_AInt();
 init_ADArrayReduce();
 init_ASet();
 CLS(2,_AImplGeneration_7,__AImplGeneration_7);
 CLS(6,_AImplGeneration_6,__AImplGeneration_6);
 CLS(4,_AImplGeneration_5_c,__AImplGeneration_5);
 CLS(4,_AImplGeneration_2_c,__AImplGeneration_2);
 CLS(4,_AImplGeneration_1_c,__AImplGeneration_1);
 MTH(6,0,2,_mt_6_0_2);LZYMTH(6,0,2,_mt_6_0_2);
 MTH(6,2,4,_mt_6_2_4);LZYMTH(6,2,4,_mt_6_2_4);}

