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

  goto <D.16187>;
  <D.16186>:
  {
    struct MonoSimpleBasicBlock * next;

    next = bb->next;
    D.16235 = bb->out_bb;
    if (D.16235 != 0B) goto <D.16236>; else goto <D.16237>;
    <D.16236>:
    D.16235 = bb->out_bb;
    monoeg_g_slist_free (D.16235);
    <D.16237>:
    monoeg_g_free (bb);
    bb = next;
  }
  <D.16187>:
  if (bb != 0B) goto <D.16186>; else goto <D.16188>;
  <D.16188>:
}


mono_basic_block_split (struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16238;
  struct MonoSimpleBasicBlock * D.16241;
  int end.0;
  int start.1;
  int D.16244;
  int D.16245;
  int D.16247;
  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.16238 = header->code_size;
      end = start + D.16238;
      mono_error_init (error);
      if (header == 0B) goto <D.16239>; else goto <D.16240>;
      <D.16239>:
      mono_error_set_not_verifiable (error, method, "Could not decode header");
      D.16241 = 0B;
      return D.16241;
      <D.16240>:
      bb = monoeg_malloc0 (32);
      bb->start = 0;
      end.0 = (int) end;
      start.1 = (int) start;
      D.16244 = end.0 - start.1;
      bb->end = D.16244;
      bb->colour = 1;
      bb->dead = 0;
      root = bb;
      bb_formation_il_pass (start, end, bb, &root, method, error);
      D.16245 = mono_error_ok (error);
      if (D.16245 == 0) goto fail; else goto <D.16246>;
      <D.16246>:
      bb_formation_eh_pass (header, bb, &root, method, error);
      D.16247 = mono_error_ok (error);
      if (D.16247 == 0) goto fail; else goto <D.16248>;
      <D.16248>:
      bb_liveness (bb);
      mono_metadata_free_mh (header);
      D.16241 = bb;
      return D.16241;
      fail:
      mono_metadata_free_mh (header);
      mono_basic_block_free (bb);
      D.16241 = 0B;
      return D.16241;
    }
  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.16254;
  unsigned char D.16257;
  int D.16258;
  int D.16260;
  unsigned int D.16261;
  _Bool D.16262;
  long int D.16263;
  long int D.16264;
  int value.5;
  unsigned char D.16268;
  int D.16269;
  const unsigned char * ip.6;
  int D.16271;
  unsigned int D.16274;
  const unsigned char * ip.7;
  const unsigned char * ip.8;
  const unsigned char * ip.9;
  const unsigned char * ip.10;
  unsigned char D.16287;
  signed char D.16288;
  unsigned int D.16289;
  unsigned int D.16290;
  unsigned int D.16292;
  unsigned int D.16293;
  int D.16298;
  int D.16299;
  unsigned char D.16304;
  _Bool D.16305;
  int D.16306;
  unsigned int D.16316;
  unsigned int D.16317;
  unsigned int D.16322;
  unsigned int D.16323;
  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.16164>;
      <D.16163>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16254 = ip.3 - start.4;
      cli_addr = (guint) D.16254;
      size = mono_opcode_value_and_size (&ip, end, &value);
      if (size < 0) goto <D.16255>; else goto <D.16256>;
      <D.16255>:
      ip.2 = ip;
      D.16257 = *ip.2;
      D.16258 = (int) D.16257;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16258);
      return;
      <D.16256>:
      goto <D.16136>;
      <D.16135>:
      current = current->next;
      <D.16136>:
      if (current != 0B) goto <D.16259>; else goto <D.16137>;
      <D.16259>:
      D.16260 = current->end;
      D.16261 = (unsigned int) D.16260;
      if (D.16261 <= cli_addr) goto <D.16135>; else goto <D.16137>;
      <D.16137>:
      D.16262 = current == 0B;
      D.16263 = (long int) D.16262;
      D.16264 = __builtin_expect (D.16263, 0);
      if (D.16264 != 0) goto <D.16265>; else goto <D.16266>;
      <D.16265>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 350, "current");
      <D.16266>:
      value.5 = value;
      opcode = &mono_opcodes[value.5];
      D.16268 = opcode->argument;
      D.16269 = (int) D.16268;
      switch (D.16269) <default: <D.16162>, case 0: <D.16138>, case 1: <D.16141>, case 2: <D.16142>, case 3: <D.16147>, case 4: <D.16143>, case 5: <D.16140>, case 6: <D.16144>, case 7: <D.16148>, case 8: <D.16149>, case 9: <D.16154>, case 10: <D.16153>, case 11: <D.16155>, case 12: <D.16151>, case 13: <D.16145>, case 14: <D.16146>, case 15: <D.16150>, case 16: <D.16152>>
      <D.16138>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      ip = ip.6;
      value.5 = value;
      D.16271 = mono_opcode_has_static_branch (value.5);
      if (D.16271 == 0) goto <D.16139>; else goto <D.16272>;
      <D.16272>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16139>; else goto <D.16273>;
      <D.16273>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16254 = ip.3 - start.4;
      D.16274 = (unsigned int) D.16254;
      next = bb_split (bb, current, root, D.16274, 0, method, error);
      if (next == 0B) goto <D.16275>; else goto <D.16276>;
      <D.16275>:
      return;
      <D.16276>:
      bb_unlink (current, next);
      current = next;
      goto <D.16139>;
      <D.16140>:
      <D.16141>:
      <D.16142>:
      <D.16143>:
      <D.16144>:
      <D.16145>:
      <D.16146>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      goto <D.16139>;
      <D.16147>:
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      value.5 = value;
      if (value.5 != 39) goto <D.16139>; else goto <D.16278>;
      <D.16278>:
      ip.2 = ip;
      if (ip.2 >= end) goto <D.16139>; else goto <D.16279>;
      <D.16279>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16254 = ip.3 - start.4;
      D.16274 = (unsigned int) D.16254;
      next = bb_split (bb, current, root, D.16274, 0, method, error);
      if (next == 0B) goto <D.16280>; else goto <D.16281>;
      <D.16280>:
      return;
      <D.16281>:
      bb_unlink (current, next);
      current = next;
      goto <D.16139>;
      <D.16148>:
      ip.2 = ip;
      ip.8 = ip.2 + 3;
      ip = ip.8;
      goto <D.16139>;
      <D.16149>:
      <D.16150>:
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16139>;
      <D.16151>:
      <D.16152>:
      ip.2 = ip;
      ip.10 = ip.2 + 9;
      ip = ip.10;
      goto <D.16139>;
      <D.16153>:
      <D.16154>:
      D.16268 = opcode->argument;
      if (D.16268 == 10) goto <D.16285>; else goto <D.16286>;
      <D.16285>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.16287 = *ip.6;
      D.16288 = (signed char) D.16287;
      D.16289 = (unsigned int) D.16288;
      D.16290 = D.16289 + cli_addr;
      offset = D.16290 + 2;
      ip.2 = ip;
      ip.9 = ip.2 + 2;
      ip = ip.9;
      goto <D.16291>;
      <D.16286>:
      ip.2 = ip;
      ip.6 = ip.2 + 1;
      D.16292 = mono_read32 (ip.6);
      D.16293 = D.16292 + cli_addr;
      offset = D.16293 + 5;
      ip.2 = ip;
      ip.7 = ip.2 + 5;
      ip = ip.7;
      <D.16291>:
      branch = bb_split (bb, current, root, offset, 1, method, error);
      if (branch == 0B) goto <D.16294>; else goto <D.16295>;
      <D.16294>:
      return;
      <D.16295>:
      if (offset < cli_addr) goto <D.16296>; else goto <D.16297>;
      <D.16296>:
      D.16298 = branch->start;
      D.16299 = current->start;
      if (D.16298 > D.16299) goto <D.16300>; else goto <D.16301>;
      <D.16300>:
      current = branch;
      <D.16301>:
      <D.16297>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16302>; else goto <D.16303>;
      <D.16302>:
      ip.2 = ip;
      ip.3 = (int) ip.2;
      start.4 = (int) start;
      D.16254 = ip.3 - start.4;
      D.16274 = (unsigned int) D.16254;
      D.16304 = opcode->flow_type;
      D.16305 = D.16304 != 1;
      D.16306 = (int) D.16305;
      next = bb_split (bb, current, root, D.16274, D.16306, method, error);
      if (next == 0B) goto <D.16307>; else goto <D.16308>;
      <D.16307>:
      return;
      <D.16308>:
      goto <D.16309>;
      <D.16303>:
      next = 0B;
      <D.16309>:
      bb_link (current, branch);
      if (next != 0B) goto <D.16310>; else goto <D.16311>;
      <D.16310>:
      D.16304 = opcode->flow_type;
      if (D.16304 == 1) goto <D.16312>; else goto <D.16313>;
      <D.16312>:
      if (next != branch) goto <D.16314>; else goto <D.16315>;
      <D.16314>:
      bb_unlink (current, next);
      current = next;
      <D.16315>:
      <D.16313>:
      <D.16311>:
      goto <D.16139>;
      <D.16155>:
      {
        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.16316 = n * 4;
        D.16317 = D.16316 + cli_addr;
        offset = D.16317 + 5;
        next = bb_split (bb, current, root, offset, 1, method, error);
        if (next == 0B) goto <D.16318>; else goto <D.16319>;
        <D.16318>:
        return;
        <D.16319>:
        bb_link (current, next);
        tmp = next;
        j = 0;
        goto <D.16160>;
        <D.16159>:
        ip.2 = ip;
        if (ip.2 >= end) goto <D.16320>; else goto <D.16321>;
        <D.16320>:
        mono_error_set_not_verifiable (error, method, "Invalid switch instruction %x", cli_addr);
        return;
        <D.16321>:
        ip.2 = ip;
        D.16322 = mono_read32 (ip.2);
        D.16323 = D.16322 + offset;
        next = bb_split (bb, next, root, D.16323, 1, method, error);
        if (next == 0B) goto <D.16324>; else goto <D.16325>;
        <D.16324>:
        return;
        <D.16325>:
        bb_link (current, next);
        ip.2 = ip;
        ip.11 = ip.2 + 4;
        ip = ip.11;
        j = j + 1;
        <D.16160>:
        if (j < n) goto <D.16159>; else goto <D.16161>;
        <D.16161>:
        current = tmp;
        goto <D.16139>;
      }
      <D.16162>:
      ip.2 = ip;
      D.16257 = *ip.2;
      D.16258 = (int) D.16257;
      mono_error_set_not_verifiable (error, method, "Invalid instruction %x", D.16258);
      return;
      <D.16139>:
      <D.16164>:
      ip.2 = ip;
      if (ip.2 < end) goto <D.16163>; else goto <D.16165>;
      <D.16165>:
      ip.2 = ip;
      if (ip.2 != end) goto <D.16327>; else goto <D.16328>;
      <D.16327>:
      mono_error_set_not_verifiable (error, method, "Invalid last instruction");
      <D.16328>:
    }
  finally
    {
      ip = {CLOBBER};
      value = {CLOBBER};
    }
}


