

#include "BUILTIN.h"
extern OBJ __ASeq_6;

#include "Nat.h"

#include "Array.h"

#include "RUNTIMEENV.h"
extern OBJ _ARUNTIMEENV_Adyn(OBJ);OBJ __ARUNTIMEENV_Adyn; /* dyn */
extern OBJ _ARUNTIMEENV_Adyn_(OBJ);OBJ __ARUNTIMEENV_Adyn_; /* dyn? */
extern OBJ _ARUNTIMEENV_Arep(OBJ);OBJ __ARUNTIMEENV_Arep; /* rep */
extern OBJ _ARUNTIMEENV_Acoded(OBJ);OBJ __ARUNTIMEENV_Acoded; /* coded */
extern OBJ _ARUNTIMEENV_Acoded_(OBJ);OBJ __ARUNTIMEENV_Acoded_; /* coded? */
extern OBJ _ARUNTIMEENV_Asymbol(OBJ);OBJ __ARUNTIMEENV_Asymbol; /* symbol */
extern OBJ _ARUNTIMEENV_Aspecial(OBJ);OBJ __ARUNTIMEENV_Aspecial; /* special */
extern OBJ _ARUNTIMEENV_Aspecial_(OBJ);OBJ __ARUNTIMEENV_Aspecial_; /* special? */
extern OBJ _ARUNTIMEENV_Afunc(OBJ);OBJ __ARUNTIMEENV_Afunc; /* func */
OBJ __ARUNTIMEENV_Adefault; /* default */
extern OBJ _ARUNTIMEENV_Adefault_(OBJ);OBJ __ARUNTIMEENV_Adefault_; /* default? */
extern OBJ _ARUNTIMEENV_Aclosure(OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_Aclosure; /* closure */
extern TUP2 _ARUNTIMEENV_Aapply(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_Aapply; /* apply */
extern OBJ _ARUNTIMEENV_Aexec(OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_Aexec; /* exec */
extern OBJ _ARUNTIMEENV_AtopExec(OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_AtopExec; /* topExec */
extern TUP2 _ARUNTIMEENV_Acontents(OBJ);OBJ __ARUNTIMEENV_Acontents; /* contents */
extern OBJ _ARUNTIMEENV_Arank(OBJ);OBJ __ARUNTIMEENV_Arank; /* rank */
extern OBJ _ARUNTIMEENV_AcExec(OBJ,OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_AcExec; /* cExec */
extern OBJ _ARUNTIMEENV_AcTopExec(OBJ,OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_AcTopExec; /* cTopExec */
extern TUP2 _ARUNTIMEENV_Ainternapply(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __ARUNTIMEENV_Ainternapply; /* internapply */

#include "RUNTIMEENV.hc.c"

extern OBJ _ARUNTIMEENV_Adyn(OBJ x1) /* dyn */
{OBJ r;
 PRD(1,1,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ARUNTIMEENV_Adyn_(OBJ x1) /* dyn? */
{OBJ r;
 if(ISTGPRD(x1,1)){
  if(EXPRD(x1,1)){
   FREE(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ARUNTIMEENV_Arep(OBJ x1) /* rep */
{OBJ r;
 if(ISTGPRD(x1,1)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    COPY(x2,1);
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("RUNTIMEENV at <unknown> : undefined selection rep\'RUNTIMEENV:funRepr->repr");}
 return r;}

extern OBJ _ARUNTIMEENV_Acoded(OBJ x1) /* coded */
{OBJ r;
 PRD(1,0,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ARUNTIMEENV_Acoded_(OBJ x1) /* coded? */
{OBJ r;
 if(ISTGPRD(x1,0)){
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  if(EXPRD(x1,1)){
   FREE(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ARUNTIMEENV_Asymbol(OBJ x1) /* symbol */
{OBJ r;
 if(ISTGPRD(x1,0)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    CPPRD(x2,1);
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("RUNTIMEENV at <unknown> : undefined selection symbol\'RUNTIMEENV:funRepr->denotation");}
 return r;}

extern OBJ _ARUNTIMEENV_Aspecial(OBJ x1) /* special */
{OBJ r;
 PRD1(1,r);FLD1(r,1)=x1;
 return r;}

extern OBJ _ARUNTIMEENV_Aspecial_(OBJ x1) /* special? */
{OBJ r;
 if(ISPRM(x1)){
  r=__ABUILTIN_3;
 }else{
  if(EXPRD(x1,1)){
   FRCLS(FLD1(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;}
 return r;}

extern OBJ _ARUNTIMEENV_Afunc(OBJ x1) /* func */
{OBJ r;
 if(ISPRM(x1)){
  HLT("RUNTIMEENV at <unknown> : undefined selection func\'RUNTIMEENV:handler->env**denotation->env");
 }else{
  {OBJ x2=FLD1(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    CPCLS(x2,1);
    r=x2;
    FRPRD(x1,1);}}}
 return r;}

extern OBJ _ARUNTIMEENV_Adefault_(OBJ x1) /* default? */
{OBJ r;
 if(ISPRM(x1)){
  r=__ABUILTIN_5;
 }else{
  if(EXPRD(x1,1)){
   FRCLS(FLD1(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_3;}
 return r;}

extern TUP2 _ARUNTIMEENV_Aapply(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* apply */
{TUP2 r;
 if(ISPRM(x3)){
  FREE(x5,1);
  PRD1(2,r.c1);FLD1(r.c1,1)=x1;FLD1(r.c1,2)=__ASeq_6;
  r.c2=x4;
 }else{
  ARUNTIMEENV_Ainternapply(x1,x2,x3,x4,x5,r.c1,r.c2);}
 return r;}
extern OBJ _ARUNTIMEENV_17_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* apply */
{OBJ r;
 {TUP2 t=_ARUNTIMEENV_17(x1,x2,x3,x4,x5);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _ARUNTIMEENV_Aexec(OBJ x1,OBJ x2,OBJ x3) /* exec */
{OBJ r;
 CPCLS(__ARUNTIMEENV_AcExec,1);
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__ARUNTIMEENV_AcExec,3))(__ARUNTIMEENV_AcExec,x1,x2,x3);
  PRD(2,0,r);FLD(r,1)=x4;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ARUNTIMEENV_AtopExec(OBJ x1,OBJ x2,OBJ x3) /* topExec */
{OBJ r;
 CPCLS(__ARUNTIMEENV_AcTopExec,1);
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__ARUNTIMEENV_AcTopExec,3))(__ARUNTIMEENV_AcTopExec,x1,x2,x3);
  PRD(2,0,r);FLD(r,1)=x4;FLD(r,2)=__ASeq_6;}
 return r;}


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

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

static OBJ _mt_4_3_1(OBJ t,OBJ t1) 
{OBJ r;
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  COPY(FLDCLS(t,1),1);
  COPY(FLDCLS(t,2),1);
  COPY(FLDCLS(t,3),1);
  DCCLS(t,1);}
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),FLDCLS(t,3),t1);
 return r;}
static OBJ _mt_4_3_1_l(OBJ t,OBJ t1) 
{OBJ r;
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),FLDCLS(t,3),t1);
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  DCCLS(t,1);
  FLDCLS(t,1)=NIL;FLDCLS(t,2)=NIL;FLDCLS(t,3)=NIL;
  COPY(r,1);LZYCLS(t,r);}
 return r;}

init_ARUNTIMEENV()
{
 static int visited=0; if(visited) return; visited=1;
 init_ARUNTIME();
 init_ASeq();
 init_ANat();
 init_ACom();
 init_APair();
 init_AVoid();
 init_AOption();
 init_AArray();
 init_ACAST();
 init_ASeqMap();
 CLS(1,_ARUNTIMEENV_21,__ARUNTIMEENV_21);
 CLS(1,_ARUNTIMEENV_20_c,__ARUNTIMEENV_20);
 CLS(3,_ARUNTIMEENV_19,__ARUNTIMEENV_19);
 CLS(3,_ARUNTIMEENV_18,__ARUNTIMEENV_18);
 CLS(5,_ARUNTIMEENV_17_c,__ARUNTIMEENV_17);
 CLS(3,_ARUNTIMEENV_16,__ARUNTIMEENV_16);
 CLS(1,_ARUNTIMEENV_13,__ARUNTIMEENV_13);
 CLS(1,_ARUNTIMEENV_11,__ARUNTIMEENV_11);
 CLS(1,_ARUNTIMEENV_10,__ARUNTIMEENV_10);
 CLS(1,_ARUNTIMEENV_9,__ARUNTIMEENV_9);
 CLS(1,_ARUNTIMEENV_7,__ARUNTIMEENV_7);
 CLS(1,_ARUNTIMEENV_6,__ARUNTIMEENV_6);
 CLS(1,_ARUNTIMEENV_5,__ARUNTIMEENV_5);
 CLS(1,_ARUNTIMEENV_4,__ARUNTIMEENV_4);
 CLS(1,_ARUNTIMEENV_3,__ARUNTIMEENV_3);
 CLS(5,_ARUNTIMEENV_35_c,__ARUNTIMEENV_35);
 CLS(1,_ARUNTIMEENV_2,__ARUNTIMEENV_2);
 CLS(4,_ARUNTIMEENV_34,__ARUNTIMEENV_34);
 CLS(4,_ARUNTIMEENV_33,__ARUNTIMEENV_33);
 MTH(1,0,3,_mt_1_0_3);LZYMTH(1,0,3,_mt_1_0_3);
 MTH(4,0,3,_mt_4_0_3);LZYMTH(4,0,3,_mt_4_0_3);
 MTH(4,3,1,_mt_4_3_1);LZYMTH(4,3,1,_mt_4_3_1_l);
 init_const_ARUNTIMEENV();
 /* __ARUNTIMEENV_Adefault */
 PRM1(__ARUNTIMEENV_Adefault);}

