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 * (*<T1c61>) (const char *, const char *) load_function.0;
  _Bool D.20026;
  long int D.20027;
  long int D.20028;
  struct MonoDomain * D.20031;

  load_function.0 = load_function;
  D.20026 = load_function.0 == 0B;
  D.20027 = (long int) D.20026;
  D.20028 = __builtin_expect (D.20027, 0);
  if (D.20028 != 0) goto <D.20029>; else goto <D.20030>;
  <D.20029>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 136, "load_function");
  <D.20030>:
  load_function.0 = load_function;
  D.20031 = load_function.0 (filename, runtime_version);
  return D.20031;
}


mono_runtime_set_no_exec (gboolean val)
{
  no_exec = val;
}


mono_runtime_get_no_exec ()
{
  gboolean D.20033;

  D.20033 = no_exec;
  return D.20033;
}


mono_runtime_init (struct MonoDomain * domain, void (*MonoThreadStartCB) (intptr_t, void *, void *) start_cb, void (*MonoThreadAttachCB) (intptr_t, void *) attach_cb)
{
  struct MonoImage * D.20035;
  struct MonoAppContext * D.20036;
  int D.20037;
  struct MonoAssembly * D.20040;
  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.20035 = mono_defaults.corlib;
  class = mono_class_from_name (D.20035, "System", "AppDomainSetup");
  setup = mono_object_new (domain, class);
  D.20035 = mono_defaults.corlib;
  class = mono_class_from_name (D.20035, "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.20036 = domain->default_context;
  mono_context_set (D.20036);
  mono_type_initialization_init ();
  D.20037 = mono_runtime_get_no_exec ();
  if (D.20037 == 0) goto <D.20038>; else goto <D.20039>;
  <D.20038>:
  create_domain_objects (domain);
  <D.20039>:
  mono_gc_init ();
  mono_network_init ();
  mono_console_init ();
  mono_attach_init ();
  D.20035 = mono_defaults.corlib;
  D.20040 = D.20035->assembly;
  mono_domain_fire_assembly_load (D.20040, 0B);
  return;
}


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

  user_data.1 = (long int) user_data;
  refonly = (gboolean) user_data.1;
  domain = mono_domain_get ();
  aname_str = mono_stringify_assembly_name (aname);
  str = mono_string_new (domain, aname_str);
  if (str == 0B) goto <D.20043>; else goto <D.20044>;
  <D.20043>:
  monoeg_g_free (aname_str);
  D.20045 = 0B;
  return D.20045;
  <D.20044>:
  assembly = mono_try_assembly_resolve (domain, str, refonly);
  monoeg_g_free (aname_str);
  if (assembly != 0B) goto <D.20046>; else goto <D.20047>;
  <D.20046>:
  D.20045 = assembly->assembly;
  return D.20045;
  <D.20047>:
  D.20045 = 0B;
  return D.20045;
}


mono_domain_assembly_search (struct MonoAssemblyName * aname, void * user_data)
{
  long int user_data.2;
  union mono_mutex_t * D.20050;
  _Bool D.20053;
  long int D.20054;
  long int D.20055;
  unsigned char D.20060;
  int D.20062;
  struct MonoAssemblyName * D.20064;
  int D.20065;
  _Bool D.20068;
  long int D.20069;
  long int D.20070;
  struct MonoAssembly * D.20073;
  _Bool D.20076;
  long int D.20077;
  long int D.20078;
  struct MonoDomain * domain;
  struct GSList * tmp;
  struct MonoAssembly * ass;
  gboolean refonly;

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

    D.20050 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.20050);
    if (ret != 0) goto <D.20051>; else goto <D.20052>;
    <D.20051>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20052>:
    D.20053 = ret != 0;
    D.20054 = (long int) D.20053;
    D.20055 = __builtin_expect (D.20054, 0);
    if (D.20055 != 0) goto <D.20056>; else goto <D.20057>;
    <D.20056>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1853, "ret == 0");
    <D.20057>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19842>;
  <D.19841>:
  ass = tmp->data;
  D.20060 = ass->dynamic;
  if (D.20060 != 0) goto <D.20058>; else goto <D.20061>;
  <D.20061>:
  D.20062 = ass->ref_only;
  if (D.20062 != refonly) goto <D.20058>; else goto <D.20063>;
  <D.20063>:
  D.20064 = &ass->aname;
  D.20065 = mono_assembly_names_equal (aname, D.20064);
  if (D.20065 == 0) goto <D.20058>; else goto <D.20059>;
  <D.20058>:
  // predicted unlikely by continue predictor.
  goto <D.19839>;
  <D.20059>:
  {
    int ret;

    D.20050 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.20050);
    if (ret != 0) goto <D.20066>; else goto <D.20067>;
    <D.20066>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20067>:
    D.20068 = ret != 0;
    D.20069 = (long int) D.20068;
    D.20070 = __builtin_expect (D.20069, 0);
    if (D.20070 != 0) goto <D.20071>; else goto <D.20072>;
    <D.20071>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1860, "ret == 0");
    <D.20072>:
  }
  D.20073 = ass;
  return D.20073;
  <D.19839>:
  tmp = tmp->next;
  <D.19842>:
  if (tmp != 0B) goto <D.19841>; else goto <D.19843>;
  <D.19843>:
  {
    int ret;

    D.20050 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.20050);
    if (ret != 0) goto <D.20074>; else goto <D.20075>;
    <D.20074>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20075>:
    D.20076 = ret != 0;
    D.20077 = (long int) D.20076;
    D.20078 = __builtin_expect (D.20077, 0);
    if (D.20078 != 0) goto <D.20079>; else goto <D.20080>;
    <D.20079>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1863, "ret == 0");
    <D.20080>:
  }
  D.20073 = 0B;
  return D.20073;
}


mono_domain_assembly_preload (struct MonoAssemblyName * aname, gchar * * assemblies_path, void * user_data)
{
  long int user_data.3;
  gchar * * D.20083;
  gchar * D.20086;
  const char * D.20089;
  const char * D.20090;
  _Bool D.20091;
  _Bool D.20092;
  _Bool D.20093;
  gchar * D.20096;
  struct MonoAssembly * D.20099;
  struct MonoDomain * domain;
  struct MonoAssembly * result;
  gboolean refonly;

  domain = mono_domain_get ();
  result = 0B;
  user_data.3 = (long int) user_data;
  refonly = (gboolean) user_data.3;
  set_domain_search_path (domain);
  D.20083 = domain->search_path;
  if (D.20083 != 0B) goto <D.20084>; else goto <D.20085>;
  <D.20084>:
  D.20083 = domain->search_path;
  D.20086 = *D.20083;
  if (D.20086 != 0B) goto <D.20087>; else goto <D.20088>;
  <D.20087>:
  D.20089 = aname->name;
  D.20090 = aname->culture;
  D.20083 = domain->search_path;
  result = real_load (D.20083, D.20090, D.20089, refonly);
  <D.20088>:
  <D.20085>:
  D.20091 = result == 0B;
  D.20092 = assemblies_path != 0B;
  D.20093 = D.20091 & D.20092;
  if (D.20093 != 0) goto <D.20094>; else goto <D.20095>;
  <D.20094>:
  D.20096 = *assemblies_path;
  if (D.20096 != 0B) goto <D.20097>; else goto <D.20098>;
  <D.20097>:
  D.20089 = aname->name;
  D.20090 = aname->culture;
  result = real_load (assemblies_path, D.20090, D.20089, refonly);
  <D.20098>:
  <D.20095>:
  D.20099 = result;
  return D.20099;
}


set_domain_search_path (struct MonoDomain * domain)
{
  union mono_mutex_t * D.20101;
  _Bool D.20104;
  long int D.20105;
  long int D.20106;
  struct MonoAppDomainSetup * D.20109;
  _Bool D.20114;
  long int D.20115;
  long int D.20116;
  gchar * * D.20119;
  unsigned char D.20122;
  _Bool D.20127;
  long int D.20128;
  long int D.20129;
  struct MonoString * D.20132;
  _Bool D.20137;
  long int D.20138;
  long int D.20139;
  struct MonoString * D.20142;
  int D.20145;
  _Bool D.20150;
  long int D.20151;
  long int D.20152;
  gchar * D.20155;
  long unsigned int D.20163;
  sizetype D.20164;
  gchar * D.20165;
  char D.20166;
  gchar * D.20169;
  _Bool D.20176;
  long int D.20177;
  long int D.20178;
  int D.20183;
  long unsigned int D.20184;
  long unsigned int D.20185;
  long unsigned int D.20186;
  long unsigned int D.20187;
  gchar * * D.20188;
  char * D.20189;
  int D.20190;
  _Bool D.20195;
  long int D.20196;
  long int D.20197;
  int D.20200;
  gchar * D.20203;
  char D.20204;
  gchar * D.20207;
  struct GError * gerror.4;
  gchar * D.20213;
  long unsigned int D.20215;
  long unsigned int D.20216;
  sizetype D.20217;
  gchar * * D.20218;
  gchar * D.20219;
  int D.20220;
  gchar * * D.20223;
  gchar * D.20224;
  gchar * D.20226;
  gchar * D.20227;
  char * D.20228;
  long unsigned int D.20233;
  long unsigned int D.20234;
  int D.20235;
  gchar * D.20238;
  _Bool D.20239;
  _Bool D.20240;
  _Bool D.20241;
  struct MonoString * D.20242;
  gchar * D.20245;
  _Bool D.20248;
  long int D.20249;
  long int D.20250;
  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.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.20101);
        if (ret != 0) goto <D.20102>; else goto <D.20103>;
        <D.20102>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.20103>:
        D.20104 = ret != 0;
        D.20105 = (long int) D.20104;
        D.20106 = __builtin_expect (D.20105, 0);
        if (D.20106 != 0) goto <D.20107>; else goto <D.20108>;
        <D.20107>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1058, "ret == 0");
        <D.20108>:
      }
      D.20109 = domain->setup;
      if (D.20109 == 0B) goto <D.20110>; else goto <D.20111>;
      <D.20110>:
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20112>; else goto <D.20113>;
        <D.20112>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20113>:
        D.20114 = ret != 0;
        D.20115 = (long int) D.20114;
        D.20116 = __builtin_expect (D.20115, 0);
        if (D.20116 != 0) goto <D.20117>; else goto <D.20118>;
        <D.20117>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1061, "ret == 0");
        <D.20118>:
      }
      return;
      <D.20111>:
      D.20119 = domain->search_path;
      if (D.20119 != 0B) goto <D.20120>; else goto <D.20121>;
      <D.20120>:
      D.20109 = domain->setup;
      D.20122 = D.20109->path_changed;
      if (D.20122 == 0) goto <D.20123>; else goto <D.20124>;
      <D.20123>:
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20125>; else goto <D.20126>;
        <D.20125>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20126>:
        D.20127 = ret != 0;
        D.20128 = (long int) D.20127;
        D.20129 = __builtin_expect (D.20128, 0);
        if (D.20129 != 0) goto <D.20130>; else goto <D.20131>;
        <D.20130>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1066, "ret == 0");
        <D.20131>:
      }
      return;
      <D.20124>:
      <D.20121>:
      setup = domain->setup;
      D.20132 = setup->application_base;
      if (D.20132 == 0B) goto <D.20133>; else goto <D.20134>;
      <D.20133>:
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20135>; else goto <D.20136>;
        <D.20135>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20136>:
        D.20137 = ret != 0;
        D.20138 = (long int) D.20137;
        D.20139 = __builtin_expect (D.20138, 0);
        if (D.20139 != 0) goto <D.20140>; else goto <D.20141>;
        <D.20140>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1071, "ret == 0");
        <D.20141>:
      }
      return;
      <D.20134>:
      npaths = npaths + 1;
      D.20142 = setup->private_bin_path;
      if (D.20142 != 0B) goto <D.20143>; else goto <D.20144>;
      <D.20143>:
      D.20142 = setup->private_bin_path;
      search_path = mono_string_to_utf8_checked (D.20142, &error);
      D.20145 = mono_error_ok (&error);
      if (D.20145 == 0) goto <D.20146>; else goto <D.20147>;
      <D.20146>:
      monoeg_g_log (0B, 16, "Could not decode AppDomain search path since it contains invalid characters");
      mono_error_cleanup (&error);
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20148>; else goto <D.20149>;
        <D.20148>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20149>:
        D.20150 = ret != 0;
        D.20151 = (long int) D.20150;
        D.20152 = __builtin_expect (D.20151, 0);
        if (D.20152 != 0) goto <D.20153>; else goto <D.20154>;
        <D.20153>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1082, "ret == 0");
        <D.20154>:
      }
      return;
      <D.20147>:
      <D.20144>:
      D.20155 = domain->private_bin_path;
      if (D.20155 != 0B) goto <D.20156>; else goto <D.20157>;
      <D.20156>:
      if (search_path == 0B) goto <D.20158>; else goto <D.20159>;
      <D.20158>:
      search_path = domain->private_bin_path;
      goto <D.20160>;
      <D.20159>:
      {
        gchar * tmp2;

        tmp2 = search_path;
        D.20155 = domain->private_bin_path;
        search_path = monoeg_g_strjoin (";", search_path, D.20155, 0B);
        monoeg_g_free (tmp2);
      }
      <D.20160>:
      <D.20157>:
      if (search_path != 0B) goto <D.20161>; else goto <D.20162>;
      <D.20161>:
      {
        gint slen;

        D.20163 = strlen (search_path);
        slen = (gint) D.20163;
        i = 0;
        goto <D.19632>;
        <D.19631>:
        D.20164 = (sizetype) i;
        D.20165 = search_path + D.20164;
        D.20166 = *D.20165;
        if (D.20166 == 58) goto <D.20167>; else goto <D.20168>;
        <D.20167>:
        D.20164 = (sizetype) i;
        D.20165 = search_path + D.20164;
        *D.20165 = 59;
        <D.20168>:
        i = i + 1;
        <D.19632>:
        if (i < slen) goto <D.19631>; else goto <D.19633>;
        <D.19633>:
        pvt_split = monoeg_g_strsplit (search_path, ";", 1000);
        monoeg_g_free (search_path);
        tmp = pvt_split;
        goto <D.19635>;
        <D.19634>:
        tmp = tmp + 8;
        npaths = npaths + 1;
        <D.19635>:
        D.20169 = *tmp;
        if (D.20169 != 0B) goto <D.19634>; else goto <D.19636>;
        <D.19636>:
      }
      <D.20162>:
      if (npaths == 0) goto <D.20170>; else goto <D.20171>;
      <D.20170>:
      if (pvt_split != 0B) goto <D.20172>; else goto <D.20173>;
      <D.20172>:
      monoeg_g_strfreev (pvt_split);
      <D.20173>:
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20174>; else goto <D.20175>;
        <D.20174>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20175>:
        D.20176 = ret != 0;
        D.20177 = (long int) D.20176;
        D.20178 = __builtin_expect (D.20177, 0);
        if (D.20178 != 0) goto <D.20179>; else goto <D.20180>;
        <D.20179>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1133, "ret == 0");
        <D.20180>:
      }
      return;
      <D.20171>:
      D.20119 = domain->search_path;
      if (D.20119 != 0B) goto <D.20181>; else goto <D.20182>;
      <D.20181>:
      D.20119 = domain->search_path;
      monoeg_g_strfreev (D.20119);
      <D.20182>:
      D.20183 = npaths + 1;
      D.20184 = (long unsigned int) D.20183;
      D.20185 = D.20184 * 8;
      tmp = monoeg_malloc (D.20185);
      D.20186 = (long unsigned int) npaths;
      D.20187 = D.20186 * 8;
      D.20188 = tmp + D.20187;
      *D.20188 = 0B;
      D.20132 = setup->application_base;
      D.20189 = mono_string_to_utf8_checked (D.20132, &error);
      *tmp = D.20189;
      D.20190 = mono_error_ok (&error);
      if (D.20190 == 0) goto <D.20191>; else goto <D.20192>;
      <D.20191>:
      mono_error_cleanup (&error);
      monoeg_g_strfreev (pvt_split);
      monoeg_g_free (tmp);
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20193>; else goto <D.20194>;
        <D.20193>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20194>:
        D.20195 = ret != 0;
        D.20196 = (long int) D.20195;
        D.20197 = __builtin_expect (D.20196, 0);
        if (D.20197 != 0) goto <D.20198>; else goto <D.20199>;
        <D.20198>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1149, "ret == 0");
        <D.20199>:
      }
      return;
      <D.20192>:
      domain->search_path = tmp;
      D.20169 = *tmp;
      D.20200 = strncmp (D.20169, "file://", 7);
      if (D.20200 == 0) goto <D.20201>; else goto <D.20202>;
      <D.20201>:
      {
        gchar * file;
        gchar * uri;
        gchar * tmpuri;

        file = *tmp;
        uri = *tmp;
        D.20203 = uri + 7;
        D.20204 = *D.20203;
        if (D.20204 != 47) goto <D.20205>; else goto <D.20206>;
        <D.20205>:
        D.20203 = uri + 7;
        uri = monoeg_g_strdup_printf ("file:///%s", D.20203);
        <D.20206>:
        tmpuri = uri;
        uri = mono_escape_uri_string (tmpuri);
        D.20207 = monoeg_g_filename_from_uri (uri, 0B, &gerror);
        *tmp = D.20207;
        monoeg_g_free (uri);
        if (tmpuri != file) goto <D.20208>; else goto <D.20209>;
        <D.20208>:
        monoeg_g_free (tmpuri);
        <D.20209>:
        gerror.4 = gerror;
        if (gerror.4 != 0B) goto <D.20211>; else goto <D.20212>;
        <D.20211>:
        gerror.4 = gerror;
        D.20213 = gerror.4->message;
        monoeg_g_log (0B, 16, "%s\n", D.20213);
        gerror.4 = gerror;
        monoeg_g_error_free (gerror.4);
        *tmp = file;
        goto <D.20214>;
        <D.20212>:
        monoeg_g_free (file);
        <D.20214>:
      }
      <D.20202>:
      i = 1;
      goto <D.19664>;
      <D.19663>:
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20217 = D.20216 + 18446744073709551608;
      D.20218 = pvt_split + D.20217;
      D.20219 = *D.20218;
      D.20220 = monoeg_g_path_is_absolute (D.20219);
      if (D.20220 != 0) goto <D.20221>; else goto <D.20222>;
      <D.20221>:
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20223 = tmp + D.20216;
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20217 = D.20216 + 18446744073709551608;
      D.20218 = pvt_split + D.20217;
      D.20219 = *D.20218;
      D.20224 = monoeg_strdup (D.20219);
      *D.20223 = D.20224;
      goto <D.20225>;
      <D.20222>:
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20223 = tmp + D.20216;
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20217 = D.20216 + 18446744073709551608;
      D.20218 = pvt_split + D.20217;
      D.20219 = *D.20218;
      D.20169 = *tmp;
      D.20226 = monoeg_g_build_path ("/", D.20169, D.20219, 0B);
      *D.20223 = D.20226;
      <D.20225>:
      D.20215 = (long unsigned int) i;
      D.20216 = D.20215 * 8;
      D.20223 = tmp + D.20216;
      D.20227 = *D.20223;
      D.20228 = __builtin_strchr (D.20227, 46);
      if (D.20228 != 0B) goto <D.20229>; else goto <D.20230>;
      <D.20229>:
      {
        gchar * reduced;
        gchar * freeme;

        D.20215 = (long unsigned int) i;
        D.20216 = D.20215 * 8;
        D.20223 = tmp + D.20216;
        D.20227 = *D.20223;
        reduced = mono_path_canonicalize (D.20227);
        if (appbaselen == -1) goto <D.20231>; else goto <D.20232>;
        <D.20231>:
        D.20169 = *tmp;
        D.20233 = strlen (D.20169);
        appbaselen = (gint) D.20233;
        <D.20232>:
        D.20234 = (long unsigned int) appbaselen;
        D.20169 = *tmp;
        D.20235 = strncmp (D.20169, reduced, D.20234);
        if (D.20235 != 0) goto <D.20236>; else goto <D.20237>;
        <D.20236>:
        monoeg_g_free (reduced);
        D.20215 = (long unsigned int) i;
        D.20216 = D.20215 * 8;
        D.20223 = tmp + D.20216;
        D.20227 = *D.20223;
        monoeg_g_free (D.20227);
        D.20215 = (long unsigned int) i;
        D.20216 = D.20215 * 8;
        D.20223 = tmp + D.20216;
        D.20238 = monoeg_strdup ("");
        *D.20223 = D.20238;
        // predicted unlikely by continue predictor.
        goto <D.19662>;
        <D.20237>:
        D.20215 = (long unsigned int) i;
        D.20216 = D.20215 * 8;
        D.20223 = tmp + D.20216;
        freeme = *D.20223;
        D.20215 = (long unsigned int) i;
        D.20216 = D.20215 * 8;
        D.20223 = tmp + D.20216;
        *D.20223 = reduced;
        monoeg_g_free (freeme);
      }
      <D.20230>:
      <D.19662>:
      i = i + 1;
      <D.19664>:
      D.20239 = pvt_split != 0B;
      D.20240 = i < npaths;
      D.20241 = D.20239 & D.20240;
      if (D.20241 != 0) goto <D.19663>; else goto <D.19665>;
      <D.19665>:
      D.20242 = setup->private_bin_path_probe;
      if (D.20242 != 0B) goto <D.20243>; else goto <D.20244>;
      <D.20243>:
      D.20169 = *tmp;
      monoeg_g_free (D.20169);
      D.20245 = monoeg_strdup ("");
      *tmp = D.20245;
      <D.20244>:
      D.20109 = domain->setup;
      D.20109->path_changed = 0;
      monoeg_g_strfreev (pvt_split);
      {
        int ret;

        D.20101 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20101);
        if (ret != 0) goto <D.20246>; else goto <D.20247>;
        <D.20246>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20247>:
        D.20248 = ret != 0;
        D.20249 = (long int) D.20248;
        D.20250 = __builtin_expect (D.20249, 0);
        if (D.20250 != 0) goto <D.20251>; else goto <D.20252>;
        <D.20251>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1218, "ret == 0");
        <D.20252>:
      }
    }
  finally
    {
      error = {CLOBBER};
      gerror = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.20256>; else goto <D.20257>;
  <D.20256>:
  D.20258 = __strdup (str);
  return D.20258;
  <D.20257>:
  D.20258 = 0B;
  return D.20258;
}


