#include "cdefs.h"
#include "mem.h"
extern cptr object_methods[meth_max];
extern cptr integer_methods[meth_max];
extern cptr string_methods[meth_max];
extern cptr sstring_methods[meth_max];
#include "cfloat.h"
#include "cint.h"
#include "cstring.h"
extern cptr strpool_methods[meth_max];

extern cint strpool_str_5;
extern cint object_Undefined;
extern cint strpool_str_19;


cptr float_methods[meth_max];

cint float_alloc(cint float_self, cint float_value){
  cint float_result;
  cint t1, t2;
  t2 = object_alloc((cint)float_self);
  float_result = t2;
  ((cptr)float_self)[4] /* class_of*/ = strpool_str_19;
  ((cptr)float_self)[7] /* fval*/ = cstring_str2float((cint)float_value);
  t1 = float_result;
  goto t1_label;
  t1_label: return t1;
}

cint float_falloc(cint float_self, cint float_fvalue){
  cint float_result;
  cint t3, t4;
  t4 = object_alloc((cint)float_self);
  float_result = t4;
  ((cptr)float_self)[4] /* class_of*/ = strpool_str_19;
  ((cptr)float_self)[7] /* fval*/ = float_fvalue;
  t3 = float_result;
  goto t3_label;
  t3_label: return t3;
}

cint float_ialloc(cint float_self, cint float_ivalue){
  cint float_result;
  cint t5, t6;
  t6 = object_alloc((cint)float_self);
  float_result = t6;
  ((cptr)float_self)[4] /* class_of*/ = strpool_str_19;
  ((cptr)float_self)[7] /* fval*/ = cfloat_as_int((cint)float_ivalue);
  t5 = float_result;
  goto t5_label;
  t5_label: return t5;
}

cint float_reclaim(cint float_self){
  cint t7;
  object_reclaim((cint)float_self);
  t7_label: return t7;
}

cint float_copy_of(cint float_self){
  cint float_result;
  cint t8, t9, t10, t11;
  t9 = ((cptr)float_self)[1] /* refcount*/ == 1;
  if (t9){
    t8 = float_self;
    goto t8_label;
  };
  t10 = mem_malloc(32); ((cptr)t10)[0] = float_methods;
  t11 = float_falloc((cint)t10, (cint)((cptr)float_self)[7] /* fval*/);
  float_result = t11;
  object_Dec_ref(float_self);
  t8 = float_result;
  goto t8_label;
  t8_label: return t8;
}

cint float_Divide(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23;
  t13 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  t14 = t13;
  if (t14){
    t15 = ((cptr)float_ob)[2] /* hashval*/ != 0;
    t14 = t15;
  };
  if (t14){
    t16 = ((cptr)(((cptr)float_self)[0]))[21];
    t17 = ((f0)t16)((cint)float_self); /* copy_of*/
    float_result = t17;
    ((cptr)float_result)[7] /* fval*/ = cfloat_fi_div((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/);
    object_Dec_ref(float_ob);
  }else{
    t19 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
    if (t19){
      float_f = float_ob;
      t20 = cint_as_float((cint)((cptr)float_f)[7] /* fval*/) != 0;
      if (t20){
        t21 = ((cptr)(((cptr)float_self)[0]))[157];
        t22 = ((f0)t21)((cint)float_self, (cint)float_ob, (cint)cfloat_ff_div((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/)); /* update_one*/
        t12 = t22;
        goto t12_label;
      };
    };
    object_Dec_ref(float_self);
    object_Dec_ref(float_ob);
    t12 = object_Undefined;
    goto t12_label;
  };
  t12 = float_result;
  goto t12_label;
  t12_label: return t12;
}

cint float_equal(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t24, t25, t26, t27, t28;
  t25 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t25){
    t26 = cint_as_float((cint)((cptr)float_self)[7] /* fval*/) == ((cptr)float_ob)[2] /* hashval*/;
    if (t26){
      t24 = 1;
      goto t24_label;
    };
  }else{
  t27 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t27){
    float_f = float_ob;
    t28 = cint_as_float((cint)((cptr)float_self)[7] /* fval*/) == cint_as_float((cint)((cptr)float_f)[7] /* fval*/);
    if (t28){
      t24 = 1;
      goto t24_label;
    };
  };};
  t24 = 0;
  goto t24_label;
  t24_label: return t24;
}

