

#include "BUILTIN.h"

#include "Nat.h"
extern TUP2 _APair_8(OBJ);extern OBJ __APair_8;
extern OBJ _AMapNotForUserPurpose_4(OBJ,OBJ,OBJ);extern OBJ __AMapNotForUserPurpose_4;
extern OBJ _ASetByBSTFilter_3(OBJ,OBJ,OBJ);extern OBJ __ASetByBSTFilter_3;
extern OBJ _ACAST_3(OBJ);extern OBJ __ACAST_3;
extern OBJ _AMapFilter_4(OBJ,OBJ,OBJ);OBJ __AMapFilter_4; /* | */
extern TUP2 _AMapFilter_5(OBJ,OBJ,OBJ);OBJ __AMapFilter_5; /* partition */
extern OBJ _AMapFilter_6(OBJ,OBJ);OBJ __AMapFilter_6; /* |'6 */
extern OBJ _AMapFilter_7(OBJ,OBJ);OBJ __AMapFilter_7; /* partition'7 */
extern OBJ _AMapFilter_8(OBJ,OBJ);OBJ __AMapFilter_8; /* partition'8 */

extern OBJ _AMapFilter_4(OBJ x1,OBJ x2,OBJ x3) /* | */
{OBJ r;
 CPCLS(__AMapFilter_6,1);
 CPCLS(__AMapNotForUserPurpose_4,1);
 {OBJ x4;OBJ x5;OBJ x6;OBJ x7;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AMapNotForUserPurpose_4,1))(__AMapNotForUserPurpose_4,x1);
  x5=_ACAST_3(x3);
  x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__AMapFilter_6,1))(__AMapFilter_6,x2);
  x7=_ASetByBSTFilter_3(x4,x6,x5);
  r=_ACAST_3(x7);}
 return r;}

extern TUP2 _AMapFilter_5(OBJ x1,OBJ x2,OBJ x3) /* partition */
{TUP2 r;
 CPCLS(__AMapFilter_7,1);
 CPCLS(__AMapFilter_8,1);
 CPCLS(__AMapNotForUserPurpose_4,1);
 CPCLS(x2,1);
 {OBJ x4;OBJ x5;OBJ x6;OBJ x7;OBJ x8;OBJ x10;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AMapNotForUserPurpose_4,1))(__AMapNotForUserPurpose_4,x1);
  CPCLS(x4,1);
  x5=_ACAST_3(x3);
  COPY(x5,1);
  x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__AMapFilter_7,1))(__AMapFilter_7,x2);
  x7=_ASetByBSTFilter_3(x4,x6,x5);
  x8=(*(OBJ(*)(OBJ,OBJ))METHOD(__AMapFilter_8,1))(__AMapFilter_8,x2);
  r.c1=_ACAST_3(x7);
  x10=_ASetByBSTFilter_3(x4,x8,x5);
  r.c2=_ACAST_3(x10);}
 return r;}
extern OBJ _AMapFilter_5_c(OBJ x1,OBJ x2,OBJ x3) /* partition */
{OBJ r;
 {TUP2 t=_AMapFilter_5(x1,x2,x3);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AMapFilter_6(OBJ x1,OBJ x2) /* |'6 */
{OBJ r;
 {TUP2 x4;
  x4=_APair_8(x2);
  r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x4.c1,x4.c2);}
 return r;}

extern OBJ _AMapFilter_7(OBJ x1,OBJ x2) /* partition'7 */
{OBJ r;
 {TUP2 x4;
  x4=_APair_8(x2);
  r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x4.c1,x4.c2);}
 return r;}

extern OBJ _AMapFilter_8(OBJ x1,OBJ x2) /* partition'8 */
{OBJ r;
 {TUP2 x7;OBJ x9;
  x7=_APair_8(x2);
  x9=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x7.c1,x7.c2);
  if(ISTGPRM(x9,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

init_AMapFilter()
{
 static int visited=0; if(visited) return; visited=1;
 init_AMap();
 init_ANat();
 init_AOption();
 init_ASet();
 init_ASeq();
 init_APair();
 init_AMapNotForUserPurpose();
 init_ASetByBST();
 init_ASetByBSTFilter();
 init_ABSTree();
 init_ATree();
 init_ACAST();
 CLS(2,_AMapFilter_8,__AMapFilter_8);
 CLS(2,_AMapFilter_7,__AMapFilter_7);
 CLS(2,_AMapFilter_6,__AMapFilter_6);
 CLS(3,_AMapFilter_5_c,__AMapFilter_5);
 CLS(3,_AMapFilter_4,__AMapFilter_4);}