real_load (gchar * * search_path, const gchar * culture, const gchar * name, gboolean refonly)
{
  char D.20264;
  long unsigned int D.20265;
  gchar * D.20266;
  char D.20267;
  sizetype D.20270;
  sizetype D.20271;
  gchar * D.20272;
  int D.20273;
  int D.20275;
  int D.20277;
  int D.20279;
  struct MonoAssembly * D.20281;
  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.20260>; else goto <D.20263>;
      <D.20263>:
      D.20264 = *culture;
      if (D.20264 == 0) goto <D.20260>; else goto <D.20261>;
      <D.20260>:
      local_culture = "";
      goto <D.20262>;
      <D.20261>:
      local_culture = culture;
      <D.20262>:
      filename = monoeg_g_strconcat (name, ".dll", 0B);
      D.20265 = strlen (filename);
      len = (gint) D.20265;
      path = search_path;
      goto <D.19821>;
      <D.19820>:
      D.20266 = *path;
      D.20267 = *D.20266;
      if (D.20267 == 0) goto <D.20268>; else goto <D.20269>;
      <D.20268>:
      is_private = 1;
      // predicted unlikely by continue predictor.
      goto <D.19818>;
      <D.20269>:
      D.20270 = (sizetype) len;
      D.20271 = D.20270 + 18446744073709551612;
      D.20272 = filename + D.20271;
      strcpy (D.20272, ".dll");
      D.20266 = *path;
      D.20273 = try_load_from (&result, D.20266, local_culture, "", filename, refonly, is_private);
      if (D.20273 != 0) goto <D.19819>; else goto <D.20274>;
      <D.20274>:
      D.20270 = (sizetype) len;
      D.20271 = D.20270 + 18446744073709551612;
      D.20272 = filename + D.20271;
      strcpy (D.20272, ".exe");
      D.20266 = *path;
      D.20275 = try_load_from (&result, D.20266, local_culture, "", filename, refonly, is_private);
      if (D.20275 != 0) goto <D.19819>; else goto <D.20276>;
      <D.20276>:
      D.20270 = (sizetype) len;
      D.20271 = D.20270 + 18446744073709551612;
      D.20272 = filename + D.20271;
      strcpy (D.20272, ".dll");
      D.20266 = *path;
      D.20277 = try_load_from (&result, D.20266, local_culture, name, filename, refonly, is_private);
      if (D.20277 != 0) goto <D.19819>; else goto <D.20278>;
      <D.20278>:
      D.20270 = (sizetype) len;
      D.20271 = D.20270 + 18446744073709551612;
      D.20272 = filename + D.20271;
      strcpy (D.20272, ".exe");
      D.20266 = *path;
      D.20279 = try_load_from (&result, D.20266, local_culture, name, filename, refonly, is_private);
      if (D.20279 != 0) goto <D.19819>; else goto <D.20280>;
      <D.20280>:
      <D.19818>:
      path = path + 8;
      <D.19821>:
      D.20266 = *path;
      if (D.20266 != 0B) goto <D.19820>; else goto <D.19819>;
      <D.19819>:
      monoeg_g_free (filename);
      D.20281 = result;
      return D.20281;
    }
  finally
    {
      result = {CLOBBER};
    }
}


strcpy (char * restrict __dest, const char * restrict __src)
{
  char * D.20284;
  long unsigned int D.20285;

  D.20285 = __builtin_object_size (__dest, 1);
  D.20284 = __builtin___strcpy_chk (__dest, __src, D.20285);
  return D.20284;
}


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.5;
  struct MonoAssembly * D.20295;
  gboolean D.20296;
  struct MonoAssembly * D.20297;
  _Bool D.20298;
  gchar * fullpath;
  gboolean found;

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

    new_fullpath = mono_portability_find_file (fullpath, 1);
    if (new_fullpath != 0B) goto <D.20290>; else goto <D.20291>;
    <D.20290>:
    monoeg_g_free (fullpath);
    fullpath = new_fullpath;
    found = 1;
    <D.20291>:
  }
  goto <D.20292>;
  <D.20289>:
  found = monoeg_g_file_test (fullpath, 1);
  <D.20292>:
  if (found != 0) goto <D.20293>; else goto <D.20294>;
  <D.20293>:
  D.20295 = mono_assembly_open_full (fullpath, 0B, refonly);
  *assembly = D.20295;
  <D.20294>:
  monoeg_g_free (fullpath);
  D.20297 = *assembly;
  D.20298 = D.20297 != 0B;
  D.20296 = (gboolean) D.20298;
  return D.20296;
}


create_domain_objects (struct MonoDomain * domain)
{
  struct MonoImage * D.20302;
  struct MonoException * D.20303;
  struct MonoException * D.20304;
  struct MonoException * D.20305;
  struct MonoClass * D.20306;
  struct MonoObject * D.20307;
  struct MonoClass * D.20310;
  struct MonoClass * D.20311;
  struct MonoDomain * old_domain;
  struct MonoString * arg;

  old_domain = mono_domain_get ();
  if (domain != old_domain) goto <D.20300>; else goto <D.20301>;
  <D.20300>:
  mono_thread_push_appdomain_ref (domain);
  mono_domain_set_internal_with_options (domain, 0);
  <D.20301>:
  arg = mono_string_new (domain, "Out of memory");
  D.20302 = mono_defaults.corlib;
  D.20303 = mono_exception_from_name_two_strings (D.20302, "System", "OutOfMemoryException", arg, 0B);
  domain->out_of_memory_ex = D.20303;
  arg = mono_string_new (domain, "A null value was found where an object instance was required");
  D.20302 = mono_defaults.corlib;
  D.20304 = mono_exception_from_name_two_strings (D.20302, "System", "NullReferenceException", arg, 0B);
  domain->null_reference_ex = D.20304;
  arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
  D.20302 = mono_defaults.corlib;
  D.20305 = mono_exception_from_name_two_strings (D.20302, "System", "StackOverflowException", arg, 0B);
  domain->stack_overflow_ex = D.20305;
  D.20306 = mono_defaults.object_class;
  D.20307 = mono_object_new (domain, D.20306);
  domain->ephemeron_tombstone = D.20307;
  if (domain != old_domain) goto <D.20308>; else goto <D.20309>;
  <D.20308>:
  mono_thread_pop_appdomain_ref ();
  mono_domain_set_internal_with_options (old_domain, 0);
  <D.20309>:
  D.20310 = mono_defaults.int_class;
  D.20311 = mono_array_class_get (D.20310, 1);
  mono_class_init (D.20311);
}


mono_domain_fire_assembly_load (struct MonoAssembly * assembly, void * user_data)
{
  struct MonoAppDomain * D.20312;
  struct MonoVTable * D.20315;
  union mono_mutex_t * D.20316;
  _Bool D.20319;
  long int D.20320;
  long int D.20321;
  _Bool D.20326;
  long int D.20327;
  long int D.20328;
  struct MonoClassField * assembly_load_field.6;
  struct MonoClassField * assembly_load_field.7;
  _Bool D.20335;
  long int D.20336;
  long int D.20337;
  void * load_value.8;
  _Bool D.20343;
  long int D.20344;
  long int D.20345;
  struct MonoMethod * assembly_load_method.9;
  struct MonoMethod * assembly_load_method.10;
  _Bool D.20352;
  long int D.20353;
  long int D.20354;
  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.20312 = domain->domain;
      if (D.20312 == 0B) goto <D.20313>; else goto <D.20314>;
      <D.20313>:
      return;
      <D.20314>:
      D.20312 = domain->domain;
      D.20315 = D.20312->mbr.obj.vtable;
      klass = D.20315->klass;
      {
        int ret;

        D.20316 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.20316);
        if (ret != 0) goto <D.20317>; else goto <D.20318>;
        <D.20317>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.20318>:
        D.20319 = ret != 0;
        D.20320 = (long int) D.20319;
        D.20321 = __builtin_expect (D.20320, 0);
        if (D.20321 != 0) goto <D.20322>; else goto <D.20323>;
        <D.20322>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1011, "ret == 0");
        <D.20323>:
      }
      add_assemblies_to_domain (domain, assembly, 0B);
      {
        int ret;

        D.20316 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.20316);
        if (ret != 0) goto <D.20324>; else goto <D.20325>;
        <D.20324>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.20325>:
        D.20326 = ret != 0;
        D.20327 = (long int) D.20326;
        D.20328 = __builtin_expect (D.20327, 0);
        if (D.20328 != 0) goto <D.20329>; else goto <D.20330>;
        <D.20329>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1013, "ret == 0");
        <D.20330>:
      }
      assembly_load_field.6 = assembly_load_field;
      if (assembly_load_field.6 == 0B) goto <D.20332>; else goto <D.20333>;
      <D.20332>:
      assembly_load_field.7 = mono_class_get_field_from_name (klass, "AssemblyLoad");
      assembly_load_field = assembly_load_field.7;
      assembly_load_field.6 = assembly_load_field;
      D.20335 = assembly_load_field.6 == 0B;
      D.20336 = (long int) D.20335;
      D.20337 = __builtin_expect (D.20336, 0);
      if (D.20337 != 0) goto <D.20338>; else goto <D.20339>;
      <D.20338>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1017, "assembly_load_field");
      <D.20339>:
      <D.20333>:
      assembly_load_field.6 = assembly_load_field;
      D.20312 = domain->domain;
      mono_field_get_value (D.20312, assembly_load_field.6, &load_value);
      load_value.8 = load_value;
      if (load_value.8 == 0B) goto <D.20341>; else goto <D.20342>;
      <D.20341>:
      return;
      <D.20342>:
      ref_assembly = mono_assembly_get_object (domain, assembly);
      D.20343 = ref_assembly == 0B;
      D.20344 = (long int) D.20343;
      D.20345 = __builtin_expect (D.20344, 0);
      if (D.20345 != 0) goto <D.20346>; else goto <D.20347>;
      <D.20346>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1027, "ref_assembly");
      <D.20347>:
      assembly_load_method.9 = assembly_load_method;
      if (assembly_load_method.9 == 0B) goto <D.20349>; else goto <D.20350>;
      <D.20349>:
      assembly_load_method.10 = mono_class_get_method_from_name (klass, "DoAssemblyLoad", -1);
      assembly_load_method = assembly_load_method.10;
      assembly_load_method.9 = assembly_load_method;
      D.20352 = assembly_load_method.9 == 0B;
      D.20353 = (long int) D.20352;
      D.20354 = __builtin_expect (D.20353, 0);
      if (D.20354 != 0) goto <D.20355>; else goto <D.20356>;
      <D.20355>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1031, "assembly_load_method");
      <D.20356>:
      <D.20350>:
      params[0] = ref_assembly;
      D.20312 = domain->domain;
      assembly_load_method.9 = assembly_load_method;
      mono_runtime_invoke (assembly_load_method.9, D.20312, &params, 0B);
    }
  finally
    {
      load_value = {CLOBBER};
      params = {CLOBBER};
    }
}


add_assemblies_to_domain (struct MonoDomain * domain, struct MonoAssembly * ass, struct GHashTable * ht)
{
  const char * D.20360;
  void * D.20365;
  void * D.20366;
  struct GSList * D.20369;
  struct GSList * D.20370;
  int D.20371;
  char * D.20372;
  struct MonoImage * D.20373;
  struct MonoAssembly * * D.20374;
  long unsigned int D.20377;
  long unsigned int D.20378;
  struct MonoAssembly * * D.20379;
  struct MonoAssembly * D.20380;
  void * D.20383;
  gint i;
  struct GSList * tmp;
  gboolean destroy_ht;

  destroy_ht = 0;
  D.20360 = ass->aname.name;
  if (D.20360 == 0B) goto <D.20361>; else goto <D.20362>;
  <D.20361>:
  return;
  <D.20362>:
  if (ht == 0B) goto <D.20363>; else goto <D.20364>;
  <D.20363>:
  ht = monoeg_g_hash_table_new (mono_aligned_addr_hash, 0B);
  destroy_ht = 1;
  <D.20364>:
  tmp = domain->domain_assemblies;
  goto <D.19594>;
  <D.19593>:
  D.20365 = tmp->data;
  D.20365 = tmp->data;
  monoeg_g_hash_table_insert_replace (ht, D.20365, D.20365, 0);
  tmp = tmp->next;
  <D.19594>:
  if (tmp != 0B) goto <D.19593>; else goto <D.19595>;
  <D.19595>:
  D.20366 = monoeg_g_hash_table_lookup (ht, ass);
  if (D.20366 == 0B) goto <D.20367>; else goto <D.20368>;
  <D.20367>:
  mono_assembly_addref (ass);
  monoeg_g_hash_table_insert_replace (ht, ass, ass, 0);
  D.20369 = domain->domain_assemblies;
  D.20370 = monoeg_g_slist_append (D.20369, ass);
  domain->domain_assemblies = D.20370;
  D.20371 = ass->ref_count;
  D.20372 = domain->friendly_name;
  D.20360 = ass->aname.name;
  mono_trace (64, 1, "Assembly %s[%p] added to domain %s, ref_count=%d", D.20360, ass, D.20372, D.20371);
  <D.20368>:
  D.20373 = ass->image;
  D.20374 = D.20373->references;
  if (D.20374 != 0B) goto <D.20375>; else goto <D.20376>;
  <D.20375>:
  i = 0;
  goto <D.19597>;
  <D.19596>:
  D.20373 = ass->image;
  D.20374 = D.20373->references;
  D.20377 = (long unsigned int) i;
  D.20378 = D.20377 * 8;
  D.20379 = D.20374 + D.20378;
  D.20380 = *D.20379;
  if (D.20380 != -1B) goto <D.20381>; else goto <D.20382>;
  <D.20381>:
  D.20373 = ass->image;
  D.20374 = D.20373->references;
  D.20377 = (long unsigned int) i;
  D.20378 = D.20377 * 8;
  D.20379 = D.20374 + D.20378;
  D.20380 = *D.20379;
  D.20383 = monoeg_g_hash_table_lookup (ht, D.20380);
  if (D.20383 == 0B) goto <D.20384>; else goto <D.20385>;
  <D.20384>:
  D.20373 = ass->image;
  D.20374 = D.20373->references;
  D.20377 = (long unsigned int) i;
  D.20378 = D.20377 * 8;
  D.20379 = D.20374 + D.20378;
  D.20380 = *D.20379;
  add_assemblies_to_domain (domain, D.20380, ht);
  <D.20385>:
  <D.20382>:
  i = i + 1;
  <D.19597>:
  D.20373 = ass->image;
  D.20374 = D.20373->references;
  D.20377 = (long unsigned int) i;
  D.20378 = D.20377 * 8;
  D.20379 = D.20374 + D.20378;
  D.20380 = *D.20379;
  if (D.20380 != 0B) goto <D.19596>; else goto <D.19598>;
  <D.19598>:
  <D.20376>:
  if (destroy_ht != 0) goto <D.20386>; else goto <D.20387>;
  <D.20386>:
  monoeg_g_hash_table_destroy (ht);
  <D.20387>:
}


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

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


mono_get_corlib_version ()
{
  struct MonoImage * D.20393;
  int D.20396;
  struct MonoType * D.20397;
  short unsigned int D.20398;
  int D.20399;
  int D.20400;
  struct MonoDomain * D.20403;
  gint32 * D.20404;
  struct MonoClass * klass;
  struct MonoClassField * field;
  struct MonoObject * value;

  D.20393 = mono_defaults.corlib;
  klass = mono_class_from_name (D.20393, "System", "Environment");
  mono_class_init (klass);
  field = mono_class_get_field_from_name (klass, "mono_corlib_version");
  if (field == 0B) goto <D.20394>; else goto <D.20395>;
  <D.20394>:
  D.20396 = -1;
  return D.20396;
  <D.20395>:
  D.20397 = field->type;
  D.20398 = D.20397->attrs;
  D.20399 = (int) D.20398;
  D.20400 = D.20399 & 16;
  if (D.20400 == 0) goto <D.20401>; else goto <D.20402>;
  <D.20401>:
  D.20396 = -1;
  return D.20396;
  <D.20402>:
  D.20403 = mono_domain_get ();
  value = mono_field_get_value_object (D.20403, field, 0B);
  D.20404 = value + 16;
  D.20396 = *D.20404;
  return D.20396;
}


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

  D.20406 = mono_defaults.corlib;
  class = mono_class_from_name (D.20406, "System.Runtime.Remoting.Contexts", "Context");
  context = mono_object_new (domain, class);
  D.20407 = domain->domain_id;
  context->domain_id = D.20407;
  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 (*<T167d>) (struct MonoDomain *, void *) quit_function.11;
  struct MonoDomain * D.20411;

  quit_function.11 = quit_function;
  if (quit_function.11 != 0B) goto <D.20409>; else goto <D.20410>;
  <D.20409>:
  quit_function.11 = quit_function;
  D.20411 = mono_get_root_domain ();
  quit_function.11 (D.20411, 0B);
  <D.20410>:
}


mono_domain_create_appdomain (char * friendly_name, char * configuration_file)
{
  struct MonoImage * D.20412;
  struct MonoDomain * D.20413;
  struct MonoString * iftmp.12;
  struct MonoDomain * D.20417;
  struct MonoDomain * D.20419;
  struct MonoAppDomain * ad;
  struct MonoAppDomainSetup * setup;
  struct MonoClass * class;

  D.20412 = mono_defaults.corlib;
  class = mono_class_from_name (D.20412, "System", "AppDomainSetup");
  D.20413 = mono_domain_get ();
  setup = mono_object_new (D.20413, class);
  if (configuration_file != 0B) goto <D.20415>; else goto <D.20416>;
  <D.20415>:
  D.20417 = mono_domain_get ();
  iftmp.12 = mono_string_new (D.20417, configuration_file);
  goto <D.20418>;
  <D.20416>:
  iftmp.12 = 0B;
  <D.20418>:
  setup->configuration_file = iftmp.12;
  ad = mono_domain_create_appdomain_internal (friendly_name, setup);
  D.20419 = mono_domain_from_appdomain (ad);
  return D.20419;
}


mono_domain_create_appdomain_internal (char * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20421;
  gchar * D.20422;
  struct MonoString * D.20423;
  struct MonoAppDomainSetup * D.20426;
  struct MonoString * D.20427;
  int D.20430;
  mono_unichar2 * D.20431;
  struct MonoString * D.20432;
  struct MonoString * * D.20433;
  struct MonoAppDomainSetup * D.20434;
  struct MonoAssembly * D.20435;
  int D.20436;
  struct MonoAppDomain * D.20439;
  struct MonoError error;
  struct MonoClass * adclass;
  struct MonoAppDomain * ad;
  struct MonoDomain * data;
  char * shadow_location;

  try
    {
      D.20421 = mono_defaults.corlib;
      adclass = mono_class_from_name (D.20421, "System", "AppDomain");
      data = mono_domain_create ();
      ad = mono_object_new (data, adclass);
      ad->data = data;
      data->domain = ad;
      D.20422 = monoeg_strdup (friendly_name);
      data->friendly_name = D.20422;
      D.20423 = setup->application_base;
      if (D.20423 == 0B) goto <D.20424>; else goto <D.20425>;
      <D.20424>:
      {
        struct MonoDomain * root;

        root = mono_get_root_domain ();
        D.20426 = root->setup;
        D.20427 = D.20426->application_base;
        if (D.20427 != 0B) goto <D.20428>; else goto <D.20429>;
        <D.20428>:
        D.20426 = root->setup;
        D.20427 = D.20426->application_base;
        D.20430 = mono_string_length (D.20427);
        D.20426 = root->setup;
        D.20427 = D.20426->application_base;
        D.20431 = mono_string_chars (D.20427);
        D.20432 = mono_string_new_utf16 (data, D.20431, D.20430);
        D.20433 = &setup->application_base;
        mono_gc_wbarrier_set_field (setup, D.20433, D.20432);
        <D.20429>:
      }
      <D.20425>:
      mono_context_init (data);
      D.20434 = copy_app_domain_setup (data, setup);
      data->setup = D.20434;
      mono_set_private_bin_path_from_config (data);
      D.20421 = mono_defaults.corlib;
      D.20435 = D.20421->assembly;
      add_assemblies_to_domain (data, D.20435, 0B);
      shadow_location = get_shadow_assembly_location_base (data, &error);
      D.20436 = mono_error_ok (&error);
      if (D.20436 == 0) goto <D.20437>; else goto <D.20438>;
      <D.20437>:
      mono_error_raise_exception (&error);
      <D.20438>:
      monoeg_g_free (shadow_location);
      create_domain_objects (data);
      D.20439 = ad;
      return D.20439;
    }
  finally
    {
      error = {CLOBBER};
    }
}


