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

  goto <D.16215>;
  <D.16214>:
  {
    struct MonoSimpleBasicBlock * next;

    next = bb->next;
    D.16263 = bb->out_bb;
    if (D.16263 != 0B) goto <D.16264>; else goto <D.16265>;
    <D.16264>:
    D.16263 = bb->out_bb;
    monoeg_g_slist_free (D.16263);
    <D.16265>:
    monoeg_g_free (bb);
    bb = next;
  }
  <D.16215>:
  if (bb != 0B) goto <D.16214>; else goto <D.16216>;
  <D.16216>:
}


mono_basic_block_split (struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16266;
  struct MonoSimpleBasicBlock * D.16269;
  int end.0;
  int start.1;
  int D.16272;
  int D.16273;
  int D.16275;
  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.16266 = header->code_size;
      end = start + D.16266;
      mono_error_init (error);
      if (header == 0B) goto <D.16267>; else goto <D.16268>;
      <D.16267>:
      mono_error_set_not_verifiable (error, method, "Could not decode header");
      D.16269 = 0B;
      return D.16269;
      <D.16268>:
      bb = monoeg_malloc0 (32);
      bb->start = 0;
      end.0 = (int) end;
      start.1 = (int) start;
      D.16272 = end.0 - start.1;
      bb->end = D.16272;
      bb->colour = 1;
      bb->dead = 0;
      root = bb;
      bb_formation_il_pass (start, end, bb, &root, method, error);
      D.16273 = mono_error_ok (error);
      if (D.16273 == 0) goto fail; else goto <D.16274>;
      <D.16274>:
      bb_formation_eh_pass (header, bb, &root, method, error);
      D.16275 = mono_error_ok (error);
      if (D.16275 == 0) goto fail; else goto <D.16276>;
      <D.16276>:
      bb_liveness (bb);
      mono_metadata_free_mh (header);
      D.16269 = bb;
      return D.16269;
      fail:
      mono_metadata_free_mh (header);
      mono_basic_block_free (bb);
      D.16269 = 0B;
      return D.16269;
    }
  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.16282;
  unsigned char D.16285;
  int D.16286;
  int D.16288;
  unsigned int D.16289;
  _Bool D.16290;
  long int D.16291;
  long int D.16292;
  int value.5;
  unsigned char D.16296;
  int D.16297;
  const unsigned char * ip.6;
  int D.16299;
  unsigned int D.16302;
  const unsigned char * ip.7;
  const unsigned char * ip.8;
  const unsigned char * ip.9;
  const unsigned char * ip.10;
  unsigned char D.16315;
  signed char D.16316;
  unsigned int D.16317;
  unsigned int D.16318;
  const guint32 * D.16320;
  unsigned int D.16321;
  unsigned int D.16322;
  int D.16327;
  int D.16328;
  unsigned char D.16333;
  _Bool D.16334;
  int D.16335;
  unsigned int D.16345;
  unsigned int D.16346;
  unsigned int D.16351;
  unsigned int D.16352;
  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.16192>;
      <D.16191>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16282 = ip.3 - start.4;
      cli_addr = (guint) D.16282;
      size = mono_opcode_value_and_size (&ip, end, &value);
      if (size < 0) goto <D.16283>; else goto <D.16284>;
      <D.16283>:
      ip.2 = ip;
      D.16285 = *ip.2;
      D.16286 = (int) D.16285;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16286);
      return;
      <D.16284>:
      goto <D.16164>;
      <D.16163>:
      current = current->next;
      <D.16164>:
      if (current != 0B) goto <D.16287>; else goto <D.16165>;
      <D.16287>:
      D.16288 = current->end;
      D.16289 = (unsigned int) D.16288;
      if (D.16289 <= cli_addr) goto <D.16163>; else goto <D.16165>;
      <D.16165>:
      D.16290 = current == 0B;
      D.16291 = (long int) D.16290;
      D.16292 = __builtin_expect (D.16291, 0);
      if (D.16292 != 0) goto <D.16293>; else goto <D.16294>;
      <D.16293>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 350, "current");
      <D.16294>:
      value.5 = value;
      opcode = &mono_opcodes[value.5];
      D.16296 = opcode->argument;
      D.16297 = (int) D.16296;
      switch (D.16297) <default: <D.16190>, case 0: <D.16166>, case 1: <D.16169>, case 2: <D.16170>, case 3: <D.16175>, case 4: <D.16171>, case 5: <D.16168>, case 6: <D.16172>, case 7: <D.16176>, case 8: <D.16177>, case 9: <D.16182>, case 10: <D.16181>, case 11: <D.16183>, case 12: <D.16179>, case 13: <D.16173>, case 14: <D.16174>, case 15: <D.16178>, case 16: <D.16180>>
      <D.16166>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      ip = ip.6;
      value.5 = value;
      D.16299 = mono_opcode_has_static_branch (value.5);
      if (D.16299 == 0) goto <D.16167>; else goto <D.16300>;
      <D.16300>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16167>; else goto <D.16301>;
      <D.16301>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16282 = ip.3 - start.4;
      D.16302 = (unsigned int) D.16282;
      next = bb_split (bb, current, root, D.16302, 0, method, error);
      if (next == 0B) goto <D.16303>; else goto <D.16304>;
      <D.16303>:
      return;
      <D.16304>:
      bb_unlink (current, next);
      current = next;
      goto <D.16167>;
      <D.16168>:
      <D.16169>:
      <D.16170>:
      <D.16171>:
      <D.16172>:
      <D.16173>:
      <D.16174>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      goto <D.16167>;
      <D.16175>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      value.5 = value;
      if (value.5 != 39) goto <D.16167>; else goto <D.16306>;
      <D.16306>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16167>; else goto <D.16307>;
      <D.16307>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16282 = ip.3 - start.4;
      D.16302 = (unsigned int) D.16282;
      next = bb_split (bb, current, root, D.16302, 0, method, error);
      if (next == 0B) goto <D.16308>; else goto <D.16309>;
      <D.16308>:
      return;
      <D.16309>:
      bb_unlink (current, next);
      current = next;
      goto <D.16167>;
      <D.16176>:
      ip.2 = ip;
      ip.8 = ip.2 + 3;
      ip = ip.8;
      goto <D.16167>;
      <D.16177>:
      <D.16178>:
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16167>;
      <D.16179>:
      <D.16180>:
      ip.2 = ip;
      ip.10 = ip.2 + 9;
      ip = ip.10;
      goto <D.16167>;
      <D.16181>:
      <D.16182>:
      D.16296 = opcode->argument;
      if (D.16296 == 10) goto <D.16313>; else goto <D.16314>;
      <D.16313>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.16315 = *ip.6;
      D.16316 = (signed char) D.16315;
      D.16317 = (unsigned int) D.16316;
      D.16318 = D.16317 + cli_addr;
      offset = D.16318 + 2;
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16319>;
      <D.16314>:
      ip.2 = ip;
      D.16320 = ip.2 + 1;
      D.16321 = *D.16320;
      D.16322 = D.16321 + cli_addr;
      offset = D.16322 + 5;
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      <D.16319>:
      branch = bb_split (bb, current, root, offset, 1, method, error);
      if (branch == 0B) goto <D.16323>; else goto <D.16324>;
      <D.16323>:
      return;
      <D.16324>:
      if (offset < cli_addr) goto <D.16325>; else goto <D.16326>;
      <D.16325>:
      D.16327 = branch->start;
      D.16328 = current->start;
      if (D.16327 > D.16328) goto <D.16329>; else goto <D.16330>;
      <D.16329>:
      current = branch;
      <D.16330>:
      <D.16326>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16331>; else goto <D.16332>;
      <D.16331>:
      D.16333 = opcode->flow_type;
      D.16334 = D.16333 != 1;
      D.16335 = (int) D.16334;
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16282 = ip.3 - start.4;
      D.16302 = (unsigned int) D.16282;
      next = bb_split (bb, current, root, D.16302, D.16335, method, error);
      if (next == 0B) goto <D.16336>; else goto <D.16337>;
      <D.16336>:
      return;
      <D.16337>:
      goto <D.16338>;
      <D.16332>:
      next = 0B;
      <D.16338>:
      bb_link (current, branch);
      if (next != 0B) goto <D.16339>; else goto <D.16340>;
      <D.16339>:
      D.16333 = opcode->flow_type;
      if (D.16333 == 1) goto <D.16341>; else goto <D.16342>;
      <D.16341>:
      if (next != branch) goto <D.16343>; else goto <D.16344>;
      <D.16343>:
      bb_unlink (current, next);
      current = next;
      <D.16344>:
      <D.16342>:
      <D.16340>:
      goto <D.16167>;
      <D.16183>:
      {
        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.16345 = n * 4;
        D.16346 = D.16345 + cli_addr;
        offset = D.16346 + 5;
        next = bb_split (bb, current, root, offset, 1, method, error);
        if (next == 0B) goto <D.16347>; else goto <D.16348>;
        <D.16347>:
        return;
        <D.16348>:
        bb_link (current, next);
        tmp = next;
        j = 0;
        goto <D.16188>;
        <D.16187>:
        ip.2 = ip;
        if (ip.2 >= end) goto <D.16349>; else goto <D.16350>;
        <D.16349>:
        mono_error_set_not_verifiable (error, method, "Invalid switch instruction %x", cli_addr);
        return;
        <D.16350>:
        ip.2 = ip;
        D.16351 = MEM[(const guint32 *)ip.2];
        D.16352 = D.16351 + offset;
        next = bb_split (bb, next, root, D.16352, 1, method, error);
        if (next == 0B) goto <D.16353>; else goto <D.16354>;
        <D.16353>:
        return;
        <D.16354>:
        bb_link (current, next);
        ip.2 = ip;
        ip.11 = ip.2 + 4;
        ip = ip.11;
        j = j + 1;
        <D.16188>:
        if (j < n) goto <D.16187>; else goto <D.16189>;
        <D.16189>:
        current = tmp;
        goto <D.16167>;
      }
      <D.16190>:
      ip.2 = ip;
      D.16285 = *ip.2;
      D.16286 = (int) D.16285;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16286);
      return;
      <D.16167>:
      <D.16192>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16191>; else goto <D.16193>;
      <D.16193>:
      ip.2 = ip;
      if (ip.2 != end) goto <D.16356>; else goto <D.16357>;
      <D.16356>:
      mono_error_set_not_verifiable (error, method, "Invalid last instruction");
      <D.16357>:
    }
  finally
    {
      ip = {CLOBBER};
      value = {CLOBBER};
    }
}


