#include "cdefs.h"
#include "mem.h"
extern cptr object_methods[meth_max];
extern cptr set_methods[meth_max];
extern cptr boolean_methods[meth_max];
extern cptr string_methods[meth_max];
#include "cint.h"
extern cptr strpool_methods[meth_max];

extern cint boolean_True;
extern cint strpool_str_159;
extern cint boolean_False;
extern cint strpool_str_12;
extern cint strpool_str_31;
extern cint strpool_str_13;
extern cint strpool_str_15;
extern cint strpool_str_67;

cint entset_predef;

cptr entset_methods[meth_max];

cint entset_init(){
  cint t1, t2, t3;
  t2 = mem_malloc(32); ((cptr)t2)[0] = entset_methods;
  t3 = entset_alloc((cint)t2);
  entset_predef = t3;
  t1_label: return t1;
}

cint entset_fini(){
  cint t4;
  object_Dec_ref(entset_predef);
  t4_label: return t4;
}

cint entset_alloc(cint entset_self){
  cint entset_result;
  cint t5, t6;
  t6 = set_alloc((cint)entset_self);
  entset_result = t6;
  ((cptr)entset_self)[5] /* representation*/ = strpool_str_31;
  ((cptr)entset_self)[3] /* len*/ = -1;
  t5 = entset_result;
  goto t5_label;
  t5_label: return t5;
}

cint entset_reclaim(cint entset_self){
  cint t7;
  set_reclaim((cint)entset_self);
  t7_label: return t7;
}

cint entset_Append(cint entset_self, cint entset_item){
  cint entset_result;
  cint t8;
  object_Dec_ref(entset_item);
  t8 = entset_self;
  goto t8_label;
  t8_label: return t8;
}

cint entset_Contains(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t9;
  object_Dec_ref(entset_self);
  object_Dec_ref(entset_ob);
  t9 = boolean_True;
  goto t9_label;
  t9_label: return t9;
}

cint entset_equal(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t10, t11;
  t11 = entset_self == entset_ob;
  if (t11){
    t10 = 1;
    goto t10_label;
  };
  t10 = 0;
  goto t10_label;
  t10_label: return t10;
}

cint entset_Expanded_with(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t12;
  t12 = entset_self;
  goto t12_label;
  t12_label: return t12;
}

cint entset_Intersect(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t13;
  object_Dec_ref(entset_self);
  t13 = entset_ob;
  goto t13_label;
  t13_label: return t13;
}

cint entset_Mkstr(cint entset_self){
  cint entset_result;
  cint t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26;
  ((cptr)strpool_str_13)[1] += 1;
  ((cptr)strpool_str_159)[1] += 1;
  t15 = ((cptr)(((cptr)strpool_str_13)[0]))[97];
  t16 = ((f0)t15)((cint)strpool_str_13, (cint)strpool_str_159); /* Plus*/
  ((cptr)strpool_str_12)[1] += 1;
  t18 = ((cptr)(((cptr)t16)[0]))[97];
  t19 = ((f0)t18)((cint)t16, (cint)strpool_str_12); /* Plus*/
  ((cptr)strpool_str_67)[1] += 1;
  t21 = ((cptr)(((cptr)t19)[0]))[97];
  t22 = ((f0)t21)((cint)t19, (cint)strpool_str_67); /* Plus*/
  ((cptr)strpool_str_15)[1] += 1;
  t24 = ((cptr)(((cptr)t22)[0]))[97];
  t25 = ((f0)t24)((cint)t22, (cint)strpool_str_15); /* Plus*/
  entset_result = t25;
  object_Dec_ref(entset_self);
  t14 = entset_result;
  goto t14_label;
  t14_label: return t14;
}

cint entset_Plus(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t27;
  object_Dec_ref(entset_ob);
  t27 = entset_self;
  goto t27_label;
  t27_label: return t27;
}

cint entset_Subset(cint entset_self, cint entset_ob){
  cint entset_result;
  cint t28, t29;
  t29 = ((cptr)entset_ob)[5] /* representation*/ == strpool_str_31;
  if (t29){
    object_Dec_ref(entset_self);
    object_Dec_ref(entset_ob);
    t28 = boolean_True;
    goto t28_label;
  }else{
    object_Dec_ref(entset_self);
    object_Dec_ref(entset_ob);
    t28 = boolean_False;
    goto t28_label;
  };
  t28 = entset_result;
  goto t28_label;
  t28_label: return t28;
}

void init_entset(){
  copy_meth_table(entset_methods, set_methods);
  entset_methods[0] = 32;
  entset_methods[1] = entset_init;
  entset_methods[2] = entset_fini;
  entset_methods[3] = entset_alloc;
  entset_methods[4] = entset_reclaim;
  entset_methods[7] = entset_Append;
  entset_methods[20] = entset_Contains;
  entset_methods[37] = entset_equal;
  entset_methods[41] = entset_Expanded_with;
  entset_methods[54] = entset_Intersect;
  entset_methods[88] = entset_Mkstr;
  entset_methods[97] = entset_Plus;
  entset_methods[104] = entset_Subset;
}
