mono_install_image_unload_hook (void (*MonoImageUnloadFunc) (struct MonoImage *, void *) func, void * user_data)
{
  struct GSList * image_unload_hooks.0;
  struct GSList * image_unload_hooks.1;
  struct ImageUnloadHook * hook;

  if (func == 0B) goto <D.18587>; else goto <D.18588>;
  <D.18587>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 75, "func != NULL");
  return;
  <D.18588>:
  hook = monoeg_malloc0 (8);
  hook->func = func;
  hook->user_data = user_data;
  image_unload_hooks.0 = image_unload_hooks;
  image_unload_hooks.1 = monoeg_g_slist_prepend (image_unload_hooks.0, hook);
  image_unload_hooks = image_unload_hooks.1;
}


mono_remove_image_unload_hook (void (*MonoImageUnloadFunc) (struct MonoImage *, void *) func, void * user_data)
{
  void (*<T1ac7>) (struct MonoImage *, void *) D.18592;
  void * D.18595;
  struct GSList * image_unload_hooks.2;
  struct GSList * image_unload_hooks.3;
  struct GSList * l;
  struct ImageUnloadHook * hook;

  l = image_unload_hooks;
  goto <D.17949>;
  <D.17948>:
  hook = l->data;
  D.18592 = hook->func;
  if (D.18592 == func) goto <D.18593>; else goto <D.18594>;
  <D.18593>:
  D.18595 = hook->user_data;
  if (D.18595 == user_data) goto <D.18596>; else goto <D.18597>;
  <D.18596>:
  monoeg_g_free (hook);
  image_unload_hooks.2 = image_unload_hooks;
  image_unload_hooks.3 = monoeg_g_slist_delete_link (image_unload_hooks.2, l);
  image_unload_hooks = image_unload_hooks.3;
  goto <D.17947>;
  <D.18597>:
  <D.18594>:
  l = l->next;
  <D.17949>:
  if (l != 0B) goto <D.17948>; else goto <D.17947>;
  <D.17947>:
}


mono_cli_rva_image_map (struct MonoImage * image, guint32 addr)
{
  unsigned int D.18600;
  unsigned int D.18603;
  unsigned int D.18604;
  guint32 D.18607;
  unsigned int D.18608;
  unsigned int D.18609;
  struct MonoCLIImageInfo * iinfo;
  const int top;
  struct MonoSectionTable * tables;
  int i;

  iinfo = image->image_info;
  top = iinfo->cli_section_count;
  tables = iinfo->cli_section_tables;
  i = 0;
  goto <D.17967>;
  <D.17966>:
  D.18600 = tables->st_virtual_address;
  if (D.18600 <= addr) goto <D.18601>; else goto <D.18602>;
  <D.18601>:
  D.18600 = tables->st_virtual_address;
  D.18603 = tables->st_raw_data_size;
  D.18604 = D.18600 + D.18603;
  if (D.18604 > addr) goto <D.18605>; else goto <D.18606>;
  <D.18605>:
  D.18600 = tables->st_virtual_address;
  D.18608 = addr - D.18600;
  D.18609 = tables->st_raw_data_ptr;
  D.18607 = D.18608 + D.18609;
  return D.18607;
  <D.18606>:
  <D.18602>:
  tables = tables + 40;
  i = i + 1;
  <D.17967>:
  if (i < top) goto <D.17966>; else goto <D.17968>;
  <D.17968>:
  D.18607 = 4294967295;
  return D.18607;
}


mono_image_rva_map (struct MonoImage * image, guint32 addr)
{
  unsigned int D.18611;
  unsigned int D.18614;
  unsigned int D.18615;
  void * * D.18618;
  unsigned int i.4;
  unsigned int D.18620;
  void * * D.18621;
  void * D.18622;
  int D.18625;
  char * D.18628;
  unsigned int D.18629;
  struct MonoCLIImageInfo * iinfo;
  const int top;
  struct MonoSectionTable * tables;
  int i;

  iinfo = image->image_info;
  top = iinfo->cli_section_count;
  tables = iinfo->cli_section_tables;
  i = 0;
  goto <D.17978>;
  <D.17977>:
  D.18611 = tables->st_virtual_address;
  if (D.18611 <= addr) goto <D.18612>; else goto <D.18613>;
  <D.18612>:
  D.18611 = tables->st_virtual_address;
  D.18614 = tables->st_raw_data_size;
  D.18615 = D.18611 + D.18614;
  if (D.18615 > addr) goto <D.18616>; else goto <D.18617>;
  <D.18616>:
  D.18618 = iinfo->cli_sections;
  i.4 = (unsigned int) i;
  D.18620 = i.4 * 4;
  D.18621 = D.18618 + D.18620;
  D.18622 = *D.18621;
  if (D.18622 == 0B) goto <D.18623>; else goto <D.18624>;
  <D.18623>:
  D.18625 = mono_image_ensure_section_idx (image, i);
  if (D.18625 == 0) goto <D.18626>; else goto <D.18627>;
  <D.18626>:
  D.18628 = 0B;
  return D.18628;
  <D.18627>:
  <D.18624>:
  D.18618 = iinfo->cli_sections;
  i.4 = (unsigned int) i;
  D.18620 = i.4 * 4;
  D.18621 = D.18618 + D.18620;
  D.18622 = *D.18621;
  D.18611 = tables->st_virtual_address;
  D.18629 = addr - D.18611;
  D.18628 = D.18622 + D.18629;
  return D.18628;
  <D.18617>:
  <D.18613>:
  tables = tables + 40;
  i = i + 1;
  <D.17978>:
  if (i < top) goto <D.17977>; else goto <D.17979>;
  <D.17979>:
  D.18628 = 0B;
  return D.18628;
}


mono_images_init ()
{
  struct GHashTable * loaded_images_hash.5;
  struct GHashTable * loaded_images_refonly_hash.6;
  const gchar * D.18633;
  _Bool D.18634;
  int debug_assembly_unload.7;

  InitializeCriticalSection (&images_mutex);
  loaded_images_hash.5 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  loaded_images_hash = loaded_images_hash.5;
  loaded_images_refonly_hash.6 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  loaded_images_refonly_hash = loaded_images_refonly_hash.6;
  D.18633 = monoeg_g_getenv ("MONO_DEBUG_ASSEMBLY_UNLOAD");
  D.18634 = D.18633 != 0B;
  debug_assembly_unload.7 = (int) D.18634;
  debug_assembly_unload = debug_assembly_unload.7;
  mutex_inited = 1;
}


mono_images_cleanup ()
{
  struct GHashTable * loaded_images_hash.8;
  struct MonoImage * image.9;
  char * D.18638;
  int D.18639;
  struct GHashTable * loaded_images_refonly_hash.10;
  struct GHashTableIter iter;
  struct MonoImage * image;

  try
    {
      DeleteCriticalSection (&images_mutex);
      loaded_images_hash.8 = loaded_images_hash;
      monoeg_g_hash_table_iter_init (&iter, loaded_images_hash.8);
      goto <D.17989>;
      <D.17988>:
      image.9 = image;
      D.18638 = image.9->name;
      mono_trace (64, 1, "Assembly image \'%s\' still loaded at shutdown.", D.18638);
      <D.17989>:
      D.18639 = monoeg_g_hash_table_iter_next (&iter, 0B, &image);
      if (D.18639 != 0) goto <D.17988>; else goto <D.17990>;
      <D.17990>:
      loaded_images_hash.8 = loaded_images_hash;
      monoeg_g_hash_table_destroy (loaded_images_hash.8);
      loaded_images_refonly_hash.10 = loaded_images_refonly_hash;
      monoeg_g_hash_table_destroy (loaded_images_refonly_hash.10);
      mutex_inited = 0;
    }
  finally
    {
      iter = {CLOBBER};
      image = {CLOBBER};
    }
}


mono_image_ensure_section_idx (struct MonoImage * image, int section)
{
  int D.18641;
  int D.18644;
  void * * D.18645;
  unsigned int section.11;
  unsigned int D.18647;
  void * * D.18648;
  void * D.18649;
  struct MonoSectionTable * D.18652;
  unsigned int D.18653;
  unsigned int D.18654;
  int D.18655;
  unsigned int D.18656;
  unsigned int D.18657;
  unsigned int D.18658;
  unsigned int D.18659;
  char * D.18662;
  void * D.18663;
  struct MonoCLIImageInfo * iinfo;
  struct MonoSectionTable * sect;
  gboolean writable;

  iinfo = image->image_info;
  D.18641 = iinfo->cli_section_count;
  if (D.18641 <= section) goto <D.18642>; else goto <D.18643>;
  <D.18642>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 237, "section < iinfo->cli_section_count");
  D.18644 = 0;
  return D.18644;
  <D.18643>:
  D.18645 = iinfo->cli_sections;
  section.11 = (unsigned int) section;
  D.18647 = section.11 * 4;
  D.18648 = D.18645 + D.18647;
  D.18649 = *D.18648;
  if (D.18649 != 0B) goto <D.18650>; else goto <D.18651>;
  <D.18650>:
  D.18644 = 1;
  return D.18644;
  <D.18651>:
  D.18652 = iinfo->cli_section_tables;
  section.11 = (unsigned int) section;
  D.18653 = section.11 * 40;
  sect = D.18652 + D.18653;
  D.18654 = sect->st_flags;
  D.18655 = (int) D.18654;
  writable = D.18655 & -2147483648;
  D.18656 = sect->st_raw_data_ptr;
  D.18657 = sect->st_raw_data_size;
  D.18658 = D.18656 + D.18657;
  D.18659 = image->raw_data_len;
  if (D.18658 > D.18659) goto <D.18660>; else goto <D.18661>;
  <D.18660>:
  D.18644 = 0;
  return D.18644;
  <D.18661>:
  D.18645 = iinfo->cli_sections;
  section.11 = (unsigned int) section;
  D.18647 = section.11 * 4;
  D.18648 = D.18645 + D.18647;
  D.18662 = image->raw_data;
  D.18656 = sect->st_raw_data_ptr;
  D.18663 = D.18662 + D.18656;
  *D.18648 = D.18663;
  D.18644 = 1;
  return D.18644;
}


mono_image_ensure_section (struct MonoImage * image, const char * section)
{
  struct MonoSectionTable * D.18665;
  unsigned int i.12;
  unsigned int D.18667;
  struct MonoSectionTable * D.18668;
  char[8] * D.18669;
  int D.18670;
  int D.18673;
  int D.18674;
  struct MonoCLIImageInfo * ii;
  int i;

  ii = image->image_info;
  i = 0;
  goto <D.18015>;
  <D.18014>:
  D.18665 = ii->cli_section_tables;
  i.12 = (unsigned int) i;
  D.18667 = i.12 * 40;
  D.18668 = D.18665 + D.18667;
  D.18669 = &D.18668->st_name;
  D.18670 = strncmp (D.18669, section, 8);
  if (D.18670 != 0) goto <D.18671>; else goto <D.18672>;
  <D.18671>:
  // predicted unlikely by continue predictor.
  goto <D.18013>;
  <D.18672>:
  D.18673 = mono_image_ensure_section_idx (image, i);
  return D.18673;
  <D.18013>:
  i = i + 1;
  <D.18015>:
  D.18674 = ii->cli_section_count;
  if (D.18674 > i) goto <D.18014>; else goto <D.18016>;
  <D.18016>:
  D.18673 = 0;
  return D.18673;
}


mono_image_check_for_module_cctor (struct MonoImage * image)
{
  unsigned int D.18676;
  unsigned int D.18677;
  <unnamed-unsigned:24> D.18680;
  int D.18681;
  int D.18143;
  int iftmp.13;
  int D.18142;
  const char[9] * D.18687;
  unsigned char D.18688;
  int D.18689;
  unsigned char D.18690;
  int D.18691;
  const unsigned char * D.18696;
  unsigned char D.18697;
  int D.18698;
  const unsigned char * D.18699;
  unsigned char D.18700;
  int D.18701;
  const unsigned char * D.18706;
  unsigned char D.18707;
  int D.18708;
  const unsigned char * D.18709;
  unsigned char D.18710;
  int D.18711;
  const unsigned char * D.18716;
  unsigned char D.18717;
  int D.18718;
  const unsigned char * D.18719;
  unsigned char D.18720;
  int D.18721;
  unsigned int D.18725;
  unsigned int D.18728;
  <unnamed-unsigned:24> D.18730;
  int first_method.14;
  int D.18154;
  int iftmp.15;
  int D.18153;
  const char[7] * D.18735;
  unsigned char D.18736;
  int D.18737;
  unsigned char D.18738;
  int D.18739;
  const unsigned char * D.18744;
  unsigned char D.18745;
  int D.18746;
  const unsigned char * D.18747;
  unsigned char D.18748;
  int D.18749;
  const unsigned char * D.18754;
  unsigned char D.18755;
  int D.18756;
  const unsigned char * D.18757;
  unsigned char D.18758;
  int D.18759;
  const unsigned char * D.18764;
  unsigned char D.18765;
  int D.18766;
  const unsigned char * D.18767;
  unsigned char D.18768;
  int D.18769;
  struct MonoTableInfo * t;
  struct MonoTableInfo * mt;

  t = &image->tables[2];
  mt = &image->tables[6];
  D.18676 = BIT_FIELD_REF <*image, 32, 128>;
  D.18677 = D.18676 & 8;
  if (D.18677 != 0) goto <D.18678>; else goto <D.18679>;
  <D.18678>:
  image->checked_module_cctor = 1;
  return;
  <D.18679>:
  D.18680 = t->rows;
  D.18681 = (int) D.18680;
  if (D.18681 > 0) goto <D.18682>; else goto <D.18683>;
  <D.18682>:
  {
    guint32 nameidx;
    const char * name;

    nameidx = mono_metadata_decode_row_col (t, 0, 1);
    name = mono_metadata_string_heap (image, nameidx);
    {
      size_t __s1_len;
      size_t __s2_len;

      __s2_len = 8;
      if (__s2_len <= 3) goto <D.18685>; else goto <D.18686>;
      <D.18685>:
      {
        const unsigned char * __s2;
        int __result;

        __s2 = name;
        D.18687 = "<Module>";
        D.18688 = MEM[(const unsigned char *)D.18687];
        D.18689 = (int) D.18688;
        D.18690 = *__s2;
        D.18691 = (int) D.18690;
        __result = D.18689 - D.18691;
        {
          if (__s2_len != 0) goto <D.18692>; else goto <D.18693>;
          <D.18692>:
          if (__result == 0) goto <D.18694>; else goto <D.18695>;
          <D.18694>:
          D.18696 = &MEM[(void *)"<Module>" + 1B];
          D.18697 = *D.18696;
          D.18698 = (int) D.18697;
          D.18699 = __s2 + 1;
          D.18700 = *D.18699;
          D.18701 = (int) D.18700;
          __result = D.18698 - D.18701;
          if (__s2_len > 1) goto <D.18702>; else goto <D.18703>;
          <D.18702>:
          if (__result == 0) goto <D.18704>; else goto <D.18705>;
          <D.18704>:
          D.18706 = &MEM[(void *)"<Module>" + 2B];
          D.18707 = *D.18706;
          D.18708 = (int) D.18707;
          D.18709 = __s2 + 2;
          D.18710 = *D.18709;
          D.18711 = (int) D.18710;
          __result = D.18708 - D.18711;
          if (__s2_len > 2) goto <D.18712>; else goto <D.18713>;
          <D.18712>:
          if (__result == 0) goto <D.18714>; else goto <D.18715>;
          <D.18714>:
          D.18716 = &MEM[(void *)"<Module>" + 3B];
          D.18717 = *D.18716;
          D.18718 = (int) D.18717;
          D.18719 = __s2 + 3;
          D.18720 = *D.18719;
          D.18721 = (int) D.18720;
          __result = D.18718 - D.18721;
          <D.18715>:
          <D.18713>:
          <D.18705>:
          <D.18703>:
          <D.18695>:
          <D.18693>:
        }
        D.18142 = __result;
      }
      iftmp.13 = -D.18142;
      goto <D.18722>;
      <D.18686>:
      iftmp.13 = __builtin_strcmp (name, "<Module>");
      <D.18722>:
      D.18143 = iftmp.13;
    }
    if (D.18143 == 0) goto <D.18723>; else goto <D.18724>;
    <D.18723>:
    {
      guint32 first_method;
      guint32 last_method;

      D.18725 = mono_metadata_decode_row_col (t, 0, 5);
      first_method = D.18725 + 4294967295;
      D.18680 = t->rows;
      D.18681 = (int) D.18680;
      if (D.18681 > 1) goto <D.18726>; else goto <D.18727>;
      <D.18726>:
      D.18728 = mono_metadata_decode_row_col (t, 1, 5);
      last_method = D.18728 + 4294967295;
      goto <D.18729>;
      <D.18727>:
      D.18730 = mt->rows;
      last_method = (guint32) D.18730;
      <D.18729>:
      goto <D.18156>;
      <D.18155>:
      first_method.14 = (int) first_method;
      nameidx = mono_metadata_decode_row_col (mt, first_method.14, 3);
      name = mono_metadata_string_heap (image, nameidx);
      {
        size_t __s1_len;
        size_t __s2_len;

        __s2_len = 6;
        if (__s2_len <= 3) goto <D.18733>; else goto <D.18734>;
        <D.18733>:
        {
          const unsigned char * __s2;
          int __result;

          __s2 = name;
          D.18735 = ".cctor";
          D.18736 = MEM[(const unsigned char *)D.18735];
          D.18737 = (int) D.18736;
          D.18738 = *__s2;
          D.18739 = (int) D.18738;
          __result = D.18737 - D.18739;
          {
            if (__s2_len != 0) goto <D.18740>; else goto <D.18741>;
            <D.18740>:
            if (__result == 0) goto <D.18742>; else goto <D.18743>;
            <D.18742>:
            D.18744 = &MEM[(void *)".cctor" + 1B];
            D.18745 = *D.18744;
            D.18746 = (int) D.18745;
            D.18747 = __s2 + 1;
            D.18748 = *D.18747;
            D.18749 = (int) D.18748;
            __result = D.18746 - D.18749;
            if (__s2_len > 1) goto <D.18750>; else goto <D.18751>;
            <D.18750>:
            if (__result == 0) goto <D.18752>; else goto <D.18753>;
            <D.18752>:
            D.18754 = &MEM[(void *)".cctor" + 2B];
            D.18755 = *D.18754;
            D.18756 = (int) D.18755;
            D.18757 = __s2 + 2;
            D.18758 = *D.18757;
            D.18759 = (int) D.18758;
            __result = D.18756 - D.18759;
            if (__s2_len > 2) goto <D.18760>; else goto <D.18761>;
            <D.18760>:
            if (__result == 0) goto <D.18762>; else goto <D.18763>;
            <D.18762>:
            D.18764 = &MEM[(void *)".cctor" + 3B];
            D.18765 = *D.18764;
            D.18766 = (int) D.18765;
            D.18767 = __s2 + 3;
            D.18768 = *D.18767;
            D.18769 = (int) D.18768;
            __result = D.18766 - D.18769;
            <D.18763>:
            <D.18761>:
            <D.18753>:
            <D.18751>:
            <D.18743>:
            <D.18741>:
          }
          D.18153 = __result;
        }
        iftmp.15 = -D.18153;
        goto <D.18770>;
        <D.18734>:
        iftmp.15 = __builtin_strcmp (name, ".cctor");
        <D.18770>:
        D.18154 = iftmp.15;
      }
      if (D.18154 == 0) goto <D.18771>; else goto <D.18772>;
      <D.18771>:
      image->has_module_cctor = 1;
      image->checked_module_cctor = 1;
      return;
      <D.18772>:
      first_method = first_method + 1;
      <D.18156>:
      if (first_method < last_method) goto <D.18155>; else goto <D.18157>;
      <D.18157>:
    }
    <D.18724>:
  }
  <D.18683>:
  image->has_module_cctor = 0;
  image->checked_module_cctor = 1;
}


