

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ _AControl_2(OBJ,OBJ,OBJ,OBJ);OBJ __AControl_2; /* cond */
extern OBJ _AControl_3(OBJ,OBJ,OBJ);OBJ __AControl_3; /* while */
extern OBJ _AControl_4(OBJ,OBJ,OBJ);OBJ __AControl_4; /* until */
extern OBJ _AControl_5(OBJ,OBJ,OBJ,OBJ);OBJ __AControl_5; /* for */
extern OBJ _AControl_6(OBJ,OBJ,OBJ);OBJ __AControl_6; /* iter */
extern OBJ _AControl_7(OBJ,OBJ,OBJ);OBJ __AControl_7; /* ^ */

extern OBJ _AControl_2(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* cond */
{OBJ r;
 COPY(x4,1);
 {OBJ x5;
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x4);
  if(ISTGPRM(x5,1)){
   FRCLS(x3,1);
   r=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x4);
  }else{
   FRCLS(x2,1);
   r=(*(OBJ(*)(OBJ,OBJ))METHOD(x3,1))(x3,x4);}}
 return r;}

extern OBJ _AControl_3(register OBJ x1,register OBJ x2,register OBJ x3) /* while */
{OBJ r;
 for(;;){
  CPCLS(x1,1);
  COPY(x3,1);
  {OBJ x4;
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x3);
   if(ISTGPRM(x4,1)){
    CPCLS(x2,1);
    {OBJ x5;
     x5=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x3);
     x3=x5;continue;}
   }else{
    FRCLS(x1,1);
    FRCLS(x2,1);
    r=x3;}}
  break;}
 return r;}

extern OBJ _AControl_4(register OBJ x1,register OBJ x2,register OBJ x3) /* until */
{OBJ r;
 for(;;){
  CPCLS(x1,1);
  CPCLS(x2,1);
  {OBJ x4;OBJ x5;
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x3);
   COPY(x4,1);
   x5=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x4);
   if(ISTGPRM(x5,1)){
    x3=x4;continue;
   }else{
    r=x4;
    FRCLS(x1,1);
    FRCLS(x2,1);}}
  break;}
 return r;}

extern OBJ _AControl_5(register OBJ x1,register OBJ x2,register OBJ x3,register OBJ x4) /* for */
{OBJ r;
 for(;;){
  {OBJ x5;
   ANat_78(x1,x2,x5);
   if(ISTGPRM(x5,1)){
    CPCLS(x3,1);
    {OBJ x6;OBJ x7;
     ANat_2(x1,x6);
     x7=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x3,2))(x3,x1,x4);
     x1=x6;x4=x7;continue;}
   }else{
    FRCLS(x3,1);
    r=x4;}}
  break;}
 return r;}

extern OBJ _AControl_6(register OBJ x1,register OBJ x2,register OBJ x3) /* iter */
{OBJ r;
 for(;;){
  {OBJ x4;
   ANat_3(x1,x4);
   if(ISTGPRM(x4,1)){
    CPCLS(x2,1);
    {OBJ x5;OBJ x6;
     ANat_4(x1,x5);
     x6=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x3);
     x1=x5;x3=x6;continue;}
   }else{
    FRCLS(x2,1);
    r=x3;}}
  break;}
 return r;}

extern OBJ _AControl_7(OBJ x1,OBJ x2,OBJ x3) /* ^ */
{OBJ r;
 r=_AControl_6(x2,x1,x3);
 return r;}

static OBJ _mt_3_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_3_0_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3);
 return r;}

static OBJ _mt_3_2_1(OBJ t,OBJ t1) 
{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))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1);
 return r;}
static OBJ _mt_3_2_1_l(OBJ t,OBJ t1) 
{OBJ r;
 r=(*(OBJ(*)(OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1);
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  DCCLS(t,1);
  FLDCLS(t,1)=NIL;FLDCLS(t,2)=NIL;
  COPY(r,1);LZYCLS(t,r);}
 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_0_4(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4);
 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_AControl()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 CLS(3,_AControl_7,__AControl_7);
 CLS(3,_AControl_6,__AControl_6);
 CLS(4,_AControl_5,__AControl_5);
 CLS(3,_AControl_4,__AControl_4);
 CLS(3,_AControl_3,__AControl_3);
 CLS(4,_AControl_2,__AControl_2);
 MTH(3,0,2,_mt_3_0_2);LZYMTH(3,0,2,_mt_3_0_2);
 MTH(3,0,3,_mt_3_0_3);LZYMTH(3,0,3,_mt_3_0_3);
 MTH(3,2,1,_mt_3_2_1);LZYMTH(3,2,1,_mt_3_2_1_l);
 MTH(4,0,3,_mt_4_0_3);LZYMTH(4,0,3,_mt_4_0_3);
 MTH(4,0,4,_mt_4_0_4);LZYMTH(4,0,4,_mt_4_0_4);
 MTH(4,3,1,_mt_4_3_1);LZYMTH(4,3,1,_mt_4_3_1_l);}

