#include "cdefs.h"
#include "mem.h"
extern cptr object_methods[meth_max];
extern cptr set_methods[meth_max];
extern cptr list_methods[meth_max];
extern cptr slist_methods[meth_max];
extern cptr string_methods[meth_max];
extern cptr entset_methods[meth_max];
extern cptr boolean_methods[meth_max];
#include "cint.h"
#include "cobarray.h"
extern cptr slicelst_methods[meth_max];
extern cptr strpool_methods[meth_max];
extern cptr mapset_methods[meth_max];
#include "cprocess.h"
extern cptr parameter_methods[meth_max];
extern cptr sset_methods[meth_max];

extern cint object_Undefined;
extern cint strpool_str_12;
extern cint strpool_str_40;
extern cint strpool_str_41;
extern cint strpool_str_60;
extern cint strpool_str_50;
extern cint strpool_str_51;
extern cint strpool_str_14;
extern cint strpool_str_52;
extern cint strpool_str_39;
extern cint boolean_False;


cptr map_methods[meth_max];

cint map_alloc(cint map_self){
  cint map_result, map_bufx, map_bufy, map_i;
  cint t1, t2;
  t2 = object_alloc((cint)map_self);
  map_result = t2;
  ((cptr)map_self)[4] /* class_of*/ = strpool_str_60;
  ((cptr)map_self)[7] /* domains*/ = 0;
  ((cptr)map_self)[8] /* codomain*/ = 0;
  ((cptr)map_self)[9] /* max_elems*/ = 32;
  map_bufx = cobarray_mem_malloc((cint)128);
  map_bufy = cobarray_mem_malloc((cint)128);
  for (map_i = 0; map_i <= 31; map_i++){
    ((cptr)(map_bufx))[map_i] = 0;
    ((cptr)(map_bufy))[map_i] = 0;
  };t3:;
  ((cptr)map_self)[10] /* x*/ = map_bufx;
  ((cptr)map_self)[11] /* y*/ = map_bufy;
  t1 = map_result;
  goto t1_label;
  t1_label: return t1;
}

cint map_reclaim(cint map_self){
  cint map_i;
  cint t4, t5, t6, t8, t9, t10;
  t5 = ((cptr)map_self)[7] /* domains*/ != 0;
  if (t5){
    object_Dec_ref(((cptr)map_self)[7] /* domains*/);
  };
  t6 = ((cptr)map_self)[8] /* codomain*/ != 0;
  if (t6){
    object_Dec_ref(((cptr)map_self)[8] /* codomain*/);
  };
  t8 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t8; map_i++){
    t9 = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i] != 0;
    if (t9){
      object_Dec_ref(((cptr)(((cptr)map_self)[10] /* x*/))[map_i]);
    };
    t10 = ((cptr)(((cptr)map_self)[11] /* y*/))[map_i] != 0;
    if (t10){
      object_Dec_ref(((cptr)(((cptr)map_self)[11] /* y*/))[map_i]);
    };
  };t7:;
  cobarray_mem_free((cint)((cptr)map_self)[10] /* x*/);
  cobarray_mem_free((cint)((cptr)map_self)[11] /* y*/);
  object_reclaim((cint)map_self);
  t4_label: return t4;
}

