mono_public_tokens_are_equal (const unsigned char * pubt1, const unsigned char * pubt2)
{
  gboolean D.19007;
  int D.19008;
  _Bool D.19009;

  D.19008 = memcmp (pubt1, pubt2, 16);
  D.19009 = D.19008 == 0;
  D.19007 = (gboolean) D.19009;
  return D.19007;
}


mono_set_assemblies_path (const char * path)
{
  char * * assemblies_path.0;
  char * D.19014;
  char D.19015;
  char * * dest.1;
  const gchar * D.19019;
  int D.19024;
  char * * splitted;
  char * * dest;

  splitted = monoeg_g_strsplit (path, ":", 1000);
  assemblies_path.0 = assemblies_path;
  if (assemblies_path.0 != 0B) goto <D.19012>; else goto <D.19013>;
  <D.19012>:
  assemblies_path.0 = assemblies_path;
  monoeg_g_strfreev (assemblies_path.0);
  <D.19013>:
  dest = splitted;
  assemblies_path = dest;
  goto <D.17851>;
  <D.17850>:
  D.19014 = *splitted;
  D.19015 = *D.19014;
  if (D.19015 != 0) goto <D.19016>; else goto <D.19017>;
  <D.19016>:
  dest.1 = dest;
  dest = dest.1 + 8;
  D.19014 = *splitted;
  *dest.1 = D.19014;
  <D.19017>:
  splitted = splitted + 8;
  <D.17851>:
  D.19014 = *splitted;
  if (D.19014 != 0B) goto <D.17850>; else goto <D.17852>;
  <D.17852>:
  D.19014 = *splitted;
  *dest = D.19014;
  D.19019 = monoeg_g_getenv ("MONO_DEBUG");
  if (D.19019 == 0B) goto <D.19020>; else goto <D.19021>;
  <D.19020>:
  return;
  <D.19021>:
  splitted = assemblies_path;
  goto <D.17854>;
  <D.17853>:
  D.19014 = *splitted;
  D.19015 = *D.19014;
  if (D.19015 != 0) goto <D.19022>; else goto <D.19023>;
  <D.19022>:
  D.19014 = *splitted;
  D.19024 = monoeg_g_file_test (D.19014, 4);
  if (D.19024 == 0) goto <D.19025>; else goto <D.19026>;
  <D.19025>:
  D.19014 = *splitted;
  monoeg_g_log (0B, 16, "\'%s\' in MONO_PATH doesn\'t exist or has wrong permissions.", D.19014);
  <D.19026>:
  <D.19023>:
  splitted = splitted + 8;
  <D.17854>:
  D.19014 = *splitted;
  if (D.19014 != 0B) goto <D.17853>; else goto <D.17855>;
  <D.17855>:
}


mono_assembly_names_equal (struct MonoAssemblyName * l, struct MonoAssemblyName * r)
{
  const char * D.19030;
  const char * D.19032;
  mono_bool D.19033;
  int D.17927;
  const char * D.19036;
  const char * D.19039;
  int D.17936;
  long unsigned int D.19044;
  long unsigned int D.19045;
  long unsigned int D.19046;
  long unsigned int D.19047;
  unsigned char D.19056;
  unsigned char D.19058;
  mono_byte[17] * D.19059;
  mono_byte[17] * D.19060;
  int D.19061;

  D.19030 = l->name;
  if (D.19030 == 0B) goto <D.19028>; else goto <D.19031>;
  <D.19031>:
  D.19032 = r->name;
  if (D.19032 == 0B) goto <D.19028>; else goto <D.19029>;
  <D.19028>:
  D.19033 = 0;
  return D.19033;
  <D.19029>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.19030 = l->name;
    D.19032 = r->name;
    D.17927 = __builtin_strcmp (D.19030, D.19032);
  }
  if (D.17927 != 0) goto <D.19034>; else goto <D.19035>;
  <D.19034>:
  D.19033 = 0;
  return D.19033;
  <D.19035>:
  D.19036 = l->culture;
  if (D.19036 != 0B) goto <D.19037>; else goto <D.19038>;
  <D.19037>:
  D.19039 = r->culture;
  if (D.19039 != 0B) goto <D.19040>; else goto <D.19041>;
  <D.19040>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.19036 = l->culture;
    D.19039 = r->culture;
    D.17936 = __builtin_strcmp (D.19036, D.19039);
  }
  if (D.17936 != 0) goto <D.19042>; else goto <D.19043>;
  <D.19042>:
  D.19033 = 0;
  return D.19033;
  <D.19043>:
  <D.19041>:
  <D.19038>:
  D.19044 = BIT_FIELD_REF <*l, 64, 512>;
  D.19045 = D.19044;
  D.19046 = BIT_FIELD_REF <*r, 64, 512>;
  D.19047 = D.19046;
  if (D.19045 != D.19047) goto <D.19048>; else goto <D.19049>;
  <D.19048>:
  D.19044 = BIT_FIELD_REF <*l, 64, 512>;
  D.19045 = D.19044;
  if (D.19045 != 0) goto <D.19050>; else goto <D.19051>;
  <D.19050>:
  D.19046 = BIT_FIELD_REF <*r, 64, 512>;
  D.19047 = D.19046;
  if (D.19047 != 0) goto <D.19052>; else goto <D.19053>;
  <D.19052>:
  D.19033 = 0;
  return D.19033;
  <D.19053>:
  <D.19051>:
  <D.19049>:
  D.19056 = l->public_key_token[0];
  if (D.19056 == 0) goto <D.19054>; else goto <D.19057>;
  <D.19057>:
  D.19058 = r->public_key_token[0];
  if (D.19058 == 0) goto <D.19054>; else goto <D.19055>;
  <D.19054>:
  D.19033 = 1;
  return D.19033;
  <D.19055>:
  D.19059 = &l->public_key_token;
  D.19060 = &r->public_key_token;
  D.19061 = mono_public_tokens_are_equal (D.19059, D.19060);
  if (D.19061 == 0) goto <D.19062>; else goto <D.19063>;
  <D.19062>:
  D.19033 = 0;
  return D.19033;
  <D.19063>:
  D.19033 = 1;
  return D.19033;
}


mono_assembly_setrootdir (const char * root_dir)
{
  gchar * D.19065;

  D.19065 = monoeg_strdup (root_dir);
  default_path[0] = D.19065;
}


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

  if (str != 0B) goto <D.19066>; else goto <D.19067>;
  <D.19066>:
  D.19068 = __strdup (str);
  return D.19068;
  <D.19067>:
  D.19068 = 0B;
  return D.19068;
}


mono_assembly_getrootdir ()
{
  const char * D.19070;

  D.19070 = default_path[0];
  return D.19070;
}


mono_set_dirs (const char * assembly_dir, const char * config_dir)
{
  if (assembly_dir == 0B) goto <D.19072>; else goto <D.19073>;
  <D.19072>:
  assembly_dir = "/usr/lib";
  <D.19073>:
  if (config_dir == 0B) goto <D.19074>; else goto <D.19075>;
  <D.19074>:
  config_dir = "/etc";
  <D.19075>:
  mono_assembly_setrootdir (assembly_dir);
  mono_set_config_dir (config_dir);
}


mono_set_rootdir ()
{
  long int D.19076;
  int D.19079;
  long int D.19080;
  char buf[4096];
  int s;
  char * str;

  try
    {
      D.19076 = readlink ("/proc/self/exe", &buf, 4095);
      s = (int) D.19076;
      if (s != -1) goto <D.19077>; else goto <D.19078>;
      <D.19077>:
      buf[s] = 0;
      set_dirs (&buf);
      return;
      <D.19078>:
      D.19079 = getpid ();
      str = monoeg_g_strdup_printf ("/proc/%d/path/a.out", D.19079);
      D.19080 = readlink (str, &buf, 4095);
      s = (int) D.19080;
      monoeg_g_free (str);
      if (s != -1) goto <D.19081>; else goto <D.19082>;
      <D.19081>:
      buf[s] = 0;
      set_dirs (&buf);
      return;
      <D.19082>:
      fallback ();
    }
  finally
    {
      buf = {CLOBBER};
    }
}


readlink (const char * restrict __path, char * restrict __buf, size_t __len)
{
  long unsigned int D.19086;
  int D.19089;
  ssize_t D.19092;
  long unsigned int D.19093;
  long unsigned int D.19094;
  long unsigned int D.19097;

  D.19086 = __builtin_object_size (__buf, 1);
  if (D.19086 != 18446744073709551615) goto <D.19087>; else goto <D.19088>;
  <D.19087>:
  D.19089 = __builtin_constant_p (__len);
  if (D.19089 == 0) goto <D.19090>; else goto <D.19091>;
  <D.19090>:
  D.19093 = __builtin_object_size (__buf, 1);
  D.19092 = __readlink_chk (__path, __buf, __len, D.19093);
  return D.19092;
  <D.19091>:
  D.19094 = __builtin_object_size (__buf, 1);
  if (D.19094 < __len) goto <D.19095>; else goto <D.19096>;
  <D.19095>:
  D.19097 = __builtin_object_size (__buf, 1);
  D.19092 = __readlink_chk_warn (__path, __buf, __len, D.19097);
  return D.19092;
  <D.19096>:
  <D.19088>:
  D.19092 = __readlink_alias (__path, __buf, __len);
  return D.19092;
}


set_dirs (char * exe)
{
  int D.19101;
  int D.19103;
  char * base;
  char * config;
  char * lib;
  char * mono;
  struct stat buf;

  try
    {
      D.19101 = strncmp (exe, "/usr/bin/", 9);
      if (D.19101 == 0) goto <D.19099>; else goto <D.19102>;
      <D.19102>:
      base = compute_base (exe);
      if (base == 0B) goto <D.19099>; else goto <D.19100>;
      <D.19099>:
      fallback ();
      return;
      <D.19100>:
      config = monoeg_g_build_path ("/", base, "etc", 0B);
      lib = monoeg_g_build_path ("/", base, "lib", 0B);
      mono = monoeg_g_build_path ("/", lib, "mono/2.0", 0B);
      D.19103 = stat (mono, &buf);
      if (D.19103 == -1) goto <D.19104>; else goto <D.19105>;
      <D.19104>:
      fallback ();
      goto <D.19106>;
      <D.19105>:
      mono_set_dirs (lib, config);
      <D.19106>:
      monoeg_g_free (config);
      monoeg_g_free (lib);
      monoeg_g_free (mono);
    }
  finally
    {
      buf = {CLOBBER};
    }
}


compute_base (char * path)
{
  char * D.19112;
  int D.17971;
  int iftmp.2;
  int D.17970;
  const char[6] * D.19116;
  unsigned char D.19117;
  int D.19118;
  unsigned char D.19119;
  int D.19120;
  const unsigned char * D.19125;
  unsigned char D.19126;
  int D.19127;
  const unsigned char * D.19128;
  unsigned char D.19129;
  int D.19130;
  const unsigned char * D.19135;
  unsigned char D.19136;
  int D.19137;
  const unsigned char * D.19138;
  unsigned char D.19139;
  int D.19140;
  const unsigned char * D.19145;
  unsigned char D.19146;
  int D.19147;
  const unsigned char * D.19148;
  unsigned char D.19149;
  int D.19150;
  int D.17980;
  int iftmp.3;
  int D.17979;
  const char[11] * D.19157;
  unsigned char D.19158;
  int D.19159;
  unsigned char D.19160;
  int D.19161;
  const unsigned char * D.19166;
  unsigned char D.19167;
  int D.19168;
  const unsigned char * D.19169;
  unsigned char D.19170;
  int D.19171;
  const unsigned char * D.19176;
  unsigned char D.19177;
  int D.19178;
  const unsigned char * D.19179;
  unsigned char D.19180;
  int D.19181;
  const unsigned char * D.19186;
  unsigned char D.19187;
  int D.19188;
  const unsigned char * D.19189;
  unsigned char D.19190;
  int D.19191;
  int D.17989;
  int iftmp.4;
  int D.17988;
  const char[8] * D.19198;
  unsigned char D.19199;
  int D.19200;
  unsigned char D.19201;
  int D.19202;
  const unsigned char * D.19207;
  unsigned char D.19208;
  int D.19209;
  const unsigned char * D.19210;
  unsigned char D.19211;
  int D.19212;
  const unsigned char * D.19217;
  unsigned char D.19218;
  int D.19219;
  const unsigned char * D.19220;
  unsigned char D.19221;
  int D.19222;
  const unsigned char * D.19227;
  unsigned char D.19228;
  int D.19229;
  const unsigned char * D.19230;
  unsigned char D.19231;
  int D.19232;
  int D.17998;
  int iftmp.5;
  int D.17997;
  const char[9] * D.19239;
  unsigned char D.19240;
  int D.19241;
  unsigned char D.19242;
  int D.19243;
  const unsigned char * D.19248;
  unsigned char D.19249;
  int D.19250;
  const unsigned char * D.19251;
  unsigned char D.19252;
  int D.19253;
  const unsigned char * D.19258;
  unsigned char D.19259;
  int D.19260;
  const unsigned char * D.19261;
  unsigned char D.19262;
  int D.19263;
  const unsigned char * D.19268;
  unsigned char D.19269;
  int D.19270;
  const unsigned char * D.19271;
  unsigned char D.19272;
  int D.19273;
  int D.18007;
  int iftmp.6;
  int D.18006;
  const char[6] * D.19280;
  unsigned char D.19281;
  int D.19282;
  unsigned char D.19283;
  int D.19284;
  const unsigned char * D.19289;
  unsigned char D.19290;
  int D.19291;
  const unsigned char * D.19292;
  unsigned char D.19293;
  int D.19294;
  const unsigned char * D.19299;
  unsigned char D.19300;
  int D.19301;
  const unsigned char * D.19302;
  unsigned char D.19303;
  int D.19304;
  const unsigned char * D.19309;
  unsigned char D.19310;
  int D.19311;
  const unsigned char * D.19312;
  unsigned char D.19313;
  int D.19314;
  int D.18016;
  int iftmp.7;
  int D.18015;
  const char[10] * D.19321;
  unsigned char D.19322;
  int D.19323;
  unsigned char D.19324;
  int D.19325;
  const unsigned char * D.19330;
  unsigned char D.19331;
  int D.19332;
  const unsigned char * D.19333;
  unsigned char D.19334;
  int D.19335;
  const unsigned char * D.19340;
  unsigned char D.19341;
  int D.19342;
  const unsigned char * D.19343;
  unsigned char D.19344;
  int D.19345;
  const unsigned char * D.19350;
  unsigned char D.19351;
  int D.19352;
  const unsigned char * D.19353;
  unsigned char D.19354;
  int D.19355;
  int D.18025;
  int iftmp.8;
  int D.18024;
  const char[5] * D.19364;
  unsigned char D.19365;
  int D.19366;
  unsigned char D.19367;
  int D.19368;
  const unsigned char * D.19373;
  unsigned char D.19374;
  int D.19375;
  const unsigned char * D.19376;
  unsigned char D.19377;
  int D.19378;
  const unsigned char * D.19383;
  unsigned char D.19384;
  int D.19385;
  const unsigned char * D.19386;
  unsigned char D.19387;
  int D.19388;
  const unsigned char * D.19393;
  unsigned char D.19394;
  int D.19395;
  const unsigned char * D.19396;
  unsigned char D.19397;
  int D.19398;
  char * p;

  p = strrchr (path, 47);
  if (p == 0B) goto <D.19110>; else goto <D.19111>;
  <D.19110>:
  D.19112 = 0B;
  return D.19112;
  <D.19111>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19116 = "/mono";
      D.19117 = MEM[(const unsigned char *)D.19116];
      D.19118 = (int) D.19117;
      D.19119 = *__s2;
      D.19120 = (int) D.19119;
      __result = D.19118 - D.19120;
      {
        if (__s2_len != 0) goto <D.19121>; else goto <D.19122>;
        <D.19121>:
        if (__result == 0) goto <D.19123>; else goto <D.19124>;
        <D.19123>:
        D.19125 = &MEM[(void *)"/mono" + 1B];
        D.19126 = *D.19125;
        D.19127 = (int) D.19126;
        D.19128 = __s2 + 1;
        D.19129 = *D.19128;
        D.19130 = (int) D.19129;
        __result = D.19127 - D.19130;
        if (__s2_len > 1) goto <D.19131>; else goto <D.19132>;
        <D.19131>:
        if (__result == 0) goto <D.19133>; else goto <D.19134>;
        <D.19133>:
        D.19135 = &MEM[(void *)"/mono" + 2B];
        D.19136 = *D.19135;
        D.19137 = (int) D.19136;
        D.19138 = __s2 + 2;
        D.19139 = *D.19138;
        D.19140 = (int) D.19139;
        __result = D.19137 - D.19140;
        if (__s2_len > 2) goto <D.19141>; else goto <D.19142>;
        <D.19141>:
        if (__result == 0) goto <D.19143>; else goto <D.19144>;
        <D.19143>:
        D.19145 = &MEM[(void *)"/mono" + 3B];
        D.19146 = *D.19145;
        D.19147 = (int) D.19146;
        D.19148 = __s2 + 3;
        D.19149 = *D.19148;
        D.19150 = (int) D.19149;
        __result = D.19147 - D.19150;
        <D.19144>:
        <D.19142>:
        <D.19134>:
        <D.19132>:
        <D.19124>:
        <D.19122>:
      }
      D.17970 = __result;
    }
    iftmp.2 = -D.17970;
    goto <D.19151>;
    <D.19115>:
    iftmp.2 = __builtin_strcmp (p, "/mono");
    <D.19151>:
    D.17971 = iftmp.2;
  }
  if (D.17971 != 0) goto <D.19152>; else goto <D.19153>;
  <D.19152>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19157 = "/mono-sgen";
      D.19158 = MEM[(const unsigned char *)D.19157];
      D.19159 = (int) D.19158;
      D.19160 = *__s2;
      D.19161 = (int) D.19160;
      __result = D.19159 - D.19161;
      {
        if (__s2_len != 0) goto <D.19162>; else goto <D.19163>;
        <D.19162>:
        if (__result == 0) goto <D.19164>; else goto <D.19165>;
        <D.19164>:
        D.19166 = &MEM[(void *)"/mono-sgen" + 1B];
        D.19167 = *D.19166;
        D.19168 = (int) D.19167;
        D.19169 = __s2 + 1;
        D.19170 = *D.19169;
        D.19171 = (int) D.19170;
        __result = D.19168 - D.19171;
        if (__s2_len > 1) goto <D.19172>; else goto <D.19173>;
        <D.19172>:
        if (__result == 0) goto <D.19174>; else goto <D.19175>;
        <D.19174>:
        D.19176 = &MEM[(void *)"/mono-sgen" + 2B];
        D.19177 = *D.19176;
        D.19178 = (int) D.19177;
        D.19179 = __s2 + 2;
        D.19180 = *D.19179;
        D.19181 = (int) D.19180;
        __result = D.19178 - D.19181;
        if (__s2_len > 2) goto <D.19182>; else goto <D.19183>;
        <D.19182>:
        if (__result == 0) goto <D.19184>; else goto <D.19185>;
        <D.19184>:
        D.19186 = &MEM[(void *)"/mono-sgen" + 3B];
        D.19187 = *D.19186;
        D.19188 = (int) D.19187;
        D.19189 = __s2 + 3;
        D.19190 = *D.19189;
        D.19191 = (int) D.19190;
        __result = D.19188 - D.19191;
        <D.19185>:
        <D.19183>:
        <D.19175>:
        <D.19173>:
        <D.19165>:
        <D.19163>:
      }
      D.17979 = __result;
    }
    iftmp.3 = -D.17979;
    goto <D.19192>;
    <D.19156>:
    iftmp.3 = __builtin_strcmp (p, "/mono-sgen");
    <D.19192>:
    D.17980 = iftmp.3;
  }
  if (D.17980 != 0) goto <D.19193>; else goto <D.19194>;
  <D.19193>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19198 = "/pedump";
      D.19199 = MEM[(const unsigned char *)D.19198];
      D.19200 = (int) D.19199;
      D.19201 = *__s2;
      D.19202 = (int) D.19201;
      __result = D.19200 - D.19202;
      {
        if (__s2_len != 0) goto <D.19203>; else goto <D.19204>;
        <D.19203>:
        if (__result == 0) goto <D.19205>; else goto <D.19206>;
        <D.19205>:
        D.19207 = &MEM[(void *)"/pedump" + 1B];
        D.19208 = *D.19207;
        D.19209 = (int) D.19208;
        D.19210 = __s2 + 1;
        D.19211 = *D.19210;
        D.19212 = (int) D.19211;
        __result = D.19209 - D.19212;
        if (__s2_len > 1) goto <D.19213>; else goto <D.19214>;
        <D.19213>:
        if (__result == 0) goto <D.19215>; else goto <D.19216>;
        <D.19215>:
        D.19217 = &MEM[(void *)"/pedump" + 2B];
        D.19218 = *D.19217;
        D.19219 = (int) D.19218;
        D.19220 = __s2 + 2;
        D.19221 = *D.19220;
        D.19222 = (int) D.19221;
        __result = D.19219 - D.19222;
        if (__s2_len > 2) goto <D.19223>; else goto <D.19224>;
        <D.19223>:
        if (__result == 0) goto <D.19225>; else goto <D.19226>;
        <D.19225>:
        D.19227 = &MEM[(void *)"/pedump" + 3B];
        D.19228 = *D.19227;
        D.19229 = (int) D.19228;
        D.19230 = __s2 + 3;
        D.19231 = *D.19230;
        D.19232 = (int) D.19231;
        __result = D.19229 - D.19232;
        <D.19226>:
        <D.19224>:
        <D.19216>:
        <D.19214>:
        <D.19206>:
        <D.19204>:
      }
      D.17988 = __result;
    }
    iftmp.4 = -D.17988;
    goto <D.19233>;
    <D.19197>:
    iftmp.4 = __builtin_strcmp (p, "/pedump");
    <D.19233>:
    D.17989 = iftmp.4;
  }
  if (D.17989 != 0) goto <D.19234>; else goto <D.19235>;
  <D.19234>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19239 = "/monodis";
      D.19240 = MEM[(const unsigned char *)D.19239];
      D.19241 = (int) D.19240;
      D.19242 = *__s2;
      D.19243 = (int) D.19242;
      __result = D.19241 - D.19243;
      {
        if (__s2_len != 0) goto <D.19244>; else goto <D.19245>;
        <D.19244>:
        if (__result == 0) goto <D.19246>; else goto <D.19247>;
        <D.19246>:
        D.19248 = &MEM[(void *)"/monodis" + 1B];
        D.19249 = *D.19248;
        D.19250 = (int) D.19249;
        D.19251 = __s2 + 1;
        D.19252 = *D.19251;
        D.19253 = (int) D.19252;
        __result = D.19250 - D.19253;
        if (__s2_len > 1) goto <D.19254>; else goto <D.19255>;
        <D.19254>:
        if (__result == 0) goto <D.19256>; else goto <D.19257>;
        <D.19256>:
        D.19258 = &MEM[(void *)"/monodis" + 2B];
        D.19259 = *D.19258;
        D.19260 = (int) D.19259;
        D.19261 = __s2 + 2;
        D.19262 = *D.19261;
        D.19263 = (int) D.19262;
        __result = D.19260 - D.19263;
        if (__s2_len > 2) goto <D.19264>; else goto <D.19265>;
        <D.19264>:
        if (__result == 0) goto <D.19266>; else goto <D.19267>;
        <D.19266>:
        D.19268 = &MEM[(void *)"/monodis" + 3B];
        D.19269 = *D.19268;
        D.19270 = (int) D.19269;
        D.19271 = __s2 + 3;
        D.19272 = *D.19271;
        D.19273 = (int) D.19272;
        __result = D.19270 - D.19273;
        <D.19267>:
        <D.19265>:
        <D.19257>:
        <D.19255>:
        <D.19247>:
        <D.19245>:
      }
      D.17997 = __result;
    }
    iftmp.5 = -D.17997;
    goto <D.19274>;
    <D.19238>:
    iftmp.5 = __builtin_strcmp (p, "/monodis");
    <D.19274>:
    D.17998 = iftmp.5;
  }
  if (D.17998 != 0) goto <D.19275>; else goto <D.19276>;
  <D.19275>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19280 = "/mint";
      D.19281 = MEM[(const unsigned char *)D.19280];
      D.19282 = (int) D.19281;
      D.19283 = *__s2;
      D.19284 = (int) D.19283;
      __result = D.19282 - D.19284;
      {
        if (__s2_len != 0) goto <D.19285>; else goto <D.19286>;
        <D.19285>:
        if (__result == 0) goto <D.19287>; else goto <D.19288>;
        <D.19287>:
        D.19289 = &MEM[(void *)"/mint" + 1B];
        D.19290 = *D.19289;
        D.19291 = (int) D.19290;
        D.19292 = __s2 + 1;
        D.19293 = *D.19292;
        D.19294 = (int) D.19293;
        __result = D.19291 - D.19294;
        if (__s2_len > 1) goto <D.19295>; else goto <D.19296>;
        <D.19295>:
        if (__result == 0) goto <D.19297>; else goto <D.19298>;
        <D.19297>:
        D.19299 = &MEM[(void *)"/mint" + 2B];
        D.19300 = *D.19299;
        D.19301 = (int) D.19300;
        D.19302 = __s2 + 2;
        D.19303 = *D.19302;
        D.19304 = (int) D.19303;
        __result = D.19301 - D.19304;
        if (__s2_len > 2) goto <D.19305>; else goto <D.19306>;
        <D.19305>:
        if (__result == 0) goto <D.19307>; else goto <D.19308>;
        <D.19307>:
        D.19309 = &MEM[(void *)"/mint" + 3B];
        D.19310 = *D.19309;
        D.19311 = (int) D.19310;
        D.19312 = __s2 + 3;
        D.19313 = *D.19312;
        D.19314 = (int) D.19313;
        __result = D.19311 - D.19314;
        <D.19308>:
        <D.19306>:
        <D.19298>:
        <D.19296>:
        <D.19288>:
        <D.19286>:
      }
      D.18006 = __result;
    }
    iftmp.6 = -D.18006;
    goto <D.19315>;
    <D.19279>:
    iftmp.6 = __builtin_strcmp (p, "/mint");
    <D.19315>:
    D.18007 = iftmp.6;
  }
  if (D.18007 != 0) goto <D.19316>; else goto <D.19317>;
  <D.19316>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19321 = "/monodiet";
      D.19322 = MEM[(const unsigned char *)D.19321];
      D.19323 = (int) D.19322;
      D.19324 = *__s2;
      D.19325 = (int) D.19324;
      __result = D.19323 - D.19325;
      {
        if (__s2_len != 0) goto <D.19326>; else goto <D.19327>;
        <D.19326>:
        if (__result == 0) goto <D.19328>; else goto <D.19329>;
        <D.19328>:
        D.19330 = &MEM[(void *)"/monodiet" + 1B];
        D.19331 = *D.19330;
        D.19332 = (int) D.19331;
        D.19333 = __s2 + 1;
        D.19334 = *D.19333;
        D.19335 = (int) D.19334;
        __result = D.19332 - D.19335;
        if (__s2_len > 1) goto <D.19336>; else goto <D.19337>;
        <D.19336>:
        if (__result == 0) goto <D.19338>; else goto <D.19339>;
        <D.19338>:
        D.19340 = &MEM[(void *)"/monodiet" + 2B];
        D.19341 = *D.19340;
        D.19342 = (int) D.19341;
        D.19343 = __s2 + 2;
        D.19344 = *D.19343;
        D.19345 = (int) D.19344;
        __result = D.19342 - D.19345;
        if (__s2_len > 2) goto <D.19346>; else goto <D.19347>;
        <D.19346>:
        if (__result == 0) goto <D.19348>; else goto <D.19349>;
        <D.19348>:
        D.19350 = &MEM[(void *)"/monodiet" + 3B];
        D.19351 = *D.19350;
        D.19352 = (int) D.19351;
        D.19353 = __s2 + 3;
        D.19354 = *D.19353;
        D.19355 = (int) D.19354;
        __result = D.19352 - D.19355;
        <D.19349>:
        <D.19347>:
        <D.19339>:
        <D.19337>:
        <D.19329>:
        <D.19327>:
      }
      D.18015 = __result;
    }
    iftmp.7 = -D.18015;
    goto <D.19356>;
    <D.19320>:
    iftmp.7 = __builtin_strcmp (p, "/monodiet");
    <D.19356>:
    D.18016 = iftmp.7;
  }
  if (D.18016 != 0) goto <D.19357>; else goto <D.19358>;
  <D.19357>:
  D.19112 = 0B;
  return D.19112;
  <D.19358>:
  <D.19317>:
  <D.19276>:
  <D.19235>:
  <D.19194>:
  <D.19153>:
  *p = 0;
  p = strrchr (path, 47);
  if (p == 0B) goto <D.19359>; else goto <D.19360>;
  <D.19359>:
  D.19112 = 0B;
  return D.19112;
  <D.19360>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.19364 = "/bin";
      D.19365 = MEM[(const unsigned char *)D.19364];
      D.19366 = (int) D.19365;
      D.19367 = *__s2;
      D.19368 = (int) D.19367;
      __result = D.19366 - D.19368;
      {
        if (__s2_len != 0) goto <D.19369>; else goto <D.19370>;
        <D.19369>:
        if (__result == 0) goto <D.19371>; else goto <D.19372>;
        <D.19371>:
        D.19373 = &MEM[(void *)"/bin" + 1B];
        D.19374 = *D.19373;
        D.19375 = (int) D.19374;
        D.19376 = __s2 + 1;
        D.19377 = *D.19376;
        D.19378 = (int) D.19377;
        __result = D.19375 - D.19378;
        if (__s2_len > 1) goto <D.19379>; else goto <D.19380>;
        <D.19379>:
        if (__result == 0) goto <D.19381>; else goto <D.19382>;
        <D.19381>:
        D.19383 = &MEM[(void *)"/bin" + 2B];
        D.19384 = *D.19383;
        D.19385 = (int) D.19384;
        D.19386 = __s2 + 2;
        D.19387 = *D.19386;
        D.19388 = (int) D.19387;
        __result = D.19385 - D.19388;
        if (__s2_len > 2) goto <D.19389>; else goto <D.19390>;
        <D.19389>:
        if (__result == 0) goto <D.19391>; else goto <D.19392>;
        <D.19391>:
        D.19393 = &MEM[(void *)"/bin" + 3B];
        D.19394 = *D.19393;
        D.19395 = (int) D.19394;
        D.19396 = __s2 + 3;
        D.19397 = *D.19396;
        D.19398 = (int) D.19397;
        __result = D.19395 - D.19398;
        <D.19392>:
        <D.19390>:
        <D.19382>:
        <D.19380>:
        <D.19372>:
        <D.19370>:
      }
      D.18024 = __result;
    }
    iftmp.8 = -D.18024;
    goto <D.19399>;
    <D.19363>:
    iftmp.8 = __builtin_strcmp (p, "/bin");
    <D.19399>:
    D.18025 = iftmp.8;
  }
  if (D.18025 != 0) goto <D.19400>; else goto <D.19401>;
  <D.19400>:
  D.19112 = 0B;
  return D.19112;
  <D.19401>:
  *p = 0;
  D.19112 = path;
  return D.19112;
}


stat (const char * __path, struct stat * __statbuf)
{
  int D.19403;

  D.19403 = __xstat (1, __path, __statbuf);
  return D.19403;
}


fallback ()
{
  mono_set_dirs ("/usr/lib", "/etc");
}


mono_assemblies_init ()
{
  const char * D.19405;

  D.19405 = mono_assembly_getrootdir ();
  if (D.19405 == 0B) goto <D.19406>; else goto <D.19407>;
  <D.19406>:
  mono_set_rootdir ();
  <D.19407>:
  check_path_env ();
  check_extra_gac_path_env ();
  InitializeCriticalSection (&assemblies_mutex);
  pthread_mutex_init (&assembly_binding_mutex, 0B);
}


check_path_env ()
{
  char * * assemblies_path.9;
  const char * path;

  path = monoeg_g_getenv ("MONO_PATH");
  if (path == 0B) goto <D.19408>; else goto <D.19410>;
  <D.19410>:
  assemblies_path.9 = assemblies_path;
  if (assemblies_path.9 != 0B) goto <D.19408>; else goto <D.19409>;
  <D.19408>:
  return;
  <D.19409>:
  mono_set_assemblies_path (path);
}


