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

  goto <D.18770>;
  <D.18769>:
  {
    struct MonoSimpleBasicBlock * next;

    next = bb->next;
    D.18820 = bb->out_bb;
    if (D.18820 != 0B) goto <D.18821>; else goto <D.18822>;
    <D.18821>:
    D.18820 = bb->out_bb;
    monoeg_g_slist_free (D.18820);
    <D.18822>:
    monoeg_g_free (bb);
    bb = next;
  }
  <D.18770>:
  if (bb != 0B) goto <D.18769>; else goto <D.18771>;
  <D.18771>:
}


mono_basic_block_split (struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.18823;
  struct MonoSimpleBasicBlock * D.18826;
  int end.0;
  int start.1;
  int D.18829;
  int D.18830;
  int D.18832;
  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.18823 = header->code_size;
      end = start + D.18823;
      mono_error_init (error);
      if (header == 0B) goto <D.18824>; else goto <D.18825>;
      <D.18824>:
      mono_error_set_not_verifiable (error, method, "Could not decode header");
      D.18826 = 0B;
      return D.18826;
      <D.18825>:
      bb = monoeg_malloc0 (32);
      bb->start = 0;
      end.0 = (int) end;
      start.1 = (int) start;
      D.18829 = end.0 - start.1;
      bb->end = D.18829;
      bb->colour = 1;
      bb->dead = 0;
      root = bb;
      bb_formation_il_pass (start, end, bb, &root, method, error);
      D.18830 = mono_error_ok (error);
      if (D.18830 == 0) goto fail; else goto <D.18831>;
      <D.18831>:
      bb_formation_eh_pass (header, bb, &root, method, error);
      D.18832 = mono_error_ok (error);
      if (D.18832 == 0) goto fail; else goto <D.18833>;
      <D.18833>:
      bb_liveness (bb);
      mono_metadata_free_mh (header);
      D.18826 = bb;
      return D.18826;
      fail:
      mono_metadata_free_mh (header);
      mono_basic_block_free (bb);
      D.18826 = 0B;
      return D.18826;
    }
  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;
  int ip.3;
  int start.4;
  int D.18839;
  unsigned char D.18842;
  int D.18843;
  int D.18845;
  unsigned int D.18846;
  _Bool D.18847;
  long int D.18848;
  long int D.18849;
  int value.5;
  unsigned char D.18853;
  int D.18854;
  const unsigned char * ip.6;
  int D.18856;
  unsigned int D.18859;
  const unsigned char * ip.7;
  const unsigned char * ip.8;
  const unsigned char * ip.9;
  const unsigned char * ip.10;
  unsigned char D.18872;
  signed char D.18873;
  unsigned int D.18874;
  unsigned int D.18875;
  unsigned int D.18877;
  unsigned int D.18878;
  int D.18883;
  int D.18884;
  unsigned char D.18889;
  _Bool D.18890;
  int D.18891;
  unsigned int D.18901;
  unsigned int D.18902;
  unsigned int D.18907;
  unsigned int D.18908;
  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.18747>;
      <D.18746>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.18839 = ip.3 - start.4;
      cli_addr = (guint) D.18839;
      size = mono_opcode_value_and_size (&ip, end, &value);
      if (size < 0) goto <D.18840>; else goto <D.18841>;
      <D.18840>:
      ip.2 = ip;
      D.18842 = *ip.2;
      D.18843 = (int) D.18842;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.18843);
      return;
      <D.18841>:
      goto <D.18719>;
      <D.18718>:
      current = current->next;
      <D.18719>:
      if (current != 0B) goto <D.18844>; else goto <D.18720>;
      <D.18844>:
      D.18845 = current->end;
      D.18846 = (unsigned int) D.18845;
      if (D.18846 <= cli_addr) goto <D.18718>; else goto <D.18720>;
      <D.18720>:
      D.18847 = current == 0B;
      D.18848 = (long int) D.18847;
      D.18849 = __builtin_expect (D.18848, 0);
      if (D.18849 != 0) goto <D.18850>; else goto <D.18851>;
      <D.18850>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 350, "current");
      <D.18851>:
      value.5 = value;
      opcode = &mono_opcodes[value.5];
      D.18853 = opcode->argument;
      D.18854 = (int) D.18853;
      switch (D.18854) <default: <D.18745>, case 0: <D.18721>, case 1: <D.18724>, case 2: <D.18725>, case 3: <D.18730>, case 4: <D.18726>, case 5: <D.18723>, case 6: <D.18727>, case 7: <D.18731>, case 8: <D.18732>, case 9: <D.18737>, case 10: <D.18736>, case 11: <D.18738>, case 12: <D.18734>, case 13: <D.18728>, case 14: <D.18729>, case 15: <D.18733>, case 16: <D.18735>>
      <D.18721>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      ip = ip.6;
      value.5 = value;
      D.18856 = mono_opcode_has_static_branch (value.5);
      if (D.18856 == 0) goto <D.18722>; else goto <D.18857>;
      <D.18857>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.18722>; else goto <D.18858>;
      <D.18858>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.18839 = ip.3 - start.4;
      D.18859 = (unsigned int) D.18839;
      next = bb_split (bb, current, root, D.18859, 0, method, error);
      if (next == 0B) goto <D.18860>; else goto <D.18861>;
      <D.18860>:
      return;
      <D.18861>:
      bb_unlink (current, next);
      current = next;
      goto <D.18722>;
      <D.18723>:
      <D.18724>:
      <D.18725>:
      <D.18726>:
      <D.18727>:
      <D.18728>:
      <D.18729>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      goto <D.18722>;
      <D.18730>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      value.5 = value;
      if (value.5 != 39) goto <D.18722>; else goto <D.18863>;
      <D.18863>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.18722>; else goto <D.18864>;
      <D.18864>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.18839 = ip.3 - start.4;
      D.18859 = (unsigned int) D.18839;
      next = bb_split (bb, current, root, D.18859, 0, method, error);
      if (next == 0B) goto <D.18865>; else goto <D.18866>;
      <D.18865>:
      return;
      <D.18866>:
      bb_unlink (current, next);
      current = next;
      goto <D.18722>;
      <D.18731>:
      ip.2 = ip;
      ip.8 = ip.2 + 3;
      ip = ip.8;
      goto <D.18722>;
      <D.18732>:
      <D.18733>:
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.18722>;
      <D.18734>:
      <D.18735>:
      ip.2 = ip;
      ip.10 = ip.2 + 9;
      ip = ip.10;
      goto <D.18722>;
      <D.18736>:
      <D.18737>:
      D.18853 = opcode->argument;
      if (D.18853 == 10) goto <D.18870>; else goto <D.18871>;
      <D.18870>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.18872 = *ip.6;
      D.18873 = (signed char) D.18872;
      D.18874 = (unsigned int) D.18873;
      D.18875 = D.18874 + cli_addr;
      offset = D.18875 + 2;
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.18876>;
      <D.18871>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.18877 = mono_read32 (ip.6);
      D.18878 = D.18877 + cli_addr;
      offset = D.18878 + 5;
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      <D.18876>:
      branch = bb_split (bb, current, root, offset, 1, method, error);
      if (branch == 0B) goto <D.18879>; else goto <D.18880>;
      <D.18879>:
      return;
      <D.18880>:
      if (offset < cli_addr) goto <D.18881>; else goto <D.18882>;
      <D.18881>:
      D.18883 = branch->start;
      D.18884 = current->start;
      if (D.18883 > D.18884) goto <D.18885>; else goto <D.18886>;
      <D.18885>:
      current = branch;
      <D.18886>:
      <D.18882>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.18887>; else goto <D.18888>;
      <D.18887>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.18839 = ip.3 - start.4;
      D.18859 = (unsigned int) D.18839;
      D.18889 = opcode->flow_type;
      D.18890 = D.18889 != 1;
      D.18891 = (int) D.18890;
      next = bb_split (bb, current, root, D.18859, D.18891, method, error);
      if (next == 0B) goto <D.18892>; else goto <D.18893>;
      <D.18892>:
      return;
      <D.18893>:
      goto <D.18894>;
      <D.18888>:
      next = 0B;
      <D.18894>:
      bb_link (current, branch);
      if (next != 0B) goto <D.18895>; else goto <D.18896>;
      <D.18895>:
      D.18889 = opcode->flow_type;
      if (D.18889 == 1) goto <D.18897>; else goto <D.18898>;
      <D.18897>:
      if (next != branch) goto <D.18899>; else goto <D.18900>;
      <D.18899>:
      bb_unlink (current, next);
      current = next;
      <D.18900>:
      <D.18898>:
      <D.18896>:
      goto <D.18722>;
      <D.18738>:
      {
        struct MonoSimpleBasicBlock * tmp;
        guint32 j;
        guint32 n;

        ip.2 = ip;
        ip.6 = ip.2 + 1;
        n = mono_read32 (ip.6);
        ip.2 = ip;
        ip.7 = ip.2 + 5;
        ip = ip.7;
        D.18901 = n * 4;
        D.18902 = D.18901 + cli_addr;
        offset = D.18902 + 5;
        next = bb_split (bb, current, root, offset, 1, method, error);
        if (next == 0B) goto <D.18903>; else goto <D.18904>;
        <D.18903>:
        return;
        <D.18904>:
        bb_link (current, next);
        tmp = next;
        j = 0;
        goto <D.18743>;
        <D.18742>:
        ip.2 = ip;
        if (ip.2 >= end) goto <D.18905>; else goto <D.18906>;
        <D.18905>:
        mono_error_set_not_verifiable (error, method, "Invalid switch instruction %x", cli_addr);
        return;
        <D.18906>:
        ip.2 = ip;
        D.18907 = mono_read32 (ip.2);
        D.18908 = D.18907 + offset;
        next = bb_split (bb, next, root, D.18908, 1, method, error);
        if (next == 0B) goto <D.18909>; else goto <D.18910>;
        <D.18909>:
        return;
        <D.18910>:
        bb_link (current, next);
        ip.2 = ip;
        ip.11 = ip.2 + 4;
        ip = ip.11;
        j = j + 1;
        <D.18743>:
        if (j < n) goto <D.18742>; else goto <D.18744>;
        <D.18744>:
        current = tmp;
        goto <D.18722>;
      }
      <D.18745>:
      ip.2 = ip;
      D.18842 = *ip.2;
      D.18843 = (int) D.18842;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.18843);
      return;
      <D.18722>:
      <D.18747>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.18746>; else goto <D.18748>;
      <D.18748>:
      ip.2 = ip;
      if (ip.2 != end) goto <D.18912>; else goto <D.18913>;
      <D.18912>:
      mono_error_set_not_verifiable (error, method, "Invalid last instruction");
      <D.18913>:
    }
  finally
    {
      ip = {CLOBBER};
      value = {CLOBBER};
    }
}