cint map_Apply(cint map_self, cint map_params){
  cint map_result, map_pars;
  cint t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46;
  t12 = ((cptr)(((cptr)map_self)[0]))[183];
  t13 = ((f0)t12)((cint)map_self, (cint)map_params); /* domain_violated*/
  t14 = t13 == 1;
  if (t14){
    map_result = object_Undefined;
  }else{
    t15 = ((cptr)(((cptr)map_self)[0]))[184];
    t16 = ((f0)t15)((cint)map_self, (cint)map_params); /* get_pos_in_x*/
    map_result = ((cptr)(((cptr)map_self)[11] /* y*/))[t16];
    t18 = map_result == 0;
    if (t18){
      t19 = ((cptr)map_params)[5] /* representation*/ == strpool_str_41;
      t20 = t19;
      if (t20){
        t21 = ((cptr)map_params)[3] /* len*/ > 1;
        t20 = t21;
      };
      t22 = t20;
      if (t22){
        t23 = ((cptr)map_self)[7] /* domains*/ == 0;
        t24 = t23;
        if (!t24){          t25 = ((cptr)map_params)[3] /* len*/ > ((cptr)((cptr)map_self)[7] /* domains*/)[3] /* len*/;
          t24 = t25;
        };
        t22 = t24;
      };
      if (t22){
        t26 = ((cptr)(((cptr)map_self)[0]))[181];
        t27 = ((f0)t26)((cint)map_self, (cint)map_params); /* map_params*/
        map_pars = t27;
        t29 = ((cptr)(((cptr)map_self)[0]))[184];
        t30 = ((f0)t29)((cint)map_self, (cint)map_pars); /* get_pos_in_x*/
        map_result = ((cptr)(((cptr)map_self)[11] /* y*/))[t30];
        object_Dec_ref(map_pars);
        t32 = map_result != 0;
        if (t32){
          t33 = ((cptr)(((cptr)map_self)[0]))[182];
          t34 = ((f0)t33)((cint)map_self, (cint)map_params); /* other_params*/
          map_pars = t34;
          object_Dec_ref(map_self);
          object_Dec_ref(map_params);
          ((cptr)map_result)[1] += 1;
          t36 = ((cptr)(((cptr)map_result)[0]))[9];
          t37 = ((f0)t36)((cint)map_result, (cint)map_pars); /* Apply*/
          t11 = t37;
          goto t11_label;
        };
      };
      map_result = object_Undefined;
    }else{
    t44 = ((cptr)map_self)[8] /* codomain*/ != 0;
    t45 = t44;
    if (t45){
    ((cptr)((cptr)map_self)[8] /* codomain*/)[1] += 1;
    t39 = ((cptr)(((cptr)((cptr)map_self)[8] /* codomain*/)[0]))[38];
    t40 = ((f0)t39)((cint)((cptr)map_self)[8] /* codomain*/); /* Eval*/
    ((cptr)map_result)[1] += 1;
    t42 = ((cptr)(((cptr)t40)[0]))[20];
    t43 = ((f0)t42)((cint)t40, (cint)map_result); /* Contains*/
      t46 = t43 == boolean_False;
      t45 = t46;
    };
    if (t45){
      map_result = object_Undefined;
    };};
  };
  object_Dec_ref(map_self);
  object_Dec_ref(map_params);
  ((cptr)map_result)[1] += 1;
  t11 = map_result;
  goto t11_label;
  t11_label: return t11;
}

cint map_Make_parameter(cint map_self, cint map_ob){
  cint map_result;
  cint t47, t48, t49;
  t48 = mem_malloc(36); ((cptr)t48)[0] = parameter_methods;
  t49 = parameter_alloc((cint)t48, (cint)map_self, (cint)map_ob);
  t47 = t49;
  goto t47_label;
  t47_label: return t47;
}

cint map_map_params(cint map_self, cint map_params){
  cint map_result;
  cint t50, t51, t52, t53, t54, t55, t56, t57, t58, t59, t60, t61;
  t51 = ((cptr)map_self)[7] /* domains*/ == 0;
  if (t51){
    t52 = mem_malloc(40); ((cptr)t52)[0] = slist_methods;
    t53 = slist_alloc((cint)t52, (cint)1);
    ((cptr)t53)[1] += 1;
    t56 = ((cptr)(((cptr)map_params)[0]))[62];
    t55 = ((f0)t56)((cint)map_params, (cint)1); /* lookup*/
    ((cptr)t55)[1] += 1;
    t57 = ((cptr)(((cptr)t53)[0]))[7];
    t58 = ((f0)t57)((cint)t53, (cint)t55); /* Append*/
    t50 = t58;
    goto t50_label;
  };
  t60 = mem_malloc(40); ((cptr)t60)[0] = slicelst_methods;
  ((cptr)map_params)[1] += 1;
  t61 = slicelst_alloc((cint)t60, (cint)map_params, (cint)1, (cint)((cptr)((cptr)map_self)[7] /* domains*/)[3] /* len*/);
  t50 = t61;
  goto t50_label;
  t50_label: return t50;
}

cint map_other_params(cint map_self, cint map_params){
  cint map_result, map_l, map_m;
  cint t62, t63, t64, t65, t66, t67, t68, t69;
  t63 = ((cptr)map_self)[7] /* domains*/ == 0;
  if (t63){
    ((cptr)map_params)[1] += 1;
    t64 = ((cptr)(((cptr)map_params)[0]))[106];
    t65 = ((f0)t64)((cint)map_params); /* Tail*/
    t62 = t65;
    goto t62_label;
  };
  t67 = ((cptr)((cptr)map_self)[7] /* domains*/)[3] /* len*/ + 1;
  map_l = t67;
  map_m = ((cptr)map_params)[3] /* len*/;
  t68 = mem_malloc(40); ((cptr)t68)[0] = slicelst_methods;
  ((cptr)map_params)[1] += 1;
  t69 = slicelst_alloc((cint)t68, (cint)map_params, (cint)map_l, (cint)map_m);
  t62 = t69;
  goto t62_label;
  t62_label: return t62;
}