check_extra_gac_path_env ()
{
  char * * extra_gac_paths.10;
  char * D.19418;
  char D.19419;
  char * * dest.11;
  const gchar * D.19423;
  int D.19428;
  const char * path;
  char * * splitted;
  char * * dest;

  path = monoeg_g_getenv ("MONO_GAC_PREFIX");
  if (path == 0B) goto <D.19413>; else goto <D.19414>;
  <D.19413>:
  return;
  <D.19414>:
  splitted = monoeg_g_strsplit (path, ":", 1000);
  extra_gac_paths.10 = extra_gac_paths;
  if (extra_gac_paths.10 != 0B) goto <D.19416>; else goto <D.19417>;
  <D.19416>:
  extra_gac_paths.10 = extra_gac_paths;
  monoeg_g_strfreev (extra_gac_paths.10);
  <D.19417>:
  dest = splitted;
  extra_gac_paths = dest;
  goto <D.17867>;
  <D.17866>:
  D.19418 = *splitted;
  D.19419 = *D.19418;
  if (D.19419 != 0) goto <D.19420>; else goto <D.19421>;
  <D.19420>:
  dest.11 = dest;
  dest = dest.11 + 8;
  D.19418 = *splitted;
  *dest.11 = D.19418;
  <D.19421>:
  splitted = splitted + 8;
  <D.17867>:
  D.19418 = *splitted;
  if (D.19418 != 0B) goto <D.17866>; else goto <D.17868>;
  <D.17868>:
  D.19418 = *splitted;
  *dest = D.19418;
  D.19423 = monoeg_g_getenv ("MONO_DEBUG");
  if (D.19423 == 0B) goto <D.19424>; else goto <D.19425>;
  <D.19424>:
  return;
  <D.19425>:
  goto <D.17870>;
  <D.17869>:
  D.19418 = *splitted;
  D.19419 = *D.19418;
  if (D.19419 != 0) goto <D.19426>; else goto <D.19427>;
  <D.19426>:
  D.19418 = *splitted;
  D.19428 = monoeg_g_file_test (D.19418, 4);
  if (D.19428 == 0) goto <D.19429>; else goto <D.19430>;
  <D.19429>:
  D.19418 = *splitted;
  monoeg_g_log (0B, 16, "\'%s\' in MONO_GAC_PREFIX doesn\'t exist or has wrong permissions.", D.19418);
  <D.19430>:
  <D.19427>:
  splitted = splitted + 8;
  <D.17870>:
  D.19418 = *splitted;
  if (D.19418 != 0B) goto <D.17869>; else goto <D.17871>;
  <D.17871>:
}


mono_assembly_fill_assembly_name (struct MonoImage * image, struct MonoAssemblyName * aname)
{
  long unsigned int D.19432;
  long unsigned int D.19433;
  mono_bool D.19436;
  unsigned int D.19437;
  const char * D.19438;
  unsigned int D.19439;
  const char * D.19440;
  unsigned int D.19441;
  unsigned int D.19442;
  short unsigned int D.19443;
  unsigned int D.19444;
  short unsigned int D.19445;
  unsigned int D.19446;
  short unsigned int D.19447;
  unsigned int D.19448;
  short unsigned int D.19449;
  unsigned int D.19450;
  unsigned int D.19451;
  const char * pkey.12;
  const gchar * pkey.13;
  unsigned int D.19456;
  const mono_byte * D.19457;
  unsigned int len.14;
  mono_byte[17] * D.19459;
  const char * D.19463;
  void * D.19465;
  short unsigned int D.19466;
  unsigned int D.19467;
  int D.19468;
  int D.19472;
  struct MonoTableInfo * t;
  guint32 cols[9];
  gint32 machine;
  gint32 flags;

  try
    {
      t = &image->tables[32];
      D.19432 = BIT_FIELD_REF <*t, 64, 64>;
      D.19433 = D.19432 & 16777215;
      if (D.19433 == 0) goto <D.19434>; else goto <D.19435>;
      <D.19434>:
      D.19436 = 0;
      return D.19436;
      <D.19435>:
      mono_metadata_decode_row (t, 0, &cols, 9);
      aname->hash_len = 0;
      aname->hash_value = 0B;
      D.19437 = cols[7];
      D.19438 = mono_metadata_string_heap (image, D.19437);
      aname->name = D.19438;
      D.19439 = cols[8];
      D.19440 = mono_metadata_string_heap (image, D.19439);
      aname->culture = D.19440;
      D.19441 = cols[5];
      aname->flags = D.19441;
      D.19442 = cols[1];
      D.19443 = (short unsigned int) D.19442;
      aname->major = D.19443;
      D.19444 = cols[2];
      D.19445 = (short unsigned int) D.19444;
      aname->minor = D.19445;
      D.19446 = cols[3];
      D.19447 = (short unsigned int) D.19446;
      aname->build = D.19447;
      D.19448 = cols[4];
      D.19449 = (short unsigned int) D.19448;
      aname->revision = D.19449;
      D.19450 = cols[0];
      aname->hash_alg = D.19450;
      D.19451 = cols[6];
      if (D.19451 != 0) goto <D.19452>; else goto <D.19453>;
      <D.19452>:
      {
        guchar * token;
        gchar * encoded;
        const gchar * pkey;
        int len;

        try
          {
            token = monoeg_malloc (8);
            D.19451 = cols[6];
            pkey.12 = mono_metadata_blob_heap (image, D.19451);
            pkey = pkey.12;
            pkey.13 = pkey;
            D.19456 = mono_metadata_decode_blob_size (pkey.13, &pkey);
            len = (int) D.19456;
            pkey.13 = pkey;
            aname->public_key = pkey.13;
            D.19457 = aname->public_key;
            len.14 = (unsigned int) len;
            mono_digest_get_public_token (token, D.19457, len.14);
            encoded = encode_public_tok (token, 8);
            D.19459 = &aname->public_key_token;
            monoeg_g_strlcpy (D.19459, encoded, 17);
            monoeg_g_free (encoded);
            monoeg_g_free (token);
          }
        finally
          {
            pkey = {CLOBBER};
          }
      }
      goto <D.19460>;
      <D.19453>:
      aname->public_key = 0B;
      D.19459 = &aname->public_key_token;
      memset (D.19459, 0, 17);
      <D.19460>:
      D.19451 = cols[6];
      if (D.19451 != 0) goto <D.19461>; else goto <D.19462>;
      <D.19461>:
      D.19451 = cols[6];
      D.19463 = mono_metadata_blob_heap (image, D.19451);
      aname->public_key = D.19463;
      goto <D.19464>;
      <D.19462>:
      aname->public_key = 0B;
      <D.19464>:
      D.19465 = image->image_info;
      D.19466 = MEM[(struct MonoCLIImageInfo *)D.19465].cli_header.coff.coff_machine;
      machine = (gint32) D.19466;
      D.19465 = image->image_info;
      D.19467 = MEM[(struct MonoCLIImageInfo *)D.19465].cli_cli_header.ch_flags;
      flags = (gint32) D.19467;
      switch (machine) <default: <D.18078>, case 332: <D.18073>, case 452: <D.18077>, case 512: <D.18075>, case 34404: <D.18076>>
      <D.18073>:
      D.19468 = flags & 18;
      if (D.19468 != 0) goto <D.19469>; else goto <D.19470>;
      <D.19469>:
      aname->arch = 2;
      goto <D.19471>;
      <D.19470>:
      D.19472 = flags & 112;
      if (D.19472 == 112) goto <D.19473>; else goto <D.19474>;
      <D.19473>:
      aname->arch = 0;
      goto <D.19475>;
      <D.19474>:
      aname->arch = 1;
      <D.19475>:
      <D.19471>:
      goto <D.18074>;
      <D.18075>:
      aname->arch = 3;
      goto <D.18074>;
      <D.18076>:
      aname->arch = 4;
      goto <D.18074>;
      <D.18077>:
      aname->arch = 5;
      goto <D.18074>;
      <D.18078>:
      goto <D.18074>;
      <D.18074>:
      D.19436 = 1;
      return D.19436;
    }
  finally
    {
      cols = {CLOBBER};
    }
}


encode_public_tok (const guchar * token, gint32 len)
{
  int D.19479;
  int D.19480;
  long unsigned int D.19481;
  int D.19482;
  sizetype D.19483;
  gchar * D.19484;
  sizetype D.19485;
  const guchar * D.19486;
  unsigned char D.19487;
  unsigned char D.19488;
  int D.19489;
  char D.19490;
  sizetype D.19491;
  gchar * D.19492;
  int D.19493;
  int D.19494;
  char D.19495;
  sizetype D.19496;
  gchar * D.19497;
  gchar * D.19498;
  static const gchar allowed[16] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102};
  gchar * res;
  int i;

  D.19479 = len * 2;
  D.19480 = D.19479 + 1;
  D.19481 = (long unsigned int) D.19480;
  res = monoeg_malloc (D.19481);
  i = 0;
  goto <D.17839>;
  <D.17838>:
  D.19482 = i * 2;
  D.19483 = (sizetype) D.19482;
  D.19484 = res + D.19483;
  D.19485 = (sizetype) i;
  D.19486 = token + D.19485;
  D.19487 = *D.19486;
  D.19488 = D.19487 >> 4;
  D.19489 = (int) D.19488;
  D.19490 = allowed[D.19489];
  *D.19484 = D.19490;
  D.19482 = i * 2;
  D.19483 = (sizetype) D.19482;
  D.19491 = D.19483 + 1;
  D.19492 = res + D.19491;
  D.19485 = (sizetype) i;
  D.19486 = token + D.19485;
  D.19487 = *D.19486;
  D.19493 = (int) D.19487;
  D.19494 = D.19493 & 15;
  D.19495 = allowed[D.19494];
  *D.19492 = D.19495;
  i = i + 1;
  <D.17839>:
  if (i < len) goto <D.17838>; else goto <D.17840>;
  <D.17840>:
  D.19479 = len * 2;
  D.19496 = (sizetype) D.19479;
  D.19497 = res + D.19496;
  *D.19497 = 0;
  D.19498 = res;
  return D.19498;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.19502;
  int D.19507;
  void * D.19509;
  long unsigned int D.19510;

  D.19502 = __builtin_constant_p (__len);
  if (D.19502 != 0) goto <D.19503>; else goto <D.19504>;
  <D.19503>:
  if (__len == 0) goto <D.19505>; else goto <D.19506>;
  <D.19505>:
  D.19507 = __builtin_constant_p (__ch);
  if (D.19507 == 0) goto <D.19500>; else goto <D.19508>;
  <D.19508>:
  if (__ch != 0) goto <D.19500>; else goto <D.19501>;
  <D.19500>:
  __warn_memset_zero_len ();
  D.19509 = __dest;
  return D.19509;
  <D.19501>:
  <D.19506>:
  <D.19504>:
  D.19510 = __builtin_object_size (__dest, 0);
  D.19509 = __builtin___memset_chk (__dest, __ch, __len, D.19510);
  return D.19509;
}


mono_stringify_assembly_name (struct MonoAssemblyName * aname)
{
  const char * iftmp.15;
  const char * D.19515;
  const short unsigned int * * D.19517;
  const short unsigned int * D.19518;
  char D.19519;
  long unsigned int D.19520;
  long unsigned int D.19521;
  const short unsigned int * D.19522;
  short unsigned int D.19523;
  int D.19524;
  int D.19525;
  char * D.19527;
  short unsigned int D.19528;
  int D.19529;
  short unsigned int D.19530;
  int D.19531;
  short unsigned int D.19532;
  int D.19533;
  short unsigned int D.19534;
  int D.19535;
  const char * iftmp.16;
  const char * D.19539;
  char D.19541;
  const char * iftmp.17;
  unsigned char D.19544;
  const char * iftmp.18;
  unsigned int D.19549;
  unsigned int D.19550;
  const char * quote;

  D.19515 = aname->name;
  if (D.19515 != 0B) goto <D.19516>; else goto <D.19513>;
  <D.19516>:
  D.19517 = __ctype_b_loc ();
  D.19518 = *D.19517;
  D.19515 = aname->name;
  D.19519 = *D.19515;
  D.19520 = (long unsigned int) D.19519;
  D.19521 = D.19520 * 2;
  D.19522 = D.19518 + D.19521;
  D.19523 = *D.19522;
  D.19524 = (int) D.19523;
  D.19525 = D.19524 & 8192;
  if (D.19525 != 0) goto <D.19526>; else goto <D.19513>;
  <D.19526>:
  iftmp.15 = "\"";
  goto <D.19514>;
  <D.19513>:
  iftmp.15 = "";
  <D.19514>:
  quote = iftmp.15;
  D.19515 = aname->name;
  D.19528 = aname->major;
  D.19529 = (int) D.19528;
  D.19530 = aname->minor;
  D.19531 = (int) D.19530;
  D.19532 = aname->build;
  D.19533 = (int) D.19532;
  D.19534 = aname->revision;
  D.19535 = (int) D.19534;
  D.19539 = aname->culture;
  if (D.19539 != 0B) goto <D.19540>; else goto <D.19537>;
  <D.19540>:
  D.19539 = aname->culture;
  D.19541 = *D.19539;
  if (D.19541 != 0) goto <D.19542>; else goto <D.19537>;
  <D.19542>:
  iftmp.16 = aname->culture;
  goto <D.19538>;
  <D.19537>:
  iftmp.16 = "neutral";
  <D.19538>:
  D.19544 = aname->public_key_token[0];
  if (D.19544 != 0) goto <D.19545>; else goto <D.19546>;
  <D.19545>:
  iftmp.17 = &aname->public_key_token;
  goto <D.19547>;
  <D.19546>:
  iftmp.17 = "null";
  <D.19547>:
  D.19549 = aname->flags;
  D.19550 = D.19549 & 256;
  if (D.19550 != 0) goto <D.19551>; else goto <D.19552>;
  <D.19551>:
  iftmp.18 = ", Retargetable=Yes";
  goto <D.19553>;
  <D.19552>:
  iftmp.18 = "";
  <D.19553>:
  D.19527 = monoeg_g_strdup_printf ("%s%s%s, Version=%d.%d.%d.%d, Culture=%s, PublicKeyToken=%s%s", quote, D.19515, quote, D.19529, D.19531, D.19533, D.19535, iftmp.16, iftmp.17, iftmp.18);
  return D.19527;
}


mono_assembly_addref (struct MonoAssembly * assembly)
{
  int * D.19555;

  D.19555 = &assembly->ref_count;
  InterlockedIncrement (D.19555);
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.19556;
  unsigned int D.19557;

  D.19557 = __sync_add_and_fetch_4 (val, 1);
  D.19556 = (gint32) D.19557;
  return D.19556;
}


mono_assembly_get_assemblyref (struct MonoImage * image, int index, struct MonoAssemblyName * aname)
{
  unsigned int D.19559;
  const char * hash.19;
  const char * hash.20;
  unsigned int D.19562;
  unsigned int D.19563;
  const char * D.19564;
  unsigned int D.19565;
  const char * D.19566;
  unsigned int D.19567;
  unsigned int D.19568;
  short unsigned int D.19569;
  unsigned int D.19570;
  short unsigned int D.19571;
  unsigned int D.19572;
  short unsigned int D.19573;
  unsigned int D.19574;
  short unsigned int D.19575;
  unsigned int D.19576;
  unsigned int D.19579;
  mono_byte[17] * D.19580;
  struct MonoTableInfo * t;
  guint32 cols[9];
  const char * hash;

  try
    {
      t = &image->tables[35];
      mono_metadata_decode_row (t, index, &cols, 9);
      D.19559 = cols[8];
      hash.19 = mono_metadata_blob_heap (image, D.19559);
      hash = hash.19;
      hash.20 = hash;
      D.19562 = mono_metadata_decode_blob_size (hash.20, &hash);
      aname->hash_len = D.19562;
      hash.20 = hash;
      aname->hash_value = hash.20;
      D.19563 = cols[6];
      D.19564 = mono_metadata_string_heap (image, D.19563);
      aname->name = D.19564;
      D.19565 = cols[7];
      D.19566 = mono_metadata_string_heap (image, D.19565);
      aname->culture = D.19566;
      D.19567 = cols[4];
      aname->flags = D.19567;
      D.19568 = cols[0];
      D.19569 = (short unsigned int) D.19568;
      aname->major = D.19569;
      D.19570 = cols[1];
      D.19571 = (short unsigned int) D.19570;
      aname->minor = D.19571;
      D.19572 = cols[2];
      D.19573 = (short unsigned int) D.19572;
      aname->build = D.19573;
      D.19574 = cols[3];
      D.19575 = (short unsigned int) D.19574;
      aname->revision = D.19575;
      D.19576 = cols[5];
      if (D.19576 != 0) goto <D.19577>; else goto <D.19578>;
      <D.19577>:
      {
        gchar * token;

        D.19576 = cols[5];
        D.19579 = aname->flags;
        token = assemblyref_public_tok (image, D.19576, D.19579);
        D.19580 = &aname->public_key_token;
        monoeg_g_strlcpy (D.19580, token, 17);
        monoeg_g_free (token);
      }
      goto <D.19581>;
      <D.19578>:
      D.19580 = &aname->public_key_token;
      memset (D.19580, 0, 17);
      <D.19581>:
    }
  finally
    {
      cols = {CLOBBER};
      hash = {CLOBBER};
    }
}


assemblyref_public_tok (struct MonoImage * image, guint32 key_index, guint32 flags)
{
  const char * public_tok.21;
  const gchar * public_tok.22;
  unsigned int D.19584;
  unsigned int D.19585;
  unsigned int len.23;
  gchar * D.19589;
  const gchar * public_tok;
  int len;

  try
    {
      public_tok.21 = mono_metadata_blob_heap (image, key_index);
      public_tok = public_tok.21;
      public_tok.22 = public_tok;
      D.19584 = mono_metadata_decode_blob_size (public_tok.22, &public_tok);
      len = (int) D.19584;
      D.19585 = flags & 1;
      if (D.19585 != 0) goto <D.19586>; else goto <D.19587>;
      <D.19586>:
      {
        guchar token[8];

        try
          {
            public_tok.22 = public_tok;
            len.23 = (unsigned int) len;
            mono_digest_get_public_token (&token, public_tok.22, len.23);
            D.19589 = encode_public_tok (&token, 8);
            return D.19589;
          }
        finally
          {
            token = {CLOBBER};
          }
      }
      <D.19587>:
      public_tok.22 = public_tok;
      D.19589 = encode_public_tok (public_tok.22, len);
      return D.19589;
    }
  finally
    {
      public_tok = {CLOBBER};
    }
}


mono_assembly_load_reference (struct MonoImage * image, int index)
{
  _Bool D.19595;
  long int D.19596;
  long int D.19597;
  struct MonoAssembly * * D.19600;
  <unnamed-unsigned:24> D.19603;
  int D.19604;
  int D.19605;
  long unsigned int D.19606;
  long unsigned int D.19607;
  void * D.19608;
  long unsigned int D.19609;
  long unsigned int D.19610;
  struct MonoAssembly * * D.19611;
  _Bool D.19614;
  long int D.19615;
  long int D.19616;
  struct MonoAssembly * D.19623;
  int D.19625;
  int D.18178;
  int iftmp.24;
  int D.18177;
  const char[9] * D.19630;
  unsigned char D.19631;
  int D.19632;
  unsigned char D.19633;
  int D.19634;
  const unsigned char * D.19639;
  unsigned char D.19640;
  int D.19641;
  const unsigned char * D.19642;
  unsigned char D.19643;
  int D.19644;
  const unsigned char * D.19649;
  unsigned char D.19650;
  int D.19651;
  const unsigned char * D.19652;
  unsigned char D.19653;
  int D.19654;
  const unsigned char * D.19659;
  unsigned char D.19660;
  int D.19661;
  const unsigned char * D.19662;
  unsigned char D.19663;
  int D.19664;
  const char * D.19666;
  char * D.19669;
  const char * iftmp.25;
  <unnamed type> status.26;
  int * D.19685;
  int D.19686;
  const char * iftmp.27;
  char * D.19694;
  char * D.19702;
  short unsigned int D.19703;
  int D.19704;
  short unsigned int D.19705;
  int D.19706;
  short unsigned int D.19707;
  int D.19708;
  short unsigned int D.19709;
  int D.19710;
  const char * iftmp.28;
  mono_byte[17] * D.19712;
  char D.19713;
  _Bool D.19719;
  long int D.19720;
  long int D.19721;
  struct MonoAssembly * D.19726;
  const char * D.19733;
  const char * D.19734;
  int D.19735;
  _Bool D.19741;
  long int D.19742;
  long int D.19743;
  struct MonoAssembly * reference;
  struct MonoAssemblyName aname;
  MonoImageOpenStatus status;

  try
    {
      {
        int ret;

        ret = pthread_mutex_lock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.19593>; else goto <D.19594>;
        <D.19593>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19594>:
        D.19595 = ret != 0;
        D.19596 = (long int) D.19595;
        D.19597 = __builtin_expect (D.19596, 0);
        if (D.19597 != 0) goto <D.19598>; else goto <D.19599>;
        <D.19598>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1074, "ret == 0");
        <D.19599>:
      }
      D.19600 = image->references;
      if (D.19600 == 0B) goto <D.19601>; else goto <D.19602>;
      <D.19601>:
      {
        struct MonoTableInfo * t;

        t = &image->tables[35];
        D.19603 = t->rows;
        D.19604 = (int) D.19603;
        D.19605 = D.19604 + 1;
        D.19606 = (long unsigned int) D.19605;
        D.19607 = D.19606 * 8;
        D.19608 = monoeg_malloc0 (D.19607);
        image->references = D.19608;
        D.19603 = t->rows;
        D.19604 = (int) D.19603;
        image->nreferences = D.19604;
      }
      <D.19602>:
      D.19600 = image->references;
      D.19609 = (long unsigned int) index;
      D.19610 = D.19609 * 8;
      D.19611 = D.19600 + D.19610;
      reference = *D.19611;
      {
        int ret;

        ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.19612>; else goto <D.19613>;
        <D.19612>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19613>:
        D.19614 = ret != 0;
        D.19615 = (long int) D.19614;
        D.19616 = __builtin_expect (D.19615, 0);
        if (D.19616 != 0) goto <D.19617>; else goto <D.19618>;
        <D.19617>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1082, "ret == 0");
        <D.19618>:
      }
      if (reference != 0B) goto <D.19619>; else goto <D.19620>;
      <D.19619>:
      return;
      <D.19620>:
      mono_assembly_get_assemblyref (image, index, &aname);
      D.19623 = image->assembly;
      if (D.19623 != 0B) goto <D.19624>; else goto <D.19621>;
      <D.19624>:
      D.19623 = image->assembly;
      D.19625 = D.19623->ref_only;
      if (D.19625 != 0) goto <D.19626>; else goto <D.19621>;
      <D.19626>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname.name;
          D.19630 = "mscorlib";
          D.19631 = MEM[(const unsigned char *)D.19630];
          D.19632 = (int) D.19631;
          D.19633 = *__s2;
          D.19634 = (int) D.19633;
          __result = D.19632 - D.19634;
          {
            if (__s2_len != 0) goto <D.19635>; else goto <D.19636>;
            <D.19635>:
            if (__result == 0) goto <D.19637>; else goto <D.19638>;
            <D.19637>:
            D.19639 = &MEM[(void *)"mscorlib" + 1B];
            D.19640 = *D.19639;
            D.19641 = (int) D.19640;
            D.19642 = __s2 + 1;
            D.19643 = *D.19642;
            D.19644 = (int) D.19643;
            __result = D.19641 - D.19644;
            if (__s2_len > 1) goto <D.19645>; else goto <D.19646>;
            <D.19645>:
            if (__result == 0) goto <D.19647>; else goto <D.19648>;
            <D.19647>:
            D.19649 = &MEM[(void *)"mscorlib" + 2B];
            D.19650 = *D.19649;
            D.19651 = (int) D.19650;
            D.19652 = __s2 + 2;
            D.19653 = *D.19652;
            D.19654 = (int) D.19653;
            __result = D.19651 - D.19654;
            if (__s2_len > 2) goto <D.19655>; else goto <D.19656>;
            <D.19655>:
            if (__result == 0) goto <D.19657>; else goto <D.19658>;
            <D.19657>:
            D.19659 = &MEM[(void *)"mscorlib" + 3B];
            D.19660 = *D.19659;
            D.19661 = (int) D.19660;
            D.19662 = __s2 + 3;
            D.19663 = *D.19662;
            D.19664 = (int) D.19663;
            __result = D.19661 - D.19664;
            <D.19658>:
            <D.19656>:
            <D.19648>:
            <D.19646>:
            <D.19638>:
            <D.19636>:
          }
          D.18177 = __result;
        }
        iftmp.24 = -D.18177;
        goto <D.19665>;
        <D.19629>:
        D.19666 = aname.name;
        iftmp.24 = __builtin_strcmp (D.19666, "mscorlib");
        <D.19665>:
        D.18178 = iftmp.24;
      }
      if (D.18178 == 0) goto <D.19667>; else goto <D.19668>;
      <D.19667>:
      D.19623 = image->assembly;
      D.19669 = D.19623->basedir;
      reference = mono_assembly_load_full (&aname, D.19669, &status, 0);
      goto <D.19670>;
      <D.19668>:
      reference = mono_assembly_loaded_full (&aname, 1);
      if (reference == 0B) goto <D.19671>; else goto <D.19672>;
      <D.19671>:
      reference = mono_assembly_invoke_search_hook_internal (&aname, 1, 1);
      <D.19672>:
      <D.19670>:
      if (reference == 0B) goto <D.19673>; else goto <D.19674>;
      <D.19673>:
      reference = -1B;
      <D.19674>:
      goto <D.19622>;
      <D.19621>:
      D.19623 = image->assembly;
      if (D.19623 != 0B) goto <D.19676>; else goto <D.19677>;
      <D.19676>:
      D.19623 = image->assembly;
      iftmp.25 = D.19623->basedir;
      goto <D.19678>;
      <D.19677>:
      iftmp.25 = 0B;
      <D.19678>:
      reference = mono_assembly_load (&aname, iftmp.25, &status);
      <D.19622>:
      if (reference == 0B) goto <D.19679>; else goto <D.19680>;
      <D.19679>:
      {
        char * extra_msg;

        status.26 = status;
        if (status.26 == 1) goto <D.19684>; else goto <D.19681>;
        <D.19684>:
        D.19685 = __errno_location ();
        D.19686 = *D.19685;
        if (D.19686 == 2) goto <D.19687>; else goto <D.19681>;
        <D.19687>:
        D.19623 = image->assembly;
        if (D.19623 != 0B) goto <D.19689>; else goto <D.19690>;
        <D.19689>:
        D.19623 = image->assembly;
        iftmp.27 = D.19623->basedir;
        goto <D.19691>;
        <D.19690>:
        iftmp.27 = "";
        <D.19691>:
        extra_msg = monoeg_g_strdup_printf ("The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (%s).\n", iftmp.27);
        goto <D.19682>;
        <D.19681>:
        status.26 = status;
        if (status.26 == 1) goto <D.19692>; else goto <D.19693>;
        <D.19692>:
        D.19685 = __errno_location ();
        D.19686 = *D.19685;
        D.19694 = strerror (D.19686);
        extra_msg = monoeg_g_strdup_printf ("System error: %s\n", D.19694);
        goto <D.19695>;
        <D.19693>:
        status.26 = status;
        if (status.26 == 2) goto <D.19696>; else goto <D.19697>;
        <D.19696>:
        extra_msg = monoeg_strdup ("Cannot find an assembly referenced from this one.\n");
        goto <D.19698>;
        <D.19697>:
        status.26 = status;
        if (status.26 == 3) goto <D.19699>; else goto <D.19700>;
        <D.19699>:
        extra_msg = monoeg_strdup ("The file exists but is not a valid assembly.\n");
        goto <D.19701>;
        <D.19700>:
        extra_msg = monoeg_strdup ("");
        <D.19701>:
        <D.19698>:
        <D.19695>:
        <D.19682>:
        D.19702 = image->name;
        D.19666 = aname.name;
        D.19703 = aname.major;
        D.19704 = (int) D.19703;
        D.19705 = aname.minor;
        D.19706 = (int) D.19705;
        D.19707 = aname.build;
        D.19708 = (int) D.19707;
        D.19709 = aname.revision;
        D.19710 = (int) D.19709;
        D.19712 = &aname.public_key_token;
        D.19713 = MEM[(const char *)D.19712];
        if (D.19713 != 0) goto <D.19714>; else goto <D.19715>;
        <D.19714>:
        iftmp.28 = &aname.public_key_token;
        goto <D.19716>;
        <D.19715>:
        iftmp.28 = "(none)";
        <D.19716>:
        mono_trace (16, 1, "The following assembly referenced from %s could not be loaded:\n     Assembly:   %s    (assemblyref_index=%d)\n     Version:    %d.%d.%d.%d\n     Public Key: %s\n%s", D.19702, D.19666, index, D.19704, D.19706, D.19708, D.19710, iftmp.28, extra_msg);
        monoeg_g_free (extra_msg);
      }
      <D.19680>:
      {
        int ret;

        ret = pthread_mutex_lock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.19717>; else goto <D.19718>;
        <D.19717>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19718>:
        D.19719 = ret != 0;
        D.19720 = (long int) D.19719;
        D.19721 = __builtin_expect (D.19720, 0);
        if (D.19721 != 0) goto <D.19722>; else goto <D.19723>;
        <D.19722>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1133, "ret == 0");
        <D.19723>:
      }
      if (reference == 0B) goto <D.19724>; else goto <D.19725>;
      <D.19724>:
      reference = -1B;
      <D.19725>:
      D.19600 = image->references;
      D.19609 = (long unsigned int) index;
      D.19610 = D.19609 * 8;
      D.19611 = D.19600 + D.19610;
      D.19726 = *D.19611;
      if (D.19726 == 0B) goto <D.19727>; else goto <D.19728>;
      <D.19727>:
      if (reference != -1B) goto <D.19729>; else goto <D.19730>;
      <D.19729>:
      mono_assembly_addref (reference);
      D.19623 = image->assembly;
      if (D.19623 != 0B) goto <D.19731>; else goto <D.19732>;
      <D.19731>:
      D.19623 = image->assembly;
      D.19733 = D.19623->aname.name;
      D.19623 = image->assembly;
      D.19734 = reference->aname.name;
      D.19735 = reference->ref_count;
      mono_trace (64, 1, "Assembly Ref addref %s[%p] -> %s[%p]: %d", D.19733, D.19623, D.19734, reference, D.19735);
      <D.19732>:
      goto <D.19736>;
      <D.19730>:
      D.19623 = image->assembly;
      if (D.19623 != 0B) goto <D.19737>; else goto <D.19738>;
      <D.19737>:
      D.19623 = image->assembly;
      D.19733 = D.19623->aname.name;
      D.19623 = image->assembly;
      mono_trace (64, 1, "Failed to load assembly %s[%p]\n", D.19733, D.19623);
      <D.19738>:
      <D.19736>:
      D.19600 = image->references;
      D.19609 = (long unsigned int) index;
      D.19610 = D.19609 * 8;
      D.19611 = D.19600 + D.19610;
      *D.19611 = reference;
      <D.19728>:
      {
        int ret;

        ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.19739>; else goto <D.19740>;
        <D.19739>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19740>:
        D.19741 = ret != 0;
        D.19742 = (long int) D.19741;
        D.19743 = __builtin_expect (D.19742, 0);
        if (D.19743 != 0) goto <D.19744>; else goto <D.19745>;
        <D.19744>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1153, "ret == 0");
        <D.19745>:
      }
      D.19600 = image->references;
      D.19609 = (long unsigned int) index;
      D.19610 = D.19609 * 8;
      D.19611 = D.19600 + D.19610;
      D.19726 = *D.19611;
      if (D.19726 != reference) goto <D.19746>; else goto <D.19747>;
      <D.19746>:
      mono_assembly_close (reference);
      <D.19747>:
    }
  finally
    {
      aname = {CLOBBER};
      status = {CLOBBER};
    }
}


mono_assembly_invoke_search_hook_internal (struct MonoAssemblyName * aname, gboolean refonly, gboolean postload)
{
  int D.19751;
  int D.19754;
  struct MonoAssembly * (*<Tf5c>) (struct MonoAssemblyName *, void *) D.19757;
  void * D.19758;
  struct MonoAssembly * D.19761;
  struct AssemblySearchHook * hook;

  hook = assembly_search_hook;
  goto <D.18228>;
  <D.18227>:
  D.19751 = hook->refonly;
  if (D.19751 == refonly) goto <D.19752>; else goto <D.19753>;
  <D.19752>:
  D.19754 = hook->postload;
  if (D.19754 == postload) goto <D.19755>; else goto <D.19756>;
  <D.19755>:
  {
    struct MonoAssembly * ass;

    D.19757 = hook->func;
    D.19758 = hook->user_data;
    ass = D.19757 (aname, D.19758);
    if (ass != 0B) goto <D.19759>; else goto <D.19760>;
    <D.19759>:
    D.19761 = ass;
    return D.19761;
    <D.19760>:
  }
  <D.19756>:
  <D.19753>:
  hook = hook->next;
  <D.18228>:
  if (hook != 0B) goto <D.18227>; else goto <D.18229>;
  <D.18229>:
  D.19761 = 0B;
  return D.19761;
}