copy_app_domain_setup (struct MonoDomain * domain, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20442;
  struct MonoString * D.20443;
  struct MonoObject * D.20444;
  struct MonoString * * D.20445;
  struct MonoString * D.20446;
  struct MonoObject * D.20447;
  struct MonoString * * D.20448;
  struct MonoString * D.20449;
  struct MonoObject * D.20450;
  struct MonoString * * D.20451;
  struct MonoString * D.20452;
  struct MonoObject * D.20453;
  struct MonoString * * D.20454;
  struct MonoString * D.20455;
  struct MonoObject * D.20456;
  struct MonoString * * D.20457;
  struct MonoString * D.20458;
  struct MonoObject * D.20459;
  struct MonoString * * D.20460;
  struct MonoString * D.20461;
  struct MonoObject * D.20462;
  struct MonoString * * D.20463;
  struct MonoString * D.20464;
  struct MonoObject * D.20465;
  struct MonoString * * D.20466;
  struct MonoString * D.20467;
  struct MonoObject * D.20468;
  struct MonoString * * D.20469;
  struct MonoString * D.20470;
  struct MonoObject * D.20471;
  struct MonoString * * D.20472;
  unsigned char D.20473;
  unsigned char D.20474;
  int D.20475;
  unsigned char D.20476;
  unsigned char D.20477;
  struct MonoArray * D.20478;
  struct MonoObject * D.20479;
  struct MonoArray * * D.20480;
  unsigned char D.20481;
  struct MonoObject * D.20482;
  struct MonoObject * D.20483;
  struct MonoObject * * D.20484;
  struct MonoArray * D.20485;
  struct MonoObject * D.20486;
  struct MonoArray * * D.20487;
  struct MonoArray * D.20488;
  struct MonoObject * D.20489;
  struct MonoArray * * D.20490;
  struct MonoAppDomainSetup * D.20491;
  struct MonoDomain * caller_domain;
  struct MonoClass * ads_class;
  struct MonoAppDomainSetup * copy;

  caller_domain = mono_domain_get ();
  D.20442 = mono_defaults.corlib;
  ads_class = mono_class_from_name (D.20442, "System", "AppDomainSetup");
  copy = mono_object_new (domain, ads_class);
  mono_domain_set_internal (domain);
  D.20443 = setup->application_base;
  D.20444 = mono_marshal_xdomain_copy_value (D.20443);
  D.20445 = &copy->application_base;
  mono_gc_wbarrier_set_field (copy, D.20445, D.20444);
  D.20446 = setup->application_name;
  D.20447 = mono_marshal_xdomain_copy_value (D.20446);
  D.20448 = &copy->application_name;
  mono_gc_wbarrier_set_field (copy, D.20448, D.20447);
  D.20449 = setup->cache_path;
  D.20450 = mono_marshal_xdomain_copy_value (D.20449);
  D.20451 = &copy->cache_path;
  mono_gc_wbarrier_set_field (copy, D.20451, D.20450);
  D.20452 = setup->configuration_file;
  D.20453 = mono_marshal_xdomain_copy_value (D.20452);
  D.20454 = &copy->configuration_file;
  mono_gc_wbarrier_set_field (copy, D.20454, D.20453);
  D.20455 = setup->dynamic_base;
  D.20456 = mono_marshal_xdomain_copy_value (D.20455);
  D.20457 = &copy->dynamic_base;
  mono_gc_wbarrier_set_field (copy, D.20457, D.20456);
  D.20458 = setup->license_file;
  D.20459 = mono_marshal_xdomain_copy_value (D.20458);
  D.20460 = &copy->license_file;
  mono_gc_wbarrier_set_field (copy, D.20460, D.20459);
  D.20461 = setup->private_bin_path;
  D.20462 = mono_marshal_xdomain_copy_value (D.20461);
  D.20463 = &copy->private_bin_path;
  mono_gc_wbarrier_set_field (copy, D.20463, D.20462);
  D.20464 = setup->private_bin_path_probe;
  D.20465 = mono_marshal_xdomain_copy_value (D.20464);
  D.20466 = &copy->private_bin_path_probe;
  mono_gc_wbarrier_set_field (copy, D.20466, D.20465);
  D.20467 = setup->shadow_copy_directories;
  D.20468 = mono_marshal_xdomain_copy_value (D.20467);
  D.20469 = &copy->shadow_copy_directories;
  mono_gc_wbarrier_set_field (copy, D.20469, D.20468);
  D.20470 = setup->shadow_copy_files;
  D.20471 = mono_marshal_xdomain_copy_value (D.20470);
  D.20472 = &copy->shadow_copy_files;
  mono_gc_wbarrier_set_field (copy, D.20472, D.20471);
  D.20473 = setup->publisher_policy;
  copy->publisher_policy = D.20473;
  D.20474 = setup->path_changed;
  copy->path_changed = D.20474;
  D.20475 = setup->loader_optimization;
  copy->loader_optimization = D.20475;
  D.20476 = setup->disallow_binding_redirects;
  copy->disallow_binding_redirects = D.20476;
  D.20477 = setup->disallow_code_downloads;
  copy->disallow_code_downloads = D.20477;
  D.20478 = setup->domain_initializer_args;
  D.20479 = mono_marshal_xdomain_copy_value (D.20478);
  D.20480 = &copy->domain_initializer_args;
  mono_gc_wbarrier_set_field (copy, D.20480, D.20479);
  D.20481 = setup->disallow_appbase_probe;
  copy->disallow_appbase_probe = D.20481;
  D.20482 = setup->application_trust;
  D.20483 = mono_marshal_xdomain_copy_value (D.20482);
  D.20484 = &copy->application_trust;
  mono_gc_wbarrier_set_field (copy, D.20484, D.20483);
  D.20485 = setup->configuration_bytes;
  D.20486 = mono_marshal_xdomain_copy_value (D.20485);
  D.20487 = &copy->configuration_bytes;
  mono_gc_wbarrier_set_field (copy, D.20487, D.20486);
  D.20488 = setup->serialized_non_primitives;
  D.20489 = mono_marshal_xdomain_copy_value (D.20488);
  D.20490 = &copy->serialized_non_primitives;
  mono_gc_wbarrier_set_field (copy, D.20490, D.20489);
  mono_domain_set_internal (caller_domain);
  D.20491 = copy;
  return D.20491;
}


get_shadow_assembly_location_base (struct MonoDomain * domain, struct MonoError * error)
{
  struct MonoString * D.20495;
  struct MonoString * D.20497;
  int D.20499;
  char * D.20502;
  long unsigned int D.20503;
  unsigned int D.20504;
  unsigned int D.20505;
  sizetype D.20506;
  char * D.20507;
  char D.20508;
  int D.20511;
  const gchar * D.20514;
  const gchar * D.20515;
  struct MonoAppDomainSetup * setup;
  char * cache_path;
  char * appname;
  char * userdir;
  char * location;

  mono_error_init (error);
  setup = domain->setup;
  D.20495 = setup->cache_path;
  if (D.20495 != 0B) goto <D.20496>; else goto <D.20493>;
  <D.20496>:
  D.20497 = setup->application_name;
  if (D.20497 != 0B) goto <D.20498>; else goto <D.20493>;
  <D.20498>:
  D.20495 = setup->cache_path;
  cache_path = mono_string_to_utf8_checked (D.20495, error);
  D.20499 = mono_error_ok (error);
  if (D.20499 == 0) goto <D.20500>; else goto <D.20501>;
  <D.20500>:
  D.20502 = 0B;
  return D.20502;
  <D.20501>:
  {
    gint i;

    D.20503 = strlen (cache_path);
    D.20504 = (unsigned int) D.20503;
    D.20505 = D.20504 + 4294967295;
    i = (gint) D.20505;
    goto <D.19700>;
    <D.19699>:
    D.20506 = (sizetype) i;
    D.20507 = cache_path + D.20506;
    D.20508 = *D.20507;
    if (D.20508 == 92) goto <D.20509>; else goto <D.20510>;
    <D.20509>:
    D.20506 = (sizetype) i;
    D.20507 = cache_path + D.20506;
    *D.20507 = 47;
    <D.20510>:
    i = i + -1;
    <D.19700>:
    if (i >= 0) goto <D.19699>; else goto <D.19701>;
    <D.19701>:
  }
  D.20497 = setup->application_name;
  appname = mono_string_to_utf8_checked (D.20497, error);
  D.20511 = mono_error_ok (error);
  if (D.20511 == 0) goto <D.20512>; else goto <D.20513>;
  <D.20512>:
  monoeg_g_free (cache_path);
  D.20502 = 0B;
  return D.20502;
  <D.20513>:
  location = monoeg_g_build_path ("/", cache_path, appname, "assembly", "shadow", 0B);
  monoeg_g_free (appname);
  monoeg_g_free (cache_path);
  goto <D.20494>;
  <D.20493>:
  D.20514 = monoeg_g_get_user_name ();
  userdir = monoeg_g_strdup_printf ("%s-mono-cachepath", D.20514);
  D.20515 = monoeg_g_get_tmp_dir ();
  location = monoeg_g_build_path ("/", D.20515, userdir, "assembly", "shadow", 0B);
  monoeg_g_free (userdir);
  <D.20494>:
  D.20502 = location;
  return D.20502;
}


mono_domain_has_type_resolve (struct MonoDomain * domain)
{
  struct MonoClassField * field.13;
  struct MonoClass * D.20520;
  struct MonoClassField * field.14;
  _Bool D.20522;
  long int D.20523;
  long int D.20524;
  struct MonoAppDomain * D.20527;
  mono_bool D.20530;
  struct MonoObject * o.15;
  _Bool D.20532;
  static struct MonoClassField * field = 0B;
  struct MonoObject * o;

  try
    {
      field.13 = field;
      if (field.13 == 0B) goto <D.20518>; else goto <D.20519>;
      <D.20518>:
      D.20520 = mono_defaults.appdomain_class;
      field.14 = mono_class_get_field_from_name (D.20520, "TypeResolve");
      field = field.14;
      field.13 = field;
      D.20522 = field.13 == 0B;
      D.20523 = (long int) D.20522;
      D.20524 = __builtin_expect (D.20523, 0);
      if (D.20524 != 0) goto <D.20525>; else goto <D.20526>;
      <D.20525>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 503, "field");
      <D.20526>:
      <D.20519>:
      D.20527 = domain->domain;
      if (D.20527 == 0B) goto <D.20528>; else goto <D.20529>;
      <D.20528>:
      D.20530 = 0;
      return D.20530;
      <D.20529>:
      field.13 = field;
      D.20527 = domain->domain;
      mono_field_get_value (D.20527, field.13, &o);
      o.15 = o;
      D.20532 = o.15 != 0B;
      D.20530 = (mono_bool) D.20532;
      return D.20530;
    }
  finally
    {
      o = {CLOBBER};
    }
}


mono_domain_try_type_resolve (struct MonoDomain * domain, char * name, struct MonoObject * tb)
{
  int iftmp.16;
  _Bool D.20540;
  _Bool D.20541;
  _Bool D.20542;
  _Bool D.20543;
  long int D.20544;
  long int D.20545;
  struct MonoMethod * method.17;
  struct MonoAppDomain * D.20551;
  struct MonoVTable * D.20552;
  _Bool D.20553;
  long int D.20554;
  long int D.20555;
  struct MonoMethod * method.18;
  struct MonoReflectionAssembly * D.20561;
  struct MonoDomain * D.20564;
  struct MonoString * D.20565;
  struct MonoClass * klass;
  void * params[1];
  static struct MonoMethod * method = 0B;

  try
    {
      if (domain == 0B) goto <D.20536>; else goto <D.20539>;
      <D.20539>:
      D.20540 = name == 0B;
      D.20541 = tb == 0B;
      D.20542 = D.20540 & D.20541;
      if (D.20542 != 0) goto <D.20536>; else goto <D.20537>;
      <D.20536>:
      iftmp.16 = 1;
      goto <D.20538>;
      <D.20537>:
      iftmp.16 = 0;
      <D.20538>:
      D.20543 = iftmp.16 != 0;
      D.20544 = (long int) D.20543;
      D.20545 = __builtin_expect (D.20544, 0);
      if (D.20545 != 0) goto <D.20546>; else goto <D.20547>;
      <D.20546>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 534, "domain != NULL && ((name != NULL) || (tb != NULL))");
      <D.20547>:
      method.17 = method;
      if (method.17 == 0B) goto <D.20549>; else goto <D.20550>;
      <D.20549>:
      D.20551 = domain->domain;
      D.20552 = D.20551->mbr.obj.vtable;
      klass = D.20552->klass;
      D.20553 = klass == 0B;
      D.20554 = (long int) D.20553;
      D.20555 = __builtin_expect (D.20554, 0);
      if (D.20555 != 0) goto <D.20556>; else goto <D.20557>;
      <D.20556>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 538, "klass");
      <D.20557>:
      method.18 = mono_class_get_method_from_name (klass, "DoTypeResolve", -1);
      method = method.18;
      method.17 = method;
      if (method.17 == 0B) goto <D.20559>; else goto <D.20560>;
      <D.20559>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoTypeResolve not found.\n");
      D.20561 = 0B;
      return D.20561;
      <D.20560>:
      <D.20550>:
      if (name != 0B) goto <D.20562>; else goto <D.20563>;
      <D.20562>:
      D.20564 = mono_domain_get ();
      D.20565 = mono_string_new (D.20564, name);
      params[0] = D.20565;
      goto <D.20566>;
      <D.20563>:
      params[0] = tb;
      <D.20566>:
      D.20551 = domain->domain;
      method.17 = method;
      D.20561 = mono_runtime_invoke (method.17, D.20551, &params, 0B);
      return D.20561;
    }
  finally
    {
      params = {CLOBBER};
    }
}


mono_domain_owns_vtable_slot (struct MonoDomain * domain, void * vtable_slot)
{
  union mono_mutex_t * D.20569;
  _Bool D.20572;
  long int D.20573;
  long int D.20574;
  struct MonoMemPool * D.20577;
  _Bool D.20580;
  long int D.20581;
  long int D.20582;
  mono_bool D.20585;
  gboolean res;

  {
    int ret;

    D.20569 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.20569);
    if (ret != 0) goto <D.20570>; else goto <D.20571>;
    <D.20570>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20571>:
    D.20572 = ret != 0;
    D.20573 = (long int) D.20572;
    D.20574 = __builtin_expect (D.20573, 0);
    if (D.20574 != 0) goto <D.20575>; else goto <D.20576>;
    <D.20575>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 564, "ret == 0");
    <D.20576>:
  }
  D.20577 = domain->mp;
  res = mono_mempool_contains_addr (D.20577, vtable_slot);
  {
    int ret;

    D.20569 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.20569);
    if (ret != 0) goto <D.20578>; else goto <D.20579>;
    <D.20578>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20579>:
    D.20580 = ret != 0;
    D.20581 = (long int) D.20580;
    D.20582 = __builtin_expect (D.20581, 0);
    if (D.20582 != 0) goto <D.20583>; else goto <D.20584>;
    <D.20583>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 566, "ret == 0");
    <D.20584>:
  }
  D.20585 = res;
  return D.20585;
}


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

  if (force == 0) goto <D.20587>; else goto <D.20588>;
  <D.20587>:
  D.20589 = domain->state;
  if (D.20589 == 3) goto <D.20590>; else goto <D.20591>;
  <D.20590>:
  D.20592 = 0;
  return D.20592;
  <D.20591>:
  <D.20588>:
  mono_domain_set_internal (domain);
  D.20592 = 1;
  return D.20592;
}