mono_opcode_has_static_branch (int opcode)
{
  gboolean D.16332;

  switch (opcode) <default: <D.16333>, case 42: <D.16114>, case 122: <D.16115>, case 220: <D.16117>, case 282: <D.16116>>
  <D.16114>:
  <D.16115>:
  <D.16116>:
  <D.16117>:
  D.16332 = 1;
  return D.16332;
  <D.16333>:
  D.16332 = 0;
  return D.16332;
}


bb_unlink (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16335;
  struct GSList * D.16338;

  D.16335 = from->out_bb;
  if (D.16335 != 0B) goto <D.16336>; else goto <D.16337>;
  <D.16336>:
  D.16335 = from->out_bb;
  D.16338 = monoeg_g_slist_remove (D.16335, to);
  from->out_bb = D.16338;
  <D.16337>:
}


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.16340;
  struct MonoSimpleBasicBlock * D.16345;
  int D.16347;
  int D.16349;
  int D.16351;
  unsigned int D.16352;
  struct MonoSimpleBasicBlock * D.16358;
  int D.16361;
  struct MonoSimpleBasicBlock * D.16362;
  struct GSList * D.16363;
  int D.16364;
  struct MonoSimpleBasicBlock * res;
  struct MonoSimpleBasicBlock * bb;

  bb = first;
  target.12 = (int) target;
  D.16340 = bb_idx_is_contained (hint, target.12);
  if (D.16340 != 0) goto <D.16341>; else goto <D.16342>;
  <D.16341>:
  first = hint;
  goto <D.16343>;
  <D.16342>:
  D.16345 = hint->next;
  if (D.16345 != 0B) goto <D.16346>; else goto <D.16344>;
  <D.16346>:
  D.16345 = hint->next;
  target.12 = (int) target;
  D.16347 = bb_idx_is_contained (D.16345, target.12);
  if (D.16347 != 0) goto <D.16348>; else goto <D.16344>;
  <D.16348>:
  first = hint->next;
  goto <D.16093>;
  <D.16344>:
  first = *root;
  <D.16094>:
  target.12 = (int) target;
  D.16349 = bb_idx_is_contained (first, target.12);
  if (D.16349 != 0) goto <D.16093>; else goto <D.16350>;
  <D.16350>:
  D.16351 = first->start;
  D.16352 = (unsigned int) D.16351;
  if (D.16352 > target) goto <D.16353>; else goto <D.16354>;
  <D.16353>:
  first = first->left;
  goto <D.16355>;
  <D.16354>:
  first = first->right;
  <D.16355>:
  if (first != 0B) goto <D.16094>; else goto <D.16093>;
  <D.16093>:
  <D.16343>:
  if (first == 0B) goto <D.16356>; else goto <D.16357>;
  <D.16356>:
  mono_error_set_not_verifiable (error, method, "Invalid instruction target %x", target);
  D.16358 = 0B;
  return D.16358;
  <D.16357>:
  D.16351 = first->start;
  D.16352 = (unsigned int) D.16351;
  if (D.16352 == target) goto <D.16359>; else goto <D.16360>;
  <D.16359>:
  D.16358 = first;
  return D.16358;
  <D.16360>:
  res = monoeg_malloc0 (32);
  target.12 = (int) target;
  res->start = target.12;
  D.16361 = first->end;
  res->end = D.16361;
  D.16362 = first->next;
  res->next = D.16362;
  D.16363 = first->out_bb;
  res->out_bb = D.16363;
  res->dead = 1;
  D.16364 = res->start;
  first->end = D.16364;
  first->next = res;
  first->out_bb = 0B;
  if (link_blocks != 0) goto <D.16365>; else goto <D.16366>;
  <D.16365>:
  bb_link (first, res);
  <D.16366>:
  bb_insert (bb, res, root);
  D.16358 = res;
  return D.16358;
}


