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 * (*<T1bc9>) (const char *, const char *) load_function.0;
  _Bool D.19664;
  long int D.19665;
  long int D.19666;
  struct MonoDomain * D.19669;

  load_function.0 = load_function;
  D.19664 = load_function.0 == 0B;
  D.19665 = (long int) D.19664;
  D.19666 = __builtin_expect (D.19665, 0);
  if (D.19666 != 0) goto <D.19667>; else goto <D.19668>;
  <D.19667>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 136, "load_function");
  <D.19668>:
  load_function.0 = load_function;
  D.19669 = load_function.0 (filename, runtime_version);
  return D.19669;
}


mono_runtime_set_no_exec (gboolean val)
{
  no_exec = val;
}


mono_runtime_get_no_exec ()
{
  gboolean D.19671;

  D.19671 = no_exec;
  return D.19671;
}


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


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

  refonly = (gboolean) user_data;
  domain = mono_domain_get ();
  aname_str = mono_stringify_assembly_name (aname);
  str = mono_string_new (domain, aname_str);
  if (str == 0B) goto <D.19680>; else goto <D.19681>;
  <D.19680>:
  monoeg_g_free (aname_str);
  D.19682 = 0B;
  return D.19682;
  <D.19681>:
  assembly = mono_try_assembly_resolve (domain, str, refonly);
  monoeg_g_free (aname_str);
  if (assembly != 0B) goto <D.19683>; else goto <D.19684>;
  <D.19683>:
  D.19682 = assembly->assembly;
  return D.19682;
  <D.19684>:
  D.19682 = 0B;
  return D.19682;
}


mono_domain_assembly_search (struct MonoAssemblyName * aname, void * user_data)
{
  union mono_mutex_t * D.19686;
  _Bool D.19689;
  long int D.19690;
  long int D.19691;
  unsigned char D.19696;
  int D.19698;
  struct MonoAssemblyName * D.19700;
  int D.19701;
  _Bool D.19704;
  long int D.19705;
  long int D.19706;
  struct MonoAssembly * D.19709;
  _Bool D.19712;
  long int D.19713;
  long int D.19714;
  struct MonoDomain * domain;
  struct GSList * tmp;
  struct MonoAssembly * ass;
  gboolean refonly;

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

    D.19686 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.19686);
    if (ret != 0) goto <D.19687>; else goto <D.19688>;
    <D.19687>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19688>:
    D.19689 = ret != 0;
    D.19690 = (long int) D.19689;
    D.19691 = __builtin_expect (D.19690, 0);
    if (D.19691 != 0) goto <D.19692>; else goto <D.19693>;
    <D.19692>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1853, "ret == 0");
    <D.19693>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19480>;
  <D.19479>:
  ass = tmp->data;
  D.19696 = ass->dynamic;
  if (D.19696 != 0) goto <D.19694>; else goto <D.19697>;
  <D.19697>:
  D.19698 = ass->ref_only;
  if (D.19698 != refonly) goto <D.19694>; else goto <D.19699>;
  <D.19699>:
  D.19700 = &ass->aname;
  D.19701 = mono_assembly_names_equal (aname, D.19700);
  if (D.19701 == 0) goto <D.19694>; else goto <D.19695>;
  <D.19694>:
  // predicted unlikely by continue predictor.
  goto <D.19477>;
  <D.19695>:
  {
    int ret;

    D.19686 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.19686);
    if (ret != 0) goto <D.19702>; else goto <D.19703>;
    <D.19702>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19703>:
    D.19704 = ret != 0;
    D.19705 = (long int) D.19704;
    D.19706 = __builtin_expect (D.19705, 0);
    if (D.19706 != 0) goto <D.19707>; else goto <D.19708>;
    <D.19707>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1860, "ret == 0");
    <D.19708>:
  }
  D.19709 = ass;
  return D.19709;
  <D.19477>:
  tmp = tmp->next;
  <D.19480>:
  if (tmp != 0B) goto <D.19479>; else goto <D.19481>;
  <D.19481>:
  {
    int ret;

    D.19686 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.19686);
    if (ret != 0) goto <D.19710>; else goto <D.19711>;
    <D.19710>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19711>:
    D.19712 = ret != 0;
    D.19713 = (long int) D.19712;
    D.19714 = __builtin_expect (D.19713, 0);
    if (D.19714 != 0) goto <D.19715>; else goto <D.19716>;
    <D.19715>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1863, "ret == 0");
    <D.19716>:
  }
  D.19709 = 0B;
  return D.19709;
}


mono_domain_assembly_preload (struct MonoAssemblyName * aname, gchar * * assemblies_path, void * user_data)
{
  gchar * * D.19718;
  gchar * D.19721;
  const char * D.19724;
  const char * D.19725;
  _Bool D.19726;
  _Bool D.19727;
  _Bool D.19728;
  gchar * D.19731;
  struct MonoAssembly * D.19734;
  struct MonoDomain * domain;
  struct MonoAssembly * result;
  gboolean refonly;

  domain = mono_domain_get ();
  result = 0B;
  refonly = (gboolean) user_data;
  set_domain_search_path (domain);
  D.19718 = domain->search_path;
  if (D.19718 != 0B) goto <D.19719>; else goto <D.19720>;
  <D.19719>:
  D.19718 = domain->search_path;
  D.19721 = *D.19718;
  if (D.19721 != 0B) goto <D.19722>; else goto <D.19723>;
  <D.19722>:
  D.19724 = aname->name;
  D.19725 = aname->culture;
  D.19718 = domain->search_path;
  result = real_load (D.19718, D.19725, D.19724, refonly);
  <D.19723>:
  <D.19720>:
  D.19726 = result == 0B;
  D.19727 = assemblies_path != 0B;
  D.19728 = D.19726 & D.19727;
  if (D.19728 != 0) goto <D.19729>; else goto <D.19730>;
  <D.19729>:
  D.19731 = *assemblies_path;
  if (D.19731 != 0B) goto <D.19732>; else goto <D.19733>;
  <D.19732>:
  D.19724 = aname->name;
  D.19725 = aname->culture;
  result = real_load (assemblies_path, D.19725, D.19724, refonly);
  <D.19733>:
  <D.19730>:
  D.19734 = result;
  return D.19734;
}


set_domain_search_path (struct MonoDomain * domain)
{
  union mono_mutex_t * D.19736;
  _Bool D.19739;
  long int D.19740;
  long int D.19741;
  struct MonoAppDomainSetup * D.19744;
  _Bool D.19749;
  long int D.19750;
  long int D.19751;
  gchar * * D.19754;
  unsigned char D.19757;
  _Bool D.19762;
  long int D.19763;
  long int D.19764;
  struct MonoString * D.19767;
  _Bool D.19772;
  long int D.19773;
  long int D.19774;
  struct MonoString * D.19777;
  int D.19780;
  _Bool D.19785;
  long int D.19786;
  long int D.19787;
  gchar * D.19790;
  unsigned int D.19798;
  sizetype i.1;
  gchar * D.19800;
  char D.19801;
  gchar * D.19804;
  _Bool D.19811;
  long int D.19812;
  long int D.19813;
  int D.19818;
  unsigned int D.19819;
  unsigned int D.19820;
  unsigned int npaths.2;
  unsigned int D.19822;
  gchar * * D.19823;
  char * D.19824;
  int D.19825;
  _Bool D.19830;
  long int D.19831;
  long int D.19832;
  int D.19835;
  gchar * D.19838;
  char D.19839;
  gchar * D.19842;
  struct GError * gerror.3;
  gchar * D.19848;
  sizetype D.19850;
  sizetype D.19851;
  gchar * * D.19852;
  gchar * D.19853;
  int D.19854;
  unsigned int i.4;
  unsigned int D.19858;
  gchar * * D.19859;
  gchar * D.19860;
  gchar * D.19862;
  gchar * D.19863;
  char * D.19864;
  unsigned int D.19869;
  unsigned int appbaselen.5;
  int D.19871;
  gchar * D.19874;
  _Bool D.19875;
  _Bool D.19876;
  _Bool D.19877;
  struct MonoString * D.19878;
  gchar * D.19881;
  _Bool D.19884;
  long int D.19885;
  long int D.19886;
  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.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.19736);
        if (ret != 0) goto <D.19737>; else goto <D.19738>;
        <D.19737>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19738>:
        D.19739 = ret != 0;
        D.19740 = (long int) D.19739;
        D.19741 = __builtin_expect (D.19740, 0);
        if (D.19741 != 0) goto <D.19742>; else goto <D.19743>;
        <D.19742>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1058, "ret == 0");
        <D.19743>:
      }
      D.19744 = domain->setup;
      if (D.19744 == 0B) goto <D.19745>; else goto <D.19746>;
      <D.19745>:
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19747>; else goto <D.19748>;
        <D.19747>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19748>:
        D.19749 = ret != 0;
        D.19750 = (long int) D.19749;
        D.19751 = __builtin_expect (D.19750, 0);
        if (D.19751 != 0) goto <D.19752>; else goto <D.19753>;
        <D.19752>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1061, "ret == 0");
        <D.19753>:
      }
      return;
      <D.19746>:
      D.19754 = domain->search_path;
      if (D.19754 != 0B) goto <D.19755>; else goto <D.19756>;
      <D.19755>:
      D.19744 = domain->setup;
      D.19757 = D.19744->path_changed;
      if (D.19757 == 0) goto <D.19758>; else goto <D.19759>;
      <D.19758>:
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19760>; else goto <D.19761>;
        <D.19760>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19761>:
        D.19762 = ret != 0;
        D.19763 = (long int) D.19762;
        D.19764 = __builtin_expect (D.19763, 0);
        if (D.19764 != 0) goto <D.19765>; else goto <D.19766>;
        <D.19765>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1066, "ret == 0");
        <D.19766>:
      }
      return;
      <D.19759>:
      <D.19756>:
      setup = domain->setup;
      D.19767 = setup->application_base;
      if (D.19767 == 0B) goto <D.19768>; else goto <D.19769>;
      <D.19768>:
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19770>; else goto <D.19771>;
        <D.19770>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19771>:
        D.19772 = ret != 0;
        D.19773 = (long int) D.19772;
        D.19774 = __builtin_expect (D.19773, 0);
        if (D.19774 != 0) goto <D.19775>; else goto <D.19776>;
        <D.19775>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1071, "ret == 0");
        <D.19776>:
      }
      return;
      <D.19769>:
      npaths = npaths + 1;
      D.19777 = setup->private_bin_path;
      if (D.19777 != 0B) goto <D.19778>; else goto <D.19779>;
      <D.19778>:
      D.19777 = setup->private_bin_path;
      search_path = mono_string_to_utf8_checked (D.19777, &error);
      D.19780 = mono_error_ok (&error);
      if (D.19780 == 0) goto <D.19781>; else goto <D.19782>;
      <D.19781>:
      monoeg_g_log (0B, 16, "Could not decode AppDomain search path since it contains invalid characters");
      mono_error_cleanup (&error);
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19783>; else goto <D.19784>;
        <D.19783>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19784>:
        D.19785 = ret != 0;
        D.19786 = (long int) D.19785;
        D.19787 = __builtin_expect (D.19786, 0);
        if (D.19787 != 0) goto <D.19788>; else goto <D.19789>;
        <D.19788>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1082, "ret == 0");
        <D.19789>:
      }
      return;
      <D.19782>:
      <D.19779>:
      D.19790 = domain->private_bin_path;
      if (D.19790 != 0B) goto <D.19791>; else goto <D.19792>;
      <D.19791>:
      if (search_path == 0B) goto <D.19793>; else goto <D.19794>;
      <D.19793>:
      search_path = domain->private_bin_path;
      goto <D.19795>;
      <D.19794>:
      {
        gchar * tmp2;

        tmp2 = search_path;
        D.19790 = domain->private_bin_path;
        search_path = monoeg_g_strjoin (";", search_path, D.19790, 0B);
        monoeg_g_free (tmp2);
      }
      <D.19795>:
      <D.19792>:
      if (search_path != 0B) goto <D.19796>; else goto <D.19797>;
      <D.19796>:
      {
        gint slen;

        D.19798 = strlen (search_path);
        slen = (gint) D.19798;
        i = 0;
        goto <D.19270>;
        <D.19269>:
        i.1 = (sizetype) i;
        D.19800 = search_path + i.1;
        D.19801 = *D.19800;
        if (D.19801 == 58) goto <D.19802>; else goto <D.19803>;
        <D.19802>:
        i.1 = (sizetype) i;
        D.19800 = search_path + i.1;
        *D.19800 = 59;
        <D.19803>:
        i = i + 1;
        <D.19270>:
        if (i < slen) goto <D.19269>; else goto <D.19271>;
        <D.19271>:
        pvt_split = monoeg_g_strsplit (search_path, ";", 1000);
        monoeg_g_free (search_path);
        tmp = pvt_split;
        goto <D.19273>;
        <D.19272>:
        tmp = tmp + 4;
        npaths = npaths + 1;
        <D.19273>:
        D.19804 = *tmp;
        if (D.19804 != 0B) goto <D.19272>; else goto <D.19274>;
        <D.19274>:
      }
      <D.19797>:
      if (npaths == 0) goto <D.19805>; else goto <D.19806>;
      <D.19805>:
      if (pvt_split != 0B) goto <D.19807>; else goto <D.19808>;
      <D.19807>:
      monoeg_g_strfreev (pvt_split);
      <D.19808>:
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19809>; else goto <D.19810>;
        <D.19809>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19810>:
        D.19811 = ret != 0;
        D.19812 = (long int) D.19811;
        D.19813 = __builtin_expect (D.19812, 0);
        if (D.19813 != 0) goto <D.19814>; else goto <D.19815>;
        <D.19814>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1133, "ret == 0");
        <D.19815>:
      }
      return;
      <D.19806>:
      D.19754 = domain->search_path;
      if (D.19754 != 0B) goto <D.19816>; else goto <D.19817>;
      <D.19816>:
      D.19754 = domain->search_path;
      monoeg_g_strfreev (D.19754);
      <D.19817>:
      D.19818 = npaths + 1;
      D.19819 = (unsigned int) D.19818;
      D.19820 = D.19819 * 4;
      tmp = monoeg_malloc (D.19820);
      npaths.2 = (unsigned int) npaths;
      D.19822 = npaths.2 * 4;
      D.19823 = tmp + D.19822;
      *D.19823 = 0B;
      D.19767 = setup->application_base;
      D.19824 = mono_string_to_utf8_checked (D.19767, &error);
      *tmp = D.19824;
      D.19825 = mono_error_ok (&error);
      if (D.19825 == 0) goto <D.19826>; else goto <D.19827>;
      <D.19826>:
      mono_error_cleanup (&error);
      monoeg_g_strfreev (pvt_split);
      monoeg_g_free (tmp);
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19828>; else goto <D.19829>;
        <D.19828>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19829>:
        D.19830 = ret != 0;
        D.19831 = (long int) D.19830;
        D.19832 = __builtin_expect (D.19831, 0);
        if (D.19832 != 0) goto <D.19833>; else goto <D.19834>;
        <D.19833>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1149, "ret == 0");
        <D.19834>:
      }
      return;
      <D.19827>:
      domain->search_path = tmp;
      D.19804 = *tmp;
      D.19835 = strncmp (D.19804, "file://", 7);
      if (D.19835 == 0) goto <D.19836>; else goto <D.19837>;
      <D.19836>:
      {
        gchar * file;
        gchar * uri;
        gchar * tmpuri;

        file = *tmp;
        uri = *tmp;
        D.19838 = uri + 7;
        D.19839 = *D.19838;
        if (D.19839 != 47) goto <D.19840>; else goto <D.19841>;
        <D.19840>:
        D.19838 = uri + 7;
        uri = monoeg_g_strdup_printf ("file:///%s", D.19838);
        <D.19841>:
        tmpuri = uri;
        uri = mono_escape_uri_string (tmpuri);
        D.19842 = monoeg_g_filename_from_uri (uri, 0B, &gerror);
        *tmp = D.19842;
        monoeg_g_free (uri);
        if (tmpuri != file) goto <D.19843>; else goto <D.19844>;
        <D.19843>:
        monoeg_g_free (tmpuri);
        <D.19844>:
        gerror.3 = gerror;
        if (gerror.3 != 0B) goto <D.19846>; else goto <D.19847>;
        <D.19846>:
        gerror.3 = gerror;
        D.19848 = gerror.3->message;
        monoeg_g_log (0B, 16, "%s\n", D.19848);
        gerror.3 = gerror;
        monoeg_g_error_free (gerror.3);
        *tmp = file;
        goto <D.19849>;
        <D.19847>:
        monoeg_g_free (file);
        <D.19849>:
      }
      <D.19837>:
      i = 1;
      goto <D.19302>;
      <D.19301>:
      i.1 = (sizetype) i;
      D.19850 = i.1 + 1073741823;
      D.19851 = D.19850 * 4;
      D.19852 = pvt_split + D.19851;
      D.19853 = *D.19852;
      D.19854 = monoeg_g_path_is_absolute (D.19853);
      if (D.19854 != 0) goto <D.19855>; else goto <D.19856>;
      <D.19855>:
      i.4 = (unsigned int) i;
      D.19858 = i.4 * 4;
      D.19859 = tmp + D.19858;
      i.1 = (sizetype) i;
      D.19850 = i.1 + 1073741823;
      D.19851 = D.19850 * 4;
      D.19852 = pvt_split + D.19851;
      D.19853 = *D.19852;
      D.19860 = monoeg_strdup (D.19853);
      *D.19859 = D.19860;
      goto <D.19861>;
      <D.19856>:
      i.4 = (unsigned int) i;
      D.19858 = i.4 * 4;
      D.19859 = tmp + D.19858;
      i.1 = (sizetype) i;
      D.19850 = i.1 + 1073741823;
      D.19851 = D.19850 * 4;
      D.19852 = pvt_split + D.19851;
      D.19853 = *D.19852;
      D.19804 = *tmp;
      D.19862 = monoeg_g_build_path ("/", D.19804, D.19853, 0B);
      *D.19859 = D.19862;
      <D.19861>:
      i.4 = (unsigned int) i;
      D.19858 = i.4 * 4;
      D.19859 = tmp + D.19858;
      D.19863 = *D.19859;
      D.19864 = __builtin_strchr (D.19863, 46);
      if (D.19864 != 0B) goto <D.19865>; else goto <D.19866>;
      <D.19865>:
      {
        gchar * reduced;
        gchar * freeme;

        i.4 = (unsigned int) i;
        D.19858 = i.4 * 4;
        D.19859 = tmp + D.19858;
        D.19863 = *D.19859;
        reduced = mono_path_canonicalize (D.19863);
        if (appbaselen == -1) goto <D.19867>; else goto <D.19868>;
        <D.19867>:
        D.19804 = *tmp;
        D.19869 = strlen (D.19804);
        appbaselen = (gint) D.19869;
        <D.19868>:
        appbaselen.5 = (unsigned int) appbaselen;
        D.19804 = *tmp;
        D.19871 = strncmp (D.19804, reduced, appbaselen.5);
        if (D.19871 != 0) goto <D.19872>; else goto <D.19873>;
        <D.19872>:
        monoeg_g_free (reduced);
        i.4 = (unsigned int) i;
        D.19858 = i.4 * 4;
        D.19859 = tmp + D.19858;
        D.19863 = *D.19859;
        monoeg_g_free (D.19863);
        i.4 = (unsigned int) i;
        D.19858 = i.4 * 4;
        D.19859 = tmp + D.19858;
        D.19874 = monoeg_strdup ("");
        *D.19859 = D.19874;
        // predicted unlikely by continue predictor.
        goto <D.19300>;
        <D.19873>:
        i.4 = (unsigned int) i;
        D.19858 = i.4 * 4;
        D.19859 = tmp + D.19858;
        freeme = *D.19859;
        i.4 = (unsigned int) i;
        D.19858 = i.4 * 4;
        D.19859 = tmp + D.19858;
        *D.19859 = reduced;
        monoeg_g_free (freeme);
      }
      <D.19866>:
      <D.19300>:
      i = i + 1;
      <D.19302>:
      D.19875 = pvt_split != 0B;
      D.19876 = i < npaths;
      D.19877 = D.19875 & D.19876;
      if (D.19877 != 0) goto <D.19301>; else goto <D.19303>;
      <D.19303>:
      D.19878 = setup->private_bin_path_probe;
      if (D.19878 != 0B) goto <D.19879>; else goto <D.19880>;
      <D.19879>:
      D.19804 = *tmp;
      monoeg_g_free (D.19804);
      D.19881 = monoeg_strdup ("");
      *tmp = D.19881;
      <D.19880>:
      D.19744 = domain->setup;
      D.19744->path_changed = 0;
      monoeg_g_strfreev (pvt_split);
      {
        int ret;

        D.19736 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19736);
        if (ret != 0) goto <D.19882>; else goto <D.19883>;
        <D.19882>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19883>:
        D.19884 = ret != 0;
        D.19885 = (long int) D.19884;
        D.19886 = __builtin_expect (D.19885, 0);
        if (D.19886 != 0) goto <D.19887>; else goto <D.19888>;
        <D.19887>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1218, "ret == 0");
        <D.19888>:
      }
    }
  finally
    {
      error = {CLOBBER};
      gerror = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.19892>; else goto <D.19893>;
  <D.19892>:
  D.19894 = __strdup (str);
  return D.19894;
  <D.19893>:
  D.19894 = 0B;
  return D.19894;
}