mono_image_load_module (struct MonoImage * image, int idx)
{
  <unnamed-unsigned:1> D.18774;
  unsigned int D.18777;
  unsigned int idx.16;
  struct MonoImage * D.18781;
  gboolean * D.18782;
  sizetype idx.17;
  sizetype D.18784;
  sizetype D.18785;
  gboolean * D.18786;
  int D.18787;
  struct MonoImage * * D.18790;
  struct MonoImage * * D.18791;
  unsigned int D.18792;
  unsigned int D.18795;
  const char * D.18796;
  <unnamed-unsigned:24> D.18797;
  int D.18798;
  char * D.18799;
  unsigned int D.18800;
  unsigned int D.18801;
  _Bool D.18802;
  int D.18803;
  unsigned int D.18804;
  int D.18191;
  void * D.18805;
  struct MonoImage * D.18810;
  struct MonoImage * D.18811;
  struct MonoAssembly * D.18814;
  struct MonoTableInfo * t;
  struct MonoTableInfo * file_table;
  int i;
  char * base_dir;
  gboolean refonly;
  struct GList * list_iter;
  struct GList * valid_modules;
  MonoImageOpenStatus status;

  try
    {
      D.18774 = image->ref_only;
      refonly = (gboolean) D.18774;
      valid_modules = 0B;
      D.18777 = image->module_count;
      if (D.18777 == 0) goto <D.18775>; else goto <D.18778>;
      <D.18778>:
      idx.16 = (unsigned int) idx;
      D.18777 = image->module_count;
      if (idx.16 > D.18777) goto <D.18775>; else goto <D.18780>;
      <D.18780>:
      if (idx <= 0) goto <D.18775>; else goto <D.18776>;
      <D.18775>:
      D.18781 = 0B;
      return D.18781;
      <D.18776>:
      D.18782 = image->modules_loaded;
      idx.17 = (sizetype) idx;
      D.18784 = idx.17 + 1073741823;
      D.18785 = D.18784 * 4;
      D.18786 = D.18782 + D.18785;
      D.18787 = *D.18786;
      if (D.18787 != 0) goto <D.18788>; else goto <D.18789>;
      <D.18788>:
      D.18790 = image->modules;
      idx.17 = (sizetype) idx;
      D.18784 = idx.17 + 1073741823;
      D.18785 = D.18784 * 4;
      D.18791 = D.18790 + D.18785;
      D.18781 = *D.18791;
      return D.18781;
      <D.18789>:
      file_table = &image->tables[38];
      i = 0;
      goto <D.18177>;
      <D.18176>:
      {
        guint32 cols[3];

        try
          {
            mono_metadata_decode_row (file_table, i, &cols, 3);
            D.18792 = cols[0];
            if (D.18792 == 1) goto <D.18793>; else goto <D.18794>;
            <D.18793>:
            // predicted unlikely by continue predictor.
            goto <D.18175>;
            <D.18794>:
            D.18795 = cols[1];
            D.18796 = mono_metadata_string_heap (image, D.18795);
            valid_modules = monoeg_g_list_prepend (valid_modules, D.18796);
          }
        finally
          {
            cols = {CLOBBER};
          }
      }
      <D.18175>:
      i = i + 1;
      <D.18177>:
      D.18797 = file_table->rows;
      D.18798 = (int) D.18797;
      if (D.18798 > i) goto <D.18176>; else goto <D.18178>;
      <D.18178>:
      t = &image->tables[26];
      D.18799 = image->name;
      base_dir = monoeg_g_path_get_dirname (D.18799);
      {
        char * module_ref;
        const char * name;
        guint32 cols[1];
        int valid;

        try
          {
            D.18800 = BIT_FIELD_REF <*file_table, 32, 32>;
            D.18801 = D.18800 & 16777215;
            D.18802 = D.18801 == 0;
            valid = (int) D.18802;
            D.18803 = idx + -1;
            mono_metadata_decode_row (t, D.18803, &cols, 1);
            D.18804 = cols[0];
            name = mono_metadata_string_heap (image, D.18804);
            list_iter = valid_modules;
            goto <D.18194>;
            <D.18193>:
            {
              size_t __s1_len;
              size_t __s2_len;

              D.18805 = list_iter->data;
              D.18191 = __builtin_strcmp (D.18805, name);
            }
            if (D.18191 == 0) goto <D.18806>; else goto <D.18807>;
            <D.18806>:
            valid = 1;
            goto <D.18192>;
            <D.18807>:
            list_iter = list_iter->next;
            <D.18194>:
            if (list_iter != 0B) goto <D.18193>; else goto <D.18192>;
            <D.18192>:
            if (valid != 0) goto <D.18808>; else goto <D.18809>;
            <D.18808>:
            module_ref = monoeg_g_build_path ("/", base_dir, name, 0B);
            D.18790 = image->modules;
            idx.17 = (sizetype) idx;
            D.18784 = idx.17 + 1073741823;
            D.18785 = D.18784 * 4;
            D.18791 = D.18790 + D.18785;
            D.18810 = mono_image_open_full (module_ref, &status, refonly);
            *D.18791 = D.18810;
            D.18790 = image->modules;
            idx.17 = (sizetype) idx;
            D.18784 = idx.17 + 1073741823;
            D.18785 = D.18784 * 4;
            D.18791 = D.18790 + D.18785;
            D.18811 = *D.18791;
            if (D.18811 != 0B) goto <D.18812>; else goto <D.18813>;
            <D.18812>:
            D.18790 = image->modules;
            idx.17 = (sizetype) idx;
            D.18784 = idx.17 + 1073741823;
            D.18785 = D.18784 * 4;
            D.18791 = D.18790 + D.18785;
            D.18811 = *D.18791;
            mono_image_addref (D.18811);
            D.18790 = image->modules;
            idx.17 = (sizetype) idx;
            D.18784 = idx.17 + 1073741823;
            D.18785 = D.18784 * 4;
            D.18791 = D.18790 + D.18785;
            D.18811 = *D.18791;
            D.18814 = image->assembly;
            D.18811->assembly = D.18814;
            <D.18813>:
            monoeg_g_free (module_ref);
            <D.18809>:
          }
        finally
          {
            cols = {CLOBBER};
          }
      }
      D.18782 = image->modules_loaded;
      idx.17 = (sizetype) idx;
      D.18784 = idx.17 + 1073741823;
      D.18785 = D.18784 * 4;
      D.18786 = D.18782 + D.18785;
      *D.18786 = 1;
      monoeg_g_free (base_dir);
      monoeg_g_list_free (valid_modules);
      D.18790 = image->modules;
      idx.17 = (sizetype) idx;
      D.18784 = idx.17 + 1073741823;
      D.18785 = D.18784 * 4;
      D.18791 = D.18790 + D.18785;
      D.18781 = *D.18791;
      return D.18781;
    }
  finally
    {
      status = {CLOBBER};
    }
}


mono_image_init (struct MonoImage * image)
{
  struct MonoMemPool * D.18819;
  struct MonoInternalHashTable * D.18820;
  struct GHashTable * D.18821;
  struct GHashTable * D.18822;
  struct GHashTable * D.18823;
  struct GHashTable * D.18824;
  struct GHashTable * D.18825;
  struct MonoPropertyHash * D.18826;
  struct CRITICAL_SECTION * D.18827;
  struct CRITICAL_SECTION * D.18828;

  D.18819 = mono_mempool_new_size (512);
  image->mempool = D.18819;
  D.18820 = &image->class_cache;
  mono_internal_hash_table_init (D.18820, monoeg_g_direct_hash, class_key_extract, class_next_value);
  D.18821 = monoeg_g_hash_table_new (0B, 0B);
  image->field_cache = D.18821;
  D.18822 = monoeg_g_hash_table_new (0B, 0B);
  image->typespec_cache = D.18822;
  D.18823 = monoeg_g_hash_table_new (0B, 0B);
  image->memberref_signatures = D.18823;
  D.18824 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  image->helper_signatures = D.18824;
  D.18825 = monoeg_g_hash_table_new (0B, 0B);
  image->method_signatures = D.18825;
  D.18826 = mono_property_hash_new ();
  image->property_hash = D.18826;
  D.18827 = &image->lock;
  InitializeCriticalSection (D.18827);
  D.18828 = &image->szarray_cache_lock;
  InitializeCriticalSection (D.18828);
}


class_next_value (void * value)
{
  void * * D.18829;
  struct MonoClass * class;

  class = value;
  D.18829 = &class->next_class_cache;
  return D.18829;
}


class_key_extract (void * value)
{
  void * D.18831;
  unsigned int D.18832;
  struct MonoClass * class;

  class = value;
  D.18832 = class->type_token;
  D.18831 = (void *) D.18832;
  return D.18831;
}


mono_image_load_pe_data (struct MonoImage * image)
{
  unsigned int offset.18;
  unsigned int D.18835;
  unsigned int D.18836;
  char * D.18838;
  sizetype offset.19;
  char * D.18840;
  signed int D.18841;
  unsigned int D.18842;
  unsigned int D.18843;
  unsigned int D.18845;
  unsigned int offset.20;
  int D.18848;
  gboolean D.18850;
  struct MonoCLIImageInfo * iinfo;
  struct MonoDotNetHeader * header;
  struct MonoMSDOSHeader msdos;
  gint32 offset;
  void invalid_image = <<< error >>>;

  try
    {
      offset = 0;
      iinfo = image->image_info;
      header = &iinfo->cli_header;
      offset.18 = (unsigned int) offset;
      D.18835 = offset.18 + 128;
      D.18836 = image->raw_data_len;
      if (D.18835 > D.18836) goto invalid_image; else goto <D.18837>;
      <D.18837>:
      D.18838 = image->raw_data;
      offset.19 = (sizetype) offset;
      D.18840 = D.18838 + offset.19;
      memcpy (&msdos, D.18840, 128);
      D.18841 = BIT_FIELD_REF <msdos, 32, 0>;
      D.18842 = (unsigned int) D.18841;
      D.18843 = D.18842 & 65535;
      if (D.18843 != 23117) goto invalid_image; else goto <D.18844>;
      <D.18844>:
      D.18845 = msdos.pe_offset;
      msdos.pe_offset = D.18845;
      D.18845 = msdos.pe_offset;
      offset = (gint32) D.18845;
      offset = do_load_header (image, header, offset);
      if (offset < 0) goto invalid_image; else goto <D.18846>;
      <D.18846>:
      offset.20 = (unsigned int) offset;
      D.18848 = load_section_tables (image, iinfo, offset.20);
      if (D.18848 == 0) goto invalid_image; else goto <D.18849>;
      <D.18849>:
      D.18850 = 1;
      return D.18850;
      invalid_image:
      D.18850 = 0;
      return D.18850;
    }
  finally
    {
      msdos = {CLOBBER};
    }
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.18853;
  unsigned int D.18854;

  D.18854 = __builtin_object_size (__dest, 0);
  D.18853 = __builtin___memcpy_chk (__dest, __src, __len, D.18854);
  return D.18853;
}


do_load_header (struct MonoImage * image, struct MonoDotNetHeader * header, int offset)
{
  unsigned int offset.21;
  unsigned int D.18857;
  unsigned int D.18858;
  int D.18861;
  char * D.18862;
  sizetype offset.22;
  char * D.18864;
  signed int D.18865;
  unsigned int D.18866;
  unsigned int D.18867;
  short unsigned int D.18870;
  short unsigned int D.18873;
  unsigned int D.18881;
  long long unsigned int D.18882;
  unsigned int D.18883;
  long long unsigned int D.18884;
  unsigned int D.18885;
  long long unsigned int D.18886;
  unsigned int D.18887;
  long long unsigned int D.18888;
  unsigned int D.18889;
  long long unsigned int D.18890;
  unsigned int D.18891;
  unsigned int D.18892;
  unsigned int D.18893;
  short unsigned int D.18894;
  short unsigned int D.18895;
  short unsigned int D.18896;
  short unsigned int D.18897;
  short unsigned int D.18898;
  short unsigned int D.18899;
  unsigned int D.18900;
  unsigned int D.18901;
  unsigned int D.18902;
  unsigned int D.18903;
  short unsigned int D.18904;
  short unsigned int D.18905;
  unsigned int D.18906;
  unsigned int D.18907;
  struct MonoPEDatadir * D.18908;
  struct MonoDotNetHeader64 header64;

  try
    {
      offset.21 = (unsigned int) offset;
      D.18857 = offset.21 + 248;
      D.18858 = image->raw_data_len;
      if (D.18857 > D.18858) goto <D.18859>; else goto <D.18860>;
      <D.18859>:
      D.18861 = -1;
      return D.18861;
      <D.18860>:
      D.18862 = image->raw_data;
      offset.22 = (sizetype) offset;
      D.18864 = D.18862 + offset.22;
      memcpy (header, D.18864, 248);
      D.18865 = BIT_FIELD_REF <*header, 32, 0>;
      D.18866 = (unsigned int) D.18865;
      D.18867 = D.18866 & 65535;
      if (D.18867 != 17744) goto <D.18868>; else goto <D.18869>;
      <D.18868>:
      D.18861 = -1;
      return D.18861;
      <D.18869>:
      D.18870 = header->pe.pe_magic;
      if (D.18870 == 267) goto <D.18871>; else goto <D.18872>;
      <D.18871>:
      offset.21 = (unsigned int) offset;
      D.18857 = offset.21 + 248;
      offset = (int) D.18857;
      D.18873 = header->coff.coff_opt_header_size;
      if (D.18873 != 224) goto <D.18874>; else goto <D.18875>;
      <D.18874>:
      D.18861 = -1;
      return D.18861;
      <D.18875>:
      goto <D.18876>;
      <D.18872>:
      D.18870 = header->pe.pe_magic;
      if (D.18870 == 523) goto <D.18877>; else goto <D.18878>;
      <D.18877>:
      D.18873 = header->coff.coff_opt_header_size;
      if (D.18873 != 240) goto <D.18879>; else goto <D.18880>;
      <D.18879>:
      D.18861 = -1;
      return D.18861;
      <D.18880>:
      D.18862 = image->raw_data;
      offset.22 = (sizetype) offset;
      D.18864 = D.18862 + offset.22;
      memcpy (&header64, D.18864, 264);
      offset.21 = (unsigned int) offset;
      D.18881 = offset.21 + 264;
      offset = (int) D.18881;
      memcpy (&header64, header, 244);
      D.18882 = header64.nt.pe_image_base;
      D.18883 = (unsigned int) D.18882;
      header->nt.pe_image_base = D.18883;
      D.18884 = header64.nt.pe_stack_reserve;
      D.18885 = (unsigned int) D.18884;
      header->nt.pe_stack_reserve = D.18885;
      D.18886 = header64.nt.pe_stack_commit;
      D.18887 = (unsigned int) D.18886;
      header->nt.pe_stack_commit = D.18887;
      D.18888 = header64.nt.pe_heap_reserve;
      D.18889 = (unsigned int) D.18888;
      header->nt.pe_heap_reserve = D.18889;
      D.18890 = header64.nt.pe_heap_commit;
      D.18891 = (unsigned int) D.18890;
      header->nt.pe_heap_commit = D.18891;
      D.18892 = header64.nt.pe_section_align;
      header->nt.pe_section_align = D.18892;
      D.18893 = header64.nt.pe_file_alignment;
      header->nt.pe_file_alignment = D.18893;
      D.18894 = header64.nt.pe_os_major;
      header->nt.pe_os_major = D.18894;
      D.18895 = header64.nt.pe_os_minor;
      header->nt.pe_os_minor = D.18895;
      D.18896 = header64.nt.pe_user_major;
      header->nt.pe_user_major = D.18896;
      D.18897 = header64.nt.pe_user_minor;
      header->nt.pe_user_minor = D.18897;
      D.18898 = header64.nt.pe_subsys_major;
      header->nt.pe_subsys_major = D.18898;
      D.18899 = header64.nt.pe_subsys_minor;
      header->nt.pe_subsys_minor = D.18899;
      D.18900 = header64.nt.pe_reserved_1;
      header->nt.pe_reserved_1 = D.18900;
      D.18901 = header64.nt.pe_image_size;
      header->nt.pe_image_size = D.18901;
      D.18902 = header64.nt.pe_header_size;
      header->nt.pe_header_size = D.18902;
      D.18903 = header64.nt.pe_checksum;
      header->nt.pe_checksum = D.18903;
      D.18904 = header64.nt.pe_subsys_required;
      header->nt.pe_subsys_required = D.18904;
      D.18905 = header64.nt.pe_dll_flags;
      header->nt.pe_dll_flags = D.18905;
      D.18906 = header64.nt.pe_loader_flags;
      header->nt.pe_loader_flags = D.18906;
      D.18907 = header64.nt.pe_data_dir_count;
      header->nt.pe_data_dir_count = D.18907;
      D.18908 = &header->datadir;
      memcpy (D.18908, &header64.datadir, 128);
      goto <D.18909>;
      <D.18878>:
      D.18861 = -1;
      return D.18861;
      <D.18909>:
      <D.18876>:
      D.18861 = offset;
      return D.18861;
    }
  finally
    {
      header64 = {CLOBBER};
    }
}


load_section_tables (struct MonoImage * image, struct MonoCLIImageInfo * iinfo, guint32 offset)
{
  short unsigned int D.18912;
  unsigned int top.23;
  unsigned int D.18914;
  void * D.18915;
  unsigned int D.18916;
  void * D.18917;
  struct MonoSectionTable * D.18918;
  unsigned int i.24;
  unsigned int D.18920;
  unsigned int D.18921;
  unsigned int D.18922;
  int D.18925;
  char * D.18926;
  char * D.18927;
  const int top;
  int i;

  D.18912 = iinfo->cli_header.coff.coff_sections;
  top = (const int) D.18912;
  iinfo->cli_section_count = top;
  top.23 = (unsigned int) top;
  D.18914 = top.23 * 40;
  D.18915 = monoeg_malloc0 (D.18914);
  iinfo->cli_section_tables = D.18915;
  top.23 = (unsigned int) top;
  D.18916 = top.23 * 4;
  D.18917 = monoeg_malloc0 (D.18916);
  iinfo->cli_sections = D.18917;
  i = 0;
  goto <D.18026>;
  <D.18025>:
  {
    struct MonoSectionTable * t;

    D.18918 = iinfo->cli_section_tables;
    i.24 = (unsigned int) i;
    D.18920 = i.24 * 40;
    t = D.18918 + D.18920;
    D.18921 = offset + 40;
    D.18922 = image->raw_data_len;
    if (D.18921 > D.18922) goto <D.18923>; else goto <D.18924>;
    <D.18923>:
    D.18925 = 0;
    return D.18925;
    <D.18924>:
    D.18926 = image->raw_data;
    D.18927 = D.18926 + offset;
    memcpy (t, D.18927, 40);
    offset = offset + 40;
  }
  i = i + 1;
  <D.18026>:
  if (i < top) goto <D.18025>; else goto <D.18027>;
  <D.18027>:
  D.18925 = 1;
  return D.18925;
}


mono_image_load_cli_data (struct MonoImage * image)
{
  int D.18929;
  gboolean D.18932;
  int D.18933;
  struct MonoCLIImageInfo * iinfo;
  struct MonoDotNetHeader * header;

  iinfo = image->image_info;
  header = &iinfo->cli_header;
  D.18929 = load_cli_header (image, iinfo);
  if (D.18929 == 0) goto <D.18930>; else goto <D.18931>;
  <D.18930>:
  D.18932 = 0;
  return D.18932;
  <D.18931>:
  D.18933 = load_metadata (image, iinfo);
  if (D.18933 == 0) goto <D.18934>; else goto <D.18935>;
  <D.18934>:
  D.18932 = 0;
  return D.18932;
  <D.18935>:
  D.18932 = 1;
  return D.18932;
}


