mono_varlist_insert_sorted (struct MonoCompile * cfg, struct GList * list, struct MonoMethodVar * mv, int sort_type)
{
  struct GList * D.24437;
  int D.24440;
  int D.24441;
  unsigned int D.24447;
  unsigned int D.24448;
  unsigned int D.24452;
  unsigned int D.24453;
  struct GList * l;

  if (list == 0B) goto <D.24435>; else goto <D.24436>;
  <D.24435>:
  D.24437 = monoeg_g_list_prepend (0B, mv);
  return D.24437;
  <D.24436>:
  l = list;
  goto <D.24306>;
  <D.24305>:
  {
    struct MonoMethodVar * v1;

    v1 = l->data;
    if (sort_type == 2) goto <D.24438>; else goto <D.24439>;
    <D.24438>:
    D.24440 = mv->spill_costs;
    D.24441 = v1->spill_costs;
    if (D.24440 >= D.24441) goto <D.24442>; else goto <D.24443>;
    <D.24442>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.24304>;
    <D.24443>:
    goto <D.24444>;
    <D.24439>:
    if (sort_type == 1) goto <D.24445>; else goto <D.24446>;
    <D.24445>:
    D.24447 = mv->range.last_use.abs_pos;
    D.24448 = v1->range.last_use.abs_pos;
    if (D.24447 <= D.24448) goto <D.24449>; else goto <D.24450>;
    <D.24449>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.24304>;
    <D.24450>:
    goto <D.24451>;
    <D.24446>:
    D.24452 = mv->range.first_use.abs_pos;
    D.24453 = v1->range.first_use.abs_pos;
    if (D.24452 <= D.24453) goto <D.24454>; else goto <D.24455>;
    <D.24454>:
    list = monoeg_g_list_insert_before (list, l, mv);
    goto <D.24304>;
    <D.24455>:
    <D.24451>:
    <D.24444>:
  }
  l = l->next;
  <D.24306>:
  if (l != 0B) goto <D.24305>; else goto <D.24304>;
  <D.24304>:
  if (l == 0B) goto <D.24456>; else goto <D.24457>;
  <D.24456>:
  list = monoeg_g_list_append (list, mv);
  <D.24457>:
  D.24437 = list;
  return D.24437;
}


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

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


compare_by_first_use_func (const void * a, const void * b)
{
  gint D.24463;
  unsigned int D.24464;
  unsigned int D.24465;
  unsigned int D.24466;
  struct MonoMethodVar * v1;
  struct MonoMethodVar * v2;

  v1 = a;
  v2 = b;
  D.24464 = v1->range.first_use.abs_pos;
  D.24465 = v2->range.first_use.abs_pos;
  D.24466 = D.24464 - D.24465;
  D.24463 = (gint) D.24466;
  return D.24463;
}


