mono_basic_block_free (struct MonoSimpleBasicBlock * bb)
{
  struct GSList * D.16627;

  goto <D.16579>;
  <D.16578>:
  {
    struct MonoSimpleBasicBlock * next;

    next = bb->next;
    D.16627 = bb->out_bb;
    if (D.16627 != 0B) goto <D.16628>; else goto <D.16629>;
    <D.16628>:
    D.16627 = bb->out_bb;
    monoeg_g_slist_free (D.16627);
    <D.16629>:
    monoeg_g_free (bb);
    bb = next;
  }
  <D.16579>:
  if (bb != 0B) goto <D.16578>; else goto <D.16580>;
  <D.16580>:
}


mono_basic_block_split (struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16630;
  sizetype D.16631;
  struct MonoSimpleBasicBlock * D.16634;
  long int end.0;
  long int start.1;
  long int D.16637;
  int D.16638;
  int D.16639;
  int D.16641;
  struct MonoSimpleBasicBlock * bb;
  struct MonoSimpleBasicBlock * root;
  const unsigned char * start;
  const unsigned char * end;
  struct MonoMethodHeader * header;
  void fail = <<< error >>>;

  try
    {
      header = mono_method_get_header (method);
      start = header->code;
      D.16630 = header->code_size;
      D.16631 = (sizetype) D.16630;
      end = start + D.16631;
      mono_error_init (error);
      if (header == 0B) goto <D.16632>; else goto <D.16633>;
      <D.16632>:
      mono_error_set_not_verifiable (error, method, "Could not decode header");
      D.16634 = 0B;
      return D.16634;
      <D.16633>:
      bb = monoeg_malloc0 (56);
      bb->start = 0;
      end.0 = (long int) end;
      start.1 = (long int) start;
      D.16637 = end.0 - start.1;
      D.16638 = (int) D.16637;
      bb->end = D.16638;
      bb->colour = 1;
      bb->dead = 0;
      root = bb;
      bb_formation_il_pass (start, end, bb, &root, method, error);
      D.16639 = mono_error_ok (error);
      if (D.16639 == 0) goto fail; else goto <D.16640>;
      <D.16640>:
      bb_formation_eh_pass (header, bb, &root, method, error);
      D.16641 = mono_error_ok (error);
      if (D.16641 == 0) goto fail; else goto <D.16642>;
      <D.16642>:
      bb_liveness (bb);
      mono_metadata_free_mh (header);
      D.16634 = bb;
      return D.16634;
      fail:
      mono_metadata_free_mh (header);
      mono_basic_block_free (bb);
      D.16634 = 0B;
      return D.16634;
    }
  finally
    {
      root = {CLOBBER};
    }
}