mono_assembly_load_references (struct MonoImage * image, MonoImageOpenStatus * status)
{
  *status = 0;
}


mono_assembly_invoke_load_hook (struct MonoAssembly * ass)
{
  void (*<Tf55>) (struct MonoAssembly *, void *) D.19763;
  void * D.19764;
  struct AssemblyLoadHook * hook;

  hook = assembly_load_hook;
  goto <D.18197>;
  <D.18196>:
  D.19763 = hook->func;
  D.19764 = hook->user_data;
  D.19763 (ass, D.19764);
  hook = hook->next;
  <D.18197>:
  if (hook != 0B) goto <D.18196>; else goto <D.18198>;
  <D.18198>:
}


mono_install_assembly_load_hook (void (*MonoAssemblyLoadFunc) (struct MonoAssembly *, void *) func, void * user_data)
{
  struct AssemblyLoadHook * assembly_load_hook.29;
  struct AssemblyLoadHook * hook;

  if (func == 0B) goto <D.19765>; else goto <D.19766>;
  <D.19765>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1192, "func != NULL");
  return;
  <D.19766>:
  hook = monoeg_malloc0 (24);
  hook->func = func;
  hook->user_data = user_data;
  assembly_load_hook.29 = assembly_load_hook;
  hook->next = assembly_load_hook.29;
  assembly_load_hook = hook;
}


mono_assembly_invoke_search_hook (struct MonoAssemblyName * aname)
{
  struct MonoAssembly * D.19769;

  D.19769 = mono_assembly_invoke_search_hook_internal (aname, 0, 0);
  return D.19769;
}


mono_install_assembly_search_hook (struct MonoAssembly * (*MonoAssemblySearchFunc) (struct MonoAssemblyName *, void *) func, void * user_data)
{
  mono_install_assembly_search_hook_internal (func, user_data, 0, 0);
}


mono_install_assembly_search_hook_internal (struct MonoAssembly * (*MonoAssemblySearchFunc) (struct MonoAssemblyName *, void *) func, void * user_data, gboolean refonly, gboolean postload)
{
  struct AssemblySearchHook * assembly_search_hook.30;
  struct AssemblySearchHook * hook;

  if (func == 0B) goto <D.19771>; else goto <D.19772>;
  <D.19771>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1250, "func != NULL");
  return;
  <D.19772>:
  hook = monoeg_malloc0 (32);
  hook->func = func;
  hook->user_data = user_data;
  hook->refonly = refonly;
  hook->postload = postload;
  assembly_search_hook.30 = assembly_search_hook;
  hook->next = assembly_search_hook.30;
  assembly_search_hook = hook;
}


mono_install_assembly_refonly_search_hook (struct MonoAssembly * (*MonoAssemblySearchFunc) (struct MonoAssemblyName *, void *) func, void * user_data)
{
  mono_install_assembly_search_hook_internal (func, user_data, 1, 0);
}


mono_install_assembly_postload_search_hook (struct MonoAssembly * (*MonoAssemblySearchFunc) (struct MonoAssemblyName *, void *) func, void * user_data)
{
  mono_install_assembly_search_hook_internal (func, user_data, 0, 1);
}


mono_install_assembly_postload_refonly_search_hook (struct MonoAssembly * (*MonoAssemblySearchFunc) (struct MonoAssemblyName *, void *) func, void * user_data)
{
  mono_install_assembly_search_hook_internal (func, user_data, 1, 1);
}


mono_install_assembly_preload_hook (struct MonoAssembly * (*MonoAssemblyPreLoadFunc) (struct MonoAssemblyName *, char * *, void *) func, void * user_data)
{
  struct AssemblyPreLoadHook * assembly_preload_hook.31;
  struct AssemblyPreLoadHook * hook;

  if (func == 0B) goto <D.19775>; else goto <D.19776>;
  <D.19775>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1341, "func != NULL");
  return;
  <D.19776>:
  hook = monoeg_malloc0 (24);
  hook->func = func;
  hook->user_data = user_data;
  assembly_preload_hook.31 = assembly_preload_hook;
  hook->next = assembly_preload_hook.31;
  assembly_preload_hook = hook;
}


mono_install_assembly_refonly_preload_hook (struct MonoAssembly * (*MonoAssemblyPreLoadFunc) (struct MonoAssemblyName *, char * *, void *) func, void * user_data)
{
  struct AssemblyPreLoadHook * assembly_refonly_preload_hook.32;
  struct AssemblyPreLoadHook * hook;

  if (func == 0B) goto <D.19779>; else goto <D.19780>;
  <D.19779>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1355, "func != NULL");
  return;
  <D.19780>:
  hook = monoeg_malloc0 (24);
  hook->func = func;
  hook->user_data = user_data;
  assembly_refonly_preload_hook.32 = assembly_refonly_preload_hook;
  hook->next = assembly_refonly_preload_hook.32;
  assembly_refonly_preload_hook = hook;
}


mono_assembly_open_from_bundle (const char * filename, MonoImageOpenStatus * status, gboolean refonly)
{
  const struct MonoBundledAssembly * * bundles.33;
  struct MonoImage * D.19786;
  _Bool D.19789;
  long int D.19790;
  long int D.19791;
  int D.18364;
  long unsigned int D.19794;
  long unsigned int D.19795;
  const struct MonoBundledAssembly * * D.19796;
  const struct MonoBundledAssembly * D.19797;
  const char * D.19798;
  const unsigned char * D.19801;
  unsigned int D.19802;
  _Bool D.19806;
  long int D.19807;
  long int D.19808;
  int i;
  char * name;
  struct MonoImage * image;

  image = 0B;
  bundles.33 = bundles;
  if (bundles.33 == 0B) goto <D.19784>; else goto <D.19785>;
  <D.19784>:
  D.19786 = 0B;
  return D.19786;
  <D.19785>:
  name = monoeg_g_path_get_basename (filename);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19787>; else goto <D.19788>;
    <D.19787>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19788>:
    D.19789 = ret != 0;
    D.19790 = (long int) D.19789;
    D.19791 = __builtin_expect (D.19790, 0);
    if (D.19791 != 0) goto <D.19792>; else goto <D.19793>;
    <D.19792>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1466, "ret == 0");
    <D.19793>:
  }
  i = 0;
  goto <D.18367>;
  <D.18366>:
  {
    size_t __s1_len;
    size_t __s2_len;

    bundles.33 = bundles;
    D.19794 = (long unsigned int) i;
    D.19795 = D.19794 * 8;
    D.19796 = bundles.33 + D.19795;
    D.19797 = *D.19796;
    D.19798 = D.19797->name;
    D.18364 = __builtin_strcmp (D.19798, name);
  }
  if (D.18364 == 0) goto <D.19799>; else goto <D.19800>;
  <D.19799>:
  bundles.33 = bundles;
  D.19794 = (long unsigned int) i;
  D.19795 = D.19794 * 8;
  D.19796 = bundles.33 + D.19795;
  D.19797 = *D.19796;
  D.19801 = D.19797->data;
  bundles.33 = bundles;
  D.19794 = (long unsigned int) i;
  D.19795 = D.19794 * 8;
  D.19796 = bundles.33 + D.19795;
  D.19797 = *D.19796;
  D.19802 = D.19797->size;
  image = mono_image_open_from_data_with_name (D.19801, D.19802, 0, status, refonly, name);
  goto <D.18365>;
  <D.19800>:
  i = i + 1;
  <D.18367>:
  if (image == 0B) goto <D.19803>; else goto <D.18365>;
  <D.19803>:
  bundles.33 = bundles;
  D.19794 = (long unsigned int) i;
  D.19795 = D.19794 * 8;
  D.19796 = bundles.33 + D.19795;
  D.19797 = *D.19796;
  if (D.19797 != 0B) goto <D.18366>; else goto <D.18365>;
  <D.18365>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19804>; else goto <D.19805>;
    <D.19804>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19805>:
    D.19806 = ret != 0;
    D.19807 = (long int) D.19806;
    D.19808 = __builtin_expect (D.19807, 0);
    if (D.19808 != 0) goto <D.19809>; else goto <D.19810>;
    <D.19809>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1473, "ret == 0");
    <D.19810>:
  }
  monoeg_g_free (name);
  if (image != 0B) goto <D.19811>; else goto <D.19812>;
  <D.19811>:
  mono_image_addref (image);
  D.19786 = image;
  return D.19786;
  <D.19812>:
  D.19786 = 0B;
  return D.19786;
}


mono_assembly_open_full (const char * filename, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoAssembly * D.19816;
  int D.19819;
  gchar * D.19822;
  char D.19823;
  struct GError * error.34;
  gchar * D.19831;
  unsigned char D.19833;
  const struct MonoBundledAssembly * * bundles.35;
  <unnamed type> D.19847;
  struct MonoAssembly * D.19850;
  struct MonoImage * D.19857;
  struct MonoImage * image;
  struct MonoAssembly * ass;
  MonoImageOpenStatus def_status;
  gchar * fname;
  gchar * new_fname;

  try
    {
      if (filename == 0B) goto <D.19814>; else goto <D.19815>;
      <D.19814>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1491, "filename != NULL");
      D.19816 = 0B;
      return D.19816;
      <D.19815>:
      if (status == 0B) goto <D.19817>; else goto <D.19818>;
      <D.19817>:
      status = &def_status;
      <D.19818>:
      *status = 0;
      D.19819 = strncmp (filename, "file://", 7);
      if (D.19819 == 0) goto <D.19820>; else goto <D.19821>;
      <D.19820>:
      {
        struct GError * error;
        gchar * uri;
        gchar * tmpuri;

        try
          {
            error = 0B;
            uri = filename;
            D.19822 = uri + 7;
            D.19823 = *D.19822;
            if (D.19823 != 47) goto <D.19824>; else goto <D.19825>;
            <D.19824>:
            D.19822 = uri + 7;
            uri = monoeg_g_strdup_printf ("file:///%s", D.19822);
            <D.19825>:
            tmpuri = uri;
            uri = mono_escape_uri_string (tmpuri);
            fname = monoeg_g_filename_from_uri (uri, 0B, &error);
            monoeg_g_free (uri);
            if (tmpuri != filename) goto <D.19826>; else goto <D.19827>;
            <D.19826>:
            monoeg_g_free (tmpuri);
            <D.19827>:
            error.34 = error;
            if (error.34 != 0B) goto <D.19829>; else goto <D.19830>;
            <D.19829>:
            error.34 = error;
            D.19831 = error.34->message;
            monoeg_g_log (0B, 16, "%s\n", D.19831);
            error.34 = error;
            monoeg_g_error_free (error.34);
            fname = monoeg_strdup (filename);
            <D.19830>:
          }
        finally
          {
            error = {CLOBBER};
          }
      }
      goto <D.19832>;
      <D.19821>:
      fname = monoeg_strdup (filename);
      <D.19832>:
      mono_trace (64, 1, "Assembly Loader probing location: \'%s\'.", fname);
      new_fname = 0B;
      D.19833 = mono_assembly_is_in_gac (fname);
      if (D.19833 == 0) goto <D.19834>; else goto <D.19835>;
      <D.19834>:
      new_fname = mono_make_shadow_copy (fname);
      <D.19835>:
      if (new_fname != 0B) goto <D.19836>; else goto <D.19837>;
      <D.19836>:
      if (new_fname != fname) goto <D.19838>; else goto <D.19839>;
      <D.19838>:
      monoeg_g_free (fname);
      fname = new_fname;
      mono_trace (64, 1, "Assembly Loader shadow-copied assembly to: \'%s\'.", fname);
      <D.19839>:
      <D.19837>:
      image = 0B;
      bundles.35 = bundles;
      if (bundles.35 != 0B) goto <D.19841>; else goto <D.19842>;
      <D.19841>:
      image = mono_assembly_open_from_bundle (fname, status, refonly);
      <D.19842>:
      if (image == 0B) goto <D.19843>; else goto <D.19844>;
      <D.19843>:
      image = mono_image_open_full (fname, status, refonly);
      <D.19844>:
      if (image == 0B) goto <D.19845>; else goto <D.19846>;
      <D.19845>:
      D.19847 = *status;
      if (D.19847 == 0) goto <D.19848>; else goto <D.19849>;
      <D.19848>:
      *status = 1;
      <D.19849>:
      monoeg_g_free (fname);
      D.19816 = 0B;
      return D.19816;
      <D.19846>:
      D.19850 = image->assembly;
      if (D.19850 != 0B) goto <D.19851>; else goto <D.19852>;
      <D.19851>:
      D.19850 = image->assembly;
      mono_assembly_invoke_load_hook (D.19850);
      mono_image_close (image);
      monoeg_g_free (fname);
      D.19816 = image->assembly;
      return D.19816;
      <D.19852>:
      ass = mono_assembly_load_from_full (image, fname, status, refonly);
      if (ass != 0B) goto <D.19853>; else goto <D.19854>;
      <D.19853>:
      mono_trace (64, 1, "Assembly Loader loaded assembly from location: \'%s\'.", filename);
      if (refonly == 0) goto <D.19855>; else goto <D.19856>;
      <D.19855>:
      D.19857 = ass->image;
      mono_config_for_assembly (D.19857);
      <D.19856>:
      <D.19854>:
      mono_image_close (image);
      monoeg_g_free (fname);
      D.19816 = ass;
      return D.19816;
    }
  finally
    {
      def_status = {CLOBBER};
    }
}


mono_assembly_is_in_gac (const gchar * filename)
{
  MonoBoolean D.19862;
  gchar * D.19863;
  char * D.19864;
  long unsigned int D.19867;
  char D.19868;
  int D.19871;
  int D.19876;
  int D.19881;
  char * D.19887;
  long unsigned int D.19890;
  int D.19893;
  int D.19898;
  const gchar * rootdir;
  gchar * gp;
  gchar * * paths;

  if (filename == 0B) goto <D.19860>; else goto <D.19861>;
  <D.19860>:
  D.19862 = 0;
  return D.19862;
  <D.19861>:
  paths = extra_gac_paths;
  goto <D.18672>;
  <D.18671>:
  D.19863 = *paths;
  D.19864 = strstr (D.19863, filename);
  D.19863 = *paths;
  if (D.19864 != D.19863) goto <D.19865>; else goto <D.19866>;
  <D.19865>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19866>:
  D.19863 = *paths;
  D.19867 = strlen (D.19863);
  gp = filename + D.19867;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19869>; else goto <D.19870>;
  <D.19869>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19870>:
  gp = gp + 1;
  D.19871 = strncmp (gp, "lib", 3);
  if (D.19871 != 0) goto <D.19872>; else goto <D.19873>;
  <D.19872>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19873>:
  gp = gp + 3;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19874>; else goto <D.19875>;
  <D.19874>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19875>:
  gp = gp + 1;
  D.19876 = strncmp (gp, "mono", 4);
  if (D.19876 != 0) goto <D.19877>; else goto <D.19878>;
  <D.19877>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19878>:
  gp = gp + 4;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19879>; else goto <D.19880>;
  <D.19879>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19880>:
  gp = gp + 1;
  D.19881 = strncmp (gp, "gac", 3);
  if (D.19881 != 0) goto <D.19882>; else goto <D.19883>;
  <D.19882>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19883>:
  gp = gp + 3;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19884>; else goto <D.19885>;
  <D.19884>:
  // predicted unlikely by continue predictor.
  goto <D.18643>;
  <D.19885>:
  D.19862 = 1;
  return D.19862;
  <D.18643>:
  paths = paths + 8;
  <D.18672>:
  if (paths != 0B) goto <D.19886>; else goto <D.18673>;
  <D.19886>:
  D.19863 = *paths;
  if (D.19863 != 0B) goto <D.18671>; else goto <D.18673>;
  <D.18673>:
  rootdir = mono_assembly_getrootdir ();
  D.19887 = strstr (filename, rootdir);
  if (D.19887 != filename) goto <D.19888>; else goto <D.19889>;
  <D.19888>:
  D.19862 = 0;
  return D.19862;
  <D.19889>:
  D.19890 = strlen (rootdir);
  gp = filename + D.19890;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19891>; else goto <D.19892>;
  <D.19891>:
  D.19862 = 0;
  return D.19862;
  <D.19892>:
  gp = gp + 1;
  D.19893 = strncmp (gp, "mono", 4);
  if (D.19893 != 0) goto <D.19894>; else goto <D.19895>;
  <D.19894>:
  D.19862 = 0;
  return D.19862;
  <D.19895>:
  gp = gp + 4;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19896>; else goto <D.19897>;
  <D.19896>:
  D.19862 = 0;
  return D.19862;
  <D.19897>:
  gp = gp + 1;
  D.19898 = strncmp (gp, "gac", 3);
  if (D.19898 != 0) goto <D.19899>; else goto <D.19900>;
  <D.19899>:
  D.19862 = 0;
  return D.19862;
  <D.19900>:
  gp = gp + 3;
  D.19868 = *gp;
  if (D.19868 != 47) goto <D.19901>; else goto <D.19902>;
  <D.19901>:
  D.19862 = 0;
  return D.19862;
  <D.19902>:
  D.19862 = 1;
  return D.19862;
}


mono_assembly_load_friends (struct MonoAssembly * ass)
{
  unsigned char D.19904;
  _Bool D.19911;
  long int D.19912;
  long int D.19913;
  _Bool D.19918;
  long int D.19919;
  long int D.19920;
  _Bool D.19925;
  long int D.19926;
  long int D.19927;
  _Bool D.19934;
  long int D.19935;
  long int D.19936;
  _Bool D.19941;
  long int D.19942;
  long int D.19943;
  struct MonoMethod * D.19948;
  struct MonoClass * D.19950;
  struct MonoClass * D.19951;
  unsigned int D.19952;
  const mono_byte * data.36;
  const gchar * data.37;
  char D.19959;
  const gchar * D.19961;
  char D.19962;
  const gchar * D.19964;
  char D.19965;
  const char * D.19966;
  int D.19967;
  int D.19971;
  _Bool D.19974;
  long int D.19975;
  long int D.19976;
  _Bool D.19983;
  long int D.19984;
  long int D.19985;
  _Bool D.19990;
  long int D.19991;
  long int D.19992;
  int i;
  struct MonoCustomAttrInfo * attrs;
  struct GSList * list;

  D.19904 = ass->friend_assembly_names_inited;
  if (D.19904 != 0) goto <D.19905>; else goto <D.19906>;
  <D.19905>:
  return;
  <D.19906>:
  attrs = mono_custom_attrs_from_assembly (ass);
  if (attrs == 0B) goto <D.19907>; else goto <D.19908>;
  <D.19907>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19909>; else goto <D.19910>;
    <D.19909>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19910>:
    D.19911 = ret != 0;
    D.19912 = (long int) D.19911;
    D.19913 = __builtin_expect (D.19912, 0);
    if (D.19913 != 0) goto <D.19914>; else goto <D.19915>;
    <D.19914>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1611, "ret == 0");
    <D.19915>:
  }
  ass->friend_assembly_names_inited = 1;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19916>; else goto <D.19917>;
    <D.19916>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19917>:
    D.19918 = ret != 0;
    D.19919 = (long int) D.19918;
    D.19920 = __builtin_expect (D.19919, 0);
    if (D.19920 != 0) goto <D.19921>; else goto <D.19922>;
    <D.19921>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1613, "ret == 0");
    <D.19922>:
  }
  return;
  <D.19908>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19923>; else goto <D.19924>;
    <D.19923>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19924>:
    D.19925 = ret != 0;
    D.19926 = (long int) D.19925;
    D.19927 = __builtin_expect (D.19926, 0);
    if (D.19927 != 0) goto <D.19928>; else goto <D.19929>;
    <D.19928>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1617, "ret == 0");
    <D.19929>:
  }
  D.19904 = ass->friend_assembly_names_inited;
  if (D.19904 != 0) goto <D.19930>; else goto <D.19931>;
  <D.19930>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19932>; else goto <D.19933>;
    <D.19932>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19933>:
    D.19934 = ret != 0;
    D.19935 = (long int) D.19934;
    D.19936 = __builtin_expect (D.19935, 0);
    if (D.19936 != 0) goto <D.19937>; else goto <D.19938>;
    <D.19937>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1619, "ret == 0");
    <D.19938>:
  }
  return;
  <D.19931>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19939>; else goto <D.19940>;
    <D.19939>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19940>:
    D.19941 = ret != 0;
    D.19942 = (long int) D.19941;
    D.19943 = __builtin_expect (D.19942, 0);
    if (D.19943 != 0) goto <D.19944>; else goto <D.19945>;
    <D.19944>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1622, "ret == 0");
    <D.19945>:
  }
  list = 0B;
  i = 0;
  goto <D.18412>;
  <D.18411>:
  {
    struct MonoCustomAttrEntry * attr;
    struct MonoAssemblyName * aname;
    const gchar * data;
    guint slen;

    try
      {
        attr = &attrs->attrs[i];
        D.19948 = attr->ctor;
        if (D.19948 == 0B) goto <D.19946>; else goto <D.19949>;
        <D.19949>:
        D.19948 = attr->ctor;
        D.19950 = D.19948->klass;
        D.19951 = mono_defaults.internals_visible_class;
        if (D.19950 != D.19951) goto <D.19946>; else goto <D.19947>;
        <D.19946>:
        // predicted unlikely by continue predictor.
        goto <D.18410>;
        <D.19947>:
        D.19952 = attr->data_size;
        if (D.19952 <= 3) goto <D.19953>; else goto <D.19954>;
        <D.19953>:
        // predicted unlikely by continue predictor.
        goto <D.18410>;
        <D.19954>:
        data.36 = attr->data;
        data = data.36;
        data.37 = data;
        D.19959 = *data.37;
        if (D.19959 != 1) goto <D.19956>; else goto <D.19960>;
        <D.19960>:
        data.37 = data;
        D.19961 = data.37 + 1;
        D.19962 = *D.19961;
        if (D.19962 != 0) goto <D.19956>; else goto <D.19963>;
        <D.19963>:
        data.37 = data;
        D.19964 = data.37 + 2;
        D.19965 = *D.19964;
        if (D.19965 == 255) goto <D.19956>; else goto <D.19957>;
        <D.19956>:
        // predicted unlikely by continue predictor.
        goto <D.18410>;
        <D.19957>:
        data.37 = data;
        D.19966 = data.37 + 2;
        slen = mono_metadata_decode_value (D.19966, &data);
        aname = monoeg_malloc0 (80);
        data.37 = data;
        D.19967 = mono_assembly_name_parse_full (data.37, aname, 1, 0B, 0B);
        if (D.19967 != 0) goto <D.19968>; else goto <D.19969>;
        <D.19968>:
        list = monoeg_g_slist_prepend (list, aname);
        goto <D.19970>;
        <D.19969>:
        monoeg_g_free (aname);
        <D.19970>:
      }
    finally
      {
        data = {CLOBBER};
      }
  }
  <D.18410>:
  i = i + 1;
  <D.18412>:
  D.19971 = attrs->num_attrs;
  if (D.19971 > i) goto <D.18411>; else goto <D.18413>;
  <D.18413>:
  mono_custom_attrs_free (attrs);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19972>; else goto <D.19973>;
    <D.19972>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19973>:
    D.19974 = ret != 0;
    D.19975 = (long int) D.19974;
    D.19976 = __builtin_expect (D.19975, 0);
    if (D.19976 != 0) goto <D.19977>; else goto <D.19978>;
    <D.19977>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1654, "ret == 0");
    <D.19978>:
  }
  D.19904 = ass->friend_assembly_names_inited;
  if (D.19904 != 0) goto <D.19979>; else goto <D.19980>;
  <D.19979>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19981>; else goto <D.19982>;
    <D.19981>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19982>:
    D.19983 = ret != 0;
    D.19984 = (long int) D.19983;
    D.19985 = __builtin_expect (D.19984, 0);
    if (D.19985 != 0) goto <D.19986>; else goto <D.19987>;
    <D.19986>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1656, "ret == 0");
    <D.19987>:
  }
  monoeg_g_slist_foreach (list, free_item, 0B);
  monoeg_g_slist_free (list);
  return;
  <D.19980>:
  ass->friend_assembly_names = list;
  mono_memory_barrier ();
  ass->friend_assembly_names_inited = 1;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19988>; else goto <D.19989>;
    <D.19988>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19989>:
    D.19990 = ret != 0;
    D.19991 = (long int) D.19990;
    D.19992 = __builtin_expect (D.19991, 0);
    if (D.19992 != 0) goto <D.19993>; else goto <D.19994>;
    <D.19993>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1666, "ret == 0");
    <D.19994>:
  }
}


free_item (void * val, void * user_data)
{
  monoeg_g_free (val);
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_assembly_open (const char * filename, MonoImageOpenStatus * status)
{
  struct MonoAssembly * D.19998;

  D.19998 = mono_assembly_open_full (filename, status, 0);
  return D.19998;
}


mono_assembly_load_from_full (struct MonoImage * image, const char * fname, MonoImageOpenStatus * status, gboolean refonly)
{
  long unsigned int D.20000;
  long unsigned int D.20001;
  struct MonoAssembly * D.20004;
  struct MonoAssemblyName * D.20005;
  struct MonoImage * D.20006;
  int D.18438;
  int iftmp.38;
  int D.18437;
  const char[9] * D.20012;
  unsigned char D.20013;
  int D.20014;
  unsigned char D.20015;
  int D.20016;
  const unsigned char * D.20021;
  unsigned char D.20022;
  int D.20023;
  const unsigned char * D.20024;
  unsigned char D.20025;
  int D.20026;
  const unsigned char * D.20031;
  unsigned char D.20032;
  int D.20033;
  const unsigned char * D.20034;
  unsigned char D.20035;
  int D.20036;
  const unsigned char * D.20041;
  unsigned char D.20042;
  int D.20043;
  const unsigned char * D.20044;
  unsigned char D.20045;
  int D.20046;
  const char * D.20048;
  char * D.20051;
  int D.20052;
  _Bool D.20059;
  long int D.20060;
  long int D.20061;
  struct MonoAssembly * D.20064;
  _Bool D.20069;
  long int D.20070;
  long int D.20071;
  struct GList * loaded_assemblies.39;
  struct GList * loaded_assemblies.40;
  _Bool D.20078;
  long int D.20079;
  long int D.20080;
  struct MonoAssembly * ass;
  struct MonoAssembly * ass2;
  char * base_dir;

  D.20000 = BIT_FIELD_REF <*image, 64, 5696>;
  D.20001 = D.20000 & 16777215;
  if (D.20001 == 0) goto <D.20002>; else goto <D.20003>;
  <D.20002>:
  *status = 3;
  D.20004 = 0B;
  return D.20004;
  <D.20003>:
  base_dir = absolute_dir (fname);
  ass = monoeg_malloc0 (128);
  ass->basedir = base_dir;
  ass->ref_only = refonly;
  ass->image = image;
  mono_profiler_assembly_event (ass, 0);
  D.20005 = &ass->aname;
  mono_assembly_fill_assembly_name (image, D.20005);
  D.20006 = mono_defaults.corlib;
  if (D.20006 != 0B) goto <D.20007>; else goto <D.20008>;
  <D.20007>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = ass->aname.name;
      D.20012 = "mscorlib";
      D.20013 = MEM[(const unsigned char *)D.20012];
      D.20014 = (int) D.20013;
      D.20015 = *__s2;
      D.20016 = (int) D.20015;
      __result = D.20014 - D.20016;
      {
        if (__s2_len != 0) goto <D.20017>; else goto <D.20018>;
        <D.20017>:
        if (__result == 0) goto <D.20019>; else goto <D.20020>;
        <D.20019>:
        D.20021 = &MEM[(void *)"mscorlib" + 1B];
        D.20022 = *D.20021;
        D.20023 = (int) D.20022;
        D.20024 = __s2 + 1;
        D.20025 = *D.20024;
        D.20026 = (int) D.20025;
        __result = D.20023 - D.20026;
        if (__s2_len > 1) goto <D.20027>; else goto <D.20028>;
        <D.20027>:
        if (__result == 0) goto <D.20029>; else goto <D.20030>;
        <D.20029>:
        D.20031 = &MEM[(void *)"mscorlib" + 2B];
        D.20032 = *D.20031;
        D.20033 = (int) D.20032;
        D.20034 = __s2 + 2;
        D.20035 = *D.20034;
        D.20036 = (int) D.20035;
        __result = D.20033 - D.20036;
        if (__s2_len > 2) goto <D.20037>; else goto <D.20038>;
        <D.20037>:
        if (__result == 0) goto <D.20039>; else goto <D.20040>;
        <D.20039>:
        D.20041 = &MEM[(void *)"mscorlib" + 3B];
        D.20042 = *D.20041;
        D.20043 = (int) D.20042;
        D.20044 = __s2 + 3;
        D.20045 = *D.20044;
        D.20046 = (int) D.20045;
        __result = D.20043 - D.20046;
        <D.20040>:
        <D.20038>:
        <D.20030>:
        <D.20028>:
        <D.20020>:
        <D.20018>:
      }
      D.18437 = __result;
    }
    iftmp.38 = -D.18437;
    goto <D.20047>;
    <D.20011>:
    D.20048 = ass->aname.name;
    iftmp.38 = __builtin_strcmp (D.20048, "mscorlib");
    <D.20047>:
    D.18438 = iftmp.38;
  }
  if (D.18438 == 0) goto <D.20049>; else goto <D.20050>;
  <D.20049>:
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  D.20006 = mono_defaults.corlib;
  mono_image_addref (D.20006);
  *status = 0;
  D.20006 = mono_defaults.corlib;
  D.20004 = D.20006->assembly;
  return D.20004;
  <D.20050>:
  <D.20008>:
  mono_image_addref (image);
  D.20048 = ass->aname.name;
  D.20051 = image->name;
  D.20052 = image->ref_count;
  mono_trace (64, 1, "Image addref %s[%p] -> %s[%p]: %d", D.20048, ass, D.20051, image, D.20052);
  D.20048 = ass->aname.name;
  if (D.20048 != 0B) goto <D.20053>; else goto <D.20054>;
  <D.20053>:
  D.20005 = &ass->aname;
  ass2 = mono_assembly_invoke_search_hook_internal (D.20005, refonly, 0);
  if (ass2 != 0B) goto <D.20055>; else goto <D.20056>;
  <D.20055>:
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  mono_image_close (image);
  *status = 0;
  D.20004 = ass2;
  return D.20004;
  <D.20056>:
  <D.20054>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20057>; else goto <D.20058>;
    <D.20057>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20058>:
    D.20059 = ret != 0;
    D.20060 = (long int) D.20059;
    D.20061 = __builtin_expect (D.20060, 0);
    if (D.20061 != 0) goto <D.20062>; else goto <D.20063>;
    <D.20062>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1759, "ret == 0");
    <D.20063>:
  }
  D.20064 = image->assembly;
  if (D.20064 != 0B) goto <D.20065>; else goto <D.20066>;
  <D.20065>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20067>; else goto <D.20068>;
    <D.20067>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20068>:
    D.20069 = ret != 0;
    D.20070 = (long int) D.20069;
    D.20071 = __builtin_expect (D.20070, 0);
    if (D.20071 != 0) goto <D.20072>; else goto <D.20073>;
    <D.20072>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1766, "ret == 0");
    <D.20073>:
  }
  ass2 = image->assembly;
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  mono_image_close (image);
  *status = 0;
  D.20004 = ass2;
  return D.20004;
  <D.20066>:
  image->assembly = ass;
  loaded_assemblies.39 = loaded_assemblies;
  loaded_assemblies.40 = monoeg_g_list_prepend (loaded_assemblies.39, ass);
  loaded_assemblies = loaded_assemblies.40;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20076>; else goto <D.20077>;
    <D.20076>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20077>:
    D.20078 = ret != 0;
    D.20079 = (long int) D.20078;
    D.20080 = __builtin_expect (D.20079, 0);
    if (D.20080 != 0) goto <D.20081>; else goto <D.20082>;
    <D.20081>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1778, "ret == 0");
    <D.20082>:
  }
  mono_assembly_invoke_load_hook (ass);
  mono_profiler_assembly_loaded (ass, 0);
  D.20004 = ass;
  return D.20004;
}


