mono_install_runtime_load (struct MonoDomain * (*MonoLoadFunc) (const char *, const char *) func)
{
  load_function = func;
}


mono_runtime_load (const char * filename, const char * runtime_version)
{
  struct MonoDomain * (*<T2660>) (const char *, const char *) load_function.0;
  _Bool D.22229;
  long int D.22230;
  long int D.22231;
  struct MonoDomain * D.22234;

  load_function.0 = load_function;
  D.22229 = load_function.0 == 0B;
  D.22230 = (long int) D.22229;
  D.22231 = __builtin_expect (D.22230, 0);
  if (D.22231 != 0) goto <D.22232>; else goto <D.22233>;
  <D.22232>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 136, "load_function");
  <D.22233>:
  load_function.0 = load_function;
  D.22234 = load_function.0 (filename, runtime_version);
  return D.22234;
}


mono_runtime_set_no_exec (gboolean val)
{
  no_exec = val;
}


mono_runtime_get_no_exec ()
{
  gboolean D.22236;

  D.22236 = no_exec;
  return D.22236;
}


mono_runtime_init (struct MonoDomain * domain, void (*MonoThreadStartCB) (intptr_t, void *, void *) start_cb, void (*MonoThreadAttachCB) (intptr_t, void *) attach_cb)
{
  struct MonoImage * D.22238;
  struct MonoAppContext * D.22239;
  int D.22240;
  struct MonoAssembly * D.22243;
  struct MonoAppDomainSetup * setup;
  struct MonoAppDomain * ad;
  struct MonoClass * class;

  mono_portability_helpers_init ();
  mono_gc_base_init ();
  mono_monitor_init ();
  mono_thread_pool_init ();
  mono_marshal_init ();
  mono_install_assembly_preload_hook (mono_domain_assembly_preload, 0B);
  mono_install_assembly_refonly_preload_hook (mono_domain_assembly_preload, 1B);
  mono_install_assembly_search_hook (mono_domain_assembly_search, 0B);
  mono_install_assembly_refonly_search_hook (mono_domain_assembly_search, 1B);
  mono_install_assembly_postload_search_hook (mono_domain_assembly_postload_search, 0B);
  mono_install_assembly_postload_refonly_search_hook (mono_domain_assembly_postload_search, 1B);
  mono_install_assembly_load_hook (mono_domain_fire_assembly_load, 0B);
  mono_install_lookup_dynamic_token (mono_reflection_lookup_dynamic_token);
  mono_thread_init (start_cb, attach_cb);
  D.22238 = mono_defaults.corlib;
  class = mono_class_from_name (D.22238, "System", "AppDomainSetup");
  setup = mono_object_new (domain, class);
  D.22238 = mono_defaults.corlib;
  class = mono_class_from_name (D.22238, "System", "AppDomain");
  ad = mono_object_new (domain, class);
  ad->data = domain;
  domain->domain = ad;
  domain->setup = setup;
  InitializeCriticalSection (&mono_delegate_section);
  InitializeCriticalSection (&mono_strtod_mutex);
  mono_thread_attach (domain);
  mono_context_init (domain);
  D.22239 = domain->default_context;
  mono_context_set (D.22239);
  mono_type_initialization_init ();
  D.22240 = mono_runtime_get_no_exec ();
  if (D.22240 == 0) goto <D.22241>; else goto <D.22242>;
  <D.22241>:
  create_domain_objects (domain);
  <D.22242>:
  mono_gc_init ();
  mono_network_init ();
  mono_console_init ();
  mono_attach_init ();
  D.22238 = mono_defaults.corlib;
  D.22243 = D.22238->assembly;
  mono_domain_fire_assembly_load (D.22243, 0B);
  return;
}


mono_domain_assembly_postload_search (struct MonoAssemblyName * aname, void * user_data)
{
  struct MonoAssembly * D.22247;
  gboolean refonly;
  struct MonoReflectionAssembly * assembly;
  struct MonoDomain * domain;
  char * aname_str;
  struct MonoString * str;

  refonly = (gboolean) user_data;
  domain = mono_domain_get ();
  aname_str = mono_stringify_assembly_name (aname);
  str = mono_string_new (domain, aname_str);
  if (str == 0B) goto <D.22245>; else goto <D.22246>;
  <D.22245>:
  monoeg_g_free (aname_str);
  D.22247 = 0B;
  return D.22247;
  <D.22246>:
  assembly = mono_try_assembly_resolve (domain, str, refonly);
  monoeg_g_free (aname_str);
  if (assembly != 0B) goto <D.22248>; else goto <D.22249>;
  <D.22248>:
  D.22247 = assembly->assembly;
  return D.22247;
  <D.22249>:
  D.22247 = 0B;
  return D.22247;
}


mono_domain_assembly_search (struct MonoAssemblyName * aname, void * user_data)
{
  union mono_mutex_t * D.22251;
  _Bool D.22254;
  long int D.22255;
  long int D.22256;
  unsigned char D.22261;
  int D.22263;
  struct MonoAssemblyName * D.22265;
  int D.22266;
  _Bool D.22269;
  long int D.22270;
  long int D.22271;
  struct MonoAssembly * D.22274;
  _Bool D.22277;
  long int D.22278;
  long int D.22279;
  struct MonoDomain * domain;
  struct GSList * tmp;
  struct MonoAssembly * ass;
  gboolean refonly;

  domain = mono_domain_get ();
  refonly = (gboolean) user_data;
  {
    int ret;

    D.22251 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.22251);
    if (ret != 0) goto <D.22252>; else goto <D.22253>;
    <D.22252>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22253>:
    D.22254 = ret != 0;
    D.22255 = (long int) D.22254;
    D.22256 = __builtin_expect (D.22255, 0);
    if (D.22256 != 0) goto <D.22257>; else goto <D.22258>;
    <D.22257>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1853, "ret == 0");
    <D.22258>:
  }
  tmp = domain->domain_assemblies;
  goto <D.22043>;
  <D.22042>:
  ass = tmp->data;
  D.22261 = ass->dynamic;
  if (D.22261 != 0) goto <D.22259>; else goto <D.22262>;
  <D.22262>:
  D.22263 = ass->ref_only;
  if (D.22263 != refonly) goto <D.22259>; else goto <D.22264>;
  <D.22264>:
  D.22265 = &ass->aname;
  D.22266 = mono_assembly_names_equal (aname, D.22265);
  if (D.22266 == 0) goto <D.22259>; else goto <D.22260>;
  <D.22259>:
  // predicted unlikely by continue predictor.
  goto <D.22040>;
  <D.22260>:
  {
    int ret;

    D.22251 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.22251);
    if (ret != 0) goto <D.22267>; else goto <D.22268>;
    <D.22267>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22268>:
    D.22269 = ret != 0;
    D.22270 = (long int) D.22269;
    D.22271 = __builtin_expect (D.22270, 0);
    if (D.22271 != 0) goto <D.22272>; else goto <D.22273>;
    <D.22272>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1860, "ret == 0");
    <D.22273>:
  }
  D.22274 = ass;
  return D.22274;
  <D.22040>:
  tmp = tmp->next;
  <D.22043>:
  if (tmp != 0B) goto <D.22042>; else goto <D.22044>;
  <D.22044>:
  {
    int ret;

    D.22251 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.22251);
    if (ret != 0) goto <D.22275>; else goto <D.22276>;
    <D.22275>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22276>:
    D.22277 = ret != 0;
    D.22278 = (long int) D.22277;
    D.22279 = __builtin_expect (D.22278, 0);
    if (D.22279 != 0) goto <D.22280>; else goto <D.22281>;
    <D.22280>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1863, "ret == 0");
    <D.22281>:
  }
  D.22274 = 0B;
  return D.22274;
}


mono_domain_assembly_preload (struct MonoAssemblyName * aname, gchar * * assemblies_path, void * user_data)
{
  gchar * * D.22283;
  gchar * D.22286;
  const char * D.22289;
  const char * D.22290;
  _Bool D.22291;
  _Bool D.22292;
  _Bool D.22293;
  gchar * D.22296;
  struct MonoAssembly * D.22299;
  struct MonoDomain * domain;
  struct MonoAssembly * result;
  gboolean refonly;

  domain = mono_domain_get ();
  result = 0B;
  refonly = (gboolean) user_data;
  set_domain_search_path (domain);
  D.22283 = domain->search_path;
  if (D.22283 != 0B) goto <D.22284>; else goto <D.22285>;
  <D.22284>:
  D.22283 = domain->search_path;
  D.22286 = *D.22283;
  if (D.22286 != 0B) goto <D.22287>; else goto <D.22288>;
  <D.22287>:
  D.22283 = domain->search_path;
  D.22289 = aname->culture;
  D.22290 = aname->name;
  result = real_load (D.22283, D.22289, D.22290, refonly);
  <D.22288>:
  <D.22285>:
  D.22291 = result == 0B;
  D.22292 = assemblies_path != 0B;
  D.22293 = D.22291 & D.22292;
  if (D.22293 != 0) goto <D.22294>; else goto <D.22295>;
  <D.22294>:
  D.22296 = *assemblies_path;
  if (D.22296 != 0B) goto <D.22297>; else goto <D.22298>;
  <D.22297>:
  D.22289 = aname->culture;
  D.22290 = aname->name;
  result = real_load (assemblies_path, D.22289, D.22290, refonly);
  <D.22298>:
  <D.22295>:
  D.22299 = result;
  return D.22299;
}


set_domain_search_path (struct MonoDomain * domain)
{
  union mono_mutex_t * D.22301;
  _Bool D.22304;
  long int D.22305;
  long int D.22306;
  struct MonoAppDomainSetup * D.22309;
  _Bool D.22314;
  long int D.22315;
  long int D.22316;
  gchar * * D.22319;
  unsigned char D.22322;
  _Bool D.22327;
  long int D.22328;
  long int D.22329;
  struct MonoString * D.22332;
  _Bool D.22337;
  long int D.22338;
  long int D.22339;
  struct MonoString * D.22342;
  int D.22345;
  _Bool D.22350;
  long int D.22351;
  long int D.22352;
  gchar * D.22355;
  unsigned int D.22363;
  sizetype i.1;
  gchar * D.22365;
  char D.22366;
  gchar * D.22369;
  _Bool D.22376;
  long int D.22377;
  long int D.22378;
  int D.22383;
  unsigned int D.22384;
  unsigned int D.22385;
  unsigned int npaths.2;
  unsigned int D.22387;
  gchar * * D.22388;
  char * D.22389;
  int D.22390;
  _Bool D.22395;
  long int D.22396;
  long int D.22397;
  int D.22400;
  gchar * D.22403;
  char D.22404;
  gchar * D.22407;
  struct GError * gerror.3;
  gchar * D.22413;
  sizetype D.22415;
  sizetype D.22416;
  gchar * * D.22417;
  gchar * D.22418;
  int D.22419;
  unsigned int i.4;
  unsigned int D.22423;
  gchar * * D.22424;
  gchar * D.22425;
  gchar * D.22427;
  gchar * D.22428;
  char * D.22429;
  unsigned int D.22434;
  unsigned int appbaselen.5;
  int D.22436;
  gchar * D.22439;
  _Bool D.22440;
  _Bool D.22441;
  _Bool D.22442;
  struct MonoString * D.22443;
  gchar * D.22446;
  _Bool D.22449;
  long int D.22450;
  long int D.22451;
  struct MonoError error;
  struct MonoAppDomainSetup * setup;
  gchar * * tmp;
  gchar * search_path;
  gint i;
  gint npaths;
  gchar * * pvt_split;
  struct GError * gerror;
  gint appbaselen;

  try
    {
      search_path = 0B;
      npaths = 0;
      pvt_split = 0B;
      gerror = 0B;
      appbaselen = -1;
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.22301);
        if (ret != 0) goto <D.22302>; else goto <D.22303>;
        <D.22302>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.22303>:
        D.22304 = ret != 0;
        D.22305 = (long int) D.22304;
        D.22306 = __builtin_expect (D.22305, 0);
        if (D.22306 != 0) goto <D.22307>; else goto <D.22308>;
        <D.22307>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1058, "ret == 0");
        <D.22308>:
      }
      D.22309 = domain->setup;
      if (D.22309 == 0B) goto <D.22310>; else goto <D.22311>;
      <D.22310>:
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22312>; else goto <D.22313>;
        <D.22312>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22313>:
        D.22314 = ret != 0;
        D.22315 = (long int) D.22314;
        D.22316 = __builtin_expect (D.22315, 0);
        if (D.22316 != 0) goto <D.22317>; else goto <D.22318>;
        <D.22317>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1061, "ret == 0");
        <D.22318>:
      }
      return;
      <D.22311>:
      D.22319 = domain->search_path;
      if (D.22319 != 0B) goto <D.22320>; else goto <D.22321>;
      <D.22320>:
      D.22309 = domain->setup;
      D.22322 = D.22309->path_changed;
      if (D.22322 == 0) goto <D.22323>; else goto <D.22324>;
      <D.22323>:
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22325>; else goto <D.22326>;
        <D.22325>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22326>:
        D.22327 = ret != 0;
        D.22328 = (long int) D.22327;
        D.22329 = __builtin_expect (D.22328, 0);
        if (D.22329 != 0) goto <D.22330>; else goto <D.22331>;
        <D.22330>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1066, "ret == 0");
        <D.22331>:
      }
      return;
      <D.22324>:
      <D.22321>:
      setup = domain->setup;
      D.22332 = setup->application_base;
      if (D.22332 == 0B) goto <D.22333>; else goto <D.22334>;
      <D.22333>:
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22335>; else goto <D.22336>;
        <D.22335>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22336>:
        D.22337 = ret != 0;
        D.22338 = (long int) D.22337;
        D.22339 = __builtin_expect (D.22338, 0);
        if (D.22339 != 0) goto <D.22340>; else goto <D.22341>;
        <D.22340>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1071, "ret == 0");
        <D.22341>:
      }
      return;
      <D.22334>:
      npaths = npaths + 1;
      D.22342 = setup->private_bin_path;
      if (D.22342 != 0B) goto <D.22343>; else goto <D.22344>;
      <D.22343>:
      D.22342 = setup->private_bin_path;
      search_path = mono_string_to_utf8_checked (D.22342, &error);
      D.22345 = mono_error_ok (&error);
      if (D.22345 == 0) goto <D.22346>; else goto <D.22347>;
      <D.22346>:
      monoeg_g_log (0B, 16, "Could not decode AppDomain search path since it contains invalid characters");
      mono_error_cleanup (&error);
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22348>; else goto <D.22349>;
        <D.22348>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22349>:
        D.22350 = ret != 0;
        D.22351 = (long int) D.22350;
        D.22352 = __builtin_expect (D.22351, 0);
        if (D.22352 != 0) goto <D.22353>; else goto <D.22354>;
        <D.22353>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1082, "ret == 0");
        <D.22354>:
      }
      return;
      <D.22347>:
      <D.22344>:
      D.22355 = domain->private_bin_path;
      if (D.22355 != 0B) goto <D.22356>; else goto <D.22357>;
      <D.22356>:
      if (search_path == 0B) goto <D.22358>; else goto <D.22359>;
      <D.22358>:
      search_path = domain->private_bin_path;
      goto <D.22360>;
      <D.22359>:
      {
        gchar * tmp2;

        tmp2 = search_path;
        D.22355 = domain->private_bin_path;
        search_path = monoeg_g_strjoin (";", search_path, D.22355, 0B);
        monoeg_g_free (tmp2);
      }
      <D.22360>:
      <D.22357>:
      if (search_path != 0B) goto <D.22361>; else goto <D.22362>;
      <D.22361>:
      {
        gint slen;

        D.22363 = strlen (search_path);
        slen = (gint) D.22363;
        i = 0;
        goto <D.21833>;
        <D.21832>:
        i.1 = (sizetype) i;
        D.22365 = search_path + i.1;
        D.22366 = *D.22365;
        if (D.22366 == 58) goto <D.22367>; else goto <D.22368>;
        <D.22367>:
        i.1 = (sizetype) i;
        D.22365 = search_path + i.1;
        *D.22365 = 59;
        <D.22368>:
        i = i + 1;
        <D.21833>:
        if (i < slen) goto <D.21832>; else goto <D.21834>;
        <D.21834>:
        pvt_split = monoeg_g_strsplit (search_path, ";", 1000);
        monoeg_g_free (search_path);
        tmp = pvt_split;
        goto <D.21836>;
        <D.21835>:
        tmp = tmp + 4;
        npaths = npaths + 1;
        <D.21836>:
        D.22369 = *tmp;
        if (D.22369 != 0B) goto <D.21835>; else goto <D.21837>;
        <D.21837>:
      }
      <D.22362>:
      if (npaths == 0) goto <D.22370>; else goto <D.22371>;
      <D.22370>:
      if (pvt_split != 0B) goto <D.22372>; else goto <D.22373>;
      <D.22372>:
      monoeg_g_strfreev (pvt_split);
      <D.22373>:
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22374>; else goto <D.22375>;
        <D.22374>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22375>:
        D.22376 = ret != 0;
        D.22377 = (long int) D.22376;
        D.22378 = __builtin_expect (D.22377, 0);
        if (D.22378 != 0) goto <D.22379>; else goto <D.22380>;
        <D.22379>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1133, "ret == 0");
        <D.22380>:
      }
      return;
      <D.22371>:
      D.22319 = domain->search_path;
      if (D.22319 != 0B) goto <D.22381>; else goto <D.22382>;
      <D.22381>:
      D.22319 = domain->search_path;
      monoeg_g_strfreev (D.22319);
      <D.22382>:
      D.22383 = npaths + 1;
      D.22384 = (unsigned int) D.22383;
      D.22385 = D.22384 * 4;
      tmp = monoeg_malloc (D.22385);
      npaths.2 = (unsigned int) npaths;
      D.22387 = npaths.2 * 4;
      D.22388 = tmp + D.22387;
      *D.22388 = 0B;
      D.22332 = setup->application_base;
      D.22389 = mono_string_to_utf8_checked (D.22332, &error);
      *tmp = D.22389;
      D.22390 = mono_error_ok (&error);
      if (D.22390 == 0) goto <D.22391>; else goto <D.22392>;
      <D.22391>:
      mono_error_cleanup (&error);
      monoeg_g_strfreev (pvt_split);
      monoeg_g_free (tmp);
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22393>; else goto <D.22394>;
        <D.22393>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22394>:
        D.22395 = ret != 0;
        D.22396 = (long int) D.22395;
        D.22397 = __builtin_expect (D.22396, 0);
        if (D.22397 != 0) goto <D.22398>; else goto <D.22399>;
        <D.22398>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1149, "ret == 0");
        <D.22399>:
      }
      return;
      <D.22392>:
      domain->search_path = tmp;
      D.22369 = *tmp;
      D.22400 = strncmp (D.22369, "file://", 7);
      if (D.22400 == 0) goto <D.22401>; else goto <D.22402>;
      <D.22401>:
      {
        gchar * file;
        gchar * uri;
        gchar * tmpuri;

        file = *tmp;
        uri = *tmp;
        D.22403 = uri + 7;
        D.22404 = *D.22403;
        if (D.22404 != 47) goto <D.22405>; else goto <D.22406>;
        <D.22405>:
        D.22403 = uri + 7;
        uri = monoeg_g_strdup_printf ("file:///%s", D.22403);
        <D.22406>:
        tmpuri = uri;
        uri = mono_escape_uri_string (tmpuri);
        D.22407 = monoeg_g_filename_from_uri (uri, 0B, &gerror);
        *tmp = D.22407;
        monoeg_g_free (uri);
        if (tmpuri != file) goto <D.22408>; else goto <D.22409>;
        <D.22408>:
        monoeg_g_free (tmpuri);
        <D.22409>:
        gerror.3 = gerror;
        if (gerror.3 != 0B) goto <D.22411>; else goto <D.22412>;
        <D.22411>:
        gerror.3 = gerror;
        D.22413 = gerror.3->message;
        monoeg_g_log (0B, 16, "%s\n", D.22413);
        gerror.3 = gerror;
        monoeg_g_error_free (gerror.3);
        *tmp = file;
        goto <D.22414>;
        <D.22412>:
        monoeg_g_free (file);
        <D.22414>:
      }
      <D.22402>:
      i = 1;
      goto <D.21865>;
      <D.21864>:
      i.1 = (sizetype) i;
      D.22415 = i.1 + 1073741823;
      D.22416 = D.22415 * 4;
      D.22417 = pvt_split + D.22416;
      D.22418 = *D.22417;
      D.22419 = monoeg_g_path_is_absolute (D.22418);
      if (D.22419 != 0) goto <D.22420>; else goto <D.22421>;
      <D.22420>:
      i.4 = (unsigned int) i;
      D.22423 = i.4 * 4;
      D.22424 = tmp + D.22423;
      i.1 = (sizetype) i;
      D.22415 = i.1 + 1073741823;
      D.22416 = D.22415 * 4;
      D.22417 = pvt_split + D.22416;
      D.22418 = *D.22417;
      D.22425 = monoeg_strdup (D.22418);
      *D.22424 = D.22425;
      goto <D.22426>;
      <D.22421>:
      i.4 = (unsigned int) i;
      D.22423 = i.4 * 4;
      D.22424 = tmp + D.22423;
      D.22369 = *tmp;
      i.1 = (sizetype) i;
      D.22415 = i.1 + 1073741823;
      D.22416 = D.22415 * 4;
      D.22417 = pvt_split + D.22416;
      D.22418 = *D.22417;
      D.22427 = monoeg_g_build_path ("/", D.22369, D.22418, 0B);
      *D.22424 = D.22427;
      <D.22426>:
      i.4 = (unsigned int) i;
      D.22423 = i.4 * 4;
      D.22424 = tmp + D.22423;
      D.22428 = *D.22424;
      D.22429 = __builtin_strchr (D.22428, 46);
      if (D.22429 != 0B) goto <D.22430>; else goto <D.22431>;
      <D.22430>:
      {
        gchar * reduced;
        gchar * freeme;

        i.4 = (unsigned int) i;
        D.22423 = i.4 * 4;
        D.22424 = tmp + D.22423;
        D.22428 = *D.22424;
        reduced = mono_path_canonicalize (D.22428);
        if (appbaselen == -1) goto <D.22432>; else goto <D.22433>;
        <D.22432>:
        D.22369 = *tmp;
        D.22434 = strlen (D.22369);
        appbaselen = (gint) D.22434;
        <D.22433>:
        D.22369 = *tmp;
        appbaselen.5 = (unsigned int) appbaselen;
        D.22436 = strncmp (D.22369, reduced, appbaselen.5);
        if (D.22436 != 0) goto <D.22437>; else goto <D.22438>;
        <D.22437>:
        monoeg_g_free (reduced);
        i.4 = (unsigned int) i;
        D.22423 = i.4 * 4;
        D.22424 = tmp + D.22423;
        D.22428 = *D.22424;
        monoeg_g_free (D.22428);
        i.4 = (unsigned int) i;
        D.22423 = i.4 * 4;
        D.22424 = tmp + D.22423;
        D.22439 = monoeg_strdup ("");
        *D.22424 = D.22439;
        // predicted unlikely by continue predictor.
        goto <D.21863>;
        <D.22438>:
        i.4 = (unsigned int) i;
        D.22423 = i.4 * 4;
        D.22424 = tmp + D.22423;
        freeme = *D.22424;
        i.4 = (unsigned int) i;
        D.22423 = i.4 * 4;
        D.22424 = tmp + D.22423;
        *D.22424 = reduced;
        monoeg_g_free (freeme);
      }
      <D.22431>:
      <D.21863>:
      i = i + 1;
      <D.21865>:
      D.22440 = pvt_split != 0B;
      D.22441 = i < npaths;
      D.22442 = D.22440 & D.22441;
      if (D.22442 != 0) goto <D.21864>; else goto <D.21866>;
      <D.21866>:
      D.22443 = setup->private_bin_path_probe;
      if (D.22443 != 0B) goto <D.22444>; else goto <D.22445>;
      <D.22444>:
      D.22369 = *tmp;
      monoeg_g_free (D.22369);
      D.22446 = monoeg_strdup ("");
      *tmp = D.22446;
      <D.22445>:
      D.22309 = domain->setup;
      D.22309->path_changed = 0;
      monoeg_g_strfreev (pvt_split);
      {
        int ret;

        D.22301 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22301);
        if (ret != 0) goto <D.22447>; else goto <D.22448>;
        <D.22447>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22448>:
        D.22449 = ret != 0;
        D.22450 = (long int) D.22449;
        D.22451 = __builtin_expect (D.22450, 0);
        if (D.22451 != 0) goto <D.22452>; else goto <D.22453>;
        <D.22452>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1218, "ret == 0");
        <D.22453>:
      }
    }
  finally
    {
      error = {CLOBBER};
      gerror = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.22457>; else goto <D.22458>;
  <D.22457>:
  D.22459 = __strdup (str);
  return D.22459;
  <D.22458>:
  D.22459 = 0B;
  return D.22459;
}