bb_formation_il_pass (const unsigned char * start, const unsigned char * end, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  const unsigned char * ip.2;
  long int ip.3;
  long int start.4;
  long int D.16648;
  unsigned char D.16651;
  int D.16652;
  int D.16654;
  unsigned int D.16655;
  _Bool D.16656;
  long int D.16657;
  long int D.16658;
  int value.5;
  unsigned char D.16662;
  int D.16663;
  const unsigned char * ip.6;
  int D.16665;
  unsigned int D.16668;
  const unsigned char * ip.7;
  const unsigned char * ip.8;
  const unsigned char * ip.9;
  const unsigned char * ip.10;
  unsigned char D.16681;
  signed char D.16682;
  unsigned int D.16683;
  unsigned int D.16684;
  const guint32 * D.16686;
  unsigned int D.16687;
  unsigned int D.16688;
  int D.16693;
  int D.16694;
  unsigned char D.16699;
  _Bool D.16700;
  int D.16701;
  unsigned int D.16711;
  unsigned int D.16712;
  unsigned int D.16717;
  unsigned int D.16718;
  const unsigned char * ip.11;
  const unsigned char * ip;
  int value;
  int size;
  guint cli_addr;
  guint offset;
  struct MonoSimpleBasicBlock * branch;
  struct MonoSimpleBasicBlock * next;
  struct MonoSimpleBasicBlock * current;
  const struct MonoOpcode * opcode;

  try
    {
      ip = start;
      current = bb;
      goto <D.16556>;
      <D.16555>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.16648 = ip.3 - start.4;
      cli_addr = (guint) D.16648;
      size = mono_opcode_value_and_size (&ip, end, &value);
      if (size < 0) goto <D.16649>; else goto <D.16650>;
      <D.16649>:
      ip.2 = ip;
      D.16651 = *ip.2;
      D.16652 = (int) D.16651;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16652);
      return;
      <D.16650>:
      goto <D.16528>;
      <D.16527>:
      current = current->next;
      <D.16528>:
      if (current != 0B) goto <D.16653>; else goto <D.16529>;
      <D.16653>:
      D.16654 = current->end;
      D.16655 = (unsigned int) D.16654;
      if (D.16655 <= cli_addr) goto <D.16527>; else goto <D.16529>;
      <D.16529>:
      D.16656 = current == 0B;
      D.16657 = (long int) D.16656;
      D.16658 = __builtin_expect (D.16657, 0);
      if (D.16658 != 0) goto <D.16659>; else goto <D.16660>;
      <D.16659>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 350, "current");
      <D.16660>:
      value.5 = value;
      opcode = &mono_opcodes[value.5];
      D.16662 = opcode->argument;
      D.16663 = (int) D.16662;
      switch (D.16663) <default: <D.16554>, case 0: <D.16530>, case 1: <D.16533>, case 2: <D.16534>, case 3: <D.16539>, case 4: <D.16535>, case 5: <D.16532>, case 6: <D.16536>, case 7: <D.16540>, case 8: <D.16541>, case 9: <D.16546>, case 10: <D.16545>, case 11: <D.16547>, case 12: <D.16543>, case 13: <D.16537>, case 14: <D.16538>, case 15: <D.16542>, case 16: <D.16544>>
      <D.16530>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      ip = ip.6;
      value.5 = value;
      D.16665 = mono_opcode_has_static_branch (value.5);
      if (D.16665 == 0) goto <D.16531>; else goto <D.16666>;
      <D.16666>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16531>; else goto <D.16667>;
      <D.16667>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.16648 = ip.3 - start.4;
      D.16668 = (unsigned int) D.16648;
      next = bb_split (bb, current, root, D.16668, 0, method, error);
      if (next == 0B) goto <D.16669>; else goto <D.16670>;
      <D.16669>:
      return;
      <D.16670>:
      bb_unlink (current, next);
      current = next;
      goto <D.16531>;
      <D.16532>:
      <D.16533>:
      <D.16534>:
      <D.16535>:
      <D.16536>:
      <D.16537>:
      <D.16538>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      goto <D.16531>;
      <D.16539>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      value.5 = value;
      if (value.5 != 39) goto <D.16531>; else goto <D.16672>;
      <D.16672>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16531>; else goto <D.16673>;
      <D.16673>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.16648 = ip.3 - start.4;
      D.16668 = (unsigned int) D.16648;
      next = bb_split (bb, current, root, D.16668, 0, method, error);
      if (next == 0B) goto <D.16674>; else goto <D.16675>;
      <D.16674>:
      return;
      <D.16675>:
      bb_unlink (current, next);
      current = next;
      goto <D.16531>;
      <D.16540>:
      ip.2 = ip;
      ip.8 = ip.2 + 3;
      ip = ip.8;
      goto <D.16531>;
      <D.16541>:
      <D.16542>:
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16531>;
      <D.16543>:
      <D.16544>:
      ip.2 = ip;
      ip.10 = ip.2 + 9;
      ip = ip.10;
      goto <D.16531>;
      <D.16545>:
      <D.16546>:
      D.16662 = opcode->argument;
      if (D.16662 == 10) goto <D.16679>; else goto <D.16680>;
      <D.16679>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.16681 = *ip.6;
      D.16682 = (signed char) D.16681;
      D.16683 = (unsigned int) D.16682;
      D.16684 = D.16683 + cli_addr;
      offset = D.16684 + 2;
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16685>;
      <D.16680>:
      ip.2 = ip;
      D.16686 = ip.2 + 1;
      D.16687 = *D.16686;
      D.16688 = D.16687 + cli_addr;
      offset = D.16688 + 5;
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      <D.16685>:
      branch = bb_split (bb, current, root, offset, 1, method, error);
      if (branch == 0B) goto <D.16689>; else goto <D.16690>;
      <D.16689>:
      return;
      <D.16690>:
      if (offset < cli_addr) goto <D.16691>; else goto <D.16692>;
      <D.16691>:
      D.16693 = branch->start;
      D.16694 = current->start;
      if (D.16693 > D.16694) goto <D.16695>; else goto <D.16696>;
      <D.16695>:
      current = branch;
      <D.16696>:
      <D.16692>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16697>; else goto <D.16698>;
      <D.16697>:
      D.16699 = opcode->flow_type;
      D.16700 = D.16699 != 1;
      D.16701 = (int) D.16700;
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.16648 = ip.3 - start.4;
      D.16668 = (unsigned int) D.16648;
      next = bb_split (bb, current, root, D.16668, D.16701, method, error);
      if (next == 0B) goto <D.16702>; else goto <D.16703>;
      <D.16702>:
      return;
      <D.16703>:
      goto <D.16704>;
      <D.16698>:
      next = 0B;
      <D.16704>:
      bb_link (current, branch);
      if (next != 0B) goto <D.16705>; else goto <D.16706>;
      <D.16705>:
      D.16699 = opcode->flow_type;
      if (D.16699 == 1) goto <D.16707>; else goto <D.16708>;
      <D.16707>:
      if (next != branch) goto <D.16709>; else goto <D.16710>;
      <D.16709>:
      bb_unlink (current, next);
      current = next;
      <D.16710>:
      <D.16708>:
      <D.16706>:
      goto <D.16531>;
      <D.16547>:
      {
        struct MonoSimpleBasicBlock * tmp;
        guint32 j;
        guint32 n;

        ip.2 = ip;
        n = MEM[(const guint32 *)ip.2 + 1B];
        ip.2 = ip;
        ip.7 = ip.2 + 5;
        ip = ip.7;
        D.16711 = n * 4;
        D.16712 = D.16711 + cli_addr;
        offset = D.16712 + 5;
        next = bb_split (bb, current, root, offset, 1, method, error);
        if (next == 0B) goto <D.16713>; else goto <D.16714>;
        <D.16713>:
        return;
        <D.16714>:
        bb_link (current, next);
        tmp = next;
        j = 0;
        goto <D.16552>;
        <D.16551>:
        ip.2 = ip;
        if (ip.2 >= end) goto <D.16715>; else goto <D.16716>;
        <D.16715>:
        mono_error_set_not_verifiable (error, method, "Invalid switch instruction %x", cli_addr);
        return;
        <D.16716>:
        ip.2 = ip;
        D.16717 = MEM[(const guint32 *)ip.2];
        D.16718 = D.16717 + offset;
        next = bb_split (bb, next, root, D.16718, 1, method, error);
        if (next == 0B) goto <D.16719>; else goto <D.16720>;
        <D.16719>:
        return;
        <D.16720>:
        bb_link (current, next);
        ip.2 = ip;
        ip.11 = ip.2 + 4;
        ip = ip.11;
        j = j + 1;
        <D.16552>:
        if (j < n) goto <D.16551>; else goto <D.16553>;
        <D.16553>:
        current = tmp;
        goto <D.16531>;
      }
      <D.16554>:
      ip.2 = ip;
      D.16651 = *ip.2;
      D.16652 = (int) D.16651;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16652);
      return;
      <D.16531>:
      <D.16556>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16555>; else goto <D.16557>;
      <D.16557>:
      ip.2 = ip;
      if (ip.2 != end) goto <D.16722>; else goto <D.16723>;
      <D.16722>:
      mono_error_set_not_verifiable (error, method, "Invalid last instruction");
      <D.16723>:
    }
  finally
    {
      ip = {CLOBBER};
      value = {CLOBBER};
    }
}