bb_idx_is_contained (struct MonoSimpleBasicBlock * bb, int target)
{
  gboolean D.16368;
  int iftmp.13;
  int D.16372;
  int D.16374;

  D.16372 = bb->start;
  if (D.16372 <= target) goto <D.16373>; else goto <D.16370>;
  <D.16373>:
  D.16374 = bb->end;
  if (D.16374 > target) goto <D.16375>; else goto <D.16370>;
  <D.16375>:
  iftmp.13 = 1;
  goto <D.16371>;
  <D.16370>:
  iftmp.13 = 0;
  <D.16371>:
  D.16368 = iftmp.13;
  return D.16368;
}


bb_insert (struct MonoSimpleBasicBlock * first, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  int D.16377;
  struct MonoSimpleBasicBlock * D.16380;
  struct MonoSimpleBasicBlock * D.16384;
  _Bool D.16387;
  long int D.16388;
  long int D.16389;
  struct MonoSimpleBasicBlock * D.16392;
  unsigned int D.16395;
  unsigned int D.16396;
  unsigned int D.16400;
  unsigned int D.16401;
  struct MonoSimpleBasicBlock * D.16406;
  struct MonoSimpleBasicBlock * D.16408;
  struct MonoSimpleBasicBlock * D.16410;
  struct MonoSimpleBasicBlock * D.16413;
  struct MonoSimpleBasicBlock * parent;
  struct MonoSimpleBasicBlock * uncle;
  struct MonoSimpleBasicBlock * grandparent;
  int bb_start;

  bb_start = bb->start;
  parent = *root;
  <D.16074>:
  D.16377 = parent->start;
  if (D.16377 > bb_start) goto <D.16378>; else goto <D.16379>;
  <D.16378>:
  D.16380 = parent->left;
  if (D.16380 == 0B) goto <D.16381>; else goto <D.16382>;
  <D.16381>:
  parent->left = bb;
  goto <D.16073>;
  <D.16382>:
  parent = parent->left;
  goto <D.16383>;
  <D.16379>:
  D.16384 = parent->right;
  if (D.16384 == 0B) goto <D.16385>; else goto <D.16386>;
  <D.16385>:
  parent->right = bb;
  goto <D.16073>;
  <D.16386>:
  parent = parent->right;
  <D.16383>:
  if (parent != 0B) goto <D.16074>; else goto <D.16073>;
  <D.16073>:
  D.16387 = parent == 0B;
  D.16388 = (long int) D.16387;
  D.16389 = __builtin_expect (D.16388, 0);
  if (D.16389 != 0) goto <D.16390>; else goto <D.16391>;
  <D.16390>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-basic-block.c", 180, "parent");
  <D.16391>:
  bb->parent = parent;
  bb->colour = 0;
  <D.16077>:
  D.16392 = bb->parent;
  if (D.16392 == 0B) goto <D.16393>; else goto <D.16394>;
  <D.16393>:
  bb->colour = 1;
  goto <D.16075>;
  <D.16394>:
  D.16392 = bb->parent;
  D.16395 = BIT_FIELD_REF <*D.16392, 32, 224>;
  D.16396 = D.16395 & 1;
  if (D.16396 != 0) goto <D.16075>; else goto <D.16397>;
  <D.16397>:
  uncle = bb_uncle (bb);
  if (uncle != 0B) goto <D.16398>; else goto <D.16399>;
  <D.16398>:
  D.16400 = BIT_FIELD_REF <*uncle, 32, 224>;
  D.16401 = D.16400 & 1;
  if (D.16401 == 0) goto <D.16402>; else goto <D.16403>;
  <D.16402>:
  grandparent = bb_grandparent (bb);
  D.16392 = bb->parent;
  D.16392->colour = 1;
  uncle->colour = 1;
  grandparent->colour = 0;
  bb = grandparent;
  // predicted unlikely by continue predictor.
  goto <D.16076>;
  <D.16403>:
  <D.16399>:
  grandparent = bb_grandparent (bb);
  D.16392 = bb->parent;
  D.16406 = D.16392->right;
  if (D.16406 == bb) goto <D.16407>; else goto <D.16404>;
  <D.16407>:
  D.16392 = bb->parent;
  D.16408 = grandparent->left;
  if (D.16392 == D.16408) goto <D.16409>; else goto <D.16404>;
  <D.16409>:
  D.16392 = bb->parent;
  rotate_left (D.16392, root);
  bb = bb->left;
  goto <D.16405>;
  <D.16404>:
  D.16392 = bb->parent;
  D.16410 = D.16392->left;
  if (D.16410 == bb) goto <D.16411>; else goto <D.16412>;
  <D.16411>:
  D.16392 = bb->parent;
  D.16413 = grandparent->right;
  if (D.16392 == D.16413) goto <D.16414>; else goto <D.16415>;
  <D.16414>:
  D.16392 = bb->parent;
  rotate_right (D.16392, root);
  bb = bb->right;
  <D.16415>:
  <D.16412>:
  <D.16405>:
  grandparent = bb_grandparent (bb);
  D.16392 = bb->parent;
  D.16392->colour = 1;
  grandparent->colour = 0;
  D.16392 = bb->parent;
  D.16410 = D.16392->left;
  if (D.16410 == bb) goto <D.16418>; else goto <D.16416>;
  <D.16418>:
  D.16392 = bb->parent;
  D.16408 = grandparent->left;
  if (D.16392 == D.16408) goto <D.16419>; else goto <D.16416>;
  <D.16419>:
  rotate_right (grandparent, root);
  goto <D.16417>;
  <D.16416>:
  rotate_left (grandparent, root);
  <D.16417>:
  goto <D.16075>;
  <D.16076>:
  goto <D.16077>;
  <D.16075>:
}