real_load (gchar * * search_path, const gchar * culture, const gchar * name, gboolean refonly)
{
  char D.19900;
  unsigned int D.19901;
  gchar * D.19902;
  char D.19903;
  sizetype len.6;
  sizetype D.19907;
  gchar * D.19908;
  int D.19909;
  int D.19911;
  int D.19913;
  int D.19915;
  struct MonoAssembly * D.19917;
  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.19896>; else goto <D.19899>;
      <D.19899>:
      D.19900 = *culture;
      if (D.19900 == 0) goto <D.19896>; else goto <D.19897>;
      <D.19896>:
      local_culture = "";
      goto <D.19898>;
      <D.19897>:
      local_culture = culture;
      <D.19898>:
      filename = monoeg_g_strconcat (name, ".dll", 0B);
      D.19901 = strlen (filename);
      len = (gint) D.19901;
      path = search_path;
      goto <D.19459>;
      <D.19458>:
      D.19902 = *path;
      D.19903 = *D.19902;
      if (D.19903 == 0) goto <D.19904>; else goto <D.19905>;
      <D.19904>:
      is_private = 1;
      // predicted unlikely by continue predictor.
      goto <D.19456>;
      <D.19905>:
      len.6 = (sizetype) len;
      D.19907 = len.6 + 4294967292;
      D.19908 = filename + D.19907;
      strcpy (D.19908, ".dll");
      D.19902 = *path;
      D.19909 = try_load_from (&result, D.19902, local_culture, "", filename, refonly, is_private);
      if (D.19909 != 0) goto <D.19457>; else goto <D.19910>;
      <D.19910>:
      len.6 = (sizetype) len;
      D.19907 = len.6 + 4294967292;
      D.19908 = filename + D.19907;
      strcpy (D.19908, ".exe");
      D.19902 = *path;
      D.19911 = try_load_from (&result, D.19902, local_culture, "", filename, refonly, is_private);
      if (D.19911 != 0) goto <D.19457>; else goto <D.19912>;
      <D.19912>:
      len.6 = (sizetype) len;
      D.19907 = len.6 + 4294967292;
      D.19908 = filename + D.19907;
      strcpy (D.19908, ".dll");
      D.19902 = *path;
      D.19913 = try_load_from (&result, D.19902, local_culture, name, filename, refonly, is_private);
      if (D.19913 != 0) goto <D.19457>; else goto <D.19914>;
      <D.19914>:
      len.6 = (sizetype) len;
      D.19907 = len.6 + 4294967292;
      D.19908 = filename + D.19907;
      strcpy (D.19908, ".exe");
      D.19902 = *path;
      D.19915 = try_load_from (&result, D.19902, local_culture, name, filename, refonly, is_private);
      if (D.19915 != 0) goto <D.19457>; else goto <D.19916>;
      <D.19916>:
      <D.19456>:
      path = path + 4;
      <D.19459>:
      D.19902 = *path;
      if (D.19902 != 0B) goto <D.19458>; else goto <D.19457>;
      <D.19457>:
      monoeg_g_free (filename);
      D.19917 = result;
      return D.19917;
    }
  finally
    {
      result = {CLOBBER};
    }
}


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

  D.19921 = __builtin_object_size (__dest, 1);
  D.19920 = __builtin___strcpy_chk (__dest, __src, D.19921);
  return D.19920;
}


try_load_from (struct MonoAssembly * * assembly, const gchar * path1, const gchar * path2, const gchar * path3, const gchar * path4, gboolean refonly, gboolean is_private)
{
  int __mono_io_portability_helpers.7;
  struct MonoAssembly * D.19931;
  gboolean D.19932;
  struct MonoAssembly * D.19933;
  _Bool D.19934;
  gchar * fullpath;
  gboolean found;

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

    new_fullpath = mono_portability_find_file (fullpath, 1);
    if (new_fullpath != 0B) goto <D.19926>; else goto <D.19927>;
    <D.19926>:
    monoeg_g_free (fullpath);
    fullpath = new_fullpath;
    found = 1;
    <D.19927>:
  }
  goto <D.19928>;
  <D.19925>:
  found = monoeg_g_file_test (fullpath, 1);
  <D.19928>:
  if (found != 0) goto <D.19929>; else goto <D.19930>;
  <D.19929>:
  D.19931 = mono_assembly_open_full (fullpath, 0B, refonly);
  *assembly = D.19931;
  <D.19930>:
  monoeg_g_free (fullpath);
  D.19933 = *assembly;
  D.19934 = D.19933 != 0B;
  D.19932 = (gboolean) D.19934;
  return D.19932;
}


create_domain_objects (struct MonoDomain * domain)
{
  struct MonoImage * D.19938;
  struct MonoException * D.19939;
  struct MonoException * D.19940;
  struct MonoException * D.19941;
  struct MonoClass * D.19942;
  struct MonoObject * D.19943;
  struct MonoClass * D.19946;
  struct MonoClass * D.19947;
  struct MonoDomain * old_domain;
  struct MonoString * arg;

  old_domain = mono_domain_get ();
  if (domain != old_domain) goto <D.19936>; else goto <D.19937>;
  <D.19936>:
  mono_thread_push_appdomain_ref (domain);
  mono_domain_set_internal_with_options (domain, 0);
  <D.19937>:
  arg = mono_string_new (domain, "Out of memory");
  D.19938 = mono_defaults.corlib;
  D.19939 = mono_exception_from_name_two_strings (D.19938, "System", "OutOfMemoryException", arg, 0B);
  domain->out_of_memory_ex = D.19939;
  arg = mono_string_new (domain, "A null value was found where an object instance was required");
  D.19938 = mono_defaults.corlib;
  D.19940 = mono_exception_from_name_two_strings (D.19938, "System", "NullReferenceException", arg, 0B);
  domain->null_reference_ex = D.19940;
  arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
  D.19938 = mono_defaults.corlib;
  D.19941 = mono_exception_from_name_two_strings (D.19938, "System", "StackOverflowException", arg, 0B);
  domain->stack_overflow_ex = D.19941;
  D.19942 = mono_defaults.object_class;
  D.19943 = mono_object_new (domain, D.19942);
  domain->ephemeron_tombstone = D.19943;
  if (domain != old_domain) goto <D.19944>; else goto <D.19945>;
  <D.19944>:
  mono_thread_pop_appdomain_ref ();
  mono_domain_set_internal_with_options (old_domain, 0);
  <D.19945>:
  D.19946 = mono_defaults.int_class;
  D.19947 = mono_array_class_get (D.19946, 1);
  mono_class_init (D.19947);
}


mono_domain_fire_assembly_load (struct MonoAssembly * assembly, void * user_data)
{
  struct MonoAppDomain * D.19948;
  struct MonoVTable * D.19951;
  union mono_mutex_t * D.19952;
  _Bool D.19955;
  long int D.19956;
  long int D.19957;
  _Bool D.19962;
  long int D.19963;
  long int D.19964;
  struct MonoClassField * assembly_load_field.8;
  struct MonoClassField * assembly_load_field.9;
  _Bool D.19971;
  long int D.19972;
  long int D.19973;
  void * load_value.10;
  _Bool D.19979;
  long int D.19980;
  long int D.19981;
  struct MonoMethod * assembly_load_method.11;
  struct MonoMethod * assembly_load_method.12;
  _Bool D.19988;
  long int D.19989;
  long int D.19990;
  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.19948 = domain->domain;
      if (D.19948 == 0B) goto <D.19949>; else goto <D.19950>;
      <D.19949>:
      return;
      <D.19950>:
      D.19948 = domain->domain;
      D.19951 = D.19948->mbr.obj.vtable;
      klass = D.19951->klass;
      {
        int ret;

        D.19952 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.19952);
        if (ret != 0) goto <D.19953>; else goto <D.19954>;
        <D.19953>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19954>:
        D.19955 = ret != 0;
        D.19956 = (long int) D.19955;
        D.19957 = __builtin_expect (D.19956, 0);
        if (D.19957 != 0) goto <D.19958>; else goto <D.19959>;
        <D.19958>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1011, "ret == 0");
        <D.19959>:
      }
      add_assemblies_to_domain (domain, assembly, 0B);
      {
        int ret;

        D.19952 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19952);
        if (ret != 0) goto <D.19960>; else goto <D.19961>;
        <D.19960>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19961>:
        D.19962 = ret != 0;
        D.19963 = (long int) D.19962;
        D.19964 = __builtin_expect (D.19963, 0);
        if (D.19964 != 0) goto <D.19965>; else goto <D.19966>;
        <D.19965>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1013, "ret == 0");
        <D.19966>:
      }
      assembly_load_field.8 = assembly_load_field;
      if (assembly_load_field.8 == 0B) goto <D.19968>; else goto <D.19969>;
      <D.19968>:
      assembly_load_field.9 = mono_class_get_field_from_name (klass, "AssemblyLoad");
      assembly_load_field = assembly_load_field.9;
      assembly_load_field.8 = assembly_load_field;
      D.19971 = assembly_load_field.8 == 0B;
      D.19972 = (long int) D.19971;
      D.19973 = __builtin_expect (D.19972, 0);
      if (D.19973 != 0) goto <D.19974>; else goto <D.19975>;
      <D.19974>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1017, "assembly_load_field");
      <D.19975>:
      <D.19969>:
      assembly_load_field.8 = assembly_load_field;
      D.19948 = domain->domain;
      mono_field_get_value (D.19948, assembly_load_field.8, &load_value);
      load_value.10 = load_value;
      if (load_value.10 == 0B) goto <D.19977>; else goto <D.19978>;
      <D.19977>:
      return;
      <D.19978>:
      ref_assembly = mono_assembly_get_object (domain, assembly);
      D.19979 = ref_assembly == 0B;
      D.19980 = (long int) D.19979;
      D.19981 = __builtin_expect (D.19980, 0);
      if (D.19981 != 0) goto <D.19982>; else goto <D.19983>;
      <D.19982>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1027, "ref_assembly");
      <D.19983>:
      assembly_load_method.11 = assembly_load_method;
      if (assembly_load_method.11 == 0B) goto <D.19985>; else goto <D.19986>;
      <D.19985>:
      assembly_load_method.12 = mono_class_get_method_from_name (klass, "DoAssemblyLoad", -1);
      assembly_load_method = assembly_load_method.12;
      assembly_load_method.11 = assembly_load_method;
      D.19988 = assembly_load_method.11 == 0B;
      D.19989 = (long int) D.19988;
      D.19990 = __builtin_expect (D.19989, 0);
      if (D.19990 != 0) goto <D.19991>; else goto <D.19992>;
      <D.19991>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1031, "assembly_load_method");
      <D.19992>:
      <D.19986>:
      params[0] = ref_assembly;
      D.19948 = domain->domain;
      assembly_load_method.11 = assembly_load_method;
      mono_runtime_invoke (assembly_load_method.11, D.19948, &params, 0B);
    }
  finally
    {
      load_value = {CLOBBER};
      params = {CLOBBER};
    }
}


add_assemblies_to_domain (struct MonoDomain * domain, struct MonoAssembly * ass, struct GHashTable * ht)
{
  const char * D.19996;
  void * D.20001;
  void * D.20002;
  struct GSList * D.20005;
  struct GSList * D.20006;
  int D.20007;
  char * D.20008;
  struct MonoImage * D.20009;
  struct MonoAssembly * * D.20010;
  unsigned int i.13;
  unsigned int D.20014;
  struct MonoAssembly * * D.20015;
  struct MonoAssembly * D.20016;
  void * D.20019;
  gint i;
  struct GSList * tmp;
  gboolean destroy_ht;

  destroy_ht = 0;
  D.19996 = ass->aname.name;
  if (D.19996 == 0B) goto <D.19997>; else goto <D.19998>;
  <D.19997>:
  return;
  <D.19998>:
  if (ht == 0B) goto <D.19999>; else goto <D.20000>;
  <D.19999>:
  ht = monoeg_g_hash_table_new (mono_aligned_addr_hash, 0B);
  destroy_ht = 1;
  <D.20000>:
  tmp = domain->domain_assemblies;
  goto <D.19232>;
  <D.19231>:
  D.20001 = tmp->data;
  D.20001 = tmp->data;
  monoeg_g_hash_table_insert_replace (ht, D.20001, D.20001, 0);
  tmp = tmp->next;
  <D.19232>:
  if (tmp != 0B) goto <D.19231>; else goto <D.19233>;
  <D.19233>:
  D.20002 = monoeg_g_hash_table_lookup (ht, ass);
  if (D.20002 == 0B) goto <D.20003>; else goto <D.20004>;
  <D.20003>:
  mono_assembly_addref (ass);
  monoeg_g_hash_table_insert_replace (ht, ass, ass, 0);
  D.20005 = domain->domain_assemblies;
  D.20006 = monoeg_g_slist_append (D.20005, ass);
  domain->domain_assemblies = D.20006;
  D.20007 = ass->ref_count;
  D.20008 = domain->friendly_name;
  D.19996 = ass->aname.name;
  mono_trace (64, 1, "Assembly %s[%p] added to domain %s, ref_count=%d", D.19996, ass, D.20008, D.20007);
  <D.20004>:
  D.20009 = ass->image;
  D.20010 = D.20009->references;
  if (D.20010 != 0B) goto <D.20011>; else goto <D.20012>;
  <D.20011>:
  i = 0;
  goto <D.19235>;
  <D.19234>:
  D.20009 = ass->image;
  D.20010 = D.20009->references;
  i.13 = (unsigned int) i;
  D.20014 = i.13 * 4;
  D.20015 = D.20010 + D.20014;
  D.20016 = *D.20015;
  if (D.20016 != 4294967295B) goto <D.20017>; else goto <D.20018>;
  <D.20017>:
  D.20009 = ass->image;
  D.20010 = D.20009->references;
  i.13 = (unsigned int) i;
  D.20014 = i.13 * 4;
  D.20015 = D.20010 + D.20014;
  D.20016 = *D.20015;
  D.20019 = monoeg_g_hash_table_lookup (ht, D.20016);
  if (D.20019 == 0B) goto <D.20020>; else goto <D.20021>;
  <D.20020>:
  D.20009 = ass->image;
  D.20010 = D.20009->references;
  i.13 = (unsigned int) i;
  D.20014 = i.13 * 4;
  D.20015 = D.20010 + D.20014;
  D.20016 = *D.20015;
  add_assemblies_to_domain (domain, D.20016, ht);
  <D.20021>:
  <D.20018>:
  i = i + 1;
  <D.19235>:
  D.20009 = ass->image;
  D.20010 = D.20009->references;
  i.13 = (unsigned int) i;
  D.20014 = i.13 * 4;
  D.20015 = D.20010 + D.20014;
  D.20016 = *D.20015;
  if (D.20016 != 0B) goto <D.19234>; else goto <D.19236>;
  <D.19236>:
  <D.20012>:
  if (destroy_ht != 0) goto <D.20022>; else goto <D.20023>;
  <D.20022>:
  monoeg_g_hash_table_destroy (ht);
  <D.20023>:
}


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

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


mono_get_corlib_version ()
{
  struct MonoImage * D.20029;
  int D.20032;
  struct MonoType * D.20033;
  short unsigned int D.20034;
  int D.20035;
  int D.20036;
  struct MonoDomain * D.20039;
  gint32 * D.20040;
  struct MonoClass * klass;
  struct MonoClassField * field;
  struct MonoObject * value;

  D.20029 = mono_defaults.corlib;
  klass = mono_class_from_name (D.20029, "System", "Environment");
  mono_class_init (klass);
  field = mono_class_get_field_from_name (klass, "mono_corlib_version");
  if (field == 0B) goto <D.20030>; else goto <D.20031>;
  <D.20030>:
  D.20032 = -1;
  return D.20032;
  <D.20031>:
  D.20033 = field->type;
  D.20034 = D.20033->attrs;
  D.20035 = (int) D.20034;
  D.20036 = D.20035 & 16;
  if (D.20036 == 0) goto <D.20037>; else goto <D.20038>;
  <D.20037>:
  D.20032 = -1;
  return D.20032;
  <D.20038>:
  D.20039 = mono_domain_get ();
  value = mono_field_get_value_object (D.20039, field, 0B);
  D.20040 = value + 8;
  D.20032 = *D.20040;
  return D.20032;
}


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

  D.20042 = mono_defaults.corlib;
  class = mono_class_from_name (D.20042, "System.Runtime.Remoting.Contexts", "Context");
  context = mono_object_new (domain, class);
  D.20043 = domain->domain_id;
  context->domain_id = D.20043;
  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 (*<T15df>) (struct MonoDomain *, void *) quit_function.14;
  struct MonoDomain * D.20047;

  quit_function.14 = quit_function;
  if (quit_function.14 != 0B) goto <D.20045>; else goto <D.20046>;
  <D.20045>:
  quit_function.14 = quit_function;
  D.20047 = mono_get_root_domain ();
  quit_function.14 (D.20047, 0B);
  <D.20046>:
}


mono_domain_create_appdomain (char * friendly_name, char * configuration_file)
{
  struct MonoImage * D.20048;
  struct MonoDomain * D.20049;
  struct MonoString * iftmp.15;
  struct MonoDomain * D.20053;
  struct MonoDomain * D.20055;
  struct MonoAppDomain * ad;
  struct MonoAppDomainSetup * setup;
  struct MonoClass * class;

  D.20048 = mono_defaults.corlib;
  class = mono_class_from_name (D.20048, "System", "AppDomainSetup");
  D.20049 = mono_domain_get ();
  setup = mono_object_new (D.20049, class);
  if (configuration_file != 0B) goto <D.20051>; else goto <D.20052>;
  <D.20051>:
  D.20053 = mono_domain_get ();
  iftmp.15 = mono_string_new (D.20053, configuration_file);
  goto <D.20054>;
  <D.20052>:
  iftmp.15 = 0B;
  <D.20054>:
  setup->configuration_file = iftmp.15;
  ad = mono_domain_create_appdomain_internal (friendly_name, setup);
  D.20055 = mono_domain_from_appdomain (ad);
  return D.20055;
}


mono_domain_create_appdomain_internal (char * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20057;
  gchar * D.20058;
  struct MonoString * D.20059;
  struct MonoAppDomainSetup * D.20062;
  struct MonoString * D.20063;
  int D.20066;
  mono_unichar2 * D.20067;
  struct MonoString * D.20068;
  struct MonoString * * D.20069;
  struct MonoAppDomainSetup * D.20070;
  struct MonoAssembly * D.20071;
  int D.20072;
  struct MonoAppDomain * D.20075;
  struct MonoError error;
  struct MonoClass * adclass;
  struct MonoAppDomain * ad;
  struct MonoDomain * data;
  char * shadow_location;

  try
    {
      D.20057 = mono_defaults.corlib;
      adclass = mono_class_from_name (D.20057, "System", "AppDomain");
      data = mono_domain_create ();
      ad = mono_object_new (data, adclass);
      ad->data = data;
      data->domain = ad;
      D.20058 = monoeg_strdup (friendly_name);
      data->friendly_name = D.20058;
      D.20059 = setup->application_base;
      if (D.20059 == 0B) goto <D.20060>; else goto <D.20061>;
      <D.20060>:
      {
        struct MonoDomain * root;

        root = mono_get_root_domain ();
        D.20062 = root->setup;
        D.20063 = D.20062->application_base;
        if (D.20063 != 0B) goto <D.20064>; else goto <D.20065>;
        <D.20064>:
        D.20062 = root->setup;
        D.20063 = D.20062->application_base;
        D.20066 = mono_string_length (D.20063);
        D.20062 = root->setup;
        D.20063 = D.20062->application_base;
        D.20067 = mono_string_chars (D.20063);
        D.20068 = mono_string_new_utf16 (data, D.20067, D.20066);
        D.20069 = &setup->application_base;
        mono_gc_wbarrier_set_field (setup, D.20069, D.20068);
        <D.20065>:
      }
      <D.20061>:
      mono_context_init (data);
      D.20070 = copy_app_domain_setup (data, setup);
      data->setup = D.20070;
      mono_set_private_bin_path_from_config (data);
      D.20057 = mono_defaults.corlib;
      D.20071 = D.20057->assembly;
      add_assemblies_to_domain (data, D.20071, 0B);
      shadow_location = get_shadow_assembly_location_base (data, &error);
      D.20072 = mono_error_ok (&error);
      if (D.20072 == 0) goto <D.20073>; else goto <D.20074>;
      <D.20073>:
      mono_error_raise_exception (&error);
      <D.20074>:
      monoeg_g_free (shadow_location);
      create_domain_objects (data);
      D.20075 = ad;
      return D.20075;
    }
  finally
    {
      error = {CLOBBER};
    }
}