real_load (gchar * * search_path, const gchar * culture, const gchar * name, gboolean refonly)
{
  char D.22465;
  unsigned int D.22466;
  gchar * D.22467;
  char D.22468;
  sizetype len.6;
  sizetype D.22472;
  gchar * D.22473;
  int D.22474;
  int D.22476;
  int D.22478;
  int D.22480;
  struct MonoAssembly * D.22482;
  struct MonoAssembly * result;
  gchar * * path;
  gchar * filename;
  const gchar * local_culture;
  gint len;
  gboolean is_private;

  try
    {
      result = 0B;
      is_private = 0;
      if (culture == 0B) goto <D.22461>; else goto <D.22464>;
      <D.22464>:
      D.22465 = *culture;
      if (D.22465 == 0) goto <D.22461>; else goto <D.22462>;
      <D.22461>:
      local_culture = "";
      goto <D.22463>;
      <D.22462>:
      local_culture = culture;
      <D.22463>:
      filename = monoeg_g_strconcat (name, ".dll", 0B);
      D.22466 = strlen (filename);
      len = (gint) D.22466;
      path = search_path;
      goto <D.22022>;
      <D.22021>:
      D.22467 = *path;
      D.22468 = *D.22467;
      if (D.22468 == 0) goto <D.22469>; else goto <D.22470>;
      <D.22469>:
      is_private = 1;
      // predicted unlikely by continue predictor.
      goto <D.22019>;
      <D.22470>:
      len.6 = (sizetype) len;
      D.22472 = len.6 + 4294967292;
      D.22473 = filename + D.22472;
      strcpy (D.22473, ".dll");
      D.22467 = *path;
      D.22474 = try_load_from (&result, D.22467, local_culture, "", filename, refonly, is_private);
      if (D.22474 != 0) goto <D.22020>; else goto <D.22475>;
      <D.22475>:
      len.6 = (sizetype) len;
      D.22472 = len.6 + 4294967292;
      D.22473 = filename + D.22472;
      strcpy (D.22473, ".exe");
      D.22467 = *path;
      D.22476 = try_load_from (&result, D.22467, local_culture, "", filename, refonly, is_private);
      if (D.22476 != 0) goto <D.22020>; else goto <D.22477>;
      <D.22477>:
      len.6 = (sizetype) len;
      D.22472 = len.6 + 4294967292;
      D.22473 = filename + D.22472;
      strcpy (D.22473, ".dll");
      D.22467 = *path;
      D.22478 = try_load_from (&result, D.22467, local_culture, name, filename, refonly, is_private);
      if (D.22478 != 0) goto <D.22020>; else goto <D.22479>;
      <D.22479>:
      len.6 = (sizetype) len;
      D.22472 = len.6 + 4294967292;
      D.22473 = filename + D.22472;
      strcpy (D.22473, ".exe");
      D.22467 = *path;
      D.22480 = try_load_from (&result, D.22467, local_culture, name, filename, refonly, is_private);
      if (D.22480 != 0) goto <D.22020>; else goto <D.22481>;
      <D.22481>:
      <D.22019>:
      path = path + 4;
      <D.22022>:
      D.22467 = *path;
      if (D.22467 != 0B) goto <D.22021>; else goto <D.22020>;
      <D.22020>:
      monoeg_g_free (filename);
      D.22482 = result;
      return D.22482;
    }
  finally
    {
      result = {CLOBBER};
    }
}


strcpy (char * restrict __dest, const char * restrict __src)
{
  char * D.22485;
  unsigned int D.22486;

  D.22486 = __builtin_object_size (__dest, 1);
  D.22485 = __builtin___strcpy_chk (__dest, __src, D.22486);
  return D.22485;
}


try_load_from (struct MonoAssembly * * assembly, const gchar * path1, const gchar * path2, const gchar * path3, const gchar * path4, gboolean refonly, gboolean is_private)
{
  int __mono_io_portability_helpers.7;
  struct MonoAssembly * D.22496;
  gboolean D.22497;
  struct MonoAssembly * D.22498;
  _Bool D.22499;
  gchar * fullpath;
  gboolean found;

  found = 0;
  *assembly = 0B;
  fullpath = monoeg_g_build_path ("/", path1, path2, path3, path4, 0B);
  __mono_io_portability_helpers.7 = __mono_io_portability_helpers;
  if (__mono_io_portability_helpers.7 > 0) goto <D.22489>; else goto <D.22490>;
  <D.22489>:
  {
    gchar * new_fullpath;

    new_fullpath = mono_portability_find_file (fullpath, 1);
    if (new_fullpath != 0B) goto <D.22491>; else goto <D.22492>;
    <D.22491>:
    monoeg_g_free (fullpath);
    fullpath = new_fullpath;
    found = 1;
    <D.22492>:
  }
  goto <D.22493>;
  <D.22490>:
  found = monoeg_g_file_test (fullpath, 1);
  <D.22493>:
  if (found != 0) goto <D.22494>; else goto <D.22495>;
  <D.22494>:
  D.22496 = mono_assembly_open_full (fullpath, 0B, refonly);
  *assembly = D.22496;
  <D.22495>:
  monoeg_g_free (fullpath);
  D.22498 = *assembly;
  D.22499 = D.22498 != 0B;
  D.22497 = (gboolean) D.22499;
  return D.22497;
}


create_domain_objects (struct MonoDomain * domain)
{
  struct MonoImage * D.22503;
  struct MonoException * D.22504;
  struct MonoException * D.22505;
  struct MonoException * D.22506;
  struct MonoClass * D.22507;
  struct MonoObject * D.22508;
  struct MonoClass * D.22511;
  struct MonoClass * D.22512;
  struct MonoDomain * old_domain;
  struct MonoString * arg;

  old_domain = mono_domain_get ();
  if (domain != old_domain) goto <D.22501>; else goto <D.22502>;
  <D.22501>:
  mono_thread_push_appdomain_ref (domain);
  mono_domain_set_internal_with_options (domain, 0);
  <D.22502>:
  arg = mono_string_new (domain, "Out of memory");
  D.22503 = mono_defaults.corlib;
  D.22504 = mono_exception_from_name_two_strings (D.22503, "System", "OutOfMemoryException", arg, 0B);
  domain->out_of_memory_ex = D.22504;
  arg = mono_string_new (domain, "A null value was found where an object instance was required");
  D.22503 = mono_defaults.corlib;
  D.22505 = mono_exception_from_name_two_strings (D.22503, "System", "NullReferenceException", arg, 0B);
  domain->null_reference_ex = D.22505;
  arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
  D.22503 = mono_defaults.corlib;
  D.22506 = mono_exception_from_name_two_strings (D.22503, "System", "StackOverflowException", arg, 0B);
  domain->stack_overflow_ex = D.22506;
  D.22507 = mono_defaults.object_class;
  D.22508 = mono_object_new (domain, D.22507);
  domain->ephemeron_tombstone = D.22508;
  if (domain != old_domain) goto <D.22509>; else goto <D.22510>;
  <D.22509>:
  mono_thread_pop_appdomain_ref ();
  mono_domain_set_internal_with_options (old_domain, 0);
  <D.22510>:
  D.22511 = mono_defaults.int_class;
  D.22512 = mono_array_class_get (D.22511, 1);
  mono_class_init (D.22512);
}


mono_domain_fire_assembly_load (struct MonoAssembly * assembly, void * user_data)
{
  struct MonoAppDomain * D.22513;
  struct MonoVTable * D.22516;
  union mono_mutex_t * D.22517;
  _Bool D.22520;
  long int D.22521;
  long int D.22522;
  _Bool D.22527;
  long int D.22528;
  long int D.22529;
  struct MonoClassField * assembly_load_field.8;
  struct MonoClassField * assembly_load_field.9;
  _Bool D.22536;
  long int D.22537;
  long int D.22538;
  void * load_value.10;
  _Bool D.22544;
  long int D.22545;
  long int D.22546;
  struct MonoMethod * assembly_load_method.11;
  struct MonoMethod * assembly_load_method.12;
  _Bool D.22553;
  long int D.22554;
  long int D.22555;
  static struct MonoClassField * assembly_load_field;
  static struct MonoMethod * assembly_load_method;
  struct MonoDomain * domain;
  struct MonoReflectionAssembly * ref_assembly;
  struct MonoClass * klass;
  void * load_value;
  void * params[1];

  try
    {
      domain = mono_domain_get ();
      D.22513 = domain->domain;
      if (D.22513 == 0B) goto <D.22514>; else goto <D.22515>;
      <D.22514>:
      return;
      <D.22515>:
      D.22513 = domain->domain;
      D.22516 = D.22513->mbr.obj.vtable;
      klass = D.22516->klass;
      {
        int ret;

        D.22517 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.22517);
        if (ret != 0) goto <D.22518>; else goto <D.22519>;
        <D.22518>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.22519>:
        D.22520 = ret != 0;
        D.22521 = (long int) D.22520;
        D.22522 = __builtin_expect (D.22521, 0);
        if (D.22522 != 0) goto <D.22523>; else goto <D.22524>;
        <D.22523>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1011, "ret == 0");
        <D.22524>:
      }
      add_assemblies_to_domain (domain, assembly, 0B);
      {
        int ret;

        D.22517 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.22517);
        if (ret != 0) goto <D.22525>; else goto <D.22526>;
        <D.22525>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.22526>:
        D.22527 = ret != 0;
        D.22528 = (long int) D.22527;
        D.22529 = __builtin_expect (D.22528, 0);
        if (D.22529 != 0) goto <D.22530>; else goto <D.22531>;
        <D.22530>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1013, "ret == 0");
        <D.22531>:
      }
      assembly_load_field.8 = assembly_load_field;
      if (assembly_load_field.8 == 0B) goto <D.22533>; else goto <D.22534>;
      <D.22533>:
      assembly_load_field.9 = mono_class_get_field_from_name (klass, "AssemblyLoad");
      assembly_load_field = assembly_load_field.9;
      assembly_load_field.8 = assembly_load_field;
      D.22536 = assembly_load_field.8 == 0B;
      D.22537 = (long int) D.22536;
      D.22538 = __builtin_expect (D.22537, 0);
      if (D.22538 != 0) goto <D.22539>; else goto <D.22540>;
      <D.22539>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1017, "assembly_load_field");
      <D.22540>:
      <D.22534>:
      D.22513 = domain->domain;
      assembly_load_field.8 = assembly_load_field;
      mono_field_get_value (D.22513, assembly_load_field.8, &load_value);
      load_value.10 = load_value;
      if (load_value.10 == 0B) goto <D.22542>; else goto <D.22543>;
      <D.22542>:
      return;
      <D.22543>:
      ref_assembly = mono_assembly_get_object (domain, assembly);
      D.22544 = ref_assembly == 0B;
      D.22545 = (long int) D.22544;
      D.22546 = __builtin_expect (D.22545, 0);
      if (D.22546 != 0) goto <D.22547>; else goto <D.22548>;
      <D.22547>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1027, "ref_assembly");
      <D.22548>:
      assembly_load_method.11 = assembly_load_method;
      if (assembly_load_method.11 == 0B) goto <D.22550>; else goto <D.22551>;
      <D.22550>:
      assembly_load_method.12 = mono_class_get_method_from_name (klass, "DoAssemblyLoad", -1);
      assembly_load_method = assembly_load_method.12;
      assembly_load_method.11 = assembly_load_method;
      D.22553 = assembly_load_method.11 == 0B;
      D.22554 = (long int) D.22553;
      D.22555 = __builtin_expect (D.22554, 0);
      if (D.22555 != 0) goto <D.22556>; else goto <D.22557>;
      <D.22556>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1031, "assembly_load_method");
      <D.22557>:
      <D.22551>:
      params[0] = ref_assembly;
      assembly_load_method.11 = assembly_load_method;
      D.22513 = domain->domain;
      mono_runtime_invoke (assembly_load_method.11, D.22513, &params, 0B);
    }
  finally
    {
      load_value = {CLOBBER};
      params = {CLOBBER};
    }
}


add_assemblies_to_domain (struct MonoDomain * domain, struct MonoAssembly * ass, struct GHashTable * ht)
{
  const char * D.22561;
  void * D.22566;
  void * D.22567;
  struct GSList * D.22570;
  struct GSList * D.22571;
  char * D.22572;
  int D.22573;
  struct MonoImage * D.22574;
  struct MonoAssembly * * D.22575;
  unsigned int i.13;
  unsigned int D.22579;
  struct MonoAssembly * * D.22580;
  struct MonoAssembly * D.22581;
  void * D.22584;
  gint i;
  struct GSList * tmp;
  gboolean destroy_ht;

  destroy_ht = 0;
  D.22561 = ass->aname.name;
  if (D.22561 == 0B) goto <D.22562>; else goto <D.22563>;
  <D.22562>:
  return;
  <D.22563>:
  if (ht == 0B) goto <D.22564>; else goto <D.22565>;
  <D.22564>:
  ht = monoeg_g_hash_table_new (mono_aligned_addr_hash, 0B);
  destroy_ht = 1;
  <D.22565>:
  tmp = domain->domain_assemblies;
  goto <D.21795>;
  <D.21794>:
  D.22566 = tmp->data;
  D.22566 = tmp->data;
  monoeg_g_hash_table_insert_replace (ht, D.22566, D.22566, 0);
  tmp = tmp->next;
  <D.21795>:
  if (tmp != 0B) goto <D.21794>; else goto <D.21796>;
  <D.21796>:
  D.22567 = monoeg_g_hash_table_lookup (ht, ass);
  if (D.22567 == 0B) goto <D.22568>; else goto <D.22569>;
  <D.22568>:
  mono_assembly_addref (ass);
  monoeg_g_hash_table_insert_replace (ht, ass, ass, 0);
  D.22570 = domain->domain_assemblies;
  D.22571 = monoeg_g_slist_append (D.22570, ass);
  domain->domain_assemblies = D.22571;
  D.22561 = ass->aname.name;
  D.22572 = domain->friendly_name;
  D.22573 = ass->ref_count;
  mono_trace (64, 1, "Assembly %s[%p] added to domain %s, ref_count=%d", D.22561, ass, D.22572, D.22573);
  <D.22569>:
  D.22574 = ass->image;
  D.22575 = D.22574->references;
  if (D.22575 != 0B) goto <D.22576>; else goto <D.22577>;
  <D.22576>:
  i = 0;
  goto <D.21798>;
  <D.21797>:
  D.22574 = ass->image;
  D.22575 = D.22574->references;
  i.13 = (unsigned int) i;
  D.22579 = i.13 * 4;
  D.22580 = D.22575 + D.22579;
  D.22581 = *D.22580;
  if (D.22581 != 4294967295B) goto <D.22582>; else goto <D.22583>;
  <D.22582>:
  D.22574 = ass->image;
  D.22575 = D.22574->references;
  i.13 = (unsigned int) i;
  D.22579 = i.13 * 4;
  D.22580 = D.22575 + D.22579;
  D.22581 = *D.22580;
  D.22584 = monoeg_g_hash_table_lookup (ht, D.22581);
  if (D.22584 == 0B) goto <D.22585>; else goto <D.22586>;
  <D.22585>:
  D.22574 = ass->image;
  D.22575 = D.22574->references;
  i.13 = (unsigned int) i;
  D.22579 = i.13 * 4;
  D.22580 = D.22575 + D.22579;
  D.22581 = *D.22580;
  add_assemblies_to_domain (domain, D.22581, ht);
  <D.22586>:
  <D.22583>:
  i = i + 1;
  <D.21798>:
  D.22574 = ass->image;
  D.22575 = D.22574->references;
  i.13 = (unsigned int) i;
  D.22579 = i.13 * 4;
  D.22580 = D.22575 + D.22579;
  D.22581 = *D.22580;
  if (D.22581 != 0B) goto <D.21797>; else goto <D.21799>;
  <D.21799>:
  <D.22577>:
  if (destroy_ht != 0) goto <D.22587>; else goto <D.22588>;
  <D.22587>:
  monoeg_g_hash_table_destroy (ht);
  <D.22588>:
}


mono_check_corlib_version ()
{
  const char * D.22592;
  int version;

  version = mono_get_corlib_version ();
  if (version != 111) goto <D.22590>; else goto <D.22591>;
  <D.22590>:
  D.22592 = monoeg_g_strdup_printf ("expected corlib version %d, found %d.", 111, version);
  return D.22592;
  <D.22591>:
  D.22592 = 0B;
  return D.22592;
}


mono_get_corlib_version ()
{
  struct MonoImage * D.22594;
  int D.22597;
  struct MonoType * D.22598;
  short unsigned int D.22599;
  int D.22600;
  int D.22601;
  struct MonoDomain * D.22604;
  gint32 * D.22605;
  struct MonoClass * klass;
  struct MonoClassField * field;
  struct MonoObject * value;

  D.22594 = mono_defaults.corlib;
  klass = mono_class_from_name (D.22594, "System", "Environment");
  mono_class_init (klass);
  field = mono_class_get_field_from_name (klass, "mono_corlib_version");
  if (field == 0B) goto <D.22595>; else goto <D.22596>;
  <D.22595>:
  D.22597 = -1;
  return D.22597;
  <D.22596>:
  D.22598 = field->type;
  D.22599 = D.22598->attrs;
  D.22600 = (int) D.22599;
  D.22601 = D.22600 & 16;
  if (D.22601 == 0) goto <D.22602>; else goto <D.22603>;
  <D.22602>:
  D.22597 = -1;
  return D.22597;
  <D.22603>:
  D.22604 = mono_domain_get ();
  value = mono_field_get_value_object (D.22604, field, 0B);
  D.22605 = value + 8;
  D.22597 = *D.22605;
  return D.22597;
}


mono_context_init (struct MonoDomain * domain)
{
  struct MonoImage * D.22607;
  int D.22608;
  struct MonoClass * class;
  struct MonoAppContext * context;

  D.22607 = mono_defaults.corlib;
  class = mono_class_from_name (D.22607, "System.Runtime.Remoting.Contexts", "Context");
  context = mono_object_new (domain, class);
  D.22608 = domain->domain_id;
  context->domain_id = D.22608;
  context->context_id = 0;
  domain->default_context = context;
}


mono_runtime_cleanup (struct MonoDomain * domain)
{
  mono_attach_cleanup ();
  mono_gc_cleanup ();
  mono_thread_cleanup ();
  mono_network_cleanup ();
  mono_marshal_cleanup ();
  mono_type_initialization_cleanup ();
  mono_monitor_cleanup ();
}


mono_install_runtime_cleanup (void (*MonoDomainFunc) (struct MonoDomain *, void *) func)
{
  quit_function = func;
}


mono_runtime_quit ()
{
  void (*<T207b>) (struct MonoDomain *, void *) quit_function.14;
  struct MonoDomain * D.22612;

  quit_function.14 = quit_function;
  if (quit_function.14 != 0B) goto <D.22610>; else goto <D.22611>;
  <D.22610>:
  quit_function.14 = quit_function;
  D.22612 = mono_get_root_domain ();
  quit_function.14 (D.22612, 0B);
  <D.22611>:
}


mono_domain_create_appdomain (char * friendly_name, char * configuration_file)
{
  struct MonoImage * D.22613;
  struct MonoDomain * D.22614;
  struct MonoString * iftmp.15;
  struct MonoDomain * D.22618;
  struct MonoDomain * D.22620;
  struct MonoAppDomain * ad;
  struct MonoAppDomainSetup * setup;
  struct MonoClass * class;

  D.22613 = mono_defaults.corlib;
  class = mono_class_from_name (D.22613, "System", "AppDomainSetup");
  D.22614 = mono_domain_get ();
  setup = mono_object_new (D.22614, class);
  if (configuration_file != 0B) goto <D.22616>; else goto <D.22617>;
  <D.22616>:
  D.22618 = mono_domain_get ();
  iftmp.15 = mono_string_new (D.22618, configuration_file);
  goto <D.22619>;
  <D.22617>:
  iftmp.15 = 0B;
  <D.22619>:
  setup->configuration_file = iftmp.15;
  ad = mono_domain_create_appdomain_internal (friendly_name, setup);
  D.22620 = mono_domain_from_appdomain (ad);
  return D.22620;
}


mono_domain_create_appdomain_internal (char * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.22622;
  gchar * D.22623;
  struct MonoString * D.22624;
  struct MonoAppDomainSetup * D.22627;
  struct MonoString * D.22628;
  struct MonoString * * D.22631;
  mono_unichar2 * D.22632;
  int D.22633;
  struct MonoString * D.22634;
  struct MonoAppDomainSetup * D.22635;
  struct MonoAssembly * D.22636;
  int D.22637;
  struct MonoAppDomain * D.22640;
  struct MonoError error;
  struct MonoClass * adclass;
  struct MonoAppDomain * ad;
  struct MonoDomain * data;
  char * shadow_location;

  try
    {
      D.22622 = mono_defaults.corlib;
      adclass = mono_class_from_name (D.22622, "System", "AppDomain");
      data = mono_domain_create ();
      ad = mono_object_new (data, adclass);
      ad->data = data;
      data->domain = ad;
      D.22623 = monoeg_strdup (friendly_name);
      data->friendly_name = D.22623;
      D.22624 = setup->application_base;
      if (D.22624 == 0B) goto <D.22625>; else goto <D.22626>;
      <D.22625>:
      {
        struct MonoDomain * root;

        root = mono_get_root_domain ();
        D.22627 = root->setup;
        D.22628 = D.22627->application_base;
        if (D.22628 != 0B) goto <D.22629>; else goto <D.22630>;
        <D.22629>:
        D.22631 = &setup->application_base;
        D.22627 = root->setup;
        D.22628 = D.22627->application_base;
        D.22632 = mono_string_chars (D.22628);
        D.22627 = root->setup;
        D.22628 = D.22627->application_base;
        D.22633 = mono_string_length (D.22628);
        D.22634 = mono_string_new_utf16 (data, D.22632, D.22633);
        mono_gc_wbarrier_set_field (setup, D.22631, D.22634);
        <D.22630>:
      }
      <D.22626>:
      mono_context_init (data);
      D.22635 = copy_app_domain_setup (data, setup);
      data->setup = D.22635;
      mono_set_private_bin_path_from_config (data);
      D.22622 = mono_defaults.corlib;
      D.22636 = D.22622->assembly;
      add_assemblies_to_domain (data, D.22636, 0B);
      shadow_location = get_shadow_assembly_location_base (data, &error);
      D.22637 = mono_error_ok (&error);
      if (D.22637 == 0) goto <D.22638>; else goto <D.22639>;
      <D.22638>:
      mono_error_raise_exception (&error);
      <D.22639>:
      monoeg_g_free (shadow_location);
      create_domain_objects (data);
      D.22640 = ad;
      return D.22640;
    }
  finally
    {
      error = {CLOBBER};
    }
}