mono_opcode_has_static_branch (int opcode)
{
  gboolean D.16361;

  switch (opcode) <default: <D.16362>, case 42: <D.16142>, case 122: <D.16143>, case 220: <D.16145>, case 282: <D.16144>>
  <D.16142>:
  <D.16143>:
  <D.16144>:
  <D.16145>:
  D.16361 = 1;
  return D.16361;
  <D.16362>:
  D.16361 = 0;
  return D.16361;
}


bb_unlink (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16364;
  struct GSList * D.16367;

  D.16364 = from->out_bb;
  if (D.16364 != 0B) goto <D.16365>; else goto <D.16366>;
  <D.16365>:
  D.16364 = from->out_bb;
  D.16367 = monoeg_g_slist_remove (D.16364, to);
  from->out_bb = D.16367;
  <D.16366>:
}


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.16369;
  struct MonoSimpleBasicBlock * D.16374;
  int D.16376;
  int D.16378;
  int D.16380;
  unsigned int D.16381;
  struct MonoSimpleBasicBlock * D.16387;
  int D.16390;
  struct MonoSimpleBasicBlock * D.16391;
  struct GSList * D.16392;
  int D.16393;
  struct MonoSimpleBasicBlock * res;
  struct MonoSimpleBasicBlock * bb;

  bb = first;
  target.12 = (int) target;
  D.16369 = bb_idx_is_contained (hint, target.12);
  if (D.16369 != 0) goto <D.16370>; else goto <D.16371>;
  <D.16370>:
  first = hint;
  goto <D.16372>;
  <D.16371>:
  D.16374 = hint->next;
  if (D.16374 != 0B) goto <D.16375>; else goto <D.16373>;
  <D.16375>:
  target.12 = (int) target;
  D.16374 = hint->next;
  D.16376 = bb_idx_is_contained (D.16374, target.12);
  if (D.16376 != 0) goto <D.16377>; else goto <D.16373>;
  <D.16377>:
  first = hint->next;
  goto <D.16121>;
  <D.16373>:
  first = *root;
  <D.16122>:
  target.12 = (int) target;
  D.16378 = bb_idx_is_contained (first, target.12);
  if (D.16378 != 0) goto <D.16121>; else goto <D.16379>;
  <D.16379>:
  D.16380 = first->start;
  D.16381 = (unsigned int) D.16380;
  if (D.16381 > target) goto <D.16382>; else goto <D.16383>;
  <D.16382>:
  first = first->left;
  goto <D.16384>;
  <D.16383>:
  first = first->right;
  <D.16384>:
  if (first != 0B) goto <D.16122>; else goto <D.16121>;
  <D.16121>:
  <D.16372>:
  if (first == 0B) goto <D.16385>; else goto <D.16386>;
  <D.16385>:
  mono_error_set_not_verifiable (error, method, "Invalid instruction target %x", target);
  D.16387 = 0B;
  return D.16387;
  <D.16386>:
  D.16380 = first->start;
  D.16381 = (unsigned int) D.16380;
  if (D.16381 == target) goto <D.16388>; else goto <D.16389>;
  <D.16388>:
  D.16387 = first;
  return D.16387;
  <D.16389>:
  res = monoeg_malloc0 (32);
  target.12 = (int) target;
  res->start = target.12;
  D.16390 = first->end;
  res->end = D.16390;
  D.16391 = first->next;
  res->next = D.16391;
  D.16392 = first->out_bb;
  res->out_bb = D.16392;
  res->dead = 1;
  D.16393 = res->start;
  first->end = D.16393;
  first->next = res;
  first->out_bb = 0B;
  if (link_blocks != 0) goto <D.16394>; else goto <D.16395>;
  <D.16394>:
  bb_link (first, res);
  <D.16395>:
  bb_insert (bb, res, root);
  D.16387 = res;
  return D.16387;
}