absolute_dir (const gchar * filename)
{
  int D.20084;
  gchar * D.20087;
  int D.18330;
  int iftmp.41;
  int D.18329;
  const char[2] * D.20091;
  unsigned char D.20092;
  int D.20093;
  unsigned char D.20094;
  int D.20095;
  const unsigned char * D.20100;
  unsigned char D.20101;
  int D.20102;
  const unsigned char * D.20103;
  unsigned char D.20104;
  int D.20105;
  const unsigned char * D.20110;
  unsigned char D.20111;
  int D.20112;
  const unsigned char * D.20113;
  unsigned char D.20114;
  int D.20115;
  const unsigned char * D.20120;
  unsigned char D.20121;
  int D.20122;
  const unsigned char * D.20123;
  unsigned char D.20124;
  int D.20125;
  int D.18340;
  int iftmp.42;
  int D.18339;
  const char[3] * D.20132;
  unsigned char D.20133;
  int D.20134;
  unsigned char D.20135;
  int D.20136;
  const unsigned char * D.20141;
  unsigned char D.20142;
  int D.20143;
  const unsigned char * D.20144;
  unsigned char D.20145;
  int D.20146;
  const unsigned char * D.20151;
  unsigned char D.20152;
  int D.20153;
  const unsigned char * D.20154;
  unsigned char D.20155;
  int D.20156;
  const unsigned char * D.20161;
  unsigned char D.20162;
  int D.20163;
  const unsigned char * D.20164;
  unsigned char D.20165;
  int D.20166;
  struct GList * D.20172;
  long unsigned int D.20176;
  long unsigned int D.20177;
  gchar * * D.20178;
  void * D.20179;
  struct GList * D.20183;
  char D.20184;
  gchar * cwd;
  gchar * mixed;
  gchar * * parts;
  gchar * part;
  struct GList * list;
  struct GList * tmp;
  struct GString * result;
  gchar * res;
  gint i;

  D.20084 = monoeg_g_path_is_absolute (filename);
  if (D.20084 != 0) goto <D.20085>; else goto <D.20086>;
  <D.20085>:
  part = monoeg_g_path_get_dirname (filename);
  res = monoeg_g_strconcat (part, "/", 0B);
  monoeg_g_free (part);
  D.20087 = res;
  return D.20087;
  <D.20086>:
  cwd = monoeg_g_get_current_dir ();
  mixed = monoeg_g_build_path ("/", cwd, filename, 0B);
  parts = monoeg_g_strsplit (mixed, "/", 0);
  monoeg_g_free (mixed);
  monoeg_g_free (cwd);
  list = 0B;
  i = 0;
  goto <D.18342>;
  <D.18341>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = part;
      D.20091 = ".";
      D.20092 = MEM[(const unsigned char *)D.20091];
      D.20093 = (int) D.20092;
      D.20094 = *__s2;
      D.20095 = (int) D.20094;
      __result = D.20093 - D.20095;
      {
        if (__s2_len != 0) goto <D.20096>; else goto <D.20097>;
        <D.20096>:
        if (__result == 0) goto <D.20098>; else goto <D.20099>;
        <D.20098>:
        D.20100 = &MEM[(void *)"." + 1B];
        D.20101 = *D.20100;
        D.20102 = (int) D.20101;
        D.20103 = __s2 + 1;
        D.20104 = *D.20103;
        D.20105 = (int) D.20104;
        __result = D.20102 - D.20105;
        if (__s2_len > 1) goto <D.20106>; else goto <D.20107>;
        <D.20106>:
        if (__result == 0) goto <D.20108>; else goto <D.20109>;
        <D.20108>:
        D.20110 = &MEM[(void *)"." + 2B];
        D.20111 = *D.20110;
        D.20112 = (int) D.20111;
        D.20113 = __s2 + 2;
        D.20114 = *D.20113;
        D.20115 = (int) D.20114;
        __result = D.20112 - D.20115;
        if (__s2_len > 2) goto <D.20116>; else goto <D.20117>;
        <D.20116>:
        if (__result == 0) goto <D.20118>; else goto <D.20119>;
        <D.20118>:
        D.20120 = &MEM[(void *)"." + 3B];
        D.20121 = *D.20120;
        D.20122 = (int) D.20121;
        D.20123 = __s2 + 3;
        D.20124 = *D.20123;
        D.20125 = (int) D.20124;
        __result = D.20122 - D.20125;
        <D.20119>:
        <D.20117>:
        <D.20109>:
        <D.20107>:
        <D.20099>:
        <D.20097>:
      }
      D.18329 = __result;
    }
    iftmp.41 = -D.18329;
    goto <D.20126>;
    <D.20090>:
    iftmp.41 = __builtin_strcmp (part, ".");
    <D.20126>:
    D.18330 = iftmp.41;
  }
  if (D.18330 == 0) goto <D.20127>; else goto <D.20128>;
  <D.20127>:
  // predicted unlikely by continue predictor.
  goto <D.18331>;
  <D.20128>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = part;
      D.20132 = "..";
      D.20133 = MEM[(const unsigned char *)D.20132];
      D.20134 = (int) D.20133;
      D.20135 = *__s2;
      D.20136 = (int) D.20135;
      __result = D.20134 - D.20136;
      {
        if (__s2_len != 0) goto <D.20137>; else goto <D.20138>;
        <D.20137>:
        if (__result == 0) goto <D.20139>; else goto <D.20140>;
        <D.20139>:
        D.20141 = &MEM[(void *)".." + 1B];
        D.20142 = *D.20141;
        D.20143 = (int) D.20142;
        D.20144 = __s2 + 1;
        D.20145 = *D.20144;
        D.20146 = (int) D.20145;
        __result = D.20143 - D.20146;
        if (__s2_len > 1) goto <D.20147>; else goto <D.20148>;
        <D.20147>:
        if (__result == 0) goto <D.20149>; else goto <D.20150>;
        <D.20149>:
        D.20151 = &MEM[(void *)".." + 2B];
        D.20152 = *D.20151;
        D.20153 = (int) D.20152;
        D.20154 = __s2 + 2;
        D.20155 = *D.20154;
        D.20156 = (int) D.20155;
        __result = D.20153 - D.20156;
        if (__s2_len > 2) goto <D.20157>; else goto <D.20158>;
        <D.20157>:
        if (__result == 0) goto <D.20159>; else goto <D.20160>;
        <D.20159>:
        D.20161 = &MEM[(void *)".." + 3B];
        D.20162 = *D.20161;
        D.20163 = (int) D.20162;
        D.20164 = __s2 + 3;
        D.20165 = *D.20164;
        D.20166 = (int) D.20165;
        __result = D.20163 - D.20166;
        <D.20160>:
        <D.20158>:
        <D.20150>:
        <D.20148>:
        <D.20140>:
        <D.20138>:
      }
      D.18339 = __result;
    }
    iftmp.42 = -D.18339;
    goto <D.20167>;
    <D.20131>:
    iftmp.42 = __builtin_strcmp (part, "..");
    <D.20167>:
    D.18340 = iftmp.42;
  }
  if (D.18340 == 0) goto <D.20168>; else goto <D.20169>;
  <D.20168>:
  if (list != 0B) goto <D.20170>; else goto <D.20171>;
  <D.20170>:
  D.20172 = list->next;
  if (D.20172 != 0B) goto <D.20173>; else goto <D.20174>;
  <D.20173>:
  list = monoeg_g_list_delete_link (list, list);
  <D.20174>:
  <D.20171>:
  goto <D.20175>;
  <D.20169>:
  list = monoeg_g_list_prepend (list, part);
  <D.20175>:
  <D.18331>:
  i = i + 1;
  <D.18342>:
  D.20176 = (long unsigned int) i;
  D.20177 = D.20176 * 8;
  D.20178 = parts + D.20177;
  part = *D.20178;
  if (part != 0B) goto <D.18341>; else goto <D.18343>;
  <D.18343>:
  result = monoeg_g_string_new ("");
  list = monoeg_g_list_reverse (list);
  tmp = list;
  goto <D.18345>;
  <D.18344>:
  D.20179 = tmp->data;
  if (D.20179 != 0B) goto <D.20180>; else goto <D.20181>;
  <D.20180>:
  D.20179 = tmp->data;
  monoeg_g_string_append_printf (result, "%s%c", D.20179, 47);
  <D.20181>:
  tmp = tmp->next;
  <D.18345>:
  if (tmp != 0B) goto <D.20182>; else goto <D.18346>;
  <D.20182>:
  D.20183 = tmp->next;
  if (D.20183 != 0B) goto <D.18344>; else goto <D.18346>;
  <D.18346>:
  res = result->str;
  monoeg_g_string_free (result, 0);
  monoeg_g_list_free (list);
  monoeg_g_strfreev (parts);
  D.20184 = *res;
  if (D.20184 == 0) goto <D.20185>; else goto <D.20186>;
  <D.20185>:
  monoeg_g_free (res);
  D.20087 = monoeg_strdup (".");
  return D.20087;
  <D.20186>:
  D.20087 = res;
  return D.20087;
}


mono_assembly_load_from (struct MonoImage * image, const char * fname, MonoImageOpenStatus * status)
{
  struct MonoAssembly * D.20188;

  D.20188 = mono_assembly_load_from_full (image, fname, status, 0);
  return D.20188;
}


mono_assembly_name_free (struct MonoAssemblyName * aname)
{
  const char * D.20192;
  const char * D.20193;
  const char * D.20194;

  if (aname == 0B) goto <D.20190>; else goto <D.20191>;
  <D.20190>:
  return;
  <D.20191>:
  D.20192 = aname->name;
  monoeg_g_free (D.20192);
  D.20193 = aname->culture;
  monoeg_g_free (D.20193);
  D.20194 = aname->hash_value;
  monoeg_g_free (D.20194);
}


mono_assembly_name_parse_full (const char * name, struct MonoAssemblyName * aname, gboolean save_public_key, gboolean * is_version_defined, gboolean * is_token_defined)
{
  gchar * D.20203;
  gboolean D.20204;
  gchar * D.20205;
  gchar * D.20206;
  gchar * D.20207;
  int D.20208;
  unsigned int part_name_len.43;
  gchar * part_name.44;
  long unsigned int D.20214;
  int D.20215;
  char D.20218;
  int D.20222;
  char D.20225;
  int D.20229;
  char D.20232;
  int D.20236;
  char D.20239;
  int D.20243;
  char D.20246;
  int D.20248;
  int D.20252;
  int D.20256;
  gchar * value.45;
  int D.20260;
  int D.20264;
  int D.20268;
  int D.20272;
  int D.20276;
  gchar * dllname;
  gchar * version;
  gchar * culture;
  gchar * token;
  gchar * key;
  gchar * retargetable;
  gboolean res;
  gchar * value;
  gchar * part_name;
  guint32 part_name_len;
  gchar * * parts;
  gchar * * tmp;
  gboolean version_defined;
  gboolean token_defined;
  guint32 flags;
  guint32 arch;
  void cleanup_and_fail = <<< error >>>;

  try
    {
      version = 0B;
      culture = 0B;
      token = 0B;
      key = 0B;
      retargetable = 0B;
      flags = 0;
      arch = 0;
      if (is_version_defined == 0B) goto <D.20196>; else goto <D.20197>;
      <D.20196>:
      is_version_defined = &version_defined;
      <D.20197>:
      *is_version_defined = 0;
      if (is_token_defined == 0B) goto <D.20198>; else goto <D.20199>;
      <D.20198>:
      is_token_defined = &token_defined;
      <D.20199>:
      *is_token_defined = 0;
      tmp = monoeg_g_strsplit (name, ",", 6);
      parts = tmp;
      if (tmp == 0B) goto <D.20200>; else goto <D.20202>;
      <D.20202>:
      D.20203 = *tmp;
      if (D.20203 == 0B) goto <D.20200>; else goto <D.20201>;
      <D.20200>:
      monoeg_g_strfreev (tmp);
      D.20204 = 0;
      return D.20204;
      <D.20201>:
      D.20203 = *tmp;
      D.20205 = monoeg_g_strchomp (D.20203);
      dllname = monoeg_g_strchug (D.20205);
      tmp = tmp + 8;
      goto <D.18566>;
      <D.18567>:
      D.20203 = *tmp;
      D.20206 = monoeg_g_strchomp (D.20203);
      D.20207 = monoeg_g_strchug (D.20206);
      D.20208 = split_key_value (D.20207, &part_name, &part_name_len, &value);
      if (D.20208 == 0) goto cleanup_and_fail; else goto <D.20209>;
      <D.20209>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 7) goto <D.20211>; else goto <D.20212>;
      <D.20211>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20215 = monoeg_g_ascii_strncasecmp (part_name.44, "Version", D.20214);
      if (D.20215 == 0) goto <D.20216>; else goto <D.20217>;
      <D.20216>:
      *is_version_defined = 1;
      version = value;
      D.20218 = MEM[(const char *)version];
      if (D.20218 == 0) goto cleanup_and_fail; else goto <D.20219>;
      <D.20219>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20217>:
      <D.20212>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 7) goto <D.20220>; else goto <D.20221>;
      <D.20220>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20222 = monoeg_g_ascii_strncasecmp (part_name.44, "Culture", D.20214);
      if (D.20222 == 0) goto <D.20223>; else goto <D.20224>;
      <D.20223>:
      culture = value;
      D.20225 = MEM[(const char *)culture];
      if (D.20225 == 0) goto cleanup_and_fail; else goto <D.20226>;
      <D.20226>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20224>:
      <D.20221>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 14) goto <D.20227>; else goto <D.20228>;
      <D.20227>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20229 = monoeg_g_ascii_strncasecmp (part_name.44, "PublicKeyToken", D.20214);
      if (D.20229 == 0) goto <D.20230>; else goto <D.20231>;
      <D.20230>:
      *is_token_defined = 1;
      token = value;
      D.20232 = MEM[(const char *)token];
      if (D.20232 == 0) goto cleanup_and_fail; else goto <D.20233>;
      <D.20233>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20231>:
      <D.20228>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 9) goto <D.20234>; else goto <D.20235>;
      <D.20234>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20236 = monoeg_g_ascii_strncasecmp (part_name.44, "PublicKey", D.20214);
      if (D.20236 == 0) goto <D.20237>; else goto <D.20238>;
      <D.20237>:
      key = value;
      D.20239 = MEM[(const char *)key];
      if (D.20239 == 0) goto cleanup_and_fail; else goto <D.20240>;
      <D.20240>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20238>:
      <D.20235>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 12) goto <D.20241>; else goto <D.20242>;
      <D.20241>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20243 = monoeg_g_ascii_strncasecmp (part_name.44, "Retargetable", D.20214);
      if (D.20243 == 0) goto <D.20244>; else goto <D.20245>;
      <D.20244>:
      retargetable = value;
      D.20246 = MEM[(const char *)retargetable];
      if (D.20246 == 0) goto cleanup_and_fail; else goto <D.20247>;
      <D.20247>:
      D.20248 = monoeg_ascii_strcasecmp (retargetable, "yes");
      if (D.20248 == 0) goto <D.20249>; else goto <D.20250>;
      <D.20249>:
      flags = flags | 256;
      goto <D.20251>;
      <D.20250>:
      D.20252 = monoeg_ascii_strcasecmp (retargetable, "no");
      if (D.20252 != 0) goto cleanup_and_fail; else goto <D.20253>;
      <D.20253>:
      <D.20251>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20245>:
      <D.20242>:
      part_name_len.43 = part_name_len;
      if (part_name_len.43 == 21) goto <D.20254>; else goto <D.20255>;
      <D.20254>:
      part_name.44 = part_name;
      part_name_len.43 = part_name_len;
      D.20214 = (long unsigned int) part_name_len.43;
      D.20256 = monoeg_g_ascii_strncasecmp (part_name.44, "ProcessorArchitecture", D.20214);
      if (D.20256 == 0) goto <D.20257>; else goto <D.20258>;
      <D.20257>:
      value.45 = value;
      D.20260 = monoeg_ascii_strcasecmp (value.45, "None");
      if (D.20260 == 0) goto <D.20261>; else goto <D.20262>;
      <D.20261>:
      arch = 0;
      goto <D.20263>;
      <D.20262>:
      value.45 = value;
      D.20264 = monoeg_ascii_strcasecmp (value.45, "MSIL");
      if (D.20264 == 0) goto <D.20265>; else goto <D.20266>;
      <D.20265>:
      arch = 1;
      goto <D.20267>;
      <D.20266>:
      value.45 = value;
      D.20268 = monoeg_ascii_strcasecmp (value.45, "X86");
      if (D.20268 == 0) goto <D.20269>; else goto <D.20270>;
      <D.20269>:
      arch = 2;
      goto <D.20271>;
      <D.20270>:
      value.45 = value;
      D.20272 = monoeg_ascii_strcasecmp (value.45, "IA64");
      if (D.20272 == 0) goto <D.20273>; else goto <D.20274>;
      <D.20273>:
      arch = 3;
      goto <D.20275>;
      <D.20274>:
      value.45 = value;
      D.20276 = monoeg_ascii_strcasecmp (value.45, "AMD64");
      if (D.20276 == 0) goto <D.20277>; else goto cleanup_and_fail;
      <D.20277>:
      arch = 4;
      <D.20275>:
      <D.20271>:
      <D.20267>:
      <D.20263>:
      tmp = tmp + 8;
      // predicted unlikely by continue predictor.
      goto <D.18566>;
      <D.20258>:
      <D.20255>:
      monoeg_g_strfreev (parts);
      D.20204 = 0;
      return D.20204;
      <D.18566>:
      D.20203 = *tmp;
      if (D.20203 != 0B) goto <D.18567>; else goto <D.18568>;
      <D.18568>:
      if (retargetable != 0B) goto <D.20279>; else goto <D.20280>;
      <D.20279>:
      if (version == 0B) goto cleanup_and_fail; else goto <D.20281>;
      <D.20281>:
      if (culture == 0B) goto cleanup_and_fail; else goto <D.20282>;
      <D.20282>:
      if (key == 0B) goto <D.20283>; else goto <D.20278>;
      <D.20283>:
      if (token == 0B) goto cleanup_and_fail; else goto <D.20278>;
      <D.20278>:
      <D.20280>:
      res = build_assembly_name (dllname, version, culture, token, key, flags, arch, aname, save_public_key);
      monoeg_g_strfreev (parts);
      D.20204 = res;
      return D.20204;
      cleanup_and_fail:
      monoeg_g_strfreev (parts);
      D.20204 = 0;
      return D.20204;
    }
  finally
    {
      value = {CLOBBER};
      part_name = {CLOBBER};
      part_name_len = {CLOBBER};
      version_defined = {CLOBBER};
      token_defined = {CLOBBER};
    }
}


split_key_value (const gchar * pair, gchar * * key, guint32 * keylen, gchar * * value)
{
  gboolean D.20288;
  long int eqsign.46;
  gchar * D.20290;
  long int D.20291;
  long int D.20292;
  unsigned int D.20293;
  unsigned int D.20294;
  unsigned int D.20295;
  const short unsigned int * * D.20297;
  const short unsigned int * D.20298;
  sizetype D.20299;
  gchar * D.20300;
  char D.20301;
  long unsigned int D.20302;
  long unsigned int D.20303;
  const short unsigned int * D.20304;
  short unsigned int D.20305;
  int D.20306;
  int D.20307;
  gchar * D.20308;
  gchar * D.20309;
  gchar * D.20310;
  char * eqsign;

  eqsign = __builtin_strchr (pair, 61);
  if (eqsign == 0B) goto <D.20286>; else goto <D.20287>;
  <D.20286>:
  *key = 0B;
  *keylen = 0;
  *value = 0B;
  D.20288 = 0;
  return D.20288;
  <D.20287>:
  *key = pair;
  eqsign.46 = (long int) eqsign;
  D.20290 = *key;
  D.20291 = (long int) D.20290;
  D.20292 = eqsign.46 - D.20291;
  D.20293 = (unsigned int) D.20292;
  *keylen = D.20293;
  goto <D.18540>;
  <D.18539>:
  D.20294 = *keylen;
  D.20295 = D.20294 + 4294967295;
  *keylen = D.20295;
  <D.18540>:
  D.20294 = *keylen;
  if (D.20294 != 0) goto <D.20296>; else goto <D.18541>;
  <D.20296>:
  D.20297 = __ctype_b_loc ();
  D.20298 = *D.20297;
  D.20290 = *key;
  D.20294 = *keylen;
  D.20295 = D.20294 + 4294967295;
  D.20299 = (sizetype) D.20295;
  D.20300 = D.20290 + D.20299;
  D.20301 = *D.20300;
  D.20302 = (long unsigned int) D.20301;
  D.20303 = D.20302 * 2;
  D.20304 = D.20298 + D.20303;
  D.20305 = *D.20304;
  D.20306 = (int) D.20305;
  D.20307 = D.20306 & 8192;
  if (D.20307 != 0) goto <D.18539>; else goto <D.18541>;
  <D.18541>:
  D.20308 = eqsign + 1;
  D.20309 = monoeg_g_strchomp (D.20308);
  D.20310 = monoeg_g_strchug (D.20309);
  *value = D.20310;
  D.20288 = 1;
  return D.20288;
}


build_assembly_name (const char * name, const char * version, const char * culture, const char * token, const char * key, guint32 flags, guint32 arch, struct MonoAssemblyName * aname, gboolean save_public_key)
{
  unsigned int version_parts.47;
  unsigned int D.20315;
  gboolean D.20318;
  int major.48;
  short unsigned int D.20320;
  int minor.49;
  short unsigned int D.20322;
  int build.50;
  short unsigned int D.20326;
  int revision.51;
  short unsigned int D.20331;
  short unsigned int D.20333;
  gchar * D.20334;
  int D.20337;
  gchar * D.20340;
  gchar * D.20342;
  int D.20345;
  long unsigned int D.20348;
  mono_byte[17] * D.20351;
  int D.18524;
  int iftmp.52;
  int D.18523;
  const char[5] * D.20359;
  unsigned char D.20360;
  int D.20361;
  unsigned char D.20362;
  int D.20363;
  const unsigned char * D.20368;
  unsigned char D.20369;
  int D.20370;
  const unsigned char * D.20371;
  unsigned char D.20372;
  int D.20373;
  const unsigned char * D.20378;
  unsigned char D.20379;
  int D.20380;
  const unsigned char * D.20381;
  unsigned char D.20382;
  int D.20383;
  const unsigned char * D.20388;
  unsigned char D.20389;
  int D.20390;
  const unsigned char * D.20391;
  unsigned char D.20392;
  int D.20393;
  int D.20396;
  int is_ecma.53;
  gchar * pkey.54;
  unsigned int D.20404;
  gchar * pkeyptr.55;
  unsigned int len.56;
  gint major;
  gint minor;
  gint build;
  gint revision;
  gint len;
  gint version_parts;
  gchar * pkey;
  gchar * pkeyptr;
  gchar * encoded;
  gchar tok[8];

  try
    {
      memset (aname, 0, 80);
      if (version != 0B) goto <D.20312>; else goto <D.20313>;
      <D.20312>:
      version_parts = sscanf (version, "%u.%u.%u.%u", &major, &minor, &build, &revision);
      version_parts.47 = (unsigned int) version_parts;
      D.20315 = version_parts.47 + 4294967294;
      if (D.20315 > 2) goto <D.20316>; else goto <D.20317>;
      <D.20316>:
      D.20318 = 0;
      return D.20318;
      <D.20317>:
      major.48 = major;
      D.20320 = (short unsigned int) major.48;
      aname->major = D.20320;
      minor.49 = minor;
      D.20322 = (short unsigned int) minor.49;
      aname->minor = D.20322;
      if (version_parts > 2) goto <D.20323>; else goto <D.20324>;
      <D.20323>:
      build.50 = build;
      D.20326 = (short unsigned int) build.50;
      aname->build = D.20326;
      goto <D.20327>;
      <D.20324>:
      aname->build = 0;
      <D.20327>:
      if (version_parts == 4) goto <D.20328>; else goto <D.20329>;
      <D.20328>:
      revision.51 = revision;
      D.20331 = (short unsigned int) revision.51;
      aname->revision = D.20331;
      goto <D.20332>;
      <D.20329>:
      aname->revision = 0;
      <D.20332>:
      <D.20313>:
      aname->flags = flags;
      D.20333 = (short unsigned int) arch;
      aname->arch = D.20333;
      D.20334 = monoeg_strdup (name);
      aname->name = D.20334;
      if (culture != 0B) goto <D.20335>; else goto <D.20336>;
      <D.20335>:
      D.20337 = monoeg_ascii_strcasecmp (culture, "neutral");
      if (D.20337 == 0) goto <D.20338>; else goto <D.20339>;
      <D.20338>:
      D.20340 = monoeg_strdup ("");
      aname->culture = D.20340;
      goto <D.20341>;
      <D.20339>:
      D.20342 = monoeg_strdup (culture);
      aname->culture = D.20342;
      <D.20341>:
      <D.20336>:
      if (token != 0B) goto <D.20343>; else goto <D.20344>;
      <D.20343>:
      D.20345 = strncmp (token, "null", 4);
      if (D.20345 != 0) goto <D.20346>; else goto <D.20347>;
      <D.20346>:
      {
        char * lower;

        D.20348 = strlen (token);
        if (D.20348 != 16) goto <D.20349>; else goto <D.20350>;
        <D.20349>:
        mono_assembly_name_free (aname);
        D.20318 = 0;
        return D.20318;
        <D.20350>:
        lower = monoeg_g_ascii_strdown (token, 17);
        D.20351 = &aname->public_key_token;
        monoeg_g_strlcpy (D.20351, lower, 17);
        monoeg_g_free (lower);
      }
      <D.20347>:
      <D.20344>:
      if (key != 0B) goto <D.20352>; else goto <D.20353>;
      <D.20352>:
      {
        gboolean is_ecma;

        try
          {
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = key;
                D.20359 = "null";
                D.20360 = MEM[(const unsigned char *)D.20359];
                D.20361 = (int) D.20360;
                D.20362 = *__s2;
                D.20363 = (int) D.20362;
                __result = D.20361 - D.20363;
                {
                  if (__s2_len != 0) goto <D.20364>; else goto <D.20365>;
                  <D.20364>:
                  if (__result == 0) goto <D.20366>; else goto <D.20367>;
                  <D.20366>:
                  D.20368 = &MEM[(void *)"null" + 1B];
                  D.20369 = *D.20368;
                  D.20370 = (int) D.20369;
                  D.20371 = __s2 + 1;
                  D.20372 = *D.20371;
                  D.20373 = (int) D.20372;
                  __result = D.20370 - D.20373;
                  if (__s2_len > 1) goto <D.20374>; else goto <D.20375>;
                  <D.20374>:
                  if (__result == 0) goto <D.20376>; else goto <D.20377>;
                  <D.20376>:
                  D.20378 = &MEM[(void *)"null" + 2B];
                  D.20379 = *D.20378;
                  D.20380 = (int) D.20379;
                  D.20381 = __s2 + 2;
                  D.20382 = *D.20381;
                  D.20383 = (int) D.20382;
                  __result = D.20380 - D.20383;
                  if (__s2_len > 2) goto <D.20384>; else goto <D.20385>;
                  <D.20384>:
                  if (__result == 0) goto <D.20386>; else goto <D.20387>;
                  <D.20386>:
                  D.20388 = &MEM[(void *)"null" + 3B];
                  D.20389 = *D.20388;
                  D.20390 = (int) D.20389;
                  D.20391 = __s2 + 3;
                  D.20392 = *D.20391;
                  D.20393 = (int) D.20392;
                  __result = D.20390 - D.20393;
                  <D.20387>:
                  <D.20385>:
                  <D.20377>:
                  <D.20375>:
                  <D.20367>:
                  <D.20365>:
                }
                D.18523 = __result;
              }
              iftmp.52 = -D.18523;
              goto <D.20394>;
              <D.20358>:
              iftmp.52 = __builtin_strcmp (key, "null");
              <D.20394>:
              D.18524 = iftmp.52;
            }
            if (D.18524 == 0) goto <D.20354>; else goto <D.20395>;
            <D.20395>:
            D.20396 = parse_public_key (key, &pkey, &is_ecma);
            if (D.20396 == 0) goto <D.20354>; else goto <D.20355>;
            <D.20354>:
            mono_assembly_name_free (aname);
            D.20318 = 0;
            return D.20318;
            <D.20355>:
            is_ecma.53 = is_ecma;
            if (is_ecma.53 != 0) goto <D.20398>; else goto <D.20399>;
            <D.20398>:
            if (save_public_key != 0) goto <D.20400>; else goto <D.20401>;
            <D.20400>:
            pkey.54 = pkey;
            aname->public_key = pkey.54;
            goto <D.20403>;
            <D.20401>:
            pkey.54 = pkey;
            monoeg_g_free (pkey.54);
            <D.20403>:
            D.20351 = &aname->public_key_token;
            monoeg_g_strlcpy (D.20351, "b77a5c561934e089", 17);
            D.20318 = 1;
            return D.20318;
            <D.20399>:
            pkey.54 = pkey;
            D.20404 = mono_metadata_decode_blob_size (pkey.54, &pkeyptr);
            len = (gint) D.20404;
            pkeyptr.55 = pkeyptr;
            len.56 = (unsigned int) len;
            mono_digest_get_public_token (&tok, pkeyptr.55, len.56);
            encoded = encode_public_tok (&tok, 8);
            D.20351 = &aname->public_key_token;
            monoeg_g_strlcpy (D.20351, encoded, 17);
            monoeg_g_free (encoded);
            if (save_public_key != 0) goto <D.20407>; else goto <D.20408>;
            <D.20407>:
            pkey.54 = pkey;
            aname->public_key = pkey.54;
            goto <D.20409>;
            <D.20408>:
            pkey.54 = pkey;
            monoeg_g_free (pkey.54);
            <D.20409>:
          }
        finally
          {
            is_ecma = {CLOBBER};
          }
      }
      <D.20353>:
      D.20318 = 1;
      return D.20318;
    }
  finally
    {
      major = {CLOBBER};
      minor = {CLOBBER};
      build = {CLOBBER};
      revision = {CLOBBER};
      pkey = {CLOBBER};
      pkeyptr = {CLOBBER};
      tok = {CLOBBER};
    }
}


