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

  goto <D.17109>;
  <D.17108>:
  {
    struct MonoSimpleBasicBlock * next;

    next = bb->next;
    D.17157 = bb->out_bb;
    if (D.17157 != 0B) goto <D.17158>; else goto <D.17159>;
    <D.17158>:
    D.17157 = bb->out_bb;
    monoeg_g_slist_free (D.17157);
    <D.17159>:
    monoeg_g_free (bb);
    bb = next;
  }
  <D.17109>:
  if (bb != 0B) goto <D.17108>; else goto <D.17110>;
  <D.17110>:
}


mono_basic_block_split (struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.17160;
  sizetype D.17161;
  struct MonoSimpleBasicBlock * D.17164;
  long int end.0;
  long int start.1;
  long int D.17167;
  int D.17168;
  int D.17169;
  int D.17171;
  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.17160 = header->code_size;
      D.17161 = (sizetype) D.17160;
      end = start + D.17161;
      mono_error_init (error);
      if (header == 0B) goto <D.17162>; else goto <D.17163>;
      <D.17162>:
      mono_error_set_not_verifiable (error, method, "Could not decode header");
      D.17164 = 0B;
      return D.17164;
      <D.17163>:
      bb = monoeg_malloc0 (56);
      bb->start = 0;
      end.0 = (long int) end;
      start.1 = (long int) start;
      D.17167 = end.0 - start.1;
      D.17168 = (int) D.17167;
      bb->end = D.17168;
      bb->colour = 1;
      bb->dead = 0;
      root = bb;
      bb_formation_il_pass (start, end, bb, &root, method, error);
      D.17169 = mono_error_ok (error);
      if (D.17169 == 0) goto fail; else goto <D.17170>;
      <D.17170>:
      bb_formation_eh_pass (header, bb, &root, method, error);
      D.17171 = mono_error_ok (error);
      if (D.17171 == 0) goto fail; else goto <D.17172>;
      <D.17172>:
      bb_liveness (bb);
      mono_metadata_free_mh (header);
      D.17164 = bb;
      return D.17164;
      fail:
      mono_metadata_free_mh (header);
      mono_basic_block_free (bb);
      D.17164 = 0B;
      return D.17164;
    }
  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.17178;
  unsigned char D.17181;
  int D.17182;
  int D.17184;
  unsigned int D.17185;
  _Bool D.17186;
  long int D.17187;
  long int D.17188;
  int value.5;
  unsigned char D.17192;
  int D.17193;
  const unsigned char * ip.6;
  int D.17195;
  unsigned int D.17198;
  const unsigned char * ip.7;
  const unsigned char * ip.8;
  const unsigned char * ip.9;
  const unsigned char * ip.10;
  unsigned char D.17211;
  signed char D.17212;
  unsigned int D.17213;
  unsigned int D.17214;
  const guint32 * D.17216;
  unsigned int D.17217;
  unsigned int D.17218;
  int D.17223;
  int D.17224;
  unsigned char D.17229;
  _Bool D.17230;
  int D.17231;
  unsigned int D.17241;
  unsigned int D.17242;
  unsigned int D.17247;
  unsigned int D.17248;
  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.17086>;
      <D.17085>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.17178 = ip.3 - start.4;
      cli_addr = (guint) D.17178;
      size = mono_opcode_value_and_size (&ip, end, &value);
      if (size < 0) goto <D.17179>; else goto <D.17180>;
      <D.17179>:
      ip.2 = ip;
      D.17181 = *ip.2;
      D.17182 = (int) D.17181;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.17182);
      return;
      <D.17180>:
      goto <D.17058>;
      <D.17057>:
      current = current->next;
      <D.17058>:
      if (current != 0B) goto <D.17183>; else goto <D.17059>;
      <D.17183>:
      D.17184 = current->end;
      D.17185 = (unsigned int) D.17184;
      if (D.17185 <= cli_addr) goto <D.17057>; else goto <D.17059>;
      <D.17059>:
      D.17186 = current == 0B;
      D.17187 = (long int) D.17186;
      D.17188 = __builtin_expect (D.17187, 0);
      if (D.17188 != 0) goto <D.17189>; else goto <D.17190>;
      <D.17189>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 350, "current");
      <D.17190>:
      value.5 = value;
      opcode = &mono_opcodes[value.5];
      D.17192 = opcode->argument;
      D.17193 = (int) D.17192;
      switch (D.17193) <default: <D.17084>, case 0: <D.17060>, case 1: <D.17063>, case 2: <D.17064>, case 3: <D.17069>, case 4: <D.17065>, case 5: <D.17062>, case 6: <D.17066>, case 7: <D.17070>, case 8: <D.17071>, case 9: <D.17076>, case 10: <D.17075>, case 11: <D.17077>, case 12: <D.17073>, case 13: <D.17067>, case 14: <D.17068>, case 15: <D.17072>, case 16: <D.17074>>
      <D.17060>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      ip = ip.6;
      value.5 = value;
      D.17195 = mono_opcode_has_static_branch (value.5);
      if (D.17195 == 0) goto <D.17061>; else goto <D.17196>;
      <D.17196>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.17061>; else goto <D.17197>;
      <D.17197>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.17178 = ip.3 - start.4;
      D.17198 = (unsigned int) D.17178;
      next = bb_split (bb, current, root, D.17198, 0, method, error);
      if (next == 0B) goto <D.17199>; else goto <D.17200>;
      <D.17199>:
      return;
      <D.17200>:
      bb_unlink (current, next);
      current = next;
      goto <D.17061>;
      <D.17062>:
      <D.17063>:
      <D.17064>:
      <D.17065>:
      <D.17066>:
      <D.17067>:
      <D.17068>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      goto <D.17061>;
      <D.17069>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      value.5 = value;
      if (value.5 != 39) goto <D.17061>; else goto <D.17202>;
      <D.17202>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.17061>; else goto <D.17203>;
      <D.17203>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.17178 = ip.3 - start.4;
      D.17198 = (unsigned int) D.17178;
      next = bb_split (bb, current, root, D.17198, 0, method, error);
      if (next == 0B) goto <D.17204>; else goto <D.17205>;
      <D.17204>:
      return;
      <D.17205>:
      bb_unlink (current, next);
      current = next;
      goto <D.17061>;
      <D.17070>:
      ip.2 = ip;
      ip.8 = ip.2 + 3;
      ip = ip.8;
      goto <D.17061>;
      <D.17071>:
      <D.17072>:
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.17061>;
      <D.17073>:
      <D.17074>:
      ip.2 = ip;
      ip.10 = ip.2 + 9;
      ip = ip.10;
      goto <D.17061>;
      <D.17075>:
      <D.17076>:
      D.17192 = opcode->argument;
      if (D.17192 == 10) goto <D.17209>; else goto <D.17210>;
      <D.17209>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.17211 = *ip.6;
      D.17212 = (signed char) D.17211;
      D.17213 = (unsigned int) D.17212;
      D.17214 = D.17213 + cli_addr;
      offset = D.17214 + 2;
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.17215>;
      <D.17210>:
      ip.2 = ip;
      D.17216 = ip.2 + 1;
      D.17217 = *D.17216;
      D.17218 = D.17217 + cli_addr;
      offset = D.17218 + 5;
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      <D.17215>:
      branch = bb_split (bb, current, root, offset, 1, method, error);
      if (branch == 0B) goto <D.17219>; else goto <D.17220>;
      <D.17219>:
      return;
      <D.17220>:
      if (offset < cli_addr) goto <D.17221>; else goto <D.17222>;
      <D.17221>:
      D.17223 = branch->start;
      D.17224 = current->start;
      if (D.17223 > D.17224) goto <D.17225>; else goto <D.17226>;
      <D.17225>:
      current = branch;
      <D.17226>:
      <D.17222>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.17227>; else goto <D.17228>;
      <D.17227>:
      ip.2 = ip;
      ip.3 = (long int) ip.2;
      start.4 = (long int) start;
      D.17178 = ip.3 - start.4;
      D.17198 = (unsigned int) D.17178;
      D.17229 = opcode->flow_type;
      D.17230 = D.17229 != 1;
      D.17231 = (int) D.17230;
      next = bb_split (bb, current, root, D.17198, D.17231, method, error);
      if (next == 0B) goto <D.17232>; else goto <D.17233>;
      <D.17232>:
      return;
      <D.17233>:
      goto <D.17234>;
      <D.17228>:
      next = 0B;
      <D.17234>:
      bb_link (current, branch);
      if (next != 0B) goto <D.17235>; else goto <D.17236>;
      <D.17235>:
      D.17229 = opcode->flow_type;
      if (D.17229 == 1) goto <D.17237>; else goto <D.17238>;
      <D.17237>:
      if (next != branch) goto <D.17239>; else goto <D.17240>;
      <D.17239>:
      bb_unlink (current, next);
      current = next;
      <D.17240>:
      <D.17238>:
      <D.17236>:
      goto <D.17061>;
      <D.17077>:
      {
        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.17241 = n * 4;
        D.17242 = D.17241 + cli_addr;
        offset = D.17242 + 5;
        next = bb_split (bb, current, root, offset, 1, method, error);
        if (next == 0B) goto <D.17243>; else goto <D.17244>;
        <D.17243>:
        return;
        <D.17244>:
        bb_link (current, next);
        tmp = next;
        j = 0;
        goto <D.17082>;
        <D.17081>:
        ip.2 = ip;
        if (ip.2 >= end) goto <D.17245>; else goto <D.17246>;
        <D.17245>:
        mono_error_set_not_verifiable (error, method, "Invalid switch instruction %x", cli_addr);
        return;
        <D.17246>:
        ip.2 = ip;
        D.17247 = MEM[(const guint32 *)ip.2];
        D.17248 = D.17247 + offset;
        next = bb_split (bb, next, root, D.17248, 1, method, error);
        if (next == 0B) goto <D.17249>; else goto <D.17250>;
        <D.17249>:
        return;
        <D.17250>:
        bb_link (current, next);
        ip.2 = ip;
        ip.11 = ip.2 + 4;
        ip = ip.11;
        j = j + 1;
        <D.17082>:
        if (j < n) goto <D.17081>; else goto <D.17083>;
        <D.17083>:
        current = tmp;
        goto <D.17061>;
      }
      <D.17084>:
      ip.2 = ip;
      D.17181 = *ip.2;
      D.17182 = (int) D.17181;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.17182);
      return;
      <D.17061>:
      <D.17086>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.17085>; else goto <D.17087>;
      <D.17087>:
      ip.2 = ip;
      if (ip.2 != end) goto <D.17252>; else goto <D.17253>;
      <D.17252>:
      mono_error_set_not_verifiable (error, method, "Invalid last instruction");
      <D.17253>:
    }
  finally
    {
      ip = {CLOBBER};
      value = {CLOBBER};
    }
}


