

#include "BUILTIN.h"

#include "Bitset.h"

#include "Nat.h"
extern OBJ _ABitsetFold_1(OBJ,OBJ);OBJ __ABitsetFold_1; /* / */

extern OBJ _ABitsetFold_1(OBJ x1,OBJ x2) /* / */
{OBJ r;
 CPPRD(x2,1);
 {OBJ x3;
  ABitset_20(x2,x3);
  if(ISTGPRM(x3,0)){
   CPPRD(x2,1);
   {OBJ x4;OBJ x5;OBJ x6;
    ABitset_19(x2,x4);
    ABitset_13(x4,x2,x5);
    CPPRD(x5,1);
    ABitset_20(x5,x6);
    if(ISTGPRM(x6,1)){
     r=x4;
     FRCLS(x1,1);
     FRPRD(x5,1);
    }else{
     CPCLS(x1,1);
     {OBJ x7;
      x7=_ABitsetFold_1(x1,x5);
      r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x4,x7);}}}
  }else{
   HLT("/\'BitsetFold applied to empty set");}}
 return r;}

init_ABitsetFold()
{
 static int visited=0; if(visited) return; visited=1;
 init_ABitset();
 init_ANat();
 init_AOption();
 CLS(2,_ABitsetFold_1,__ABitsetFold_1);}