ves_icall_System_AppDomain_GetData (struct MonoAppDomain * ad, struct MonoString * name)
{
  _Bool D.20594;
  long int D.20595;
  long int D.20596;
  _Bool D.20599;
  long int D.20600;
  long int D.20601;
  struct MonoException * D.20606;
  union mono_mutex_t * D.20607;
  _Bool D.20610;
  long int D.20611;
  long int D.20612;
  int D.19346;
  int iftmp.19;
  int D.19345;
  const char[8] * D.20618;
  unsigned char D.20619;
  int D.20620;
  unsigned char D.20621;
  int D.20622;
  _Bool D.20623;
  _Bool D.20624;
  _Bool D.20625;
  const unsigned char * D.20628;
  unsigned char D.20629;
  int D.20630;
  const unsigned char * D.20631;
  unsigned char D.20632;
  int D.20633;
  _Bool D.20634;
  _Bool D.20635;
  const unsigned char * D.20638;
  unsigned char D.20639;
  int D.20640;
  const unsigned char * D.20641;
  unsigned char D.20642;
  int D.20643;
  _Bool D.20644;
  _Bool D.20645;
  const unsigned char * D.20648;
  unsigned char D.20649;
  int D.20650;
  const unsigned char * D.20651;
  unsigned char D.20652;
  int D.20653;
  struct MonoAppDomainSetup * D.20657;
  int D.19355;
  int iftmp.20;
  int D.19354;
  const char[16] * D.20662;
  unsigned char D.20663;
  int D.20664;
  unsigned char D.20665;
  int D.20666;
  _Bool D.20667;
  _Bool D.20668;
  _Bool D.20669;
  const unsigned char * D.20672;
  unsigned char D.20673;
  int D.20674;
  const unsigned char * D.20675;
  unsigned char D.20676;
  int D.20677;
  _Bool D.20678;
  _Bool D.20679;
  const unsigned char * D.20682;
  unsigned char D.20683;
  int D.20684;
  const unsigned char * D.20685;
  unsigned char D.20686;
  int D.20687;
  _Bool D.20688;
  _Bool D.20689;
  const unsigned char * D.20692;
  unsigned char D.20693;
  int D.20694;
  const unsigned char * D.20695;
  unsigned char D.20696;
  int D.20697;
  int D.19364;
  int iftmp.21;
  int D.19363;
  const char[13] * D.20705;
  unsigned char D.20706;
  int D.20707;
  unsigned char D.20708;
  int D.20709;
  _Bool D.20710;
  _Bool D.20711;
  _Bool D.20712;
  const unsigned char * D.20715;
  unsigned char D.20716;
  int D.20717;
  const unsigned char * D.20718;
  unsigned char D.20719;
  int D.20720;
  _Bool D.20721;
  _Bool D.20722;
  const unsigned char * D.20725;
  unsigned char D.20726;
  int D.20727;
  const unsigned char * D.20728;
  unsigned char D.20729;
  int D.20730;
  _Bool D.20731;
  _Bool D.20732;
  const unsigned char * D.20735;
  unsigned char D.20736;
  int D.20737;
  const unsigned char * D.20738;
  unsigned char D.20739;
  int D.20740;
  int D.19373;
  int iftmp.22;
  int D.19372;
  const char[9] * D.20748;
  unsigned char D.20749;
  int D.20750;
  unsigned char D.20751;
  int D.20752;
  _Bool D.20753;
  _Bool D.20754;
  _Bool D.20755;
  const unsigned char * D.20758;
  unsigned char D.20759;
  int D.20760;
  const unsigned char * D.20761;
  unsigned char D.20762;
  int D.20763;
  _Bool D.20764;
  _Bool D.20765;
  const unsigned char * D.20768;
  unsigned char D.20769;
  int D.20770;
  const unsigned char * D.20771;
  unsigned char D.20772;
  int D.20773;
  _Bool D.20774;
  _Bool D.20775;
  const unsigned char * D.20778;
  unsigned char D.20779;
  int D.20780;
  const unsigned char * D.20781;
  unsigned char D.20782;
  int D.20783;
  int D.19382;
  int iftmp.23;
  int D.19381;
  const char[11] * D.20791;
  unsigned char D.20792;
  int D.20793;
  unsigned char D.20794;
  int D.20795;
  _Bool D.20796;
  _Bool D.20797;
  _Bool D.20798;
  const unsigned char * D.20801;
  unsigned char D.20802;
  int D.20803;
  const unsigned char * D.20804;
  unsigned char D.20805;
  int D.20806;
  _Bool D.20807;
  _Bool D.20808;
  const unsigned char * D.20811;
  unsigned char D.20812;
  int D.20813;
  const unsigned char * D.20814;
  unsigned char D.20815;
  int D.20816;
  _Bool D.20817;
  _Bool D.20818;
  const unsigned char * D.20821;
  unsigned char D.20822;
  int D.20823;
  const unsigned char * D.20824;
  unsigned char D.20825;
  int D.20826;
  int D.19391;
  int iftmp.24;
  int D.19390;
  const char[16] * D.20834;
  unsigned char D.20835;
  int D.20836;
  unsigned char D.20837;
  int D.20838;
  _Bool D.20839;
  _Bool D.20840;
  _Bool D.20841;
  const unsigned char * D.20844;
  unsigned char D.20845;
  int D.20846;
  const unsigned char * D.20847;
  unsigned char D.20848;
  int D.20849;
  _Bool D.20850;
  _Bool D.20851;
  const unsigned char * D.20854;
  unsigned char D.20855;
  int D.20856;
  const unsigned char * D.20857;
  unsigned char D.20858;
  int D.20859;
  _Bool D.20860;
  _Bool D.20861;
  const unsigned char * D.20864;
  unsigned char D.20865;
  int D.20866;
  const unsigned char * D.20867;
  unsigned char D.20868;
  int D.20869;
  int D.19400;
  int iftmp.25;
  int D.19399;
  const char[19] * D.20877;
  unsigned char D.20878;
  int D.20879;
  unsigned char D.20880;
  int D.20881;
  _Bool D.20882;
  _Bool D.20883;
  _Bool D.20884;
  const unsigned char * D.20887;
  unsigned char D.20888;
  int D.20889;
  const unsigned char * D.20890;
  unsigned char D.20891;
  int D.20892;
  _Bool D.20893;
  _Bool D.20894;
  const unsigned char * D.20897;
  unsigned char D.20898;
  int D.20899;
  const unsigned char * D.20900;
  unsigned char D.20901;
  int D.20902;
  _Bool D.20903;
  _Bool D.20904;
  const unsigned char * D.20907;
  unsigned char D.20908;
  int D.20909;
  const unsigned char * D.20910;
  unsigned char D.20911;
  int D.20912;
  int D.19409;
  int iftmp.26;
  int D.19408;
  const char[17] * D.20920;
  unsigned char D.20921;
  int D.20922;
  unsigned char D.20923;
  int D.20924;
  _Bool D.20925;
  _Bool D.20926;
  _Bool D.20927;
  const unsigned char * D.20930;
  unsigned char D.20931;
  int D.20932;
  const unsigned char * D.20933;
  unsigned char D.20934;
  int D.20935;
  _Bool D.20936;
  _Bool D.20937;
  const unsigned char * D.20940;
  unsigned char D.20941;
  int D.20942;
  const unsigned char * D.20943;
  unsigned char D.20944;
  int D.20945;
  _Bool D.20946;
  _Bool D.20947;
  const unsigned char * D.20950;
  unsigned char D.20951;
  int D.20952;
  const unsigned char * D.20953;
  unsigned char D.20954;
  int D.20955;
  int D.19418;
  int iftmp.27;
  int D.19417;
  const char[20] * D.20963;
  unsigned char D.20964;
  int D.20965;
  unsigned char D.20966;
  int D.20967;
  _Bool D.20968;
  _Bool D.20969;
  _Bool D.20970;
  const unsigned char * D.20973;
  unsigned char D.20974;
  int D.20975;
  const unsigned char * D.20976;
  unsigned char D.20977;
  int D.20978;
  _Bool D.20979;
  _Bool D.20980;
  const unsigned char * D.20983;
  unsigned char D.20984;
  int D.20985;
  const unsigned char * D.20986;
  unsigned char D.20987;
  int D.20988;
  _Bool D.20989;
  _Bool D.20990;
  const unsigned char * D.20993;
  unsigned char D.20994;
  int D.20995;
  const unsigned char * D.20996;
  unsigned char D.20997;
  int D.20998;
  struct MonoGHashTable * D.21003;
  _Bool D.21006;
  long int D.21007;
  long int D.21008;
  struct MonoObject * D.21013;
  struct MonoDomain * add;
  struct MonoObject * o;
  char * str;

  D.20594 = ad == 0B;
  D.20595 = (long int) D.20594;
  D.20596 = __builtin_expect (D.20595, 0);
  if (D.20596 != 0) goto <D.20597>; else goto <D.20598>;
  <D.20597>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 602, "ad != NULL");
  <D.20598>:
  add = ad->data;
  D.20599 = add == 0B;
  D.20600 = (long int) D.20599;
  D.20601 = __builtin_expect (D.20600, 0);
  if (D.20601 != 0) goto <D.20602>; else goto <D.20603>;
  <D.20602>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 604, "add != NULL");
  <D.20603>:
  if (name == 0B) goto <D.20604>; else goto <D.20605>;
  <D.20604>:
  D.20606 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.20606);
  <D.20605>:
  str = mono_string_to_utf8 (name);
  {
    int ret;

    D.20607 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.20607);
    if (ret != 0) goto <D.20608>; else goto <D.20609>;
    <D.20608>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20609>:
    D.20610 = ret != 0;
    D.20611 = (long int) D.20610;
    D.20612 = __builtin_expect (D.20611, 0);
    if (D.20612 != 0) goto <D.20613>; else goto <D.20614>;
    <D.20613>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 611, "ret == 0");
    <D.20614>:
  }
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20618 = "APPBASE";
      D.20619 = MEM[(const unsigned char *)D.20618];
      D.20620 = (int) D.20619;
      D.20621 = *__s2;
      D.20622 = (int) D.20621;
      __result = D.20620 - D.20622;
      {
        D.20623 = __s2_len != 0;
        D.20624 = __result == 0;
        D.20625 = D.20623 & D.20624;
        if (D.20625 != 0) goto <D.20626>; else goto <D.20627>;
        <D.20626>:
        D.20628 = &MEM[(void *)"APPBASE" + 1B];
        D.20629 = *D.20628;
        D.20630 = (int) D.20629;
        D.20631 = __s2 + 1;
        D.20632 = *D.20631;
        D.20633 = (int) D.20632;
        __result = D.20630 - D.20633;
        D.20634 = __s2_len > 1;
        D.20624 = __result == 0;
        D.20635 = D.20634 & D.20624;
        if (D.20635 != 0) goto <D.20636>; else goto <D.20637>;
        <D.20636>:
        D.20638 = &MEM[(void *)"APPBASE" + 2B];
        D.20639 = *D.20638;
        D.20640 = (int) D.20639;
        D.20641 = __s2 + 2;
        D.20642 = *D.20641;
        D.20643 = (int) D.20642;
        __result = D.20640 - D.20643;
        D.20644 = __s2_len > 2;
        D.20624 = __result == 0;
        D.20645 = D.20644 & D.20624;
        if (D.20645 != 0) goto <D.20646>; else goto <D.20647>;
        <D.20646>:
        D.20648 = &MEM[(void *)"APPBASE" + 3B];
        D.20649 = *D.20648;
        D.20650 = (int) D.20649;
        D.20651 = __s2 + 3;
        D.20652 = *D.20651;
        D.20653 = (int) D.20652;
        __result = D.20650 - D.20653;
        <D.20647>:
        <D.20637>:
        <D.20627>:
      }
      D.19345 = __result;
    }
    iftmp.19 = -D.19345;
    goto <D.20654>;
    <D.20617>:
    iftmp.19 = __builtin_strcmp (str, "APPBASE");
    <D.20654>:
    D.19346 = iftmp.19;
  }
  if (D.19346 == 0) goto <D.20655>; else goto <D.20656>;
  <D.20655>:
  D.20657 = add->setup;
  o = D.20657->application_base;
  goto <D.20658>;
  <D.20656>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20662 = "APP_CONFIG_FILE";
      D.20663 = MEM[(const unsigned char *)D.20662];
      D.20664 = (int) D.20663;
      D.20665 = *__s2;
      D.20666 = (int) D.20665;
      __result = D.20664 - D.20666;
      {
        D.20667 = __s2_len != 0;
        D.20668 = __result == 0;
        D.20669 = D.20667 & D.20668;
        if (D.20669 != 0) goto <D.20670>; else goto <D.20671>;
        <D.20670>:
        D.20672 = &MEM[(void *)"APP_CONFIG_FILE" + 1B];
        D.20673 = *D.20672;
        D.20674 = (int) D.20673;
        D.20675 = __s2 + 1;
        D.20676 = *D.20675;
        D.20677 = (int) D.20676;
        __result = D.20674 - D.20677;
        D.20678 = __s2_len > 1;
        D.20668 = __result == 0;
        D.20679 = D.20678 & D.20668;
        if (D.20679 != 0) goto <D.20680>; else goto <D.20681>;
        <D.20680>:
        D.20682 = &MEM[(void *)"APP_CONFIG_FILE" + 2B];
        D.20683 = *D.20682;
        D.20684 = (int) D.20683;
        D.20685 = __s2 + 2;
        D.20686 = *D.20685;
        D.20687 = (int) D.20686;
        __result = D.20684 - D.20687;
        D.20688 = __s2_len > 2;
        D.20668 = __result == 0;
        D.20689 = D.20688 & D.20668;
        if (D.20689 != 0) goto <D.20690>; else goto <D.20691>;
        <D.20690>:
        D.20692 = &MEM[(void *)"APP_CONFIG_FILE" + 3B];
        D.20693 = *D.20692;
        D.20694 = (int) D.20693;
        D.20695 = __s2 + 3;
        D.20696 = *D.20695;
        D.20697 = (int) D.20696;
        __result = D.20694 - D.20697;
        <D.20691>:
        <D.20681>:
        <D.20671>:
      }
      D.19354 = __result;
    }
    iftmp.20 = -D.19354;
    goto <D.20698>;
    <D.20661>:
    iftmp.20 = __builtin_strcmp (str, "APP_CONFIG_FILE");
    <D.20698>:
    D.19355 = iftmp.20;
  }
  if (D.19355 == 0) goto <D.20699>; else goto <D.20700>;
  <D.20699>:
  D.20657 = add->setup;
  o = D.20657->configuration_file;
  goto <D.20701>;
  <D.20700>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20705 = "DYNAMIC_BASE";
      D.20706 = MEM[(const unsigned char *)D.20705];
      D.20707 = (int) D.20706;
      D.20708 = *__s2;
      D.20709 = (int) D.20708;
      __result = D.20707 - D.20709;
      {
        D.20710 = __s2_len != 0;
        D.20711 = __result == 0;
        D.20712 = D.20710 & D.20711;
        if (D.20712 != 0) goto <D.20713>; else goto <D.20714>;
        <D.20713>:
        D.20715 = &MEM[(void *)"DYNAMIC_BASE" + 1B];
        D.20716 = *D.20715;
        D.20717 = (int) D.20716;
        D.20718 = __s2 + 1;
        D.20719 = *D.20718;
        D.20720 = (int) D.20719;
        __result = D.20717 - D.20720;
        D.20721 = __s2_len > 1;
        D.20711 = __result == 0;
        D.20722 = D.20721 & D.20711;
        if (D.20722 != 0) goto <D.20723>; else goto <D.20724>;
        <D.20723>:
        D.20725 = &MEM[(void *)"DYNAMIC_BASE" + 2B];
        D.20726 = *D.20725;
        D.20727 = (int) D.20726;
        D.20728 = __s2 + 2;
        D.20729 = *D.20728;
        D.20730 = (int) D.20729;
        __result = D.20727 - D.20730;
        D.20731 = __s2_len > 2;
        D.20711 = __result == 0;
        D.20732 = D.20731 & D.20711;
        if (D.20732 != 0) goto <D.20733>; else goto <D.20734>;
        <D.20733>:
        D.20735 = &MEM[(void *)"DYNAMIC_BASE" + 3B];
        D.20736 = *D.20735;
        D.20737 = (int) D.20736;
        D.20738 = __s2 + 3;
        D.20739 = *D.20738;
        D.20740 = (int) D.20739;
        __result = D.20737 - D.20740;
        <D.20734>:
        <D.20724>:
        <D.20714>:
      }
      D.19363 = __result;
    }
    iftmp.21 = -D.19363;
    goto <D.20741>;
    <D.20704>:
    iftmp.21 = __builtin_strcmp (str, "DYNAMIC_BASE");
    <D.20741>:
    D.19364 = iftmp.21;
  }
  if (D.19364 == 0) goto <D.20742>; else goto <D.20743>;
  <D.20742>:
  D.20657 = add->setup;
  o = D.20657->dynamic_base;
  goto <D.20744>;
  <D.20743>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20748 = "APP_NAME";
      D.20749 = MEM[(const unsigned char *)D.20748];
      D.20750 = (int) D.20749;
      D.20751 = *__s2;
      D.20752 = (int) D.20751;
      __result = D.20750 - D.20752;
      {
        D.20753 = __s2_len != 0;
        D.20754 = __result == 0;
        D.20755 = D.20753 & D.20754;
        if (D.20755 != 0) goto <D.20756>; else goto <D.20757>;
        <D.20756>:
        D.20758 = &MEM[(void *)"APP_NAME" + 1B];
        D.20759 = *D.20758;
        D.20760 = (int) D.20759;
        D.20761 = __s2 + 1;
        D.20762 = *D.20761;
        D.20763 = (int) D.20762;
        __result = D.20760 - D.20763;
        D.20764 = __s2_len > 1;
        D.20754 = __result == 0;
        D.20765 = D.20764 & D.20754;
        if (D.20765 != 0) goto <D.20766>; else goto <D.20767>;
        <D.20766>:
        D.20768 = &MEM[(void *)"APP_NAME" + 2B];
        D.20769 = *D.20768;
        D.20770 = (int) D.20769;
        D.20771 = __s2 + 2;
        D.20772 = *D.20771;
        D.20773 = (int) D.20772;
        __result = D.20770 - D.20773;
        D.20774 = __s2_len > 2;
        D.20754 = __result == 0;
        D.20775 = D.20774 & D.20754;
        if (D.20775 != 0) goto <D.20776>; else goto <D.20777>;
        <D.20776>:
        D.20778 = &MEM[(void *)"APP_NAME" + 3B];
        D.20779 = *D.20778;
        D.20780 = (int) D.20779;
        D.20781 = __s2 + 3;
        D.20782 = *D.20781;
        D.20783 = (int) D.20782;
        __result = D.20780 - D.20783;
        <D.20777>:
        <D.20767>:
        <D.20757>:
      }
      D.19372 = __result;
    }
    iftmp.22 = -D.19372;
    goto <D.20784>;
    <D.20747>:
    iftmp.22 = __builtin_strcmp (str, "APP_NAME");
    <D.20784>:
    D.19373 = iftmp.22;
  }
  if (D.19373 == 0) goto <D.20785>; else goto <D.20786>;
  <D.20785>:
  D.20657 = add->setup;
  o = D.20657->application_name;
  goto <D.20787>;
  <D.20786>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20791 = "CACHE_BASE";
      D.20792 = MEM[(const unsigned char *)D.20791];
      D.20793 = (int) D.20792;
      D.20794 = *__s2;
      D.20795 = (int) D.20794;
      __result = D.20793 - D.20795;
      {
        D.20796 = __s2_len != 0;
        D.20797 = __result == 0;
        D.20798 = D.20796 & D.20797;
        if (D.20798 != 0) goto <D.20799>; else goto <D.20800>;
        <D.20799>:
        D.20801 = &MEM[(void *)"CACHE_BASE" + 1B];
        D.20802 = *D.20801;
        D.20803 = (int) D.20802;
        D.20804 = __s2 + 1;
        D.20805 = *D.20804;
        D.20806 = (int) D.20805;
        __result = D.20803 - D.20806;
        D.20807 = __s2_len > 1;
        D.20797 = __result == 0;
        D.20808 = D.20807 & D.20797;
        if (D.20808 != 0) goto <D.20809>; else goto <D.20810>;
        <D.20809>:
        D.20811 = &MEM[(void *)"CACHE_BASE" + 2B];
        D.20812 = *D.20811;
        D.20813 = (int) D.20812;
        D.20814 = __s2 + 2;
        D.20815 = *D.20814;
        D.20816 = (int) D.20815;
        __result = D.20813 - D.20816;
        D.20817 = __s2_len > 2;
        D.20797 = __result == 0;
        D.20818 = D.20817 & D.20797;
        if (D.20818 != 0) goto <D.20819>; else goto <D.20820>;
        <D.20819>:
        D.20821 = &MEM[(void *)"CACHE_BASE" + 3B];
        D.20822 = *D.20821;
        D.20823 = (int) D.20822;
        D.20824 = __s2 + 3;
        D.20825 = *D.20824;
        D.20826 = (int) D.20825;
        __result = D.20823 - D.20826;
        <D.20820>:
        <D.20810>:
        <D.20800>:
      }
      D.19381 = __result;
    }
    iftmp.23 = -D.19381;
    goto <D.20827>;
    <D.20790>:
    iftmp.23 = __builtin_strcmp (str, "CACHE_BASE");
    <D.20827>:
    D.19382 = iftmp.23;
  }
  if (D.19382 == 0) goto <D.20828>; else goto <D.20829>;
  <D.20828>:
  D.20657 = add->setup;
  o = D.20657->cache_path;
  goto <D.20830>;
  <D.20829>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20834 = "PRIVATE_BINPATH";
      D.20835 = MEM[(const unsigned char *)D.20834];
      D.20836 = (int) D.20835;
      D.20837 = *__s2;
      D.20838 = (int) D.20837;
      __result = D.20836 - D.20838;
      {
        D.20839 = __s2_len != 0;
        D.20840 = __result == 0;
        D.20841 = D.20839 & D.20840;
        if (D.20841 != 0) goto <D.20842>; else goto <D.20843>;
        <D.20842>:
        D.20844 = &MEM[(void *)"PRIVATE_BINPATH" + 1B];
        D.20845 = *D.20844;
        D.20846 = (int) D.20845;
        D.20847 = __s2 + 1;
        D.20848 = *D.20847;
        D.20849 = (int) D.20848;
        __result = D.20846 - D.20849;
        D.20850 = __s2_len > 1;
        D.20840 = __result == 0;
        D.20851 = D.20850 & D.20840;
        if (D.20851 != 0) goto <D.20852>; else goto <D.20853>;
        <D.20852>:
        D.20854 = &MEM[(void *)"PRIVATE_BINPATH" + 2B];
        D.20855 = *D.20854;
        D.20856 = (int) D.20855;
        D.20857 = __s2 + 2;
        D.20858 = *D.20857;
        D.20859 = (int) D.20858;
        __result = D.20856 - D.20859;
        D.20860 = __s2_len > 2;
        D.20840 = __result == 0;
        D.20861 = D.20860 & D.20840;
        if (D.20861 != 0) goto <D.20862>; else goto <D.20863>;
        <D.20862>:
        D.20864 = &MEM[(void *)"PRIVATE_BINPATH" + 3B];
        D.20865 = *D.20864;
        D.20866 = (int) D.20865;
        D.20867 = __s2 + 3;
        D.20868 = *D.20867;
        D.20869 = (int) D.20868;
        __result = D.20866 - D.20869;
        <D.20863>:
        <D.20853>:
        <D.20843>:
      }
      D.19390 = __result;
    }
    iftmp.24 = -D.19390;
    goto <D.20870>;
    <D.20833>:
    iftmp.24 = __builtin_strcmp (str, "PRIVATE_BINPATH");
    <D.20870>:
    D.19391 = iftmp.24;
  }
  if (D.19391 == 0) goto <D.20871>; else goto <D.20872>;
  <D.20871>:
  D.20657 = add->setup;
  o = D.20657->private_bin_path;
  goto <D.20873>;
  <D.20872>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20877 = "BINPATH_PROBE_ONLY";
      D.20878 = MEM[(const unsigned char *)D.20877];
      D.20879 = (int) D.20878;
      D.20880 = *__s2;
      D.20881 = (int) D.20880;
      __result = D.20879 - D.20881;
      {
        D.20882 = __s2_len != 0;
        D.20883 = __result == 0;
        D.20884 = D.20882 & D.20883;
        if (D.20884 != 0) goto <D.20885>; else goto <D.20886>;
        <D.20885>:
        D.20887 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 1B];
        D.20888 = *D.20887;
        D.20889 = (int) D.20888;
        D.20890 = __s2 + 1;
        D.20891 = *D.20890;
        D.20892 = (int) D.20891;
        __result = D.20889 - D.20892;
        D.20893 = __s2_len > 1;
        D.20883 = __result == 0;
        D.20894 = D.20893 & D.20883;
        if (D.20894 != 0) goto <D.20895>; else goto <D.20896>;
        <D.20895>:
        D.20897 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 2B];
        D.20898 = *D.20897;
        D.20899 = (int) D.20898;
        D.20900 = __s2 + 2;
        D.20901 = *D.20900;
        D.20902 = (int) D.20901;
        __result = D.20899 - D.20902;
        D.20903 = __s2_len > 2;
        D.20883 = __result == 0;
        D.20904 = D.20903 & D.20883;
        if (D.20904 != 0) goto <D.20905>; else goto <D.20906>;
        <D.20905>:
        D.20907 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 3B];
        D.20908 = *D.20907;
        D.20909 = (int) D.20908;
        D.20910 = __s2 + 3;
        D.20911 = *D.20910;
        D.20912 = (int) D.20911;
        __result = D.20909 - D.20912;
        <D.20906>:
        <D.20896>:
        <D.20886>:
      }
      D.19399 = __result;
    }
    iftmp.25 = -D.19399;
    goto <D.20913>;
    <D.20876>:
    iftmp.25 = __builtin_strcmp (str, "BINPATH_PROBE_ONLY");
    <D.20913>:
    D.19400 = iftmp.25;
  }
  if (D.19400 == 0) goto <D.20914>; else goto <D.20915>;
  <D.20914>:
  D.20657 = add->setup;
  o = D.20657->private_bin_path_probe;
  goto <D.20916>;
  <D.20915>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20920 = "SHADOW_COPY_DIRS";
      D.20921 = MEM[(const unsigned char *)D.20920];
      D.20922 = (int) D.20921;
      D.20923 = *__s2;
      D.20924 = (int) D.20923;
      __result = D.20922 - D.20924;
      {
        D.20925 = __s2_len != 0;
        D.20926 = __result == 0;
        D.20927 = D.20925 & D.20926;
        if (D.20927 != 0) goto <D.20928>; else goto <D.20929>;
        <D.20928>:
        D.20930 = &MEM[(void *)"SHADOW_COPY_DIRS" + 1B];
        D.20931 = *D.20930;
        D.20932 = (int) D.20931;
        D.20933 = __s2 + 1;
        D.20934 = *D.20933;
        D.20935 = (int) D.20934;
        __result = D.20932 - D.20935;
        D.20936 = __s2_len > 1;
        D.20926 = __result == 0;
        D.20937 = D.20936 & D.20926;
        if (D.20937 != 0) goto <D.20938>; else goto <D.20939>;
        <D.20938>:
        D.20940 = &MEM[(void *)"SHADOW_COPY_DIRS" + 2B];
        D.20941 = *D.20940;
        D.20942 = (int) D.20941;
        D.20943 = __s2 + 2;
        D.20944 = *D.20943;
        D.20945 = (int) D.20944;
        __result = D.20942 - D.20945;
        D.20946 = __s2_len > 2;
        D.20926 = __result == 0;
        D.20947 = D.20946 & D.20926;
        if (D.20947 != 0) goto <D.20948>; else goto <D.20949>;
        <D.20948>:
        D.20950 = &MEM[(void *)"SHADOW_COPY_DIRS" + 3B];
        D.20951 = *D.20950;
        D.20952 = (int) D.20951;
        D.20953 = __s2 + 3;
        D.20954 = *D.20953;
        D.20955 = (int) D.20954;
        __result = D.20952 - D.20955;
        <D.20949>:
        <D.20939>:
        <D.20929>:
      }
      D.19408 = __result;
    }
    iftmp.26 = -D.19408;
    goto <D.20956>;
    <D.20919>:
    iftmp.26 = __builtin_strcmp (str, "SHADOW_COPY_DIRS");
    <D.20956>:
    D.19409 = iftmp.26;
  }
  if (D.19409 == 0) goto <D.20957>; else goto <D.20958>;
  <D.20957>:
  D.20657 = add->setup;
  o = D.20657->shadow_copy_directories;
  goto <D.20959>;
  <D.20958>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20963 = "FORCE_CACHE_INSTALL";
      D.20964 = MEM[(const unsigned char *)D.20963];
      D.20965 = (int) D.20964;
      D.20966 = *__s2;
      D.20967 = (int) D.20966;
      __result = D.20965 - D.20967;
      {
        D.20968 = __s2_len != 0;
        D.20969 = __result == 0;
        D.20970 = D.20968 & D.20969;
        if (D.20970 != 0) goto <D.20971>; else goto <D.20972>;
        <D.20971>:
        D.20973 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 1B];
        D.20974 = *D.20973;
        D.20975 = (int) D.20974;
        D.20976 = __s2 + 1;
        D.20977 = *D.20976;
        D.20978 = (int) D.20977;
        __result = D.20975 - D.20978;
        D.20979 = __s2_len > 1;
        D.20969 = __result == 0;
        D.20980 = D.20979 & D.20969;
        if (D.20980 != 0) goto <D.20981>; else goto <D.20982>;
        <D.20981>:
        D.20983 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 2B];
        D.20984 = *D.20983;
        D.20985 = (int) D.20984;
        D.20986 = __s2 + 2;
        D.20987 = *D.20986;
        D.20988 = (int) D.20987;
        __result = D.20985 - D.20988;
        D.20989 = __s2_len > 2;
        D.20969 = __result == 0;
        D.20990 = D.20989 & D.20969;
        if (D.20990 != 0) goto <D.20991>; else goto <D.20992>;
        <D.20991>:
        D.20993 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 3B];
        D.20994 = *D.20993;
        D.20995 = (int) D.20994;
        D.20996 = __s2 + 3;
        D.20997 = *D.20996;
        D.20998 = (int) D.20997;
        __result = D.20995 - D.20998;
        <D.20992>:
        <D.20982>:
        <D.20972>:
      }
      D.19417 = __result;
    }
    iftmp.27 = -D.19417;
    goto <D.20999>;
    <D.20962>:
    iftmp.27 = __builtin_strcmp (str, "FORCE_CACHE_INSTALL");
    <D.20999>:
    D.19418 = iftmp.27;
  }
  if (D.19418 == 0) goto <D.21000>; else goto <D.21001>;
  <D.21000>:
  D.20657 = add->setup;
  o = D.20657->shadow_copy_files;
  goto <D.21002>;
  <D.21001>:
  D.21003 = add->env;
  o = mono_g_hash_table_lookup (D.21003, name);
  <D.21002>:
  <D.20959>:
  <D.20916>:
  <D.20873>:
  <D.20830>:
  <D.20787>:
  <D.20744>:
  <D.20701>:
  <D.20658>:
  {
    int ret;

    D.20607 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.20607);
    if (ret != 0) goto <D.21004>; else goto <D.21005>;
    <D.21004>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21005>:
    D.21006 = ret != 0;
    D.21007 = (long int) D.21006;
    D.21008 = __builtin_expect (D.21007, 0);
    if (D.21008 != 0) goto <D.21009>; else goto <D.21010>;
    <D.21009>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 634, "ret == 0");
    <D.21010>:
  }
  monoeg_g_free (str);
  if (o == 0B) goto <D.21011>; else goto <D.21012>;
  <D.21011>:
  D.21013 = 0B;
  return D.21013;
  <D.21012>:
  D.21013 = o;
  return D.21013;
}


