mono_public_tokens_are_equal (const unsigned char * pubt1, const unsigned char * pubt2)
{
  gboolean D.18099;
  int D.18100;
  _Bool D.18101;

  D.18100 = memcmp (pubt1, pubt2, 16);
  D.18101 = D.18100 == 0;
  D.18099 = (gboolean) D.18101;
  return D.18099;
}


mono_set_assemblies_path (const char * path)
{
  char * * assemblies_path.0;
  char * D.18106;
  char D.18107;
  char * * dest.1;
  const gchar * D.18111;
  int D.18116;
  char * * splitted;
  char * * dest;

  splitted = monoeg_g_strsplit (path, ":", 1000);
  assemblies_path.0 = assemblies_path;
  if (assemblies_path.0 != 0B) goto <D.18104>; else goto <D.18105>;
  <D.18104>:
  assemblies_path.0 = assemblies_path;
  monoeg_g_strfreev (assemblies_path.0);
  <D.18105>:
  dest = splitted;
  assemblies_path = dest;
  goto <D.16943>;
  <D.16942>:
  D.18106 = *splitted;
  D.18107 = *D.18106;
  if (D.18107 != 0) goto <D.18108>; else goto <D.18109>;
  <D.18108>:
  dest.1 = dest;
  dest = dest.1 + 4;
  D.18106 = *splitted;
  *dest.1 = D.18106;
  <D.18109>:
  splitted = splitted + 4;
  <D.16943>:
  D.18106 = *splitted;
  if (D.18106 != 0B) goto <D.16942>; else goto <D.16944>;
  <D.16944>:
  D.18106 = *splitted;
  *dest = D.18106;
  D.18111 = monoeg_g_getenv ("MONO_DEBUG");
  if (D.18111 == 0B) goto <D.18112>; else goto <D.18113>;
  <D.18112>:
  return;
  <D.18113>:
  splitted = assemblies_path;
  goto <D.16946>;
  <D.16945>:
  D.18106 = *splitted;
  D.18107 = *D.18106;
  if (D.18107 != 0) goto <D.18114>; else goto <D.18115>;
  <D.18114>:
  D.18106 = *splitted;
  D.18116 = monoeg_g_file_test (D.18106, 4);
  if (D.18116 == 0) goto <D.18117>; else goto <D.18118>;
  <D.18117>:
  D.18106 = *splitted;
  monoeg_g_log (0B, 16, "\'%s\' in MONO_PATH doesn\'t exist or has wrong permissions.", D.18106);
  <D.18118>:
  <D.18115>:
  splitted = splitted + 4;
  <D.16946>:
  D.18106 = *splitted;
  if (D.18106 != 0B) goto <D.16945>; else goto <D.16947>;
  <D.16947>:
}


mono_assembly_names_equal (struct MonoAssemblyName * l, struct MonoAssemblyName * r)
{
  const char * D.18122;
  const char * D.18124;
  mono_bool D.18125;
  int D.17019;
  const char * D.18128;
  const char * D.18131;
  int D.17028;
  unsigned int D.18138;
  unsigned int D.18139;
  unsigned int D.18140;
  unsigned int D.18141;
  unsigned int D.18143;
  unsigned int D.18144;
  unsigned int D.18145;
  unsigned int D.18146;
  unsigned char D.18154;
  unsigned char D.18156;
  mono_byte[17] * D.18157;
  mono_byte[17] * D.18158;
  int D.18159;

  D.18122 = l->name;
  if (D.18122 == 0B) goto <D.18120>; else goto <D.18123>;
  <D.18123>:
  D.18124 = r->name;
  if (D.18124 == 0B) goto <D.18120>; else goto <D.18121>;
  <D.18120>:
  D.18125 = 0;
  return D.18125;
  <D.18121>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.18122 = l->name;
    D.18124 = r->name;
    D.17019 = __builtin_strcmp (D.18122, D.18124);
  }
  if (D.17019 != 0) goto <D.18126>; else goto <D.18127>;
  <D.18126>:
  D.18125 = 0;
  return D.18125;
  <D.18127>:
  D.18128 = l->culture;
  if (D.18128 != 0B) goto <D.18129>; else goto <D.18130>;
  <D.18129>:
  D.18131 = r->culture;
  if (D.18131 != 0B) goto <D.18132>; else goto <D.18133>;
  <D.18132>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.18128 = l->culture;
    D.18131 = r->culture;
    D.17028 = __builtin_strcmp (D.18128, D.18131);
  }
  if (D.17028 != 0) goto <D.18134>; else goto <D.18135>;
  <D.18134>:
  D.18125 = 0;
  return D.18125;
  <D.18135>:
  <D.18133>:
  <D.18130>:
  D.18138 = BIT_FIELD_REF <*l, 32, 384>;
  D.18139 = D.18138;
  D.18140 = BIT_FIELD_REF <*r, 32, 384>;
  D.18141 = D.18140;
  if (D.18139 != D.18141) goto <D.18136>; else goto <D.18142>;
  <D.18142>:
  D.18143 = BIT_FIELD_REF <*l, 32, 416>;
  D.18144 = D.18143;
  D.18145 = BIT_FIELD_REF <*r, 32, 416>;
  D.18146 = D.18145;
  if (D.18144 != D.18146) goto <D.18136>; else goto <D.18137>;
  <D.18136>:
  D.18138 = BIT_FIELD_REF <*l, 32, 384>;
  D.18139 = D.18138;
  if (D.18139 != 0) goto <D.18149>; else goto <D.18150>;
  <D.18150>:
  D.18143 = BIT_FIELD_REF <*l, 32, 416>;
  D.18144 = D.18143;
  if (D.18144 != 0) goto <D.18149>; else goto <D.18148>;
  <D.18149>:
  D.18140 = BIT_FIELD_REF <*r, 32, 384>;
  D.18141 = D.18140;
  if (D.18141 != 0) goto <D.18147>; else goto <D.18151>;
  <D.18151>:
  D.18145 = BIT_FIELD_REF <*r, 32, 416>;
  D.18146 = D.18145;
  if (D.18146 != 0) goto <D.18147>; else goto <D.18148>;
  <D.18147>:
  D.18125 = 0;
  return D.18125;
  <D.18148>:
  <D.18137>:
  D.18154 = l->public_key_token[0];
  if (D.18154 == 0) goto <D.18152>; else goto <D.18155>;
  <D.18155>:
  D.18156 = r->public_key_token[0];
  if (D.18156 == 0) goto <D.18152>; else goto <D.18153>;
  <D.18152>:
  D.18125 = 1;
  return D.18125;
  <D.18153>:
  D.18157 = &l->public_key_token;
  D.18158 = &r->public_key_token;
  D.18159 = mono_public_tokens_are_equal (D.18157, D.18158);
  if (D.18159 == 0) goto <D.18160>; else goto <D.18161>;
  <D.18160>:
  D.18125 = 0;
  return D.18125;
  <D.18161>:
  D.18125 = 1;
  return D.18125;
}


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

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


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

  if (str != 0B) goto <D.18164>; else goto <D.18165>;
  <D.18164>:
  D.18166 = __strdup (str);
  return D.18166;
  <D.18165>:
  D.18166 = 0B;
  return D.18166;
}


mono_assembly_getrootdir ()
{
  const char * D.18168;

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


mono_set_dirs (const char * assembly_dir, const char * config_dir)
{
  if (assembly_dir == 0B) goto <D.18170>; else goto <D.18171>;
  <D.18170>:
  assembly_dir = "/usr/lib";
  <D.18171>:
  if (config_dir == 0B) goto <D.18172>; else goto <D.18173>;
  <D.18172>:
  config_dir = "/etc";
  <D.18173>:
  mono_assembly_setrootdir (assembly_dir);
  mono_set_config_dir (config_dir);
}


mono_set_rootdir ()
{
  int D.18176;
  char buf[4096];
  int s;
  char * str;

  try
    {
      s = readlink ("/proc/self/exe", &buf, 4095);
      if (s != -1) goto <D.18174>; else goto <D.18175>;
      <D.18174>:
      buf[s] = 0;
      set_dirs (&buf);
      return;
      <D.18175>:
      D.18176 = getpid ();
      str = monoeg_g_strdup_printf ("/proc/%d/path/a.out", D.18176);
      s = readlink (str, &buf, 4095);
      monoeg_g_free (str);
      if (s != -1) goto <D.18177>; else goto <D.18178>;
      <D.18177>:
      buf[s] = 0;
      set_dirs (&buf);
      return;
      <D.18178>:
      fallback ();
    }
  finally
    {
      buf = {CLOBBER};
    }
}


readlink (const char * restrict __path, char * restrict __buf, size_t __len)
{
  unsigned int D.18182;
  int D.18185;
  ssize_t D.18188;
  unsigned int D.18189;
  unsigned int D.18190;
  unsigned int D.18193;

  D.18182 = __builtin_object_size (__buf, 1);
  if (D.18182 != 4294967295) goto <D.18183>; else goto <D.18184>;
  <D.18183>:
  D.18185 = __builtin_constant_p (__len);
  if (D.18185 == 0) goto <D.18186>; else goto <D.18187>;
  <D.18186>:
  D.18189 = __builtin_object_size (__buf, 1);
  D.18188 = __readlink_chk (__path, __buf, __len, D.18189);
  return D.18188;
  <D.18187>:
  D.18190 = __builtin_object_size (__buf, 1);
  if (D.18190 < __len) goto <D.18191>; else goto <D.18192>;
  <D.18191>:
  D.18193 = __builtin_object_size (__buf, 1);
  D.18188 = __readlink_chk_warn (__path, __buf, __len, D.18193);
  return D.18188;
  <D.18192>:
  <D.18184>:
  D.18188 = __readlink_alias (__path, __buf, __len);
  return D.18188;
}


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

  try
    {
      D.18197 = strncmp (exe, "/usr/bin/", 9);
      if (D.18197 == 0) goto <D.18195>; else goto <D.18198>;
      <D.18198>:
      base = compute_base (exe);
      if (base == 0B) goto <D.18195>; else goto <D.18196>;
      <D.18195>:
      fallback ();
      return;
      <D.18196>:
      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.18199 = stat (mono, &buf);
      if (D.18199 == -1) goto <D.18200>; else goto <D.18201>;
      <D.18200>:
      fallback ();
      goto <D.18202>;
      <D.18201>:
      mono_set_dirs (lib, config);
      <D.18202>:
      monoeg_g_free (config);
      monoeg_g_free (lib);
      monoeg_g_free (mono);
    }
  finally
    {
      buf = {CLOBBER};
    }
}


compute_base (char * path)
{
  char * D.18208;
  int D.17063;
  int iftmp.2;
  int D.17062;
  const char[6] * D.18212;
  unsigned char D.18213;
  int D.18214;
  unsigned char D.18215;
  int D.18216;
  const unsigned char * D.18221;
  unsigned char D.18222;
  int D.18223;
  const unsigned char * D.18224;
  unsigned char D.18225;
  int D.18226;
  const unsigned char * D.18231;
  unsigned char D.18232;
  int D.18233;
  const unsigned char * D.18234;
  unsigned char D.18235;
  int D.18236;
  const unsigned char * D.18241;
  unsigned char D.18242;
  int D.18243;
  const unsigned char * D.18244;
  unsigned char D.18245;
  int D.18246;
  int D.17072;
  int iftmp.3;
  int D.17071;
  const char[11] * D.18253;
  unsigned char D.18254;
  int D.18255;
  unsigned char D.18256;
  int D.18257;
  const unsigned char * D.18262;
  unsigned char D.18263;
  int D.18264;
  const unsigned char * D.18265;
  unsigned char D.18266;
  int D.18267;
  const unsigned char * D.18272;
  unsigned char D.18273;
  int D.18274;
  const unsigned char * D.18275;
  unsigned char D.18276;
  int D.18277;
  const unsigned char * D.18282;
  unsigned char D.18283;
  int D.18284;
  const unsigned char * D.18285;
  unsigned char D.18286;
  int D.18287;
  int D.17081;
  int iftmp.4;
  int D.17080;
  const char[8] * D.18294;
  unsigned char D.18295;
  int D.18296;
  unsigned char D.18297;
  int D.18298;
  const unsigned char * D.18303;
  unsigned char D.18304;
  int D.18305;
  const unsigned char * D.18306;
  unsigned char D.18307;
  int D.18308;
  const unsigned char * D.18313;
  unsigned char D.18314;
  int D.18315;
  const unsigned char * D.18316;
  unsigned char D.18317;
  int D.18318;
  const unsigned char * D.18323;
  unsigned char D.18324;
  int D.18325;
  const unsigned char * D.18326;
  unsigned char D.18327;
  int D.18328;
  int D.17090;
  int iftmp.5;
  int D.17089;
  const char[9] * D.18335;
  unsigned char D.18336;
  int D.18337;
  unsigned char D.18338;
  int D.18339;
  const unsigned char * D.18344;
  unsigned char D.18345;
  int D.18346;
  const unsigned char * D.18347;
  unsigned char D.18348;
  int D.18349;
  const unsigned char * D.18354;
  unsigned char D.18355;
  int D.18356;
  const unsigned char * D.18357;
  unsigned char D.18358;
  int D.18359;
  const unsigned char * D.18364;
  unsigned char D.18365;
  int D.18366;
  const unsigned char * D.18367;
  unsigned char D.18368;
  int D.18369;
  int D.17099;
  int iftmp.6;
  int D.17098;
  const char[6] * D.18376;
  unsigned char D.18377;
  int D.18378;
  unsigned char D.18379;
  int D.18380;
  const unsigned char * D.18385;
  unsigned char D.18386;
  int D.18387;
  const unsigned char * D.18388;
  unsigned char D.18389;
  int D.18390;
  const unsigned char * D.18395;
  unsigned char D.18396;
  int D.18397;
  const unsigned char * D.18398;
  unsigned char D.18399;
  int D.18400;
  const unsigned char * D.18405;
  unsigned char D.18406;
  int D.18407;
  const unsigned char * D.18408;
  unsigned char D.18409;
  int D.18410;
  int D.17108;
  int iftmp.7;
  int D.17107;
  const char[10] * D.18417;
  unsigned char D.18418;
  int D.18419;
  unsigned char D.18420;
  int D.18421;
  const unsigned char * D.18426;
  unsigned char D.18427;
  int D.18428;
  const unsigned char * D.18429;
  unsigned char D.18430;
  int D.18431;
  const unsigned char * D.18436;
  unsigned char D.18437;
  int D.18438;
  const unsigned char * D.18439;
  unsigned char D.18440;
  int D.18441;
  const unsigned char * D.18446;
  unsigned char D.18447;
  int D.18448;
  const unsigned char * D.18449;
  unsigned char D.18450;
  int D.18451;
  int D.17117;
  int iftmp.8;
  int D.17116;
  const char[5] * D.18460;
  unsigned char D.18461;
  int D.18462;
  unsigned char D.18463;
  int D.18464;
  const unsigned char * D.18469;
  unsigned char D.18470;
  int D.18471;
  const unsigned char * D.18472;
  unsigned char D.18473;
  int D.18474;
  const unsigned char * D.18479;
  unsigned char D.18480;
  int D.18481;
  const unsigned char * D.18482;
  unsigned char D.18483;
  int D.18484;
  const unsigned char * D.18489;
  unsigned char D.18490;
  int D.18491;
  const unsigned char * D.18492;
  unsigned char D.18493;
  int D.18494;
  char * p;

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

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

      __s2 = p;
      D.18212 = "/mono";
      D.18213 = MEM[(const unsigned char *)D.18212];
      D.18214 = (int) D.18213;
      D.18215 = *__s2;
      D.18216 = (int) D.18215;
      __result = D.18214 - D.18216;
      {
        if (__s2_len != 0) goto <D.18217>; else goto <D.18218>;
        <D.18217>:
        if (__result == 0) goto <D.18219>; else goto <D.18220>;
        <D.18219>:
        D.18221 = &MEM[(void *)"/mono" + 1B];
        D.18222 = *D.18221;
        D.18223 = (int) D.18222;
        D.18224 = __s2 + 1;
        D.18225 = *D.18224;
        D.18226 = (int) D.18225;
        __result = D.18223 - D.18226;
        if (__s2_len > 1) goto <D.18227>; else goto <D.18228>;
        <D.18227>:
        if (__result == 0) goto <D.18229>; else goto <D.18230>;
        <D.18229>:
        D.18231 = &MEM[(void *)"/mono" + 2B];
        D.18232 = *D.18231;
        D.18233 = (int) D.18232;
        D.18234 = __s2 + 2;
        D.18235 = *D.18234;
        D.18236 = (int) D.18235;
        __result = D.18233 - D.18236;
        if (__s2_len > 2) goto <D.18237>; else goto <D.18238>;
        <D.18237>:
        if (__result == 0) goto <D.18239>; else goto <D.18240>;
        <D.18239>:
        D.18241 = &MEM[(void *)"/mono" + 3B];
        D.18242 = *D.18241;
        D.18243 = (int) D.18242;
        D.18244 = __s2 + 3;
        D.18245 = *D.18244;
        D.18246 = (int) D.18245;
        __result = D.18243 - D.18246;
        <D.18240>:
        <D.18238>:
        <D.18230>:
        <D.18228>:
        <D.18220>:
        <D.18218>:
      }
      D.17062 = __result;
    }
    iftmp.2 = -D.17062;
    goto <D.18247>;
    <D.18211>:
    iftmp.2 = __builtin_strcmp (p, "/mono");
    <D.18247>:
    D.17063 = iftmp.2;
  }
  if (D.17063 != 0) goto <D.18248>; else goto <D.18249>;
  <D.18248>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18253 = "/mono-sgen";
      D.18254 = MEM[(const unsigned char *)D.18253];
      D.18255 = (int) D.18254;
      D.18256 = *__s2;
      D.18257 = (int) D.18256;
      __result = D.18255 - D.18257;
      {
        if (__s2_len != 0) goto <D.18258>; else goto <D.18259>;
        <D.18258>:
        if (__result == 0) goto <D.18260>; else goto <D.18261>;
        <D.18260>:
        D.18262 = &MEM[(void *)"/mono-sgen" + 1B];
        D.18263 = *D.18262;
        D.18264 = (int) D.18263;
        D.18265 = __s2 + 1;
        D.18266 = *D.18265;
        D.18267 = (int) D.18266;
        __result = D.18264 - D.18267;
        if (__s2_len > 1) goto <D.18268>; else goto <D.18269>;
        <D.18268>:
        if (__result == 0) goto <D.18270>; else goto <D.18271>;
        <D.18270>:
        D.18272 = &MEM[(void *)"/mono-sgen" + 2B];
        D.18273 = *D.18272;
        D.18274 = (int) D.18273;
        D.18275 = __s2 + 2;
        D.18276 = *D.18275;
        D.18277 = (int) D.18276;
        __result = D.18274 - D.18277;
        if (__s2_len > 2) goto <D.18278>; else goto <D.18279>;
        <D.18278>:
        if (__result == 0) goto <D.18280>; else goto <D.18281>;
        <D.18280>:
        D.18282 = &MEM[(void *)"/mono-sgen" + 3B];
        D.18283 = *D.18282;
        D.18284 = (int) D.18283;
        D.18285 = __s2 + 3;
        D.18286 = *D.18285;
        D.18287 = (int) D.18286;
        __result = D.18284 - D.18287;
        <D.18281>:
        <D.18279>:
        <D.18271>:
        <D.18269>:
        <D.18261>:
        <D.18259>:
      }
      D.17071 = __result;
    }
    iftmp.3 = -D.17071;
    goto <D.18288>;
    <D.18252>:
    iftmp.3 = __builtin_strcmp (p, "/mono-sgen");
    <D.18288>:
    D.17072 = iftmp.3;
  }
  if (D.17072 != 0) goto <D.18289>; else goto <D.18290>;
  <D.18289>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18294 = "/pedump";
      D.18295 = MEM[(const unsigned char *)D.18294];
      D.18296 = (int) D.18295;
      D.18297 = *__s2;
      D.18298 = (int) D.18297;
      __result = D.18296 - D.18298;
      {
        if (__s2_len != 0) goto <D.18299>; else goto <D.18300>;
        <D.18299>:
        if (__result == 0) goto <D.18301>; else goto <D.18302>;
        <D.18301>:
        D.18303 = &MEM[(void *)"/pedump" + 1B];
        D.18304 = *D.18303;
        D.18305 = (int) D.18304;
        D.18306 = __s2 + 1;
        D.18307 = *D.18306;
        D.18308 = (int) D.18307;
        __result = D.18305 - D.18308;
        if (__s2_len > 1) goto <D.18309>; else goto <D.18310>;
        <D.18309>:
        if (__result == 0) goto <D.18311>; else goto <D.18312>;
        <D.18311>:
        D.18313 = &MEM[(void *)"/pedump" + 2B];
        D.18314 = *D.18313;
        D.18315 = (int) D.18314;
        D.18316 = __s2 + 2;
        D.18317 = *D.18316;
        D.18318 = (int) D.18317;
        __result = D.18315 - D.18318;
        if (__s2_len > 2) goto <D.18319>; else goto <D.18320>;
        <D.18319>:
        if (__result == 0) goto <D.18321>; else goto <D.18322>;
        <D.18321>:
        D.18323 = &MEM[(void *)"/pedump" + 3B];
        D.18324 = *D.18323;
        D.18325 = (int) D.18324;
        D.18326 = __s2 + 3;
        D.18327 = *D.18326;
        D.18328 = (int) D.18327;
        __result = D.18325 - D.18328;
        <D.18322>:
        <D.18320>:
        <D.18312>:
        <D.18310>:
        <D.18302>:
        <D.18300>:
      }
      D.17080 = __result;
    }
    iftmp.4 = -D.17080;
    goto <D.18329>;
    <D.18293>:
    iftmp.4 = __builtin_strcmp (p, "/pedump");
    <D.18329>:
    D.17081 = iftmp.4;
  }
  if (D.17081 != 0) goto <D.18330>; else goto <D.18331>;
  <D.18330>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18335 = "/monodis";
      D.18336 = MEM[(const unsigned char *)D.18335];
      D.18337 = (int) D.18336;
      D.18338 = *__s2;
      D.18339 = (int) D.18338;
      __result = D.18337 - D.18339;
      {
        if (__s2_len != 0) goto <D.18340>; else goto <D.18341>;
        <D.18340>:
        if (__result == 0) goto <D.18342>; else goto <D.18343>;
        <D.18342>:
        D.18344 = &MEM[(void *)"/monodis" + 1B];
        D.18345 = *D.18344;
        D.18346 = (int) D.18345;
        D.18347 = __s2 + 1;
        D.18348 = *D.18347;
        D.18349 = (int) D.18348;
        __result = D.18346 - D.18349;
        if (__s2_len > 1) goto <D.18350>; else goto <D.18351>;
        <D.18350>:
        if (__result == 0) goto <D.18352>; else goto <D.18353>;
        <D.18352>:
        D.18354 = &MEM[(void *)"/monodis" + 2B];
        D.18355 = *D.18354;
        D.18356 = (int) D.18355;
        D.18357 = __s2 + 2;
        D.18358 = *D.18357;
        D.18359 = (int) D.18358;
        __result = D.18356 - D.18359;
        if (__s2_len > 2) goto <D.18360>; else goto <D.18361>;
        <D.18360>:
        if (__result == 0) goto <D.18362>; else goto <D.18363>;
        <D.18362>:
        D.18364 = &MEM[(void *)"/monodis" + 3B];
        D.18365 = *D.18364;
        D.18366 = (int) D.18365;
        D.18367 = __s2 + 3;
        D.18368 = *D.18367;
        D.18369 = (int) D.18368;
        __result = D.18366 - D.18369;
        <D.18363>:
        <D.18361>:
        <D.18353>:
        <D.18351>:
        <D.18343>:
        <D.18341>:
      }
      D.17089 = __result;
    }
    iftmp.5 = -D.17089;
    goto <D.18370>;
    <D.18334>:
    iftmp.5 = __builtin_strcmp (p, "/monodis");
    <D.18370>:
    D.17090 = iftmp.5;
  }
  if (D.17090 != 0) goto <D.18371>; else goto <D.18372>;
  <D.18371>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18376 = "/mint";
      D.18377 = MEM[(const unsigned char *)D.18376];
      D.18378 = (int) D.18377;
      D.18379 = *__s2;
      D.18380 = (int) D.18379;
      __result = D.18378 - D.18380;
      {
        if (__s2_len != 0) goto <D.18381>; else goto <D.18382>;
        <D.18381>:
        if (__result == 0) goto <D.18383>; else goto <D.18384>;
        <D.18383>:
        D.18385 = &MEM[(void *)"/mint" + 1B];
        D.18386 = *D.18385;
        D.18387 = (int) D.18386;
        D.18388 = __s2 + 1;
        D.18389 = *D.18388;
        D.18390 = (int) D.18389;
        __result = D.18387 - D.18390;
        if (__s2_len > 1) goto <D.18391>; else goto <D.18392>;
        <D.18391>:
        if (__result == 0) goto <D.18393>; else goto <D.18394>;
        <D.18393>:
        D.18395 = &MEM[(void *)"/mint" + 2B];
        D.18396 = *D.18395;
        D.18397 = (int) D.18396;
        D.18398 = __s2 + 2;
        D.18399 = *D.18398;
        D.18400 = (int) D.18399;
        __result = D.18397 - D.18400;
        if (__s2_len > 2) goto <D.18401>; else goto <D.18402>;
        <D.18401>:
        if (__result == 0) goto <D.18403>; else goto <D.18404>;
        <D.18403>:
        D.18405 = &MEM[(void *)"/mint" + 3B];
        D.18406 = *D.18405;
        D.18407 = (int) D.18406;
        D.18408 = __s2 + 3;
        D.18409 = *D.18408;
        D.18410 = (int) D.18409;
        __result = D.18407 - D.18410;
        <D.18404>:
        <D.18402>:
        <D.18394>:
        <D.18392>:
        <D.18384>:
        <D.18382>:
      }
      D.17098 = __result;
    }
    iftmp.6 = -D.17098;
    goto <D.18411>;
    <D.18375>:
    iftmp.6 = __builtin_strcmp (p, "/mint");
    <D.18411>:
    D.17099 = iftmp.6;
  }
  if (D.17099 != 0) goto <D.18412>; else goto <D.18413>;
  <D.18412>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18417 = "/monodiet";
      D.18418 = MEM[(const unsigned char *)D.18417];
      D.18419 = (int) D.18418;
      D.18420 = *__s2;
      D.18421 = (int) D.18420;
      __result = D.18419 - D.18421;
      {
        if (__s2_len != 0) goto <D.18422>; else goto <D.18423>;
        <D.18422>:
        if (__result == 0) goto <D.18424>; else goto <D.18425>;
        <D.18424>:
        D.18426 = &MEM[(void *)"/monodiet" + 1B];
        D.18427 = *D.18426;
        D.18428 = (int) D.18427;
        D.18429 = __s2 + 1;
        D.18430 = *D.18429;
        D.18431 = (int) D.18430;
        __result = D.18428 - D.18431;
        if (__s2_len > 1) goto <D.18432>; else goto <D.18433>;
        <D.18432>:
        if (__result == 0) goto <D.18434>; else goto <D.18435>;
        <D.18434>:
        D.18436 = &MEM[(void *)"/monodiet" + 2B];
        D.18437 = *D.18436;
        D.18438 = (int) D.18437;
        D.18439 = __s2 + 2;
        D.18440 = *D.18439;
        D.18441 = (int) D.18440;
        __result = D.18438 - D.18441;
        if (__s2_len > 2) goto <D.18442>; else goto <D.18443>;
        <D.18442>:
        if (__result == 0) goto <D.18444>; else goto <D.18445>;
        <D.18444>:
        D.18446 = &MEM[(void *)"/monodiet" + 3B];
        D.18447 = *D.18446;
        D.18448 = (int) D.18447;
        D.18449 = __s2 + 3;
        D.18450 = *D.18449;
        D.18451 = (int) D.18450;
        __result = D.18448 - D.18451;
        <D.18445>:
        <D.18443>:
        <D.18435>:
        <D.18433>:
        <D.18425>:
        <D.18423>:
      }
      D.17107 = __result;
    }
    iftmp.7 = -D.17107;
    goto <D.18452>;
    <D.18416>:
    iftmp.7 = __builtin_strcmp (p, "/monodiet");
    <D.18452>:
    D.17108 = iftmp.7;
  }
  if (D.17108 != 0) goto <D.18453>; else goto <D.18454>;
  <D.18453>:
  D.18208 = 0B;
  return D.18208;
  <D.18454>:
  <D.18413>:
  <D.18372>:
  <D.18331>:
  <D.18290>:
  <D.18249>:
  *p = 0;
  p = strrchr (path, 47);
  if (p == 0B) goto <D.18455>; else goto <D.18456>;
  <D.18455>:
  D.18208 = 0B;
  return D.18208;
  <D.18456>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = p;
      D.18460 = "/bin";
      D.18461 = MEM[(const unsigned char *)D.18460];
      D.18462 = (int) D.18461;
      D.18463 = *__s2;
      D.18464 = (int) D.18463;
      __result = D.18462 - D.18464;
      {
        if (__s2_len != 0) goto <D.18465>; else goto <D.18466>;
        <D.18465>:
        if (__result == 0) goto <D.18467>; else goto <D.18468>;
        <D.18467>:
        D.18469 = &MEM[(void *)"/bin" + 1B];
        D.18470 = *D.18469;
        D.18471 = (int) D.18470;
        D.18472 = __s2 + 1;
        D.18473 = *D.18472;
        D.18474 = (int) D.18473;
        __result = D.18471 - D.18474;
        if (__s2_len > 1) goto <D.18475>; else goto <D.18476>;
        <D.18475>:
        if (__result == 0) goto <D.18477>; else goto <D.18478>;
        <D.18477>:
        D.18479 = &MEM[(void *)"/bin" + 2B];
        D.18480 = *D.18479;
        D.18481 = (int) D.18480;
        D.18482 = __s2 + 2;
        D.18483 = *D.18482;
        D.18484 = (int) D.18483;
        __result = D.18481 - D.18484;
        if (__s2_len > 2) goto <D.18485>; else goto <D.18486>;
        <D.18485>:
        if (__result == 0) goto <D.18487>; else goto <D.18488>;
        <D.18487>:
        D.18489 = &MEM[(void *)"/bin" + 3B];
        D.18490 = *D.18489;
        D.18491 = (int) D.18490;
        D.18492 = __s2 + 3;
        D.18493 = *D.18492;
        D.18494 = (int) D.18493;
        __result = D.18491 - D.18494;
        <D.18488>:
        <D.18486>:
        <D.18478>:
        <D.18476>:
        <D.18468>:
        <D.18466>:
      }
      D.17116 = __result;
    }
    iftmp.8 = -D.17116;
    goto <D.18495>;
    <D.18459>:
    iftmp.8 = __builtin_strcmp (p, "/bin");
    <D.18495>:
    D.17117 = iftmp.8;
  }
  if (D.17117 != 0) goto <D.18496>; else goto <D.18497>;
  <D.18496>:
  D.18208 = 0B;
  return D.18208;
  <D.18497>:
  *p = 0;
  D.18208 = path;
  return D.18208;
}


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

  D.18499 = __xstat (3, __path, __statbuf);
  return D.18499;
}


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