copy_app_domain_setup (struct MonoDomain * domain, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20078;
  struct MonoString * D.20079;
  struct MonoObject * D.20080;
  struct MonoString * * D.20081;
  struct MonoString * D.20082;
  struct MonoObject * D.20083;
  struct MonoString * * D.20084;
  struct MonoString * D.20085;
  struct MonoObject * D.20086;
  struct MonoString * * D.20087;
  struct MonoString * D.20088;
  struct MonoObject * D.20089;
  struct MonoString * * D.20090;
  struct MonoString * D.20091;
  struct MonoObject * D.20092;
  struct MonoString * * D.20093;
  struct MonoString * D.20094;
  struct MonoObject * D.20095;
  struct MonoString * * D.20096;
  struct MonoString * D.20097;
  struct MonoObject * D.20098;
  struct MonoString * * D.20099;
  struct MonoString * D.20100;
  struct MonoObject * D.20101;
  struct MonoString * * D.20102;
  struct MonoString * D.20103;
  struct MonoObject * D.20104;
  struct MonoString * * D.20105;
  struct MonoString * D.20106;
  struct MonoObject * D.20107;
  struct MonoString * * D.20108;
  unsigned char D.20109;
  unsigned char D.20110;
  int D.20111;
  unsigned char D.20112;
  unsigned char D.20113;
  struct MonoArray * D.20114;
  struct MonoObject * D.20115;
  struct MonoArray * * D.20116;
  unsigned char D.20117;
  struct MonoObject * D.20118;
  struct MonoObject * D.20119;
  struct MonoObject * * D.20120;
  struct MonoArray * D.20121;
  struct MonoObject * D.20122;
  struct MonoArray * * D.20123;
  struct MonoArray * D.20124;
  struct MonoObject * D.20125;
  struct MonoArray * * D.20126;
  struct MonoAppDomainSetup * D.20127;
  struct MonoDomain * caller_domain;
  struct MonoClass * ads_class;
  struct MonoAppDomainSetup * copy;

  caller_domain = mono_domain_get ();
  D.20078 = mono_defaults.corlib;
  ads_class = mono_class_from_name (D.20078, "System", "AppDomainSetup");
  copy = mono_object_new (domain, ads_class);
  mono_domain_set_internal (domain);
  D.20079 = setup->application_base;
  D.20080 = mono_marshal_xdomain_copy_value (D.20079);
  D.20081 = &copy->application_base;
  mono_gc_wbarrier_set_field (copy, D.20081, D.20080);
  D.20082 = setup->application_name;
  D.20083 = mono_marshal_xdomain_copy_value (D.20082);
  D.20084 = &copy->application_name;
  mono_gc_wbarrier_set_field (copy, D.20084, D.20083);
  D.20085 = setup->cache_path;
  D.20086 = mono_marshal_xdomain_copy_value (D.20085);
  D.20087 = &copy->cache_path;
  mono_gc_wbarrier_set_field (copy, D.20087, D.20086);
  D.20088 = setup->configuration_file;
  D.20089 = mono_marshal_xdomain_copy_value (D.20088);
  D.20090 = &copy->configuration_file;
  mono_gc_wbarrier_set_field (copy, D.20090, D.20089);
  D.20091 = setup->dynamic_base;
  D.20092 = mono_marshal_xdomain_copy_value (D.20091);
  D.20093 = &copy->dynamic_base;
  mono_gc_wbarrier_set_field (copy, D.20093, D.20092);
  D.20094 = setup->license_file;
  D.20095 = mono_marshal_xdomain_copy_value (D.20094);
  D.20096 = &copy->license_file;
  mono_gc_wbarrier_set_field (copy, D.20096, D.20095);
  D.20097 = setup->private_bin_path;
  D.20098 = mono_marshal_xdomain_copy_value (D.20097);
  D.20099 = &copy->private_bin_path;
  mono_gc_wbarrier_set_field (copy, D.20099, D.20098);
  D.20100 = setup->private_bin_path_probe;
  D.20101 = mono_marshal_xdomain_copy_value (D.20100);
  D.20102 = &copy->private_bin_path_probe;
  mono_gc_wbarrier_set_field (copy, D.20102, D.20101);
  D.20103 = setup->shadow_copy_directories;
  D.20104 = mono_marshal_xdomain_copy_value (D.20103);
  D.20105 = &copy->shadow_copy_directories;
  mono_gc_wbarrier_set_field (copy, D.20105, D.20104);
  D.20106 = setup->shadow_copy_files;
  D.20107 = mono_marshal_xdomain_copy_value (D.20106);
  D.20108 = &copy->shadow_copy_files;
  mono_gc_wbarrier_set_field (copy, D.20108, D.20107);
  D.20109 = setup->publisher_policy;
  copy->publisher_policy = D.20109;
  D.20110 = setup->path_changed;
  copy->path_changed = D.20110;
  D.20111 = setup->loader_optimization;
  copy->loader_optimization = D.20111;
  D.20112 = setup->disallow_binding_redirects;
  copy->disallow_binding_redirects = D.20112;
  D.20113 = setup->disallow_code_downloads;
  copy->disallow_code_downloads = D.20113;
  D.20114 = setup->domain_initializer_args;
  D.20115 = mono_marshal_xdomain_copy_value (D.20114);
  D.20116 = &copy->domain_initializer_args;
  mono_gc_wbarrier_set_field (copy, D.20116, D.20115);
  D.20117 = setup->disallow_appbase_probe;
  copy->disallow_appbase_probe = D.20117;
  D.20118 = setup->application_trust;
  D.20119 = mono_marshal_xdomain_copy_value (D.20118);
  D.20120 = &copy->application_trust;
  mono_gc_wbarrier_set_field (copy, D.20120, D.20119);
  D.20121 = setup->configuration_bytes;
  D.20122 = mono_marshal_xdomain_copy_value (D.20121);
  D.20123 = &copy->configuration_bytes;
  mono_gc_wbarrier_set_field (copy, D.20123, D.20122);
  D.20124 = setup->serialized_non_primitives;
  D.20125 = mono_marshal_xdomain_copy_value (D.20124);
  D.20126 = &copy->serialized_non_primitives;
  mono_gc_wbarrier_set_field (copy, D.20126, D.20125);
  mono_domain_set_internal (caller_domain);
  D.20127 = copy;
  return D.20127;
}


get_shadow_assembly_location_base (struct MonoDomain * domain, struct MonoError * error)
{
  struct MonoString * D.20131;
  struct MonoString * D.20133;
  int D.20135;
  char * D.20138;
  unsigned int D.20139;
  unsigned int D.20140;
  sizetype i.16;
  char * D.20142;
  char D.20143;
  int D.20146;
  const gchar * D.20149;
  const gchar * D.20150;
  struct MonoAppDomainSetup * setup;
  char * cache_path;
  char * appname;
  char * userdir;
  char * location;

  mono_error_init (error);
  setup = domain->setup;
  D.20131 = setup->cache_path;
  if (D.20131 != 0B) goto <D.20132>; else goto <D.20129>;
  <D.20132>:
  D.20133 = setup->application_name;
  if (D.20133 != 0B) goto <D.20134>; else goto <D.20129>;
  <D.20134>:
  D.20131 = setup->cache_path;
  cache_path = mono_string_to_utf8_checked (D.20131, error);
  D.20135 = mono_error_ok (error);
  if (D.20135 == 0) goto <D.20136>; else goto <D.20137>;
  <D.20136>:
  D.20138 = 0B;
  return D.20138;
  <D.20137>:
  {
    gint i;

    D.20139 = strlen (cache_path);
    D.20140 = D.20139 + 4294967295;
    i = (gint) D.20140;
    goto <D.19338>;
    <D.19337>:
    i.16 = (sizetype) i;
    D.20142 = cache_path + i.16;
    D.20143 = *D.20142;
    if (D.20143 == 92) goto <D.20144>; else goto <D.20145>;
    <D.20144>:
    i.16 = (sizetype) i;
    D.20142 = cache_path + i.16;
    *D.20142 = 47;
    <D.20145>:
    i = i + -1;
    <D.19338>:
    if (i >= 0) goto <D.19337>; else goto <D.19339>;
    <D.19339>:
  }
  D.20133 = setup->application_name;
  appname = mono_string_to_utf8_checked (D.20133, error);
  D.20146 = mono_error_ok (error);
  if (D.20146 == 0) goto <D.20147>; else goto <D.20148>;
  <D.20147>:
  monoeg_g_free (cache_path);
  D.20138 = 0B;
  return D.20138;
  <D.20148>:
  location = monoeg_g_build_path ("/", cache_path, appname, "assembly", "shadow", 0B);
  monoeg_g_free (appname);
  monoeg_g_free (cache_path);
  goto <D.20130>;
  <D.20129>:
  D.20149 = monoeg_g_get_user_name ();
  userdir = monoeg_g_strdup_printf ("%s-mono-cachepath", D.20149);
  D.20150 = monoeg_g_get_tmp_dir ();
  location = monoeg_g_build_path ("/", D.20150, userdir, "assembly", "shadow", 0B);
  monoeg_g_free (userdir);
  <D.20130>:
  D.20138 = location;
  return D.20138;
}


mono_domain_has_type_resolve (struct MonoDomain * domain)
{
  struct MonoClassField * field.17;
  struct MonoClass * D.20155;
  struct MonoClassField * field.18;
  _Bool D.20157;
  long int D.20158;
  long int D.20159;
  struct MonoAppDomain * D.20162;
  mono_bool D.20165;
  struct MonoObject * o.19;
  _Bool D.20167;
  static struct MonoClassField * field = 0B;
  struct MonoObject * o;

  try
    {
      field.17 = field;
      if (field.17 == 0B) goto <D.20153>; else goto <D.20154>;
      <D.20153>:
      D.20155 = mono_defaults.appdomain_class;
      field.18 = mono_class_get_field_from_name (D.20155, "TypeResolve");
      field = field.18;
      field.17 = field;
      D.20157 = field.17 == 0B;
      D.20158 = (long int) D.20157;
      D.20159 = __builtin_expect (D.20158, 0);
      if (D.20159 != 0) goto <D.20160>; else goto <D.20161>;
      <D.20160>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 503, "field");
      <D.20161>:
      <D.20154>:
      D.20162 = domain->domain;
      if (D.20162 == 0B) goto <D.20163>; else goto <D.20164>;
      <D.20163>:
      D.20165 = 0;
      return D.20165;
      <D.20164>:
      field.17 = field;
      D.20162 = domain->domain;
      mono_field_get_value (D.20162, field.17, &o);
      o.19 = o;
      D.20167 = o.19 != 0B;
      D.20165 = (mono_bool) D.20167;
      return D.20165;
    }
  finally
    {
      o = {CLOBBER};
    }
}


mono_domain_try_type_resolve (struct MonoDomain * domain, char * name, struct MonoObject * tb)
{
  int iftmp.20;
  _Bool D.20175;
  _Bool D.20176;
  _Bool D.20177;
  _Bool D.20178;
  long int D.20179;
  long int D.20180;
  struct MonoMethod * method.21;
  struct MonoAppDomain * D.20186;
  struct MonoVTable * D.20187;
  _Bool D.20188;
  long int D.20189;
  long int D.20190;
  struct MonoMethod * method.22;
  struct MonoReflectionAssembly * D.20196;
  struct MonoDomain * D.20199;
  struct MonoString * D.20200;
  struct MonoClass * klass;
  void * params[1];
  static struct MonoMethod * method = 0B;

  try
    {
      if (domain == 0B) goto <D.20171>; else goto <D.20174>;
      <D.20174>:
      D.20175 = name == 0B;
      D.20176 = tb == 0B;
      D.20177 = D.20175 & D.20176;
      if (D.20177 != 0) goto <D.20171>; else goto <D.20172>;
      <D.20171>:
      iftmp.20 = 1;
      goto <D.20173>;
      <D.20172>:
      iftmp.20 = 0;
      <D.20173>:
      D.20178 = iftmp.20 != 0;
      D.20179 = (long int) D.20178;
      D.20180 = __builtin_expect (D.20179, 0);
      if (D.20180 != 0) goto <D.20181>; else goto <D.20182>;
      <D.20181>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 534, "domain != NULL && ((name != NULL) || (tb != NULL))");
      <D.20182>:
      method.21 = method;
      if (method.21 == 0B) goto <D.20184>; else goto <D.20185>;
      <D.20184>:
      D.20186 = domain->domain;
      D.20187 = D.20186->mbr.obj.vtable;
      klass = D.20187->klass;
      D.20188 = klass == 0B;
      D.20189 = (long int) D.20188;
      D.20190 = __builtin_expect (D.20189, 0);
      if (D.20190 != 0) goto <D.20191>; else goto <D.20192>;
      <D.20191>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 538, "klass");
      <D.20192>:
      method.22 = mono_class_get_method_from_name (klass, "DoTypeResolve", -1);
      method = method.22;
      method.21 = method;
      if (method.21 == 0B) goto <D.20194>; else goto <D.20195>;
      <D.20194>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoTypeResolve not found.\n");
      D.20196 = 0B;
      return D.20196;
      <D.20195>:
      <D.20185>:
      if (name != 0B) goto <D.20197>; else goto <D.20198>;
      <D.20197>:
      D.20199 = mono_domain_get ();
      D.20200 = mono_string_new (D.20199, name);
      params[0] = D.20200;
      goto <D.20201>;
      <D.20198>:
      params[0] = tb;
      <D.20201>:
      D.20186 = domain->domain;
      method.21 = method;
      D.20196 = mono_runtime_invoke (method.21, D.20186, &params, 0B);
      return D.20196;
    }
  finally
    {
      params = {CLOBBER};
    }
}


mono_domain_owns_vtable_slot (struct MonoDomain * domain, void * vtable_slot)
{
  union mono_mutex_t * D.20204;
  _Bool D.20207;
  long int D.20208;
  long int D.20209;
  struct MonoMemPool * D.20212;
  _Bool D.20215;
  long int D.20216;
  long int D.20217;
  mono_bool D.20220;
  gboolean res;

  {
    int ret;

    D.20204 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.20204);
    if (ret != 0) goto <D.20205>; else goto <D.20206>;
    <D.20205>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20206>:
    D.20207 = ret != 0;
    D.20208 = (long int) D.20207;
    D.20209 = __builtin_expect (D.20208, 0);
    if (D.20209 != 0) goto <D.20210>; else goto <D.20211>;
    <D.20210>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 564, "ret == 0");
    <D.20211>:
  }
  D.20212 = domain->mp;
  res = mono_mempool_contains_addr (D.20212, vtable_slot);
  {
    int ret;

    D.20204 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.20204);
    if (ret != 0) goto <D.20213>; else goto <D.20214>;
    <D.20213>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20214>:
    D.20215 = ret != 0;
    D.20216 = (long int) D.20215;
    D.20217 = __builtin_expect (D.20216, 0);
    if (D.20217 != 0) goto <D.20218>; else goto <D.20219>;
    <D.20218>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 566, "ret == 0");
    <D.20219>:
  }
  D.20220 = res;
  return D.20220;
}


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

  if (force == 0) goto <D.20222>; else goto <D.20223>;
  <D.20222>:
  D.20224 = domain->state;
  if (D.20224 == 3) goto <D.20225>; else goto <D.20226>;
  <D.20225>:
  D.20227 = 0;
  return D.20227;
  <D.20226>:
  <D.20223>:
  mono_domain_set_internal (domain);
  D.20227 = 1;
  return D.20227;
}