ves_icall_System_AppDomain_SetData (struct MonoAppDomain * ad, struct MonoString * name, struct MonoObject * data)
{
  _Bool D.21015;
  long int D.21016;
  long int D.21017;
  _Bool D.21020;
  long int D.21021;
  long int D.21022;
  struct MonoException * D.21027;
  union mono_mutex_t * D.21028;
  _Bool D.21031;
  long int D.21032;
  long int D.21033;
  struct MonoGHashTable * D.21036;
  _Bool D.21039;
  long int D.21040;
  long int D.21041;
  struct MonoDomain * add;

  D.21015 = ad == 0B;
  D.21016 = (long int) D.21015;
  D.21017 = __builtin_expect (D.21016, 0);
  if (D.21017 != 0) goto <D.21018>; else goto <D.21019>;
  <D.21018>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 650, "ad != NULL");
  <D.21019>:
  add = ad->data;
  D.21020 = add == 0B;
  D.21021 = (long int) D.21020;
  D.21022 = __builtin_expect (D.21021, 0);
  if (D.21022 != 0) goto <D.21023>; else goto <D.21024>;
  <D.21023>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 652, "add != NULL");
  <D.21024>:
  if (name == 0B) goto <D.21025>; else goto <D.21026>;
  <D.21025>:
  D.21027 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.21027);
  <D.21026>:
  {
    int ret;

    D.21028 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.21028);
    if (ret != 0) goto <D.21029>; else goto <D.21030>;
    <D.21029>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21030>:
    D.21031 = ret != 0;
    D.21032 = (long int) D.21031;
    D.21033 = __builtin_expect (D.21032, 0);
    if (D.21033 != 0) goto <D.21034>; else goto <D.21035>;
    <D.21034>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 657, "ret == 0");
    <D.21035>:
  }
  D.21036 = add->env;
  mono_g_hash_table_insert (D.21036, name, data);
  {
    int ret;

    D.21028 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.21028);
    if (ret != 0) goto <D.21037>; else goto <D.21038>;
    <D.21037>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21038>:
    D.21039 = ret != 0;
    D.21040 = (long int) D.21039;
    D.21041 = __builtin_expect (D.21040, 0);
    if (D.21041 != 0) goto <D.21042>; else goto <D.21043>;
    <D.21042>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 661, "ret == 0");
    <D.21043>:
  }
}


ves_icall_System_AppDomain_getSetup (struct MonoAppDomain * ad)
{
  _Bool D.21044;
  long int D.21045;
  long int D.21046;
  struct MonoDomain * D.21049;
  _Bool D.21050;
  long int D.21051;
  long int D.21052;
  struct MonoAppDomainSetup * D.21055;

  D.21044 = ad == 0B;
  D.21045 = (long int) D.21044;
  D.21046 = __builtin_expect (D.21045, 0);
  if (D.21046 != 0) goto <D.21047>; else goto <D.21048>;
  <D.21047>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 669, "ad != NULL");
  <D.21048>:
  D.21049 = ad->data;
  D.21050 = D.21049 == 0B;
  D.21051 = (long int) D.21050;
  D.21052 = __builtin_expect (D.21051, 0);
  if (D.21052 != 0) goto <D.21053>; else goto <D.21054>;
  <D.21053>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 670, "ad->data != NULL");
  <D.21054>:
  D.21049 = ad->data;
  D.21055 = D.21049->setup;
  return D.21055;
}


ves_icall_System_AppDomain_getFriendlyName (struct MonoAppDomain * ad)
{
  _Bool D.21057;
  long int D.21058;
  long int D.21059;
  struct MonoDomain * D.21062;
  _Bool D.21063;
  long int D.21064;
  long int D.21065;
  struct MonoString * D.21068;
  char * D.21069;

  D.21057 = ad == 0B;
  D.21058 = (long int) D.21057;
  D.21059 = __builtin_expect (D.21058, 0);
  if (D.21059 != 0) goto <D.21060>; else goto <D.21061>;
  <D.21060>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 680, "ad != NULL");
  <D.21061>:
  D.21062 = ad->data;
  D.21063 = D.21062 == 0B;
  D.21064 = (long int) D.21063;
  D.21065 = __builtin_expect (D.21064, 0);
  if (D.21065 != 0) goto <D.21066>; else goto <D.21067>;
  <D.21066>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 681, "ad->data != NULL");
  <D.21067>:
  D.21062 = ad->data;
  D.21069 = D.21062->friendly_name;
  D.21062 = ad->data;
  D.21068 = mono_string_new (D.21062, D.21069);
  return D.21068;
}


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

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


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

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


mono_set_private_bin_path_from_config (struct MonoDomain * domain)
{
  struct MonoAppDomainSetup * D.21078;
  struct MonoString * D.21080;
  int D.21081;
  int D.21086;
  long unsigned int len.28;
  gchar * text.29;
  char D.21092;
  gchar * D.21095;
  char D.21096;
  gchar * D.21099;
  char D.21100;
  long unsigned int D.21103;
  long unsigned int D.21104;
  long int D.21105;
  sizetype D.21106;
  const gchar * D.21107;
  int D.21108;
  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.21075>; else goto <D.21077>;
      <D.21077>:
      D.21078 = domain->setup;
      if (D.21078 == 0B) goto <D.21075>; else goto <D.21079>;
      <D.21079>:
      D.21078 = domain->setup;
      D.21080 = D.21078->configuration_file;
      if (D.21080 == 0B) goto <D.21075>; else goto <D.21076>;
      <D.21075>:
      return;
      <D.21076>:
      D.21078 = domain->setup;
      D.21080 = D.21078->configuration_file;
      config_file_name = mono_string_to_utf8_checked (D.21080, &error);
      D.21081 = mono_error_ok (&error);
      if (D.21081 == 0) goto <D.21082>; else goto <D.21083>;
      <D.21082>:
      mono_error_cleanup (&error);
      goto free_and_out;
      <D.21083>:
      config_file_path = mono_portability_find_file (config_file_name, 1);
      if (config_file_path == 0B) goto <D.21084>; else goto <D.21085>;
      <D.21084>:
      config_file_path = config_file_name;
      <D.21085>:
      D.21086 = monoeg_g_file_get_contents (config_file_path, &text, &len, 0B);
      if (D.21086 == 0) goto free_and_out; else goto <D.21087>;
      <D.21087>:
      runtime_config.runtime_count = 0;
      runtime_config.assemblybinding_count = 0;
      runtime_config.domain = domain;
      runtime_config.filename = config_file_path;
      offset = 0;
      len.28 = len;
      if (len.28 > 3) goto <D.21089>; else goto <D.21090>;
      <D.21089>:
      text.29 = text;
      D.21092 = *text.29;
      if (D.21092 == -17) goto <D.21093>; else goto <D.21094>;
      <D.21093>:
      text.29 = text;
      D.21095 = text.29 + 1;
      D.21096 = *D.21095;
      if (D.21096 == -69) goto <D.21097>; else goto <D.21098>;
      <D.21097>:
      text.29 = text;
      D.21099 = text.29 + 2;
      D.21100 = *D.21099;
      if (D.21100 == -65) goto <D.21101>; else goto <D.21102>;
      <D.21101>:
      offset = 3;
      <D.21102>:
      <D.21098>:
      <D.21094>:
      <D.21090>:
      context = monoeg_g_markup_parse_context_new (&mono_parser, 0, &runtime_config, 0B);
      len.28 = len;
      D.21103 = (long unsigned int) offset;
      D.21104 = len.28 - D.21103;
      D.21105 = (long int) D.21104;
      text.29 = text;
      D.21106 = (sizetype) offset;
      D.21107 = text.29 + D.21106;
      D.21108 = monoeg_g_markup_parse_context_parse (context, D.21107, D.21105, 0B);
      if (D.21108 != 0) goto <D.21109>; else goto <D.21110>;
      <D.21109>:
      monoeg_g_markup_parse_context_end_parse (context, 0B);
      <D.21110>:
      monoeg_g_markup_parse_context_free (context);
      free_and_out:
      text.29 = text;
      monoeg_g_free (text.29);
      if (config_file_name != config_file_path) goto <D.21111>; else goto <D.21112>;
      <D.21111>:
      monoeg_g_free (config_file_name);
      <D.21112>:
      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.30;
  gchar * D.21120;
  const gchar * iftmp.31;
  gchar * D.21126;
  struct RuntimeConfig * state;
  const gchar * msg;
  const gchar * filename;

  state = user_data;
  if (state != 0B) goto <D.21119>; else goto <D.21117>;
  <D.21119>:
  D.21120 = state->filename;
  if (D.21120 != 0B) goto <D.21121>; else goto <D.21117>;
  <D.21121>:
  iftmp.30 = state->filename;
  goto <D.21118>;
  <D.21117>:
  iftmp.30 = "<unknown>";
  <D.21118>:
  filename = iftmp.30;
  if (error != 0B) goto <D.21125>; else goto <D.21123>;
  <D.21125>:
  D.21126 = error->message;
  if (D.21126 != 0B) goto <D.21127>; else goto <D.21123>;
  <D.21127>:
  iftmp.31 = error->message;
  goto <D.21124>;
  <D.21123>:
  iftmp.31 = "";
  <D.21124>:
  msg = iftmp.31;
  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.19509;
  int iftmp.32;
  int D.19508;
  const char[8] * D.21131;
  unsigned char D.21132;
  int D.21133;
  unsigned char D.21134;
  int D.21135;
  _Bool D.21136;
  _Bool D.21137;
  _Bool D.21138;
  const unsigned char * D.21141;
  unsigned char D.21142;
  int D.21143;
  const unsigned char * D.21144;
  unsigned char D.21145;
  int D.21146;
  _Bool D.21147;
  _Bool D.21148;
  const unsigned char * D.21151;
  unsigned char D.21152;
  int D.21153;
  const unsigned char * D.21154;
  unsigned char D.21155;
  int D.21156;
  _Bool D.21157;
  _Bool D.21158;
  const unsigned char * D.21161;
  unsigned char D.21162;
  int D.21163;
  const unsigned char * D.21164;
  unsigned char D.21165;
  int D.21166;
  int D.21170;
  int D.21171;
  int D.19518;
  int iftmp.33;
  int D.19517;
  const char[16] * D.21176;
  unsigned char D.21177;
  int D.21178;
  unsigned char D.21179;
  int D.21180;
  _Bool D.21181;
  _Bool D.21182;
  _Bool D.21183;
  const unsigned char * D.21186;
  unsigned char D.21187;
  int D.21188;
  const unsigned char * D.21189;
  unsigned char D.21190;
  int D.21191;
  _Bool D.21192;
  _Bool D.21193;
  const unsigned char * D.21196;
  unsigned char D.21197;
  int D.21198;
  const unsigned char * D.21199;
  unsigned char D.21200;
  int D.21201;
  _Bool D.21202;
  _Bool D.21203;
  const unsigned char * D.21206;
  unsigned char D.21207;
  int D.21208;
  const unsigned char * D.21209;
  unsigned char D.21210;
  int D.21211;
  int D.21215;
  int D.21216;
  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.21129>; else goto <D.21130>;
    <D.21129>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.21131 = "runtime";
      D.21132 = MEM[(const unsigned char *)D.21131];
      D.21133 = (int) D.21132;
      D.21134 = *__s2;
      D.21135 = (int) D.21134;
      __result = D.21133 - D.21135;
      {
        D.21136 = __s2_len != 0;
        D.21137 = __result == 0;
        D.21138 = D.21136 & D.21137;
        if (D.21138 != 0) goto <D.21139>; else goto <D.21140>;
        <D.21139>:
        D.21141 = &MEM[(void *)"runtime" + 1B];
        D.21142 = *D.21141;
        D.21143 = (int) D.21142;
        D.21144 = __s2 + 1;
        D.21145 = *D.21144;
        D.21146 = (int) D.21145;
        __result = D.21143 - D.21146;
        D.21147 = __s2_len > 1;
        D.21137 = __result == 0;
        D.21148 = D.21147 & D.21137;
        if (D.21148 != 0) goto <D.21149>; else goto <D.21150>;
        <D.21149>:
        D.21151 = &MEM[(void *)"runtime" + 2B];
        D.21152 = *D.21151;
        D.21153 = (int) D.21152;
        D.21154 = __s2 + 2;
        D.21155 = *D.21154;
        D.21156 = (int) D.21155;
        __result = D.21153 - D.21156;
        D.21157 = __s2_len > 2;
        D.21137 = __result == 0;
        D.21158 = D.21157 & D.21137;
        if (D.21158 != 0) goto <D.21159>; else goto <D.21160>;
        <D.21159>:
        D.21161 = &MEM[(void *)"runtime" + 3B];
        D.21162 = *D.21161;
        D.21163 = (int) D.21162;
        D.21164 = __s2 + 3;
        D.21165 = *D.21164;
        D.21166 = (int) D.21165;
        __result = D.21163 - D.21166;
        <D.21160>:
        <D.21150>:
        <D.21140>:
      }
      D.19508 = __result;
    }
    iftmp.32 = -D.19508;
    goto <D.21167>;
    <D.21130>:
    iftmp.32 = __builtin_strcmp (element_name, "runtime");
    <D.21167>:
    D.19509 = iftmp.32;
  }
  if (D.19509 == 0) goto <D.21168>; else goto <D.21169>;
  <D.21168>:
  D.21170 = runtime_config->runtime_count;
  D.21171 = D.21170 + -1;
  runtime_config->runtime_count = D.21171;
  goto <D.21172>;
  <D.21169>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.21176 = "assemblyBinding";
      D.21177 = MEM[(const unsigned char *)D.21176];
      D.21178 = (int) D.21177;
      D.21179 = *__s2;
      D.21180 = (int) D.21179;
      __result = D.21178 - D.21180;
      {
        D.21181 = __s2_len != 0;
        D.21182 = __result == 0;
        D.21183 = D.21181 & D.21182;
        if (D.21183 != 0) goto <D.21184>; else goto <D.21185>;
        <D.21184>:
        D.21186 = &MEM[(void *)"assemblyBinding" + 1B];
        D.21187 = *D.21186;
        D.21188 = (int) D.21187;
        D.21189 = __s2 + 1;
        D.21190 = *D.21189;
        D.21191 = (int) D.21190;
        __result = D.21188 - D.21191;
        D.21192 = __s2_len > 1;
        D.21182 = __result == 0;
        D.21193 = D.21192 & D.21182;
        if (D.21193 != 0) goto <D.21194>; else goto <D.21195>;
        <D.21194>:
        D.21196 = &MEM[(void *)"assemblyBinding" + 2B];
        D.21197 = *D.21196;
        D.21198 = (int) D.21197;
        D.21199 = __s2 + 2;
        D.21200 = *D.21199;
        D.21201 = (int) D.21200;
        __result = D.21198 - D.21201;
        D.21202 = __s2_len > 2;
        D.21182 = __result == 0;
        D.21203 = D.21202 & D.21182;
        if (D.21203 != 0) goto <D.21204>; else goto <D.21205>;
        <D.21204>:
        D.21206 = &MEM[(void *)"assemblyBinding" + 3B];
        D.21207 = *D.21206;
        D.21208 = (int) D.21207;
        D.21209 = __s2 + 3;
        D.21210 = *D.21209;
        D.21211 = (int) D.21210;
        __result = D.21208 - D.21211;
        <D.21205>:
        <D.21195>:
        <D.21185>:
      }
      D.19517 = __result;
    }
    iftmp.33 = -D.19517;
    goto <D.21212>;
    <D.21175>:
    iftmp.33 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.21212>:
    D.19518 = iftmp.33;
  }
  if (D.19518 == 0) goto <D.21213>; else goto <D.21214>;
  <D.21213>:
  D.21215 = runtime_config->assemblybinding_count;
  D.21216 = D.21215 + -1;
  runtime_config->assemblybinding_count = D.21216;
  <D.21214>:
  <D.21172>:
}


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.19475;
  int iftmp.34;
  int D.19474;
  const char[8] * D.21220;
  unsigned char D.21221;
  int D.21222;
  unsigned char D.21223;
  int D.21224;
  _Bool D.21225;
  _Bool D.21226;
  _Bool D.21227;
  const unsigned char * D.21230;
  unsigned char D.21231;
  int D.21232;
  const unsigned char * D.21233;
  unsigned char D.21234;
  int D.21235;
  _Bool D.21236;
  _Bool D.21237;
  const unsigned char * D.21240;
  unsigned char D.21241;
  int D.21242;
  const unsigned char * D.21243;
  unsigned char D.21244;
  int D.21245;
  _Bool D.21246;
  _Bool D.21247;
  const unsigned char * D.21250;
  unsigned char D.21251;
  int D.21252;
  const unsigned char * D.21253;
  unsigned char D.21254;
  int D.21255;
  int D.21259;
  int D.21260;
  int D.19484;
  int iftmp.35;
  int D.19483;
  const char[16] * D.21264;
  unsigned char D.21265;
  int D.21266;
  unsigned char D.21267;
  int D.21268;
  _Bool D.21269;
  _Bool D.21270;
  _Bool D.21271;
  const unsigned char * D.21274;
  unsigned char D.21275;
  int D.21276;
  const unsigned char * D.21277;
  unsigned char D.21278;
  int D.21279;
  _Bool D.21280;
  _Bool D.21281;
  const unsigned char * D.21284;
  unsigned char D.21285;
  int D.21286;
  const unsigned char * D.21287;
  unsigned char D.21288;
  int D.21289;
  _Bool D.21290;
  _Bool D.21291;
  const unsigned char * D.21294;
  unsigned char D.21295;
  int D.21296;
  const unsigned char * D.21297;
  unsigned char D.21298;
  int D.21299;
  int D.21303;
  int D.21304;
  signed long D.21305;
  long unsigned int D.21306;
  long unsigned int D.21307;
  int D.19493;
  int iftmp.36;
  int D.19492;
  const char[8] * D.21313;
  unsigned char D.21314;
  int D.21315;
  unsigned char D.21316;
  int D.21317;
  _Bool D.21318;
  _Bool D.21319;
  _Bool D.21320;
  const unsigned char * D.21323;
  unsigned char D.21324;
  int D.21325;
  const unsigned char * D.21326;
  unsigned char D.21327;
  int D.21328;
  _Bool D.21329;
  _Bool D.21330;
  const unsigned char * D.21333;
  unsigned char D.21334;
  int D.21335;
  const unsigned char * D.21336;
  unsigned char D.21337;
  int D.21338;
  _Bool D.21339;
  _Bool D.21340;
  const unsigned char * D.21343;
  unsigned char D.21344;
  int D.21345;
  const unsigned char * D.21346;
  unsigned char D.21347;
  int D.21348;
  struct MonoDomain * D.21352;
  gchar * D.21353;
  char * D.21354;
  char D.21357;
  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.21218>; else goto <D.21219>;
    <D.21218>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.21220 = "runtime";
      D.21221 = MEM[(const unsigned char *)D.21220];
      D.21222 = (int) D.21221;
      D.21223 = *__s2;
      D.21224 = (int) D.21223;
      __result = D.21222 - D.21224;
      {
        D.21225 = __s2_len != 0;
        D.21226 = __result == 0;
        D.21227 = D.21225 & D.21226;
        if (D.21227 != 0) goto <D.21228>; else goto <D.21229>;
        <D.21228>:
        D.21230 = &MEM[(void *)"runtime" + 1B];
        D.21231 = *D.21230;
        D.21232 = (int) D.21231;
        D.21233 = __s2 + 1;
        D.21234 = *D.21233;
        D.21235 = (int) D.21234;
        __result = D.21232 - D.21235;
        D.21236 = __s2_len > 1;
        D.21226 = __result == 0;
        D.21237 = D.21236 & D.21226;
        if (D.21237 != 0) goto <D.21238>; else goto <D.21239>;
        <D.21238>:
        D.21240 = &MEM[(void *)"runtime" + 2B];
        D.21241 = *D.21240;
        D.21242 = (int) D.21241;
        D.21243 = __s2 + 2;
        D.21244 = *D.21243;
        D.21245 = (int) D.21244;
        __result = D.21242 - D.21245;
        D.21246 = __s2_len > 2;
        D.21226 = __result == 0;
        D.21247 = D.21246 & D.21226;
        if (D.21247 != 0) goto <D.21248>; else goto <D.21249>;
        <D.21248>:
        D.21250 = &MEM[(void *)"runtime" + 3B];
        D.21251 = *D.21250;
        D.21252 = (int) D.21251;
        D.21253 = __s2 + 3;
        D.21254 = *D.21253;
        D.21255 = (int) D.21254;
        __result = D.21252 - D.21255;
        <D.21249>:
        <D.21239>:
        <D.21229>:
      }
      D.19474 = __result;
    }
    iftmp.34 = -D.19474;
    goto <D.21256>;
    <D.21219>:
    iftmp.34 = __builtin_strcmp (element_name, "runtime");
    <D.21256>:
    D.19475 = iftmp.34;
  }
  if (D.19475 == 0) goto <D.21257>; else goto <D.21258>;
  <D.21257>:
  D.21259 = runtime_config->runtime_count;
  D.21260 = D.21259 + 1;
  runtime_config->runtime_count = D.21260;
  return;
  <D.21258>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.21264 = "assemblyBinding";
      D.21265 = MEM[(const unsigned char *)D.21264];
      D.21266 = (int) D.21265;
      D.21267 = *__s2;
      D.21268 = (int) D.21267;
      __result = D.21266 - D.21268;
      {
        D.21269 = __s2_len != 0;
        D.21270 = __result == 0;
        D.21271 = D.21269 & D.21270;
        if (D.21271 != 0) goto <D.21272>; else goto <D.21273>;
        <D.21272>:
        D.21274 = &MEM[(void *)"assemblyBinding" + 1B];
        D.21275 = *D.21274;
        D.21276 = (int) D.21275;
        D.21277 = __s2 + 1;
        D.21278 = *D.21277;
        D.21279 = (int) D.21278;
        __result = D.21276 - D.21279;
        D.21280 = __s2_len > 1;
        D.21270 = __result == 0;
        D.21281 = D.21280 & D.21270;
        if (D.21281 != 0) goto <D.21282>; else goto <D.21283>;
        <D.21282>:
        D.21284 = &MEM[(void *)"assemblyBinding" + 2B];
        D.21285 = *D.21284;
        D.21286 = (int) D.21285;
        D.21287 = __s2 + 2;
        D.21288 = *D.21287;
        D.21289 = (int) D.21288;
        __result = D.21286 - D.21289;
        D.21290 = __s2_len > 2;
        D.21270 = __result == 0;
        D.21291 = D.21290 & D.21270;
        if (D.21291 != 0) goto <D.21292>; else goto <D.21293>;
        <D.21292>:
        D.21294 = &MEM[(void *)"assemblyBinding" + 3B];
        D.21295 = *D.21294;
        D.21296 = (int) D.21295;
        D.21297 = __s2 + 3;
        D.21298 = *D.21297;
        D.21299 = (int) D.21298;
        __result = D.21296 - D.21299;
        <D.21293>:
        <D.21283>:
        <D.21273>:
      }
      D.19483 = __result;
    }
    iftmp.35 = -D.19483;
    goto <D.21300>;
    <D.21263>:
    iftmp.35 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.21300>:
    D.19484 = iftmp.35;
  }
  if (D.19484 == 0) goto <D.21301>; else goto <D.21302>;
  <D.21301>:
  D.21303 = runtime_config->assemblybinding_count;
  D.21304 = D.21303 + 1;
  runtime_config->assemblybinding_count = D.21304;
  return;
  <D.21302>:
  D.21305 = BIT_FIELD_REF <*runtime_config, 64, 0>;
  D.21306 = (long unsigned int) D.21305;
  D.21307 = D.21306;
  if (D.21307 != 4294967297) goto <D.21308>; else goto <D.21309>;
  <D.21308>:
  return;
  <D.21309>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.21313 = "probing";
      D.21314 = MEM[(const unsigned char *)D.21313];
      D.21315 = (int) D.21314;
      D.21316 = *__s2;
      D.21317 = (int) D.21316;
      __result = D.21315 - D.21317;
      {
        D.21318 = __s2_len != 0;
        D.21319 = __result == 0;
        D.21320 = D.21318 & D.21319;
        if (D.21320 != 0) goto <D.21321>; else goto <D.21322>;
        <D.21321>:
        D.21323 = &MEM[(void *)"probing" + 1B];
        D.21324 = *D.21323;
        D.21325 = (int) D.21324;
        D.21326 = __s2 + 1;
        D.21327 = *D.21326;
        D.21328 = (int) D.21327;
        __result = D.21325 - D.21328;
        D.21329 = __s2_len > 1;
        D.21319 = __result == 0;
        D.21330 = D.21329 & D.21319;
        if (D.21330 != 0) goto <D.21331>; else goto <D.21332>;
        <D.21331>:
        D.21333 = &MEM[(void *)"probing" + 2B];
        D.21334 = *D.21333;
        D.21335 = (int) D.21334;
        D.21336 = __s2 + 2;
        D.21337 = *D.21336;
        D.21338 = (int) D.21337;
        __result = D.21335 - D.21338;
        D.21339 = __s2_len > 2;
        D.21319 = __result == 0;
        D.21340 = D.21339 & D.21319;
        if (D.21340 != 0) goto <D.21341>; else goto <D.21342>;
        <D.21341>:
        D.21343 = &MEM[(void *)"probing" + 3B];
        D.21344 = *D.21343;
        D.21345 = (int) D.21344;
        D.21346 = __s2 + 3;
        D.21347 = *D.21346;
        D.21348 = (int) D.21347;
        __result = D.21345 - D.21348;
        <D.21342>:
        <D.21332>:
        <D.21322>:
      }
      D.19492 = __result;
    }
    iftmp.36 = -D.19492;
    goto <D.21349>;
    <D.21312>:
    iftmp.36 = __builtin_strcmp (element_name, "probing");
    <D.21349>:
    D.19493 = iftmp.36;
  }
  if (D.19493 != 0) goto <D.21350>; else goto <D.21351>;
  <D.21350>:
  return;
  <D.21351>:
  D.21352 = runtime_config->domain;
  D.21353 = D.21352->private_bin_path;
  monoeg_g_free (D.21353);
  D.21352 = runtime_config->domain;
  D.21354 = get_attribute_value (attribute_names, attribute_values, "privatePath");
  D.21352->private_bin_path = D.21354;
  D.21352 = runtime_config->domain;
  D.21353 = D.21352->private_bin_path;
  if (D.21353 != 0B) goto <D.21355>; else goto <D.21356>;
  <D.21355>:
  D.21352 = runtime_config->domain;
  D.21353 = D.21352->private_bin_path;
  D.21357 = *D.21353;
  if (D.21357 == 0) goto <D.21358>; else goto <D.21359>;
  <D.21358>:
  D.21352 = runtime_config->domain;
  D.21353 = D.21352->private_bin_path;
  monoeg_g_free (D.21353);
  D.21352 = runtime_config->domain;
  D.21352->private_bin_path = 0B;
  return;
  <D.21359>:
  <D.21356>:
}