mono_opcode_has_static_branch (int opcode)
{
  gboolean D.17257;

  switch (opcode) <default: <D.17258>, case 42: <D.17036>, case 122: <D.17037>, case 220: <D.17039>, case 282: <D.17038>>
  <D.17036>:
  <D.17037>:
  <D.17038>:
  <D.17039>:
  D.17257 = 1;
  return D.17257;
  <D.17258>:
  D.17257 = 0;
  return D.17257;
}


bb_unlink (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.17260;
  struct GSList * D.17263;

  D.17260 = from->out_bb;
  if (D.17260 != 0B) goto <D.17261>; else goto <D.17262>;
  <D.17261>:
  D.17260 = from->out_bb;
  D.17263 = monoeg_g_slist_remove (D.17260, to);
  from->out_bb = D.17263;
  <D.17262>:
}


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.17265;
  struct MonoSimpleBasicBlock * D.17270;
  int D.17272;
  int D.17274;
  int D.17276;
  unsigned int D.17277;
  struct MonoSimpleBasicBlock * D.17283;
  int D.17286;
  struct MonoSimpleBasicBlock * D.17287;
  struct GSList * D.17288;
  int D.17289;
  struct MonoSimpleBasicBlock * res;
  struct MonoSimpleBasicBlock * bb;

  bb = first;
  target.12 = (int) target;
  D.17265 = bb_idx_is_contained (hint, target.12);
  if (D.17265 != 0) goto <D.17266>; else goto <D.17267>;
  <D.17266>:
  first = hint;
  goto <D.17268>;
  <D.17267>:
  D.17270 = hint->next;
  if (D.17270 != 0B) goto <D.17271>; else goto <D.17269>;
  <D.17271>:
  D.17270 = hint->next;
  target.12 = (int) target;
  D.17272 = bb_idx_is_contained (D.17270, target.12);
  if (D.17272 != 0) goto <D.17273>; else goto <D.17269>;
  <D.17273>:
  first = hint->next;
  goto <D.17015>;
  <D.17269>:
  first = *root;
  <D.17016>:
  target.12 = (int) target;
  D.17274 = bb_idx_is_contained (first, target.12);
  if (D.17274 != 0) goto <D.17015>; else goto <D.17275>;
  <D.17275>:
  D.17276 = first->start;
  D.17277 = (unsigned int) D.17276;
  if (D.17277 > target) goto <D.17278>; else goto <D.17279>;
  <D.17278>:
  first = first->left;
  goto <D.17280>;
  <D.17279>:
  first = first->right;
  <D.17280>:
  if (first != 0B) goto <D.17016>; else goto <D.17015>;
  <D.17015>:
  <D.17268>:
  if (first == 0B) goto <D.17281>; else goto <D.17282>;
  <D.17281>:
  mono_error_set_not_verifiable (error, method, "Invalid instruction target %x", target);
  D.17283 = 0B;
  return D.17283;
  <D.17282>:
  D.17276 = first->start;
  D.17277 = (unsigned int) D.17276;
  if (D.17277 == target) goto <D.17284>; else goto <D.17285>;
  <D.17284>:
  D.17283 = first;
  return D.17283;
  <D.17285>:
  res = monoeg_malloc0 (56);
  target.12 = (int) target;
  res->start = target.12;
  D.17286 = first->end;
  res->end = D.17286;
  D.17287 = first->next;
  res->next = D.17287;
  D.17288 = first->out_bb;
  res->out_bb = D.17288;
  res->dead = 1;
  D.17289 = res->start;
  first->end = D.17289;
  first->next = res;
  first->out_bb = 0B;
  if (link_blocks != 0) goto <D.17290>; else goto <D.17291>;
  <D.17290>:
  bb_link (first, res);
  <D.17291>:
  bb_insert (bb, res, root);
  D.17283 = res;
  return D.17283;
}