copy_app_domain_setup (struct MonoDomain * domain, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.22643;
  struct MonoString * * D.22644;
  struct MonoString * D.22645;
  struct MonoObject * D.22646;
  struct MonoString * * D.22647;
  struct MonoString * D.22648;
  struct MonoObject * D.22649;
  struct MonoString * * D.22650;
  struct MonoString * D.22651;
  struct MonoObject * D.22652;
  struct MonoString * * D.22653;
  struct MonoString * D.22654;
  struct MonoObject * D.22655;
  struct MonoString * * D.22656;
  struct MonoString * D.22657;
  struct MonoObject * D.22658;
  struct MonoString * * D.22659;
  struct MonoString * D.22660;
  struct MonoObject * D.22661;
  struct MonoString * * D.22662;
  struct MonoString * D.22663;
  struct MonoObject * D.22664;
  struct MonoString * * D.22665;
  struct MonoString * D.22666;
  struct MonoObject * D.22667;
  struct MonoString * * D.22668;
  struct MonoString * D.22669;
  struct MonoObject * D.22670;
  struct MonoString * * D.22671;
  struct MonoString * D.22672;
  struct MonoObject * D.22673;
  unsigned char D.22674;
  unsigned char D.22675;
  int D.22676;
  unsigned char D.22677;
  unsigned char D.22678;
  struct MonoArray * * D.22679;
  struct MonoArray * D.22680;
  struct MonoObject * D.22681;
  unsigned char D.22682;
  struct MonoObject * * D.22683;
  struct MonoObject * D.22684;
  struct MonoObject * D.22685;
  struct MonoArray * * D.22686;
  struct MonoArray * D.22687;
  struct MonoObject * D.22688;
  struct MonoArray * * D.22689;
  struct MonoArray * D.22690;
  struct MonoObject * D.22691;
  struct MonoAppDomainSetup * D.22692;
  struct MonoDomain * caller_domain;
  struct MonoClass * ads_class;
  struct MonoAppDomainSetup * copy;

  caller_domain = mono_domain_get ();
  D.22643 = mono_defaults.corlib;
  ads_class = mono_class_from_name (D.22643, "System", "AppDomainSetup");
  copy = mono_object_new (domain, ads_class);
  mono_domain_set_internal (domain);
  D.22644 = &copy->application_base;
  D.22645 = setup->application_base;
  D.22646 = mono_marshal_xdomain_copy_value (D.22645);
  mono_gc_wbarrier_set_field (copy, D.22644, D.22646);
  D.22647 = &copy->application_name;
  D.22648 = setup->application_name;
  D.22649 = mono_marshal_xdomain_copy_value (D.22648);
  mono_gc_wbarrier_set_field (copy, D.22647, D.22649);
  D.22650 = &copy->cache_path;
  D.22651 = setup->cache_path;
  D.22652 = mono_marshal_xdomain_copy_value (D.22651);
  mono_gc_wbarrier_set_field (copy, D.22650, D.22652);
  D.22653 = &copy->configuration_file;
  D.22654 = setup->configuration_file;
  D.22655 = mono_marshal_xdomain_copy_value (D.22654);
  mono_gc_wbarrier_set_field (copy, D.22653, D.22655);
  D.22656 = &copy->dynamic_base;
  D.22657 = setup->dynamic_base;
  D.22658 = mono_marshal_xdomain_copy_value (D.22657);
  mono_gc_wbarrier_set_field (copy, D.22656, D.22658);
  D.22659 = &copy->license_file;
  D.22660 = setup->license_file;
  D.22661 = mono_marshal_xdomain_copy_value (D.22660);
  mono_gc_wbarrier_set_field (copy, D.22659, D.22661);
  D.22662 = &copy->private_bin_path;
  D.22663 = setup->private_bin_path;
  D.22664 = mono_marshal_xdomain_copy_value (D.22663);
  mono_gc_wbarrier_set_field (copy, D.22662, D.22664);
  D.22665 = &copy->private_bin_path_probe;
  D.22666 = setup->private_bin_path_probe;
  D.22667 = mono_marshal_xdomain_copy_value (D.22666);
  mono_gc_wbarrier_set_field (copy, D.22665, D.22667);
  D.22668 = &copy->shadow_copy_directories;
  D.22669 = setup->shadow_copy_directories;
  D.22670 = mono_marshal_xdomain_copy_value (D.22669);
  mono_gc_wbarrier_set_field (copy, D.22668, D.22670);
  D.22671 = &copy->shadow_copy_files;
  D.22672 = setup->shadow_copy_files;
  D.22673 = mono_marshal_xdomain_copy_value (D.22672);
  mono_gc_wbarrier_set_field (copy, D.22671, D.22673);
  D.22674 = setup->publisher_policy;
  copy->publisher_policy = D.22674;
  D.22675 = setup->path_changed;
  copy->path_changed = D.22675;
  D.22676 = setup->loader_optimization;
  copy->loader_optimization = D.22676;
  D.22677 = setup->disallow_binding_redirects;
  copy->disallow_binding_redirects = D.22677;
  D.22678 = setup->disallow_code_downloads;
  copy->disallow_code_downloads = D.22678;
  D.22679 = &copy->domain_initializer_args;
  D.22680 = setup->domain_initializer_args;
  D.22681 = mono_marshal_xdomain_copy_value (D.22680);
  mono_gc_wbarrier_set_field (copy, D.22679, D.22681);
  D.22682 = setup->disallow_appbase_probe;
  copy->disallow_appbase_probe = D.22682;
  D.22683 = &copy->application_trust;
  D.22684 = setup->application_trust;
  D.22685 = mono_marshal_xdomain_copy_value (D.22684);
  mono_gc_wbarrier_set_field (copy, D.22683, D.22685);
  D.22686 = &copy->configuration_bytes;
  D.22687 = setup->configuration_bytes;
  D.22688 = mono_marshal_xdomain_copy_value (D.22687);
  mono_gc_wbarrier_set_field (copy, D.22686, D.22688);
  D.22689 = &copy->serialized_non_primitives;
  D.22690 = setup->serialized_non_primitives;
  D.22691 = mono_marshal_xdomain_copy_value (D.22690);
  mono_gc_wbarrier_set_field (copy, D.22689, D.22691);
  mono_domain_set_internal (caller_domain);
  D.22692 = copy;
  return D.22692;
}


get_shadow_assembly_location_base (struct MonoDomain * domain, struct MonoError * error)
{
  struct MonoString * D.22696;
  struct MonoString * D.22698;
  int D.22700;
  char * D.22703;
  unsigned int D.22704;
  unsigned int D.22705;
  sizetype i.16;
  char * D.22707;
  char D.22708;
  int D.22711;
  const gchar * D.22714;
  const gchar * D.22715;
  struct MonoAppDomainSetup * setup;
  char * cache_path;
  char * appname;
  char * userdir;
  char * location;

  mono_error_init (error);
  setup = domain->setup;
  D.22696 = setup->cache_path;
  if (D.22696 != 0B) goto <D.22697>; else goto <D.22694>;
  <D.22697>:
  D.22698 = setup->application_name;
  if (D.22698 != 0B) goto <D.22699>; else goto <D.22694>;
  <D.22699>:
  D.22696 = setup->cache_path;
  cache_path = mono_string_to_utf8_checked (D.22696, error);
  D.22700 = mono_error_ok (error);
  if (D.22700 == 0) goto <D.22701>; else goto <D.22702>;
  <D.22701>:
  D.22703 = 0B;
  return D.22703;
  <D.22702>:
  {
    gint i;

    D.22704 = strlen (cache_path);
    D.22705 = D.22704 + 4294967295;
    i = (gint) D.22705;
    goto <D.21901>;
    <D.21900>:
    i.16 = (sizetype) i;
    D.22707 = cache_path + i.16;
    D.22708 = *D.22707;
    if (D.22708 == 92) goto <D.22709>; else goto <D.22710>;
    <D.22709>:
    i.16 = (sizetype) i;
    D.22707 = cache_path + i.16;
    *D.22707 = 47;
    <D.22710>:
    i = i + -1;
    <D.21901>:
    if (i >= 0) goto <D.21900>; else goto <D.21902>;
    <D.21902>:
  }
  D.22698 = setup->application_name;
  appname = mono_string_to_utf8_checked (D.22698, error);
  D.22711 = mono_error_ok (error);
  if (D.22711 == 0) goto <D.22712>; else goto <D.22713>;
  <D.22712>:
  monoeg_g_free (cache_path);
  D.22703 = 0B;
  return D.22703;
  <D.22713>:
  location = monoeg_g_build_path ("/", cache_path, appname, "assembly", "shadow", 0B);
  monoeg_g_free (appname);
  monoeg_g_free (cache_path);
  goto <D.22695>;
  <D.22694>:
  D.22714 = monoeg_g_get_user_name ();
  userdir = monoeg_g_strdup_printf ("%s-mono-cachepath", D.22714);
  D.22715 = monoeg_g_get_tmp_dir ();
  location = monoeg_g_build_path ("/", D.22715, userdir, "assembly", "shadow", 0B);
  monoeg_g_free (userdir);
  <D.22695>:
  D.22703 = location;
  return D.22703;
}


mono_domain_has_type_resolve (struct MonoDomain * domain)
{
  struct MonoClassField * field.17;
  struct MonoClass * D.22720;
  struct MonoClassField * field.18;
  _Bool D.22722;
  long int D.22723;
  long int D.22724;
  struct MonoAppDomain * D.22727;
  mono_bool D.22730;
  struct MonoObject * o.19;
  _Bool D.22732;
  static struct MonoClassField * field = 0B;
  struct MonoObject * o;

  try
    {
      field.17 = field;
      if (field.17 == 0B) goto <D.22718>; else goto <D.22719>;
      <D.22718>:
      D.22720 = mono_defaults.appdomain_class;
      field.18 = mono_class_get_field_from_name (D.22720, "TypeResolve");
      field = field.18;
      field.17 = field;
      D.22722 = field.17 == 0B;
      D.22723 = (long int) D.22722;
      D.22724 = __builtin_expect (D.22723, 0);
      if (D.22724 != 0) goto <D.22725>; else goto <D.22726>;
      <D.22725>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 503, "field");
      <D.22726>:
      <D.22719>:
      D.22727 = domain->domain;
      if (D.22727 == 0B) goto <D.22728>; else goto <D.22729>;
      <D.22728>:
      D.22730 = 0;
      return D.22730;
      <D.22729>:
      D.22727 = domain->domain;
      field.17 = field;
      mono_field_get_value (D.22727, field.17, &o);
      o.19 = o;
      D.22732 = o.19 != 0B;
      D.22730 = (mono_bool) D.22732;
      return D.22730;
    }
  finally
    {
      o = {CLOBBER};
    }
}


mono_domain_try_type_resolve (struct MonoDomain * domain, char * name, struct MonoObject * tb)
{
  int iftmp.20;
  _Bool D.22740;
  _Bool D.22741;
  _Bool D.22742;
  _Bool D.22743;
  long int D.22744;
  long int D.22745;
  struct MonoMethod * method.21;
  struct MonoAppDomain * D.22751;
  struct MonoVTable * D.22752;
  _Bool D.22753;
  long int D.22754;
  long int D.22755;
  struct MonoMethod * method.22;
  struct MonoReflectionAssembly * D.22761;
  struct MonoDomain * D.22764;
  struct MonoString * D.22765;
  struct MonoClass * klass;
  void * params[1];
  static struct MonoMethod * method = 0B;

  try
    {
      if (domain == 0B) goto <D.22736>; else goto <D.22739>;
      <D.22739>:
      D.22740 = name == 0B;
      D.22741 = tb == 0B;
      D.22742 = D.22740 & D.22741;
      if (D.22742 != 0) goto <D.22736>; else goto <D.22737>;
      <D.22736>:
      iftmp.20 = 1;
      goto <D.22738>;
      <D.22737>:
      iftmp.20 = 0;
      <D.22738>:
      D.22743 = iftmp.20 != 0;
      D.22744 = (long int) D.22743;
      D.22745 = __builtin_expect (D.22744, 0);
      if (D.22745 != 0) goto <D.22746>; else goto <D.22747>;
      <D.22746>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 534, "domain != NULL && ((name != NULL) || (tb != NULL))");
      <D.22747>:
      method.21 = method;
      if (method.21 == 0B) goto <D.22749>; else goto <D.22750>;
      <D.22749>:
      D.22751 = domain->domain;
      D.22752 = D.22751->mbr.obj.vtable;
      klass = D.22752->klass;
      D.22753 = klass == 0B;
      D.22754 = (long int) D.22753;
      D.22755 = __builtin_expect (D.22754, 0);
      if (D.22755 != 0) goto <D.22756>; else goto <D.22757>;
      <D.22756>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 538, "klass");
      <D.22757>:
      method.22 = mono_class_get_method_from_name (klass, "DoTypeResolve", -1);
      method = method.22;
      method.21 = method;
      if (method.21 == 0B) goto <D.22759>; else goto <D.22760>;
      <D.22759>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoTypeResolve not found.\n");
      D.22761 = 0B;
      return D.22761;
      <D.22760>:
      <D.22750>:
      if (name != 0B) goto <D.22762>; else goto <D.22763>;
      <D.22762>:
      D.22764 = mono_domain_get ();
      D.22765 = mono_string_new (D.22764, name);
      params[0] = D.22765;
      goto <D.22766>;
      <D.22763>:
      params[0] = tb;
      <D.22766>:
      method.21 = method;
      D.22751 = domain->domain;
      D.22761 = mono_runtime_invoke (method.21, D.22751, &params, 0B);
      return D.22761;
    }
  finally
    {
      params = {CLOBBER};
    }
}


mono_domain_owns_vtable_slot (struct MonoDomain * domain, void * vtable_slot)
{
  union mono_mutex_t * D.22769;
  _Bool D.22772;
  long int D.22773;
  long int D.22774;
  struct MonoMemPool * D.22777;
  _Bool D.22780;
  long int D.22781;
  long int D.22782;
  mono_bool D.22785;
  gboolean res;

  {
    int ret;

    D.22769 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.22769);
    if (ret != 0) goto <D.22770>; else goto <D.22771>;
    <D.22770>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22771>:
    D.22772 = ret != 0;
    D.22773 = (long int) D.22772;
    D.22774 = __builtin_expect (D.22773, 0);
    if (D.22774 != 0) goto <D.22775>; else goto <D.22776>;
    <D.22775>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 564, "ret == 0");
    <D.22776>:
  }
  D.22777 = domain->mp;
  res = mono_mempool_contains_addr (D.22777, vtable_slot);
  {
    int ret;

    D.22769 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.22769);
    if (ret != 0) goto <D.22778>; else goto <D.22779>;
    <D.22778>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22779>:
    D.22780 = ret != 0;
    D.22781 = (long int) D.22780;
    D.22782 = __builtin_expect (D.22781, 0);
    if (D.22782 != 0) goto <D.22783>; else goto <D.22784>;
    <D.22783>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 566, "ret == 0");
    <D.22784>:
  }
  D.22785 = res;
  return D.22785;
}


mono_domain_set (struct MonoDomain * domain, gboolean force)
{
  unsigned int D.22789;
  mono_bool D.22792;

  if (force == 0) goto <D.22787>; else goto <D.22788>;
  <D.22787>:
  D.22789 = domain->state;
  if (D.22789 == 3) goto <D.22790>; else goto <D.22791>;
  <D.22790>:
  D.22792 = 0;
  return D.22792;
  <D.22791>:
  <D.22788>:
  mono_domain_set_internal (domain);
  D.22792 = 1;
  return D.22792;
}


