

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ _ABagConv_6(OBJ,OBJ);extern OBJ __ABagConv_6;
extern OBJ _ASeqMap_3(OBJ,OBJ);extern OBJ __ASeqMap_3;

#include "Char.h"
extern OBJ _ABagMap_5(OBJ,OBJ,OBJ,OBJ);OBJ __ABagMap_5; /* * */
extern OBJ _ABagMap_6(OBJ,OBJ);OBJ __ABagMap_6; /* *'6 */

extern OBJ _ABagMap_5(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* * */
{OBJ r;
 CPCLS(__ABagMap_6,1);
 FRCLS(x1,1);
 {OBJ x5;OBJ x6;
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__ABagMap_6,1))(__ABagMap_6,x3);
  x6=_ASeqMap_3(x5,x4);
  r=_ABagConv_6(x2,x6);}
 return r;}

extern OBJ _ABagMap_6(OBJ x1,OBJ x2) /* *'6 */
{OBJ r;
 {OBJ x10=FLD1(x2,1);OBJ x11;
  if(EXPRD(x2,1)){
   {OBJ x12;
    x12=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x10);
    RSOME(x2,r);FLD1(r,1)=x12;}
  }else{
   x11=FLD1(x2,2);COPY(x10,1);
   {OBJ x12;
    x12=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x10);
    FRPRD(x2,1);PRD1(2,r);FLD1(r,1)=x12;FLD1(r,2)=x11;}}}
 return r;}

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

init_ABagMap()
{
 static int visited=0; if(visited) return; visited=1;
 init_ABag();
 init_ANat();
 init_APair();
 init_AOption();
 init_ASeq();
 init_ABagConv();
 init_ASeqMap();
 init_AString();
 init_AChar();
 CLS(2,_ABagMap_6,__ABagMap_6);
 CLS(4,_ABagMap_5,__ABagMap_5);
 MTH(4,0,2,_mt_4_0_2);LZYMTH(4,0,2,_mt_4_0_2);
 MTH(4,2,2,_mt_4_2_2);LZYMTH(4,2,2,_mt_4_2_2);}

