#include "cdefs.h"
#include "mem.h"
extern cptr object_methods[meth_max];
extern cptr collection_methods[meth_max];
extern cptr list_methods[meth_max];
extern cptr plist_methods[meth_max];
#include "cobarray.h"
#include "cint.h"
extern cptr boolean_methods[meth_max];
extern cptr strpool_methods[meth_max];
extern cptr ulist_methods[meth_max];

extern cint boolean_True;
extern cint object_Undefined;
extern cint boolean_False;
extern cint strpool_str_30;
extern cint strpool_str_41;


cptr slist_methods[meth_max];

cint slist_alloc(cint slist_self, cint slist_max){
  cint slist_result, slist_buf;
  cint t1, t2, t3, t4, t5;
  t2 = slist_max == 0;
  if (t2){
    slist_max = 16;
  };
  t3 = slist_max * 4;
  slist_buf = cobarray_mem_malloc((cint)t3);
  t4 = slist_buf == 0;
  if (t4){
    object_reclaim((cint)slist_self);
    t1 = object_Undefined;
    goto t1_label;
  };
  t5 = list_alloc((cint)slist_self);
  slist_result = t5;
  ((cptr)slist_self)[5] /* representation*/ = strpool_str_41;
  ((cptr)slist_self)[8] /* elems*/ = slist_buf;
  ((cptr)slist_self)[9] /* max_elems*/ = slist_max;
  t1 = slist_result;
  goto t1_label;
  t1_label: return t1;
}

cint slist_reclaim(cint slist_self){
  cint slist_i;
  cint t6, t8;
  t8 = ((cptr)slist_self)[3] /* len*/ - 1;
  for (slist_i = 0; slist_i <= t8; slist_i++){
    object_Dec_ref(((cptr)(((cptr)slist_self)[8] /* elems*/))[slist_i]);
  };t7:;
  cobarray_mem_free((cint)((cptr)slist_self)[8] /* elems*/);
  list_reclaim((cint)slist_self);
  t6_label: return t6;
}

cint slist_All_but_last(cint slist_self){
  cint slist_result, slist_item;
  cint t9, t10, t11, t12, t13, t14, t15;
  t10 = ((cptr)slist_self)[3] /* len*/ <= 0;
  if (t10){
    object_Dec_ref(slist_self);
    t9 = object_Undefined;
    goto t9_label;
  };
  t11 = ((cptr)(((cptr)slist_self)[0]))[21];
  t12 = ((f0)t11)((cint)slist_self); /* copy_of*/
  slist_result = t12;
  t14 = ((cptr)slist_result)[3] /* len*/ - 1;
  ((cptr)slist_result)[3] /* len*/ = t14;
  slist_item = ((cptr)(((cptr)slist_result)[8] /* elems*/))[((cptr)slist_result)[3] /* len*/];
  t15 = ((cptr)slist_result)[2] /* hashval*/ - ((cptr)slist_item)[2] /* hashval*/;
  ((cptr)slist_result)[2] /* hashval*/ = t15;
  object_Dec_ref(slist_item);
  t9 = slist_result;
  goto t9_label;
  t9_label: return t9;
}