get_attribute_value (const gchar * * attribute_names, const gchar * * attribute_values, const char * att_name)
{
  int D.19454;
  long unsigned int D.21361;
  long unsigned int D.21362;
  const gchar * * D.21363;
  const gchar * D.21364;
  char * D.21367;
  const gchar * * D.21368;
  const gchar * D.21369;
  int n;

  n = 0;
  goto <D.19456>;
  <D.19455>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.21361 = (long unsigned int) n;
    D.21362 = D.21361 * 8;
    D.21363 = attribute_names + D.21362;
    D.21364 = *D.21363;
    D.19454 = __builtin_strcmp (D.21364, att_name);
  }
  if (D.19454 == 0) goto <D.21365>; else goto <D.21366>;
  <D.21365>:
  D.21361 = (long unsigned int) n;
  D.21362 = D.21361 * 8;
  D.21368 = attribute_values + D.21362;
  D.21369 = *D.21368;
  D.21367 = monoeg_strdup (D.21369);
  return D.21367;
  <D.21366>:
  n = n + 1;
  <D.19456>:
  D.21361 = (long unsigned int) n;
  D.21362 = D.21361 * 8;
  D.21363 = attribute_names + D.21362;
  D.21364 = *D.21363;
  if (D.21364 != 0B) goto <D.19455>; else goto <D.19457>;
  <D.19457>:
  D.21367 = 0B;
  return D.21367;
}


ves_icall_System_AppDomain_createDomain (struct MonoString * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoAppDomain * D.21371;
  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.21371 = ad;
  return D.21371;
}


ves_icall_System_AppDomain_GetAssemblies (struct MonoAppDomain * ad, MonoBoolean refonly)
{
  struct MonoClass * System_Reflection_Assembly.37;
  struct MonoImage * D.21376;
  struct MonoClass * System_Reflection_Assembly.38;
  union mono_mutex_t * D.21378;
  _Bool D.21381;
  long int D.21382;
  long int D.21383;
  int D.21386;
  int D.21387;
  unsigned char D.21390;
  _Bool D.21395;
  long int D.21396;
  long int D.21397;
  unsigned int D.21400;
  long unsigned int D.21401;
  void * * D.21402;
  long unsigned int D.21403;
  long unsigned int D.21404;
  void * * D.21405;
  long unsigned int D.21406;
  struct MonoReflectionAssembly * D.21407;
  unsigned int i.39;
  struct MonoArray * D.21409;
  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.37 = System_Reflection_Assembly;
  if (System_Reflection_Assembly.37 == 0B) goto <D.21374>; else goto <D.21375>;
  <D.21374>:
  D.21376 = mono_defaults.corlib;
  System_Reflection_Assembly.38 = mono_class_from_name (D.21376, "System.Reflection", "Assembly");
  System_Reflection_Assembly = System_Reflection_Assembly.38;
  <D.21375>:
  assemblies = monoeg_g_ptr_array_new ();
  {
    int ret;

    D.21378 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21378);
    if (ret != 0) goto <D.21379>; else goto <D.21380>;
    <D.21379>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21380>:
    D.21381 = ret != 0;
    D.21382 = (long int) D.21381;
    D.21383 = __builtin_expect (D.21382, 0);
    if (D.21383 != 0) goto <D.21384>; else goto <D.21385>;
    <D.21384>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 874, "ret == 0");
    <D.21385>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19560>;
  <D.19559>:
  ass = tmp->data;
  D.21386 = (int) refonly;
  D.21387 = ass->ref_only;
  if (D.21386 != D.21387) goto <D.21388>; else goto <D.21389>;
  <D.21388>:
  // predicted unlikely by continue predictor.
  goto <D.19558>;
  <D.21389>:
  D.21390 = ass->corlib_internal;
  if (D.21390 != 0) goto <D.21391>; else goto <D.21392>;
  <D.21391>:
  // predicted unlikely by continue predictor.
  goto <D.19558>;
  <D.21392>:
  monoeg_g_ptr_array_add (assemblies, ass);
  <D.19558>:
  tmp = tmp->next;
  <D.19560>:
  if (tmp != 0B) goto <D.19559>; else goto <D.19561>;
  <D.19561>:
  {
    int ret;

    D.21378 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21378);
    if (ret != 0) goto <D.21393>; else goto <D.21394>;
    <D.21393>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21394>:
    D.21395 = ret != 0;
    D.21396 = (long int) D.21395;
    D.21397 = __builtin_expect (D.21396, 0);
    if (D.21397 != 0) goto <D.21398>; else goto <D.21399>;
    <D.21398>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 883, "ret == 0");
    <D.21399>:
  }
  D.21400 = assemblies->len;
  D.21401 = (long unsigned int) D.21400;
  System_Reflection_Assembly.37 = System_Reflection_Assembly;
  res = mono_array_new (domain, System_Reflection_Assembly.37, D.21401);
  i = 0;
  goto <D.19565>;
  <D.19564>:
  D.21402 = assemblies->pdata;
  D.21403 = (long unsigned int) i;
  D.21404 = D.21403 * 8;
  D.21405 = D.21402 + D.21404;
  ass = *D.21405;
  {
    void * * __p;

    D.21406 = (long unsigned int) i;
    __p = mono_array_addr_with_size (res, 8, D.21406);
    D.21407 = mono_assembly_get_object (domain, ass);
    mono_gc_wbarrier_set_arrayref (res, __p, D.21407);
  }
  i = i + 1;
  <D.19565>:
  i.39 = (unsigned int) i;
  D.21400 = assemblies->len;
  if (i.39 < D.21400) goto <D.19564>; else goto <D.19566>;
  <D.19566>:
  monoeg_g_ptr_array_free (assemblies, 1);
  D.21409 = res;
  return D.21409;
}


mono_try_assembly_resolve (struct MonoDomain * domain, struct MonoString * fname, gboolean refonly)
{
  int D.21411;
  struct MonoReflectionAssembly * D.21414;
  _Bool D.21415;
  _Bool D.21416;
  _Bool D.21417;
  int D.21418;
  _Bool D.21419;
  long int D.21420;
  long int D.21421;
  struct MonoAppDomain * D.21424;
  struct MonoVTable * D.21425;
  _Bool D.21426;
  long int D.21427;
  long int D.21428;
  _Bool D.21433;
  unsigned char isrefonly.40;
  struct MonoClass * klass;
  struct MonoMethod * method;
  MonoBoolean isrefonly;
  void * params[2];

  try
    {
      D.21411 = mono_runtime_get_no_exec ();
      if (D.21411 != 0) goto <D.21412>; else goto <D.21413>;
      <D.21412>:
      D.21414 = 0B;
      return D.21414;
      <D.21413>:
      D.21415 = domain == 0B;
      D.21416 = fname == 0B;
      D.21417 = D.21415 | D.21416;
      D.21418 = (int) D.21417;
      D.21419 = D.21418 != 0;
      D.21420 = (long int) D.21419;
      D.21421 = __builtin_expect (D.21420, 0);
      if (D.21421 != 0) goto <D.21422>; else goto <D.21423>;
      <D.21422>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 907, "domain != NULL && fname != NULL");
      <D.21423>:
      D.21424 = domain->domain;
      D.21425 = D.21424->mbr.obj.vtable;
      klass = D.21425->klass;
      D.21426 = klass == 0B;
      D.21427 = (long int) D.21426;
      D.21428 = __builtin_expect (D.21427, 0);
      if (D.21428 != 0) goto <D.21429>; else goto <D.21430>;
      <D.21429>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 910, "klass");
      <D.21430>:
      method = mono_class_get_method_from_name (klass, "DoAssemblyResolve", -1);
      if (method == 0B) goto <D.21431>; else goto <D.21432>;
      <D.21431>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoAssemblyResolve not found.\n");
      D.21414 = 0B;
      return D.21414;
      <D.21432>:
      D.21433 = refonly != 0;
      isrefonly.40 = (unsigned char) D.21433;
      isrefonly = isrefonly.40;
      params[0] = fname;
      params[1] = &isrefonly;
      D.21424 = domain->domain;
      D.21414 = mono_runtime_invoke (method, D.21424, &params, 0B);
      return D.21414;
    }
  finally
    {
      isrefonly = {CLOBBER};
      params = {CLOBBER};
    }
}


mono_is_shadow_copy_enabled (struct MonoDomain * domain, const gchar * dir_name)
{
  gboolean D.21439;
  struct MonoString * D.21443;
  int D.21444;
  int D.21447;
  _Bool D.21448;
  struct MonoString * D.21451;
  int D.21454;
  char * D.21457;
  int D.21460;
  gchar * D.21463;
  char D.21464;
  int D.19768;
  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.21437>; else goto <D.21438>;
      <D.21437>:
      D.21439 = 0;
      return D.21439;
      <D.21438>:
      setup = domain->setup;
      if (setup == 0B) goto <D.21440>; else goto <D.21442>;
      <D.21442>:
      D.21443 = setup->shadow_copy_files;
      if (D.21443 == 0B) goto <D.21440>; else goto <D.21441>;
      <D.21440>:
      D.21439 = 0;
      return D.21439;
      <D.21441>:
      D.21443 = setup->shadow_copy_files;
      shadow_status_string = mono_string_to_utf8_checked (D.21443, &error);
      D.21444 = mono_error_ok (&error);
      if (D.21444 == 0) goto <D.21445>; else goto <D.21446>;
      <D.21445>:
      mono_error_cleanup (&error);
      D.21439 = 0;
      return D.21439;
      <D.21446>:
      D.21447 = monoeg_g_ascii_strncasecmp (shadow_status_string, "true", 4);
      D.21448 = D.21447 == 0;
      shadow_enabled = (gboolean) D.21448;
      monoeg_g_free (shadow_status_string);
      if (shadow_enabled == 0) goto <D.21449>; else goto <D.21450>;
      <D.21449>:
      D.21439 = 0;
      return D.21439;
      <D.21450>:
      D.21451 = setup->shadow_copy_directories;
      if (D.21451 == 0B) goto <D.21452>; else goto <D.21453>;
      <D.21452>:
      D.21439 = 1;
      return D.21439;
      <D.21453>:
      base_dir = get_shadow_assembly_location_base (domain, &error);
      D.21454 = mono_error_ok (&error);
      if (D.21454 == 0) goto <D.21455>; else goto <D.21456>;
      <D.21455>:
      mono_error_cleanup (&error);
      D.21439 = 0;
      return D.21439;
      <D.21456>:
      D.21457 = strstr (dir_name, base_dir);
      if (D.21457 != 0B) goto <D.21458>; else goto <D.21459>;
      <D.21458>:
      monoeg_g_free (base_dir);
      D.21439 = 1;
      return D.21439;
      <D.21459>:
      monoeg_g_free (base_dir);
      D.21451 = setup->shadow_copy_directories;
      all_dirs = mono_string_to_utf8_checked (D.21451, &error);
      D.21460 = mono_error_ok (&error);
      if (D.21460 == 0) goto <D.21461>; else goto <D.21462>;
      <D.21461>:
      mono_error_cleanup (&error);
      D.21439 = 0;
      return D.21439;
      <D.21462>:
      directories = monoeg_g_strsplit (all_dirs, ":", 1000);
      dir_ptr = directories;
      goto <D.19771>;
      <D.19770>:
      D.21463 = *dir_ptr;
      D.21464 = *D.21463;
      if (D.21464 != 0) goto <D.21465>; else goto <D.21466>;
      <D.21465>:
      {
        size_t __s1_len;
        size_t __s2_len;

        D.21463 = *dir_ptr;
        D.19768 = __builtin_strcmp (D.21463, dir_name);
      }
      if (D.19768 == 0) goto <D.21467>; else goto <D.21468>;
      <D.21467>:
      found = 1;
      goto <D.19769>;
      <D.21468>:
      <D.21466>:
      dir_ptr = dir_ptr + 8;
      <D.19771>:
      D.21463 = *dir_ptr;
      if (D.21463 != 0B) goto <D.19770>; else goto <D.19769>;
      <D.19769>:
      monoeg_g_strfreev (directories);
      monoeg_g_free (all_dirs);
      D.21439 = found;
      return D.21439;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_make_shadow_copy (const char * filename)
{
  int D.21471;
  char * D.21474;
  int D.21475;
  char * D.21478;
  int D.21481;
  int D.21484;
  int D.21487;
  long unsigned int D.21490;
  long int D.21491;
  long unsigned int D.21492;
  long int D.21493;
  long unsigned int D.21500;
  long unsigned int D.21501;
  int D.21506;
  long int D.21509;
  long int D.21510;
  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.21471 = mono_is_shadow_copy_enabled (domain, dir_name);
      if (D.21471 == 0) goto <D.21472>; else goto <D.21473>;
      <D.21472>:
      monoeg_g_free (dir_name);
      D.21474 = filename;
      return D.21474;
      <D.21473>:
      shadow_dir = get_shadow_assembly_location_base (domain, &error);
      D.21475 = mono_error_ok (&error);
      if (D.21475 == 0) goto <D.21476>; else goto <D.21477>;
      <D.21476>:
      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.21477>:
      D.21478 = strstr (dir_name, shadow_dir);
      if (D.21478 != 0B) goto <D.21479>; else goto <D.21480>;
      <D.21479>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      D.21474 = filename;
      return D.21474;
      <D.21480>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      shadow = get_shadow_assembly_location (filename, &error);
      D.21481 = mono_error_ok (&error);
      if (D.21481 == 0) goto <D.21482>; else goto <D.21483>;
      <D.21482>:
      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.21483>:
      D.21484 = ensure_directory_exists (shadow);
      if (D.21484 == 0) goto <D.21485>; else goto <D.21486>;
      <D.21485>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (ensure directory exists).");
      mono_raise_exception (exc);
      <D.21486>:
      D.21487 = private_file_needs_copying (filename, &src_sbuf, shadow);
      if (D.21487 == 0) goto <D.21488>; else goto <D.21489>;
      <D.21488>:
      D.21474 = shadow;
      return D.21474;
      <D.21489>:
      D.21490 = strlen (filename);
      D.21491 = (long int) D.21490;
      orig = monoeg_g_utf8_to_utf16 (filename, D.21491, 0B, 0B, 0B);
      D.21492 = strlen (shadow);
      D.21493 = (long int) D.21492;
      dest = monoeg_g_utf8_to_utf16 (shadow, D.21493, 0B, 0B, 0B);
      DeleteFile (dest);
      attrs = GetFileAttributes (orig);
      if (attrs == 4294967295) goto <D.21494>; else goto <D.21495>;
      <D.21494>:
      monoeg_g_free (shadow);
      D.21474 = filename;
      return D.21474;
      <D.21495>:
      copy_result = CopyFile (orig, dest, 0);
      if (copy_result != 0) goto <D.21496>; else goto <D.21497>;
      <D.21496>:
      copy_result = SetFileAttributes (dest, 128);
      <D.21497>:
      monoeg_g_free (dest);
      monoeg_g_free (orig);
      if (copy_result == 0) goto <D.21498>; else goto <D.21499>;
      <D.21498>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (CopyFile).");
      mono_raise_exception (exc);
      <D.21499>:
      sibling_source = monoeg_g_strconcat (filename, ".config", 0B);
      D.21500 = strlen (sibling_source);
      sibling_source_len = (gint) D.21500;
      sibling_target = monoeg_g_strconcat (shadow, ".config", 0B);
      D.21501 = strlen (sibling_target);
      sibling_target_len = (gint) D.21501;
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
      if (copy_result == 1) goto <D.21502>; else goto <D.21503>;
      <D.21502>:
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);
      <D.21503>:
      monoeg_g_free (sibling_source);
      monoeg_g_free (sibling_target);
      if (copy_result == 0) goto <D.21504>; else goto <D.21505>;
      <D.21504>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy of sibling data (CopyFile).");
      mono_raise_exception (exc);
      <D.21505>:
      D.21506 = shadow_copy_create_ini (shadow, filename);
      if (D.21506 == 0) goto <D.21507>; else goto <D.21508>;
      <D.21507>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy .ini file.");
      mono_raise_exception (exc);
      <D.21508>:
      D.21509 = src_sbuf.st_atim.tv_sec;
      utbuf.actime = D.21509;
      D.21510 = src_sbuf.st_mtim.tv_sec;
      utbuf.modtime = D.21510;
      utime (shadow, &utbuf);
      D.21474 = shadow;
      return D.21474;
    }
  finally
    {
      error = {CLOBBER};
      src_sbuf = {CLOBBER};
      utbuf = {CLOBBER};
    }
}