ves_icall_System_AppDomain_GetData (struct MonoAppDomain * ad, struct MonoString * name)
{
  _Bool D.22794;
  long int D.22795;
  long int D.22796;
  _Bool D.22799;
  long int D.22800;
  long int D.22801;
  struct MonoException * D.22806;
  union mono_mutex_t * D.22807;
  _Bool D.22810;
  long int D.22811;
  long int D.22812;
  int D.21547;
  int iftmp.23;
  int D.21546;
  const char[8] * D.22818;
  unsigned char D.22819;
  int D.22820;
  unsigned char D.22821;
  int D.22822;
  _Bool D.22823;
  _Bool D.22824;
  _Bool D.22825;
  const unsigned char * D.22828;
  unsigned char D.22829;
  int D.22830;
  const unsigned char * D.22831;
  unsigned char D.22832;
  int D.22833;
  _Bool D.22834;
  _Bool D.22835;
  const unsigned char * D.22838;
  unsigned char D.22839;
  int D.22840;
  const unsigned char * D.22841;
  unsigned char D.22842;
  int D.22843;
  _Bool D.22844;
  _Bool D.22845;
  const unsigned char * D.22848;
  unsigned char D.22849;
  int D.22850;
  const unsigned char * D.22851;
  unsigned char D.22852;
  int D.22853;
  struct MonoAppDomainSetup * D.22857;
  int D.21556;
  int iftmp.24;
  int D.21555;
  const char[16] * D.22862;
  unsigned char D.22863;
  int D.22864;
  unsigned char D.22865;
  int D.22866;
  _Bool D.22867;
  _Bool D.22868;
  _Bool D.22869;
  const unsigned char * D.22872;
  unsigned char D.22873;
  int D.22874;
  const unsigned char * D.22875;
  unsigned char D.22876;
  int D.22877;
  _Bool D.22878;
  _Bool D.22879;
  const unsigned char * D.22882;
  unsigned char D.22883;
  int D.22884;
  const unsigned char * D.22885;
  unsigned char D.22886;
  int D.22887;
  _Bool D.22888;
  _Bool D.22889;
  const unsigned char * D.22892;
  unsigned char D.22893;
  int D.22894;
  const unsigned char * D.22895;
  unsigned char D.22896;
  int D.22897;
  int D.21565;
  int iftmp.25;
  int D.21564;
  const char[13] * D.22905;
  unsigned char D.22906;
  int D.22907;
  unsigned char D.22908;
  int D.22909;
  _Bool D.22910;
  _Bool D.22911;
  _Bool D.22912;
  const unsigned char * D.22915;
  unsigned char D.22916;
  int D.22917;
  const unsigned char * D.22918;
  unsigned char D.22919;
  int D.22920;
  _Bool D.22921;
  _Bool D.22922;
  const unsigned char * D.22925;
  unsigned char D.22926;
  int D.22927;
  const unsigned char * D.22928;
  unsigned char D.22929;
  int D.22930;
  _Bool D.22931;
  _Bool D.22932;
  const unsigned char * D.22935;
  unsigned char D.22936;
  int D.22937;
  const unsigned char * D.22938;
  unsigned char D.22939;
  int D.22940;
  int D.21574;
  int iftmp.26;
  int D.21573;
  const char[9] * D.22948;
  unsigned char D.22949;
  int D.22950;
  unsigned char D.22951;
  int D.22952;
  _Bool D.22953;
  _Bool D.22954;
  _Bool D.22955;
  const unsigned char * D.22958;
  unsigned char D.22959;
  int D.22960;
  const unsigned char * D.22961;
  unsigned char D.22962;
  int D.22963;
  _Bool D.22964;
  _Bool D.22965;
  const unsigned char * D.22968;
  unsigned char D.22969;
  int D.22970;
  const unsigned char * D.22971;
  unsigned char D.22972;
  int D.22973;
  _Bool D.22974;
  _Bool D.22975;
  const unsigned char * D.22978;
  unsigned char D.22979;
  int D.22980;
  const unsigned char * D.22981;
  unsigned char D.22982;
  int D.22983;
  int D.21583;
  int iftmp.27;
  int D.21582;
  const char[11] * D.22991;
  unsigned char D.22992;
  int D.22993;
  unsigned char D.22994;
  int D.22995;
  _Bool D.22996;
  _Bool D.22997;
  _Bool D.22998;
  const unsigned char * D.23001;
  unsigned char D.23002;
  int D.23003;
  const unsigned char * D.23004;
  unsigned char D.23005;
  int D.23006;
  _Bool D.23007;
  _Bool D.23008;
  const unsigned char * D.23011;
  unsigned char D.23012;
  int D.23013;
  const unsigned char * D.23014;
  unsigned char D.23015;
  int D.23016;
  _Bool D.23017;
  _Bool D.23018;
  const unsigned char * D.23021;
  unsigned char D.23022;
  int D.23023;
  const unsigned char * D.23024;
  unsigned char D.23025;
  int D.23026;
  int D.21592;
  int iftmp.28;
  int D.21591;
  const char[16] * D.23034;
  unsigned char D.23035;
  int D.23036;
  unsigned char D.23037;
  int D.23038;
  _Bool D.23039;
  _Bool D.23040;
  _Bool D.23041;
  const unsigned char * D.23044;
  unsigned char D.23045;
  int D.23046;
  const unsigned char * D.23047;
  unsigned char D.23048;
  int D.23049;
  _Bool D.23050;
  _Bool D.23051;
  const unsigned char * D.23054;
  unsigned char D.23055;
  int D.23056;
  const unsigned char * D.23057;
  unsigned char D.23058;
  int D.23059;
  _Bool D.23060;
  _Bool D.23061;
  const unsigned char * D.23064;
  unsigned char D.23065;
  int D.23066;
  const unsigned char * D.23067;
  unsigned char D.23068;
  int D.23069;
  int D.21601;
  int iftmp.29;
  int D.21600;
  const char[19] * D.23077;
  unsigned char D.23078;
  int D.23079;
  unsigned char D.23080;
  int D.23081;
  _Bool D.23082;
  _Bool D.23083;
  _Bool D.23084;
  const unsigned char * D.23087;
  unsigned char D.23088;
  int D.23089;
  const unsigned char * D.23090;
  unsigned char D.23091;
  int D.23092;
  _Bool D.23093;
  _Bool D.23094;
  const unsigned char * D.23097;
  unsigned char D.23098;
  int D.23099;
  const unsigned char * D.23100;
  unsigned char D.23101;
  int D.23102;
  _Bool D.23103;
  _Bool D.23104;
  const unsigned char * D.23107;
  unsigned char D.23108;
  int D.23109;
  const unsigned char * D.23110;
  unsigned char D.23111;
  int D.23112;
  int D.21610;
  int iftmp.30;
  int D.21609;
  const char[17] * D.23120;
  unsigned char D.23121;
  int D.23122;
  unsigned char D.23123;
  int D.23124;
  _Bool D.23125;
  _Bool D.23126;
  _Bool D.23127;
  const unsigned char * D.23130;
  unsigned char D.23131;
  int D.23132;
  const unsigned char * D.23133;
  unsigned char D.23134;
  int D.23135;
  _Bool D.23136;
  _Bool D.23137;
  const unsigned char * D.23140;
  unsigned char D.23141;
  int D.23142;
  const unsigned char * D.23143;
  unsigned char D.23144;
  int D.23145;
  _Bool D.23146;
  _Bool D.23147;
  const unsigned char * D.23150;
  unsigned char D.23151;
  int D.23152;
  const unsigned char * D.23153;
  unsigned char D.23154;
  int D.23155;
  int D.21619;
  int iftmp.31;
  int D.21618;
  const char[20] * D.23163;
  unsigned char D.23164;
  int D.23165;
  unsigned char D.23166;
  int D.23167;
  _Bool D.23168;
  _Bool D.23169;
  _Bool D.23170;
  const unsigned char * D.23173;
  unsigned char D.23174;
  int D.23175;
  const unsigned char * D.23176;
  unsigned char D.23177;
  int D.23178;
  _Bool D.23179;
  _Bool D.23180;
  const unsigned char * D.23183;
  unsigned char D.23184;
  int D.23185;
  const unsigned char * D.23186;
  unsigned char D.23187;
  int D.23188;
  _Bool D.23189;
  _Bool D.23190;
  const unsigned char * D.23193;
  unsigned char D.23194;
  int D.23195;
  const unsigned char * D.23196;
  unsigned char D.23197;
  int D.23198;
  struct MonoGHashTable * D.23203;
  _Bool D.23206;
  long int D.23207;
  long int D.23208;
  struct MonoObject * D.23213;
  struct MonoDomain * add;
  struct MonoObject * o;
  char * str;

  D.22794 = ad == 0B;
  D.22795 = (long int) D.22794;
  D.22796 = __builtin_expect (D.22795, 0);
  if (D.22796 != 0) goto <D.22797>; else goto <D.22798>;
  <D.22797>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 602, "ad != NULL");
  <D.22798>:
  add = ad->data;
  D.22799 = add == 0B;
  D.22800 = (long int) D.22799;
  D.22801 = __builtin_expect (D.22800, 0);
  if (D.22801 != 0) goto <D.22802>; else goto <D.22803>;
  <D.22802>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 604, "add != NULL");
  <D.22803>:
  if (name == 0B) goto <D.22804>; else goto <D.22805>;
  <D.22804>:
  D.22806 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.22806);
  <D.22805>:
  str = mono_string_to_utf8 (name);
  {
    int ret;

    D.22807 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.22807);
    if (ret != 0) goto <D.22808>; else goto <D.22809>;
    <D.22808>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22809>:
    D.22810 = ret != 0;
    D.22811 = (long int) D.22810;
    D.22812 = __builtin_expect (D.22811, 0);
    if (D.22812 != 0) goto <D.22813>; else goto <D.22814>;
    <D.22813>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 611, "ret == 0");
    <D.22814>:
  }
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.22818 = "APPBASE";
      D.22819 = MEM[(const unsigned char *)D.22818];
      D.22820 = (int) D.22819;
      D.22821 = *__s2;
      D.22822 = (int) D.22821;
      __result = D.22820 - D.22822;
      {
        D.22823 = __s2_len != 0;
        D.22824 = __result == 0;
        D.22825 = D.22823 & D.22824;
        if (D.22825 != 0) goto <D.22826>; else goto <D.22827>;
        <D.22826>:
        D.22828 = &MEM[(void *)"APPBASE" + 1B];
        D.22829 = *D.22828;
        D.22830 = (int) D.22829;
        D.22831 = __s2 + 1;
        D.22832 = *D.22831;
        D.22833 = (int) D.22832;
        __result = D.22830 - D.22833;
        D.22834 = __s2_len > 1;
        D.22824 = __result == 0;
        D.22835 = D.22834 & D.22824;
        if (D.22835 != 0) goto <D.22836>; else goto <D.22837>;
        <D.22836>:
        D.22838 = &MEM[(void *)"APPBASE" + 2B];
        D.22839 = *D.22838;
        D.22840 = (int) D.22839;
        D.22841 = __s2 + 2;
        D.22842 = *D.22841;
        D.22843 = (int) D.22842;
        __result = D.22840 - D.22843;
        D.22844 = __s2_len > 2;
        D.22824 = __result == 0;
        D.22845 = D.22844 & D.22824;
        if (D.22845 != 0) goto <D.22846>; else goto <D.22847>;
        <D.22846>:
        D.22848 = &MEM[(void *)"APPBASE" + 3B];
        D.22849 = *D.22848;
        D.22850 = (int) D.22849;
        D.22851 = __s2 + 3;
        D.22852 = *D.22851;
        D.22853 = (int) D.22852;
        __result = D.22850 - D.22853;
        <D.22847>:
        <D.22837>:
        <D.22827>:
      }
      D.21546 = __result;
    }
    iftmp.23 = -D.21546;
    goto <D.22854>;
    <D.22817>:
    iftmp.23 = __builtin_strcmp (str, "APPBASE");
    <D.22854>:
    D.21547 = iftmp.23;
  }
  if (D.21547 == 0) goto <D.22855>; else goto <D.22856>;
  <D.22855>:
  D.22857 = add->setup;
  o = D.22857->application_base;
  goto <D.22858>;
  <D.22856>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.22862 = "APP_CONFIG_FILE";
      D.22863 = MEM[(const unsigned char *)D.22862];
      D.22864 = (int) D.22863;
      D.22865 = *__s2;
      D.22866 = (int) D.22865;
      __result = D.22864 - D.22866;
      {
        D.22867 = __s2_len != 0;
        D.22868 = __result == 0;
        D.22869 = D.22867 & D.22868;
        if (D.22869 != 0) goto <D.22870>; else goto <D.22871>;
        <D.22870>:
        D.22872 = &MEM[(void *)"APP_CONFIG_FILE" + 1B];
        D.22873 = *D.22872;
        D.22874 = (int) D.22873;
        D.22875 = __s2 + 1;
        D.22876 = *D.22875;
        D.22877 = (int) D.22876;
        __result = D.22874 - D.22877;
        D.22878 = __s2_len > 1;
        D.22868 = __result == 0;
        D.22879 = D.22878 & D.22868;
        if (D.22879 != 0) goto <D.22880>; else goto <D.22881>;
        <D.22880>:
        D.22882 = &MEM[(void *)"APP_CONFIG_FILE" + 2B];
        D.22883 = *D.22882;
        D.22884 = (int) D.22883;
        D.22885 = __s2 + 2;
        D.22886 = *D.22885;
        D.22887 = (int) D.22886;
        __result = D.22884 - D.22887;
        D.22888 = __s2_len > 2;
        D.22868 = __result == 0;
        D.22889 = D.22888 & D.22868;
        if (D.22889 != 0) goto <D.22890>; else goto <D.22891>;
        <D.22890>:
        D.22892 = &MEM[(void *)"APP_CONFIG_FILE" + 3B];
        D.22893 = *D.22892;
        D.22894 = (int) D.22893;
        D.22895 = __s2 + 3;
        D.22896 = *D.22895;
        D.22897 = (int) D.22896;
        __result = D.22894 - D.22897;
        <D.22891>:
        <D.22881>:
        <D.22871>:
      }
      D.21555 = __result;
    }
    iftmp.24 = -D.21555;
    goto <D.22898>;
    <D.22861>:
    iftmp.24 = __builtin_strcmp (str, "APP_CONFIG_FILE");
    <D.22898>:
    D.21556 = iftmp.24;
  }
  if (D.21556 == 0) goto <D.22899>; else goto <D.22900>;
  <D.22899>:
  D.22857 = add->setup;
  o = D.22857->configuration_file;
  goto <D.22901>;
  <D.22900>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.22905 = "DYNAMIC_BASE";
      D.22906 = MEM[(const unsigned char *)D.22905];
      D.22907 = (int) D.22906;
      D.22908 = *__s2;
      D.22909 = (int) D.22908;
      __result = D.22907 - D.22909;
      {
        D.22910 = __s2_len != 0;
        D.22911 = __result == 0;
        D.22912 = D.22910 & D.22911;
        if (D.22912 != 0) goto <D.22913>; else goto <D.22914>;
        <D.22913>:
        D.22915 = &MEM[(void *)"DYNAMIC_BASE" + 1B];
        D.22916 = *D.22915;
        D.22917 = (int) D.22916;
        D.22918 = __s2 + 1;
        D.22919 = *D.22918;
        D.22920 = (int) D.22919;
        __result = D.22917 - D.22920;
        D.22921 = __s2_len > 1;
        D.22911 = __result == 0;
        D.22922 = D.22921 & D.22911;
        if (D.22922 != 0) goto <D.22923>; else goto <D.22924>;
        <D.22923>:
        D.22925 = &MEM[(void *)"DYNAMIC_BASE" + 2B];
        D.22926 = *D.22925;
        D.22927 = (int) D.22926;
        D.22928 = __s2 + 2;
        D.22929 = *D.22928;
        D.22930 = (int) D.22929;
        __result = D.22927 - D.22930;
        D.22931 = __s2_len > 2;
        D.22911 = __result == 0;
        D.22932 = D.22931 & D.22911;
        if (D.22932 != 0) goto <D.22933>; else goto <D.22934>;
        <D.22933>:
        D.22935 = &MEM[(void *)"DYNAMIC_BASE" + 3B];
        D.22936 = *D.22935;
        D.22937 = (int) D.22936;
        D.22938 = __s2 + 3;
        D.22939 = *D.22938;
        D.22940 = (int) D.22939;
        __result = D.22937 - D.22940;
        <D.22934>:
        <D.22924>:
        <D.22914>:
      }
      D.21564 = __result;
    }
    iftmp.25 = -D.21564;
    goto <D.22941>;
    <D.22904>:
    iftmp.25 = __builtin_strcmp (str, "DYNAMIC_BASE");
    <D.22941>:
    D.21565 = iftmp.25;
  }
  if (D.21565 == 0) goto <D.22942>; else goto <D.22943>;
  <D.22942>:
  D.22857 = add->setup;
  o = D.22857->dynamic_base;
  goto <D.22944>;
  <D.22943>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.22948 = "APP_NAME";
      D.22949 = MEM[(const unsigned char *)D.22948];
      D.22950 = (int) D.22949;
      D.22951 = *__s2;
      D.22952 = (int) D.22951;
      __result = D.22950 - D.22952;
      {
        D.22953 = __s2_len != 0;
        D.22954 = __result == 0;
        D.22955 = D.22953 & D.22954;
        if (D.22955 != 0) goto <D.22956>; else goto <D.22957>;
        <D.22956>:
        D.22958 = &MEM[(void *)"APP_NAME" + 1B];
        D.22959 = *D.22958;
        D.22960 = (int) D.22959;
        D.22961 = __s2 + 1;
        D.22962 = *D.22961;
        D.22963 = (int) D.22962;
        __result = D.22960 - D.22963;
        D.22964 = __s2_len > 1;
        D.22954 = __result == 0;
        D.22965 = D.22964 & D.22954;
        if (D.22965 != 0) goto <D.22966>; else goto <D.22967>;
        <D.22966>:
        D.22968 = &MEM[(void *)"APP_NAME" + 2B];
        D.22969 = *D.22968;
        D.22970 = (int) D.22969;
        D.22971 = __s2 + 2;
        D.22972 = *D.22971;
        D.22973 = (int) D.22972;
        __result = D.22970 - D.22973;
        D.22974 = __s2_len > 2;
        D.22954 = __result == 0;
        D.22975 = D.22974 & D.22954;
        if (D.22975 != 0) goto <D.22976>; else goto <D.22977>;
        <D.22976>:
        D.22978 = &MEM[(void *)"APP_NAME" + 3B];
        D.22979 = *D.22978;
        D.22980 = (int) D.22979;
        D.22981 = __s2 + 3;
        D.22982 = *D.22981;
        D.22983 = (int) D.22982;
        __result = D.22980 - D.22983;
        <D.22977>:
        <D.22967>:
        <D.22957>:
      }
      D.21573 = __result;
    }
    iftmp.26 = -D.21573;
    goto <D.22984>;
    <D.22947>:
    iftmp.26 = __builtin_strcmp (str, "APP_NAME");
    <D.22984>:
    D.21574 = iftmp.26;
  }
  if (D.21574 == 0) goto <D.22985>; else goto <D.22986>;
  <D.22985>:
  D.22857 = add->setup;
  o = D.22857->application_name;
  goto <D.22987>;
  <D.22986>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.22991 = "CACHE_BASE";
      D.22992 = MEM[(const unsigned char *)D.22991];
      D.22993 = (int) D.22992;
      D.22994 = *__s2;
      D.22995 = (int) D.22994;
      __result = D.22993 - D.22995;
      {
        D.22996 = __s2_len != 0;
        D.22997 = __result == 0;
        D.22998 = D.22996 & D.22997;
        if (D.22998 != 0) goto <D.22999>; else goto <D.23000>;
        <D.22999>:
        D.23001 = &MEM[(void *)"CACHE_BASE" + 1B];
        D.23002 = *D.23001;
        D.23003 = (int) D.23002;
        D.23004 = __s2 + 1;
        D.23005 = *D.23004;
        D.23006 = (int) D.23005;
        __result = D.23003 - D.23006;
        D.23007 = __s2_len > 1;
        D.22997 = __result == 0;
        D.23008 = D.23007 & D.22997;
        if (D.23008 != 0) goto <D.23009>; else goto <D.23010>;
        <D.23009>:
        D.23011 = &MEM[(void *)"CACHE_BASE" + 2B];
        D.23012 = *D.23011;
        D.23013 = (int) D.23012;
        D.23014 = __s2 + 2;
        D.23015 = *D.23014;
        D.23016 = (int) D.23015;
        __result = D.23013 - D.23016;
        D.23017 = __s2_len > 2;
        D.22997 = __result == 0;
        D.23018 = D.23017 & D.22997;
        if (D.23018 != 0) goto <D.23019>; else goto <D.23020>;
        <D.23019>:
        D.23021 = &MEM[(void *)"CACHE_BASE" + 3B];
        D.23022 = *D.23021;
        D.23023 = (int) D.23022;
        D.23024 = __s2 + 3;
        D.23025 = *D.23024;
        D.23026 = (int) D.23025;
        __result = D.23023 - D.23026;
        <D.23020>:
        <D.23010>:
        <D.23000>:
      }
      D.21582 = __result;
    }
    iftmp.27 = -D.21582;
    goto <D.23027>;
    <D.22990>:
    iftmp.27 = __builtin_strcmp (str, "CACHE_BASE");
    <D.23027>:
    D.21583 = iftmp.27;
  }
  if (D.21583 == 0) goto <D.23028>; else goto <D.23029>;
  <D.23028>:
  D.22857 = add->setup;
  o = D.22857->cache_path;
  goto <D.23030>;
  <D.23029>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.23034 = "PRIVATE_BINPATH";
      D.23035 = MEM[(const unsigned char *)D.23034];
      D.23036 = (int) D.23035;
      D.23037 = *__s2;
      D.23038 = (int) D.23037;
      __result = D.23036 - D.23038;
      {
        D.23039 = __s2_len != 0;
        D.23040 = __result == 0;
        D.23041 = D.23039 & D.23040;
        if (D.23041 != 0) goto <D.23042>; else goto <D.23043>;
        <D.23042>:
        D.23044 = &MEM[(void *)"PRIVATE_BINPATH" + 1B];
        D.23045 = *D.23044;
        D.23046 = (int) D.23045;
        D.23047 = __s2 + 1;
        D.23048 = *D.23047;
        D.23049 = (int) D.23048;
        __result = D.23046 - D.23049;
        D.23050 = __s2_len > 1;
        D.23040 = __result == 0;
        D.23051 = D.23050 & D.23040;
        if (D.23051 != 0) goto <D.23052>; else goto <D.23053>;
        <D.23052>:
        D.23054 = &MEM[(void *)"PRIVATE_BINPATH" + 2B];
        D.23055 = *D.23054;
        D.23056 = (int) D.23055;
        D.23057 = __s2 + 2;
        D.23058 = *D.23057;
        D.23059 = (int) D.23058;
        __result = D.23056 - D.23059;
        D.23060 = __s2_len > 2;
        D.23040 = __result == 0;
        D.23061 = D.23060 & D.23040;
        if (D.23061 != 0) goto <D.23062>; else goto <D.23063>;
        <D.23062>:
        D.23064 = &MEM[(void *)"PRIVATE_BINPATH" + 3B];
        D.23065 = *D.23064;
        D.23066 = (int) D.23065;
        D.23067 = __s2 + 3;
        D.23068 = *D.23067;
        D.23069 = (int) D.23068;
        __result = D.23066 - D.23069;
        <D.23063>:
        <D.23053>:
        <D.23043>:
      }
      D.21591 = __result;
    }
    iftmp.28 = -D.21591;
    goto <D.23070>;
    <D.23033>:
    iftmp.28 = __builtin_strcmp (str, "PRIVATE_BINPATH");
    <D.23070>:
    D.21592 = iftmp.28;
  }
  if (D.21592 == 0) goto <D.23071>; else goto <D.23072>;
  <D.23071>:
  D.22857 = add->setup;
  o = D.22857->private_bin_path;
  goto <D.23073>;
  <D.23072>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.23077 = "BINPATH_PROBE_ONLY";
      D.23078 = MEM[(const unsigned char *)D.23077];
      D.23079 = (int) D.23078;
      D.23080 = *__s2;
      D.23081 = (int) D.23080;
      __result = D.23079 - D.23081;
      {
        D.23082 = __s2_len != 0;
        D.23083 = __result == 0;
        D.23084 = D.23082 & D.23083;
        if (D.23084 != 0) goto <D.23085>; else goto <D.23086>;
        <D.23085>:
        D.23087 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 1B];
        D.23088 = *D.23087;
        D.23089 = (int) D.23088;
        D.23090 = __s2 + 1;
        D.23091 = *D.23090;
        D.23092 = (int) D.23091;
        __result = D.23089 - D.23092;
        D.23093 = __s2_len > 1;
        D.23083 = __result == 0;
        D.23094 = D.23093 & D.23083;
        if (D.23094 != 0) goto <D.23095>; else goto <D.23096>;
        <D.23095>:
        D.23097 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 2B];
        D.23098 = *D.23097;
        D.23099 = (int) D.23098;
        D.23100 = __s2 + 2;
        D.23101 = *D.23100;
        D.23102 = (int) D.23101;
        __result = D.23099 - D.23102;
        D.23103 = __s2_len > 2;
        D.23083 = __result == 0;
        D.23104 = D.23103 & D.23083;
        if (D.23104 != 0) goto <D.23105>; else goto <D.23106>;
        <D.23105>:
        D.23107 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 3B];
        D.23108 = *D.23107;
        D.23109 = (int) D.23108;
        D.23110 = __s2 + 3;
        D.23111 = *D.23110;
        D.23112 = (int) D.23111;
        __result = D.23109 - D.23112;
        <D.23106>:
        <D.23096>:
        <D.23086>:
      }
      D.21600 = __result;
    }
    iftmp.29 = -D.21600;
    goto <D.23113>;
    <D.23076>:
    iftmp.29 = __builtin_strcmp (str, "BINPATH_PROBE_ONLY");
    <D.23113>:
    D.21601 = iftmp.29;
  }
  if (D.21601 == 0) goto <D.23114>; else goto <D.23115>;
  <D.23114>:
  D.22857 = add->setup;
  o = D.22857->private_bin_path_probe;
  goto <D.23116>;
  <D.23115>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.23120 = "SHADOW_COPY_DIRS";
      D.23121 = MEM[(const unsigned char *)D.23120];
      D.23122 = (int) D.23121;
      D.23123 = *__s2;
      D.23124 = (int) D.23123;
      __result = D.23122 - D.23124;
      {
        D.23125 = __s2_len != 0;
        D.23126 = __result == 0;
        D.23127 = D.23125 & D.23126;
        if (D.23127 != 0) goto <D.23128>; else goto <D.23129>;
        <D.23128>:
        D.23130 = &MEM[(void *)"SHADOW_COPY_DIRS" + 1B];
        D.23131 = *D.23130;
        D.23132 = (int) D.23131;
        D.23133 = __s2 + 1;
        D.23134 = *D.23133;
        D.23135 = (int) D.23134;
        __result = D.23132 - D.23135;
        D.23136 = __s2_len > 1;
        D.23126 = __result == 0;
        D.23137 = D.23136 & D.23126;
        if (D.23137 != 0) goto <D.23138>; else goto <D.23139>;
        <D.23138>:
        D.23140 = &MEM[(void *)"SHADOW_COPY_DIRS" + 2B];
        D.23141 = *D.23140;
        D.23142 = (int) D.23141;
        D.23143 = __s2 + 2;
        D.23144 = *D.23143;
        D.23145 = (int) D.23144;
        __result = D.23142 - D.23145;
        D.23146 = __s2_len > 2;
        D.23126 = __result == 0;
        D.23147 = D.23146 & D.23126;
        if (D.23147 != 0) goto <D.23148>; else goto <D.23149>;
        <D.23148>:
        D.23150 = &MEM[(void *)"SHADOW_COPY_DIRS" + 3B];
        D.23151 = *D.23150;
        D.23152 = (int) D.23151;
        D.23153 = __s2 + 3;
        D.23154 = *D.23153;
        D.23155 = (int) D.23154;
        __result = D.23152 - D.23155;
        <D.23149>:
        <D.23139>:
        <D.23129>:
      }
      D.21609 = __result;
    }
    iftmp.30 = -D.21609;
    goto <D.23156>;
    <D.23119>:
    iftmp.30 = __builtin_strcmp (str, "SHADOW_COPY_DIRS");
    <D.23156>:
    D.21610 = iftmp.30;
  }
  if (D.21610 == 0) goto <D.23157>; else goto <D.23158>;
  <D.23157>:
  D.22857 = add->setup;
  o = D.22857->shadow_copy_directories;
  goto <D.23159>;
  <D.23158>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.23163 = "FORCE_CACHE_INSTALL";
      D.23164 = MEM[(const unsigned char *)D.23163];
      D.23165 = (int) D.23164;
      D.23166 = *__s2;
      D.23167 = (int) D.23166;
      __result = D.23165 - D.23167;
      {
        D.23168 = __s2_len != 0;
        D.23169 = __result == 0;
        D.23170 = D.23168 & D.23169;
        if (D.23170 != 0) goto <D.23171>; else goto <D.23172>;
        <D.23171>:
        D.23173 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 1B];
        D.23174 = *D.23173;
        D.23175 = (int) D.23174;
        D.23176 = __s2 + 1;
        D.23177 = *D.23176;
        D.23178 = (int) D.23177;
        __result = D.23175 - D.23178;
        D.23179 = __s2_len > 1;
        D.23169 = __result == 0;
        D.23180 = D.23179 & D.23169;
        if (D.23180 != 0) goto <D.23181>; else goto <D.23182>;
        <D.23181>:
        D.23183 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 2B];
        D.23184 = *D.23183;
        D.23185 = (int) D.23184;
        D.23186 = __s2 + 2;
        D.23187 = *D.23186;
        D.23188 = (int) D.23187;
        __result = D.23185 - D.23188;
        D.23189 = __s2_len > 2;
        D.23169 = __result == 0;
        D.23190 = D.23189 & D.23169;
        if (D.23190 != 0) goto <D.23191>; else goto <D.23192>;
        <D.23191>:
        D.23193 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 3B];
        D.23194 = *D.23193;
        D.23195 = (int) D.23194;
        D.23196 = __s2 + 3;
        D.23197 = *D.23196;
        D.23198 = (int) D.23197;
        __result = D.23195 - D.23198;
        <D.23192>:
        <D.23182>:
        <D.23172>:
      }
      D.21618 = __result;
    }
    iftmp.31 = -D.21618;
    goto <D.23199>;
    <D.23162>:
    iftmp.31 = __builtin_strcmp (str, "FORCE_CACHE_INSTALL");
    <D.23199>:
    D.21619 = iftmp.31;
  }
  if (D.21619 == 0) goto <D.23200>; else goto <D.23201>;
  <D.23200>:
  D.22857 = add->setup;
  o = D.22857->shadow_copy_files;
  goto <D.23202>;
  <D.23201>:
  D.23203 = add->env;
  o = mono_g_hash_table_lookup (D.23203, name);
  <D.23202>:
  <D.23159>:
  <D.23116>:
  <D.23073>:
  <D.23030>:
  <D.22987>:
  <D.22944>:
  <D.22901>:
  <D.22858>:
  {
    int ret;

    D.22807 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.22807);
    if (ret != 0) goto <D.23204>; else goto <D.23205>;
    <D.23204>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23205>:
    D.23206 = ret != 0;
    D.23207 = (long int) D.23206;
    D.23208 = __builtin_expect (D.23207, 0);
    if (D.23208 != 0) goto <D.23209>; else goto <D.23210>;
    <D.23209>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 634, "ret == 0");
    <D.23210>:
  }
  monoeg_g_free (str);
  if (o == 0B) goto <D.23211>; else goto <D.23212>;
  <D.23211>:
  D.23213 = 0B;
  return D.23213;
  <D.23212>:
  D.23213 = o;
  return D.23213;
}