cint float_Exponentiate(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t29, t30, t31, t32, t33, t34, t35, t36, t37;
  t30 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t30){
    t31 = ((cptr)(((cptr)float_self)[0]))[21];
    t32 = ((f0)t31)((cint)float_self); /* copy_of*/
    float_result = t32;
    ((cptr)float_result)[7] /* fval*/ = cfloat_fi_pow((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/);
    object_Dec_ref(float_ob);
  }else{
    t34 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
    if (t34){
      float_f = float_ob;
      t35 = ((cptr)(((cptr)float_self)[0]))[157];
      t36 = ((f0)t35)((cint)float_self, (cint)float_ob, (cint)cfloat_ff_pow((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/)); /* update_one*/
      t29 = t36;
      goto t29_label;
    };
    object_Dec_ref(float_self);
    object_Dec_ref(float_ob);
    t29 = object_Undefined;
    goto t29_label;
  };
  t29 = float_result;
  goto t29_label;
  t29_label: return t29;
}

cint float_less_than(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t38, t39, t40, t41, t42;
  t39 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t39){
    t40 = cint_as_float((cint)((cptr)float_self)[7] /* fval*/) < ((cptr)float_ob)[2] /* hashval*/;
    if (t40){
      t38 = 1;
      goto t38_label;
    };
  }else{
  t41 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t41){
    float_f = float_ob;
    t42 = cint_as_float((cint)((cptr)float_self)[7] /* fval*/) < cint_as_float((cint)((cptr)float_f)[7] /* fval*/);
    if (t42){
      t38 = 1;
      goto t38_label;
    };
  };};
  t38 = 0;
  goto t38_label;
  t38_label: return t38;
}

cint float_make_abs(cint float_self){
  cint float_result;
  cint t43, t44, t45;
  t44 = mem_malloc(32); ((cptr)t44)[0] = float_methods;
  t45 = float_falloc((cint)t44, (cint)cfloat_f_fabs((cint)((cptr)float_self)[7] /* fval*/));
  t43 = t45;
  goto t43_label;
  t43_label: return t43;
}

cint float_make_ceil(cint float_self){
  cint float_result;
  cint t46, t47, t48;
  t47 = mem_malloc(28); ((cptr)t47)[0] = integer_methods;
  t48 = integer_ialloc((cint)t47, (cint)cfloat_f_ceil((cint)((cptr)float_self)[7] /* fval*/));
  t46 = t48;
  goto t46_label;
  t46_label: return t46;
}