mono_opcode_has_static_branch (int opcode)
{
  gboolean D.16727;

  switch (opcode) <default: <D.16728>, case 42: <D.16506>, case 122: <D.16507>, case 220: <D.16509>, case 282: <D.16508>>
  <D.16506>:
  <D.16507>:
  <D.16508>:
  <D.16509>:
  D.16727 = 1;
  return D.16727;
  <D.16728>:
  D.16727 = 0;
  return D.16727;
}


bb_unlink (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16730;
  struct GSList * D.16733;

  D.16730 = from->out_bb;
  if (D.16730 != 0B) goto <D.16731>; else goto <D.16732>;
  <D.16731>:
  D.16730 = from->out_bb;
  D.16733 = monoeg_g_slist_remove (D.16730, to);
  from->out_bb = D.16733;
  <D.16732>:
}


bb_split (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * hint, struct MonoSimpleBasicBlock * * root, guint target, gboolean link_blocks, struct MonoMethod * method, struct MonoError * error)
{
  int target.12;
  int D.16735;
  struct MonoSimpleBasicBlock * D.16740;
  int D.16742;
  int D.16744;
  int D.16746;
  unsigned int D.16747;
  struct MonoSimpleBasicBlock * D.16753;
  int D.16756;
  struct MonoSimpleBasicBlock * D.16757;
  struct GSList * D.16758;
  int D.16759;
  struct MonoSimpleBasicBlock * res;
  struct MonoSimpleBasicBlock * bb;

  bb = first;
  target.12 = (int) target;
  D.16735 = bb_idx_is_contained (hint, target.12);
  if (D.16735 != 0) goto <D.16736>; else goto <D.16737>;
  <D.16736>:
  first = hint;
  goto <D.16738>;
  <D.16737>:
  D.16740 = hint->next;
  if (D.16740 != 0B) goto <D.16741>; else goto <D.16739>;
  <D.16741>:
  target.12 = (int) target;
  D.16740 = hint->next;
  D.16742 = bb_idx_is_contained (D.16740, target.12);
  if (D.16742 != 0) goto <D.16743>; else goto <D.16739>;
  <D.16743>:
  first = hint->next;
  goto <D.16485>;
  <D.16739>:
  first = *root;
  <D.16486>:
  target.12 = (int) target;
  D.16744 = bb_idx_is_contained (first, target.12);
  if (D.16744 != 0) goto <D.16485>; else goto <D.16745>;
  <D.16745>:
  D.16746 = first->start;
  D.16747 = (unsigned int) D.16746;
  if (D.16747 > target) goto <D.16748>; else goto <D.16749>;
  <D.16748>:
  first = first->left;
  goto <D.16750>;
  <D.16749>:
  first = first->right;
  <D.16750>:
  if (first != 0B) goto <D.16486>; else goto <D.16485>;
  <D.16485>:
  <D.16738>:
  if (first == 0B) goto <D.16751>; else goto <D.16752>;
  <D.16751>:
  mono_error_set_not_verifiable (error, method, "Invalid instruction target %x", target);
  D.16753 = 0B;
  return D.16753;
  <D.16752>:
  D.16746 = first->start;
  D.16747 = (unsigned int) D.16746;
  if (D.16747 == target) goto <D.16754>; else goto <D.16755>;
  <D.16754>:
  D.16753 = first;
  return D.16753;
  <D.16755>:
  res = monoeg_malloc0 (56);
  target.12 = (int) target;
  res->start = target.12;
  D.16756 = first->end;
  res->end = D.16756;
  D.16757 = first->next;
  res->next = D.16757;
  D.16758 = first->out_bb;
  res->out_bb = D.16758;
  res->dead = 1;
  D.16759 = res->start;
  first->end = D.16759;
  first->next = res;
  first->out_bb = 0B;
  if (link_blocks != 0) goto <D.16760>; else goto <D.16761>;
  <D.16760>:
  bb_link (first, res);
  <D.16761>:
  bb_insert (bb, res, root);
  D.16753 = res;
  return D.16753;
}