ves_icall_System_AppDomain_SetData (struct MonoAppDomain * ad, struct MonoString * name, struct MonoObject * data)
{
  _Bool D.23215;
  long int D.23216;
  long int D.23217;
  _Bool D.23220;
  long int D.23221;
  long int D.23222;
  struct MonoException * D.23227;
  union mono_mutex_t * D.23228;
  _Bool D.23231;
  long int D.23232;
  long int D.23233;
  struct MonoGHashTable * D.23236;
  _Bool D.23239;
  long int D.23240;
  long int D.23241;
  struct MonoDomain * add;

  D.23215 = ad == 0B;
  D.23216 = (long int) D.23215;
  D.23217 = __builtin_expect (D.23216, 0);
  if (D.23217 != 0) goto <D.23218>; else goto <D.23219>;
  <D.23218>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 650, "ad != NULL");
  <D.23219>:
  add = ad->data;
  D.23220 = add == 0B;
  D.23221 = (long int) D.23220;
  D.23222 = __builtin_expect (D.23221, 0);
  if (D.23222 != 0) goto <D.23223>; else goto <D.23224>;
  <D.23223>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 652, "add != NULL");
  <D.23224>:
  if (name == 0B) goto <D.23225>; else goto <D.23226>;
  <D.23225>:
  D.23227 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.23227);
  <D.23226>:
  {
    int ret;

    D.23228 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.23228);
    if (ret != 0) goto <D.23229>; else goto <D.23230>;
    <D.23229>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23230>:
    D.23231 = ret != 0;
    D.23232 = (long int) D.23231;
    D.23233 = __builtin_expect (D.23232, 0);
    if (D.23233 != 0) goto <D.23234>; else goto <D.23235>;
    <D.23234>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 657, "ret == 0");
    <D.23235>:
  }
  D.23236 = add->env;
  mono_g_hash_table_insert (D.23236, name, data);
  {
    int ret;

    D.23228 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.23228);
    if (ret != 0) goto <D.23237>; else goto <D.23238>;
    <D.23237>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23238>:
    D.23239 = ret != 0;
    D.23240 = (long int) D.23239;
    D.23241 = __builtin_expect (D.23240, 0);
    if (D.23241 != 0) goto <D.23242>; else goto <D.23243>;
    <D.23242>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 661, "ret == 0");
    <D.23243>:
  }
}


ves_icall_System_AppDomain_getSetup (struct MonoAppDomain * ad)
{
  _Bool D.23244;
  long int D.23245;
  long int D.23246;
  struct MonoDomain * D.23249;
  _Bool D.23250;
  long int D.23251;
  long int D.23252;
  struct MonoAppDomainSetup * D.23255;

  D.23244 = ad == 0B;
  D.23245 = (long int) D.23244;
  D.23246 = __builtin_expect (D.23245, 0);
  if (D.23246 != 0) goto <D.23247>; else goto <D.23248>;
  <D.23247>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 669, "ad != NULL");
  <D.23248>:
  D.23249 = ad->data;
  D.23250 = D.23249 == 0B;
  D.23251 = (long int) D.23250;
  D.23252 = __builtin_expect (D.23251, 0);
  if (D.23252 != 0) goto <D.23253>; else goto <D.23254>;
  <D.23253>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 670, "ad->data != NULL");
  <D.23254>:
  D.23249 = ad->data;
  D.23255 = D.23249->setup;
  return D.23255;
}


ves_icall_System_AppDomain_getFriendlyName (struct MonoAppDomain * ad)
{
  _Bool D.23257;
  long int D.23258;
  long int D.23259;
  struct MonoDomain * D.23262;
  _Bool D.23263;
  long int D.23264;
  long int D.23265;
  struct MonoString * D.23268;
  char * D.23269;

  D.23257 = ad == 0B;
  D.23258 = (long int) D.23257;
  D.23259 = __builtin_expect (D.23258, 0);
  if (D.23259 != 0) goto <D.23260>; else goto <D.23261>;
  <D.23260>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 680, "ad != NULL");
  <D.23261>:
  D.23262 = ad->data;
  D.23263 = D.23262 == 0B;
  D.23264 = (long int) D.23263;
  D.23265 = __builtin_expect (D.23264, 0);
  if (D.23265 != 0) goto <D.23266>; else goto <D.23267>;
  <D.23266>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 681, "ad->data != NULL");
  <D.23267>:
  D.23262 = ad->data;
  D.23262 = ad->data;
  D.23269 = D.23262->friendly_name;
  D.23268 = mono_string_new (D.23262, D.23269);
  return D.23268;
}


ves_icall_System_AppDomain_getCurDomain ()
{
  struct MonoAppDomain * D.23271;
  struct MonoDomain * add;

  add = mono_domain_get ();
  D.23271 = add->domain;
  return D.23271;
}


ves_icall_System_AppDomain_getRootDomain ()
{
  struct MonoAppDomain * D.23273;
  struct MonoDomain * root;

  root = mono_get_root_domain ();
  D.23273 = root->domain;
  return D.23273;
}


mono_set_private_bin_path_from_config (struct MonoDomain * domain)
{
  struct MonoAppDomainSetup * D.23278;
  struct MonoString * D.23280;
  int D.23281;
  int D.23286;
  unsigned int len.32;
  gchar * text.33;
  char D.23292;
  gchar * D.23295;
  char D.23296;
  gchar * D.23299;
  char D.23300;
  sizetype offset.34;
  const gchar * D.23304;
  unsigned int offset.35;
  unsigned int D.23306;
  int D.23307;
  int D.23308;
  struct MonoError error;
  gchar * config_file_name;
  gchar * text;
  gchar * config_file_path;
  gsize len;
  struct GMarkupParseContext * context;
  struct RuntimeConfig runtime_config;
  gint offset;
  void free_and_out = <<< error >>>;

  try
    {
      config_file_name = 0B;
      text = 0B;
      config_file_path = 0B;
      if (domain == 0B) goto <D.23275>; else goto <D.23277>;
      <D.23277>:
      D.23278 = domain->setup;
      if (D.23278 == 0B) goto <D.23275>; else goto <D.23279>;
      <D.23279>:
      D.23278 = domain->setup;
      D.23280 = D.23278->configuration_file;
      if (D.23280 == 0B) goto <D.23275>; else goto <D.23276>;
      <D.23275>:
      return;
      <D.23276>:
      D.23278 = domain->setup;
      D.23280 = D.23278->configuration_file;
      config_file_name = mono_string_to_utf8_checked (D.23280, &error);
      D.23281 = mono_error_ok (&error);
      if (D.23281 == 0) goto <D.23282>; else goto <D.23283>;
      <D.23282>:
      mono_error_cleanup (&error);
      goto free_and_out;
      <D.23283>:
      config_file_path = mono_portability_find_file (config_file_name, 1);
      if (config_file_path == 0B) goto <D.23284>; else goto <D.23285>;
      <D.23284>:
      config_file_path = config_file_name;
      <D.23285>:
      D.23286 = monoeg_g_file_get_contents (config_file_path, &text, &len, 0B);
      if (D.23286 == 0) goto free_and_out; else goto <D.23287>;
      <D.23287>:
      runtime_config.runtime_count = 0;
      runtime_config.assemblybinding_count = 0;
      runtime_config.domain = domain;
      runtime_config.filename = config_file_path;
      offset = 0;
      len.32 = len;
      if (len.32 > 3) goto <D.23289>; else goto <D.23290>;
      <D.23289>:
      text.33 = text;
      D.23292 = *text.33;
      if (D.23292 == 239) goto <D.23293>; else goto <D.23294>;
      <D.23293>:
      text.33 = text;
      D.23295 = text.33 + 1;
      D.23296 = *D.23295;
      if (D.23296 == 187) goto <D.23297>; else goto <D.23298>;
      <D.23297>:
      text.33 = text;
      D.23299 = text.33 + 2;
      D.23300 = *D.23299;
      if (D.23300 == 191) goto <D.23301>; else goto <D.23302>;
      <D.23301>:
      offset = 3;
      <D.23302>:
      <D.23298>:
      <D.23294>:
      <D.23290>:
      context = monoeg_g_markup_parse_context_new (&mono_parser, 0, &runtime_config, 0B);
      text.33 = text;
      offset.34 = (sizetype) offset;
      D.23304 = text.33 + offset.34;
      len.32 = len;
      offset.35 = (unsigned int) offset;
      D.23306 = len.32 - offset.35;
      D.23307 = (int) D.23306;
      D.23308 = monoeg_g_markup_parse_context_parse (context, D.23304, D.23307, 0B);
      if (D.23308 != 0) goto <D.23309>; else goto <D.23310>;
      <D.23309>:
      monoeg_g_markup_parse_context_end_parse (context, 0B);
      <D.23310>:
      monoeg_g_markup_parse_context_free (context);
      free_and_out:
      text.33 = text;
      monoeg_g_free (text.33);
      if (config_file_name != config_file_path) goto <D.23311>; else goto <D.23312>;
      <D.23311>:
      monoeg_g_free (config_file_name);
      <D.23312>:
      monoeg_g_free (config_file_path);
    }
  finally
    {
      error = {CLOBBER};
      text = {CLOBBER};
      len = {CLOBBER};
      runtime_config = {CLOBBER};
    }
}


parse_error (struct GMarkupParseContext * context, struct GError * error, void * user_data)
{
  const gchar * iftmp.36;
  gchar * D.23320;
  const gchar * iftmp.37;
  gchar * D.23326;
  struct RuntimeConfig * state;
  const gchar * msg;
  const gchar * filename;

  state = user_data;
  if (state != 0B) goto <D.23319>; else goto <D.23317>;
  <D.23319>:
  D.23320 = state->filename;
  if (D.23320 != 0B) goto <D.23321>; else goto <D.23317>;
  <D.23321>:
  iftmp.36 = state->filename;
  goto <D.23318>;
  <D.23317>:
  iftmp.36 = "<unknown>";
  <D.23318>:
  filename = iftmp.36;
  if (error != 0B) goto <D.23325>; else goto <D.23323>;
  <D.23325>:
  D.23326 = error->message;
  if (D.23326 != 0B) goto <D.23327>; else goto <D.23323>;
  <D.23327>:
  iftmp.37 = error->message;
  goto <D.23324>;
  <D.23323>:
  iftmp.37 = "";
  <D.23324>:
  msg = iftmp.37;
  monoeg_g_log (0B, 16, "Error parsing %s: %s", filename, msg);
}


end_element (struct GMarkupParseContext * context, const gchar * element_name, void * user_data, struct GError * * error)
{
  int D.21710;
  int iftmp.38;
  int D.21709;
  const char[8] * D.23331;
  unsigned char D.23332;
  int D.23333;
  unsigned char D.23334;
  int D.23335;
  _Bool D.23336;
  _Bool D.23337;
  _Bool D.23338;
  const unsigned char * D.23341;
  unsigned char D.23342;
  int D.23343;
  const unsigned char * D.23344;
  unsigned char D.23345;
  int D.23346;
  _Bool D.23347;
  _Bool D.23348;
  const unsigned char * D.23351;
  unsigned char D.23352;
  int D.23353;
  const unsigned char * D.23354;
  unsigned char D.23355;
  int D.23356;
  _Bool D.23357;
  _Bool D.23358;
  const unsigned char * D.23361;
  unsigned char D.23362;
  int D.23363;
  const unsigned char * D.23364;
  unsigned char D.23365;
  int D.23366;
  int D.23370;
  int D.23371;
  int D.21719;
  int iftmp.39;
  int D.21718;
  const char[16] * D.23376;
  unsigned char D.23377;
  int D.23378;
  unsigned char D.23379;
  int D.23380;
  _Bool D.23381;
  _Bool D.23382;
  _Bool D.23383;
  const unsigned char * D.23386;
  unsigned char D.23387;
  int D.23388;
  const unsigned char * D.23389;
  unsigned char D.23390;
  int D.23391;
  _Bool D.23392;
  _Bool D.23393;
  const unsigned char * D.23396;
  unsigned char D.23397;
  int D.23398;
  const unsigned char * D.23399;
  unsigned char D.23400;
  int D.23401;
  _Bool D.23402;
  _Bool D.23403;
  const unsigned char * D.23406;
  unsigned char D.23407;
  int D.23408;
  const unsigned char * D.23409;
  unsigned char D.23410;
  int D.23411;
  int D.23415;
  int D.23416;
  struct RuntimeConfig * runtime_config;

  runtime_config = user_data;
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.23331 = "runtime";
      D.23332 = MEM[(const unsigned char *)D.23331];
      D.23333 = (int) D.23332;
      D.23334 = *__s2;
      D.23335 = (int) D.23334;
      __result = D.23333 - D.23335;
      {
        D.23336 = __s2_len != 0;
        D.23337 = __result == 0;
        D.23338 = D.23336 & D.23337;
        if (D.23338 != 0) goto <D.23339>; else goto <D.23340>;
        <D.23339>:
        D.23341 = &MEM[(void *)"runtime" + 1B];
        D.23342 = *D.23341;
        D.23343 = (int) D.23342;
        D.23344 = __s2 + 1;
        D.23345 = *D.23344;
        D.23346 = (int) D.23345;
        __result = D.23343 - D.23346;
        D.23347 = __s2_len > 1;
        D.23337 = __result == 0;
        D.23348 = D.23347 & D.23337;
        if (D.23348 != 0) goto <D.23349>; else goto <D.23350>;
        <D.23349>:
        D.23351 = &MEM[(void *)"runtime" + 2B];
        D.23352 = *D.23351;
        D.23353 = (int) D.23352;
        D.23354 = __s2 + 2;
        D.23355 = *D.23354;
        D.23356 = (int) D.23355;
        __result = D.23353 - D.23356;
        D.23357 = __s2_len > 2;
        D.23337 = __result == 0;
        D.23358 = D.23357 & D.23337;
        if (D.23358 != 0) goto <D.23359>; else goto <D.23360>;
        <D.23359>:
        D.23361 = &MEM[(void *)"runtime" + 3B];
        D.23362 = *D.23361;
        D.23363 = (int) D.23362;
        D.23364 = __s2 + 3;
        D.23365 = *D.23364;
        D.23366 = (int) D.23365;
        __result = D.23363 - D.23366;
        <D.23360>:
        <D.23350>:
        <D.23340>:
      }
      D.21709 = __result;
    }
    iftmp.38 = -D.21709;
    goto <D.23367>;
    <D.23330>:
    iftmp.38 = __builtin_strcmp (element_name, "runtime");
    <D.23367>:
    D.21710 = iftmp.38;
  }
  if (D.21710 == 0) goto <D.23368>; else goto <D.23369>;
  <D.23368>:
  D.23370 = runtime_config->runtime_count;
  D.23371 = D.23370 + -1;
  runtime_config->runtime_count = D.23371;
  goto <D.23372>;
  <D.23369>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.23376 = "assemblyBinding";
      D.23377 = MEM[(const unsigned char *)D.23376];
      D.23378 = (int) D.23377;
      D.23379 = *__s2;
      D.23380 = (int) D.23379;
      __result = D.23378 - D.23380;
      {
        D.23381 = __s2_len != 0;
        D.23382 = __result == 0;
        D.23383 = D.23381 & D.23382;
        if (D.23383 != 0) goto <D.23384>; else goto <D.23385>;
        <D.23384>:
        D.23386 = &MEM[(void *)"assemblyBinding" + 1B];
        D.23387 = *D.23386;
        D.23388 = (int) D.23387;
        D.23389 = __s2 + 1;
        D.23390 = *D.23389;
        D.23391 = (int) D.23390;
        __result = D.23388 - D.23391;
        D.23392 = __s2_len > 1;
        D.23382 = __result == 0;
        D.23393 = D.23392 & D.23382;
        if (D.23393 != 0) goto <D.23394>; else goto <D.23395>;
        <D.23394>:
        D.23396 = &MEM[(void *)"assemblyBinding" + 2B];
        D.23397 = *D.23396;
        D.23398 = (int) D.23397;
        D.23399 = __s2 + 2;
        D.23400 = *D.23399;
        D.23401 = (int) D.23400;
        __result = D.23398 - D.23401;
        D.23402 = __s2_len > 2;
        D.23382 = __result == 0;
        D.23403 = D.23402 & D.23382;
        if (D.23403 != 0) goto <D.23404>; else goto <D.23405>;
        <D.23404>:
        D.23406 = &MEM[(void *)"assemblyBinding" + 3B];
        D.23407 = *D.23406;
        D.23408 = (int) D.23407;
        D.23409 = __s2 + 3;
        D.23410 = *D.23409;
        D.23411 = (int) D.23410;
        __result = D.23408 - D.23411;
        <D.23405>:
        <D.23395>:
        <D.23385>:
      }
      D.21718 = __result;
    }
    iftmp.39 = -D.21718;
    goto <D.23412>;
    <D.23375>:
    iftmp.39 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.23412>:
    D.21719 = iftmp.39;
  }
  if (D.21719 == 0) goto <D.23413>; else goto <D.23414>;
  <D.23413>:
  D.23415 = runtime_config->assemblybinding_count;
  D.23416 = D.23415 + -1;
  runtime_config->assemblybinding_count = D.23416;
  <D.23414>:
  <D.23372>:
}