cint float_make_div(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t49, t50, t51, t52, t53, t54, t55, t56, t57, t58;
  t50 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  t51 = t50;
  if (t51){
    t52 = ((cptr)float_ob)[2] /* hashval*/ != 0;
    t51 = t52;
  };
  if (t51){
    t53 = mem_malloc(28); ((cptr)t53)[0] = integer_methods;
    t54 = integer_ialloc((cint)t53, (cint)cfloat_fi_idiv((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/));
    t49 = t54;
    goto t49_label;
  }else{
  t55 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t55){
    float_f = float_ob;
    t56 = cint_as_float((cint)((cptr)float_f)[7] /* fval*/) == 0;
    if (t56){
      t49 = object_Undefined;
      goto t49_label;
    };
    t57 = mem_malloc(28); ((cptr)t57)[0] = integer_methods;
    t58 = integer_ialloc((cint)t57, (cint)cfloat_ff_idiv((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/));
    t49 = t58;
    goto t49_label;
  };};
  t49 = object_Undefined;
  goto t49_label;
  t49_label: return t49;
}

cint float_make_floor(cint float_self){
  cint float_result;
  cint t59, t60, t61;
  t60 = mem_malloc(28); ((cptr)t60)[0] = integer_methods;
  t61 = integer_ialloc((cint)t60, (cint)cfloat_f_floor((cint)((cptr)float_self)[7] /* fval*/));
  t59 = t61;
  goto t59_label;
  t59_label: return t59;
}

cint float_make_frac(cint float_self){
  cint float_result;
  cint t62, t63, t64;
  t63 = mem_malloc(32); ((cptr)t63)[0] = float_methods;
  t64 = float_falloc((cint)t63, (cint)cfloat_f_frac((cint)((cptr)float_self)[7] /* fval*/));
  t62 = t64;
  goto t62_label;
  t62_label: return t62;
}

cint float_make_int(cint float_self){
  cint float_result;
  cint t65, t66, t67;
  t66 = mem_malloc(28); ((cptr)t66)[0] = integer_methods;
  t67 = integer_ialloc((cint)t66, (cint)cfloat_f_int((cint)((cptr)float_self)[7] /* fval*/));
  t65 = t67;
  goto t65_label;
  t65_label: return t65;
}

cint float_make_mod(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t68, t69, t70, t71, t72, t73, t74, t75, t76, t77;
  t69 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  t70 = t69;
  if (t70){
    t71 = ((cptr)float_ob)[2] /* hashval*/ != 0;
    t70 = t71;
  };
  if (t70){
    t72 = mem_malloc(32); ((cptr)t72)[0] = float_methods;
    t73 = float_falloc((cint)t72, (cint)cfloat_fi_mod((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/));
    t68 = t73;
    goto t68_label;
  }else{
  t74 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t74){
    float_f = float_ob;
    t75 = cint_as_float((cint)((cptr)float_f)[7] /* fval*/) != 0;
    if (t75){
      t76 = mem_malloc(32); ((cptr)t76)[0] = float_methods;
      t77 = float_falloc((cint)t76, (cint)cfloat_ff_mod((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/));
      t68 = t77;
      goto t68_label;
    };
  };};
  t68 = object_Undefined;
  goto t68_label;
  t68_label: return t68;
}

cint float_make_rem(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t78, t79, t80, t81, t82, t83, t84, t85, t86, t87;
  t79 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  t80 = t79;
  if (t80){
    t81 = ((cptr)float_ob)[2] /* hashval*/ != 0;
    t80 = t81;
  };
  if (t80){
    t82 = mem_malloc(32); ((cptr)t82)[0] = float_methods;
    t83 = float_falloc((cint)t82, (cint)cfloat_fi_rem((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/));
    t78 = t83;
    goto t78_label;
  }else{
  t84 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t84){
    float_f = float_ob;
    t85 = cint_as_float((cint)((cptr)float_f)[7] /* fval*/) != 0;
    if (t85){
      t86 = mem_malloc(32); ((cptr)t86)[0] = float_methods;
      t87 = float_falloc((cint)t86, (cint)cfloat_ff_rem((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/));
      t78 = t87;
      goto t78_label;
    };
  };};
  t78 = object_Undefined;
  goto t78_label;
  t78_label: return t78;
}

cint float_make_round(cint float_self){
  cint float_result;
  cint t88, t89, t90;
  t89 = mem_malloc(28); ((cptr)t89)[0] = integer_methods;
  t90 = integer_ialloc((cint)t89, (cint)cfloat_round(cint_as_float((cint)((cptr)float_self)[7] /* fval*/)));
  t88 = t90;
  goto t88_label;
  t88_label: return t88;
}

cint float_Minus(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t91, t92, t93, t94, t95, t96, t97, t98, t99;
  t92 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t92){
    t93 = ((cptr)(((cptr)float_self)[0]))[21];
    t94 = ((f0)t93)((cint)float_self); /* copy_of*/
    float_result = t94;
    ((cptr)float_result)[7] /* fval*/ = cfloat_fi_min((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/);
    object_Dec_ref(float_ob);
  }else{
  t96 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t96){
    float_f = float_ob;
    t97 = ((cptr)(((cptr)float_self)[0]))[157];
    t98 = ((f0)t97)((cint)float_self, (cint)float_ob, (cint)cfloat_ff_min((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/)); /* update_one*/
    t91 = t98;
    goto t91_label;
  }else{
    object_Dec_ref(float_self);
    object_Dec_ref(float_ob);
    t91 = object_Undefined;
    goto t91_label;
  };};
  t91 = float_result;
  goto t91_label;
  t91_label: return t91;
}

cint float_Mknum(cint float_self){
  cint float_result;
  cint t100;
  t100 = float_self;
  goto t100_label;
  t100_label: return t100;
}

cint float_Mkstr(cint float_self){
  cint float_result;
  cint t101, t102, t103;
  t102 = mem_malloc(40); ((cptr)t102)[0] = sstring_methods;
  t103 = sstring_alloc((cint)t102, (cint)cstring_float2str(cint_as_float((cint)((cptr)float_self)[7] /* fval*/)));
  float_result = t103;
  object_Dec_ref(float_self);
  t101 = float_result;
  goto t101_label;
  t101_label: return t101;
}

cint float_Multiply(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t104, t105, t106, t107, t108, t109, t110, t111, t112;
  t105 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t105){
    t106 = ((cptr)(((cptr)float_self)[0]))[21];
    t107 = ((f0)t106)((cint)float_self); /* copy_of*/
    float_result = t107;
    ((cptr)float_result)[7] /* fval*/ = cfloat_fi_mul((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/);
    object_Dec_ref(float_ob);
  }else{
  t109 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t109){
    float_f = float_ob;
    t110 = ((cptr)(((cptr)float_self)[0]))[157];
    t111 = ((f0)t110)((cint)float_self, (cint)float_ob, (cint)cfloat_ff_mul((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/)); /* update_one*/
    t104 = t111;
    goto t104_label;
  }else{
    object_Dec_ref(float_self);
    object_Dec_ref(float_ob);
    t104 = object_Undefined;
    goto t104_label;
  };};
  t104 = float_result;
  goto t104_label;
  t104_label: return t104;
}

cint float_Negate(cint float_self){
  cint float_result;
  cint t113, t114, t115, t116;
  t114 = ((cptr)(((cptr)float_self)[0]))[21];
  t115 = ((f0)t114)((cint)float_self); /* copy_of*/
  float_result = t115;
  ((cptr)float_result)[7] /* fval*/ = cfloat_ff_min((cint)cfloat_as_int((cint)0), (cint)((cptr)float_self)[7] /* fval*/);
  t113 = float_result;
  goto t113_label;
  t113_label: return t113;
}

cint float_Plus(cint float_self, cint float_ob){
  cint float_result, float_f;
  cint t117, t118, t119, t120, t121, t122, t123, t124, t125;
  t118 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_5;
  if (t118){
    t119 = ((cptr)(((cptr)float_self)[0]))[21];
    t120 = ((f0)t119)((cint)float_self); /* copy_of*/
    float_result = t120;
    ((cptr)float_result)[7] /* fval*/ = cfloat_fi_plus((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_ob)[2] /* hashval*/);
    object_Dec_ref(float_ob);
  }else{
  t122 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
  if (t122){
    float_f = float_ob;
    t123 = ((cptr)(((cptr)float_self)[0]))[157];
    t124 = ((f0)t123)((cint)float_self, (cint)float_ob, (cint)cfloat_ff_plus((cint)((cptr)float_self)[7] /* fval*/, (cint)((cptr)float_f)[7] /* fval*/)); /* update_one*/
    t117 = t124;
    goto t117_label;
  }else{
    object_Dec_ref(float_self);
    object_Dec_ref(float_ob);
    t117 = object_Undefined;
    goto t117_label;
  };};
  t117 = float_result;
  goto t117_label;
  t117_label: return t117;
}

cint float_update_one(cint float_self, cint float_ob, cint float_val){
  cint float_result;
  cint t126, t127, t128, t129, t130, t131, t132;
  t127 = ((cptr)float_ob)[1] /* refcount*/ == 1;
  t128 = t127;
  if (t128){
    t129 = ((cptr)float_ob)[4] /* class_of*/ == strpool_str_19;
    t128 = t129;
  };
  if (t128){
    float_result = float_ob;
    ((cptr)float_result)[7] /* fval*/ = float_val;
    object_Dec_ref(float_self);
  }else{
    t130 = ((cptr)(((cptr)float_self)[0]))[21];
    t131 = ((f0)t130)((cint)float_self); /* copy_of*/
    float_result = t131;
    ((cptr)float_result)[7] /* fval*/ = float_val;
    object_Dec_ref(float_ob);
  };
  t126 = float_result;
  goto t126_label;
  t126_label: return t126;
}

void init_float(){
  copy_meth_table(float_methods, object_methods);
  float_methods[0] = 32;
  float_methods[3] = float_alloc;
  float_methods[174] = float_falloc;
  float_methods[153] = float_ialloc;
  float_methods[4] = float_reclaim;
  float_methods[21] = float_copy_of;
  float_methods[31] = float_Divide;
  float_methods[37] = float_equal;
  float_methods[42] = float_Exponentiate;
  float_methods[60] = float_less_than;
  float_methods[175] = float_make_abs;
  float_methods[176] = float_make_ceil;
  float_methods[154] = float_make_div;
  float_methods[177] = float_make_floor;
  float_methods[178] = float_make_frac;
  float_methods[179] = float_make_int;
  float_methods[155] = float_make_mod;
  float_methods[156] = float_make_rem;
  float_methods[180] = float_make_round;
  float_methods[83] = float_Minus;
  float_methods[87] = float_Mknum;
  float_methods[88] = float_Mkstr;
  float_methods[89] = float_Multiply;
  float_methods[92] = float_Negate;
  float_methods[97] = float_Plus;
  float_methods[157] = float_update_one;
}