load_cli_header (struct MonoImage * image, struct MonoCLIImageInfo * iinfo)
{
  unsigned int D.18937;
  gboolean D.18940;
  unsigned int D.18941;
  unsigned int D.18942;
  struct MonoCLIHeader * D.18945;
  char * D.18946;
  char * D.18947;
  unsigned int D.18948;
  unsigned int D.18951;
  unsigned int D.18954;
  unsigned int D.18957;
  unsigned int D.18960;
  unsigned int D.18963;
  unsigned int D.18966;
  unsigned int D.18969;
  unsigned int D.18972;
  guint32 offset;

  D.18937 = iinfo->cli_header.datadir.pe_cli_header.rva;
  offset = mono_cli_rva_image_map (image, D.18937);
  if (offset == 4294967295) goto <D.18938>; else goto <D.18939>;
  <D.18938>:
  D.18940 = 0;
  return D.18940;
  <D.18939>:
  D.18941 = offset + 136;
  D.18942 = image->raw_data_len;
  if (D.18941 > D.18942) goto <D.18943>; else goto <D.18944>;
  <D.18943>:
  D.18940 = 0;
  return D.18940;
  <D.18944>:
  D.18945 = &iinfo->cli_cli_header;
  D.18946 = image->raw_data;
  D.18947 = D.18946 + offset;
  memcpy (D.18945, D.18947, 136);
  D.18948 = iinfo->cli_cli_header.ch_eeinfo_table.rva;
  if (D.18948 != 0) goto <D.18949>; else goto <D.18950>;
  <D.18950>:
  D.18951 = iinfo->cli_cli_header.ch_helper_table.rva;
  if (D.18951 != 0) goto <D.18952>; else goto <D.18953>;
  <D.18953>:
  D.18954 = iinfo->cli_cli_header.ch_dynamic_info.rva;
  if (D.18954 != 0) goto <D.18955>; else goto <D.18956>;
  <D.18956>:
  D.18957 = iinfo->cli_cli_header.ch_delay_load_info.rva;
  if (D.18957 != 0) goto <D.18958>; else goto <D.18959>;
  <D.18959>:
  D.18960 = iinfo->cli_cli_header.ch_module_image.rva;
  if (D.18960 != 0) goto <D.18961>; else goto <D.18962>;
  <D.18962>:
  D.18963 = iinfo->cli_cli_header.ch_external_fixups.rva;
  if (D.18963 != 0) goto <D.18964>; else goto <D.18965>;
  <D.18965>:
  D.18966 = iinfo->cli_cli_header.ch_ridmap.rva;
  if (D.18966 != 0) goto <D.18967>; else goto <D.18968>;
  <D.18968>:
  D.18969 = iinfo->cli_cli_header.ch_debug_map.rva;
  if (D.18969 != 0) goto <D.18970>; else goto <D.18971>;
  <D.18971>:
  D.18972 = iinfo->cli_cli_header.ch_ip_map.rva;
  if (D.18972 != 0) goto <D.18973>; else goto <D.18974>;
  <D.18973>:
  <D.18974>:
  <D.18970>:
  <D.18967>:
  <D.18964>:
  <D.18961>:
  <D.18958>:
  <D.18955>:
  <D.18952>:
  <D.18949>:
  D.18940 = 1;
  return D.18940;
}


load_metadata (struct MonoImage * image, struct MonoCLIImageInfo * iinfo)
{
  int D.18976;
  gboolean D.18979;

  D.18976 = load_metadata_ptrs (image, iinfo);
  if (D.18976 == 0) goto <D.18977>; else goto <D.18978>;
  <D.18977>:
  D.18979 = 0;
  return D.18979;
  <D.18978>:
  D.18979 = load_tables (image);
  return D.18979;
}


load_metadata_ptrs (struct MonoImage * image, struct MonoCLIImageInfo * iinfo)
{
  unsigned int D.18981;
  gboolean D.18984;
  unsigned int D.18985;
  unsigned int D.18986;
  char * D.18989;
  char * D.18990;
  int D.18991;
  short unsigned int D.18994;
  short int D.18995;
  short unsigned int D.18996;
  short int D.18997;
  gchar * D.18998;
  int ptr.25;
  char * D.19000;
  int D.19001;
  int D.19002;
  unsigned int D.19003;
  unsigned int D.19006;
  int D.18061;
  int iftmp.26;
  int D.18060;
  const char[3] * D.19011;
  unsigned char D.19012;
  int D.19013;
  unsigned char D.19014;
  int D.19015;
  const unsigned char * D.19020;
  unsigned char D.19021;
  int D.19022;
  const unsigned char * D.19023;
  unsigned char D.19024;
  int D.19025;
  const unsigned char * D.19030;
  unsigned char D.19031;
  int D.19032;
  const unsigned char * D.19033;
  unsigned char D.19034;
  int D.19035;
  const unsigned char * D.19040;
  unsigned char D.19041;
  int D.19042;
  const unsigned char * D.19043;
  unsigned char D.19044;
  int D.19045;
  const char * D.19047;
  unsigned int D.19050;
  const char * D.19051;
  const unsigned char * D.19052;
  unsigned int D.19053;
  int D.18070;
  int iftmp.27;
  int D.18069;
  const char[9] * D.19058;
  unsigned char D.19059;
  int D.19060;
  unsigned char D.19061;
  int D.19062;
  const unsigned char * D.19067;
  unsigned char D.19068;
  int D.19069;
  const unsigned char * D.19070;
  unsigned char D.19071;
  int D.19072;
  const unsigned char * D.19077;
  unsigned char D.19078;
  int D.19079;
  const unsigned char * D.19080;
  unsigned char D.19081;
  int D.19082;
  const unsigned char * D.19087;
  unsigned char D.19088;
  int D.19089;
  const unsigned char * D.19090;
  unsigned char D.19091;
  int D.19092;
  unsigned int D.19096;
  const char * D.19097;
  unsigned int D.19098;
  int D.18079;
  int iftmp.28;
  int D.18078;
  const char[4] * D.19103;
  unsigned char D.19104;
  int D.19105;
  unsigned char D.19106;
  int D.19107;
  const unsigned char * D.19112;
  unsigned char D.19113;
  int D.19114;
  const unsigned char * D.19115;
  unsigned char D.19116;
  int D.19117;
  const unsigned char * D.19122;
  unsigned char D.19123;
  int D.19124;
  const unsigned char * D.19125;
  unsigned char D.19126;
  int D.19127;
  const unsigned char * D.19132;
  unsigned char D.19133;
  int D.19134;
  const unsigned char * D.19135;
  unsigned char D.19136;
  int D.19137;
  unsigned int D.19141;
  const char * D.19142;
  unsigned int D.19143;
  int D.18088;
  int iftmp.29;
  int D.18087;
  const char[6] * D.19148;
  unsigned char D.19149;
  int D.19150;
  unsigned char D.19151;
  int D.19152;
  const unsigned char * D.19157;
  unsigned char D.19158;
  int D.19159;
  const unsigned char * D.19160;
  unsigned char D.19161;
  int D.19162;
  const unsigned char * D.19167;
  unsigned char D.19168;
  int D.19169;
  const unsigned char * D.19170;
  unsigned char D.19171;
  int D.19172;
  const unsigned char * D.19177;
  unsigned char D.19178;
  int D.19179;
  const unsigned char * D.19180;
  unsigned char D.19181;
  int D.19182;
  unsigned int D.19186;
  const char * D.19187;
  unsigned int D.19188;
  int D.18097;
  int iftmp.30;
  int D.18096;
  const char[6] * D.19193;
  unsigned char D.19194;
  int D.19195;
  unsigned char D.19196;
  int D.19197;
  const unsigned char * D.19202;
  unsigned char D.19203;
  int D.19204;
  const unsigned char * D.19205;
  unsigned char D.19206;
  int D.19207;
  const unsigned char * D.19212;
  unsigned char D.19213;
  int D.19214;
  const unsigned char * D.19215;
  unsigned char D.19216;
  int D.19217;
  const unsigned char * D.19222;
  unsigned char D.19223;
  int D.19224;
  const unsigned char * D.19225;
  unsigned char D.19226;
  int D.19227;
  unsigned int D.19231;
  const char * D.19232;
  unsigned int D.19233;
  int D.18106;
  int iftmp.31;
  int D.18105;
  const char[3] * D.19238;
  unsigned char D.19239;
  int D.19240;
  unsigned char D.19241;
  int D.19242;
  const unsigned char * D.19247;
  unsigned char D.19248;
  int D.19249;
  const unsigned char * D.19250;
  unsigned char D.19251;
  int D.19252;
  const unsigned char * D.19257;
  unsigned char D.19258;
  int D.19259;
  const unsigned char * D.19260;
  unsigned char D.19261;
  int D.19262;
  const unsigned char * D.19267;
  unsigned char D.19268;
  int D.19269;
  const unsigned char * D.19270;
  unsigned char D.19271;
  int D.19272;
  unsigned int D.19276;
  const char * D.19277;
  unsigned int D.19278;
  char * D.19279;
  char * D.19281;
  unsigned int D.19282;
  sizetype D.19283;
  int D.19286;
  const char * D.19287;
  _Bool D.19288;
  long int D.19289;
  long int D.19290;
  unsigned int D.19293;
  _Bool D.19294;
  long int D.19295;
  long int D.19296;
  char * D.19299;
  guint32 offset;
  guint32 size;
  guint16 streams;
  int i;
  guint32 pad;
  char * ptr;

  D.18981 = iinfo->cli_cli_header.ch_metadata.rva;
  offset = mono_cli_rva_image_map (image, D.18981);
  if (offset == 4294967295) goto <D.18982>; else goto <D.18983>;
  <D.18982>:
  D.18984 = 0;
  return D.18984;
  <D.18983>:
  size = iinfo->cli_cli_header.ch_metadata.size;
  D.18985 = offset + size;
  D.18986 = image->raw_data_len;
  if (D.18985 > D.18986) goto <D.18987>; else goto <D.18988>;
  <D.18987>:
  D.18984 = 0;
  return D.18984;
  <D.18988>:
  D.18989 = image->raw_data;
  D.18990 = D.18989 + offset;
  image->raw_metadata = D.18990;
  ptr = image->raw_metadata;
  D.18991 = strncmp (ptr, "BSJB", 4);
  if (D.18991 == 0) goto <D.18992>; else goto <D.18993>;
  <D.18992>:
  {
    guint32 version_string_len;

    ptr = ptr + 4;
    D.18994 = mono_read16 (ptr);
    D.18995 = (short int) D.18994;
    image->md_version_major = D.18995;
    ptr = ptr + 2;
    D.18996 = mono_read16 (ptr);
    D.18997 = (short int) D.18996;
    image->md_version_minor = D.18997;
    ptr = ptr + 6;
    version_string_len = mono_read32 (ptr);
    ptr = ptr + 4;
    D.18998 = monoeg_g_strndup (ptr, version_string_len);
    image->version = D.18998;
    ptr = ptr + version_string_len;
    ptr.25 = (int) ptr;
    D.19000 = image->raw_metadata;
    D.19001 = (int) D.19000;
    D.19002 = ptr.25 - D.19001;
    pad = (guint32) D.19002;
    D.19003 = pad & 3;
    if (D.19003 != 0) goto <D.19004>; else goto <D.19005>;
    <D.19004>:
    D.19003 = pad & 3;
    D.19006 = 4 - D.19003;
    ptr = ptr + D.19006;
    <D.19005>:
  }
  goto <D.19007>;
  <D.18993>:
  D.18984 = 0;
  return D.18984;
  <D.19007>:
  ptr = ptr + 2;
  streams = mono_read16 (ptr);
  ptr = ptr + 2;
  i = 0;
  goto <D.18108>;
  <D.18107>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 2;
    if (__s2_len <= 3) goto <D.19009>; else goto <D.19010>;
    <D.19009>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19011 = "#~";
      D.19012 = MEM[(const unsigned char *)D.19011];
      D.19013 = (int) D.19012;
      D.19014 = *__s2;
      D.19015 = (int) D.19014;
      __result = D.19013 - D.19015;
      {
        if (__s2_len != 0) goto <D.19016>; else goto <D.19017>;
        <D.19016>:
        if (__result == 0) goto <D.19018>; else goto <D.19019>;
        <D.19018>:
        D.19020 = &MEM[(void *)"#~" + 1B];
        D.19021 = *D.19020;
        D.19022 = (int) D.19021;
        D.19023 = __s2 + 1;
        D.19024 = *D.19023;
        D.19025 = (int) D.19024;
        __result = D.19022 - D.19025;
        if (__s2_len > 1) goto <D.19026>; else goto <D.19027>;
        <D.19026>:
        if (__result == 0) goto <D.19028>; else goto <D.19029>;
        <D.19028>:
        D.19030 = &MEM[(void *)"#~" + 2B];
        D.19031 = *D.19030;
        D.19032 = (int) D.19031;
        D.19033 = __s2 + 2;
        D.19034 = *D.19033;
        D.19035 = (int) D.19034;
        __result = D.19032 - D.19035;
        if (__s2_len > 2) goto <D.19036>; else goto <D.19037>;
        <D.19036>:
        if (__result == 0) goto <D.19038>; else goto <D.19039>;
        <D.19038>:
        D.19040 = &MEM[(void *)"#~" + 3B];
        D.19041 = *D.19040;
        D.19042 = (int) D.19041;
        D.19043 = __s2 + 3;
        D.19044 = *D.19043;
        D.19045 = (int) D.19044;
        __result = D.19042 - D.19045;
        <D.19039>:
        <D.19037>:
        <D.19029>:
        <D.19027>:
        <D.19019>:
        <D.19017>:
      }
      D.18060 = __result;
    }
    iftmp.26 = -D.18060;
    goto <D.19046>;
    <D.19010>:
    D.19047 = ptr + 8;
    iftmp.26 = __builtin_strcmp (D.19047, "#~");
    <D.19046>:
    D.18061 = iftmp.26;
  }
  if (D.18061 == 0) goto <D.19048>; else goto <D.19049>;
  <D.19048>:
  D.19000 = image->raw_metadata;
  D.19050 = mono_read32 (ptr);
  D.19051 = D.19000 + D.19050;
  image->heap_tables.data = D.19051;
  D.19052 = ptr + 4;
  D.19053 = mono_read32 (D.19052);
  image->heap_tables.size = D.19053;
  ptr = ptr + 11;
  goto <D.19054>;
  <D.19049>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 8;
    if (__s2_len <= 3) goto <D.19056>; else goto <D.19057>;
    <D.19056>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19058 = "#Strings";
      D.19059 = MEM[(const unsigned char *)D.19058];
      D.19060 = (int) D.19059;
      D.19061 = *__s2;
      D.19062 = (int) D.19061;
      __result = D.19060 - D.19062;
      {
        if (__s2_len != 0) goto <D.19063>; else goto <D.19064>;
        <D.19063>:
        if (__result == 0) goto <D.19065>; else goto <D.19066>;
        <D.19065>:
        D.19067 = &MEM[(void *)"#Strings" + 1B];
        D.19068 = *D.19067;
        D.19069 = (int) D.19068;
        D.19070 = __s2 + 1;
        D.19071 = *D.19070;
        D.19072 = (int) D.19071;
        __result = D.19069 - D.19072;
        if (__s2_len > 1) goto <D.19073>; else goto <D.19074>;
        <D.19073>:
        if (__result == 0) goto <D.19075>; else goto <D.19076>;
        <D.19075>:
        D.19077 = &MEM[(void *)"#Strings" + 2B];
        D.19078 = *D.19077;
        D.19079 = (int) D.19078;
        D.19080 = __s2 + 2;
        D.19081 = *D.19080;
        D.19082 = (int) D.19081;
        __result = D.19079 - D.19082;
        if (__s2_len > 2) goto <D.19083>; else goto <D.19084>;
        <D.19083>:
        if (__result == 0) goto <D.19085>; else goto <D.19086>;
        <D.19085>:
        D.19087 = &MEM[(void *)"#Strings" + 3B];
        D.19088 = *D.19087;
        D.19089 = (int) D.19088;
        D.19090 = __s2 + 3;
        D.19091 = *D.19090;
        D.19092 = (int) D.19091;
        __result = D.19089 - D.19092;
        <D.19086>:
        <D.19084>:
        <D.19076>:
        <D.19074>:
        <D.19066>:
        <D.19064>:
      }
      D.18069 = __result;
    }
    iftmp.27 = -D.18069;
    goto <D.19093>;
    <D.19057>:
    D.19047 = ptr + 8;
    iftmp.27 = __builtin_strcmp (D.19047, "#Strings");
    <D.19093>:
    D.18070 = iftmp.27;
  }
  if (D.18070 == 0) goto <D.19094>; else goto <D.19095>;
  <D.19094>:
  D.19000 = image->raw_metadata;
  D.19096 = mono_read32 (ptr);
  D.19097 = D.19000 + D.19096;
  image->heap_strings.data = D.19097;
  D.19052 = ptr + 4;
  D.19098 = mono_read32 (D.19052);
  image->heap_strings.size = D.19098;
  ptr = ptr + 17;
  goto <D.19099>;
  <D.19095>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 3;
    if (__s2_len <= 3) goto <D.19101>; else goto <D.19102>;
    <D.19101>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19103 = "#US";
      D.19104 = MEM[(const unsigned char *)D.19103];
      D.19105 = (int) D.19104;
      D.19106 = *__s2;
      D.19107 = (int) D.19106;
      __result = D.19105 - D.19107;
      {
        if (__s2_len != 0) goto <D.19108>; else goto <D.19109>;
        <D.19108>:
        if (__result == 0) goto <D.19110>; else goto <D.19111>;
        <D.19110>:
        D.19112 = &MEM[(void *)"#US" + 1B];
        D.19113 = *D.19112;
        D.19114 = (int) D.19113;
        D.19115 = __s2 + 1;
        D.19116 = *D.19115;
        D.19117 = (int) D.19116;
        __result = D.19114 - D.19117;
        if (__s2_len > 1) goto <D.19118>; else goto <D.19119>;
        <D.19118>:
        if (__result == 0) goto <D.19120>; else goto <D.19121>;
        <D.19120>:
        D.19122 = &MEM[(void *)"#US" + 2B];
        D.19123 = *D.19122;
        D.19124 = (int) D.19123;
        D.19125 = __s2 + 2;
        D.19126 = *D.19125;
        D.19127 = (int) D.19126;
        __result = D.19124 - D.19127;
        if (__s2_len > 2) goto <D.19128>; else goto <D.19129>;
        <D.19128>:
        if (__result == 0) goto <D.19130>; else goto <D.19131>;
        <D.19130>:
        D.19132 = &MEM[(void *)"#US" + 3B];
        D.19133 = *D.19132;
        D.19134 = (int) D.19133;
        D.19135 = __s2 + 3;
        D.19136 = *D.19135;
        D.19137 = (int) D.19136;
        __result = D.19134 - D.19137;
        <D.19131>:
        <D.19129>:
        <D.19121>:
        <D.19119>:
        <D.19111>:
        <D.19109>:
      }
      D.18078 = __result;
    }
    iftmp.28 = -D.18078;
    goto <D.19138>;
    <D.19102>:
    D.19047 = ptr + 8;
    iftmp.28 = __builtin_strcmp (D.19047, "#US");
    <D.19138>:
    D.18079 = iftmp.28;
  }
  if (D.18079 == 0) goto <D.19139>; else goto <D.19140>;
  <D.19139>:
  D.19000 = image->raw_metadata;
  D.19141 = mono_read32 (ptr);
  D.19142 = D.19000 + D.19141;
  image->heap_us.data = D.19142;
  D.19052 = ptr + 4;
  D.19143 = mono_read32 (D.19052);
  image->heap_us.size = D.19143;
  ptr = ptr + 12;
  goto <D.19144>;
  <D.19140>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.19146>; else goto <D.19147>;
    <D.19146>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19148 = "#Blob";
      D.19149 = MEM[(const unsigned char *)D.19148];
      D.19150 = (int) D.19149;
      D.19151 = *__s2;
      D.19152 = (int) D.19151;
      __result = D.19150 - D.19152;
      {
        if (__s2_len != 0) goto <D.19153>; else goto <D.19154>;
        <D.19153>:
        if (__result == 0) goto <D.19155>; else goto <D.19156>;
        <D.19155>:
        D.19157 = &MEM[(void *)"#Blob" + 1B];
        D.19158 = *D.19157;
        D.19159 = (int) D.19158;
        D.19160 = __s2 + 1;
        D.19161 = *D.19160;
        D.19162 = (int) D.19161;
        __result = D.19159 - D.19162;
        if (__s2_len > 1) goto <D.19163>; else goto <D.19164>;
        <D.19163>:
        if (__result == 0) goto <D.19165>; else goto <D.19166>;
        <D.19165>:
        D.19167 = &MEM[(void *)"#Blob" + 2B];
        D.19168 = *D.19167;
        D.19169 = (int) D.19168;
        D.19170 = __s2 + 2;
        D.19171 = *D.19170;
        D.19172 = (int) D.19171;
        __result = D.19169 - D.19172;
        if (__s2_len > 2) goto <D.19173>; else goto <D.19174>;
        <D.19173>:
        if (__result == 0) goto <D.19175>; else goto <D.19176>;
        <D.19175>:
        D.19177 = &MEM[(void *)"#Blob" + 3B];
        D.19178 = *D.19177;
        D.19179 = (int) D.19178;
        D.19180 = __s2 + 3;
        D.19181 = *D.19180;
        D.19182 = (int) D.19181;
        __result = D.19179 - D.19182;
        <D.19176>:
        <D.19174>:
        <D.19166>:
        <D.19164>:
        <D.19156>:
        <D.19154>:
      }
      D.18087 = __result;
    }
    iftmp.29 = -D.18087;
    goto <D.19183>;
    <D.19147>:
    D.19047 = ptr + 8;
    iftmp.29 = __builtin_strcmp (D.19047, "#Blob");
    <D.19183>:
    D.18088 = iftmp.29;
  }
  if (D.18088 == 0) goto <D.19184>; else goto <D.19185>;
  <D.19184>:
  D.19000 = image->raw_metadata;
  D.19186 = mono_read32 (ptr);
  D.19187 = D.19000 + D.19186;
  image->heap_blob.data = D.19187;
  D.19052 = ptr + 4;
  D.19188 = mono_read32 (D.19052);
  image->heap_blob.size = D.19188;
  ptr = ptr + 14;
  goto <D.19189>;
  <D.19185>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.19191>; else goto <D.19192>;
    <D.19191>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19193 = "#GUID";
      D.19194 = MEM[(const unsigned char *)D.19193];
      D.19195 = (int) D.19194;
      D.19196 = *__s2;
      D.19197 = (int) D.19196;
      __result = D.19195 - D.19197;
      {
        if (__s2_len != 0) goto <D.19198>; else goto <D.19199>;
        <D.19198>:
        if (__result == 0) goto <D.19200>; else goto <D.19201>;
        <D.19200>:
        D.19202 = &MEM[(void *)"#GUID" + 1B];
        D.19203 = *D.19202;
        D.19204 = (int) D.19203;
        D.19205 = __s2 + 1;
        D.19206 = *D.19205;
        D.19207 = (int) D.19206;
        __result = D.19204 - D.19207;
        if (__s2_len > 1) goto <D.19208>; else goto <D.19209>;
        <D.19208>:
        if (__result == 0) goto <D.19210>; else goto <D.19211>;
        <D.19210>:
        D.19212 = &MEM[(void *)"#GUID" + 2B];
        D.19213 = *D.19212;
        D.19214 = (int) D.19213;
        D.19215 = __s2 + 2;
        D.19216 = *D.19215;
        D.19217 = (int) D.19216;
        __result = D.19214 - D.19217;
        if (__s2_len > 2) goto <D.19218>; else goto <D.19219>;
        <D.19218>:
        if (__result == 0) goto <D.19220>; else goto <D.19221>;
        <D.19220>:
        D.19222 = &MEM[(void *)"#GUID" + 3B];
        D.19223 = *D.19222;
        D.19224 = (int) D.19223;
        D.19225 = __s2 + 3;
        D.19226 = *D.19225;
        D.19227 = (int) D.19226;
        __result = D.19224 - D.19227;
        <D.19221>:
        <D.19219>:
        <D.19211>:
        <D.19209>:
        <D.19201>:
        <D.19199>:
      }
      D.18096 = __result;
    }
    iftmp.30 = -D.18096;
    goto <D.19228>;
    <D.19192>:
    D.19047 = ptr + 8;
    iftmp.30 = __builtin_strcmp (D.19047, "#GUID");
    <D.19228>:
    D.18097 = iftmp.30;
  }
  if (D.18097 == 0) goto <D.19229>; else goto <D.19230>;
  <D.19229>:
  D.19000 = image->raw_metadata;
  D.19231 = mono_read32 (ptr);
  D.19232 = D.19000 + D.19231;
  image->heap_guid.data = D.19232;
  D.19052 = ptr + 4;
  D.19233 = mono_read32 (D.19052);
  image->heap_guid.size = D.19233;
  ptr = ptr + 14;
  goto <D.19234>;
  <D.19230>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 2;
    if (__s2_len <= 3) goto <D.19236>; else goto <D.19237>;
    <D.19236>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = ptr + 8;
      D.19238 = "#-";
      D.19239 = MEM[(const unsigned char *)D.19238];
      D.19240 = (int) D.19239;
      D.19241 = *__s2;
      D.19242 = (int) D.19241;
      __result = D.19240 - D.19242;
      {
        if (__s2_len != 0) goto <D.19243>; else goto <D.19244>;
        <D.19243>:
        if (__result == 0) goto <D.19245>; else goto <D.19246>;
        <D.19245>:
        D.19247 = &MEM[(void *)"#-" + 1B];
        D.19248 = *D.19247;
        D.19249 = (int) D.19248;
        D.19250 = __s2 + 1;
        D.19251 = *D.19250;
        D.19252 = (int) D.19251;
        __result = D.19249 - D.19252;
        if (__s2_len > 1) goto <D.19253>; else goto <D.19254>;
        <D.19253>:
        if (__result == 0) goto <D.19255>; else goto <D.19256>;
        <D.19255>:
        D.19257 = &MEM[(void *)"#-" + 2B];
        D.19258 = *D.19257;
        D.19259 = (int) D.19258;
        D.19260 = __s2 + 2;
        D.19261 = *D.19260;
        D.19262 = (int) D.19261;
        __result = D.19259 - D.19262;
        if (__s2_len > 2) goto <D.19263>; else goto <D.19264>;
        <D.19263>:
        if (__result == 0) goto <D.19265>; else goto <D.19266>;
        <D.19265>:
        D.19267 = &MEM[(void *)"#-" + 3B];
        D.19268 = *D.19267;
        D.19269 = (int) D.19268;
        D.19270 = __s2 + 3;
        D.19271 = *D.19270;
        D.19272 = (int) D.19271;
        __result = D.19269 - D.19272;
        <D.19266>:
        <D.19264>:
        <D.19256>:
        <D.19254>:
        <D.19246>:
        <D.19244>:
      }
      D.18105 = __result;
    }
    iftmp.31 = -D.18105;
    goto <D.19273>;
    <D.19237>:
    D.19047 = ptr + 8;
    iftmp.31 = __builtin_strcmp (D.19047, "#-");
    <D.19273>:
    D.18106 = iftmp.31;
  }
  if (D.18106 == 0) goto <D.19274>; else goto <D.19275>;
  <D.19274>:
  D.19000 = image->raw_metadata;
  D.19276 = mono_read32 (ptr);
  D.19277 = D.19000 + D.19276;
  image->heap_tables.data = D.19277;
  D.19052 = ptr + 4;
  D.19278 = mono_read32 (D.19052);
  image->heap_tables.size = D.19278;
  ptr = ptr + 11;
  image->uncompressed_metadata = 1;
  D.19279 = image->name;
  mono_trace (64, 1, "Assembly \'%s\' has the non-standard metadata heap #-.\nRecompile it correctly (without the /incremental switch or in Release mode).\n", D.19279);
  goto <D.19280>;
  <D.19275>:
  D.19281 = ptr + 8;
  monoeg_g_log (0B, 32, "Unknown heap type: %s\n", D.19281);
  D.19047 = ptr + 8;
  D.19282 = strlen (D.19047);
  D.19283 = D.19282 + 9;
  ptr = ptr + D.19283;
  <D.19280>:
  <D.19234>:
  <D.19189>:
  <D.19144>:
  <D.19099>:
  <D.19054>:
  ptr.25 = (int) ptr;
  D.19000 = image->raw_metadata;
  D.19001 = (int) D.19000;
  D.19002 = ptr.25 - D.19001;
  pad = (guint32) D.19002;
  D.19003 = pad & 3;
  if (D.19003 != 0) goto <D.19284>; else goto <D.19285>;
  <D.19284>:
  D.19003 = pad & 3;
  D.19006 = 4 - D.19003;
  ptr = ptr + D.19006;
  <D.19285>:
  i = i + 1;
  <D.18108>:
  D.19286 = (int) streams;
  if (D.19286 > i) goto <D.18107>; else goto <D.18109>;
  <D.18109>:
  D.19287 = image->heap_guid.data;
  D.19288 = D.19287 == 0B;
  D.19289 = (long int) D.19288;
  D.19290 = __builtin_expect (D.19289, 0);
  if (D.19290 != 0) goto <D.19291>; else goto <D.19292>;
  <D.19291>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 465, "image->heap_guid.data");
  <D.19292>:
  D.19293 = image->heap_guid.size;
  D.19294 = D.19293 <= 15;
  D.19295 = (long int) D.19294;
  D.19296 = __builtin_expect (D.19295, 0);
  if (D.19296 != 0) goto <D.19297>; else goto <D.19298>;
  <D.19297>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 466, "image->heap_guid.size >= 16");
  <D.19298>:
  D.19287 = image->heap_guid.data;
  D.19299 = mono_guid_to_string (D.19287);
  image->guid = D.19299;
  D.18984 = 1;
  return D.18984;
}