ves_icall_System_AppDomain_GetData (struct MonoAppDomain * ad, struct MonoString * name)
{
  _Bool D.20229;
  long int D.20230;
  long int D.20231;
  _Bool D.20234;
  long int D.20235;
  long int D.20236;
  struct MonoException * D.20241;
  union mono_mutex_t * D.20242;
  _Bool D.20245;
  long int D.20246;
  long int D.20247;
  int D.18984;
  int iftmp.23;
  int D.18983;
  const char[8] * D.20253;
  unsigned char D.20254;
  int D.20255;
  unsigned char D.20256;
  int D.20257;
  _Bool D.20258;
  _Bool D.20259;
  _Bool D.20260;
  const unsigned char * D.20263;
  unsigned char D.20264;
  int D.20265;
  const unsigned char * D.20266;
  unsigned char D.20267;
  int D.20268;
  _Bool D.20269;
  _Bool D.20270;
  const unsigned char * D.20273;
  unsigned char D.20274;
  int D.20275;
  const unsigned char * D.20276;
  unsigned char D.20277;
  int D.20278;
  _Bool D.20279;
  _Bool D.20280;
  const unsigned char * D.20283;
  unsigned char D.20284;
  int D.20285;
  const unsigned char * D.20286;
  unsigned char D.20287;
  int D.20288;
  struct MonoAppDomainSetup * D.20292;
  int D.18993;
  int iftmp.24;
  int D.18992;
  const char[16] * D.20297;
  unsigned char D.20298;
  int D.20299;
  unsigned char D.20300;
  int D.20301;
  _Bool D.20302;
  _Bool D.20303;
  _Bool D.20304;
  const unsigned char * D.20307;
  unsigned char D.20308;
  int D.20309;
  const unsigned char * D.20310;
  unsigned char D.20311;
  int D.20312;
  _Bool D.20313;
  _Bool D.20314;
  const unsigned char * D.20317;
  unsigned char D.20318;
  int D.20319;
  const unsigned char * D.20320;
  unsigned char D.20321;
  int D.20322;
  _Bool D.20323;
  _Bool D.20324;
  const unsigned char * D.20327;
  unsigned char D.20328;
  int D.20329;
  const unsigned char * D.20330;
  unsigned char D.20331;
  int D.20332;
  int D.19002;
  int iftmp.25;
  int D.19001;
  const char[13] * D.20340;
  unsigned char D.20341;
  int D.20342;
  unsigned char D.20343;
  int D.20344;
  _Bool D.20345;
  _Bool D.20346;
  _Bool D.20347;
  const unsigned char * D.20350;
  unsigned char D.20351;
  int D.20352;
  const unsigned char * D.20353;
  unsigned char D.20354;
  int D.20355;
  _Bool D.20356;
  _Bool D.20357;
  const unsigned char * D.20360;
  unsigned char D.20361;
  int D.20362;
  const unsigned char * D.20363;
  unsigned char D.20364;
  int D.20365;
  _Bool D.20366;
  _Bool D.20367;
  const unsigned char * D.20370;
  unsigned char D.20371;
  int D.20372;
  const unsigned char * D.20373;
  unsigned char D.20374;
  int D.20375;
  int D.19011;
  int iftmp.26;
  int D.19010;
  const char[9] * D.20383;
  unsigned char D.20384;
  int D.20385;
  unsigned char D.20386;
  int D.20387;
  _Bool D.20388;
  _Bool D.20389;
  _Bool D.20390;
  const unsigned char * D.20393;
  unsigned char D.20394;
  int D.20395;
  const unsigned char * D.20396;
  unsigned char D.20397;
  int D.20398;
  _Bool D.20399;
  _Bool D.20400;
  const unsigned char * D.20403;
  unsigned char D.20404;
  int D.20405;
  const unsigned char * D.20406;
  unsigned char D.20407;
  int D.20408;
  _Bool D.20409;
  _Bool D.20410;
  const unsigned char * D.20413;
  unsigned char D.20414;
  int D.20415;
  const unsigned char * D.20416;
  unsigned char D.20417;
  int D.20418;
  int D.19020;
  int iftmp.27;
  int D.19019;
  const char[11] * D.20426;
  unsigned char D.20427;
  int D.20428;
  unsigned char D.20429;
  int D.20430;
  _Bool D.20431;
  _Bool D.20432;
  _Bool D.20433;
  const unsigned char * D.20436;
  unsigned char D.20437;
  int D.20438;
  const unsigned char * D.20439;
  unsigned char D.20440;
  int D.20441;
  _Bool D.20442;
  _Bool D.20443;
  const unsigned char * D.20446;
  unsigned char D.20447;
  int D.20448;
  const unsigned char * D.20449;
  unsigned char D.20450;
  int D.20451;
  _Bool D.20452;
  _Bool D.20453;
  const unsigned char * D.20456;
  unsigned char D.20457;
  int D.20458;
  const unsigned char * D.20459;
  unsigned char D.20460;
  int D.20461;
  int D.19029;
  int iftmp.28;
  int D.19028;
  const char[16] * D.20469;
  unsigned char D.20470;
  int D.20471;
  unsigned char D.20472;
  int D.20473;
  _Bool D.20474;
  _Bool D.20475;
  _Bool D.20476;
  const unsigned char * D.20479;
  unsigned char D.20480;
  int D.20481;
  const unsigned char * D.20482;
  unsigned char D.20483;
  int D.20484;
  _Bool D.20485;
  _Bool D.20486;
  const unsigned char * D.20489;
  unsigned char D.20490;
  int D.20491;
  const unsigned char * D.20492;
  unsigned char D.20493;
  int D.20494;
  _Bool D.20495;
  _Bool D.20496;
  const unsigned char * D.20499;
  unsigned char D.20500;
  int D.20501;
  const unsigned char * D.20502;
  unsigned char D.20503;
  int D.20504;
  int D.19038;
  int iftmp.29;
  int D.19037;
  const char[19] * D.20512;
  unsigned char D.20513;
  int D.20514;
  unsigned char D.20515;
  int D.20516;
  _Bool D.20517;
  _Bool D.20518;
  _Bool D.20519;
  const unsigned char * D.20522;
  unsigned char D.20523;
  int D.20524;
  const unsigned char * D.20525;
  unsigned char D.20526;
  int D.20527;
  _Bool D.20528;
  _Bool D.20529;
  const unsigned char * D.20532;
  unsigned char D.20533;
  int D.20534;
  const unsigned char * D.20535;
  unsigned char D.20536;
  int D.20537;
  _Bool D.20538;
  _Bool D.20539;
  const unsigned char * D.20542;
  unsigned char D.20543;
  int D.20544;
  const unsigned char * D.20545;
  unsigned char D.20546;
  int D.20547;
  int D.19047;
  int iftmp.30;
  int D.19046;
  const char[17] * D.20555;
  unsigned char D.20556;
  int D.20557;
  unsigned char D.20558;
  int D.20559;
  _Bool D.20560;
  _Bool D.20561;
  _Bool D.20562;
  const unsigned char * D.20565;
  unsigned char D.20566;
  int D.20567;
  const unsigned char * D.20568;
  unsigned char D.20569;
  int D.20570;
  _Bool D.20571;
  _Bool D.20572;
  const unsigned char * D.20575;
  unsigned char D.20576;
  int D.20577;
  const unsigned char * D.20578;
  unsigned char D.20579;
  int D.20580;
  _Bool D.20581;
  _Bool D.20582;
  const unsigned char * D.20585;
  unsigned char D.20586;
  int D.20587;
  const unsigned char * D.20588;
  unsigned char D.20589;
  int D.20590;
  int D.19056;
  int iftmp.31;
  int D.19055;
  const char[20] * D.20598;
  unsigned char D.20599;
  int D.20600;
  unsigned char D.20601;
  int D.20602;
  _Bool D.20603;
  _Bool D.20604;
  _Bool D.20605;
  const unsigned char * D.20608;
  unsigned char D.20609;
  int D.20610;
  const unsigned char * D.20611;
  unsigned char D.20612;
  int D.20613;
  _Bool D.20614;
  _Bool D.20615;
  const unsigned char * D.20618;
  unsigned char D.20619;
  int D.20620;
  const unsigned char * D.20621;
  unsigned char D.20622;
  int 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;
  struct MonoGHashTable * D.20638;
  _Bool D.20641;
  long int D.20642;
  long int D.20643;
  struct MonoObject * D.20648;
  struct MonoDomain * add;
  struct MonoObject * o;
  char * str;

  D.20229 = ad == 0B;
  D.20230 = (long int) D.20229;
  D.20231 = __builtin_expect (D.20230, 0);
  if (D.20231 != 0) goto <D.20232>; else goto <D.20233>;
  <D.20232>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 602, "ad != NULL");
  <D.20233>:
  add = ad->data;
  D.20234 = add == 0B;
  D.20235 = (long int) D.20234;
  D.20236 = __builtin_expect (D.20235, 0);
  if (D.20236 != 0) goto <D.20237>; else goto <D.20238>;
  <D.20237>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 604, "add != NULL");
  <D.20238>:
  if (name == 0B) goto <D.20239>; else goto <D.20240>;
  <D.20239>:
  D.20241 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.20241);
  <D.20240>:
  str = mono_string_to_utf8 (name);
  {
    int ret;

    D.20242 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.20242);
    if (ret != 0) goto <D.20243>; else goto <D.20244>;
    <D.20243>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20244>:
    D.20245 = ret != 0;
    D.20246 = (long int) D.20245;
    D.20247 = __builtin_expect (D.20246, 0);
    if (D.20247 != 0) goto <D.20248>; else goto <D.20249>;
    <D.20248>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 611, "ret == 0");
    <D.20249>:
  }
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20253 = "APPBASE";
      D.20254 = MEM[(const unsigned char *)D.20253];
      D.20255 = (int) D.20254;
      D.20256 = *__s2;
      D.20257 = (int) D.20256;
      __result = D.20255 - D.20257;
      {
        D.20258 = __s2_len != 0;
        D.20259 = __result == 0;
        D.20260 = D.20258 & D.20259;
        if (D.20260 != 0) goto <D.20261>; else goto <D.20262>;
        <D.20261>:
        D.20263 = &MEM[(void *)"APPBASE" + 1B];
        D.20264 = *D.20263;
        D.20265 = (int) D.20264;
        D.20266 = __s2 + 1;
        D.20267 = *D.20266;
        D.20268 = (int) D.20267;
        __result = D.20265 - D.20268;
        D.20269 = __s2_len > 1;
        D.20259 = __result == 0;
        D.20270 = D.20269 & D.20259;
        if (D.20270 != 0) goto <D.20271>; else goto <D.20272>;
        <D.20271>:
        D.20273 = &MEM[(void *)"APPBASE" + 2B];
        D.20274 = *D.20273;
        D.20275 = (int) D.20274;
        D.20276 = __s2 + 2;
        D.20277 = *D.20276;
        D.20278 = (int) D.20277;
        __result = D.20275 - D.20278;
        D.20279 = __s2_len > 2;
        D.20259 = __result == 0;
        D.20280 = D.20279 & D.20259;
        if (D.20280 != 0) goto <D.20281>; else goto <D.20282>;
        <D.20281>:
        D.20283 = &MEM[(void *)"APPBASE" + 3B];
        D.20284 = *D.20283;
        D.20285 = (int) D.20284;
        D.20286 = __s2 + 3;
        D.20287 = *D.20286;
        D.20288 = (int) D.20287;
        __result = D.20285 - D.20288;
        <D.20282>:
        <D.20272>:
        <D.20262>:
      }
      D.18983 = __result;
    }
    iftmp.23 = -D.18983;
    goto <D.20289>;
    <D.20252>:
    iftmp.23 = __builtin_strcmp (str, "APPBASE");
    <D.20289>:
    D.18984 = iftmp.23;
  }
  if (D.18984 == 0) goto <D.20290>; else goto <D.20291>;
  <D.20290>:
  D.20292 = add->setup;
  o = D.20292->application_base;
  goto <D.20293>;
  <D.20291>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20297 = "APP_CONFIG_FILE";
      D.20298 = MEM[(const unsigned char *)D.20297];
      D.20299 = (int) D.20298;
      D.20300 = *__s2;
      D.20301 = (int) D.20300;
      __result = D.20299 - D.20301;
      {
        D.20302 = __s2_len != 0;
        D.20303 = __result == 0;
        D.20304 = D.20302 & D.20303;
        if (D.20304 != 0) goto <D.20305>; else goto <D.20306>;
        <D.20305>:
        D.20307 = &MEM[(void *)"APP_CONFIG_FILE" + 1B];
        D.20308 = *D.20307;
        D.20309 = (int) D.20308;
        D.20310 = __s2 + 1;
        D.20311 = *D.20310;
        D.20312 = (int) D.20311;
        __result = D.20309 - D.20312;
        D.20313 = __s2_len > 1;
        D.20303 = __result == 0;
        D.20314 = D.20313 & D.20303;
        if (D.20314 != 0) goto <D.20315>; else goto <D.20316>;
        <D.20315>:
        D.20317 = &MEM[(void *)"APP_CONFIG_FILE" + 2B];
        D.20318 = *D.20317;
        D.20319 = (int) D.20318;
        D.20320 = __s2 + 2;
        D.20321 = *D.20320;
        D.20322 = (int) D.20321;
        __result = D.20319 - D.20322;
        D.20323 = __s2_len > 2;
        D.20303 = __result == 0;
        D.20324 = D.20323 & D.20303;
        if (D.20324 != 0) goto <D.20325>; else goto <D.20326>;
        <D.20325>:
        D.20327 = &MEM[(void *)"APP_CONFIG_FILE" + 3B];
        D.20328 = *D.20327;
        D.20329 = (int) D.20328;
        D.20330 = __s2 + 3;
        D.20331 = *D.20330;
        D.20332 = (int) D.20331;
        __result = D.20329 - D.20332;
        <D.20326>:
        <D.20316>:
        <D.20306>:
      }
      D.18992 = __result;
    }
    iftmp.24 = -D.18992;
    goto <D.20333>;
    <D.20296>:
    iftmp.24 = __builtin_strcmp (str, "APP_CONFIG_FILE");
    <D.20333>:
    D.18993 = iftmp.24;
  }
  if (D.18993 == 0) goto <D.20334>; else goto <D.20335>;
  <D.20334>:
  D.20292 = add->setup;
  o = D.20292->configuration_file;
  goto <D.20336>;
  <D.20335>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20340 = "DYNAMIC_BASE";
      D.20341 = MEM[(const unsigned char *)D.20340];
      D.20342 = (int) D.20341;
      D.20343 = *__s2;
      D.20344 = (int) D.20343;
      __result = D.20342 - D.20344;
      {
        D.20345 = __s2_len != 0;
        D.20346 = __result == 0;
        D.20347 = D.20345 & D.20346;
        if (D.20347 != 0) goto <D.20348>; else goto <D.20349>;
        <D.20348>:
        D.20350 = &MEM[(void *)"DYNAMIC_BASE" + 1B];
        D.20351 = *D.20350;
        D.20352 = (int) D.20351;
        D.20353 = __s2 + 1;
        D.20354 = *D.20353;
        D.20355 = (int) D.20354;
        __result = D.20352 - D.20355;
        D.20356 = __s2_len > 1;
        D.20346 = __result == 0;
        D.20357 = D.20356 & D.20346;
        if (D.20357 != 0) goto <D.20358>; else goto <D.20359>;
        <D.20358>:
        D.20360 = &MEM[(void *)"DYNAMIC_BASE" + 2B];
        D.20361 = *D.20360;
        D.20362 = (int) D.20361;
        D.20363 = __s2 + 2;
        D.20364 = *D.20363;
        D.20365 = (int) D.20364;
        __result = D.20362 - D.20365;
        D.20366 = __s2_len > 2;
        D.20346 = __result == 0;
        D.20367 = D.20366 & D.20346;
        if (D.20367 != 0) goto <D.20368>; else goto <D.20369>;
        <D.20368>:
        D.20370 = &MEM[(void *)"DYNAMIC_BASE" + 3B];
        D.20371 = *D.20370;
        D.20372 = (int) D.20371;
        D.20373 = __s2 + 3;
        D.20374 = *D.20373;
        D.20375 = (int) D.20374;
        __result = D.20372 - D.20375;
        <D.20369>:
        <D.20359>:
        <D.20349>:
      }
      D.19001 = __result;
    }
    iftmp.25 = -D.19001;
    goto <D.20376>;
    <D.20339>:
    iftmp.25 = __builtin_strcmp (str, "DYNAMIC_BASE");
    <D.20376>:
    D.19002 = iftmp.25;
  }
  if (D.19002 == 0) goto <D.20377>; else goto <D.20378>;
  <D.20377>:
  D.20292 = add->setup;
  o = D.20292->dynamic_base;
  goto <D.20379>;
  <D.20378>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20383 = "APP_NAME";
      D.20384 = MEM[(const unsigned char *)D.20383];
      D.20385 = (int) D.20384;
      D.20386 = *__s2;
      D.20387 = (int) D.20386;
      __result = D.20385 - D.20387;
      {
        D.20388 = __s2_len != 0;
        D.20389 = __result == 0;
        D.20390 = D.20388 & D.20389;
        if (D.20390 != 0) goto <D.20391>; else goto <D.20392>;
        <D.20391>:
        D.20393 = &MEM[(void *)"APP_NAME" + 1B];
        D.20394 = *D.20393;
        D.20395 = (int) D.20394;
        D.20396 = __s2 + 1;
        D.20397 = *D.20396;
        D.20398 = (int) D.20397;
        __result = D.20395 - D.20398;
        D.20399 = __s2_len > 1;
        D.20389 = __result == 0;
        D.20400 = D.20399 & D.20389;
        if (D.20400 != 0) goto <D.20401>; else goto <D.20402>;
        <D.20401>:
        D.20403 = &MEM[(void *)"APP_NAME" + 2B];
        D.20404 = *D.20403;
        D.20405 = (int) D.20404;
        D.20406 = __s2 + 2;
        D.20407 = *D.20406;
        D.20408 = (int) D.20407;
        __result = D.20405 - D.20408;
        D.20409 = __s2_len > 2;
        D.20389 = __result == 0;
        D.20410 = D.20409 & D.20389;
        if (D.20410 != 0) goto <D.20411>; else goto <D.20412>;
        <D.20411>:
        D.20413 = &MEM[(void *)"APP_NAME" + 3B];
        D.20414 = *D.20413;
        D.20415 = (int) D.20414;
        D.20416 = __s2 + 3;
        D.20417 = *D.20416;
        D.20418 = (int) D.20417;
        __result = D.20415 - D.20418;
        <D.20412>:
        <D.20402>:
        <D.20392>:
      }
      D.19010 = __result;
    }
    iftmp.26 = -D.19010;
    goto <D.20419>;
    <D.20382>:
    iftmp.26 = __builtin_strcmp (str, "APP_NAME");
    <D.20419>:
    D.19011 = iftmp.26;
  }
  if (D.19011 == 0) goto <D.20420>; else goto <D.20421>;
  <D.20420>:
  D.20292 = add->setup;
  o = D.20292->application_name;
  goto <D.20422>;
  <D.20421>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20426 = "CACHE_BASE";
      D.20427 = MEM[(const unsigned char *)D.20426];
      D.20428 = (int) D.20427;
      D.20429 = *__s2;
      D.20430 = (int) D.20429;
      __result = D.20428 - D.20430;
      {
        D.20431 = __s2_len != 0;
        D.20432 = __result == 0;
        D.20433 = D.20431 & D.20432;
        if (D.20433 != 0) goto <D.20434>; else goto <D.20435>;
        <D.20434>:
        D.20436 = &MEM[(void *)"CACHE_BASE" + 1B];
        D.20437 = *D.20436;
        D.20438 = (int) D.20437;
        D.20439 = __s2 + 1;
        D.20440 = *D.20439;
        D.20441 = (int) D.20440;
        __result = D.20438 - D.20441;
        D.20442 = __s2_len > 1;
        D.20432 = __result == 0;
        D.20443 = D.20442 & D.20432;
        if (D.20443 != 0) goto <D.20444>; else goto <D.20445>;
        <D.20444>:
        D.20446 = &MEM[(void *)"CACHE_BASE" + 2B];
        D.20447 = *D.20446;
        D.20448 = (int) D.20447;
        D.20449 = __s2 + 2;
        D.20450 = *D.20449;
        D.20451 = (int) D.20450;
        __result = D.20448 - D.20451;
        D.20452 = __s2_len > 2;
        D.20432 = __result == 0;
        D.20453 = D.20452 & D.20432;
        if (D.20453 != 0) goto <D.20454>; else goto <D.20455>;
        <D.20454>:
        D.20456 = &MEM[(void *)"CACHE_BASE" + 3B];
        D.20457 = *D.20456;
        D.20458 = (int) D.20457;
        D.20459 = __s2 + 3;
        D.20460 = *D.20459;
        D.20461 = (int) D.20460;
        __result = D.20458 - D.20461;
        <D.20455>:
        <D.20445>:
        <D.20435>:
      }
      D.19019 = __result;
    }
    iftmp.27 = -D.19019;
    goto <D.20462>;
    <D.20425>:
    iftmp.27 = __builtin_strcmp (str, "CACHE_BASE");
    <D.20462>:
    D.19020 = iftmp.27;
  }
  if (D.19020 == 0) goto <D.20463>; else goto <D.20464>;
  <D.20463>:
  D.20292 = add->setup;
  o = D.20292->cache_path;
  goto <D.20465>;
  <D.20464>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20469 = "PRIVATE_BINPATH";
      D.20470 = MEM[(const unsigned char *)D.20469];
      D.20471 = (int) D.20470;
      D.20472 = *__s2;
      D.20473 = (int) D.20472;
      __result = D.20471 - D.20473;
      {
        D.20474 = __s2_len != 0;
        D.20475 = __result == 0;
        D.20476 = D.20474 & D.20475;
        if (D.20476 != 0) goto <D.20477>; else goto <D.20478>;
        <D.20477>:
        D.20479 = &MEM[(void *)"PRIVATE_BINPATH" + 1B];
        D.20480 = *D.20479;
        D.20481 = (int) D.20480;
        D.20482 = __s2 + 1;
        D.20483 = *D.20482;
        D.20484 = (int) D.20483;
        __result = D.20481 - D.20484;
        D.20485 = __s2_len > 1;
        D.20475 = __result == 0;
        D.20486 = D.20485 & D.20475;
        if (D.20486 != 0) goto <D.20487>; else goto <D.20488>;
        <D.20487>:
        D.20489 = &MEM[(void *)"PRIVATE_BINPATH" + 2B];
        D.20490 = *D.20489;
        D.20491 = (int) D.20490;
        D.20492 = __s2 + 2;
        D.20493 = *D.20492;
        D.20494 = (int) D.20493;
        __result = D.20491 - D.20494;
        D.20495 = __s2_len > 2;
        D.20475 = __result == 0;
        D.20496 = D.20495 & D.20475;
        if (D.20496 != 0) goto <D.20497>; else goto <D.20498>;
        <D.20497>:
        D.20499 = &MEM[(void *)"PRIVATE_BINPATH" + 3B];
        D.20500 = *D.20499;
        D.20501 = (int) D.20500;
        D.20502 = __s2 + 3;
        D.20503 = *D.20502;
        D.20504 = (int) D.20503;
        __result = D.20501 - D.20504;
        <D.20498>:
        <D.20488>:
        <D.20478>:
      }
      D.19028 = __result;
    }
    iftmp.28 = -D.19028;
    goto <D.20505>;
    <D.20468>:
    iftmp.28 = __builtin_strcmp (str, "PRIVATE_BINPATH");
    <D.20505>:
    D.19029 = iftmp.28;
  }
  if (D.19029 == 0) goto <D.20506>; else goto <D.20507>;
  <D.20506>:
  D.20292 = add->setup;
  o = D.20292->private_bin_path;
  goto <D.20508>;
  <D.20507>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20512 = "BINPATH_PROBE_ONLY";
      D.20513 = MEM[(const unsigned char *)D.20512];
      D.20514 = (int) D.20513;
      D.20515 = *__s2;
      D.20516 = (int) D.20515;
      __result = D.20514 - D.20516;
      {
        D.20517 = __s2_len != 0;
        D.20518 = __result == 0;
        D.20519 = D.20517 & D.20518;
        if (D.20519 != 0) goto <D.20520>; else goto <D.20521>;
        <D.20520>:
        D.20522 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 1B];
        D.20523 = *D.20522;
        D.20524 = (int) D.20523;
        D.20525 = __s2 + 1;
        D.20526 = *D.20525;
        D.20527 = (int) D.20526;
        __result = D.20524 - D.20527;
        D.20528 = __s2_len > 1;
        D.20518 = __result == 0;
        D.20529 = D.20528 & D.20518;
        if (D.20529 != 0) goto <D.20530>; else goto <D.20531>;
        <D.20530>:
        D.20532 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 2B];
        D.20533 = *D.20532;
        D.20534 = (int) D.20533;
        D.20535 = __s2 + 2;
        D.20536 = *D.20535;
        D.20537 = (int) D.20536;
        __result = D.20534 - D.20537;
        D.20538 = __s2_len > 2;
        D.20518 = __result == 0;
        D.20539 = D.20538 & D.20518;
        if (D.20539 != 0) goto <D.20540>; else goto <D.20541>;
        <D.20540>:
        D.20542 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 3B];
        D.20543 = *D.20542;
        D.20544 = (int) D.20543;
        D.20545 = __s2 + 3;
        D.20546 = *D.20545;
        D.20547 = (int) D.20546;
        __result = D.20544 - D.20547;
        <D.20541>:
        <D.20531>:
        <D.20521>:
      }
      D.19037 = __result;
    }
    iftmp.29 = -D.19037;
    goto <D.20548>;
    <D.20511>:
    iftmp.29 = __builtin_strcmp (str, "BINPATH_PROBE_ONLY");
    <D.20548>:
    D.19038 = iftmp.29;
  }
  if (D.19038 == 0) goto <D.20549>; else goto <D.20550>;
  <D.20549>:
  D.20292 = add->setup;
  o = D.20292->private_bin_path_probe;
  goto <D.20551>;
  <D.20550>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20555 = "SHADOW_COPY_DIRS";
      D.20556 = MEM[(const unsigned char *)D.20555];
      D.20557 = (int) D.20556;
      D.20558 = *__s2;
      D.20559 = (int) D.20558;
      __result = D.20557 - D.20559;
      {
        D.20560 = __s2_len != 0;
        D.20561 = __result == 0;
        D.20562 = D.20560 & D.20561;
        if (D.20562 != 0) goto <D.20563>; else goto <D.20564>;
        <D.20563>:
        D.20565 = &MEM[(void *)"SHADOW_COPY_DIRS" + 1B];
        D.20566 = *D.20565;
        D.20567 = (int) D.20566;
        D.20568 = __s2 + 1;
        D.20569 = *D.20568;
        D.20570 = (int) D.20569;
        __result = D.20567 - D.20570;
        D.20571 = __s2_len > 1;
        D.20561 = __result == 0;
        D.20572 = D.20571 & D.20561;
        if (D.20572 != 0) goto <D.20573>; else goto <D.20574>;
        <D.20573>:
        D.20575 = &MEM[(void *)"SHADOW_COPY_DIRS" + 2B];
        D.20576 = *D.20575;
        D.20577 = (int) D.20576;
        D.20578 = __s2 + 2;
        D.20579 = *D.20578;
        D.20580 = (int) D.20579;
        __result = D.20577 - D.20580;
        D.20581 = __s2_len > 2;
        D.20561 = __result == 0;
        D.20582 = D.20581 & D.20561;
        if (D.20582 != 0) goto <D.20583>; else goto <D.20584>;
        <D.20583>:
        D.20585 = &MEM[(void *)"SHADOW_COPY_DIRS" + 3B];
        D.20586 = *D.20585;
        D.20587 = (int) D.20586;
        D.20588 = __s2 + 3;
        D.20589 = *D.20588;
        D.20590 = (int) D.20589;
        __result = D.20587 - D.20590;
        <D.20584>:
        <D.20574>:
        <D.20564>:
      }
      D.19046 = __result;
    }
    iftmp.30 = -D.19046;
    goto <D.20591>;
    <D.20554>:
    iftmp.30 = __builtin_strcmp (str, "SHADOW_COPY_DIRS");
    <D.20591>:
    D.19047 = iftmp.30;
  }
  if (D.19047 == 0) goto <D.20592>; else goto <D.20593>;
  <D.20592>:
  D.20292 = add->setup;
  o = D.20292->shadow_copy_directories;
  goto <D.20594>;
  <D.20593>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20598 = "FORCE_CACHE_INSTALL";
      D.20599 = MEM[(const unsigned char *)D.20598];
      D.20600 = (int) D.20599;
      D.20601 = *__s2;
      D.20602 = (int) D.20601;
      __result = D.20600 - D.20602;
      {
        D.20603 = __s2_len != 0;
        D.20604 = __result == 0;
        D.20605 = D.20603 & D.20604;
        if (D.20605 != 0) goto <D.20606>; else goto <D.20607>;
        <D.20606>:
        D.20608 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 1B];
        D.20609 = *D.20608;
        D.20610 = (int) D.20609;
        D.20611 = __s2 + 1;
        D.20612 = *D.20611;
        D.20613 = (int) D.20612;
        __result = D.20610 - D.20613;
        D.20614 = __s2_len > 1;
        D.20604 = __result == 0;
        D.20615 = D.20614 & D.20604;
        if (D.20615 != 0) goto <D.20616>; else goto <D.20617>;
        <D.20616>:
        D.20618 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 2B];
        D.20619 = *D.20618;
        D.20620 = (int) D.20619;
        D.20621 = __s2 + 2;
        D.20622 = *D.20621;
        D.20623 = (int) D.20622;
        __result = D.20620 - D.20623;
        D.20624 = __s2_len > 2;
        D.20604 = __result == 0;
        D.20625 = D.20624 & D.20604;
        if (D.20625 != 0) goto <D.20626>; else goto <D.20627>;
        <D.20626>:
        D.20628 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 3B];
        D.20629 = *D.20628;
        D.20630 = (int) D.20629;
        D.20631 = __s2 + 3;
        D.20632 = *D.20631;
        D.20633 = (int) D.20632;
        __result = D.20630 - D.20633;
        <D.20627>:
        <D.20617>:
        <D.20607>:
      }
      D.19055 = __result;
    }
    iftmp.31 = -D.19055;
    goto <D.20634>;
    <D.20597>:
    iftmp.31 = __builtin_strcmp (str, "FORCE_CACHE_INSTALL");
    <D.20634>:
    D.19056 = iftmp.31;
  }
  if (D.19056 == 0) goto <D.20635>; else goto <D.20636>;
  <D.20635>:
  D.20292 = add->setup;
  o = D.20292->shadow_copy_files;
  goto <D.20637>;
  <D.20636>:
  D.20638 = add->env;
  o = mono_g_hash_table_lookup (D.20638, name);
  <D.20637>:
  <D.20594>:
  <D.20551>:
  <D.20508>:
  <D.20465>:
  <D.20422>:
  <D.20379>:
  <D.20336>:
  <D.20293>:
  {
    int ret;

    D.20242 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.20242);
    if (ret != 0) goto <D.20639>; else goto <D.20640>;
    <D.20639>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20640>:
    D.20641 = ret != 0;
    D.20642 = (long int) D.20641;
    D.20643 = __builtin_expect (D.20642, 0);
    if (D.20643 != 0) goto <D.20644>; else goto <D.20645>;
    <D.20644>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 634, "ret == 0");
    <D.20645>:
  }
  monoeg_g_free (str);
  if (o == 0B) goto <D.20646>; else goto <D.20647>;
  <D.20646>:
  D.20648 = 0B;
  return D.20648;
  <D.20647>:
  D.20648 = o;
  return D.20648;
}