mono_assemblies_init ()
{
  const char * D.18501;

  D.18501 = mono_assembly_getrootdir ();
  if (D.18501 == 0B) goto <D.18502>; else goto <D.18503>;
  <D.18502>:
  mono_set_rootdir ();
  <D.18503>:
  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.18504>; else goto <D.18506>;
  <D.18506>:
  assemblies_path.9 = assemblies_path;
  if (assemblies_path.9 != 0B) goto <D.18504>; else goto <D.18505>;
  <D.18504>:
  return;
  <D.18505>:
  mono_set_assemblies_path (path);
}


check_extra_gac_path_env ()
{
  char * * extra_gac_paths.10;
  char * D.18514;
  char D.18515;
  char * * dest.11;
  const gchar * D.18519;
  int D.18524;
  const char * path;
  char * * splitted;
  char * * dest;

  path = monoeg_g_getenv ("MONO_GAC_PREFIX");
  if (path == 0B) goto <D.18509>; else goto <D.18510>;
  <D.18509>:
  return;
  <D.18510>:
  splitted = monoeg_g_strsplit (path, ":", 1000);
  extra_gac_paths.10 = extra_gac_paths;
  if (extra_gac_paths.10 != 0B) goto <D.18512>; else goto <D.18513>;
  <D.18512>:
  extra_gac_paths.10 = extra_gac_paths;
  monoeg_g_strfreev (extra_gac_paths.10);
  <D.18513>:
  dest = splitted;
  extra_gac_paths = dest;
  goto <D.16959>;
  <D.16958>:
  D.18514 = *splitted;
  D.18515 = *D.18514;
  if (D.18515 != 0) goto <D.18516>; else goto <D.18517>;
  <D.18516>:
  dest.11 = dest;
  dest = dest.11 + 4;
  D.18514 = *splitted;
  *dest.11 = D.18514;
  <D.18517>:
  splitted = splitted + 4;
  <D.16959>:
  D.18514 = *splitted;
  if (D.18514 != 0B) goto <D.16958>; else goto <D.16960>;
  <D.16960>:
  D.18514 = *splitted;
  *dest = D.18514;
  D.18519 = monoeg_g_getenv ("MONO_DEBUG");
  if (D.18519 == 0B) goto <D.18520>; else goto <D.18521>;
  <D.18520>:
  return;
  <D.18521>:
  goto <D.16962>;
  <D.16961>:
  D.18514 = *splitted;
  D.18515 = *D.18514;
  if (D.18515 != 0) goto <D.18522>; else goto <D.18523>;
  <D.18522>:
  D.18514 = *splitted;
  D.18524 = monoeg_g_file_test (D.18514, 4);
  if (D.18524 == 0) goto <D.18525>; else goto <D.18526>;
  <D.18525>:
  D.18514 = *splitted;
  monoeg_g_log (0B, 16, "\'%s\' in MONO_GAC_PREFIX doesn\'t exist or has wrong permissions.", D.18514);
  <D.18526>:
  <D.18523>:
  splitted = splitted + 4;
  <D.16962>:
  D.18514 = *splitted;
  if (D.18514 != 0B) goto <D.16961>; else goto <D.16963>;
  <D.16963>:
}


mono_assembly_fill_assembly_name (struct MonoImage * image, struct MonoAssemblyName * aname)
{
  unsigned int D.18528;
  unsigned int D.18529;
  mono_bool D.18532;
  unsigned int D.18533;
  const char * D.18534;
  unsigned int D.18535;
  const char * D.18536;
  unsigned int D.18537;
  unsigned int D.18538;
  short unsigned int D.18539;
  unsigned int D.18540;
  short unsigned int D.18541;
  unsigned int D.18542;
  short unsigned int D.18543;
  unsigned int D.18544;
  short unsigned int D.18545;
  unsigned int D.18546;
  unsigned int D.18547;
  const char * pkey.12;
  const gchar * pkey.13;
  unsigned int D.18552;
  const mono_byte * D.18553;
  unsigned int len.14;
  mono_byte[17] * D.18555;
  const char * D.18559;
  void * D.18561;
  short unsigned int D.18562;
  unsigned int D.18563;
  int D.18564;
  int D.18568;
  struct MonoTableInfo * t;
  guint32 cols[9];
  gint32 machine;
  gint32 flags;

  try
    {
      t = &image->tables[32];
      D.18528 = BIT_FIELD_REF <*t, 32, 32>;
      D.18529 = D.18528 & 16777215;
      if (D.18529 == 0) goto <D.18530>; else goto <D.18531>;
      <D.18530>:
      D.18532 = 0;
      return D.18532;
      <D.18531>:
      mono_metadata_decode_row (t, 0, &cols, 9);
      aname->hash_len = 0;
      aname->hash_value = 0B;
      D.18533 = cols[7];
      D.18534 = mono_metadata_string_heap (image, D.18533);
      aname->name = D.18534;
      D.18535 = cols[8];
      D.18536 = mono_metadata_string_heap (image, D.18535);
      aname->culture = D.18536;
      D.18537 = cols[5];
      aname->flags = D.18537;
      D.18538 = cols[1];
      D.18539 = (short unsigned int) D.18538;
      aname->major = D.18539;
      D.18540 = cols[2];
      D.18541 = (short unsigned int) D.18540;
      aname->minor = D.18541;
      D.18542 = cols[3];
      D.18543 = (short unsigned int) D.18542;
      aname->build = D.18543;
      D.18544 = cols[4];
      D.18545 = (short unsigned int) D.18544;
      aname->revision = D.18545;
      D.18546 = cols[0];
      aname->hash_alg = D.18546;
      D.18547 = cols[6];
      if (D.18547 != 0) goto <D.18548>; else goto <D.18549>;
      <D.18548>:
      {
        guchar * token;
        gchar * encoded;
        const gchar * pkey;
        int len;

        try
          {
            token = monoeg_malloc (8);
            D.18547 = cols[6];
            pkey.12 = mono_metadata_blob_heap (image, D.18547);
            pkey = pkey.12;
            pkey.13 = pkey;
            D.18552 = mono_metadata_decode_blob_size (pkey.13, &pkey);
            len = (int) D.18552;
            pkey.13 = pkey;
            aname->public_key = pkey.13;
            D.18553 = aname->public_key;
            len.14 = (unsigned int) len;
            mono_digest_get_public_token (token, D.18553, len.14);
            encoded = encode_public_tok (token, 8);
            D.18555 = &aname->public_key_token;
            monoeg_g_strlcpy (D.18555, encoded, 17);
            monoeg_g_free (encoded);
            monoeg_g_free (token);
          }
        finally
          {
            pkey = {CLOBBER};
          }
      }
      goto <D.18556>;
      <D.18549>:
      aname->public_key = 0B;
      D.18555 = &aname->public_key_token;
      memset (D.18555, 0, 17);
      <D.18556>:
      D.18547 = cols[6];
      if (D.18547 != 0) goto <D.18557>; else goto <D.18558>;
      <D.18557>:
      D.18547 = cols[6];
      D.18559 = mono_metadata_blob_heap (image, D.18547);
      aname->public_key = D.18559;
      goto <D.18560>;
      <D.18558>:
      aname->public_key = 0B;
      <D.18560>:
      D.18561 = image->image_info;
      D.18562 = MEM[(struct MonoCLIImageInfo *)D.18561].cli_header.coff.coff_machine;
      machine = (gint32) D.18562;
      D.18561 = image->image_info;
      D.18563 = MEM[(struct MonoCLIImageInfo *)D.18561].cli_cli_header.ch_flags;
      flags = (gint32) D.18563;
      switch (machine) <default: <D.17170>, case 332: <D.17165>, case 452: <D.17169>, case 512: <D.17167>, case 34404: <D.17168>>
      <D.17165>:
      D.18564 = flags & 18;
      if (D.18564 != 0) goto <D.18565>; else goto <D.18566>;
      <D.18565>:
      aname->arch = 2;
      goto <D.18567>;
      <D.18566>:
      D.18568 = flags & 112;
      if (D.18568 == 112) goto <D.18569>; else goto <D.18570>;
      <D.18569>:
      aname->arch = 0;
      goto <D.18571>;
      <D.18570>:
      aname->arch = 1;
      <D.18571>:
      <D.18567>:
      goto <D.17166>;
      <D.17167>:
      aname->arch = 3;
      goto <D.17166>;
      <D.17168>:
      aname->arch = 4;
      goto <D.17166>;
      <D.17169>:
      aname->arch = 5;
      goto <D.17166>;
      <D.17170>:
      goto <D.17166>;
      <D.17166>:
      D.18532 = 1;
      return D.18532;
    }
  finally
    {
      cols = {CLOBBER};
    }
}


encode_public_tok (const guchar * token, gint32 len)
{
  int D.18575;
  int D.18576;
  unsigned int D.18577;
  int D.18578;
  sizetype D.18579;
  gchar * D.18580;
  sizetype i.15;
  const guchar * D.18582;
  unsigned char D.18583;
  unsigned char D.18584;
  int D.18585;
  char D.18586;
  sizetype D.18587;
  gchar * D.18588;
  int D.18589;
  int D.18590;
  char D.18591;
  sizetype D.18592;
  gchar * D.18593;
  gchar * D.18594;
  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.18575 = len * 2;
  D.18576 = D.18575 + 1;
  D.18577 = (unsigned int) D.18576;
  res = monoeg_malloc (D.18577);
  i = 0;
  goto <D.16931>;
  <D.16930>:
  D.18578 = i * 2;
  D.18579 = (sizetype) D.18578;
  D.18580 = res + D.18579;
  i.15 = (sizetype) i;
  D.18582 = token + i.15;
  D.18583 = *D.18582;
  D.18584 = D.18583 >> 4;
  D.18585 = (int) D.18584;
  D.18586 = allowed[D.18585];
  *D.18580 = D.18586;
  D.18578 = i * 2;
  D.18579 = (sizetype) D.18578;
  D.18587 = D.18579 + 1;
  D.18588 = res + D.18587;
  i.15 = (sizetype) i;
  D.18582 = token + i.15;
  D.18583 = *D.18582;
  D.18589 = (int) D.18583;
  D.18590 = D.18589 & 15;
  D.18591 = allowed[D.18590];
  *D.18588 = D.18591;
  i = i + 1;
  <D.16931>:
  if (i < len) goto <D.16930>; else goto <D.16932>;
  <D.16932>:
  D.18575 = len * 2;
  D.18592 = (sizetype) D.18575;
  D.18593 = res + D.18592;
  *D.18593 = 0;
  D.18594 = res;
  return D.18594;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.18598;
  int D.18603;
  void * D.18605;
  unsigned int D.18606;

  D.18598 = __builtin_constant_p (__len);
  if (D.18598 != 0) goto <D.18599>; else goto <D.18600>;
  <D.18599>:
  if (__len == 0) goto <D.18601>; else goto <D.18602>;
  <D.18601>:
  D.18603 = __builtin_constant_p (__ch);
  if (D.18603 == 0) goto <D.18596>; else goto <D.18604>;
  <D.18604>:
  if (__ch != 0) goto <D.18596>; else goto <D.18597>;
  <D.18596>:
  __warn_memset_zero_len ();
  D.18605 = __dest;
  return D.18605;
  <D.18597>:
  <D.18602>:
  <D.18600>:
  D.18606 = __builtin_object_size (__dest, 0);
  D.18605 = __builtin___memset_chk (__dest, __ch, __len, D.18606);
  return D.18605;
}


mono_stringify_assembly_name (struct MonoAssemblyName * aname)
{
  const char * iftmp.16;
  const char * D.18611;
  const short unsigned int * * D.18613;
  const short unsigned int * D.18614;
  char D.18615;
  unsigned int D.18616;
  unsigned int D.18617;
  const short unsigned int * D.18618;
  short unsigned int D.18619;
  int D.18620;
  int D.18621;
  char * D.18623;
  short unsigned int D.18624;
  int D.18625;
  short unsigned int D.18626;
  int D.18627;
  short unsigned int D.18628;
  int D.18629;
  short unsigned int D.18630;
  int D.18631;
  const char * iftmp.17;
  const char * D.18635;
  char D.18637;
  const char * iftmp.18;
  unsigned char D.18640;
  const char * iftmp.19;
  unsigned int D.18645;
  unsigned int D.18646;
  const char * quote;

  D.18611 = aname->name;
  if (D.18611 != 0B) goto <D.18612>; else goto <D.18609>;
  <D.18612>:
  D.18613 = __ctype_b_loc ();
  D.18614 = *D.18613;
  D.18611 = aname->name;
  D.18615 = *D.18611;
  D.18616 = (unsigned int) D.18615;
  D.18617 = D.18616 * 2;
  D.18618 = D.18614 + D.18617;
  D.18619 = *D.18618;
  D.18620 = (int) D.18619;
  D.18621 = D.18620 & 8192;
  if (D.18621 != 0) goto <D.18622>; else goto <D.18609>;
  <D.18622>:
  iftmp.16 = "\"";
  goto <D.18610>;
  <D.18609>:
  iftmp.16 = "";
  <D.18610>:
  quote = iftmp.16;
  D.18611 = aname->name;
  D.18624 = aname->major;
  D.18625 = (int) D.18624;
  D.18626 = aname->minor;
  D.18627 = (int) D.18626;
  D.18628 = aname->build;
  D.18629 = (int) D.18628;
  D.18630 = aname->revision;
  D.18631 = (int) D.18630;
  D.18635 = aname->culture;
  if (D.18635 != 0B) goto <D.18636>; else goto <D.18633>;
  <D.18636>:
  D.18635 = aname->culture;
  D.18637 = *D.18635;
  if (D.18637 != 0) goto <D.18638>; else goto <D.18633>;
  <D.18638>:
  iftmp.17 = aname->culture;
  goto <D.18634>;
  <D.18633>:
  iftmp.17 = "neutral";
  <D.18634>:
  D.18640 = aname->public_key_token[0];
  if (D.18640 != 0) goto <D.18641>; else goto <D.18642>;
  <D.18641>:
  iftmp.18 = &aname->public_key_token;
  goto <D.18643>;
  <D.18642>:
  iftmp.18 = "null";
  <D.18643>:
  D.18645 = aname->flags;
  D.18646 = D.18645 & 256;
  if (D.18646 != 0) goto <D.18647>; else goto <D.18648>;
  <D.18647>:
  iftmp.19 = ", Retargetable=Yes";
  goto <D.18649>;
  <D.18648>:
  iftmp.19 = "";
  <D.18649>:
  D.18623 = monoeg_g_strdup_printf ("%s%s%s, Version=%d.%d.%d.%d, Culture=%s, PublicKeyToken=%s%s", quote, D.18611, quote, D.18625, D.18627, D.18629, D.18631, iftmp.17, iftmp.18, iftmp.19);
  return D.18623;
}


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

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


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.18652;
  unsigned int D.18653;

  D.18653 = __sync_add_and_fetch_4 (val, 1);
  D.18652 = (gint32) D.18653;
  return D.18652;
}


mono_assembly_get_assemblyref (struct MonoImage * image, int index, struct MonoAssemblyName * aname)
{
  unsigned int D.18655;
  const char * hash.20;
  const char * hash.21;
  unsigned int D.18658;
  unsigned int D.18659;
  const char * D.18660;
  unsigned int D.18661;
  const char * D.18662;
  unsigned int D.18663;
  unsigned int D.18664;
  short unsigned int D.18665;
  unsigned int D.18666;
  short unsigned int D.18667;
  unsigned int D.18668;
  short unsigned int D.18669;
  unsigned int D.18670;
  short unsigned int D.18671;
  unsigned int D.18672;
  unsigned int D.18675;
  mono_byte[17] * D.18676;
  struct MonoTableInfo * t;
  guint32 cols[9];
  const char * hash;

  try
    {
      t = &image->tables[35];
      mono_metadata_decode_row (t, index, &cols, 9);
      D.18655 = cols[8];
      hash.20 = mono_metadata_blob_heap (image, D.18655);
      hash = hash.20;
      hash.21 = hash;
      D.18658 = mono_metadata_decode_blob_size (hash.21, &hash);
      aname->hash_len = D.18658;
      hash.21 = hash;
      aname->hash_value = hash.21;
      D.18659 = cols[6];
      D.18660 = mono_metadata_string_heap (image, D.18659);
      aname->name = D.18660;
      D.18661 = cols[7];
      D.18662 = mono_metadata_string_heap (image, D.18661);
      aname->culture = D.18662;
      D.18663 = cols[4];
      aname->flags = D.18663;
      D.18664 = cols[0];
      D.18665 = (short unsigned int) D.18664;
      aname->major = D.18665;
      D.18666 = cols[1];
      D.18667 = (short unsigned int) D.18666;
      aname->minor = D.18667;
      D.18668 = cols[2];
      D.18669 = (short unsigned int) D.18668;
      aname->build = D.18669;
      D.18670 = cols[3];
      D.18671 = (short unsigned int) D.18670;
      aname->revision = D.18671;
      D.18672 = cols[5];
      if (D.18672 != 0) goto <D.18673>; else goto <D.18674>;
      <D.18673>:
      {
        gchar * token;

        D.18672 = cols[5];
        D.18675 = aname->flags;
        token = assemblyref_public_tok (image, D.18672, D.18675);
        D.18676 = &aname->public_key_token;
        monoeg_g_strlcpy (D.18676, token, 17);
        monoeg_g_free (token);
      }
      goto <D.18677>;
      <D.18674>:
      D.18676 = &aname->public_key_token;
      memset (D.18676, 0, 17);
      <D.18677>:
    }
  finally
    {
      cols = {CLOBBER};
      hash = {CLOBBER};
    }
}


assemblyref_public_tok (struct MonoImage * image, guint32 key_index, guint32 flags)
{
  const char * public_tok.22;
  const gchar * public_tok.23;
  unsigned int D.18680;
  unsigned int D.18681;
  unsigned int len.24;
  gchar * D.18685;
  const gchar * public_tok;
  int len;

  try
    {
      public_tok.22 = mono_metadata_blob_heap (image, key_index);
      public_tok = public_tok.22;
      public_tok.23 = public_tok;
      D.18680 = mono_metadata_decode_blob_size (public_tok.23, &public_tok);
      len = (int) D.18680;
      D.18681 = flags & 1;
      if (D.18681 != 0) goto <D.18682>; else goto <D.18683>;
      <D.18682>:
      {
        guchar token[8];

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


mono_assembly_load_reference (struct MonoImage * image, int index)
{
  _Bool D.18691;
  long int D.18692;
  long int D.18693;
  struct MonoAssembly * * D.18696;
  <unnamed-unsigned:24> D.18699;
  int D.18700;
  int D.18701;
  unsigned int D.18702;
  unsigned int D.18703;
  void * D.18704;
  unsigned int index.25;
  unsigned int D.18706;
  struct MonoAssembly * * D.18707;
  _Bool D.18710;
  long int D.18711;
  long int D.18712;
  struct MonoAssembly * D.18719;
  int D.18721;
  int D.17270;
  int iftmp.26;
  int D.17269;
  const char[9] * D.18726;
  unsigned char D.18727;
  int D.18728;
  unsigned char D.18729;
  int D.18730;
  const unsigned char * D.18735;
  unsigned char D.18736;
  int D.18737;
  const unsigned char * D.18738;
  unsigned char D.18739;
  int D.18740;
  const unsigned char * D.18745;
  unsigned char D.18746;
  int D.18747;
  const unsigned char * D.18748;
  unsigned char D.18749;
  int D.18750;
  const unsigned char * D.18755;
  unsigned char D.18756;
  int D.18757;
  const unsigned char * D.18758;
  unsigned char D.18759;
  int D.18760;
  const char * D.18762;
  char * D.18765;
  const char * iftmp.27;
  <unnamed type> status.28;
  int * D.18781;
  int D.18782;
  const char * iftmp.29;
  char * D.18790;
  char * D.18798;
  short unsigned int D.18799;
  int D.18800;
  short unsigned int D.18801;
  int D.18802;
  short unsigned int D.18803;
  int D.18804;
  short unsigned int D.18805;
  int D.18806;
  const char * iftmp.30;
  mono_byte[17] * D.18808;
  char D.18809;
  _Bool D.18815;
  long int D.18816;
  long int D.18817;
  struct MonoAssembly * D.18822;
  const char * D.18829;
  const char * D.18830;
  int D.18831;
  _Bool D.18837;
  long int D.18838;
  long int D.18839;
  struct MonoAssembly * reference;
  struct MonoAssemblyName aname;
  MonoImageOpenStatus status;

  try
    {
      {
        int ret;

        ret = pthread_mutex_lock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.18689>; else goto <D.18690>;
        <D.18689>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.18690>:
        D.18691 = ret != 0;
        D.18692 = (long int) D.18691;
        D.18693 = __builtin_expect (D.18692, 0);
        if (D.18693 != 0) goto <D.18694>; else goto <D.18695>;
        <D.18694>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1074, "ret == 0");
        <D.18695>:
      }
      D.18696 = image->references;
      if (D.18696 == 0B) goto <D.18697>; else goto <D.18698>;
      <D.18697>:
      {
        struct MonoTableInfo * t;

        t = &image->tables[35];
        D.18699 = t->rows;
        D.18700 = (int) D.18699;
        D.18701 = D.18700 + 1;
        D.18702 = (unsigned int) D.18701;
        D.18703 = D.18702 * 4;
        D.18704 = monoeg_malloc0 (D.18703);
        image->references = D.18704;
        D.18699 = t->rows;
        D.18700 = (int) D.18699;
        image->nreferences = D.18700;
      }
      <D.18698>:
      D.18696 = image->references;
      index.25 = (unsigned int) index;
      D.18706 = index.25 * 4;
      D.18707 = D.18696 + D.18706;
      reference = *D.18707;
      {
        int ret;

        ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.18708>; else goto <D.18709>;
        <D.18708>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.18709>:
        D.18710 = ret != 0;
        D.18711 = (long int) D.18710;
        D.18712 = __builtin_expect (D.18711, 0);
        if (D.18712 != 0) goto <D.18713>; else goto <D.18714>;
        <D.18713>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1082, "ret == 0");
        <D.18714>:
      }
      if (reference != 0B) goto <D.18715>; else goto <D.18716>;
      <D.18715>:
      return;
      <D.18716>:
      mono_assembly_get_assemblyref (image, index, &aname);
      D.18719 = image->assembly;
      if (D.18719 != 0B) goto <D.18720>; else goto <D.18717>;
      <D.18720>:
      D.18719 = image->assembly;
      D.18721 = D.18719->ref_only;
      if (D.18721 != 0) goto <D.18722>; else goto <D.18717>;
      <D.18722>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname.name;
          D.18726 = "mscorlib";
          D.18727 = MEM[(const unsigned char *)D.18726];
          D.18728 = (int) D.18727;
          D.18729 = *__s2;
          D.18730 = (int) D.18729;
          __result = D.18728 - D.18730;
          {
            if (__s2_len != 0) goto <D.18731>; else goto <D.18732>;
            <D.18731>:
            if (__result == 0) goto <D.18733>; else goto <D.18734>;
            <D.18733>:
            D.18735 = &MEM[(void *)"mscorlib" + 1B];
            D.18736 = *D.18735;
            D.18737 = (int) D.18736;
            D.18738 = __s2 + 1;
            D.18739 = *D.18738;
            D.18740 = (int) D.18739;
            __result = D.18737 - D.18740;
            if (__s2_len > 1) goto <D.18741>; else goto <D.18742>;
            <D.18741>:
            if (__result == 0) goto <D.18743>; else goto <D.18744>;
            <D.18743>:
            D.18745 = &MEM[(void *)"mscorlib" + 2B];
            D.18746 = *D.18745;
            D.18747 = (int) D.18746;
            D.18748 = __s2 + 2;
            D.18749 = *D.18748;
            D.18750 = (int) D.18749;
            __result = D.18747 - D.18750;
            if (__s2_len > 2) goto <D.18751>; else goto <D.18752>;
            <D.18751>:
            if (__result == 0) goto <D.18753>; else goto <D.18754>;
            <D.18753>:
            D.18755 = &MEM[(void *)"mscorlib" + 3B];
            D.18756 = *D.18755;
            D.18757 = (int) D.18756;
            D.18758 = __s2 + 3;
            D.18759 = *D.18758;
            D.18760 = (int) D.18759;
            __result = D.18757 - D.18760;
            <D.18754>:
            <D.18752>:
            <D.18744>:
            <D.18742>:
            <D.18734>:
            <D.18732>:
          }
          D.17269 = __result;
        }
        iftmp.26 = -D.17269;
        goto <D.18761>;
        <D.18725>:
        D.18762 = aname.name;
        iftmp.26 = __builtin_strcmp (D.18762, "mscorlib");
        <D.18761>:
        D.17270 = iftmp.26;
      }
      if (D.17270 == 0) goto <D.18763>; else goto <D.18764>;
      <D.18763>:
      D.18719 = image->assembly;
      D.18765 = D.18719->basedir;
      reference = mono_assembly_load_full (&aname, D.18765, &status, 0);
      goto <D.18766>;
      <D.18764>:
      reference = mono_assembly_loaded_full (&aname, 1);
      if (reference == 0B) goto <D.18767>; else goto <D.18768>;
      <D.18767>:
      reference = mono_assembly_invoke_search_hook_internal (&aname, 1, 1);
      <D.18768>:
      <D.18766>:
      if (reference == 0B) goto <D.18769>; else goto <D.18770>;
      <D.18769>:
      reference = 4294967295B;
      <D.18770>:
      goto <D.18718>;
      <D.18717>:
      D.18719 = image->assembly;
      if (D.18719 != 0B) goto <D.18772>; else goto <D.18773>;
      <D.18772>:
      D.18719 = image->assembly;
      iftmp.27 = D.18719->basedir;
      goto <D.18774>;
      <D.18773>:
      iftmp.27 = 0B;
      <D.18774>:
      reference = mono_assembly_load (&aname, iftmp.27, &status);
      <D.18718>:
      if (reference == 0B) goto <D.18775>; else goto <D.18776>;
      <D.18775>:
      {
        char * extra_msg;

        status.28 = status;
        if (status.28 == 1) goto <D.18780>; else goto <D.18777>;
        <D.18780>:
        D.18781 = __errno_location ();
        D.18782 = *D.18781;
        if (D.18782 == 2) goto <D.18783>; else goto <D.18777>;
        <D.18783>:
        D.18719 = image->assembly;
        if (D.18719 != 0B) goto <D.18785>; else goto <D.18786>;
        <D.18785>:
        D.18719 = image->assembly;
        iftmp.29 = D.18719->basedir;
        goto <D.18787>;
        <D.18786>:
        iftmp.29 = "";
        <D.18787>:
        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.29);
        goto <D.18778>;
        <D.18777>:
        status.28 = status;
        if (status.28 == 1) goto <D.18788>; else goto <D.18789>;
        <D.18788>:
        D.18781 = __errno_location ();
        D.18782 = *D.18781;
        D.18790 = strerror (D.18782);
        extra_msg = monoeg_g_strdup_printf ("System error: %s\n", D.18790);
        goto <D.18791>;
        <D.18789>:
        status.28 = status;
        if (status.28 == 2) goto <D.18792>; else goto <D.18793>;
        <D.18792>:
        extra_msg = monoeg_strdup ("Cannot find an assembly referenced from this one.\n");
        goto <D.18794>;
        <D.18793>:
        status.28 = status;
        if (status.28 == 3) goto <D.18795>; else goto <D.18796>;
        <D.18795>:
        extra_msg = monoeg_strdup ("The file exists but is not a valid assembly.\n");
        goto <D.18797>;
        <D.18796>:
        extra_msg = monoeg_strdup ("");
        <D.18797>:
        <D.18794>:
        <D.18791>:
        <D.18778>:
        D.18798 = image->name;
        D.18762 = aname.name;
        D.18799 = aname.major;
        D.18800 = (int) D.18799;
        D.18801 = aname.minor;
        D.18802 = (int) D.18801;
        D.18803 = aname.build;
        D.18804 = (int) D.18803;
        D.18805 = aname.revision;
        D.18806 = (int) D.18805;
        D.18808 = &aname.public_key_token;
        D.18809 = MEM[(const char *)D.18808];
        if (D.18809 != 0) goto <D.18810>; else goto <D.18811>;
        <D.18810>:
        iftmp.30 = &aname.public_key_token;
        goto <D.18812>;
        <D.18811>:
        iftmp.30 = "(none)";
        <D.18812>:
        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.18798, D.18762, index, D.18800, D.18802, D.18804, D.18806, iftmp.30, extra_msg);
        monoeg_g_free (extra_msg);
      }
      <D.18776>:
      {
        int ret;

        ret = pthread_mutex_lock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.18813>; else goto <D.18814>;
        <D.18813>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.18814>:
        D.18815 = ret != 0;
        D.18816 = (long int) D.18815;
        D.18817 = __builtin_expect (D.18816, 0);
        if (D.18817 != 0) goto <D.18818>; else goto <D.18819>;
        <D.18818>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1133, "ret == 0");
        <D.18819>:
      }
      if (reference == 0B) goto <D.18820>; else goto <D.18821>;
      <D.18820>:
      reference = 4294967295B;
      <D.18821>:
      D.18696 = image->references;
      index.25 = (unsigned int) index;
      D.18706 = index.25 * 4;
      D.18707 = D.18696 + D.18706;
      D.18822 = *D.18707;
      if (D.18822 == 0B) goto <D.18823>; else goto <D.18824>;
      <D.18823>:
      if (reference != 4294967295B) goto <D.18825>; else goto <D.18826>;
      <D.18825>:
      mono_assembly_addref (reference);
      D.18719 = image->assembly;
      if (D.18719 != 0B) goto <D.18827>; else goto <D.18828>;
      <D.18827>:
      D.18719 = image->assembly;
      D.18829 = D.18719->aname.name;
      D.18719 = image->assembly;
      D.18830 = reference->aname.name;
      D.18831 = reference->ref_count;
      mono_trace (64, 1, "Assembly Ref addref %s[%p] -> %s[%p]: %d", D.18829, D.18719, D.18830, reference, D.18831);
      <D.18828>:
      goto <D.18832>;
      <D.18826>:
      D.18719 = image->assembly;
      if (D.18719 != 0B) goto <D.18833>; else goto <D.18834>;
      <D.18833>:
      D.18719 = image->assembly;
      D.18829 = D.18719->aname.name;
      D.18719 = image->assembly;
      mono_trace (64, 1, "Failed to load assembly %s[%p]\n", D.18829, D.18719);
      <D.18834>:
      <D.18832>:
      D.18696 = image->references;
      index.25 = (unsigned int) index;
      D.18706 = index.25 * 4;
      D.18707 = D.18696 + D.18706;
      *D.18707 = reference;
      <D.18824>:
      {
        int ret;

        ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
        if (ret != 0) goto <D.18835>; else goto <D.18836>;
        <D.18835>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.18836>:
        D.18837 = ret != 0;
        D.18838 = (long int) D.18837;
        D.18839 = __builtin_expect (D.18838, 0);
        if (D.18839 != 0) goto <D.18840>; else goto <D.18841>;
        <D.18840>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1153, "ret == 0");
        <D.18841>:
      }
      D.18696 = image->references;
      index.25 = (unsigned int) index;
      D.18706 = index.25 * 4;
      D.18707 = D.18696 + D.18706;
      D.18822 = *D.18707;
      if (D.18822 != reference) goto <D.18842>; else goto <D.18843>;
      <D.18842>:
      mono_assembly_close (reference);
      <D.18843>:
    }
  finally
    {
      aname = {CLOBBER};
      status = {CLOBBER};
    }
}