parse_public_key (const gchar * key, gchar * * pubkey, gboolean * is_ecma)
{
  long unsigned int D.20414;
  long unsigned int D.20415;
  gboolean D.20418;
  int D.18473;
  int iftmp.57;
  int D.18472;
  const char[33] * D.20422;
  unsigned char D.20423;
  int D.20424;
  unsigned char D.20425;
  int D.20426;
  const unsigned char * D.20431;
  unsigned char D.20432;
  int D.20433;
  const unsigned char * D.20434;
  unsigned char D.20435;
  int D.20436;
  const unsigned char * D.20441;
  unsigned char D.20442;
  int D.20443;
  const unsigned char * D.20444;
  unsigned char D.20445;
  int D.20446;
  const unsigned char * D.20451;
  unsigned char D.20452;
  int D.20453;
  const unsigned char * D.20454;
  unsigned char D.20455;
  int D.20456;
  gchar * D.20462;
  char D.20463;
  int D.20464;
  char D.20465;
  const gchar * D.20466;
  char D.20467;
  int D.20468;
  signed char D.20469;
  signed char val.58;
  signed char D.20471;
  int D.20472;
  const gchar * D.20475;
  char D.20476;
  int D.20477;
  const gchar * D.20478;
  char D.20479;
  int D.20480;
  signed char D.20481;
  signed char D.20482;
  long unsigned int D.20485;
  long unsigned int D.20486;
  int j.59;
  sizetype D.20490;
  const gchar * D.20491;
  char D.20492;
  int D.20493;
  char D.20494;
  char D.20495;
  int j.60;
  sizetype D.20497;
  const gchar * D.20498;
  char D.20499;
  int D.20500;
  char D.20501;
  signed char D.20502;
  signed char D.20503;
  signed char D.20504;
  char D.20505;
  char D.20508;
  char D.20510;
  char D.20512;
  char D.20514;
  const guint32 * D.20516;
  unsigned int D.20517;
  const guint32 * D.20518;
  unsigned int D.20519;
  unsigned int D.20520;
  int D.20521;
  int D.20528;
  long unsigned int D.20529;
  int offset.61;
  sizetype D.20531;
  gchar * D.20532;
  char D.20533;
  int D.20535;
  long unsigned int D.20536;
  int offset.62;
  sizetype D.20538;
  gchar * D.20539;
  int offset.63;
  sizetype D.20541;
  gchar * D.20542;
  sizetype D.20543;
  gchar * D.20544;
  int j.64;
  sizetype D.20546;
  const gchar * D.20547;
  char D.20548;
  int D.20549;
  char D.20550;
  char D.20551;
  int j.65;
  sizetype D.20553;
  const gchar * D.20554;
  char D.20555;
  int D.20556;
  char D.20557;
  signed char D.20558;
  signed char D.20559;
  signed char D.20560;
  char D.20561;
  int D.20562;
  const gchar * pkey;
  gchar header[16];
  gchar val;
  gchar * arr;
  gint i;
  gint j;
  gint offset;
  gint bitlen;
  gint keylen;
  gint pkeylen;

  try
    {
      D.20414 = strlen (key);
      D.20415 = D.20414 >> 1;
      keylen = (gint) D.20415;
      if (keylen <= 0) goto <D.20416>; else goto <D.20417>;
      <D.20416>:
      D.20418 = 0;
      return D.20418;
      <D.20417>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = key;
          D.20422 = "00000000000000000400000000000000";
          D.20423 = MEM[(const unsigned char *)D.20422];
          D.20424 = (int) D.20423;
          D.20425 = *__s2;
          D.20426 = (int) D.20425;
          __result = D.20424 - D.20426;
          {
            if (__s2_len != 0) goto <D.20427>; else goto <D.20428>;
            <D.20427>:
            if (__result == 0) goto <D.20429>; else goto <D.20430>;
            <D.20429>:
            D.20431 = &MEM[(void *)"00000000000000000400000000000000" + 1B];
            D.20432 = *D.20431;
            D.20433 = (int) D.20432;
            D.20434 = __s2 + 1;
            D.20435 = *D.20434;
            D.20436 = (int) D.20435;
            __result = D.20433 - D.20436;
            if (__s2_len > 1) goto <D.20437>; else goto <D.20438>;
            <D.20437>:
            if (__result == 0) goto <D.20439>; else goto <D.20440>;
            <D.20439>:
            D.20441 = &MEM[(void *)"00000000000000000400000000000000" + 2B];
            D.20442 = *D.20441;
            D.20443 = (int) D.20442;
            D.20444 = __s2 + 2;
            D.20445 = *D.20444;
            D.20446 = (int) D.20445;
            __result = D.20443 - D.20446;
            if (__s2_len > 2) goto <D.20447>; else goto <D.20448>;
            <D.20447>:
            if (__result == 0) goto <D.20449>; else goto <D.20450>;
            <D.20449>:
            D.20451 = &MEM[(void *)"00000000000000000400000000000000" + 3B];
            D.20452 = *D.20451;
            D.20453 = (int) D.20452;
            D.20454 = __s2 + 3;
            D.20455 = *D.20454;
            D.20456 = (int) D.20455;
            __result = D.20453 - D.20456;
            <D.20450>:
            <D.20448>:
            <D.20440>:
            <D.20438>:
            <D.20430>:
            <D.20428>:
          }
          D.18472 = __result;
        }
        iftmp.57 = -D.18472;
        goto <D.20457>;
        <D.20421>:
        iftmp.57 = __builtin_strcmp (key, "00000000000000000400000000000000");
        <D.20457>:
        D.18473 = iftmp.57;
      }
      if (D.18473 == 0) goto <D.20458>; else goto <D.20459>;
      <D.20458>:
      if (pubkey != 0B) goto <D.20460>; else goto <D.20461>;
      <D.20460>:
      D.20462 = monoeg_strdup (key);
      *pubkey = D.20462;
      *is_ecma = 1;
      <D.20461>:
      D.20418 = 1;
      return D.20418;
      <D.20459>:
      *is_ecma = 0;
      D.20463 = *key;
      D.20464 = monoeg_g_ascii_xdigit_value (D.20463);
      D.20465 = (char) D.20464;
      val = D.20465 << 4;
      D.20466 = key + 1;
      D.20467 = *D.20466;
      D.20468 = monoeg_g_ascii_xdigit_value (D.20467);
      D.20469 = (signed char) D.20468;
      val.58 = (signed char) val;
      D.20471 = D.20469 | val.58;
      val = (gchar) D.20471;
      D.20472 = (int) val;
      switch (D.20472) <default: <D.18477>, case 0: <D.18474>, case 6: <D.18476>>
      <D.18474>:
      if (keylen <= 12) goto <D.20473>; else goto <D.20474>;
      <D.20473>:
      D.20418 = 0;
      return D.20418;
      <D.20474>:
      D.20475 = key + 24;
      D.20476 = *D.20475;
      D.20477 = monoeg_g_ascii_xdigit_value (D.20476);
      val = (gchar) D.20477;
      D.20478 = key + 25;
      D.20479 = *D.20478;
      D.20480 = monoeg_g_ascii_xdigit_value (D.20479);
      D.20481 = (signed char) D.20480;
      val.58 = (signed char) val;
      D.20482 = D.20481 | val.58;
      val = (gchar) D.20482;
      if (val != 6) goto <D.20483>; else goto <D.20484>;
      <D.20483>:
      D.20418 = 0;
      return D.20418;
      <D.20484>:
      pkey = key + 24;
      goto <D.18475>;
      <D.18476>:
      pkey = key;
      goto <D.18475>;
      <D.18477>:
      D.20418 = 0;
      return D.20418;
      <D.18475>:
      D.20485 = strlen (pkey);
      D.20486 = D.20485 >> 1;
      pkeylen = (gint) D.20486;
      if (pkeylen <= 15) goto <D.20487>; else goto <D.20488>;
      <D.20487>:
      D.20418 = 0;
      return D.20418;
      <D.20488>:
      i = 0;
      j = 0;
      goto <D.18479>;
      <D.18478>:
      j.59 = j;
      j = j.59 + 1;
      D.20490 = (sizetype) j.59;
      D.20491 = pkey + D.20490;
      D.20492 = *D.20491;
      D.20493 = monoeg_g_ascii_xdigit_value (D.20492);
      D.20494 = (char) D.20493;
      D.20495 = D.20494 << 4;
      header[i] = D.20495;
      j.60 = j;
      j = j.60 + 1;
      D.20497 = (sizetype) j.60;
      D.20498 = pkey + D.20497;
      D.20499 = *D.20498;
      D.20500 = monoeg_g_ascii_xdigit_value (D.20499);
      D.20501 = header[i];
      D.20502 = (signed char) D.20501;
      D.20503 = (signed char) D.20500;
      D.20504 = D.20502 | D.20503;
      D.20505 = (char) D.20504;
      header[i] = D.20505;
      i = i + 1;
      <D.18479>:
      if (i <= 15) goto <D.18478>; else goto <D.18480>;
      <D.18480>:
      D.20508 = header[0];
      if (D.20508 != 6) goto <D.20506>; else goto <D.20509>;
      <D.20509>:
      D.20510 = header[1];
      if (D.20510 != 2) goto <D.20506>; else goto <D.20511>;
      <D.20511>:
      D.20512 = header[2];
      if (D.20512 != 0) goto <D.20506>; else goto <D.20513>;
      <D.20513>:
      D.20514 = header[3];
      if (D.20514 != 0) goto <D.20506>; else goto <D.20515>;
      <D.20515>:
      D.20516 = &MEM[(void *)&header + 8B];
      D.20517 = *D.20516;
      if (D.20517 != 826364754) goto <D.20506>; else goto <D.20507>;
      <D.20506>:
      D.20418 = 0;
      return D.20418;
      <D.20507>:
      D.20518 = &MEM[(void *)&header + 12B];
      D.20519 = *D.20518;
      D.20520 = D.20519 >> 3;
      bitlen = (gint) D.20520;
      D.20521 = bitlen + 20;
      if (D.20521 != pkeylen) goto <D.20522>; else goto <D.20523>;
      <D.20522>:
      D.20418 = 0;
      return D.20418;
      <D.20523>:
      if (pubkey == 0B) goto <D.20524>; else goto <D.20525>;
      <D.20524>:
      D.20418 = 1;
      return D.20418;
      <D.20525>:
      offset = 0;
      if (keylen <= 127) goto <D.20526>; else goto <D.20527>;
      <D.20526>:
      D.20528 = keylen + 1;
      D.20529 = (long unsigned int) D.20528;
      arr = monoeg_malloc (D.20529);
      offset.61 = offset;
      offset = offset.61 + 1;
      D.20531 = (sizetype) offset.61;
      D.20532 = arr + D.20531;
      D.20533 = (char) keylen;
      *D.20532 = D.20533;
      goto <D.20534>;
      <D.20527>:
      D.20535 = keylen + 2;
      D.20536 = (long unsigned int) D.20535;
      arr = monoeg_malloc (D.20536);
      offset.62 = offset;
      offset = offset.62 + 1;
      D.20538 = (sizetype) offset.62;
      D.20539 = arr + D.20538;
      *D.20539 = 128;
      offset.63 = offset;
      offset = offset.63 + 1;
      D.20541 = (sizetype) offset.63;
      D.20542 = arr + D.20541;
      D.20533 = (char) keylen;
      *D.20542 = D.20533;
      <D.20534>:
      i = offset;
      j = 0;
      goto <D.18482>;
      <D.18481>:
      D.20543 = (sizetype) i;
      D.20544 = arr + D.20543;
      j.64 = j;
      j = j.64 + 1;
      D.20546 = (sizetype) j.64;
      D.20547 = key + D.20546;
      D.20548 = *D.20547;
      D.20549 = monoeg_g_ascii_xdigit_value (D.20548);
      D.20550 = (char) D.20549;
      D.20551 = D.20550 << 4;
      *D.20544 = D.20551;
      j.65 = j;
      j = j.65 + 1;
      D.20553 = (sizetype) j.65;
      D.20554 = key + D.20553;
      D.20555 = *D.20554;
      D.20556 = monoeg_g_ascii_xdigit_value (D.20555);
      D.20543 = (sizetype) i;
      D.20544 = arr + D.20543;
      D.20543 = (sizetype) i;
      D.20544 = arr + D.20543;
      D.20557 = *D.20544;
      D.20558 = (signed char) D.20557;
      D.20559 = (signed char) D.20556;
      D.20560 = D.20558 | D.20559;
      D.20561 = (char) D.20560;
      *D.20544 = D.20561;
      i = i + 1;
      <D.18482>:
      D.20562 = keylen + offset;
      if (D.20562 > i) goto <D.18481>; else goto <D.18483>;
      <D.18483>:
      *pubkey = arr;
      D.20418 = 1;
      return D.20418;
    }
  finally
    {
      header = {CLOBBER};
    }
}


mono_assembly_name_parse (const char * name, struct MonoAssemblyName * aname)
{
  gboolean D.20565;

  D.20565 = mono_assembly_name_parse_full (name, aname, 0, 0B, 0B);
  return D.20565;
}


mono_assembly_name_new (const char * name)
{
  int D.20567;
  struct MonoAssemblyName * D.20570;
  struct MonoAssemblyName * aname;

  aname = monoeg_malloc0 (80);
  D.20567 = mono_assembly_name_parse (name, aname);
  if (D.20567 != 0) goto <D.20568>; else goto <D.20569>;
  <D.20568>:
  D.20570 = aname;
  return D.20570;
  <D.20569>:
  monoeg_g_free (aname);
  D.20570 = 0B;
  return D.20570;
}


mono_assembly_name_get_name (struct MonoAssemblyName * aname)
{
  const char * D.20572;

  D.20572 = aname->name;
  return D.20572;
}


mono_assembly_name_get_culture (struct MonoAssemblyName * aname)
{
  const char * D.20574;

  D.20574 = aname->culture;
  return D.20574;
}


mono_assembly_name_get_pubkeytoken (struct MonoAssemblyName * aname)
{
  unsigned char D.20576;
  mono_byte * D.20579;

  D.20576 = aname->public_key_token[0];
  if (D.20576 != 0) goto <D.20577>; else goto <D.20578>;
  <D.20577>:
  D.20579 = &aname->public_key_token;
  return D.20579;
  <D.20578>:
  D.20579 = 0B;
  return D.20579;
}


mono_assembly_name_get_version (struct MonoAssemblyName * aname, uint16_t * minor, uint16_t * build, uint16_t * revision)
{
  short unsigned int D.20583;
  short unsigned int D.20586;
  short unsigned int D.20589;
  uint16_t D.20590;

  if (minor != 0B) goto <D.20581>; else goto <D.20582>;
  <D.20581>:
  D.20583 = aname->minor;
  *minor = D.20583;
  <D.20582>:
  if (build != 0B) goto <D.20584>; else goto <D.20585>;
  <D.20584>:
  D.20586 = aname->build;
  *build = D.20586;
  <D.20585>:
  if (revision != 0B) goto <D.20587>; else goto <D.20588>;
  <D.20587>:
  D.20589 = aname->revision;
  *revision = D.20589;
  <D.20588>:
  D.20590 = aname->major;
  return D.20590;
}


mono_assembly_load_with_partial_name (const char * name, MonoImageOpenStatus * status)
{
  int D.20592;
  struct MonoAssembly * D.20595;
  short unsigned int D.20596;
  short unsigned int D.20597;
  short unsigned int D.20598;
  short unsigned int D.20599;
  short unsigned int D.20600;
  short unsigned int D.20601;
  short unsigned int D.20602;
  char * * assemblies_path.66;
  const char * D.20610;
  char * * extra_gac_paths.67;
  gchar * D.20614;
  const char * D.20618;
  struct MonoString * D.20622;
  struct MonoAssembly * res;
  struct MonoAssemblyName * aname;
  struct MonoAssemblyName base_name;
  struct MonoAssemblyName mapped_aname;
  gchar * fullname;
  gchar * gacpath;
  gchar * * paths;

  try
    {
      memset (&base_name, 0, 80);
      aname = &base_name;
      D.20592 = mono_assembly_name_parse (name, aname);
      if (D.20592 == 0) goto <D.20593>; else goto <D.20594>;
      <D.20593>:
      D.20595 = 0B;
      return D.20595;
      <D.20594>:
      D.20596 = aname->major;
      D.20597 = aname->minor;
      D.20598 = D.20596 | D.20597;
      D.20599 = aname->build;
      D.20600 = D.20598 | D.20599;
      D.20601 = aname->revision;
      D.20602 = D.20600 | D.20601;
      if (D.20602 == 0) goto <D.20603>; else goto <D.20604>;
      <D.20603>:
      aname = mono_assembly_remap_version (aname, &mapped_aname);
      <D.20604>:
      res = mono_assembly_loaded (aname);
      if (res != 0B) goto <D.20605>; else goto <D.20606>;
      <D.20605>:
      mono_assembly_name_free (aname);
      D.20595 = res;
      return D.20595;
      <D.20606>:
      assemblies_path.66 = assemblies_path;
      res = invoke_assembly_preload_hook (aname, assemblies_path.66);
      if (res != 0B) goto <D.20608>; else goto <D.20609>;
      <D.20608>:
      res->in_gac = 0;
      mono_assembly_name_free (aname);
      D.20595 = res;
      return D.20595;
      <D.20609>:
      D.20610 = aname->name;
      fullname = monoeg_g_strdup_printf ("%s.dll", D.20610);
      extra_gac_paths.67 = extra_gac_paths;
      if (extra_gac_paths.67 != 0B) goto <D.20612>; else goto <D.20613>;
      <D.20612>:
      paths = extra_gac_paths;
      goto <D.18633>;
      <D.18632>:
      D.20614 = *paths;
      D.20610 = aname->name;
      gacpath = monoeg_g_build_path ("/", D.20614, "lib", "mono", "gac", D.20610, 0B);
      res = probe_for_partial_name (gacpath, fullname, aname, status);
      monoeg_g_free (gacpath);
      paths = paths + 8;
      <D.18633>:
      if (res == 0B) goto <D.20615>; else goto <D.18634>;
      <D.20615>:
      D.20614 = *paths;
      if (D.20614 != 0B) goto <D.18632>; else goto <D.18634>;
      <D.18634>:
      <D.20613>:
      if (res != 0B) goto <D.20616>; else goto <D.20617>;
      <D.20616>:
      res->in_gac = 1;
      monoeg_g_free (fullname);
      mono_assembly_name_free (aname);
      D.20595 = res;
      return D.20595;
      <D.20617>:
      D.20618 = mono_assembly_getrootdir ();
      D.20610 = aname->name;
      gacpath = monoeg_g_build_path ("/", D.20618, "mono", "gac", D.20610, 0B);
      res = probe_for_partial_name (gacpath, fullname, aname, status);
      monoeg_g_free (gacpath);
      if (res != 0B) goto <D.20619>; else goto <D.20620>;
      <D.20619>:
      res->in_gac = 1;
      goto <D.20621>;
      <D.20620>:
      {
        struct MonoDomain * domain;
        struct MonoReflectionAssembly * refasm;

        domain = mono_domain_get ();
        D.20622 = mono_string_new (domain, name);
        refasm = mono_try_assembly_resolve (domain, D.20622, 0);
        if (refasm != 0B) goto <D.20623>; else goto <D.20624>;
        <D.20623>:
        res = refasm->assembly;
        <D.20624>:
      }
      <D.20621>:
      monoeg_g_free (fullname);
      mono_assembly_name_free (aname);
      D.20595 = res;
      return D.20595;
    }
  finally
    {
      base_name = {CLOBBER};
      mapped_aname = {CLOBBER};
    }
}


mono_assembly_remap_version (struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_aname)
{
  const char * D.20627;
  struct MonoAssemblyName * D.20630;
  unsigned int D.20631;
  unsigned int D.20632;
  short unsigned int D.20635;
  short unsigned int D.20636;
  short unsigned int D.20637;
  short unsigned int D.20638;
  unsigned int D.20639;
  unsigned int D.20640;
  int D.18135;
  int iftmp.68;
  int D.18134;
  const char[11] * D.20644;
  unsigned char D.20645;
  int D.20646;
  unsigned char D.20647;
  int D.20648;
  const unsigned char * D.20653;
  unsigned char D.20654;
  int D.20655;
  const unsigned char * D.20656;
  unsigned char D.20657;
  int D.20658;
  const unsigned char * D.20663;
  unsigned char D.20664;
  int D.20665;
  const unsigned char * D.20666;
  unsigned char D.20667;
  int D.20668;
  const unsigned char * D.20673;
  unsigned char D.20674;
  int D.20675;
  const unsigned char * D.20676;
  unsigned char D.20677;
  int D.20678;
  gchar * D.20682;
  short unsigned int D.20683;
  int D.20684;
  short unsigned int D.20685;
  int D.20686;
  short unsigned int D.20687;
  int D.20688;
  short unsigned int D.20689;
  int D.20690;
  const char * D.20691;
  int D.20692;
  int D.20693;
  int D.20694;
  int D.20695;
  int D.20696;
  int D.20697;
  int res.69;
  const char * D.20698;
  unsigned char D.20701;
  unsigned int index.70;
  _Bool D.20703;
  long int D.20704;
  long int D.20705;
  short unsigned int D.20708;
  short unsigned int D.20711;
  short unsigned int D.20714;
  short unsigned int D.20717;
  short unsigned int D.20720;
  short unsigned int D.20721;
  short unsigned int D.20722;
  int D.20725;
  int D.20726;
  int D.20727;
  int D.20728;
  const struct MonoRuntimeInfo * current_runtime;
  int pos;
  int first;
  int last;

  D.20627 = aname->name;
  if (D.20627 == 0B) goto <D.20628>; else goto <D.20629>;
  <D.20628>:
  D.20630 = aname;
  return D.20630;
  <D.20629>:
  current_runtime = mono_get_runtime_info ();
  D.20631 = aname->flags;
  D.20632 = D.20631 & 256;
  if (D.20632 != 0) goto <D.20633>; else goto <D.20634>;
  <D.20633>:
  {
    const struct AssemblyVersionSet * vset;

    vset = &current_runtime->version_sets[0];
    memcpy (dest_aname, aname, 80);
    D.20635 = vset->major;
    dest_aname->major = D.20635;
    D.20636 = vset->minor;
    dest_aname->minor = D.20636;
    D.20637 = vset->build;
    dest_aname->build = D.20637;
    D.20638 = vset->revision;
    dest_aname->revision = D.20638;
    D.20639 = dest_aname->flags;
    D.20640 = D.20639 & 4294967039;
    dest_aname->flags = D.20640;
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = aname->name;
        D.20644 = "System.Net";
        D.20645 = MEM[(const unsigned char *)D.20644];
        D.20646 = (int) D.20645;
        D.20647 = *__s2;
        D.20648 = (int) D.20647;
        __result = D.20646 - D.20648;
        {
          if (__s2_len != 0) goto <D.20649>; else goto <D.20650>;
          <D.20649>:
          if (__result == 0) goto <D.20651>; else goto <D.20652>;
          <D.20651>:
          D.20653 = &MEM[(void *)"System.Net" + 1B];
          D.20654 = *D.20653;
          D.20655 = (int) D.20654;
          D.20656 = __s2 + 1;
          D.20657 = *D.20656;
          D.20658 = (int) D.20657;
          __result = D.20655 - D.20658;
          if (__s2_len > 1) goto <D.20659>; else goto <D.20660>;
          <D.20659>:
          if (__result == 0) goto <D.20661>; else goto <D.20662>;
          <D.20661>:
          D.20663 = &MEM[(void *)"System.Net" + 2B];
          D.20664 = *D.20663;
          D.20665 = (int) D.20664;
          D.20666 = __s2 + 2;
          D.20667 = *D.20666;
          D.20668 = (int) D.20667;
          __result = D.20665 - D.20668;
          if (__s2_len > 2) goto <D.20669>; else goto <D.20670>;
          <D.20669>:
          if (__result == 0) goto <D.20671>; else goto <D.20672>;
          <D.20671>:
          D.20673 = &MEM[(void *)"System.Net" + 3B];
          D.20674 = *D.20673;
          D.20675 = (int) D.20674;
          D.20676 = __s2 + 3;
          D.20677 = *D.20676;
          D.20678 = (int) D.20677;
          __result = D.20675 - D.20678;
          <D.20672>:
          <D.20670>:
          <D.20662>:
          <D.20660>:
          <D.20652>:
          <D.20650>:
        }
        D.18134 = __result;
      }
      iftmp.68 = -D.18134;
      goto <D.20679>;
      <D.20643>:
      D.20627 = aname->name;
      iftmp.68 = __builtin_strcmp (D.20627, "System.Net");
      <D.20679>:
      D.18135 = iftmp.68;
    }
    if (D.18135 == 0) goto <D.20680>; else goto <D.20681>;
    <D.20680>:
    D.20682 = monoeg_strdup ("System");
    dest_aname->name = D.20682;
    <D.20681>:
    remap_keys (dest_aname);
    D.20627 = aname->name;
    D.20683 = aname->major;
    D.20684 = (int) D.20683;
    D.20685 = aname->minor;
    D.20686 = (int) D.20685;
    D.20687 = aname->build;
    D.20688 = (int) D.20687;
    D.20689 = aname->revision;
    D.20690 = (int) D.20689;
    D.20691 = dest_aname->name;
    D.20635 = vset->major;
    D.20692 = (int) D.20635;
    D.20636 = vset->minor;
    D.20693 = (int) D.20636;
    D.20637 = vset->build;
    D.20694 = (int) D.20637;
    D.20638 = vset->revision;
    D.20695 = (int) D.20638;
    mono_trace (64, 1, "The request to load the retargetable assembly %s v%d.%d.%d.%d was remapped to %s v%d.%d.%d.%d", D.20627, D.20684, D.20686, D.20688, D.20690, D.20691, D.20692, D.20693, D.20694, D.20695);
    D.20630 = dest_aname;
    return D.20630;
  }
  <D.20634>:
  first = 0;
  last = 62;
  goto <D.18149>;
  <D.18148>:
  {
    int res;

    D.20696 = last - first;
    D.20697 = D.20696 / 2;
    pos = D.20697 + first;
    {
      size_t __s1_len;
      size_t __s2_len;

      D.20627 = aname->name;
      D.20698 = framework_assemblies[pos].assembly_name;
      res.69 = __builtin_strcmp (D.20627, D.20698);
    }
    res = res.69;
    if (res == 0) goto <D.20699>; else goto <D.20700>;
    <D.20699>:
    {
      const struct AssemblyVersionSet * vset;
      int index;

      D.20701 = framework_assemblies[pos].version_set_index;
      index = (int) D.20701;
      index.70 = (unsigned int) index;
      D.20703 = index.70 > 3;
      D.20704 = (long int) D.20703;
      D.20705 = __builtin_expect (D.20704, 0);
      if (D.20705 != 0) goto <D.20706>; else goto <D.20707>;
      <D.20706>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 995, "index < G_N_ELEMENTS (current_runtime->version_sets)");
      <D.20707>:
      vset = &current_runtime->version_sets[index];
      D.20683 = aname->major;
      D.20708 = vset->major;
      if (D.20683 == D.20708) goto <D.20709>; else goto <D.20710>;
      <D.20709>:
      D.20685 = aname->minor;
      D.20711 = vset->minor;
      if (D.20685 == D.20711) goto <D.20712>; else goto <D.20713>;
      <D.20712>:
      D.20687 = aname->build;
      D.20714 = vset->build;
      if (D.20687 == D.20714) goto <D.20715>; else goto <D.20716>;
      <D.20715>:
      D.20689 = aname->revision;
      D.20717 = vset->revision;
      if (D.20689 == D.20717) goto <D.20718>; else goto <D.20719>;
      <D.20718>:
      D.20630 = aname;
      return D.20630;
      <D.20719>:
      <D.20716>:
      <D.20713>:
      <D.20710>:
      D.20683 = aname->major;
      D.20685 = aname->minor;
      D.20720 = D.20683 | D.20685;
      D.20687 = aname->build;
      D.20721 = D.20720 | D.20687;
      D.20689 = aname->revision;
      D.20722 = D.20721 | D.20689;
      if (D.20722 != 0) goto <D.20723>; else goto <D.20724>;
      <D.20723>:
      D.20627 = aname->name;
      D.20683 = aname->major;
      D.20684 = (int) D.20683;
      D.20685 = aname->minor;
      D.20686 = (int) D.20685;
      D.20687 = aname->build;
      D.20688 = (int) D.20687;
      D.20689 = aname->revision;
      D.20690 = (int) D.20689;
      D.20708 = vset->major;
      D.20725 = (int) D.20708;
      D.20711 = vset->minor;
      D.20726 = (int) D.20711;
      D.20714 = vset->build;
      D.20727 = (int) D.20714;
      D.20717 = vset->revision;
      D.20728 = (int) D.20717;
      mono_trace (16, 1, "The request to load the assembly %s v%d.%d.%d.%d was remapped to v%d.%d.%d.%d", D.20627, D.20684, D.20686, D.20688, D.20690, D.20725, D.20726, D.20727, D.20728);
      <D.20724>:
      memcpy (dest_aname, aname, 80);
      D.20708 = vset->major;
      dest_aname->major = D.20708;
      D.20711 = vset->minor;
      dest_aname->minor = D.20711;
      D.20714 = vset->build;
      dest_aname->build = D.20714;
      D.20717 = vset->revision;
      dest_aname->revision = D.20717;
      D.20630 = dest_aname;
      return D.20630;
    }
    <D.20700>:
    if (res < 0) goto <D.20729>; else goto <D.20730>;
    <D.20729>:
    last = pos + -1;
    goto <D.20731>;
    <D.20730>:
    first = pos + 1;
    <D.20731>:
  }
  <D.18149>:
  if (first <= last) goto <D.18148>; else goto <D.18150>;
  <D.18150>:
  D.20630 = aname;
  return D.20630;
}


remap_keys (struct MonoAssemblyName * aname)
{
  int D.18113;
  const char * D.20735;
  const char * D.20736;
  mono_byte[17] * D.20738;
  const char * D.20739;
  int D.20740;
  const char * D.20741;
  unsigned int i.71;
  int i;

  i = 0;
  goto <D.18116>;
  <D.18115>:
  {
    const struct KeyRemapEntry * entry;

    entry = &key_remap_table[i];
    {
      size_t __s1_len;
      size_t __s2_len;

      D.20735 = aname->name;
      D.20736 = entry->name;
      D.18113 = __builtin_strcmp (D.20735, D.20736);
    }
    if (D.18113 != 0) goto <D.20733>; else goto <D.20737>;
    <D.20737>:
    D.20738 = &aname->public_key_token;
    D.20739 = entry->from;
    D.20740 = mono_public_tokens_are_equal (D.20738, D.20739);
    if (D.20740 == 0) goto <D.20733>; else goto <D.20734>;
    <D.20733>:
    // predicted unlikely by continue predictor.
    goto <D.18114>;
    <D.20734>:
    D.20738 = &aname->public_key_token;
    D.20741 = entry->to;
    memcpy (D.20738, D.20741, 17);
    D.20735 = aname->name;
    D.20739 = entry->from;
    D.20741 = entry->to;
    mono_trace (64, 1, "Remapped public key token of retargetable assembly %s from %s to %s", D.20735, D.20739, D.20741);
    return;
  }
  <D.18114>:
  i = i + 1;
  <D.18116>:
  i.71 = (unsigned int) i;
  if (i.71 <= 13) goto <D.18115>; else goto <D.18117>;
  <D.18117>:
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.20744;
  long unsigned int D.20745;

  D.20745 = __builtin_object_size (__dest, 0);
  D.20744 = __builtin___memcpy_chk (__dest, __src, __len, D.20745);
  return D.20744;
}


invoke_assembly_preload_hook (struct MonoAssemblyName * aname, gchar * * assemblies_path)
{
  struct MonoAssembly * (*<Tf6b>) (struct MonoAssemblyName *, char * *, void *) D.20747;
  void * D.20748;
  struct MonoAssembly * D.20751;
  struct AssemblyPreLoadHook * hook;
  struct MonoAssembly * assembly;

  hook = assembly_preload_hook;
  goto <D.18278>;
  <D.18277>:
  D.20747 = hook->func;
  D.20748 = hook->user_data;
  assembly = D.20747 (aname, assemblies_path, D.20748);
  if (assembly != 0B) goto <D.20749>; else goto <D.20750>;
  <D.20749>:
  D.20751 = assembly;
  return D.20751;
  <D.20750>:
  hook = hook->next;
  <D.18278>:
  if (hook != 0B) goto <D.18277>; else goto <D.18279>;
  <D.18279>:
  D.20751 = 0B;
  return D.20751;
}