bb_uncle (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16422;
  struct MonoSimpleBasicBlock * D.16423;
  struct MonoSimpleBasicBlock * D.16424;
  struct MonoSimpleBasicBlock * gp;

  gp = bb_grandparent (bb);
  if (gp == 0B) goto <D.16420>; else goto <D.16421>;
  <D.16420>:
  D.16422 = 0B;
  return D.16422;
  <D.16421>:
  D.16423 = bb->parent;
  D.16424 = gp->left;
  if (D.16423 == D.16424) goto <D.16425>; else goto <D.16426>;
  <D.16425>:
  D.16422 = gp->right;
  return D.16422;
  <D.16426>:
  D.16422 = gp->left;
  return D.16422;
}


bb_grandparent (struct MonoSimpleBasicBlock * bb)
{
  struct MonoSimpleBasicBlock * D.16428;
  struct MonoSimpleBasicBlock * iftmp.14;
  struct MonoSimpleBasicBlock * D.16433;

  if (bb != 0B) goto <D.16432>; else goto <D.16430>;
  <D.16432>:
  D.16433 = bb->parent;
  if (D.16433 != 0B) goto <D.16434>; else goto <D.16430>;
  <D.16434>:
  D.16433 = bb->parent;
  iftmp.14 = D.16433->parent;
  goto <D.16431>;
  <D.16430>:
  iftmp.14 = 0B;
  <D.16431>:
  D.16428 = iftmp.14;
  return D.16428;
}