cint slist_Append(cint slist_self, cint slist_item){
  cint slist_result, slist_incr, slist_buf, slist_i;
  cint t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t33, t34, t35;
  t17 = ((cptr)(((cptr)slist_self)[0]))[21];
  t18 = ((f0)t17)((cint)slist_self); /* copy_of*/
  slist_result = t18;
  t20 = ((cptr)slist_result)[3] /* len*/ >= ((cptr)slist_result)[9] /* max_elems*/;
  if (t20){
    t21 = ((cptr)slist_self)[3] /* len*/ >= 1024;
    if (t21){
      t22 = mem_malloc(40); ((cptr)t22)[0] = plist_methods;
      t23 = mem_malloc(40); ((cptr)t23)[0] = slist_methods;
      t24 = slist_alloc((cint)t23, (cint)0);
      t25 = ((cptr)(((cptr)t24)[0]))[7];
      t26 = ((f0)t25)((cint)t24, (cint)slist_item); /* Append*/
      t27 = plist_alloc((cint)t22, (cint)slist_result, (cint)t26);
      t16 = t27;
      goto t16_label;
    };
    slist_incr = 64;
    t29 = 64 > ((cptr)slist_result)[9] /* max_elems*/;
    if (t29){
      slist_incr = ((cptr)slist_result)[9] /* max_elems*/;
    };
    t30 = ((cptr)slist_result)[9] /* max_elems*/ + slist_incr;
    ((cptr)slist_result)[9] /* max_elems*/ = t30;
    t31 = ((cptr)slist_result)[9] /* max_elems*/ * 4;
    slist_buf = cobarray_mem_malloc((cint)t31);
    t33 = ((cptr)slist_result)[3] /* len*/ - 1;
    for (slist_i = 0; slist_i <= t33; slist_i++){
      ((cptr)(slist_buf))[slist_i] = ((cptr)(((cptr)slist_result)[8] /* elems*/))[slist_i];
    };t32:;
    cobarray_mem_free((cint)((cptr)slist_result)[8] /* elems*/);
    ((cptr)slist_result)[8] /* elems*/ = slist_buf;
  };
  t34 = ((cptr)slist_result)[2] /* hashval*/ + ((cptr)slist_item)[2] /* hashval*/;
  ((cptr)slist_result)[2] /* hashval*/ = t34;
  ((cptr)(((cptr)slist_result)[8] /* elems*/))[((cptr)slist_result)[3] /* len*/] = slist_item;
  t35 = ((cptr)slist_result)[3] /* len*/ + 1;
  ((cptr)slist_result)[3] /* len*/ = t35;
  t16 = slist_result;
  goto t16_label;
  t16_label: return t16;
}

cint slist_Contains(cint slist_self, cint slist_ob){
  cint slist_result, slist_i;
  cint t36, t38, t39, t40, t41;
  t38 = ((cptr)slist_self)[3] /* len*/ - 1;
  for (slist_i = 0; slist_i <= t38; slist_i++){
    t39 = ((cptr)(((cptr)slist_ob)[0]))[37];
    t40 = ((f0)t39)((cint)slist_ob, (cint)((cptr)(((cptr)slist_self)[8] /* elems*/))[slist_i]); /* equal*/
    t41 = t40 == 1;
    if (t41){
      object_Dec_ref(slist_self);
      object_Dec_ref(slist_ob);
      t36 = boolean_True;
      goto t36_label;
    };
  };t37:;
  object_Dec_ref(slist_self);
  object_Dec_ref(slist_ob);
  t36 = boolean_False;
  goto t36_label;
  t36_label: return t36;
}

cint slist_copy_of(cint slist_self){
  cint slist_result, slist_i;
  cint t42, t43, t44, t45, t47;
  t43 = ((cptr)slist_self)[1] /* refcount*/ <= 1;
  if (t43){
    t42 = slist_self;
    goto t42_label;
  };
  t44 = mem_malloc(40); ((cptr)t44)[0] = slist_methods;
  t45 = slist_alloc((cint)t44, (cint)((cptr)slist_self)[9] /* max_elems*/);
  slist_result = t45;
  ((cptr)slist_result)[2] /* hashval*/ = ((cptr)slist_self)[2] /* hashval*/;
  ((cptr)slist_result)[3] /* len*/ = ((cptr)slist_self)[3] /* len*/;
  t47 = ((cptr)slist_self)[3] /* len*/ - 1;
  for (slist_i = 0; slist_i <= t47; slist_i++){
    ((cptr)((cptr)(((cptr)slist_self)[8] /* elems*/))[slist_i])[1] += 1;
    ((cptr)(((cptr)slist_result)[8] /* elems*/))[slist_i] = ((cptr)(((cptr)slist_self)[8] /* elems*/))[slist_i];
  };t46:;
  object_Dec_ref(slist_self);
  t42 = slist_result;
  goto t42_label;
  t42_label: return t42;
}