mono_opcode_has_static_branch (int opcode)
{
  gboolean D.18917;

  switch (opcode) <default: <D.18918>, case 42: <D.18697>, case 122: <D.18698>, case 220: <D.18700>, case 282: <D.18699>>
  <D.18697>:
  <D.18698>:
  <D.18699>:
  <D.18700>:
  D.18917 = 1;
  return D.18917;
  <D.18918>:
  D.18917 = 0;
  return D.18917;
}


bb_unlink (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.18920;
  struct GSList * D.18923;

  D.18920 = from->out_bb;
  if (D.18920 != 0B) goto <D.18921>; else goto <D.18922>;
  <D.18921>:
  D.18920 = from->out_bb;
  D.18923 = monoeg_g_slist_remove (D.18920, to);
  from->out_bb = D.18923;
  <D.18922>:
}


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.18925;
  struct MonoSimpleBasicBlock * D.18930;
  int D.18932;
  int D.18934;
  int D.18936;
  unsigned int D.18937;
  struct MonoSimpleBasicBlock * D.18943;
  int D.18946;
  struct MonoSimpleBasicBlock * D.18947;
  struct GSList * D.18948;
  int D.18949;
  struct MonoSimpleBasicBlock * res;
  struct MonoSimpleBasicBlock * bb;

  bb = first;
  target.12 = (int) target;
  D.18925 = bb_idx_is_contained (hint, target.12);
  if (D.18925 != 0) goto <D.18926>; else goto <D.18927>;
  <D.18926>:
  first = hint;
  goto <D.18928>;
  <D.18927>:
  D.18930 = hint->next;
  if (D.18930 != 0B) goto <D.18931>; else goto <D.18929>;
  <D.18931>:
  D.18930 = hint->next;
  target.12 = (int) target;
  D.18932 = bb_idx_is_contained (D.18930, target.12);
  if (D.18932 != 0) goto <D.18933>; else goto <D.18929>;
  <D.18933>:
  first = hint->next;
  goto <D.18676>;
  <D.18929>:
  first = *root;
  <D.18677>:
  target.12 = (int) target;
  D.18934 = bb_idx_is_contained (first, target.12);
  if (D.18934 != 0) goto <D.18676>; else goto <D.18935>;
  <D.18935>:
  D.18936 = first->start;
  D.18937 = (unsigned int) D.18936;
  if (D.18937 > target) goto <D.18938>; else goto <D.18939>;
  <D.18938>:
  first = first->left;
  goto <D.18940>;
  <D.18939>:
  first = first->right;
  <D.18940>:
  if (first != 0B) goto <D.18677>; else goto <D.18676>;
  <D.18676>:
  <D.18928>:
  if (first == 0B) goto <D.18941>; else goto <D.18942>;
  <D.18941>:
  mono_error_set_not_verifiable (error, method, "Invalid instruction target %x", target);
  D.18943 = 0B;
  return D.18943;
  <D.18942>:
  D.18936 = first->start;
  D.18937 = (unsigned int) D.18936;
  if (D.18937 == target) goto <D.18944>; else goto <D.18945>;
  <D.18944>:
  D.18943 = first;
  return D.18943;
  <D.18945>:
  res = monoeg_malloc0 (32);
  target.12 = (int) target;
  res->start = target.12;
  D.18946 = first->end;
  res->end = D.18946;
  D.18947 = first->next;
  res->next = D.18947;
  D.18948 = first->out_bb;
  res->out_bb = D.18948;
  res->dead = 1;
  D.18949 = res->start;
  first->end = D.18949;
  first->next = res;
  first->out_bb = 0B;
  if (link_blocks != 0) goto <D.18950>; else goto <D.18951>;
  <D.18950>:
  bb_link (first, res);
  <D.18951>:
  bb_insert (bb, res, root);
  D.18943 = res;
  return D.18943;
}