load_tables (struct MonoImage * image)
{
  const char * D.19301;
  char D.19302;
  int D.19303;
  _Bool D.19304;
  int D.19305;
  _Bool D.19306;
  int D.19307;
  _Bool D.19308;
  const unsigned char * D.19309;
  const unsigned char * D.19310;
  long long unsigned int D.19311;
  long long unsigned int D.19312;
  unsigned int D.19320;
  <unnamed-unsigned:24> D.19321;
  int D.19322;
  sizetype D.19323;
  sizetype D.19324;
  const char * D.19325;
  const char * D.19326;
  _Bool D.19327;
  long int D.19328;
  long int D.19329;
  gboolean D.19332;
  const char * heap_tables;
  const guint32 * rows;
  guint64 valid_mask;
  guint64 sorted_mask;
  int valid;
  int table;
  int heap_sizes;

  heap_tables = image->heap_tables.data;
  valid = 0;
  D.19301 = heap_tables + 6;
  D.19302 = *D.19301;
  heap_sizes = (int) D.19302;
  D.19303 = heap_sizes & 1;
  D.19304 = D.19303 != 0;
  image->idx_string_wide = D.19304;
  D.19305 = heap_sizes & 2;
  D.19306 = D.19305 != 0;
  image->idx_guid_wide = D.19306;
  D.19307 = heap_sizes & 4;
  D.19308 = D.19307 != 0;
  image->idx_blob_wide = D.19308;
  D.19309 = heap_tables + 8;
  valid_mask = mono_read64 (D.19309);
  D.19310 = heap_tables + 16;
  sorted_mask = mono_read64 (D.19310);
  rows = heap_tables + 24;
  table = 0;
  goto <D.18122>;
  <D.18121>:
  D.19311 = valid_mask >> table;
  D.19312 = D.19311 & 1;
  if (D.19312 == 0) goto <D.19313>; else goto <D.19314>;
  <D.19313>:
  if (table > 44) goto <D.19315>; else goto <D.19316>;
  <D.19315>:
  // predicted unlikely by continue predictor.
  goto <D.18120>;
  <D.19316>:
  image->tables[table].rows = 0;
  // predicted unlikely by continue predictor.
  goto <D.18120>;
  <D.19314>:
  if (table > 44) goto <D.19317>; else goto <D.19318>;
  <D.19317>:
  monoeg_g_log (0B, 16, "bits in valid must be zero above 0x2d (II - 23.1.6)");
  goto <D.19319>;
  <D.19318>:
  D.19320 = mono_read32 (rows);
  D.19321 = (<unnamed-unsigned:24>) D.19320;
  image->tables[table].rows = D.19321;
  <D.19319>:
  rows = rows + 4;
  valid = valid + 1;
  <D.18120>:
  table = table + 1;
  <D.18122>:
  if (table <= 63) goto <D.18121>; else goto <D.18123>;
  <D.18123>:
  D.19322 = valid * 4;
  D.19323 = (sizetype) D.19322;
  D.19324 = D.19323 + 24;
  D.19325 = heap_tables + D.19324;
  image->tables_base = D.19325;
  D.19326 = image->tables_base;
  D.19327 = D.19326 != rows;
  D.19328 = (long int) D.19327;
  D.19329 = __builtin_expect (D.19328, 0);
  if (D.19329 != 0) goto <D.19330>; else goto <D.19331>;
  <D.19330>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 516, "(const void *) image->tables_base == (const void *) rows");
  <D.19331>:
  mono_metadata_compute_table_bases (image);
  D.19332 = 1;
  return D.19332;
}


mono_image_load_names (struct MonoImage * image)
{
  unsigned int D.19334;
  unsigned int D.19335;
  struct MonoTableInfo * D.19338;
  unsigned int D.19339;
  const char * D.19340;
  struct MonoTableInfo * D.19341;
  unsigned int D.19342;
  const char * D.19343;

  D.19334 = BIT_FIELD_REF <*image, 32, 3904>;
  D.19335 = D.19334 & 16777215;
  if (D.19335 != 0) goto <D.19336>; else goto <D.19337>;
  <D.19336>:
  D.19338 = &image->tables[32];
  D.19339 = mono_metadata_decode_row_col (D.19338, 0, 7);
  D.19340 = mono_metadata_string_heap (image, D.19339);
  image->assembly_name = D.19340;
  <D.19337>:
  D.19341 = &image->tables[0];
  D.19342 = mono_metadata_decode_row_col (D.19341, 0, 1);
  D.19343 = mono_metadata_string_heap (image, D.19342);
  image->module_name = D.19343;
}


mono_image_loaded_full (const char * name, gboolean refonly)
{
  struct GHashTable * iftmp.32;
  int mutex_inited.33;
  _Bool D.19353;
  long int D.19354;
  long int D.19355;
  _Bool D.19362;
  long int D.19363;
  long int D.19364;
  struct MonoImage * D.19367;
  struct MonoImage * res;
  struct GHashTable * loaded_images;

  if (refonly != 0) goto <D.19345>; else goto <D.19346>;
  <D.19345>:
  iftmp.32 = loaded_images_refonly_hash;
  goto <D.19347>;
  <D.19346>:
  iftmp.32 = loaded_images_hash;
  <D.19347>:
  loaded_images = iftmp.32;
  mutex_inited.33 = mutex_inited;
  if (mutex_inited.33 != 0) goto <D.19349>; else goto <D.19350>;
  <D.19349>:
  {
    int ret;

    ret = pthread_mutex_lock (&images_mutex.mutex);
    if (ret != 0) goto <D.19351>; else goto <D.19352>;
    <D.19351>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19352>:
    D.19353 = ret != 0;
    D.19354 = (long int) D.19353;
    D.19355 = __builtin_expect (D.19354, 0);
    if (D.19355 != 0) goto <D.19356>; else goto <D.19357>;
    <D.19356>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1060, "ret == 0");
    <D.19357>:
  }
  <D.19350>:
  res = monoeg_g_hash_table_lookup (loaded_images, name);
  mutex_inited.33 = mutex_inited;
  if (mutex_inited.33 != 0) goto <D.19358>; else goto <D.19359>;
  <D.19358>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19360>; else goto <D.19361>;
    <D.19360>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19361>:
    D.19362 = ret != 0;
    D.19363 = (long int) D.19362;
    D.19364 = __builtin_expect (D.19363, 0);
    if (D.19364 != 0) goto <D.19365>; else goto <D.19366>;
    <D.19365>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1062, "ret == 0");
    <D.19366>:
  }
  <D.19359>:
  D.19367 = res;
  return D.19367;
}


mono_image_loaded (const char * name)
{
  struct MonoImage * D.19369;

  D.19369 = mono_image_loaded_full (name, 0);
  return D.19369;
}


mono_image_loaded_by_guid_full (const char * guid, gboolean refonly)
{
  struct GHashTable * iftmp.34;
  int mutex_inited.35;
  _Bool D.19380;
  long int D.19381;
  long int D.19382;
  _Bool D.19389;
  long int D.19390;
  long int D.19391;
  struct MonoImage * D.19394;
  struct GuidData data;
  struct GHashTable * loaded_images;

  try
    {
      if (refonly != 0) goto <D.19372>; else goto <D.19373>;
      <D.19372>:
      iftmp.34 = loaded_images_refonly_hash;
      goto <D.19374>;
      <D.19373>:
      iftmp.34 = loaded_images_hash;
      <D.19374>:
      loaded_images = iftmp.34;
      data.res = 0B;
      data.guid = guid;
      mutex_inited.35 = mutex_inited;
      if (mutex_inited.35 != 0) goto <D.19376>; else goto <D.19377>;
      <D.19376>:
      {
        int ret;

        ret = pthread_mutex_lock (&images_mutex.mutex);
        if (ret != 0) goto <D.19378>; else goto <D.19379>;
        <D.19378>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19379>:
        D.19380 = ret != 0;
        D.19381 = (long int) D.19380;
        D.19382 = __builtin_expect (D.19381, 0);
        if (D.19382 != 0) goto <D.19383>; else goto <D.19384>;
        <D.19383>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1106, "ret == 0");
        <D.19384>:
      }
      <D.19377>:
      monoeg_g_hash_table_foreach (loaded_images, find_by_guid, &data);
      mutex_inited.35 = mutex_inited;
      if (mutex_inited.35 != 0) goto <D.19385>; else goto <D.19386>;
      <D.19385>:
      {
        int ret;

        ret = pthread_mutex_unlock (&images_mutex.mutex);
        if (ret != 0) goto <D.19387>; else goto <D.19388>;
        <D.19387>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19388>:
        D.19389 = ret != 0;
        D.19390 = (long int) D.19389;
        D.19391 = __builtin_expect (D.19390, 0);
        if (D.19391 != 0) goto <D.19392>; else goto <D.19393>;
        <D.19392>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1108, "ret == 0");
        <D.19393>:
      }
      <D.19386>:
      D.19394 = data.res;
      return D.19394;
    }
  finally
    {
      data = {CLOBBER};
    }
}


