mono_varlist_insert_sorted (struct MonoCompile * cfg, struct GList * list, struct MonoMethodVar * mv, int sort_type)
{
  struct GList * D.21923;
  int D.21926;
  int D.21927;
  unsigned int D.21933;
  unsigned int D.21934;
  unsigned int D.21938;
  unsigned int D.21939;
  struct GList * l;

  if (list == 0B) goto <D.21921>; else goto <D.21922>;
  <D.21921>:
  D.21923 = monoeg_g_list_prepend (0B, mv);
  return D.21923;
  <D.21922>:
  l = list;
  goto <D.21794>;
  <D.21793>:
  {
    struct MonoMethodVar * v1;

    v1 = l->data;
    if (sort_type == 2) goto <D.21924>; else goto <D.21925>;
    <D.21924>:
    D.21926 = mv->spill_costs;
    D.21927 = v1->spill_costs;
    if (D.21926 >= D.21927) goto <D.21928>; else goto <D.21929>;
    <D.21928>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.21792>;
    <D.21929>:
    goto <D.21930>;
    <D.21925>:
    if (sort_type == 1) goto <D.21931>; else goto <D.21932>;
    <D.21931>:
    D.21933 = mv->range.last_use.abs_pos;
    D.21934 = v1->range.last_use.abs_pos;
    if (D.21933 <= D.21934) goto <D.21935>; else goto <D.21936>;
    <D.21935>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.21792>;
    <D.21936>:
    goto <D.21937>;
    <D.21932>:
    D.21938 = mv->range.first_use.abs_pos;
    D.21939 = v1->range.first_use.abs_pos;
    if (D.21938 <= D.21939) goto <D.21940>; else goto <D.21941>;
    <D.21940>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.21792>;
    <D.21941>:
    <D.21937>:
    <D.21930>:
  }
  l = l->next;
  <D.21794>:
  if (l != 0B) goto <D.21793>; else goto <D.21792>;
  <D.21792>:
  if (l == 0B) goto <D.21942>; else goto <D.21943>;
  <D.21942>:
  list = monoeg_g_list_append (list, mv);
  <D.21943>:
  D.21923 = list;
  return D.21923;
}


mono_varlist_sort (struct MonoCompile * cfg, struct GList * list, int sort_type)
{
  struct GList * D.21947;

  if (sort_type == 0) goto <D.21945>; else goto <D.21946>;
  <D.21945>:
  D.21947 = monoeg_g_list_sort (list, compare_by_first_use_func);
  return D.21947;
  <D.21946>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "linear-scan.c", 66);
  D.21947 = 0B;
  return D.21947;
}


compare_by_first_use_func (const void * a, const void * b)
{
  gint D.21949;
  unsigned int D.21950;
  unsigned int D.21951;
  unsigned int D.21952;
  struct MonoMethodVar * v1;
  struct MonoMethodVar * v2;

  v1 = a;
  v2 = b;
  D.21950 = v1->range.first_use.abs_pos;
  D.21951 = v2->range.first_use.abs_pos;
  D.21952 = D.21950 - D.21951;
  D.21949 = (gint) D.21952;
  return D.21949;
}