mono_assembly_invoke_search_hook_internal (struct MonoAssemblyName * aname, gboolean refonly, gboolean postload)
{
  int D.18847;
  int D.18850;
  struct MonoAssembly * (*<Te83>) (struct MonoAssemblyName *, void *) D.18853;
  void * D.18854;
  struct MonoAssembly * D.18857;
  struct AssemblySearchHook * hook;

  hook = assembly_search_hook;
  goto <D.17320>;
  <D.17319>:
  D.18847 = hook->refonly;
  if (D.18847 == refonly) goto <D.18848>; else goto <D.18849>;
  <D.18848>:
  D.18850 = hook->postload;
  if (D.18850 == postload) goto <D.18851>; else goto <D.18852>;
  <D.18851>:
  {
    struct MonoAssembly * ass;

    D.18853 = hook->func;
    D.18854 = hook->user_data;
    ass = D.18853 (aname, D.18854);
    if (ass != 0B) goto <D.18855>; else goto <D.18856>;
    <D.18855>:
    D.18857 = ass;
    return D.18857;
    <D.18856>:
  }
  <D.18852>:
  <D.18849>:
  hook = hook->next;
  <D.17320>:
  if (hook != 0B) goto <D.17319>; else goto <D.17321>;
  <D.17321>:
  D.18857 = 0B;
  return D.18857;
}


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


mono_assembly_invoke_load_hook (struct MonoAssembly * ass)
{
  void (*<Te7c>) (struct MonoAssembly *, void *) D.18859;
  void * D.18860;
  struct AssemblyLoadHook * hook;

  hook = assembly_load_hook;
  goto <D.17289>;
  <D.17288>:
  D.18859 = hook->func;
  D.18860 = hook->user_data;
  D.18859 (ass, D.18860);
  hook = hook->next;
  <D.17289>:
  if (hook != 0B) goto <D.17288>; else goto <D.17290>;
  <D.17290>:
}


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

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


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

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


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.32;
  struct AssemblySearchHook * hook;

  if (func == 0B) goto <D.18867>; else goto <D.18868>;
  <D.18867>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1250, "func != NULL");
  return;
  <D.18868>:
  hook = monoeg_malloc0 (20);
  hook->func = func;
  hook->user_data = user_data;
  hook->refonly = refonly;
  hook->postload = postload;
  assembly_search_hook.32 = assembly_search_hook;
  hook->next = assembly_search_hook.32;
  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.33;
  struct AssemblyPreLoadHook * hook;

  if (func == 0B) goto <D.18871>; else goto <D.18872>;
  <D.18871>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1341, "func != NULL");
  return;
  <D.18872>:
  hook = monoeg_malloc0 (12);
  hook->func = func;
  hook->user_data = user_data;
  assembly_preload_hook.33 = assembly_preload_hook;
  hook->next = assembly_preload_hook.33;
  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.34;
  struct AssemblyPreLoadHook * hook;

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


mono_assembly_open_from_bundle (const char * filename, MonoImageOpenStatus * status, gboolean refonly)
{
  const struct MonoBundledAssembly * * bundles.35;
  struct MonoImage * D.18882;
  _Bool D.18885;
  long int D.18886;
  long int D.18887;
  int D.17456;
  unsigned int i.36;
  unsigned int D.18891;
  const struct MonoBundledAssembly * * D.18892;
  const struct MonoBundledAssembly * D.18893;
  const char * D.18894;
  const unsigned char * D.18897;
  unsigned int D.18898;
  _Bool D.18902;
  long int D.18903;
  long int D.18904;
  int i;
  char * name;
  struct MonoImage * image;

  image = 0B;
  bundles.35 = bundles;
  if (bundles.35 == 0B) goto <D.18880>; else goto <D.18881>;
  <D.18880>:
  D.18882 = 0B;
  return D.18882;
  <D.18881>:
  name = monoeg_g_path_get_basename (filename);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.18883>; else goto <D.18884>;
    <D.18883>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.18884>:
    D.18885 = ret != 0;
    D.18886 = (long int) D.18885;
    D.18887 = __builtin_expect (D.18886, 0);
    if (D.18887 != 0) goto <D.18888>; else goto <D.18889>;
    <D.18888>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1466, "ret == 0");
    <D.18889>:
  }
  i = 0;
  goto <D.17459>;
  <D.17458>:
  {
    size_t __s1_len;
    size_t __s2_len;

    bundles.35 = bundles;
    i.36 = (unsigned int) i;
    D.18891 = i.36 * 4;
    D.18892 = bundles.35 + D.18891;
    D.18893 = *D.18892;
    D.18894 = D.18893->name;
    D.17456 = __builtin_strcmp (D.18894, name);
  }
  if (D.17456 == 0) goto <D.18895>; else goto <D.18896>;
  <D.18895>:
  bundles.35 = bundles;
  i.36 = (unsigned int) i;
  D.18891 = i.36 * 4;
  D.18892 = bundles.35 + D.18891;
  D.18893 = *D.18892;
  D.18897 = D.18893->data;
  bundles.35 = bundles;
  i.36 = (unsigned int) i;
  D.18891 = i.36 * 4;
  D.18892 = bundles.35 + D.18891;
  D.18893 = *D.18892;
  D.18898 = D.18893->size;
  image = mono_image_open_from_data_with_name (D.18897, D.18898, 0, status, refonly, name);
  goto <D.17457>;
  <D.18896>:
  i = i + 1;
  <D.17459>:
  if (image == 0B) goto <D.18899>; else goto <D.17457>;
  <D.18899>:
  bundles.35 = bundles;
  i.36 = (unsigned int) i;
  D.18891 = i.36 * 4;
  D.18892 = bundles.35 + D.18891;
  D.18893 = *D.18892;
  if (D.18893 != 0B) goto <D.17458>; else goto <D.17457>;
  <D.17457>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.18900>; else goto <D.18901>;
    <D.18900>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.18901>:
    D.18902 = ret != 0;
    D.18903 = (long int) D.18902;
    D.18904 = __builtin_expect (D.18903, 0);
    if (D.18904 != 0) goto <D.18905>; else goto <D.18906>;
    <D.18905>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1473, "ret == 0");
    <D.18906>:
  }
  monoeg_g_free (name);
  if (image != 0B) goto <D.18907>; else goto <D.18908>;
  <D.18907>:
  mono_image_addref (image);
  D.18882 = image;
  return D.18882;
  <D.18908>:
  D.18882 = 0B;
  return D.18882;
}


mono_assembly_open_full (const char * filename, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoAssembly * D.18912;
  int D.18915;
  gchar * D.18918;
  char D.18919;
  struct GError * error.37;
  gchar * D.18927;
  unsigned char D.18929;
  const struct MonoBundledAssembly * * bundles.38;
  <unnamed type> D.18943;
  struct MonoAssembly * D.18946;
  struct MonoImage * D.18953;
  struct MonoImage * image;
  struct MonoAssembly * ass;
  MonoImageOpenStatus def_status;
  gchar * fname;
  gchar * new_fname;

  try
    {
      if (filename == 0B) goto <D.18910>; else goto <D.18911>;
      <D.18910>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 1491, "filename != NULL");
      D.18912 = 0B;
      return D.18912;
      <D.18911>:
      if (status == 0B) goto <D.18913>; else goto <D.18914>;
      <D.18913>:
      status = &def_status;
      <D.18914>:
      *status = 0;
      D.18915 = strncmp (filename, "file://", 7);
      if (D.18915 == 0) goto <D.18916>; else goto <D.18917>;
      <D.18916>:
      {
        struct GError * error;
        gchar * uri;
        gchar * tmpuri;

        try
          {
            error = 0B;
            uri = filename;
            D.18918 = uri + 7;
            D.18919 = *D.18918;
            if (D.18919 != 47) goto <D.18920>; else goto <D.18921>;
            <D.18920>:
            D.18918 = uri + 7;
            uri = monoeg_g_strdup_printf ("file:///%s", D.18918);
            <D.18921>:
            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.18922>; else goto <D.18923>;
            <D.18922>:
            monoeg_g_free (tmpuri);
            <D.18923>:
            error.37 = error;
            if (error.37 != 0B) goto <D.18925>; else goto <D.18926>;
            <D.18925>:
            error.37 = error;
            D.18927 = error.37->message;
            monoeg_g_log (0B, 16, "%s\n", D.18927);
            error.37 = error;
            monoeg_g_error_free (error.37);
            fname = monoeg_strdup (filename);
            <D.18926>:
          }
        finally
          {
            error = {CLOBBER};
          }
      }
      goto <D.18928>;
      <D.18917>:
      fname = monoeg_strdup (filename);
      <D.18928>:
      mono_trace (64, 1, "Assembly Loader probing location: \'%s\'.", fname);
      new_fname = 0B;
      D.18929 = mono_assembly_is_in_gac (fname);
      if (D.18929 == 0) goto <D.18930>; else goto <D.18931>;
      <D.18930>:
      new_fname = mono_make_shadow_copy (fname);
      <D.18931>:
      if (new_fname != 0B) goto <D.18932>; else goto <D.18933>;
      <D.18932>:
      if (new_fname != fname) goto <D.18934>; else goto <D.18935>;
      <D.18934>:
      monoeg_g_free (fname);
      fname = new_fname;
      mono_trace (64, 1, "Assembly Loader shadow-copied assembly to: \'%s\'.", fname);
      <D.18935>:
      <D.18933>:
      image = 0B;
      bundles.38 = bundles;
      if (bundles.38 != 0B) goto <D.18937>; else goto <D.18938>;
      <D.18937>:
      image = mono_assembly_open_from_bundle (fname, status, refonly);
      <D.18938>:
      if (image == 0B) goto <D.18939>; else goto <D.18940>;
      <D.18939>:
      image = mono_image_open_full (fname, status, refonly);
      <D.18940>:
      if (image == 0B) goto <D.18941>; else goto <D.18942>;
      <D.18941>:
      D.18943 = *status;
      if (D.18943 == 0) goto <D.18944>; else goto <D.18945>;
      <D.18944>:
      *status = 1;
      <D.18945>:
      monoeg_g_free (fname);
      D.18912 = 0B;
      return D.18912;
      <D.18942>:
      D.18946 = image->assembly;
      if (D.18946 != 0B) goto <D.18947>; else goto <D.18948>;
      <D.18947>:
      D.18946 = image->assembly;
      mono_assembly_invoke_load_hook (D.18946);
      mono_image_close (image);
      monoeg_g_free (fname);
      D.18912 = image->assembly;
      return D.18912;
      <D.18948>:
      ass = mono_assembly_load_from_full (image, fname, status, refonly);
      if (ass != 0B) goto <D.18949>; else goto <D.18950>;
      <D.18949>:
      mono_trace (64, 1, "Assembly Loader loaded assembly from location: \'%s\'.", filename);
      if (refonly == 0) goto <D.18951>; else goto <D.18952>;
      <D.18951>:
      D.18953 = ass->image;
      mono_config_for_assembly (D.18953);
      <D.18952>:
      <D.18950>:
      mono_image_close (image);
      monoeg_g_free (fname);
      D.18912 = ass;
      return D.18912;
    }
  finally
    {
      def_status = {CLOBBER};
    }
}


mono_assembly_is_in_gac (const gchar * filename)
{
  MonoBoolean D.18958;
  gchar * D.18959;
  char * D.18960;
  unsigned int D.18963;
  char D.18964;
  int D.18967;
  int D.18972;
  int D.18977;
  char * D.18983;
  unsigned int D.18986;
  int D.18989;
  int D.18994;
  const gchar * rootdir;
  gchar * gp;
  gchar * * paths;

  if (filename == 0B) goto <D.18956>; else goto <D.18957>;
  <D.18956>:
  D.18958 = 0;
  return D.18958;
  <D.18957>:
  paths = extra_gac_paths;
  goto <D.17764>;
  <D.17763>:
  D.18959 = *paths;
  D.18960 = strstr (D.18959, filename);
  D.18959 = *paths;
  if (D.18960 != D.18959) goto <D.18961>; else goto <D.18962>;
  <D.18961>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18962>:
  D.18959 = *paths;
  D.18963 = strlen (D.18959);
  gp = filename + D.18963;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18965>; else goto <D.18966>;
  <D.18965>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18966>:
  gp = gp + 1;
  D.18967 = strncmp (gp, "lib", 3);
  if (D.18967 != 0) goto <D.18968>; else goto <D.18969>;
  <D.18968>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18969>:
  gp = gp + 3;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18970>; else goto <D.18971>;
  <D.18970>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18971>:
  gp = gp + 1;
  D.18972 = strncmp (gp, "mono", 4);
  if (D.18972 != 0) goto <D.18973>; else goto <D.18974>;
  <D.18973>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18974>:
  gp = gp + 4;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18975>; else goto <D.18976>;
  <D.18975>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18976>:
  gp = gp + 1;
  D.18977 = strncmp (gp, "gac", 3);
  if (D.18977 != 0) goto <D.18978>; else goto <D.18979>;
  <D.18978>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18979>:
  gp = gp + 3;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18980>; else goto <D.18981>;
  <D.18980>:
  // predicted unlikely by continue predictor.
  goto <D.17735>;
  <D.18981>:
  D.18958 = 1;
  return D.18958;
  <D.17735>:
  paths = paths + 4;
  <D.17764>:
  if (paths != 0B) goto <D.18982>; else goto <D.17765>;
  <D.18982>:
  D.18959 = *paths;
  if (D.18959 != 0B) goto <D.17763>; else goto <D.17765>;
  <D.17765>:
  rootdir = mono_assembly_getrootdir ();
  D.18983 = strstr (filename, rootdir);
  if (D.18983 != filename) goto <D.18984>; else goto <D.18985>;
  <D.18984>:
  D.18958 = 0;
  return D.18958;
  <D.18985>:
  D.18986 = strlen (rootdir);
  gp = filename + D.18986;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18987>; else goto <D.18988>;
  <D.18987>:
  D.18958 = 0;
  return D.18958;
  <D.18988>:
  gp = gp + 1;
  D.18989 = strncmp (gp, "mono", 4);
  if (D.18989 != 0) goto <D.18990>; else goto <D.18991>;
  <D.18990>:
  D.18958 = 0;
  return D.18958;
  <D.18991>:
  gp = gp + 4;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18992>; else goto <D.18993>;
  <D.18992>:
  D.18958 = 0;
  return D.18958;
  <D.18993>:
  gp = gp + 1;
  D.18994 = strncmp (gp, "gac", 3);
  if (D.18994 != 0) goto <D.18995>; else goto <D.18996>;
  <D.18995>:
  D.18958 = 0;
  return D.18958;
  <D.18996>:
  gp = gp + 3;
  D.18964 = *gp;
  if (D.18964 != 47) goto <D.18997>; else goto <D.18998>;
  <D.18997>:
  D.18958 = 0;
  return D.18958;
  <D.18998>:
  D.18958 = 1;
  return D.18958;
}


mono_assembly_load_friends (struct MonoAssembly * ass)
{
  unsigned char D.19000;
  _Bool D.19007;
  long int D.19008;
  long int D.19009;
  _Bool D.19014;
  long int D.19015;
  long int D.19016;
  _Bool D.19021;
  long int D.19022;
  long int D.19023;
  _Bool D.19030;
  long int D.19031;
  long int D.19032;
  _Bool D.19037;
  long int D.19038;
  long int D.19039;
  struct MonoMethod * D.19044;
  struct MonoClass * D.19046;
  struct MonoClass * D.19047;
  unsigned int D.19048;
  const mono_byte * data.39;
  const gchar * data.40;
  char D.19055;
  const gchar * D.19057;
  char D.19058;
  const gchar * D.19060;
  char D.19061;
  int D.19062;
  int D.19063;
  const char * D.19064;
  int D.19065;
  int D.19069;
  _Bool D.19072;
  long int D.19073;
  long int D.19074;
  _Bool D.19081;
  long int D.19082;
  long int D.19083;
  _Bool D.19088;
  long int D.19089;
  long int D.19090;
  int i;
  struct MonoCustomAttrInfo * attrs;
  struct GSList * list;

  D.19000 = ass->friend_assembly_names_inited;
  if (D.19000 != 0) goto <D.19001>; else goto <D.19002>;
  <D.19001>:
  return;
  <D.19002>:
  attrs = mono_custom_attrs_from_assembly (ass);
  if (attrs == 0B) goto <D.19003>; else goto <D.19004>;
  <D.19003>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19005>; else goto <D.19006>;
    <D.19005>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19006>:
    D.19007 = ret != 0;
    D.19008 = (long int) D.19007;
    D.19009 = __builtin_expect (D.19008, 0);
    if (D.19009 != 0) goto <D.19010>; else goto <D.19011>;
    <D.19010>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1611, "ret == 0");
    <D.19011>:
  }
  ass->friend_assembly_names_inited = 1;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19012>; else goto <D.19013>;
    <D.19012>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19013>:
    D.19014 = ret != 0;
    D.19015 = (long int) D.19014;
    D.19016 = __builtin_expect (D.19015, 0);
    if (D.19016 != 0) goto <D.19017>; else goto <D.19018>;
    <D.19017>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1613, "ret == 0");
    <D.19018>:
  }
  return;
  <D.19004>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19019>; else goto <D.19020>;
    <D.19019>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19020>:
    D.19021 = ret != 0;
    D.19022 = (long int) D.19021;
    D.19023 = __builtin_expect (D.19022, 0);
    if (D.19023 != 0) goto <D.19024>; else goto <D.19025>;
    <D.19024>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1617, "ret == 0");
    <D.19025>:
  }
  D.19000 = ass->friend_assembly_names_inited;
  if (D.19000 != 0) goto <D.19026>; else goto <D.19027>;
  <D.19026>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19028>; else goto <D.19029>;
    <D.19028>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19029>:
    D.19030 = ret != 0;
    D.19031 = (long int) D.19030;
    D.19032 = __builtin_expect (D.19031, 0);
    if (D.19032 != 0) goto <D.19033>; else goto <D.19034>;
    <D.19033>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1619, "ret == 0");
    <D.19034>:
  }
  return;
  <D.19027>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19035>; else goto <D.19036>;
    <D.19035>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19036>:
    D.19037 = ret != 0;
    D.19038 = (long int) D.19037;
    D.19039 = __builtin_expect (D.19038, 0);
    if (D.19039 != 0) goto <D.19040>; else goto <D.19041>;
    <D.19040>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1622, "ret == 0");
    <D.19041>:
  }
  list = 0B;
  i = 0;
  goto <D.17504>;
  <D.17503>:
  {
    struct MonoCustomAttrEntry * attr;
    struct MonoAssemblyName * aname;
    const gchar * data;
    guint slen;

    try
      {
        attr = &attrs->attrs[i];
        D.19044 = attr->ctor;
        if (D.19044 == 0B) goto <D.19042>; else goto <D.19045>;
        <D.19045>:
        D.19044 = attr->ctor;
        D.19046 = D.19044->klass;
        D.19047 = mono_defaults.internals_visible_class;
        if (D.19046 != D.19047) goto <D.19042>; else goto <D.19043>;
        <D.19042>:
        // predicted unlikely by continue predictor.
        goto <D.17502>;
        <D.19043>:
        D.19048 = attr->data_size;
        if (D.19048 <= 3) goto <D.19049>; else goto <D.19050>;
        <D.19049>:
        // predicted unlikely by continue predictor.
        goto <D.17502>;
        <D.19050>:
        data.39 = attr->data;
        data = data.39;
        data.40 = data;
        D.19055 = *data.40;
        if (D.19055 != 1) goto <D.19052>; else goto <D.19056>;
        <D.19056>:
        data.40 = data;
        D.19057 = data.40 + 1;
        D.19058 = *D.19057;
        if (D.19058 != 0) goto <D.19052>; else goto <D.19059>;
        <D.19059>:
        data.40 = data;
        D.19060 = data.40 + 2;
        D.19061 = *D.19060;
        D.19062 = (int) D.19061;
        D.19063 = D.19062 & 255;
        if (D.19063 == 255) goto <D.19052>; else goto <D.19053>;
        <D.19052>:
        // predicted unlikely by continue predictor.
        goto <D.17502>;
        <D.19053>:
        data.40 = data;
        D.19064 = data.40 + 2;
        slen = mono_metadata_decode_value (D.19064, &data);
        aname = monoeg_malloc0 (60);
        data.40 = data;
        D.19065 = mono_assembly_name_parse_full (data.40, aname, 1, 0B, 0B);
        if (D.19065 != 0) goto <D.19066>; else goto <D.19067>;
        <D.19066>:
        list = monoeg_g_slist_prepend (list, aname);
        goto <D.19068>;
        <D.19067>:
        monoeg_g_free (aname);
        <D.19068>:
      }
    finally
      {
        data = {CLOBBER};
      }
  }
  <D.17502>:
  i = i + 1;
  <D.17504>:
  D.19069 = attrs->num_attrs;
  if (D.19069 > i) goto <D.17503>; else goto <D.17505>;
  <D.17505>:
  mono_custom_attrs_free (attrs);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19070>; else goto <D.19071>;
    <D.19070>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19071>:
    D.19072 = ret != 0;
    D.19073 = (long int) D.19072;
    D.19074 = __builtin_expect (D.19073, 0);
    if (D.19074 != 0) goto <D.19075>; else goto <D.19076>;
    <D.19075>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1654, "ret == 0");
    <D.19076>:
  }
  D.19000 = ass->friend_assembly_names_inited;
  if (D.19000 != 0) goto <D.19077>; else goto <D.19078>;
  <D.19077>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19079>; else goto <D.19080>;
    <D.19079>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19080>:
    D.19081 = ret != 0;
    D.19082 = (long int) D.19081;
    D.19083 = __builtin_expect (D.19082, 0);
    if (D.19083 != 0) goto <D.19084>; else goto <D.19085>;
    <D.19084>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1656, "ret == 0");
    <D.19085>:
  }
  monoeg_g_slist_foreach (list, free_item, 0B);
  monoeg_g_slist_free (list);
  return;
  <D.19078>:
  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.19086>; else goto <D.19087>;
    <D.19086>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19087>:
    D.19088 = ret != 0;
    D.19089 = (long int) D.19088;
    D.19090 = __builtin_expect (D.19089, 0);
    if (D.19090 != 0) goto <D.19091>; else goto <D.19092>;
    <D.19091>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1666, "ret == 0");
    <D.19092>:
  }
}


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.19096;

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


mono_assembly_load_from_full (struct MonoImage * image, const char * fname, MonoImageOpenStatus * status, gboolean refonly)
{
  unsigned int D.19098;
  unsigned int D.19099;
  struct MonoAssembly * D.19102;
  struct MonoAssemblyName * D.19103;
  struct MonoImage * D.19104;
  int D.17530;
  int iftmp.41;
  int D.17529;
  const char[9] * D.19110;
  unsigned char D.19111;
  int D.19112;
  unsigned char D.19113;
  int D.19114;
  const unsigned char * D.19119;
  unsigned char D.19120;
  int D.19121;
  const unsigned char * D.19122;
  unsigned char D.19123;
  int D.19124;
  const unsigned char * D.19129;
  unsigned char D.19130;
  int D.19131;
  const unsigned char * D.19132;
  unsigned char D.19133;
  int D.19134;
  const unsigned char * D.19139;
  unsigned char D.19140;
  int D.19141;
  const unsigned char * D.19142;
  unsigned char D.19143;
  int D.19144;
  const char * D.19146;
  char * D.19149;
  int D.19150;
  _Bool D.19157;
  long int D.19158;
  long int D.19159;
  struct MonoAssembly * D.19162;
  _Bool D.19167;
  long int D.19168;
  long int D.19169;
  struct GList * loaded_assemblies.42;
  struct GList * loaded_assemblies.43;
  _Bool D.19176;
  long int D.19177;
  long int D.19178;
  struct MonoAssembly * ass;
  struct MonoAssembly * ass2;
  char * base_dir;

  D.19098 = BIT_FIELD_REF <*image, 32, 3904>;
  D.19099 = D.19098 & 16777215;
  if (D.19099 == 0) goto <D.19100>; else goto <D.19101>;
  <D.19100>:
  *status = 3;
  D.19102 = 0B;
  return D.19102;
  <D.19101>:
  base_dir = absolute_dir (fname);
  ass = monoeg_malloc0 (92);
  ass->basedir = base_dir;
  ass->ref_only = refonly;
  ass->image = image;
  mono_profiler_assembly_event (ass, 0);
  D.19103 = &ass->aname;
  mono_assembly_fill_assembly_name (image, D.19103);
  D.19104 = mono_defaults.corlib;
  if (D.19104 != 0B) goto <D.19105>; else goto <D.19106>;
  <D.19105>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = ass->aname.name;
      D.19110 = "mscorlib";
      D.19111 = MEM[(const unsigned char *)D.19110];
      D.19112 = (int) D.19111;
      D.19113 = *__s2;
      D.19114 = (int) D.19113;
      __result = D.19112 - D.19114;
      {
        if (__s2_len != 0) goto <D.19115>; else goto <D.19116>;
        <D.19115>:
        if (__result == 0) goto <D.19117>; else goto <D.19118>;
        <D.19117>:
        D.19119 = &MEM[(void *)"mscorlib" + 1B];
        D.19120 = *D.19119;
        D.19121 = (int) D.19120;
        D.19122 = __s2 + 1;
        D.19123 = *D.19122;
        D.19124 = (int) D.19123;
        __result = D.19121 - D.19124;
        if (__s2_len > 1) goto <D.19125>; else goto <D.19126>;
        <D.19125>:
        if (__result == 0) goto <D.19127>; else goto <D.19128>;
        <D.19127>:
        D.19129 = &MEM[(void *)"mscorlib" + 2B];
        D.19130 = *D.19129;
        D.19131 = (int) D.19130;
        D.19132 = __s2 + 2;
        D.19133 = *D.19132;
        D.19134 = (int) D.19133;
        __result = D.19131 - D.19134;
        if (__s2_len > 2) goto <D.19135>; else goto <D.19136>;
        <D.19135>:
        if (__result == 0) goto <D.19137>; else goto <D.19138>;
        <D.19137>:
        D.19139 = &MEM[(void *)"mscorlib" + 3B];
        D.19140 = *D.19139;
        D.19141 = (int) D.19140;
        D.19142 = __s2 + 3;
        D.19143 = *D.19142;
        D.19144 = (int) D.19143;
        __result = D.19141 - D.19144;
        <D.19138>:
        <D.19136>:
        <D.19128>:
        <D.19126>:
        <D.19118>:
        <D.19116>:
      }
      D.17529 = __result;
    }
    iftmp.41 = -D.17529;
    goto <D.19145>;
    <D.19109>:
    D.19146 = ass->aname.name;
    iftmp.41 = __builtin_strcmp (D.19146, "mscorlib");
    <D.19145>:
    D.17530 = iftmp.41;
  }
  if (D.17530 == 0) goto <D.19147>; else goto <D.19148>;
  <D.19147>:
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  D.19104 = mono_defaults.corlib;
  mono_image_addref (D.19104);
  *status = 0;
  D.19104 = mono_defaults.corlib;
  D.19102 = D.19104->assembly;
  return D.19102;
  <D.19148>:
  <D.19106>:
  mono_image_addref (image);
  D.19146 = ass->aname.name;
  D.19149 = image->name;
  D.19150 = image->ref_count;
  mono_trace (64, 1, "Image addref %s[%p] -> %s[%p]: %d", D.19146, ass, D.19149, image, D.19150);
  D.19146 = ass->aname.name;
  if (D.19146 != 0B) goto <D.19151>; else goto <D.19152>;
  <D.19151>:
  D.19103 = &ass->aname;
  ass2 = mono_assembly_invoke_search_hook_internal (D.19103, refonly, 0);
  if (ass2 != 0B) goto <D.19153>; else goto <D.19154>;
  <D.19153>:
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  mono_image_close (image);
  *status = 0;
  D.19102 = ass2;
  return D.19102;
  <D.19154>:
  <D.19152>:
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19155>; else goto <D.19156>;
    <D.19155>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19156>:
    D.19157 = ret != 0;
    D.19158 = (long int) D.19157;
    D.19159 = __builtin_expect (D.19158, 0);
    if (D.19159 != 0) goto <D.19160>; else goto <D.19161>;
    <D.19160>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1759, "ret == 0");
    <D.19161>:
  }
  D.19162 = image->assembly;
  if (D.19162 != 0B) goto <D.19163>; else goto <D.19164>;
  <D.19163>:
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19165>; else goto <D.19166>;
    <D.19165>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19166>:
    D.19167 = ret != 0;
    D.19168 = (long int) D.19167;
    D.19169 = __builtin_expect (D.19168, 0);
    if (D.19169 != 0) goto <D.19170>; else goto <D.19171>;
    <D.19170>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1766, "ret == 0");
    <D.19171>:
  }
  ass2 = image->assembly;
  monoeg_g_free (ass);
  monoeg_g_free (base_dir);
  mono_image_close (image);
  *status = 0;
  D.19102 = ass2;
  return D.19102;
  <D.19164>:
  image->assembly = ass;
  loaded_assemblies.42 = loaded_assemblies;
  loaded_assemblies.43 = monoeg_g_list_prepend (loaded_assemblies.42, ass);
  loaded_assemblies = loaded_assemblies.43;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.19174>; else goto <D.19175>;
    <D.19174>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19175>:
    D.19176 = ret != 0;
    D.19177 = (long int) D.19176;
    D.19178 = __builtin_expect (D.19177, 0);
    if (D.19178 != 0) goto <D.19179>; else goto <D.19180>;
    <D.19179>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 1778, "ret == 0");
    <D.19180>:
  }
  mono_assembly_invoke_load_hook (ass);
  mono_profiler_assembly_loaded (ass, 0);
  D.19102 = ass;
  return D.19102;
}