find_by_guid (void * key, void * val, void * user_data)
{
  struct MonoImage * D.19397;
  int D.18281;
  const char * D.19400;
  const char * D.19401;
  struct GuidData * data;
  struct MonoImage * image;

  data = user_data;
  D.19397 = data->res;
  if (D.19397 != 0B) goto <D.19398>; else goto <D.19399>;
  <D.19398>:
  return;
  <D.19399>:
  image = val;
  {
    size_t __s1_len;
    size_t __s2_len;

    D.19400 = data->guid;
    D.19401 = mono_image_get_guid (image);
    D.18281 = __builtin_strcmp (D.19400, D.19401);
  }
  if (D.18281 == 0) goto <D.19402>; else goto <D.19403>;
  <D.19402>:
  data->res = image;
  <D.19403>:
}


mono_image_loaded_by_guid (const char * guid)
{
  struct MonoImage * D.19405;

  D.19405 = mono_image_loaded_by_guid_full (guid, 0);
  return D.19405;
}


mono_image_open_from_data_with_name (char * data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus * status, gboolean refonly, const char * name)
{
  struct MonoImage * D.19412;
  unsigned char D.19419;
  <unnamed-unsigned:1> D.19420;
  gchar * iftmp.36;
  unsigned char D.19425;
  <unnamed-unsigned:1> D.19426;
  struct MonoCLIImageInfo * iinfo;
  struct MonoImage * image;
  char * datac;

  if (data == 0B) goto <D.19407>; else goto <D.19409>;
  <D.19409>:
  if (data_len == 0) goto <D.19407>; else goto <D.19408>;
  <D.19407>:
  if (status != 0B) goto <D.19410>; else goto <D.19411>;
  <D.19410>:
  *status = 3;
  <D.19411>:
  D.19412 = 0B;
  return D.19412;
  <D.19408>:
  datac = data;
  if (need_copy != 0) goto <D.19413>; else goto <D.19414>;
  <D.19413>:
  datac = monoeg_try_malloc (data_len);
  if (datac == 0B) goto <D.19415>; else goto <D.19416>;
  <D.19415>:
  if (status != 0B) goto <D.19417>; else goto <D.19418>;
  <D.19417>:
  *status = 1;
  <D.19418>:
  D.19412 = 0B;
  return D.19412;
  <D.19416>:
  memcpy (datac, data, data_len);
  <D.19414>:
  image = monoeg_malloc0 (980);
  image->raw_data = datac;
  image->raw_data_len = data_len;
  D.19419 = (unsigned char) need_copy;
  D.19420 = (<unnamed-unsigned:1>) D.19419;
  image->raw_data_allocated = D.19420;
  if (name == 0B) goto <D.19422>; else goto <D.19423>;
  <D.19422>:
  iftmp.36 = monoeg_g_strdup_printf ("data-%p", datac);
  goto <D.19424>;
  <D.19423>:
  iftmp.36 = monoeg_strdup (name);
  <D.19424>:
  image->name = iftmp.36;
  iinfo = monoeg_malloc0 (396);
  image->image_info = iinfo;
  D.19425 = (unsigned char) refonly;
  D.19426 = (<unnamed-unsigned:1>) D.19425;
  image->ref_only = D.19426;
  image = do_mono_image_load (image, status, 1, 1);
  if (image == 0B) goto <D.19427>; else goto <D.19428>;
  <D.19427>:
  D.19412 = 0B;
  return D.19412;
  <D.19428>:
  D.19412 = register_image (image);
  return D.19412;
}


monoeg_strdup (const gchar * str)
{
  gchar * D.19432;

  if (str != 0B) goto <D.19430>; else goto <D.19431>;
  <D.19430>:
  D.19432 = __strdup (str);
  return D.19432;
  <D.19431>:
  D.19432 = 0B;
  return D.19432;
}


do_mono_image_load (struct MonoImage * image, MonoImageOpenStatus * status, gboolean care_about_cli, gboolean care_about_pecoff)
{
  int D.19437;
  int D.19439;
  int D.19442;
  int D.19444;
  int D.19446;
  struct MonoImage * D.19450;
  struct GSList * errors.37;
  char * D.19454;
  char * D.19455;
  struct MonoCLIImageInfo * iinfo;
  struct MonoDotNetHeader * header;
  struct GSList * errors;
  void done = <<< error >>>;
  void invalid_image = <<< error >>>;

  try
    {
      errors = 0B;
      mono_profiler_module_event (image, 0);
      mono_image_init (image);
      iinfo = image->image_info;
      header = &iinfo->cli_header;
      if (status != 0B) goto <D.19434>; else goto <D.19435>;
      <D.19434>:
      *status = 3;
      <D.19435>:
      if (care_about_pecoff == 0) goto done; else goto <D.19436>;
      <D.19436>:
      D.19437 = mono_verifier_verify_pe_data (image, &errors);
      if (D.19437 == 0) goto invalid_image; else goto <D.19438>;
      <D.19438>:
      D.19439 = mono_image_load_pe_data (image);
      if (D.19439 == 0) goto invalid_image; else goto <D.19440>;
      <D.19440>:
      if (care_about_cli == 0) goto done; else goto <D.19441>;
      <D.19441>:
      D.19442 = mono_verifier_verify_cli_data (image, &errors);
      if (D.19442 == 0) goto invalid_image; else goto <D.19443>;
      <D.19443>:
      D.19444 = mono_image_load_cli_data (image);
      if (D.19444 == 0) goto invalid_image; else goto <D.19445>;
      <D.19445>:
      D.19446 = mono_verifier_verify_table_data (image, &errors);
      if (D.19446 == 0) goto invalid_image; else goto <D.19447>;
      <D.19447>:
      mono_image_load_names (image);
      load_modules (image);
      done:
      mono_profiler_module_loaded (image, 0);
      if (status != 0B) goto <D.19448>; else goto <D.19449>;
      <D.19448>:
      *status = 0;
      <D.19449>:
      D.19450 = image;
      return D.19450;
      invalid_image:
      errors.37 = errors;
      if (errors.37 != 0B) goto <D.19452>; else goto <D.19453>;
      <D.19452>:
      {
        struct MonoVerifyInfo * info;

        errors.37 = errors;
        info = errors.37->data;
        D.19454 = image->name;
        D.19455 = info->message;
        monoeg_g_log (0B, 16, "Could not load image %s due to %s", D.19454, D.19455);
        errors.37 = errors;
        mono_free_verify_list (errors.37);
      }
      <D.19453>:
      mono_profiler_module_loaded (image, 1);
      mono_image_close (image);
      D.19450 = 0B;
      return D.19450;
    }
  finally
    {
      errors = {CLOBBER};
    }
}


load_modules (struct MonoImage * image)
{
  struct MonoImage * * D.19458;
  <unnamed-unsigned:24> D.19461;
  unsigned int D.19462;
  unsigned int D.19463;
  void * D.19464;
  void * D.19465;
  unsigned int D.19466;
  struct MonoTableInfo * t;

  D.19458 = image->modules;
  if (D.19458 != 0B) goto <D.19459>; else goto <D.19460>;
  <D.19459>:
  return;
  <D.19460>:
  t = &image->tables[26];
  D.19461 = t->rows;
  D.19462 = (unsigned int) D.19461;
  D.19463 = D.19462 * 4;
  D.19464 = monoeg_malloc0 (D.19463);
  image->modules = D.19464;
  D.19461 = t->rows;
  D.19462 = (unsigned int) D.19461;
  D.19463 = D.19462 * 4;
  D.19465 = monoeg_malloc0 (D.19463);
  image->modules_loaded = D.19465;
  D.19461 = t->rows;
  D.19466 = (unsigned int) D.19461;
  image->module_count = D.19466;
}


register_image (struct MonoImage * image)
{
  struct GHashTable * iftmp.38;
  unsigned int D.19469;
  unsigned int D.19470;
  int mutex_inited.39;
  _Bool D.19479;
  long int D.19480;
  long int D.19481;
  char * D.19484;
  _Bool D.19491;
  long int D.19492;
  long int D.19493;
  struct MonoImage * D.19496;
  const char * D.19497;
  void * D.19500;
  _Bool D.19507;
  long int D.19508;
  long int D.19509;
  struct MonoImage * image2;
  struct GHashTable * loaded_images;

  D.19469 = BIT_FIELD_REF <*image, 32, 128>;
  D.19470 = D.19469 & 16;
  if (D.19470 != 0) goto <D.19471>; else goto <D.19472>;
  <D.19471>:
  iftmp.38 = loaded_images_refonly_hash;
  goto <D.19473>;
  <D.19472>:
  iftmp.38 = loaded_images_hash;
  <D.19473>:
  loaded_images = iftmp.38;
  mutex_inited.39 = mutex_inited;
  if (mutex_inited.39 != 0) goto <D.19475>; else goto <D.19476>;
  <D.19475>:
  {
    int ret;

    ret = pthread_mutex_lock (&images_mutex.mutex);
    if (ret != 0) goto <D.19477>; else goto <D.19478>;
    <D.19477>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19478>:
    D.19479 = ret != 0;
    D.19480 = (long int) D.19479;
    D.19481 = __builtin_expect (D.19480, 0);
    if (D.19481 != 0) goto <D.19482>; else goto <D.19483>;
    <D.19482>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1124, "ret == 0");
    <D.19483>:
  }
  <D.19476>:
  D.19484 = image->name;
  image2 = monoeg_g_hash_table_lookup (loaded_images, D.19484);
  if (image2 != 0B) goto <D.19485>; else goto <D.19486>;
  <D.19485>:
  mono_image_addref (image2);
  mutex_inited.39 = mutex_inited;
  if (mutex_inited.39 != 0) goto <D.19487>; else goto <D.19488>;
  <D.19487>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19489>; else goto <D.19490>;
    <D.19489>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19490>:
    D.19491 = ret != 0;
    D.19492 = (long int) D.19491;
    D.19493 = __builtin_expect (D.19492, 0);
    if (D.19493 != 0) goto <D.19494>; else goto <D.19495>;
    <D.19494>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1130, "ret == 0");
    <D.19495>:
  }
  <D.19488>:
  mono_image_close (image);
  D.19496 = image2;
  return D.19496;
  <D.19486>:
  D.19484 = image->name;
  monoeg_g_hash_table_insert_replace (loaded_images, D.19484, image, 0);
  D.19497 = image->assembly_name;
  if (D.19497 != 0B) goto <D.19498>; else goto <D.19499>;
  <D.19498>:
  D.19497 = image->assembly_name;
  D.19500 = monoeg_g_hash_table_lookup (loaded_images, D.19497);
  if (D.19500 == 0B) goto <D.19501>; else goto <D.19502>;
  <D.19501>:
  D.19497 = image->assembly_name;
  monoeg_g_hash_table_insert_replace (loaded_images, D.19497, image, 0);
  <D.19502>:
  <D.19499>:
  mutex_inited.39 = mutex_inited;
  if (mutex_inited.39 != 0) goto <D.19503>; else goto <D.19504>;
  <D.19503>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19505>; else goto <D.19506>;
    <D.19505>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19506>:
    D.19507 = ret != 0;
    D.19508 = (long int) D.19507;
    D.19509 = __builtin_expect (D.19508, 0);
    if (D.19509 != 0) goto <D.19510>; else goto <D.19511>;
    <D.19510>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1137, "ret == 0");
    <D.19511>:
  }
  <D.19504>:
  D.19496 = image;
  return D.19496;
}


mono_image_open_from_data_full (char * data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoImage * D.19513;

  D.19513 = mono_image_open_from_data_with_name (data, data_len, need_copy, status, refonly, 0B);
  return D.19513;
}


mono_image_open_from_data (char * data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus * status)
{
  struct MonoImage * D.19515;

  D.19515 = mono_image_open_from_data_full (data, data_len, need_copy, status, 0);
  return D.19515;
}


mono_image_open_full (const char * fname, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoImage * D.19519;
  int mutex_inited.40;
  _Bool D.19525;
  long int D.19526;
  long int D.19527;
  struct GHashTable * iftmp.41;
  _Bool D.19540;
  long int D.19541;
  long int D.19542;
  _Bool D.19549;
  long int D.19550;
  long int D.19551;
  struct MonoImage * image;
  struct GHashTable * loaded_images;
  char * absfname;

  if (fname == 0B) goto <D.19517>; else goto <D.19518>;
  <D.19517>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 1225, "fname != NULL");
  D.19519 = 0B;
  return D.19519;
  <D.19518>:
  absfname = mono_path_canonicalize (fname);
  mutex_inited.40 = mutex_inited;
  if (mutex_inited.40 != 0) goto <D.19521>; else goto <D.19522>;
  <D.19521>:
  {
    int ret;

    ret = pthread_mutex_lock (&images_mutex.mutex);
    if (ret != 0) goto <D.19523>; else goto <D.19524>;
    <D.19523>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19524>:
    D.19525 = ret != 0;
    D.19526 = (long int) D.19525;
    D.19527 = __builtin_expect (D.19526, 0);
    if (D.19527 != 0) goto <D.19528>; else goto <D.19529>;
    <D.19528>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1305, "ret == 0");
    <D.19529>:
  }
  <D.19522>:
  if (refonly != 0) goto <D.19531>; else goto <D.19532>;
  <D.19531>:
  iftmp.41 = loaded_images_refonly_hash;
  goto <D.19533>;
  <D.19532>:
  iftmp.41 = loaded_images_hash;
  <D.19533>:
  loaded_images = iftmp.41;
  image = monoeg_g_hash_table_lookup (loaded_images, absfname);
  monoeg_g_free (absfname);
  if (image != 0B) goto <D.19534>; else goto <D.19535>;
  <D.19534>:
  mono_image_addref (image);
  mutex_inited.40 = mutex_inited;
  if (mutex_inited.40 != 0) goto <D.19536>; else goto <D.19537>;
  <D.19536>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19538>; else goto <D.19539>;
    <D.19538>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19539>:
    D.19540 = ret != 0;
    D.19541 = (long int) D.19540;
    D.19542 = __builtin_expect (D.19541, 0);
    if (D.19542 != 0) goto <D.19543>; else goto <D.19544>;
    <D.19543>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1312, "ret == 0");
    <D.19544>:
  }
  <D.19537>:
  D.19519 = image;
  return D.19519;
  <D.19535>:
  mutex_inited.40 = mutex_inited;
  if (mutex_inited.40 != 0) goto <D.19545>; else goto <D.19546>;
  <D.19545>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19547>; else goto <D.19548>;
    <D.19547>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19548>:
    D.19549 = ret != 0;
    D.19550 = (long int) D.19549;
    D.19551 = __builtin_expect (D.19550, 0);
    if (D.19551 != 0) goto <D.19552>; else goto <D.19553>;
    <D.19552>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1315, "ret == 0");
    <D.19553>:
  }
  <D.19546>:
  image = do_mono_image_open (fname, status, 1, 1, refonly);
  if (image == 0B) goto <D.19554>; else goto <D.19555>;
  <D.19554>:
  D.19519 = 0B;
  return D.19519;
  <D.19555>:
  D.19519 = register_image (image);
  return D.19519;
}


do_mono_image_open (const char * fname, MonoImageOpenStatus * status, gboolean care_about_cli, gboolean care_about_pecoff, gboolean refonly)
{
  int __mono_io_portability_helpers.42;
  struct MonoImage * D.19568;
  long long unsigned int D.19569;
  unsigned int D.19570;
  unsigned int D.19571;
  int D.19572;
  void * * D.19573;
  void * D.19574;
  char * D.19575;
  int D.19578;
  void * D.19579;
  gchar * D.19584;
  unsigned char D.19585;
  <unnamed-unsigned:1> D.19586;
  int D.19587;
  unsigned char D.19588;
  <unnamed-unsigned:1> D.19589;
  struct MonoCLIImageInfo * iinfo;
  struct MonoImage * image;
  struct MonoFileMap * filed;

  filed = mono_file_map_open (fname);
  if (filed == 0B) goto <D.19557>; else goto <D.19558>;
  <D.19557>:
  __mono_io_portability_helpers.42 = __mono_io_portability_helpers;
  if (__mono_io_portability_helpers.42 > 0) goto <D.19560>; else goto <D.19561>;
  <D.19560>:
  {
    gchar * ffname;

    ffname = mono_portability_find_file (fname, 1);
    if (ffname != 0B) goto <D.19562>; else goto <D.19563>;
    <D.19562>:
    filed = mono_file_map_open (ffname);
    monoeg_g_free (ffname);
    <D.19563>:
  }
  <D.19561>:
  if (filed == 0B) goto <D.19564>; else goto <D.19565>;
  <D.19564>:
  if (status != 0B) goto <D.19566>; else goto <D.19567>;
  <D.19566>:
  *status = 1;
  <D.19567>:
  D.19568 = 0B;
  return D.19568;
  <D.19565>:
  <D.19558>:
  image = monoeg_malloc0 (980);
  image->raw_buffer_used = 1;
  D.19569 = mono_file_map_size (filed);
  D.19570 = (unsigned int) D.19569;
  image->raw_data_len = D.19570;
  D.19571 = image->raw_data_len;
  D.19572 = mono_file_map_fd (filed);
  D.19573 = &image->raw_data_handle;
  D.19574 = mono_file_map (D.19571, 17, D.19572, 0, D.19573);
  image->raw_data = D.19574;
  D.19575 = image->raw_data;
  if (D.19575 == 0B) goto <D.19576>; else goto <D.19577>;
  <D.19576>:
  image->fileio_used = 1;
  D.19571 = image->raw_data_len;
  D.19578 = mono_file_map_fd (filed);
  D.19573 = &image->raw_data_handle;
  D.19579 = mono_file_map_fileio (D.19571, 17, D.19578, 0, D.19573);
  image->raw_data = D.19579;
  <D.19577>:
  D.19575 = image->raw_data;
  if (D.19575 == 0B) goto <D.19580>; else goto <D.19581>;
  <D.19580>:
  mono_file_map_close (filed);
  monoeg_g_free (image);
  if (status != 0B) goto <D.19582>; else goto <D.19583>;
  <D.19582>:
  *status = 3;
  <D.19583>:
  D.19568 = 0B;
  return D.19568;
  <D.19581>:
  iinfo = monoeg_malloc0 (396);
  image->image_info = iinfo;
  D.19584 = mono_path_resolve_symlinks (fname);
  image->name = D.19584;
  D.19585 = (unsigned char) refonly;
  D.19586 = (<unnamed-unsigned:1>) D.19585;
  image->ref_only = D.19586;
  image->ref_count = 1;
  D.19587 = mono_security_core_clr_determine_platform_image (image);
  D.19588 = (unsigned char) D.19587;
  D.19589 = (<unnamed-unsigned:1>) D.19588;
  image->core_clr_platform_code = D.19589;
  mono_file_map_close (filed);
  D.19568 = do_mono_image_load (image, status, care_about_cli, care_about_pecoff);
  return D.19568;
}


mono_image_open (const char * fname, MonoImageOpenStatus * status)
{
  struct MonoImage * D.19591;

  D.19591 = mono_image_open_full (fname, status, 0);
  return D.19591;
}


mono_pe_file_open (const char * fname, MonoImageOpenStatus * status)
{
  struct MonoImage * D.19595;

  if (fname == 0B) goto <D.19593>; else goto <D.19594>;
  <D.19593>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 1354, "fname != NULL");
  D.19595 = 0B;
  return D.19595;
  <D.19594>:
  D.19595 = do_mono_image_open (fname, status, 0, 1, 0);
  return D.19595;
}


mono_image_open_raw (const char * fname, MonoImageOpenStatus * status)
{
  struct MonoImage * D.19599;

  if (fname == 0B) goto <D.19597>; else goto <D.19598>;
  <D.19597>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 1371, "fname != NULL");
  D.19599 = 0B;
  return D.19599;
  <D.19598>:
  D.19599 = do_mono_image_open (fname, status, 0, 0, 0);
  return D.19599;
}