cint map_Assign_to_component(cint map_self, cint map_params, cint map_new_val, cint map_op){
  cint map_result, map_mpars, map_pos;
  cint t70, t71, t72, t73, t74, t75, t76, t77, t78, t79, t80, t81, t82, t83, t84, t85, t86, t87, t88, t89, t90, t91, t92, t93, t94, t95, t96, t97, t98, t99, t100, t101, t102, t103, t104, t105, t106;
  map_mpars = map_params;
  t71 = ((cptr)map_params)[5] /* representation*/ == strpool_str_41;
  t72 = t71;
  if (t72){
    t73 = ((cptr)map_self)[7] /* domains*/ != 0;
    t74 = t73;
    if (t74){
      t75 = ((cptr)((cptr)map_self)[7] /* domains*/)[3] /* len*/ < ((cptr)map_params)[3] /* len*/;
      t74 = t75;
    };
    t76 = t74;
    if (!t76){      t77 = ((cptr)map_self)[7] /* domains*/ == 0;
      t78 = t77;
      if (t78){
        t79 = ((cptr)map_params)[3] /* len*/ > 1;
        t78 = t79;
      };
      t76 = t78;
    };
    t72 = t76;
  };
  if (t72){
    t80 = ((cptr)(((cptr)map_self)[0]))[181];
    t81 = ((f0)t80)((cint)map_self, (cint)map_params); /* map_params*/
    map_mpars = t81;
    t83 = map_mpars != map_params;
    if (t83){
      cprocess_exitt((cint)212);
    };
  };
  t84 = ((cptr)(((cptr)map_self)[0]))[183];
  t85 = ((f0)t84)((cint)map_self, (cint)map_mpars); /* domain_violated*/
  t86 = t85 == 1;
  if (t86){
    map_result = object_Undefined;
  }else{
    t87 = ((cptr)(((cptr)map_self)[0]))[21];
    t88 = ((f0)t87)((cint)map_self); /* copy_of*/
    map_result = t88;
    t90 = ((cptr)(((cptr)map_result)[0]))[184];
    t91 = ((f0)t90)((cint)map_result, (cint)map_mpars); /* get_pos_in_x*/
    map_pos = t91;
    t93 = ((cptr)(((cptr)map_result)[11] /* y*/))[map_pos] != 0;
    if (t93){
      t94 = (cptr)(((cptr)(((cptr)map_result)[0]))[185]); /* update_y*/
      ((f0)t94)((cint)map_result, (cint)map_pos, (cint)map_new_val, (cint)map_op, (cint)map_mpars, (cint)map_params);
      t95 = map_mpars != map_params;
      if (t95){
        object_Dec_ref(map_mpars);
      };
      object_Dec_ref(map_params);
    }else{
    t96 = map_op == 0;
    t97 = t96;
    if (t97){
      t98 = map_mpars == map_params;
      t97 = t98;
    };
    t99 = t97;
    if (t99){
      t100 = map_new_val != object_Undefined;
      t99 = t100;
    };
    if (t99){
      ((cptr)(((cptr)map_result)[10] /* x*/))[map_pos] = map_params;
      ((cptr)(((cptr)map_result)[11] /* y*/))[map_pos] = map_new_val;
      t101 = ((cptr)map_result)[2] /* hashval*/ + ((cptr)map_params)[2] /* hashval*/;
      ((cptr)map_result)[2] /* hashval*/ = t101;
      t102 = ((cptr)map_result)[3] /* len*/ + 1;
      ((cptr)map_result)[3] /* len*/ = t102;
      t103 = ((cptr)map_result)[9] /* max_elems*/ / 2;
      t104 = ((cptr)map_result)[3] /* len*/ >= t103;
      if (t104){
        t105 = (cptr)(((cptr)(((cptr)map_result)[0]))[162]); /* increase_size_and_rehash*/
        ((f0)t105)((cint)map_result);
      };
    }else{
      t106 = map_mpars != map_params;
      if (t106){
        object_Dec_ref(map_mpars);
      };
      object_Dec_ref(map_params);
      object_Dec_ref(map_new_val);
    };};
  };
  t70 = map_result;
  goto t70_label;
  t70_label: return t70;
}