cint slist_Delete_ith(cint slist_self, cint slist_i){
  cint slist_result, slist_j;
  cint t48, t49, t50, t51, t52, t53, t54, t55, t57, t58;
  t49 = ((cptr)(((cptr)slist_self)[0]))[21];
  t50 = ((f0)t49)((cint)slist_self); /* copy_of*/
  slist_result = t50;
  t52 = slist_i - 1;
  t53 = ((cptr)slist_result)[2] /* hashval*/ - ((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t52])[2] /* hashval*/;
  ((cptr)slist_result)[2] /* hashval*/ = t53;
  t54 = slist_i - 1;
  object_Dec_ref(((cptr)(((cptr)slist_result)[8] /* elems*/))[t54]);
  t55 = ((cptr)slist_result)[3] /* len*/ - 1;
  ((cptr)slist_result)[3] /* len*/ = t55;
  t57 = ((cptr)slist_self)[3] /* len*/ - 1;
  for (slist_j = slist_i; slist_j <= t57; slist_j++){
    t58 = slist_j - 1;
    ((cptr)(((cptr)slist_result)[8] /* elems*/))[t58] = ((cptr)(((cptr)slist_result)[8] /* elems*/))[slist_j];
  };t56:;
  t48 = slist_result;
  goto t48_label;
  t48_label: return t48;
}

cint slist_Plus(cint slist_self, cint slist_ob){
  cint slist_result, slist_olst, slist_i;
  cint t59, t60, t61, t62, t63, t64, t65, t66, t67, t68, t70, t71, t72, t73, t74, t75, t76, t77;
  t60 = ((cptr)slist_ob)[4] /* class_of*/ != strpool_str_30;
  if (t60){
    object_Dec_ref(slist_self);
    object_Dec_ref(slist_ob);
    t59 = object_Undefined;
    goto t59_label;
  };
  t61 = ((cptr)slist_self)[3] /* len*/ == 0;
  if (t61){
    object_Dec_ref(slist_self);
    t59 = slist_ob;
    goto t59_label;
  };
  slist_olst = slist_ob;
  t62 = ((cptr)slist_self)[3] /* len*/ + ((cptr)slist_olst)[3] /* len*/;
  t63 = t62 <= 16;
  t64 = t63;
  if (!t64){    t65 = ((cptr)slist_self)[3] /* len*/ + ((cptr)slist_olst)[3] /* len*/;
    t66 = t65 <= ((cptr)slist_self)[9] /* max_elems*/;
    t67 = t66;
    if (t67){
      t68 = ((cptr)slist_self)[1] /* refcount*/ == 1;
      t67 = t68;
    };
    t64 = t67;
  };
  if (t64){
    slist_result = slist_self;
    for (slist_i = 1; slist_i <= ((cptr)slist_olst)[3] /* len*/; slist_i++){
      t72 = ((cptr)(((cptr)slist_olst)[0]))[62];
      t71 = ((f0)t72)((cint)slist_olst, (cint)slist_i); /* lookup*/
      ((cptr)t71)[1] += 1;
      t73 = ((cptr)(((cptr)slist_result)[0]))[7];
      t74 = ((f0)t73)((cint)slist_result, (cint)t71); /* Append*/
      slist_result = t74;
    };t69:;
    object_Dec_ref(slist_olst);
  }else{
    t76 = mem_malloc(40); ((cptr)t76)[0] = plist_methods;
    t77 = plist_alloc((cint)t76, (cint)slist_self, (cint)slist_olst);
    t59 = t77;
    goto t59_label;
  };
  t59 = slist_result;
  goto t59_label;
  t59_label: return t59;
}

cint slist_lookup(cint slist_self, cint slist_i){
  cint slist_result;
  cint t78, t79, t80, t81, t82;
  t79 = slist_i < 1;
  t80 = t79;
  if (!t80){    t81 = slist_i > ((cptr)slist_self)[3] /* len*/;
    t80 = t81;
  };
  if (t80){
    t78 = object_Undefined;
    goto t78_label;
  };
  t82 = slist_i - 1;
  t78 = ((cptr)(((cptr)slist_self)[8] /* elems*/))[t82];
  goto t78_label;
  t78_label: return t78;
}