get_shadow_assembly_location (const char * filename, struct MonoError * error)
{
  int D.21513;
  int D.21514;
  int D.21515;
  char * D.21518;
  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.21513 = domain->shadow_serial;
      D.21514 = hash ^ hash2;
      monoeg_g_snprintf (&path_hash, 30, "%08x_%08x_%08x", D.21514, hash2, D.21513);
      tmploc = get_shadow_assembly_location_base (domain, error);
      D.21515 = mono_error_ok (error);
      if (D.21515 == 0) goto <D.21516>; else goto <D.21517>;
      <D.21516>:
      monoeg_g_free (bname);
      monoeg_g_free (dirname);
      D.21518 = 0B;
      return D.21518;
      <D.21517>:
      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.21518 = location;
      return D.21518;
    }
  finally
    {
      name_hash = {CLOBBER};
      path_hash = {CLOBBER};
    }
}


get_cstring_hash (const char * str)
{
  char D.21524;
  gint32 D.21525;
  long unsigned int D.21526;
  int D.21527;
  int D.21528;
  char D.21529;
  int D.21530;
  int len;
  int i;
  const char * p;
  gint32 h;

  h = 0;
  if (str == 0B) goto <D.21521>; else goto <D.21523>;
  <D.21523>:
  D.21524 = *str;
  if (D.21524 == 0) goto <D.21521>; else goto <D.21522>;
  <D.21521>:
  D.21525 = 0;
  return D.21525;
  <D.21522>:
  D.21526 = strlen (str);
  len = (int) D.21526;
  p = str;
  i = 0;
  goto <D.19687>;
  <D.19686>:
  D.21527 = h << 5;
  D.21528 = D.21527 - h;
  D.21529 = *p;
  D.21530 = (int) D.21529;
  h = D.21528 + D.21530;
  p = p + 1;
  i = i + 1;
  <D.19687>:
  if (i < len) goto <D.19686>; else goto <D.19688>;
  <D.19688>:
  D.21525 = h;
  return D.21525;
}


ensure_directory_exists (const char * filename)
{
  char D.21535;
  gboolean D.21536;
  int D.21537;
  unsigned int D.21540;
  unsigned int D.21541;
  char D.21544;
  int * D.21549;
  int D.21550;
  char * p.41;
  char * p;
  gchar * dir;
  int retval;
  struct stat sbuf;

  try
    {
      dir = monoeg_g_path_get_dirname (filename);
      if (dir == 0B) goto <D.21532>; else goto <D.21534>;
      <D.21534>:
      D.21535 = *dir;
      if (D.21535 == 0) goto <D.21532>; else goto <D.21533>;
      <D.21532>:
      monoeg_g_free (dir);
      D.21536 = 0;
      return D.21536;
      <D.21533>:
      D.21537 = stat (dir, &sbuf);
      if (D.21537 == 0) goto <D.21538>; else goto <D.21539>;
      <D.21538>:
      D.21540 = sbuf.st_mode;
      D.21541 = D.21540 & 61440;
      if (D.21541 == 16384) goto <D.21542>; else goto <D.21543>;
      <D.21542>:
      monoeg_g_free (dir);
      D.21536 = 1;
      return D.21536;
      <D.21543>:
      <D.21539>:
      p = dir;
      goto <D.19723>;
      <D.19722>:
      p = p + 1;
      <D.19723>:
      D.21544 = *p;
      if (D.21544 == 47) goto <D.19722>; else goto <D.19724>;
      <D.19724>:
      <D.19726>:
      p = __builtin_strchr (p, 47);
      if (p != 0B) goto <D.21545>; else goto <D.21546>;
      <D.21545>:
      *p = 0;
      <D.21546>:
      retval = mkdir (dir, 511);
      if (retval != 0) goto <D.21547>; else goto <D.21548>;
      <D.21547>:
      D.21549 = __errno_location ();
      D.21550 = *D.21549;
      if (D.21550 != 17) goto <D.21551>; else goto <D.21552>;
      <D.21551>:
      monoeg_g_free (dir);
      D.21536 = 0;
      return D.21536;
      <D.21552>:
      <D.21548>:
      if (p == 0B) goto <D.19725>; else goto <D.21553>;
      <D.21553>:
      p.41 = p;
      p = p.41 + 1;
      *p.41 = 47;
      goto <D.19726>;
      <D.19725>:
      monoeg_g_free (dir);
      D.21536 = 1;
      return D.21536;
    }
  finally
    {
      sbuf = {CLOBBER};
    }
}


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

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


private_file_needs_copying (const char * src, struct stat * sbuf_src, char * dest)
{
  int D.21562;
  gboolean D.21567;
  int D.21570;
  long int D.21573;
  long int D.21574;
  long int D.21577;
  long int D.21578;
  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.21559>; else goto <D.21560>;
      <D.21559>:
      stat_src = src;
      goto <D.21561>;
      <D.21560>:
      stat_src = real_src;
      <D.21561>:
      D.21562 = stat (stat_src, sbuf_src);
      if (D.21562 == -1) goto <D.21563>; else goto <D.21564>;
      <D.21563>:
      {
        time_t tnow;

        tnow = time (0B);
        if (real_src != 0B) goto <D.21565>; else goto <D.21566>;
        <D.21565>:
        monoeg_g_free (real_src);
        <D.21566>:
        memset (sbuf_src, 0, 144);
        sbuf_src->st_mtim.tv_sec = tnow;
        sbuf_src->st_atim.tv_sec = tnow;
        D.21567 = 1;
        return D.21567;
      }
      <D.21564>:
      if (real_src != 0B) goto <D.21568>; else goto <D.21569>;
      <D.21568>:
      monoeg_g_free (real_src);
      <D.21569>:
      D.21570 = stat (dest, &sbuf_dest);
      if (D.21570 == -1) goto <D.21571>; else goto <D.21572>;
      <D.21571>:
      D.21567 = 1;
      return D.21567;
      <D.21572>:
      D.21573 = sbuf_src->st_size;
      D.21574 = sbuf_dest.st_size;
      if (D.21573 == D.21574) goto <D.21575>; else goto <D.21576>;
      <D.21575>:
      D.21577 = sbuf_src->st_mtim.tv_sec;
      D.21578 = sbuf_dest.st_mtim.tv_sec;
      if (D.21577 == D.21578) goto <D.21579>; else goto <D.21580>;
      <D.21579>:
      D.21567 = 0;
      return D.21567;
      <D.21580>:
      <D.21576>:
      D.21567 = 1;
      return D.21567;
    }
  finally
    {
      sbuf_dest = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.21585;
  int D.21590;
  void * D.21592;
  long unsigned int D.21593;

  D.21585 = __builtin_constant_p (__len);
  if (D.21585 != 0) goto <D.21586>; else goto <D.21587>;
  <D.21586>:
  if (__len == 0) goto <D.21588>; else goto <D.21589>;
  <D.21588>:
  D.21590 = __builtin_constant_p (__ch);
  if (D.21590 == 0) goto <D.21583>; else goto <D.21591>;
  <D.21591>:
  if (__ch != 0) goto <D.21583>; else goto <D.21584>;
  <D.21583>:
  __warn_memset_zero_len ();
  D.21592 = __dest;
  return D.21592;
  <D.21584>:
  <D.21589>:
  <D.21587>:
  D.21593 = __builtin_object_size (__dest, 0);
  D.21592 = __builtin___memset_chk (__dest, __ch, __len, D.21593);
  return D.21592;
}


shadow_copy_sibling (gchar * src, gint srclen, const char * extension, gchar * target, gint targetlen, gint tail_len)
{
  sizetype D.21595;
  sizetype D.21596;
  sizetype D.21597;
  gchar * D.21598;
  int __mono_io_portability_helpers.42;
  int D.21600;
  gboolean D.21605;
  int D.21607;
  long unsigned int D.21610;
  long int D.21611;
  sizetype D.21612;
  sizetype D.21613;
  gchar * D.21614;
  long unsigned int D.21615;
  long int D.21616;
  guint16 * orig;
  guint16 * dest;
  gboolean copy_result;

  D.21595 = (sizetype) srclen;
  D.21596 = (sizetype) tail_len;
  D.21597 = D.21595 - D.21596;
  D.21598 = src + D.21597;
  strcpy (D.21598, extension);
  __mono_io_portability_helpers.42 = __mono_io_portability_helpers;
  D.21600 = __mono_io_portability_helpers.42 & 4;
  if (D.21600 != 0) goto <D.21601>; else goto <D.21602>;
  <D.21601>:
  {
    gchar * file;

    file = mono_portability_find_file (src, 1);
    if (file == 0B) goto <D.21603>; else goto <D.21604>;
    <D.21603>:
    D.21605 = 1;
    return D.21605;
    <D.21604>:
    monoeg_g_free (file);
  }
  goto <D.21606>;
  <D.21602>:
  D.21607 = monoeg_g_file_test (src, 1);
  if (D.21607 == 0) goto <D.21608>; else goto <D.21609>;
  <D.21608>:
  D.21605 = 1;
  return D.21605;
  <D.21609>:
  <D.21606>:
  D.21610 = strlen (src);
  D.21611 = (long int) D.21610;
  orig = monoeg_g_utf8_to_utf16 (src, D.21611, 0B, 0B, 0B);
  D.21612 = (sizetype) targetlen;
  D.21596 = (sizetype) tail_len;
  D.21613 = D.21612 - D.21596;
  D.21614 = target + D.21613;
  strcpy (D.21614, extension);
  D.21615 = strlen (target);
  D.21616 = (long int) D.21615;
  dest = monoeg_g_utf8_to_utf16 (target, D.21616, 0B, 0B, 0B);
  DeleteFile (dest);
  copy_result = CopyFile (orig, dest, 0);
  if (copy_result != 0) goto <D.21617>; else goto <D.21618>;
  <D.21617>:
  copy_result = SetFileAttributes (dest, 128);
  <D.21618>:
  monoeg_g_free (orig);
  monoeg_g_free (dest);
  D.21605 = copy_result;
  return D.21605;
}


shadow_copy_create_ini (const char * shadow, const char * filename)
{
  int D.21620;
  gboolean D.21623;
  long unsigned int D.21624;
  long int D.21625;
  long unsigned int D.21630;
  unsigned int D.21631;
  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.21620 = monoeg_g_file_test (ini_file, 1);
      if (D.21620 != 0) goto <D.21621>; else goto <D.21622>;
      <D.21621>:
      monoeg_g_free (ini_file);
      D.21623 = 1;
      return D.21623;
      <D.21622>:
      D.21624 = strlen (ini_file);
      D.21625 = (long int) D.21624;
      u16_ini = monoeg_g_utf8_to_utf16 (ini_file, D.21625, 0B, 0B, 0B);
      monoeg_g_free (ini_file);
      if (u16_ini == 0B) goto <D.21626>; else goto <D.21627>;
      <D.21626>:
      D.21623 = 0;
      return D.21623;
      <D.21627>:
      handle = CreateFile (u16_ini, 1073741824, 3, 0B, 1, 128, 0B);
      monoeg_g_free (u16_ini);
      if (handle == -1B) goto <D.21628>; else goto <D.21629>;
      <D.21628>:
      D.21623 = 0;
      return D.21623;
      <D.21629>:
      full_path = mono_path_resolve_symlinks (filename);
      D.21630 = strlen (full_path);
      D.21631 = (unsigned int) D.21630;
      result = WriteFile (handle, full_path, D.21631, &n, 0B);
      monoeg_g_free (full_path);
      CloseHandle (handle);
      D.21623 = result;
      return D.21623;
    }
  finally
    {
      n = {CLOBBER};
    }
}


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

  if (appdomain == 0B) goto <D.21634>; else goto <D.21635>;
  <D.21634>:
  D.21636 = 0B;
  return D.21636;
  <D.21635>:
  D.21636 = appdomain->data;
  return D.21636;
}


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

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

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

        status.43 = status;
        if (status.43 == 3) goto <D.21644>; else goto <D.21645>;
        <D.21644>:
        exc = mono_get_exception_bad_image_format2 (0B, fname);
        goto <D.21646>;
        <D.21645>:
        exc = mono_get_exception_file_not_found2 (0B, fname);
        <D.21646>:
        monoeg_g_free (name);
        mono_raise_exception (exc);
      }
      <D.21642>:
      monoeg_g_free (name);
      D.21647 = mono_assembly_get_object (domain, ass);
      return D.21647;
    }
  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)
{
  long unsigned int D.21650;
  int D.21651;
  char * D.21652;
  struct MonoException * D.21655;
  struct MonoReflectionAssembly * D.21656;
  long unsigned int D.21659;
  int D.21660;
  char * D.21661;
  struct MonoException * D.21664;
  struct MonoObject * * D.21665;
  struct MonoAssembly * ass;
  struct MonoReflectionAssembly * refass;
  struct MonoDomain * domain;
  MonoImageOpenStatus status;
  guint32 raw_assembly_len;
  struct MonoImage * image;

  try
    {
      refass = 0B;
      domain = ad->data;
      D.21650 = mono_array_length (raw_assembly);
      raw_assembly_len = (guint32) D.21650;
      D.21651 = (int) refonly;
      D.21652 = mono_array_addr_with_size (raw_assembly, 1, 0);
      image = mono_image_open_from_data_full (D.21652, raw_assembly_len, 1, 0B, D.21651);
      if (image == 0B) goto <D.21653>; else goto <D.21654>;
      <D.21653>:
      D.21655 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21655);
      D.21656 = 0B;
      return D.21656;
      <D.21654>:
      if (raw_symbol_store != 0B) goto <D.21657>; else goto <D.21658>;
      <D.21657>:
      D.21659 = mono_array_length (raw_symbol_store);
      D.21660 = (int) D.21659;
      D.21661 = mono_array_addr_with_size (raw_symbol_store, 1, 0);
      mono_debug_open_image_from_memory (image, D.21661, D.21660);
      <D.21658>:
      D.21651 = (int) refonly;
      ass = mono_assembly_load_from_full (image, "", &status, D.21651);
      if (ass == 0B) goto <D.21662>; else goto <D.21663>;
      <D.21662>:
      mono_image_close (image);
      D.21664 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21664);
      D.21656 = 0B;
      return D.21656;
      <D.21663>:
      refass = mono_assembly_get_object (domain, ass);
      D.21665 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21665, evidence);
      D.21656 = refass;
      return D.21656;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssembly (struct MonoAppDomain * ad, struct MonoString * assRef, struct MonoObject * evidence, MonoBoolean refOnly)
{
  _Bool D.21668;
  long int D.21669;
  long int D.21670;
  int D.21677;
  struct MonoReflectionAssembly * D.21678;
  struct MonoObject * * D.21688;
  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.21668 = assRef == 0B;
      D.21669 = (long int) D.21668;
      D.21670 = __builtin_expect (D.21669, 0);
      if (D.21670 != 0) goto <D.21671>; else goto <D.21672>;
      <D.21671>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1951, "assRef != NULL");
      <D.21672>:
      name = mono_string_to_utf8 (assRef);
      parsed = mono_assembly_name_parse (name, &aname);
      monoeg_g_free (name);
      if (parsed == 0) goto <D.21673>; else goto <D.21674>;
      <D.21673>:
      if (refOnly == 0) goto <D.21675>; else goto <D.21676>;
      <D.21675>:
      D.21677 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21677);
      <D.21676>:
      D.21678 = refass;
      return D.21678;
      <D.21674>:
      D.21677 = (int) refOnly;
      ass = mono_assembly_load_full_nosearch (&aname, 0B, &status, D.21677);
      mono_assembly_name_free (&aname);
      if (ass == 0B) goto <D.21679>; else goto <D.21680>;
      <D.21679>:
      if (refOnly == 0) goto <D.21681>; else goto <D.21682>;
      <D.21681>:
      D.21677 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21677);
      goto <D.21683>;
      <D.21682>:
      refass = 0B;
      <D.21683>:
      if (refass == 0B) goto <D.21684>; else goto <D.21685>;
      <D.21684>:
      D.21678 = 0B;
      return D.21678;
      <D.21685>:
      <D.21680>:
      if (refass == 0B) goto <D.21686>; else goto <D.21687>;
      <D.21686>:
      refass = mono_assembly_get_object (domain, ass);
      <D.21687>:
      D.21688 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21688, evidence);
      D.21678 = refass;
      return D.21678;
    }
  finally
    {
      status = {CLOBBER};
      aname = {CLOBBER};
    }
}


ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
  struct MonoDomain * D.21693;
  struct MonoException * D.21696;
  const gchar * D.21697;
  struct MonoDomain * domain;

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

    exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
    mono_raise_exception (exc);
  }
  <D.21692>:
  D.21693 = mono_get_root_domain ();
  if (D.21693 == domain) goto <D.21694>; else goto <D.21695>;
  <D.21694>:
  D.21696 = mono_get_exception_cannot_unload_appdomain ("The default appdomain can not be unloaded.");
  mono_raise_exception (D.21696);
  return;
  <D.21695>:
  D.21697 = monoeg_g_getenv ("MONO_NO_UNLOAD");
  if (D.21697 != 0B) goto <D.21698>; else goto <D.21699>;
  <D.21698>:
  return;
  <D.21699>:
  mono_domain_unload (domain);
}


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21701>; else goto <D.21702>;
  <D.21701>:
  D.21703 = 1;
  return D.21703;
  <D.21702>:
  D.21703 = mono_domain_is_unloading (domain);
  return D.21703;
}