cint map_copy_of(cint map_self){
  cint map_result, map_i;
  cint t107, t108, t109, t110, t111, t112, t113, t114, t116, t117;
  t108 = ((cptr)map_self)[1] /* refcount*/ == 1;
  if (t108){
    t107 = map_self;
    goto t107_label;
  };
  object_Dec_ref(map_self);
  t109 = mem_malloc(48); ((cptr)t109)[0] = map_methods;
  t110 = object_alloc((cint)t109);
  map_result = t110;
  ((cptr)map_result)[4] /* class_of*/ = strpool_str_60;
  ((cptr)map_result)[3] /* len*/ = ((cptr)map_self)[3] /* len*/;
  ((cptr)map_result)[2] /* hashval*/ = ((cptr)map_self)[2] /* hashval*/;
  ((cptr)map_result)[7] /* domains*/ = 0;
  ((cptr)map_result)[8] /* codomain*/ = 0;
  t111 = ((cptr)map_self)[7] /* domains*/ != 0;
  if (t111){
    ((cptr)((cptr)map_self)[7] /* domains*/)[1] += 1;
    ((cptr)map_result)[7] /* domains*/ = ((cptr)map_self)[7] /* domains*/;
  };
  t112 = ((cptr)map_self)[8] /* codomain*/ != 0;
  if (t112){
    ((cptr)((cptr)map_self)[8] /* codomain*/)[1] += 1;
    ((cptr)map_result)[8] /* codomain*/ = ((cptr)map_self)[8] /* codomain*/;
  };
  ((cptr)map_result)[9] /* max_elems*/ = ((cptr)map_self)[9] /* max_elems*/;
  t113 = ((cptr)map_self)[9] /* max_elems*/ * 4;
  ((cptr)map_result)[10] /* x*/ = cobarray_mem_malloc((cint)t113);
  t114 = ((cptr)map_self)[9] /* max_elems*/ * 4;
  ((cptr)map_result)[11] /* y*/ = cobarray_mem_malloc((cint)t114);
  t116 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t116; map_i++){
    t117 = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i] != 0;
    if (t117){
      ((cptr)((cptr)(((cptr)map_self)[10] /* x*/))[map_i])[1] += 1;
      ((cptr)(((cptr)map_result)[10] /* x*/))[map_i] = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i];
      ((cptr)((cptr)(((cptr)map_self)[11] /* y*/))[map_i])[1] += 1;
      ((cptr)(((cptr)map_result)[11] /* y*/))[map_i] = ((cptr)(((cptr)map_self)[11] /* y*/))[map_i];
    }else{
      ((cptr)(((cptr)map_result)[10] /* x*/))[map_i] = 0;
      ((cptr)(((cptr)map_result)[11] /* y*/))[map_i] = 0;
    };
  };t115:;
  t107 = map_result;
  goto t107_label;
  t107_label: return t107;
}

cint map_domain_violated(cint map_self, cint map_params){
  cint map_result, map_i, map_dom, map_par;
  cint t118, t119, t121, t122, t123, t124, t125, t126, t127, t128, t129;
  t119 = ((cptr)map_self)[7] /* domains*/ == 0;
  if (t119){
    t118 = 0;
    goto t118_label;
  };
  map_result = 0;
  for (map_i = 1; map_i <= ((cptr)((cptr)map_self)[7] /* domains*/)[3] /* len*/; map_i++){
    t123 = ((cptr)(((cptr)((cptr)map_self)[7] /* domains*/)[0]))[62];
    t122 = ((f0)t123)((cint)((cptr)map_self)[7] /* domains*/, (cint)map_i); /* lookup*/
    ((cptr)t122)[1] += 1;
    map_dom = t122;
    t126 = ((cptr)(((cptr)map_params)[0]))[62];
    t125 = ((f0)t126)((cint)map_params, (cint)map_i); /* lookup*/
    ((cptr)t125)[1] += 1;
    map_par = t125;
    t127 = ((cptr)(((cptr)map_dom)[0]))[20];
    t128 = ((f0)t127)((cint)map_dom, (cint)map_par); /* Contains*/
    t129 = t128 == boolean_False;
    if (t129){
      t118 = 1;
      goto t118_label;
    };
  };t120:;
  t118 = 0;
  goto t118_label;
  t118_label: return t118;
}

