

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ __ASeq_6;
extern OBJ _ACom_47(OBJ,OBJ);extern OBJ __ACom_47;

#include "Denotation.h"
extern OBJ _AComCompose_5(OBJ,OBJ);extern OBJ __AComCompose_5;
extern OBJ _AEQUALITY_2(OBJ,OBJ);extern OBJ __AEQUALITY_2;

#include "Char.h"

#include "Int.h"

#include "Env.h"

#define __AEnv_AgetNextArg_L13 __AEnv_13
#define _AEnv_AgetNextArg_L13 _AEnv_13
#define AEnv_13 AEnv_AgetNextArg_L13
extern OBJ __AEnv_AgetNextArg_L13;
extern OBJ _AEnv_AgetNextArg_L13(OBJ,OBJ,OBJ);

#define __AEnv_Aargs_L14 __AEnv_14
#define _AEnv_Aargs_L14 _AEnv_14
#define AEnv_14 AEnv_Aargs_L14
extern OBJ __AEnv_Aargs_L14;
extern OBJ _AEnv_Aargs_L14(OBJ);
OBJ __AEnv_AargCount; /* argCount */
extern OBJ _AEnv_Aarg(OBJ);OBJ __AEnv_Aarg; /* arg */
extern OBJ _AEnv_AnoSuchArg_(OBJ);OBJ __AEnv_AnoSuchArg_; /* noSuchArg? */
OBJ __AEnv_Aargs; /* args */
extern OBJ _AEnv_Aenv(OBJ);OBJ __AEnv_Aenv; /* env */
extern OBJ _AEnv_AnoSuchEnvVar_(OBJ);OBJ __AEnv_AnoSuchEnvVar_; /* noSuchEnvVar? */
extern OBJ _AEnv_AxargCount(OBJ);OBJ __AEnv_AxargCount; /* xargCount */
extern OBJ _AEnv_Axarg(OBJ,OBJ);OBJ __AEnv_Axarg; /* xarg */
OBJ __AEnv_AnoSuchArg; /* noSuchArg */
extern OBJ _AEnv_AgetNextArg(OBJ,OBJ);OBJ __AEnv_AgetNextArg; /* getNextArg */
extern OBJ _AEnv_Axenv(OBJ,OBJ);OBJ __AEnv_Axenv; /* xenv */
OBJ __AEnv_AnoSuchEnvVar; /* noSuchEnvVar */
extern OBJ _AEnv_AgetNextArg_L13(OBJ,OBJ,OBJ);OBJ __AEnv_AgetNextArg_L13; /* getNextArg'13 */
extern OBJ _AEnv_Aargs_L14(OBJ);OBJ __AEnv_Aargs_L14; /* args'14 */
OBJ __AEnv_AnoSuchArg_L15; /* noSuchArg'15 */
OBJ __AEnv_AnoSuchEnvVar_L16; /* noSuchEnvVar'16 */

#include "Env.hc.c"