start_element (struct GMarkupParseContext * context, const gchar * element_name, const gchar * * attribute_names, const gchar * * attribute_values, void * user_data, struct GError * * error)
{
  int D.21676;
  int iftmp.40;
  int D.21675;
  const char[8] * D.23420;
  unsigned char D.23421;
  int D.23422;
  unsigned char D.23423;
  int D.23424;
  _Bool D.23425;
  _Bool D.23426;
  _Bool D.23427;
  const unsigned char * D.23430;
  unsigned char D.23431;
  int D.23432;
  const unsigned char * D.23433;
  unsigned char D.23434;
  int D.23435;
  _Bool D.23436;
  _Bool D.23437;
  const unsigned char * D.23440;
  unsigned char D.23441;
  int D.23442;
  const unsigned char * D.23443;
  unsigned char D.23444;
  int D.23445;
  _Bool D.23446;
  _Bool D.23447;
  const unsigned char * D.23450;
  unsigned char D.23451;
  int D.23452;
  const unsigned char * D.23453;
  unsigned char D.23454;
  int D.23455;
  int D.23459;
  int D.23460;
  int D.21685;
  int iftmp.41;
  int D.21684;
  const char[16] * D.23464;
  unsigned char D.23465;
  int D.23466;
  unsigned char D.23467;
  int D.23468;
  _Bool D.23469;
  _Bool D.23470;
  _Bool D.23471;
  const unsigned char * D.23474;
  unsigned char D.23475;
  int D.23476;
  const unsigned char * D.23477;
  unsigned char D.23478;
  int D.23479;
  _Bool D.23480;
  _Bool D.23481;
  const unsigned char * D.23484;
  unsigned char D.23485;
  int D.23486;
  const unsigned char * D.23487;
  unsigned char D.23488;
  int D.23489;
  _Bool D.23490;
  _Bool D.23491;
  const unsigned char * D.23494;
  unsigned char D.23495;
  int D.23496;
  const unsigned char * D.23497;
  unsigned char D.23498;
  int D.23499;
  int D.23503;
  int D.23504;
  int D.21694;
  int iftmp.42;
  int D.21693;
  const char[8] * D.23511;
  unsigned char D.23512;
  int D.23513;
  unsigned char D.23514;
  int D.23515;
  _Bool D.23516;
  _Bool D.23517;
  _Bool D.23518;
  const unsigned char * D.23521;
  unsigned char D.23522;
  int D.23523;
  const unsigned char * D.23524;
  unsigned char D.23525;
  int D.23526;
  _Bool D.23527;
  _Bool D.23528;
  const unsigned char * D.23531;
  unsigned char D.23532;
  int D.23533;
  const unsigned char * D.23534;
  unsigned char D.23535;
  int D.23536;
  _Bool D.23537;
  _Bool D.23538;
  const unsigned char * D.23541;
  unsigned char D.23542;
  int D.23543;
  const unsigned char * D.23544;
  unsigned char D.23545;
  int D.23546;
  struct MonoDomain * D.23550;
  gchar * D.23551;
  char * D.23552;
  char D.23555;
  struct RuntimeConfig * runtime_config;

  runtime_config = user_data;
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.23420 = "runtime";
      D.23421 = MEM[(const unsigned char *)D.23420];
      D.23422 = (int) D.23421;
      D.23423 = *__s2;
      D.23424 = (int) D.23423;
      __result = D.23422 - D.23424;
      {
        D.23425 = __s2_len != 0;
        D.23426 = __result == 0;
        D.23427 = D.23425 & D.23426;
        if (D.23427 != 0) goto <D.23428>; else goto <D.23429>;
        <D.23428>:
        D.23430 = &MEM[(void *)"runtime" + 1B];
        D.23431 = *D.23430;
        D.23432 = (int) D.23431;
        D.23433 = __s2 + 1;
        D.23434 = *D.23433;
        D.23435 = (int) D.23434;
        __result = D.23432 - D.23435;
        D.23436 = __s2_len > 1;
        D.23426 = __result == 0;
        D.23437 = D.23436 & D.23426;
        if (D.23437 != 0) goto <D.23438>; else goto <D.23439>;
        <D.23438>:
        D.23440 = &MEM[(void *)"runtime" + 2B];
        D.23441 = *D.23440;
        D.23442 = (int) D.23441;
        D.23443 = __s2 + 2;
        D.23444 = *D.23443;
        D.23445 = (int) D.23444;
        __result = D.23442 - D.23445;
        D.23446 = __s2_len > 2;
        D.23426 = __result == 0;
        D.23447 = D.23446 & D.23426;
        if (D.23447 != 0) goto <D.23448>; else goto <D.23449>;
        <D.23448>:
        D.23450 = &MEM[(void *)"runtime" + 3B];
        D.23451 = *D.23450;
        D.23452 = (int) D.23451;
        D.23453 = __s2 + 3;
        D.23454 = *D.23453;
        D.23455 = (int) D.23454;
        __result = D.23452 - D.23455;
        <D.23449>:
        <D.23439>:
        <D.23429>:
      }
      D.21675 = __result;
    }
    iftmp.40 = -D.21675;
    goto <D.23456>;
    <D.23419>:
    iftmp.40 = __builtin_strcmp (element_name, "runtime");
    <D.23456>:
    D.21676 = iftmp.40;
  }
  if (D.21676 == 0) goto <D.23457>; else goto <D.23458>;
  <D.23457>:
  D.23459 = runtime_config->runtime_count;
  D.23460 = D.23459 + 1;
  runtime_config->runtime_count = D.23460;
  return;
  <D.23458>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.23464 = "assemblyBinding";
      D.23465 = MEM[(const unsigned char *)D.23464];
      D.23466 = (int) D.23465;
      D.23467 = *__s2;
      D.23468 = (int) D.23467;
      __result = D.23466 - D.23468;
      {
        D.23469 = __s2_len != 0;
        D.23470 = __result == 0;
        D.23471 = D.23469 & D.23470;
        if (D.23471 != 0) goto <D.23472>; else goto <D.23473>;
        <D.23472>:
        D.23474 = &MEM[(void *)"assemblyBinding" + 1B];
        D.23475 = *D.23474;
        D.23476 = (int) D.23475;
        D.23477 = __s2 + 1;
        D.23478 = *D.23477;
        D.23479 = (int) D.23478;
        __result = D.23476 - D.23479;
        D.23480 = __s2_len > 1;
        D.23470 = __result == 0;
        D.23481 = D.23480 & D.23470;
        if (D.23481 != 0) goto <D.23482>; else goto <D.23483>;
        <D.23482>:
        D.23484 = &MEM[(void *)"assemblyBinding" + 2B];
        D.23485 = *D.23484;
        D.23486 = (int) D.23485;
        D.23487 = __s2 + 2;
        D.23488 = *D.23487;
        D.23489 = (int) D.23488;
        __result = D.23486 - D.23489;
        D.23490 = __s2_len > 2;
        D.23470 = __result == 0;
        D.23491 = D.23490 & D.23470;
        if (D.23491 != 0) goto <D.23492>; else goto <D.23493>;
        <D.23492>:
        D.23494 = &MEM[(void *)"assemblyBinding" + 3B];
        D.23495 = *D.23494;
        D.23496 = (int) D.23495;
        D.23497 = __s2 + 3;
        D.23498 = *D.23497;
        D.23499 = (int) D.23498;
        __result = D.23496 - D.23499;
        <D.23493>:
        <D.23483>:
        <D.23473>:
      }
      D.21684 = __result;
    }
    iftmp.41 = -D.21684;
    goto <D.23500>;
    <D.23463>:
    iftmp.41 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.23500>:
    D.21685 = iftmp.41;
  }
  if (D.21685 == 0) goto <D.23501>; else goto <D.23502>;
  <D.23501>:
  D.23503 = runtime_config->assemblybinding_count;
  D.23504 = D.23503 + 1;
  runtime_config->assemblybinding_count = D.23504;
  return;
  <D.23502>:
  D.23459 = runtime_config->runtime_count;
  if (D.23459 != 1) goto <D.23505>; else goto <D.23507>;
  <D.23507>:
  D.23503 = runtime_config->assemblybinding_count;
  if (D.23503 != 1) goto <D.23505>; else goto <D.23506>;
  <D.23505>:
  return;
  <D.23506>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.23511 = "probing";
      D.23512 = MEM[(const unsigned char *)D.23511];
      D.23513 = (int) D.23512;
      D.23514 = *__s2;
      D.23515 = (int) D.23514;
      __result = D.23513 - D.23515;
      {
        D.23516 = __s2_len != 0;
        D.23517 = __result == 0;
        D.23518 = D.23516 & D.23517;
        if (D.23518 != 0) goto <D.23519>; else goto <D.23520>;
        <D.23519>:
        D.23521 = &MEM[(void *)"probing" + 1B];
        D.23522 = *D.23521;
        D.23523 = (int) D.23522;
        D.23524 = __s2 + 1;
        D.23525 = *D.23524;
        D.23526 = (int) D.23525;
        __result = D.23523 - D.23526;
        D.23527 = __s2_len > 1;
        D.23517 = __result == 0;
        D.23528 = D.23527 & D.23517;
        if (D.23528 != 0) goto <D.23529>; else goto <D.23530>;
        <D.23529>:
        D.23531 = &MEM[(void *)"probing" + 2B];
        D.23532 = *D.23531;
        D.23533 = (int) D.23532;
        D.23534 = __s2 + 2;
        D.23535 = *D.23534;
        D.23536 = (int) D.23535;
        __result = D.23533 - D.23536;
        D.23537 = __s2_len > 2;
        D.23517 = __result == 0;
        D.23538 = D.23537 & D.23517;
        if (D.23538 != 0) goto <D.23539>; else goto <D.23540>;
        <D.23539>:
        D.23541 = &MEM[(void *)"probing" + 3B];
        D.23542 = *D.23541;
        D.23543 = (int) D.23542;
        D.23544 = __s2 + 3;
        D.23545 = *D.23544;
        D.23546 = (int) D.23545;
        __result = D.23543 - D.23546;
        <D.23540>:
        <D.23530>:
        <D.23520>:
      }
      D.21693 = __result;
    }
    iftmp.42 = -D.21693;
    goto <D.23547>;
    <D.23510>:
    iftmp.42 = __builtin_strcmp (element_name, "probing");
    <D.23547>:
    D.21694 = iftmp.42;
  }
  if (D.21694 != 0) goto <D.23548>; else goto <D.23549>;
  <D.23548>:
  return;
  <D.23549>:
  D.23550 = runtime_config->domain;
  D.23551 = D.23550->private_bin_path;
  monoeg_g_free (D.23551);
  D.23550 = runtime_config->domain;
  D.23552 = get_attribute_value (attribute_names, attribute_values, "privatePath");
  D.23550->private_bin_path = D.23552;
  D.23550 = runtime_config->domain;
  D.23551 = D.23550->private_bin_path;
  if (D.23551 != 0B) goto <D.23553>; else goto <D.23554>;
  <D.23553>:
  D.23550 = runtime_config->domain;
  D.23551 = D.23550->private_bin_path;
  D.23555 = *D.23551;
  if (D.23555 == 0) goto <D.23556>; else goto <D.23557>;
  <D.23556>:
  D.23550 = runtime_config->domain;
  D.23551 = D.23550->private_bin_path;
  monoeg_g_free (D.23551);
  D.23550 = runtime_config->domain;
  D.23550->private_bin_path = 0B;
  return;
  <D.23557>:
  <D.23554>:
}


get_attribute_value (const gchar * * attribute_names, const gchar * * attribute_values, const char * att_name)
{
  int D.21655;
  unsigned int n.43;
  unsigned int D.23560;
  const gchar * * D.23561;
  const gchar * D.23562;
  char * D.23565;
  const gchar * * D.23566;
  const gchar * D.23567;
  int n;

  n = 0;
  goto <D.21657>;
  <D.21656>:
  {
    size_t __s1_len;
    size_t __s2_len;

    n.43 = (unsigned int) n;
    D.23560 = n.43 * 4;
    D.23561 = attribute_names + D.23560;
    D.23562 = *D.23561;
    D.21655 = __builtin_strcmp (D.23562, att_name);
  }
  if (D.21655 == 0) goto <D.23563>; else goto <D.23564>;
  <D.23563>:
  n.43 = (unsigned int) n;
  D.23560 = n.43 * 4;
  D.23566 = attribute_values + D.23560;
  D.23567 = *D.23566;
  D.23565 = monoeg_strdup (D.23567);
  return D.23565;
  <D.23564>:
  n = n + 1;
  <D.21657>:
  n.43 = (unsigned int) n;
  D.23560 = n.43 * 4;
  D.23561 = attribute_names + D.23560;
  D.23562 = *D.23561;
  if (D.23562 != 0B) goto <D.21656>; else goto <D.21658>;
  <D.21658>:
  D.23565 = 0B;
  return D.23565;
}


ves_icall_System_AppDomain_createDomain (struct MonoString * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoAppDomain * D.23569;
  char * fname;
  struct MonoAppDomain * ad;

  fname = mono_string_to_utf8 (friendly_name);
  ad = mono_domain_create_appdomain_internal (fname, setup);
  monoeg_g_free (fname);
  D.23569 = ad;
  return D.23569;
}


ves_icall_System_AppDomain_GetAssemblies (struct MonoAppDomain * ad, MonoBoolean refonly)
{
  struct MonoClass * System_Reflection_Assembly.44;
  struct MonoImage * D.23574;
  struct MonoClass * System_Reflection_Assembly.45;
  union mono_mutex_t * D.23576;
  _Bool D.23579;
  long int D.23580;
  long int D.23581;
  int D.23584;
  int D.23585;
  unsigned char D.23588;
  _Bool D.23593;
  long int D.23594;
  long int D.23595;
  unsigned int D.23598;
  void * * D.23599;
  unsigned int i.46;
  unsigned int D.23601;
  void * * D.23602;
  unsigned int i.47;
  struct MonoReflectionAssembly * D.23604;
  unsigned int i.48;
  struct MonoArray * D.23606;
  struct MonoDomain * domain;
  struct MonoAssembly * ass;
  static struct MonoClass * System_Reflection_Assembly;
  struct MonoArray * res;
  struct GSList * tmp;
  int i;
  struct GPtrArray * assemblies;

  domain = ad->data;
  System_Reflection_Assembly.44 = System_Reflection_Assembly;
  if (System_Reflection_Assembly.44 == 0B) goto <D.23572>; else goto <D.23573>;
  <D.23572>:
  D.23574 = mono_defaults.corlib;
  System_Reflection_Assembly.45 = mono_class_from_name (D.23574, "System.Reflection", "Assembly");
  System_Reflection_Assembly = System_Reflection_Assembly.45;
  <D.23573>:
  assemblies = monoeg_g_ptr_array_new ();
  {
    int ret;

    D.23576 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.23576);
    if (ret != 0) goto <D.23577>; else goto <D.23578>;
    <D.23577>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23578>:
    D.23579 = ret != 0;
    D.23580 = (long int) D.23579;
    D.23581 = __builtin_expect (D.23580, 0);
    if (D.23581 != 0) goto <D.23582>; else goto <D.23583>;
    <D.23582>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 874, "ret == 0");
    <D.23583>:
  }
  tmp = domain->domain_assemblies;
  goto <D.21761>;
  <D.21760>:
  ass = tmp->data;
  D.23584 = (int) refonly;
  D.23585 = ass->ref_only;
  if (D.23584 != D.23585) goto <D.23586>; else goto <D.23587>;
  <D.23586>:
  // predicted unlikely by continue predictor.
  goto <D.21759>;
  <D.23587>:
  D.23588 = ass->corlib_internal;
  if (D.23588 != 0) goto <D.23589>; else goto <D.23590>;
  <D.23589>:
  // predicted unlikely by continue predictor.
  goto <D.21759>;
  <D.23590>:
  monoeg_g_ptr_array_add (assemblies, ass);
  <D.21759>:
  tmp = tmp->next;
  <D.21761>:
  if (tmp != 0B) goto <D.21760>; else goto <D.21762>;
  <D.21762>:
  {
    int ret;

    D.23576 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.23576);
    if (ret != 0) goto <D.23591>; else goto <D.23592>;
    <D.23591>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23592>:
    D.23593 = ret != 0;
    D.23594 = (long int) D.23593;
    D.23595 = __builtin_expect (D.23594, 0);
    if (D.23595 != 0) goto <D.23596>; else goto <D.23597>;
    <D.23596>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 883, "ret == 0");
    <D.23597>:
  }
  System_Reflection_Assembly.44 = System_Reflection_Assembly;
  D.23598 = assemblies->len;
  res = mono_array_new (domain, System_Reflection_Assembly.44, D.23598);
  i = 0;
  goto <D.21766>;
  <D.21765>:
  D.23599 = assemblies->pdata;
  i.46 = (unsigned int) i;
  D.23601 = i.46 * 4;
  D.23602 = D.23599 + D.23601;
  ass = *D.23602;
  {
    void * * __p;

    i.47 = (unsigned int) i;
    __p = mono_array_addr_with_size (res, 4, i.47);
    D.23604 = mono_assembly_get_object (domain, ass);
    mono_gc_wbarrier_set_arrayref (res, __p, D.23604);
  }
  i = i + 1;
  <D.21766>:
  i.48 = (unsigned int) i;
  D.23598 = assemblies->len;
  if (i.48 < D.23598) goto <D.21765>; else goto <D.21767>;
  <D.21767>:
  monoeg_g_ptr_array_free (assemblies, 1);
  D.23606 = res;
  return D.23606;
}


mono_try_assembly_resolve (struct MonoDomain * domain, struct MonoString * fname, gboolean refonly)
{
  int D.23608;
  struct MonoReflectionAssembly * D.23611;
  _Bool D.23612;
  _Bool D.23613;
  _Bool D.23614;
  int D.23615;
  _Bool D.23616;
  long int D.23617;
  long int D.23618;
  struct MonoAppDomain * D.23621;
  struct MonoVTable * D.23622;
  _Bool D.23623;
  long int D.23624;
  long int D.23625;
  _Bool D.23630;
  unsigned char isrefonly.49;
  struct MonoClass * klass;
  struct MonoMethod * method;
  MonoBoolean isrefonly;
  void * params[2];

  try
    {
      D.23608 = mono_runtime_get_no_exec ();
      if (D.23608 != 0) goto <D.23609>; else goto <D.23610>;
      <D.23609>:
      D.23611 = 0B;
      return D.23611;
      <D.23610>:
      D.23612 = domain == 0B;
      D.23613 = fname == 0B;
      D.23614 = D.23612 | D.23613;
      D.23615 = (int) D.23614;
      D.23616 = D.23615 != 0;
      D.23617 = (long int) D.23616;
      D.23618 = __builtin_expect (D.23617, 0);
      if (D.23618 != 0) goto <D.23619>; else goto <D.23620>;
      <D.23619>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 907, "domain != NULL && fname != NULL");
      <D.23620>:
      D.23621 = domain->domain;
      D.23622 = D.23621->mbr.obj.vtable;
      klass = D.23622->klass;
      D.23623 = klass == 0B;
      D.23624 = (long int) D.23623;
      D.23625 = __builtin_expect (D.23624, 0);
      if (D.23625 != 0) goto <D.23626>; else goto <D.23627>;
      <D.23626>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 910, "klass");
      <D.23627>:
      method = mono_class_get_method_from_name (klass, "DoAssemblyResolve", -1);
      if (method == 0B) goto <D.23628>; else goto <D.23629>;
      <D.23628>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoAssemblyResolve not found.\n");
      D.23611 = 0B;
      return D.23611;
      <D.23629>:
      D.23630 = refonly != 0;
      isrefonly.49 = (unsigned char) D.23630;
      isrefonly = isrefonly.49;
      params[0] = fname;
      params[1] = &isrefonly;
      D.23621 = domain->domain;
      D.23611 = mono_runtime_invoke (method, D.23621, &params, 0B);
      return D.23611;
    }
  finally
    {
      isrefonly = {CLOBBER};
      params = {CLOBBER};
    }
}