cint map_equal(cint map_self, cint map_other){
  cint map_result, map_i;
  cint t130, t131, t132, t133, t135, t136, t137, t138, t139;
  t131 = ((cptr)map_self)[2] /* hashval*/ != ((cptr)map_other)[2] /* hashval*/;
  if (t131){
    t130 = 0;
    goto t130_label;
  };
  t132 = ((cptr)map_self)[3] /* len*/ != ((cptr)map_other)[3] /* len*/;
  if (t132){
    t130 = 0;
    goto t130_label;
  };
  t133 = ((cptr)map_other)[4] /* class_of*/ != strpool_str_60;
  if (t133){
    t130 = 0;
    goto t130_label;
  };
  t135 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t135; map_i++){
    t136 = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i] != 0;
    if (t136){
      t137 = ((cptr)(((cptr)map_other)[0]))[276];
      t138 = ((f0)t137)((cint)map_other, (cint)((cptr)(((cptr)map_self)[10] /* x*/))[map_i], (cint)((cptr)(((cptr)map_self)[11] /* y*/))[map_i]); /* found*/
      t139 = t138 == 0;
      if (t139){
        t130 = 0;
        goto t130_label;
      };
    };
  };t134:;
  t130 = 1;
  goto t130_label;
  t130_label: return t130;
}

cint map_found(cint map_self, cint map_xval, cint map_yval){
  cint map_result, map_j;
  cint t140, t141, t142, t143, t144, t145, t146;
  t141 = ((cptr)(((cptr)map_self)[0]))[184];
  t142 = ((f0)t141)((cint)map_self, (cint)map_xval); /* get_pos_in_x*/
  map_j = t142;
  t144 = ((cptr)(((cptr)((cptr)(((cptr)map_self)[11] /* y*/))[map_j])[0]))[37];
  t145 = ((f0)t144)((cint)((cptr)(((cptr)map_self)[11] /* y*/))[map_j], (cint)map_yval); /* equal*/
  t146 = t145 == 1;
  if (t146){
    t140 = 1;
    goto t140_label;
  };
  t140 = 0;
  goto t140_label;
  t140_label: return t140;
}

cint map_increase_size_and_rehash(cint map_self){
  cint map_oldx, map_oldy, map_old_max, map_i, map_j;
  cint t147, t148, t149, t150, t151, t152, t154, t156, t157, t158, t159, t160;
  map_oldx = ((cptr)map_self)[10] /* x*/;
  map_oldy = ((cptr)map_self)[11] /* y*/;
  map_old_max = ((cptr)map_self)[9] /* max_elems*/;
  t148 = map_old_max < 1024;
  if (t148){
    t149 = ((cptr)map_self)[9] /* max_elems*/ * 2;
    ((cptr)map_self)[9] /* max_elems*/ = t149;
  }else{
    t150 = ((cptr)map_self)[9] /* max_elems*/ + 1024;
    ((cptr)map_self)[9] /* max_elems*/ = t150;
  };
  t151 = ((cptr)map_self)[9] /* max_elems*/ * 4;
  ((cptr)map_self)[10] /* x*/ = cobarray_mem_malloc((cint)t151);
  t152 = ((cptr)map_self)[9] /* max_elems*/ * 4;
  ((cptr)map_self)[11] /* y*/ = cobarray_mem_malloc((cint)t152);
  t154 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t154; map_i++){
    ((cptr)(((cptr)map_self)[10] /* x*/))[map_i] = 0;
    ((cptr)(((cptr)map_self)[11] /* y*/))[map_i] = 0;
  };t153:;
  t156 = map_old_max - 1;
  for (map_i = 0; map_i <= t156; map_i++){
    t157 = ((cptr)(map_oldx))[map_i] != 0;
    if (t157){
      t158 = ((cptr)(((cptr)map_self)[0]))[184];
      t159 = ((f0)t158)((cint)map_self, (cint)((cptr)(map_oldx))[map_i]); /* get_pos_in_x*/
      map_j = t159;
      ((cptr)(((cptr)map_self)[10] /* x*/))[map_j] = ((cptr)(map_oldx))[map_i];
      ((cptr)(((cptr)map_self)[11] /* y*/))[map_j] = ((cptr)(map_oldy))[map_i];
    };
  };t155:;
  cobarray_mem_free((cint)map_oldx);
  cobarray_mem_free((cint)map_oldy);
  t147_label: return t147;
}

cint map_get_pos_in_x(cint map_self, cint map_item){
  cint map_result;
  cint t161, t162, t163, t166, t167, t168, t169, t170, t171, t172;
  map_result = cint_mod((cint)((cptr)map_item)[2] /* hashval*/, (cint)((cptr)map_self)[9] /* max_elems*/);
  t164:
  t168 = ((cptr)(((cptr)map_self)[10] /* x*/))[map_result] != 0;
  t169 = t168;
  if (t169){
  t166 = ((cptr)(((cptr)((cptr)(((cptr)map_self)[10] /* x*/))[map_result])[0]))[37];
  t167 = ((f0)t166)((cint)((cptr)(((cptr)map_self)[10] /* x*/))[map_result], (cint)map_item); /* equal*/
    t170 = t167 == 0;
    t169 = t170;
  };
  if (!t169) goto t165;
    t171 = map_result + 1;
    map_result = t171;
    t172 = map_result >= ((cptr)map_self)[9] /* max_elems*/;
    if (t172){
      map_result = 0;
    };
  goto t164;
  t165:;
  t161 = map_result;
  goto t161_label;
  t161_label: return t161;
}