mono_linear_scan (struct MonoCompile * cfg, struct GList * vars, struct GList * regs, regmask_t * used_mask)
{
  void * D.21956;
  struct MonoLiveInterval * D.21957;
  unsigned int D.21960;
  void * D.21961;
  unsigned int regnum.0;
  _Bool D.21963;
  long int D.21964;
  long int D.21965;
  unsigned char D.21968;
  unsigned char D.21969;
  unsigned int D.21972;
  unsigned int D.21973;
  int D.21975;
  void * D.21976;
  int D.21977;
  int D.21978;
  int D.21979;
  unsigned int D.21983;
  unsigned int max_regs.1;
  int D.21986;
  unsigned int D.21987;
  int D.21993;
  unsigned int D.21995;
  _Bool D.21999;
  long int D.22000;
  long int D.22001;
  void * D.22004;
  int D.22005;
  int D.22006;
  long long int D.22007;
  signed int D.22008;
  signed int used_regs.2;
  signed int D.22010;
  int D.22015;
  unsigned int D.22016;
  unsigned int D.22017;
  struct MonoInst * * D.22019;
  unsigned int D.22020;
  unsigned int D.22021;
  struct MonoInst * * D.22022;
  struct MonoInst * D.22023;
  short unsigned int D.22024;
  unsigned int D.22026;
  int D.22029;
  const char * D.22032;
  unsigned int D.22033;
  unsigned int D.22040;
  unsigned int D.22041;
  struct GList * l;
  struct GList * a;
  struct GList * active;
  struct MonoMethodVar * vmv;
  struct MonoMethodVar * amv;
  int max_regs;
  int n_regvars;
  int gains[32];
  regmask_t used_regs;
  gboolean cost_driven;

  try
    {
      active = 0B;
      used_regs = 0;
      if (vars != 0B) goto <D.21954>; else goto <D.21955>;
      <D.21954>:
      D.21956 = vars->data;
      D.21957 = MEM[(struct MonoMethodVar *)D.21956].interval;
      if (D.21957 != 0B) goto <D.21958>; else goto <D.21959>;
      <D.21958>:
      mono_linear_scan2 (cfg, vars, regs, used_mask);
      return;
      <D.21959>:
      <D.21955>:
      cost_driven = 1;
      D.21960 = monoeg_g_list_length (regs);
      max_regs = (int) D.21960;
      l = regs;
      goto <D.21824>;
      <D.21823>:
      {
        int regnum;

        D.21961 = l->data;
        regnum = (int) D.21961;
        regnum.0 = (unsigned int) regnum;
        D.21963 = regnum.0 > 31;
        D.21964 = (long int) D.21963;
        D.21965 = __builtin_expect (D.21964, 0);
        if (D.21965 != 0) goto <D.21966>; else goto <D.21967>;
        <D.21966>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 105, "regnum < G_N_ELEMENTS (gains)");
        <D.21967>:
        gains[regnum] = 0;
      }
      l = l->next;
      <D.21824>:
      if (l != 0B) goto <D.21823>; else goto <D.21825>;
      <D.21825>:
      l = vars;
      goto <D.21830>;
      <D.21829>:
      vmv = l->data;
      D.21968 = BIT_FIELD_REF <*cfg, 8, 3400>;
      D.21969 = D.21968 & 128;
      if (D.21969 == 0) goto <D.21970>; else goto <D.21971>;
      <D.21970>:
      goto <D.21828>;
      <D.21827>:
      amv = active->data;
      D.21972 = amv->range.last_use.abs_pos;
      D.21973 = vmv->range.first_use.abs_pos;
      if (D.21972 > D.21973) goto <D.21826>; else goto <D.21974>;
      <D.21974>:
      active = monoeg_g_list_delete_link (active, active);
      D.21975 = amv->reg;
      D.21976 = (void *) D.21975;
      regs = monoeg_g_list_prepend (regs, D.21976);
      D.21975 = amv->reg;
      D.21975 = amv->reg;
      D.21977 = gains[D.21975];
      D.21978 = amv->spill_costs;
      D.21979 = D.21977 + D.21978;
      gains[D.21975] = D.21979;
      <D.21828>:
      if (active != 0B) goto <D.21827>; else goto <D.21826>;
      <D.21826>:
      <D.21971>:
      if (active != 0B) goto <D.21982>; else goto <D.21980>;
      <D.21982>:
      D.21983 = monoeg_g_list_length (active);
      max_regs.1 = (unsigned int) max_regs;
      if (D.21983 == max_regs.1) goto <D.21985>; else goto <D.21980>;
      <D.21985>:
      D.21986 = max_regs + -1;
      D.21987 = (unsigned int) D.21986;
      a = monoeg_g_list_nth (active, D.21987);
      amv = a->data;
      if (cost_driven != 0) goto <D.21992>; else goto <D.21988>;
      <D.21992>:
      D.21978 = amv->spill_costs;
      D.21993 = vmv->spill_costs;
      if (D.21978 < D.21993) goto <D.21989>; else goto <D.21988>;
      <D.21988>:
      if (cost_driven == 0) goto <D.21994>; else goto <D.21990>;
      <D.21994>:
      D.21972 = amv->range.last_use.abs_pos;
      D.21995 = vmv->range.last_use.abs_pos;
      if (D.21972 > D.21995) goto <D.21989>; else goto <D.21990>;
      <D.21989>:
      D.21975 = amv->reg;
      vmv->reg = D.21975;
      amv->reg = -1;
      active = monoeg_g_list_delete_link (active, a);
      if (cost_driven != 0) goto <D.21996>; else goto <D.21997>;
      <D.21996>:
      active = mono_varlist_insert_sorted (cfg, active, vmv, 2);
      goto <D.21998>;
      <D.21997>:
      active = mono_varlist_insert_sorted (cfg, active, vmv, 1);
      <D.21998>:
      goto <D.21991>;
      <D.21990>:
      vmv->reg = -1;
      <D.21991>:
      goto <D.21981>;
      <D.21980>:
      D.21999 = regs == 0B;
      D.22000 = (long int) D.21999;
      D.22001 = __builtin_expect (D.22000, 0);
      if (D.22001 != 0) goto <D.22002>; else goto <D.22003>;
      <D.22002>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 168, "regs");
      <D.22003>:
      D.22004 = regs->data;
      D.22005 = (int) D.22004;
      vmv->reg = D.22005;
      D.22006 = vmv->reg;
      D.22007 = 1 << D.22006;
      D.22008 = (signed int) D.22007;
      used_regs.2 = (signed int) used_regs;
      D.22010 = D.22008 | used_regs.2;
      used_regs = (regmask_t) D.22010;
      regs = monoeg_g_list_delete_link (regs, regs);
      active = mono_varlist_insert_sorted (cfg, active, vmv, 1);
      <D.21981>:
      l = l->next;
      <D.21830>:
      if (l != 0B) goto <D.21829>; else goto <D.21831>;
      <D.21831>:
      a = active;
      goto <D.21833>;
      <D.21832>:
      amv = a->data;
      D.21975 = amv->reg;
      D.21975 = amv->reg;
      D.21977 = gains[D.21975];
      D.21978 = amv->spill_costs;
      D.21979 = D.21977 + D.21978;
      gains[D.21975] = D.21979;
      a = a->next;
      <D.21833>:
      if (a != 0B) goto <D.21832>; else goto <D.21834>;
      <D.21834>:
      n_regvars = 0;
      l = vars;
      goto <D.21836>;
      <D.21835>:
      vmv = l->data;
      D.22006 = vmv->reg;
      if (D.22006 >= 0) goto <D.22011>; else goto <D.22012>;
      <D.22011>:
      D.22006 = vmv->reg;
      D.22015 = gains[D.22006];
      D.22016 = (unsigned int) D.22015;
      D.22017 = mono_arch_regalloc_cost (cfg, vmv);
      if (D.22016 > D.22017) goto <D.22018>; else goto <D.22013>;
      <D.22018>:
      D.22019 = cfg->varinfo;
      D.22020 = vmv->idx;
      D.22021 = D.22020 * 4;
      D.22022 = D.22019 + D.22021;
      D.22023 = *D.22022;
      D.22024 = D.22023->opcode;
      if (D.22024 != 366) goto <D.22025>; else goto <D.22013>;
      <D.22025>:
      D.22026 = cfg->verbose_level;
      if (D.22026 > 2) goto <D.22027>; else goto <D.22028>;
      <D.22027>:
      D.21993 = vmv->spill_costs;
      D.22006 = vmv->reg;
      D.22020 = vmv->idx;
      D.22019 = cfg->varinfo;
      D.22020 = vmv->idx;
      D.22021 = D.22020 * 4;
      D.22022 = D.22019 + D.22021;
      D.22023 = *D.22022;
      D.22029 = D.22023->dreg;
      printf ("ALLOCATED R%d(%d) TO HREG %d COST %d\n", D.22029, D.22020, D.22006, D.21993);
      <D.22028>:
      D.22019 = cfg->varinfo;
      D.22020 = vmv->idx;
      D.22021 = D.22020 * 4;
      D.22022 = D.22019 + D.22021;
      D.22023 = *D.22022;
      D.22023->opcode = 366;
      D.22019 = cfg->varinfo;
      D.22020 = vmv->idx;
      D.22021 = D.22020 * 4;
      D.22022 = D.22019 + D.22021;
      D.22023 = *D.22022;
      D.22006 = vmv->reg;
      D.22023->dreg = D.22006;
      n_regvars = n_regvars + 1;
      goto <D.22014>;
      <D.22013>:
      D.22026 = cfg->verbose_level;
      if (D.22026 > 2) goto <D.22030>; else goto <D.22031>;
      <D.22030>:
      D.22006 = vmv->reg;
      D.22032 = mono_arch_regname (D.22006);
      D.22033 = mono_arch_regalloc_cost (cfg, vmv);
      D.21993 = vmv->spill_costs;
      D.22020 = vmv->idx;
      printf ("COSTLY: R%d C%d C%d %s\n", D.22020, D.21993, D.22033, D.22032);
      <D.22031>:
      vmv->reg = -1;
      <D.22014>:
      <D.22012>:
      D.22006 = vmv->reg;
      if (D.22006 == -1) goto <D.22034>; else goto <D.22035>;
      <D.22034>:
      D.22026 = cfg->verbose_level;
      if (D.22026 > 2) goto <D.22036>; else goto <D.22037>;
      <D.22036>:
      D.22020 = vmv->idx;
      printf ("NOT REGVAR: %d\n", D.22020);
      <D.22037>:
      <D.22035>:
      l = l->next;
      <D.21836>:
      if (l != 0B) goto <D.21835>; else goto <D.21837>;
      <D.21837>:
      cfg->stat_n_regvars = n_regvars;
      used_regs = 0;
      l = vars;
      goto <D.21839>;
      <D.21838>:
      vmv = l->data;
      D.22006 = vmv->reg;
      if (D.22006 >= 0) goto <D.22038>; else goto <D.22039>;
      <D.22038>:
      D.22006 = vmv->reg;
      D.22007 = 1 << D.22006;
      D.22008 = (signed int) D.22007;
      used_regs.2 = (signed int) used_regs;
      D.22010 = D.22008 | used_regs.2;
      used_regs = (regmask_t) D.22010;
      <D.22039>:
      l = l->next;
      <D.21839>:
      if (l != 0B) goto <D.21838>; else goto <D.21840>;
      <D.21840>:
      D.22040 = *used_mask;
      D.22041 = D.22040 | used_regs;
      *used_mask = D.22041;
      monoeg_g_list_free (regs);
      monoeg_g_list_free (active);
      monoeg_g_list_free (vars);
    }
  finally
    {
      gains = {CLOBBER};
    }
}