ves_icall_System_AppDomain_SetData (struct MonoAppDomain * ad, struct MonoString * name, struct MonoObject * data)
{
  _Bool D.20650;
  long int D.20651;
  long int D.20652;
  _Bool D.20655;
  long int D.20656;
  long int D.20657;
  struct MonoException * D.20662;
  union mono_mutex_t * D.20663;
  _Bool D.20666;
  long int D.20667;
  long int D.20668;
  struct MonoGHashTable * D.20671;
  _Bool D.20674;
  long int D.20675;
  long int D.20676;
  struct MonoDomain * add;

  D.20650 = ad == 0B;
  D.20651 = (long int) D.20650;
  D.20652 = __builtin_expect (D.20651, 0);
  if (D.20652 != 0) goto <D.20653>; else goto <D.20654>;
  <D.20653>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 650, "ad != NULL");
  <D.20654>:
  add = ad->data;
  D.20655 = add == 0B;
  D.20656 = (long int) D.20655;
  D.20657 = __builtin_expect (D.20656, 0);
  if (D.20657 != 0) goto <D.20658>; else goto <D.20659>;
  <D.20658>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 652, "add != NULL");
  <D.20659>:
  if (name == 0B) goto <D.20660>; else goto <D.20661>;
  <D.20660>:
  D.20662 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.20662);
  <D.20661>:
  {
    int ret;

    D.20663 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.20663);
    if (ret != 0) goto <D.20664>; else goto <D.20665>;
    <D.20664>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20665>:
    D.20666 = ret != 0;
    D.20667 = (long int) D.20666;
    D.20668 = __builtin_expect (D.20667, 0);
    if (D.20668 != 0) goto <D.20669>; else goto <D.20670>;
    <D.20669>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 657, "ret == 0");
    <D.20670>:
  }
  D.20671 = add->env;
  mono_g_hash_table_insert (D.20671, name, data);
  {
    int ret;

    D.20663 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.20663);
    if (ret != 0) goto <D.20672>; else goto <D.20673>;
    <D.20672>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20673>:
    D.20674 = ret != 0;
    D.20675 = (long int) D.20674;
    D.20676 = __builtin_expect (D.20675, 0);
    if (D.20676 != 0) goto <D.20677>; else goto <D.20678>;
    <D.20677>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 661, "ret == 0");
    <D.20678>:
  }
}


ves_icall_System_AppDomain_getSetup (struct MonoAppDomain * ad)
{
  _Bool D.20679;
  long int D.20680;
  long int D.20681;
  struct MonoDomain * D.20684;
  _Bool D.20685;
  long int D.20686;
  long int D.20687;
  struct MonoAppDomainSetup * D.20690;

  D.20679 = ad == 0B;
  D.20680 = (long int) D.20679;
  D.20681 = __builtin_expect (D.20680, 0);
  if (D.20681 != 0) goto <D.20682>; else goto <D.20683>;
  <D.20682>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 669, "ad != NULL");
  <D.20683>:
  D.20684 = ad->data;
  D.20685 = D.20684 == 0B;
  D.20686 = (long int) D.20685;
  D.20687 = __builtin_expect (D.20686, 0);
  if (D.20687 != 0) goto <D.20688>; else goto <D.20689>;
  <D.20688>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 670, "ad->data != NULL");
  <D.20689>:
  D.20684 = ad->data;
  D.20690 = D.20684->setup;
  return D.20690;
}


ves_icall_System_AppDomain_getFriendlyName (struct MonoAppDomain * ad)
{
  _Bool D.20692;
  long int D.20693;
  long int D.20694;
  struct MonoDomain * D.20697;
  _Bool D.20698;
  long int D.20699;
  long int D.20700;
  struct MonoString * D.20703;
  char * D.20704;

  D.20692 = ad == 0B;
  D.20693 = (long int) D.20692;
  D.20694 = __builtin_expect (D.20693, 0);
  if (D.20694 != 0) goto <D.20695>; else goto <D.20696>;
  <D.20695>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 680, "ad != NULL");
  <D.20696>:
  D.20697 = ad->data;
  D.20698 = D.20697 == 0B;
  D.20699 = (long int) D.20698;
  D.20700 = __builtin_expect (D.20699, 0);
  if (D.20700 != 0) goto <D.20701>; else goto <D.20702>;
  <D.20701>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 681, "ad->data != NULL");
  <D.20702>:
  D.20697 = ad->data;
  D.20704 = D.20697->friendly_name;
  D.20697 = ad->data;
  D.20703 = mono_string_new (D.20697, D.20704);
  return D.20703;
}


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

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


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

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


mono_set_private_bin_path_from_config (struct MonoDomain * domain)
{
  struct MonoAppDomainSetup * D.20713;
  struct MonoString * D.20715;
  int D.20716;
  int D.20721;
  unsigned int len.32;
  gchar * text.33;
  char D.20727;
  gchar * D.20730;
  char D.20731;
  gchar * D.20734;
  char D.20735;
  unsigned int offset.34;
  unsigned int D.20739;
  int D.20740;
  sizetype offset.35;
  const gchar * D.20742;
  int D.20743;
  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.20710>; else goto <D.20712>;
      <D.20712>:
      D.20713 = domain->setup;
      if (D.20713 == 0B) goto <D.20710>; else goto <D.20714>;
      <D.20714>:
      D.20713 = domain->setup;
      D.20715 = D.20713->configuration_file;
      if (D.20715 == 0B) goto <D.20710>; else goto <D.20711>;
      <D.20710>:
      return;
      <D.20711>:
      D.20713 = domain->setup;
      D.20715 = D.20713->configuration_file;
      config_file_name = mono_string_to_utf8_checked (D.20715, &error);
      D.20716 = mono_error_ok (&error);
      if (D.20716 == 0) goto <D.20717>; else goto <D.20718>;
      <D.20717>:
      mono_error_cleanup (&error);
      goto free_and_out;
      <D.20718>:
      config_file_path = mono_portability_find_file (config_file_name, 1);
      if (config_file_path == 0B) goto <D.20719>; else goto <D.20720>;
      <D.20719>:
      config_file_path = config_file_name;
      <D.20720>:
      D.20721 = monoeg_g_file_get_contents (config_file_path, &text, &len, 0B);
      if (D.20721 == 0) goto free_and_out; else goto <D.20722>;
      <D.20722>:
      runtime_config.runtime_count = 0;
      runtime_config.assemblybinding_count = 0;
      runtime_config.domain = domain;
      runtime_config.filename = config_file_path;
      offset = 0;
      len.32 = len;
      if (len.32 > 3) goto <D.20724>; else goto <D.20725>;
      <D.20724>:
      text.33 = text;
      D.20727 = *text.33;
      if (D.20727 == -17) goto <D.20728>; else goto <D.20729>;
      <D.20728>:
      text.33 = text;
      D.20730 = text.33 + 1;
      D.20731 = *D.20730;
      if (D.20731 == -69) goto <D.20732>; else goto <D.20733>;
      <D.20732>:
      text.33 = text;
      D.20734 = text.33 + 2;
      D.20735 = *D.20734;
      if (D.20735 == -65) goto <D.20736>; else goto <D.20737>;
      <D.20736>:
      offset = 3;
      <D.20737>:
      <D.20733>:
      <D.20729>:
      <D.20725>:
      context = monoeg_g_markup_parse_context_new (&mono_parser, 0, &runtime_config, 0B);
      len.32 = len;
      offset.34 = (unsigned int) offset;
      D.20739 = len.32 - offset.34;
      D.20740 = (int) D.20739;
      text.33 = text;
      offset.35 = (sizetype) offset;
      D.20742 = text.33 + offset.35;
      D.20743 = monoeg_g_markup_parse_context_parse (context, D.20742, D.20740, 0B);
      if (D.20743 != 0) goto <D.20744>; else goto <D.20745>;
      <D.20744>:
      monoeg_g_markup_parse_context_end_parse (context, 0B);
      <D.20745>:
      monoeg_g_markup_parse_context_free (context);
      free_and_out:
      text.33 = text;
      monoeg_g_free (text.33);
      if (config_file_name != config_file_path) goto <D.20746>; else goto <D.20747>;
      <D.20746>:
      monoeg_g_free (config_file_name);
      <D.20747>:
      monoeg_g_free (config_file_path);
    }
  finally
    {
      error = {CLOBBER};
      text = {CLOBBER};
      len = {CLOBBER};
      runtime_config = {CLOBBER};
    }
}


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

  state = user_data;
  if (state != 0B) goto <D.20754>; else goto <D.20752>;
  <D.20754>:
  D.20755 = state->filename;
  if (D.20755 != 0B) goto <D.20756>; else goto <D.20752>;
  <D.20756>:
  iftmp.36 = state->filename;
  goto <D.20753>;
  <D.20752>:
  iftmp.36 = "<unknown>";
  <D.20753>:
  filename = iftmp.36;
  if (error != 0B) goto <D.20760>; else goto <D.20758>;
  <D.20760>:
  D.20761 = error->message;
  if (D.20761 != 0B) goto <D.20762>; else goto <D.20758>;
  <D.20762>:
  iftmp.37 = error->message;
  goto <D.20759>;
  <D.20758>:
  iftmp.37 = "";
  <D.20759>:
  msg = iftmp.37;
  monoeg_g_log (0B, 16, "Error parsing %s: %s", filename, msg);
}


