

#include "BUILTIN.h"

#include "Array.h"
extern TUP2 _ANameGeneration_1(OBJ,OBJ,OBJ);extern OBJ __ANameGeneration_1;
extern TUP2 _AAGSig_11(OBJ,OBJ);extern OBJ __AAGSig_11;
extern OBJ __AInterOpal_78;
extern OBJ _AAnalyzedGlobSig_6(OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_6;
extern TUP2 _ASeqMapEnv_4(OBJ,OBJ,OBJ);extern OBJ __ASeqMapEnv_4;
extern OBJ __ASeq_6;

#include "Nat.h"

#include "Char.h"

#include "Int.h"
extern OBJ _AName4SigAna_4(OBJ,OBJ);extern OBJ __AName4SigAna_4;
extern OBJ _ACAST_3(OBJ);extern OBJ __ACAST_3;

#include "Denotation.h"

#include "Bitset.h"
extern TUP2 _AFctGeneration_1(OBJ,OBJ,OBJ);OBJ __AFctGeneration_1; /* kind2Kind */
extern TUP2 _AFctGeneration_2(OBJ,OBJ,OBJ);OBJ __AFctGeneration_2; /* fct2Fct */
OBJ __AFctGeneration_3; /* fct2Fct'3 */
extern OBJ _AFctGeneration_4(OBJ);OBJ __AFctGeneration_4; /* kind2Kind'4 */
OBJ __AFctGeneration_5; /* kind2Kind'5 */
OBJ __AFctGeneration_6; /* kind2Kind'6 */

extern TUP2 _AFctGeneration_1(OBJ x1,OBJ x2,OBJ x3) /* kind2Kind */
{TUP2 r;
 COPY(x1,1);
 COPY(x3,1);
 {OBJ x4;
  x4=_AName4SigAna_4(x1,x3);
  if(ISTGPRM(x4,1)){
   FREE(x1,1);
   FREE(x3,1);
   r.c1=x2;r.c2=__AInterOpal_78;
  }else{
   COPY(x1,1);
   COPY(x3,1);
   {OBJ x5;
    x5=_AAnalyzedGlobSig_6(x1,x3);
    if(ISTGPRM(x5,1)){
     COPY(x1,1);
     {TUP2 x7;OBJ x13;OBJ x11;OBJ x14;OBJ x15;
      x7=_AAGSig_11(x1,x3);
      if(ISPRM(x7.c2)){
       COPY(x1,1);
       COPY(x7.c1,1);
       x13=__ABUILTIN_3;x11=__ABUILTIN_5;
      }else{
       COPY(x1,1);
       COPY(x7.c1,1);
       x13=__ABUILTIN_5;x11=__ABUILTIN_3;}
      {TUP2 t=_AFctGeneration_2(x1,x2,x7.c1);
       x14=t.c1;
       x15=t.c2;}
      if(ISTGPRM(x11,1)){
       FREE(x1,1);
       FREE(x7.c2,1);
       if(ISPRD(x7.c1)&&(ISTGPRD(x7.c1,4))){
	r.c1=x14;
	if(EXPRD(x7.c1,1)){
	 DSPRDF(x7.c1);
	}else{
	 DCPRD(x7.c1,1);}
	FRPRD(x15,1);
	CPCLS(__AFctGeneration_4,1);
	CPPRD(__AFctGeneration_5,1);
	CPPRD(__AFctGeneration_6,1);
	{OBJ x23;OBJ x24;
	 x23=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFctGeneration_4,1))(__AFctGeneration_4,__ABUILTIN_20);
	 PRD1(2,x24);FLD1(x24,1)=__AFctGeneration_5;FLD1(x24,2)=x23;
	 PRD(2,2,r.c2);FLD(r.c2,1)=__AFctGeneration_6;FLD(r.c2,2)=x24;}
       }else{
	r.c1=x14;
	FREE(x7.c1,1);
	PRD(1,1,r.c2);FLD(r.c2,1)=x15;}
      }else{
       FREE(x7.c1,1);
       FRPRD(x15,1);
       if(ISTGPRM(x13,1)){
	{OBJ x28;
	 if(ISPRM(x7.c2)){
	  HLT("Option at <unknown> : undefined selection cont\'Option:option->data");
	 }else{
	  {OBJ x27=FLD1(x7.c2,1);
	   if(EXPRD(x7.c2,1)){
	    x28=x27;
	    DSPRDF(x7.c2);
	   }else{
	    COPY(x27,1);
	    x28=x27;
	    FRPRD(x7.c2,1);}}}
	 if(ISPRD(x28)&&(ISTGPRD(x28,4))){
	  r.c1=x14;
	  if(EXPRD(x28,1)){
	   DSPRDF(x28);
	  }else{
	   DCPRD(x28,1);}
	  FREE(x1,1);
	  CPCLS(__AFctGeneration_4,1);
	  CPPRD(__AFctGeneration_5,1);
	  CPPRD(__AFctGeneration_6,1);
	  {OBJ x39;OBJ x40;
	   x39=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFctGeneration_4,1))(__AFctGeneration_4,__ABUILTIN_20);
	   PRD1(2,x40);FLD1(x40,1)=__AFctGeneration_5;FLD1(x40,2)=x39;
	   PRD(2,2,r.c2);FLD(r.c2,1)=__AFctGeneration_6;FLD(r.c2,2)=x40;}
	 }else{
	  {
	   PRD(1,1,r.c2);
	   {TUP2 t=_AFctGeneration_2(x1,x14,x28);
	    r.c1=t.c1;
	    FLD(r.c2,1)=t.c2;}}}}
       }else{
	HLT("FctGeneration at <53,23-65,35> : missing else in kind2Kind\'FctGeneration:globSig->envIO**name->envIO**kind");}}}
    }else{
     HLT("FctGeneration at <49,12-65,35> : missing else in kind2Kind\'FctGeneration:globSig->envIO**name->envIO**kind");}}}}
 return r;}