absolute_dir (const gchar * filename)
{
  int D.19182;
  gchar * D.19185;
  int D.17422;
  int iftmp.44;
  int D.17421;
  const char[2] * D.19189;
  unsigned char D.19190;
  int D.19191;
  unsigned char D.19192;
  int D.19193;
  const unsigned char * D.19198;
  unsigned char D.19199;
  int D.19200;
  const unsigned char * D.19201;
  unsigned char D.19202;
  int D.19203;
  const unsigned char * D.19208;
  unsigned char D.19209;
  int D.19210;
  const unsigned char * D.19211;
  unsigned char D.19212;
  int D.19213;
  const unsigned char * D.19218;
  unsigned char D.19219;
  int D.19220;
  const unsigned char * D.19221;
  unsigned char D.19222;
  int D.19223;
  int D.17432;
  int iftmp.45;
  int D.17431;
  const char[3] * D.19230;
  unsigned char D.19231;
  int D.19232;
  unsigned char D.19233;
  int D.19234;
  const unsigned char * D.19239;
  unsigned char D.19240;
  int D.19241;
  const unsigned char * D.19242;
  unsigned char D.19243;
  int D.19244;
  const unsigned char * D.19249;
  unsigned char D.19250;
  int D.19251;
  const unsigned char * D.19252;
  unsigned char D.19253;
  int D.19254;
  const unsigned char * D.19259;
  unsigned char D.19260;
  int D.19261;
  const unsigned char * D.19262;
  unsigned char D.19263;
  int D.19264;
  struct GList * D.19270;
  unsigned int i.46;
  unsigned int D.19275;
  gchar * * D.19276;
  void * D.19277;
  struct GList * D.19281;
  char D.19282;
  gchar * cwd;
  gchar * mixed;
  gchar * * parts;
  gchar * part;
  struct GList * list;
  struct GList * tmp;
  struct GString * result;
  gchar * res;
  gint i;

  D.19182 = monoeg_g_path_is_absolute (filename);
  if (D.19182 != 0) goto <D.19183>; else goto <D.19184>;
  <D.19183>:
  part = monoeg_g_path_get_dirname (filename);
  res = monoeg_g_strconcat (part, "/", 0B);
  monoeg_g_free (part);
  D.19185 = res;
  return D.19185;
  <D.19184>:
  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.17434>;
  <D.17433>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = part;
      D.19189 = ".";
      D.19190 = MEM[(const unsigned char *)D.19189];
      D.19191 = (int) D.19190;
      D.19192 = *__s2;
      D.19193 = (int) D.19192;
      __result = D.19191 - D.19193;
      {
        if (__s2_len != 0) goto <D.19194>; else goto <D.19195>;
        <D.19194>:
        if (__result == 0) goto <D.19196>; else goto <D.19197>;
        <D.19196>:
        D.19198 = &MEM[(void *)"." + 1B];
        D.19199 = *D.19198;
        D.19200 = (int) D.19199;
        D.19201 = __s2 + 1;
        D.19202 = *D.19201;
        D.19203 = (int) D.19202;
        __result = D.19200 - D.19203;
        if (__s2_len > 1) goto <D.19204>; else goto <D.19205>;
        <D.19204>:
        if (__result == 0) goto <D.19206>; else goto <D.19207>;
        <D.19206>:
        D.19208 = &MEM[(void *)"." + 2B];
        D.19209 = *D.19208;
        D.19210 = (int) D.19209;
        D.19211 = __s2 + 2;
        D.19212 = *D.19211;
        D.19213 = (int) D.19212;
        __result = D.19210 - D.19213;
        if (__s2_len > 2) goto <D.19214>; else goto <D.19215>;
        <D.19214>:
        if (__result == 0) goto <D.19216>; else goto <D.19217>;
        <D.19216>:
        D.19218 = &MEM[(void *)"." + 3B];
        D.19219 = *D.19218;
        D.19220 = (int) D.19219;
        D.19221 = __s2 + 3;
        D.19222 = *D.19221;
        D.19223 = (int) D.19222;
        __result = D.19220 - D.19223;
        <D.19217>:
        <D.19215>:
        <D.19207>:
        <D.19205>:
        <D.19197>:
        <D.19195>:
      }
      D.17421 = __result;
    }
    iftmp.44 = -D.17421;
    goto <D.19224>;
    <D.19188>:
    iftmp.44 = __builtin_strcmp (part, ".");
    <D.19224>:
    D.17422 = iftmp.44;
  }
  if (D.17422 == 0) goto <D.19225>; else goto <D.19226>;
  <D.19225>:
  // predicted unlikely by continue predictor.
  goto <D.17423>;
  <D.19226>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = part;
      D.19230 = "..";
      D.19231 = MEM[(const unsigned char *)D.19230];
      D.19232 = (int) D.19231;
      D.19233 = *__s2;
      D.19234 = (int) D.19233;
      __result = D.19232 - D.19234;
      {
        if (__s2_len != 0) goto <D.19235>; else goto <D.19236>;
        <D.19235>:
        if (__result == 0) goto <D.19237>; else goto <D.19238>;
        <D.19237>:
        D.19239 = &MEM[(void *)".." + 1B];
        D.19240 = *D.19239;
        D.19241 = (int) D.19240;
        D.19242 = __s2 + 1;
        D.19243 = *D.19242;
        D.19244 = (int) D.19243;
        __result = D.19241 - D.19244;
        if (__s2_len > 1) goto <D.19245>; else goto <D.19246>;
        <D.19245>:
        if (__result == 0) goto <D.19247>; else goto <D.19248>;
        <D.19247>:
        D.19249 = &MEM[(void *)".." + 2B];
        D.19250 = *D.19249;
        D.19251 = (int) D.19250;
        D.19252 = __s2 + 2;
        D.19253 = *D.19252;
        D.19254 = (int) D.19253;
        __result = D.19251 - D.19254;
        if (__s2_len > 2) goto <D.19255>; else goto <D.19256>;
        <D.19255>:
        if (__result == 0) goto <D.19257>; else goto <D.19258>;
        <D.19257>:
        D.19259 = &MEM[(void *)".." + 3B];
        D.19260 = *D.19259;
        D.19261 = (int) D.19260;
        D.19262 = __s2 + 3;
        D.19263 = *D.19262;
        D.19264 = (int) D.19263;
        __result = D.19261 - D.19264;
        <D.19258>:
        <D.19256>:
        <D.19248>:
        <D.19246>:
        <D.19238>:
        <D.19236>:
      }
      D.17431 = __result;
    }
    iftmp.45 = -D.17431;
    goto <D.19265>;
    <D.19229>:
    iftmp.45 = __builtin_strcmp (part, "..");
    <D.19265>:
    D.17432 = iftmp.45;
  }
  if (D.17432 == 0) goto <D.19266>; else goto <D.19267>;
  <D.19266>:
  if (list != 0B) goto <D.19268>; else goto <D.19269>;
  <D.19268>:
  D.19270 = list->next;
  if (D.19270 != 0B) goto <D.19271>; else goto <D.19272>;
  <D.19271>:
  list = monoeg_g_list_delete_link (list, list);
  <D.19272>:
  <D.19269>:
  goto <D.19273>;
  <D.19267>:
  list = monoeg_g_list_prepend (list, part);
  <D.19273>:
  <D.17423>:
  i = i + 1;
  <D.17434>:
  i.46 = (unsigned int) i;
  D.19275 = i.46 * 4;
  D.19276 = parts + D.19275;
  part = *D.19276;
  if (part != 0B) goto <D.17433>; else goto <D.17435>;
  <D.17435>:
  result = monoeg_g_string_new ("");
  list = monoeg_g_list_reverse (list);
  tmp = list;
  goto <D.17437>;
  <D.17436>:
  D.19277 = tmp->data;
  if (D.19277 != 0B) goto <D.19278>; else goto <D.19279>;
  <D.19278>:
  D.19277 = tmp->data;
  monoeg_g_string_append_printf (result, "%s%c", D.19277, 47);
  <D.19279>:
  tmp = tmp->next;
  <D.17437>:
  if (tmp != 0B) goto <D.19280>; else goto <D.17438>;
  <D.19280>:
  D.19281 = tmp->next;
  if (D.19281 != 0B) goto <D.17436>; else goto <D.17438>;
  <D.17438>:
  res = result->str;
  monoeg_g_string_free (result, 0);
  monoeg_g_list_free (list);
  monoeg_g_strfreev (parts);
  D.19282 = *res;
  if (D.19282 == 0) goto <D.19283>; else goto <D.19284>;
  <D.19283>:
  monoeg_g_free (res);
  D.19185 = monoeg_strdup (".");
  return D.19185;
  <D.19284>:
  D.19185 = res;
  return D.19185;
}


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

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


mono_assembly_name_free (struct MonoAssemblyName * aname)
{
  const char * D.19290;
  const char * D.19291;
  const char * D.19292;

  if (aname == 0B) goto <D.19288>; else goto <D.19289>;
  <D.19288>:
  return;
  <D.19289>:
  D.19290 = aname->name;
  monoeg_g_free (D.19290);
  D.19291 = aname->culture;
  monoeg_g_free (D.19291);
  D.19292 = aname->hash_value;
  monoeg_g_free (D.19292);
}


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.19301;
  gboolean D.19302;
  gchar * D.19303;
  gchar * D.19304;
  gchar * D.19305;
  int D.19306;
  unsigned int part_name_len.47;
  gchar * part_name.48;
  int D.19312;
  char D.19315;
  int D.19319;
  char D.19322;
  int D.19326;
  char D.19329;
  int D.19333;
  char D.19336;
  int D.19340;
  char D.19343;
  int D.19345;
  int D.19349;
  int D.19353;
  gchar * value.49;
  int D.19357;
  int D.19361;
  int D.19365;
  int D.19369;
  int D.19373;
  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.19294>; else goto <D.19295>;
      <D.19294>:
      is_version_defined = &version_defined;
      <D.19295>:
      *is_version_defined = 0;
      if (is_token_defined == 0B) goto <D.19296>; else goto <D.19297>;
      <D.19296>:
      is_token_defined = &token_defined;
      <D.19297>:
      *is_token_defined = 0;
      tmp = monoeg_g_strsplit (name, ",", 6);
      parts = tmp;
      if (tmp == 0B) goto <D.19298>; else goto <D.19300>;
      <D.19300>:
      D.19301 = *tmp;
      if (D.19301 == 0B) goto <D.19298>; else goto <D.19299>;
      <D.19298>:
      monoeg_g_strfreev (tmp);
      D.19302 = 0;
      return D.19302;
      <D.19299>:
      D.19301 = *tmp;
      D.19303 = monoeg_g_strchomp (D.19301);
      dllname = monoeg_g_strchug (D.19303);
      tmp = tmp + 4;
      goto <D.17658>;
      <D.17659>:
      D.19301 = *tmp;
      D.19304 = monoeg_g_strchomp (D.19301);
      D.19305 = monoeg_g_strchug (D.19304);
      D.19306 = split_key_value (D.19305, &part_name, &part_name_len, &value);
      if (D.19306 == 0) goto cleanup_and_fail; else goto <D.19307>;
      <D.19307>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 7) goto <D.19309>; else goto <D.19310>;
      <D.19309>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19312 = monoeg_g_ascii_strncasecmp (part_name.48, "Version", part_name_len.47);
      if (D.19312 == 0) goto <D.19313>; else goto <D.19314>;
      <D.19313>:
      *is_version_defined = 1;
      version = value;
      D.19315 = MEM[(const char *)version];
      if (D.19315 == 0) goto cleanup_and_fail; else goto <D.19316>;
      <D.19316>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19314>:
      <D.19310>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 7) goto <D.19317>; else goto <D.19318>;
      <D.19317>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19319 = monoeg_g_ascii_strncasecmp (part_name.48, "Culture", part_name_len.47);
      if (D.19319 == 0) goto <D.19320>; else goto <D.19321>;
      <D.19320>:
      culture = value;
      D.19322 = MEM[(const char *)culture];
      if (D.19322 == 0) goto cleanup_and_fail; else goto <D.19323>;
      <D.19323>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19321>:
      <D.19318>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 14) goto <D.19324>; else goto <D.19325>;
      <D.19324>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19326 = monoeg_g_ascii_strncasecmp (part_name.48, "PublicKeyToken", part_name_len.47);
      if (D.19326 == 0) goto <D.19327>; else goto <D.19328>;
      <D.19327>:
      *is_token_defined = 1;
      token = value;
      D.19329 = MEM[(const char *)token];
      if (D.19329 == 0) goto cleanup_and_fail; else goto <D.19330>;
      <D.19330>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19328>:
      <D.19325>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 9) goto <D.19331>; else goto <D.19332>;
      <D.19331>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19333 = monoeg_g_ascii_strncasecmp (part_name.48, "PublicKey", part_name_len.47);
      if (D.19333 == 0) goto <D.19334>; else goto <D.19335>;
      <D.19334>:
      key = value;
      D.19336 = MEM[(const char *)key];
      if (D.19336 == 0) goto cleanup_and_fail; else goto <D.19337>;
      <D.19337>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19335>:
      <D.19332>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 12) goto <D.19338>; else goto <D.19339>;
      <D.19338>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19340 = monoeg_g_ascii_strncasecmp (part_name.48, "Retargetable", part_name_len.47);
      if (D.19340 == 0) goto <D.19341>; else goto <D.19342>;
      <D.19341>:
      retargetable = value;
      D.19343 = MEM[(const char *)retargetable];
      if (D.19343 == 0) goto cleanup_and_fail; else goto <D.19344>;
      <D.19344>:
      D.19345 = monoeg_ascii_strcasecmp (retargetable, "yes");
      if (D.19345 == 0) goto <D.19346>; else goto <D.19347>;
      <D.19346>:
      flags = flags | 256;
      goto <D.19348>;
      <D.19347>:
      D.19349 = monoeg_ascii_strcasecmp (retargetable, "no");
      if (D.19349 != 0) goto cleanup_and_fail; else goto <D.19350>;
      <D.19350>:
      <D.19348>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19342>:
      <D.19339>:
      part_name_len.47 = part_name_len;
      if (part_name_len.47 == 21) goto <D.19351>; else goto <D.19352>;
      <D.19351>:
      part_name.48 = part_name;
      part_name_len.47 = part_name_len;
      D.19353 = monoeg_g_ascii_strncasecmp (part_name.48, "ProcessorArchitecture", part_name_len.47);
      if (D.19353 == 0) goto <D.19354>; else goto <D.19355>;
      <D.19354>:
      value.49 = value;
      D.19357 = monoeg_ascii_strcasecmp (value.49, "None");
      if (D.19357 == 0) goto <D.19358>; else goto <D.19359>;
      <D.19358>:
      arch = 0;
      goto <D.19360>;
      <D.19359>:
      value.49 = value;
      D.19361 = monoeg_ascii_strcasecmp (value.49, "MSIL");
      if (D.19361 == 0) goto <D.19362>; else goto <D.19363>;
      <D.19362>:
      arch = 1;
      goto <D.19364>;
      <D.19363>:
      value.49 = value;
      D.19365 = monoeg_ascii_strcasecmp (value.49, "X86");
      if (D.19365 == 0) goto <D.19366>; else goto <D.19367>;
      <D.19366>:
      arch = 2;
      goto <D.19368>;
      <D.19367>:
      value.49 = value;
      D.19369 = monoeg_ascii_strcasecmp (value.49, "IA64");
      if (D.19369 == 0) goto <D.19370>; else goto <D.19371>;
      <D.19370>:
      arch = 3;
      goto <D.19372>;
      <D.19371>:
      value.49 = value;
      D.19373 = monoeg_ascii_strcasecmp (value.49, "AMD64");
      if (D.19373 == 0) goto <D.19374>; else goto cleanup_and_fail;
      <D.19374>:
      arch = 4;
      <D.19372>:
      <D.19368>:
      <D.19364>:
      <D.19360>:
      tmp = tmp + 4;
      // predicted unlikely by continue predictor.
      goto <D.17658>;
      <D.19355>:
      <D.19352>:
      monoeg_g_strfreev (parts);
      D.19302 = 0;
      return D.19302;
      <D.17658>:
      D.19301 = *tmp;
      if (D.19301 != 0B) goto <D.17659>; else goto <D.17660>;
      <D.17660>:
      if (retargetable != 0B) goto <D.19376>; else goto <D.19377>;
      <D.19376>:
      if (version == 0B) goto cleanup_and_fail; else goto <D.19378>;
      <D.19378>:
      if (culture == 0B) goto cleanup_and_fail; else goto <D.19379>;
      <D.19379>:
      if (key == 0B) goto <D.19380>; else goto <D.19375>;
      <D.19380>:
      if (token == 0B) goto cleanup_and_fail; else goto <D.19375>;
      <D.19375>:
      <D.19377>:
      res = build_assembly_name (dllname, version, culture, token, key, flags, arch, aname, save_public_key);
      monoeg_g_strfreev (parts);
      D.19302 = res;
      return D.19302;
      cleanup_and_fail:
      monoeg_g_strfreev (parts);
      D.19302 = 0;
      return D.19302;
    }
  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.19385;
  int eqsign.50;
  gchar * D.19387;
  int D.19388;
  int D.19389;
  unsigned int D.19390;
  unsigned int D.19391;
  unsigned int D.19392;
  const short unsigned int * * D.19394;
  const short unsigned int * D.19395;
  sizetype D.19396;
  gchar * D.19397;
  char D.19398;
  unsigned int D.19399;
  unsigned int D.19400;
  const short unsigned int * D.19401;
  short unsigned int D.19402;
  int D.19403;
  int D.19404;
  gchar * D.19405;
  gchar * D.19406;
  gchar * D.19407;
  char * eqsign;

  eqsign = __builtin_strchr (pair, 61);
  if (eqsign == 0B) goto <D.19383>; else goto <D.19384>;
  <D.19383>:
  *key = 0B;
  *keylen = 0;
  *value = 0B;
  D.19385 = 0;
  return D.19385;
  <D.19384>:
  *key = pair;
  eqsign.50 = (int) eqsign;
  D.19387 = *key;
  D.19388 = (int) D.19387;
  D.19389 = eqsign.50 - D.19388;
  D.19390 = (unsigned int) D.19389;
  *keylen = D.19390;
  goto <D.17632>;
  <D.17631>:
  D.19391 = *keylen;
  D.19392 = D.19391 + 4294967295;
  *keylen = D.19392;
  <D.17632>:
  D.19391 = *keylen;
  if (D.19391 != 0) goto <D.19393>; else goto <D.17633>;
  <D.19393>:
  D.19394 = __ctype_b_loc ();
  D.19395 = *D.19394;
  D.19387 = *key;
  D.19391 = *keylen;
  D.19396 = D.19391 + 4294967295;
  D.19397 = D.19387 + D.19396;
  D.19398 = *D.19397;
  D.19399 = (unsigned int) D.19398;
  D.19400 = D.19399 * 2;
  D.19401 = D.19395 + D.19400;
  D.19402 = *D.19401;
  D.19403 = (int) D.19402;
  D.19404 = D.19403 & 8192;
  if (D.19404 != 0) goto <D.17631>; else goto <D.17633>;
  <D.17633>:
  D.19405 = eqsign + 1;
  D.19406 = monoeg_g_strchomp (D.19405);
  D.19407 = monoeg_g_strchug (D.19406);
  *value = D.19407;
  D.19385 = 1;
  return D.19385;
}


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.51;
  unsigned int D.19412;
  gboolean D.19415;
  int major.52;
  short unsigned int D.19417;
  int minor.53;
  short unsigned int D.19419;
  int build.54;
  short unsigned int D.19423;
  int revision.55;
  short unsigned int D.19428;
  short unsigned int D.19430;
  gchar * D.19431;
  int D.19434;
  gchar * D.19437;
  gchar * D.19439;
  int D.19442;
  unsigned int D.19445;
  mono_byte[17] * D.19448;
  int D.17616;
  int iftmp.56;
  int D.17615;
  const char[5] * D.19456;
  unsigned char D.19457;
  int D.19458;
  unsigned char D.19459;
  int D.19460;
  const unsigned char * D.19465;
  unsigned char D.19466;
  int D.19467;
  const unsigned char * D.19468;
  unsigned char D.19469;
  int D.19470;
  const unsigned char * D.19475;
  unsigned char D.19476;
  int D.19477;
  const unsigned char * D.19478;
  unsigned char D.19479;
  int D.19480;
  const unsigned char * D.19485;
  unsigned char D.19486;
  int D.19487;
  const unsigned char * D.19488;
  unsigned char D.19489;
  int D.19490;
  int D.19493;
  int is_ecma.57;
  gchar * pkey.58;
  unsigned int D.19501;
  gchar * pkeyptr.59;
  unsigned int len.60;
  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, 60);
      if (version != 0B) goto <D.19409>; else goto <D.19410>;
      <D.19409>:
      version_parts = sscanf (version, "%u.%u.%u.%u", &major, &minor, &build, &revision);
      version_parts.51 = (unsigned int) version_parts;
      D.19412 = version_parts.51 + 4294967294;
      if (D.19412 > 2) goto <D.19413>; else goto <D.19414>;
      <D.19413>:
      D.19415 = 0;
      return D.19415;
      <D.19414>:
      major.52 = major;
      D.19417 = (short unsigned int) major.52;
      aname->major = D.19417;
      minor.53 = minor;
      D.19419 = (short unsigned int) minor.53;
      aname->minor = D.19419;
      if (version_parts > 2) goto <D.19420>; else goto <D.19421>;
      <D.19420>:
      build.54 = build;
      D.19423 = (short unsigned int) build.54;
      aname->build = D.19423;
      goto <D.19424>;
      <D.19421>:
      aname->build = 0;
      <D.19424>:
      if (version_parts == 4) goto <D.19425>; else goto <D.19426>;
      <D.19425>:
      revision.55 = revision;
      D.19428 = (short unsigned int) revision.55;
      aname->revision = D.19428;
      goto <D.19429>;
      <D.19426>:
      aname->revision = 0;
      <D.19429>:
      <D.19410>:
      aname->flags = flags;
      D.19430 = (short unsigned int) arch;
      aname->arch = D.19430;
      D.19431 = monoeg_strdup (name);
      aname->name = D.19431;
      if (culture != 0B) goto <D.19432>; else goto <D.19433>;
      <D.19432>:
      D.19434 = monoeg_ascii_strcasecmp (culture, "neutral");
      if (D.19434 == 0) goto <D.19435>; else goto <D.19436>;
      <D.19435>:
      D.19437 = monoeg_strdup ("");
      aname->culture = D.19437;
      goto <D.19438>;
      <D.19436>:
      D.19439 = monoeg_strdup (culture);
      aname->culture = D.19439;
      <D.19438>:
      <D.19433>:
      if (token != 0B) goto <D.19440>; else goto <D.19441>;
      <D.19440>:
      D.19442 = strncmp (token, "null", 4);
      if (D.19442 != 0) goto <D.19443>; else goto <D.19444>;
      <D.19443>:
      {
        char * lower;

        D.19445 = strlen (token);
        if (D.19445 != 16) goto <D.19446>; else goto <D.19447>;
        <D.19446>:
        mono_assembly_name_free (aname);
        D.19415 = 0;
        return D.19415;
        <D.19447>:
        lower = monoeg_g_ascii_strdown (token, 17);
        D.19448 = &aname->public_key_token;
        monoeg_g_strlcpy (D.19448, lower, 17);
        monoeg_g_free (lower);
      }
      <D.19444>:
      <D.19441>:
      if (key != 0B) goto <D.19449>; else goto <D.19450>;
      <D.19449>:
      {
        gboolean is_ecma;

        try
          {
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = key;
                D.19456 = "null";
                D.19457 = MEM[(const unsigned char *)D.19456];
                D.19458 = (int) D.19457;
                D.19459 = *__s2;
                D.19460 = (int) D.19459;
                __result = D.19458 - D.19460;
                {
                  if (__s2_len != 0) goto <D.19461>; else goto <D.19462>;
                  <D.19461>:
                  if (__result == 0) goto <D.19463>; else goto <D.19464>;
                  <D.19463>:
                  D.19465 = &MEM[(void *)"null" + 1B];
                  D.19466 = *D.19465;
                  D.19467 = (int) D.19466;
                  D.19468 = __s2 + 1;
                  D.19469 = *D.19468;
                  D.19470 = (int) D.19469;
                  __result = D.19467 - D.19470;
                  if (__s2_len > 1) goto <D.19471>; else goto <D.19472>;
                  <D.19471>:
                  if (__result == 0) goto <D.19473>; else goto <D.19474>;
                  <D.19473>:
                  D.19475 = &MEM[(void *)"null" + 2B];
                  D.19476 = *D.19475;
                  D.19477 = (int) D.19476;
                  D.19478 = __s2 + 2;
                  D.19479 = *D.19478;
                  D.19480 = (int) D.19479;
                  __result = D.19477 - D.19480;
                  if (__s2_len > 2) goto <D.19481>; else goto <D.19482>;
                  <D.19481>:
                  if (__result == 0) goto <D.19483>; else goto <D.19484>;
                  <D.19483>:
                  D.19485 = &MEM[(void *)"null" + 3B];
                  D.19486 = *D.19485;
                  D.19487 = (int) D.19486;
                  D.19488 = __s2 + 3;
                  D.19489 = *D.19488;
                  D.19490 = (int) D.19489;
                  __result = D.19487 - D.19490;
                  <D.19484>:
                  <D.19482>:
                  <D.19474>:
                  <D.19472>:
                  <D.19464>:
                  <D.19462>:
                }
                D.17615 = __result;
              }
              iftmp.56 = -D.17615;
              goto <D.19491>;
              <D.19455>:
              iftmp.56 = __builtin_strcmp (key, "null");
              <D.19491>:
              D.17616 = iftmp.56;
            }
            if (D.17616 == 0) goto <D.19451>; else goto <D.19492>;
            <D.19492>:
            D.19493 = parse_public_key (key, &pkey, &is_ecma);
            if (D.19493 == 0) goto <D.19451>; else goto <D.19452>;
            <D.19451>:
            mono_assembly_name_free (aname);
            D.19415 = 0;
            return D.19415;
            <D.19452>:
            is_ecma.57 = is_ecma;
            if (is_ecma.57 != 0) goto <D.19495>; else goto <D.19496>;
            <D.19495>:
            if (save_public_key != 0) goto <D.19497>; else goto <D.19498>;
            <D.19497>:
            pkey.58 = pkey;
            aname->public_key = pkey.58;
            goto <D.19500>;
            <D.19498>:
            pkey.58 = pkey;
            monoeg_g_free (pkey.58);
            <D.19500>:
            D.19448 = &aname->public_key_token;
            monoeg_g_strlcpy (D.19448, "b77a5c561934e089", 17);
            D.19415 = 1;
            return D.19415;
            <D.19496>:
            pkey.58 = pkey;
            D.19501 = mono_metadata_decode_blob_size (pkey.58, &pkeyptr);
            len = (gint) D.19501;
            pkeyptr.59 = pkeyptr;
            len.60 = (unsigned int) len;
            mono_digest_get_public_token (&tok, pkeyptr.59, len.60);
            encoded = encode_public_tok (&tok, 8);
            D.19448 = &aname->public_key_token;
            monoeg_g_strlcpy (D.19448, encoded, 17);
            monoeg_g_free (encoded);
            if (save_public_key != 0) goto <D.19504>; else goto <D.19505>;
            <D.19504>:
            pkey.58 = pkey;
            aname->public_key = pkey.58;
            goto <D.19506>;
            <D.19505>:
            pkey.58 = pkey;
            monoeg_g_free (pkey.58);
            <D.19506>:
          }
        finally
          {
            is_ecma = {CLOBBER};
          }
      }
      <D.19450>:
      D.19415 = 1;
      return D.19415;
    }
  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)
{
  unsigned int D.19511;
  unsigned int D.19512;
  gboolean D.19515;
  int D.17565;
  int iftmp.61;
  int D.17564;
  const char[33] * D.19519;
  unsigned char D.19520;
  int D.19521;
  unsigned char D.19522;
  int D.19523;
  const unsigned char * D.19528;
  unsigned char D.19529;
  int D.19530;
  const unsigned char * D.19531;
  unsigned char D.19532;
  int D.19533;
  const unsigned char * D.19538;
  unsigned char D.19539;
  int D.19540;
  const unsigned char * D.19541;
  unsigned char D.19542;
  int D.19543;
  const unsigned char * D.19548;
  unsigned char D.19549;
  int D.19550;
  const unsigned char * D.19551;
  unsigned char D.19552;
  int D.19553;
  gchar * D.19559;
  char D.19560;
  int D.19561;
  int D.19562;
  int D.19563;
  const gchar * D.19564;
  char D.19565;
  int D.19566;
  int D.19567;
  char D.19568;
  int D.19569;
  const gchar * D.19572;
  char D.19573;
  int D.19574;
  int D.19575;
  const gchar * D.19576;
  char D.19577;
  int D.19578;
  int D.19579;
  char D.19580;
  unsigned int D.19583;
  unsigned int D.19584;
  int j.62;
  sizetype j.63;
  const gchar * D.19589;
  char D.19590;
  int D.19591;
  int D.19592;
  int D.19593;
  char D.19594;
  int j.64;
  sizetype j.65;
  const gchar * D.19597;
  char D.19598;
  int D.19599;
  int D.19600;
  char D.19601;
  char D.19602;
  char D.19603;
  char D.19606;
  char D.19608;
  char D.19610;
  char D.19612;
  unsigned int D.19614;
  unsigned int D.19615;
  unsigned int D.19616;
  int D.19617;
  int D.19624;
  unsigned int D.19625;
  int offset.66;
  sizetype offset.67;
  gchar * D.19628;
  char D.19629;
  int D.19631;
  unsigned int D.19632;
  int offset.68;
  sizetype offset.69;
  gchar * D.19635;
  int offset.70;
  sizetype offset.71;
  gchar * D.19638;
  sizetype i.72;
  gchar * D.19640;
  int j.73;
  sizetype j.74;
  const gchar * D.19643;
  char D.19644;
  int D.19645;
  int D.19646;
  int D.19647;
  char D.19648;
  int j.75;
  sizetype j.76;
  const gchar * D.19651;
  char D.19652;
  int D.19653;
  int D.19654;
  char D.19655;
  char D.19656;
  char D.19657;
  int D.19658;
  const gchar * pkey;
  gchar header[16];
  gchar val;
  gchar * arr;
  gint i;
  gint j;
  gint offset;
  gint bitlen;
  gint keylen;
  gint pkeylen;

  try
    {
      D.19511 = strlen (key);
      D.19512 = D.19511 >> 1;
      keylen = (gint) D.19512;
      if (keylen <= 0) goto <D.19513>; else goto <D.19514>;
      <D.19513>:
      D.19515 = 0;
      return D.19515;
      <D.19514>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = key;
          D.19519 = "00000000000000000400000000000000";
          D.19520 = MEM[(const unsigned char *)D.19519];
          D.19521 = (int) D.19520;
          D.19522 = *__s2;
          D.19523 = (int) D.19522;
          __result = D.19521 - D.19523;
          {
            if (__s2_len != 0) goto <D.19524>; else goto <D.19525>;
            <D.19524>:
            if (__result == 0) goto <D.19526>; else goto <D.19527>;
            <D.19526>:
            D.19528 = &MEM[(void *)"00000000000000000400000000000000" + 1B];
            D.19529 = *D.19528;
            D.19530 = (int) D.19529;
            D.19531 = __s2 + 1;
            D.19532 = *D.19531;
            D.19533 = (int) D.19532;
            __result = D.19530 - D.19533;
            if (__s2_len > 1) goto <D.19534>; else goto <D.19535>;
            <D.19534>:
            if (__result == 0) goto <D.19536>; else goto <D.19537>;
            <D.19536>:
            D.19538 = &MEM[(void *)"00000000000000000400000000000000" + 2B];
            D.19539 = *D.19538;
            D.19540 = (int) D.19539;
            D.19541 = __s2 + 2;
            D.19542 = *D.19541;
            D.19543 = (int) D.19542;
            __result = D.19540 - D.19543;
            if (__s2_len > 2) goto <D.19544>; else goto <D.19545>;
            <D.19544>:
            if (__result == 0) goto <D.19546>; else goto <D.19547>;
            <D.19546>:
            D.19548 = &MEM[(void *)"00000000000000000400000000000000" + 3B];
            D.19549 = *D.19548;
            D.19550 = (int) D.19549;
            D.19551 = __s2 + 3;
            D.19552 = *D.19551;
            D.19553 = (int) D.19552;
            __result = D.19550 - D.19553;
            <D.19547>:
            <D.19545>:
            <D.19537>:
            <D.19535>:
            <D.19527>:
            <D.19525>:
          }
          D.17564 = __result;
        }
        iftmp.61 = -D.17564;
        goto <D.19554>;
        <D.19518>:
        iftmp.61 = __builtin_strcmp (key, "00000000000000000400000000000000");
        <D.19554>:
        D.17565 = iftmp.61;
      }
      if (D.17565 == 0) goto <D.19555>; else goto <D.19556>;
      <D.19555>:
      if (pubkey != 0B) goto <D.19557>; else goto <D.19558>;
      <D.19557>:
      D.19559 = monoeg_strdup (key);
      *pubkey = D.19559;
      *is_ecma = 1;
      <D.19558>:
      D.19515 = 1;
      return D.19515;
      <D.19556>:
      *is_ecma = 0;
      D.19560 = *key;
      D.19561 = (int) D.19560;
      D.19562 = monoeg_g_ascii_xdigit_value (D.19561);
      D.19563 = D.19562 << 4;
      val = (gchar) D.19563;
      D.19564 = key + 1;
      D.19565 = *D.19564;
      D.19566 = (int) D.19565;
      D.19567 = monoeg_g_ascii_xdigit_value (D.19566);
      D.19568 = (char) D.19567;
      val = D.19568 | val;
      D.19569 = (int) val;
      switch (D.19569) <default: <D.17569>, case 0: <D.17566>, case 6: <D.17568>>
      <D.17566>:
      if (keylen <= 12) goto <D.19570>; else goto <D.19571>;
      <D.19570>:
      D.19515 = 0;
      return D.19515;
      <D.19571>:
      D.19572 = key + 24;
      D.19573 = *D.19572;
      D.19574 = (int) D.19573;
      D.19575 = monoeg_g_ascii_xdigit_value (D.19574);
      val = (gchar) D.19575;
      D.19576 = key + 25;
      D.19577 = *D.19576;
      D.19578 = (int) D.19577;
      D.19579 = monoeg_g_ascii_xdigit_value (D.19578);
      D.19580 = (char) D.19579;
      val = D.19580 | val;
      if (val != 6) goto <D.19581>; else goto <D.19582>;
      <D.19581>:
      D.19515 = 0;
      return D.19515;
      <D.19582>:
      pkey = key + 24;
      goto <D.17567>;
      <D.17568>:
      pkey = key;
      goto <D.17567>;
      <D.17569>:
      D.19515 = 0;
      return D.19515;
      <D.17567>:
      D.19583 = strlen (pkey);
      D.19584 = D.19583 >> 1;
      pkeylen = (gint) D.19584;
      if (pkeylen <= 15) goto <D.19585>; else goto <D.19586>;
      <D.19585>:
      D.19515 = 0;
      return D.19515;
      <D.19586>:
      i = 0;
      j = 0;
      goto <D.17571>;
      <D.17570>:
      j.62 = j;
      j = j.62 + 1;
      j.63 = (sizetype) j.62;
      D.19589 = pkey + j.63;
      D.19590 = *D.19589;
      D.19591 = (int) D.19590;
      D.19592 = monoeg_g_ascii_xdigit_value (D.19591);
      D.19593 = D.19592 << 4;
      D.19594 = (char) D.19593;
      header[i] = D.19594;
      j.64 = j;
      j = j.64 + 1;
      j.65 = (sizetype) j.64;
      D.19597 = pkey + j.65;
      D.19598 = *D.19597;
      D.19599 = (int) D.19598;
      D.19600 = monoeg_g_ascii_xdigit_value (D.19599);
      D.19601 = header[i];
      D.19602 = (char) D.19600;
      D.19603 = D.19601 | D.19602;
      header[i] = D.19603;
      i = i + 1;
      <D.17571>:
      if (i <= 15) goto <D.17570>; else goto <D.17572>;
      <D.17572>:
      D.19606 = header[0];
      if (D.19606 != 6) goto <D.19604>; else goto <D.19607>;
      <D.19607>:
      D.19608 = header[1];
      if (D.19608 != 2) goto <D.19604>; else goto <D.19609>;
      <D.19609>:
      D.19610 = header[2];
      if (D.19610 != 0) goto <D.19604>; else goto <D.19611>;
      <D.19611>:
      D.19612 = header[3];
      if (D.19612 != 0) goto <D.19604>; else goto <D.19613>;
      <D.19613>:
      D.19614 = mono_read32 (&MEM[(void *)&header + 8B]);
      if (D.19614 != 826364754) goto <D.19604>; else goto <D.19605>;
      <D.19604>:
      D.19515 = 0;
      return D.19515;
      <D.19605>:
      D.19615 = mono_read32 (&MEM[(void *)&header + 12B]);
      D.19616 = D.19615 >> 3;
      bitlen = (gint) D.19616;
      D.19617 = bitlen + 20;
      if (D.19617 != pkeylen) goto <D.19618>; else goto <D.19619>;
      <D.19618>:
      D.19515 = 0;
      return D.19515;
      <D.19619>:
      if (pubkey == 0B) goto <D.19620>; else goto <D.19621>;
      <D.19620>:
      D.19515 = 1;
      return D.19515;
      <D.19621>:
      offset = 0;
      if (keylen <= 127) goto <D.19622>; else goto <D.19623>;
      <D.19622>:
      D.19624 = keylen + 1;
      D.19625 = (unsigned int) D.19624;
      arr = monoeg_malloc (D.19625);
      offset.66 = offset;
      offset = offset.66 + 1;
      offset.67 = (sizetype) offset.66;
      D.19628 = arr + offset.67;
      D.19629 = (char) keylen;
      *D.19628 = D.19629;
      goto <D.19630>;
      <D.19623>:
      D.19631 = keylen + 2;
      D.19632 = (unsigned int) D.19631;
      arr = monoeg_malloc (D.19632);
      offset.68 = offset;
      offset = offset.68 + 1;
      offset.69 = (sizetype) offset.68;
      D.19635 = arr + offset.69;
      *D.19635 = -128;
      offset.70 = offset;
      offset = offset.70 + 1;
      offset.71 = (sizetype) offset.70;
      D.19638 = arr + offset.71;
      D.19629 = (char) keylen;
      *D.19638 = D.19629;
      <D.19630>:
      i = offset;
      j = 0;
      goto <D.17574>;
      <D.17573>:
      i.72 = (sizetype) i;
      D.19640 = arr + i.72;
      j.73 = j;
      j = j.73 + 1;
      j.74 = (sizetype) j.73;
      D.19643 = key + j.74;
      D.19644 = *D.19643;
      D.19645 = (int) D.19644;
      D.19646 = monoeg_g_ascii_xdigit_value (D.19645);
      D.19647 = D.19646 << 4;
      D.19648 = (char) D.19647;
      *D.19640 = D.19648;
      j.75 = j;
      j = j.75 + 1;
      j.76 = (sizetype) j.75;
      D.19651 = key + j.76;
      D.19652 = *D.19651;
      D.19653 = (int) D.19652;
      D.19654 = monoeg_g_ascii_xdigit_value (D.19653);
      i.72 = (sizetype) i;
      D.19640 = arr + i.72;
      i.72 = (sizetype) i;
      D.19640 = arr + i.72;
      D.19655 = *D.19640;
      D.19656 = (char) D.19654;
      D.19657 = D.19655 | D.19656;
      *D.19640 = D.19657;
      i = i + 1;
      <D.17574>:
      D.19658 = keylen + offset;
      if (D.19658 > i) goto <D.17573>; else goto <D.17575>;
      <D.17575>:
      *pubkey = arr;
      D.19515 = 1;
      return D.19515;
    }
  finally
    {
      header = {CLOBBER};
    }
}


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

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