probe_for_partial_name (const char * basepath, const char * fullname, struct MonoAssemblyName * aname, MonoImageOpenStatus * status)
{
  struct MonoAssembly * D.20755;
  short unsigned int D.20756;
  short unsigned int D.20757;
  short unsigned int D.20758;
  short unsigned int D.20759;
  short unsigned int D.20760;
  short unsigned int D.20761;
  short unsigned int D.20762;
  _Bool D.20763;
  const char * D.20764;
  int D.20765;
  const char * D.20768;
  int D.18617;
  const char * D.20771;
  mono_byte[17] * D.20776;
  char D.20777;
  int D.20780;
  long unsigned int D.20787;
  long unsigned int D.20788;
  long unsigned int D.20789;
  long unsigned int D.20790;
  _Bool D.20791;
  short unsigned int D.20793;
  int D.20794;
  short unsigned int D.20800;
  int D.20801;
  short unsigned int D.20807;
  int D.20808;
  short unsigned int D.20814;
  int D.20815;
  gchar * fullpath;
  struct GDir * dirhandle;
  const char * direntry;
  struct MonoAssemblyName gac_aname;
  gint major;
  gint minor;
  gint build;
  gint revision;
  gboolean exact_version;

  try
    {
      fullpath = 0B;
      major = -1;
      minor = 0;
      build = 0;
      revision = 0;
      dirhandle = monoeg_g_dir_open (basepath, 0, 0B);
      if (dirhandle == 0B) goto <D.20753>; else goto <D.20754>;
      <D.20753>:
      D.20755 = 0B;
      return D.20755;
      <D.20754>:
      D.20756 = aname->major;
      D.20757 = aname->minor;
      D.20758 = D.20756 | D.20757;
      D.20759 = aname->build;
      D.20760 = D.20758 | D.20759;
      D.20761 = aname->revision;
      D.20762 = D.20760 | D.20761;
      D.20763 = D.20762 != 0;
      exact_version = (gboolean) D.20763;
      goto <D.18608>;
      <D.18618>:
      {
        gboolean match;

        match = 1;
        D.20764 = aname->name;
        D.20765 = parse_assembly_directory_name (D.20764, direntry, &gac_aname);
        if (D.20765 == 0) goto <D.20766>; else goto <D.20767>;
        <D.20766>:
        // predicted unlikely by continue predictor.
        goto <D.18608>;
        <D.20767>:
        D.20768 = aname->culture;
        if (D.20768 != 0B) goto <D.20769>; else goto <D.20770>;
        <D.20769>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.20768 = aname->culture;
          D.20771 = gac_aname.culture;
          D.18617 = __builtin_strcmp (D.20768, D.20771);
        }
        if (D.18617 != 0) goto <D.20772>; else goto <D.20773>;
        <D.20772>:
        match = 0;
        <D.20773>:
        <D.20770>:
        if (match != 0) goto <D.20774>; else goto <D.20775>;
        <D.20774>:
        D.20776 = &aname->public_key_token;
        D.20777 = MEM[(const char *)D.20776];
        if (D.20777 != 0) goto <D.20778>; else goto <D.20779>;
        <D.20778>:
        D.20776 = &aname->public_key_token;
        D.20780 = mono_public_tokens_are_equal (D.20776, &gac_aname.public_key_token);
        if (D.20780 == 0) goto <D.20781>; else goto <D.20782>;
        <D.20781>:
        match = 0;
        <D.20782>:
        <D.20779>:
        <D.20775>:
        if (match != 0) goto <D.20783>; else goto <D.20784>;
        <D.20783>:
        if (exact_version != 0) goto <D.20785>; else goto <D.20786>;
        <D.20785>:
        D.20787 = BIT_FIELD_REF <*aname, 64, 512>;
        D.20788 = D.20787;
        D.20789 = BIT_FIELD_REF <gac_aname, 64, 512>;
        D.20790 = D.20789;
        D.20791 = D.20788 == D.20790;
        match = (gboolean) D.20791;
        goto <D.20792>;
        <D.20786>:
        D.20793 = gac_aname.major;
        D.20794 = (int) D.20793;
        if (D.20794 < major) goto <D.20795>; else goto <D.20796>;
        <D.20795>:
        match = 0;
        goto <D.20797>;
        <D.20796>:
        D.20793 = gac_aname.major;
        D.20794 = (int) D.20793;
        if (D.20794 == major) goto <D.20798>; else goto <D.20799>;
        <D.20798>:
        D.20800 = gac_aname.minor;
        D.20801 = (int) D.20800;
        if (D.20801 < minor) goto <D.20802>; else goto <D.20803>;
        <D.20802>:
        match = 0;
        goto <D.20804>;
        <D.20803>:
        D.20800 = gac_aname.minor;
        D.20801 = (int) D.20800;
        if (D.20801 == minor) goto <D.20805>; else goto <D.20806>;
        <D.20805>:
        D.20807 = gac_aname.build;
        D.20808 = (int) D.20807;
        if (D.20808 < build) goto <D.20809>; else goto <D.20810>;
        <D.20809>:
        match = 0;
        goto <D.20811>;
        <D.20810>:
        D.20807 = gac_aname.build;
        D.20808 = (int) D.20807;
        if (D.20808 == build) goto <D.20812>; else goto <D.20813>;
        <D.20812>:
        D.20814 = gac_aname.revision;
        D.20815 = (int) D.20814;
        if (D.20815 <= revision) goto <D.20816>; else goto <D.20817>;
        <D.20816>:
        match = 0;
        <D.20817>:
        <D.20813>:
        <D.20811>:
        <D.20806>:
        <D.20804>:
        <D.20799>:
        <D.20797>:
        <D.20792>:
        <D.20784>:
        if (match != 0) goto <D.20818>; else goto <D.20819>;
        <D.20818>:
        D.20793 = gac_aname.major;
        major = (gint) D.20793;
        D.20800 = gac_aname.minor;
        minor = (gint) D.20800;
        D.20807 = gac_aname.build;
        build = (gint) D.20807;
        D.20814 = gac_aname.revision;
        revision = (gint) D.20814;
        monoeg_g_free (fullpath);
        fullpath = monoeg_g_build_path ("/", basepath, direntry, fullname, 0B);
        <D.20819>:
        mono_assembly_name_free (&gac_aname);
      }
      <D.18608>:
      direntry = monoeg_g_dir_read_name (dirhandle);
      if (direntry != 0B) goto <D.18618>; else goto <D.18619>;
      <D.18619>:
      monoeg_g_dir_close (dirhandle);
      if (fullpath == 0B) goto <D.20820>; else goto <D.20821>;
      <D.20820>:
      D.20755 = 0B;
      return D.20755;
      <D.20821>:
      {
        struct MonoAssembly * res;

        res = mono_assembly_open (fullpath, status);
        monoeg_g_free (fullpath);
        D.20755 = res;
        return D.20755;
      }
    }
  finally
    {
      gac_aname = {CLOBBER};
    }
}


parse_assembly_directory_name (const char * name, const char * dirname, struct MonoAssemblyName * aname)
{
  gchar * D.20827;
  gchar * * D.20829;
  gchar * D.20830;
  gchar * * D.20832;
  gchar * D.20833;
  gboolean D.20834;
  gchar * * parts;
  gboolean res;

  parts = monoeg_g_strsplit (dirname, "_", 3);
  if (parts == 0B) goto <D.20824>; else goto <D.20826>;
  <D.20826>:
  D.20827 = *parts;
  if (D.20827 == 0B) goto <D.20824>; else goto <D.20828>;
  <D.20828>:
  D.20829 = parts + 8;
  D.20830 = *D.20829;
  if (D.20830 == 0B) goto <D.20824>; else goto <D.20831>;
  <D.20831>:
  D.20832 = parts + 16;
  D.20833 = *D.20832;
  if (D.20833 == 0B) goto <D.20824>; else goto <D.20825>;
  <D.20824>:
  monoeg_g_strfreev (parts);
  D.20834 = 0;
  return D.20834;
  <D.20825>:
  D.20827 = *parts;
  D.20829 = parts + 8;
  D.20830 = *D.20829;
  D.20832 = parts + 16;
  D.20833 = *D.20832;
  res = build_assembly_name (name, D.20827, D.20830, D.20833, 0B, 0, 0, aname, 0);
  monoeg_g_strfreev (parts);
  D.20834 = res;
  return D.20834;
}


mono_assembly_load_corlib (const struct MonoRuntimeInfo * runtime, MonoImageOpenStatus * status)
{
  struct MonoAssembly * corlib.72;
  struct MonoAssembly * D.20839;
  char * * assemblies_path.73;
  struct MonoAssembly * corlib.74;
  struct MonoAssembly * corlib.75;
  const char[4] * D.20849;
  struct MonoAssembly * corlib.76;
  struct MonoAssembly * corlib.77;
  int D.18822;
  int iftmp.78;
  int D.18821;
  const char[4] * D.20861;
  unsigned char D.20862;
  int D.20863;
  unsigned char D.20864;
  int D.20865;
  const unsigned char * D.20870;
  unsigned char D.20871;
  int D.20872;
  const unsigned char * D.20873;
  unsigned char D.20874;
  int D.20875;
  const unsigned char * D.20880;
  unsigned char D.20881;
  int D.20882;
  const unsigned char * D.20883;
  unsigned char D.20884;
  int D.20885;
  const unsigned char * D.20890;
  unsigned char D.20891;
  int D.20892;
  const unsigned char * D.20893;
  unsigned char D.20894;
  int D.20895;
  const char * D.20899;
  gchar * D.20900;
  char * corlib_file;
  struct MonoAssemblyName * aname;

  corlib.72 = corlib;
  if (corlib.72 != 0B) goto <D.20837>; else goto <D.20838>;
  <D.20837>:
  D.20839 = corlib;
  return D.20839;
  <D.20838>:
  aname = mono_assembly_name_new ("mscorlib.dll");
  assemblies_path.73 = assemblies_path;
  corlib.74 = invoke_assembly_preload_hook (aname, assemblies_path.73);
  corlib = corlib.74;
  mono_assembly_name_free (aname);
  monoeg_g_free (aname);
  corlib.72 = corlib;
  if (corlib.72 != 0B) goto <D.20842>; else goto <D.20843>;
  <D.20842>:
  D.20839 = corlib;
  return D.20839;
  <D.20843>:
  assemblies_path.73 = assemblies_path;
  if (assemblies_path.73 != 0B) goto <D.20844>; else goto <D.20845>;
  <D.20844>:
  assemblies_path.73 = assemblies_path;
  corlib.75 = load_in_path ("mscorlib.dll", assemblies_path.73, status, 0);
  corlib = corlib.75;
  corlib.72 = corlib;
  if (corlib.72 != 0B) goto <D.20847>; else goto <D.20848>;
  <D.20847>:
  D.20839 = corlib;
  return D.20839;
  <D.20848>:
  <D.20845>:
  D.20849 = &runtime->framework_version;
  corlib_file = monoeg_g_build_path ("/", "mono", D.20849, "mscorlib.dll", 0B);
  assemblies_path.73 = assemblies_path;
  if (assemblies_path.73 != 0B) goto <D.20850>; else goto <D.20851>;
  <D.20850>:
  assemblies_path.73 = assemblies_path;
  corlib.76 = load_in_path (corlib_file, assemblies_path.73, status, 0);
  corlib = corlib.76;
  corlib.72 = corlib;
  if (corlib.72 != 0B) goto <D.20853>; else goto <D.20854>;
  <D.20853>:
  monoeg_g_free (corlib_file);
  D.20839 = corlib;
  return D.20839;
  <D.20854>:
  <D.20851>:
  corlib.77 = load_in_path (corlib_file, &default_path, status, 0);
  corlib = corlib.77;
  monoeg_g_free (corlib_file);
  corlib.72 = corlib;
  if (corlib.72 != 0B) goto <D.20856>; else goto <D.20857>;
  <D.20856>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &runtime->framework_version;
      D.20861 = "4.5";
      D.20862 = MEM[(const unsigned char *)D.20861];
      D.20863 = (int) D.20862;
      D.20864 = *__s2;
      D.20865 = (int) D.20864;
      __result = D.20863 - D.20865;
      {
        if (__s2_len != 0) goto <D.20866>; else goto <D.20867>;
        <D.20866>:
        if (__result == 0) goto <D.20868>; else goto <D.20869>;
        <D.20868>:
        D.20870 = &MEM[(void *)"4.5" + 1B];
        D.20871 = *D.20870;
        D.20872 = (int) D.20871;
        D.20873 = __s2 + 1;
        D.20874 = *D.20873;
        D.20875 = (int) D.20874;
        __result = D.20872 - D.20875;
        if (__s2_len > 1) goto <D.20876>; else goto <D.20877>;
        <D.20876>:
        if (__result == 0) goto <D.20878>; else goto <D.20879>;
        <D.20878>:
        D.20880 = &MEM[(void *)"4.5" + 2B];
        D.20881 = *D.20880;
        D.20882 = (int) D.20881;
        D.20883 = __s2 + 2;
        D.20884 = *D.20883;
        D.20885 = (int) D.20884;
        __result = D.20882 - D.20885;
        if (__s2_len > 2) goto <D.20886>; else goto <D.20887>;
        <D.20886>:
        if (__result == 0) goto <D.20888>; else goto <D.20889>;
        <D.20888>:
        D.20890 = &MEM[(void *)"4.5" + 3B];
        D.20891 = *D.20890;
        D.20892 = (int) D.20891;
        D.20893 = __s2 + 3;
        D.20894 = *D.20893;
        D.20895 = (int) D.20894;
        __result = D.20892 - D.20895;
        <D.20889>:
        <D.20887>:
        <D.20879>:
        <D.20877>:
        <D.20869>:
        <D.20867>:
      }
      D.18821 = __result;
    }
    iftmp.78 = -D.18821;
    goto <D.20896>;
    <D.20860>:
    D.20849 = &runtime->framework_version;
    iftmp.78 = __builtin_strcmp (D.20849, "4.5");
    <D.20896>:
    D.18822 = iftmp.78;
  }
  if (D.18822 == 0) goto <D.20897>; else goto <D.20898>;
  <D.20897>:
  D.20899 = default_path[0];
  D.20900 = monoeg_g_strdup_printf ("%s/mono/4.5/Facades", D.20899);
  default_path[1] = D.20900;
  <D.20898>:
  <D.20857>:
  D.20839 = corlib;
  return D.20839;
}


load_in_path (const char * basename, const char * * search_path, MonoImageOpenStatus * status, MonoBoolean refonly)
{
  long unsigned int D.20902;
  long unsigned int D.20903;
  const char * * D.20904;
  const char * D.20905;
  int D.20906;
  struct MonoAssembly * D.20909;
  int i;
  char * fullpath;
  struct MonoAssembly * result;

  i = 0;
  goto <D.17947>;
  <D.17946>:
  D.20902 = (long unsigned int) i;
  D.20903 = D.20902 * 8;
  D.20904 = search_path + D.20903;
  D.20905 = *D.20904;
  fullpath = monoeg_g_build_path ("/", D.20905, basename, 0B);
  D.20906 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.20906);
  monoeg_g_free (fullpath);
  if (result != 0B) goto <D.20907>; else goto <D.20908>;
  <D.20907>:
  D.20909 = result;
  return D.20909;
  <D.20908>:
  i = i + 1;
  <D.17947>:
  D.20902 = (long unsigned int) i;
  D.20903 = D.20902 * 8;
  D.20904 = search_path + D.20903;
  D.20905 = *D.20904;
  if (D.20905 != 0B) goto <D.17946>; else goto <D.17948>;
  <D.17948>:
  D.20909 = 0B;
  return D.20909;
}


mono_assembly_load_full_nosearch (struct MonoAssemblyName * aname, const char * basedir, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoAssembly * D.20915;
  struct MonoAssembly * iftmp.79;
  char * * assemblies_path.80;
  int D.18845;
  int iftmp.81;
  int D.18844;
  const char[9] * D.20928;
  unsigned char D.20929;
  int D.20930;
  unsigned char D.20931;
  int D.20932;
  const unsigned char * D.20937;
  unsigned char D.20938;
  int D.20939;
  const unsigned char * D.20940;
  unsigned char D.20941;
  int D.20942;
  const unsigned char * D.20947;
  unsigned char D.20948;
  int D.20949;
  const unsigned char * D.20950;
  unsigned char D.20951;
  int D.20952;
  const unsigned char * D.20957;
  unsigned char D.20958;
  int D.20959;
  const unsigned char * D.20960;
  unsigned char D.20961;
  int D.20962;
  const char * D.20964;
  int D.18854;
  int iftmp.82;
  int D.18853;
  const char[13] * D.20969;
  unsigned char D.20970;
  int D.20971;
  unsigned char D.20972;
  int D.20973;
  const unsigned char * D.20978;
  unsigned char D.20979;
  int D.20980;
  const unsigned char * D.20981;
  unsigned char D.20982;
  int D.20983;
  const unsigned char * D.20988;
  unsigned char D.20989;
  int D.20990;
  const unsigned char * D.20991;
  unsigned char D.20992;
  int D.20993;
  const unsigned char * D.20998;
  unsigned char D.20999;
  int D.21000;
  const unsigned char * D.21001;
  unsigned char D.21002;
  int D.21003;
  const struct MonoRuntimeInfo * D.21005;
  long unsigned int D.21006;
  const char * iftmp.83;
  int D.18863;
  int iftmp.84;
  int D.18862;
  sizetype D.21018;
  sizetype D.21019;
  const char[5] * D.21020;
  unsigned char D.21021;
  int D.21022;
  unsigned char D.21023;
  int D.21024;
  const unsigned char * D.21029;
  unsigned char D.21030;
  int D.21031;
  const unsigned char * D.21032;
  unsigned char D.21033;
  int D.21034;
  const unsigned char * D.21039;
  unsigned char D.21040;
  int D.21041;
  const unsigned char * D.21042;
  unsigned char D.21043;
  int D.21044;
  const unsigned char * D.21049;
  unsigned char D.21050;
  int D.21051;
  const unsigned char * D.21052;
  unsigned char D.21053;
  int D.21054;
  const char * D.21056;
  int D.18872;
  int iftmp.85;
  int D.18871;
  const char[5] * D.21061;
  unsigned char D.21062;
  int D.21063;
  unsigned char D.21064;
  int D.21065;
  const unsigned char * D.21070;
  unsigned char D.21071;
  int D.21072;
  const unsigned char * D.21073;
  unsigned char D.21074;
  int D.21075;
  const unsigned char * D.21080;
  unsigned char D.21081;
  int D.21082;
  const unsigned char * D.21083;
  unsigned char D.21084;
  int D.21085;
  const unsigned char * D.21090;
  unsigned char D.21091;
  int D.21092;
  const unsigned char * D.21093;
  unsigned char D.21094;
  int D.21095;
  unsigned char D.21097;
  struct MonoAssembly * result;
  char * fullpath;
  char * filename;
  struct MonoAssemblyName maped_aname;
  struct MonoAssemblyName maped_name_pp;
  int ext_index;
  const char * ext;
  int len;

  try
    {
      aname = mono_assembly_remap_version (aname, &maped_aname);
      if (refonly == 0) goto <D.20911>; else goto <D.20912>;
      <D.20911>:
      aname = mono_assembly_apply_binding (aname, &maped_name_pp);
      <D.20912>:
      result = mono_assembly_loaded_full (aname, refonly);
      if (result != 0B) goto <D.20913>; else goto <D.20914>;
      <D.20913>:
      D.20915 = result;
      return D.20915;
      <D.20914>:
      if (refonly != 0) goto <D.20917>; else goto <D.20918>;
      <D.20917>:
      assemblies_path.80 = assemblies_path;
      iftmp.79 = invoke_assembly_refonly_preload_hook (aname, assemblies_path.80);
      goto <D.20920>;
      <D.20918>:
      assemblies_path.80 = assemblies_path;
      iftmp.79 = invoke_assembly_preload_hook (aname, assemblies_path.80);
      <D.20920>:
      result = iftmp.79;
      if (result != 0B) goto <D.20921>; else goto <D.20922>;
      <D.20921>:
      result->in_gac = 0;
      D.20915 = result;
      return D.20915;
      <D.20922>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname->name;
          D.20928 = "mscorlib";
          D.20929 = MEM[(const unsigned char *)D.20928];
          D.20930 = (int) D.20929;
          D.20931 = *__s2;
          D.20932 = (int) D.20931;
          __result = D.20930 - D.20932;
          {
            if (__s2_len != 0) goto <D.20933>; else goto <D.20934>;
            <D.20933>:
            if (__result == 0) goto <D.20935>; else goto <D.20936>;
            <D.20935>:
            D.20937 = &MEM[(void *)"mscorlib" + 1B];
            D.20938 = *D.20937;
            D.20939 = (int) D.20938;
            D.20940 = __s2 + 1;
            D.20941 = *D.20940;
            D.20942 = (int) D.20941;
            __result = D.20939 - D.20942;
            if (__s2_len > 1) goto <D.20943>; else goto <D.20944>;
            <D.20943>:
            if (__result == 0) goto <D.20945>; else goto <D.20946>;
            <D.20945>:
            D.20947 = &MEM[(void *)"mscorlib" + 2B];
            D.20948 = *D.20947;
            D.20949 = (int) D.20948;
            D.20950 = __s2 + 2;
            D.20951 = *D.20950;
            D.20952 = (int) D.20951;
            __result = D.20949 - D.20952;
            if (__s2_len > 2) goto <D.20953>; else goto <D.20954>;
            <D.20953>:
            if (__result == 0) goto <D.20955>; else goto <D.20956>;
            <D.20955>:
            D.20957 = &MEM[(void *)"mscorlib" + 3B];
            D.20958 = *D.20957;
            D.20959 = (int) D.20958;
            D.20960 = __s2 + 3;
            D.20961 = *D.20960;
            D.20962 = (int) D.20961;
            __result = D.20959 - D.20962;
            <D.20956>:
            <D.20954>:
            <D.20946>:
            <D.20944>:
            <D.20936>:
            <D.20934>:
          }
          D.18844 = __result;
        }
        iftmp.81 = -D.18844;
        goto <D.20963>;
        <D.20927>:
        D.20964 = aname->name;
        iftmp.81 = __builtin_strcmp (D.20964, "mscorlib");
        <D.20963>:
        D.18845 = iftmp.81;
      }
      if (D.18845 == 0) goto <D.20923>; else goto <D.20965>;
      <D.20965>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname->name;
          D.20969 = "mscorlib.dll";
          D.20970 = MEM[(const unsigned char *)D.20969];
          D.20971 = (int) D.20970;
          D.20972 = *__s2;
          D.20973 = (int) D.20972;
          __result = D.20971 - D.20973;
          {
            if (__s2_len != 0) goto <D.20974>; else goto <D.20975>;
            <D.20974>:
            if (__result == 0) goto <D.20976>; else goto <D.20977>;
            <D.20976>:
            D.20978 = &MEM[(void *)"mscorlib.dll" + 1B];
            D.20979 = *D.20978;
            D.20980 = (int) D.20979;
            D.20981 = __s2 + 1;
            D.20982 = *D.20981;
            D.20983 = (int) D.20982;
            __result = D.20980 - D.20983;
            if (__s2_len > 1) goto <D.20984>; else goto <D.20985>;
            <D.20984>:
            if (__result == 0) goto <D.20986>; else goto <D.20987>;
            <D.20986>:
            D.20988 = &MEM[(void *)"mscorlib.dll" + 2B];
            D.20989 = *D.20988;
            D.20990 = (int) D.20989;
            D.20991 = __s2 + 2;
            D.20992 = *D.20991;
            D.20993 = (int) D.20992;
            __result = D.20990 - D.20993;
            if (__s2_len > 2) goto <D.20994>; else goto <D.20995>;
            <D.20994>:
            if (__result == 0) goto <D.20996>; else goto <D.20997>;
            <D.20996>:
            D.20998 = &MEM[(void *)"mscorlib.dll" + 3B];
            D.20999 = *D.20998;
            D.21000 = (int) D.20999;
            D.21001 = __s2 + 3;
            D.21002 = *D.21001;
            D.21003 = (int) D.21002;
            __result = D.21000 - D.21003;
            <D.20997>:
            <D.20995>:
            <D.20987>:
            <D.20985>:
            <D.20977>:
            <D.20975>:
          }
          D.18853 = __result;
        }
        iftmp.82 = -D.18853;
        goto <D.21004>;
        <D.20968>:
        D.20964 = aname->name;
        iftmp.82 = __builtin_strcmp (D.20964, "mscorlib.dll");
        <D.21004>:
        D.18854 = iftmp.82;
      }
      if (D.18854 == 0) goto <D.20923>; else goto <D.20924>;
      <D.20923>:
      D.21005 = mono_get_runtime_info ();
      D.20915 = mono_assembly_load_corlib (D.21005, status);
      return D.20915;
      <D.20924>:
      D.20964 = aname->name;
      D.21006 = strlen (D.20964);
      len = (int) D.21006;
      ext_index = 0;
      goto <D.18874>;
      <D.18873>:
      if (ext_index == 0) goto <D.21008>; else goto <D.21009>;
      <D.21008>:
      iftmp.83 = ".dll";
      goto <D.21010>;
      <D.21009>:
      iftmp.83 = ".exe";
      <D.21010>:
      ext = iftmp.83;
      if (len > 4) goto <D.21014>; else goto <D.21011>;
      <D.21014>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          D.20964 = aname->name;
          D.21018 = (sizetype) len;
          D.21019 = D.21018 + 18446744073709551612;
          __s2 = D.20964 + D.21019;
          D.21020 = ".dll";
          D.21021 = MEM[(const unsigned char *)D.21020];
          D.21022 = (int) D.21021;
          D.21023 = *__s2;
          D.21024 = (int) D.21023;
          __result = D.21022 - D.21024;
          {
            if (__s2_len != 0) goto <D.21025>; else goto <D.21026>;
            <D.21025>:
            if (__result == 0) goto <D.21027>; else goto <D.21028>;
            <D.21027>:
            D.21029 = &MEM[(void *)".dll" + 1B];
            D.21030 = *D.21029;
            D.21031 = (int) D.21030;
            D.21032 = __s2 + 1;
            D.21033 = *D.21032;
            D.21034 = (int) D.21033;
            __result = D.21031 - D.21034;
            if (__s2_len > 1) goto <D.21035>; else goto <D.21036>;
            <D.21035>:
            if (__result == 0) goto <D.21037>; else goto <D.21038>;
            <D.21037>:
            D.21039 = &MEM[(void *)".dll" + 2B];
            D.21040 = *D.21039;
            D.21041 = (int) D.21040;
            D.21042 = __s2 + 2;
            D.21043 = *D.21042;
            D.21044 = (int) D.21043;
            __result = D.21041 - D.21044;
            if (__s2_len > 2) goto <D.21045>; else goto <D.21046>;
            <D.21045>:
            if (__result == 0) goto <D.21047>; else goto <D.21048>;
            <D.21047>:
            D.21049 = &MEM[(void *)".dll" + 3B];
            D.21050 = *D.21049;
            D.21051 = (int) D.21050;
            D.21052 = __s2 + 3;
            D.21053 = *D.21052;
            D.21054 = (int) D.21053;
            __result = D.21051 - D.21054;
            <D.21048>:
            <D.21046>:
            <D.21038>:
            <D.21036>:
            <D.21028>:
            <D.21026>:
          }
          D.18862 = __result;
        }
        iftmp.84 = -D.18862;
        goto <D.21055>;
        <D.21017>:
        D.20964 = aname->name;
        D.21018 = (sizetype) len;
        D.21019 = D.21018 + 18446744073709551612;
        D.21056 = D.20964 + D.21019;
        iftmp.84 = __builtin_strcmp (D.21056, ".dll");
        <D.21055>:
        D.18863 = iftmp.84;
      }
      if (D.18863 == 0) goto <D.21012>; else goto <D.21057>;
      <D.21057>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          D.20964 = aname->name;
          D.21018 = (sizetype) len;
          D.21019 = D.21018 + 18446744073709551612;
          __s2 = D.20964 + D.21019;
          D.21061 = ".exe";
          D.21062 = MEM[(const unsigned char *)D.21061];
          D.21063 = (int) D.21062;
          D.21064 = *__s2;
          D.21065 = (int) D.21064;
          __result = D.21063 - D.21065;
          {
            if (__s2_len != 0) goto <D.21066>; else goto <D.21067>;
            <D.21066>:
            if (__result == 0) goto <D.21068>; else goto <D.21069>;
            <D.21068>:
            D.21070 = &MEM[(void *)".exe" + 1B];
            D.21071 = *D.21070;
            D.21072 = (int) D.21071;
            D.21073 = __s2 + 1;
            D.21074 = *D.21073;
            D.21075 = (int) D.21074;
            __result = D.21072 - D.21075;
            if (__s2_len > 1) goto <D.21076>; else goto <D.21077>;
            <D.21076>:
            if (__result == 0) goto <D.21078>; else goto <D.21079>;
            <D.21078>:
            D.21080 = &MEM[(void *)".exe" + 2B];
            D.21081 = *D.21080;
            D.21082 = (int) D.21081;
            D.21083 = __s2 + 2;
            D.21084 = *D.21083;
            D.21085 = (int) D.21084;
            __result = D.21082 - D.21085;
            if (__s2_len > 2) goto <D.21086>; else goto <D.21087>;
            <D.21086>:
            if (__result == 0) goto <D.21088>; else goto <D.21089>;
            <D.21088>:
            D.21090 = &MEM[(void *)".exe" + 3B];
            D.21091 = *D.21090;
            D.21092 = (int) D.21091;
            D.21093 = __s2 + 3;
            D.21094 = *D.21093;
            D.21095 = (int) D.21094;
            __result = D.21092 - D.21095;
            <D.21089>:
            <D.21087>:
            <D.21079>:
            <D.21077>:
            <D.21069>:
            <D.21067>:
          }
          D.18871 = __result;
        }
        iftmp.85 = -D.18871;
        goto <D.21096>;
        <D.21060>:
        D.20964 = aname->name;
        D.21018 = (sizetype) len;
        D.21019 = D.21018 + 18446744073709551612;
        D.21056 = D.20964 + D.21019;
        iftmp.85 = __builtin_strcmp (D.21056, ".exe");
        <D.21096>:
        D.18872 = iftmp.85;
      }
      if (D.18872 == 0) goto <D.21012>; else goto <D.21011>;
      <D.21012>:
      D.20964 = aname->name;
      filename = monoeg_strdup (D.20964);
      ext_index = ext_index + 1;
      goto <D.21013>;
      <D.21011>:
      D.20964 = aname->name;
      filename = monoeg_g_strconcat (D.20964, ext, 0B);
      <D.21013>:
      D.21097 = (unsigned char) refonly;
      result = mono_assembly_load_from_gac (aname, filename, status, D.21097);
      if (result != 0B) goto <D.21098>; else goto <D.21099>;
      <D.21098>:
      monoeg_g_free (filename);
      D.20915 = result;
      return D.20915;
      <D.21099>:
      if (basedir != 0B) goto <D.21100>; else goto <D.21101>;
      <D.21100>:
      fullpath = monoeg_g_build_path ("/", basedir, filename, 0B);
      result = mono_assembly_open_full (fullpath, status, refonly);
      monoeg_g_free (fullpath);
      if (result != 0B) goto <D.21102>; else goto <D.21103>;
      <D.21102>:
      result->in_gac = 0;
      monoeg_g_free (filename);
      D.20915 = result;
      return D.20915;
      <D.21103>:
      <D.21101>:
      D.21097 = (unsigned char) refonly;
      result = load_in_path (filename, &default_path, status, D.21097);
      if (result != 0B) goto <D.21104>; else goto <D.21105>;
      <D.21104>:
      result->in_gac = 0;
      <D.21105>:
      monoeg_g_free (filename);
      if (result != 0B) goto <D.21106>; else goto <D.21107>;
      <D.21106>:
      D.20915 = result;
      return D.20915;
      <D.21107>:
      ext_index = ext_index + 1;
      <D.18874>:
      if (ext_index <= 1) goto <D.18873>; else goto <D.18875>;
      <D.18875>:
      D.20915 = result;
      return D.20915;
    }
  finally
    {
      maped_aname = {CLOBBER};
      maped_name_pp = {CLOBBER};
    }
}