bb_idx_is_contained (struct MonoSimpleBasicBlock * bb, int target)
{
  gboolean D.18953;
  int iftmp.13;
  int D.18957;
  int D.18959;

  D.18957 = bb->start;
  if (D.18957 <= target) goto <D.18958>; else goto <D.18955>;
  <D.18958>:
  D.18959 = bb->end;
  if (D.18959 > target) goto <D.18960>; else goto <D.18955>;
  <D.18960>:
  iftmp.13 = 1;
  goto <D.18956>;
  <D.18955>:
  iftmp.13 = 0;
  <D.18956>:
  D.18953 = iftmp.13;
  return D.18953;
}


bb_insert (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  int D.18962;
  struct MonoSimpleBasicBlock * D.18965;
  struct MonoSimpleBasicBlock * D.18969;
  _Bool D.18972;
  long int D.18973;
  long int D.18974;
  struct MonoSimpleBasicBlock * D.18977;
  unsigned char D.18980;
  unsigned char D.18981;
  unsigned char D.18985;
  unsigned char D.18986;
  struct MonoSimpleBasicBlock * D.18991;
  struct MonoSimpleBasicBlock * D.18993;
  struct MonoSimpleBasicBlock * D.18995;
  struct MonoSimpleBasicBlock * D.18998;
  struct MonoSimpleBasicBlock * parent;
  struct MonoSimpleBasicBlock * uncle;
  struct MonoSimpleBasicBlock * grandparent;
  int bb_start;

  bb_start = bb->start;
  parent = *root;
  <D.18657>:
  D.18962 = parent->start;
  if (D.18962 > bb_start) goto <D.18963>; else goto <D.18964>;
  <D.18963>:
  D.18965 = parent->left;
  if (D.18965 == 0B) goto <D.18966>; else goto <D.18967>;
  <D.18966>:
  parent->left = bb;
  goto <D.18656>;
  <D.18967>:
  parent = parent->left;
  goto <D.18968>;
  <D.18964>:
  D.18969 = parent->right;
  if (D.18969 == 0B) goto <D.18970>; else goto <D.18971>;
  <D.18970>:
  parent->right = bb;
  goto <D.18656>;
  <D.18971>:
  parent = parent->right;
  <D.18968>:
  if (parent != 0B) goto <D.18657>; else goto <D.18656>;
  <D.18656>:
  D.18972 = parent == 0B;
  D.18973 = (long int) D.18972;
  D.18974 = __builtin_expect (D.18973, 0);
  if (D.18974 != 0) goto <D.18975>; else goto <D.18976>;
  <D.18975>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 180, "parent");
  <D.18976>:
  bb->parent = parent;
  bb->colour = 0;
  <D.18660>:
  D.18977 = bb->parent;
  if (D.18977 == 0B) goto <D.18978>; else goto <D.18979>;
  <D.18978>:
  bb->colour = 1;
  goto <D.18658>;
  <D.18979>:
  D.18977 = bb->parent;
  D.18980 = BIT_FIELD_REF <*D.18977, 8, 224>;
  D.18981 = D.18980 & 1;
  if (D.18981 != 0) goto <D.18658>; else goto <D.18982>;
  <D.18982>:
  uncle = bb_uncle (bb);
  if (uncle != 0B) goto <D.18983>; else goto <D.18984>;
  <D.18983>:
  D.18985 = BIT_FIELD_REF <*uncle, 8, 224>;
  D.18986 = D.18985 & 1;
  if (D.18986 == 0) goto <D.18987>; else goto <D.18988>;
  <D.18987>:
  grandparent = bb_grandparent (bb);
  D.18977 = bb->parent;
  D.18977->colour = 1;
  uncle->colour = 1;
  grandparent->colour = 0;
  bb = grandparent;
  // predicted unlikely by continue predictor.
  goto <D.18659>;
  <D.18988>:
  <D.18984>:
  grandparent = bb_grandparent (bb);
  D.18977 = bb->parent;
  D.18991 = D.18977->right;
  if (D.18991 == bb) goto <D.18992>; else goto <D.18989>;
  <D.18992>:
  D.18977 = bb->parent;
  D.18993 = grandparent->left;
  if (D.18977 == D.18993) goto <D.18994>; else goto <D.18989>;
  <D.18994>:
  D.18977 = bb->parent;
  rotate_left (D.18977, root);
  bb = bb->left;
  goto <D.18990>;
  <D.18989>:
  D.18977 = bb->parent;
  D.18995 = D.18977->left;
  if (D.18995 == bb) goto <D.18996>; else goto <D.18997>;
  <D.18996>:
  D.18977 = bb->parent;
  D.18998 = grandparent->right;
  if (D.18977 == D.18998) goto <D.18999>; else goto <D.19000>;
  <D.18999>:
  D.18977 = bb->parent;
  rotate_right (D.18977, root);
  bb = bb->right;
  <D.19000>:
  <D.18997>:
  <D.18990>:
  grandparent = bb_grandparent (bb);
  D.18977 = bb->parent;
  D.18977->colour = 1;
  grandparent->colour = 0;
  D.18977 = bb->parent;
  D.18995 = D.18977->left;
  if (D.18995 == bb) goto <D.19003>; else goto <D.19001>;
  <D.19003>:
  D.18977 = bb->parent;
  D.18993 = grandparent->left;
  if (D.18977 == D.18993) goto <D.19004>; else goto <D.19001>;
  <D.19004>:
  rotate_right (grandparent, root);
  goto <D.19002>;
  <D.19001>:
  rotate_left (grandparent, root);
  <D.19002>:
  goto <D.18658>;
  <D.18659>:
  goto <D.18660>;
  <D.18658>:
}