mono_assembly_name_new (const char * name)
{
  int D.19663;
  struct MonoAssemblyName * D.19666;
  struct MonoAssemblyName * aname;

  aname = monoeg_malloc0 (60);
  D.19663 = mono_assembly_name_parse (name, aname);
  if (D.19663 != 0) goto <D.19664>; else goto <D.19665>;
  <D.19664>:
  D.19666 = aname;
  return D.19666;
  <D.19665>:
  monoeg_g_free (aname);
  D.19666 = 0B;
  return D.19666;
}


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

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


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

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


mono_assembly_name_get_pubkeytoken (struct MonoAssemblyName * aname)
{
  unsigned char D.19672;
  mono_byte * D.19675;

  D.19672 = aname->public_key_token[0];
  if (D.19672 != 0) goto <D.19673>; else goto <D.19674>;
  <D.19673>:
  D.19675 = &aname->public_key_token;
  return D.19675;
  <D.19674>:
  D.19675 = 0B;
  return D.19675;
}


mono_assembly_name_get_version (struct MonoAssemblyName * aname, uint16_t * minor, uint16_t * build, uint16_t * revision)
{
  short unsigned int D.19679;
  short unsigned int D.19682;
  short unsigned int D.19685;
  uint16_t D.19686;

  if (minor != 0B) goto <D.19677>; else goto <D.19678>;
  <D.19677>:
  D.19679 = aname->minor;
  *minor = D.19679;
  <D.19678>:
  if (build != 0B) goto <D.19680>; else goto <D.19681>;
  <D.19680>:
  D.19682 = aname->build;
  *build = D.19682;
  <D.19681>:
  if (revision != 0B) goto <D.19683>; else goto <D.19684>;
  <D.19683>:
  D.19685 = aname->revision;
  *revision = D.19685;
  <D.19684>:
  D.19686 = aname->major;
  return D.19686;
}


mono_assembly_load_with_partial_name (const char * name, MonoImageOpenStatus * status)
{
  int D.19688;
  struct MonoAssembly * D.19691;
  short unsigned int D.19692;
  short unsigned int D.19693;
  short unsigned int D.19694;
  short unsigned int D.19695;
  short unsigned int D.19696;
  short unsigned int D.19697;
  short unsigned int D.19698;
  char * * assemblies_path.77;
  const char * D.19706;
  char * * extra_gac_paths.78;
  gchar * D.19710;
  const char * D.19714;
  struct MonoString * D.19718;
  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, 60);
      aname = &base_name;
      D.19688 = mono_assembly_name_parse (name, aname);
      if (D.19688 == 0) goto <D.19689>; else goto <D.19690>;
      <D.19689>:
      D.19691 = 0B;
      return D.19691;
      <D.19690>:
      D.19692 = aname->major;
      D.19693 = aname->minor;
      D.19694 = D.19692 | D.19693;
      D.19695 = aname->build;
      D.19696 = D.19694 | D.19695;
      D.19697 = aname->revision;
      D.19698 = D.19696 | D.19697;
      if (D.19698 == 0) goto <D.19699>; else goto <D.19700>;
      <D.19699>:
      aname = mono_assembly_remap_version (aname, &mapped_aname);
      <D.19700>:
      res = mono_assembly_loaded (aname);
      if (res != 0B) goto <D.19701>; else goto <D.19702>;
      <D.19701>:
      mono_assembly_name_free (aname);
      D.19691 = res;
      return D.19691;
      <D.19702>:
      assemblies_path.77 = assemblies_path;
      res = invoke_assembly_preload_hook (aname, assemblies_path.77);
      if (res != 0B) goto <D.19704>; else goto <D.19705>;
      <D.19704>:
      res->in_gac = 0;
      mono_assembly_name_free (aname);
      D.19691 = res;
      return D.19691;
      <D.19705>:
      D.19706 = aname->name;
      fullname = monoeg_g_strdup_printf ("%s.dll", D.19706);
      extra_gac_paths.78 = extra_gac_paths;
      if (extra_gac_paths.78 != 0B) goto <D.19708>; else goto <D.19709>;
      <D.19708>:
      paths = extra_gac_paths;
      goto <D.17725>;
      <D.17724>:
      D.19710 = *paths;
      D.19706 = aname->name;
      gacpath = monoeg_g_build_path ("/", D.19710, "lib", "mono", "gac", D.19706, 0B);
      res = probe_for_partial_name (gacpath, fullname, aname, status);
      monoeg_g_free (gacpath);
      paths = paths + 4;
      <D.17725>:
      if (res == 0B) goto <D.19711>; else goto <D.17726>;
      <D.19711>:
      D.19710 = *paths;
      if (D.19710 != 0B) goto <D.17724>; else goto <D.17726>;
      <D.17726>:
      <D.19709>:
      if (res != 0B) goto <D.19712>; else goto <D.19713>;
      <D.19712>:
      res->in_gac = 1;
      monoeg_g_free (fullname);
      mono_assembly_name_free (aname);
      D.19691 = res;
      return D.19691;
      <D.19713>:
      D.19714 = mono_assembly_getrootdir ();
      D.19706 = aname->name;
      gacpath = monoeg_g_build_path ("/", D.19714, "mono", "gac", D.19706, 0B);
      res = probe_for_partial_name (gacpath, fullname, aname, status);
      monoeg_g_free (gacpath);
      if (res != 0B) goto <D.19715>; else goto <D.19716>;
      <D.19715>:
      res->in_gac = 1;
      goto <D.19717>;
      <D.19716>:
      {
        struct MonoDomain * domain;
        struct MonoReflectionAssembly * refasm;

        domain = mono_domain_get ();
        D.19718 = mono_string_new (domain, name);
        refasm = mono_try_assembly_resolve (domain, D.19718, 0);
        if (refasm != 0B) goto <D.19719>; else goto <D.19720>;
        <D.19719>:
        res = refasm->assembly;
        <D.19720>:
      }
      <D.19717>:
      monoeg_g_free (fullname);
      mono_assembly_name_free (aname);
      D.19691 = res;
      return D.19691;
    }
  finally
    {
      base_name = {CLOBBER};
      mapped_aname = {CLOBBER};
    }
}


mono_assembly_remap_version (struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_aname)
{
  const char * D.19723;
  struct MonoAssemblyName * D.19726;
  unsigned int D.19727;
  unsigned int D.19728;
  short unsigned int D.19731;
  short unsigned int D.19732;
  short unsigned int D.19733;
  short unsigned int D.19734;
  unsigned int D.19735;
  unsigned int D.19736;
  int D.17227;
  int iftmp.79;
  int D.17226;
  const char[11] * D.19740;
  unsigned char D.19741;
  int D.19742;
  unsigned char D.19743;
  int D.19744;
  const unsigned char * D.19749;
  unsigned char D.19750;
  int D.19751;
  const unsigned char * D.19752;
  unsigned char D.19753;
  int D.19754;
  const unsigned char * D.19759;
  unsigned char D.19760;
  int D.19761;
  const unsigned char * D.19762;
  unsigned char D.19763;
  int D.19764;
  const unsigned char * D.19769;
  unsigned char D.19770;
  int D.19771;
  const unsigned char * D.19772;
  unsigned char D.19773;
  int D.19774;
  gchar * D.19778;
  short unsigned int D.19779;
  int D.19780;
  short unsigned int D.19781;
  int D.19782;
  short unsigned int D.19783;
  int D.19784;
  short unsigned int D.19785;
  int D.19786;
  const char * D.19787;
  int D.19788;
  int D.19789;
  int D.19790;
  int D.19791;
  int D.19792;
  int D.19793;
  int res.80;
  const char * D.19794;
  unsigned char D.19797;
  unsigned int index.81;
  _Bool D.19799;
  long int D.19800;
  long int D.19801;
  short unsigned int D.19804;
  short unsigned int D.19807;
  short unsigned int D.19810;
  short unsigned int D.19813;
  short unsigned int D.19816;
  short unsigned int D.19817;
  short unsigned int D.19818;
  int D.19821;
  int D.19822;
  int D.19823;
  int D.19824;
  const struct MonoRuntimeInfo * current_runtime;
  int pos;
  int first;
  int last;

  D.19723 = aname->name;
  if (D.19723 == 0B) goto <D.19724>; else goto <D.19725>;
  <D.19724>:
  D.19726 = aname;
  return D.19726;
  <D.19725>:
  current_runtime = mono_get_runtime_info ();
  D.19727 = aname->flags;
  D.19728 = D.19727 & 256;
  if (D.19728 != 0) goto <D.19729>; else goto <D.19730>;
  <D.19729>:
  {
    const struct AssemblyVersionSet * vset;

    vset = &current_runtime->version_sets[0];
    memcpy (dest_aname, aname, 60);
    D.19731 = vset->major;
    dest_aname->major = D.19731;
    D.19732 = vset->minor;
    dest_aname->minor = D.19732;
    D.19733 = vset->build;
    dest_aname->build = D.19733;
    D.19734 = vset->revision;
    dest_aname->revision = D.19734;
    D.19735 = dest_aname->flags;
    D.19736 = D.19735 & 4294967039;
    dest_aname->flags = D.19736;
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = aname->name;
        D.19740 = "System.Net";
        D.19741 = MEM[(const unsigned char *)D.19740];
        D.19742 = (int) D.19741;
        D.19743 = *__s2;
        D.19744 = (int) D.19743;
        __result = D.19742 - D.19744;
        {
          if (__s2_len != 0) goto <D.19745>; else goto <D.19746>;
          <D.19745>:
          if (__result == 0) goto <D.19747>; else goto <D.19748>;
          <D.19747>:
          D.19749 = &MEM[(void *)"System.Net" + 1B];
          D.19750 = *D.19749;
          D.19751 = (int) D.19750;
          D.19752 = __s2 + 1;
          D.19753 = *D.19752;
          D.19754 = (int) D.19753;
          __result = D.19751 - D.19754;
          if (__s2_len > 1) goto <D.19755>; else goto <D.19756>;
          <D.19755>:
          if (__result == 0) goto <D.19757>; else goto <D.19758>;
          <D.19757>:
          D.19759 = &MEM[(void *)"System.Net" + 2B];
          D.19760 = *D.19759;
          D.19761 = (int) D.19760;
          D.19762 = __s2 + 2;
          D.19763 = *D.19762;
          D.19764 = (int) D.19763;
          __result = D.19761 - D.19764;
          if (__s2_len > 2) goto <D.19765>; else goto <D.19766>;
          <D.19765>:
          if (__result == 0) goto <D.19767>; else goto <D.19768>;
          <D.19767>:
          D.19769 = &MEM[(void *)"System.Net" + 3B];
          D.19770 = *D.19769;
          D.19771 = (int) D.19770;
          D.19772 = __s2 + 3;
          D.19773 = *D.19772;
          D.19774 = (int) D.19773;
          __result = D.19771 - D.19774;
          <D.19768>:
          <D.19766>:
          <D.19758>:
          <D.19756>:
          <D.19748>:
          <D.19746>:
        }
        D.17226 = __result;
      }
      iftmp.79 = -D.17226;
      goto <D.19775>;
      <D.19739>:
      D.19723 = aname->name;
      iftmp.79 = __builtin_strcmp (D.19723, "System.Net");
      <D.19775>:
      D.17227 = iftmp.79;
    }
    if (D.17227 == 0) goto <D.19776>; else goto <D.19777>;
    <D.19776>:
    D.19778 = monoeg_strdup ("System");
    dest_aname->name = D.19778;
    <D.19777>:
    remap_keys (dest_aname);
    D.19723 = aname->name;
    D.19779 = aname->major;
    D.19780 = (int) D.19779;
    D.19781 = aname->minor;
    D.19782 = (int) D.19781;
    D.19783 = aname->build;
    D.19784 = (int) D.19783;
    D.19785 = aname->revision;
    D.19786 = (int) D.19785;
    D.19787 = dest_aname->name;
    D.19731 = vset->major;
    D.19788 = (int) D.19731;
    D.19732 = vset->minor;
    D.19789 = (int) D.19732;
    D.19733 = vset->build;
    D.19790 = (int) D.19733;
    D.19734 = vset->revision;
    D.19791 = (int) D.19734;
    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.19723, D.19780, D.19782, D.19784, D.19786, D.19787, D.19788, D.19789, D.19790, D.19791);
    D.19726 = dest_aname;
    return D.19726;
  }
  <D.19730>:
  first = 0;
  last = 62;
  goto <D.17241>;
  <D.17240>:
  {
    int res;

    D.19792 = last - first;
    D.19793 = D.19792 / 2;
    pos = D.19793 + first;
    {
      size_t __s1_len;
      size_t __s2_len;

      D.19723 = aname->name;
      D.19794 = framework_assemblies[pos].assembly_name;
      res.80 = __builtin_strcmp (D.19723, D.19794);
    }
    res = res.80;
    if (res == 0) goto <D.19795>; else goto <D.19796>;
    <D.19795>:
    {
      const struct AssemblyVersionSet * vset;
      int index;

      D.19797 = framework_assemblies[pos].version_set_index;
      index = (int) D.19797;
      index.81 = (unsigned int) index;
      D.19799 = index.81 > 3;
      D.19800 = (long int) D.19799;
      D.19801 = __builtin_expect (D.19800, 0);
      if (D.19801 != 0) goto <D.19802>; else goto <D.19803>;
      <D.19802>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 995, "index < G_N_ELEMENTS (current_runtime->version_sets)");
      <D.19803>:
      vset = &current_runtime->version_sets[index];
      D.19779 = aname->major;
      D.19804 = vset->major;
      if (D.19779 == D.19804) goto <D.19805>; else goto <D.19806>;
      <D.19805>:
      D.19781 = aname->minor;
      D.19807 = vset->minor;
      if (D.19781 == D.19807) goto <D.19808>; else goto <D.19809>;
      <D.19808>:
      D.19783 = aname->build;
      D.19810 = vset->build;
      if (D.19783 == D.19810) goto <D.19811>; else goto <D.19812>;
      <D.19811>:
      D.19785 = aname->revision;
      D.19813 = vset->revision;
      if (D.19785 == D.19813) goto <D.19814>; else goto <D.19815>;
      <D.19814>:
      D.19726 = aname;
      return D.19726;
      <D.19815>:
      <D.19812>:
      <D.19809>:
      <D.19806>:
      D.19779 = aname->major;
      D.19781 = aname->minor;
      D.19816 = D.19779 | D.19781;
      D.19783 = aname->build;
      D.19817 = D.19816 | D.19783;
      D.19785 = aname->revision;
      D.19818 = D.19817 | D.19785;
      if (D.19818 != 0) goto <D.19819>; else goto <D.19820>;
      <D.19819>:
      D.19723 = aname->name;
      D.19779 = aname->major;
      D.19780 = (int) D.19779;
      D.19781 = aname->minor;
      D.19782 = (int) D.19781;
      D.19783 = aname->build;
      D.19784 = (int) D.19783;
      D.19785 = aname->revision;
      D.19786 = (int) D.19785;
      D.19804 = vset->major;
      D.19821 = (int) D.19804;
      D.19807 = vset->minor;
      D.19822 = (int) D.19807;
      D.19810 = vset->build;
      D.19823 = (int) D.19810;
      D.19813 = vset->revision;
      D.19824 = (int) D.19813;
      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.19723, D.19780, D.19782, D.19784, D.19786, D.19821, D.19822, D.19823, D.19824);
      <D.19820>:
      memcpy (dest_aname, aname, 60);
      D.19804 = vset->major;
      dest_aname->major = D.19804;
      D.19807 = vset->minor;
      dest_aname->minor = D.19807;
      D.19810 = vset->build;
      dest_aname->build = D.19810;
      D.19813 = vset->revision;
      dest_aname->revision = D.19813;
      D.19726 = dest_aname;
      return D.19726;
    }
    <D.19796>:
    if (res < 0) goto <D.19825>; else goto <D.19826>;
    <D.19825>:
    last = pos + -1;
    goto <D.19827>;
    <D.19826>:
    first = pos + 1;
    <D.19827>:
  }
  <D.17241>:
  if (first <= last) goto <D.17240>; else goto <D.17242>;
  <D.17242>:
  D.19726 = aname;
  return D.19726;
}


remap_keys (struct MonoAssemblyName * aname)
{
  int D.17205;
  const char * D.19831;
  const char * D.19832;
  mono_byte[17] * D.19834;
  const char * D.19835;
  int D.19836;
  const char * D.19837;
  unsigned int i.82;
  int i;

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

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

      D.19831 = aname->name;
      D.19832 = entry->name;
      D.17205 = __builtin_strcmp (D.19831, D.19832);
    }
    if (D.17205 != 0) goto <D.19829>; else goto <D.19833>;
    <D.19833>:
    D.19834 = &aname->public_key_token;
    D.19835 = entry->from;
    D.19836 = mono_public_tokens_are_equal (D.19834, D.19835);
    if (D.19836 == 0) goto <D.19829>; else goto <D.19830>;
    <D.19829>:
    // predicted unlikely by continue predictor.
    goto <D.17206>;
    <D.19830>:
    D.19834 = &aname->public_key_token;
    D.19837 = entry->to;
    memcpy (D.19834, D.19837, 17);
    D.19831 = aname->name;
    D.19835 = entry->from;
    D.19837 = entry->to;
    mono_trace (64, 1, "Remapped public key token of retargetable assembly %s from %s to %s", D.19831, D.19835, D.19837);
    return;
  }
  <D.17206>:
  i = i + 1;
  <D.17208>:
  i.82 = (unsigned int) i;
  if (i.82 <= 13) goto <D.17207>; else goto <D.17209>;
  <D.17209>:
}


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

  D.19841 = __builtin_object_size (__dest, 0);
  D.19840 = __builtin___memcpy_chk (__dest, __src, __len, D.19841);
  return D.19840;
}


invoke_assembly_preload_hook (struct MonoAssemblyName * aname, gchar * * assemblies_path)
{
  struct MonoAssembly * (*<Te92>) (struct MonoAssemblyName *, char * *, void *) D.19843;
  void * D.19844;
  struct MonoAssembly * D.19847;
  struct AssemblyPreLoadHook * hook;
  struct MonoAssembly * assembly;

  hook = assembly_preload_hook;
  goto <D.17370>;
  <D.17369>:
  D.19843 = hook->func;
  D.19844 = hook->user_data;
  assembly = D.19843 (aname, assemblies_path, D.19844);
  if (assembly != 0B) goto <D.19845>; else goto <D.19846>;
  <D.19845>:
  D.19847 = assembly;
  return D.19847;
  <D.19846>:
  hook = hook->next;
  <D.17370>:
  if (hook != 0B) goto <D.17369>; else goto <D.17371>;
  <D.17371>:
  D.19847 = 0B;
  return D.19847;
}