rotate_right (struct MonoSimpleBasicBlock * parent, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16436;
  struct MonoSimpleBasicBlock * D.16439;
  struct MonoSimpleBasicBlock * bb;

  bb = parent->left;
  D.16436 = bb->right;
  if (D.16436 != 0B) goto <D.16437>; else goto <D.16438>;
  <D.16437>:
  D.16436 = bb->right;
  parent->left = D.16436;
  D.16439 = parent->left;
  D.16439->parent = parent;
  goto <D.16440>;
  <D.16438>:
  parent->left = 0B;
  <D.16440>:
  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.16443;
  struct MonoSimpleBasicBlock * parent;

  parent = from->parent;
  if (parent != 0B) goto <D.16441>; else goto <D.16442>;
  <D.16441>:
  D.16443 = parent->left;
  if (D.16443 == from) goto <D.16444>; else goto <D.16445>;
  <D.16444>:
  parent->left = to;
  goto <D.16446>;
  <D.16445>:
  parent->right = to;
  <D.16446>:
  goto <D.16447>;
  <D.16442>:
  *root = to;
  <D.16447>:
  to->parent = parent;
}


rotate_left (struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root)
{
  struct MonoSimpleBasicBlock * D.16448;
  struct MonoSimpleBasicBlock * D.16451;
  struct MonoSimpleBasicBlock * other;

  other = bb->right;
  D.16448 = other->left;
  if (D.16448 != 0B) goto <D.16449>; else goto <D.16450>;
  <D.16449>:
  D.16448 = other->left;
  bb->right = D.16448;
  D.16451 = bb->right;
  D.16451->parent = bb;
  goto <D.16452>;
  <D.16450>:
  bb->right = 0B;
  <D.16452>:
  other->left = bb;
  change_node (bb, other, root);
  bb->parent = other;
}