cint map_Indexed(cint map_self){
  cint map_result, map_i, map_x_elem, map_y_elem, map_t;
  cint t173, t174, t175, t177, t178, t179, t180, t181, t182, t183, t184, t185, t186, t187, t188, t189, t190, t191, t192, t193, t194, t195, t196;
  t174 = mem_malloc(48); ((cptr)t174)[0] = sset_methods;
  t175 = sset_alloc((cint)t174);
  map_result = t175;
  t177 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t177; map_i++){
    map_x_elem = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i];
    t178 = map_x_elem != 0;
    if (t178){
      ((cptr)((cptr)(((cptr)map_self)[11] /* y*/))[map_i])[1] += 1;
      map_y_elem = ((cptr)(((cptr)map_self)[11] /* y*/))[map_i];
      t179 = mem_malloc(40); ((cptr)t179)[0] = slist_methods;
      t180 = slist_alloc((cint)t179, (cint)2);
      map_t = t180;
      t181 = ((cptr)map_x_elem)[3] /* len*/ == 1;
      if (t181){
        t184 = ((cptr)(((cptr)map_x_elem)[0]))[62];
        t183 = ((f0)t184)((cint)map_x_elem, (cint)1); /* lookup*/
        ((cptr)t183)[1] += 1;
        t185 = ((cptr)(((cptr)map_t)[0]))[7];
        t186 = ((f0)t185)((cint)map_t, (cint)t183); /* Append*/
        map_t = t186;
      }else{
        ((cptr)map_x_elem)[1] += 1;
        t188 = ((cptr)(((cptr)map_t)[0]))[7];
        t189 = ((f0)t188)((cint)map_t, (cint)map_x_elem); /* Append*/
        map_t = t189;
      };
      t191 = ((cptr)(((cptr)map_t)[0]))[7];
      t192 = ((f0)t191)((cint)map_t, (cint)map_y_elem); /* Append*/
      map_t = t192;
      t194 = ((cptr)(((cptr)map_result)[0]))[7];
      t195 = ((f0)t194)((cint)map_result, (cint)map_t); /* Append*/
      map_result = t195;
    };
  };t176:;
  t173 = map_result;
  goto t173_label;
  t173_label: return t173;
}

cint map_Make_list(cint map_self){
  cint map_result, map_i, map_x_elem, map_y_elem, map_t;
  cint t197, t198, t199, t201, t202, t203, t204, t205, t206, t207, t208, t209, t210, t211, t212, t213, t214, t215, t216, t217, t218, t219, t220;
  t198 = mem_malloc(40); ((cptr)t198)[0] = slist_methods;
  t199 = slist_alloc((cint)t198, (cint)((cptr)map_self)[3] /* len*/);
  map_result = t199;
  t201 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t201; map_i++){
    map_x_elem = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i];
    t202 = map_x_elem != 0;
    if (t202){
      ((cptr)((cptr)(((cptr)map_self)[11] /* y*/))[map_i])[1] += 1;
      map_y_elem = ((cptr)(((cptr)map_self)[11] /* y*/))[map_i];
      t203 = mem_malloc(40); ((cptr)t203)[0] = slist_methods;
      t204 = slist_alloc((cint)t203, (cint)2);
      map_t = t204;
      t205 = ((cptr)map_x_elem)[3] /* len*/ == 1;
      if (t205){
        t208 = ((cptr)(((cptr)map_x_elem)[0]))[62];
        t207 = ((f0)t208)((cint)map_x_elem, (cint)1); /* lookup*/
        ((cptr)t207)[1] += 1;
        t209 = ((cptr)(((cptr)map_t)[0]))[7];
        t210 = ((f0)t209)((cint)map_t, (cint)t207); /* Append*/
        map_t = t210;
      }else{
        ((cptr)map_x_elem)[1] += 1;
        t212 = ((cptr)(((cptr)map_t)[0]))[7];
        t213 = ((f0)t212)((cint)map_t, (cint)map_x_elem); /* Append*/
        map_t = t213;
      };
      t215 = ((cptr)(((cptr)map_t)[0]))[7];
      t216 = ((f0)t215)((cint)map_t, (cint)map_y_elem); /* Append*/
      map_t = t216;
      t218 = ((cptr)(((cptr)map_result)[0]))[7];
      t219 = ((f0)t218)((cint)map_result, (cint)map_t); /* Append*/
      map_result = t219;
    };
  };t200:;
  t197 = map_result;
  goto t197_label;
  t197_label: return t197;
}

