

#include "BUILTIN.h"

#include "Bitset.h"

#include "Nat.h"
extern OBJ _ABitsetFilter_1(OBJ,OBJ);OBJ __ABitsetFilter_1; /* | */
extern TUP2 _ABitsetFilter_2(OBJ,OBJ);OBJ __ABitsetFilter_2; /* partition */

extern OBJ _ABitsetFilter_1(register OBJ x1,register OBJ x2) /* | */
{OBJ r;
 for(;;){
  CPPRD(x2,1);
  {OBJ x3;
   ABitset_20(x2,x3);
   if(ISTGPRM(x3,1)){
    FRCLS(x1,1);
    FRPRD(x2,1);
    CPPRD(__ABitset_2,1);
    r=__ABitset_2;
   }else{
    CPCLS(x1,1);
    CPPRD(x2,1);
    {OBJ x4;OBJ x5;OBJ x6;
     ABitset_19(x2,x4);
     ABitset_13(x4,x2,x5);
     x6=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x4);
     if(ISTGPRM(x6,1)){
      {OBJ x7;
       x7=_ABitsetFilter_1(x1,x5);
       ABitset_3(x4,x7,r);}
     }else{
      x2=x5;continue;}}}}
  break;}
 return r;}

extern TUP2 _ABitsetFilter_2(OBJ x1,OBJ x2) /* partition */
{TUP2 r;
 CPPRD(x2,1);
 {OBJ x3;
  ABitset_20(x2,x3);
  if(ISTGPRM(x3,1)){
   FRCLS(x1,1);
   FRPRD(x2,1);
   CPPRD(__ABitset_2,2);
   r.c1=__ABitset_2;r.c2=__ABitset_2;
  }else{
   CPCLS(x1,1);
   CPPRD(x2,1);
   {OBJ x4;OBJ x5;OBJ x6;TUP2 x8;
    ABitset_19(x2,x4);
    ABitset_13(x4,x2,x5);
    x6=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x4);
    x8=_ABitsetFilter_2(x1,x5);
    if(ISTGPRM(x6,1)){
     r.c2=x8.c2;
     ABitset_3(x4,x8.c1,r.c1);
    }else{
     r.c1=x8.c1;
     ABitset_3(x4,x8.c2,r.c2);}}}}
 return r;}
extern OBJ _ABitsetFilter_2_c(OBJ x1,OBJ x2) /* partition */
{OBJ r;
 {TUP2 t=_ABitsetFilter_2(x1,x2);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

init_ABitsetFilter()
{
 static int visited=0; if(visited) return; visited=1;
 init_ABitset();
 init_ANat();
 init_AOption();
 CLS(2,_ABitsetFilter_2_c,__ABitsetFilter_2);
 CLS(2,_ABitsetFilter_1,__ABitsetFilter_1);}