bb_uncle (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.19007;
  struct MonoSimpleBasicBlock * D.19008;
  struct MonoSimpleBasicBlock * D.19009;
  struct MonoSimpleBasicBlock * gp;

  gp = bb_grandparent (bb);
  if (gp == 0B) goto <D.19005>; else goto <D.19006>;
  <D.19005>:
  D.19007 = 0B;
  return D.19007;
  <D.19006>:
  D.19008 = bb->parent;
  D.19009 = gp->left;
  if (D.19008 == D.19009) goto <D.19010>; else goto <D.19011>;
  <D.19010>:
  D.19007 = gp->right;
  return D.19007;
  <D.19011>:
  D.19007 = gp->left;
  return D.19007;
}


bb_grandparent (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.19013;
  struct MonoSimpleBasicBlock * iftmp.14;
  struct MonoSimpleBasicBlock * D.19018;

  if (bb != 0B) goto <D.19017>; else goto <D.19015>;
  <D.19017>:
  D.19018 = bb->parent;
  if (D.19018 != 0B) goto <D.19019>; else goto <D.19015>;
  <D.19019>:
  D.19018 = bb->parent;
  iftmp.14 = D.19018->parent;
  goto <D.19016>;
  <D.19015>:
  iftmp.14 = 0B;
  <D.19016>:
  D.19013 = iftmp.14;
  return D.19013;
}