bb_idx_is_contained (struct MonoSimpleBasicBlock * bb, int target)
{
  gboolean D.16763;
  int iftmp.13;
  int D.16767;
  int D.16769;

  D.16767 = bb->start;
  if (D.16767 <= target) goto <D.16768>; else goto <D.16765>;
  <D.16768>:
  D.16769 = bb->end;
  if (D.16769 > target) goto <D.16770>; else goto <D.16765>;
  <D.16770>:
  iftmp.13 = 1;
  goto <D.16766>;
  <D.16765>:
  iftmp.13 = 0;
  <D.16766>:
  D.16763 = iftmp.13;
  return D.16763;
}


bb_insert (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  int D.16772;
  struct MonoSimpleBasicBlock * D.16775;
  struct MonoSimpleBasicBlock * D.16779;
  _Bool D.16782;
  long int D.16783;
  long int D.16784;
  struct MonoSimpleBasicBlock * D.16787;
  unsigned char D.16790;
  unsigned char D.16791;
  unsigned char D.16795;
  unsigned char D.16796;
  struct MonoSimpleBasicBlock * D.16801;
  struct MonoSimpleBasicBlock * D.16803;
  struct MonoSimpleBasicBlock * D.16805;
  struct MonoSimpleBasicBlock * D.16808;
  struct MonoSimpleBasicBlock * parent;
  struct MonoSimpleBasicBlock * uncle;
  struct MonoSimpleBasicBlock * grandparent;
  int bb_start;

  bb_start = bb->start;
  parent = *root;
  <D.16466>:
  D.16772 = parent->start;
  if (D.16772 > bb_start) goto <D.16773>; else goto <D.16774>;
  <D.16773>:
  D.16775 = parent->left;
  if (D.16775 == 0B) goto <D.16776>; else goto <D.16777>;
  <D.16776>:
  parent->left = bb;
  goto <D.16465>;
  <D.16777>:
  parent = parent->left;
  goto <D.16778>;
  <D.16774>:
  D.16779 = parent->right;
  if (D.16779 == 0B) goto <D.16780>; else goto <D.16781>;
  <D.16780>:
  parent->right = bb;
  goto <D.16465>;
  <D.16781>:
  parent = parent->right;
  <D.16778>:
  if (parent != 0B) goto <D.16466>; else goto <D.16465>;
  <D.16465>:
  D.16782 = parent == 0B;
  D.16783 = (long int) D.16782;
  D.16784 = __builtin_expect (D.16783, 0);
  if (D.16784 != 0) goto <D.16785>; else goto <D.16786>;
  <D.16785>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 180, "parent");
  <D.16786>:
  bb->parent = parent;
  bb->colour = 0;
  <D.16469>:
  D.16787 = bb->parent;
  if (D.16787 == 0B) goto <D.16788>; else goto <D.16789>;
  <D.16788>:
  bb->colour = 1;
  goto <D.16467>;
  <D.16789>:
  D.16787 = bb->parent;
  D.16790 = BIT_FIELD_REF <*D.16787, 8, 384>;
  D.16791 = D.16790 & 1;
  if (D.16791 != 0) goto <D.16467>; else goto <D.16792>;
  <D.16792>:
  uncle = bb_uncle (bb);
  if (uncle != 0B) goto <D.16793>; else goto <D.16794>;
  <D.16793>:
  D.16795 = BIT_FIELD_REF <*uncle, 8, 384>;
  D.16796 = D.16795 & 1;
  if (D.16796 == 0) goto <D.16797>; else goto <D.16798>;
  <D.16797>:
  grandparent = bb_grandparent (bb);
  D.16787 = bb->parent;
  D.16787->colour = 1;
  uncle->colour = 1;
  grandparent->colour = 0;
  bb = grandparent;
  // predicted unlikely by continue predictor.
  goto <D.16468>;
  <D.16798>:
  <D.16794>:
  grandparent = bb_grandparent (bb);
  D.16787 = bb->parent;
  D.16801 = D.16787->right;
  if (D.16801 == bb) goto <D.16802>; else goto <D.16799>;
  <D.16802>:
  D.16787 = bb->parent;
  D.16803 = grandparent->left;
  if (D.16787 == D.16803) goto <D.16804>; else goto <D.16799>;
  <D.16804>:
  D.16787 = bb->parent;
  rotate_left (D.16787, root);
  bb = bb->left;
  goto <D.16800>;
  <D.16799>:
  D.16787 = bb->parent;
  D.16805 = D.16787->left;
  if (D.16805 == bb) goto <D.16806>; else goto <D.16807>;
  <D.16806>:
  D.16787 = bb->parent;
  D.16808 = grandparent->right;
  if (D.16787 == D.16808) goto <D.16809>; else goto <D.16810>;
  <D.16809>:
  D.16787 = bb->parent;
  rotate_right (D.16787, root);
  bb = bb->right;
  <D.16810>:
  <D.16807>:
  <D.16800>:
  grandparent = bb_grandparent (bb);
  D.16787 = bb->parent;
  D.16787->colour = 1;
  grandparent->colour = 0;
  D.16787 = bb->parent;
  D.16805 = D.16787->left;
  if (D.16805 == bb) goto <D.16813>; else goto <D.16811>;
  <D.16813>:
  D.16787 = bb->parent;
  D.16803 = grandparent->left;
  if (D.16787 == D.16803) goto <D.16814>; else goto <D.16811>;
  <D.16814>:
  rotate_right (grandparent, root);
  goto <D.16812>;
  <D.16811>:
  rotate_left (grandparent, root);
  <D.16812>:
  goto <D.16467>;
  <D.16468>:
  goto <D.16469>;
  <D.16467>:
}