mono_is_shadow_copy_enabled (struct MonoDomain * domain, const gchar * dir_name)
{
  gboolean D.23636;
  struct MonoString * D.23640;
  int D.23641;
  int D.23644;
  _Bool D.23645;
  struct MonoString * D.23648;
  int D.23651;
  char * D.23654;
  int D.23657;
  gchar * D.23660;
  char D.23661;
  int D.21969;
  struct MonoError error;
  struct MonoAppDomainSetup * setup;
  gchar * all_dirs;
  gchar * * dir_ptr;
  gchar * * directories;
  gchar * shadow_status_string;
  gchar * base_dir;
  gboolean shadow_enabled;
  gboolean found;

  try
    {
      found = 0;
      if (domain == 0B) goto <D.23634>; else goto <D.23635>;
      <D.23634>:
      D.23636 = 0;
      return D.23636;
      <D.23635>:
      setup = domain->setup;
      if (setup == 0B) goto <D.23637>; else goto <D.23639>;
      <D.23639>:
      D.23640 = setup->shadow_copy_files;
      if (D.23640 == 0B) goto <D.23637>; else goto <D.23638>;
      <D.23637>:
      D.23636 = 0;
      return D.23636;
      <D.23638>:
      D.23640 = setup->shadow_copy_files;
      shadow_status_string = mono_string_to_utf8_checked (D.23640, &error);
      D.23641 = mono_error_ok (&error);
      if (D.23641 == 0) goto <D.23642>; else goto <D.23643>;
      <D.23642>:
      mono_error_cleanup (&error);
      D.23636 = 0;
      return D.23636;
      <D.23643>:
      D.23644 = monoeg_g_ascii_strncasecmp (shadow_status_string, "true", 4);
      D.23645 = D.23644 == 0;
      shadow_enabled = (gboolean) D.23645;
      monoeg_g_free (shadow_status_string);
      if (shadow_enabled == 0) goto <D.23646>; else goto <D.23647>;
      <D.23646>:
      D.23636 = 0;
      return D.23636;
      <D.23647>:
      D.23648 = setup->shadow_copy_directories;
      if (D.23648 == 0B) goto <D.23649>; else goto <D.23650>;
      <D.23649>:
      D.23636 = 1;
      return D.23636;
      <D.23650>:
      base_dir = get_shadow_assembly_location_base (domain, &error);
      D.23651 = mono_error_ok (&error);
      if (D.23651 == 0) goto <D.23652>; else goto <D.23653>;
      <D.23652>:
      mono_error_cleanup (&error);
      D.23636 = 0;
      return D.23636;
      <D.23653>:
      D.23654 = strstr (dir_name, base_dir);
      if (D.23654 != 0B) goto <D.23655>; else goto <D.23656>;
      <D.23655>:
      monoeg_g_free (base_dir);
      D.23636 = 1;
      return D.23636;
      <D.23656>:
      monoeg_g_free (base_dir);
      D.23648 = setup->shadow_copy_directories;
      all_dirs = mono_string_to_utf8_checked (D.23648, &error);
      D.23657 = mono_error_ok (&error);
      if (D.23657 == 0) goto <D.23658>; else goto <D.23659>;
      <D.23658>:
      mono_error_cleanup (&error);
      D.23636 = 0;
      return D.23636;
      <D.23659>:
      directories = monoeg_g_strsplit (all_dirs, ":", 1000);
      dir_ptr = directories;
      goto <D.21972>;
      <D.21971>:
      D.23660 = *dir_ptr;
      D.23661 = *D.23660;
      if (D.23661 != 0) goto <D.23662>; else goto <D.23663>;
      <D.23662>:
      {
        size_t __s1_len;
        size_t __s2_len;

        D.23660 = *dir_ptr;
        D.21969 = __builtin_strcmp (D.23660, dir_name);
      }
      if (D.21969 == 0) goto <D.23664>; else goto <D.23665>;
      <D.23664>:
      found = 1;
      goto <D.21970>;
      <D.23665>:
      <D.23663>:
      dir_ptr = dir_ptr + 4;
      <D.21972>:
      D.23660 = *dir_ptr;
      if (D.23660 != 0B) goto <D.21971>; else goto <D.21970>;
      <D.21970>:
      monoeg_g_strfreev (directories);
      monoeg_g_free (all_dirs);
      D.23636 = found;
      return D.23636;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_make_shadow_copy (const char * filename)
{
  int D.23668;
  char * D.23671;
  int D.23672;
  char * D.23675;
  int D.23678;
  int D.23681;
  int D.23684;
  unsigned int D.23687;
  long int D.23688;
  unsigned int D.23689;
  long int D.23690;
  unsigned int D.23697;
  unsigned int D.23698;
  int D.23703;
  long int D.23706;
  long int D.23707;
  struct MonoError error;
  gchar * sibling_source;
  gchar * sibling_target;
  gint sibling_source_len;
  gint sibling_target_len;
  guint16 * orig;
  guint16 * dest;
  guint32 attrs;
  char * shadow;
  gboolean copy_result;
  struct MonoException * exc;
  struct stat src_sbuf;
  struct utimbuf utbuf;
  char * dir_name;
  struct MonoDomain * domain;
  char * shadow_dir;

  try
    {
      dir_name = monoeg_g_path_get_dirname (filename);
      domain = mono_domain_get ();
      set_domain_search_path (domain);
      D.23668 = mono_is_shadow_copy_enabled (domain, dir_name);
      if (D.23668 == 0) goto <D.23669>; else goto <D.23670>;
      <D.23669>:
      monoeg_g_free (dir_name);
      D.23671 = filename;
      return D.23671;
      <D.23670>:
      shadow_dir = get_shadow_assembly_location_base (domain, &error);
      D.23672 = mono_error_ok (&error);
      if (D.23672 == 0) goto <D.23673>; else goto <D.23674>;
      <D.23673>:
      mono_error_cleanup (&error);
      monoeg_g_free (dir_name);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (invalid characters in shadow directory name).");
      mono_raise_exception (exc);
      <D.23674>:
      D.23675 = strstr (dir_name, shadow_dir);
      if (D.23675 != 0B) goto <D.23676>; else goto <D.23677>;
      <D.23676>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      D.23671 = filename;
      return D.23671;
      <D.23677>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      shadow = get_shadow_assembly_location (filename, &error);
      D.23678 = mono_error_ok (&error);
      if (D.23678 == 0) goto <D.23679>; else goto <D.23680>;
      <D.23679>:
      mono_error_cleanup (&error);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (invalid characters in file name).");
      mono_raise_exception (exc);
      <D.23680>:
      D.23681 = ensure_directory_exists (shadow);
      if (D.23681 == 0) goto <D.23682>; else goto <D.23683>;
      <D.23682>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (ensure directory exists).");
      mono_raise_exception (exc);
      <D.23683>:
      D.23684 = private_file_needs_copying (filename, &src_sbuf, shadow);
      if (D.23684 == 0) goto <D.23685>; else goto <D.23686>;
      <D.23685>:
      D.23671 = shadow;
      return D.23671;
      <D.23686>:
      D.23687 = strlen (filename);
      D.23688 = (long int) D.23687;
      orig = monoeg_g_utf8_to_utf16 (filename, D.23688, 0B, 0B, 0B);
      D.23689 = strlen (shadow);
      D.23690 = (long int) D.23689;
      dest = monoeg_g_utf8_to_utf16 (shadow, D.23690, 0B, 0B, 0B);
      DeleteFile (dest);
      attrs = GetFileAttributes (orig);
      if (attrs == 4294967295) goto <D.23691>; else goto <D.23692>;
      <D.23691>:
      monoeg_g_free (shadow);
      D.23671 = filename;
      return D.23671;
      <D.23692>:
      copy_result = CopyFile (orig, dest, 0);
      if (copy_result != 0) goto <D.23693>; else goto <D.23694>;
      <D.23693>:
      copy_result = SetFileAttributes (dest, 128);
      <D.23694>:
      monoeg_g_free (dest);
      monoeg_g_free (orig);
      if (copy_result == 0) goto <D.23695>; else goto <D.23696>;
      <D.23695>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (CopyFile).");
      mono_raise_exception (exc);
      <D.23696>:
      sibling_source = monoeg_g_strconcat (filename, ".config", 0B);
      D.23697 = strlen (sibling_source);
      sibling_source_len = (gint) D.23697;
      sibling_target = monoeg_g_strconcat (shadow, ".config", 0B);
      D.23698 = strlen (sibling_target);
      sibling_target_len = (gint) D.23698;
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
      if (copy_result == 1) goto <D.23699>; else goto <D.23700>;
      <D.23699>:
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);
      <D.23700>:
      monoeg_g_free (sibling_source);
      monoeg_g_free (sibling_target);
      if (copy_result == 0) goto <D.23701>; else goto <D.23702>;
      <D.23701>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy of sibling data (CopyFile).");
      mono_raise_exception (exc);
      <D.23702>:
      D.23703 = shadow_copy_create_ini (shadow, filename);
      if (D.23703 == 0) goto <D.23704>; else goto <D.23705>;
      <D.23704>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy .ini file.");
      mono_raise_exception (exc);
      <D.23705>:
      D.23706 = src_sbuf.st_atim.tv_sec;
      utbuf.actime = D.23706;
      D.23707 = src_sbuf.st_mtim.tv_sec;
      utbuf.modtime = D.23707;
      utime (shadow, &utbuf);
      D.23671 = shadow;
      return D.23671;
    }
  finally
    {
      error = {CLOBBER};
      src_sbuf = {CLOBBER};
      utbuf = {CLOBBER};
    }
}


get_shadow_assembly_location (const char * filename, struct MonoError * error)
{
  int D.23710;
  int D.23711;
  int D.23712;
  char * D.23715;
  gint32 hash;
  gint32 hash2;
  char name_hash[9];
  char path_hash[30];
  char * bname;
  char * dirname;
  char * location;
  char * tmploc;
  struct MonoDomain * domain;

  try
    {
      hash = 0;
      hash2 = 0;
      bname = monoeg_g_path_get_basename (filename);
      dirname = monoeg_g_path_get_dirname (filename);
      domain = mono_domain_get ();
      mono_error_init (error);
      hash = get_cstring_hash (bname);
      hash2 = get_cstring_hash (dirname);
      monoeg_g_snprintf (&name_hash, 9, "%08x", hash);
      D.23710 = hash ^ hash2;
      D.23711 = domain->shadow_serial;
      monoeg_g_snprintf (&path_hash, 30, "%08x_%08x_%08x", D.23710, hash2, D.23711);
      tmploc = get_shadow_assembly_location_base (domain, error);
      D.23712 = mono_error_ok (error);
      if (D.23712 == 0) goto <D.23713>; else goto <D.23714>;
      <D.23713>:
      monoeg_g_free (bname);
      monoeg_g_free (dirname);
      D.23715 = 0B;
      return D.23715;
      <D.23714>:
      location = monoeg_g_build_path ("/", tmploc, &name_hash, &path_hash, bname, 0B);
      monoeg_g_free (tmploc);
      monoeg_g_free (bname);
      monoeg_g_free (dirname);
      D.23715 = location;
      return D.23715;
    }
  finally
    {
      name_hash = {CLOBBER};
      path_hash = {CLOBBER};
    }
}


get_cstring_hash (const char * str)
{
  char D.23721;
  gint32 D.23722;
  unsigned int D.23723;
  int D.23724;
  int D.23725;
  char D.23726;
  int D.23727;
  int len;
  int i;
  const char * p;
  gint32 h;

  h = 0;
  if (str == 0B) goto <D.23718>; else goto <D.23720>;
  <D.23720>:
  D.23721 = *str;
  if (D.23721 == 0) goto <D.23718>; else goto <D.23719>;
  <D.23718>:
  D.23722 = 0;
  return D.23722;
  <D.23719>:
  D.23723 = strlen (str);
  len = (int) D.23723;
  p = str;
  i = 0;
  goto <D.21888>;
  <D.21887>:
  D.23724 = h << 5;
  D.23725 = D.23724 - h;
  D.23726 = *p;
  D.23727 = (int) D.23726;
  h = D.23725 + D.23727;
  p = p + 1;
  i = i + 1;
  <D.21888>:
  if (i < len) goto <D.21887>; else goto <D.21889>;
  <D.21889>:
  D.23722 = h;
  return D.23722;
}


ensure_directory_exists (const char * filename)
{
  char D.23732;
  gboolean D.23733;
  int D.23734;
  unsigned int D.23737;
  unsigned int D.23738;
  char D.23741;
  int * D.23746;
  int D.23747;
  char * p.50;
  char * p;
  gchar * dir;
  int retval;
  struct stat sbuf;

  try
    {
      dir = monoeg_g_path_get_dirname (filename);
      if (dir == 0B) goto <D.23729>; else goto <D.23731>;
      <D.23731>:
      D.23732 = *dir;
      if (D.23732 == 0) goto <D.23729>; else goto <D.23730>;
      <D.23729>:
      monoeg_g_free (dir);
      D.23733 = 0;
      return D.23733;
      <D.23730>:
      D.23734 = stat (dir, &sbuf);
      if (D.23734 == 0) goto <D.23735>; else goto <D.23736>;
      <D.23735>:
      D.23737 = sbuf.st_mode;
      D.23738 = D.23737 & 61440;
      if (D.23738 == 16384) goto <D.23739>; else goto <D.23740>;
      <D.23739>:
      monoeg_g_free (dir);
      D.23733 = 1;
      return D.23733;
      <D.23740>:
      <D.23736>:
      p = dir;
      goto <D.21924>;
      <D.21923>:
      p = p + 1;
      <D.21924>:
      D.23741 = *p;
      if (D.23741 == 47) goto <D.21923>; else goto <D.21925>;
      <D.21925>:
      <D.21927>:
      p = __builtin_strchr (p, 47);
      if (p != 0B) goto <D.23742>; else goto <D.23743>;
      <D.23742>:
      *p = 0;
      <D.23743>:
      retval = mkdir (dir, 511);
      if (retval != 0) goto <D.23744>; else goto <D.23745>;
      <D.23744>:
      D.23746 = __errno_location ();
      D.23747 = *D.23746;
      if (D.23747 != 17) goto <D.23748>; else goto <D.23749>;
      <D.23748>:
      monoeg_g_free (dir);
      D.23733 = 0;
      return D.23733;
      <D.23749>:
      <D.23745>:
      if (p == 0B) goto <D.21926>; else goto <D.23750>;
      <D.23750>:
      p.50 = p;
      p = p.50 + 1;
      *p.50 = 47;
      goto <D.21927>;
      <D.21926>:
      monoeg_g_free (dir);
      D.23733 = 1;
      return D.23733;
    }
  finally
    {
      sbuf = {CLOBBER};
    }
}


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

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


private_file_needs_copying (const char * src, struct stat * sbuf_src, char * dest)
{
  int D.23759;
  gboolean D.23764;
  int D.23767;
  long long int D.23770;
  long long int D.23771;
  long int D.23774;
  long int D.23775;
  struct stat sbuf_dest;
  gchar * stat_src;
  gchar * real_src;

  try
    {
      real_src = mono_portability_find_file (src, 1);
      if (real_src == 0B) goto <D.23756>; else goto <D.23757>;
      <D.23756>:
      stat_src = src;
      goto <D.23758>;
      <D.23757>:
      stat_src = real_src;
      <D.23758>:
      D.23759 = stat (stat_src, sbuf_src);
      if (D.23759 == -1) goto <D.23760>; else goto <D.23761>;
      <D.23760>:
      {
        time_t tnow;

        tnow = time (0B);
        if (real_src != 0B) goto <D.23762>; else goto <D.23763>;
        <D.23762>:
        monoeg_g_free (real_src);
        <D.23763>:
        memset (sbuf_src, 0, 104);
        sbuf_src->st_mtim.tv_sec = tnow;
        sbuf_src->st_atim.tv_sec = tnow;
        D.23764 = 1;
        return D.23764;
      }
      <D.23761>:
      if (real_src != 0B) goto <D.23765>; else goto <D.23766>;
      <D.23765>:
      monoeg_g_free (real_src);
      <D.23766>:
      D.23767 = stat (dest, &sbuf_dest);
      if (D.23767 == -1) goto <D.23768>; else goto <D.23769>;
      <D.23768>:
      D.23764 = 1;
      return D.23764;
      <D.23769>:
      D.23770 = sbuf_src->st_size;
      D.23771 = sbuf_dest.st_size;
      if (D.23770 == D.23771) goto <D.23772>; else goto <D.23773>;
      <D.23772>:
      D.23774 = sbuf_src->st_mtim.tv_sec;
      D.23775 = sbuf_dest.st_mtim.tv_sec;
      if (D.23774 == D.23775) goto <D.23776>; else goto <D.23777>;
      <D.23776>:
      D.23764 = 0;
      return D.23764;
      <D.23777>:
      <D.23773>:
      D.23764 = 1;
      return D.23764;
    }
  finally
    {
      sbuf_dest = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.23782;
  int D.23787;
  void * D.23789;
  unsigned int D.23790;

  D.23782 = __builtin_constant_p (__len);
  if (D.23782 != 0) goto <D.23783>; else goto <D.23784>;
  <D.23783>:
  if (__len == 0) goto <D.23785>; else goto <D.23786>;
  <D.23785>:
  D.23787 = __builtin_constant_p (__ch);
  if (D.23787 == 0) goto <D.23780>; else goto <D.23788>;
  <D.23788>:
  if (__ch != 0) goto <D.23780>; else goto <D.23781>;
  <D.23780>:
  __warn_memset_zero_len ();
  D.23789 = __dest;
  return D.23789;
  <D.23781>:
  <D.23786>:
  <D.23784>:
  D.23790 = __builtin_object_size (__dest, 0);
  D.23789 = __builtin___memset_chk (__dest, __ch, __len, D.23790);
  return D.23789;
}


shadow_copy_sibling (gchar * src, gint srclen, const char * extension, gchar * target, gint targetlen, gint tail_len)
{
  sizetype srclen.51;
  sizetype tail_len.52;
  sizetype D.23794;
  gchar * D.23795;
  int __mono_io_portability_helpers.53;
  int D.23797;
  gboolean D.23802;
  int D.23804;
  unsigned int D.23807;
  long int D.23808;
  sizetype targetlen.54;
  sizetype D.23810;
  gchar * D.23811;
  unsigned int D.23812;
  long int D.23813;
  guint16 * orig;
  guint16 * dest;
  gboolean copy_result;

  srclen.51 = (sizetype) srclen;
  tail_len.52 = (sizetype) tail_len;
  D.23794 = srclen.51 - tail_len.52;
  D.23795 = src + D.23794;
  strcpy (D.23795, extension);
  __mono_io_portability_helpers.53 = __mono_io_portability_helpers;
  D.23797 = __mono_io_portability_helpers.53 & 4;
  if (D.23797 != 0) goto <D.23798>; else goto <D.23799>;
  <D.23798>:
  {
    gchar * file;

    file = mono_portability_find_file (src, 1);
    if (file == 0B) goto <D.23800>; else goto <D.23801>;
    <D.23800>:
    D.23802 = 1;
    return D.23802;
    <D.23801>:
    monoeg_g_free (file);
  }
  goto <D.23803>;
  <D.23799>:
  D.23804 = monoeg_g_file_test (src, 1);
  if (D.23804 == 0) goto <D.23805>; else goto <D.23806>;
  <D.23805>:
  D.23802 = 1;
  return D.23802;
  <D.23806>:
  <D.23803>:
  D.23807 = strlen (src);
  D.23808 = (long int) D.23807;
  orig = monoeg_g_utf8_to_utf16 (src, D.23808, 0B, 0B, 0B);
  targetlen.54 = (sizetype) targetlen;
  tail_len.52 = (sizetype) tail_len;
  D.23810 = targetlen.54 - tail_len.52;
  D.23811 = target + D.23810;
  strcpy (D.23811, extension);
  D.23812 = strlen (target);
  D.23813 = (long int) D.23812;
  dest = monoeg_g_utf8_to_utf16 (target, D.23813, 0B, 0B, 0B);
  DeleteFile (dest);
  copy_result = CopyFile (orig, dest, 0);
  if (copy_result != 0) goto <D.23814>; else goto <D.23815>;
  <D.23814>:
  copy_result = SetFileAttributes (dest, 128);
  <D.23815>:
  monoeg_g_free (orig);
  monoeg_g_free (dest);
  D.23802 = copy_result;
  return D.23802;
}


shadow_copy_create_ini (const char * shadow, const char * filename)
{
  int D.23817;
  gboolean D.23820;
  unsigned int D.23821;
  long int D.23822;
  unsigned int D.23827;
  char * dir_name;
  char * ini_file;
  guint16 * u16_ini;
  gboolean result;
  guint32 n;
  void * * handle;
  gchar * full_path;

  try
    {
      dir_name = monoeg_g_path_get_dirname (shadow);
      ini_file = monoeg_g_build_path ("/", dir_name, "__AssemblyInfo__.ini", 0B);
      monoeg_g_free (dir_name);
      D.23817 = monoeg_g_file_test (ini_file, 1);
      if (D.23817 != 0) goto <D.23818>; else goto <D.23819>;
      <D.23818>:
      monoeg_g_free (ini_file);
      D.23820 = 1;
      return D.23820;
      <D.23819>:
      D.23821 = strlen (ini_file);
      D.23822 = (long int) D.23821;
      u16_ini = monoeg_g_utf8_to_utf16 (ini_file, D.23822, 0B, 0B, 0B);
      monoeg_g_free (ini_file);
      if (u16_ini == 0B) goto <D.23823>; else goto <D.23824>;
      <D.23823>:
      D.23820 = 0;
      return D.23820;
      <D.23824>:
      handle = CreateFile (u16_ini, 1073741824, 3, 0B, 1, 128, 0B);
      monoeg_g_free (u16_ini);
      if (handle == 4294967295B) goto <D.23825>; else goto <D.23826>;
      <D.23825>:
      D.23820 = 0;
      return D.23820;
      <D.23826>:
      full_path = mono_path_resolve_symlinks (filename);
      D.23827 = strlen (full_path);
      result = WriteFile (handle, full_path, D.23827, &n, 0B);
      monoeg_g_free (full_path);
      CloseHandle (handle);
      D.23820 = result;
      return D.23820;
    }
  finally
    {
      n = {CLOBBER};
    }
}


mono_domain_from_appdomain (struct MonoAppDomain * appdomain)
{
  struct MonoDomain * D.23832;

  if (appdomain == 0B) goto <D.23830>; else goto <D.23831>;
  <D.23830>:
  D.23832 = 0B;
  return D.23832;
  <D.23831>:
  D.23832 = appdomain->data;
  return D.23832;
}


ves_icall_System_Reflection_Assembly_LoadFrom (struct MonoString * fname, MonoBoolean refOnly)
{
  int D.23836;
  <unnamed type> status.55;
  struct MonoReflectionAssembly * D.23843;
  struct MonoDomain * domain;
  char * name;
  char * filename;
  MonoImageOpenStatus status;
  struct MonoAssembly * ass;

  try
    {
      domain = mono_domain_get ();
      status = 0;
      if (fname == 0B) goto <D.23834>; else goto <D.23835>;
      <D.23834>:
      {
        struct MonoException * exc;

        exc = mono_get_exception_argument_null ("assemblyFile");
        mono_raise_exception (exc);
      }
      <D.23835>:
      filename = mono_string_to_utf8 (fname);
      name = filename;
      D.23836 = (int) refOnly;
      ass = mono_assembly_open_full (filename, &status, D.23836);
      if (ass == 0B) goto <D.23837>; else goto <D.23838>;
      <D.23837>:
      {
        struct MonoException * exc;

        status.55 = status;
        if (status.55 == 3) goto <D.23840>; else goto <D.23841>;
        <D.23840>:
        exc = mono_get_exception_bad_image_format2 (0B, fname);
        goto <D.23842>;
        <D.23841>:
        exc = mono_get_exception_file_not_found2 (0B, fname);
        <D.23842>:
        monoeg_g_free (name);
        mono_raise_exception (exc);
      }
      <D.23838>:
      monoeg_g_free (name);
      D.23843 = mono_assembly_get_object (domain, ass);
      return D.23843;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssemblyRaw (struct MonoAppDomain * ad, struct MonoArray * raw_assembly, struct MonoArray * raw_symbol_store, struct MonoObject * evidence, MonoBoolean refonly)
{
  char * D.23846;
  int D.23847;
  struct MonoException * D.23850;
  struct MonoReflectionAssembly * D.23851;
  char * D.23854;
  unsigned int D.23855;
  int D.23856;
  struct MonoException * D.23859;
  struct MonoObject * * D.23860;
  struct MonoAssembly * ass;
  struct MonoReflectionAssembly * refass;
  struct MonoDomain * domain;
  MonoImageOpenStatus status;
  guint32 raw_assembly_len;
  struct MonoImage * image;

  try
    {
      refass = 0B;
      domain = ad->data;
      raw_assembly_len = mono_array_length (raw_assembly);
      D.23846 = mono_array_addr_with_size (raw_assembly, 1, 0);
      D.23847 = (int) refonly;
      image = mono_image_open_from_data_full (D.23846, raw_assembly_len, 1, 0B, D.23847);
      if (image == 0B) goto <D.23848>; else goto <D.23849>;
      <D.23848>:
      D.23850 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.23850);
      D.23851 = 0B;
      return D.23851;
      <D.23849>:
      if (raw_symbol_store != 0B) goto <D.23852>; else goto <D.23853>;
      <D.23852>:
      D.23854 = mono_array_addr_with_size (raw_symbol_store, 1, 0);
      D.23855 = mono_array_length (raw_symbol_store);
      D.23856 = (int) D.23855;
      mono_debug_open_image_from_memory (image, D.23854, D.23856);
      <D.23853>:
      D.23847 = (int) refonly;
      ass = mono_assembly_load_from_full (image, "", &status, D.23847);
      if (ass == 0B) goto <D.23857>; else goto <D.23858>;
      <D.23857>:
      mono_image_close (image);
      D.23859 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.23859);
      D.23851 = 0B;
      return D.23851;
      <D.23858>:
      refass = mono_assembly_get_object (domain, ass);
      D.23860 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.23860, evidence);
      D.23851 = refass;
      return D.23851;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssembly (struct MonoAppDomain * ad, struct MonoString * assRef, struct MonoObject * evidence, MonoBoolean refOnly)
{
  _Bool D.23863;
  long int D.23864;
  long int D.23865;
  int D.23872;
  struct MonoReflectionAssembly * D.23873;
  struct MonoObject * * D.23883;
  struct MonoDomain * domain;
  MonoImageOpenStatus status;
  struct MonoAssembly * ass;
  struct MonoAssemblyName aname;
  struct MonoReflectionAssembly * refass;
  gchar * name;
  gboolean parsed;

  try
    {
      domain = ad->data;
      status = 0;
      refass = 0B;
      D.23863 = assRef == 0B;
      D.23864 = (long int) D.23863;
      D.23865 = __builtin_expect (D.23864, 0);
      if (D.23865 != 0) goto <D.23866>; else goto <D.23867>;
      <D.23866>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1951, "assRef != NULL");
      <D.23867>:
      name = mono_string_to_utf8 (assRef);
      parsed = mono_assembly_name_parse (name, &aname);
      monoeg_g_free (name);
      if (parsed == 0) goto <D.23868>; else goto <D.23869>;
      <D.23868>:
      if (refOnly == 0) goto <D.23870>; else goto <D.23871>;
      <D.23870>:
      D.23872 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.23872);
      <D.23871>:
      D.23873 = refass;
      return D.23873;
      <D.23869>:
      D.23872 = (int) refOnly;
      ass = mono_assembly_load_full_nosearch (&aname, 0B, &status, D.23872);
      mono_assembly_name_free (&aname);
      if (ass == 0B) goto <D.23874>; else goto <D.23875>;
      <D.23874>:
      if (refOnly == 0) goto <D.23876>; else goto <D.23877>;
      <D.23876>:
      D.23872 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.23872);
      goto <D.23878>;
      <D.23877>:
      refass = 0B;
      <D.23878>:
      if (refass == 0B) goto <D.23879>; else goto <D.23880>;
      <D.23879>:
      D.23873 = 0B;
      return D.23873;
      <D.23880>:
      <D.23875>:
      if (refass == 0B) goto <D.23881>; else goto <D.23882>;
      <D.23881>:
      refass = mono_assembly_get_object (domain, ass);
      <D.23882>:
      D.23883 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.23883, evidence);
      D.23873 = refass;
      return D.23873;
    }
  finally
    {
      status = {CLOBBER};
      aname = {CLOBBER};
    }
}


ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
  struct MonoDomain * D.23888;
  struct MonoException * D.23891;
  const gchar * D.23892;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.23886>; else goto <D.23887>;
  <D.23886>:
  {
    struct MonoException * exc;

    exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
    mono_raise_exception (exc);
  }
  <D.23887>:
  D.23888 = mono_get_root_domain ();
  if (D.23888 == domain) goto <D.23889>; else goto <D.23890>;
  <D.23889>:
  D.23891 = mono_get_exception_cannot_unload_appdomain ("The default appdomain can not be unloaded.");
  mono_raise_exception (D.23891);
  return;
  <D.23890>:
  D.23892 = monoeg_g_getenv ("MONO_NO_UNLOAD");
  if (D.23892 != 0B) goto <D.23893>; else goto <D.23894>;
  <D.23893>:
  return;
  <D.23894>:
  mono_domain_unload (domain);
}


ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id)
{
  gboolean D.23898;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.23896>; else goto <D.23897>;
  <D.23896>:
  D.23898 = 1;
  return D.23898;
  <D.23897>:
  D.23898 = mono_domain_is_unloading (domain);
  return D.23898;
}


ves_icall_System_AppDomain_ExecuteAssembly (struct MonoAppDomain * ad, struct MonoReflectionAssembly * refass, struct MonoArray * args)
{
  _Bool D.23900;
  long int D.23901;
  long int D.23902;
  struct MonoAssembly * D.23905;
  _Bool D.23906;
  long int D.23907;
  long int D.23908;
  unsigned int D.23911;
  char * D.23914;
  struct MonoDomain * D.23917;
  struct MonoClass * D.23918;
  gint32 D.23919;
  struct MonoImage * image;
  struct MonoMethod * method;

  D.23900 = refass == 0B;
  D.23901 = (long int) D.23900;
  D.23902 = __builtin_expect (D.23901, 0);
  if (D.23902 != 0) goto <D.23903>; else goto <D.23904>;
  <D.23903>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2035, "refass");
  <D.23904>:
  D.23905 = refass->assembly;
  image = D.23905->image;
  D.23906 = image == 0B;
  D.23907 = (long int) D.23906;
  D.23908 = __builtin_expect (D.23907, 0);
  if (D.23908 != 0) goto <D.23909>; else goto <D.23910>;
  <D.23909>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2037, "image");
  <D.23910>:
  D.23911 = mono_image_get_entry_point (image);
  method = mono_get_method (image, D.23911, 0B);
  if (method == 0B) goto <D.23912>; else goto <D.23913>;
  <D.23912>:
  D.23914 = image->name;
  monoeg_g_log (0B, 4, "No entry point method found in %s", D.23914);
  <D.22099>:
  goto <D.22099>;
  <D.23913>:
  if (args == 0B) goto <D.23915>; else goto <D.23916>;
  <D.23915>:
  D.23917 = ad->data;
  D.23918 = mono_defaults.string_class;
  args = mono_array_new (D.23917, D.23918, 0);
  <D.23916>:
  D.23919 = mono_runtime_exec_main (method, args, 0B);
  return D.23919;
}