end_element (struct GMarkupParseContext * context, const gchar * element_name, void * user_data, struct GError * * error)
{
  int D.19147;
  int iftmp.38;
  int D.19146;
  const char[8] * D.20766;
  unsigned char D.20767;
  int D.20768;
  unsigned char D.20769;
  int D.20770;
  _Bool D.20771;
  _Bool D.20772;
  _Bool D.20773;
  const unsigned char * D.20776;
  unsigned char D.20777;
  int D.20778;
  const unsigned char * D.20779;
  unsigned char D.20780;
  int D.20781;
  _Bool D.20782;
  _Bool D.20783;
  const unsigned char * D.20786;
  unsigned char D.20787;
  int D.20788;
  const unsigned char * D.20789;
  unsigned char D.20790;
  int D.20791;
  _Bool D.20792;
  _Bool D.20793;
  const unsigned char * D.20796;
  unsigned char D.20797;
  int D.20798;
  const unsigned char * D.20799;
  unsigned char D.20800;
  int D.20801;
  int D.20805;
  int D.20806;
  int D.19156;
  int iftmp.39;
  int D.19155;
  const char[16] * D.20811;
  unsigned char D.20812;
  int D.20813;
  unsigned char D.20814;
  int D.20815;
  _Bool 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;
  _Bool D.20827;
  _Bool D.20828;
  const unsigned char * D.20831;
  unsigned char D.20832;
  int D.20833;
  const unsigned char * D.20834;
  unsigned char D.20835;
  int D.20836;
  _Bool D.20837;
  _Bool D.20838;
  const unsigned char * D.20841;
  unsigned char D.20842;
  int D.20843;
  const unsigned char * D.20844;
  unsigned char D.20845;
  int D.20846;
  int D.20850;
  int D.20851;
  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.20764>; else goto <D.20765>;
    <D.20764>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.20766 = "runtime";
      D.20767 = MEM[(const unsigned char *)D.20766];
      D.20768 = (int) D.20767;
      D.20769 = *__s2;
      D.20770 = (int) D.20769;
      __result = D.20768 - D.20770;
      {
        D.20771 = __s2_len != 0;
        D.20772 = __result == 0;
        D.20773 = D.20771 & D.20772;
        if (D.20773 != 0) goto <D.20774>; else goto <D.20775>;
        <D.20774>:
        D.20776 = &MEM[(void *)"runtime" + 1B];
        D.20777 = *D.20776;
        D.20778 = (int) D.20777;
        D.20779 = __s2 + 1;
        D.20780 = *D.20779;
        D.20781 = (int) D.20780;
        __result = D.20778 - D.20781;
        D.20782 = __s2_len > 1;
        D.20772 = __result == 0;
        D.20783 = D.20782 & D.20772;
        if (D.20783 != 0) goto <D.20784>; else goto <D.20785>;
        <D.20784>:
        D.20786 = &MEM[(void *)"runtime" + 2B];
        D.20787 = *D.20786;
        D.20788 = (int) D.20787;
        D.20789 = __s2 + 2;
        D.20790 = *D.20789;
        D.20791 = (int) D.20790;
        __result = D.20788 - D.20791;
        D.20792 = __s2_len > 2;
        D.20772 = __result == 0;
        D.20793 = D.20792 & D.20772;
        if (D.20793 != 0) goto <D.20794>; else goto <D.20795>;
        <D.20794>:
        D.20796 = &MEM[(void *)"runtime" + 3B];
        D.20797 = *D.20796;
        D.20798 = (int) D.20797;
        D.20799 = __s2 + 3;
        D.20800 = *D.20799;
        D.20801 = (int) D.20800;
        __result = D.20798 - D.20801;
        <D.20795>:
        <D.20785>:
        <D.20775>:
      }
      D.19146 = __result;
    }
    iftmp.38 = -D.19146;
    goto <D.20802>;
    <D.20765>:
    iftmp.38 = __builtin_strcmp (element_name, "runtime");
    <D.20802>:
    D.19147 = iftmp.38;
  }
  if (D.19147 == 0) goto <D.20803>; else goto <D.20804>;
  <D.20803>:
  D.20805 = runtime_config->runtime_count;
  D.20806 = D.20805 + -1;
  runtime_config->runtime_count = D.20806;
  goto <D.20807>;
  <D.20804>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20811 = "assemblyBinding";
      D.20812 = MEM[(const unsigned char *)D.20811];
      D.20813 = (int) D.20812;
      D.20814 = *__s2;
      D.20815 = (int) D.20814;
      __result = D.20813 - D.20815;
      {
        D.20816 = __s2_len != 0;
        D.20817 = __result == 0;
        D.20818 = D.20816 & D.20817;
        if (D.20818 != 0) goto <D.20819>; else goto <D.20820>;
        <D.20819>:
        D.20821 = &MEM[(void *)"assemblyBinding" + 1B];
        D.20822 = *D.20821;
        D.20823 = (int) D.20822;
        D.20824 = __s2 + 1;
        D.20825 = *D.20824;
        D.20826 = (int) D.20825;
        __result = D.20823 - D.20826;
        D.20827 = __s2_len > 1;
        D.20817 = __result == 0;
        D.20828 = D.20827 & D.20817;
        if (D.20828 != 0) goto <D.20829>; else goto <D.20830>;
        <D.20829>:
        D.20831 = &MEM[(void *)"assemblyBinding" + 2B];
        D.20832 = *D.20831;
        D.20833 = (int) D.20832;
        D.20834 = __s2 + 2;
        D.20835 = *D.20834;
        D.20836 = (int) D.20835;
        __result = D.20833 - D.20836;
        D.20837 = __s2_len > 2;
        D.20817 = __result == 0;
        D.20838 = D.20837 & D.20817;
        if (D.20838 != 0) goto <D.20839>; else goto <D.20840>;
        <D.20839>:
        D.20841 = &MEM[(void *)"assemblyBinding" + 3B];
        D.20842 = *D.20841;
        D.20843 = (int) D.20842;
        D.20844 = __s2 + 3;
        D.20845 = *D.20844;
        D.20846 = (int) D.20845;
        __result = D.20843 - D.20846;
        <D.20840>:
        <D.20830>:
        <D.20820>:
      }
      D.19155 = __result;
    }
    iftmp.39 = -D.19155;
    goto <D.20847>;
    <D.20810>:
    iftmp.39 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.20847>:
    D.19156 = iftmp.39;
  }
  if (D.19156 == 0) goto <D.20848>; else goto <D.20849>;
  <D.20848>:
  D.20850 = runtime_config->assemblybinding_count;
  D.20851 = D.20850 + -1;
  runtime_config->assemblybinding_count = D.20851;
  <D.20849>:
  <D.20807>:
}


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.19113;
  int iftmp.40;
  int D.19112;
  const char[8] * D.20855;
  unsigned char D.20856;
  int D.20857;
  unsigned char D.20858;
  int D.20859;
  _Bool D.20860;
  _Bool D.20861;
  _Bool D.20862;
  const unsigned char * D.20865;
  unsigned char D.20866;
  int D.20867;
  const unsigned char * D.20868;
  unsigned char D.20869;
  int D.20870;
  _Bool D.20871;
  _Bool D.20872;
  const unsigned char * D.20875;
  unsigned char D.20876;
  int D.20877;
  const unsigned char * D.20878;
  unsigned char D.20879;
  int D.20880;
  _Bool D.20881;
  _Bool D.20882;
  const unsigned char * D.20885;
  unsigned char D.20886;
  int D.20887;
  const unsigned char * D.20888;
  unsigned char D.20889;
  int D.20890;
  int D.20894;
  int D.20895;
  int D.19122;
  int iftmp.41;
  int D.19121;
  const char[16] * D.20899;
  unsigned char D.20900;
  int D.20901;
  unsigned char D.20902;
  int D.20903;
  _Bool D.20904;
  _Bool D.20905;
  _Bool D.20906;
  const unsigned char * D.20909;
  unsigned char D.20910;
  int D.20911;
  const unsigned char * D.20912;
  unsigned char D.20913;
  int D.20914;
  _Bool D.20915;
  _Bool D.20916;
  const unsigned char * D.20919;
  unsigned char D.20920;
  int D.20921;
  const unsigned char * D.20922;
  unsigned char D.20923;
  int D.20924;
  _Bool D.20925;
  _Bool D.20926;
  const unsigned char * D.20929;
  unsigned char D.20930;
  int D.20931;
  const unsigned char * D.20932;
  unsigned char D.20933;
  int D.20934;
  int D.20938;
  int D.20939;
  int D.19131;
  int iftmp.42;
  int D.19130;
  const char[8] * D.20946;
  unsigned char D.20947;
  int D.20948;
  unsigned char D.20949;
  int D.20950;
  _Bool D.20951;
  _Bool D.20952;
  _Bool D.20953;
  const unsigned char * D.20956;
  unsigned char D.20957;
  int D.20958;
  const unsigned char * D.20959;
  unsigned char D.20960;
  int D.20961;
  _Bool D.20962;
  _Bool D.20963;
  const unsigned char * D.20966;
  unsigned char D.20967;
  int D.20968;
  const unsigned char * D.20969;
  unsigned char D.20970;
  int D.20971;
  _Bool D.20972;
  _Bool D.20973;
  const unsigned char * D.20976;
  unsigned char D.20977;
  int D.20978;
  const unsigned char * D.20979;
  unsigned char D.20980;
  int D.20981;
  struct MonoDomain * D.20985;
  gchar * D.20986;
  char * D.20987;
  char D.20990;
  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.20853>; else goto <D.20854>;
    <D.20853>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.20855 = "runtime";
      D.20856 = MEM[(const unsigned char *)D.20855];
      D.20857 = (int) D.20856;
      D.20858 = *__s2;
      D.20859 = (int) D.20858;
      __result = D.20857 - D.20859;
      {
        D.20860 = __s2_len != 0;
        D.20861 = __result == 0;
        D.20862 = D.20860 & D.20861;
        if (D.20862 != 0) goto <D.20863>; else goto <D.20864>;
        <D.20863>:
        D.20865 = &MEM[(void *)"runtime" + 1B];
        D.20866 = *D.20865;
        D.20867 = (int) D.20866;
        D.20868 = __s2 + 1;
        D.20869 = *D.20868;
        D.20870 = (int) D.20869;
        __result = D.20867 - D.20870;
        D.20871 = __s2_len > 1;
        D.20861 = __result == 0;
        D.20872 = D.20871 & D.20861;
        if (D.20872 != 0) goto <D.20873>; else goto <D.20874>;
        <D.20873>:
        D.20875 = &MEM[(void *)"runtime" + 2B];
        D.20876 = *D.20875;
        D.20877 = (int) D.20876;
        D.20878 = __s2 + 2;
        D.20879 = *D.20878;
        D.20880 = (int) D.20879;
        __result = D.20877 - D.20880;
        D.20881 = __s2_len > 2;
        D.20861 = __result == 0;
        D.20882 = D.20881 & D.20861;
        if (D.20882 != 0) goto <D.20883>; else goto <D.20884>;
        <D.20883>:
        D.20885 = &MEM[(void *)"runtime" + 3B];
        D.20886 = *D.20885;
        D.20887 = (int) D.20886;
        D.20888 = __s2 + 3;
        D.20889 = *D.20888;
        D.20890 = (int) D.20889;
        __result = D.20887 - D.20890;
        <D.20884>:
        <D.20874>:
        <D.20864>:
      }
      D.19112 = __result;
    }
    iftmp.40 = -D.19112;
    goto <D.20891>;
    <D.20854>:
    iftmp.40 = __builtin_strcmp (element_name, "runtime");
    <D.20891>:
    D.19113 = iftmp.40;
  }
  if (D.19113 == 0) goto <D.20892>; else goto <D.20893>;
  <D.20892>:
  D.20894 = runtime_config->runtime_count;
  D.20895 = D.20894 + 1;
  runtime_config->runtime_count = D.20895;
  return;
  <D.20893>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20899 = "assemblyBinding";
      D.20900 = MEM[(const unsigned char *)D.20899];
      D.20901 = (int) D.20900;
      D.20902 = *__s2;
      D.20903 = (int) D.20902;
      __result = D.20901 - D.20903;
      {
        D.20904 = __s2_len != 0;
        D.20905 = __result == 0;
        D.20906 = D.20904 & D.20905;
        if (D.20906 != 0) goto <D.20907>; else goto <D.20908>;
        <D.20907>:
        D.20909 = &MEM[(void *)"assemblyBinding" + 1B];
        D.20910 = *D.20909;
        D.20911 = (int) D.20910;
        D.20912 = __s2 + 1;
        D.20913 = *D.20912;
        D.20914 = (int) D.20913;
        __result = D.20911 - D.20914;
        D.20915 = __s2_len > 1;
        D.20905 = __result == 0;
        D.20916 = D.20915 & D.20905;
        if (D.20916 != 0) goto <D.20917>; else goto <D.20918>;
        <D.20917>:
        D.20919 = &MEM[(void *)"assemblyBinding" + 2B];
        D.20920 = *D.20919;
        D.20921 = (int) D.20920;
        D.20922 = __s2 + 2;
        D.20923 = *D.20922;
        D.20924 = (int) D.20923;
        __result = D.20921 - D.20924;
        D.20925 = __s2_len > 2;
        D.20905 = __result == 0;
        D.20926 = D.20925 & D.20905;
        if (D.20926 != 0) goto <D.20927>; else goto <D.20928>;
        <D.20927>:
        D.20929 = &MEM[(void *)"assemblyBinding" + 3B];
        D.20930 = *D.20929;
        D.20931 = (int) D.20930;
        D.20932 = __s2 + 3;
        D.20933 = *D.20932;
        D.20934 = (int) D.20933;
        __result = D.20931 - D.20934;
        <D.20928>:
        <D.20918>:
        <D.20908>:
      }
      D.19121 = __result;
    }
    iftmp.41 = -D.19121;
    goto <D.20935>;
    <D.20898>:
    iftmp.41 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.20935>:
    D.19122 = iftmp.41;
  }
  if (D.19122 == 0) goto <D.20936>; else goto <D.20937>;
  <D.20936>:
  D.20938 = runtime_config->assemblybinding_count;
  D.20939 = D.20938 + 1;
  runtime_config->assemblybinding_count = D.20939;
  return;
  <D.20937>:
  D.20894 = runtime_config->runtime_count;
  if (D.20894 != 1) goto <D.20940>; else goto <D.20942>;
  <D.20942>:
  D.20938 = runtime_config->assemblybinding_count;
  if (D.20938 != 1) goto <D.20940>; else goto <D.20941>;
  <D.20940>:
  return;
  <D.20941>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20946 = "probing";
      D.20947 = MEM[(const unsigned char *)D.20946];
      D.20948 = (int) D.20947;
      D.20949 = *__s2;
      D.20950 = (int) D.20949;
      __result = D.20948 - D.20950;
      {
        D.20951 = __s2_len != 0;
        D.20952 = __result == 0;
        D.20953 = D.20951 & D.20952;
        if (D.20953 != 0) goto <D.20954>; else goto <D.20955>;
        <D.20954>:
        D.20956 = &MEM[(void *)"probing" + 1B];
        D.20957 = *D.20956;
        D.20958 = (int) D.20957;
        D.20959 = __s2 + 1;
        D.20960 = *D.20959;
        D.20961 = (int) D.20960;
        __result = D.20958 - D.20961;
        D.20962 = __s2_len > 1;
        D.20952 = __result == 0;
        D.20963 = D.20962 & D.20952;
        if (D.20963 != 0) goto <D.20964>; else goto <D.20965>;
        <D.20964>:
        D.20966 = &MEM[(void *)"probing" + 2B];
        D.20967 = *D.20966;
        D.20968 = (int) D.20967;
        D.20969 = __s2 + 2;
        D.20970 = *D.20969;
        D.20971 = (int) D.20970;
        __result = D.20968 - D.20971;
        D.20972 = __s2_len > 2;
        D.20952 = __result == 0;
        D.20973 = D.20972 & D.20952;
        if (D.20973 != 0) goto <D.20974>; else goto <D.20975>;
        <D.20974>:
        D.20976 = &MEM[(void *)"probing" + 3B];
        D.20977 = *D.20976;
        D.20978 = (int) D.20977;
        D.20979 = __s2 + 3;
        D.20980 = *D.20979;
        D.20981 = (int) D.20980;
        __result = D.20978 - D.20981;
        <D.20975>:
        <D.20965>:
        <D.20955>:
      }
      D.19130 = __result;
    }
    iftmp.42 = -D.19130;
    goto <D.20982>;
    <D.20945>:
    iftmp.42 = __builtin_strcmp (element_name, "probing");
    <D.20982>:
    D.19131 = iftmp.42;
  }
  if (D.19131 != 0) goto <D.20983>; else goto <D.20984>;
  <D.20983>:
  return;
  <D.20984>:
  D.20985 = runtime_config->domain;
  D.20986 = D.20985->private_bin_path;
  monoeg_g_free (D.20986);
  D.20985 = runtime_config->domain;
  D.20987 = get_attribute_value (attribute_names, attribute_values, "privatePath");
  D.20985->private_bin_path = D.20987;
  D.20985 = runtime_config->domain;
  D.20986 = D.20985->private_bin_path;
  if (D.20986 != 0B) goto <D.20988>; else goto <D.20989>;
  <D.20988>:
  D.20985 = runtime_config->domain;
  D.20986 = D.20985->private_bin_path;
  D.20990 = *D.20986;
  if (D.20990 == 0) goto <D.20991>; else goto <D.20992>;
  <D.20991>:
  D.20985 = runtime_config->domain;
  D.20986 = D.20985->private_bin_path;
  monoeg_g_free (D.20986);
  D.20985 = runtime_config->domain;
  D.20985->private_bin_path = 0B;
  return;
  <D.20992>:
  <D.20989>:
}


get_attribute_value (const gchar * * attribute_names, const gchar * * attribute_values, const char * att_name)
{
  int D.19092;
  unsigned int n.43;
  unsigned int D.20995;
  const gchar * * D.20996;
  const gchar * D.20997;
  char * D.21000;
  const gchar * * D.21001;
  const gchar * D.21002;
  int n;

  n = 0;
  goto <D.19094>;
  <D.19093>:
  {
    size_t __s1_len;
    size_t __s2_len;

    n.43 = (unsigned int) n;
    D.20995 = n.43 * 4;
    D.20996 = attribute_names + D.20995;
    D.20997 = *D.20996;
    D.19092 = __builtin_strcmp (D.20997, att_name);
  }
  if (D.19092 == 0) goto <D.20998>; else goto <D.20999>;
  <D.20998>:
  n.43 = (unsigned int) n;
  D.20995 = n.43 * 4;
  D.21001 = attribute_values + D.20995;
  D.21002 = *D.21001;
  D.21000 = monoeg_strdup (D.21002);
  return D.21000;
  <D.20999>:
  n = n + 1;
  <D.19094>:
  n.43 = (unsigned int) n;
  D.20995 = n.43 * 4;
  D.20996 = attribute_names + D.20995;
  D.20997 = *D.20996;
  if (D.20997 != 0B) goto <D.19093>; else goto <D.19095>;
  <D.19095>:
  D.21000 = 0B;
  return D.21000;
}


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


ves_icall_System_AppDomain_GetAssemblies (struct MonoAppDomain * ad, MonoBoolean refonly)
{
  struct MonoClass * System_Reflection_Assembly.44;
  struct MonoImage * D.21009;
  struct MonoClass * System_Reflection_Assembly.45;
  union mono_mutex_t * D.21011;
  _Bool D.21014;
  long int D.21015;
  long int D.21016;
  int D.21019;
  int D.21020;
  unsigned char D.21023;
  _Bool D.21028;
  long int D.21029;
  long int D.21030;
  unsigned int D.21033;
  void * * D.21034;
  unsigned int i.46;
  unsigned int D.21036;
  void * * D.21037;
  unsigned int i.47;
  struct MonoReflectionAssembly * D.21039;
  unsigned int i.48;
  struct MonoArray * D.21041;
  struct MonoDomain * domain;
  struct MonoAssembly * ass;
  static struct MonoClass * System_Reflection_Assembly;
  struct MonoArray * res;
  struct GSList * tmp;
  int i;
  struct GPtrArray * assemblies;

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

    D.21011 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21011);
    if (ret != 0) goto <D.21012>; else goto <D.21013>;
    <D.21012>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21013>:
    D.21014 = ret != 0;
    D.21015 = (long int) D.21014;
    D.21016 = __builtin_expect (D.21015, 0);
    if (D.21016 != 0) goto <D.21017>; else goto <D.21018>;
    <D.21017>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 874, "ret == 0");
    <D.21018>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19198>;
  <D.19197>:
  ass = tmp->data;
  D.21019 = (int) refonly;
  D.21020 = ass->ref_only;
  if (D.21019 != D.21020) goto <D.21021>; else goto <D.21022>;
  <D.21021>:
  // predicted unlikely by continue predictor.
  goto <D.19196>;
  <D.21022>:
  D.21023 = ass->corlib_internal;
  if (D.21023 != 0) goto <D.21024>; else goto <D.21025>;
  <D.21024>:
  // predicted unlikely by continue predictor.
  goto <D.19196>;
  <D.21025>:
  monoeg_g_ptr_array_add (assemblies, ass);
  <D.19196>:
  tmp = tmp->next;
  <D.19198>:
  if (tmp != 0B) goto <D.19197>; else goto <D.19199>;
  <D.19199>:
  {
    int ret;

    D.21011 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21011);
    if (ret != 0) goto <D.21026>; else goto <D.21027>;
    <D.21026>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21027>:
    D.21028 = ret != 0;
    D.21029 = (long int) D.21028;
    D.21030 = __builtin_expect (D.21029, 0);
    if (D.21030 != 0) goto <D.21031>; else goto <D.21032>;
    <D.21031>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 883, "ret == 0");
    <D.21032>:
  }
  D.21033 = assemblies->len;
  System_Reflection_Assembly.44 = System_Reflection_Assembly;
  res = mono_array_new (domain, System_Reflection_Assembly.44, D.21033);
  i = 0;
  goto <D.19203>;
  <D.19202>:
  D.21034 = assemblies->pdata;
  i.46 = (unsigned int) i;
  D.21036 = i.46 * 4;
  D.21037 = D.21034 + D.21036;
  ass = *D.21037;
  {
    void * * __p;

    i.47 = (unsigned int) i;
    __p = mono_array_addr_with_size (res, 4, i.47);
    D.21039 = mono_assembly_get_object (domain, ass);
    mono_gc_wbarrier_set_arrayref (res, __p, D.21039);
  }
  i = i + 1;
  <D.19203>:
  i.48 = (unsigned int) i;
  D.21033 = assemblies->len;
  if (i.48 < D.21033) goto <D.19202>; else goto <D.19204>;
  <D.19204>:
  monoeg_g_ptr_array_free (assemblies, 1);
  D.21041 = res;
  return D.21041;
}


mono_try_assembly_resolve (struct MonoDomain * domain, struct MonoString * fname, gboolean refonly)
{
  int D.21043;
  struct MonoReflectionAssembly * D.21046;
  _Bool D.21047;
  _Bool D.21048;
  _Bool D.21049;
  int D.21050;
  _Bool D.21051;
  long int D.21052;
  long int D.21053;
  struct MonoAppDomain * D.21056;
  struct MonoVTable * D.21057;
  _Bool D.21058;
  long int D.21059;
  long int D.21060;
  _Bool D.21065;
  unsigned char isrefonly.49;
  struct MonoClass * klass;
  struct MonoMethod * method;
  MonoBoolean isrefonly;
  void * params[2];

  try
    {
      D.21043 = mono_runtime_get_no_exec ();
      if (D.21043 != 0) goto <D.21044>; else goto <D.21045>;
      <D.21044>:
      D.21046 = 0B;
      return D.21046;
      <D.21045>:
      D.21047 = domain == 0B;
      D.21048 = fname == 0B;
      D.21049 = D.21047 | D.21048;
      D.21050 = (int) D.21049;
      D.21051 = D.21050 != 0;
      D.21052 = (long int) D.21051;
      D.21053 = __builtin_expect (D.21052, 0);
      if (D.21053 != 0) goto <D.21054>; else goto <D.21055>;
      <D.21054>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 907, "domain != NULL && fname != NULL");
      <D.21055>:
      D.21056 = domain->domain;
      D.21057 = D.21056->mbr.obj.vtable;
      klass = D.21057->klass;
      D.21058 = klass == 0B;
      D.21059 = (long int) D.21058;
      D.21060 = __builtin_expect (D.21059, 0);
      if (D.21060 != 0) goto <D.21061>; else goto <D.21062>;
      <D.21061>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 910, "klass");
      <D.21062>:
      method = mono_class_get_method_from_name (klass, "DoAssemblyResolve", -1);
      if (method == 0B) goto <D.21063>; else goto <D.21064>;
      <D.21063>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoAssemblyResolve not found.\n");
      D.21046 = 0B;
      return D.21046;
      <D.21064>:
      D.21065 = refonly != 0;
      isrefonly.49 = (unsigned char) D.21065;
      isrefonly = isrefonly.49;
      params[0] = fname;
      params[1] = &isrefonly;
      D.21056 = domain->domain;
      D.21046 = mono_runtime_invoke (method, D.21056, &params, 0B);
      return D.21046;
    }
  finally
    {
      isrefonly = {CLOBBER};
      params = {CLOBBER};
    }
}


mono_is_shadow_copy_enabled (struct MonoDomain * domain, const gchar * dir_name)
{
  gboolean D.21071;
  struct MonoString * D.21075;
  int D.21076;
  int D.21079;
  _Bool D.21080;
  struct MonoString * D.21083;
  int D.21086;
  char * D.21089;
  int D.21092;
  gchar * D.21095;
  char D.21096;
  int D.19406;
  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.21069>; else goto <D.21070>;
      <D.21069>:
      D.21071 = 0;
      return D.21071;
      <D.21070>:
      setup = domain->setup;
      if (setup == 0B) goto <D.21072>; else goto <D.21074>;
      <D.21074>:
      D.21075 = setup->shadow_copy_files;
      if (D.21075 == 0B) goto <D.21072>; else goto <D.21073>;
      <D.21072>:
      D.21071 = 0;
      return D.21071;
      <D.21073>:
      D.21075 = setup->shadow_copy_files;
      shadow_status_string = mono_string_to_utf8_checked (D.21075, &error);
      D.21076 = mono_error_ok (&error);
      if (D.21076 == 0) goto <D.21077>; else goto <D.21078>;
      <D.21077>:
      mono_error_cleanup (&error);
      D.21071 = 0;
      return D.21071;
      <D.21078>:
      D.21079 = monoeg_g_ascii_strncasecmp (shadow_status_string, "true", 4);
      D.21080 = D.21079 == 0;
      shadow_enabled = (gboolean) D.21080;
      monoeg_g_free (shadow_status_string);
      if (shadow_enabled == 0) goto <D.21081>; else goto <D.21082>;
      <D.21081>:
      D.21071 = 0;
      return D.21071;
      <D.21082>:
      D.21083 = setup->shadow_copy_directories;
      if (D.21083 == 0B) goto <D.21084>; else goto <D.21085>;
      <D.21084>:
      D.21071 = 1;
      return D.21071;
      <D.21085>:
      base_dir = get_shadow_assembly_location_base (domain, &error);
      D.21086 = mono_error_ok (&error);
      if (D.21086 == 0) goto <D.21087>; else goto <D.21088>;
      <D.21087>:
      mono_error_cleanup (&error);
      D.21071 = 0;
      return D.21071;
      <D.21088>:
      D.21089 = strstr (dir_name, base_dir);
      if (D.21089 != 0B) goto <D.21090>; else goto <D.21091>;
      <D.21090>:
      monoeg_g_free (base_dir);
      D.21071 = 1;
      return D.21071;
      <D.21091>:
      monoeg_g_free (base_dir);
      D.21083 = setup->shadow_copy_directories;
      all_dirs = mono_string_to_utf8_checked (D.21083, &error);
      D.21092 = mono_error_ok (&error);
      if (D.21092 == 0) goto <D.21093>; else goto <D.21094>;
      <D.21093>:
      mono_error_cleanup (&error);
      D.21071 = 0;
      return D.21071;
      <D.21094>:
      directories = monoeg_g_strsplit (all_dirs, ":", 1000);
      dir_ptr = directories;
      goto <D.19409>;
      <D.19408>:
      D.21095 = *dir_ptr;
      D.21096 = *D.21095;
      if (D.21096 != 0) goto <D.21097>; else goto <D.21098>;
      <D.21097>:
      {
        size_t __s1_len;
        size_t __s2_len;

        D.21095 = *dir_ptr;
        D.19406 = __builtin_strcmp (D.21095, dir_name);
      }
      if (D.19406 == 0) goto <D.21099>; else goto <D.21100>;
      <D.21099>:
      found = 1;
      goto <D.19407>;
      <D.21100>:
      <D.21098>:
      dir_ptr = dir_ptr + 4;
      <D.19409>:
      D.21095 = *dir_ptr;
      if (D.21095 != 0B) goto <D.19408>; else goto <D.19407>;
      <D.19407>:
      monoeg_g_strfreev (directories);
      monoeg_g_free (all_dirs);
      D.21071 = found;
      return D.21071;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_make_shadow_copy (const char * filename)
{
  int D.21103;
  char * D.21106;
  int D.21107;
  char * D.21110;
  int D.21113;
  int D.21116;
  int D.21119;
  unsigned int D.21122;
  long int D.21123;
  unsigned int D.21124;
  long int D.21125;
  unsigned int D.21132;
  unsigned int D.21133;
  int D.21138;
  long int D.21141;
  long int D.21142;
  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.21103 = mono_is_shadow_copy_enabled (domain, dir_name);
      if (D.21103 == 0) goto <D.21104>; else goto <D.21105>;
      <D.21104>:
      monoeg_g_free (dir_name);
      D.21106 = filename;
      return D.21106;
      <D.21105>:
      shadow_dir = get_shadow_assembly_location_base (domain, &error);
      D.21107 = mono_error_ok (&error);
      if (D.21107 == 0) goto <D.21108>; else goto <D.21109>;
      <D.21108>:
      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.21109>:
      D.21110 = strstr (dir_name, shadow_dir);
      if (D.21110 != 0B) goto <D.21111>; else goto <D.21112>;
      <D.21111>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      D.21106 = filename;
      return D.21106;
      <D.21112>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      shadow = get_shadow_assembly_location (filename, &error);
      D.21113 = mono_error_ok (&error);
      if (D.21113 == 0) goto <D.21114>; else goto <D.21115>;
      <D.21114>:
      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.21115>:
      D.21116 = ensure_directory_exists (shadow);
      if (D.21116 == 0) goto <D.21117>; else goto <D.21118>;
      <D.21117>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (ensure directory exists).");
      mono_raise_exception (exc);
      <D.21118>:
      D.21119 = private_file_needs_copying (filename, &src_sbuf, shadow);
      if (D.21119 == 0) goto <D.21120>; else goto <D.21121>;
      <D.21120>:
      D.21106 = shadow;
      return D.21106;
      <D.21121>:
      D.21122 = strlen (filename);
      D.21123 = (long int) D.21122;
      orig = monoeg_g_utf8_to_utf16 (filename, D.21123, 0B, 0B, 0B);
      D.21124 = strlen (shadow);
      D.21125 = (long int) D.21124;
      dest = monoeg_g_utf8_to_utf16 (shadow, D.21125, 0B, 0B, 0B);
      DeleteFile (dest);
      attrs = GetFileAttributes (orig);
      if (attrs == 4294967295) goto <D.21126>; else goto <D.21127>;
      <D.21126>:
      monoeg_g_free (shadow);
      D.21106 = filename;
      return D.21106;
      <D.21127>:
      copy_result = CopyFile (orig, dest, 0);
      if (copy_result != 0) goto <D.21128>; else goto <D.21129>;
      <D.21128>:
      copy_result = SetFileAttributes (dest, 128);
      <D.21129>:
      monoeg_g_free (dest);
      monoeg_g_free (orig);
      if (copy_result == 0) goto <D.21130>; else goto <D.21131>;
      <D.21130>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (CopyFile).");
      mono_raise_exception (exc);
      <D.21131>:
      sibling_source = monoeg_g_strconcat (filename, ".config", 0B);
      D.21132 = strlen (sibling_source);
      sibling_source_len = (gint) D.21132;
      sibling_target = monoeg_g_strconcat (shadow, ".config", 0B);
      D.21133 = strlen (sibling_target);
      sibling_target_len = (gint) D.21133;
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
      if (copy_result == 1) goto <D.21134>; else goto <D.21135>;
      <D.21134>:
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);
      <D.21135>:
      monoeg_g_free (sibling_source);
      monoeg_g_free (sibling_target);
      if (copy_result == 0) goto <D.21136>; else goto <D.21137>;
      <D.21136>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy of sibling data (CopyFile).");
      mono_raise_exception (exc);
      <D.21137>:
      D.21138 = shadow_copy_create_ini (shadow, filename);
      if (D.21138 == 0) goto <D.21139>; else goto <D.21140>;
      <D.21139>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy .ini file.");
      mono_raise_exception (exc);
      <D.21140>:
      D.21141 = src_sbuf.st_atim.tv_sec;
      utbuf.actime = D.21141;
      D.21142 = src_sbuf.st_mtim.tv_sec;
      utbuf.modtime = D.21142;
      utime (shadow, &utbuf);
      D.21106 = shadow;
      return D.21106;
    }
  finally
    {
      error = {CLOBBER};
      src_sbuf = {CLOBBER};
      utbuf = {CLOBBER};
    }
}


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