probe_for_partial_name (const char * basepath, const char * fullname, struct MonoAssemblyName * aname, MonoImageOpenStatus * status)
{
  struct MonoAssembly * D.19851;
  short unsigned int D.19852;
  short unsigned int D.19853;
  short unsigned int D.19854;
  short unsigned int D.19855;
  short unsigned int D.19856;
  short unsigned int D.19857;
  short unsigned int D.19858;
  _Bool D.19859;
  const char * D.19860;
  int D.19861;
  const char * D.19864;
  int D.17709;
  const char * D.19867;
  mono_byte[17] * D.19872;
  char D.19873;
  int D.19876;
  int iftmp.83;
  unsigned int D.19886;
  unsigned int D.19887;
  unsigned int D.19888;
  unsigned int D.19889;
  unsigned int D.19891;
  unsigned int D.19892;
  unsigned int D.19893;
  unsigned int D.19894;
  short unsigned int D.19897;
  int D.19898;
  short unsigned int D.19904;
  int D.19905;
  short unsigned int D.19911;
  int D.19912;
  short unsigned int D.19918;
  int D.19919;
  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.19849>; else goto <D.19850>;
      <D.19849>:
      D.19851 = 0B;
      return D.19851;
      <D.19850>:
      D.19852 = aname->major;
      D.19853 = aname->minor;
      D.19854 = D.19852 | D.19853;
      D.19855 = aname->build;
      D.19856 = D.19854 | D.19855;
      D.19857 = aname->revision;
      D.19858 = D.19856 | D.19857;
      D.19859 = D.19858 != 0;
      exact_version = (gboolean) D.19859;
      goto <D.17700>;
      <D.17710>:
      {
        gboolean match;

        match = 1;
        D.19860 = aname->name;
        D.19861 = parse_assembly_directory_name (D.19860, direntry, &gac_aname);
        if (D.19861 == 0) goto <D.19862>; else goto <D.19863>;
        <D.19862>:
        // predicted unlikely by continue predictor.
        goto <D.17700>;
        <D.19863>:
        D.19864 = aname->culture;
        if (D.19864 != 0B) goto <D.19865>; else goto <D.19866>;
        <D.19865>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.19864 = aname->culture;
          D.19867 = gac_aname.culture;
          D.17709 = __builtin_strcmp (D.19864, D.19867);
        }
        if (D.17709 != 0) goto <D.19868>; else goto <D.19869>;
        <D.19868>:
        match = 0;
        <D.19869>:
        <D.19866>:
        if (match != 0) goto <D.19870>; else goto <D.19871>;
        <D.19870>:
        D.19872 = &aname->public_key_token;
        D.19873 = MEM[(const char *)D.19872];
        if (D.19873 != 0) goto <D.19874>; else goto <D.19875>;
        <D.19874>:
        D.19872 = &aname->public_key_token;
        D.19876 = mono_public_tokens_are_equal (D.19872, &gac_aname.public_key_token);
        if (D.19876 == 0) goto <D.19877>; else goto <D.19878>;
        <D.19877>:
        match = 0;
        <D.19878>:
        <D.19875>:
        <D.19871>:
        if (match != 0) goto <D.19879>; else goto <D.19880>;
        <D.19879>:
        if (exact_version != 0) goto <D.19881>; else goto <D.19882>;
        <D.19881>:
        D.19886 = BIT_FIELD_REF <*aname, 32, 384>;
        D.19887 = D.19886;
        D.19888 = BIT_FIELD_REF <gac_aname, 32, 384>;
        D.19889 = D.19888;
        if (D.19887 == D.19889) goto <D.19890>; else goto <D.19884>;
        <D.19890>:
        D.19891 = BIT_FIELD_REF <*aname, 32, 416>;
        D.19892 = D.19891;
        D.19893 = BIT_FIELD_REF <gac_aname, 32, 416>;
        D.19894 = D.19893;
        if (D.19892 == D.19894) goto <D.19895>; else goto <D.19884>;
        <D.19895>:
        iftmp.83 = 1;
        goto <D.19885>;
        <D.19884>:
        iftmp.83 = 0;
        <D.19885>:
        match = iftmp.83;
        goto <D.19896>;
        <D.19882>:
        D.19897 = gac_aname.major;
        D.19898 = (int) D.19897;
        if (D.19898 < major) goto <D.19899>; else goto <D.19900>;
        <D.19899>:
        match = 0;
        goto <D.19901>;
        <D.19900>:
        D.19897 = gac_aname.major;
        D.19898 = (int) D.19897;
        if (D.19898 == major) goto <D.19902>; else goto <D.19903>;
        <D.19902>:
        D.19904 = gac_aname.minor;
        D.19905 = (int) D.19904;
        if (D.19905 < minor) goto <D.19906>; else goto <D.19907>;
        <D.19906>:
        match = 0;
        goto <D.19908>;
        <D.19907>:
        D.19904 = gac_aname.minor;
        D.19905 = (int) D.19904;
        if (D.19905 == minor) goto <D.19909>; else goto <D.19910>;
        <D.19909>:
        D.19911 = gac_aname.build;
        D.19912 = (int) D.19911;
        if (D.19912 < build) goto <D.19913>; else goto <D.19914>;
        <D.19913>:
        match = 0;
        goto <D.19915>;
        <D.19914>:
        D.19911 = gac_aname.build;
        D.19912 = (int) D.19911;
        if (D.19912 == build) goto <D.19916>; else goto <D.19917>;
        <D.19916>:
        D.19918 = gac_aname.revision;
        D.19919 = (int) D.19918;
        if (D.19919 <= revision) goto <D.19920>; else goto <D.19921>;
        <D.19920>:
        match = 0;
        <D.19921>:
        <D.19917>:
        <D.19915>:
        <D.19910>:
        <D.19908>:
        <D.19903>:
        <D.19901>:
        <D.19896>:
        <D.19880>:
        if (match != 0) goto <D.19922>; else goto <D.19923>;
        <D.19922>:
        D.19897 = gac_aname.major;
        major = (gint) D.19897;
        D.19904 = gac_aname.minor;
        minor = (gint) D.19904;
        D.19911 = gac_aname.build;
        build = (gint) D.19911;
        D.19918 = gac_aname.revision;
        revision = (gint) D.19918;
        monoeg_g_free (fullpath);
        fullpath = monoeg_g_build_path ("/", basepath, direntry, fullname, 0B);
        <D.19923>:
        mono_assembly_name_free (&gac_aname);
      }
      <D.17700>:
      direntry = monoeg_g_dir_read_name (dirhandle);
      if (direntry != 0B) goto <D.17710>; else goto <D.17711>;
      <D.17711>:
      monoeg_g_dir_close (dirhandle);
      if (fullpath == 0B) goto <D.19924>; else goto <D.19925>;
      <D.19924>:
      D.19851 = 0B;
      return D.19851;
      <D.19925>:
      {
        struct MonoAssembly * res;

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


parse_assembly_directory_name (const char * name, const char * dirname, struct MonoAssemblyName * aname)
{
  gchar * D.19931;
  gchar * * D.19933;
  gchar * D.19934;
  gchar * * D.19936;
  gchar * D.19937;
  gboolean D.19938;
  gchar * * parts;
  gboolean res;

  parts = monoeg_g_strsplit (dirname, "_", 3);
  if (parts == 0B) goto <D.19928>; else goto <D.19930>;
  <D.19930>:
  D.19931 = *parts;
  if (D.19931 == 0B) goto <D.19928>; else goto <D.19932>;
  <D.19932>:
  D.19933 = parts + 4;
  D.19934 = *D.19933;
  if (D.19934 == 0B) goto <D.19928>; else goto <D.19935>;
  <D.19935>:
  D.19936 = parts + 8;
  D.19937 = *D.19936;
  if (D.19937 == 0B) goto <D.19928>; else goto <D.19929>;
  <D.19928>:
  monoeg_g_strfreev (parts);
  D.19938 = 0;
  return D.19938;
  <D.19929>:
  D.19931 = *parts;
  D.19933 = parts + 4;
  D.19934 = *D.19933;
  D.19936 = parts + 8;
  D.19937 = *D.19936;
  res = build_assembly_name (name, D.19931, D.19934, D.19937, 0B, 0, 0, aname, 0);
  monoeg_g_strfreev (parts);
  D.19938 = res;
  return D.19938;
}


mono_assembly_load_corlib (const struct MonoRuntimeInfo * runtime, MonoImageOpenStatus * status)
{
  struct MonoAssembly * corlib.84;
  struct MonoAssembly * D.19943;
  char * * assemblies_path.85;
  struct MonoAssembly * corlib.86;
  struct MonoAssembly * corlib.87;
  const char[4] * D.19953;
  struct MonoAssembly * corlib.88;
  struct MonoAssembly * corlib.89;
  int D.17914;
  int iftmp.90;
  int D.17913;
  const char[4] * D.19965;
  unsigned char D.19966;
  int D.19967;
  unsigned char D.19968;
  int D.19969;
  const unsigned char * D.19974;
  unsigned char D.19975;
  int D.19976;
  const unsigned char * D.19977;
  unsigned char D.19978;
  int D.19979;
  const unsigned char * D.19984;
  unsigned char D.19985;
  int D.19986;
  const unsigned char * D.19987;
  unsigned char D.19988;
  int D.19989;
  const unsigned char * D.19994;
  unsigned char D.19995;
  int D.19996;
  const unsigned char * D.19997;
  unsigned char D.19998;
  int D.19999;
  const char * D.20003;
  gchar * D.20004;
  char * corlib_file;
  struct MonoAssemblyName * aname;

  corlib.84 = corlib;
  if (corlib.84 != 0B) goto <D.19941>; else goto <D.19942>;
  <D.19941>:
  D.19943 = corlib;
  return D.19943;
  <D.19942>:
  aname = mono_assembly_name_new ("mscorlib.dll");
  assemblies_path.85 = assemblies_path;
  corlib.86 = invoke_assembly_preload_hook (aname, assemblies_path.85);
  corlib = corlib.86;
  mono_assembly_name_free (aname);
  monoeg_g_free (aname);
  corlib.84 = corlib;
  if (corlib.84 != 0B) goto <D.19946>; else goto <D.19947>;
  <D.19946>:
  D.19943 = corlib;
  return D.19943;
  <D.19947>:
  assemblies_path.85 = assemblies_path;
  if (assemblies_path.85 != 0B) goto <D.19948>; else goto <D.19949>;
  <D.19948>:
  assemblies_path.85 = assemblies_path;
  corlib.87 = load_in_path ("mscorlib.dll", assemblies_path.85, status, 0);
  corlib = corlib.87;
  corlib.84 = corlib;
  if (corlib.84 != 0B) goto <D.19951>; else goto <D.19952>;
  <D.19951>:
  D.19943 = corlib;
  return D.19943;
  <D.19952>:
  <D.19949>:
  D.19953 = &runtime->framework_version;
  corlib_file = monoeg_g_build_path ("/", "mono", D.19953, "mscorlib.dll", 0B);
  assemblies_path.85 = assemblies_path;
  if (assemblies_path.85 != 0B) goto <D.19954>; else goto <D.19955>;
  <D.19954>:
  assemblies_path.85 = assemblies_path;
  corlib.88 = load_in_path (corlib_file, assemblies_path.85, status, 0);
  corlib = corlib.88;
  corlib.84 = corlib;
  if (corlib.84 != 0B) goto <D.19957>; else goto <D.19958>;
  <D.19957>:
  monoeg_g_free (corlib_file);
  D.19943 = corlib;
  return D.19943;
  <D.19958>:
  <D.19955>:
  corlib.89 = load_in_path (corlib_file, &default_path, status, 0);
  corlib = corlib.89;
  monoeg_g_free (corlib_file);
  corlib.84 = corlib;
  if (corlib.84 != 0B) goto <D.19960>; else goto <D.19961>;
  <D.19960>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &runtime->framework_version;
      D.19965 = "4.5";
      D.19966 = MEM[(const unsigned char *)D.19965];
      D.19967 = (int) D.19966;
      D.19968 = *__s2;
      D.19969 = (int) D.19968;
      __result = D.19967 - D.19969;
      {
        if (__s2_len != 0) goto <D.19970>; else goto <D.19971>;
        <D.19970>:
        if (__result == 0) goto <D.19972>; else goto <D.19973>;
        <D.19972>:
        D.19974 = &MEM[(void *)"4.5" + 1B];
        D.19975 = *D.19974;
        D.19976 = (int) D.19975;
        D.19977 = __s2 + 1;
        D.19978 = *D.19977;
        D.19979 = (int) D.19978;
        __result = D.19976 - D.19979;
        if (__s2_len > 1) goto <D.19980>; else goto <D.19981>;
        <D.19980>:
        if (__result == 0) goto <D.19982>; else goto <D.19983>;
        <D.19982>:
        D.19984 = &MEM[(void *)"4.5" + 2B];
        D.19985 = *D.19984;
        D.19986 = (int) D.19985;
        D.19987 = __s2 + 2;
        D.19988 = *D.19987;
        D.19989 = (int) D.19988;
        __result = D.19986 - D.19989;
        if (__s2_len > 2) goto <D.19990>; else goto <D.19991>;
        <D.19990>:
        if (__result == 0) goto <D.19992>; else goto <D.19993>;
        <D.19992>:
        D.19994 = &MEM[(void *)"4.5" + 3B];
        D.19995 = *D.19994;
        D.19996 = (int) D.19995;
        D.19997 = __s2 + 3;
        D.19998 = *D.19997;
        D.19999 = (int) D.19998;
        __result = D.19996 - D.19999;
        <D.19993>:
        <D.19991>:
        <D.19983>:
        <D.19981>:
        <D.19973>:
        <D.19971>:
      }
      D.17913 = __result;
    }
    iftmp.90 = -D.17913;
    goto <D.20000>;
    <D.19964>:
    D.19953 = &runtime->framework_version;
    iftmp.90 = __builtin_strcmp (D.19953, "4.5");
    <D.20000>:
    D.17914 = iftmp.90;
  }
  if (D.17914 == 0) goto <D.20001>; else goto <D.20002>;
  <D.20001>:
  D.20003 = default_path[0];
  D.20004 = monoeg_g_strdup_printf ("%s/mono/4.5/Facades", D.20003);
  default_path[1] = D.20004;
  <D.20002>:
  <D.19961>:
  D.19943 = corlib;
  return D.19943;
}


load_in_path (const char * basename, const char * * search_path, MonoImageOpenStatus * status, MonoBoolean refonly)
{
  unsigned int i.91;
  unsigned int D.20007;
  const char * * D.20008;
  const char * D.20009;
  int D.20010;
  struct MonoAssembly * D.20013;
  int i;
  char * fullpath;
  struct MonoAssembly * result;

  i = 0;
  goto <D.17039>;
  <D.17038>:
  i.91 = (unsigned int) i;
  D.20007 = i.91 * 4;
  D.20008 = search_path + D.20007;
  D.20009 = *D.20008;
  fullpath = monoeg_g_build_path ("/", D.20009, basename, 0B);
  D.20010 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.20010);
  monoeg_g_free (fullpath);
  if (result != 0B) goto <D.20011>; else goto <D.20012>;
  <D.20011>:
  D.20013 = result;
  return D.20013;
  <D.20012>:
  i = i + 1;
  <D.17039>:
  i.91 = (unsigned int) i;
  D.20007 = i.91 * 4;
  D.20008 = search_path + D.20007;
  D.20009 = *D.20008;
  if (D.20009 != 0B) goto <D.17038>; else goto <D.17040>;
  <D.17040>:
  D.20013 = 0B;
  return D.20013;
}


mono_assembly_load_full_nosearch (struct MonoAssemblyName * aname, const char * basedir, MonoImageOpenStatus * status, gboolean refonly)
{
  struct MonoAssembly * D.20019;
  struct MonoAssembly * iftmp.92;
  char * * assemblies_path.93;
  int D.17937;
  int iftmp.94;
  int D.17936;
  const char[9] * D.20032;
  unsigned char D.20033;
  int 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 unsigned char * D.20051;
  unsigned char D.20052;
  int D.20053;
  const unsigned char * D.20054;
  unsigned char D.20055;
  int D.20056;
  const unsigned char * D.20061;
  unsigned char D.20062;
  int D.20063;
  const unsigned char * D.20064;
  unsigned char D.20065;
  int D.20066;
  const char * D.20068;
  int D.17946;
  int iftmp.95;
  int D.17945;
  const char[13] * D.20073;
  unsigned char D.20074;
  int D.20075;
  unsigned char D.20076;
  int D.20077;
  const unsigned char * D.20082;
  unsigned char D.20083;
  int D.20084;
  const unsigned char * D.20085;
  unsigned char D.20086;
  int D.20087;
  const unsigned char * D.20092;
  unsigned char D.20093;
  int D.20094;
  const unsigned char * D.20095;
  unsigned char D.20096;
  int D.20097;
  const unsigned char * D.20102;
  unsigned char D.20103;
  int D.20104;
  const unsigned char * D.20105;
  unsigned char D.20106;
  int D.20107;
  const struct MonoRuntimeInfo * D.20109;
  unsigned int D.20110;
  const char * iftmp.96;
  int D.17955;
  int iftmp.97;
  int D.17954;
  sizetype len.98;
  sizetype D.20123;
  const char[5] * D.20124;
  unsigned char D.20125;
  int D.20126;
  unsigned char D.20127;
  int D.20128;
  const unsigned char * D.20133;
  unsigned char D.20134;
  int D.20135;
  const unsigned char * D.20136;
  unsigned char D.20137;
  int D.20138;
  const unsigned char * D.20143;
  unsigned char D.20144;
  int D.20145;
  const unsigned char * D.20146;
  unsigned char D.20147;
  int D.20148;
  const unsigned char * D.20153;
  unsigned char D.20154;
  int D.20155;
  const unsigned char * D.20156;
  unsigned char D.20157;
  int D.20158;
  const char * D.20160;
  int D.17964;
  int iftmp.99;
  int D.17963;
  const char[5] * D.20165;
  unsigned char D.20166;
  int D.20167;
  unsigned char D.20168;
  int D.20169;
  const unsigned char * D.20174;
  unsigned char D.20175;
  int D.20176;
  const unsigned char * D.20177;
  unsigned char D.20178;
  int D.20179;
  const unsigned char * D.20184;
  unsigned char D.20185;
  int D.20186;
  const unsigned char * D.20187;
  unsigned char D.20188;
  int D.20189;
  const unsigned char * D.20194;
  unsigned char D.20195;
  int D.20196;
  const unsigned char * D.20197;
  unsigned char D.20198;
  int D.20199;
  unsigned char D.20201;
  int D.20202;
  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.20015>; else goto <D.20016>;
      <D.20015>:
      aname = mono_assembly_apply_binding (aname, &maped_name_pp);
      <D.20016>:
      result = mono_assembly_loaded_full (aname, refonly);
      if (result != 0B) goto <D.20017>; else goto <D.20018>;
      <D.20017>:
      D.20019 = result;
      return D.20019;
      <D.20018>:
      if (refonly != 0) goto <D.20021>; else goto <D.20022>;
      <D.20021>:
      assemblies_path.93 = assemblies_path;
      iftmp.92 = invoke_assembly_refonly_preload_hook (aname, assemblies_path.93);
      goto <D.20024>;
      <D.20022>:
      assemblies_path.93 = assemblies_path;
      iftmp.92 = invoke_assembly_preload_hook (aname, assemblies_path.93);
      <D.20024>:
      result = iftmp.92;
      if (result != 0B) goto <D.20025>; else goto <D.20026>;
      <D.20025>:
      result->in_gac = 0;
      D.20019 = result;
      return D.20019;
      <D.20026>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname->name;
          D.20032 = "mscorlib";
          D.20033 = MEM[(const unsigned char *)D.20032];
          D.20034 = (int) D.20033;
          D.20035 = *__s2;
          D.20036 = (int) D.20035;
          __result = D.20034 - D.20036;
          {
            if (__s2_len != 0) 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" + 1B];
            D.20042 = *D.20041;
            D.20043 = (int) D.20042;
            D.20044 = __s2 + 1;
            D.20045 = *D.20044;
            D.20046 = (int) D.20045;
            __result = D.20043 - D.20046;
            if (__s2_len > 1) goto <D.20047>; else goto <D.20048>;
            <D.20047>:
            if (__result == 0) goto <D.20049>; else goto <D.20050>;
            <D.20049>:
            D.20051 = &MEM[(void *)"mscorlib" + 2B];
            D.20052 = *D.20051;
            D.20053 = (int) D.20052;
            D.20054 = __s2 + 2;
            D.20055 = *D.20054;
            D.20056 = (int) D.20055;
            __result = D.20053 - D.20056;
            if (__s2_len > 2) goto <D.20057>; else goto <D.20058>;
            <D.20057>:
            if (__result == 0) goto <D.20059>; else goto <D.20060>;
            <D.20059>:
            D.20061 = &MEM[(void *)"mscorlib" + 3B];
            D.20062 = *D.20061;
            D.20063 = (int) D.20062;
            D.20064 = __s2 + 3;
            D.20065 = *D.20064;
            D.20066 = (int) D.20065;
            __result = D.20063 - D.20066;
            <D.20060>:
            <D.20058>:
            <D.20050>:
            <D.20048>:
            <D.20040>:
            <D.20038>:
          }
          D.17936 = __result;
        }
        iftmp.94 = -D.17936;
        goto <D.20067>;
        <D.20031>:
        D.20068 = aname->name;
        iftmp.94 = __builtin_strcmp (D.20068, "mscorlib");
        <D.20067>:
        D.17937 = iftmp.94;
      }
      if (D.17937 == 0) goto <D.20027>; else goto <D.20069>;
      <D.20069>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = aname->name;
          D.20073 = "mscorlib.dll";
          D.20074 = MEM[(const unsigned char *)D.20073];
          D.20075 = (int) D.20074;
          D.20076 = *__s2;
          D.20077 = (int) D.20076;
          __result = D.20075 - D.20077;
          {
            if (__s2_len != 0) goto <D.20078>; else goto <D.20079>;
            <D.20078>:
            if (__result == 0) goto <D.20080>; else goto <D.20081>;
            <D.20080>:
            D.20082 = &MEM[(void *)"mscorlib.dll" + 1B];
            D.20083 = *D.20082;
            D.20084 = (int) D.20083;
            D.20085 = __s2 + 1;
            D.20086 = *D.20085;
            D.20087 = (int) D.20086;
            __result = D.20084 - D.20087;
            if (__s2_len > 1) goto <D.20088>; else goto <D.20089>;
            <D.20088>:
            if (__result == 0) goto <D.20090>; else goto <D.20091>;
            <D.20090>:
            D.20092 = &MEM[(void *)"mscorlib.dll" + 2B];
            D.20093 = *D.20092;
            D.20094 = (int) D.20093;
            D.20095 = __s2 + 2;
            D.20096 = *D.20095;
            D.20097 = (int) D.20096;
            __result = D.20094 - D.20097;
            if (__s2_len > 2) goto <D.20098>; else goto <D.20099>;
            <D.20098>:
            if (__result == 0) goto <D.20100>; else goto <D.20101>;
            <D.20100>:
            D.20102 = &MEM[(void *)"mscorlib.dll" + 3B];
            D.20103 = *D.20102;
            D.20104 = (int) D.20103;
            D.20105 = __s2 + 3;
            D.20106 = *D.20105;
            D.20107 = (int) D.20106;
            __result = D.20104 - D.20107;
            <D.20101>:
            <D.20099>:
            <D.20091>:
            <D.20089>:
            <D.20081>:
            <D.20079>:
          }
          D.17945 = __result;
        }
        iftmp.95 = -D.17945;
        goto <D.20108>;
        <D.20072>:
        D.20068 = aname->name;
        iftmp.95 = __builtin_strcmp (D.20068, "mscorlib.dll");
        <D.20108>:
        D.17946 = iftmp.95;
      }
      if (D.17946 == 0) goto <D.20027>; else goto <D.20028>;
      <D.20027>:
      D.20109 = mono_get_runtime_info ();
      D.20019 = mono_assembly_load_corlib (D.20109, status);
      return D.20019;
      <D.20028>:
      D.20068 = aname->name;
      D.20110 = strlen (D.20068);
      len = (int) D.20110;
      ext_index = 0;
      goto <D.17966>;
      <D.17965>:
      if (ext_index == 0) goto <D.20112>; else goto <D.20113>;
      <D.20112>:
      iftmp.96 = ".dll";
      goto <D.20114>;
      <D.20113>:
      iftmp.96 = ".exe";
      <D.20114>:
      ext = iftmp.96;
      if (len > 4) goto <D.20118>; else goto <D.20115>;
      <D.20118>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          D.20068 = aname->name;
          len.98 = (sizetype) len;
          D.20123 = len.98 + 4294967292;
          __s2 = D.20068 + D.20123;
          D.20124 = ".dll";
          D.20125 = MEM[(const unsigned char *)D.20124];
          D.20126 = (int) D.20125;
          D.20127 = *__s2;
          D.20128 = (int) D.20127;
          __result = D.20126 - D.20128;
          {
            if (__s2_len != 0) goto <D.20129>; else goto <D.20130>;
            <D.20129>:
            if (__result == 0) goto <D.20131>; else goto <D.20132>;
            <D.20131>:
            D.20133 = &MEM[(void *)".dll" + 1B];
            D.20134 = *D.20133;
            D.20135 = (int) D.20134;
            D.20136 = __s2 + 1;
            D.20137 = *D.20136;
            D.20138 = (int) D.20137;
            __result = D.20135 - D.20138;
            if (__s2_len > 1) goto <D.20139>; else goto <D.20140>;
            <D.20139>:
            if (__result == 0) goto <D.20141>; else goto <D.20142>;
            <D.20141>:
            D.20143 = &MEM[(void *)".dll" + 2B];
            D.20144 = *D.20143;
            D.20145 = (int) D.20144;
            D.20146 = __s2 + 2;
            D.20147 = *D.20146;
            D.20148 = (int) D.20147;
            __result = D.20145 - D.20148;
            if (__s2_len > 2) goto <D.20149>; else goto <D.20150>;
            <D.20149>:
            if (__result == 0) goto <D.20151>; else goto <D.20152>;
            <D.20151>:
            D.20153 = &MEM[(void *)".dll" + 3B];
            D.20154 = *D.20153;
            D.20155 = (int) D.20154;
            D.20156 = __s2 + 3;
            D.20157 = *D.20156;
            D.20158 = (int) D.20157;
            __result = D.20155 - D.20158;
            <D.20152>:
            <D.20150>:
            <D.20142>:
            <D.20140>:
            <D.20132>:
            <D.20130>:
          }
          D.17954 = __result;
        }
        iftmp.97 = -D.17954;
        goto <D.20159>;
        <D.20121>:
        D.20068 = aname->name;
        len.98 = (sizetype) len;
        D.20123 = len.98 + 4294967292;
        D.20160 = D.20068 + D.20123;
        iftmp.97 = __builtin_strcmp (D.20160, ".dll");
        <D.20159>:
        D.17955 = iftmp.97;
      }
      if (D.17955 == 0) goto <D.20116>; else goto <D.20161>;
      <D.20161>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          D.20068 = aname->name;
          len.98 = (sizetype) len;
          D.20123 = len.98 + 4294967292;
          __s2 = D.20068 + D.20123;
          D.20165 = ".exe";
          D.20166 = MEM[(const unsigned char *)D.20165];
          D.20167 = (int) D.20166;
          D.20168 = *__s2;
          D.20169 = (int) D.20168;
          __result = D.20167 - D.20169;
          {
            if (__s2_len != 0) goto <D.20170>; else goto <D.20171>;
            <D.20170>:
            if (__result == 0) goto <D.20172>; else goto <D.20173>;
            <D.20172>:
            D.20174 = &MEM[(void *)".exe" + 1B];
            D.20175 = *D.20174;
            D.20176 = (int) D.20175;
            D.20177 = __s2 + 1;
            D.20178 = *D.20177;
            D.20179 = (int) D.20178;
            __result = D.20176 - D.20179;
            if (__s2_len > 1) goto <D.20180>; else goto <D.20181>;
            <D.20180>:
            if (__result == 0) goto <D.20182>; else goto <D.20183>;
            <D.20182>:
            D.20184 = &MEM[(void *)".exe" + 2B];
            D.20185 = *D.20184;
            D.20186 = (int) D.20185;
            D.20187 = __s2 + 2;
            D.20188 = *D.20187;
            D.20189 = (int) D.20188;
            __result = D.20186 - D.20189;
            if (__s2_len > 2) goto <D.20190>; else goto <D.20191>;
            <D.20190>:
            if (__result == 0) goto <D.20192>; else goto <D.20193>;
            <D.20192>:
            D.20194 = &MEM[(void *)".exe" + 3B];
            D.20195 = *D.20194;
            D.20196 = (int) D.20195;
            D.20197 = __s2 + 3;
            D.20198 = *D.20197;
            D.20199 = (int) D.20198;
            __result = D.20196 - D.20199;
            <D.20193>:
            <D.20191>:
            <D.20183>:
            <D.20181>:
            <D.20173>:
            <D.20171>:
          }
          D.17963 = __result;
        }
        iftmp.99 = -D.17963;
        goto <D.20200>;
        <D.20164>:
        D.20068 = aname->name;
        len.98 = (sizetype) len;
        D.20123 = len.98 + 4294967292;
        D.20160 = D.20068 + D.20123;
        iftmp.99 = __builtin_strcmp (D.20160, ".exe");
        <D.20200>:
        D.17964 = iftmp.99;
      }
      if (D.17964 == 0) goto <D.20116>; else goto <D.20115>;
      <D.20116>:
      D.20068 = aname->name;
      filename = monoeg_strdup (D.20068);
      ext_index = ext_index + 1;
      goto <D.20117>;
      <D.20115>:
      D.20068 = aname->name;
      filename = monoeg_g_strconcat (D.20068, ext, 0B);
      <D.20117>:
      D.20201 = (unsigned char) refonly;
      D.20202 = (int) D.20201;
      result = mono_assembly_load_from_gac (aname, filename, status, D.20202);
      if (result != 0B) goto <D.20203>; else goto <D.20204>;
      <D.20203>:
      monoeg_g_free (filename);
      D.20019 = result;
      return D.20019;
      <D.20204>:
      if (basedir != 0B) goto <D.20205>; else goto <D.20206>;
      <D.20205>:
      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.20207>; else goto <D.20208>;
      <D.20207>:
      result->in_gac = 0;
      monoeg_g_free (filename);
      D.20019 = result;
      return D.20019;
      <D.20208>:
      <D.20206>:
      D.20201 = (unsigned char) refonly;
      D.20202 = (int) D.20201;
      result = load_in_path (filename, &default_path, status, D.20202);
      if (result != 0B) goto <D.20209>; else goto <D.20210>;
      <D.20209>:
      result->in_gac = 0;
      <D.20210>:
      monoeg_g_free (filename);
      if (result != 0B) goto <D.20211>; else goto <D.20212>;
      <D.20211>:
      D.20019 = result;
      return D.20019;
      <D.20212>:
      ext_index = ext_index + 1;
      <D.17966>:
      if (ext_index <= 1) goto <D.17965>; else goto <D.17967>;
      <D.17967>:
      D.20019 = result;
      return D.20019;
    }
  finally
    {
      maped_aname = {CLOBBER};
      maped_name_pp = {CLOBBER};
    }
}