bb_uncle (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16817;
  struct MonoSimpleBasicBlock * D.16818;
  struct MonoSimpleBasicBlock * D.16819;
  struct MonoSimpleBasicBlock * gp;

  gp = bb_grandparent (bb);
  if (gp == 0B) goto <D.16815>; else goto <D.16816>;
  <D.16815>:
  D.16817 = 0B;
  return D.16817;
  <D.16816>:
  D.16818 = bb->parent;
  D.16819 = gp->left;
  if (D.16818 == D.16819) goto <D.16820>; else goto <D.16821>;
  <D.16820>:
  D.16817 = gp->right;
  return D.16817;
  <D.16821>:
  D.16817 = gp->left;
  return D.16817;
}


bb_grandparent (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16823;
  struct MonoSimpleBasicBlock * iftmp.14;
  struct MonoSimpleBasicBlock * D.16828;

  if (bb != 0B) goto <D.16827>; else goto <D.16825>;
  <D.16827>:
  D.16828 = bb->parent;
  if (D.16828 != 0B) goto <D.16829>; else goto <D.16825>;
  <D.16829>:
  D.16828 = bb->parent;
  iftmp.14 = D.16828->parent;
  goto <D.16826>;
  <D.16825>:
  iftmp.14 = 0B;
  <D.16826>:
  D.16823 = iftmp.14;
  return D.16823;
}