cint map_Make_set(cint map_self){
  cint map_result;
  cint t221, t222, t223, t224;
  t222 = ((cptr)(((cptr)map_self)[0]))[51];
  t223 = ((f0)t222)((cint)map_self); /* Indexed*/
  t221 = t223;
  goto t221_label;
  t221_label: return t221;
}

cint map_Mkstr(cint map_self){
  cint map_result, map_i, map_xe, map_x_elem, map_y_elem;
  cint t225, t226, t228, t229, t230, t231, t232, t233, t234, t235, t236, t237, t238, t239, t240, t241, t242, t243, t244, t245, t246, t247, t248, t249, t250, t251, t252, t253, t254, t255, t256, t257;
  t226 = ((cptr)map_self)[3] /* len*/ < 1;
  if (t226){
    object_Dec_ref(map_self);
    ((cptr)strpool_str_50)[1] += 1;
    t225 = strpool_str_50;
    goto t225_label;
  };
  ((cptr)strpool_str_51)[1] += 1;
  map_result = strpool_str_51;
  t228 = ((cptr)map_self)[9] /* max_elems*/ - 1;
  for (map_i = 0; map_i <= t228; map_i++){
    map_xe = ((cptr)(((cptr)map_self)[10] /* x*/))[map_i];
    t229 = map_xe != 0;
    if (t229){
      map_x_elem = map_xe;
      ((cptr)((cptr)(((cptr)map_self)[11] /* y*/))[map_i])[1] += 1;
      map_y_elem = ((cptr)(((cptr)map_self)[11] /* y*/))[map_i];
      t230 = map_result != strpool_str_51;
      if (t230){
        ((cptr)strpool_str_12)[1] += 1;
        t231 = ((cptr)(((cptr)map_result)[0]))[97];
        t232 = ((f0)t231)((cint)map_result, (cint)strpool_str_12); /* Plus*/
        map_result = t232;
      };
      ((cptr)strpool_str_39)[1] += 1;
      t234 = ((cptr)(((cptr)map_result)[0]))[97];
      t235 = ((f0)t234)((cint)map_result, (cint)strpool_str_39); /* Plus*/
      t236 = ((cptr)(((cptr)map_x_elem)[0]))[112];
      t237 = ((f0)t236)((cint)map_x_elem); /* ubstr*/
      t239 = ((cptr)(((cptr)t235)[0]))[97];
      t240 = ((f0)t239)((cint)t235, (cint)t237); /* Plus*/
      ((cptr)strpool_str_14)[1] += 1;
      t243 = ((cptr)(((cptr)t240)[0]))[97];
      t244 = ((f0)t243)((cint)t240, (cint)strpool_str_14); /* Plus*/
      t245 = ((cptr)(((cptr)map_y_elem)[0]))[88];
      t246 = ((f0)t245)((cint)map_y_elem); /* Mkstr*/
      t248 = ((cptr)(((cptr)t244)[0]))[97];
      t249 = ((f0)t248)((cint)t244, (cint)t246); /* Plus*/
      ((cptr)strpool_str_40)[1] += 1;
      t252 = ((cptr)(((cptr)t249)[0]))[97];
      t253 = ((f0)t252)((cint)t249, (cint)strpool_str_40); /* Plus*/
      map_result = t253;
    };
  };t227:;
  ((cptr)strpool_str_52)[1] += 1;
  t255 = ((cptr)(((cptr)map_result)[0]))[97];
  t256 = ((f0)t255)((cint)map_result, (cint)strpool_str_52); /* Plus*/
  map_result = t256;
  object_Dec_ref(map_self);
  t225 = map_result;
  goto t225_label;
  t225_label: return t225;
}