cint slist_Trim_trailing_undefineds(cint slist_self){
  cint slist_result;
  cint t83, t84, t85, t86, t89, t90, t91, t92, t93;
  t84 = ((cptr)(((cptr)slist_self)[0]))[21];
  t85 = ((f0)t84)((cint)slist_self); /* copy_of*/
  slist_result = t85;
  t87:
  t89 = ((cptr)slist_result)[3] /* len*/ > 0;
  t90 = t89;
  if (t90){
    t91 = ((cptr)slist_result)[3] /* len*/ - 1;
    t92 = ((cptr)(((cptr)slist_result)[8] /* elems*/))[t91] == object_Undefined;
    t90 = t92;
  };
  if (!t90) goto t88;
    t93 = ((cptr)slist_result)[3] /* len*/ - 1;
    ((cptr)slist_result)[3] /* len*/ = t93;
  goto t87;
  t88:;
  t83 = slist_result;
  goto t83_label;
  t83_label: return t83;
}

cint slist_update(cint slist_self, cint slist_i, cint slist_ob, cint slist_op){
  cint slist_result, slist_j, slist_ul;
  cint t94, t95, t96, t97, t98, t99, t101, t102, t103, t104, t105, t106, t107, t108, t109, t110, t111, t112, t113, t114, t115, t116, t117, t118, t119, t120, t121, t122, t123, t124, t125, t126, t127, t128, t129, t130, t131, t132, t133, t134, t135, t136, t138, t139, t140, t141, t142, t143, t144, t145, t146, t147, t148, t149, t150, t151, t152, t153, t154, t155, t156, t157, t158, t159, t160, t161, t162, t163, t166, t167, t168, t169, t170;
  t95 = ((cptr)(((cptr)slist_self)[0]))[21];
  t96 = ((f0)t95)((cint)slist_self); /* copy_of*/
  slist_result = t96;
  t98 = slist_i <= ((cptr)slist_result)[9] /* max_elems*/;
  if (t98){
    t99 = slist_i > ((cptr)slist_result)[3] /* len*/;
    if (t99){
      t101 = slist_i - 1;
      for (slist_j = ((cptr)slist_result)[3] /* len*/; slist_j <= t101; slist_j++){
        ((cptr)(((cptr)slist_result)[8] /* elems*/))[slist_j] = object_Undefined;
      };t100:;
    }else{
      t102 = slist_i - 1;
      t103 = ((cptr)slist_result)[2] /* hashval*/ - ((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t102])[2] /* hashval*/;
      ((cptr)slist_result)[2] /* hashval*/ = t103;
    };
    t104 = slist_op == 0;
    if (t104){
      t105 = slist_i - 1;
      object_Dec_ref(((cptr)(((cptr)slist_result)[8] /* elems*/))[t105]);
    };
    t106 = slist_op == 1;
    if (t106){
      t107 = slist_i - 1;
      t108 = ((cptr)(((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t107])[0]))[31];
      t109 = ((f0)t108)((cint)((cptr)(((cptr)slist_result)[8] /* elems*/))[t107], (cint)slist_ob); /* Divide*/
      slist_ob = t109;
    };
    t111 = slist_op == 2;
    if (t111){
      t112 = slist_i - 1;
      t113 = ((cptr)(((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t112])[0]))[83];
      t114 = ((f0)t113)((cint)((cptr)(((cptr)slist_result)[8] /* elems*/))[t112], (cint)slist_ob); /* Minus*/
      slist_ob = t114;
    };
    t116 = slist_op == 3;
    if (t116){
      t117 = slist_i - 1;
      t118 = ((cptr)(((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t117])[0]))[89];
      t119 = ((f0)t118)((cint)((cptr)(((cptr)slist_result)[8] /* elems*/))[t117], (cint)slist_ob); /* Multiply*/
      slist_ob = t119;
    };
    t121 = slist_op == 4;
    if (t121){
      t122 = slist_i - 1;
      t123 = ((cptr)(((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t122])[0]))[97];
      t124 = ((f0)t123)((cint)((cptr)(((cptr)slist_result)[8] /* elems*/))[t122], (cint)slist_ob); /* Plus*/
      slist_ob = t124;
    };
    t126 = slist_op == 5;
    if (t126){
      t127 = slist_i - 1;
      t128 = ((cptr)(((cptr)((cptr)(((cptr)slist_result)[8] /* elems*/))[t127])[0]))[7];
      t129 = ((f0)t128)((cint)((cptr)(((cptr)slist_result)[8] /* elems*/))[t127], (cint)slist_ob); /* Append*/
      slist_ob = t129;
    };
    t131 = slist_i - 1;
    ((cptr)(((cptr)slist_result)[8] /* elems*/))[t131] = slist_ob;
    t132 = ((cptr)slist_result)[2] /* hashval*/ + ((cptr)slist_ob)[2] /* hashval*/;
    ((cptr)slist_result)[2] /* hashval*/ = t132;
    t133 = slist_i > ((cptr)slist_result)[3] /* len*/;
    if (t133){
      ((cptr)slist_result)[3] /* len*/ = slist_i;
    };
  }else{
  t134 = slist_i - ((cptr)slist_result)[3] /* len*/;
  t135 = t134 < 16;
  if (t135){
    t136 = slist_op != 0;
    if (t136){
      object_Dec_ref(slist_ob);
      t94 = slist_result;
      goto t94_label;
    };
    t138 = slist_i - 1;
    for (slist_j = ((cptr)slist_result)[3] /* len*/; slist_j <= t138; slist_j++){
      t139 = ((cptr)(((cptr)slist_result)[0]))[7];
      t140 = ((f0)t139)((cint)slist_result, (cint)object_Undefined); /* Append*/
      slist_result = t140;
    };t137:;
    t142 = ((cptr)(((cptr)slist_result)[0]))[130];
    t143 = ((f0)t142)((cint)slist_result, (cint)slist_i, (cint)slist_ob, (cint)slist_op); /* update*/
    slist_result = t143;
  }else{
    t145 = slist_op != 0;
    if (t145){
      object_Dec_ref(slist_ob);
      t94 = slist_self;
      goto t94_label;
    };
    t146 = mem_malloc(32); ((cptr)t146)[0] = ulist_methods;
    t147 = slist_i - ((cptr)slist_result)[3] /* len*/;
    t148 = t147 - 1;
    t149 = ulist_alloc((cint)t146, (cint)t148);
    slist_ul = t149;
    t150 = ((cptr)slist_result)[3] /* len*/ > 0;
    if (t150){
      t151 = ((cptr)(((cptr)slist_result)[0]))[97];
      t152 = ((f0)t151)((cint)slist_result, (cint)slist_ul); /* Plus*/
      t154 = ((cptr)(((cptr)t152)[0]))[7];
      t155 = ((f0)t154)((cint)t152, (cint)slist_ob); /* Append*/
      t94 = t155;
      goto t94_label;
    };
    t157 = ((cptr)(((cptr)slist_result)[0]))[7];
    t158 = ((f0)t157)((cint)slist_result, (cint)slist_ob); /* Append*/
    t159 = ((cptr)(((cptr)slist_ul)[0]))[97];
    t160 = ((f0)t159)((cint)slist_ul, (cint)t158); /* Plus*/
    t94 = t160;
    goto t94_label;
  };};
  t163 = ((cptr)slist_result)[3] /* len*/ - 1;
  slist_i = t163;
  t164:
  t166 = slist_i >= 0;
  t167 = t166;
  if (t167){
    t168 = ((cptr)(((cptr)slist_result)[8] /* elems*/))[slist_i] == object_Undefined;
    t167 = t168;
  };
  if (!t167) goto t165;
    t169 = slist_i - 1;
    slist_i = t169;
  goto t164;
  t165:;
  t170 = slist_i + 1;
  ((cptr)slist_result)[3] /* len*/ = t170;
  t94 = slist_result;
  goto t94_label;
  t94_label: return t94;
}