rotate_right (struct MonoSimpleBasicBlock * parent, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.19021;
  struct MonoSimpleBasicBlock * D.19024;
  struct MonoSimpleBasicBlock * bb;

  bb = parent->left;
  D.19021 = bb->right;
  if (D.19021 != 0B) goto <D.19022>; else goto <D.19023>;
  <D.19022>:
  D.19021 = bb->right;
  parent->left = D.19021;
  D.19024 = parent->left;
  D.19024->parent = parent;
  goto <D.19025>;
  <D.19023>:
  parent->left = 0B;
  <D.19025>:
  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.19028;
  struct MonoSimpleBasicBlock * parent;

  parent = from->parent;
  if (parent != 0B) goto <D.19026>; else goto <D.19027>;
  <D.19026>:
  D.19028 = parent->left;
  if (D.19028 == from) goto <D.19029>; else goto <D.19030>;
  <D.19029>:
  parent->left = to;
  goto <D.19031>;
  <D.19030>:
  parent->right = to;
  <D.19031>:
  goto <D.19032>;
  <D.19027>:
  *root = to;
  <D.19032>:
  to->parent = parent;
}


rotate_left (struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.19033;
  struct MonoSimpleBasicBlock * D.19036;
  struct MonoSimpleBasicBlock * other;

  other = bb->right;
  D.19033 = other->left;
  if (D.19033 != 0B) goto <D.19034>; else goto <D.19035>;
  <D.19034>:
  D.19033 = other->left;
  bb->right = D.19033;
  D.19036 = bb->right;
  D.19036->parent = bb;
  goto <D.19037>;
  <D.19035>:
  bb->right = 0B;
  <D.19037>:
  other->left = bb;
  change_node (bb, other, root);
  bb->parent = other;
}