cint map_update_y(cint map_self, cint map_pos, cint map_new_val, cint map_op, cint map_mpars, cint map_params){
  cint map_new_pos, map_oldob, map_other_pars;
  cint t258, t259, t260, t261, t262, t263, t264, t265, t266, t267, t268, t269, t270, t271, t272, t273, t274, t275, t276, t277, t278, t281, t282, t283, t284, t285, t286, t287, t288, t289, t290, t291, t292, t293, t294;
  map_oldob = ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos];
  t259 = map_mpars == map_params;
  if (t259){
    t260 = map_op == 0;
    if (t260){
      object_Dec_ref(map_oldob);
    };
    t261 = map_op == 1;
    if (t261){
      t262 = ((cptr)(((cptr)map_oldob)[0]))[31];
      t263 = ((f0)t262)((cint)map_oldob, (cint)map_new_val); /* Divide*/
      map_new_val = t263;
    };
    t265 = map_op == 2;
    if (t265){
      t266 = ((cptr)(((cptr)map_oldob)[0]))[83];
      t267 = ((f0)t266)((cint)map_oldob, (cint)map_new_val); /* Minus*/
      map_new_val = t267;
    };
    t269 = map_op == 3;
    if (t269){
      t270 = ((cptr)(((cptr)map_oldob)[0]))[89];
      t271 = ((f0)t270)((cint)map_oldob, (cint)map_new_val); /* Multiply*/
      map_new_val = t271;
    };
    t273 = map_op == 4;
    if (t273){
      t274 = ((cptr)(((cptr)map_oldob)[0]))[97];
      t275 = ((f0)t274)((cint)map_oldob, (cint)map_new_val); /* Plus*/
      map_new_val = t275;
    };
    ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos] = map_new_val;
    t277 = map_new_val == object_Undefined;
    if (t277){
      t278 = ((cptr)map_self)[3] /* len*/ - 1;
      ((cptr)map_self)[3] /* len*/ = t278;
      object_Dec_ref(((cptr)(((cptr)map_self)[10] /* x*/))[map_pos]);
      ((cptr)(((cptr)map_self)[10] /* x*/))[map_pos] = 0;
      ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos] = 0;
      t279:
        t281 = map_pos + 1;
        map_pos = t281;
        t282 = map_pos >= ((cptr)map_self)[9] /* max_elems*/;
        if (t282){
          map_pos = 0;
        };
        t283 = ((cptr)(((cptr)map_self)[10] /* x*/))[map_pos] == 0;
        if (t283){
          goto t280;
        };
        t284 = ((cptr)(((cptr)map_self)[0]))[184];
        t285 = ((f0)t284)((cint)map_self, (cint)((cptr)(((cptr)map_self)[10] /* x*/))[map_pos]); /* get_pos_in_x*/
        map_new_pos = t285;
        t287 = map_new_pos != map_pos;
        if (t287){
          ((cptr)(((cptr)map_self)[10] /* x*/))[map_new_pos] = ((cptr)(((cptr)map_self)[10] /* x*/))[map_pos];
          ((cptr)(((cptr)map_self)[11] /* y*/))[map_new_pos] = ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos];
          ((cptr)(((cptr)map_self)[10] /* x*/))[map_pos] = 0;
          ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos] = 0;
        };
      goto t279;
      t280:;
      t288 = ((cptr)map_self)[2] /* hashval*/ - ((cptr)map_params)[2] /* hashval*/;
      ((cptr)map_self)[2] /* hashval*/ = t288;
    };
  }else{
    t289 = ((cptr)(((cptr)map_self)[0]))[182];
    t290 = ((f0)t289)((cint)map_self, (cint)map_params); /* other_params*/
    map_other_pars = t290;
    t292 = ((cptr)(((cptr)map_oldob)[0]))[15];
    t293 = ((f0)t292)((cint)map_oldob, (cint)map_other_pars, (cint)map_new_val, (cint)map_op); /* Assign_to_component*/
    map_oldob = t293;
    ((cptr)(((cptr)map_self)[11] /* y*/))[map_pos] = map_oldob;
  };
  t258_label: return t258;
}

void init_map(){
  copy_meth_table(map_methods, object_methods);
  map_methods[0] = 48;
  map_methods[3] = map_alloc;
  map_methods[4] = map_reclaim;
  map_methods[9] = map_Apply;
  map_methods[77] = map_Make_parameter;
  map_methods[181] = map_map_params;
  map_methods[182] = map_other_params;
  map_methods[15] = map_Assign_to_component;
  map_methods[21] = map_copy_of;
  map_methods[183] = map_domain_violated;
  map_methods[37] = map_equal;
  map_methods[276] = map_found;
  map_methods[162] = map_increase_size_and_rehash;
  map_methods[184] = map_get_pos_in_x;
  map_methods[51] = map_Indexed;
  map_methods[68] = map_Make_list;
  map_methods[74] = map_Make_set;
  map_methods[88] = map_Mkstr;
  map_methods[185] = map_update_y;
}