get_cstring_hash (const char * str)
{
  char D.21156;
  gint32 D.21157;
  unsigned int D.21158;
  int D.21159;
  int D.21160;
  char D.21161;
  int D.21162;
  int len;
  int i;
  const char * p;
  gint32 h;

  h = 0;
  if (str == 0B) goto <D.21153>; else goto <D.21155>;
  <D.21155>:
  D.21156 = *str;
  if (D.21156 == 0) goto <D.21153>; else goto <D.21154>;
  <D.21153>:
  D.21157 = 0;
  return D.21157;
  <D.21154>:
  D.21158 = strlen (str);
  len = (int) D.21158;
  p = str;
  i = 0;
  goto <D.19325>;
  <D.19324>:
  D.21159 = h << 5;
  D.21160 = D.21159 - h;
  D.21161 = *p;
  D.21162 = (int) D.21161;
  h = D.21160 + D.21162;
  p = p + 1;
  i = i + 1;
  <D.19325>:
  if (i < len) goto <D.19324>; else goto <D.19326>;
  <D.19326>:
  D.21157 = h;
  return D.21157;
}


ensure_directory_exists (const char * filename)
{
  char D.21167;
  gboolean D.21168;
  int D.21169;
  unsigned int D.21172;
  unsigned int D.21173;
  char D.21176;
  int * D.21181;
  int D.21182;
  char * p.50;
  char * p;
  gchar * dir;
  int retval;
  struct stat sbuf;

  try
    {
      dir = monoeg_g_path_get_dirname (filename);
      if (dir == 0B) goto <D.21164>; else goto <D.21166>;
      <D.21166>:
      D.21167 = *dir;
      if (D.21167 == 0) goto <D.21164>; else goto <D.21165>;
      <D.21164>:
      monoeg_g_free (dir);
      D.21168 = 0;
      return D.21168;
      <D.21165>:
      D.21169 = stat (dir, &sbuf);
      if (D.21169 == 0) goto <D.21170>; else goto <D.21171>;
      <D.21170>:
      D.21172 = sbuf.st_mode;
      D.21173 = D.21172 & 61440;
      if (D.21173 == 16384) goto <D.21174>; else goto <D.21175>;
      <D.21174>:
      monoeg_g_free (dir);
      D.21168 = 1;
      return D.21168;
      <D.21175>:
      <D.21171>:
      p = dir;
      goto <D.19361>;
      <D.19360>:
      p = p + 1;
      <D.19361>:
      D.21176 = *p;
      if (D.21176 == 47) goto <D.19360>; else goto <D.19362>;
      <D.19362>:
      <D.19364>:
      p = __builtin_strchr (p, 47);
      if (p != 0B) goto <D.21177>; else goto <D.21178>;
      <D.21177>:
      *p = 0;
      <D.21178>:
      retval = mkdir (dir, 511);
      if (retval != 0) goto <D.21179>; else goto <D.21180>;
      <D.21179>:
      D.21181 = __errno_location ();
      D.21182 = *D.21181;
      if (D.21182 != 17) goto <D.21183>; else goto <D.21184>;
      <D.21183>:
      monoeg_g_free (dir);
      D.21168 = 0;
      return D.21168;
      <D.21184>:
      <D.21180>:
      if (p == 0B) goto <D.19363>; else goto <D.21185>;
      <D.21185>:
      p.50 = p;
      p = p.50 + 1;
      *p.50 = 47;
      goto <D.19364>;
      <D.19363>:
      monoeg_g_free (dir);
      D.21168 = 1;
      return D.21168;
    }
  finally
    {
      sbuf = {CLOBBER};
    }
}


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

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


private_file_needs_copying (const char * src, struct stat * sbuf_src, char * dest)
{
  int D.21194;
  gboolean D.21199;
  int D.21202;
  long long int D.21205;
  long long int D.21206;
  long int D.21209;
  long int D.21210;
  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.21191>; else goto <D.21192>;
      <D.21191>:
      stat_src = src;
      goto <D.21193>;
      <D.21192>:
      stat_src = real_src;
      <D.21193>:
      D.21194 = stat (stat_src, sbuf_src);
      if (D.21194 == -1) goto <D.21195>; else goto <D.21196>;
      <D.21195>:
      {
        time_t tnow;

        tnow = time (0B);
        if (real_src != 0B) goto <D.21197>; else goto <D.21198>;
        <D.21197>:
        monoeg_g_free (real_src);
        <D.21198>:
        memset (sbuf_src, 0, 96);
        sbuf_src->st_mtim.tv_sec = tnow;
        sbuf_src->st_atim.tv_sec = tnow;
        D.21199 = 1;
        return D.21199;
      }
      <D.21196>:
      if (real_src != 0B) goto <D.21200>; else goto <D.21201>;
      <D.21200>:
      monoeg_g_free (real_src);
      <D.21201>:
      D.21202 = stat (dest, &sbuf_dest);
      if (D.21202 == -1) goto <D.21203>; else goto <D.21204>;
      <D.21203>:
      D.21199 = 1;
      return D.21199;
      <D.21204>:
      D.21205 = sbuf_src->st_size;
      D.21206 = sbuf_dest.st_size;
      if (D.21205 == D.21206) goto <D.21207>; else goto <D.21208>;
      <D.21207>:
      D.21209 = sbuf_src->st_mtim.tv_sec;
      D.21210 = sbuf_dest.st_mtim.tv_sec;
      if (D.21209 == D.21210) goto <D.21211>; else goto <D.21212>;
      <D.21211>:
      D.21199 = 0;
      return D.21199;
      <D.21212>:
      <D.21208>:
      D.21199 = 1;
      return D.21199;
    }
  finally
    {
      sbuf_dest = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.21217;
  int D.21222;
  void * D.21224;
  unsigned int D.21225;

  D.21217 = __builtin_constant_p (__len);
  if (D.21217 != 0) goto <D.21218>; else goto <D.21219>;
  <D.21218>:
  if (__len == 0) goto <D.21220>; else goto <D.21221>;
  <D.21220>:
  D.21222 = __builtin_constant_p (__ch);
  if (D.21222 == 0) goto <D.21215>; else goto <D.21223>;
  <D.21223>:
  if (__ch != 0) goto <D.21215>; else goto <D.21216>;
  <D.21215>:
  __warn_memset_zero_len ();
  D.21224 = __dest;
  return D.21224;
  <D.21216>:
  <D.21221>:
  <D.21219>:
  D.21225 = __builtin_object_size (__dest, 0);
  D.21224 = __builtin___memset_chk (__dest, __ch, __len, D.21225);
  return D.21224;
}


shadow_copy_sibling (gchar * src, gint srclen, const char * extension, gchar * target, gint targetlen, gint tail_len)
{
  sizetype srclen.51;
  sizetype tail_len.52;
  sizetype D.21229;
  gchar * D.21230;
  int __mono_io_portability_helpers.53;
  int D.21232;
  gboolean D.21237;
  int D.21239;
  unsigned int D.21242;
  long int D.21243;
  sizetype targetlen.54;
  sizetype D.21245;
  gchar * D.21246;
  unsigned int D.21247;
  long int D.21248;
  guint16 * orig;
  guint16 * dest;
  gboolean copy_result;

  srclen.51 = (sizetype) srclen;
  tail_len.52 = (sizetype) tail_len;
  D.21229 = srclen.51 - tail_len.52;
  D.21230 = src + D.21229;
  strcpy (D.21230, extension);
  __mono_io_portability_helpers.53 = __mono_io_portability_helpers;
  D.21232 = __mono_io_portability_helpers.53 & 4;
  if (D.21232 != 0) goto <D.21233>; else goto <D.21234>;
  <D.21233>:
  {
    gchar * file;

    file = mono_portability_find_file (src, 1);
    if (file == 0B) goto <D.21235>; else goto <D.21236>;
    <D.21235>:
    D.21237 = 1;
    return D.21237;
    <D.21236>:
    monoeg_g_free (file);
  }
  goto <D.21238>;
  <D.21234>:
  D.21239 = monoeg_g_file_test (src, 1);
  if (D.21239 == 0) goto <D.21240>; else goto <D.21241>;
  <D.21240>:
  D.21237 = 1;
  return D.21237;
  <D.21241>:
  <D.21238>:
  D.21242 = strlen (src);
  D.21243 = (long int) D.21242;
  orig = monoeg_g_utf8_to_utf16 (src, D.21243, 0B, 0B, 0B);
  targetlen.54 = (sizetype) targetlen;
  tail_len.52 = (sizetype) tail_len;
  D.21245 = targetlen.54 - tail_len.52;
  D.21246 = target + D.21245;
  strcpy (D.21246, extension);
  D.21247 = strlen (target);
  D.21248 = (long int) D.21247;
  dest = monoeg_g_utf8_to_utf16 (target, D.21248, 0B, 0B, 0B);
  DeleteFile (dest);
  copy_result = CopyFile (orig, dest, 0);
  if (copy_result != 0) goto <D.21249>; else goto <D.21250>;
  <D.21249>:
  copy_result = SetFileAttributes (dest, 128);
  <D.21250>:
  monoeg_g_free (orig);
  monoeg_g_free (dest);
  D.21237 = copy_result;
  return D.21237;
}


shadow_copy_create_ini (const char * shadow, const char * filename)
{
  int D.21252;
  gboolean D.21255;
  unsigned int D.21256;
  long int D.21257;
  unsigned int D.21262;
  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.21252 = monoeg_g_file_test (ini_file, 1);
      if (D.21252 != 0) goto <D.21253>; else goto <D.21254>;
      <D.21253>:
      monoeg_g_free (ini_file);
      D.21255 = 1;
      return D.21255;
      <D.21254>:
      D.21256 = strlen (ini_file);
      D.21257 = (long int) D.21256;
      u16_ini = monoeg_g_utf8_to_utf16 (ini_file, D.21257, 0B, 0B, 0B);
      monoeg_g_free (ini_file);
      if (u16_ini == 0B) goto <D.21258>; else goto <D.21259>;
      <D.21258>:
      D.21255 = 0;
      return D.21255;
      <D.21259>:
      handle = CreateFile (u16_ini, 1073741824, 3, 0B, 1, 128, 0B);
      monoeg_g_free (u16_ini);
      if (handle == 4294967295B) goto <D.21260>; else goto <D.21261>;
      <D.21260>:
      D.21255 = 0;
      return D.21255;
      <D.21261>:
      full_path = mono_path_resolve_symlinks (filename);
      D.21262 = strlen (full_path);
      result = WriteFile (handle, full_path, D.21262, &n, 0B);
      monoeg_g_free (full_path);
      CloseHandle (handle);
      D.21255 = result;
      return D.21255;
    }
  finally
    {
      n = {CLOBBER};
    }
}


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

  if (appdomain == 0B) goto <D.21265>; else goto <D.21266>;
  <D.21265>:
  D.21267 = 0B;
  return D.21267;
  <D.21266>:
  D.21267 = appdomain->data;
  return D.21267;
}


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

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

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

        status.55 = status;
        if (status.55 == 3) goto <D.21275>; else goto <D.21276>;
        <D.21275>:
        exc = mono_get_exception_bad_image_format2 (0B, fname);
        goto <D.21277>;
        <D.21276>:
        exc = mono_get_exception_file_not_found2 (0B, fname);
        <D.21277>:
        monoeg_g_free (name);
        mono_raise_exception (exc);
      }
      <D.21273>:
      monoeg_g_free (name);
      D.21278 = mono_assembly_get_object (domain, ass);
      return D.21278;
    }
  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)
{
  int D.21281;
  char * D.21282;
  struct MonoException * D.21285;
  struct MonoReflectionAssembly * D.21286;
  unsigned int D.21289;
  int D.21290;
  char * D.21291;
  struct MonoException * D.21294;
  struct MonoObject * * D.21295;
  struct MonoAssembly * ass;
  struct MonoReflectionAssembly * refass;
  struct MonoDomain * domain;
  MonoImageOpenStatus status;
  guint32 raw_assembly_len;
  struct MonoImage * image;

  try
    {
      refass = 0B;
      domain = ad->data;
      raw_assembly_len = mono_array_length (raw_assembly);
      D.21281 = (int) refonly;
      D.21282 = mono_array_addr_with_size (raw_assembly, 1, 0);
      image = mono_image_open_from_data_full (D.21282, raw_assembly_len, 1, 0B, D.21281);
      if (image == 0B) goto <D.21283>; else goto <D.21284>;
      <D.21283>:
      D.21285 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21285);
      D.21286 = 0B;
      return D.21286;
      <D.21284>:
      if (raw_symbol_store != 0B) goto <D.21287>; else goto <D.21288>;
      <D.21287>:
      D.21289 = mono_array_length (raw_symbol_store);
      D.21290 = (int) D.21289;
      D.21291 = mono_array_addr_with_size (raw_symbol_store, 1, 0);
      mono_debug_open_image_from_memory (image, D.21291, D.21290);
      <D.21288>:
      D.21281 = (int) refonly;
      ass = mono_assembly_load_from_full (image, "", &status, D.21281);
      if (ass == 0B) goto <D.21292>; else goto <D.21293>;
      <D.21292>:
      mono_image_close (image);
      D.21294 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21294);
      D.21286 = 0B;
      return D.21286;
      <D.21293>:
      refass = mono_assembly_get_object (domain, ass);
      D.21295 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21295, evidence);
      D.21286 = refass;
      return D.21286;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssembly (struct MonoAppDomain * ad, struct MonoString * assRef, struct MonoObject * evidence, MonoBoolean refOnly)
{
  _Bool D.21298;
  long int D.21299;
  long int D.21300;
  int D.21307;
  struct MonoReflectionAssembly * D.21308;
  struct MonoObject * * D.21318;
  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.21298 = assRef == 0B;
      D.21299 = (long int) D.21298;
      D.21300 = __builtin_expect (D.21299, 0);
      if (D.21300 != 0) goto <D.21301>; else goto <D.21302>;
      <D.21301>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1951, "assRef != NULL");
      <D.21302>:
      name = mono_string_to_utf8 (assRef);
      parsed = mono_assembly_name_parse (name, &aname);
      monoeg_g_free (name);
      if (parsed == 0) goto <D.21303>; else goto <D.21304>;
      <D.21303>:
      if (refOnly == 0) goto <D.21305>; else goto <D.21306>;
      <D.21305>:
      D.21307 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21307);
      <D.21306>:
      D.21308 = refass;
      return D.21308;
      <D.21304>:
      D.21307 = (int) refOnly;
      ass = mono_assembly_load_full_nosearch (&aname, 0B, &status, D.21307);
      mono_assembly_name_free (&aname);
      if (ass == 0B) goto <D.21309>; else goto <D.21310>;
      <D.21309>:
      if (refOnly == 0) goto <D.21311>; else goto <D.21312>;
      <D.21311>:
      D.21307 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21307);
      goto <D.21313>;
      <D.21312>:
      refass = 0B;
      <D.21313>:
      if (refass == 0B) goto <D.21314>; else goto <D.21315>;
      <D.21314>:
      D.21308 = 0B;
      return D.21308;
      <D.21315>:
      <D.21310>:
      if (refass == 0B) goto <D.21316>; else goto <D.21317>;
      <D.21316>:
      refass = mono_assembly_get_object (domain, ass);
      <D.21317>:
      D.21318 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21318, evidence);
      D.21308 = refass;
      return D.21308;
    }
  finally
    {
      status = {CLOBBER};
      aname = {CLOBBER};
    }
}


ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
  struct MonoDomain * D.21323;
  struct MonoException * D.21326;
  const gchar * D.21327;
  struct MonoDomain * domain;

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

    exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
    mono_raise_exception (exc);
  }
  <D.21322>:
  D.21323 = mono_get_root_domain ();
  if (D.21323 == domain) goto <D.21324>; else goto <D.21325>;
  <D.21324>:
  D.21326 = mono_get_exception_cannot_unload_appdomain ("The default appdomain can not be unloaded.");
  mono_raise_exception (D.21326);
  return;
  <D.21325>:
  D.21327 = monoeg_g_getenv ("MONO_NO_UNLOAD");
  if (D.21327 != 0B) goto <D.21328>; else goto <D.21329>;
  <D.21328>:
  return;
  <D.21329>:
  mono_domain_unload (domain);
}


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21331>; else goto <D.21332>;
  <D.21331>:
  D.21333 = 1;
  return D.21333;
  <D.21332>:
  D.21333 = mono_domain_is_unloading (domain);
  return D.21333;
}


