

#include "BUILTIN.h"
extern OBJ _AMap_31(OBJ,OBJ,OBJ,OBJ);extern OBJ __AMap_31;
extern OBJ _AMap_33(OBJ,OBJ,OBJ);extern OBJ __AMap_33;

#include "Nat.h"
extern OBJ _AMapReduce_6(OBJ,OBJ,OBJ,OBJ);extern OBJ __AMapReduce_6;
extern OBJ __ATree_7;
extern OBJ _AMapCompose_6(OBJ,OBJ,OBJ,OBJ);OBJ __AMapCompose_6; /* o */
extern OBJ _AMapCompose_7(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __AMapCompose_7; /* o'7 */

extern OBJ _AMapCompose_6(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* o */
{OBJ r;
 CPCLS(__AMapCompose_7,1);
 CPCLS(x1,1);
 {OBJ x5;
  x5=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AMapCompose_7,3))(__AMapCompose_7,x1,x2,x4);
  r=_AMapReduce_6(x1,x5,__ATree_7,x3);}
 return r;}

extern OBJ _AMapCompose_7(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5,OBJ x6) /* o'7 */
{OBJ r;
 {OBJ x7;
  x7=_AMap_33(x2,x3,x5);
  if(ISPRM(x7)){
   FRCLS(x1,1);
   FREE(x4,1);
   r=x6;
  }else{
   {OBJ x12=FLD1(x7,1);
    if(EXPRD(x7,1)){
     DSPRDF(x7);
    }else{
     COPY(x12,1);
     FRPRD(x7,1);}
    r=_AMap_31(x1,x4,x12,x6);}}}
 return r;}

static OBJ _mt_6_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_6_0_6(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4,OBJ t5,OBJ t6) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4,t5,t6);
 return r;}

static OBJ _mt_6_3_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{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,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),FLDCLS(t,3),t1,t2,t3);
 return r;}

init_AMapCompose()
{
 static int visited=0; if(visited) return; visited=1;
 init_AMap();
 init_ANat();
 init_AOption();
 init_ASet();
 init_ASeq();
 init_APair();
 init_AMapReduce();
 init_ASetByBST();
 init_ABSTree();
 init_ATree();
 CLS(6,_AMapCompose_7,__AMapCompose_7);
 CLS(4,_AMapCompose_6,__AMapCompose_6);
 MTH(6,0,3,_mt_6_0_3);LZYMTH(6,0,3,_mt_6_0_3);
 MTH(6,0,6,_mt_6_0_6);LZYMTH(6,0,6,_mt_6_0_6);
 MTH(6,3,3,_mt_6_3_3);LZYMTH(6,3,3,_mt_6_3_3);}