bb_link (struct MonoSimpleBasicBlock * from, struct MonoSimpleBasicBlock * to)
{
  struct GSList * D.16453;
  struct GSList * D.16454;
  struct GSList * D.16457;

  D.16453 = from->out_bb;
  D.16454 = monoeg_g_slist_find (D.16453, to);
  if (D.16454 != 0B) goto <D.16455>; else goto <D.16456>;
  <D.16455>:
  return;
  <D.16456>:
  D.16453 = from->out_bb;
  D.16457 = monoeg_g_slist_prepend (D.16453, to);
  from->out_bb = D.16457;
}


bb_formation_eh_pass (struct MonoMethodHeader * header, struct MonoSimpleBasicBlock * bb, struct MonoSimpleBasicBlock * * root, struct MonoMethod * method, struct MonoError * error)
{
  unsigned int D.16459;
  struct MonoExceptionClause * D.16460;
  unsigned int i.15;
  unsigned int D.16462;
  unsigned int D.16463;
  unsigned int D.16466;
  unsigned int D.16469;
  unsigned int D.16472;
  unsigned int D.16475;
  unsigned int D.16476;
  unsigned int end.16;
  struct MonoSimpleBasicBlock * D.16480;
  unsigned int D.16483;
  unsigned int D.16484;
  struct MonoSimpleBasicBlock * D.16487;
  <unnamed-unsigned:15> D.16490;
  int D.16491;
  int i;
  int end;

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

    D.16460 = header->clauses;
    i.15 = (unsigned int) i;
    D.16462 = i.15 * 24;
    clause = D.16460 + D.16462;
    D.16463 = clause->try_offset;
    try_block = bb_split (bb, bb, root, D.16463, 1, method, error);
    if (try_block == 0B) goto <D.16464>; else goto <D.16465>;
    <D.16464>:
    return;
    <D.16465>:
    D.16466 = clause->handler_offset;
    handler = bb_split (bb, try_block, root, D.16466, 0, method, error);
    if (handler == 0B) goto <D.16467>; else goto <D.16468>;
    <D.16467>:
    return;
    <D.16468>:
    handler->dead = 0;
    D.16469 = clause->flags;
    if (D.16469 == 1) goto <D.16470>; else goto <D.16471>;
    <D.16470>:
    {
      struct MonoSimpleBasicBlock * filter;

      D.16472 = clause->data.filter_offset;
      filter = bb_split (bb, try_block, root, D.16472, 0, method, error);
      if (filter == 0B) goto <D.16473>; else goto <D.16474>;
      <D.16473>:
      return;
      <D.16474>:
      filter->dead = 0;
    }
    <D.16471>:
    D.16463 = clause->try_offset;
    D.16475 = clause->try_len;
    D.16476 = D.16463 + D.16475;
    end.16 = (unsigned int) end;
    if (D.16476 < end.16) goto <D.16478>; else goto <D.16479>;
    <D.16478>:
    D.16463 = clause->try_offset;
    D.16475 = clause->try_len;
    D.16476 = D.16463 + D.16475;
    D.16480 = bb_split (bb, try_block, root, D.16476, 0, method, error);
    if (D.16480 == 0B) goto <D.16481>; else goto <D.16482>;
    <D.16481>:
    return;
    <D.16482>:
    <D.16479>:
    D.16466 = clause->handler_offset;
    D.16483 = clause->handler_len;
    D.16484 = D.16466 + D.16483;
    end.16 = (unsigned int) end;
    if (D.16484 < end.16) goto <D.16485>; else goto <D.16486>;
    <D.16485>:
    D.16466 = clause->handler_offset;
    D.16483 = clause->handler_len;
    D.16484 = D.16466 + D.16483;
    D.16487 = bb_split (bb, handler, root, D.16484, 0, method, error);
    if (D.16487 == 0B) goto <D.16488>; else goto <D.16489>;
    <D.16488>:
    return;
    <D.16489>:
    <D.16486>:
  }
  i = i + 1;
  <D.16180>:
  D.16490 = header->num_clauses;
  D.16491 = (int) D.16490;
  if (D.16491 > i) goto <D.16179>; else goto <D.16181>;
  <D.16181>:
}