bb_idx_is_contained (struct MonoSimpleBasicBlock * bb, int target)
{
  gboolean D.17293;
  int iftmp.13;
  int D.17297;
  int D.17299;

  D.17297 = bb->start;
  if (D.17297 <= target) goto <D.17298>; else goto <D.17295>;
  <D.17298>:
  D.17299 = bb->end;
  if (D.17299 > target) goto <D.17300>; else goto <D.17295>;
  <D.17300>:
  iftmp.13 = 1;
  goto <D.17296>;
  <D.17295>:
  iftmp.13 = 0;
  <D.17296>:
  D.17293 = iftmp.13;
  return D.17293;
}


bb_insert (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  int D.17302;
  struct MonoSimpleBasicBlock * D.17305;
  struct MonoSimpleBasicBlock * D.17309;
  _Bool D.17312;
  long int D.17313;
  long int D.17314;
  struct MonoSimpleBasicBlock * D.17317;
  long unsigned int D.17320;
  long unsigned int D.17321;
  long unsigned int D.17325;
  long unsigned int D.17326;
  struct MonoSimpleBasicBlock * D.17331;
  struct MonoSimpleBasicBlock * D.17333;
  struct MonoSimpleBasicBlock * D.17335;
  struct MonoSimpleBasicBlock * D.17338;
  struct MonoSimpleBasicBlock * parent;
  struct MonoSimpleBasicBlock * uncle;
  struct MonoSimpleBasicBlock * grandparent;
  int bb_start;

  bb_start = bb->start;
  parent = *root;
  <D.16996>:
  D.17302 = parent->start;
  if (D.17302 > bb_start) goto <D.17303>; else goto <D.17304>;
  <D.17303>:
  D.17305 = parent->left;
  if (D.17305 == 0B) goto <D.17306>; else goto <D.17307>;
  <D.17306>:
  parent->left = bb;
  goto <D.16995>;
  <D.17307>:
  parent = parent->left;
  goto <D.17308>;
  <D.17304>:
  D.17309 = parent->right;
  if (D.17309 == 0B) goto <D.17310>; else goto <D.17311>;
  <D.17310>:
  parent->right = bb;
  goto <D.16995>;
  <D.17311>:
  parent = parent->right;
  <D.17308>:
  if (parent != 0B) goto <D.16996>; else goto <D.16995>;
  <D.16995>:
  D.17312 = parent == 0B;
  D.17313 = (long int) D.17312;
  D.17314 = __builtin_expect (D.17313, 0);
  if (D.17314 != 0) goto <D.17315>; else goto <D.17316>;
  <D.17315>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 180, "parent");
  <D.17316>:
  bb->parent = parent;
  bb->colour = 0;
  <D.16999>:
  D.17317 = bb->parent;
  if (D.17317 == 0B) goto <D.17318>; else goto <D.17319>;
  <D.17318>:
  bb->colour = 1;
  goto <D.16997>;
  <D.17319>:
  D.17317 = bb->parent;
  D.17320 = BIT_FIELD_REF <*D.17317, 64, 384>;
  D.17321 = D.17320 & 1;
  if (D.17321 != 0) goto <D.16997>; else goto <D.17322>;
  <D.17322>:
  uncle = bb_uncle (bb);
  if (uncle != 0B) goto <D.17323>; else goto <D.17324>;
  <D.17323>:
  D.17325 = BIT_FIELD_REF <*uncle, 64, 384>;
  D.17326 = D.17325 & 1;
  if (D.17326 == 0) goto <D.17327>; else goto <D.17328>;
  <D.17327>:
  grandparent = bb_grandparent (bb);
  D.17317 = bb->parent;
  D.17317->colour = 1;
  uncle->colour = 1;
  grandparent->colour = 0;
  bb = grandparent;
  // predicted unlikely by continue predictor.
  goto <D.16998>;
  <D.17328>:
  <D.17324>:
  grandparent = bb_grandparent (bb);
  D.17317 = bb->parent;
  D.17331 = D.17317->right;
  if (D.17331 == bb) goto <D.17332>; else goto <D.17329>;
  <D.17332>:
  D.17317 = bb->parent;
  D.17333 = grandparent->left;
  if (D.17317 == D.17333) goto <D.17334>; else goto <D.17329>;
  <D.17334>:
  D.17317 = bb->parent;
  rotate_left (D.17317, root);
  bb = bb->left;
  goto <D.17330>;
  <D.17329>:
  D.17317 = bb->parent;
  D.17335 = D.17317->left;
  if (D.17335 == bb) goto <D.17336>; else goto <D.17337>;
  <D.17336>:
  D.17317 = bb->parent;
  D.17338 = grandparent->right;
  if (D.17317 == D.17338) goto <D.17339>; else goto <D.17340>;
  <D.17339>:
  D.17317 = bb->parent;
  rotate_right (D.17317, root);
  bb = bb->right;
  <D.17340>:
  <D.17337>:
  <D.17330>:
  grandparent = bb_grandparent (bb);
  D.17317 = bb->parent;
  D.17317->colour = 1;
  grandparent->colour = 0;
  D.17317 = bb->parent;
  D.17335 = D.17317->left;
  if (D.17335 == bb) goto <D.17343>; else goto <D.17341>;
  <D.17343>:
  D.17317 = bb->parent;
  D.17333 = grandparent->left;
  if (D.17317 == D.17333) goto <D.17344>; else goto <D.17341>;
  <D.17344>:
  rotate_right (grandparent, root);
  goto <D.17342>;
  <D.17341>:
  rotate_left (grandparent, root);
  <D.17342>:
  goto <D.16997>;
  <D.16998>:
  goto <D.16999>;
  <D.16997>:
}