bb_idx_is_contained (struct MonoSimpleBasicBlock * bb, int target)
{
  gboolean D.16397;
  int iftmp.13;
  int D.16401;
  int D.16403;

  D.16401 = bb->start;
  if (D.16401 <= target) goto <D.16402>; else goto <D.16399>;
  <D.16402>:
  D.16403 = bb->end;
  if (D.16403 > target) goto <D.16404>; else goto <D.16399>;
  <D.16404>:
  iftmp.13 = 1;
  goto <D.16400>;
  <D.16399>:
  iftmp.13 = 0;
  <D.16400>:
  D.16397 = iftmp.13;
  return D.16397;
}


bb_insert (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  int D.16406;
  struct MonoSimpleBasicBlock * D.16409;
  struct MonoSimpleBasicBlock * D.16413;
  _Bool D.16416;
  long int D.16417;
  long int D.16418;
  struct MonoSimpleBasicBlock * D.16421;
  unsigned char D.16424;
  unsigned char D.16425;
  unsigned char D.16429;
  unsigned char D.16430;
  struct MonoSimpleBasicBlock * D.16435;
  struct MonoSimpleBasicBlock * D.16437;
  struct MonoSimpleBasicBlock * D.16439;
  struct MonoSimpleBasicBlock * D.16442;
  struct MonoSimpleBasicBlock * parent;
  struct MonoSimpleBasicBlock * uncle;
  struct MonoSimpleBasicBlock * grandparent;
  int bb_start;

  bb_start = bb->start;
  parent = *root;
  <D.16102>:
  D.16406 = parent->start;
  if (D.16406 > bb_start) goto <D.16407>; else goto <D.16408>;
  <D.16407>:
  D.16409 = parent->left;
  if (D.16409 == 0B) goto <D.16410>; else goto <D.16411>;
  <D.16410>:
  parent->left = bb;
  goto <D.16101>;
  <D.16411>:
  parent = parent->left;
  goto <D.16412>;
  <D.16408>:
  D.16413 = parent->right;
  if (D.16413 == 0B) goto <D.16414>; else goto <D.16415>;
  <D.16414>:
  parent->right = bb;
  goto <D.16101>;
  <D.16415>:
  parent = parent->right;
  <D.16412>:
  if (parent != 0B) goto <D.16102>; else goto <D.16101>;
  <D.16101>:
  D.16416 = parent == 0B;
  D.16417 = (long int) D.16416;
  D.16418 = __builtin_expect (D.16417, 0);
  if (D.16418 != 0) goto <D.16419>; else goto <D.16420>;
  <D.16419>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 180, "parent");
  <D.16420>:
  bb->parent = parent;
  bb->colour = 0;
  <D.16105>:
  D.16421 = bb->parent;
  if (D.16421 == 0B) goto <D.16422>; else goto <D.16423>;
  <D.16422>:
  bb->colour = 1;
  goto <D.16103>;
  <D.16423>:
  D.16421 = bb->parent;
  D.16424 = BIT_FIELD_REF <*D.16421, 8, 224>;
  D.16425 = D.16424 & 1;
  if (D.16425 != 0) goto <D.16103>; else goto <D.16426>;
  <D.16426>:
  uncle = bb_uncle (bb);
  if (uncle != 0B) goto <D.16427>; else goto <D.16428>;
  <D.16427>:
  D.16429 = BIT_FIELD_REF <*uncle, 8, 224>;
  D.16430 = D.16429 & 1;
  if (D.16430 == 0) goto <D.16431>; else goto <D.16432>;
  <D.16431>:
  grandparent = bb_grandparent (bb);
  D.16421 = bb->parent;
  D.16421->colour = 1;
  uncle->colour = 1;
  grandparent->colour = 0;
  bb = grandparent;
  // predicted unlikely by continue predictor.
  goto <D.16104>;
  <D.16432>:
  <D.16428>:
  grandparent = bb_grandparent (bb);
  D.16421 = bb->parent;
  D.16435 = D.16421->right;
  if (D.16435 == bb) goto <D.16436>; else goto <D.16433>;
  <D.16436>:
  D.16421 = bb->parent;
  D.16437 = grandparent->left;
  if (D.16421 == D.16437) goto <D.16438>; else goto <D.16433>;
  <D.16438>:
  D.16421 = bb->parent;
  rotate_left (D.16421, root);
  bb = bb->left;
  goto <D.16434>;
  <D.16433>:
  D.16421 = bb->parent;
  D.16439 = D.16421->left;
  if (D.16439 == bb) goto <D.16440>; else goto <D.16441>;
  <D.16440>:
  D.16421 = bb->parent;
  D.16442 = grandparent->right;
  if (D.16421 == D.16442) goto <D.16443>; else goto <D.16444>;
  <D.16443>:
  D.16421 = bb->parent;
  rotate_right (D.16421, root);
  bb = bb->right;
  <D.16444>:
  <D.16441>:
  <D.16434>:
  grandparent = bb_grandparent (bb);
  D.16421 = bb->parent;
  D.16421->colour = 1;
  grandparent->colour = 0;
  D.16421 = bb->parent;
  D.16439 = D.16421->left;
  if (D.16439 == bb) goto <D.16447>; else goto <D.16445>;
  <D.16447>:
  D.16421 = bb->parent;
  D.16437 = grandparent->left;
  if (D.16421 == D.16437) goto <D.16448>; else goto <D.16445>;
  <D.16448>:
  rotate_right (grandparent, root);
  goto <D.16446>;
  <D.16445>:
  rotate_left (grandparent, root);
  <D.16446>:
  goto <D.16103>;
  <D.16104>:
  goto <D.16105>;
  <D.16103>:
}