mono_linear_scan2 (struct MonoCompile * cfg, struct GList * vars, struct GList * regs, regmask_t * used_mask)
{
  unsigned int D.22045;
  unsigned int n_regs.3;
  unsigned int D.22047;
  struct GList * D.22048;
  struct MonoLiveInterval * D.22049;
  struct MonoLiveRange2 * D.22050;
  struct MonoLiveInterval * D.22053;
  struct MonoLiveRange2 * D.22054;
  int D.22055;
  int D.22058;
  struct MonoLiveInterval * D.22061;
  struct MonoLiveRange2 * D.22062;
  int D.22063;
  int D.22066;
  int D.22069;
  int D.22072;
  struct MonoLiveInterval * D.22075;
  int D.22078;
  _Bool D.22081;
  long int D.22082;
  long int D.22083;
  int D.22086;
  struct MonoLiveRange2 * D.22087;
  int D.22088;
  int D.22091;
  int D.22092;
  int D.22093;
  int D.22094;
  int D.22098;
  int D.22101;
  int D.22102;
  int D.22103;
  int D.22106;
  int iftmp.4;
  struct MonoMethod * D.22110;
  unsigned char D.22111;
  unsigned char D.22112;
  int D.22116;
  unsigned int D.22121;
  void * D.22122;
  int D.22123;
  int D.22126;
  unsigned int D.22127;
  unsigned int D.22128;
  struct MonoInst * * D.22130;
  unsigned int D.22131;
  unsigned int D.22132;
  struct MonoInst * * D.22133;
  struct MonoInst * D.22134;
  short unsigned int D.22135;
  unsigned int D.22137;
  const char * D.22140;
  unsigned int D.22141;
  int D.22142;
  const char * D.22145;
  unsigned int D.22146;
  char * D.22147;
  long long int D.22150;
  signed int D.22151;
  signed int used_regs.5;
  signed int D.22153;
  unsigned int D.22154;
  unsigned int D.22155;
  struct GList * unhandled;
  struct GList * active;
  struct GList * inactive;
  struct GList * l;
  struct MonoMethodVar * vmv;
  gint32 free_pos[32];
  gint32 gains[32];
  regmask_t used_regs;
  int n_regs;
  int n_regvars;
  int i;

  try
    {
      used_regs = 0;
      l = vars;
      goto <D.21870>;
      <D.21869>:
      vmv = l->data;
      l = l->next;
      <D.21870>:
      if (l != 0B) goto <D.21869>; else goto <D.21871>;
      <D.21871>:
      D.22045 = monoeg_g_list_length (regs);
      n_regs = (int) D.22045;
      n_regs.3 = (unsigned int) n_regs;
      D.22047 = n_regs.3 * 4;
      memset (&gains, 0, D.22047);
      D.22048 = monoeg_g_list_copy (vars);
      unhandled = monoeg_g_list_sort (D.22048, compare_by_interval_start_pos_func);
      active = 0B;
      inactive = 0B;
      goto <D.21877>;
      <D.21908>:
      {
        struct MonoMethodVar * current;
        int pos;
        int reg;
        int max_free_pos;
        gboolean changed;

        current = unhandled->data;
        unhandled = monoeg_g_list_delete_link (unhandled, unhandled);
        D.22049 = current->interval;
        D.22050 = D.22049->range;
        if (D.22050 == 0B) goto <D.22051>; else goto <D.22052>;
        <D.22051>:
        // predicted unlikely by continue predictor.
        goto <D.21877>;
        <D.22052>:
        D.22049 = current->interval;
        D.22050 = D.22049->range;
        pos = D.22050->from;
        changed = 1;
        goto <D.21883>;
        <D.21882>:
        changed = 0;
        l = active;
        goto <D.21881>;
        <D.21880>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.22053 = v->interval;
          D.22054 = D.22053->last_range;
          D.22055 = D.22054->to;
          if (D.22055 < pos) goto <D.22056>; else goto <D.22057>;
          <D.22056>:
          active = monoeg_g_list_delete_link (active, l);
          changed = 1;
          goto <D.21879>;
          <D.22057>:
          D.22053 = v->interval;
          D.22058 = mono_linterval_covers (D.22053, pos);
          if (D.22058 == 0) goto <D.22059>; else goto <D.22060>;
          <D.22059>:
          inactive = monoeg_g_list_append (inactive, v);
          active = monoeg_g_list_delete_link (active, l);
          changed = 1;
          goto <D.21879>;
          <D.22060>:
        }
        l = l->next;
        <D.21881>:
        if (l != 0B) goto <D.21880>; else goto <D.21879>;
        <D.21879>:
        <D.21883>:
        if (changed != 0) goto <D.21882>; else goto <D.21884>;
        <D.21884>:
        changed = 1;
        goto <D.21890>;
        <D.21889>:
        changed = 0;
        l = inactive;
        goto <D.21888>;
        <D.21887>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.22061 = v->interval;
          D.22062 = D.22061->last_range;
          D.22063 = D.22062->to;
          if (D.22063 < pos) goto <D.22064>; else goto <D.22065>;
          <D.22064>:
          inactive = monoeg_g_list_delete_link (inactive, l);
          changed = 1;
          goto <D.21886>;
          <D.22065>:
          D.22061 = v->interval;
          D.22066 = mono_linterval_covers (D.22061, pos);
          if (D.22066 != 0) goto <D.22067>; else goto <D.22068>;
          <D.22067>:
          active = monoeg_g_list_append (active, v);
          inactive = monoeg_g_list_delete_link (inactive, l);
          changed = 1;
          goto <D.21886>;
          <D.22068>:
        }
        l = l->next;
        <D.21888>:
        if (l != 0B) goto <D.21887>; else goto <D.21886>;
        <D.21886>:
        <D.21890>:
        if (changed != 0) goto <D.21889>; else goto <D.21891>;
        <D.21891>:
        i = 0;
        goto <D.21893>;
        <D.21892>:
        free_pos[i] = 2147483647;
        i = i + 1;
        <D.21893>:
        if (i < n_regs) goto <D.21892>; else goto <D.21894>;
        <D.21894>:
        l = active;
        goto <D.21897>;
        <D.21896>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.22069 = v->reg;
          if (D.22069 >= 0) goto <D.22070>; else goto <D.22071>;
          <D.22070>:
          D.22069 = v->reg;
          free_pos[D.22069] = 0;
          <D.22071>:
        }
        l = l->next;
        <D.21897>:
        if (l != 0B) goto <D.21896>; else goto <D.21898>;
        <D.21898>:
        l = inactive;
        goto <D.21902>;
        <D.21901>:
        {
          struct MonoMethodVar * v;
          gint32 intersect_pos;

          v = l->data;
          D.22072 = v->reg;
          if (D.22072 >= 0) goto <D.22073>; else goto <D.22074>;
          <D.22073>:
          D.22075 = v->interval;
          D.22049 = current->interval;
          intersect_pos = mono_linterval_get_intersect_pos (D.22049, D.22075);
          if (intersect_pos != -1) goto <D.22076>; else goto <D.22077>;
          <D.22076>:
          D.22072 = v->reg;
          free_pos[D.22072] = intersect_pos;
          <D.22077>:
          <D.22074>:
        }
        l = l->next;
        <D.21902>:
        if (l != 0B) goto <D.21901>; else goto <D.21903>;
        <D.21903>:
        max_free_pos = -1;
        reg = -1;
        i = 0;
        goto <D.21905>;
        <D.21904>:
        D.22078 = free_pos[i];
        if (D.22078 > max_free_pos) goto <D.22079>; else goto <D.22080>;
        <D.22079>:
        reg = i;
        max_free_pos = free_pos[i];
        <D.22080>:
        i = i + 1;
        <D.21905>:
        if (i < n_regs) goto <D.21904>; else goto <D.21906>;
        <D.21906>:
        D.22081 = reg == -1;
        D.22082 = (long int) D.22081;
        D.22083 = __builtin_expect (D.22082, 0);
        if (D.22083 != 0) goto <D.22084>; else goto <D.22085>;
        <D.22084>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 402, "reg != -1");
        <D.22085>:
        D.22086 = free_pos[reg];
        D.22049 = current->interval;
        D.22087 = D.22049->last_range;
        D.22088 = D.22087->to;
        if (D.22086 >= D.22088) goto <D.22089>; else goto <D.22090>;
        <D.22089>:
        current->reg = reg;
        active = monoeg_g_list_append (active, current);
        D.22091 = current->reg;
        D.22091 = current->reg;
        D.22092 = gains[D.22091];
        D.22093 = current->spill_costs;
        D.22094 = D.22092 + D.22093;
        gains[D.22091] = D.22094;
        goto <D.22095>;
        <D.22090>:
        if (active != 0B) goto <D.22096>; else goto <D.22097>;
        <D.22096>:
        {
          struct GList * min_spill_pos;

          min_spill_pos = active;
          vmv = min_spill_pos->data;
          D.22098 = vmv->spill_costs;
          D.22093 = current->spill_costs;
          if (D.22098 < D.22093) goto <D.22099>; else goto <D.22100>;
          <D.22099>:
          D.22101 = vmv->reg;
          D.22101 = vmv->reg;
          D.22102 = gains[D.22101];
          D.22098 = vmv->spill_costs;
          D.22103 = D.22102 - D.22098;
          gains[D.22101] = D.22103;
          vmv->reg = -1;
          active = monoeg_g_list_delete_link (active, min_spill_pos);
          goto <D.22104>;
          <D.22100>:
          <D.22104>:
        }
        goto <D.22105>;
        <D.22097>:
        <D.22105>:
        <D.22095>:
      }
      <D.21877>:
      if (unhandled != 0B) goto <D.21908>; else goto <D.21909>;
      <D.21909>:
      i = 0;
      goto <D.21911>;
      <D.21910>:
      D.22106 = gains[i];
      if (D.22106 != 0) goto <D.22107>; else goto <D.22108>;
      <D.22107>:
      D.22106 = gains[i];
      D.22110 = cfg->method;
      D.22111 = BIT_FIELD_REF <*D.22110, 8, 168>;
      D.22112 = D.22111 & 1;
      if (D.22112 != 0) goto <D.22113>; else goto <D.22114>;
      <D.22113>:
      iftmp.4 = 1;
      goto <D.22115>;
      <D.22114>:
      iftmp.4 = 2;
      <D.22115>:
      D.22116 = D.22106 - iftmp.4;
      gains[i] = D.22116;
      D.22106 = gains[i];
      if (D.22106 < 0) goto <D.22117>; else goto <D.22118>;
      <D.22117>:
      gains[i] = 0;
      <D.22118>:
      <D.22108>:
      i = i + 1;
      <D.21911>:
      if (i < n_regs) goto <D.21910>; else goto <D.21912>;
      <D.21912>:
      n_regvars = 0;
      l = vars;
      goto <D.21915>;
      <D.21914>:
      vmv = l->data;
      D.22101 = vmv->reg;
      if (D.22101 >= 0) goto <D.22119>; else goto <D.22120>;
      <D.22119>:
      {
        int reg_index;

        reg_index = vmv->reg;
        D.22101 = vmv->reg;
        D.22121 = (unsigned int) D.22101;
        D.22122 = monoeg_g_list_nth_data (regs, D.22121);
        D.22123 = (int) D.22122;
        vmv->reg = D.22123;
        D.22126 = gains[reg_index];
        D.22127 = (unsigned int) D.22126;
        D.22128 = regalloc_cost (cfg, vmv);
        if (D.22127 > D.22128) goto <D.22129>; else goto <D.22124>;
        <D.22129>:
        D.22130 = cfg->varinfo;
        D.22131 = vmv->idx;
        D.22132 = D.22131 * 4;
        D.22133 = D.22130 + D.22132;
        D.22134 = *D.22133;
        D.22135 = D.22134->opcode;
        if (D.22135 != 366) goto <D.22136>; else goto <D.22124>;
        <D.22136>:
        D.22137 = cfg->verbose_level;
        if (D.22137 > 2) goto <D.22138>; else goto <D.22139>;
        <D.22138>:
        D.22101 = vmv->reg;
        D.22140 = mono_arch_regname (D.22101);
        D.22141 = regalloc_cost (cfg, vmv);
        D.22126 = gains[reg_index];
        D.22130 = cfg->varinfo;
        D.22131 = vmv->idx;
        D.22132 = D.22131 * 4;
        D.22133 = D.22130 + D.22132;
        D.22134 = *D.22133;
        D.22142 = D.22134->dreg;
        printf ("REGVAR R%d G%d C%d %s\n", D.22142, D.22126, D.22141, D.22140);
        <D.22139>:
        D.22130 = cfg->varinfo;
        D.22131 = vmv->idx;
        D.22132 = D.22131 * 4;
        D.22133 = D.22130 + D.22132;
        D.22134 = *D.22133;
        D.22134->opcode = 366;
        D.22130 = cfg->varinfo;
        D.22131 = vmv->idx;
        D.22132 = D.22131 * 4;
        D.22133 = D.22130 + D.22132;
        D.22134 = *D.22133;
        D.22101 = vmv->reg;
        D.22134->dreg = D.22101;
        n_regvars = n_regvars + 1;
        goto <D.22125>;
        <D.22124>:
        D.22137 = cfg->verbose_level;
        if (D.22137 > 2) goto <D.22143>; else goto <D.22144>;
        <D.22143>:
        D.22101 = vmv->reg;
        D.22145 = mono_arch_regname (D.22101);
        D.22146 = regalloc_cost (cfg, vmv);
        D.22126 = gains[reg_index];
        D.22130 = cfg->varinfo;
        D.22131 = vmv->idx;
        D.22132 = D.22131 * 4;
        D.22133 = D.22130 + D.22132;
        D.22134 = *D.22133;
        D.22142 = D.22134->dreg;
        D.22110 = cfg->method;
        D.22147 = mono_method_full_name (D.22110, 1);
        printf ("COSTLY: %s R%d G%d C%d %s\n", D.22147, D.22142, D.22126, D.22146, D.22145);
        <D.22144>:
        vmv->reg = -1;
        <D.22125>:
      }
      <D.22120>:
      l = l->next;
      <D.21915>:
      if (l != 0B) goto <D.21914>; else goto <D.21916>;
      <D.21916>:
      cfg->stat_n_regvars = n_regvars;
      used_regs = 0;
      l = vars;
      goto <D.21918>;
      <D.21917>:
      vmv = l->data;
      D.22101 = vmv->reg;
      if (D.22101 >= 0) goto <D.22148>; else goto <D.22149>;
      <D.22148>:
      D.22101 = vmv->reg;
      D.22150 = 1 << D.22101;
      D.22151 = (signed int) D.22150;
      used_regs.5 = (signed int) used_regs;
      D.22153 = D.22151 | used_regs.5;
      used_regs = (regmask_t) D.22153;
      <D.22149>:
      l = l->next;
      <D.21918>:
      if (l != 0B) goto <D.21917>; else goto <D.21919>;
      <D.21919>:
      D.22154 = *used_mask;
      D.22155 = D.22154 | used_regs;
      *used_mask = D.22155;
      monoeg_g_list_free (active);
      monoeg_g_list_free (inactive);
    }
  finally
    {
      free_pos = {CLOBBER};
      gains = {CLOBBER};
    }
}