bb_uncle (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.17347;
  struct MonoSimpleBasicBlock * D.17348;
  struct MonoSimpleBasicBlock * D.17349;
  struct MonoSimpleBasicBlock * gp;

  gp = bb_grandparent (bb);
  if (gp == 0B) goto <D.17345>; else goto <D.17346>;
  <D.17345>:
  D.17347 = 0B;
  return D.17347;
  <D.17346>:
  D.17348 = bb->parent;
  D.17349 = gp->left;
  if (D.17348 == D.17349) goto <D.17350>; else goto <D.17351>;
  <D.17350>:
  D.17347 = gp->right;
  return D.17347;
  <D.17351>:
  D.17347 = gp->left;
  return D.17347;
}


bb_grandparent (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.17353;
  struct MonoSimpleBasicBlock * iftmp.14;
  struct MonoSimpleBasicBlock * D.17358;

  if (bb != 0B) goto <D.17357>; else goto <D.17355>;
  <D.17357>:
  D.17358 = bb->parent;
  if (D.17358 != 0B) goto <D.17359>; else goto <D.17355>;
  <D.17359>:
  D.17358 = bb->parent;
  iftmp.14 = D.17358->parent;
  goto <D.17356>;
  <D.17355>:
  iftmp.14 = 0B;
  <D.17356>:
  D.17353 = iftmp.14;
  return D.17353;
}