bb_uncle (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16451;
  struct MonoSimpleBasicBlock * D.16452;
  struct MonoSimpleBasicBlock * D.16453;
  struct MonoSimpleBasicBlock * gp;

  gp = bb_grandparent (bb);
  if (gp == 0B) goto <D.16449>; else goto <D.16450>;
  <D.16449>:
  D.16451 = 0B;
  return D.16451;
  <D.16450>:
  D.16452 = bb->parent;
  D.16453 = gp->left;
  if (D.16452 == D.16453) goto <D.16454>; else goto <D.16455>;
  <D.16454>:
  D.16451 = gp->right;
  return D.16451;
  <D.16455>:
  D.16451 = gp->left;
  return D.16451;
}


bb_grandparent (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16457;
  struct MonoSimpleBasicBlock * iftmp.14;
  struct MonoSimpleBasicBlock * D.16462;

  if (bb != 0B) goto <D.16461>; else goto <D.16459>;
  <D.16461>:
  D.16462 = bb->parent;
  if (D.16462 != 0B) goto <D.16463>; else goto <D.16459>;
  <D.16463>:
  D.16462 = bb->parent;
  iftmp.14 = D.16462->parent;
  goto <D.16460>;
  <D.16459>:
  iftmp.14 = 0B;
  <D.16460>:
  D.16457 = iftmp.14;
  return D.16457;
}