mono_assembly_apply_binding (struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_name)
{
  unsigned char D.20215;
  struct MonoAssemblyName * D.20218;
  union mono_mutex_t * D.20221;
  _Bool D.20224;
  long int D.20225;
  long int D.20226;
  _Bool D.20231;
  long int D.20232;
  long int D.20233;
  int D.20238;
  struct MonoAppDomainSetup * D.20243;
  struct MonoString * D.20246;
  _Bool D.20251;
  long int D.20252;
  long int D.20253;
  int D.20256;
  short unsigned int D.20261;
  int D.20262;
  short unsigned int D.20263;
  int D.20264;
  char * D.20269;
  gchar * D.20270;
  char * D.20271;
  gchar * D.20272;
  int D.20273;
  _Bool D.20276;
  long int D.20277;
  long int D.20278;
  unsigned int D.20283;
  unsigned int D.20284;
  const char * D.20291;
  gchar * D.20292;
  const char * D.20293;
  gchar * D.20294;
  guchar[17] * D.20295;
  mono_byte[17] * D.20296;
  struct GSList * loaded_assembly_bindings.100;
  struct GSList * loaded_assembly_bindings.101;
  int D.20305;
  struct MonoAssemblyBindingInfo * info;
  struct MonoAssemblyBindingInfo * info2;
  struct MonoImage * ppimage;
  struct MonoDomain * domain;

  D.20215 = aname->public_key_token[0];
  if (D.20215 == 0) goto <D.20216>; else goto <D.20217>;
  <D.20216>:
  D.20218 = aname;
  return D.20218;
  <D.20217>:
  domain = mono_domain_get ();
  mono_assembly_binding_lock ();
  info = search_binding_loaded (aname);
  mono_assembly_binding_unlock ();
  if (info == 0B) goto <D.20219>; else goto <D.20220>;
  <D.20219>:
  {
    int ret;

    D.20221 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.20221);
    if (ret != 0) goto <D.20222>; else goto <D.20223>;
    <D.20222>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20223>:
    D.20224 = ret != 0;
    D.20225 = (long int) D.20224;
    D.20226 = __builtin_expect (D.20225, 0);
    if (D.20226 != 0) goto <D.20227>; else goto <D.20228>;
    <D.20227>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2644, "ret == 0");
    <D.20228>:
  }
  info = get_per_domain_assembly_binding_info (domain, aname);
  {
    int ret;

    D.20221 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.20221);
    if (ret != 0) goto <D.20229>; else goto <D.20230>;
    <D.20229>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20230>:
    D.20231 = ret != 0;
    D.20232 = (long int) D.20231;
    D.20233 = __builtin_expect (D.20232, 0);
    if (D.20233 != 0) goto <D.20234>; else goto <D.20235>;
    <D.20234>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2646, "ret == 0");
    <D.20235>:
  }
  <D.20220>:
  if (info != 0B) goto <D.20236>; else goto <D.20237>;
  <D.20236>:
  D.20238 = check_policy_versions (info, aname);
  if (D.20238 == 0) goto <D.20239>; else goto <D.20240>;
  <D.20239>:
  D.20218 = aname;
  return D.20218;
  <D.20240>:
  mono_assembly_bind_version (info, aname, dest_name);
  D.20218 = dest_name;
  return D.20218;
  <D.20237>:
  if (domain != 0B) goto <D.20241>; else goto <D.20242>;
  <D.20241>:
  D.20243 = domain->setup;
  if (D.20243 != 0B) goto <D.20244>; else goto <D.20245>;
  <D.20244>:
  D.20243 = domain->setup;
  D.20246 = D.20243->configuration_file;
  if (D.20246 != 0B) goto <D.20247>; else goto <D.20248>;
  <D.20247>:
  {
    int ret;

    D.20221 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.20221);
    if (ret != 0) goto <D.20249>; else goto <D.20250>;
    <D.20249>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20250>:
    D.20251 = ret != 0;
    D.20252 = (long int) D.20251;
    D.20253 = __builtin_expect (D.20252, 0);
    if (D.20253 != 0) goto <D.20254>; else goto <D.20255>;
    <D.20254>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2658, "ret == 0");
    <D.20255>:
  }
  D.20256 = domain->assembly_bindings_parsed;
  if (D.20256 == 0) goto <D.20257>; else goto <D.20258>;
  <D.20257>:
  {
    gchar * domain_config_file_name;
    gchar * domain_config_file_path;

    D.20243 = domain->setup;
    D.20246 = D.20243->configuration_file;
    domain_config_file_name = mono_string_to_utf8 (D.20246);
    domain_config_file_path = mono_portability_find_file (domain_config_file_name, 1);
    if (domain_config_file_path == 0B) goto <D.20259>; else goto <D.20260>;
    <D.20259>:
    domain_config_file_path = domain_config_file_name;
    <D.20260>:
    D.20261 = aname->major;
    D.20262 = (int) D.20261;
    D.20263 = aname->minor;
    D.20264 = (int) D.20263;
    mono_config_parse_assembly_bindings (domain_config_file_path, D.20262, D.20264, domain, assembly_binding_info_parsed);
    domain->assembly_bindings_parsed = 1;
    if (domain_config_file_name != domain_config_file_path) goto <D.20265>; else goto <D.20266>;
    <D.20265>:
    monoeg_g_free (domain_config_file_name);
    <D.20266>:
    monoeg_g_free (domain_config_file_path);
  }
  <D.20258>:
  info2 = get_per_domain_assembly_binding_info (domain, aname);
  if (info2 != 0B) goto <D.20267>; else goto <D.20268>;
  <D.20267>:
  info = monoeg_g_memdup (info2, 68);
  D.20269 = info2->name;
  D.20270 = monoeg_strdup (D.20269);
  info->name = D.20270;
  D.20271 = info2->culture;
  D.20272 = monoeg_strdup (D.20271);
  info->culture = D.20272;
  D.20273 = domain->domain_id;
  info->domain_id = D.20273;
  <D.20268>:
  {
    int ret;

    D.20221 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.20221);
    if (ret != 0) goto <D.20274>; else goto <D.20275>;
    <D.20274>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20275>:
    D.20276 = ret != 0;
    D.20277 = (long int) D.20276;
    D.20278 = __builtin_expect (D.20277, 0);
    if (D.20278 != 0) goto <D.20279>; else goto <D.20280>;
    <D.20279>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 2682, "ret == 0");
    <D.20280>:
  }
  <D.20248>:
  <D.20245>:
  <D.20242>:
  if (info == 0B) goto <D.20281>; else goto <D.20282>;
  <D.20281>:
  info = monoeg_malloc0 (68);
  D.20261 = aname->major;
  D.20262 = (int) D.20261;
  info->major = D.20262;
  D.20263 = aname->minor;
  D.20264 = (int) D.20263;
  info->minor = D.20264;
  <D.20282>:
  D.20283 = BIT_FIELD_REF <*info, 32, 480>;
  D.20284 = D.20283 & 8;
  if (D.20284 == 0) goto <D.20285>; else goto <D.20286>;
  <D.20285>:
  ppimage = mono_assembly_load_publisher_policy (aname);
  if (ppimage != 0B) goto <D.20287>; else goto <D.20288>;
  <D.20287>:
  get_publisher_policy_info (ppimage, aname, info);
  mono_image_close (ppimage);
  <D.20288>:
  <D.20286>:
  D.20283 = BIT_FIELD_REF <*info, 32, 480>;
  D.20284 = D.20283 & 8;
  if (D.20284 == 0) goto <D.20289>; else goto <D.20290>;
  <D.20289>:
  D.20291 = aname->name;
  D.20292 = monoeg_strdup (D.20291);
  info->name = D.20292;
  D.20293 = aname->culture;
  D.20294 = monoeg_strdup (D.20293);
  info->culture = D.20294;
  D.20295 = &info->public_key_token;
  D.20296 = &aname->public_key_token;
  monoeg_g_strlcpy (D.20295, D.20296, 17);
  <D.20290>:
  mono_assembly_binding_lock ();
  info2 = search_binding_loaded (aname);
  if (info2 != 0B) goto <D.20297>; else goto <D.20298>;
  <D.20297>:
  mono_assembly_binding_info_free (info);
  monoeg_g_free (info);
  info = info2;
  goto <D.20299>;
  <D.20298>:
  loaded_assembly_bindings.100 = loaded_assembly_bindings;
  loaded_assembly_bindings.101 = monoeg_g_slist_prepend (loaded_assembly_bindings.100, info);
  loaded_assembly_bindings = loaded_assembly_bindings.101;
  <D.20299>:
  mono_assembly_binding_unlock ();
  D.20283 = BIT_FIELD_REF <*info, 32, 480>;
  D.20284 = D.20283 & 8;
  if (D.20284 == 0) goto <D.20302>; else goto <D.20304>;
  <D.20304>:
  D.20305 = check_policy_versions (info, aname);
  if (D.20305 == 0) goto <D.20302>; else goto <D.20303>;
  <D.20302>:
  D.20218 = aname;
  return D.20218;
  <D.20303>:
  mono_assembly_bind_version (info, aname, dest_name);
  D.20218 = dest_name;
  return D.20218;
}


assembly_binding_info_parsed (struct MonoAssemblyBindingInfo * info, void * user_data)
{
  int D.17837;
  char * D.20309;
  char * D.20310;
  int D.20313;
  struct MonoMemPool * D.20316;
  char * D.20319;
  char * D.20320;
  char * D.20323;
  struct GSList * D.20324;
  struct GSList * D.20325;
  struct MonoAssemblyBindingInfo * info_copy;
  struct GSList * tmp;
  struct MonoAssemblyBindingInfo * info_tmp;
  struct MonoDomain * domain;

  domain = user_data;
  if (domain == 0B) goto <D.20307>; else goto <D.20308>;
  <D.20307>:
  return;
  <D.20308>:
  tmp = domain->assembly_bindings;
  goto <D.17839>;
  <D.17838>:
  info_tmp = tmp->data;
  {
    size_t __s1_len;
    size_t __s2_len;

    D.20309 = info->name;
    D.20310 = info_tmp->name;
    D.17837 = __builtin_strcmp (D.20309, D.20310);
  }
  if (D.17837 == 0) goto <D.20311>; else goto <D.20312>;
  <D.20311>:
  D.20313 = info_versions_equal (info, info_tmp);
  if (D.20313 != 0) goto <D.20314>; else goto <D.20315>;
  <D.20314>:
  return;
  <D.20315>:
  <D.20312>:
  tmp = tmp->next;
  <D.17839>:
  if (tmp != 0B) goto <D.17838>; else goto <D.17840>;
  <D.17840>:
  D.20316 = domain->mp;
  info_copy = mono_mempool_alloc0 (D.20316, 68);
  memcpy (info_copy, info, 68);
  D.20309 = info->name;
  if (D.20309 != 0B) goto <D.20317>; else goto <D.20318>;
  <D.20317>:
  D.20316 = domain->mp;
  D.20309 = info->name;
  D.20319 = mono_mempool_strdup (D.20316, D.20309);
  info_copy->name = D.20319;
  <D.20318>:
  D.20320 = info->culture;
  if (D.20320 != 0B) goto <D.20321>; else goto <D.20322>;
  <D.20321>:
  D.20316 = domain->mp;
  D.20320 = info->culture;
  D.20323 = mono_mempool_strdup (D.20316, D.20320);
  info_copy->culture = D.20323;
  <D.20322>:
  D.20316 = domain->mp;
  D.20324 = domain->assembly_bindings;
  D.20325 = g_slist_append_mempool (D.20316, D.20324, info_copy);
  domain->assembly_bindings = D.20325;
}


info_versions_equal (struct MonoAssemblyBindingInfo * left, struct MonoAssemblyBindingInfo * right)
{
  unsigned int D.20327;
  unsigned int D.20328;
  unsigned int D.20329;
  unsigned int D.20330;
  gboolean D.20333;
  unsigned int D.20334;
  unsigned int D.20337;
  unsigned int D.20340;
  struct AssemblyVersionSet * D.20343;
  struct AssemblyVersionSet * D.20344;
  int D.20345;
  unsigned int D.20348;
  struct AssemblyVersionSet * D.20351;
  struct AssemblyVersionSet * D.20352;
  int D.20353;
  unsigned int D.20356;
  struct AssemblyVersionSet * D.20359;
  struct AssemblyVersionSet * D.20360;
  int D.20361;

  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20328 = BIT_FIELD_REF <*right, 32, 480>;
  D.20329 = D.20327 ^ D.20328;
  D.20330 = D.20329 & 1;
  if (D.20330 != 0) goto <D.20331>; else goto <D.20332>;
  <D.20331>:
  D.20333 = 0;
  return D.20333;
  <D.20332>:
  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20328 = BIT_FIELD_REF <*right, 32, 480>;
  D.20329 = D.20327 ^ D.20328;
  D.20334 = D.20329 & 2;
  if (D.20334 != 0) goto <D.20335>; else goto <D.20336>;
  <D.20335>:
  D.20333 = 0;
  return D.20333;
  <D.20336>:
  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20328 = BIT_FIELD_REF <*right, 32, 480>;
  D.20329 = D.20327 ^ D.20328;
  D.20337 = D.20329 & 4;
  if (D.20337 != 0) goto <D.20338>; else goto <D.20339>;
  <D.20338>:
  D.20333 = 0;
  return D.20333;
  <D.20339>:
  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20340 = D.20327 & 1;
  if (D.20340 != 0) goto <D.20341>; else goto <D.20342>;
  <D.20341>:
  D.20343 = &left->old_version_bottom;
  D.20344 = &right->old_version_bottom;
  D.20345 = info_compare_versions (D.20343, D.20344);
  if (D.20345 == 0) goto <D.20346>; else goto <D.20347>;
  <D.20346>:
  D.20333 = 0;
  return D.20333;
  <D.20347>:
  <D.20342>:
  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20348 = D.20327 & 2;
  if (D.20348 != 0) goto <D.20349>; else goto <D.20350>;
  <D.20349>:
  D.20351 = &left->old_version_top;
  D.20352 = &right->old_version_top;
  D.20353 = info_compare_versions (D.20351, D.20352);
  if (D.20353 == 0) goto <D.20354>; else goto <D.20355>;
  <D.20354>:
  D.20333 = 0;
  return D.20333;
  <D.20355>:
  <D.20350>:
  D.20327 = BIT_FIELD_REF <*left, 32, 480>;
  D.20356 = D.20327 & 4;
  if (D.20356 != 0) goto <D.20357>; else goto <D.20358>;
  <D.20357>:
  D.20359 = &left->new_version;
  D.20360 = &right->new_version;
  D.20361 = info_compare_versions (D.20359, D.20360);
  if (D.20361 == 0) goto <D.20362>; else goto <D.20363>;
  <D.20362>:
  D.20333 = 0;
  return D.20333;
  <D.20363>:
  <D.20358>:
  D.20333 = 1;
  return D.20333;
}


info_compare_versions (struct AssemblyVersionSet * left, struct AssemblyVersionSet * right)
{
  short unsigned int D.20367;
  short unsigned int D.20368;
  short unsigned int D.20370;
  short unsigned int D.20371;
  short unsigned int D.20373;
  short unsigned int D.20374;
  short unsigned int D.20376;
  short unsigned int D.20377;
  gboolean D.20378;

  D.20367 = left->major;
  D.20368 = right->major;
  if (D.20367 != D.20368) goto <D.20365>; else goto <D.20369>;
  <D.20369>:
  D.20370 = left->minor;
  D.20371 = right->minor;
  if (D.20370 != D.20371) goto <D.20365>; else goto <D.20372>;
  <D.20372>:
  D.20373 = left->build;
  D.20374 = right->build;
  if (D.20373 != D.20374) goto <D.20365>; else goto <D.20375>;
  <D.20375>:
  D.20376 = left->revision;
  D.20377 = right->revision;
  if (D.20376 != D.20377) goto <D.20365>; else goto <D.20366>;
  <D.20365>:
  D.20378 = 0;
  return D.20378;
  <D.20366>:
  D.20378 = 1;
  return D.20378;
}


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

  new_list = mono_mempool_alloc (mp, 8);
  new_list->data = data;
  new_list->next = 0B;
  if (list != 0B) goto <D.20380>; else goto <D.20381>;
  <D.20380>:
  last = list;
  goto <D.10497>;
  <D.10496>:
  last = last->next;
  <D.10497>:
  D.20382 = last->next;
  if (D.20382 != 0B) goto <D.10496>; else goto <D.10498>;
  <D.10498>:
  last->next = new_list;
  D.20383 = list;
  return D.20383;
  <D.20381>:
  D.20383 = new_list;
  return D.20383;
}


get_per_domain_assembly_binding_info (struct MonoDomain * domain, struct MonoAssemblyName * aname)
{
  struct GSList * D.20385;
  struct MonoAssemblyBindingInfo * D.20388;
  int D.17864;
  const char * D.20391;
  char * D.20392;
  int D.20395;
  unsigned char D.20402;
  unsigned int D.20404;
  unsigned int D.20405;
  int D.20407;
  struct MonoAssemblyBindingInfo * info;
  struct GSList * list;

  D.20385 = domain->assembly_bindings;
  if (D.20385 == 0B) goto <D.20386>; else goto <D.20387>;
  <D.20386>:
  D.20388 = 0B;
  return D.20388;
  <D.20387>:
  info = 0B;
  list = domain->assembly_bindings;
  goto <D.17867>;
  <D.17866>:
  info = list->data;
  if (info != 0B) goto <D.20389>; else goto <D.20390>;
  <D.20389>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.20391 = aname->name;
    D.20392 = info->name;
    D.17864 = __builtin_strcmp (D.20391, D.20392);
  }
  if (D.17864 == 0) goto <D.20393>; else goto <D.20394>;
  <D.20393>:
  D.20395 = info_major_minor_in_range (info, aname);
  if (D.20395 != 0) goto <D.17865>; else goto <D.20396>;
  <D.20396>:
  <D.20394>:
  <D.20390>:
  info = 0B;
  list = list->next;
  <D.17867>:
  if (list != 0B) goto <D.17866>; else goto <D.17865>;
  <D.17865>:
  if (info != 0B) goto <D.20397>; else goto <D.20398>;
  <D.20397>:
  D.20392 = info->name;
  if (D.20392 != 0B) goto <D.20401>; else goto <D.20399>;
  <D.20401>:
  D.20402 = info->public_key_token[0];
  if (D.20402 != 0) goto <D.20403>; else goto <D.20399>;
  <D.20403>:
  D.20404 = BIT_FIELD_REF <*info, 32, 480>;
  D.20405 = D.20404 & 5;
  if (D.20405 == 5) goto <D.20406>; else goto <D.20399>;
  <D.20406>:
  D.20407 = assembly_binding_maps_name (info, aname);
  if (D.20407 != 0) goto <D.20408>; else goto <D.20399>;
  <D.20408>:
  info->is_valid = 1;
  goto <D.20400>;
  <D.20399>:
  info->is_valid = 0;
  <D.20400>:
  <D.20398>:
  D.20388 = info;
  return D.20388;
}


info_major_minor_in_range (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname)
{
  short unsigned int D.20410;
  int D.20411;
  short unsigned int D.20412;
  int D.20413;
  unsigned int D.20414;
  unsigned int D.20415;
  gboolean D.20418;
  short unsigned int D.20419;
  int D.20420;
  short unsigned int D.20421;
  int D.20422;
  int D.20423;
  unsigned int D.20426;
  short unsigned int D.20429;
  int D.20430;
  short unsigned int D.20431;
  int D.20432;
  int D.20433;
  int aname_version_number;

  D.20410 = aname->major;
  D.20411 = (int) D.20410;
  D.20412 = aname->minor;
  D.20413 = (int) D.20412;
  aname_version_number = get_version_number (D.20411, D.20413);
  D.20414 = BIT_FIELD_REF <*info, 32, 480>;
  D.20415 = D.20414 & 1;
  if (D.20415 == 0) goto <D.20416>; else goto <D.20417>;
  <D.20416>:
  D.20418 = 0;
  return D.20418;
  <D.20417>:
  D.20419 = info->old_version_bottom.major;
  D.20420 = (int) D.20419;
  D.20421 = info->old_version_bottom.minor;
  D.20422 = (int) D.20421;
  D.20423 = get_version_number (D.20420, D.20422);
  if (D.20423 > aname_version_number) goto <D.20424>; else goto <D.20425>;
  <D.20424>:
  D.20418 = 0;
  return D.20418;
  <D.20425>:
  D.20414 = BIT_FIELD_REF <*info, 32, 480>;
  D.20426 = D.20414 & 2;
  if (D.20426 != 0) goto <D.20427>; else goto <D.20428>;
  <D.20427>:
  D.20429 = info->old_version_top.major;
  D.20430 = (int) D.20429;
  D.20431 = info->old_version_top.minor;
  D.20432 = (int) D.20431;
  D.20433 = get_version_number (D.20430, D.20432);
  if (D.20433 < aname_version_number) goto <D.20434>; else goto <D.20435>;
  <D.20434>:
  D.20418 = 0;
  return D.20418;
  <D.20435>:
  <D.20428>:
  D.20410 = aname->major;
  D.20411 = (int) D.20410;
  info->major = D.20411;
  D.20412 = aname->minor;
  D.20413 = (int) D.20412;
  info->minor = D.20413;
  D.20418 = 1;
  return D.20418;
}


get_version_number (int major, int minor)
{
  int D.20437;
  int D.20438;

  D.20438 = major * 256;
  D.20437 = D.20438 + minor;
  return D.20437;
}


assembly_binding_maps_name (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname)
{
  char * D.20443;
  gboolean D.20444;
  int D.16976;
  const char * D.20445;
  int D.20450;
  short unsigned int D.20451;
  int D.20452;
  int D.20454;
  short unsigned int D.20455;
  int D.20456;
  int iftmp.102;
  char * D.20460;
  char D.20462;
  _Bool D.20464;
  int iftmp.103;
  const char * D.20468;
  char D.20470;
  _Bool D.20472;
  _Bool D.20473;
  int D.16985;
  guchar[17] * D.20482;
  mono_byte[17] * D.20483;
  int D.20484;

  if (info == 0B) goto <D.20440>; else goto <D.20442>;
  <D.20442>:
  D.20443 = info->name;
  if (D.20443 == 0B) goto <D.20440>; else goto <D.20441>;
  <D.20440>:
  D.20444 = 0;
  return D.20444;
  <D.20441>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.20443 = info->name;
    D.20445 = aname->name;
    D.16976 = __builtin_strcmp (D.20443, D.20445);
  }
  if (D.16976 != 0) goto <D.20446>; else goto <D.20447>;
  <D.20446>:
  D.20444 = 0;
  return D.20444;
  <D.20447>:
  D.20450 = info->major;
  D.20451 = aname->major;
  D.20452 = (int) D.20451;
  if (D.20450 != D.20452) goto <D.20448>; else goto <D.20453>;
  <D.20453>:
  D.20454 = info->minor;
  D.20455 = aname->minor;
  D.20456 = (int) D.20455;
  if (D.20454 != D.20456) goto <D.20448>; else goto <D.20449>;
  <D.20448>:
  D.20444 = 0;
  return D.20444;
  <D.20449>:
  D.20460 = info->culture;
  if (D.20460 != 0B) goto <D.20461>; else goto <D.20458>;
  <D.20461>:
  D.20460 = info->culture;
  D.20462 = *D.20460;
  if (D.20462 != 0) goto <D.20463>; else goto <D.20458>;
  <D.20463>:
  iftmp.102 = 1;
  goto <D.20459>;
  <D.20458>:
  iftmp.102 = 0;
  <D.20459>:
  D.20464 = (_Bool) iftmp.102;
  D.20468 = aname->culture;
  if (D.20468 != 0B) goto <D.20469>; else goto <D.20466>;
  <D.20469>:
  D.20468 = aname->culture;
  D.20470 = *D.20468;
  if (D.20470 != 0) goto <D.20471>; else goto <D.20466>;
  <D.20471>:
  iftmp.103 = 1;
  goto <D.20467>;
  <D.20466>:
  iftmp.103 = 0;
  <D.20467>:
  D.20472 = (_Bool) iftmp.103;
  D.20473 = D.20464 ^ D.20472;
  if (D.20473 != 0) goto <D.20474>; else goto <D.20475>;
  <D.20474>:
  D.20444 = 0;
  return D.20444;
  <D.20475>:
  D.20460 = info->culture;
  if (D.20460 != 0B) goto <D.20476>; else goto <D.20477>;
  <D.20476>:
  D.20468 = aname->culture;
  if (D.20468 != 0B) goto <D.20478>; else goto <D.20479>;
  <D.20478>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.20460 = info->culture;
    D.20468 = aname->culture;
    D.16985 = __builtin_strcmp (D.20460, D.20468);
  }
  if (D.16985 != 0) goto <D.20480>; else goto <D.20481>;
  <D.20480>:
  D.20444 = 0;
  return D.20444;
  <D.20481>:
  <D.20479>:
  <D.20477>:
  D.20482 = &info->public_key_token;
  D.20483 = &aname->public_key_token;
  D.20484 = mono_public_tokens_are_equal (D.20482, D.20483);
  if (D.20484 == 0) goto <D.20485>; else goto <D.20486>;
  <D.20485>:
  D.20444 = 0;
  return D.20444;
  <D.20486>:
  D.20444 = 1;
  return D.20444;
}


mono_assembly_load_publisher_policy (struct MonoAssemblyName * aname)
{
  const char * D.20488;
  char * D.20489;
  unsigned int D.20492;
  unsigned int D.20493;
  unsigned int len.104;
  unsigned int len.105;
  const char * D.20497;
  short unsigned int D.20501;
  int D.20502;
  short unsigned int D.20503;
  int D.20504;
  mono_byte[17] * D.20505;
  char * * extra_gac_paths.106;
  gchar * D.20509;
  struct MonoImage * D.20513;
  const char * D.20514;
  struct MonoImage * image;
  gchar * filename;
  gchar * pname;
  gchar * name;
  gchar * culture;
  gchar * version;
  gchar * fullpath;
  gchar * subpath;
  gchar * * paths;
  gint32 len;

  D.20488 = aname->name;
  D.20489 = strstr (D.20488, ".dll");
  if (D.20489 != 0B) goto <D.20490>; else goto <D.20491>;
  <D.20490>:
  D.20488 = aname->name;
  D.20492 = strlen (D.20488);
  D.20493 = D.20492 + 4294967292;
  len = (gint32) D.20493;
  len.104 = (unsigned int) len;
  name = monoeg_malloc (len.104);
  D.20488 = aname->name;
  len.105 = (unsigned int) len;
  strncpy (name, D.20488, len.105);
  goto <D.20496>;
  <D.20491>:
  D.20488 = aname->name;
  name = monoeg_strdup (D.20488);
  <D.20496>:
  D.20497 = aname->culture;
  if (D.20497 != 0B) goto <D.20498>; else goto <D.20499>;
  <D.20498>:
  D.20497 = aname->culture;
  culture = monoeg_g_utf8_strdown (D.20497, -1);
  goto <D.20500>;
  <D.20499>:
  culture = monoeg_strdup ("");
  <D.20500>:
  D.20501 = aname->major;
  D.20502 = (int) D.20501;
  D.20503 = aname->minor;
  D.20504 = (int) D.20503;
  pname = monoeg_g_strdup_printf ("policy.%d.%d.%s", D.20502, D.20504, name);
  D.20505 = &aname->public_key_token;
  version = monoeg_g_strdup_printf ("0.0.0.0_%s_%s", culture, D.20505);
  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.106 = extra_gac_paths;
  if (extra_gac_paths.106 != 0B) goto <D.20507>; else goto <D.20508>;
  <D.20507>:
  paths = extra_gac_paths;
  goto <D.17798>;
  <D.17797>:
  D.20509 = *paths;
  fullpath = monoeg_g_build_path ("/", D.20509, "lib", "mono", "gac", subpath, 0B);
  image = mono_image_open (fullpath, 0B);
  monoeg_g_free (fullpath);
  paths = paths + 4;
  <D.17798>:
  if (image == 0B) goto <D.20510>; else goto <D.17799>;
  <D.20510>:
  D.20509 = *paths;
  if (D.20509 != 0B) goto <D.17797>; else goto <D.17799>;
  <D.17799>:
  <D.20508>:
  if (image != 0B) goto <D.20511>; else goto <D.20512>;
  <D.20511>:
  monoeg_g_free (subpath);
  D.20513 = image;
  return D.20513;
  <D.20512>:
  D.20514 = mono_assembly_getrootdir ();
  fullpath = monoeg_g_build_path ("/", D.20514, "mono", "gac", subpath, 0B);
  image = mono_image_open (fullpath, 0B);
  monoeg_g_free (subpath);
  monoeg_g_free (fullpath);
  D.20513 = image;
  return D.20513;
}


strncpy (char * restrict __dest, const char * restrict __src, size_t __len)
{
  char * D.20516;
  unsigned int D.20517;

  D.20517 = __builtin_object_size (__dest, 1);
  D.20516 = __builtin___strncpy_chk (__dest, __src, __len, D.20517);
  return D.20516;
}


get_publisher_policy_info (struct MonoImage * image, struct MonoAssemblyName * aname, struct MonoAssemblyBindingInfo * binding_info)
{
  <unnamed-unsigned:24> D.20519;
  int D.20520;
  unsigned int D.20523;
  unsigned int D.20524;
  unsigned int D.20527;
  _Bool D.20528;
  long int D.20529;
  long int D.20530;
  char * D.20533;
  char * D.20534;
  gchar * D.20537;
  char * D.20540;
  unsigned char D.20542;
  unsigned int D.20544;
  unsigned int D.20545;
  int D.20547;
  struct MonoTableInfo * t;
  guint32 cols[4];
  const gchar * filename;
  gchar * subpath;
  gchar * fullpath;

  try
    {
      t = &image->tables[40];
      D.20519 = t->rows;
      D.20520 = (int) D.20519;
      if (D.20520 <= 0) goto <D.20521>; else goto <D.20522>;
      <D.20521>:
      binding_info->is_valid = 0;
      return;
      <D.20522>:
      mono_metadata_decode_row (t, 0, &cols, 4);
      D.20523 = cols[3];
      D.20524 = D.20523 & 3;
      if (D.20524 != 0) goto <D.20525>; else goto <D.20526>;
      <D.20525>:
      binding_info->is_valid = 0;
      return;
      <D.20526>:
      D.20527 = cols[2];
      filename = mono_metadata_string_heap (image, D.20527);
      D.20528 = filename == 0B;
      D.20529 = (long int) D.20528;
      D.20530 = __builtin_expect (D.20529, 0);
      if (D.20530 != 0) goto <D.20531>; else goto <D.20532>;
      <D.20531>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 370, "filename != NULL");
      <D.20532>:
      D.20533 = image->name;
      subpath = monoeg_g_path_get_dirname (D.20533);
      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.20534 = binding_info->culture;
      if (D.20534 == 0B) goto <D.20535>; else goto <D.20536>;
      <D.20535>:
      D.20537 = monoeg_strdup ("");
      binding_info->culture = D.20537;
      <D.20536>:
      D.20540 = binding_info->name;
      if (D.20540 == 0B) goto <D.20538>; else goto <D.20541>;
      <D.20541>:
      D.20542 = binding_info->public_key_token[0];
      if (D.20542 == 0) goto <D.20538>; else goto <D.20543>;
      <D.20543>:
      D.20544 = BIT_FIELD_REF <*binding_info, 32, 480>;
      D.20545 = D.20544 & 5;
      if (D.20545 != 5) goto <D.20538>; else goto <D.20546>;
      <D.20546>:
      D.20547 = assembly_binding_maps_name (binding_info, aname);
      if (D.20547 == 0) goto <D.20538>; else goto <D.20539>;
      <D.20538>:
      mono_assembly_binding_info_free (binding_info);
      binding_info->is_valid = 0;
      return;
      <D.20539>:
      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.20551;
  struct MonoAssemblyBindingInfo * D.20554;
  struct GSList * tmp;

  tmp = loaded_assembly_bindings;
  goto <D.17811>;
  <D.17810>:
  {
    struct MonoAssemblyBindingInfo * info;

    info = tmp->data;
    D.20551 = assembly_binding_maps_name (info, aname);
    if (D.20551 != 0) goto <D.20552>; else goto <D.20553>;
    <D.20552>:
    D.20554 = info;
    return D.20554;
    <D.20553>:
  }
  tmp = tmp->next;
  <D.17811>:
  if (tmp != 0B) goto <D.17810>; else goto <D.17812>;
  <D.17812>:
  D.20554 = 0B;
  return D.20554;
}


mono_assembly_binding_info_free (struct MonoAssemblyBindingInfo * info)
{
  char * D.20558;
  char * D.20559;

  if (info == 0B) goto <D.20556>; else goto <D.20557>;
  <D.20556>:
  return;
  <D.20557>:
  D.20558 = info->name;
  monoeg_g_free (D.20558);
  D.20559 = info->culture;
  monoeg_g_free (D.20559);
}


mono_assembly_binding_unlock ()
{
  pthread_mutex_unlock (&assembly_binding_mutex);
}