rotate_right (struct MonoSimpleBasicBlock * parent, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.17361;
  struct MonoSimpleBasicBlock * D.17364;
  struct MonoSimpleBasicBlock * bb;

  bb = parent->left;
  D.17361 = bb->right;
  if (D.17361 != 0B) goto <D.17362>; else goto <D.17363>;
  <D.17362>:
  D.17361 = bb->right;
  parent->left = D.17361;
  D.17364 = parent->left;
  D.17364->parent = parent;
  goto <D.17365>;
  <D.17363>:
  parent->left = 0B;
  <D.17365>:
  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.17368;
  struct MonoSimpleBasicBlock * parent;

  parent = from->parent;
  if (parent != 0B) goto <D.17366>; else goto <D.17367>;
  <D.17366>:
  D.17368 = parent->left;
  if (D.17368 == from) goto <D.17369>; else goto <D.17370>;
  <D.17369>:
  parent->left = to;
  goto <D.17371>;
  <D.17370>:
  parent->right = to;
  <D.17371>:
  goto <D.17372>;
  <D.17367>:
  *root = to;
  <D.17372>:
  to->parent = parent;
}


rotate_left (struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.17373;
  struct MonoSimpleBasicBlock * D.17376;
  struct MonoSimpleBasicBlock * other;

  other = bb->right;
  D.17373 = other->left;
  if (D.17373 != 0B) goto <D.17374>; else goto <D.17375>;
  <D.17374>:
  D.17373 = other->left;
  bb->right = D.17373;
  D.17376 = bb->right;
  D.17376->parent = bb;
  goto <D.17377>;
  <D.17375>:
  bb->right = 0B;
  <D.17377>:
  other->left = bb;
  change_node (bb, other, root);
  bb->parent = other;
}