mono_linear_scan (struct MonoCompile * cfg, struct GList * vars, struct GList * regs, regmask_t * used_mask)
{
  void * D.24470;
  struct MonoLiveInterval * D.24471;
  unsigned int D.24474;
  void * D.24475;
  unsigned int regnum.0;
  _Bool D.24477;
  long int D.24478;
  long int D.24479;
  unsigned char D.24482;
  unsigned char D.24483;
  unsigned int D.24486;
  unsigned int D.24487;
  int D.24489;
  void * D.24490;
  int D.24491;
  int D.24492;
  int D.24493;
  unsigned int D.24497;
  unsigned int max_regs.1;
  int D.24500;
  unsigned int D.24501;
  int D.24507;
  unsigned int D.24509;
  _Bool D.24513;
  long int D.24514;
  long int D.24515;
  void * D.24518;
  int D.24519;
  int D.24520;
  long long int D.24521;
  signed int D.24522;
  signed int used_regs.2;
  signed int D.24524;
  int D.24529;
  unsigned int D.24530;
  unsigned int D.24531;
  struct MonoInst * * D.24533;
  unsigned int D.24534;
  unsigned int D.24535;
  struct MonoInst * * D.24536;
  struct MonoInst * D.24537;
  short unsigned int D.24538;
  unsigned int D.24540;
  int D.24543;
  unsigned int D.24546;
  const char * D.24547;
  unsigned int D.24554;
  unsigned int D.24555;
  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.24468>; else goto <D.24469>;
      <D.24468>:
      D.24470 = vars->data;
      D.24471 = MEM[(struct MonoMethodVar *)D.24470].interval;
      if (D.24471 != 0B) goto <D.24472>; else goto <D.24473>;
      <D.24472>:
      mono_linear_scan2 (cfg, vars, regs, used_mask);
      return;
      <D.24473>:
      <D.24469>:
      cost_driven = 1;
      D.24474 = monoeg_g_list_length (regs);
      max_regs = (int) D.24474;
      l = regs;
      goto <D.24336>;
      <D.24335>:
      {
        int regnum;

        D.24475 = l->data;
        regnum = (int) D.24475;
        regnum.0 = (unsigned int) regnum;
        D.24477 = regnum.0 > 31;
        D.24478 = (long int) D.24477;
        D.24479 = __builtin_expect (D.24478, 0);
        if (D.24479 != 0) goto <D.24480>; else goto <D.24481>;
        <D.24480>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 105, "regnum < G_N_ELEMENTS (gains)");
        <D.24481>:
        gains[regnum] = 0;
      }
      l = l->next;
      <D.24336>:
      if (l != 0B) goto <D.24335>; else goto <D.24337>;
      <D.24337>:
      l = vars;
      goto <D.24342>;
      <D.24341>:
      vmv = l->data;
      D.24482 = BIT_FIELD_REF <*cfg, 8, 3400>;
      D.24483 = D.24482 & 128;
      if (D.24483 == 0) goto <D.24484>; else goto <D.24485>;
      <D.24484>:
      goto <D.24340>;
      <D.24339>:
      amv = active->data;
      D.24486 = amv->range.last_use.abs_pos;
      D.24487 = vmv->range.first_use.abs_pos;
      if (D.24486 > D.24487) goto <D.24338>; else goto <D.24488>;
      <D.24488>:
      active = monoeg_g_list_delete_link (active, active);
      D.24489 = amv->reg;
      D.24490 = (void *) D.24489;
      regs = monoeg_g_list_prepend (regs, D.24490);
      D.24489 = amv->reg;
      D.24489 = amv->reg;
      D.24491 = gains[D.24489];
      D.24492 = amv->spill_costs;
      D.24493 = D.24491 + D.24492;
      gains[D.24489] = D.24493;
      <D.24340>:
      if (active != 0B) goto <D.24339>; else goto <D.24338>;
      <D.24338>:
      <D.24485>:
      if (active != 0B) goto <D.24496>; else goto <D.24494>;
      <D.24496>:
      D.24497 = monoeg_g_list_length (active);
      max_regs.1 = (unsigned int) max_regs;
      if (D.24497 == max_regs.1) goto <D.24499>; else goto <D.24494>;
      <D.24499>:
      D.24500 = max_regs + -1;
      D.24501 = (unsigned int) D.24500;
      a = monoeg_g_list_nth (active, D.24501);
      amv = a->data;
      if (cost_driven != 0) goto <D.24506>; else goto <D.24502>;
      <D.24506>:
      D.24492 = amv->spill_costs;
      D.24507 = vmv->spill_costs;
      if (D.24492 < D.24507) goto <D.24503>; else goto <D.24502>;
      <D.24502>:
      if (cost_driven == 0) goto <D.24508>; else goto <D.24504>;
      <D.24508>:
      D.24486 = amv->range.last_use.abs_pos;
      D.24509 = vmv->range.last_use.abs_pos;
      if (D.24486 > D.24509) goto <D.24503>; else goto <D.24504>;
      <D.24503>:
      D.24489 = amv->reg;
      vmv->reg = D.24489;
      amv->reg = -1;
      active = monoeg_g_list_delete_link (active, a);
      if (cost_driven != 0) goto <D.24510>; else goto <D.24511>;
      <D.24510>:
      active = mono_varlist_insert_sorted (cfg, active, vmv, 2);
      goto <D.24512>;
      <D.24511>:
      active = mono_varlist_insert_sorted (cfg, active, vmv, 1);
      <D.24512>:
      goto <D.24505>;
      <D.24504>:
      vmv->reg = -1;
      <D.24505>:
      goto <D.24495>;
      <D.24494>:
      D.24513 = regs == 0B;
      D.24514 = (long int) D.24513;
      D.24515 = __builtin_expect (D.24514, 0);
      if (D.24515 != 0) goto <D.24516>; else goto <D.24517>;
      <D.24516>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 168, "regs");
      <D.24517>:
      D.24518 = regs->data;
      D.24519 = (int) D.24518;
      vmv->reg = D.24519;
      D.24520 = vmv->reg;
      D.24521 = 1 << D.24520;
      D.24522 = (signed int) D.24521;
      used_regs.2 = (signed int) used_regs;
      D.24524 = D.24522 | used_regs.2;
      used_regs = (regmask_t) D.24524;
      regs = monoeg_g_list_delete_link (regs, regs);
      active = mono_varlist_insert_sorted (cfg, active, vmv, 1);
      <D.24495>:
      l = l->next;
      <D.24342>:
      if (l != 0B) goto <D.24341>; else goto <D.24343>;
      <D.24343>:
      a = active;
      goto <D.24345>;
      <D.24344>:
      amv = a->data;
      D.24489 = amv->reg;
      D.24489 = amv->reg;
      D.24491 = gains[D.24489];
      D.24492 = amv->spill_costs;
      D.24493 = D.24491 + D.24492;
      gains[D.24489] = D.24493;
      a = a->next;
      <D.24345>:
      if (a != 0B) goto <D.24344>; else goto <D.24346>;
      <D.24346>:
      n_regvars = 0;
      l = vars;
      goto <D.24348>;
      <D.24347>:
      vmv = l->data;
      D.24520 = vmv->reg;
      if (D.24520 >= 0) goto <D.24525>; else goto <D.24526>;
      <D.24525>:
      D.24520 = vmv->reg;
      D.24529 = gains[D.24520];
      D.24530 = (unsigned int) D.24529;
      D.24531 = mono_arch_regalloc_cost (cfg, vmv);
      if (D.24530 > D.24531) goto <D.24532>; else goto <D.24527>;
      <D.24532>:
      D.24533 = cfg->varinfo;
      D.24534 = vmv->idx;
      D.24535 = D.24534 * 4;
      D.24536 = D.24533 + D.24535;
      D.24537 = *D.24536;
      D.24538 = D.24537->opcode;
      if (D.24538 != 366) goto <D.24539>; else goto <D.24527>;
      <D.24539>:
      D.24540 = cfg->verbose_level;
      if (D.24540 > 2) goto <D.24541>; else goto <D.24542>;
      <D.24541>:
      D.24533 = cfg->varinfo;
      D.24534 = vmv->idx;
      D.24535 = D.24534 * 4;
      D.24536 = D.24533 + D.24535;
      D.24537 = *D.24536;
      D.24543 = D.24537->dreg;
      D.24534 = vmv->idx;
      D.24520 = vmv->reg;
      D.24507 = vmv->spill_costs;
      printf ("ALLOCATED R%d(%d) TO HREG %d COST %d\n", D.24543, D.24534, D.24520, D.24507);
      <D.24542>:
      D.24533 = cfg->varinfo;
      D.24534 = vmv->idx;
      D.24535 = D.24534 * 4;
      D.24536 = D.24533 + D.24535;
      D.24537 = *D.24536;
      D.24537->opcode = 366;
      D.24533 = cfg->varinfo;
      D.24534 = vmv->idx;
      D.24535 = D.24534 * 4;
      D.24536 = D.24533 + D.24535;
      D.24537 = *D.24536;
      D.24520 = vmv->reg;
      D.24537->dreg = D.24520;
      n_regvars = n_regvars + 1;
      goto <D.24528>;
      <D.24527>:
      D.24540 = cfg->verbose_level;
      if (D.24540 > 2) goto <D.24544>; else goto <D.24545>;
      <D.24544>:
      D.24534 = vmv->idx;
      D.24507 = vmv->spill_costs;
      D.24546 = mono_arch_regalloc_cost (cfg, vmv);
      D.24520 = vmv->reg;
      D.24547 = mono_arch_regname (D.24520);
      printf ("COSTLY: R%d C%d C%d %s\n", D.24534, D.24507, D.24546, D.24547);
      <D.24545>:
      vmv->reg = -1;
      <D.24528>:
      <D.24526>:
      D.24520 = vmv->reg;
      if (D.24520 == -1) goto <D.24548>; else goto <D.24549>;
      <D.24548>:
      D.24540 = cfg->verbose_level;
      if (D.24540 > 2) goto <D.24550>; else goto <D.24551>;
      <D.24550>:
      D.24534 = vmv->idx;
      printf ("NOT REGVAR: %d\n", D.24534);
      <D.24551>:
      <D.24549>:
      l = l->next;
      <D.24348>:
      if (l != 0B) goto <D.24347>; else goto <D.24349>;
      <D.24349>:
      cfg->stat_n_regvars = n_regvars;
      used_regs = 0;
      l = vars;
      goto <D.24351>;
      <D.24350>:
      vmv = l->data;
      D.24520 = vmv->reg;
      if (D.24520 >= 0) goto <D.24552>; else goto <D.24553>;
      <D.24552>:
      D.24520 = vmv->reg;
      D.24521 = 1 << D.24520;
      D.24522 = (signed int) D.24521;
      used_regs.2 = (signed int) used_regs;
      D.24524 = D.24522 | used_regs.2;
      used_regs = (regmask_t) D.24524;
      <D.24553>:
      l = l->next;
      <D.24351>:
      if (l != 0B) goto <D.24350>; else goto <D.24352>;
      <D.24352>:
      D.24554 = *used_mask;
      D.24555 = D.24554 | used_regs;
      *used_mask = D.24555;
      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.24559;
  unsigned int n_regs.3;
  unsigned int D.24561;
  struct GList * D.24562;
  struct MonoLiveInterval * D.24563;
  struct MonoLiveRange2 * D.24564;
  struct MonoLiveInterval * D.24567;
  struct MonoLiveRange2 * D.24568;
  int D.24569;
  int D.24572;
  struct MonoLiveInterval * D.24575;
  struct MonoLiveRange2 * D.24576;
  int D.24577;
  int D.24580;
  int D.24583;
  int D.24586;
  struct MonoLiveInterval * D.24589;
  int D.24592;
  _Bool D.24595;
  long int D.24596;
  long int D.24597;
  int D.24600;
  struct MonoLiveRange2 * D.24601;
  int D.24602;
  int D.24605;
  int D.24606;
  int D.24607;
  int D.24608;
  int D.24612;
  int D.24615;
  int D.24616;
  int D.24617;
  int D.24620;
  int iftmp.4;
  struct MonoMethod * D.24624;
  unsigned char D.24625;
  unsigned char D.24626;
  int D.24630;
  unsigned int D.24635;
  void * D.24636;
  int D.24637;
  int D.24640;
  unsigned int D.24641;
  unsigned int D.24642;
  struct MonoInst * * D.24644;
  unsigned int D.24645;
  unsigned int D.24646;
  struct MonoInst * * D.24647;
  struct MonoInst * D.24648;
  short unsigned int D.24649;
  unsigned int D.24651;
  int D.24654;
  unsigned int D.24655;
  const char * D.24656;
  char * D.24659;
  unsigned int D.24660;
  const char * D.24661;
  long long int D.24664;
  signed int D.24665;
  signed int used_regs.5;
  signed int D.24667;
  unsigned int D.24668;
  unsigned int D.24669;
  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.24382>;
      <D.24381>:
      vmv = l->data;
      l = l->next;
      <D.24382>:
      if (l != 0B) goto <D.24381>; else goto <D.24383>;
      <D.24383>:
      D.24559 = monoeg_g_list_length (regs);
      n_regs = (int) D.24559;
      n_regs.3 = (unsigned int) n_regs;
      D.24561 = n_regs.3 * 4;
      memset (&gains, 0, D.24561);
      D.24562 = monoeg_g_list_copy (vars);
      unhandled = monoeg_g_list_sort (D.24562, compare_by_interval_start_pos_func);
      active = 0B;
      inactive = 0B;
      goto <D.24389>;
      <D.24420>:
      {
        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.24563 = current->interval;
        D.24564 = D.24563->range;
        if (D.24564 == 0B) goto <D.24565>; else goto <D.24566>;
        <D.24565>:
        // predicted unlikely by continue predictor.
        goto <D.24389>;
        <D.24566>:
        D.24563 = current->interval;
        D.24564 = D.24563->range;
        pos = D.24564->from;
        changed = 1;
        goto <D.24395>;
        <D.24394>:
        changed = 0;
        l = active;
        goto <D.24393>;
        <D.24392>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.24567 = v->interval;
          D.24568 = D.24567->last_range;
          D.24569 = D.24568->to;
          if (D.24569 < pos) goto <D.24570>; else goto <D.24571>;
          <D.24570>:
          active = monoeg_g_list_delete_link (active, l);
          changed = 1;
          goto <D.24391>;
          <D.24571>:
          D.24567 = v->interval;
          D.24572 = mono_linterval_covers (D.24567, pos);
          if (D.24572 == 0) goto <D.24573>; else goto <D.24574>;
          <D.24573>:
          inactive = monoeg_g_list_append (inactive, v);
          active = monoeg_g_list_delete_link (active, l);
          changed = 1;
          goto <D.24391>;
          <D.24574>:
        }
        l = l->next;
        <D.24393>:
        if (l != 0B) goto <D.24392>; else goto <D.24391>;
        <D.24391>:
        <D.24395>:
        if (changed != 0) goto <D.24394>; else goto <D.24396>;
        <D.24396>:
        changed = 1;
        goto <D.24402>;
        <D.24401>:
        changed = 0;
        l = inactive;
        goto <D.24400>;
        <D.24399>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.24575 = v->interval;
          D.24576 = D.24575->last_range;
          D.24577 = D.24576->to;
          if (D.24577 < pos) goto <D.24578>; else goto <D.24579>;
          <D.24578>:
          inactive = monoeg_g_list_delete_link (inactive, l);
          changed = 1;
          goto <D.24398>;
          <D.24579>:
          D.24575 = v->interval;
          D.24580 = mono_linterval_covers (D.24575, pos);
          if (D.24580 != 0) goto <D.24581>; else goto <D.24582>;
          <D.24581>:
          active = monoeg_g_list_append (active, v);
          inactive = monoeg_g_list_delete_link (inactive, l);
          changed = 1;
          goto <D.24398>;
          <D.24582>:
        }
        l = l->next;
        <D.24400>:
        if (l != 0B) goto <D.24399>; else goto <D.24398>;
        <D.24398>:
        <D.24402>:
        if (changed != 0) goto <D.24401>; else goto <D.24403>;
        <D.24403>:
        i = 0;
        goto <D.24405>;
        <D.24404>:
        free_pos[i] = 2147483647;
        i = i + 1;
        <D.24405>:
        if (i < n_regs) goto <D.24404>; else goto <D.24406>;
        <D.24406>:
        l = active;
        goto <D.24409>;
        <D.24408>:
        {
          struct MonoMethodVar * v;

          v = l->data;
          D.24583 = v->reg;
          if (D.24583 >= 0) goto <D.24584>; else goto <D.24585>;
          <D.24584>:
          D.24583 = v->reg;
          free_pos[D.24583] = 0;
          <D.24585>:
        }
        l = l->next;
        <D.24409>:
        if (l != 0B) goto <D.24408>; else goto <D.24410>;
        <D.24410>:
        l = inactive;
        goto <D.24414>;
        <D.24413>:
        {
          struct MonoMethodVar * v;
          gint32 intersect_pos;

          v = l->data;
          D.24586 = v->reg;
          if (D.24586 >= 0) goto <D.24587>; else goto <D.24588>;
          <D.24587>:
          D.24563 = current->interval;
          D.24589 = v->interval;
          intersect_pos = mono_linterval_get_intersect_pos (D.24563, D.24589);
          if (intersect_pos != -1) goto <D.24590>; else goto <D.24591>;
          <D.24590>:
          D.24586 = v->reg;
          free_pos[D.24586] = intersect_pos;
          <D.24591>:
          <D.24588>:
        }
        l = l->next;
        <D.24414>:
        if (l != 0B) goto <D.24413>; else goto <D.24415>;
        <D.24415>:
        max_free_pos = -1;
        reg = -1;
        i = 0;
        goto <D.24417>;
        <D.24416>:
        D.24592 = free_pos[i];
        if (D.24592 > max_free_pos) goto <D.24593>; else goto <D.24594>;
        <D.24593>:
        reg = i;
        max_free_pos = free_pos[i];
        <D.24594>:
        i = i + 1;
        <D.24417>:
        if (i < n_regs) goto <D.24416>; else goto <D.24418>;
        <D.24418>:
        D.24595 = reg == -1;
        D.24596 = (long int) D.24595;
        D.24597 = __builtin_expect (D.24596, 0);
        if (D.24597 != 0) goto <D.24598>; else goto <D.24599>;
        <D.24598>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "linear-scan.c", 402, "reg != -1");
        <D.24599>:
        D.24600 = free_pos[reg];
        D.24563 = current->interval;
        D.24601 = D.24563->last_range;
        D.24602 = D.24601->to;
        if (D.24600 >= D.24602) goto <D.24603>; else goto <D.24604>;
        <D.24603>:
        current->reg = reg;
        active = monoeg_g_list_append (active, current);
        D.24605 = current->reg;
        D.24605 = current->reg;
        D.24606 = gains[D.24605];
        D.24607 = current->spill_costs;
        D.24608 = D.24606 + D.24607;
        gains[D.24605] = D.24608;
        goto <D.24609>;
        <D.24604>:
        if (active != 0B) goto <D.24610>; else goto <D.24611>;
        <D.24610>:
        {
          struct GList * min_spill_pos;

          min_spill_pos = active;
          vmv = min_spill_pos->data;
          D.24612 = vmv->spill_costs;
          D.24607 = current->spill_costs;
          if (D.24612 < D.24607) goto <D.24613>; else goto <D.24614>;
          <D.24613>:
          D.24615 = vmv->reg;
          D.24615 = vmv->reg;
          D.24616 = gains[D.24615];
          D.24612 = vmv->spill_costs;
          D.24617 = D.24616 - D.24612;
          gains[D.24615] = D.24617;
          vmv->reg = -1;
          active = monoeg_g_list_delete_link (active, min_spill_pos);
          goto <D.24618>;
          <D.24614>:
          <D.24618>:
        }
        goto <D.24619>;
        <D.24611>:
        <D.24619>:
        <D.24609>:
      }
      <D.24389>:
      if (unhandled != 0B) goto <D.24420>; else goto <D.24421>;
      <D.24421>:
      i = 0;
      goto <D.24423>;
      <D.24422>:
      D.24620 = gains[i];
      if (D.24620 != 0) goto <D.24621>; else goto <D.24622>;
      <D.24621>:
      D.24620 = gains[i];
      D.24624 = cfg->method;
      D.24625 = BIT_FIELD_REF <*D.24624, 8, 168>;
      D.24626 = D.24625 & 1;
      if (D.24626 != 0) goto <D.24627>; else goto <D.24628>;
      <D.24627>:
      iftmp.4 = 1;
      goto <D.24629>;
      <D.24628>:
      iftmp.4 = 2;
      <D.24629>:
      D.24630 = D.24620 - iftmp.4;
      gains[i] = D.24630;
      D.24620 = gains[i];
      if (D.24620 < 0) goto <D.24631>; else goto <D.24632>;
      <D.24631>:
      gains[i] = 0;
      <D.24632>:
      <D.24622>:
      i = i + 1;
      <D.24423>:
      if (i < n_regs) goto <D.24422>; else goto <D.24424>;
      <D.24424>:
      n_regvars = 0;
      l = vars;
      goto <D.24427>;
      <D.24426>:
      vmv = l->data;
      D.24615 = vmv->reg;
      if (D.24615 >= 0) goto <D.24633>; else goto <D.24634>;
      <D.24633>:
      {
        int reg_index;

        reg_index = vmv->reg;
        D.24615 = vmv->reg;
        D.24635 = (unsigned int) D.24615;
        D.24636 = monoeg_g_list_nth_data (regs, D.24635);
        D.24637 = (int) D.24636;
        vmv->reg = D.24637;
        D.24640 = gains[reg_index];
        D.24641 = (unsigned int) D.24640;
        D.24642 = regalloc_cost (cfg, vmv);
        if (D.24641 > D.24642) goto <D.24643>; else goto <D.24638>;
        <D.24643>:
        D.24644 = cfg->varinfo;
        D.24645 = vmv->idx;
        D.24646 = D.24645 * 4;
        D.24647 = D.24644 + D.24646;
        D.24648 = *D.24647;
        D.24649 = D.24648->opcode;
        if (D.24649 != 366) goto <D.24650>; else goto <D.24638>;
        <D.24650>:
        D.24651 = cfg->verbose_level;
        if (D.24651 > 2) goto <D.24652>; else goto <D.24653>;
        <D.24652>:
        D.24644 = cfg->varinfo;
        D.24645 = vmv->idx;
        D.24646 = D.24645 * 4;
        D.24647 = D.24644 + D.24646;
        D.24648 = *D.24647;
        D.24654 = D.24648->dreg;
        D.24640 = gains[reg_index];
        D.24655 = regalloc_cost (cfg, vmv);
        D.24615 = vmv->reg;
        D.24656 = mono_arch_regname (D.24615);
        printf ("REGVAR R%d G%d C%d %s\n", D.24654, D.24640, D.24655, D.24656);
        <D.24653>:
        D.24644 = cfg->varinfo;
        D.24645 = vmv->idx;
        D.24646 = D.24645 * 4;
        D.24647 = D.24644 + D.24646;
        D.24648 = *D.24647;
        D.24648->opcode = 366;
        D.24644 = cfg->varinfo;
        D.24645 = vmv->idx;
        D.24646 = D.24645 * 4;
        D.24647 = D.24644 + D.24646;
        D.24648 = *D.24647;
        D.24615 = vmv->reg;
        D.24648->dreg = D.24615;
        n_regvars = n_regvars + 1;
        goto <D.24639>;
        <D.24638>:
        D.24651 = cfg->verbose_level;
        if (D.24651 > 2) goto <D.24657>; else goto <D.24658>;
        <D.24657>:
        D.24624 = cfg->method;
        D.24659 = mono_method_full_name (D.24624, 1);
        D.24644 = cfg->varinfo;
        D.24645 = vmv->idx;
        D.24646 = D.24645 * 4;
        D.24647 = D.24644 + D.24646;
        D.24648 = *D.24647;
        D.24654 = D.24648->dreg;
        D.24640 = gains[reg_index];
        D.24660 = regalloc_cost (cfg, vmv);
        D.24615 = vmv->reg;
        D.24661 = mono_arch_regname (D.24615);
        printf ("COSTLY: %s R%d G%d C%d %s\n", D.24659, D.24654, D.24640, D.24660, D.24661);
        <D.24658>:
        vmv->reg = -1;
        <D.24639>:
      }
      <D.24634>:
      l = l->next;
      <D.24427>:
      if (l != 0B) goto <D.24426>; else goto <D.24428>;
      <D.24428>:
      cfg->stat_n_regvars = n_regvars;
      used_regs = 0;
      l = vars;
      goto <D.24430>;
      <D.24429>:
      vmv = l->data;
      D.24615 = vmv->reg;
      if (D.24615 >= 0) goto <D.24662>; else goto <D.24663>;
      <D.24662>:
      D.24615 = vmv->reg;
      D.24664 = 1 << D.24615;
      D.24665 = (signed int) D.24664;
      used_regs.5 = (signed int) used_regs;
      D.24667 = D.24665 | used_regs.5;
      used_regs = (regmask_t) D.24667;
      <D.24663>:
      l = l->next;
      <D.24430>:
      if (l != 0B) goto <D.24429>; else goto <D.24431>;
      <D.24431>:
      D.24668 = *used_mask;
      D.24669 = D.24668 | used_regs;
      *used_mask = D.24669;
      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.24672;
  struct MonoLiveInterval * D.24674;
  struct MonoLiveRange2 * D.24675;
  struct MonoLiveInterval * D.24677;
  struct MonoLiveRange2 * D.24678;
  int D.24680;
  int D.24681;
  struct MonoMethodVar * v1;
  struct MonoMethodVar * v2;

  v1 = a;
  v2 = b;
  if (v1 == v2) goto <D.24670>; else goto <D.24671>;
  <D.24670>:
  D.24672 = 0;
  return D.24672;
  <D.24671>:
  D.24674 = v1->interval;
  D.24675 = D.24674->range;
  if (D.24675 != 0B) goto <D.24676>; else goto <D.24673>;
  <D.24676>:
  D.24677 = v2->interval;
  D.24678 = D.24677->range;
  if (D.24678 != 0B) goto <D.24679>; else goto <D.24673>;
  <D.24679>:
  D.24674 = v1->interval;
  D.24675 = D.24674->range;
  D.24680 = D.24675->from;
  D.24677 = v2->interval;
  D.24678 = D.24677->range;
  D.24681 = D.24678->from;
  D.24672 = D.24680 - D.24681;
  return D.24672;
  <D.24673>:
  D.24674 = v1->interval;
  D.24675 = D.24674->range;
  if (D.24675 != 0B) goto <D.24682>; else goto <D.24683>;
  <D.24682>:
  D.24672 = -1;
  return D.24672;
  <D.24683>:
  D.24672 = 1;
  return D.24672;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.24687;
  int D.24692;
  void * D.24694;
  unsigned int D.24695;

  D.24687 = __builtin_constant_p (__len);
  if (D.24687 != 0) goto <D.24688>; else goto <D.24689>;
  <D.24688>:
  if (__len == 0) goto <D.24690>; else goto <D.24691>;
  <D.24690>:
  D.24692 = __builtin_constant_p (__ch);
  if (D.24692 == 0) goto <D.24685>; else goto <D.24693>;
  <D.24693>:
  if (__ch != 0) goto <D.24685>; else goto <D.24686>;
  <D.24685>:
  __warn_memset_zero_len ();
  D.24694 = __dest;
  return D.24694;
  <D.24686>:
  <D.24691>:
  <D.24689>:
  D.24695 = __builtin_object_size (__dest, 0);
  D.24694 = __builtin___memset_chk (__dest, __ch, __len, D.24695);
  return D.24694;
}


regalloc_cost (struct MonoCompile * cfg, struct MonoMethodVar * vmv)
{
  struct MonoInst * * D.24697;
  unsigned int D.24698;
  unsigned int D.24699;
  struct MonoInst * * D.24700;
  guint32 D.24701;
  short unsigned int D.24702;
  _Bool D.24703;
  struct MonoInst * ins;

  D.24697 = cfg->varinfo;
  D.24698 = vmv->idx;
  D.24699 = D.24698 * 4;
  D.24700 = D.24697 + D.24699;
  ins = *D.24700;
  D.24702 = ins->opcode;
  D.24703 = D.24702 == 330;
  D.24701 = (guint32) D.24703;
  return D.24701;
}


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

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