ves_icall_System_AppDomain_ExecuteAssembly (struct MonoAppDomain * ad, struct MonoReflectionAssembly * refass, struct MonoArray * args)
{
  _Bool D.21335;
  long int D.21336;
  long int D.21337;
  struct MonoAssembly * D.21340;
  _Bool D.21341;
  long int D.21342;
  long int D.21343;
  unsigned int D.21346;
  char * D.21349;
  struct MonoClass * D.21352;
  struct MonoDomain * D.21353;
  gint32 D.21354;
  struct MonoImage * image;
  struct MonoMethod * method;

  D.21335 = refass == 0B;
  D.21336 = (long int) D.21335;
  D.21337 = __builtin_expect (D.21336, 0);
  if (D.21337 != 0) goto <D.21338>; else goto <D.21339>;
  <D.21338>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2035, "refass");
  <D.21339>:
  D.21340 = refass->assembly;
  image = D.21340->image;
  D.21341 = image == 0B;
  D.21342 = (long int) D.21341;
  D.21343 = __builtin_expect (D.21342, 0);
  if (D.21343 != 0) goto <D.21344>; else goto <D.21345>;
  <D.21344>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2037, "image");
  <D.21345>:
  D.21346 = mono_image_get_entry_point (image);
  method = mono_get_method (image, D.21346, 0B);
  if (method == 0B) goto <D.21347>; else goto <D.21348>;
  <D.21347>:
  D.21349 = image->name;
  monoeg_g_log (0B, 4, "No entry point method found in %s", D.21349);
  <D.19536>:
  goto <D.19536>;
  <D.21348>:
  if (args == 0B) goto <D.21350>; else goto <D.21351>;
  <D.21350>:
  D.21352 = mono_defaults.string_class;
  D.21353 = ad->data;
  args = mono_array_new (D.21353, D.21352, 0);
  <D.21351>:
  D.21354 = mono_runtime_exec_main (method, args, 0B);
  return D.21354;
}


ves_icall_System_AppDomain_GetIDFromDomain (struct MonoAppDomain * ad)
{
  gint32 D.21356;
  struct MonoDomain * D.21357;

  D.21357 = ad->data;
  D.21356 = D.21357->domain_id;
  return D.21356;
}


ves_icall_System_AppDomain_InternalSetDomain (struct MonoAppDomain * ad)
{
  struct MonoDomain * D.21359;
  int D.21360;
  struct MonoException * D.21363;
  struct MonoAppDomain * D.21364;
  struct MonoDomain * old_domain;

  old_domain = mono_domain_get ();
  D.21359 = ad->data;
  D.21360 = mono_domain_set (D.21359, 0);
  if (D.21360 == 0) goto <D.21361>; else goto <D.21362>;
  <D.21361>:
  D.21363 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21363);
  <D.21362>:
  D.21364 = old_domain->domain;
  return D.21364;
}


ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid)
{
  int D.21369;
  struct MonoException * D.21370;
  struct MonoAppDomain * D.21371;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (domainid);
  if (domain == 0B) goto <D.21366>; else goto <D.21368>;
  <D.21368>:
  D.21369 = mono_domain_set (domain, 0);
  if (D.21369 == 0) goto <D.21366>; else goto <D.21367>;
  <D.21366>:
  D.21370 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21370);
  <D.21367>:
  D.21371 = current_domain->domain;
  return D.21371;
}


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

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


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21374>; else goto <D.21375>;
  <D.21374>:
  D.21376 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21376);
  <D.21375>:
  mono_thread_push_appdomain_ref (domain);
}


ves_icall_System_AppDomain_InternalPopDomainRef ()
{
  mono_thread_pop_appdomain_ref ();
}


ves_icall_System_AppDomain_InternalGetContext ()
{
  struct MonoAppContext * D.21377;

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


ves_icall_System_AppDomain_InternalGetDefaultContext ()
{
  struct MonoAppContext * D.21379;
  struct MonoDomain * D.21380;

  D.21380 = mono_domain_get ();
  D.21379 = D.21380->default_context;
  return D.21379;
}


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

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


ves_icall_System_AppDomain_InternalGetProcessGuid (struct MonoString * newguid)
{
  union mono_mutex_t * D.21384;
  _Bool D.21387;
  long int D.21388;
  long int D.21389;
  int process_guid_set.56;
  _Bool D.21397;
  long int D.21398;
  long int D.21399;
  struct MonoString * D.21402;
  struct MonoDomain * D.21403;
  mono_unichar2 * D.21404;
  _Bool D.21407;
  long int D.21408;
  long int D.21409;
  struct MonoDomain * mono_root_domain;

  mono_root_domain = mono_get_root_domain ();
  {
    int ret;

    D.21384 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_lock (D.21384);
    if (ret != 0) goto <D.21385>; else goto <D.21386>;
    <D.21385>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21386>:
    D.21387 = ret != 0;
    D.21388 = (long int) D.21387;
    D.21389 = __builtin_expect (D.21388, 0);
    if (D.21389 != 0) goto <D.21390>; else goto <D.21391>;
    <D.21390>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2150, "ret == 0");
    <D.21391>:
  }
  process_guid_set.56 = process_guid_set;
  if (process_guid_set.56 != 0) goto <D.21393>; else goto <D.21394>;
  <D.21393>:
  {
    int ret;

    D.21384 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21384);
    if (ret != 0) goto <D.21395>; else goto <D.21396>;
    <D.21395>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21396>:
    D.21397 = ret != 0;
    D.21398 = (long int) D.21397;
    D.21399 = __builtin_expect (D.21398, 0);
    if (D.21399 != 0) goto <D.21400>; else goto <D.21401>;
    <D.21400>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2152, "ret == 0");
    <D.21401>:
  }
  D.21403 = mono_domain_get ();
  D.21402 = mono_string_new_utf16 (D.21403, &process_guid, 36);
  return D.21402;
  <D.21394>:
  D.21404 = mono_string_chars (newguid);
  memcpy (&process_guid, D.21404, 72);
  process_guid_set = 1;
  {
    int ret;

    D.21384 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21384);
    if (ret != 0) goto <D.21405>; else goto <D.21406>;
    <D.21405>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21406>:
    D.21407 = ret != 0;
    D.21408 = (long int) D.21407;
    D.21409 = __builtin_expect (D.21408, 0);
    if (D.21409 != 0) goto <D.21410>; else goto <D.21411>;
    <D.21410>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2157, "ret == 0");
    <D.21411>:
  }
  D.21402 = newguid;
  return D.21402;
}


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

  D.21414 = __builtin_object_size (__dest, 0);
  D.21413 = __builtin___memcpy_chk (__dest, __src, __len, D.21414);
  return D.21413;
}


mono_domain_is_unloading (struct MonoDomain * domain)
{
  unsigned int D.21416;
  unsigned int D.21417;
  mono_bool D.21420;

  D.21416 = domain->state;
  D.21417 = D.21416 + 4294967294;
  if (D.21417 <= 1) goto <D.21418>; else goto <D.21419>;
  <D.21418>:
  D.21420 = 1;
  return D.21420;
  <D.21419>:
  D.21420 = 0;
  return D.21420;
}


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

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


mono_domain_try_unload (struct MonoDomain * domain, struct MonoObject * * exc)
{
  guint32 * D.21425;
  int D.21426;
  struct MonoException * D.21429;
  struct MonoException * D.21430;
  struct MonoAppDomain * D.21431;
  struct MonoVTable * D.21432;
  struct MonoClass * D.21433;
  _Bool D.21434;
  long int D.21435;
  long int D.21436;
  struct MonoObject * D.21439;
  struct MonoInternalThread * D.21444;
  int D.21445;
  int D.21448;
  int D.21451;
  unsigned int D.21453;
  char * D.21454;
  struct MonoException * D.21457;
  void * thread_handle;
  MonoAppDomainState prev_state;
  struct MonoMethod * method;
  struct unload_data * thread_data;
  struct MonoDomain * caller_domain;

  caller_domain = mono_domain_get ();
  D.21425 = &domain->state;
  D.21426 = InterlockedCompareExchange (D.21425, 1, 0);
  prev_state = (MonoAppDomainState) D.21426;
  if (prev_state != 0) goto <D.21427>; else goto <D.21428>;
  <D.21427>:
  switch (prev_state) <default: <D.19658>, case 1: <D.19655>, case 2: <D.19656>, case 3: <D.19657>>
  <D.19655>:
  <D.19656>:
  D.21429 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded.");
  *exc = D.21429;
  return;
  <D.19657>:
  D.21430 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded.");
  *exc = D.21430;
  return;
  <D.19658>:
  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.21428>:
  mono_domain_set (domain, 0);
  D.21431 = domain->domain;
  D.21432 = D.21431->mbr.obj.vtable;
  D.21433 = D.21432->klass;
  method = mono_class_get_method_from_name (D.21433, "DoDomainUnload", -1);
  D.21434 = method == 0B;
  D.21435 = (long int) D.21434;
  D.21436 = __builtin_expect (D.21435, 0);
  if (D.21436 != 0) goto <D.21437>; else goto <D.21438>;
  <D.21437>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2416, "method");
  <D.21438>:
  D.21431 = domain->domain;
  mono_runtime_invoke (method, D.21431, 0B, exc);
  D.21439 = *exc;
  if (D.21439 != 0B) goto <D.21440>; else goto <D.21441>;
  <D.21440>:
  domain->state = 0;
  mono_domain_set (caller_domain, 0);
  return;
  <D.21441>:
  mono_domain_set (caller_domain, 0);
  thread_data = monoeg_malloc0 (16);
  thread_data->domain = domain;
  thread_data->failure_reason = 0B;
  thread_data->done = 0;
  thread_data->refcount = 2;
  domain->state = 2;
  thread_handle = mono_threads_create_thread (unload_thread_main, thread_data, 0, 4, 0B);
  if (thread_handle == 0B) goto <D.21442>; else goto <D.21443>;
  <D.21442>:
  return;
  <D.21443>:
  ResumeThread (thread_handle);
  goto <D.19660>;
  <D.19659>:
  D.21444 = mono_thread_internal_current ();
  D.21445 = mono_thread_internal_has_appdomain_ref (D.21444, domain);
  if (D.21445 != 0) goto <D.21446>; else goto <D.21447>;
  <D.21446>:
  D.21448 = mono_thread_interruption_requested ();
  if (D.21448 != 0) goto <D.21449>; else goto <D.21450>;
  <D.21449>:
  CloseHandle (thread_handle);
  unload_data_unref (thread_data);
  return;
  <D.21450>:
  <D.21447>:
  <D.19660>:
  D.21451 = thread_data->done;
  if (D.21451 == 0) goto <D.21452>; else goto <D.19661>;
  <D.21452>:
  D.21453 = WaitForSingleObjectEx (thread_handle, 4294967295, 1);
  if (D.21453 == 192) goto <D.19659>; else goto <D.19661>;
  <D.19661>:
  CloseHandle (thread_handle);
  D.21454 = thread_data->failure_reason;
  if (D.21454 != 0B) goto <D.21455>; else goto <D.21456>;
  <D.21455>:
  domain->state = 0;
  D.21454 = thread_data->failure_reason;
  monoeg_g_log (0B, 16, "%s", D.21454);
  D.21454 = thread_data->failure_reason;
  D.21457 = mono_get_exception_cannot_unload_appdomain (D.21454);
  *exc = D.21457;
  D.21454 = thread_data->failure_reason;
  monoeg_g_free (D.21454);
  thread_data->failure_reason = 0B;
  <D.21456>:
  unload_data_unref (thread_data);
}


unload_thread_main (void * arg)
{
  struct MonoDomain * D.21459;
  int D.21460;
  char * D.21463;
  gchar * D.21464;
  int D.21465;
  gchar * D.21468;
  int D.21469;
  gchar * D.21472;
  union mono_mutex_t * D.21473;
  _Bool D.21476;
  long int D.21477;
  long int D.21478;
  struct GPtrArray * D.21481;
  void * * D.21482;
  unsigned int i.58;
  unsigned int D.21484;
  void * * D.21485;
  void * D.21486;
  unsigned int i.59;
  unsigned int D.21488;
  int D.21489;
  unsigned int D.21490;
  _Bool D.21493;
  long int D.21494;
  long int D.21495;
  int D.21498;
  guint32 D.21499;
  struct unload_data * data;
  struct MonoDomain * domain;
  struct MonoThread * thread;
  int i;
  void failure = <<< error >>>;

  data = arg;
  domain = data->domain;
  D.21459 = mono_get_root_domain ();
  thread = mono_thread_attach_full (D.21459, 1);
  D.21460 = mono_threads_abort_appdomain_threads (domain, -1);
  if (D.21460 == 0) goto <D.21461>; else goto <D.21462>;
  <D.21461>:
  D.21463 = domain->friendly_name;
  D.21464 = monoeg_g_strdup_printf ("Aborting of threads in domain %s timed out.", D.21463);
  data->failure_reason = D.21464;
  goto failure;
  <D.21462>:
  D.21465 = mono_thread_pool_remove_domain_jobs (domain, -1);
  if (D.21465 == 0) goto <D.21466>; else goto <D.21467>;
  <D.21466>:
  D.21463 = domain->friendly_name;
  D.21468 = monoeg_g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", D.21463);
  data->failure_reason = D.21468;
  goto failure;
  <D.21467>:
  D.21469 = mono_domain_finalize (domain, 4294967295);
  if (D.21469 == 0) goto <D.21470>; else goto <D.21471>;
  <D.21470>:
  D.21463 = domain->friendly_name;
  D.21472 = monoeg_g_strdup_printf ("Finalization of domain %s timed out.", D.21463);
  data->failure_reason = D.21472;
  goto failure;
  <D.21471>:
  mono_loader_lock ();
  {
    int ret;

    D.21473 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.21473);
    if (ret != 0) goto <D.21474>; else goto <D.21475>;
    <D.21474>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21475>:
    D.21476 = ret != 0;
    D.21477 = (long int) D.21476;
    D.21478 = __builtin_expect (D.21477, 0);
    if (D.21478 != 0) goto <D.21479>; else goto <D.21480>;
    <D.21479>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2299, "ret == 0");
    <D.21480>:
  }
  i = 0;
  goto <D.19636>;
  <D.19635>:
  D.21481 = domain->class_vtable_array;
  D.21482 = D.21481->pdata;
  i.58 = (unsigned int) i;
  D.21484 = i.58 * 4;
  D.21485 = D.21482 + D.21484;
  D.21486 = *D.21485;
  zero_static_data (D.21486);
  i = i + 1;
  <D.19636>:
  i.59 = (unsigned int) i;
  D.21481 = domain->class_vtable_array;
  D.21488 = D.21481->len;
  if (i.59 < D.21488) goto <D.19635>; else goto <D.19637>;
  <D.19637>:
  mono_gc_collect (0);
  i = 0;
  goto <D.19639>;
  <D.19638>:
  D.21481 = domain->class_vtable_array;
  D.21482 = D.21481->pdata;
  i.58 = (unsigned int) i;
  D.21484 = i.58 * 4;
  D.21485 = D.21482 + D.21484;
  D.21486 = *D.21485;
  clear_cached_vtable (D.21486);
  i = i + 1;
  <D.19639>:
  i.59 = (unsigned int) i;
  D.21481 = domain->class_vtable_array;
  D.21488 = D.21481->len;
  if (i.59 < D.21488) goto <D.19638>; else goto <D.19640>;
  <D.19640>:
  deregister_reflection_info_roots (domain);
  D.21489 = domain->domain_id;
  D.21490 = (unsigned int) D.21489;
  mono_assembly_cleanup_domain_bindings (D.21490);
  {
    int ret;

    D.21473 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21473);
    if (ret != 0) goto <D.21491>; else goto <D.21492>;
    <D.21491>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21492>:
    D.21493 = ret != 0;
    D.21494 = (long int) D.21493;
    D.21495 = __builtin_expect (D.21494, 0);
    if (D.21495 != 0) goto <D.21496>; else goto <D.21497>;
    <D.21496>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2320, "ret == 0");
    <D.21497>:
  }
  mono_loader_unlock ();
  mono_threads_clear_cached_culture (domain);
  domain->state = 3;
  mono_gchandle_free_domain (domain);
  mono_domain_free (domain, 0);
  D.21498 = mono_gc_max_generation ();
  mono_gc_collect (D.21498);
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21499 = 0;
  return D.21499;
  failure:
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21499 = 1;
  return D.21499;
}


zero_static_data (struct MonoVTable * vtable)
{
  unsigned char D.21501;
  unsigned char D.21502;
  int D.21507;
  unsigned int D.21508;
  struct MonoClass * klass;
  void * data;

  klass = vtable->klass;
  D.21501 = BIT_FIELD_REF <*klass, 8, 184>;
  D.21502 = D.21501 & 16;
  if (D.21502 != 0) goto <D.21503>; else goto <D.21504>;
  <D.21503>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21505>; else goto <D.21506>;
  <D.21505>:
  D.21507 = mono_class_data_size (klass);
  D.21508 = (unsigned int) D.21507;
  mono_gc_bzero_aligned (data, D.21508);
  <D.21506>:
  <D.21504>:
}


clear_cached_vtable (struct MonoVTable * vtable)
{
  short unsigned int D.21511;
  int D.21512;
  int D.21513;
  unsigned char D.21516;
  unsigned char D.21517;
  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.21509>; else goto <D.21510>;
  <D.21509>:
  D.21511 = runtime_info->max_domain;
  D.21512 = (int) D.21511;
  D.21513 = domain->domain_id;
  if (D.21512 >= D.21513) goto <D.21514>; else goto <D.21515>;
  <D.21514>:
  D.21513 = domain->domain_id;
  runtime_info->domain_vtables[D.21513] = 0B;
  <D.21515>:
  <D.21510>:
  D.21516 = BIT_FIELD_REF <*klass, 8, 184>;
  D.21517 = D.21516 & 16;
  if (D.21517 != 0) goto <D.21518>; else goto <D.21519>;
  <D.21518>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21520>; else goto <D.21521>;
  <D.21520>:
  mono_gc_free_fixed (data);
  <D.21521>:
  <D.21519>:
}


deregister_reflection_info_roots (struct MonoDomain * domain)
{
  union mono_mutex_t * D.21522;
  _Bool D.21525;
  long int D.21526;
  long int D.21527;
  unsigned char D.21530;
  unsigned char D.21531;
  struct MonoImage * * D.21534;
  unsigned int i.60;
  unsigned int D.21536;
  struct MonoImage * * D.21537;
  unsigned char D.21540;
  unsigned char D.21541;
  unsigned int i.61;
  unsigned int D.21545;
  _Bool D.21548;
  long int D.21549;
  long int D.21550;
  struct GSList * list;

  {
    int ret;

    D.21522 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21522);
    if (ret != 0) goto <D.21523>; else goto <D.21524>;
    <D.21523>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21524>:
    D.21525 = ret != 0;
    D.21526 = (long int) D.21525;
    D.21527 = __builtin_expect (D.21526, 0);
    if (D.21527 != 0) goto <D.21528>; else goto <D.21529>;
    <D.21528>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2237, "ret == 0");
    <D.21529>:
  }
  list = domain->domain_assemblies;
  goto <D.19623>;
  <D.19622>:
  {
    struct MonoAssembly * assembly;
    struct MonoImage * image;
    int i;

    assembly = list->data;
    image = assembly->image;
    D.21530 = BIT_FIELD_REF <*image, 8, 128>;
    D.21531 = D.21530 & 8;
    if (D.21531 != 0) goto <D.21532>; else goto <D.21533>;
    <D.21532>:
    deregister_reflection_info_roots_from_list (image);
    <D.21533>:
    i = 0;
    goto <D.19620>;
    <D.19619>:
    {
      struct MonoImage * module;

      D.21534 = image->modules;
      i.60 = (unsigned int) i;
      D.21536 = i.60 * 4;
      D.21537 = D.21534 + D.21536;
      module = *D.21537;
      if (module != 0B) goto <D.21538>; else goto <D.21539>;
      <D.21538>:
      D.21540 = BIT_FIELD_REF <*module, 8, 128>;
      D.21541 = D.21540 & 8;
      if (D.21541 != 0) goto <D.21542>; else goto <D.21543>;
      <D.21542>:
      deregister_reflection_info_roots_from_list (module);
      <D.21543>:
      <D.21539>:
    }
    i = i + 1;
    <D.19620>:
    i.61 = (unsigned int) i;
    D.21545 = image->module_count;
    if (i.61 < D.21545) goto <D.19619>; else goto <D.19621>;
    <D.19621>:
  }
  list = list->next;
  <D.19623>:
  if (list != 0B) goto <D.19622>; else goto <D.19624>;
  <D.19624>:
  {
    int ret;

    D.21522 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21522);
    if (ret != 0) goto <D.21546>; else goto <D.21547>;
    <D.21546>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21547>:
    D.21548 = ret != 0;
    D.21549 = (long int) D.21548;
    D.21550 = __builtin_expect (D.21549, 0);
    if (D.21550 != 0) goto <D.21551>; else goto <D.21552>;
    <D.21551>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2258, "ret == 0");
    <D.21552>:
  }
}


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

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

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


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

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


unload_data_unref (struct unload_data * data)
{
  unsigned int count.64;
  unsigned int D.21559;
  _Bool D.21560;
  long int D.21561;
  long int D.21562;
  int D.21567;
  gint32 * D.21568;
  int D.21569;
  gint32 count;

  <D.19600>:
  {
    gint32 __tmp;

    __tmp = data->refcount;
    count = __tmp;
  }
  count.64 = (unsigned int) count;
  D.21559 = count.64 + 4294967295;
  D.21560 = D.21559 > 1;
  D.21561 = (long int) D.21560;
  D.21562 = __builtin_expect (D.21561, 0);
  if (D.21562 != 0) goto <D.21563>; else goto <D.21564>;
  <D.21563>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2208, "count >= 1 && count <= 2");
  <D.21564>:
  if (count == 1) goto <D.21565>; else goto <D.21566>;
  <D.21565>:
  monoeg_g_free (data);
  return;
  <D.21566>:
  D.21567 = count + -1;
  D.21568 = &data->refcount;
  D.21569 = InterlockedCompareExchange (D.21568, count, D.21567);
  if (D.21569 != count) goto <D.19600>; else goto <D.19601>;
  <D.19601>:
}