rotate_right (struct MonoSimpleBasicBlock * parent, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16831;
  struct MonoSimpleBasicBlock * D.16834;
  struct MonoSimpleBasicBlock * bb;

  bb = parent->left;
  D.16831 = bb->right;
  if (D.16831 != 0B) goto <D.16832>; else goto <D.16833>;
  <D.16832>:
  D.16831 = bb->right;
  parent->left = D.16831;
  D.16834 = parent->left;
  D.16834->parent = parent;
  goto <D.16835>;
  <D.16833>:
  parent->left = 0B;
  <D.16835>:
  bb->right = parent;
  change_node (parent, bb, root);
  parent->parent = bb;
}


change_node (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16838;
  struct MonoSimpleBasicBlock * parent;

  parent = from->parent;
  if (parent != 0B) goto <D.16836>; else goto <D.16837>;
  <D.16836>:
  D.16838 = parent->left;
  if (D.16838 == from) goto <D.16839>; else goto <D.16840>;
  <D.16839>:
  parent->left = to;
  goto <D.16841>;
  <D.16840>:
  parent->right = to;
  <D.16841>:
  goto <D.16842>;
  <D.16837>:
  *root = to;
  <D.16842>:
  to->parent = parent;
}


rotate_left (struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16843;
  struct MonoSimpleBasicBlock * D.16846;
  struct MonoSimpleBasicBlock * other;

  other = bb->right;
  D.16843 = other->left;
  if (D.16843 != 0B) goto <D.16844>; else goto <D.16845>;
  <D.16844>:
  D.16843 = other->left;
  bb->right = D.16843;
  D.16846 = bb->right;
  D.16846->parent = bb;
  goto <D.16847>;
  <D.16845>:
  bb->right = 0B;
  <D.16847>:
  other->left = bb;
  change_node (bb, other, root);
  bb->parent = other;
}


bb_link (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16848;
  struct GSList * D.16849;
  struct GSList * D.16852;

  D.16848 = from->out_bb;
  D.16849 = monoeg_g_slist_find (D.16848, to);
  if (D.16849 != 0B) goto <D.16850>; else goto <D.16851>;
  <D.16850>:
  return;
  <D.16851>:
  D.16848 = from->out_bb;
  D.16852 = monoeg_g_slist_prepend (D.16848, to);
  from->out_bb = D.16852;
}