mono_image_fixup_vtable (struct MonoImage * image)
{
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "image.c", 1423);
}


mono_image_addref (struct MonoImage * image)
{
  int * D.19601;

  D.19601 = &image->ref_count;
  InterlockedIncrement (D.19601);
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.19602;
  unsigned int D.19603;

  D.19603 = __sync_add_and_fetch_4 (val, 1);
  D.19602 = (gint32) D.19603;
  return D.19602;
}


mono_dynamic_stream_reset (struct MonoDynamicStream * stream)
{
  unsigned int D.19605;
  unsigned int D.19606;
  char * D.19607;
  struct GHashTable * D.19608;

  stream->offset = 0;
  D.19605 = stream->offset;
  stream->index = D.19605;
  D.19606 = stream->index;
  stream->alloc_size = D.19606;
  D.19607 = stream->data;
  monoeg_g_free (D.19607);
  stream->data = 0B;
  D.19608 = stream->hash;
  if (D.19608 != 0B) goto <D.19609>; else goto <D.19610>;
  <D.19609>:
  D.19608 = stream->hash;
  monoeg_g_hash_table_destroy (D.19608);
  stream->hash = 0B;
  <D.19610>:
}


mono_image_close_except_pools (struct MonoImage * image)
{
  gboolean D.19613;
  int mutex_inited.43;
  _Bool D.19619;
  long int D.19620;
  long int D.19621;
  int * D.19624;
  int D.19625;
  _Bool D.19632;
  long int D.19633;
  long int D.19634;
  struct GHashTable * iftmp.44;
  unsigned int D.19638;
  unsigned int D.19639;
  char * D.19643;
  const char * D.19646;
  void * D.19649;
  _Bool D.19656;
  long int D.19657;
  long int D.19658;
  struct MonoAssembly * * D.19663;
  unsigned int D.19665;
  unsigned int i.45;
  unsigned int D.19668;
  struct MonoAssembly * * D.19669;
  struct MonoAssembly * D.19670;
  struct MonoAssembly * D.19671;
  int D.19674;
  int D.19677;
  unsigned int D.19680;
  char * D.19683;
  unsigned int D.19686;
  void * D.19689;
  unsigned int D.19691;
  char * D.19694;
  unsigned int D.19697;
  char * D.19698;
  void * * D.19701;
  void * * D.19702;
  void * D.19703;
  int D.19708;
  int debug_assembly_unload.46;
  gchar * D.19712;
  char * D.19714;
  char * D.19715;
  struct MonoImage * * D.19716;
  struct GHashTable * D.19717;
  struct GHashTable * D.19720;
  struct MonoInternalHashTable * D.19723;
  struct GHashTable * D.19724;
  struct GHashTable * D.19725;
  struct GHashTable * D.19728;
  struct GHashTable * D.19731;
  struct GHashTable * D.19734;
  struct GHashTable * D.19737;
  struct GHashTable * D.19738;
  struct GHashTable * D.19739;
  struct GHashTable * D.19740;
  struct GHashTable * D.19741;
  struct GHashTable * D.19742;
  struct GHashTable * D.19743;
  struct GHashTable * D.19744;
  struct GHashTable * D.19745;
  struct GHashTable * D.19746;
  struct GHashTable * D.19747;
  struct GHashTable * D.19748;
  struct GHashTable * D.19749;
  struct GHashTable * D.19750;
  struct GHashTable * D.19751;
  struct GHashTable * D.19752;
  struct GHashTable * D.19753;
  struct GHashTable * D.19754;
  struct GHashTable * D.19755;
  struct GHashTable * D.19756;
  struct GHashTable * D.19757;
  struct GHashTable * D.19758;
  struct GHashTable * D.19759;
  struct GHashTable * D.19760;
  struct GHashTable * D.19761;
  struct GHashTable * D.19762;
  struct GHashTable * D.19763;
  struct GHashTable * D.19764;
  struct GHashTable * D.19765;
  struct GHashTable * D.19766;
  struct GHashTable * D.19767;
  struct GHashTable * D.19768;
  struct GHashTable * D.19769;
  struct GHashTable * D.19770;
  struct GHashTable * D.19771;
  struct GHashTable * D.19772;
  struct GHashTable * D.19773;
  struct GHashTable * D.19774;
  struct GHashTable * D.19775;
  struct MonoPropertyHash * D.19778;
  int iftmp.47;
  struct GSList * D.19784;
  int D.19786;
  _Bool D.19788;
  long int D.19789;
  long int D.19790;
  struct MonoBitSet * D.19793;
  void * D.19796;
  struct MonoSectionTable * D.19799;
  void * * D.19802;
  struct MonoImage * * D.19805;
  struct MonoImage * * D.19806;
  struct MonoImage * D.19807;
  int D.19810;
  unsigned int i.48;
  unsigned int D.19814;
  gboolean * D.19815;
  struct CRITICAL_SECTION * D.19818;
  struct CRITICAL_SECTION * D.19819;
  const char * D.19822;
  struct MonoImage * image2;
  struct GHashTable * loaded_images;
  int i;

  if (image == 0B) goto <D.19611>; else goto <D.19612>;
  <D.19611>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "image.c", 1492, "image != NULL");
  D.19613 = 0;
  return D.19613;
  <D.19612>:
  mutex_inited.43 = mutex_inited;
  if (mutex_inited.43 != 0) goto <D.19615>; else goto <D.19616>;
  <D.19615>:
  {
    int ret;

    ret = pthread_mutex_lock (&images_mutex.mutex);
    if (ret != 0) goto <D.19617>; else goto <D.19618>;
    <D.19617>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19618>:
    D.19619 = ret != 0;
    D.19620 = (long int) D.19619;
    D.19621 = __builtin_expect (D.19620, 0);
    if (D.19621 != 0) goto <D.19622>; else goto <D.19623>;
    <D.19622>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1498, "ret == 0");
    <D.19623>:
  }
  <D.19616>:
  D.19624 = &image->ref_count;
  D.19625 = InterlockedDecrement (D.19624);
  if (D.19625 > 0) goto <D.19626>; else goto <D.19627>;
  <D.19626>:
  mutex_inited.43 = mutex_inited;
  if (mutex_inited.43 != 0) goto <D.19628>; else goto <D.19629>;
  <D.19628>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19630>; else goto <D.19631>;
    <D.19630>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19631>:
    D.19632 = ret != 0;
    D.19633 = (long int) D.19632;
    D.19634 = __builtin_expect (D.19633, 0);
    if (D.19634 != 0) goto <D.19635>; else goto <D.19636>;
    <D.19635>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1501, "ret == 0");
    <D.19636>:
  }
  <D.19629>:
  D.19613 = 0;
  return D.19613;
  <D.19627>:
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19639 = D.19638 & 16;
  if (D.19639 != 0) goto <D.19640>; else goto <D.19641>;
  <D.19640>:
  iftmp.44 = loaded_images_refonly_hash;
  goto <D.19642>;
  <D.19641>:
  iftmp.44 = loaded_images_hash;
  <D.19642>:
  loaded_images = iftmp.44;
  D.19643 = image->name;
  image2 = monoeg_g_hash_table_lookup (loaded_images, D.19643);
  if (image == image2) goto <D.19644>; else goto <D.19645>;
  <D.19644>:
  D.19643 = image->name;
  monoeg_g_hash_table_remove (loaded_images, D.19643);
  <D.19645>:
  D.19646 = image->assembly_name;
  if (D.19646 != 0B) goto <D.19647>; else goto <D.19648>;
  <D.19647>:
  D.19646 = image->assembly_name;
  D.19649 = monoeg_g_hash_table_lookup (loaded_images, D.19646);
  if (D.19649 == image) goto <D.19650>; else goto <D.19651>;
  <D.19650>:
  D.19646 = image->assembly_name;
  monoeg_g_hash_table_remove (loaded_images, D.19646);
  <D.19651>:
  <D.19648>:
  mutex_inited.43 = mutex_inited;
  if (mutex_inited.43 != 0) goto <D.19652>; else goto <D.19653>;
  <D.19652>:
  {
    int ret;

    ret = pthread_mutex_unlock (&images_mutex.mutex);
    if (ret != 0) goto <D.19654>; else goto <D.19655>;
    <D.19654>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19655>:
    D.19656 = ret != 0;
    D.19657 = (long int) D.19656;
    D.19658 = __builtin_expect (D.19657, 0);
    if (D.19658 != 0) goto <D.19659>; else goto <D.19660>;
    <D.19659>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1514, "ret == 0");
    <D.19660>:
  }
  <D.19653>:
  mono_profiler_module_event (image, 2);
  D.19643 = image->name;
  mono_trace (64, 1, "Unloading image %s [%p].", D.19643, image);
  mono_image_invoke_unload_hook (image);
  mono_metadata_clean_for_image (image);
  D.19663 = image->references;
  if (D.19663 != 0B) goto <D.19664>; else goto <D.19661>;
  <D.19664>:
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19665 = D.19638 & 8;
  if (D.19665 == 0) goto <D.19666>; else goto <D.19661>;
  <D.19666>:
  i = 0;
  goto <D.18380>;
  <D.18379>:
  D.19663 = image->references;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19669 = D.19663 + D.19668;
  D.19670 = *D.19669;
  D.19671 = D.19670 + 4294967295;
  if (D.19671 <= 4294967293B) goto <D.19672>; else goto <D.19673>;
  <D.19672>:
  D.19663 = image->references;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19669 = D.19663 + D.19668;
  D.19670 = *D.19669;
  D.19674 = mono_assembly_close_except_image_pools (D.19670);
  if (D.19674 == 0) goto <D.19675>; else goto <D.19676>;
  <D.19675>:
  D.19663 = image->references;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19669 = D.19663 + D.19668;
  *D.19669 = 0B;
  <D.19676>:
  <D.19673>:
  i = i + 1;
  <D.18380>:
  D.19677 = image->nreferences;
  if (D.19677 > i) goto <D.18379>; else goto <D.18381>;
  <D.18381>:
  goto <D.19662>;
  <D.19661>:
  D.19663 = image->references;
  if (D.19663 != 0B) goto <D.19678>; else goto <D.19679>;
  <D.19678>:
  D.19663 = image->references;
  monoeg_g_free (D.19663);
  image->references = 0B;
  <D.19679>:
  <D.19662>:
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19680 = D.19638 & 1;
  if (D.19680 != 0) goto <D.19681>; else goto <D.19682>;
  <D.19681>:
  D.19683 = image->raw_data;
  if (D.19683 != 0B) goto <D.19684>; else goto <D.19685>;
  <D.19684>:
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19686 = D.19638 & 4;
  if (D.19686 != 0) goto <D.19687>; else goto <D.19688>;
  <D.19687>:
  D.19683 = image->raw_data;
  D.19689 = image->raw_data_handle;
  mono_file_unmap_fileio (D.19683, D.19689);
  goto <D.19690>;
  <D.19688>:
  D.19683 = image->raw_data;
  D.19689 = image->raw_data_handle;
  mono_file_unmap (D.19683, D.19689);
  <D.19690>:
  <D.19685>:
  <D.19682>:
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19691 = D.19638 & 2;
  if (D.19691 != 0) goto <D.19692>; else goto <D.19693>;
  <D.19692>:
  {
    struct MonoCLIImageInfo * ii;

    ii = image->image_info;
    D.19694 = image->raw_metadata;
    D.19683 = image->raw_data;
    if (D.19694 > D.19683) goto <D.19695>; else goto <D.19696>;
    <D.19695>:
    D.19694 = image->raw_metadata;
    D.19683 = image->raw_data;
    D.19697 = image->raw_data_len;
    D.19698 = D.19683 + D.19697;
    if (D.19694 <= D.19698) goto <D.19699>; else goto <D.19700>;
    <D.19699>:
    image->raw_metadata = 0B;
    <D.19700>:
    <D.19696>:
    i = 0;
    goto <D.18384>;
    <D.18383>:
    D.19701 = ii->cli_sections;
    i.45 = (unsigned int) i;
    D.19668 = i.45 * 4;
    D.19702 = D.19701 + D.19668;
    D.19703 = *D.19702;
    D.19683 = image->raw_data;
    if (D.19703 > D.19683) goto <D.19704>; else goto <D.19705>;
    <D.19704>:
    D.19701 = ii->cli_sections;
    i.45 = (unsigned int) i;
    D.19668 = i.45 * 4;
    D.19702 = D.19701 + D.19668;
    D.19703 = *D.19702;
    D.19683 = image->raw_data;
    D.19697 = image->raw_data_len;
    D.19698 = D.19683 + D.19697;
    if (D.19703 <= D.19698) goto <D.19706>; else goto <D.19707>;
    <D.19706>:
    D.19701 = ii->cli_sections;
    i.45 = (unsigned int) i;
    D.19668 = i.45 * 4;
    D.19702 = D.19701 + D.19668;
    *D.19702 = 0B;
    <D.19707>:
    <D.19705>:
    i = i + 1;
    <D.18384>:
    D.19708 = ii->cli_section_count;
    if (D.19708 > i) goto <D.18383>; else goto <D.18385>;
    <D.18385>:
    D.19683 = image->raw_data;
    monoeg_g_free (D.19683);
  }
  <D.19693>:
  debug_assembly_unload.46 = debug_assembly_unload;
  if (debug_assembly_unload.46 != 0) goto <D.19710>; else goto <D.19711>;
  <D.19710>:
  D.19643 = image->name;
  D.19712 = monoeg_g_strdup_printf ("%s - UNLOADED", D.19643);
  image->name = D.19712;
  goto <D.19713>;
  <D.19711>:
  D.19643 = image->name;
  monoeg_g_free (D.19643);
  D.19714 = image->guid;
  monoeg_g_free (D.19714);
  D.19715 = image->version;
  monoeg_g_free (D.19715);
  D.19716 = image->files;
  monoeg_g_free (D.19716);
  <D.19713>:
  D.19717 = image->method_cache;
  if (D.19717 != 0B) goto <D.19718>; else goto <D.19719>;
  <D.19718>:
  D.19717 = image->method_cache;
  monoeg_g_hash_table_destroy (D.19717);
  <D.19719>:
  D.19720 = image->methodref_cache;
  if (D.19720 != 0B) goto <D.19721>; else goto <D.19722>;
  <D.19721>:
  D.19720 = image->methodref_cache;
  monoeg_g_hash_table_destroy (D.19720);
  <D.19722>:
  D.19723 = &image->class_cache;
  mono_internal_hash_table_destroy (D.19723);
  D.19724 = image->field_cache;
  monoeg_g_hash_table_destroy (D.19724);
  D.19725 = image->array_cache;
  if (D.19725 != 0B) goto <D.19726>; else goto <D.19727>;
  <D.19726>:
  D.19725 = image->array_cache;
  monoeg_g_hash_table_foreach (D.19725, free_array_cache_entry, 0B);
  D.19725 = image->array_cache;
  monoeg_g_hash_table_destroy (D.19725);
  <D.19727>:
  D.19728 = image->szarray_cache;
  if (D.19728 != 0B) goto <D.19729>; else goto <D.19730>;
  <D.19729>:
  D.19728 = image->szarray_cache;
  monoeg_g_hash_table_destroy (D.19728);
  <D.19730>:
  D.19731 = image->ptr_cache;
  if (D.19731 != 0B) goto <D.19732>; else goto <D.19733>;
  <D.19732>:
  D.19731 = image->ptr_cache;
  monoeg_g_hash_table_destroy (D.19731);
  <D.19733>:
  D.19734 = image->name_cache;
  if (D.19734 != 0B) goto <D.19735>; else goto <D.19736>;
  <D.19735>:
  D.19734 = image->name_cache;
  monoeg_g_hash_table_foreach (D.19734, free_hash_table, 0B);
  D.19734 = image->name_cache;
  monoeg_g_hash_table_destroy (D.19734);
  <D.19736>:
  D.19737 = image->native_wrapper_cache;
  free_hash (D.19737);
  D.19738 = image->managed_wrapper_cache;
  free_hash (D.19738);
  D.19739 = image->delegate_begin_invoke_cache;
  free_hash (D.19739);
  D.19740 = image->delegate_end_invoke_cache;
  free_hash (D.19740);
  D.19741 = image->delegate_invoke_cache;
  free_hash (D.19741);
  D.19742 = image->delegate_abstract_invoke_cache;
  free_hash (D.19742);
  D.19743 = image->delegate_bound_static_invoke_cache;
  free_hash (D.19743);
  D.19744 = image->delegate_invoke_generic_cache;
  free_hash (D.19744);
  D.19745 = image->delegate_begin_invoke_generic_cache;
  free_hash (D.19745);
  D.19746 = image->delegate_end_invoke_generic_cache;
  free_hash (D.19746);
  D.19747 = image->synchronized_generic_cache;
  free_hash (D.19747);
  D.19748 = image->remoting_invoke_cache;
  free_hash (D.19748);
  D.19749 = image->runtime_invoke_cache;
  free_hash (D.19749);
  D.19750 = image->runtime_invoke_vtype_cache;
  free_hash (D.19750);
  D.19751 = image->runtime_invoke_direct_cache;
  free_hash (D.19751);
  D.19752 = image->runtime_invoke_vcall_cache;
  free_hash (D.19752);
  D.19753 = image->synchronized_cache;
  free_hash (D.19753);
  D.19754 = image->unbox_wrapper_cache;
  free_hash (D.19754);
  D.19755 = image->cominterop_invoke_cache;
  free_hash (D.19755);
  D.19756 = image->cominterop_wrapper_cache;
  free_hash (D.19756);
  D.19757 = image->typespec_cache;
  free_hash (D.19757);
  D.19758 = image->ldfld_wrapper_cache;
  free_hash (D.19758);
  D.19759 = image->ldflda_wrapper_cache;
  free_hash (D.19759);
  D.19760 = image->stfld_wrapper_cache;
  free_hash (D.19760);
  D.19761 = image->isinst_cache;
  free_hash (D.19761);
  D.19762 = image->castclass_cache;
  free_hash (D.19762);
  D.19763 = image->proxy_isinst_cache;
  free_hash (D.19763);
  D.19764 = image->thunk_invoke_cache;
  free_hash (D.19764);
  D.19765 = image->var_cache_slow;
  free_hash (D.19765);
  D.19766 = image->mvar_cache_slow;
  free_hash (D.19766);
  D.19767 = image->wrapper_param_names;
  free_hash (D.19767);
  D.19768 = image->native_wrapper_aot_cache;
  free_hash (D.19768);
  D.19769 = image->pinvoke_scopes;
  free_hash (D.19769);
  D.19770 = image->pinvoke_scope_filenames;
  free_hash (D.19770);
  D.19771 = image->gsharedvt_types;
  free_hash (D.19771);
  D.19772 = image->memberref_signatures;
  monoeg_g_hash_table_destroy (D.19772);
  D.19773 = image->helper_signatures;
  monoeg_g_hash_table_destroy (D.19773);
  D.19774 = image->method_signatures;
  monoeg_g_hash_table_destroy (D.19774);
  D.19775 = image->rgctx_template_hash;
  if (D.19775 != 0B) goto <D.19776>; else goto <D.19777>;
  <D.19776>:
  D.19775 = image->rgctx_template_hash;
  monoeg_g_hash_table_destroy (D.19775);
  <D.19777>:
  D.19778 = image->property_hash;
  if (D.19778 != 0B) goto <D.19779>; else goto <D.19780>;
  <D.19779>:
  D.19778 = image->property_hash;
  mono_property_hash_destroy (D.19778);
  <D.19780>:
  D.19784 = image->reflection_info_unregister_classes;
  if (D.19784 != 0B) goto <D.19785>; else goto <D.19782>;
  <D.19785>:
  D.19786 = mono_runtime_is_shutting_down ();
  if (D.19786 == 0) goto <D.19787>; else goto <D.19782>;
  <D.19787>:
  iftmp.47 = 1;
  goto <D.19783>;
  <D.19782>:
  iftmp.47 = 0;
  <D.19783>:
  D.19788 = iftmp.47 != 0;
  D.19789 = (long int) D.19788;
  D.19790 = __builtin_expect (D.19789, 0);
  if (D.19790 != 0) goto <D.19791>; else goto <D.19792>;
  <D.19791>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 1670, "!image->reflection_info_unregister_classes || mono_runtime_is_shutting_down ()");
  <D.19792>:
  image->reflection_info_unregister_classes = 0B;
  D.19793 = image->interface_bitset;
  if (D.19793 != 0B) goto <D.19794>; else goto <D.19795>;
  <D.19794>:
  D.19793 = image->interface_bitset;
  mono_unload_interface_ids (D.19793);
  D.19793 = image->interface_bitset;
  mono_bitset_free (D.19793);
  <D.19795>:
  D.19796 = image->image_info;
  if (D.19796 != 0B) goto <D.19797>; else goto <D.19798>;
  <D.19797>:
  {
    struct MonoCLIImageInfo * ii;

    ii = image->image_info;
    D.19799 = ii->cli_section_tables;
    if (D.19799 != 0B) goto <D.19800>; else goto <D.19801>;
    <D.19800>:
    D.19799 = ii->cli_section_tables;
    monoeg_g_free (D.19799);
    <D.19801>:
    D.19802 = ii->cli_sections;
    if (D.19802 != 0B) goto <D.19803>; else goto <D.19804>;
    <D.19803>:
    D.19802 = ii->cli_sections;
    monoeg_g_free (D.19802);
    <D.19804>:
    D.19796 = image->image_info;
    monoeg_g_free (D.19796);
  }
  <D.19798>:
  i = 0;
  goto <D.18388>;
  <D.18387>:
  D.19805 = image->modules;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19806 = D.19805 + D.19668;
  D.19807 = *D.19806;
  if (D.19807 != 0B) goto <D.19808>; else goto <D.19809>;
  <D.19808>:
  D.19805 = image->modules;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19806 = D.19805 + D.19668;
  D.19807 = *D.19806;
  D.19810 = mono_image_close_except_pools (D.19807);
  if (D.19810 == 0) goto <D.19811>; else goto <D.19812>;
  <D.19811>:
  D.19805 = image->modules;
  i.45 = (unsigned int) i;
  D.19668 = i.45 * 4;
  D.19806 = D.19805 + D.19668;
  *D.19806 = 0B;
  <D.19812>:
  <D.19809>:
  i = i + 1;
  <D.18388>:
  i.48 = (unsigned int) i;
  D.19814 = image->module_count;
  if (i.48 < D.19814) goto <D.18387>; else goto <D.18389>;
  <D.18389>:
  D.19815 = image->modules_loaded;
  if (D.19815 != 0B) goto <D.19816>; else goto <D.19817>;
  <D.19816>:
  D.19815 = image->modules_loaded;
  monoeg_g_free (D.19815);
  <D.19817>:
  D.19818 = &image->szarray_cache_lock;
  DeleteCriticalSection (D.19818);
  D.19819 = &image->lock;
  DeleteCriticalSection (D.19819);
  D.19638 = BIT_FIELD_REF <*image, 32, 128>;
  D.19665 = D.19638 & 8;
  if (D.19665 != 0) goto <D.19820>; else goto <D.19821>;
  <D.19820>:
  D.19822 = image->module_name;
  monoeg_g_free (D.19822);
  mono_dynamic_image_free (image);
  <D.19821>:
  mono_profiler_module_event (image, 3);
  D.19613 = 1;
  return D.19613;
}