bb_link (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.17378;
  struct GSList * D.17379;
  struct GSList * D.17382;

  D.17378 = from->out_bb;
  D.17379 = monoeg_g_slist_find (D.17378, to);
  if (D.17379 != 0B) goto <D.17380>; else goto <D.17381>;
  <D.17380>:
  return;
  <D.17381>:
  D.17378 = from->out_bb;
  D.17382 = monoeg_g_slist_prepend (D.17378, to);
  from->out_bb = D.17382;
}


bb_formation_eh_pass (struct MonoMethodHeader * header, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.17384;
  struct MonoExceptionClause * D.17385;
  long unsigned int D.17386;
  long unsigned int D.17387;
  unsigned int D.17388;
  unsigned int D.17391;
  unsigned int D.17394;
  unsigned int D.17397;
  unsigned int D.17400;
  unsigned int D.17401;
  unsigned int end.15;
  struct MonoSimpleBasicBlock * D.17405;
  unsigned int D.17408;
  unsigned int D.17409;
  struct MonoSimpleBasicBlock * D.17412;
  <unnamed-unsigned:15> D.17415;
  int D.17416;
  int i;
  int end;

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

    D.17385 = header->clauses;
    D.17386 = (long unsigned int) i;
    D.17387 = D.17386 * 32;
    clause = D.17385 + D.17387;
    D.17388 = clause->try_offset;
    try_block = bb_split (bb, bb, root, D.17388, 1, method, error);
    if (try_block == 0B) goto <D.17389>; else goto <D.17390>;
    <D.17389>:
    return;
    <D.17390>:
    D.17391 = clause->handler_offset;
    handler = bb_split (bb, try_block, root, D.17391, 0, method, error);
    if (handler == 0B) goto <D.17392>; else goto <D.17393>;
    <D.17392>:
    return;
    <D.17393>:
    handler->dead = 0;
    D.17394 = clause->flags;
    if (D.17394 == 1) goto <D.17395>; else goto <D.17396>;
    <D.17395>:
    {
      struct MonoSimpleBasicBlock * filter;

      D.17397 = clause->data.filter_offset;
      filter = bb_split (bb, try_block, root, D.17397, 0, method, error);
      if (filter == 0B) goto <D.17398>; else goto <D.17399>;
      <D.17398>:
      return;
      <D.17399>:
      filter->dead = 0;
    }
    <D.17396>:
    D.17388 = clause->try_offset;
    D.17400 = clause->try_len;
    D.17401 = D.17388 + D.17400;
    end.15 = (unsigned int) end;
    if (D.17401 < end.15) goto <D.17403>; else goto <D.17404>;
    <D.17403>:
    D.17388 = clause->try_offset;
    D.17400 = clause->try_len;
    D.17401 = D.17388 + D.17400;
    D.17405 = bb_split (bb, try_block, root, D.17401, 0, method, error);
    if (D.17405 == 0B) goto <D.17406>; else goto <D.17407>;
    <D.17406>:
    return;
    <D.17407>:
    <D.17404>:
    D.17391 = clause->handler_offset;
    D.17408 = clause->handler_len;
    D.17409 = D.17391 + D.17408;
    end.15 = (unsigned int) end;
    if (D.17409 < end.15) goto <D.17410>; else goto <D.17411>;
    <D.17410>:
    D.17391 = clause->handler_offset;
    D.17408 = clause->handler_len;
    D.17409 = D.17391 + D.17408;
    D.17412 = bb_split (bb, handler, root, D.17409, 0, method, error);
    if (D.17412 == 0B) goto <D.17413>; else goto <D.17414>;
    <D.17413>:
    return;
    <D.17414>:
    <D.17411>:
  }
  i = i + 1;
  <D.17102>:
  D.17415 = header->num_clauses;
  D.17416 = (int) D.17415;
  if (D.17416 > i) goto <D.17101>; else goto <D.17103>;
  <D.17103>:
}