mono_assembly_apply_binding (struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_name)
{
  unsigned char D.21110;
  struct MonoAssemblyName * D.21113;
  union mono_mutex_t * D.21116;
  _Bool D.21119;
  long int D.21120;
  long int D.21121;
  _Bool D.21126;
  long int D.21127;
  long int D.21128;
  int D.21133;
  struct MonoAppDomainSetup * D.21138;
  struct MonoString * D.21141;
  _Bool D.21146;
  long int D.21147;
  long int D.21148;
  int D.21151;
  short unsigned int D.21156;
  int D.21157;
  short unsigned int D.21158;
  int D.21159;
  char * D.21164;
  gchar * D.21165;
  char * D.21166;
  gchar * D.21167;
  int D.21168;
  _Bool D.21171;
  long int D.21172;
  long int D.21173;
  long unsigned int D.21178;
  long unsigned int D.21179;
  const char * D.21186;
  gchar * D.21187;
  const char * D.21188;
  gchar * D.21189;
  guchar[17] * D.21190;
  mono_byte[17] * D.21191;
  struct GSList * loaded_assembly_bindings.86;
  struct GSList * loaded_assembly_bindings.87;
  int D.21200;
  struct MonoAssemblyBindingInfo * info;
  struct MonoAssemblyBindingInfo * info2;
  struct MonoImage * ppimage;
  struct MonoDomain * domain;

  D.21110 = aname->public_key_token[0];
  if (D.21110 == 0) goto <D.21111>; else goto <D.21112>;
  <D.21111>:
  D.21113 = aname;
  return D.21113;
  <D.21112>:
  domain = mono_domain_get ();
  mono_assembly_binding_lock ();
  info = search_binding_loaded (aname);
  mono_assembly_binding_unlock ();
  if (info == 0B) goto <D.21114>; else goto <D.21115>;
  <D.21114>:
  {
    int ret;

    D.21116 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.21116);
    if (ret != 0) goto <D.21117>; else goto <D.21118>;
    <D.21117>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21118>:
    D.21119 = ret != 0;
    D.21120 = (long int) D.21119;
    D.21121 = __builtin_expect (D.21120, 0);
    if (D.21121 != 0) goto <D.21122>; else goto <D.21123>;
    <D.21122>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2644, "ret == 0");
    <D.21123>:
  }
  info = get_per_domain_assembly_binding_info (domain, aname);
  {
    int ret;

    D.21116 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21116);
    if (ret != 0) goto <D.21124>; else goto <D.21125>;
    <D.21124>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21125>:
    D.21126 = ret != 0;
    D.21127 = (long int) D.21126;
    D.21128 = __builtin_expect (D.21127, 0);
    if (D.21128 != 0) goto <D.21129>; else goto <D.21130>;
    <D.21129>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2646, "ret == 0");
    <D.21130>:
  }
  <D.21115>:
  if (info != 0B) goto <D.21131>; else goto <D.21132>;
  <D.21131>:
  D.21133 = check_policy_versions (info, aname);
  if (D.21133 == 0) goto <D.21134>; else goto <D.21135>;
  <D.21134>:
  D.21113 = aname;
  return D.21113;
  <D.21135>:
  mono_assembly_bind_version (info, aname, dest_name);
  D.21113 = dest_name;
  return D.21113;
  <D.21132>:
  if (domain != 0B) goto <D.21136>; else goto <D.21137>;
  <D.21136>:
  D.21138 = domain->setup;
  if (D.21138 != 0B) goto <D.21139>; else goto <D.21140>;
  <D.21139>:
  D.21138 = domain->setup;
  D.21141 = D.21138->configuration_file;
  if (D.21141 != 0B) goto <D.21142>; else goto <D.21143>;
  <D.21142>:
  {
    int ret;

    D.21116 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.21116);
    if (ret != 0) goto <D.21144>; else goto <D.21145>;
    <D.21144>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21145>:
    D.21146 = ret != 0;
    D.21147 = (long int) D.21146;
    D.21148 = __builtin_expect (D.21147, 0);
    if (D.21148 != 0) goto <D.21149>; else goto <D.21150>;
    <D.21149>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2658, "ret == 0");
    <D.21150>:
  }
  D.21151 = domain->assembly_bindings_parsed;
  if (D.21151 == 0) goto <D.21152>; else goto <D.21153>;
  <D.21152>:
  {
    gchar * domain_config_file_name;
    gchar * domain_config_file_path;

    D.21138 = domain->setup;
    D.21141 = D.21138->configuration_file;
    domain_config_file_name = mono_string_to_utf8 (D.21141);
    domain_config_file_path = mono_portability_find_file (domain_config_file_name, 1);
    if (domain_config_file_path == 0B) goto <D.21154>; else goto <D.21155>;
    <D.21154>:
    domain_config_file_path = domain_config_file_name;
    <D.21155>:
    D.21156 = aname->major;
    D.21157 = (int) D.21156;
    D.21158 = aname->minor;
    D.21159 = (int) D.21158;
    mono_config_parse_assembly_bindings (domain_config_file_path, D.21157, D.21159, domain, assembly_binding_info_parsed);
    domain->assembly_bindings_parsed = 1;
    if (domain_config_file_name != domain_config_file_path) goto <D.21160>; else goto <D.21161>;
    <D.21160>:
    monoeg_g_free (domain_config_file_name);
    <D.21161>:
    monoeg_g_free (domain_config_file_path);
  }
  <D.21153>:
  info2 = get_per_domain_assembly_binding_info (domain, aname);
  if (info2 != 0B) goto <D.21162>; else goto <D.21163>;
  <D.21162>:
  info = monoeg_g_memdup (info2, 80);
  D.21164 = info2->name;
  D.21165 = monoeg_strdup (D.21164);
  info->name = D.21165;
  D.21166 = info2->culture;
  D.21167 = monoeg_strdup (D.21166);
  info->culture = D.21167;
  D.21168 = domain->domain_id;
  info->domain_id = D.21168;
  <D.21163>:
  {
    int ret;

    D.21116 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21116);
    if (ret != 0) goto <D.21169>; else goto <D.21170>;
    <D.21169>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21170>:
    D.21171 = ret != 0;
    D.21172 = (long int) D.21171;
    D.21173 = __builtin_expect (D.21172, 0);
    if (D.21173 != 0) goto <D.21174>; else goto <D.21175>;
    <D.21174>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2682, "ret == 0");
    <D.21175>:
  }
  <D.21143>:
  <D.21140>:
  <D.21137>:
  if (info == 0B) goto <D.21176>; else goto <D.21177>;
  <D.21176>:
  info = monoeg_malloc0 (80);
  D.21156 = aname->major;
  D.21157 = (int) D.21156;
  info->major = D.21157;
  D.21158 = aname->minor;
  D.21159 = (int) D.21158;
  info->minor = D.21159;
  <D.21177>:
  D.21178 = BIT_FIELD_REF <*info, 64, 512>;
  D.21179 = D.21178 & 34359738368;
  if (D.21179 == 0) goto <D.21180>; else goto <D.21181>;
  <D.21180>:
  ppimage = mono_assembly_load_publisher_policy (aname);
  if (ppimage != 0B) goto <D.21182>; else goto <D.21183>;
  <D.21182>:
  get_publisher_policy_info (ppimage, aname, info);
  mono_image_close (ppimage);
  <D.21183>:
  <D.21181>:
  D.21178 = BIT_FIELD_REF <*info, 64, 512>;
  D.21179 = D.21178 & 34359738368;
  if (D.21179 == 0) goto <D.21184>; else goto <D.21185>;
  <D.21184>:
  D.21186 = aname->name;
  D.21187 = monoeg_strdup (D.21186);
  info->name = D.21187;
  D.21188 = aname->culture;
  D.21189 = monoeg_strdup (D.21188);
  info->culture = D.21189;
  D.21190 = &info->public_key_token;
  D.21191 = &aname->public_key_token;
  monoeg_g_strlcpy (D.21190, D.21191, 17);
  <D.21185>:
  mono_assembly_binding_lock ();
  info2 = search_binding_loaded (aname);
  if (info2 != 0B) goto <D.21192>; else goto <D.21193>;
  <D.21192>:
  mono_assembly_binding_info_free (info);
  monoeg_g_free (info);
  info = info2;
  goto <D.21194>;
  <D.21193>:
  loaded_assembly_bindings.86 = loaded_assembly_bindings;
  loaded_assembly_bindings.87 = monoeg_g_slist_prepend (loaded_assembly_bindings.86, info);
  loaded_assembly_bindings = loaded_assembly_bindings.87;
  <D.21194>:
  mono_assembly_binding_unlock ();
  D.21178 = BIT_FIELD_REF <*info, 64, 512>;
  D.21179 = D.21178 & 34359738368;
  if (D.21179 == 0) goto <D.21197>; else goto <D.21199>;
  <D.21199>:
  D.21200 = check_policy_versions (info, aname);
  if (D.21200 == 0) goto <D.21197>; else goto <D.21198>;
  <D.21197>:
  D.21113 = aname;
  return D.21113;
  <D.21198>:
  mono_assembly_bind_version (info, aname, dest_name);
  D.21113 = dest_name;
  return D.21113;
}


assembly_binding_info_parsed (struct MonoAssemblyBindingInfo * info, void * user_data)
{
  int D.18745;
  char * D.21204;
  char * D.21205;
  int D.21208;
  struct MonoMemPool * D.21211;
  char * D.21214;
  char * D.21215;
  char * D.21218;
  struct GSList * D.21219;
  struct GSList * D.21220;
  struct MonoAssemblyBindingInfo * info_copy;
  struct GSList * tmp;
  struct MonoAssemblyBindingInfo * info_tmp;
  struct MonoDomain * domain;

  domain = user_data;
  if (domain == 0B) goto <D.21202>; else goto <D.21203>;
  <D.21202>:
  return;
  <D.21203>:
  tmp = domain->assembly_bindings;
  goto <D.18747>;
  <D.18746>:
  info_tmp = tmp->data;
  {
    size_t __s1_len;
    size_t __s2_len;

    D.21204 = info->name;
    D.21205 = info_tmp->name;
    D.18745 = __builtin_strcmp (D.21204, D.21205);
  }
  if (D.18745 == 0) goto <D.21206>; else goto <D.21207>;
  <D.21206>:
  D.21208 = info_versions_equal (info, info_tmp);
  if (D.21208 != 0) goto <D.21209>; else goto <D.21210>;
  <D.21209>:
  return;
  <D.21210>:
  <D.21207>:
  tmp = tmp->next;
  <D.18747>:
  if (tmp != 0B) goto <D.18746>; else goto <D.18748>;
  <D.18748>:
  D.21211 = domain->mp;
  info_copy = mono_mempool_alloc0 (D.21211, 80);
  memcpy (info_copy, info, 80);
  D.21204 = info->name;
  if (D.21204 != 0B) goto <D.21212>; else goto <D.21213>;
  <D.21212>:
  D.21211 = domain->mp;
  D.21204 = info->name;
  D.21214 = mono_mempool_strdup (D.21211, D.21204);
  info_copy->name = D.21214;
  <D.21213>:
  D.21215 = info->culture;
  if (D.21215 != 0B) goto <D.21216>; else goto <D.21217>;
  <D.21216>:
  D.21211 = domain->mp;
  D.21215 = info->culture;
  D.21218 = mono_mempool_strdup (D.21211, D.21215);
  info_copy->culture = D.21218;
  <D.21217>:
  D.21211 = domain->mp;
  D.21219 = domain->assembly_bindings;
  D.21220 = g_slist_append_mempool (D.21211, D.21219, info_copy);
  domain->assembly_bindings = D.21220;
}


info_versions_equal (struct MonoAssemblyBindingInfo * left, struct MonoAssemblyBindingInfo * right)
{
  long unsigned int D.21222;
  long unsigned int D.21223;
  long unsigned int D.21224;
  long unsigned int D.21225;
  gboolean D.21228;
  long unsigned int D.21229;
  long unsigned int D.21232;
  long unsigned int D.21235;
  struct AssemblyVersionSet * D.21238;
  struct AssemblyVersionSet * D.21239;
  int D.21240;
  long unsigned int D.21243;
  struct AssemblyVersionSet * D.21246;
  struct AssemblyVersionSet * D.21247;
  int D.21248;
  long unsigned int D.21251;
  struct AssemblyVersionSet * D.21254;
  struct AssemblyVersionSet * D.21255;
  int D.21256;

  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21223 = BIT_FIELD_REF <*right, 64, 512>;
  D.21224 = D.21222 ^ D.21223;
  D.21225 = D.21224 & 4294967296;
  if (D.21225 != 0) goto <D.21226>; else goto <D.21227>;
  <D.21226>:
  D.21228 = 0;
  return D.21228;
  <D.21227>:
  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21223 = BIT_FIELD_REF <*right, 64, 512>;
  D.21224 = D.21222 ^ D.21223;
  D.21229 = D.21224 & 8589934592;
  if (D.21229 != 0) goto <D.21230>; else goto <D.21231>;
  <D.21230>:
  D.21228 = 0;
  return D.21228;
  <D.21231>:
  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21223 = BIT_FIELD_REF <*right, 64, 512>;
  D.21224 = D.21222 ^ D.21223;
  D.21232 = D.21224 & 17179869184;
  if (D.21232 != 0) goto <D.21233>; else goto <D.21234>;
  <D.21233>:
  D.21228 = 0;
  return D.21228;
  <D.21234>:
  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21235 = D.21222 & 4294967296;
  if (D.21235 != 0) goto <D.21236>; else goto <D.21237>;
  <D.21236>:
  D.21238 = &left->old_version_bottom;
  D.21239 = &right->old_version_bottom;
  D.21240 = info_compare_versions (D.21238, D.21239);
  if (D.21240 == 0) goto <D.21241>; else goto <D.21242>;
  <D.21241>:
  D.21228 = 0;
  return D.21228;
  <D.21242>:
  <D.21237>:
  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21243 = D.21222 & 8589934592;
  if (D.21243 != 0) goto <D.21244>; else goto <D.21245>;
  <D.21244>:
  D.21246 = &left->old_version_top;
  D.21247 = &right->old_version_top;
  D.21248 = info_compare_versions (D.21246, D.21247);
  if (D.21248 == 0) goto <D.21249>; else goto <D.21250>;
  <D.21249>:
  D.21228 = 0;
  return D.21228;
  <D.21250>:
  <D.21245>:
  D.21222 = BIT_FIELD_REF <*left, 64, 512>;
  D.21251 = D.21222 & 17179869184;
  if (D.21251 != 0) goto <D.21252>; else goto <D.21253>;
  <D.21252>:
  D.21254 = &left->new_version;
  D.21255 = &right->new_version;
  D.21256 = info_compare_versions (D.21254, D.21255);
  if (D.21256 == 0) goto <D.21257>; else goto <D.21258>;
  <D.21257>:
  D.21228 = 0;
  return D.21228;
  <D.21258>:
  <D.21253>:
  D.21228 = 1;
  return D.21228;
}


info_compare_versions (struct AssemblyVersionSet * left, struct AssemblyVersionSet * right)
{
  short unsigned int D.21262;
  short unsigned int D.21263;
  short unsigned int D.21265;
  short unsigned int D.21266;
  short unsigned int D.21268;
  short unsigned int D.21269;
  short unsigned int D.21271;
  short unsigned int D.21272;
  gboolean D.21273;

  D.21262 = left->major;
  D.21263 = right->major;
  if (D.21262 != D.21263) goto <D.21260>; else goto <D.21264>;
  <D.21264>:
  D.21265 = left->minor;
  D.21266 = right->minor;
  if (D.21265 != D.21266) goto <D.21260>; else goto <D.21267>;
  <D.21267>:
  D.21268 = left->build;
  D.21269 = right->build;
  if (D.21268 != D.21269) goto <D.21260>; else goto <D.21270>;
  <D.21270>:
  D.21271 = left->revision;
  D.21272 = right->revision;
  if (D.21271 != D.21272) goto <D.21260>; else goto <D.21261>;
  <D.21260>:
  D.21273 = 0;
  return D.21273;
  <D.21261>:
  D.21273 = 1;
  return D.21273;
}


g_slist_append_mempool (struct MonoMemPool * mp, struct GSList * list, void * data)
{
  struct GSList * D.21277;
  struct GSList * D.21278;
  struct GSList * new_list;
  struct GSList * last;

  new_list = mono_mempool_alloc (mp, 16);
  new_list->data = data;
  new_list->next = 0B;
  if (list != 0B) goto <D.21275>; else goto <D.21276>;
  <D.21275>:
  last = list;
  goto <D.11333>;
  <D.11332>:
  last = last->next;
  <D.11333>:
  D.21277 = last->next;
  if (D.21277 != 0B) goto <D.11332>; else goto <D.11334>;
  <D.11334>:
  last->next = new_list;
  D.21278 = list;
  return D.21278;
  <D.21276>:
  D.21278 = new_list;
  return D.21278;
}


get_per_domain_assembly_binding_info (struct MonoDomain * domain, struct MonoAssemblyName * aname)
{
  struct GSList * D.21280;
  struct MonoAssemblyBindingInfo * D.21283;
  int D.18772;
  const char * D.21286;
  char * D.21287;
  int D.21290;
  unsigned char D.21297;
  long unsigned int D.21299;
  long unsigned int D.21300;
  int D.21302;
  struct MonoAssemblyBindingInfo * info;
  struct GSList * list;

  D.21280 = domain->assembly_bindings;
  if (D.21280 == 0B) goto <D.21281>; else goto <D.21282>;
  <D.21281>:
  D.21283 = 0B;
  return D.21283;
  <D.21282>:
  info = 0B;
  list = domain->assembly_bindings;
  goto <D.18775>;
  <D.18774>:
  info = list->data;
  if (info != 0B) goto <D.21284>; else goto <D.21285>;
  <D.21284>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.21286 = aname->name;
    D.21287 = info->name;
    D.18772 = __builtin_strcmp (D.21286, D.21287);
  }
  if (D.18772 == 0) goto <D.21288>; else goto <D.21289>;
  <D.21288>:
  D.21290 = info_major_minor_in_range (info, aname);
  if (D.21290 != 0) goto <D.18773>; else goto <D.21291>;
  <D.21291>:
  <D.21289>:
  <D.21285>:
  info = 0B;
  list = list->next;
  <D.18775>:
  if (list != 0B) goto <D.18774>; else goto <D.18773>;
  <D.18773>:
  if (info != 0B) goto <D.21292>; else goto <D.21293>;
  <D.21292>:
  D.21287 = info->name;
  if (D.21287 != 0B) goto <D.21296>; else goto <D.21294>;
  <D.21296>:
  D.21297 = info->public_key_token[0];
  if (D.21297 != 0) goto <D.21298>; else goto <D.21294>;
  <D.21298>:
  D.21299 = BIT_FIELD_REF <*info, 64, 512>;
  D.21300 = D.21299 & 21474836480;
  if (D.21300 == 21474836480) goto <D.21301>; else goto <D.21294>;
  <D.21301>:
  D.21302 = assembly_binding_maps_name (info, aname);
  if (D.21302 != 0) goto <D.21303>; else goto <D.21294>;
  <D.21303>:
  info->is_valid = 1;
  goto <D.21295>;
  <D.21294>:
  info->is_valid = 0;
  <D.21295>:
  <D.21293>:
  D.21283 = info;
  return D.21283;
}


info_major_minor_in_range (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname)
{
  short unsigned int D.21305;
  int D.21306;
  short unsigned int D.21307;
  int D.21308;
  long unsigned int D.21309;
  long unsigned int D.21310;
  gboolean D.21313;
  short unsigned int D.21314;
  int D.21315;
  short unsigned int D.21316;
  int D.21317;
  int D.21318;
  long unsigned int D.21321;
  short unsigned int D.21324;
  int D.21325;
  short unsigned int D.21326;
  int D.21327;
  int D.21328;
  int aname_version_number;

  D.21305 = aname->major;
  D.21306 = (int) D.21305;
  D.21307 = aname->minor;
  D.21308 = (int) D.21307;
  aname_version_number = get_version_number (D.21306, D.21308);
  D.21309 = BIT_FIELD_REF <*info, 64, 512>;
  D.21310 = D.21309 & 4294967296;
  if (D.21310 == 0) goto <D.21311>; else goto <D.21312>;
  <D.21311>:
  D.21313 = 0;
  return D.21313;
  <D.21312>:
  D.21314 = info->old_version_bottom.major;
  D.21315 = (int) D.21314;
  D.21316 = info->old_version_bottom.minor;
  D.21317 = (int) D.21316;
  D.21318 = get_version_number (D.21315, D.21317);
  if (D.21318 > aname_version_number) goto <D.21319>; else goto <D.21320>;
  <D.21319>:
  D.21313 = 0;
  return D.21313;
  <D.21320>:
  D.21309 = BIT_FIELD_REF <*info, 64, 512>;
  D.21321 = D.21309 & 8589934592;
  if (D.21321 != 0) goto <D.21322>; else goto <D.21323>;
  <D.21322>:
  D.21324 = info->old_version_top.major;
  D.21325 = (int) D.21324;
  D.21326 = info->old_version_top.minor;
  D.21327 = (int) D.21326;
  D.21328 = get_version_number (D.21325, D.21327);
  if (D.21328 < aname_version_number) goto <D.21329>; else goto <D.21330>;
  <D.21329>:
  D.21313 = 0;
  return D.21313;
  <D.21330>:
  <D.21323>:
  D.21305 = aname->major;
  D.21306 = (int) D.21305;
  info->major = D.21306;
  D.21307 = aname->minor;
  D.21308 = (int) D.21307;
  info->minor = D.21308;
  D.21313 = 1;
  return D.21313;
}


get_version_number (int major, int minor)
{
  int D.21332;
  int D.21333;

  D.21333 = major * 256;
  D.21332 = D.21333 + minor;
  return D.21332;
}


assembly_binding_maps_name (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname)
{
  char * D.21338;
  gboolean D.21339;
  int D.17884;
  const char * D.21340;
  int D.21345;
  short unsigned int D.21346;
  int D.21347;
  int D.21349;
  short unsigned int D.21350;
  int D.21351;
  int iftmp.88;
  char * D.21355;
  char D.21357;
  _Bool D.21359;
  int iftmp.89;
  const char * D.21363;
  char D.21365;
  _Bool D.21367;
  _Bool D.21368;
  int D.17893;
  guchar[17] * D.21377;
  mono_byte[17] * D.21378;
  int D.21379;

  if (info == 0B) goto <D.21335>; else goto <D.21337>;
  <D.21337>:
  D.21338 = info->name;
  if (D.21338 == 0B) goto <D.21335>; else goto <D.21336>;
  <D.21335>:
  D.21339 = 0;
  return D.21339;
  <D.21336>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.21338 = info->name;
    D.21340 = aname->name;
    D.17884 = __builtin_strcmp (D.21338, D.21340);
  }
  if (D.17884 != 0) goto <D.21341>; else goto <D.21342>;
  <D.21341>:
  D.21339 = 0;
  return D.21339;
  <D.21342>:
  D.21345 = info->major;
  D.21346 = aname->major;
  D.21347 = (int) D.21346;
  if (D.21345 != D.21347) goto <D.21343>; else goto <D.21348>;
  <D.21348>:
  D.21349 = info->minor;
  D.21350 = aname->minor;
  D.21351 = (int) D.21350;
  if (D.21349 != D.21351) goto <D.21343>; else goto <D.21344>;
  <D.21343>:
  D.21339 = 0;
  return D.21339;
  <D.21344>:
  D.21355 = info->culture;
  if (D.21355 != 0B) goto <D.21356>; else goto <D.21353>;
  <D.21356>:
  D.21355 = info->culture;
  D.21357 = *D.21355;
  if (D.21357 != 0) goto <D.21358>; else goto <D.21353>;
  <D.21358>:
  iftmp.88 = 1;
  goto <D.21354>;
  <D.21353>:
  iftmp.88 = 0;
  <D.21354>:
  D.21359 = (_Bool) iftmp.88;
  D.21363 = aname->culture;
  if (D.21363 != 0B) goto <D.21364>; else goto <D.21361>;
  <D.21364>:
  D.21363 = aname->culture;
  D.21365 = *D.21363;
  if (D.21365 != 0) goto <D.21366>; else goto <D.21361>;
  <D.21366>:
  iftmp.89 = 1;
  goto <D.21362>;
  <D.21361>:
  iftmp.89 = 0;
  <D.21362>:
  D.21367 = (_Bool) iftmp.89;
  D.21368 = D.21359 ^ D.21367;
  if (D.21368 != 0) goto <D.21369>; else goto <D.21370>;
  <D.21369>:
  D.21339 = 0;
  return D.21339;
  <D.21370>:
  D.21355 = info->culture;
  if (D.21355 != 0B) goto <D.21371>; else goto <D.21372>;
  <D.21371>:
  D.21363 = aname->culture;
  if (D.21363 != 0B) goto <D.21373>; else goto <D.21374>;
  <D.21373>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.21355 = info->culture;
    D.21363 = aname->culture;
    D.17893 = __builtin_strcmp (D.21355, D.21363);
  }
  if (D.17893 != 0) goto <D.21375>; else goto <D.21376>;
  <D.21375>:
  D.21339 = 0;
  return D.21339;
  <D.21376>:
  <D.21374>:
  <D.21372>:
  D.21377 = &info->public_key_token;
  D.21378 = &aname->public_key_token;
  D.21379 = mono_public_tokens_are_equal (D.21377, D.21378);
  if (D.21379 == 0) goto <D.21380>; else goto <D.21381>;
  <D.21380>:
  D.21339 = 0;
  return D.21339;
  <D.21381>:
  D.21339 = 1;
  return D.21339;
}


mono_assembly_load_publisher_policy (struct MonoAssemblyName * aname)
{
  const char * D.21383;
  char * D.21384;
  long unsigned int D.21387;
  unsigned int D.21388;
  unsigned int D.21389;
  long unsigned int D.21390;
  long unsigned int D.21391;
  const char * D.21393;
  short unsigned int D.21397;
  int D.21398;
  short unsigned int D.21399;
  int D.21400;
  mono_byte[17] * D.21401;
  char * * extra_gac_paths.90;
  gchar * D.21405;
  struct MonoImage * D.21409;
  const char * D.21410;
  struct MonoImage * image;
  gchar * filename;
  gchar * pname;
  gchar * name;
  gchar * culture;
  gchar * version;
  gchar * fullpath;
  gchar * subpath;
  gchar * * paths;
  gint32 len;

  D.21383 = aname->name;
  D.21384 = strstr (D.21383, ".dll");
  if (D.21384 != 0B) goto <D.21385>; else goto <D.21386>;
  <D.21385>:
  D.21383 = aname->name;
  D.21387 = strlen (D.21383);
  D.21388 = (unsigned int) D.21387;
  D.21389 = D.21388 + 4294967292;
  len = (gint32) D.21389;
  D.21390 = (long unsigned int) len;
  name = monoeg_malloc (D.21390);
  D.21383 = aname->name;
  D.21391 = (long unsigned int) len;
  strncpy (name, D.21383, D.21391);
  goto <D.21392>;
  <D.21386>:
  D.21383 = aname->name;
  name = monoeg_strdup (D.21383);
  <D.21392>:
  D.21393 = aname->culture;
  if (D.21393 != 0B) goto <D.21394>; else goto <D.21395>;
  <D.21394>:
  D.21393 = aname->culture;
  culture = monoeg_g_utf8_strdown (D.21393, -1);
  goto <D.21396>;
  <D.21395>:
  culture = monoeg_strdup ("");
  <D.21396>:
  D.21397 = aname->major;
  D.21398 = (int) D.21397;
  D.21399 = aname->minor;
  D.21400 = (int) D.21399;
  pname = monoeg_g_strdup_printf ("policy.%d.%d.%s", D.21398, D.21400, name);
  D.21401 = &aname->public_key_token;
  version = monoeg_g_strdup_printf ("0.0.0.0_%s_%s", culture, D.21401);
  monoeg_g_free (name);
  monoeg_g_free (culture);
  filename = monoeg_g_strconcat (pname, ".dll", 0B);
  subpath = monoeg_g_build_path ("/", pname, version, filename, 0B);
  monoeg_g_free (pname);
  monoeg_g_free (version);
  monoeg_g_free (filename);
  image = 0B;
  extra_gac_paths.90 = extra_gac_paths;
  if (extra_gac_paths.90 != 0B) goto <D.21403>; else goto <D.21404>;
  <D.21403>:
  paths = extra_gac_paths;
  goto <D.18706>;
  <D.18705>:
  D.21405 = *paths;
  fullpath = monoeg_g_build_path ("/", D.21405, "lib", "mono", "gac", subpath, 0B);
  image = mono_image_open (fullpath, 0B);
  monoeg_g_free (fullpath);
  paths = paths + 8;
  <D.18706>:
  if (image == 0B) goto <D.21406>; else goto <D.18707>;
  <D.21406>:
  D.21405 = *paths;
  if (D.21405 != 0B) goto <D.18705>; else goto <D.18707>;
  <D.18707>:
  <D.21404>:
  if (image != 0B) goto <D.21407>; else goto <D.21408>;
  <D.21407>:
  monoeg_g_free (subpath);
  D.21409 = image;
  return D.21409;
  <D.21408>:
  D.21410 = mono_assembly_getrootdir ();
  fullpath = monoeg_g_build_path ("/", D.21410, "mono", "gac", subpath, 0B);
  image = mono_image_open (fullpath, 0B);
  monoeg_g_free (subpath);
  monoeg_g_free (fullpath);
  D.21409 = image;
  return D.21409;
}


strncpy (char * restrict __dest, const char * restrict __src, size_t __len)
{
  char * D.21412;
  long unsigned int D.21413;

  D.21413 = __builtin_object_size (__dest, 1);
  D.21412 = __builtin___strncpy_chk (__dest, __src, __len, D.21413);
  return D.21412;
}


get_publisher_policy_info (struct MonoImage * image, struct MonoAssemblyName * aname, struct MonoAssemblyBindingInfo * binding_info)
{
  <unnamed-unsigned:24> D.21415;
  int D.21416;
  unsigned int D.21419;
  unsigned int D.21420;
  unsigned int D.21423;
  _Bool D.21424;
  long int D.21425;
  long int D.21426;
  char * D.21429;
  char * D.21430;
  gchar * D.21433;
  char * D.21436;
  unsigned char D.21438;
  long unsigned int D.21440;
  long unsigned int D.21441;
  int D.21443;
  struct MonoTableInfo * t;
  guint32 cols[4];
  const gchar * filename;
  gchar * subpath;
  gchar * fullpath;

  try
    {
      t = &image->tables[40];
      D.21415 = t->rows;
      D.21416 = (int) D.21415;
      if (D.21416 <= 0) goto <D.21417>; else goto <D.21418>;
      <D.21417>:
      binding_info->is_valid = 0;
      return;
      <D.21418>:
      mono_metadata_decode_row (t, 0, &cols, 4);
      D.21419 = cols[3];
      D.21420 = D.21419 & 3;
      if (D.21420 != 0) goto <D.21421>; else goto <D.21422>;
      <D.21421>:
      binding_info->is_valid = 0;
      return;
      <D.21422>:
      D.21423 = cols[2];
      filename = mono_metadata_string_heap (image, D.21423);
      D.21424 = filename == 0B;
      D.21425 = (long int) D.21424;
      D.21426 = __builtin_expect (D.21425, 0);
      if (D.21426 != 0) goto <D.21427>; else goto <D.21428>;
      <D.21427>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 370, "filename != NULL");
      <D.21428>:
      D.21429 = image->name;
      subpath = monoeg_g_path_get_dirname (D.21429);
      fullpath = monoeg_g_build_path ("/", subpath, filename, 0B);
      mono_config_parse_publisher_policy (fullpath, binding_info);
      monoeg_g_free (subpath);
      monoeg_g_free (fullpath);
      D.21430 = binding_info->culture;
      if (D.21430 == 0B) goto <D.21431>; else goto <D.21432>;
      <D.21431>:
      D.21433 = monoeg_strdup ("");
      binding_info->culture = D.21433;
      <D.21432>:
      D.21436 = binding_info->name;
      if (D.21436 == 0B) goto <D.21434>; else goto <D.21437>;
      <D.21437>:
      D.21438 = binding_info->public_key_token[0];
      if (D.21438 == 0) goto <D.21434>; else goto <D.21439>;
      <D.21439>:
      D.21440 = BIT_FIELD_REF <*binding_info, 64, 512>;
      D.21441 = D.21440 & 21474836480;
      if (D.21441 != 21474836480) goto <D.21434>; else goto <D.21442>;
      <D.21442>:
      D.21443 = assembly_binding_maps_name (binding_info, aname);
      if (D.21443 == 0) goto <D.21434>; else goto <D.21435>;
      <D.21434>:
      mono_assembly_binding_info_free (binding_info);
      binding_info->is_valid = 0;
      return;
      <D.21435>:
      binding_info->is_valid = 1;
    }
  finally
    {
      cols = {CLOBBER};
    }
}


mono_assembly_binding_lock ()
{
  pthread_mutex_lock (&assembly_binding_mutex);
}


search_binding_loaded (struct MonoAssemblyName * aname)
{
  int D.21447;
  struct MonoAssemblyBindingInfo * D.21450;
  struct GSList * tmp;

  tmp = loaded_assembly_bindings;
  goto <D.18719>;
  <D.18718>:
  {
    struct MonoAssemblyBindingInfo * info;

    info = tmp->data;
    D.21447 = assembly_binding_maps_name (info, aname);
    if (D.21447 != 0) goto <D.21448>; else goto <D.21449>;
    <D.21448>:
    D.21450 = info;
    return D.21450;
    <D.21449>:
  }
  tmp = tmp->next;
  <D.18719>:
  if (tmp != 0B) goto <D.18718>; else goto <D.18720>;
  <D.18720>:
  D.21450 = 0B;
  return D.21450;
}


mono_assembly_binding_info_free (struct MonoAssemblyBindingInfo * info)
{
  char * D.21454;
  char * D.21455;

  if (info == 0B) goto <D.21452>; else goto <D.21453>;
  <D.21452>:
  return;
  <D.21453>:
  D.21454 = info->name;
  monoeg_g_free (D.21454);
  D.21455 = info->culture;
  monoeg_g_free (D.21455);
}


mono_assembly_binding_unlock ()
{
  pthread_mutex_unlock (&assembly_binding_mutex);
}


check_policy_versions (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * name)
{
  long unsigned int D.21457;
  long unsigned int D.21458;
  gboolean D.21461;
  long unsigned int D.21462;
  struct AssemblyVersionSet * D.21465;
  int D.21466;
  struct AssemblyVersionSet * D.21469;
  int D.21470;
  int D.21473;

  D.21457 = BIT_FIELD_REF <*info, 64, 512>;
  D.21458 = D.21457 & 34359738368;
  if (D.21458 == 0) goto <D.21459>; else goto <D.21460>;
  <D.21459>:
  D.21461 = 0;
  return D.21461;
  <D.21460>:
  D.21457 = BIT_FIELD_REF <*info, 64, 512>;
  D.21462 = D.21457 & 8589934592;
  if (D.21462 == 0) goto <D.21463>; else goto <D.21464>;
  <D.21463>:
  D.21465 = &info->old_version_bottom;
  D.21466 = compare_versions (D.21465, name);
  if (D.21466 == 0) goto <D.21467>; else goto <D.21468>;
  <D.21467>:
  D.21461 = 1;
  return D.21461;
  <D.21468>:
  D.21461 = 0;
  return D.21461;
  <D.21464>:
  D.21469 = &info->old_version_top;
  D.21470 = compare_versions (D.21469, name);
  if (D.21470 < 0) goto <D.21471>; else goto <D.21472>;
  <D.21471>:
  D.21461 = 0;
  return D.21461;
  <D.21472>:
  D.21465 = &info->old_version_bottom;
  D.21473 = compare_versions (D.21465, name);
  if (D.21473 > 0) goto <D.21474>; else goto <D.21475>;
  <D.21474>:
  D.21461 = 0;
  return D.21461;
  <D.21475>:
  D.21461 = 1;
  return D.21461;
}