rotate_right (struct MonoSimpleBasicBlock * parent, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16465;
  struct MonoSimpleBasicBlock * D.16468;
  struct MonoSimpleBasicBlock * bb;

  bb = parent->left;
  D.16465 = bb->right;
  if (D.16465 != 0B) goto <D.16466>; else goto <D.16467>;
  <D.16466>:
  D.16465 = bb->right;
  parent->left = D.16465;
  D.16468 = parent->left;
  D.16468->parent = parent;
  goto <D.16469>;
  <D.16467>:
  parent->left = 0B;
  <D.16469>:
  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.16472;
  struct MonoSimpleBasicBlock * parent;

  parent = from->parent;
  if (parent != 0B) goto <D.16470>; else goto <D.16471>;
  <D.16470>:
  D.16472 = parent->left;
  if (D.16472 == from) goto <D.16473>; else goto <D.16474>;
  <D.16473>:
  parent->left = to;
  goto <D.16475>;
  <D.16474>:
  parent->right = to;
  <D.16475>:
  goto <D.16476>;
  <D.16471>:
  *root = to;
  <D.16476>:
  to->parent = parent;
}


rotate_left (struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16477;
  struct MonoSimpleBasicBlock * D.16480;
  struct MonoSimpleBasicBlock * other;

  other = bb->right;
  D.16477 = other->left;
  if (D.16477 != 0B) goto <D.16478>; else goto <D.16479>;
  <D.16478>:
  D.16477 = other->left;
  bb->right = D.16477;
  D.16480 = bb->right;
  D.16480->parent = bb;
  goto <D.16481>;
  <D.16479>:
  bb->right = 0B;
  <D.16481>:
  other->left = bb;
  change_node (bb, other, root);
  bb->parent = other;
}