bb_formation_eh_pass (struct MonoMethodHeader * header, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16854;
  struct MonoExceptionClause * D.16855;
  long unsigned int D.16856;
  long unsigned int D.16857;
  unsigned int D.16858;
  unsigned int D.16861;
  unsigned int D.16864;
  unsigned int D.16867;
  unsigned int D.16870;
  unsigned int D.16871;
  unsigned int end.15;
  struct MonoSimpleBasicBlock * D.16875;
  unsigned int D.16878;
  unsigned int D.16879;
  struct MonoSimpleBasicBlock * D.16882;
  <unnamed-unsigned:15> D.16885;
  int D.16886;
  int i;
  int end;

  D.16854 = header->code_size;
  end = (int) D.16854;
  i = 0;
  goto <D.16572>;
  <D.16571>:
  {
    struct MonoExceptionClause * clause;
    struct MonoSimpleBasicBlock * try_block;
    struct MonoSimpleBasicBlock * handler;

    D.16855 = header->clauses;
    D.16856 = (long unsigned int) i;
    D.16857 = D.16856 * 32;
    clause = D.16855 + D.16857;
    D.16858 = clause->try_offset;
    try_block = bb_split (bb, bb, root, D.16858, 1, method, error);
    if (try_block == 0B) goto <D.16859>; else goto <D.16860>;
    <D.16859>:
    return;
    <D.16860>:
    D.16861 = clause->handler_offset;
    handler = bb_split (bb, try_block, root, D.16861, 0, method, error);
    if (handler == 0B) goto <D.16862>; else goto <D.16863>;
    <D.16862>:
    return;
    <D.16863>:
    handler->dead = 0;
    D.16864 = clause->flags;
    if (D.16864 == 1) goto <D.16865>; else goto <D.16866>;
    <D.16865>:
    {
      struct MonoSimpleBasicBlock * filter;

      D.16867 = clause->data.filter_offset;
      filter = bb_split (bb, try_block, root, D.16867, 0, method, error);
      if (filter == 0B) goto <D.16868>; else goto <D.16869>;
      <D.16868>:
      return;
      <D.16869>:
      filter->dead = 0;
    }
    <D.16866>:
    D.16858 = clause->try_offset;
    D.16870 = clause->try_len;
    D.16871 = D.16858 + D.16870;
    end.15 = (unsigned int) end;
    if (D.16871 < end.15) goto <D.16873>; else goto <D.16874>;
    <D.16873>:
    D.16858 = clause->try_offset;
    D.16870 = clause->try_len;
    D.16871 = D.16858 + D.16870;
    D.16875 = bb_split (bb, try_block, root, D.16871, 0, method, error);
    if (D.16875 == 0B) goto <D.16876>; else goto <D.16877>;
    <D.16876>:
    return;
    <D.16877>:
    <D.16874>:
    D.16861 = clause->handler_offset;
    D.16878 = clause->handler_len;
    D.16879 = D.16861 + D.16878;
    end.15 = (unsigned int) end;
    if (D.16879 < end.15) goto <D.16880>; else goto <D.16881>;
    <D.16880>:
    D.16861 = clause->handler_offset;
    D.16878 = clause->handler_len;
    D.16879 = D.16861 + D.16878;
    D.16882 = bb_split (bb, handler, root, D.16879, 0, method, error);
    if (D.16882 == 0B) goto <D.16883>; else goto <D.16884>;
    <D.16883>:
    return;
    <D.16884>:
    <D.16881>:
  }
  i = i + 1;
  <D.16572>:
  D.16885 = header->num_clauses;
  D.16886 = (int) D.16885;
  if (D.16886 > i) goto <D.16571>; else goto <D.16573>;
  <D.16573>:
}


bb_liveness (struct MonoSimpleBasicBlock * bb)
{
  unsigned char D.16888;
  unsigned char D.16889;
  unsigned int D.16892;
  unsigned int D.16893;
  unsigned char D.16894;
  unsigned char D.16895;
  struct GPtrArray * mark_stack;
  struct GSList * tmp;

  mark_stack = monoeg_g_ptr_array_new ();
  goto <D.16493>;
  <D.16492>:
  D.16888 = BIT_FIELD_REF <*bb, 8, 384>;
  D.16889 = D.16888 & 2;
  if (D.16889 == 0) goto <D.16890>; else goto <D.16891>;
  <D.16890>:
  monoeg_g_ptr_array_add (mark_stack, bb);
  <D.16891>:
  bb = bb->next;
  <D.16493>:
  if (bb != 0B) goto <D.16492>; else goto <D.16494>;
  <D.16494>:
  goto <D.16501>;
  <D.16500>:
  {
    struct MonoSimpleBasicBlock * block;

    D.16892 = mark_stack->len;
    D.16893 = D.16892 + 4294967295;
    block = monoeg_g_ptr_array_remove_index_fast (mark_stack, D.16893);
    block->dead = 0;
    tmp = block->out_bb;
    goto <D.16498>;
    <D.16497>:
    {
      struct MonoSimpleBasicBlock * to;

      to = tmp->data;
      D.16894 = BIT_FIELD_REF <*to, 8, 384>;
      D.16895 = D.16894 & 2;
      if (D.16895 != 0) goto <D.16896>; else goto <D.16897>;
      <D.16896>:
      monoeg_g_ptr_array_add (mark_stack, to);
      <D.16897>:
    }
    tmp = tmp->next;
    <D.16498>:
    if (tmp != 0B) goto <D.16497>; else goto <D.16499>;
    <D.16499>:
  }
  <D.16501>:
  D.16892 = mark_stack->len;
  if (D.16892 != 0) goto <D.16500>; else goto <D.16502>;
  <D.16502>:
  monoeg_g_ptr_array_free (mark_stack, 1);
}