bb_link (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.19038;
  struct GSList * D.19039;
  struct GSList * D.19042;

  D.19038 = from->out_bb;
  D.19039 = monoeg_g_slist_find (D.19038, to);
  if (D.19039 != 0B) goto <D.19040>; else goto <D.19041>;
  <D.19040>:
  return;
  <D.19041>:
  D.19038 = from->out_bb;
  D.19042 = monoeg_g_slist_prepend (D.19038, to);
  from->out_bb = D.19042;
}


bb_formation_eh_pass (struct MonoMethodHeader * header, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.19044;
  struct MonoExceptionClause * D.19045;
  unsigned int i.15;
  unsigned int D.19047;
  unsigned int D.19048;
  unsigned int D.19051;
  unsigned int D.19054;
  unsigned int D.19057;
  unsigned int D.19060;
  unsigned int D.19061;
  unsigned int end.16;
  struct MonoSimpleBasicBlock * D.19065;
  unsigned int D.19068;
  unsigned int D.19069;
  struct MonoSimpleBasicBlock * D.19072;
  <unnamed-unsigned:15> D.19075;
  int D.19076;
  int i;
  int end;

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

    D.19045 = header->clauses;
    i.15 = (unsigned int) i;
    D.19047 = i.15 * 24;
    clause = D.19045 + D.19047;
    D.19048 = clause->try_offset;
    try_block = bb_split (bb, bb, root, D.19048, 1, method, error);
    if (try_block == 0B) goto <D.19049>; else goto <D.19050>;
    <D.19049>:
    return;
    <D.19050>:
    D.19051 = clause->handler_offset;
    handler = bb_split (bb, try_block, root, D.19051, 0, method, error);
    if (handler == 0B) goto <D.19052>; else goto <D.19053>;
    <D.19052>:
    return;
    <D.19053>:
    handler->dead = 0;
    D.19054 = clause->flags;
    if (D.19054 == 1) goto <D.19055>; else goto <D.19056>;
    <D.19055>:
    {
      struct MonoSimpleBasicBlock * filter;

      D.19057 = clause->data.filter_offset;
      filter = bb_split (bb, try_block, root, D.19057, 0, method, error);
      if (filter == 0B) goto <D.19058>; else goto <D.19059>;
      <D.19058>:
      return;
      <D.19059>:
      filter->dead = 0;
    }
    <D.19056>:
    D.19048 = clause->try_offset;
    D.19060 = clause->try_len;
    D.19061 = D.19048 + D.19060;
    end.16 = (unsigned int) end;
    if (D.19061 < end.16) goto <D.19063>; else goto <D.19064>;
    <D.19063>:
    D.19048 = clause->try_offset;
    D.19060 = clause->try_len;
    D.19061 = D.19048 + D.19060;
    D.19065 = bb_split (bb, try_block, root, D.19061, 0, method, error);
    if (D.19065 == 0B) goto <D.19066>; else goto <D.19067>;
    <D.19066>:
    return;
    <D.19067>:
    <D.19064>:
    D.19051 = clause->handler_offset;
    D.19068 = clause->handler_len;
    D.19069 = D.19051 + D.19068;
    end.16 = (unsigned int) end;
    if (D.19069 < end.16) goto <D.19070>; else goto <D.19071>;
    <D.19070>:
    D.19051 = clause->handler_offset;
    D.19068 = clause->handler_len;
    D.19069 = D.19051 + D.19068;
    D.19072 = bb_split (bb, handler, root, D.19069, 0, method, error);
    if (D.19072 == 0B) goto <D.19073>; else goto <D.19074>;
    <D.19073>:
    return;
    <D.19074>:
    <D.19071>:
  }
  i = i + 1;
  <D.18763>:
  D.19075 = header->num_clauses;
  D.19076 = (int) D.19075;
  if (D.19076 > i) goto <D.18762>; else goto <D.18764>;
  <D.18764>:
}