check_policy_versions (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * name)
{
  unsigned int D.20561;
  unsigned int D.20562;
  gboolean D.20565;
  unsigned int D.20566;
  struct AssemblyVersionSet * D.20569;
  int D.20570;
  struct AssemblyVersionSet * D.20573;
  int D.20574;
  int D.20577;

  D.20561 = BIT_FIELD_REF <*info, 32, 480>;
  D.20562 = D.20561 & 8;
  if (D.20562 == 0) goto <D.20563>; else goto <D.20564>;
  <D.20563>:
  D.20565 = 0;
  return D.20565;
  <D.20564>:
  D.20561 = BIT_FIELD_REF <*info, 32, 480>;
  D.20566 = D.20561 & 2;
  if (D.20566 == 0) goto <D.20567>; else goto <D.20568>;
  <D.20567>:
  D.20569 = &info->old_version_bottom;
  D.20570 = compare_versions (D.20569, name);
  if (D.20570 == 0) goto <D.20571>; else goto <D.20572>;
  <D.20571>:
  D.20565 = 1;
  return D.20565;
  <D.20572>:
  D.20565 = 0;
  return D.20565;
  <D.20568>:
  D.20573 = &info->old_version_top;
  D.20574 = compare_versions (D.20573, name);
  if (D.20574 < 0) goto <D.20575>; else goto <D.20576>;
  <D.20575>:
  D.20565 = 0;
  return D.20565;
  <D.20576>:
  D.20569 = &info->old_version_bottom;
  D.20577 = compare_versions (D.20569, name);
  if (D.20577 > 0) goto <D.20578>; else goto <D.20579>;
  <D.20578>:
  D.20565 = 0;
  return D.20565;
  <D.20579>:
  D.20565 = 1;
  return D.20565;
}


compare_versions (struct AssemblyVersionSet * v, struct MonoAssemblyName * aname)
{
  short unsigned int D.20581;
  short unsigned int D.20582;
  int D.20585;
  short unsigned int D.20588;
  short unsigned int D.20589;
  short unsigned int D.20594;
  short unsigned int D.20595;
  short unsigned int D.20600;
  short unsigned int D.20601;

  D.20581 = v->major;
  D.20582 = aname->major;
  if (D.20581 > D.20582) goto <D.20583>; else goto <D.20584>;
  <D.20583>:
  D.20585 = 1;
  return D.20585;
  <D.20584>:
  D.20581 = v->major;
  D.20582 = aname->major;
  if (D.20581 < D.20582) goto <D.20586>; else goto <D.20587>;
  <D.20586>:
  D.20585 = -1;
  return D.20585;
  <D.20587>:
  D.20588 = v->minor;
  D.20589 = aname->minor;
  if (D.20588 > D.20589) goto <D.20590>; else goto <D.20591>;
  <D.20590>:
  D.20585 = 1;
  return D.20585;
  <D.20591>:
  D.20588 = v->minor;
  D.20589 = aname->minor;
  if (D.20588 < D.20589) goto <D.20592>; else goto <D.20593>;
  <D.20592>:
  D.20585 = -1;
  return D.20585;
  <D.20593>:
  D.20594 = v->build;
  D.20595 = aname->build;
  if (D.20594 > D.20595) goto <D.20596>; else goto <D.20597>;
  <D.20596>:
  D.20585 = 1;
  return D.20585;
  <D.20597>:
  D.20594 = v->build;
  D.20595 = aname->build;
  if (D.20594 < D.20595) goto <D.20598>; else goto <D.20599>;
  <D.20598>:
  D.20585 = -1;
  return D.20585;
  <D.20599>:
  D.20600 = v->revision;
  D.20601 = aname->revision;
  if (D.20600 > D.20601) goto <D.20602>; else goto <D.20603>;
  <D.20602>:
  D.20585 = 1;
  return D.20585;
  <D.20603>:
  D.20600 = v->revision;
  D.20601 = aname->revision;
  if (D.20600 < D.20601) goto <D.20604>; else goto <D.20605>;
  <D.20604>:
  D.20585 = -1;
  return D.20585;
  <D.20605>:
  D.20585 = 0;
  return D.20585;
}


mono_assembly_bind_version (struct MonoAssemblyBindingInfo * info, struct MonoAssemblyName * aname, struct MonoAssemblyName * dest_name)
{
  short unsigned int D.20607;
  short unsigned int D.20608;
  short unsigned int D.20609;
  short unsigned int D.20610;
  struct MonoAssemblyName * D.20611;

  memcpy (dest_name, aname, 60);
  D.20607 = info->new_version.major;
  dest_name->major = D.20607;
  D.20608 = info->new_version.minor;
  dest_name->minor = D.20608;
  D.20609 = info->new_version.build;
  dest_name->build = D.20609;
  D.20610 = info->new_version.revision;
  dest_name->revision = D.20610;
  D.20611 = dest_name;
  return D.20611;
}


invoke_assembly_refonly_preload_hook (struct MonoAssemblyName * aname, gchar * * assemblies_path)
{
  struct MonoAssembly * (*<Te92>) (struct MonoAssemblyName *, char * *, void *) D.20613;
  void * D.20614;
  struct MonoAssembly * D.20617;
  struct AssemblyPreLoadHook * hook;
  struct MonoAssembly * assembly;

  hook = assembly_refonly_preload_hook;
  goto <D.17379>;
  <D.17378>:
  D.20613 = hook->func;
  D.20614 = hook->user_data;
  assembly = D.20613 (aname, assemblies_path, D.20614);
  if (assembly != 0B) goto <D.20615>; else goto <D.20616>;
  <D.20615>:
  D.20617 = assembly;
  return D.20617;
  <D.20616>:
  hook = hook->next;
  <D.17379>:
  if (hook != 0B) goto <D.17378>; else goto <D.17380>;
  <D.17380>:
  D.20617 = 0B;
  return D.20617;
}


mono_assembly_load_from_gac (struct MonoAssemblyName * aname, gchar * filename, MonoImageOpenStatus * status, MonoBoolean refonly)
{
  unsigned char D.20619;
  struct MonoAssembly * D.20622;
  const char * D.20623;
  char * D.20624;
  unsigned int D.20627;
  unsigned int D.20628;
  unsigned int len.107;
  unsigned int len.108;
  const char * D.20632;
  mono_byte[17] * D.20636;
  short unsigned int D.20637;
  int D.20638;
  short unsigned int D.20639;
  int D.20640;
  short unsigned int D.20641;
  int D.20642;
  short unsigned int D.20643;
  int D.20644;
  char * * extra_gac_paths.109;
  gchar * D.20648;
  int D.20649;
  const char * D.20653;
  struct MonoAssembly * result;
  gchar * name;
  gchar * version;
  gchar * culture;
  gchar * fullpath;
  gchar * subpath;
  gint32 len;
  gchar * * paths;
  char * pubtok;

  result = 0B;
  D.20619 = aname->public_key_token[0];
  if (D.20619 == 0) goto <D.20620>; else goto <D.20621>;
  <D.20620>:
  D.20622 = 0B;
  return D.20622;
  <D.20621>:
  D.20623 = aname->name;
  D.20624 = strstr (D.20623, ".dll");
  if (D.20624 != 0B) goto <D.20625>; else goto <D.20626>;
  <D.20625>:
  D.20627 = strlen (filename);
  D.20628 = D.20627 + 4294967292;
  len = (gint32) D.20628;
  len.107 = (unsigned int) len;
  name = monoeg_malloc (len.107);
  D.20623 = aname->name;
  len.108 = (unsigned int) len;
  strncpy (name, D.20623, len.108);
  goto <D.20631>;
  <D.20626>:
  D.20623 = aname->name;
  name = monoeg_strdup (D.20623);
  <D.20631>:
  D.20632 = aname->culture;
  if (D.20632 != 0B) goto <D.20633>; else goto <D.20634>;
  <D.20633>:
  D.20632 = aname->culture;
  culture = monoeg_g_utf8_strdown (D.20632, -1);
  goto <D.20635>;
  <D.20634>:
  culture = monoeg_strdup ("");
  <D.20635>:
  D.20636 = &aname->public_key_token;
  pubtok = monoeg_g_ascii_strdown (D.20636, 17);
  D.20637 = aname->major;
  D.20638 = (int) D.20637;
  D.20639 = aname->minor;
  D.20640 = (int) D.20639;
  D.20641 = aname->build;
  D.20642 = (int) D.20641;
  D.20643 = aname->revision;
  D.20644 = (int) D.20643;
  version = monoeg_g_strdup_printf ("%d.%d.%d.%d_%s_%s", D.20638, D.20640, D.20642, D.20644, 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.109 = extra_gac_paths;
  if (extra_gac_paths.109 != 0B) goto <D.20646>; else goto <D.20647>;
  <D.20646>:
  paths = extra_gac_paths;
  goto <D.17898>;
  <D.17897>:
  D.20648 = *paths;
  fullpath = monoeg_g_build_path ("/", D.20648, "lib", "mono", "gac", subpath, 0B);
  D.20649 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.20649);
  monoeg_g_free (fullpath);
  paths = paths + 4;
  <D.17898>:
  if (result == 0B) goto <D.20650>; else goto <D.17899>;
  <D.20650>:
  D.20648 = *paths;
  if (D.20648 != 0B) goto <D.17897>; else goto <D.17899>;
  <D.17899>:
  <D.20647>:
  if (result != 0B) goto <D.20651>; else goto <D.20652>;
  <D.20651>:
  result->in_gac = 1;
  monoeg_g_free (subpath);
  D.20622 = result;
  return D.20622;
  <D.20652>:
  D.20653 = mono_assembly_getrootdir ();
  fullpath = monoeg_g_build_path ("/", D.20653, "mono", "gac", subpath, 0B);
  D.20649 = (int) refonly;
  result = mono_assembly_open_full (fullpath, status, D.20649);
  monoeg_g_free (fullpath);
  if (result != 0B) goto <D.20654>; else goto <D.20655>;
  <D.20654>:
  result->in_gac = 1;
  <D.20655>:
  monoeg_g_free (subpath);
  D.20622 = result;
  return D.20622;
}


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

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


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

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


mono_assembly_loaded_full (struct MonoAssemblyName * aname, gboolean refonly)
{
  struct MonoAssembly * D.20663;
  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.20663 = res;
      return D.20663;
    }
  finally
    {
      maped_aname = {CLOBBER};
    }
}


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

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


mono_assembly_release_gc_roots (struct MonoAssembly * assembly)
{
  struct MonoAssembly * D.20668;
  unsigned char D.20671;
  struct MonoImage * * D.20674;
  unsigned int i.110;
  unsigned int D.20676;
  struct MonoImage * * D.20677;
  struct MonoImage * D.20678;
  unsigned int i.111;
  unsigned int D.20680;

  D.20668 = assembly + 4294967295;
  if (D.20668 > 4294967293B) goto <D.20669>; else goto <D.20670>;
  <D.20669>:
  return;
  <D.20670>:
  D.20671 = assembly->dynamic;
  if (D.20671 != 0) goto <D.20672>; else goto <D.20673>;
  <D.20672>:
  {
    int i;
    struct MonoDynamicImage * dynimg;

    dynimg = assembly->image;
    i = 0;
    goto <D.17995>;
    <D.17994>:
    D.20674 = dynimg->image.modules;
    i.110 = (unsigned int) i;
    D.20676 = i.110 * 4;
    D.20677 = D.20674 + D.20676;
    D.20678 = *D.20677;
    mono_dynamic_image_release_gc_roots (D.20678);
    i = i + 1;
    <D.17995>:
    i.111 = (unsigned int) i;
    D.20680 = dynimg->image.module_count;
    if (i.111 < D.20680) goto <D.17994>; else goto <D.17996>;
    <D.17996>:
    mono_dynamic_image_release_gc_roots (dynimg);
  }
  <D.20673>:
}


mono_assembly_close_except_image_pools (struct MonoAssembly * assembly)
{
  gboolean D.20684;
  int * D.20687;
  int D.20688;
  const char * D.20691;
  struct MonoImage * D.20692;
  _Bool D.20695;
  long int D.20696;
  long int D.20697;
  struct GList * loaded_assemblies.112;
  struct GList * loaded_assemblies.113;
  _Bool D.20704;
  long int D.20705;
  long int D.20706;
  int D.20709;
  struct GSList * D.20712;
  char * D.20713;
  struct GSList * tmp;

  if (assembly == 0B) goto <D.20682>; else goto <D.20683>;
  <D.20682>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "assembly.c", 3029, "assembly != NULL");
  D.20684 = 0;
  return D.20684;
  <D.20683>:
  if (assembly == 4294967295B) goto <D.20685>; else goto <D.20686>;
  <D.20685>:
  D.20684 = 0;
  return D.20684;
  <D.20686>:
  D.20687 = &assembly->ref_count;
  D.20688 = InterlockedDecrement (D.20687);
  if (D.20688 > 0) goto <D.20689>; else goto <D.20690>;
  <D.20689>:
  D.20684 = 0;
  return D.20684;
  <D.20690>:
  mono_profiler_assembly_event (assembly, 2);
  D.20691 = assembly->aname.name;
  mono_trace (64, 1, "Unloading assembly %s [%p].", D.20691, assembly);
  D.20692 = assembly->image;
  mono_debug_close_image (D.20692);
  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20693>; else goto <D.20694>;
    <D.20693>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20694>:
    D.20695 = ret != 0;
    D.20696 = (long int) D.20695;
    D.20697 = __builtin_expect (D.20696, 0);
    if (D.20697 != 0) goto <D.20698>; else goto <D.20699>;
    <D.20698>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3044, "ret == 0");
    <D.20699>:
  }
  loaded_assemblies.112 = loaded_assemblies;
  loaded_assemblies.113 = monoeg_g_list_remove (loaded_assemblies.112, assembly);
  loaded_assemblies = loaded_assemblies.113;
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20702>; else goto <D.20703>;
    <D.20702>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20703>:
    D.20704 = ret != 0;
    D.20705 = (long int) D.20704;
    D.20706 = __builtin_expect (D.20705, 0);
    if (D.20706 != 0) goto <D.20707>; else goto <D.20708>;
    <D.20707>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3046, "ret == 0");
    <D.20708>:
  }
  D.20692 = assembly->image;
  D.20692->assembly = 0B;
  D.20692 = assembly->image;
  D.20709 = mono_image_close_except_pools (D.20692);
  if (D.20709 == 0) goto <D.20710>; else goto <D.20711>;
  <D.20710>:
  assembly->image = 0B;
  <D.20711>:
  tmp = assembly->friend_assembly_names;
  goto <D.18005>;
  <D.18004>:
  {
    struct MonoAssemblyName * fname;

    fname = tmp->data;
    mono_assembly_name_free (fname);
    monoeg_g_free (fname);
  }
  tmp = tmp->next;
  <D.18005>:
  if (tmp != 0B) goto <D.18004>; else goto <D.18006>;
  <D.18006>:
  D.20712 = assembly->friend_assembly_names;
  monoeg_g_slist_free (D.20712);
  D.20713 = assembly->basedir;
  monoeg_g_free (D.20713);
  mono_profiler_assembly_event (assembly, 3);
  D.20684 = 1;
  return D.20684;
}


InterlockedDecrement (volatile gint32 * val)
{
  gint32 D.20715;
  unsigned int D.20716;

  D.20716 = __sync_sub_and_fetch_4 (val, 1);
  D.20715 = (gint32) D.20716;
  return D.20715;
}


mono_assembly_close_finish (struct MonoAssembly * assembly)
{
  struct MonoAssembly * D.20718;
  _Bool D.20719;
  long int D.20720;
  long int D.20721;
  struct MonoImage * D.20724;
  unsigned char D.20727;
  const char * D.20730;

  D.20718 = assembly + 4294967295;
  D.20719 = D.20718 > 4294967293B;
  D.20720 = (long int) D.20719;
  D.20721 = __builtin_expect (D.20720, 0);
  if (D.20721 != 0) goto <D.20722>; else goto <D.20723>;
  <D.20722>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3069, "assembly && assembly != REFERENCE_MISSING");
  <D.20723>:
  D.20724 = assembly->image;
  if (D.20724 != 0B) goto <D.20725>; else goto <D.20726>;
  <D.20725>:
  D.20724 = assembly->image;
  mono_image_close_finish (D.20724);
  <D.20726>:
  D.20727 = assembly->dynamic;
  if (D.20727 != 0) goto <D.20728>; else goto <D.20729>;
  <D.20728>:
  D.20730 = assembly->aname.culture;
  monoeg_g_free (D.20730);
  goto <D.20731>;
  <D.20729>:
  monoeg_g_free (assembly);
  <D.20731>:
}


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

  D.20732 = mono_assembly_close_except_image_pools (assembly);
  if (D.20732 != 0) goto <D.20733>; else goto <D.20734>;
  <D.20733>:
  mono_assembly_close_finish (assembly);
  <D.20734>:
}


mono_assembly_load_module (struct MonoAssembly * assembly, guint32 idx)
{
  struct MonoImage * D.20735;
  struct MonoImage * D.20736;
  int idx.114;

  D.20736 = assembly->image;
  idx.114 = (int) idx;
  D.20735 = mono_image_load_file_for_image (D.20736, idx.114);
  return D.20735;
}


mono_assembly_foreach (void (*GFunc) (void *, void *) func, void * user_data)
{
  _Bool D.20741;
  long int D.20742;
  long int D.20743;
  struct GList * loaded_assemblies.115;
  _Bool D.20749;
  long int D.20750;
  long int D.20751;
  struct GList * copy;

  {
    int ret;

    ret = pthread_mutex_lock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20739>; else goto <D.20740>;
    <D.20739>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20740>:
    D.20741 = ret != 0;
    D.20742 = (long int) D.20741;
    D.20743 = __builtin_expect (D.20742, 0);
    if (D.20743 != 0) goto <D.20744>; else goto <D.20745>;
    <D.20744>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3110, "ret == 0");
    <D.20745>:
  }
  loaded_assemblies.115 = loaded_assemblies;
  copy = monoeg_g_list_copy (loaded_assemblies.115);
  {
    int ret;

    ret = pthread_mutex_unlock (&assemblies_mutex.mutex);
    if (ret != 0) goto <D.20747>; else goto <D.20748>;
    <D.20747>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20748>:
    D.20749 = ret != 0;
    D.20750 = (long int) D.20749;
    D.20751 = __builtin_expect (D.20750, 0);
    if (D.20751 != 0) goto <D.20752>; else goto <D.20753>;
    <D.20752>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "assembly.c", 3112, "ret == 0");
    <D.20753>:
  }
  loaded_assemblies.115 = loaded_assemblies;
  monoeg_g_list_foreach (loaded_assemblies.115, func, user_data);
  monoeg_g_list_free (copy);
}


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

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

    info = l->data;
    mono_assembly_binding_info_free (info);
    monoeg_g_free (info);
  }
  l = l->next;
  <D.18030>:
  if (l != 0B) goto <D.18029>; else goto <D.18031>;
  <D.18031>:
  loaded_assembly_bindings.116 = loaded_assembly_bindings;
  monoeg_g_slist_free (loaded_assembly_bindings.116);
  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.17302>;
  <D.17301>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.17302>:
  if (hook != 0B) goto <D.17301>; else goto <D.17303>;
  <D.17303>:
}


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

  hook = assembly_search_hook;
  goto <D.17342>;
  <D.17341>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.17342>:
  if (hook != 0B) goto <D.17341>; else goto <D.17343>;
  <D.17343>:
}


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

  hook = assembly_preload_hook;
  goto <D.17397>;
  <D.17396>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.17397>:
  if (hook != 0B) goto <D.17396>; else goto <D.17398>;
  <D.17398>:
  hook = assembly_refonly_preload_hook;
  goto <D.17400>;
  <D.17399>:
  next = hook->next;
  monoeg_g_free (hook);
  hook = next;
  <D.17400>:
  if (hook != 0B) goto <D.17399>; else goto <D.17401>;
  <D.17401>:
}


mono_assembly_cleanup_domain_bindings (guint32 domain_id)
{
  int D.20755;
  unsigned int D.20756;
  struct GSList * D.20759;
  struct GSList * D.20761;
  struct GSList * * iter;

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

    l = *iter;
    info = l->data;
    D.20755 = info->domain_id;
    D.20756 = (unsigned int) D.20755;
    if (D.20756 == domain_id) goto <D.20757>; else goto <D.20758>;
    <D.20757>:
    D.20759 = l->next;
    *iter = D.20759;
    mono_assembly_binding_info_free (info);
    monoeg_g_free (info);
    monoeg_g_slist_free_1 (l);
    goto <D.20760>;
    <D.20758>:
    iter = &l->next;
    <D.20760>:
  }
  <D.18039>:
  D.20761 = *iter;
  if (D.20761 != 0B) goto <D.18038>; else goto <D.18040>;
  <D.18040>:
  mono_assembly_binding_unlock ();
}


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


mono_assembly_get_main ()
{
  struct MonoAssembly * D.20762;

  D.20762 = main_assembly;
  return D.20762;
}


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

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


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


mono_assembly_has_skip_verification (struct MonoAssembly * assembly)
{
  <unnamed-unsigned:2> D.20766;
  int D.20767;
  int D.20768;
  gboolean D.20771;
  int D.20772;
  struct MonoImage * D.20773;
  unsigned int D.20774;
  unsigned int D.20775;
  unsigned int D.20778;
  unsigned int D.20781;
  const char * blob.117;
  const char * blob.118;
  unsigned int D.20784;
  sizetype len.119;
  const char * D.20788;
  int D.20789;
  <unnamed-unsigned:24> D.20792;
  int D.20793;
  struct MonoTableInfo * t;
  guint32 cols[3];
  const char * blob;
  int i;
  int len;

  try
    {
      D.20766 = assembly->skipverification;
      D.20767 = (int) D.20766;
      D.20768 = D.20767 & 2;
      if (D.20768 != 0) goto <D.20769>; else goto <D.20770>;
      <D.20769>:
      D.20766 = assembly->skipverification;
      D.20772 = (int) D.20766;
      D.20771 = D.20772 & 1;
      return D.20771;
      <D.20770>:
      D.20773 = assembly->image;
      t = &D.20773->tables[14];
      i = 0;
      goto <D.18096>;
      <D.18095>:
      mono_metadata_decode_row (t, i, &cols, 3);
      D.20774 = cols[1];
      D.20775 = D.20774 & 3;
      if (D.20775 != 2) goto <D.20776>; else goto <D.20777>;
      <D.20776>:
      // predicted unlikely by continue predictor.
      goto <D.18094>;
      <D.20777>:
      D.20778 = cols[0];
      if (D.20778 != 8) goto <D.20779>; else goto <D.20780>;
      <D.20779>:
      // predicted unlikely by continue predictor.
      goto <D.18094>;
      <D.20780>:
      D.20773 = assembly->image;
      D.20781 = cols[2];
      blob.117 = mono_metadata_blob_heap (D.20773, D.20781);
      blob = blob.117;
      blob.118 = blob;
      D.20784 = mono_metadata_decode_blob_size (blob.118, &blob);
      len = (int) D.20784;
      if (len == 0) goto <D.20785>; else goto <D.20786>;
      <D.20785>:
      // predicted unlikely by continue predictor.
      goto <D.18094>;
      <D.20786>:
      blob.118 = blob;
      blob.118 = blob;
      len.119 = (sizetype) len;
      D.20788 = blob.118 + len.119;
      D.20789 = mono_assembly_try_decode_skip_verification (blob.118, D.20788);
      if (D.20789 != 0) goto <D.20790>; else goto <D.20791>;
      <D.20790>:
      assembly->skipverification = 3;
      D.20771 = 1;
      return D.20771;
      <D.20791>:
      <D.18094>:
      i = i + 1;
      <D.18096>:
      D.20792 = t->rows;
      D.20793 = (int) D.20792;
      if (D.20793 > i) goto <D.18095>; else goto <D.18097>;
      <D.18097>:
      assembly->skipverification = 2;
      D.20771 = 0;
      return D.20771;
    }
  finally
    {
      cols = {CLOBBER};
      blob = {CLOBBER};
    }
}


mono_assembly_try_decode_skip_verification (const char * p, const char * endn)
{
  const char * p.120;
  char D.20797;
  int endn.121;
  int p.122;
  int D.20802;
  char * D.20805;
  _Bool D.20806;
  gboolean D.20807;
  const char * p.123;
  const char * p.124;
  char D.20810;
  unsigned int D.20813;
  unsigned int D.20814;
  int iftmp.125;
  unsigned int len.126;
  int D.20820;
  sizetype len.127;
  const char * p.128;
  unsigned int D.20824;
  sizetype params_len.129;
  unsigned int D.20828;
  int D.20829;
  int abort_decoding.130;
  const char * p.131;
  int i;
  int j;
  int num;
  int len;
  int params_len;

  p.120 = p;
  D.20797 = *p.120;
  if (D.20797 == 60) goto <D.20798>; else goto <D.20799>;
  <D.20798>:
  {
    gsize read;
    gsize written;
    char * res;

    try
      {
        p.120 = p;
        endn.121 = (int) endn;
        p.120 = p;
        p.122 = (int) p.120;
        D.20802 = endn.121 - p.122;
        res = monoeg_g_convert (p.120, D.20802, "UTF-8", "UTF-16LE", &read, &written, 0B);
        if (res != 0B) goto <D.20803>; else goto <D.20804>;
        <D.20803>:
        {
          gboolean found;

          D.20805 = strstr (res, "\"SkipVerification\"");
          D.20806 = D.20805 != 0B;
          found = (gboolean) D.20806;
          monoeg_g_free (res);
          D.20807 = found;
          return D.20807;
        }
        <D.20804>:
        D.20807 = 0;
        return D.20807;
      }
    finally
      {
        read = {CLOBBER};
        written = {CLOBBER};
      }
  }
  <D.20799>:
  p.120 = p;
  p.123 = p.120;
  p.124 = p.123 + 1;
  p = p.124;
  D.20810 = *p.123;
  if (D.20810 != 46) goto <D.20811>; else goto <D.20812>;
  <D.20811>:
  D.20807 = 0;
  return D.20807;
  <D.20812>:
  p.120 = p;
  D.20813 = mono_metadata_decode_value (p.120, &p);
  num = (int) D.20813;
  i = 0;
  goto <D.18084>;
  <D.18083>:
  {
    gboolean is_valid;
    gboolean abort_decoding;

    try
      {
        is_valid = 0;
        abort_decoding = 0;
        p.120 = p;
        D.20814 = mono_metadata_decode_value (p.120, &p);
        len = (int) D.20814;
        len.126 = (unsigned int) len;
        if (len.126 > 54) goto <D.20819>; else goto <D.20816>;
        <D.20819>:
        p.120 = p;
        D.20820 = memcmp (p.120, "System.Security.Permissions.SecurityPermissionAttribute", 55);
        if (D.20820 == 0) goto <D.20821>; else goto <D.20816>;
        <D.20821>:
        iftmp.125 = 1;
        goto <D.20817>;
        <D.20816>:
        iftmp.125 = 0;
        <D.20817>:
        is_valid = iftmp.125;
        p.120 = p;
        len.127 = (sizetype) len;
        p.128 = p.120 + len.127;
        p = p.128;
        p.120 = p;
        D.20824 = mono_metadata_decode_value (p.120, &p);
        params_len = (int) D.20824;
        if (is_valid != 0) goto <D.20825>; else goto <D.20826>;
        <D.20825>:
        {
          const char * params_end;

          p.120 = p;
          params_len.129 = (sizetype) params_len;
          params_end = p.120 + params_len.129;
          p.120 = p;
          D.20828 = mono_metadata_decode_value (p.120, &p);
          len = (int) D.20828;
          j = 0;
          goto <D.18082>;
          <D.18081>:
          p.120 = p;
          D.20829 = mono_assembly_try_decode_skip_verification_param (p.120, &p, &abort_decoding);
          if (D.20829 != 0) goto <D.20830>; else goto <D.20831>;
          <D.20830>:
          D.20807 = 1;
          return D.20807;
          <D.20831>:
          abort_decoding.130 = abort_decoding;
          if (abort_decoding.130 != 0) goto <D.18080>; else goto <D.20833>;
          <D.20833>:
          j = j + 1;
          <D.18082>:
          if (j < len) goto <D.18081>; else goto <D.18080>;
          <D.18080>:
          p = params_end;
        }
        goto <D.20834>;
        <D.20826>:
        p.120 = p;
        params_len.129 = (sizetype) params_len;
        p.131 = p.120 + params_len.129;
        p = p.131;
        <D.20834>:
      }
    finally
      {
        abort_decoding = {CLOBBER};
      }
  }
  i = i + 1;
  <D.18084>:
  if (i < num) goto <D.18083>; else goto <D.18085>;
  <D.18085>:
  D.20807 = 0;
  return D.20807;
}


mono_assembly_try_decode_skip_verification_param (const char * p, const char * * resp, gboolean * abort_decoding)
{
  const char * p.132;
  const char * p.133;
  const char * p.134;
  char D.20843;
  int D.20844;
  gboolean D.20845;
  const char * p.135;
  const char * p.136;
  char D.20848;
  unsigned int D.20851;
  unsigned int len.137;
  int D.20855;
  sizetype len.138;
  const char * p.139;
  char D.20860;
  sizetype D.20861;
  const char * p.140;
  int len;

  p.132 = p;
  p.133 = p.132;
  p.134 = p.133 + 1;
  p = p.134;
  D.20843 = *p.133;
  D.20844 = (int) D.20843;
  switch (D.20844) <default: <D.18063>, case 83: <D.18062>, case 84: <D.18060>>
  <D.18060>:
  goto <D.18061>;
  <D.18062>:
  <D.18063>:
  *abort_decoding = 1;
  D.20845 = 0;
  return D.20845;
  <D.18061>:
  p.132 = p;
  p.135 = p.132;
  p.136 = p.135 + 1;
  p = p.136;
  D.20848 = *p.135;
  if (D.20848 != 2) goto <D.20849>; else goto <D.20850>;
  <D.20849>:
  *abort_decoding = 1;
  D.20845 = 0;
  return D.20845;
  <D.20850>:
  p.132 = p;
  D.20851 = mono_metadata_decode_value (p.132, &p);
  len = (int) D.20851;
  len.137 = (unsigned int) len;
  if (len.137 > 15) goto <D.20853>; else goto <D.20854>;
  <D.20853>:
  p.132 = p;
  D.20855 = memcmp (p.132, "SkipVerification", 16);
  if (D.20855 == 0) goto <D.20856>; else goto <D.20857>;
  <D.20856>:
  p.132 = p;
  len.138 = (sizetype) len;
  p.139 = p.132 + len.138;
  p = p.139;
  p.132 = p;
  D.20860 = *p.132;
  D.20845 = (gboolean) D.20860;
  return D.20845;
  <D.20857>:
  <D.20854>:
  p.132 = p;
  len.138 = (sizetype) len;
  D.20861 = len.138 + 1;
  p.140 = p.132 + D.20861;
  p = p.140;
  p.132 = p;
  *resp = p.132;
  D.20845 = 0;
  return D.20845;
}