extern OBJ _AEnv_Aarg(OBJ x1) /* arg */
{OBJ r;
 CPCLS(__AEnv_Axarg,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AEnv_Axarg,1))(__AEnv_Axarg,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AEnv_AnoSuchArg_(OBJ x1) /* noSuchArg? */
{OBJ r;
 CPPRD(__AEnv_AnoSuchArg,1);
 r=_AEQUALITY_2(x1,__AEnv_AnoSuchArg);
 return r;}

extern OBJ _AEnv_Aenv(OBJ x1) /* env */
{OBJ r;
 CPCLS(__AEnv_Axenv,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AEnv_Axenv,1))(__AEnv_Axenv,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AEnv_AnoSuchEnvVar_(OBJ x1) /* noSuchEnvVar? */
{OBJ r;
 CPPRD(__AEnv_AnoSuchEnvVar,1);
 r=_AEQUALITY_2(x1,__AEnv_AnoSuchEnvVar);
 return r;}

extern OBJ _AEnv_AgetNextArg(OBJ x1,OBJ x2) /* getNextArg */
{OBJ r;
 {OBJ x3;
  ANat_6(x2,x3);
  if(ISTGPRM(x3,1)){
   CPCLS(__ACom_47,1);
   {OBJ x4;OBJ x5;
    PRD(1,0,x4);FLD(x4,1)=x1;
    x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x4);
    PRD(2,0,r);FLD(r,1)=x5;FLD(r,2)=__ASeq_6;}
  }else{
   {OBJ x6;
    ANat_3(x2,x6);
    if(ISTGPRM(x6,1)){
     CPCLS(__AEnv_Axarg,1);
     CPCLS(__AEnv_AgetNextArg_L13,1);
     {OBJ x7;OBJ x8;OBJ x9;OBJ x10;
      ANat_4(x2,x7);
      x8=(*(OBJ(*)(OBJ,OBJ))METHOD(__AEnv_Axarg,1))(__AEnv_Axarg,x7);
      PRD(2,0,x9);FLD(x9,1)=x8;FLD(x9,2)=__ASeq_6;
      x10=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AEnv_AgetNextArg_L13,2))(__AEnv_AgetNextArg_L13,x1,x7);
      r=_AComCompose_5(x9,x10);}
    }else{
     HLT("Env at <29,5-14> : missing else in getNextArg\'Env:seq**nat->com");}}}}
 return r;}

extern OBJ _AEnv_AgetNextArg_L13(OBJ x1,OBJ x2,OBJ x3) /* getNextArg'13 */
{OBJ r;
 {OBJ x4;
  PRD1(2,x4);FLD1(x4,1)=x3;FLD1(x4,2)=x1;
  AEnv_AgetNextArg(x4,x2,r);}
 return r;}

extern OBJ _AEnv_Aargs_L14(OBJ x1) /* args'14 */
{OBJ r;
 AEnv_AgetNextArg(__ASeq_6,x1,r);
 return r;}





init_AEnv()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_ASeq();
 init_ACom();
 init_AVoid();
 init_AOption();
 init_ADenotation();
 init_AComCompose();
 init_AEQUALITY();
 init_AChar();
 init_ASeqMap();
 init_AInt();
 DEN("no such environment variable",__AEnv_16);
 DEN("no such argument",__AEnv_15);
 CLS(1,_AEnv_14,__AEnv_14);
 CLS(3,_AEnv_13,__AEnv_13);
 CLS(2,_AEnv_11,__AEnv_11);
 CLS(2,_AEnv_10,__AEnv_10);
 CLS(2,_AEnv_8,__AEnv_8);
 CLS(1,_AEnv_7,__AEnv_7);
 CLS(1,_AEnv_6,__AEnv_6);
 CLS(1,_AEnv_5,__AEnv_5);
 CLS(1,_AEnv_3,__AEnv_3);
 CLS(1,_AEnv_2,__AEnv_2);
 init_const_AEnv();
 /* __AEnv_AargCount */
 CPCLS(__AEnv_AxargCount,1);
 PRD(2,0,__AEnv_AargCount);FLD(__AEnv_AargCount,1)=__AEnv_AxargCount;FLD(__AEnv_AargCount,2)=__ASeq_6;
 /* __AEnv_Aargs */
 CPPRD(__AEnv_AargCount,1);
 CPCLS(__AEnv_Aargs_L14,1);
 __AEnv_Aargs=_AComCompose_5(__AEnv_AargCount,__AEnv_Aargs_L14);
 /* __AEnv_AnoSuchArg */
 CPPRD(__AEnv_AnoSuchArg_L15,1);
 PRD(1,1,__AEnv_AnoSuchArg);FLD(__AEnv_AnoSuchArg,1)=__AEnv_AnoSuchArg_L15;
 /* __AEnv_AnoSuchEnvVar */
 CPPRD(__AEnv_AnoSuchEnvVar_L16,1);
 PRD(1,1,__AEnv_AnoSuchEnvVar);FLD(__AEnv_AnoSuchEnvVar,1)=__AEnv_AnoSuchEnvVar_L16;}