bb_liveness (struct MonoSimpleBasicBlock * bb)
{
  unsigned char D.19078;
  unsigned char D.19079;
  unsigned int D.19082;
  unsigned int D.19083;
  unsigned char D.19084;
  unsigned char D.19085;
  struct GPtrArray * mark_stack;
  struct GSList * tmp;

  mark_stack = monoeg_g_ptr_array_new ();
  goto <D.18684>;
  <D.18683>:
  D.19078 = BIT_FIELD_REF <*bb, 8, 224>;
  D.19079 = D.19078 & 2;
  if (D.19079 == 0) goto <D.19080>; else goto <D.19081>;
  <D.19080>:
  monoeg_g_ptr_array_add (mark_stack, bb);
  <D.19081>:
  bb = bb->next;
  <D.18684>:
  if (bb != 0B) goto <D.18683>; else goto <D.18685>;
  <D.18685>:
  goto <D.18692>;
  <D.18691>:
  {
    struct MonoSimpleBasicBlock * block;

    D.19082 = mark_stack->len;
    D.19083 = D.19082 + 4294967295;
    block = monoeg_g_ptr_array_remove_index_fast (mark_stack, D.19083);
    block->dead = 0;
    tmp = block->out_bb;
    goto <D.18689>;
    <D.18688>:
    {
      struct MonoSimpleBasicBlock * to;

      to = tmp->data;
      D.19084 = BIT_FIELD_REF <*to, 8, 224>;
      D.19085 = D.19084 & 2;
      if (D.19085 != 0) goto <D.19086>; else goto <D.19087>;
      <D.19086>:
      monoeg_g_ptr_array_add (mark_stack, to);
      <D.19087>:
    }
    tmp = tmp->next;
    <D.18689>:
    if (tmp != 0B) goto <D.18688>; else goto <D.18690>;
    <D.18690>:
  }
  <D.18692>:
  D.19082 = mark_stack->len;
  if (D.19082 != 0) goto <D.18691>; else goto <D.18693>;
  <D.18693>:
  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.19088;
  int D.19089;
  unsigned int i.17;
  int D.19093;
  unsigned char D.19094;
  int D.19095;
  const unsigned char * D.19098;
  unsigned int p.18;
  const unsigned char * D.19101;
  unsigned int D.19104;
  unsigned int D.19105;
  sizetype size.19;
  const unsigned char * D.19109;
  unsigned int size.20;
  unsigned int D.19112;
  int p.21;
  int start.22;
  int D.19115;
  const unsigned char * start;
  const unsigned char * p;
  int i;
  int size;

  start = *ip;
  D.19088 = mono_opcode_value (ip, end);
  D.19089 = (int) D.19088;
  *value = D.19089;
  i = *value;
  size = 0;
  i.17 = (unsigned int) i;
  if (i.17 > 312) goto <D.19091>; else goto <D.19092>;
  <D.19091>:
  D.19093 = -1;
  return D.19093;
  <D.19092>:
  p = *ip;
  D.19094 = mono_opcodes[i].argument;
  D.19095 = (int) D.19094;
  switch (D.19095) <default: <D.18810>, case 0: <D.18791>, case 1: <D.18794>, case 2: <D.18795>, case 3: <D.18796>, case 4: <D.18797>, case 5: <D.18793>, case 6: <D.18798>, case 7: <D.18802>, case 8: <D.18803>, case 9: <D.18801>, case 10: <D.18805>, case 11: <D.18808>, case 12: <D.18806>, case 13: <D.18799>, case 14: <D.18800>, case 15: <D.18804>, case 16: <D.18807>>
  <D.18791>:
  size = 1;
  goto <D.18792>;
  <D.18793>:
  <D.18794>:
  <D.18795>:
  <D.18796>:
  <D.18797>:
  <D.18798>:
  <D.18799>:
  <D.18800>:
  <D.18801>:
  size = 5;
  goto <D.18792>;
  <D.18802>:
  size = 3;
  goto <D.18792>;
  <D.18803>:
  <D.18804>:
  <D.18805>:
  size = 2;
  goto <D.18792>;
  <D.18806>:
  <D.18807>:
  size = 9;
  goto <D.18792>;
  <D.18808>:
  {
    guint32 entries;

    D.19098 = p + 5;
    if (D.19098 > end) goto <D.19096>; else goto <D.19099>;
    <D.19099>:
    p.18 = (unsigned int) p;
    if (p.18 > 4294967290) goto <D.19096>; else goto <D.19097>;
    <D.19096>:
    D.19093 = -1;
    return D.19093;
    <D.19097>:
    D.19101 = p + 1;
    entries = mono_read32 (D.19101);
    if (entries > 1073741822) goto <D.19102>; else goto <D.19103>;
    <D.19102>:
    D.19093 = -1;
    return D.19093;
    <D.19103>:
    D.19104 = entries + 1;
    D.19105 = D.19104 * 4;
    size = (int) D.19105;
    goto <D.18792>;
  }
  <D.18810>:
  D.19094 = mono_opcodes[i].argument;
  D.19095 = (int) D.19094;
  monoeg_g_log (0B, 4, "Invalid opcode %d argument %d max opcode %d\n", i, D.19095, 313);
  <D.18811>:
  goto <D.18811>;
  <D.18792>:
  size.19 = (sizetype) size;
  D.19109 = p + size.19;
  if (D.19109 > end) goto <D.19106>; else goto <D.19110>;
  <D.19110>:
  size.20 = (unsigned int) size;
  D.19112 = ~size.20;
  p.18 = (unsigned int) p;
  if (D.19112 < p.18) goto <D.19106>; else goto <D.19107>;
  <D.19106>:
  D.19093 = -1;
  return D.19093;
  <D.19107>:
  p.21 = (int) p;
  start.22 = (int) start;
  D.19115 = p.21 - start.22;
  D.19093 = D.19115 + size;
  return D.19093;
}


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

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