ves_icall_System_AppDomain_ExecuteAssembly (struct MonoAppDomain * ad, struct MonoReflectionAssembly * refass, struct MonoArray * args)
{
  _Bool D.21705;
  long int D.21706;
  long int D.21707;
  struct MonoAssembly * D.21710;
  _Bool D.21711;
  long int D.21712;
  long int D.21713;
  unsigned int D.21716;
  char * D.21719;
  struct MonoClass * D.21722;
  struct MonoDomain * D.21723;
  gint32 D.21724;
  struct MonoImage * image;
  struct MonoMethod * method;

  D.21705 = refass == 0B;
  D.21706 = (long int) D.21705;
  D.21707 = __builtin_expect (D.21706, 0);
  if (D.21707 != 0) goto <D.21708>; else goto <D.21709>;
  <D.21708>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2035, "refass");
  <D.21709>:
  D.21710 = refass->assembly;
  image = D.21710->image;
  D.21711 = image == 0B;
  D.21712 = (long int) D.21711;
  D.21713 = __builtin_expect (D.21712, 0);
  if (D.21713 != 0) goto <D.21714>; else goto <D.21715>;
  <D.21714>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2037, "image");
  <D.21715>:
  D.21716 = mono_image_get_entry_point (image);
  method = mono_get_method (image, D.21716, 0B);
  if (method == 0B) goto <D.21717>; else goto <D.21718>;
  <D.21717>:
  D.21719 = image->name;
  monoeg_g_log (0B, 4, "No entry point method found in %s", D.21719);
  <D.19898>:
  goto <D.19898>;
  <D.21718>:
  if (args == 0B) goto <D.21720>; else goto <D.21721>;
  <D.21720>:
  D.21722 = mono_defaults.string_class;
  D.21723 = ad->data;
  args = mono_array_new (D.21723, D.21722, 0);
  <D.21721>:
  D.21724 = mono_runtime_exec_main (method, args, 0B);
  return D.21724;
}


ves_icall_System_AppDomain_GetIDFromDomain (struct MonoAppDomain * ad)
{
  gint32 D.21726;
  struct MonoDomain * D.21727;

  D.21727 = ad->data;
  D.21726 = D.21727->domain_id;
  return D.21726;
}


ves_icall_System_AppDomain_InternalSetDomain (struct MonoAppDomain * ad)
{
  struct MonoDomain * D.21729;
  int D.21730;
  struct MonoException * D.21733;
  struct MonoAppDomain * D.21734;
  struct MonoDomain * old_domain;

  old_domain = mono_domain_get ();
  D.21729 = ad->data;
  D.21730 = mono_domain_set (D.21729, 0);
  if (D.21730 == 0) goto <D.21731>; else goto <D.21732>;
  <D.21731>:
  D.21733 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21733);
  <D.21732>:
  D.21734 = old_domain->domain;
  return D.21734;
}


ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid)
{
  int D.21739;
  struct MonoException * D.21740;
  struct MonoAppDomain * D.21741;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (domainid);
  if (domain == 0B) goto <D.21736>; else goto <D.21738>;
  <D.21738>:
  D.21739 = mono_domain_set (domain, 0);
  if (D.21739 == 0) goto <D.21736>; else goto <D.21737>;
  <D.21736>:
  D.21740 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21740);
  <D.21737>:
  D.21741 = current_domain->domain;
  return D.21741;
}


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

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


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21744>; else goto <D.21745>;
  <D.21744>:
  D.21746 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21746);
  <D.21745>:
  mono_thread_push_appdomain_ref (domain);
}


ves_icall_System_AppDomain_InternalPopDomainRef ()
{
  mono_thread_pop_appdomain_ref ();
}


ves_icall_System_AppDomain_InternalGetContext ()
{
  struct MonoAppContext * D.21747;

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


ves_icall_System_AppDomain_InternalGetDefaultContext ()
{
  struct MonoAppContext * D.21749;
  struct MonoDomain * D.21750;

  D.21750 = mono_domain_get ();
  D.21749 = D.21750->default_context;
  return D.21749;
}


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

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


ves_icall_System_AppDomain_InternalGetProcessGuid (struct MonoString * newguid)
{
  union mono_mutex_t * D.21754;
  _Bool D.21757;
  long int D.21758;
  long int D.21759;
  int process_guid_set.44;
  _Bool D.21767;
  long int D.21768;
  long int D.21769;
  struct MonoString * D.21772;
  struct MonoDomain * D.21773;
  mono_unichar2 * D.21774;
  _Bool D.21777;
  long int D.21778;
  long int D.21779;
  struct MonoDomain * mono_root_domain;

  mono_root_domain = mono_get_root_domain ();
  {
    int ret;

    D.21754 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_lock (D.21754);
    if (ret != 0) goto <D.21755>; else goto <D.21756>;
    <D.21755>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21756>:
    D.21757 = ret != 0;
    D.21758 = (long int) D.21757;
    D.21759 = __builtin_expect (D.21758, 0);
    if (D.21759 != 0) goto <D.21760>; else goto <D.21761>;
    <D.21760>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2150, "ret == 0");
    <D.21761>:
  }
  process_guid_set.44 = process_guid_set;
  if (process_guid_set.44 != 0) goto <D.21763>; else goto <D.21764>;
  <D.21763>:
  {
    int ret;

    D.21754 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21754);
    if (ret != 0) goto <D.21765>; else goto <D.21766>;
    <D.21765>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21766>:
    D.21767 = ret != 0;
    D.21768 = (long int) D.21767;
    D.21769 = __builtin_expect (D.21768, 0);
    if (D.21769 != 0) goto <D.21770>; else goto <D.21771>;
    <D.21770>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2152, "ret == 0");
    <D.21771>:
  }
  D.21773 = mono_domain_get ();
  D.21772 = mono_string_new_utf16 (D.21773, &process_guid, 36);
  return D.21772;
  <D.21764>:
  D.21774 = mono_string_chars (newguid);
  memcpy (&process_guid, D.21774, 72);
  process_guid_set = 1;
  {
    int ret;

    D.21754 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21754);
    if (ret != 0) goto <D.21775>; else goto <D.21776>;
    <D.21775>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21776>:
    D.21777 = ret != 0;
    D.21778 = (long int) D.21777;
    D.21779 = __builtin_expect (D.21778, 0);
    if (D.21779 != 0) goto <D.21780>; else goto <D.21781>;
    <D.21780>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2157, "ret == 0");
    <D.21781>:
  }
  D.21772 = newguid;
  return D.21772;
}


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

  D.21784 = __builtin_object_size (__dest, 0);
  D.21783 = __builtin___memcpy_chk (__dest, __src, __len, D.21784);
  return D.21783;
}


mono_domain_is_unloading (struct MonoDomain * domain)
{
  unsigned int D.21786;
  unsigned int D.21787;
  mono_bool D.21790;

  D.21786 = domain->state;
  D.21787 = D.21786 + 4294967294;
  if (D.21787 <= 1) goto <D.21788>; else goto <D.21789>;
  <D.21788>:
  D.21790 = 1;
  return D.21790;
  <D.21789>:
  D.21790 = 0;
  return D.21790;
}


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

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


mono_domain_try_unload (struct MonoDomain * domain, struct MonoObject * * exc)
{
  guint32 * D.21795;
  int D.21796;
  struct MonoException * D.21799;
  struct MonoException * D.21800;
  struct MonoAppDomain * D.21801;
  struct MonoVTable * D.21802;
  struct MonoClass * D.21803;
  _Bool D.21804;
  long int D.21805;
  long int D.21806;
  struct MonoObject * D.21809;
  struct MonoInternalThread * D.21814;
  int D.21815;
  int D.21818;
  int D.21821;
  unsigned int D.21823;
  char * D.21824;
  struct MonoException * D.21827;
  void * thread_handle;
  MonoAppDomainState prev_state;
  struct MonoMethod * method;
  struct unload_data * thread_data;
  struct MonoDomain * caller_domain;

  caller_domain = mono_domain_get ();
  D.21795 = &domain->state;
  D.21796 = InterlockedCompareExchange (D.21795, 1, 0);
  prev_state = (MonoAppDomainState) D.21796;
  if (prev_state != 0) goto <D.21797>; else goto <D.21798>;
  <D.21797>:
  switch (prev_state) <default: <D.20020>, case 1: <D.20017>, case 2: <D.20018>, case 3: <D.20019>>
  <D.20017>:
  <D.20018>:
  D.21799 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded.");
  *exc = D.21799;
  return;
  <D.20019>:
  D.21800 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded.");
  *exc = D.21800;
  return;
  <D.20020>:
  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.21798>:
  mono_domain_set (domain, 0);
  D.21801 = domain->domain;
  D.21802 = D.21801->mbr.obj.vtable;
  D.21803 = D.21802->klass;
  method = mono_class_get_method_from_name (D.21803, "DoDomainUnload", -1);
  D.21804 = method == 0B;
  D.21805 = (long int) D.21804;
  D.21806 = __builtin_expect (D.21805, 0);
  if (D.21806 != 0) goto <D.21807>; else goto <D.21808>;
  <D.21807>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2416, "method");
  <D.21808>:
  D.21801 = domain->domain;
  mono_runtime_invoke (method, D.21801, 0B, exc);
  D.21809 = *exc;
  if (D.21809 != 0B) goto <D.21810>; else goto <D.21811>;
  <D.21810>:
  domain->state = 0;
  mono_domain_set (caller_domain, 0);
  return;
  <D.21811>:
  mono_domain_set (caller_domain, 0);
  thread_data = monoeg_malloc0 (32);
  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.21812>; else goto <D.21813>;
  <D.21812>:
  return;
  <D.21813>:
  ResumeThread (thread_handle);
  goto <D.20022>;
  <D.20021>:
  D.21814 = mono_thread_internal_current ();
  D.21815 = mono_thread_internal_has_appdomain_ref (D.21814, domain);
  if (D.21815 != 0) goto <D.21816>; else goto <D.21817>;
  <D.21816>:
  D.21818 = mono_thread_interruption_requested ();
  if (D.21818 != 0) goto <D.21819>; else goto <D.21820>;
  <D.21819>:
  CloseHandle (thread_handle);
  unload_data_unref (thread_data);
  return;
  <D.21820>:
  <D.21817>:
  <D.20022>:
  D.21821 = thread_data->done;
  if (D.21821 == 0) goto <D.21822>; else goto <D.20023>;
  <D.21822>:
  D.21823 = WaitForSingleObjectEx (thread_handle, 4294967295, 1);
  if (D.21823 == 192) goto <D.20021>; else goto <D.20023>;
  <D.20023>:
  CloseHandle (thread_handle);
  D.21824 = thread_data->failure_reason;
  if (D.21824 != 0B) goto <D.21825>; else goto <D.21826>;
  <D.21825>:
  domain->state = 0;
  D.21824 = thread_data->failure_reason;
  monoeg_g_log (0B, 16, "%s", D.21824);
  D.21824 = thread_data->failure_reason;
  D.21827 = mono_get_exception_cannot_unload_appdomain (D.21824);
  *exc = D.21827;
  D.21824 = thread_data->failure_reason;
  monoeg_g_free (D.21824);
  thread_data->failure_reason = 0B;
  <D.21826>:
  unload_data_unref (thread_data);
}


unload_thread_main (void * arg)
{
  struct MonoDomain * D.21829;
  int D.21830;
  char * D.21833;
  gchar * D.21834;
  int D.21835;
  gchar * D.21838;
  int D.21839;
  gchar * D.21842;
  union mono_mutex_t * D.21843;
  _Bool D.21846;
  long int D.21847;
  long int D.21848;
  struct GPtrArray * D.21851;
  void * * D.21852;
  long unsigned int D.21853;
  long unsigned int D.21854;
  void * * D.21855;
  void * D.21856;
  unsigned int i.46;
  unsigned int D.21858;
  int D.21859;
  unsigned int D.21860;
  _Bool D.21863;
  long int D.21864;
  long int D.21865;
  int D.21868;
  guint32 D.21869;
  struct unload_data * data;
  struct MonoDomain * domain;
  struct MonoThread * thread;
  int i;
  void failure = <<< error >>>;

  data = arg;
  domain = data->domain;
  D.21829 = mono_get_root_domain ();
  thread = mono_thread_attach_full (D.21829, 1);
  D.21830 = mono_threads_abort_appdomain_threads (domain, -1);
  if (D.21830 == 0) goto <D.21831>; else goto <D.21832>;
  <D.21831>:
  D.21833 = domain->friendly_name;
  D.21834 = monoeg_g_strdup_printf ("Aborting of threads in domain %s timed out.", D.21833);
  data->failure_reason = D.21834;
  goto failure;
  <D.21832>:
  D.21835 = mono_thread_pool_remove_domain_jobs (domain, -1);
  if (D.21835 == 0) goto <D.21836>; else goto <D.21837>;
  <D.21836>:
  D.21833 = domain->friendly_name;
  D.21838 = monoeg_g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", D.21833);
  data->failure_reason = D.21838;
  goto failure;
  <D.21837>:
  D.21839 = mono_domain_finalize (domain, 4294967295);
  if (D.21839 == 0) goto <D.21840>; else goto <D.21841>;
  <D.21840>:
  D.21833 = domain->friendly_name;
  D.21842 = monoeg_g_strdup_printf ("Finalization of domain %s timed out.", D.21833);
  data->failure_reason = D.21842;
  goto failure;
  <D.21841>:
  mono_loader_lock ();
  {
    int ret;

    D.21843 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.21843);
    if (ret != 0) goto <D.21844>; else goto <D.21845>;
    <D.21844>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21845>:
    D.21846 = ret != 0;
    D.21847 = (long int) D.21846;
    D.21848 = __builtin_expect (D.21847, 0);
    if (D.21848 != 0) goto <D.21849>; else goto <D.21850>;
    <D.21849>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2299, "ret == 0");
    <D.21850>:
  }
  i = 0;
  goto <D.19998>;
  <D.19997>:
  D.21851 = domain->class_vtable_array;
  D.21852 = D.21851->pdata;
  D.21853 = (long unsigned int) i;
  D.21854 = D.21853 * 8;
  D.21855 = D.21852 + D.21854;
  D.21856 = *D.21855;
  zero_static_data (D.21856);
  i = i + 1;
  <D.19998>:
  i.46 = (unsigned int) i;
  D.21851 = domain->class_vtable_array;
  D.21858 = D.21851->len;
  if (i.46 < D.21858) goto <D.19997>; else goto <D.19999>;
  <D.19999>:
  mono_gc_collect (0);
  i = 0;
  goto <D.20001>;
  <D.20000>:
  D.21851 = domain->class_vtable_array;
  D.21852 = D.21851->pdata;
  D.21853 = (long unsigned int) i;
  D.21854 = D.21853 * 8;
  D.21855 = D.21852 + D.21854;
  D.21856 = *D.21855;
  clear_cached_vtable (D.21856);
  i = i + 1;
  <D.20001>:
  i.46 = (unsigned int) i;
  D.21851 = domain->class_vtable_array;
  D.21858 = D.21851->len;
  if (i.46 < D.21858) goto <D.20000>; else goto <D.20002>;
  <D.20002>:
  deregister_reflection_info_roots (domain);
  D.21859 = domain->domain_id;
  D.21860 = (unsigned int) D.21859;
  mono_assembly_cleanup_domain_bindings (D.21860);
  {
    int ret;

    D.21843 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21843);
    if (ret != 0) goto <D.21861>; else goto <D.21862>;
    <D.21861>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21862>:
    D.21863 = ret != 0;
    D.21864 = (long int) D.21863;
    D.21865 = __builtin_expect (D.21864, 0);
    if (D.21865 != 0) goto <D.21866>; else goto <D.21867>;
    <D.21866>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2320, "ret == 0");
    <D.21867>:
  }
  mono_loader_unlock ();
  mono_threads_clear_cached_culture (domain);
  domain->state = 3;
  mono_gchandle_free_domain (domain);
  mono_domain_free (domain, 0);
  D.21868 = mono_gc_max_generation ();
  mono_gc_collect (D.21868);
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21869 = 0;
  return D.21869;
  failure:
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21869 = 1;
  return D.21869;
}


zero_static_data (struct MonoVTable * vtable)
{
  unsigned char D.21871;
  unsigned char D.21872;
  int D.21877;
  long unsigned int D.21878;
  struct MonoClass * klass;
  void * data;

  klass = vtable->klass;
  D.21871 = BIT_FIELD_REF <*klass, 8, 280>;
  D.21872 = D.21871 & 16;
  if (D.21872 != 0) goto <D.21873>; else goto <D.21874>;
  <D.21873>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21875>; else goto <D.21876>;
  <D.21875>:
  D.21877 = mono_class_data_size (klass);
  D.21878 = (long unsigned int) D.21877;
  mono_gc_bzero_aligned (data, D.21878);
  <D.21876>:
  <D.21874>:
}


clear_cached_vtable (struct MonoVTable * vtable)
{
  short unsigned int D.21881;
  int D.21882;
  int D.21883;
  unsigned char D.21886;
  unsigned char D.21887;
  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.21879>; else goto <D.21880>;
  <D.21879>:
  D.21881 = runtime_info->max_domain;
  D.21882 = (int) D.21881;
  D.21883 = domain->domain_id;
  if (D.21882 >= D.21883) goto <D.21884>; else goto <D.21885>;
  <D.21884>:
  D.21883 = domain->domain_id;
  runtime_info->domain_vtables[D.21883] = 0B;
  <D.21885>:
  <D.21880>:
  D.21886 = BIT_FIELD_REF <*klass, 8, 280>;
  D.21887 = D.21886 & 16;
  if (D.21887 != 0) goto <D.21888>; else goto <D.21889>;
  <D.21888>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21890>; else goto <D.21891>;
  <D.21890>:
  mono_gc_free_fixed (data);
  <D.21891>:
  <D.21889>:
}


deregister_reflection_info_roots (struct MonoDomain * domain)
{
  union mono_mutex_t * D.21892;
  _Bool D.21895;
  long int D.21896;
  long int D.21897;
  unsigned char D.21900;
  unsigned char D.21901;
  struct MonoImage * * D.21904;
  long unsigned int D.21905;
  long unsigned int D.21906;
  struct MonoImage * * D.21907;
  unsigned char D.21910;
  unsigned char D.21911;
  unsigned int i.47;
  unsigned int D.21915;
  _Bool D.21918;
  long int D.21919;
  long int D.21920;
  struct GSList * list;

  {
    int ret;

    D.21892 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21892);
    if (ret != 0) goto <D.21893>; else goto <D.21894>;
    <D.21893>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21894>:
    D.21895 = ret != 0;
    D.21896 = (long int) D.21895;
    D.21897 = __builtin_expect (D.21896, 0);
    if (D.21897 != 0) goto <D.21898>; else goto <D.21899>;
    <D.21898>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2237, "ret == 0");
    <D.21899>:
  }
  list = domain->domain_assemblies;
  goto <D.19985>;
  <D.19984>:
  {
    struct MonoAssembly * assembly;
    struct MonoImage * image;
    int i;

    assembly = list->data;
    image = assembly->image;
    D.21900 = BIT_FIELD_REF <*image, 8, 224>;
    D.21901 = D.21900 & 8;
    if (D.21901 != 0) goto <D.21902>; else goto <D.21903>;
    <D.21902>:
    deregister_reflection_info_roots_from_list (image);
    <D.21903>:
    i = 0;
    goto <D.19982>;
    <D.19981>:
    {
      struct MonoImage * module;

      D.21904 = image->modules;
      D.21905 = (long unsigned int) i;
      D.21906 = D.21905 * 8;
      D.21907 = D.21904 + D.21906;
      module = *D.21907;
      if (module != 0B) goto <D.21908>; else goto <D.21909>;
      <D.21908>:
      D.21910 = BIT_FIELD_REF <*module, 8, 224>;
      D.21911 = D.21910 & 8;
      if (D.21911 != 0) goto <D.21912>; else goto <D.21913>;
      <D.21912>:
      deregister_reflection_info_roots_from_list (module);
      <D.21913>:
      <D.21909>:
    }
    i = i + 1;
    <D.19982>:
    i.47 = (unsigned int) i;
    D.21915 = image->module_count;
    if (i.47 < D.21915) goto <D.19981>; else goto <D.19983>;
    <D.19983>:
  }
  list = list->next;
  <D.19985>:
  if (list != 0B) goto <D.19984>; else goto <D.19986>;
  <D.19986>:
  {
    int ret;

    D.21892 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21892);
    if (ret != 0) goto <D.21916>; else goto <D.21917>;
    <D.21916>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21917>:
    D.21918 = ret != 0;
    D.21919 = (long int) D.21918;
    D.21920 = __builtin_expect (D.21919, 0);
    if (D.21920 != 0) goto <D.21921>; else goto <D.21922>;
    <D.21921>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2258, "ret == 0");
    <D.21922>:
  }
}


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

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

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


InterlockedCompareExchange (volatile gint32 * dest, gint32 exch, gint32 comp)
{
  gint32 D.21923;
  unsigned int exch.48;
  unsigned int comp.49;
  unsigned int D.21926;

  exch.48 = (unsigned int) exch;
  comp.49 = (unsigned int) comp;
  D.21926 = __sync_val_compare_and_swap_4 (dest, comp.49, exch.48);
  D.21923 = (gint32) D.21926;
  return D.21923;
}


unload_data_unref (struct unload_data * data)
{
  unsigned int count.50;
  unsigned int D.21929;
  _Bool D.21930;
  long int D.21931;
  long int D.21932;
  int D.21937;
  gint32 * D.21938;
  int D.21939;
  gint32 count;

  <D.19962>:
  {
    gint32 __tmp;

    __tmp = data->refcount;
    count = __tmp;
  }
  count.50 = (unsigned int) count;
  D.21929 = count.50 + 4294967295;
  D.21930 = D.21929 > 1;
  D.21931 = (long int) D.21930;
  D.21932 = __builtin_expect (D.21931, 0);
  if (D.21932 != 0) goto <D.21933>; else goto <D.21934>;
  <D.21933>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2208, "count >= 1 && count <= 2");
  <D.21934>:
  if (count == 1) goto <D.21935>; else goto <D.21936>;
  <D.21935>:
  monoeg_g_free (data);
  return;
  <D.21936>:
  D.21937 = count + -1;
  D.21938 = &data->refcount;
  D.21939 = InterlockedCompareExchange (D.21938, count, D.21937);
  if (D.21939 != count) goto <D.19962>; else goto <D.19963>;
  <D.19963>:
}