bb_link (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16482;
  struct GSList * D.16483;
  struct GSList * D.16486;

  D.16482 = from->out_bb;
  D.16483 = monoeg_g_slist_find (D.16482, to);
  if (D.16483 != 0B) goto <D.16484>; else goto <D.16485>;
  <D.16484>:
  return;
  <D.16485>:
  D.16482 = from->out_bb;
  D.16486 = monoeg_g_slist_prepend (D.16482, to);
  from->out_bb = D.16486;
}


bb_formation_eh_pass (struct MonoMethodHeader * header, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16488;
  struct MonoExceptionClause * D.16489;
  unsigned int i.15;
  unsigned int D.16491;
  unsigned int D.16492;
  unsigned int D.16495;
  unsigned int D.16498;
  unsigned int D.16501;
  unsigned int D.16504;
  unsigned int D.16505;
  unsigned int end.16;
  struct MonoSimpleBasicBlock * D.16509;
  unsigned int D.16512;
  unsigned int D.16513;
  struct MonoSimpleBasicBlock * D.16516;
  <unnamed-unsigned:15> D.16519;
  int D.16520;
  int i;
  int end;

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

    D.16489 = header->clauses;
    i.15 = (unsigned int) i;
    D.16491 = i.15 * 24;
    clause = D.16489 + D.16491;
    D.16492 = clause->try_offset;
    try_block = bb_split (bb, bb, root, D.16492, 1, method, error);
    if (try_block == 0B) goto <D.16493>; else goto <D.16494>;
    <D.16493>:
    return;
    <D.16494>:
    D.16495 = clause->handler_offset;
    handler = bb_split (bb, try_block, root, D.16495, 0, method, error);
    if (handler == 0B) goto <D.16496>; else goto <D.16497>;
    <D.16496>:
    return;
    <D.16497>:
    handler->dead = 0;
    D.16498 = clause->flags;
    if (D.16498 == 1) goto <D.16499>; else goto <D.16500>;
    <D.16499>:
    {
      struct MonoSimpleBasicBlock * filter;

      D.16501 = clause->data.filter_offset;
      filter = bb_split (bb, try_block, root, D.16501, 0, method, error);
      if (filter == 0B) goto <D.16502>; else goto <D.16503>;
      <D.16502>:
      return;
      <D.16503>:
      filter->dead = 0;
    }
    <D.16500>:
    D.16492 = clause->try_offset;
    D.16504 = clause->try_len;
    D.16505 = D.16492 + D.16504;
    end.16 = (unsigned int) end;
    if (D.16505 < end.16) goto <D.16507>; else goto <D.16508>;
    <D.16507>:
    D.16492 = clause->try_offset;
    D.16504 = clause->try_len;
    D.16505 = D.16492 + D.16504;
    D.16509 = bb_split (bb, try_block, root, D.16505, 0, method, error);
    if (D.16509 == 0B) goto <D.16510>; else goto <D.16511>;
    <D.16510>:
    return;
    <D.16511>:
    <D.16508>:
    D.16495 = clause->handler_offset;
    D.16512 = clause->handler_len;
    D.16513 = D.16495 + D.16512;
    end.16 = (unsigned int) end;
    if (D.16513 < end.16) goto <D.16514>; else goto <D.16515>;
    <D.16514>:
    D.16495 = clause->handler_offset;
    D.16512 = clause->handler_len;
    D.16513 = D.16495 + D.16512;
    D.16516 = bb_split (bb, handler, root, D.16513, 0, method, error);
    if (D.16516 == 0B) goto <D.16517>; else goto <D.16518>;
    <D.16517>:
    return;
    <D.16518>:
    <D.16515>:
  }
  i = i + 1;
  <D.16208>:
  D.16519 = header->num_clauses;
  D.16520 = (int) D.16519;
  if (D.16520 > i) goto <D.16207>; else goto <D.16209>;
  <D.16209>:
}