free_hash_table (void * key, void * val, void * user_data)
{
  monoeg_g_hash_table_destroy (val);
}


free_array_cache_entry (void * key, void * val, void * user_data)
{
  monoeg_g_slist_free (val);
}


InterlockedDecrement (volatile gint32 * val)
{
  gint32 D.19824;
  unsigned int D.19825;

  D.19825 = __sync_sub_and_fetch_4 (val, 1);
  D.19824 = (gint32) D.19825;
  return D.19824;
}


mono_image_invoke_unload_hook (struct MonoImage * image)
{
  void (*<T1ac7>) (struct MonoImage *, void *) D.19827;
  void * D.19828;
  struct GSList * l;
  struct ImageUnloadHook * hook;

  l = image_unload_hooks;
  goto <D.17956>;
  <D.17955>:
  hook = l->data;
  D.19827 = hook->func;
  D.19828 = hook->user_data;
  D.19827 (image, D.19828);
  l = l->next;
  <D.17956>:
  if (l != 0B) goto <D.17955>; else goto <D.17957>;
  <D.17957>:
}


free_hash (struct GHashTable * hash)
{
  if (hash != 0B) goto <D.19829>; else goto <D.19830>;
  <D.19829>:
  monoeg_g_hash_table_destroy (hash);
  <D.19830>:
}


mono_image_close_finish (struct MonoImage * image)
{
  struct MonoAssembly * * D.19831;
  unsigned int D.19834;
  unsigned int D.19835;
  unsigned int i.49;
  unsigned int D.19839;
  struct MonoAssembly * * D.19840;
  struct MonoAssembly * D.19841;
  struct MonoAssembly * D.19842;
  int D.19845;
  struct MonoImage * * D.19846;
  struct MonoImage * * D.19847;
  struct MonoImage * D.19848;
  unsigned int i.50;
  unsigned int D.19852;
  struct MonoMemPool * D.19855;
  unsigned int D.19856;
  struct MonoPerfCounters * mono_perfcounters.51;
  unsigned int D.19858;
  unsigned int D.19859;
  int debug_assembly_unload.52;
  int i;

  D.19831 = image->references;
  if (D.19831 != 0B) goto <D.19832>; else goto <D.19833>;
  <D.19832>:
  D.19834 = BIT_FIELD_REF <*image, 32, 128>;
  D.19835 = D.19834 & 8;
  if (D.19835 == 0) goto <D.19836>; else goto <D.19837>;
  <D.19836>:
  i = 0;
  goto <D.18395>;
  <D.18394>:
  D.19831 = image->references;
  i.49 = (unsigned int) i;
  D.19839 = i.49 * 4;
  D.19840 = D.19831 + D.19839;
  D.19841 = *D.19840;
  D.19842 = D.19841 + 4294967295;
  if (D.19842 <= 4294967293B) goto <D.19843>; else goto <D.19844>;
  <D.19843>:
  D.19831 = image->references;
  i.49 = (unsigned int) i;
  D.19839 = i.49 * 4;
  D.19840 = D.19831 + D.19839;
  D.19841 = *D.19840;
  mono_assembly_close_finish (D.19841);
  <D.19844>:
  i = i + 1;
  <D.18395>:
  D.19845 = image->nreferences;
  if (D.19845 > i) goto <D.18394>; else goto <D.18396>;
  <D.18396>:
  D.19831 = image->references;
  monoeg_g_free (D.19831);
  image->references = 0B;
  <D.19837>:
  <D.19833>:
  i = 0;
  goto <D.18398>;
  <D.18397>:
  D.19846 = image->modules;
  i.49 = (unsigned int) i;
  D.19839 = i.49 * 4;
  D.19847 = D.19846 + D.19839;
  D.19848 = *D.19847;
  if (D.19848 != 0B) goto <D.19849>; else goto <D.19850>;
  <D.19849>:
  D.19846 = image->modules;
  i.49 = (unsigned int) i;
  D.19839 = i.49 * 4;
  D.19847 = D.19846 + D.19839;
  D.19848 = *D.19847;
  mono_image_close_finish (D.19848);
  <D.19850>:
  i = i + 1;
  <D.18398>:
  i.50 = (unsigned int) i;
  D.19852 = image->module_count;
  if (i.50 < D.19852) goto <D.18397>; else goto <D.18399>;
  <D.18399>:
  D.19846 = image->modules;
  if (D.19846 != 0B) goto <D.19853>; else goto <D.19854>;
  <D.19853>:
  D.19846 = image->modules;
  monoeg_g_free (D.19846);
  <D.19854>:
  D.19855 = image->mempool;
  D.19856 = mono_mempool_get_allocated (D.19855);
  mono_perfcounters.51 = mono_perfcounters;
  mono_perfcounters.51 = mono_perfcounters;
  D.19858 = mono_perfcounters.51->loader_bytes;
  D.19859 = D.19858 - D.19856;
  mono_perfcounters.51->loader_bytes = D.19859;
  D.19834 = BIT_FIELD_REF <*image, 32, 128>;
  D.19835 = D.19834 & 8;
  if (D.19835 == 0) goto <D.19860>; else goto <D.19861>;
  <D.19860>:
  debug_assembly_unload.52 = debug_assembly_unload;
  if (debug_assembly_unload.52 != 0) goto <D.19863>; else goto <D.19864>;
  <D.19863>:
  D.19855 = image->mempool;
  mono_mempool_invalidate (D.19855);
  goto <D.19865>;
  <D.19864>:
  D.19855 = image->mempool;
  mono_mempool_destroy (D.19855);
  monoeg_g_free (image);
  <D.19865>:
  goto <D.19866>;
  <D.19861>:
  debug_assembly_unload.52 = debug_assembly_unload;
  if (debug_assembly_unload.52 != 0) goto <D.19867>; else goto <D.19868>;
  <D.19867>:
  D.19855 = image->mempool;
  mono_mempool_invalidate (D.19855);
  goto <D.19869>;
  <D.19868>:
  D.19855 = image->mempool;
  mono_mempool_destroy (D.19855);
  <D.19869>:
  <D.19866>:
}


mono_image_close (struct MonoImage * image)
{
  int D.19870;

  D.19870 = mono_image_close_except_pools (image);
  if (D.19870 != 0) goto <D.19871>; else goto <D.19872>;
  <D.19871>:
  mono_image_close_finish (image);
  <D.19872>:
}


mono_image_strerror (MonoImageOpenStatus status)
{
  const char * D.19873;
  int * D.19874;
  int D.19875;

  switch (status) <default: <D.19876>, case 0: <D.18406>, case 1: <D.18407>, case 2: <D.18409>, case 3: <D.18408>>
  <D.18406>:
  D.19873 = "success";
  return D.19873;
  <D.18407>:
  D.19874 = __errno_location ();
  D.19875 = *D.19874;
  D.19873 = strerror (D.19875);
  return D.19873;
  <D.18408>:
  D.19873 = "File does not contain a valid CIL image";
  return D.19873;
  <D.18409>:
  D.19873 = "An assembly was referenced, but could not be found";
  return D.19873;
  <D.19876>:
  D.19873 = "Internal error";
  return D.19873;
}


mono_image_lookup_resource (struct MonoImage * image, guint32 res_id, guint32 lang_id, gunichar2 * name)
{
  void * D.19880;
  unsigned int D.19889;
  short unsigned int D.19892;
  int D.19893;
  short unsigned int D.19894;
  int D.19895;
  int D.19896;
  unsigned int D.19897;
  struct MonoCLIImageInfo * info;
  struct MonoDotNetHeader * header;
  struct MonoPEDatadir * datadir;
  struct MonoPEDirEntry * rsrc;
  struct MonoPEResourceDir * resource_dir;
  struct MonoPEResourceDirEntry * res_entries;
  guint32 entries;
  guint32 i;

  if (image == 0B) goto <D.19878>; else goto <D.19879>;
  <D.19878>:
  D.19880 = 0B;
  return D.19880;
  <D.19879>:
  mono_image_ensure_section_idx (image, 1);
  info = image->image_info;
  if (info == 0B) goto <D.19881>; else goto <D.19882>;
  <D.19881>:
  D.19880 = 0B;
  return D.19880;
  <D.19882>:
  header = &info->cli_header;
  if (header == 0B) goto <D.19883>; else goto <D.19884>;
  <D.19883>:
  D.19880 = 0B;
  return D.19880;
  <D.19884>:
  datadir = &header->datadir;
  if (datadir == 0B) goto <D.19885>; else goto <D.19886>;
  <D.19885>:
  D.19880 = 0B;
  return D.19880;
  <D.19886>:
  rsrc = &datadir->pe_resource_table;
  if (rsrc == 0B) goto <D.19887>; else goto <D.19888>;
  <D.19887>:
  D.19880 = 0B;
  return D.19880;
  <D.19888>:
  D.19889 = rsrc->rva;
  resource_dir = mono_image_rva_map (image, D.19889);
  if (resource_dir == 0B) goto <D.19890>; else goto <D.19891>;
  <D.19890>:
  D.19880 = 0B;
  return D.19880;
  <D.19891>:
  D.19892 = resource_dir->res_named_entries;
  D.19893 = (int) D.19892;
  D.19894 = resource_dir->res_id_entries;
  D.19895 = (int) D.19894;
  D.19896 = D.19893 + D.19895;
  entries = (guint32) D.19896;
  res_entries = resource_dir + 16;
  i = 0;
  goto <D.18451>;
  <D.18450>:
  {
    struct MonoPEResourceDirEntry * entry;
    void * ret;

    D.19897 = i * 8;
    entry = res_entries + D.19897;
    ret = mono_image_walk_resource_tree (info, res_id, lang_id, name, entry, resource_dir, 0);
    if (ret != 0B) goto <D.19898>; else goto <D.19899>;
    <D.19898>:
    D.19880 = ret;
    return D.19880;
    <D.19899>:
  }
  i = i + 1;
  <D.18451>:
  if (i < entries) goto <D.18450>; else goto <D.18452>;
  <D.18452>:
  D.19880 = 0B;
  return D.19880;
}


mono_image_walk_resource_tree (struct MonoCLIImageInfo * info, guint32 res_id, guint32 lang_id, gunichar2 * name, struct MonoPEResourceDirEntry * entry, struct MonoPEResourceDir * root, guint32 level)
{
  unsigned int D.19901;
  unsigned int D.19902;
  unsigned int D.19903;
  unsigned int D.19904;
  void * D.19909;
  short unsigned int D.19926;
  int D.19927;
  short unsigned int D.19928;
  int D.19929;
  int D.19930;
  unsigned int D.19931;
  unsigned int D.19932;
  unsigned int D.19935;
  unsigned int D.19936;
  unsigned int D.19937;
  unsigned int D.19938;
  gboolean is_string;
  gboolean is_dir;
  guint32 name_offset;
  guint32 dir_offset;

  D.19901 = entry->name;
  D.19902 = D.19901 >> 31;
  is_string = (gboolean) D.19902;
  D.19901 = entry->name;
  name_offset = D.19901 & 2147483647;
  D.19903 = entry->dir;
  D.19904 = D.19903 >> 31;
  is_dir = (gboolean) D.19904;
  D.19903 = entry->dir;
  dir_offset = D.19903 & 2147483647;
  if (level == 0) goto <D.19905>; else goto <D.19906>;
  <D.19905>:
  if (is_string != 0) goto <D.19907>; else goto <D.19908>;
  <D.19907>:
  D.19909 = 0B;
  return D.19909;
  <D.19908>:
  goto <D.19910>;
  <D.19906>:
  if (level == 1) goto <D.19911>; else goto <D.19912>;
  <D.19911>:
  if (res_id != name_offset) goto <D.19913>; else goto <D.19914>;
  <D.19913>:
  D.19909 = 0B;
  return D.19909;
  <D.19914>:
  goto <D.19915>;
  <D.19912>:
  if (level == 2) goto <D.19916>; else goto <D.19917>;
  <D.19916>:
  if (is_string == 1) goto <D.19918>; else goto <D.19920>;
  <D.19920>:
  if (is_string == 0) goto <D.19921>; else goto <D.19919>;
  <D.19921>:
  if (lang_id != 0) goto <D.19922>; else goto <D.19919>;
  <D.19922>:
  if (name_offset != lang_id) goto <D.19918>; else goto <D.19919>;
  <D.19918>:
  D.19909 = 0B;
  return D.19909;
  <D.19919>:
  goto <D.19923>;
  <D.19917>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "image.c", 1829);
  <D.19923>:
  <D.19915>:
  <D.19910>:
  if (is_dir == 1) goto <D.19924>; else goto <D.19925>;
  <D.19924>:
  {
    struct MonoPEResourceDir * res_dir;
    struct MonoPEResourceDirEntry * sub_entries;
    guint32 entries;
    guint32 i;

    res_dir = root + dir_offset;
    sub_entries = res_dir + 16;
    D.19926 = res_dir->res_named_entries;
    D.19927 = (int) D.19926;
    D.19928 = res_dir->res_id_entries;
    D.19929 = (int) D.19928;
    D.19930 = D.19927 + D.19929;
    entries = (guint32) D.19930;
    i = 0;
    goto <D.18430>;
    <D.18429>:
    {
      struct MonoPEResourceDirEntry * sub_entry;
      void * ret;

      D.19931 = i * 8;
      sub_entry = sub_entries + D.19931;
      D.19932 = level + 1;
      ret = mono_image_walk_resource_tree (info, res_id, lang_id, name, sub_entry, root, D.19932);
      if (ret != 0B) goto <D.19933>; else goto <D.19934>;
      <D.19933>:
      D.19909 = ret;
      return D.19909;
      <D.19934>:
    }
    i = i + 1;
    <D.18430>:
    if (i < entries) goto <D.18429>; else goto <D.18431>;
    <D.18431>:
    D.19909 = 0B;
    return D.19909;
  }
  <D.19925>:
  {
    struct MonoPEResourceDataEntry * data_entry;
    struct MonoPEResourceDataEntry * res;

    data_entry = root + dir_offset;
    res = monoeg_malloc0 (16);
    D.19935 = data_entry->rde_data_offset;
    res->rde_data_offset = D.19935;
    D.19936 = data_entry->rde_size;
    res->rde_size = D.19936;
    D.19937 = data_entry->rde_codepage;
    res->rde_codepage = D.19937;
    D.19938 = data_entry->rde_reserved;
    res->rde_reserved = D.19938;
    D.19909 = res;
    return D.19909;
  }
}


mono_image_get_entry_point (struct MonoImage * image)
{
  uint32_t D.19940;
  void * D.19941;

  D.19941 = image->image_info;
  D.19940 = MEM[(struct MonoCLIImageInfo *)D.19941].cli_cli_header.ch_entry_point;
  return D.19940;
}


mono_image_get_resource (struct MonoImage * image, guint32 offset, guint32 * size)
{
  unsigned int D.19945;
  unsigned int D.19947;
  unsigned int D.19948;
  const char * D.19949;
  unsigned int D.19954;
  struct MonoCLIImageInfo * iinfo;
  struct MonoCLIHeader * ch;
  const char * data;

  iinfo = image->image_info;
  ch = &iinfo->cli_cli_header;
  D.19945 = ch->ch_resources.rva;
  if (D.19945 == 0) goto <D.19943>; else goto <D.19946>;
  <D.19946>:
  D.19947 = offset + 4;
  D.19948 = ch->ch_resources.size;
  if (D.19947 > D.19948) goto <D.19943>; else goto <D.19944>;
  <D.19943>:
  D.19949 = 0B;
  return D.19949;
  <D.19944>:
  D.19945 = ch->ch_resources.rva;
  data = mono_image_rva_map (image, D.19945);
  if (data == 0B) goto <D.19950>; else goto <D.19951>;
  <D.19950>:
  D.19949 = 0B;
  return D.19949;
  <D.19951>:
  data = data + offset;
  if (size != 0B) goto <D.19952>; else goto <D.19953>;
  <D.19952>:
  D.19954 = mono_read32 (data);
  *size = D.19954;
  <D.19953>:
  data = data + 4;
  D.19949 = data;
  return D.19949;
}