bb_liveness (struct MonoSimpleBasicBlock * bb)
{
  long unsigned int D.17418;
  long unsigned int D.17419;
  unsigned int D.17422;
  unsigned int D.17423;
  long unsigned int D.17424;
  long unsigned int D.17425;
  struct GPtrArray * mark_stack;
  struct GSList * tmp;

  mark_stack = monoeg_g_ptr_array_new ();
  goto <D.17023>;
  <D.17022>:
  D.17418 = BIT_FIELD_REF <*bb, 64, 384>;
  D.17419 = D.17418 & 2;
  if (D.17419 == 0) goto <D.17420>; else goto <D.17421>;
  <D.17420>:
  monoeg_g_ptr_array_add (mark_stack, bb);
  <D.17421>:
  bb = bb->next;
  <D.17023>:
  if (bb != 0B) goto <D.17022>; else goto <D.17024>;
  <D.17024>:
  goto <D.17031>;
  <D.17030>:
  {
    struct MonoSimpleBasicBlock * block;

    D.17422 = mark_stack->len;
    D.17423 = D.17422 + 4294967295;
    block = monoeg_g_ptr_array_remove_index_fast (mark_stack, D.17423);
    block->dead = 0;
    tmp = block->out_bb;
    goto <D.17028>;
    <D.17027>:
    {
      struct MonoSimpleBasicBlock * to;

      to = tmp->data;
      D.17424 = BIT_FIELD_REF <*to, 64, 384>;
      D.17425 = D.17424 & 2;
      if (D.17425 != 0) goto <D.17426>; else goto <D.17427>;
      <D.17426>:
      monoeg_g_ptr_array_add (mark_stack, to);
      <D.17427>:
    }
    tmp = tmp->next;
    <D.17028>:
    if (tmp != 0B) goto <D.17027>; else goto <D.17029>;
    <D.17029>:
  }
  <D.17031>:
  D.17422 = mark_stack->len;
  if (D.17422 != 0) goto <D.17030>; else goto <D.17032>;
  <D.17032>:
  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.17428;
  int D.17429;
  unsigned int i.16;
  int D.17433;
  unsigned char D.17434;
  int D.17435;
  const unsigned char * D.17438;
  long unsigned int p.17;
  unsigned int D.17443;
  unsigned int D.17444;
  sizetype D.17447;
  const unsigned char * D.17448;
  long unsigned int D.17450;
  long unsigned int D.17451;
  long int p.18;
  long int start.19;
  long int D.17454;
  unsigned int D.17455;
  unsigned int size.20;
  unsigned int D.17457;
  const unsigned char * start;
  const unsigned char * p;
  int i;
  int size;

  start = *ip;
  D.17428 = mono_opcode_value (ip, end);
  D.17429 = (int) D.17428;
  *value = D.17429;
  i = *value;
  size = 0;
  i.16 = (unsigned int) i;
  if (i.16 > 312) goto <D.17431>; else goto <D.17432>;
  <D.17431>:
  D.17433 = -1;
  return D.17433;
  <D.17432>:
  p = *ip;
  D.17434 = mono_opcodes[i].argument;
  D.17435 = (int) D.17434;
  switch (D.17435) <default: <D.17149>, case 0: <D.17130>, case 1: <D.17133>, case 2: <D.17134>, case 3: <D.17135>, case 4: <D.17136>, case 5: <D.17132>, case 6: <D.17137>, case 7: <D.17141>, case 8: <D.17142>, case 9: <D.17140>, case 10: <D.17144>, case 11: <D.17147>, case 12: <D.17145>, case 13: <D.17138>, case 14: <D.17139>, case 15: <D.17143>, case 16: <D.17146>>
  <D.17130>:
  size = 1;
  goto <D.17131>;
  <D.17132>:
  <D.17133>:
  <D.17134>:
  <D.17135>:
  <D.17136>:
  <D.17137>:
  <D.17138>:
  <D.17139>:
  <D.17140>:
  size = 5;
  goto <D.17131>;
  <D.17141>:
  size = 3;
  goto <D.17131>;
  <D.17142>:
  <D.17143>:
  <D.17144>:
  size = 2;
  goto <D.17131>;
  <D.17145>:
  <D.17146>:
  size = 9;
  goto <D.17131>;
  <D.17147>:
  {
    guint32 entries;

    D.17438 = p + 5;
    if (D.17438 > end) goto <D.17436>; else goto <D.17439>;
    <D.17439>:
    p.17 = (long unsigned int) p;
    if (p.17 > 18446744073709551610) goto <D.17436>; else goto <D.17437>;
    <D.17436>:
    D.17433 = -1;
    return D.17433;
    <D.17437>:
    entries = MEM[(const guint32 *)p + 1B];
    if (entries > 1073741822) goto <D.17441>; else goto <D.17442>;
    <D.17441>:
    D.17433 = -1;
    return D.17433;
    <D.17442>:
    D.17443 = entries + 1;
    D.17444 = D.17443 * 4;
    size = (int) D.17444;
    goto <D.17131>;
  }
  <D.17149>:
  D.17434 = mono_opcodes[i].argument;
  D.17435 = (int) D.17434;
  monoeg_g_log (0B, 4, "Invalid opcode %d argument %d max opcode %d\n", i, D.17435, 313);
  <D.17150>:
  goto <D.17150>;
  <D.17131>:
  D.17447 = (sizetype) size;
  D.17448 = p + D.17447;
  if (D.17448 > end) goto <D.17445>; else goto <D.17449>;
  <D.17449>:
  D.17450 = (long unsigned int) size;
  D.17451 = ~D.17450;
  p.17 = (long unsigned int) p;
  if (D.17451 < p.17) goto <D.17445>; else goto <D.17446>;
  <D.17445>:
  D.17433 = -1;
  return D.17433;
  <D.17446>:
  p.18 = (long int) p;
  start.19 = (long int) start;
  D.17454 = p.18 - start.19;
  D.17455 = (unsigned int) D.17454;
  size.20 = (unsigned int) size;
  D.17457 = D.17455 + size.20;
  D.17433 = (int) D.17457;
  return D.17433;
}


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

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