ves_icall_System_AppDomain_GetIDFromDomain (struct MonoAppDomain * ad)
{
  gint32 D.23921;
  struct MonoDomain * D.23922;

  D.23922 = ad->data;
  D.23921 = D.23922->domain_id;
  return D.23921;
}


ves_icall_System_AppDomain_InternalSetDomain (struct MonoAppDomain * ad)
{
  struct MonoDomain * D.23924;
  int D.23925;
  struct MonoException * D.23928;
  struct MonoAppDomain * D.23929;
  struct MonoDomain * old_domain;

  old_domain = mono_domain_get ();
  D.23924 = ad->data;
  D.23925 = mono_domain_set (D.23924, 0);
  if (D.23925 == 0) goto <D.23926>; else goto <D.23927>;
  <D.23926>:
  D.23928 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.23928);
  <D.23927>:
  D.23929 = old_domain->domain;
  return D.23929;
}


ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid)
{
  int D.23934;
  struct MonoException * D.23935;
  struct MonoAppDomain * D.23936;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (domainid);
  if (domain == 0B) goto <D.23931>; else goto <D.23933>;
  <D.23933>:
  D.23934 = mono_domain_set (domain, 0);
  if (D.23934 == 0) goto <D.23931>; else goto <D.23932>;
  <D.23931>:
  D.23935 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.23935);
  <D.23932>:
  D.23936 = current_domain->domain;
  return D.23936;
}


ves_icall_System_AppDomain_InternalPushDomainRef (struct MonoAppDomain * ad)
{
  struct MonoDomain * D.23938;

  D.23938 = ad->data;
  mono_thread_push_appdomain_ref (D.23938);
}


ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id)
{
  struct MonoException * D.23941;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.23939>; else goto <D.23940>;
  <D.23939>:
  D.23941 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.23941);
  <D.23940>:
  mono_thread_push_appdomain_ref (domain);
}


ves_icall_System_AppDomain_InternalPopDomainRef ()
{
  mono_thread_pop_appdomain_ref ();
}


ves_icall_System_AppDomain_InternalGetContext ()
{
  struct MonoAppContext * D.23942;

  D.23942 = mono_context_get ();
  return D.23942;
}


ves_icall_System_AppDomain_InternalGetDefaultContext ()
{
  struct MonoAppContext * D.23944;
  struct MonoDomain * D.23945;

  D.23945 = mono_domain_get ();
  D.23944 = D.23945->default_context;
  return D.23944;
}


ves_icall_System_AppDomain_InternalSetContext (struct MonoAppContext * mc)
{
  struct MonoAppContext * D.23947;
  struct MonoAppContext * old_context;

  old_context = mono_context_get ();
  mono_context_set (mc);
  D.23947 = old_context;
  return D.23947;
}


ves_icall_System_AppDomain_InternalGetProcessGuid (struct MonoString * newguid)
{
  union mono_mutex_t * D.23949;
  _Bool D.23952;
  long int D.23953;
  long int D.23954;
  int process_guid_set.56;
  _Bool D.23962;
  long int D.23963;
  long int D.23964;
  struct MonoString * D.23967;
  struct MonoDomain * D.23968;
  mono_unichar2 * D.23969;
  _Bool D.23972;
  long int D.23973;
  long int D.23974;
  struct MonoDomain * mono_root_domain;

  mono_root_domain = mono_get_root_domain ();
  {
    int ret;

    D.23949 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_lock (D.23949);
    if (ret != 0) goto <D.23950>; else goto <D.23951>;
    <D.23950>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23951>:
    D.23952 = ret != 0;
    D.23953 = (long int) D.23952;
    D.23954 = __builtin_expect (D.23953, 0);
    if (D.23954 != 0) goto <D.23955>; else goto <D.23956>;
    <D.23955>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2150, "ret == 0");
    <D.23956>:
  }
  process_guid_set.56 = process_guid_set;
  if (process_guid_set.56 != 0) goto <D.23958>; else goto <D.23959>;
  <D.23958>:
  {
    int ret;

    D.23949 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.23949);
    if (ret != 0) goto <D.23960>; else goto <D.23961>;
    <D.23960>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23961>:
    D.23962 = ret != 0;
    D.23963 = (long int) D.23962;
    D.23964 = __builtin_expect (D.23963, 0);
    if (D.23964 != 0) goto <D.23965>; else goto <D.23966>;
    <D.23965>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2152, "ret == 0");
    <D.23966>:
  }
  D.23968 = mono_domain_get ();
  D.23967 = mono_string_new_utf16 (D.23968, &process_guid, 36);
  return D.23967;
  <D.23959>:
  D.23969 = mono_string_chars (newguid);
  memcpy (&process_guid, D.23969, 72);
  process_guid_set = 1;
  {
    int ret;

    D.23949 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.23949);
    if (ret != 0) goto <D.23970>; else goto <D.23971>;
    <D.23970>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23971>:
    D.23972 = ret != 0;
    D.23973 = (long int) D.23972;
    D.23974 = __builtin_expect (D.23973, 0);
    if (D.23974 != 0) goto <D.23975>; else goto <D.23976>;
    <D.23975>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2157, "ret == 0");
    <D.23976>:
  }
  D.23967 = newguid;
  return D.23967;
}


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

  D.23979 = __builtin_object_size (__dest, 0);
  D.23978 = __builtin___memcpy_chk (__dest, __src, __len, D.23979);
  return D.23978;
}


mono_domain_is_unloading (struct MonoDomain * domain)
{
  unsigned int D.23981;
  unsigned int D.23982;
  mono_bool D.23985;

  D.23981 = domain->state;
  D.23982 = D.23981 + 4294967294;
  if (D.23982 <= 1) goto <D.23983>; else goto <D.23984>;
  <D.23983>:
  D.23985 = 1;
  return D.23985;
  <D.23984>:
  D.23985 = 0;
  return D.23985;
}


mono_domain_unload (struct MonoDomain * domain)
{
  struct MonoObject * exc.57;
  struct MonoObject * exc;

  try
    {
      exc = 0B;
      mono_domain_try_unload (domain, &exc);
      exc.57 = exc;
      if (exc.57 != 0B) goto <D.23988>; else goto <D.23989>;
      <D.23988>:
      exc.57 = exc;
      mono_raise_exception (exc.57);
      <D.23989>:
    }
  finally
    {
      exc = {CLOBBER};
    }
}


mono_domain_try_unload (struct MonoDomain * domain, struct MonoObject * * exc)
{
  guint32 * D.23990;
  int D.23991;
  struct MonoException * D.23994;
  struct MonoException * D.23995;
  struct MonoAppDomain * D.23996;
  struct MonoVTable * D.23997;
  struct MonoClass * D.23998;
  _Bool D.23999;
  long int D.24000;
  long int D.24001;
  struct MonoObject * D.24004;
  struct MonoInternalThread * D.24009;
  int D.24010;
  int D.24013;
  int D.24016;
  unsigned int D.24018;
  char * D.24019;
  struct MonoException * D.24022;
  void * thread_handle;
  MonoAppDomainState prev_state;
  struct MonoMethod * method;
  struct unload_data * thread_data;
  struct MonoDomain * caller_domain;

  caller_domain = mono_domain_get ();
  D.23990 = &domain->state;
  D.23991 = InterlockedCompareExchange (D.23990, 1, 0);
  prev_state = (MonoAppDomainState) D.23991;
  if (prev_state != 0) goto <D.23992>; else goto <D.23993>;
  <D.23992>:
  switch (prev_state) <default: <D.22221>, case 1: <D.22218>, case 2: <D.22219>, case 3: <D.22220>>
  <D.22218>:
  <D.22219>:
  D.23994 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded.");
  *exc = D.23994;
  return;
  <D.22220>:
  D.23995 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded.");
  *exc = D.23995;
  return;
  <D.22221>:
  monoeg_g_log (0B, 16, "Invalid appdomain state %d", prev_state);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "appdomain.c", 2409);
  <D.23993>:
  mono_domain_set (domain, 0);
  D.23996 = domain->domain;
  D.23997 = D.23996->mbr.obj.vtable;
  D.23998 = D.23997->klass;
  method = mono_class_get_method_from_name (D.23998, "DoDomainUnload", -1);
  D.23999 = method == 0B;
  D.24000 = (long int) D.23999;
  D.24001 = __builtin_expect (D.24000, 0);
  if (D.24001 != 0) goto <D.24002>; else goto <D.24003>;
  <D.24002>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2416, "method");
  <D.24003>:
  D.23996 = domain->domain;
  mono_runtime_invoke (method, D.23996, 0B, exc);
  D.24004 = *exc;
  if (D.24004 != 0B) goto <D.24005>; else goto <D.24006>;
  <D.24005>:
  domain->state = 0;
  mono_domain_set (caller_domain, 0);
  return;
  <D.24006>:
  mono_domain_set (caller_domain, 0);
  thread_data = monoeg_malloc0 (16);
  thread_data->domain = domain;
  thread_data->failure_reason = 0B;
  thread_data->done = 0;
  thread_data->refcount = 2;
  domain->state = 2;
  thread_handle = mono_threads_create_thread (unload_thread_main, thread_data, 0, 4, 0B);
  if (thread_handle == 0B) goto <D.24007>; else goto <D.24008>;
  <D.24007>:
  return;
  <D.24008>:
  ResumeThread (thread_handle);
  goto <D.22223>;
  <D.22222>:
  D.24009 = mono_thread_internal_current ();
  D.24010 = mono_thread_internal_has_appdomain_ref (D.24009, domain);
  if (D.24010 != 0) goto <D.24011>; else goto <D.24012>;
  <D.24011>:
  D.24013 = mono_thread_interruption_requested ();
  if (D.24013 != 0) goto <D.24014>; else goto <D.24015>;
  <D.24014>:
  CloseHandle (thread_handle);
  unload_data_unref (thread_data);
  return;
  <D.24015>:
  <D.24012>:
  <D.22223>:
  D.24016 = thread_data->done;
  if (D.24016 == 0) goto <D.24017>; else goto <D.22224>;
  <D.24017>:
  D.24018 = WaitForSingleObjectEx (thread_handle, 4294967295, 1);
  if (D.24018 == 192) goto <D.22222>; else goto <D.22224>;
  <D.22224>:
  CloseHandle (thread_handle);
  D.24019 = thread_data->failure_reason;
  if (D.24019 != 0B) goto <D.24020>; else goto <D.24021>;
  <D.24020>:
  domain->state = 0;
  D.24019 = thread_data->failure_reason;
  monoeg_g_log (0B, 16, "%s", D.24019);
  D.24019 = thread_data->failure_reason;
  D.24022 = mono_get_exception_cannot_unload_appdomain (D.24019);
  *exc = D.24022;
  D.24019 = thread_data->failure_reason;
  monoeg_g_free (D.24019);
  thread_data->failure_reason = 0B;
  <D.24021>:
  unload_data_unref (thread_data);
}


unload_thread_main (void * arg)
{
  struct MonoDomain * D.24024;
  int D.24025;
  char * D.24028;
  gchar * D.24029;
  int D.24030;
  gchar * D.24033;
  int D.24034;
  gchar * D.24037;
  union mono_mutex_t * D.24038;
  _Bool D.24041;
  long int D.24042;
  long int D.24043;
  struct GPtrArray * D.24046;
  void * * D.24047;
  unsigned int i.58;
  unsigned int D.24049;
  void * * D.24050;
  void * D.24051;
  unsigned int i.59;
  unsigned int D.24053;
  int D.24054;
  unsigned int D.24055;
  _Bool D.24058;
  long int D.24059;
  long int D.24060;
  int D.24063;
  guint32 D.24064;
  struct unload_data * data;
  struct MonoDomain * domain;
  struct MonoThread * thread;
  int i;
  void failure = <<< error >>>;

  data = arg;
  domain = data->domain;
  D.24024 = mono_get_root_domain ();
  thread = mono_thread_attach_full (D.24024, 1);
  D.24025 = mono_threads_abort_appdomain_threads (domain, -1);
  if (D.24025 == 0) goto <D.24026>; else goto <D.24027>;
  <D.24026>:
  D.24028 = domain->friendly_name;
  D.24029 = monoeg_g_strdup_printf ("Aborting of threads in domain %s timed out.", D.24028);
  data->failure_reason = D.24029;
  goto failure;
  <D.24027>:
  D.24030 = mono_thread_pool_remove_domain_jobs (domain, -1);
  if (D.24030 == 0) goto <D.24031>; else goto <D.24032>;
  <D.24031>:
  D.24028 = domain->friendly_name;
  D.24033 = monoeg_g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", D.24028);
  data->failure_reason = D.24033;
  goto failure;
  <D.24032>:
  D.24034 = mono_domain_finalize (domain, 4294967295);
  if (D.24034 == 0) goto <D.24035>; else goto <D.24036>;
  <D.24035>:
  D.24028 = domain->friendly_name;
  D.24037 = monoeg_g_strdup_printf ("Finalization of domain %s timed out.", D.24028);
  data->failure_reason = D.24037;
  goto failure;
  <D.24036>:
  mono_loader_lock ();
  {
    int ret;

    D.24038 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.24038);
    if (ret != 0) goto <D.24039>; else goto <D.24040>;
    <D.24039>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24040>:
    D.24041 = ret != 0;
    D.24042 = (long int) D.24041;
    D.24043 = __builtin_expect (D.24042, 0);
    if (D.24043 != 0) goto <D.24044>; else goto <D.24045>;
    <D.24044>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2299, "ret == 0");
    <D.24045>:
  }
  i = 0;
  goto <D.22199>;
  <D.22198>:
  D.24046 = domain->class_vtable_array;
  D.24047 = D.24046->pdata;
  i.58 = (unsigned int) i;
  D.24049 = i.58 * 4;
  D.24050 = D.24047 + D.24049;
  D.24051 = *D.24050;
  zero_static_data (D.24051);
  i = i + 1;
  <D.22199>:
  i.59 = (unsigned int) i;
  D.24046 = domain->class_vtable_array;
  D.24053 = D.24046->len;
  if (i.59 < D.24053) goto <D.22198>; else goto <D.22200>;
  <D.22200>:
  mono_gc_collect (0);
  i = 0;
  goto <D.22202>;
  <D.22201>:
  D.24046 = domain->class_vtable_array;
  D.24047 = D.24046->pdata;
  i.58 = (unsigned int) i;
  D.24049 = i.58 * 4;
  D.24050 = D.24047 + D.24049;
  D.24051 = *D.24050;
  clear_cached_vtable (D.24051);
  i = i + 1;
  <D.22202>:
  i.59 = (unsigned int) i;
  D.24046 = domain->class_vtable_array;
  D.24053 = D.24046->len;
  if (i.59 < D.24053) goto <D.22201>; else goto <D.22203>;
  <D.22203>:
  deregister_reflection_info_roots (domain);
  D.24054 = domain->domain_id;
  D.24055 = (unsigned int) D.24054;
  mono_assembly_cleanup_domain_bindings (D.24055);
  {
    int ret;

    D.24038 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.24038);
    if (ret != 0) goto <D.24056>; else goto <D.24057>;
    <D.24056>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24057>:
    D.24058 = ret != 0;
    D.24059 = (long int) D.24058;
    D.24060 = __builtin_expect (D.24059, 0);
    if (D.24060 != 0) goto <D.24061>; else goto <D.24062>;
    <D.24061>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2320, "ret == 0");
    <D.24062>:
  }
  mono_loader_unlock ();
  mono_threads_clear_cached_culture (domain);
  domain->state = 3;
  mono_gchandle_free_domain (domain);
  mono_domain_free (domain, 0);
  D.24063 = mono_gc_max_generation ();
  mono_gc_collect (D.24063);
  mono_memory_barrier ();
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.24064 = 0;
  return D.24064;
  failure:
  mono_memory_barrier ();
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.24064 = 1;
  return D.24064;
}


zero_static_data (struct MonoVTable * vtable)
{
  unsigned char D.24066;
  unsigned char D.24067;
  int D.24072;
  unsigned int D.24073;
  struct MonoClass * klass;
  void * data;

  klass = vtable->klass;
  D.24066 = BIT_FIELD_REF <*klass, 8, 184>;
  D.24067 = D.24066 & 16;
  if (D.24067 != 0) goto <D.24068>; else goto <D.24069>;
  <D.24068>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.24070>; else goto <D.24071>;
  <D.24070>:
  D.24072 = mono_class_data_size (klass);
  D.24073 = (unsigned int) D.24072;
  mono_gc_bzero_aligned (data, D.24073);
  <D.24071>:
  <D.24069>:
}


clear_cached_vtable (struct MonoVTable * vtable)
{
  short unsigned int D.24076;
  int D.24077;
  int D.24078;
  unsigned char D.24081;
  unsigned char D.24082;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoClassRuntimeInfo * runtime_info;
  void * data;

  klass = vtable->klass;
  domain = vtable->domain;
  runtime_info = klass->runtime_info;
  if (runtime_info != 0B) goto <D.24074>; else goto <D.24075>;
  <D.24074>:
  D.24076 = runtime_info->max_domain;
  D.24077 = (int) D.24076;
  D.24078 = domain->domain_id;
  if (D.24077 >= D.24078) goto <D.24079>; else goto <D.24080>;
  <D.24079>:
  D.24078 = domain->domain_id;
  runtime_info->domain_vtables[D.24078] = 0B;
  <D.24080>:
  <D.24075>:
  D.24081 = BIT_FIELD_REF <*klass, 8, 184>;
  D.24082 = D.24081 & 16;
  if (D.24082 != 0) goto <D.24083>; else goto <D.24084>;
  <D.24083>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.24085>; else goto <D.24086>;
  <D.24085>:
  mono_gc_free_fixed (data);
  <D.24086>:
  <D.24084>:
}


deregister_reflection_info_roots (struct MonoDomain * domain)
{
  union mono_mutex_t * D.24087;
  _Bool D.24090;
  long int D.24091;
  long int D.24092;
  unsigned char D.24095;
  unsigned char D.24096;
  struct MonoImage * * D.24099;
  unsigned int i.60;
  unsigned int D.24101;
  struct MonoImage * * D.24102;
  unsigned char D.24105;
  unsigned char D.24106;
  unsigned int i.61;
  unsigned int D.24110;
  _Bool D.24113;
  long int D.24114;
  long int D.24115;
  struct GSList * list;

  {
    int ret;

    D.24087 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.24087);
    if (ret != 0) goto <D.24088>; else goto <D.24089>;
    <D.24088>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24089>:
    D.24090 = ret != 0;
    D.24091 = (long int) D.24090;
    D.24092 = __builtin_expect (D.24091, 0);
    if (D.24092 != 0) goto <D.24093>; else goto <D.24094>;
    <D.24093>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2237, "ret == 0");
    <D.24094>:
  }
  list = domain->domain_assemblies;
  goto <D.22186>;
  <D.22185>:
  {
    struct MonoAssembly * assembly;
    struct MonoImage * image;
    int i;

    assembly = list->data;
    image = assembly->image;
    D.24095 = BIT_FIELD_REF <*image, 8, 128>;
    D.24096 = D.24095 & 8;
    if (D.24096 != 0) goto <D.24097>; else goto <D.24098>;
    <D.24097>:
    deregister_reflection_info_roots_from_list (image);
    <D.24098>:
    i = 0;
    goto <D.22183>;
    <D.22182>:
    {
      struct MonoImage * module;

      D.24099 = image->modules;
      i.60 = (unsigned int) i;
      D.24101 = i.60 * 4;
      D.24102 = D.24099 + D.24101;
      module = *D.24102;
      if (module != 0B) goto <D.24103>; else goto <D.24104>;
      <D.24103>:
      D.24105 = BIT_FIELD_REF <*module, 8, 128>;
      D.24106 = D.24105 & 8;
      if (D.24106 != 0) goto <D.24107>; else goto <D.24108>;
      <D.24107>:
      deregister_reflection_info_roots_from_list (module);
      <D.24108>:
      <D.24104>:
    }
    i = i + 1;
    <D.22183>:
    i.61 = (unsigned int) i;
    D.24110 = image->module_count;
    if (i.61 < D.24110) goto <D.22182>; else goto <D.22184>;
    <D.22184>:
  }
  list = list->next;
  <D.22186>:
  if (list != 0B) goto <D.22185>; else goto <D.22187>;
  <D.22187>:
  {
    int ret;

    D.24087 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.24087);
    if (ret != 0) goto <D.24111>; else goto <D.24112>;
    <D.24111>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24112>:
    D.24113 = ret != 0;
    D.24114 = (long int) D.24113;
    D.24115 = __builtin_expect (D.24114, 0);
    if (D.24115 != 0) goto <D.24116>; else goto <D.24117>;
    <D.24116>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2258, "ret == 0");
    <D.24117>:
  }
}


deregister_reflection_info_roots_from_list (struct MonoImage * image)
{
  struct GSList * list;

  list = image->reflection_info_unregister_classes;
  goto <D.22171>;
  <D.22170>:
  {
    struct MonoClass * class;

    class = list->data;
    mono_class_free_ref_info (class);
    list = list->next;
  }
  <D.22171>:
  if (list != 0B) goto <D.22170>; else goto <D.22172>;
  <D.22172>:
  image->reflection_info_unregister_classes = 0B;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


InterlockedCompareExchange (volatile gint32 * dest, gint32 exch, gint32 comp)
{
  gint32 D.24118;
  unsigned int comp.62;
  unsigned int exch.63;
  unsigned int D.24121;

  comp.62 = (unsigned int) comp;
  exch.63 = (unsigned int) exch;
  D.24121 = __sync_val_compare_and_swap_4 (dest, comp.62, exch.63);
  D.24118 = (gint32) D.24121;
  return D.24118;
}


unload_data_unref (struct unload_data * data)
{
  unsigned int count.64;
  unsigned int D.24124;
  _Bool D.24125;
  long int D.24126;
  long int D.24127;
  gint32 * D.24132;
  int D.24133;
  int D.24134;
  gint32 count;

  <D.22163>:
  {
    gint32 __tmp;

    __tmp = data->refcount;
    mono_memory_barrier ();
    count = __tmp;
  }
  count.64 = (unsigned int) count;
  D.24124 = count.64 + 4294967295;
  D.24125 = D.24124 > 1;
  D.24126 = (long int) D.24125;
  D.24127 = __builtin_expect (D.24126, 0);
  if (D.24127 != 0) goto <D.24128>; else goto <D.24129>;
  <D.24128>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2208, "count >= 1 && count <= 2");
  <D.24129>:
  if (count == 1) goto <D.24130>; else goto <D.24131>;
  <D.24130>:
  monoeg_g_free (data);
  return;
  <D.24131>:
  D.24132 = &data->refcount;
  D.24133 = count + -1;
  D.24134 = InterlockedCompareExchange (D.24132, count, D.24133);
  if (D.24134 != count) goto <D.22163>; else goto <D.22164>;
  <D.22164>:
}