bb_liveness (struct MonoSimpleBasicBlock * bb)
{
  unsigned int D.16493;
  unsigned int D.16494;
  unsigned int D.16497;
  unsigned int D.16498;
  unsigned int D.16499;
  unsigned int D.16500;
  struct GPtrArray * mark_stack;
  struct GSList * tmp;

  mark_stack = monoeg_g_ptr_array_new ();
  goto <D.16101>;
  <D.16100>:
  D.16493 = BIT_FIELD_REF <*bb, 32, 224>;
  D.16494 = D.16493 & 2;
  if (D.16494 == 0) goto <D.16495>; else goto <D.16496>;
  <D.16495>:
  monoeg_g_ptr_array_add (mark_stack, bb);
  <D.16496>:
  bb = bb->next;
  <D.16101>:
  if (bb != 0B) goto <D.16100>; else goto <D.16102>;
  <D.16102>:
  goto <D.16109>;
  <D.16108>:
  {
    struct MonoSimpleBasicBlock * block;

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

      to = tmp->data;
      D.16499 = BIT_FIELD_REF <*to, 32, 224>;
      D.16500 = D.16499 & 2;
      if (D.16500 != 0) goto <D.16501>; else goto <D.16502>;
      <D.16501>:
      monoeg_g_ptr_array_add (mark_stack, to);
      <D.16502>:
    }
    tmp = tmp->next;
    <D.16106>:
    if (tmp != 0B) goto <D.16105>; else goto <D.16107>;
    <D.16107>:
  }
  <D.16109>:
  D.16497 = mark_stack->len;
  if (D.16497 != 0) goto <D.16108>; else goto <D.16110>;
  <D.16110>:
  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.16503;
  int D.16504;
  unsigned int i.17;
  int D.16508;
  unsigned char D.16509;
  int D.16510;
  const unsigned char * D.16513;
  unsigned int p.18;
  const unsigned char * D.16516;
  unsigned int D.16519;
  unsigned int D.16520;
  sizetype size.19;
  const unsigned char * D.16524;
  unsigned int size.20;
  unsigned int D.16527;
  int p.21;
  int start.22;
  int D.16530;
  const unsigned char * start;
  const unsigned char * p;
  int i;
  int size;

  start = *ip;
  D.16503 = mono_opcode_value (ip, end);
  D.16504 = (int) D.16503;
  *value = D.16504;
  i = *value;
  size = 0;
  i.17 = (unsigned int) i;
  if (i.17 > 312) goto <D.16506>; else goto <D.16507>;
  <D.16506>:
  D.16508 = -1;
  return D.16508;
  <D.16507>:
  p = *ip;
  D.16509 = mono_opcodes[i].argument;
  D.16510 = (int) D.16509;
  switch (D.16510) <default: <D.16227>, case 0: <D.16208>, case 1: <D.16211>, case 2: <D.16212>, case 3: <D.16213>, case 4: <D.16214>, case 5: <D.16210>, case 6: <D.16215>, case 7: <D.16219>, case 8: <D.16220>, case 9: <D.16218>, case 10: <D.16222>, case 11: <D.16225>, case 12: <D.16223>, case 13: <D.16216>, case 14: <D.16217>, case 15: <D.16221>, case 16: <D.16224>>
  <D.16208>:
  size = 1;
  goto <D.16209>;
  <D.16210>:
  <D.16211>:
  <D.16212>:
  <D.16213>:
  <D.16214>:
  <D.16215>:
  <D.16216>:
  <D.16217>:
  <D.16218>:
  size = 5;
  goto <D.16209>;
  <D.16219>:
  size = 3;
  goto <D.16209>;
  <D.16220>:
  <D.16221>:
  <D.16222>:
  size = 2;
  goto <D.16209>;
  <D.16223>:
  <D.16224>:
  size = 9;
  goto <D.16209>;
  <D.16225>:
  {
    guint32 entries;

    D.16513 = p + 5;
    if (D.16513 > end) goto <D.16511>; else goto <D.16514>;
    <D.16514>:
    p.18 = (unsigned int) p;
    if (p.18 > 4294967290) goto <D.16511>; else goto <D.16512>;
    <D.16511>:
    D.16508 = -1;
    return D.16508;
    <D.16512>:
    D.16516 = p + 1;
    entries = mono_read32 (D.16516);
    if (entries > 1073741822) goto <D.16517>; else goto <D.16518>;
    <D.16517>:
    D.16508 = -1;
    return D.16508;
    <D.16518>:
    D.16519 = entries + 1;
    D.16520 = D.16519 * 4;
    size = (int) D.16520;
    goto <D.16209>;
  }
  <D.16227>:
  D.16509 = mono_opcodes[i].argument;
  D.16510 = (int) D.16509;
  monoeg_g_log (0B, 4, "Invalid opcode %d argument %d max opcode %d\n", i, D.16510, 313);
  <D.16228>:
  goto <D.16228>;
  <D.16209>:
  size.19 = (sizetype) size;
  D.16524 = p + size.19;
  if (D.16524 > end) goto <D.16521>; else goto <D.16525>;
  <D.16525>:
  size.20 = (unsigned int) size;
  D.16527 = ~size.20;
  p.18 = (unsigned int) p;
  if (D.16527 < p.18) goto <D.16521>; else goto <D.16522>;
  <D.16521>:
  D.16508 = -1;
  return D.16508;
  <D.16522>:
  p.21 = (int) p;
  start.22 = (int) start;
  D.16530 = p.21 - start.22;
  D.16508 = D.16530 + size;
  return D.16508;
}


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

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