compare_by_interval_start_pos_func (const void * a, const void * b)
{
  gint D.22158;
  struct MonoLiveInterval * D.22160;
  struct MonoLiveRange2 * D.22161;
  struct MonoLiveInterval * D.22163;
  struct MonoLiveRange2 * D.22164;
  int D.22166;
  int D.22167;
  struct MonoMethodVar * v1;
  struct MonoMethodVar * v2;

  v1 = a;
  v2 = b;
  if (v1 == v2) goto <D.22156>; else goto <D.22157>;
  <D.22156>:
  D.22158 = 0;
  return D.22158;
  <D.22157>:
  D.22160 = v1->interval;
  D.22161 = D.22160->range;
  if (D.22161 != 0B) goto <D.22162>; else goto <D.22159>;
  <D.22162>:
  D.22163 = v2->interval;
  D.22164 = D.22163->range;
  if (D.22164 != 0B) goto <D.22165>; else goto <D.22159>;
  <D.22165>:
  D.22160 = v1->interval;
  D.22161 = D.22160->range;
  D.22166 = D.22161->from;
  D.22163 = v2->interval;
  D.22164 = D.22163->range;
  D.22167 = D.22164->from;
  D.22158 = D.22166 - D.22167;
  return D.22158;
  <D.22159>:
  D.22160 = v1->interval;
  D.22161 = D.22160->range;
  if (D.22161 != 0B) goto <D.22168>; else goto <D.22169>;
  <D.22168>:
  D.22158 = -1;
  return D.22158;
  <D.22169>:
  D.22158 = 1;
  return D.22158;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.22173;
  int D.22178;
  void * D.22180;
  unsigned int D.22181;

  D.22173 = __builtin_constant_p (__len);
  if (D.22173 != 0) goto <D.22174>; else goto <D.22175>;
  <D.22174>:
  if (__len == 0) goto <D.22176>; else goto <D.22177>;
  <D.22176>:
  D.22178 = __builtin_constant_p (__ch);
  if (D.22178 == 0) goto <D.22171>; else goto <D.22179>;
  <D.22179>:
  if (__ch != 0) goto <D.22171>; else goto <D.22172>;
  <D.22171>:
  __warn_memset_zero_len ();
  D.22180 = __dest;
  return D.22180;
  <D.22172>:
  <D.22177>:
  <D.22175>:
  D.22181 = __builtin_object_size (__dest, 0);
  D.22180 = __builtin___memset_chk (__dest, __ch, __len, D.22181);
  return D.22180;
}


regalloc_cost (struct MonoCompile * cfg, struct MonoMethodVar * vmv)
{
  struct MonoInst * * D.22183;
  unsigned int D.22184;
  unsigned int D.22185;
  struct MonoInst * * D.22186;
  guint32 D.22187;
  short unsigned int D.22188;
  _Bool D.22189;
  struct MonoInst * ins;

  D.22183 = cfg->varinfo;
  D.22184 = vmv->idx;
  D.22185 = D.22184 * 4;
  D.22186 = D.22183 + D.22185;
  ins = *D.22186;
  D.22188 = ins->opcode;
  D.22189 = D.22188 == 330;
  D.22187 = (guint32) D.22189;
  return D.22187;
}


printf (const char * restrict __fmt)
{
  int D.22191;

  D.22191 = __printf_chk (1, __fmt, __builtin_va_arg_pack ());
  return D.22191;
}