compare_versions (struct AssemblyVersionSet * v, struct MonoAssemblyName * aname)
{
  short unsigned int D.21477;
  short unsigned int D.21478;
  int D.21481;
  short unsigned int D.21484;
  short unsigned int D.21485;
  short unsigned int D.21490;
  short unsigned int D.21491;
  short unsigned int D.21496;
  short unsigned int D.21497;

  D.21477 = v->major;
  D.21478 = aname->major;
  if (D.21477 > D.21478) goto <D.21479>; else goto <D.21480>;
  <D.21479>:
  D.21481 = 1;
  return D.21481;
  <D.21480>:
  D.21477 = v->major;
  D.21478 = aname->major;
  if (D.21477 < D.21478) goto <D.21482>; else goto <D.21483>;
  <D.21482>:
  D.21481 = -1;
  return D.21481;
  <D.21483>:
  D.21484 = v->minor;
  D.21485 = aname->minor;
  if (D.21484 > D.21485) goto <D.21486>; else goto <D.21487>;
  <D.21486>:
  D.21481 = 1;
  return D.21481;
  <D.21487>:
  D.21484 = v->minor;
  D.21485 = aname->minor;
  if (D.21484 < D.21485) goto <D.21488>; else goto <D.21489>;
  <D.21488>:
  D.21481 = -1;
  return D.21481;
  <D.21489>:
  D.21490 = v->build;
  D.21491 = aname->build;
  if (D.21490 > D.21491) goto <D.21492>; else goto <D.21493>;
  <D.21492>:
  D.21481 = 1;
  return D.21481;
  <D.21493>:
  D.21490 = v->build;
  D.21491 = aname->build;
  if (D.21490 < D.21491) goto <D.21494>; else goto <D.21495>;
  <D.21494>:
  D.21481 = -1;
  return D.21481;
  <D.21495>:
  D.21496 = v->revision;
  D.21497 = aname->revision;
  if (D.21496 > D.21497) goto <D.21498>; else goto <D.21499>;
  <D.21498>:
  D.21481 = 1;
  return D.21481;
  <D.21499>:
  D.21496 = v->revision;
  D.21497 = aname->revision;
  if (D.21496 < D.21497) goto <D.21500>; else goto <D.21501>;
  <D.21500>:
  D.21481 = -1;
  return D.21481;
  <D.21501>:
  D.21481 = 0;
  return D.21481;
}


mono_assembly_bind_version (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_name)
{
  short unsigned int D.21503;
  short unsigned int D.21504;
  short unsigned int D.21505;
  short unsigned int D.21506;
  struct MonoAssemblyName * D.21507;

  memcpy (dest_name, aname, 80);
  D.21503 = info->new_version.major;
  dest_name->major = D.21503;
  D.21504 = info->new_version.minor;
  dest_name->minor = D.21504;
  D.21505 = info->new_version.build;
  dest_name->build = D.21505;
  D.21506 = info->new_version.revision;
  dest_name->revision = D.21506;
  D.21507 = dest_name;
  return D.21507;
}


invoke_assembly_refonly_preload_hook (struct MonoAssemblyName * aname, gchar * * assemblies_path)
{
  struct MonoAssembly * (*<Tf6b>) (struct MonoAssemblyName *, char * *, void *) D.21509;
  void * D.21510;
  struct MonoAssembly * D.21513;
  struct AssemblyPreLoadHook * hook;
  struct MonoAssembly * assembly;

  hook = assembly_refonly_preload_hook;
  goto <D.18287>;
  <D.18286>:
  D.21509 = hook->func;
  D.21510 = hook->user_data;
  assembly = D.21509 (aname, assemblies_path, D.21510);
  if (assembly != 0B) goto <D.21511>; else goto <D.21512>;
  <D.21511>:
  D.21513 = assembly;
  return D.21513;
  <D.21512>:
  hook = hook->next;
  <D.18287>:
  if (hook != 0B) goto <D.18286>; else goto <D.18288>;
  <D.18288>:
  D.21513 = 0B;
  return D.21513;
}


mono_assembly_load_from_gac (struct MonoAssemblyName * aname, gchar * filename, MonoImageOpenStatus * status, MonoBoolean refonly)
{
  unsigned char D.21515;
  struct MonoAssembly * D.21518;
  const char * D.21519;
  char * D.21520;
  long unsigned int D.21523;
  unsigned int D.21524;
  unsigned int D.21525;
  long unsigned int D.21526;
  long unsigned int D.21527;
  const char * D.21529;
  mono_byte[17] * D.21533;
  short unsigned int D.21534;
  int D.21535;
  short unsigned int D.21536;
  int D.21537;
  short unsigned int D.21538;
  int D.21539;
  short unsigned int D.21540;
  int D.21541;
  char * * extra_gac_paths.91;
  gchar * D.21545;
  int D.21546;
  const char * D.21550;
  struct MonoAssembly * result;
  gchar * name;
  gchar * version;
  gchar * culture;
  gchar * fullpath;
  gchar * subpath;
  gint32 len;
  gchar * * paths;
  char * pubtok;

  result = 0B;
  D.21515 = aname->public_key_token[0];
  if (D.21515 == 0) goto <D.21516>; else goto <D.21517>;
  <D.21516>:
  D.21518 = 0B;
  return D.21518;
  <D.21517>:
  D.21519 = aname->name;
  D.21520 = strstr (D.21519, ".dll");
  if (D.21520 != 0B) goto <D.21521>; else goto <D.21522>;
  <D.21521>:
  D.21523 = strlen (filename);
  D.21524 = (unsigned int) D.21523;
  D.21525 = D.21524 + 4294967292;
  len = (gint32) D.21525;
  D.21526 = (long unsigned int) len;
  name = monoeg_malloc (D.21526);
  D.21519 = aname->name;
  D.21527 = (long unsigned int) len;
  strncpy (name, D.21519, D.21527);
  goto <D.21528>;
  <D.21522>:
  D.21519 = aname->name;
  name = monoeg_strdup (D.21519);
  <D.21528>:
  D.21529 = aname->culture;
  if (D.21529 != 0B) goto <D.21530>; else goto <D.21531>;
  <D.21530>:
  D.21529 = aname->culture;
  culture = monoeg_g_utf8_strdown (D.21529, -1);
  goto <D.21532>;
  <D.21531>:
  culture = monoeg_strdup ("");
  <D.21532>:
  D.21533 = &aname->public_key_token;
  pubtok = monoeg_g_ascii_strdown (D.21533, 17);
  D.21534 = aname->major;
  D.21535 = (int) D.21534;
  D.21536 = aname->minor;
  D.21537 = (int) D.21536;
  D.21538 = aname->build;
  D.21539 = (int) D.21538;
  D.21540 = aname->revision;
  D.21541 = (int) D.21540;
  version = monoeg_g_strdup_printf ("%d.%d.%d.%d_%s_%s", D.21535, D.21537, D.21539, D.21541, culture, pubtok);
  monoeg_g_free (pubtok);
  subpath = monoeg_g_build_path ("/", name, version, filename, 0B);
  monoeg_g_free (name);
  monoeg_g_free (version);
  monoeg_g_free (culture);
  extra_gac_paths.91 = extra_gac_paths;
  if (extra_gac_paths.91 != 0B) goto <D.21543>; else goto <D.21544>;
  <D.21543>:
  paths = extra_gac_paths;
  goto <D.18806>;
  <D.18805>:
  D.21545 = *paths;
  fullpath = monoeg_g_build_path ("/", D.21545, "lib", "mono", "gac", subpath, 0B);
  D.21546 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.21546);
  monoeg_g_free (fullpath);
  paths = paths + 8;
  <D.18806>:
  if (result == 0B) goto <D.21547>; else goto <D.18807>;
  <D.21547>:
  D.21545 = *paths;
  if (D.21545 != 0B) goto <D.18805>; else goto <D.18807>;
  <D.18807>:
  <D.21544>:
  if (result != 0B) goto <D.21548>; else goto <D.21549>;
  <D.21548>:
  result->in_gac = 1;
  monoeg_g_free (subpath);
  D.21518 = result;
  return D.21518;
  <D.21549>:
  D.21550 = mono_assembly_getrootdir ();
  fullpath = monoeg_g_build_path ("/", D.21550, "mono", "gac", subpath, 0B);
  D.21546 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.21546);
  monoeg_g_free (fullpath);
  if (result != 0B) goto <D.21551>; else goto <D.21552>;
  <D.21551>:
  result->in_gac = 1;
  <D.21552>:
  monoeg_g_free (subpath);
  D.21518 = result;
  return D.21518;
}


mono_assembly_load_full (struct MonoAssemblyName * aname, const char * basedir, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoAssembly * D.21556;
  struct MonoAssembly * result;

  result = mono_assembly_load_full_nosearch (aname, basedir, status, refonly);
  if (result == 0B) goto <D.21554>; else goto <D.21555>;
  <D.21554>:
  result = mono_assembly_invoke_search_hook_internal (aname, refonly, 1);
  <D.21555>:
  D.21556 = result;
  return D.21556;
}


mono_assembly_load (struct MonoAssemblyName * aname, const char * basedir, MonoImageOpenStatus * status)
{
  struct MonoAssembly * D.21558;

  D.21558 = mono_assembly_load_full (aname, basedir, status, 0);
  return D.21558;
}


mono_assembly_loaded_full (struct MonoAssemblyName * aname, gboolean refonly)
{
  struct MonoAssembly * D.21560;
  struct MonoAssembly * res;
  struct MonoAssemblyName maped_aname;

  try
    {
      aname = mono_assembly_remap_version (aname, &maped_aname);
      res = mono_assembly_invoke_search_hook_internal (aname, refonly, 0);
      D.21560 = res;
      return D.21560;
    }
  finally
    {
      maped_aname = {CLOBBER};
    }
}


mono_assembly_loaded (struct MonoAssemblyName * aname)
{
  struct MonoAssembly * D.21563;

  D.21563 = mono_assembly_loaded_full (aname, 0);
  return D.21563;
}


mono_assembly_release_gc_roots (struct MonoAssembly * assembly)
{
  struct MonoAssembly * D.21565;
  unsigned char D.21568;
  struct MonoImage * * D.21571;
  long unsigned int D.21572;
  long unsigned int D.21573;
  struct MonoImage * * D.21574;
  struct MonoImage * D.21575;
  unsigned int i.92;
  unsigned int D.21577;

  D.21565 = assembly + 18446744073709551615;
  if (D.21565 > -3B) goto <D.21566>; else goto <D.21567>;
  <D.21566>:
  return;
  <D.21567>:
  D.21568 = assembly->dynamic;
  if (D.21568 != 0) goto <D.21569>; else goto <D.21570>;
  <D.21569>:
  {
    int i;
    struct MonoDynamicImage * dynimg;

    dynimg = assembly->image;
    i = 0;
    goto <D.18903>;
    <D.18902>:
    D.21571 = dynimg->image.modules;
    D.21572 = (long unsigned int) i;
    D.21573 = D.21572 * 8;
    D.21574 = D.21571 + D.21573;
    D.21575 = *D.21574;
    mono_dynamic_image_release_gc_roots (D.21575);
    i = i + 1;
    <D.18903>:
    i.92 = (unsigned int) i;
    D.21577 = dynimg->image.module_count;
    if (i.92 < D.21577) goto <D.18902>; else goto <D.18904>;
    <D.18904>:
    mono_dynamic_image_release_gc_roots (dynimg);
  }
  <D.21570>:
}


mono_assembly_close_except_image_pools (struct MonoAssembly * assembly)
{
  gboolean D.21581;
  int * D.21584;
  int D.21585;
  const char * D.21588;
  struct MonoImage * D.21589;
  _Bool D.21592;
  long int D.21593;
  long int D.21594;
  struct GList * loaded_assemblies.93;
  struct GList * loaded_assemblies.94;
  _Bool D.21601;
  long int D.21602;
  long int D.21603;
  int D.21606;
  struct GSList * D.21609;
  char * D.21610;
  struct GSList * tmp;

  if (assembly == 0B) goto <D.21579>; else goto <D.21580>;
  <D.21579>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 3029, "assembly != NULL");
  D.21581 = 0;
  return D.21581;
  <D.21580>:
  if (assembly == -1B) goto <D.21582>; else goto <D.21583>;
  <D.21582>:
  D.21581 = 0;
  return D.21581;
  <D.21583>:
  D.21584 = &assembly->ref_count;
  D.21585 = InterlockedDecrement (D.21584);
  if (D.21585 > 0) goto <D.21586>; else goto <D.21587>;
  <D.21586>:
  D.21581 = 0;
  return D.21581;
  <D.21587>:
  mono_profiler_assembly_event (assembly, 2);
  D.21588 = assembly->aname.name;
  mono_trace (64, 1, "Unloading assembly %s [%p].", D.21588, assembly);
  D.21589 = assembly->image;
  mono_debug_close_image (D.21589);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.21590>; else goto <D.21591>;
    <D.21590>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21591>:
    D.21592 = ret != 0;
    D.21593 = (long int) D.21592;
    D.21594 = __builtin_expect (D.21593, 0);
    if (D.21594 != 0) goto <D.21595>; else goto <D.21596>;
    <D.21595>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3044, "ret == 0");
    <D.21596>:
  }
  loaded_assemblies.93 = loaded_assemblies;
  loaded_assemblies.94 = monoeg_g_list_remove (loaded_assemblies.93, assembly);
  loaded_assemblies = loaded_assemblies.94;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.21599>; else goto <D.21600>;
    <D.21599>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21600>:
    D.21601 = ret != 0;
    D.21602 = (long int) D.21601;
    D.21603 = __builtin_expect (D.21602, 0);
    if (D.21603 != 0) goto <D.21604>; else goto <D.21605>;
    <D.21604>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3046, "ret == 0");
    <D.21605>:
  }
  D.21589 = assembly->image;
  D.21589->assembly = 0B;
  D.21589 = assembly->image;
  D.21606 = mono_image_close_except_pools (D.21589);
  if (D.21606 == 0) goto <D.21607>; else goto <D.21608>;
  <D.21607>:
  assembly->image = 0B;
  <D.21608>:
  tmp = assembly->friend_assembly_names;
  goto <D.18913>;
  <D.18912>:
  {
    struct MonoAssemblyName * fname;

    fname = tmp->data;
    mono_assembly_name_free (fname);
    monoeg_g_free (fname);
  }
  tmp = tmp->next;
  <D.18913>:
  if (tmp != 0B) goto <D.18912>; else goto <D.18914>;
  <D.18914>:
  D.21609 = assembly->friend_assembly_names;
  monoeg_g_slist_free (D.21609);
  D.21610 = assembly->basedir;
  monoeg_g_free (D.21610);
  mono_profiler_assembly_event (assembly, 3);
  D.21581 = 1;
  return D.21581;
}


InterlockedDecrement (volatile gint32 * val)
{
  gint32 D.21612;
  unsigned int D.21613;

  D.21613 = __sync_sub_and_fetch_4 (val, 1);
  D.21612 = (gint32) D.21613;
  return D.21612;
}


mono_assembly_close_finish (struct MonoAssembly * assembly)
{
  struct MonoAssembly * D.21615;
  _Bool D.21616;
  long int D.21617;
  long int D.21618;
  struct MonoImage * D.21621;
  unsigned char D.21624;
  const char * D.21627;

  D.21615 = assembly + 18446744073709551615;
  D.21616 = D.21615 > -3B;
  D.21617 = (long int) D.21616;
  D.21618 = __builtin_expect (D.21617, 0);
  if (D.21618 != 0) goto <D.21619>; else goto <D.21620>;
  <D.21619>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3069, "assembly && assembly != REFERENCE_MISSING");
  <D.21620>:
  D.21621 = assembly->image;
  if (D.21621 != 0B) goto <D.21622>; else goto <D.21623>;
  <D.21622>:
  D.21621 = assembly->image;
  mono_image_close_finish (D.21621);
  <D.21623>:
  D.21624 = assembly->dynamic;
  if (D.21624 != 0) goto <D.21625>; else goto <D.21626>;
  <D.21625>:
  D.21627 = assembly->aname.culture;
  monoeg_g_free (D.21627);
  goto <D.21628>;
  <D.21626>:
  monoeg_g_free (assembly);
  <D.21628>:
}


mono_assembly_close (struct MonoAssembly * assembly)
{
  int D.21629;

  D.21629 = mono_assembly_close_except_image_pools (assembly);
  if (D.21629 != 0) goto <D.21630>; else goto <D.21631>;
  <D.21630>:
  mono_assembly_close_finish (assembly);
  <D.21631>:
}


mono_assembly_load_module (struct MonoAssembly * assembly, guint32 idx)
{
  struct MonoImage * D.21632;
  struct MonoImage * D.21633;
  int idx.95;

  D.21633 = assembly->image;
  idx.95 = (int) idx;
  D.21632 = mono_image_load_file_for_image (D.21633, idx.95);
  return D.21632;
}


mono_assembly_foreach (void (*GFunc) (void *, void *) func, void * user_data)
{
  _Bool D.21638;
  long int D.21639;
  long int D.21640;
  struct GList * loaded_assemblies.96;
  _Bool D.21646;
  long int D.21647;
  long int D.21648;
  struct GList * copy;

  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.21636>; else goto <D.21637>;
    <D.21636>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21637>:
    D.21638 = ret != 0;
    D.21639 = (long int) D.21638;
    D.21640 = __builtin_expect (D.21639, 0);
    if (D.21640 != 0) goto <D.21641>; else goto <D.21642>;
    <D.21641>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3110, "ret == 0");
    <D.21642>:
  }
  loaded_assemblies.96 = loaded_assemblies;
  copy = monoeg_g_list_copy (loaded_assemblies.96);
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.21644>; else goto <D.21645>;
    <D.21644>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21645>:
    D.21646 = ret != 0;
    D.21647 = (long int) D.21646;
    D.21648 = __builtin_expect (D.21647, 0);
    if (D.21648 != 0) goto <D.21649>; else goto <D.21650>;
    <D.21649>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3112, "ret == 0");
    <D.21650>:
  }
  loaded_assemblies.96 = loaded_assemblies;
  monoeg_g_list_foreach (loaded_assemblies.96, func, user_data);
  monoeg_g_list_free (copy);
}


mono_assemblies_cleanup ()
{
  struct GSList * loaded_assembly_bindings.97;
  struct GSList * l;

  DeleteCriticalSection (&assemblies_mutex);
  pthread_mutex_destroy (&assembly_binding_mutex);
  l = loaded_assembly_bindings;
  goto <D.18938>;
  <D.18937>:
  {
    struct MonoAssemblyBindingInfo * info;

    info = l->data;
    mono_assembly_binding_info_free (info);
    monoeg_g_free (info);
  }
  l = l->next;
  <D.18938>:
  if (l != 0B) goto <D.18937>; else goto <D.18939>;
  <D.18939>:
  loaded_assembly_bindings.97 = loaded_assembly_bindings;
  monoeg_g_slist_free (loaded_assembly_bindings.97);
  free_assembly_load_hooks ();
  free_assembly_search_hooks ();
  free_assembly_preload_hooks ();
}


free_assembly_load_hooks ()
{
  struct AssemblyLoadHook * hook;
  struct AssemblyLoadHook * next;

  hook = assembly_load_hook;
  goto <D.18210>;
  <D.18209>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.18210>:
  if (hook != 0B) goto <D.18209>; else goto <D.18211>;
  <D.18211>:
}


free_assembly_search_hooks ()
{
  struct AssemblySearchHook * hook;
  struct AssemblySearchHook * next;

  hook = assembly_search_hook;
  goto <D.18250>;
  <D.18249>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.18250>:
  if (hook != 0B) goto <D.18249>; else goto <D.18251>;
  <D.18251>:
}


free_assembly_preload_hooks ()
{
  struct AssemblyPreLoadHook * hook;
  struct AssemblyPreLoadHook * next;

  hook = assembly_preload_hook;
  goto <D.18305>;
  <D.18304>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.18305>:
  if (hook != 0B) goto <D.18304>; else goto <D.18306>;
  <D.18306>:
  hook = assembly_refonly_preload_hook;
  goto <D.18308>;
  <D.18307>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.18308>:
  if (hook != 0B) goto <D.18307>; else goto <D.18309>;
  <D.18309>:
}


mono_assembly_cleanup_domain_bindings (guint32 domain_id)
{
  int D.21652;
  unsigned int D.21653;
  struct GSList * D.21656;
  struct GSList * D.21658;
  struct GSList * * iter;

  mono_assembly_binding_lock ();
  iter = &loaded_assembly_bindings;
  goto <D.18947>;
  <D.18946>:
  {
    struct GSList * l;
    struct MonoAssemblyBindingInfo * info;

    l = *iter;
    info = l->data;
    D.21652 = info->domain_id;
    D.21653 = (unsigned int) D.21652;
    if (D.21653 == domain_id) goto <D.21654>; else goto <D.21655>;
    <D.21654>:
    D.21656 = l->next;
    *iter = D.21656;
    mono_assembly_binding_info_free (info);
    monoeg_g_free (info);
    monoeg_g_slist_free_1 (l);
    goto <D.21657>;
    <D.21655>:
    iter = &l->next;
    <D.21657>:
  }
  <D.18947>:
  D.21658 = *iter;
  if (D.21658 != 0B) goto <D.18946>; else goto <D.18948>;
  <D.18948>:
  mono_assembly_binding_unlock ();
}


mono_assembly_set_main (struct MonoAssembly * assembly)
{
  main_assembly = assembly;
}


mono_assembly_get_main ()
{
  struct MonoAssembly * D.21659;

  D.21659 = main_assembly;
  return D.21659;
}


mono_assembly_get_image (struct MonoAssembly * assembly)
{
  struct MonoImage * D.21661;

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


mono_register_bundled_assemblies (const struct MonoBundledAssembly * * assemblies)
{
  bundles = assemblies;
}


mono_assembly_has_skip_verification (struct MonoAssembly * assembly)
{
  <unnamed-unsigned:2> D.21663;
  int D.21664;
  int D.21665;
  gboolean D.21668;
  int D.21669;
  struct MonoImage * D.21670;
  unsigned int D.21671;
  unsigned int D.21672;
  unsigned int D.21675;
  unsigned int D.21678;
  const char * blob.98;
  const char * blob.99;
  unsigned int D.21681;
  sizetype D.21684;
  const char * D.21685;
  int D.21686;
  <unnamed-unsigned:24> D.21689;
  int D.21690;
  struct MonoTableInfo * t;
  guint32 cols[3];
  const char * blob;
  int i;
  int len;

  try
    {
      D.21663 = assembly->skipverification;
      D.21664 = (int) D.21663;
      D.21665 = D.21664 & 2;
      if (D.21665 != 0) goto <D.21666>; else goto <D.21667>;
      <D.21666>:
      D.21663 = assembly->skipverification;
      D.21669 = (int) D.21663;
      D.21668 = D.21669 & 1;
      return D.21668;
      <D.21667>:
      D.21670 = assembly->image;
      t = &D.21670->tables[14];
      i = 0;
      goto <D.19004>;
      <D.19003>:
      mono_metadata_decode_row (t, i, &cols, 3);
      D.21671 = cols[1];
      D.21672 = D.21671 & 3;
      if (D.21672 != 2) goto <D.21673>; else goto <D.21674>;
      <D.21673>:
      // predicted unlikely by continue predictor.
      goto <D.19002>;
      <D.21674>:
      D.21675 = cols[0];
      if (D.21675 != 8) goto <D.21676>; else goto <D.21677>;
      <D.21676>:
      // predicted unlikely by continue predictor.
      goto <D.19002>;
      <D.21677>:
      D.21670 = assembly->image;
      D.21678 = cols[2];
      blob.98 = mono_metadata_blob_heap (D.21670, D.21678);
      blob = blob.98;
      blob.99 = blob;
      D.21681 = mono_metadata_decode_blob_size (blob.99, &blob);
      len = (int) D.21681;
      if (len == 0) goto <D.21682>; else goto <D.21683>;
      <D.21682>:
      // predicted unlikely by continue predictor.
      goto <D.19002>;
      <D.21683>:
      blob.99 = blob;
      blob.99 = blob;
      D.21684 = (sizetype) len;
      D.21685 = blob.99 + D.21684;
      D.21686 = mono_assembly_try_decode_skip_verification (blob.99, D.21685);
      if (D.21686 != 0) goto <D.21687>; else goto <D.21688>;
      <D.21687>:
      assembly->skipverification = 3;
      D.21668 = 1;
      return D.21668;
      <D.21688>:
      <D.19002>:
      i = i + 1;
      <D.19004>:
      D.21689 = t->rows;
      D.21690 = (int) D.21689;
      if (D.21690 > i) goto <D.19003>; else goto <D.19005>;
      <D.19005>:
      assembly->skipverification = 2;
      D.21668 = 0;
      return D.21668;
    }
  finally
    {
      cols = {CLOBBER};
      blob = {CLOBBER};
    }
}


mono_assembly_try_decode_skip_verification (const char * p, const char * endn)
{
  const char * p.100;
  char D.21694;
  long int endn.101;
  long int p.102;
  long int D.21699;
  char * D.21702;
  _Bool D.21703;
  gboolean D.21704;
  const char * p.103;
  const char * p.104;
  char D.21707;
  unsigned int D.21710;
  unsigned int D.21711;
  int iftmp.105;
  unsigned int len.106;
  int D.21717;
  sizetype D.21719;
  const char * p.107;
  unsigned int D.21721;
  sizetype D.21724;
  unsigned int D.21725;
  int D.21726;
  int abort_decoding.108;
  const char * p.109;
  int i;
  int j;
  int num;
  int len;
  int params_len;

  p.100 = p;
  D.21694 = *p.100;
  if (D.21694 == 60) goto <D.21695>; else goto <D.21696>;
  <D.21695>:
  {
    gsize read;
    gsize written;
    char * res;

    try
      {
        p.100 = p;
        endn.101 = (long int) endn;
        p.100 = p;
        p.102 = (long int) p.100;
        D.21699 = endn.101 - p.102;
        res = monoeg_g_convert (p.100, D.21699, "UTF-8", "UTF-16LE", &read, &written, 0B);
        if (res != 0B) goto <D.21700>; else goto <D.21701>;
        <D.21700>:
        {
          gboolean found;

          D.21702 = strstr (res, "\"SkipVerification\"");
          D.21703 = D.21702 != 0B;
          found = (gboolean) D.21703;
          monoeg_g_free (res);
          D.21704 = found;
          return D.21704;
        }
        <D.21701>:
        D.21704 = 0;
        return D.21704;
      }
    finally
      {
        read = {CLOBBER};
        written = {CLOBBER};
      }
  }
  <D.21696>:
  p.100 = p;
  p.103 = p.100;
  p.104 = p.103 + 1;
  p = p.104;
  D.21707 = *p.103;
  if (D.21707 != 46) goto <D.21708>; else goto <D.21709>;
  <D.21708>:
  D.21704 = 0;
  return D.21704;
  <D.21709>:
  p.100 = p;
  D.21710 = mono_metadata_decode_value (p.100, &p);
  num = (int) D.21710;
  i = 0;
  goto <D.18992>;
  <D.18991>:
  {
    gboolean is_valid;
    gboolean abort_decoding;

    try
      {
        is_valid = 0;
        abort_decoding = 0;
        p.100 = p;
        D.21711 = mono_metadata_decode_value (p.100, &p);
        len = (int) D.21711;
        len.106 = (unsigned int) len;
        if (len.106 > 54) goto <D.21716>; else goto <D.21713>;
        <D.21716>:
        p.100 = p;
        D.21717 = memcmp (p.100, "System.Security.Permissions.SecurityPermissionAttribute", 55);
        if (D.21717 == 0) goto <D.21718>; else goto <D.21713>;
        <D.21718>:
        iftmp.105 = 1;
        goto <D.21714>;
        <D.21713>:
        iftmp.105 = 0;
        <D.21714>:
        is_valid = iftmp.105;
        p.100 = p;
        D.21719 = (sizetype) len;
        p.107 = p.100 + D.21719;
        p = p.107;
        p.100 = p;
        D.21721 = mono_metadata_decode_value (p.100, &p);
        params_len = (int) D.21721;
        if (is_valid != 0) goto <D.21722>; else goto <D.21723>;
        <D.21722>:
        {
          const char * params_end;

          p.100 = p;
          D.21724 = (sizetype) params_len;
          params_end = p.100 + D.21724;
          p.100 = p;
          D.21725 = mono_metadata_decode_value (p.100, &p);
          len = (int) D.21725;
          j = 0;
          goto <D.18990>;
          <D.18989>:
          p.100 = p;
          D.21726 = mono_assembly_try_decode_skip_verification_param (p.100, &p, &abort_decoding);
          if (D.21726 != 0) goto <D.21727>; else goto <D.21728>;
          <D.21727>:
          D.21704 = 1;
          return D.21704;
          <D.21728>:
          abort_decoding.108 = abort_decoding;
          if (abort_decoding.108 != 0) goto <D.18988>; else goto <D.21730>;
          <D.21730>:
          j = j + 1;
          <D.18990>:
          if (j < len) goto <D.18989>; else goto <D.18988>;
          <D.18988>:
          p = params_end;
        }
        goto <D.21731>;
        <D.21723>:
        p.100 = p;
        D.21724 = (sizetype) params_len;
        p.109 = p.100 + D.21724;
        p = p.109;
        <D.21731>:
      }
    finally
      {
        abort_decoding = {CLOBBER};
      }
  }
  i = i + 1;
  <D.18992>:
  if (i < num) goto <D.18991>; else goto <D.18993>;
  <D.18993>:
  D.21704 = 0;
  return D.21704;
}


mono_assembly_try_decode_skip_verification_param (const char * p, const char * * resp, gboolean * abort_decoding)
{
  const char * p.110;
  const char * p.111;
  const char * p.112;
  char D.21740;
  int D.21741;
  gboolean D.21742;
  const char * p.113;
  const char * p.114;
  char D.21745;
  unsigned int D.21748;
  unsigned int len.115;
  int D.21752;
  sizetype D.21755;
  const char * p.116;
  char D.21757;
  sizetype D.21758;
  const char * p.117;
  int len;

  p.110 = p;
  p.111 = p.110;
  p.112 = p.111 + 1;
  p = p.112;
  D.21740 = *p.111;
  D.21741 = (int) D.21740;
  switch (D.21741) <default: <D.18971>, case 83: <D.18970>, case 84: <D.18968>>
  <D.18968>:
  goto <D.18969>;
  <D.18970>:
  <D.18971>:
  *abort_decoding = 1;
  D.21742 = 0;
  return D.21742;
  <D.18969>:
  p.110 = p;
  p.113 = p.110;
  p.114 = p.113 + 1;
  p = p.114;
  D.21745 = *p.113;
  if (D.21745 != 2) goto <D.21746>; else goto <D.21747>;
  <D.21746>:
  *abort_decoding = 1;
  D.21742 = 0;
  return D.21742;
  <D.21747>:
  p.110 = p;
  D.21748 = mono_metadata_decode_value (p.110, &p);
  len = (int) D.21748;
  len.115 = (unsigned int) len;
  if (len.115 > 15) goto <D.21750>; else goto <D.21751>;
  <D.21750>:
  p.110 = p;
  D.21752 = memcmp (p.110, "SkipVerification", 16);
  if (D.21752 == 0) goto <D.21753>; else goto <D.21754>;
  <D.21753>:
  p.110 = p;
  D.21755 = (sizetype) len;
  p.116 = p.110 + D.21755;
  p = p.116;
  p.110 = p;
  D.21757 = *p.110;
  D.21742 = (gboolean) D.21757;
  return D.21742;
  <D.21754>:
  <D.21751>:
  p.110 = p;
  D.21755 = (sizetype) len;
  D.21758 = D.21755 + 1;
  p.117 = p.110 + D.21758;
  p = p.117;
  p.110 = p;
  *resp = p.110;
  D.21742 = 0;
  return D.21742;
}