extern OBJ _AFctGeneration_1_c(OBJ x1,OBJ x2,OBJ x3) /* kind2Kind */
{OBJ r;
 {TUP2 t=_AFctGeneration_1(x1,x2,x3);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern TUP2 _AFctGeneration_2(register OBJ x1,register OBJ x2,register OBJ x3) /* fct2Fct */
{TUP2 r;OBJ* p1=&r.c1;OBJ* p2=&r.c2;
 for(;;){
  if(ISPRM(x3)){
   HLT("FctGeneration at <unknown> : missing else in fct2Fct\'FctGeneration:globSig->envIO**fct->envIO**fct");
  }else{
   switch(TGPRD(x3)){
    case 3:case 4:
     if(EXPRD(x3,1)){
      DSPRD(x3);
     }else{
      DCPRD(x3,1);}
     FREE(x1,1);
     CPPRD(__AFctGeneration_3,1);
     *p1=x2;*p2=__AFctGeneration_3;break;
    case 2:
     {OBJ x108=FLD(x3,1);OBJ x109=FLD(x3,2);
      if(EXPRD(x3,1)){
       COPY(x1,1);
       {TUP2 x111;
	x111=_AFctGeneration_2(x1,x2,x108);
	RPRD(x3,*p2);FLD(*p2,1)=x111.c2;
	x2=x111.c1;x3=x109;p2=&FLD(*p2,2);continue;}
      }else{
       COPY(x108,1);COPY(x109,1);
       COPY(x1,1);
       {TUP2 x111;
	x111=_AFctGeneration_2(x1,x2,x108);
	FRPRD(x3,1);PRD(2,2,*p2);FLD(*p2,1)=x111.c2;
	x2=x111.c1;x3=x109;p2=&FLD(*p2,2);continue;}}}break;
    case 0:
     {OBJ x117=FLD(x3,1);
      if(EXPRD(x3,1)){
       {
	RPRD(x3,*p2);
	{TUP2 t=_ANameGeneration_1(x1,x2,x117);
	 *p1=t.c1;
	 FLD(*p2,1)=t.c2;}}
      }else{
       COPY(x117,1);
       {
	FRPRD(x3,1);PRD(1,0,*p2);
	{TUP2 t=_ANameGeneration_1(x1,x2,x117);
	 *p1=t.c1;
	 FLD(*p2,1)=t.c2;}}}}break;
    default: 
     {OBJ x100=FLD(x3,1);
      if(EXPRD(x3,1)){
       CPCLS(__AFctGeneration_2,1);
       {OBJ x101;
	x101=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFctGeneration_2,1))(__AFctGeneration_2,x1);
	RPRD(x3,*p2);
	{TUP2 t=_ASeqMapEnv_4(x101,x2,x100);
	 *p1=t.c1;
	 FLD(*p2,1)=t.c2;}}
      }else{
       COPY(x100,1);
       CPCLS(__AFctGeneration_2,1);
       {OBJ x101;
	x101=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFctGeneration_2,1))(__AFctGeneration_2,x1);
	FRPRD(x3,1);PRD(1,1,*p2);
	{TUP2 t=_ASeqMapEnv_4(x101,x2,x100);
	 *p1=t.c1;
	 FLD(*p2,1)=t.c2;}}}}}}
  break;}
 return r;}
extern OBJ _AFctGeneration_2_c(OBJ x1,OBJ x2,OBJ x3) /* fct2Fct */
{OBJ r;
 {TUP2 t=_AFctGeneration_2(x1,x2,x3);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AFctGeneration_4(OBJ x1) /* kind2Kind'4 */
{OBJ r;
 r=_ACAST_3(__ABUILTIN_5);
 return r;}


init_AFctGeneration()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANatMap();
 init_AString();
 init_AArray();
 init_APartName();
 init_AEnvIO();
 init_ANameGeneration();
 init_AFct();
 init_AAGSig();
 init_AGlobSig();
 init_ABaseGeneration();
 init_AInterOpal();
 init_AAnalyzedGlobSig();
 init_AName();
 init_ASeqMapEnv();
 init_AObjects();
 init_ADynConv();
 init_ASeq();
 init_AOcError();
 init_ANat();
 init_ACom();
 init_AOption();
 init_AVoid();
 init_AOcPos();
 init_AOcOptions();
 init_AChar();
 init_AStream();
 init_AMap();
 init_AFile();
 init_ADyn();
 init_AInt();
 init_ASet();
 init_ATree();
 init_APair();
 init_ASetByBST();
 init_ATable();
 init_ABSTree();
 init_AUniqueTable();
 init_AAbsyFun3();
 init_ADeclEntry();
 init_AAnalyzedGlobSigH();
 init_APartNameEntry();
 init_AGlobSigToText();
 init_AImpExpEntry();
 init_AImpDecl4SigAna();
 init_AGlobSigImpl();
 init_AMySeqFun1();
 init_ARep();
 init_AName4SigAna();
 init_APragma();
 init_ACAST();
 init_AImpl();
 init_ADenotation();
 init_AGlobPragma();
 init_ABitset();
 init_APatterns();
 init_AAttributes();
 init_ADArray();
 DEN("any",__AFctGeneration_6);
 DEN("bool",__AFctGeneration_5);
 LCLS(1,_AFctGeneration_4,__AFctGeneration_4);
 CLS(3,_AFctGeneration_2_c,__AFctGeneration_2);
 CLS(3,_AFctGeneration_1_c,__AFctGeneration_1);
 PRDF(1,1,__AFctGeneration_3);FLD(__AFctGeneration_3,1)=__ASeq_6;}