mono_image_load_file_for_image (struct MonoImage * image, int fileidx)
{
  <unnamed-unsigned:24> D.19959;
  int D.19960;
  struct MonoImage * D.19961;
  struct MonoImage * * D.19962;
  sizetype fileidx.53;
  sizetype D.19966;
  sizetype D.19967;
  struct MonoImage * * D.19968;
  struct MonoImage * D.19969;
  unsigned int D.19974;
  unsigned int D.19975;
  void * D.19976;
  int D.19977;
  char * D.19978;
  struct MonoAssembly * D.19981;
  struct MonoImage * * D.19982;
  unsigned int i.54;
  unsigned int D.19984;
  struct MonoImage * * D.19985;
  struct MonoImage * D.19986;
  struct MonoAssembly * D.19989;
  unsigned int i.55;
  unsigned int D.19993;
  char * base_dir;
  char * name;
  struct MonoImage * res;
  struct MonoTableInfo * t;
  const char * fname;
  guint32 fname_id;

  t = &image->tables[38];
  if (fileidx <= 0) goto <D.19956>; else goto <D.19958>;
  <D.19958>:
  D.19959 = t->rows;
  D.19960 = (int) D.19959;
  if (D.19960 < fileidx) goto <D.19956>; else goto <D.19957>;
  <D.19956>:
  D.19961 = 0B;
  return D.19961;
  <D.19957>:
  mono_loader_lock ();
  D.19962 = image->files;
  if (D.19962 != 0B) goto <D.19963>; else goto <D.19964>;
  <D.19963>:
  D.19962 = image->files;
  fileidx.53 = (sizetype) fileidx;
  D.19966 = fileidx.53 + 1073741823;
  D.19967 = D.19966 * 4;
  D.19968 = D.19962 + D.19967;
  D.19969 = *D.19968;
  if (D.19969 != 0B) goto <D.19970>; else goto <D.19971>;
  <D.19970>:
  mono_loader_unlock ();
  D.19962 = image->files;
  fileidx.53 = (sizetype) fileidx;
  D.19966 = fileidx.53 + 1073741823;
  D.19967 = D.19966 * 4;
  D.19968 = D.19962 + D.19967;
  D.19961 = *D.19968;
  return D.19961;
  <D.19971>:
  <D.19964>:
  D.19962 = image->files;
  if (D.19962 == 0B) goto <D.19972>; else goto <D.19973>;
  <D.19972>:
  D.19959 = t->rows;
  D.19974 = (unsigned int) D.19959;
  D.19975 = D.19974 * 4;
  D.19976 = monoeg_malloc0 (D.19975);
  image->files = D.19976;
  <D.19973>:
  D.19977 = fileidx + -1;
  fname_id = mono_metadata_decode_row_col (t, D.19977, 1);
  fname = mono_metadata_string_heap (image, fname_id);
  D.19978 = image->name;
  base_dir = monoeg_g_path_get_dirname (D.19978);
  name = monoeg_g_build_path ("/", base_dir, fname, 0B);
  res = mono_image_open (name, 0B);
  if (res != 0B) goto <D.19979>; else goto <D.19980>;
  <D.19979>:
  {
    int i;

    D.19981 = image->assembly;
    res->assembly = D.19981;
    i = 0;
    goto <D.18476>;
    <D.18475>:
    D.19982 = res->modules;
    i.54 = (unsigned int) i;
    D.19984 = i.54 * 4;
    D.19985 = D.19982 + D.19984;
    D.19986 = *D.19985;
    if (D.19986 != 0B) goto <D.19987>; else goto <D.19988>;
    <D.19987>:
    D.19982 = res->modules;
    i.54 = (unsigned int) i;
    D.19984 = i.54 * 4;
    D.19985 = D.19982 + D.19984;
    D.19986 = *D.19985;
    D.19989 = D.19986->assembly;
    if (D.19989 == 0B) goto <D.19990>; else goto <D.19991>;
    <D.19990>:
    D.19982 = res->modules;
    i.54 = (unsigned int) i;
    D.19984 = i.54 * 4;
    D.19985 = D.19982 + D.19984;
    D.19986 = *D.19985;
    D.19981 = image->assembly;
    D.19986->assembly = D.19981;
    <D.19991>:
    <D.19988>:
    i = i + 1;
    <D.18476>:
    i.55 = (unsigned int) i;
    D.19993 = res->module_count;
    if (i.55 < D.19993) goto <D.18475>; else goto <D.18477>;
    <D.18477>:
    D.19962 = image->files;
    fileidx.53 = (sizetype) fileidx;
    D.19966 = fileidx.53 + 1073741823;
    D.19967 = D.19966 * 4;
    D.19968 = D.19962 + D.19967;
    *D.19968 = res;
  }
  <D.19980>:
  mono_loader_unlock ();
  monoeg_g_free (name);
  monoeg_g_free (base_dir);
  D.19961 = res;
  return D.19961;
}


mono_image_get_strong_name (struct MonoImage * image, guint32 * size)
{
  unsigned int D.19997;
  unsigned int D.19999;
  const char * D.20000;
  struct MonoCLIImageInfo * iinfo;
  struct MonoPEDirEntry * de;
  const char * data;

  iinfo = image->image_info;
  de = &iinfo->cli_cli_header.ch_strong_name;
  D.19997 = de->size;
  if (D.19997 == 0) goto <D.19995>; else goto <D.19998>;
  <D.19998>:
  D.19999 = de->rva;
  if (D.19999 == 0) goto <D.19995>; else goto <D.19996>;
  <D.19995>:
  D.20000 = 0B;
  return D.20000;
  <D.19996>:
  D.19999 = de->rva;
  data = mono_image_rva_map (image, D.19999);
  if (data == 0B) goto <D.20001>; else goto <D.20002>;
  <D.20001>:
  D.20000 = 0B;
  return D.20000;
  <D.20002>:
  if (size != 0B) goto <D.20003>; else goto <D.20004>;
  <D.20003>:
  D.19997 = de->size;
  *size = D.19997;
  <D.20004>:
  D.20000 = data;
  return D.20000;
}


mono_image_strong_name_position (struct MonoImage * image, guint32 * size)
{
  unsigned int D.20008;
  unsigned int D.20012;
  uint32_t D.20013;
  uint32_t iftmp.56;
  struct MonoCLIImageInfo * iinfo;
  struct MonoPEDirEntry * de;
  guint32 pos;

  iinfo = image->image_info;
  de = &iinfo->cli_cli_header.ch_strong_name;
  if (size != 0B) goto <D.20006>; else goto <D.20007>;
  <D.20006>:
  D.20008 = de->size;
  *size = D.20008;
  <D.20007>:
  D.20008 = de->size;
  if (D.20008 == 0) goto <D.20009>; else goto <D.20011>;
  <D.20011>:
  D.20012 = de->rva;
  if (D.20012 == 0) goto <D.20009>; else goto <D.20010>;
  <D.20009>:
  D.20013 = 0;
  return D.20013;
  <D.20010>:
  D.20012 = de->rva;
  pos = mono_cli_rva_image_map (image, D.20012);
  if (pos != 4294967295) goto <D.20015>; else goto <D.20016>;
  <D.20015>:
  iftmp.56 = pos;
  goto <D.20017>;
  <D.20016>:
  iftmp.56 = 0;
  <D.20017>:
  D.20013 = iftmp.56;
  return D.20013;
}


mono_image_get_public_key (struct MonoImage * image, guint32 * size)
{
  unsigned int D.20019;
  unsigned int D.20020;
  int D.20025;
  unsigned int D.20026;
  const char * D.20027;
  unsigned int D.20028;
  unsigned int D.20029;
  struct MonoTableInfo * D.20032;
  const char * pubkey.57;
  const char * pubkey.58;
  const char * pubkey;
  guint32 len;
  guint32 tok;

  try
    {
      D.20019 = BIT_FIELD_REF <*image, 32, 128>;
      D.20020 = D.20019 & 8;
      if (D.20020 != 0) goto <D.20021>; else goto <D.20022>;
      <D.20021>:
      if (size != 0B) goto <D.20023>; else goto <D.20024>;
      <D.20023>:
      D.20025 = MEM[(struct MonoDynamicImage *)image].public_key_len;
      D.20026 = (unsigned int) D.20025;
      *size = D.20026;
      <D.20024>:
      D.20027 = MEM[(struct MonoDynamicImage *)image].public_key;
      return D.20027;
      <D.20022>:
      D.20028 = BIT_FIELD_REF <*image, 32, 3904>;
      D.20029 = D.20028 & 16777215;
      if (D.20029 != 1) goto <D.20030>; else goto <D.20031>;
      <D.20030>:
      D.20027 = 0B;
      return D.20027;
      <D.20031>:
      D.20032 = &image->tables[32];
      tok = mono_metadata_decode_row_col (D.20032, 0, 6);
      if (tok == 0) goto <D.20033>; else goto <D.20034>;
      <D.20033>:
      D.20027 = 0B;
      return D.20027;
      <D.20034>:
      pubkey.57 = mono_metadata_blob_heap (image, tok);
      pubkey = pubkey.57;
      pubkey.58 = pubkey;
      len = mono_metadata_decode_blob_size (pubkey.58, &pubkey);
      if (size != 0B) goto <D.20037>; else goto <D.20038>;
      <D.20037>:
      *size = len;
      <D.20038>:
      D.20027 = pubkey;
      return D.20027;
    }
  finally
    {
      pubkey = {CLOBBER};
    }
}


mono_image_get_name (struct MonoImage * image)
{
  const char * D.20041;

  D.20041 = image->assembly_name;
  return D.20041;
}


mono_image_get_filename (struct MonoImage * image)
{
  const char * D.20043;

  D.20043 = image->name;
  return D.20043;
}


mono_image_get_guid (struct MonoImage * image)
{
  const char * D.20045;

  D.20045 = image->guid;
  return D.20045;
}


mono_image_get_table_info (struct MonoImage * image, int table_id)
{
  unsigned int table_id.59;
  const struct MonoTableInfo * D.20050;

  table_id.59 = (unsigned int) table_id;
  if (table_id.59 > 44) goto <D.20048>; else goto <D.20049>;
  <D.20048>:
  D.20050 = 0B;
  return D.20050;
  <D.20049>:
  D.20050 = &image->tables[table_id];
  return D.20050;
}


mono_image_get_table_rows (struct MonoImage * image, int table_id)
{
  unsigned int table_id.60;
  int D.20055;
  <unnamed-unsigned:24> D.20056;

  table_id.60 = (unsigned int) table_id;
  if (table_id.60 > 44) goto <D.20053>; else goto <D.20054>;
  <D.20053>:
  D.20055 = 0;
  return D.20055;
  <D.20054>:
  D.20056 = image->tables[table_id].rows;
  D.20055 = (int) D.20056;
  return D.20055;
}


mono_table_info_get_rows (const struct MonoTableInfo * table)
{
  int D.20058;
  <unnamed-unsigned:24> D.20059;

  D.20059 = table->rows;
  D.20058 = (int) D.20059;
  return D.20058;
}


mono_image_get_assembly (struct MonoImage * image)
{
  struct MonoAssembly * D.20061;

  D.20061 = image->assembly;
  return D.20061;
}


mono_image_is_dynamic (struct MonoImage * image)
{
  mono_bool D.20063;
  <unnamed-unsigned:1> D.20064;

  D.20064 = image->dynamic;
  D.20063 = (mono_bool) D.20064;
  return D.20063;
}


mono_image_has_authenticode_entry (struct MonoImage * image)
{
  mono_bool D.20066;
  int iftmp.61;
  unsigned int D.20070;
  unsigned int D.20072;
  struct MonoCLIImageInfo * iinfo;
  struct MonoDotNetHeader * header;
  struct MonoPEDirEntry * de;

  iinfo = image->image_info;
  header = &iinfo->cli_header;
  de = &header->datadir.pe_certificate_table;
  D.20070 = de->rva;
  if (D.20070 != 0) goto <D.20071>; else goto <D.20068>;
  <D.20071>:
  D.20072 = de->size;
  if (D.20072 > 8) goto <D.20073>; else goto <D.20068>;
  <D.20073>:
  iftmp.61 = 1;
  goto <D.20069>;
  <D.20068>:
  iftmp.61 = 0;
  <D.20069>:
  D.20066 = iftmp.61;
  return D.20066;
}


mono_image_alloc (struct MonoImage * image, guint size)
{
  struct MonoPerfCounters * mono_perfcounters.62;
  unsigned int D.20076;
  unsigned int D.20077;
  struct MonoMemPool * D.20078;
  void * D.20079;
  void * res;

  mono_perfcounters.62 = mono_perfcounters;
  mono_perfcounters.62 = mono_perfcounters;
  D.20076 = mono_perfcounters.62->loader_bytes;
  D.20077 = D.20076 + size;
  mono_perfcounters.62->loader_bytes = D.20077;
  mono_image_lock (image);
  D.20078 = image->mempool;
  res = mono_mempool_alloc (D.20078, size);
  mono_image_unlock (image);
  D.20079 = res;
  return D.20079;
}


mono_image_alloc0 (struct MonoImage * image, guint size)
{
  struct MonoPerfCounters * mono_perfcounters.63;
  unsigned int D.20082;
  unsigned int D.20083;
  struct MonoMemPool * D.20084;
  void * D.20085;
  void * res;

  mono_perfcounters.63 = mono_perfcounters;
  mono_perfcounters.63 = mono_perfcounters;
  D.20082 = mono_perfcounters.63->loader_bytes;
  D.20083 = D.20082 + size;
  mono_perfcounters.63->loader_bytes = D.20083;
  mono_image_lock (image);
  D.20084 = image->mempool;
  res = mono_mempool_alloc0 (D.20084, size);
  mono_image_unlock (image);
  D.20085 = res;
  return D.20085;
}


mono_image_strdup (struct MonoImage * image, const char * s)
{
  struct MonoPerfCounters * mono_perfcounters.64;
  unsigned int D.20088;
  unsigned int D.20089;
  unsigned int D.20090;
  struct MonoMemPool * D.20091;
  char * D.20092;
  char * res;

  mono_perfcounters.64 = mono_perfcounters;
  mono_perfcounters.64 = mono_perfcounters;
  D.20088 = mono_perfcounters.64->loader_bytes;
  D.20089 = strlen (s);
  D.20090 = D.20088 + D.20089;
  mono_perfcounters.64->loader_bytes = D.20090;
  mono_image_lock (image);
  D.20091 = image->mempool;
  res = mono_mempool_strdup (D.20091, s);
  mono_image_unlock (image);
  D.20092 = res;
  return D.20092;
}


g_list_prepend_image (struct MonoImage * image, struct GList * list, void * data)
{
  struct GList * iftmp.65;
  struct GList * D.20098;
  struct GList * D.20103;
  struct GList * new_list;

  new_list = mono_image_alloc (image, 12);
  new_list->data = data;
  if (list != 0B) goto <D.20095>; else goto <D.20096>;
  <D.20095>:
  iftmp.65 = list->prev;
  goto <D.20097>;
  <D.20096>:
  iftmp.65 = 0B;
  <D.20097>:
  new_list->prev = iftmp.65;
  new_list->next = list;
  D.20098 = new_list->prev;
  if (D.20098 != 0B) goto <D.20099>; else goto <D.20100>;
  <D.20099>:
  D.20098 = new_list->prev;
  D.20098->next = new_list;
  <D.20100>:
  if (list != 0B) goto <D.20101>; else goto <D.20102>;
  <D.20101>:
  list->prev = new_list;
  <D.20102>:
  D.20103 = new_list;
  return D.20103;
}


g_slist_append_image (struct MonoImage * image, struct GSList * list, void * data)
{
  struct GSList * D.20105;
  struct GSList * new_list;

  new_list = mono_image_alloc (image, 8);
  new_list->data = data;
  new_list->next = 0B;
  D.20105 = monoeg_g_slist_concat (list, new_list);
  return D.20105;
}


mono_image_lock (struct MonoImage * image)
{
  union mono_mutex_t * D.20107;
  _Bool D.20110;
  long int D.20111;
  long int D.20112;

  {
    int ret;

    D.20107 = &image->lock.mutex;
    ret = pthread_mutex_lock (D.20107);
    if (ret != 0) goto <D.20108>; else goto <D.20109>;
    <D.20108>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20109>:
    D.20110 = ret != 0;
    D.20111 = (long int) D.20110;
    D.20112 = __builtin_expect (D.20111, 0);
    if (D.20112 != 0) goto <D.20113>; else goto <D.20114>;
    <D.20113>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 2304, "ret == 0");
    <D.20114>:
  }
}


mono_image_unlock (struct MonoImage * image)
{
  union mono_mutex_t * D.20115;
  _Bool D.20118;
  long int D.20119;
  long int D.20120;

  {
    int ret;

    D.20115 = &image->lock.mutex;
    ret = pthread_mutex_unlock (D.20115);
    if (ret != 0) goto <D.20116>; else goto <D.20117>;
    <D.20116>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20117>:
    D.20118 = ret != 0;
    D.20119 = (long int) D.20118;
    D.20120 = __builtin_expect (D.20119, 0);
    if (D.20120 != 0) goto <D.20121>; else goto <D.20122>;
    <D.20121>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 2310, "ret == 0");
    <D.20122>:
  }
}


mono_image_property_lookup (struct MonoImage * image, void * subject, guint32 property)
{
  struct MonoPropertyHash * D.20123;
  void * D.20124;
  void * res;

  mono_image_lock (image);
  D.20123 = image->property_hash;
  res = mono_property_hash_lookup (D.20123, subject, property);
  mono_image_unlock (image);
  D.20124 = res;
  return D.20124;
}


mono_image_property_insert (struct MonoImage * image, void * subject, guint32 property, void * value)
{
  struct MonoPropertyHash * D.20126;

  mono_image_lock (image);
  D.20126 = image->property_hash;
  mono_property_hash_insert (D.20126, subject, property, value);
  mono_image_unlock (image);
}


mono_image_property_remove (struct MonoImage * image, void * subject)
{
  struct MonoPropertyHash * D.20127;

  mono_image_lock (image);
  D.20127 = image->property_hash;
  mono_property_hash_remove_object (D.20127, subject);
  mono_image_unlock (image);
}


mono_image_append_class_to_reflection_info_set (struct MonoClass * class)
{
  unsigned int D.20128;
  unsigned int D.20129;
  _Bool D.20130;
  long int D.20131;
  long int D.20132;
  struct MonoMemPool * D.20135;
  struct GSList * D.20136;
  struct GSList * D.20137;
  struct MonoImage * image;

  image = class->image;
  D.20128 = BIT_FIELD_REF <*image, 32, 128>;
  D.20129 = D.20128 & 8;
  D.20130 = D.20129 == 0;
  D.20131 = (long int) D.20130;
  D.20132 = __builtin_expect (D.20131, 0);
  if (D.20132 != 0) goto <D.20133>; else goto <D.20134>;
  <D.20133>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image.c", 2367, "image->dynamic");
  <D.20134>:
  mono_image_lock (image);
  D.20135 = image->mempool;
  D.20136 = image->reflection_info_unregister_classes;
  D.20137 = g_slist_prepend_mempool (D.20135, D.20136, class);
  image->reflection_info_unregister_classes = D.20137;
  mono_image_unlock (image);
}


g_slist_prepend_mempool (struct MonoMemPool * mp, struct GSList * list, void * data)
{
  struct GSList * D.20138;
  struct GSList * new_list;

  new_list = mono_mempool_alloc (mp, 8);
  new_list->data = data;
  new_list->next = list;
  D.20138 = new_list;
  return D.20138;
}