cint slist_Sort(cint slist_self, cint slist_ord){
  cint slist_result;
  cint t171, t172, t173, t174, t175;
  t172 = ((cptr)(((cptr)slist_self)[0]))[21];
  t173 = ((f0)t172)((cint)slist_self); /* copy_of*/
  slist_result = t173;
  t175 = (cptr)(((cptr)(((cptr)slist_result)[0]))[158]); /* qsort*/
  ((f0)t175)((cint)slist_result, (cint)1, (cint)((cptr)slist_self)[3] /* len*/, (cint)slist_ord);
  object_Dec_ref(slist_ord);
  t171 = slist_result;
  goto t171_label;
  t171_label: return t171;
}

cint slist_qsort(cint slist_self, cint slist_i, cint slist_j, cint slist_ord){
  cint slist_k;
  cint t176, t177, t178, t179, t180, t181, t182, t183, t184;
  t177 = slist_i >= slist_j;
  if (t177){
    goto t176_label;
  };
  t178 = ((cptr)(((cptr)slist_self)[0]))[159];
  t179 = ((f0)t178)((cint)slist_self, (cint)slist_i, (cint)slist_j, (cint)slist_ord); /* partition_and_return_pivot_pos*/
  slist_k = t179;
  t181 = slist_k - 1;
  t182 = (cptr)(((cptr)(((cptr)slist_self)[0]))[158]); /* qsort*/
  ((f0)t182)((cint)slist_self, (cint)slist_i, (cint)t181, (cint)slist_ord);
  t183 = slist_k + 1;
  t184 = (cptr)(((cptr)(((cptr)slist_self)[0]))[158]); /* qsort*/
  ((f0)t184)((cint)slist_self, (cint)t183, (cint)slist_j, (cint)slist_ord);
  t176_label: return t176;
}