mono_opcode_value_and_size (const unsigned char * * ip, const unsigned char * end, int * value)
{
  <unnamed type> D.16898;
  int D.16899;
  unsigned int i.16;
  int D.16903;
  unsigned char D.16904;
  int D.16905;
  const unsigned char * D.16908;
  long unsigned int p.17;
  unsigned int D.16913;
  unsigned int D.16914;
  sizetype D.16917;
  const unsigned char * D.16918;
  long unsigned int D.16920;
  long unsigned int D.16921;
  long int p.18;
  long int start.19;
  long int D.16924;
  unsigned int D.16925;
  unsigned int size.20;
  unsigned int D.16927;
  const unsigned char * start;
  const unsigned char * p;
  int i;
  int size;

  start = *ip;
  D.16898 = mono_opcode_value (ip, end);
  D.16899 = (int) D.16898;
  *value = D.16899;
  i = *value;
  size = 0;
  i.16 = (unsigned int) i;
  if (i.16 > 312) goto <D.16901>; else goto <D.16902>;
  <D.16901>:
  D.16903 = -1;
  return D.16903;
  <D.16902>:
  p = *ip;
  D.16904 = mono_opcodes[i].argument;
  D.16905 = (int) D.16904;
  switch (D.16905) <default: <D.16619>, case 0: <D.16600>, case 1: <D.16603>, case 2: <D.16604>, case 3: <D.16605>, case 4: <D.16606>, case 5: <D.16602>, case 6: <D.16607>, case 7: <D.16611>, case 8: <D.16612>, case 9: <D.16610>, case 10: <D.16614>, case 11: <D.16617>, case 12: <D.16615>, case 13: <D.16608>, case 14: <D.16609>, case 15: <D.16613>, case 16: <D.16616>>
  <D.16600>:
  size = 1;
  goto <D.16601>;
  <D.16602>:
  <D.16603>:
  <D.16604>:
  <D.16605>:
  <D.16606>:
  <D.16607>:
  <D.16608>:
  <D.16609>:
  <D.16610>:
  size = 5;
  goto <D.16601>;
  <D.16611>:
  size = 3;
  goto <D.16601>;
  <D.16612>:
  <D.16613>:
  <D.16614>:
  size = 2;
  goto <D.16601>;
  <D.16615>:
  <D.16616>:
  size = 9;
  goto <D.16601>;
  <D.16617>:
  {
    guint32 entries;

    D.16908 = p + 5;
    if (D.16908 > end) goto <D.16906>; else goto <D.16909>;
    <D.16909>:
    p.17 = (long unsigned int) p;
    if (p.17 > 18446744073709551610) goto <D.16906>; else goto <D.16907>;
    <D.16906>:
    D.16903 = -1;
    return D.16903;
    <D.16907>:
    entries = MEM[(const guint32 *)p + 1B];
    if (entries > 1073741822) goto <D.16911>; else goto <D.16912>;
    <D.16911>:
    D.16903 = -1;
    return D.16903;
    <D.16912>:
    D.16913 = entries + 1;
    D.16914 = D.16913 * 4;
    size = (int) D.16914;
    goto <D.16601>;
  }
  <D.16619>:
  D.16904 = mono_opcodes[i].argument;
  D.16905 = (int) D.16904;
  monoeg_g_log (0B, 4, "Invalid opcode %d argument %d max opcode %d\n", i, D.16905, 313);
  <D.16620>:
  goto <D.16620>;
  <D.16601>:
  D.16917 = (sizetype) size;
  D.16918 = p + D.16917;
  if (D.16918 > end) goto <D.16915>; else goto <D.16919>;
  <D.16919>:
  D.16920 = (long unsigned int) size;
  D.16921 = ~D.16920;
  p.17 = (long unsigned int) p;
  if (D.16921 < p.17) goto <D.16915>; else goto <D.16916>;
  <D.16915>:
  D.16903 = -1;
  return D.16903;
  <D.16916>:
  p.18 = (long int) p;
  start.19 = (long int) start;
  D.16924 = p.18 - start.19;
  D.16925 = (unsigned int) D.16924;
  size.20 = (unsigned int) size;
  D.16927 = D.16925 + size.20;
  D.16903 = (int) D.16927;
  return D.16903;
}


mono_opcode_size (const unsigned char * ip, const unsigned char * end)
{
  int D.16929;
  int tmp;

  try
    {
      D.16929 = mono_opcode_value_and_size (&ip, end, &tmp);
      return D.16929;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