bb_liveness (struct MonoSimpleBasicBlock * bb)
{
  unsigned char D.16522;
  unsigned char D.16523;
  unsigned int D.16526;
  unsigned int D.16527;
  unsigned char D.16528;
  unsigned char D.16529;
  struct GPtrArray * mark_stack;
  struct GSList * tmp;

  mark_stack = monoeg_g_ptr_array_new ();
  goto <D.16129>;
  <D.16128>:
  D.16522 = BIT_FIELD_REF <*bb, 8, 224>;
  D.16523 = D.16522 & 2;
  if (D.16523 == 0) goto <D.16524>; else goto <D.16525>;
  <D.16524>:
  monoeg_g_ptr_array_add (mark_stack, bb);
  <D.16525>:
  bb = bb->next;
  <D.16129>:
  if (bb != 0B) goto <D.16128>; else goto <D.16130>;
  <D.16130>:
  goto <D.16137>;
  <D.16136>:
  {
    struct MonoSimpleBasicBlock * block;

    D.16526 = mark_stack->len;
    D.16527 = D.16526 + 4294967295;
    block = monoeg_g_ptr_array_remove_index_fast (mark_stack, D.16527);
    block->dead = 0;
    tmp = block->out_bb;
    goto <D.16134>;
    <D.16133>:
    {
      struct MonoSimpleBasicBlock * to;

      to = tmp->data;
      D.16528 = BIT_FIELD_REF <*to, 8, 224>;
      D.16529 = D.16528 & 2;
      if (D.16529 != 0) goto <D.16530>; else goto <D.16531>;
      <D.16530>:
      monoeg_g_ptr_array_add (mark_stack, to);
      <D.16531>:
    }
    tmp = tmp->next;
    <D.16134>:
    if (tmp != 0B) goto <D.16133>; else goto <D.16135>;
    <D.16135>:
  }
  <D.16137>:
  D.16526 = mark_stack->len;
  if (D.16526 != 0) goto <D.16136>; else goto <D.16138>;
  <D.16138>:
  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.16532;
  int D.16533;
  unsigned int i.17;
  int D.16537;
  unsigned char D.16538;
  int D.16539;
  const unsigned char * D.16542;
  unsigned int p.18;
  unsigned int D.16547;
  unsigned int D.16548;
  sizetype size.19;
  const unsigned char * D.16552;
  unsigned int size.20;
  unsigned int D.16555;
  int p.21;
  int start.22;
  int D.16558;
  const unsigned char * start;
  const unsigned char * p;
  int i;
  int size;

  start = *ip;
  D.16532 = mono_opcode_value (ip, end);
  D.16533 = (int) D.16532;
  *value = D.16533;
  i = *value;
  size = 0;
  i.17 = (unsigned int) i;
  if (i.17 > 312) goto <D.16535>; else goto <D.16536>;
  <D.16535>:
  D.16537 = -1;
  return D.16537;
  <D.16536>:
  p = *ip;
  D.16538 = mono_opcodes[i].argument;
  D.16539 = (int) D.16538;
  switch (D.16539) <default: <D.16255>, case 0: <D.16236>, case 1: <D.16239>, case 2: <D.16240>, case 3: <D.16241>, case 4: <D.16242>, case 5: <D.16238>, case 6: <D.16243>, case 7: <D.16247>, case 8: <D.16248>, case 9: <D.16246>, case 10: <D.16250>, case 11: <D.16253>, case 12: <D.16251>, case 13: <D.16244>, case 14: <D.16245>, case 15: <D.16249>, case 16: <D.16252>>
  <D.16236>:
  size = 1;
  goto <D.16237>;
  <D.16238>:
  <D.16239>:
  <D.16240>:
  <D.16241>:
  <D.16242>:
  <D.16243>:
  <D.16244>:
  <D.16245>:
  <D.16246>:
  size = 5;
  goto <D.16237>;
  <D.16247>:
  size = 3;
  goto <D.16237>;
  <D.16248>:
  <D.16249>:
  <D.16250>:
  size = 2;
  goto <D.16237>;
  <D.16251>:
  <D.16252>:
  size = 9;
  goto <D.16237>;
  <D.16253>:
  {
    guint32 entries;

    D.16542 = p + 5;
    if (D.16542 > end) goto <D.16540>; else goto <D.16543>;
    <D.16543>:
    p.18 = (unsigned int) p;
    if (p.18 > 4294967290) goto <D.16540>; else goto <D.16541>;
    <D.16540>:
    D.16537 = -1;
    return D.16537;
    <D.16541>:
    entries = MEM[(const guint32 *)p + 1B];
    if (entries > 1073741822) goto <D.16545>; else goto <D.16546>;
    <D.16545>:
    D.16537 = -1;
    return D.16537;
    <D.16546>:
    D.16547 = entries + 1;
    D.16548 = D.16547 * 4;
    size = (int) D.16548;
    goto <D.16237>;
  }
  <D.16255>:
  D.16538 = mono_opcodes[i].argument;
  D.16539 = (int) D.16538;
  monoeg_g_log (0B, 4, "Invalid opcode %d argument %d max opcode %d\n", i, D.16539, 313);
  <D.16256>:
  goto <D.16256>;
  <D.16237>:
  size.19 = (sizetype) size;
  D.16552 = p + size.19;
  if (D.16552 > end) goto <D.16549>; else goto <D.16553>;
  <D.16553>:
  size.20 = (unsigned int) size;
  D.16555 = ~size.20;
  p.18 = (unsigned int) p;
  if (D.16555 < p.18) goto <D.16549>; else goto <D.16550>;
  <D.16549>:
  D.16537 = -1;
  return D.16537;
  <D.16550>:
  p.21 = (int) p;
  start.22 = (int) start;
  D.16558 = p.21 - start.22;
  D.16537 = D.16558 + size;
  return D.16537;
}


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

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