cint slist_partition_and_return_pivot_pos(cint slist_self, cint slist_i, cint slist_j, cint slist_ord){
  cint slist_result, slist_temp, slist_k, slist_l;
  cint t185, t188, t189, t190, t191, t192, t193, t194, t197, t198, t199, t200, t203, t204, t205, t206, t207, t210, t211, t212, t213, t216, t217, t218, t219, t220, t221, t222, t223;
  slist_k = slist_i;
  t186:
    t188 = slist_k + 1;
    slist_k = t188;
  t191 = slist_k >= slist_j;
  t192 = t191;
  if (!t192){  t189 = ((cptr)(((cptr)slist_self)[0]))[160];
  t190 = ((f0)t189)((cint)slist_self, (cint)slist_i, (cint)slist_k, (cint)slist_ord); /* in_order*/
    t193 = t190 == 1;
    t192 = t193;
  };
  if (!t192) goto t186;
  t187:;
  t194 = slist_j + 1;
  slist_l = t194;
  t195:
    t197 = slist_l - 1;
    slist_l = t197;
  t198 = ((cptr)(((cptr)slist_self)[0]))[160];
  t199 = ((f0)t198)((cint)slist_self, (cint)slist_i, (cint)slist_l, (cint)slist_ord); /* in_order*/
  t200 = t199 == 0;
  if (!t200) goto t195;
  t196:;
  t201:
  t203 = slist_k < slist_l;
  if (!t203) goto t202;
    t204 = slist_k - 1;
    slist_temp = ((cptr)(((cptr)slist_self)[8] /* elems*/))[t204];
    t205 = slist_k - 1;
    t206 = slist_l - 1;
    ((cptr)(((cptr)slist_self)[8] /* elems*/))[t205] = ((cptr)(((cptr)slist_self)[8] /* elems*/))[t206];
    t207 = slist_l - 1;
    ((cptr)(((cptr)slist_self)[8] /* elems*/))[t207] = slist_temp;
    t208:
      t210 = slist_k + 1;
      slist_k = t210;
    t211 = ((cptr)(((cptr)slist_self)[0]))[160];
    t212 = ((f0)t211)((cint)slist_self, (cint)slist_i, (cint)slist_k, (cint)slist_ord); /* in_order*/
    t213 = t212 == 1;
    if (!t213) goto t208;
    t209:;
    t214:
      t216 = slist_l - 1;
      slist_l = t216;
    t217 = ((cptr)(((cptr)slist_self)[0]))[160];
    t218 = ((f0)t217)((cint)slist_self, (cint)slist_i, (cint)slist_l, (cint)slist_ord); /* in_order*/
    t219 = t218 == 0;
    if (!t219) goto t214;
    t215:;
  goto t201;
  t202:;
  t220 = slist_i - 1;
  slist_temp = ((cptr)(((cptr)slist_self)[8] /* elems*/))[t220];
  t221 = slist_i - 1;
  t222 = slist_l - 1;
  ((cptr)(((cptr)slist_self)[8] /* elems*/))[t221] = ((cptr)(((cptr)slist_self)[8] /* elems*/))[t222];
  t223 = slist_l - 1;
  ((cptr)(((cptr)slist_self)[8] /* elems*/))[t223] = slist_temp;
  t185 = slist_l;
  goto t185_label;
  t185_label: return t185;
}

cint slist_in_order(cint slist_self, cint slist_i, cint slist_j, cint slist_ord){
  cint slist_result;
  cint t224, t225, t226, t227, t228, t229, t230, t231, t232, t233, t234, t235, t236, t237, t238, t239, t240, t241, t242, t243, t244, t245, t246, t247, t248;
  t225 = slist_i < 1;
  t226 = t225;
  if (!t226){    t227 = slist_i > ((cptr)slist_self)[3] /* len*/;
    t226 = t227;
  };
  if (t226){
    t224 = 1;
    goto t224_label;
  };
  t228 = slist_j < 1;
  t229 = t228;
  if (!t229){    t230 = slist_j > ((cptr)slist_self)[3] /* len*/;
    t229 = t230;
  };
  if (t229){
    t224 = 1;
    goto t224_label;
  };
  t231 = slist_ord == object_Undefined;
  if (t231){
    t232 = slist_i - 1;
    t233 = slist_j - 1;
    t234 = ((cptr)(((cptr)((cptr)(((cptr)slist_self)[8] /* elems*/))[t232])[0]))[60];
    t235 = ((f0)t234)((cint)((cptr)(((cptr)slist_self)[8] /* elems*/))[t232], (cint)((cptr)(((cptr)slist_self)[8] /* elems*/))[t233]); /* less_than*/
    t224 = t235;
    goto t224_label;
  };
  ((cptr)slist_ord)[1] += 1;
  t237 = mem_malloc(40); ((cptr)t237)[0] = slist_methods;
  t238 = slist_alloc((cint)t237, (cint)1);
  ((cptr)t238)[1] += 1;
  t239 = slist_i - 1;
  ((cptr)((cptr)(((cptr)slist_self)[8] /* elems*/))[t239])[1] += 1;
  t242 = ((cptr)(((cptr)t238)[0]))[7];
  t241 = ((f0)t242)((cint)t238, (cint)((cptr)(((cptr)slist_self)[8] /* elems*/))[t239]); /* Append*/
  ((cptr)t241)[1] += 1;
  t243 = slist_j - 1;
  ((cptr)((cptr)(((cptr)slist_self)[8] /* elems*/))[t243])[1] += 1;
  t244 = ((cptr)(((cptr)t241)[0]))[7];
  t245 = ((f0)t244)((cint)t241, (cint)((cptr)(((cptr)slist_self)[8] /* elems*/))[t243]); /* Append*/
  t246 = ((cptr)(((cptr)slist_ord)[0]))[9];
  t247 = ((f0)t246)((cint)slist_ord, (cint)t245); /* Apply*/
  t248 = t247 == boolean_True;
  if (t248){
    t224 = 1;
    goto t224_label;
  };
  t224 = 0;
  goto t224_label;
  t224_label: return t224;
}

void init_slist(){
  copy_meth_table(slist_methods, list_methods);
  slist_methods[0] = 40;
  slist_methods[3] = slist_alloc;
  slist_methods[4] = slist_reclaim;
  slist_methods[6] = slist_All_but_last;
  slist_methods[7] = slist_Append;
  slist_methods[20] = slist_Contains;
  slist_methods[21] = slist_copy_of;
  slist_methods[29] = slist_Delete_ith;
  slist_methods[97] = slist_Plus;
  slist_methods[62] = slist_lookup;
  slist_methods[107] = slist_Trim_trailing_undefineds;
  slist_methods[130] = slist_update;
  slist_methods[103] = slist_Sort;
  slist_methods[158] = slist_qsort;
  slist_methods[159] = slist_partition_and_return_pivot_pos;
  slist_methods[160] = slist_in_order;
}
