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 * (*<T1be2>) (const char *, const char *) load_function.0;
  _Bool D.19646;
  long int D.19647;
  long int D.19648;
  struct MonoDomain * D.19651;

  load_function.0 = load_function;
  D.19646 = load_function.0 == 0B;
  D.19647 = (long int) D.19646;
  D.19648 = __builtin_expect (D.19647, 0);
  if (D.19648 != 0) goto <D.19649>; else goto <D.19650>;
  <D.19649>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 136, "load_function");
  <D.19650>:
  load_function.0 = load_function;
  D.19651 = load_function.0 (filename, runtime_version);
  return D.19651;
}


mono_runtime_set_no_exec (gboolean val)
{
  no_exec = val;
}


mono_runtime_get_no_exec ()
{
  gboolean D.19653;

  D.19653 = no_exec;
  return D.19653;
}


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


mono_domain_assembly_postload_search (struct MonoAssemblyName * aname, void * user_data)
{
  struct MonoAssembly * D.19664;
  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.19662>; else goto <D.19663>;
  <D.19662>:
  monoeg_g_free (aname_str);
  D.19664 = 0B;
  return D.19664;
  <D.19663>:
  assembly = mono_try_assembly_resolve (domain, str, refonly);
  monoeg_g_free (aname_str);
  if (assembly != 0B) goto <D.19665>; else goto <D.19666>;
  <D.19665>:
  D.19664 = assembly->assembly;
  return D.19664;
  <D.19666>:
  D.19664 = 0B;
  return D.19664;
}


mono_domain_assembly_search (struct MonoAssemblyName * aname, void * user_data)
{
  union mono_mutex_t * D.19668;
  _Bool D.19671;
  long int D.19672;
  long int D.19673;
  unsigned char D.19678;
  int D.19680;
  struct MonoAssemblyName * D.19682;
  int D.19683;
  _Bool D.19686;
  long int D.19687;
  long int D.19688;
  struct MonoAssembly * D.19691;
  _Bool D.19694;
  long int D.19695;
  long int D.19696;
  struct MonoDomain * domain;
  struct GSList * tmp;
  struct MonoAssembly * ass;
  gboolean refonly;

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

    D.19668 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.19668);
    if (ret != 0) goto <D.19669>; else goto <D.19670>;
    <D.19669>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19670>:
    D.19671 = ret != 0;
    D.19672 = (long int) D.19671;
    D.19673 = __builtin_expect (D.19672, 0);
    if (D.19673 != 0) goto <D.19674>; else goto <D.19675>;
    <D.19674>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1853, "ret == 0");
    <D.19675>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19462>;
  <D.19461>:
  ass = tmp->data;
  D.19678 = ass->dynamic;
  if (D.19678 != 0) goto <D.19676>; else goto <D.19679>;
  <D.19679>:
  D.19680 = ass->ref_only;
  if (D.19680 != refonly) goto <D.19676>; else goto <D.19681>;
  <D.19681>:
  D.19682 = &ass->aname;
  D.19683 = mono_assembly_names_equal (aname, D.19682);
  if (D.19683 == 0) goto <D.19676>; else goto <D.19677>;
  <D.19676>:
  // predicted unlikely by continue predictor.
  goto <D.19459>;
  <D.19677>:
  {
    int ret;

    D.19668 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.19668);
    if (ret != 0) goto <D.19684>; else goto <D.19685>;
    <D.19684>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19685>:
    D.19686 = ret != 0;
    D.19687 = (long int) D.19686;
    D.19688 = __builtin_expect (D.19687, 0);
    if (D.19688 != 0) goto <D.19689>; else goto <D.19690>;
    <D.19689>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1860, "ret == 0");
    <D.19690>:
  }
  D.19691 = ass;
  return D.19691;
  <D.19459>:
  tmp = tmp->next;
  <D.19462>:
  if (tmp != 0B) goto <D.19461>; else goto <D.19463>;
  <D.19463>:
  {
    int ret;

    D.19668 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.19668);
    if (ret != 0) goto <D.19692>; else goto <D.19693>;
    <D.19692>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19693>:
    D.19694 = ret != 0;
    D.19695 = (long int) D.19694;
    D.19696 = __builtin_expect (D.19695, 0);
    if (D.19696 != 0) goto <D.19697>; else goto <D.19698>;
    <D.19697>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1863, "ret == 0");
    <D.19698>:
  }
  D.19691 = 0B;
  return D.19691;
}


mono_domain_assembly_preload (struct MonoAssemblyName * aname, gchar * * assemblies_path, void * user_data)
{
  gchar * * D.19700;
  gchar * D.19703;
  const char * D.19706;
  const char * D.19707;
  gchar * D.19712;
  struct MonoAssembly * D.19715;
  struct MonoDomain * domain;
  struct MonoAssembly * result;
  gboolean refonly;

  domain = mono_domain_get ();
  result = 0B;
  refonly = (gboolean) user_data;
  set_domain_search_path (domain);
  D.19700 = domain->search_path;
  if (D.19700 != 0B) goto <D.19701>; else goto <D.19702>;
  <D.19701>:
  D.19700 = domain->search_path;
  D.19703 = *D.19700;
  if (D.19703 != 0B) goto <D.19704>; else goto <D.19705>;
  <D.19704>:
  D.19700 = domain->search_path;
  D.19706 = aname->culture;
  D.19707 = aname->name;
  result = real_load (D.19700, D.19706, D.19707, refonly);
  <D.19705>:
  <D.19702>:
  if (result == 0B) goto <D.19708>; else goto <D.19709>;
  <D.19708>:
  if (assemblies_path != 0B) goto <D.19710>; else goto <D.19711>;
  <D.19710>:
  D.19712 = *assemblies_path;
  if (D.19712 != 0B) goto <D.19713>; else goto <D.19714>;
  <D.19713>:
  D.19706 = aname->culture;
  D.19707 = aname->name;
  result = real_load (assemblies_path, D.19706, D.19707, refonly);
  <D.19714>:
  <D.19711>:
  <D.19709>:
  D.19715 = result;
  return D.19715;
}


set_domain_search_path (struct MonoDomain * domain)
{
  union mono_mutex_t * D.19717;
  _Bool D.19720;
  long int D.19721;
  long int D.19722;
  struct MonoAppDomainSetup * D.19725;
  _Bool D.19730;
  long int D.19731;
  long int D.19732;
  gchar * * D.19735;
  unsigned char D.19738;
  _Bool D.19743;
  long int D.19744;
  long int D.19745;
  struct MonoString * D.19748;
  _Bool D.19753;
  long int D.19754;
  long int D.19755;
  struct MonoString * D.19758;
  int D.19761;
  _Bool D.19766;
  long int D.19767;
  long int D.19768;
  gchar * D.19771;
  unsigned int D.19779;
  sizetype i.1;
  gchar * D.19781;
  char D.19782;
  gchar * D.19785;
  _Bool D.19792;
  long int D.19793;
  long int D.19794;
  int D.19799;
  unsigned int D.19800;
  unsigned int D.19801;
  unsigned int npaths.2;
  unsigned int D.19803;
  gchar * * D.19804;
  char * D.19805;
  int D.19806;
  _Bool D.19811;
  long int D.19812;
  long int D.19813;
  int D.19816;
  gchar * D.19819;
  char D.19820;
  gchar * D.19823;
  struct GError * gerror.3;
  gchar * D.19829;
  sizetype D.19831;
  sizetype D.19832;
  gchar * * D.19833;
  gchar * D.19834;
  int D.19835;
  unsigned int i.4;
  unsigned int D.19839;
  gchar * * D.19840;
  gchar * D.19841;
  gchar * D.19843;
  gchar * D.19844;
  char * D.19845;
  unsigned int D.19850;
  unsigned int appbaselen.5;
  int D.19852;
  gchar * D.19855;
  struct MonoString * D.19857;
  gchar * D.19860;
  _Bool D.19863;
  long int D.19864;
  long int D.19865;
  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.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_lock (D.19717);
        if (ret != 0) goto <D.19718>; else goto <D.19719>;
        <D.19718>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.19719>:
        D.19720 = ret != 0;
        D.19721 = (long int) D.19720;
        D.19722 = __builtin_expect (D.19721, 0);
        if (D.19722 != 0) goto <D.19723>; else goto <D.19724>;
        <D.19723>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1058, "ret == 0");
        <D.19724>:
      }
      D.19725 = domain->setup;
      if (D.19725 == 0B) goto <D.19726>; else goto <D.19727>;
      <D.19726>:
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19728>; else goto <D.19729>;
        <D.19728>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19729>:
        D.19730 = ret != 0;
        D.19731 = (long int) D.19730;
        D.19732 = __builtin_expect (D.19731, 0);
        if (D.19732 != 0) goto <D.19733>; else goto <D.19734>;
        <D.19733>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1061, "ret == 0");
        <D.19734>:
      }
      return;
      <D.19727>:
      D.19735 = domain->search_path;
      if (D.19735 != 0B) goto <D.19736>; else goto <D.19737>;
      <D.19736>:
      D.19725 = domain->setup;
      D.19738 = D.19725->path_changed;
      if (D.19738 == 0) goto <D.19739>; else goto <D.19740>;
      <D.19739>:
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19741>; else goto <D.19742>;
        <D.19741>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19742>:
        D.19743 = ret != 0;
        D.19744 = (long int) D.19743;
        D.19745 = __builtin_expect (D.19744, 0);
        if (D.19745 != 0) goto <D.19746>; else goto <D.19747>;
        <D.19746>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1066, "ret == 0");
        <D.19747>:
      }
      return;
      <D.19740>:
      <D.19737>:
      setup = domain->setup;
      D.19748 = setup->application_base;
      if (D.19748 == 0B) goto <D.19749>; else goto <D.19750>;
      <D.19749>:
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19751>; else goto <D.19752>;
        <D.19751>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19752>:
        D.19753 = ret != 0;
        D.19754 = (long int) D.19753;
        D.19755 = __builtin_expect (D.19754, 0);
        if (D.19755 != 0) goto <D.19756>; else goto <D.19757>;
        <D.19756>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1071, "ret == 0");
        <D.19757>:
      }
      return;
      <D.19750>:
      npaths = npaths + 1;
      D.19758 = setup->private_bin_path;
      if (D.19758 != 0B) goto <D.19759>; else goto <D.19760>;
      <D.19759>:
      D.19758 = setup->private_bin_path;
      search_path = mono_string_to_utf8_checked (D.19758, &error);
      D.19761 = mono_error_ok (&error);
      if (D.19761 == 0) goto <D.19762>; else goto <D.19763>;
      <D.19762>:
      monoeg_g_log (0B, 16, "Could not decode AppDomain search path since it contains invalid characters");
      mono_error_cleanup (&error);
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19764>; else goto <D.19765>;
        <D.19764>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19765>:
        D.19766 = ret != 0;
        D.19767 = (long int) D.19766;
        D.19768 = __builtin_expect (D.19767, 0);
        if (D.19768 != 0) goto <D.19769>; else goto <D.19770>;
        <D.19769>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1082, "ret == 0");
        <D.19770>:
      }
      return;
      <D.19763>:
      <D.19760>:
      D.19771 = domain->private_bin_path;
      if (D.19771 != 0B) goto <D.19772>; else goto <D.19773>;
      <D.19772>:
      if (search_path == 0B) goto <D.19774>; else goto <D.19775>;
      <D.19774>:
      search_path = domain->private_bin_path;
      goto <D.19776>;
      <D.19775>:
      {
        gchar * tmp2;

        tmp2 = search_path;
        D.19771 = domain->private_bin_path;
        search_path = monoeg_g_strjoin (";", search_path, D.19771, 0B);
        monoeg_g_free (tmp2);
      }
      <D.19776>:
      <D.19773>:
      if (search_path != 0B) goto <D.19777>; else goto <D.19778>;
      <D.19777>:
      {
        gint slen;

        D.19779 = strlen (search_path);
        slen = (gint) D.19779;
        i = 0;
        goto <D.19252>;
        <D.19251>:
        i.1 = (sizetype) i;
        D.19781 = search_path + i.1;
        D.19782 = *D.19781;
        if (D.19782 == 58) goto <D.19783>; else goto <D.19784>;
        <D.19783>:
        i.1 = (sizetype) i;
        D.19781 = search_path + i.1;
        *D.19781 = 59;
        <D.19784>:
        i = i + 1;
        <D.19252>:
        if (i < slen) goto <D.19251>; else goto <D.19253>;
        <D.19253>:
        pvt_split = monoeg_g_strsplit (search_path, ";", 1000);
        monoeg_g_free (search_path);
        tmp = pvt_split;
        goto <D.19255>;
        <D.19254>:
        tmp = tmp + 4;
        npaths = npaths + 1;
        <D.19255>:
        D.19785 = *tmp;
        if (D.19785 != 0B) goto <D.19254>; else goto <D.19256>;
        <D.19256>:
      }
      <D.19778>:
      if (npaths == 0) goto <D.19786>; else goto <D.19787>;
      <D.19786>:
      if (pvt_split != 0B) goto <D.19788>; else goto <D.19789>;
      <D.19788>:
      monoeg_g_strfreev (pvt_split);
      <D.19789>:
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19790>; else goto <D.19791>;
        <D.19790>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19791>:
        D.19792 = ret != 0;
        D.19793 = (long int) D.19792;
        D.19794 = __builtin_expect (D.19793, 0);
        if (D.19794 != 0) goto <D.19795>; else goto <D.19796>;
        <D.19795>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1133, "ret == 0");
        <D.19796>:
      }
      return;
      <D.19787>:
      D.19735 = domain->search_path;
      if (D.19735 != 0B) goto <D.19797>; else goto <D.19798>;
      <D.19797>:
      D.19735 = domain->search_path;
      monoeg_g_strfreev (D.19735);
      <D.19798>:
      D.19799 = npaths + 1;
      D.19800 = (unsigned int) D.19799;
      D.19801 = D.19800 * 4;
      tmp = monoeg_malloc (D.19801);
      npaths.2 = (unsigned int) npaths;
      D.19803 = npaths.2 * 4;
      D.19804 = tmp + D.19803;
      *D.19804 = 0B;
      D.19748 = setup->application_base;
      D.19805 = mono_string_to_utf8_checked (D.19748, &error);
      *tmp = D.19805;
      D.19806 = mono_error_ok (&error);
      if (D.19806 == 0) goto <D.19807>; else goto <D.19808>;
      <D.19807>:
      mono_error_cleanup (&error);
      monoeg_g_strfreev (pvt_split);
      monoeg_g_free (tmp);
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        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", 1149, "ret == 0");
        <D.19815>:
      }
      return;
      <D.19808>:
      domain->search_path = tmp;
      D.19785 = *tmp;
      D.19816 = strncmp (D.19785, "file://", 7);
      if (D.19816 == 0) goto <D.19817>; else goto <D.19818>;
      <D.19817>:
      {
        gchar * file;
        gchar * uri;
        gchar * tmpuri;

        file = *tmp;
        uri = *tmp;
        D.19819 = uri + 7;
        D.19820 = *D.19819;
        if (D.19820 != 47) goto <D.19821>; else goto <D.19822>;
        <D.19821>:
        D.19819 = uri + 7;
        uri = monoeg_g_strdup_printf ("file:///%s", D.19819);
        <D.19822>:
        tmpuri = uri;
        uri = mono_escape_uri_string (tmpuri);
        D.19823 = monoeg_g_filename_from_uri (uri, 0B, &gerror);
        *tmp = D.19823;
        monoeg_g_free (uri);
        if (tmpuri != file) goto <D.19824>; else goto <D.19825>;
        <D.19824>:
        monoeg_g_free (tmpuri);
        <D.19825>:
        gerror.3 = gerror;
        if (gerror.3 != 0B) goto <D.19827>; else goto <D.19828>;
        <D.19827>:
        gerror.3 = gerror;
        D.19829 = gerror.3->message;
        monoeg_g_log (0B, 16, "%s\n", D.19829);
        gerror.3 = gerror;
        monoeg_g_error_free (gerror.3);
        *tmp = file;
        goto <D.19830>;
        <D.19828>:
        monoeg_g_free (file);
        <D.19830>:
      }
      <D.19818>:
      i = 1;
      goto <D.19284>;
      <D.19283>:
      i.1 = (sizetype) i;
      D.19831 = i.1 + 1073741823;
      D.19832 = D.19831 * 4;
      D.19833 = pvt_split + D.19832;
      D.19834 = *D.19833;
      D.19835 = monoeg_g_path_is_absolute (D.19834);
      if (D.19835 != 0) goto <D.19836>; else goto <D.19837>;
      <D.19836>:
      i.4 = (unsigned int) i;
      D.19839 = i.4 * 4;
      D.19840 = tmp + D.19839;
      i.1 = (sizetype) i;
      D.19831 = i.1 + 1073741823;
      D.19832 = D.19831 * 4;
      D.19833 = pvt_split + D.19832;
      D.19834 = *D.19833;
      D.19841 = monoeg_strdup (D.19834);
      *D.19840 = D.19841;
      goto <D.19842>;
      <D.19837>:
      i.4 = (unsigned int) i;
      D.19839 = i.4 * 4;
      D.19840 = tmp + D.19839;
      D.19785 = *tmp;
      i.1 = (sizetype) i;
      D.19831 = i.1 + 1073741823;
      D.19832 = D.19831 * 4;
      D.19833 = pvt_split + D.19832;
      D.19834 = *D.19833;
      D.19843 = monoeg_g_build_path ("/", D.19785, D.19834, 0B);
      *D.19840 = D.19843;
      <D.19842>:
      i.4 = (unsigned int) i;
      D.19839 = i.4 * 4;
      D.19840 = tmp + D.19839;
      D.19844 = *D.19840;
      D.19845 = __builtin_strchr (D.19844, 46);
      if (D.19845 != 0B) goto <D.19846>; else goto <D.19847>;
      <D.19846>:
      {
        gchar * reduced;
        gchar * freeme;

        i.4 = (unsigned int) i;
        D.19839 = i.4 * 4;
        D.19840 = tmp + D.19839;
        D.19844 = *D.19840;
        reduced = mono_path_canonicalize (D.19844);
        if (appbaselen == -1) goto <D.19848>; else goto <D.19849>;
        <D.19848>:
        D.19785 = *tmp;
        D.19850 = strlen (D.19785);
        appbaselen = (gint) D.19850;
        <D.19849>:
        D.19785 = *tmp;
        appbaselen.5 = (unsigned int) appbaselen;
        D.19852 = strncmp (D.19785, reduced, appbaselen.5);
        if (D.19852 != 0) goto <D.19853>; else goto <D.19854>;
        <D.19853>:
        monoeg_g_free (reduced);
        i.4 = (unsigned int) i;
        D.19839 = i.4 * 4;
        D.19840 = tmp + D.19839;
        D.19844 = *D.19840;
        monoeg_g_free (D.19844);
        i.4 = (unsigned int) i;
        D.19839 = i.4 * 4;
        D.19840 = tmp + D.19839;
        D.19855 = monoeg_strdup ("");
        *D.19840 = D.19855;
        // predicted unlikely by continue predictor.
        goto <D.19282>;
        <D.19854>:
        i.4 = (unsigned int) i;
        D.19839 = i.4 * 4;
        D.19840 = tmp + D.19839;
        freeme = *D.19840;
        i.4 = (unsigned int) i;
        D.19839 = i.4 * 4;
        D.19840 = tmp + D.19839;
        *D.19840 = reduced;
        monoeg_g_free (freeme);
      }
      <D.19847>:
      <D.19282>:
      i = i + 1;
      <D.19284>:
      if (pvt_split != 0B) goto <D.19856>; else goto <D.19285>;
      <D.19856>:
      if (i < npaths) goto <D.19283>; else goto <D.19285>;
      <D.19285>:
      D.19857 = setup->private_bin_path_probe;
      if (D.19857 != 0B) goto <D.19858>; else goto <D.19859>;
      <D.19858>:
      D.19785 = *tmp;
      monoeg_g_free (D.19785);
      D.19860 = monoeg_strdup ("");
      *tmp = D.19860;
      <D.19859>:
      D.19725 = domain->setup;
      D.19725->path_changed = 0;
      monoeg_g_strfreev (pvt_split);
      {
        int ret;

        D.19717 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19717);
        if (ret != 0) goto <D.19861>; else goto <D.19862>;
        <D.19861>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19862>:
        D.19863 = ret != 0;
        D.19864 = (long int) D.19863;
        D.19865 = __builtin_expect (D.19864, 0);
        if (D.19865 != 0) goto <D.19866>; else goto <D.19867>;
        <D.19866>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1218, "ret == 0");
        <D.19867>:
      }
    }
  finally
    {
      error = {CLOBBER};
      gerror = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.19871>; else goto <D.19872>;
  <D.19871>:
  D.19873 = __strdup (str);
  return D.19873;
  <D.19872>:
  D.19873 = 0B;
  return D.19873;
}


real_load (gchar * * search_path, const gchar * culture, const gchar * name, gboolean refonly)
{
  char D.19879;
  unsigned int D.19880;
  gchar * D.19881;
  char D.19882;
  sizetype len.6;
  sizetype D.19886;
  gchar * D.19887;
  int D.19888;
  int D.19890;
  int D.19892;
  int D.19894;
  struct MonoAssembly * D.19896;
  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.19875>; else goto <D.19878>;
      <D.19878>:
      D.19879 = *culture;
      if (D.19879 == 0) goto <D.19875>; else goto <D.19876>;
      <D.19875>:
      local_culture = "";
      goto <D.19877>;
      <D.19876>:
      local_culture = culture;
      <D.19877>:
      filename = monoeg_g_strconcat (name, ".dll", 0B);
      D.19880 = strlen (filename);
      len = (gint) D.19880;
      path = search_path;
      goto <D.19441>;
      <D.19440>:
      D.19881 = *path;
      D.19882 = *D.19881;
      if (D.19882 == 0) goto <D.19883>; else goto <D.19884>;
      <D.19883>:
      is_private = 1;
      // predicted unlikely by continue predictor.
      goto <D.19438>;
      <D.19884>:
      len.6 = (sizetype) len;
      D.19886 = len.6 + 4294967292;
      D.19887 = filename + D.19886;
      strcpy (D.19887, ".dll");
      D.19881 = *path;
      D.19888 = try_load_from (&result, D.19881, local_culture, "", filename, refonly, is_private);
      if (D.19888 != 0) goto <D.19439>; else goto <D.19889>;
      <D.19889>:
      len.6 = (sizetype) len;
      D.19886 = len.6 + 4294967292;
      D.19887 = filename + D.19886;
      strcpy (D.19887, ".exe");
      D.19881 = *path;
      D.19890 = try_load_from (&result, D.19881, local_culture, "", filename, refonly, is_private);
      if (D.19890 != 0) goto <D.19439>; else goto <D.19891>;
      <D.19891>:
      len.6 = (sizetype) len;
      D.19886 = len.6 + 4294967292;
      D.19887 = filename + D.19886;
      strcpy (D.19887, ".dll");
      D.19881 = *path;
      D.19892 = try_load_from (&result, D.19881, local_culture, name, filename, refonly, is_private);
      if (D.19892 != 0) goto <D.19439>; else goto <D.19893>;
      <D.19893>:
      len.6 = (sizetype) len;
      D.19886 = len.6 + 4294967292;
      D.19887 = filename + D.19886;
      strcpy (D.19887, ".exe");
      D.19881 = *path;
      D.19894 = try_load_from (&result, D.19881, local_culture, name, filename, refonly, is_private);
      if (D.19894 != 0) goto <D.19439>; else goto <D.19895>;
      <D.19895>:
      <D.19438>:
      path = path + 4;
      <D.19441>:
      D.19881 = *path;
      if (D.19881 != 0B) goto <D.19440>; else goto <D.19439>;
      <D.19439>:
      monoeg_g_free (filename);
      D.19896 = result;
      return D.19896;
    }
  finally
    {
      result = {CLOBBER};
    }
}


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

  D.19900 = __builtin_object_size (__dest, 1);
  D.19899 = __builtin___strcpy_chk (__dest, __src, D.19900);
  return D.19899;
}


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.19910;
  gboolean D.19911;
  struct MonoAssembly * D.19912;
  _Bool D.19913;
  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.19903>; else goto <D.19904>;
  <D.19903>:
  {
    gchar * new_fullpath;

    new_fullpath = mono_portability_find_file (fullpath, 1);
    if (new_fullpath != 0B) goto <D.19905>; else goto <D.19906>;
    <D.19905>:
    monoeg_g_free (fullpath);
    fullpath = new_fullpath;
    found = 1;
    <D.19906>:
  }
  goto <D.19907>;
  <D.19904>:
  found = monoeg_g_file_test (fullpath, 1);
  <D.19907>:
  if (found != 0) goto <D.19908>; else goto <D.19909>;
  <D.19908>:
  D.19910 = mono_assembly_open_full (fullpath, 0B, refonly);
  *assembly = D.19910;
  <D.19909>:
  monoeg_g_free (fullpath);
  D.19912 = *assembly;
  D.19913 = D.19912 != 0B;
  D.19911 = (gboolean) D.19913;
  return D.19911;
}


create_domain_objects (struct MonoDomain * domain)
{
  struct MonoImage * D.19917;
  struct MonoException * D.19918;
  struct MonoException * D.19919;
  struct MonoException * D.19920;
  struct MonoClass * D.19921;
  struct MonoObject * D.19922;
  struct MonoClass * D.19925;
  struct MonoClass * D.19926;
  struct MonoDomain * old_domain;
  struct MonoString * arg;

  old_domain = mono_domain_get ();
  if (domain != old_domain) goto <D.19915>; else goto <D.19916>;
  <D.19915>:
  mono_thread_push_appdomain_ref (domain);
  mono_domain_set_internal_with_options (domain, 0);
  <D.19916>:
  arg = mono_string_new (domain, "Out of memory");
  D.19917 = mono_defaults.corlib;
  D.19918 = mono_exception_from_name_two_strings (D.19917, "System", "OutOfMemoryException", arg, 0B);
  domain->out_of_memory_ex = D.19918;
  arg = mono_string_new (domain, "A null value was found where an object instance was required");
  D.19917 = mono_defaults.corlib;
  D.19919 = mono_exception_from_name_two_strings (D.19917, "System", "NullReferenceException", arg, 0B);
  domain->null_reference_ex = D.19919;
  arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
  D.19917 = mono_defaults.corlib;
  D.19920 = mono_exception_from_name_two_strings (D.19917, "System", "StackOverflowException", arg, 0B);
  domain->stack_overflow_ex = D.19920;
  D.19921 = mono_defaults.object_class;
  D.19922 = mono_object_new (domain, D.19921);
  domain->ephemeron_tombstone = D.19922;
  if (domain != old_domain) goto <D.19923>; else goto <D.19924>;
  <D.19923>:
  mono_thread_pop_appdomain_ref ();
  mono_domain_set_internal_with_options (old_domain, 0);
  <D.19924>:
  D.19925 = mono_defaults.int_class;
  D.19926 = mono_array_class_get (D.19925, 1);
  mono_class_init (D.19926);
}


mono_domain_fire_assembly_load (struct MonoAssembly * assembly, void * user_data)
{
  struct MonoAppDomain * D.19927;
  struct MonoVTable * D.19930;
  union mono_mutex_t * D.19931;
  _Bool D.19934;
  long int D.19935;
  long int D.19936;
  _Bool D.19941;
  long int D.19942;
  long int D.19943;
  struct MonoClassField * assembly_load_field.8;
  struct MonoClassField * assembly_load_field.9;
  _Bool D.19950;
  long int D.19951;
  long int D.19952;
  void * load_value.10;
  _Bool D.19958;
  long int D.19959;
  long int D.19960;
  struct MonoMethod * assembly_load_method.11;
  struct MonoMethod * assembly_load_method.12;
  _Bool D.19967;
  long int D.19968;
  long int D.19969;
  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.19927 = domain->domain;
      if (D.19927 == 0B) goto <D.19928>; else goto <D.19929>;
      <D.19928>:
      return;
      <D.19929>:
      D.19927 = domain->domain;
      D.19930 = D.19927->mbr.obj.vtable;
      klass = D.19930->klass;
      {
        int ret;

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

        D.19931 = &domain->assemblies_lock.mutex;
        ret = pthread_mutex_unlock (D.19931);
        if (ret != 0) goto <D.19939>; else goto <D.19940>;
        <D.19939>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.19940>:
        D.19941 = ret != 0;
        D.19942 = (long int) D.19941;
        D.19943 = __builtin_expect (D.19942, 0);
        if (D.19943 != 0) goto <D.19944>; else goto <D.19945>;
        <D.19944>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1013, "ret == 0");
        <D.19945>:
      }
      assembly_load_field.8 = assembly_load_field;
      if (assembly_load_field.8 == 0B) goto <D.19947>; else goto <D.19948>;
      <D.19947>:
      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.19950 = assembly_load_field.8 == 0B;
      D.19951 = (long int) D.19950;
      D.19952 = __builtin_expect (D.19951, 0);
      if (D.19952 != 0) goto <D.19953>; else goto <D.19954>;
      <D.19953>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1017, "assembly_load_field");
      <D.19954>:
      <D.19948>:
      D.19927 = domain->domain;
      assembly_load_field.8 = assembly_load_field;
      mono_field_get_value (D.19927, assembly_load_field.8, &load_value);
      load_value.10 = load_value;
      if (load_value.10 == 0B) goto <D.19956>; else goto <D.19957>;
      <D.19956>:
      return;
      <D.19957>:
      ref_assembly = mono_assembly_get_object (domain, assembly);
      D.19958 = ref_assembly == 0B;
      D.19959 = (long int) D.19958;
      D.19960 = __builtin_expect (D.19959, 0);
      if (D.19960 != 0) goto <D.19961>; else goto <D.19962>;
      <D.19961>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1027, "ref_assembly");
      <D.19962>:
      assembly_load_method.11 = assembly_load_method;
      if (assembly_load_method.11 == 0B) goto <D.19964>; else goto <D.19965>;
      <D.19964>:
      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.19967 = assembly_load_method.11 == 0B;
      D.19968 = (long int) D.19967;
      D.19969 = __builtin_expect (D.19968, 0);
      if (D.19969 != 0) goto <D.19970>; else goto <D.19971>;
      <D.19970>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1031, "assembly_load_method");
      <D.19971>:
      <D.19965>:
      params[0] = ref_assembly;
      assembly_load_method.11 = assembly_load_method;
      D.19927 = domain->domain;
      mono_runtime_invoke (assembly_load_method.11, D.19927, &params, 0B);
    }
  finally
    {
      load_value = {CLOBBER};
      params = {CLOBBER};
    }
}


add_assemblies_to_domain (struct MonoDomain * domain, struct MonoAssembly * ass, struct GHashTable * ht)
{
  const char * D.19975;
  void * D.19980;
  void * D.19981;
  struct GSList * D.19984;
  struct GSList * D.19985;
  char * D.19986;
  int D.19987;
  struct MonoImage * D.19988;
  struct MonoAssembly * * D.19989;
  unsigned int i.13;
  unsigned int D.19993;
  struct MonoAssembly * * D.19994;
  struct MonoAssembly * D.19995;
  void * D.19998;
  gint i;
  struct GSList * tmp;
  gboolean destroy_ht;

  destroy_ht = 0;
  D.19975 = ass->aname.name;
  if (D.19975 == 0B) goto <D.19976>; else goto <D.19977>;
  <D.19976>:
  return;
  <D.19977>:
  if (ht == 0B) goto <D.19978>; else goto <D.19979>;
  <D.19978>:
  ht = monoeg_g_hash_table_new (mono_aligned_addr_hash, 0B);
  destroy_ht = 1;
  <D.19979>:
  tmp = domain->domain_assemblies;
  goto <D.19214>;
  <D.19213>:
  D.19980 = tmp->data;
  D.19980 = tmp->data;
  monoeg_g_hash_table_insert_replace (ht, D.19980, D.19980, 0);
  tmp = tmp->next;
  <D.19214>:
  if (tmp != 0B) goto <D.19213>; else goto <D.19215>;
  <D.19215>:
  D.19981 = monoeg_g_hash_table_lookup (ht, ass);
  if (D.19981 == 0B) goto <D.19982>; else goto <D.19983>;
  <D.19982>:
  mono_assembly_addref (ass);
  monoeg_g_hash_table_insert_replace (ht, ass, ass, 0);
  D.19984 = domain->domain_assemblies;
  D.19985 = monoeg_g_slist_append (D.19984, ass);
  domain->domain_assemblies = D.19985;
  D.19975 = ass->aname.name;
  D.19986 = domain->friendly_name;
  D.19987 = ass->ref_count;
  mono_trace (64, 1, "Assembly %s[%p] added to domain %s, ref_count=%d", D.19975, ass, D.19986, D.19987);
  <D.19983>:
  D.19988 = ass->image;
  D.19989 = D.19988->references;
  if (D.19989 != 0B) goto <D.19990>; else goto <D.19991>;
  <D.19990>:
  i = 0;
  goto <D.19217>;
  <D.19216>:
  D.19988 = ass->image;
  D.19989 = D.19988->references;
  i.13 = (unsigned int) i;
  D.19993 = i.13 * 4;
  D.19994 = D.19989 + D.19993;
  D.19995 = *D.19994;
  if (D.19995 != 4294967295B) goto <D.19996>; else goto <D.19997>;
  <D.19996>:
  D.19988 = ass->image;
  D.19989 = D.19988->references;
  i.13 = (unsigned int) i;
  D.19993 = i.13 * 4;
  D.19994 = D.19989 + D.19993;
  D.19995 = *D.19994;
  D.19998 = monoeg_g_hash_table_lookup (ht, D.19995);
  if (D.19998 == 0B) goto <D.19999>; else goto <D.20000>;
  <D.19999>:
  D.19988 = ass->image;
  D.19989 = D.19988->references;
  i.13 = (unsigned int) i;
  D.19993 = i.13 * 4;
  D.19994 = D.19989 + D.19993;
  D.19995 = *D.19994;
  add_assemblies_to_domain (domain, D.19995, ht);
  <D.20000>:
  <D.19997>:
  i = i + 1;
  <D.19217>:
  D.19988 = ass->image;
  D.19989 = D.19988->references;
  i.13 = (unsigned int) i;
  D.19993 = i.13 * 4;
  D.19994 = D.19989 + D.19993;
  D.19995 = *D.19994;
  if (D.19995 != 0B) goto <D.19216>; else goto <D.19218>;
  <D.19218>:
  <D.19991>:
  if (destroy_ht != 0) goto <D.20001>; else goto <D.20002>;
  <D.20001>:
  monoeg_g_hash_table_destroy (ht);
  <D.20002>:
}


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

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


mono_get_corlib_version ()
{
  struct MonoImage * D.20008;
  int D.20011;
  struct MonoType * D.20012;
  short unsigned int D.20013;
  int D.20014;
  int D.20015;
  struct MonoDomain * D.20018;
  gint32 * D.20019;
  struct MonoClass * klass;
  struct MonoClassField * field;
  struct MonoObject * value;

  D.20008 = mono_defaults.corlib;
  klass = mono_class_from_name (D.20008, "System", "Environment");
  mono_class_init (klass);
  field = mono_class_get_field_from_name (klass, "mono_corlib_version");
  if (field == 0B) goto <D.20009>; else goto <D.20010>;
  <D.20009>:
  D.20011 = -1;
  return D.20011;
  <D.20010>:
  D.20012 = field->type;
  D.20013 = D.20012->attrs;
  D.20014 = (int) D.20013;
  D.20015 = D.20014 & 16;
  if (D.20015 == 0) goto <D.20016>; else goto <D.20017>;
  <D.20016>:
  D.20011 = -1;
  return D.20011;
  <D.20017>:
  D.20018 = mono_domain_get ();
  value = mono_field_get_value_object (D.20018, field, 0B);
  D.20019 = value + 8;
  D.20011 = *D.20019;
  return D.20011;
}


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

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

  quit_function.14 = quit_function;
  if (quit_function.14 != 0B) goto <D.20024>; else goto <D.20025>;
  <D.20024>:
  quit_function.14 = quit_function;
  D.20026 = mono_get_root_domain ();
  quit_function.14 (D.20026, 0B);
  <D.20025>:
}


mono_domain_create_appdomain (char * friendly_name, char * configuration_file)
{
  struct MonoImage * D.20027;
  struct MonoDomain * D.20028;
  struct MonoString * iftmp.15;
  struct MonoDomain * D.20032;
  struct MonoDomain * D.20034;
  struct MonoAppDomain * ad;
  struct MonoAppDomainSetup * setup;
  struct MonoClass * class;

  D.20027 = mono_defaults.corlib;
  class = mono_class_from_name (D.20027, "System", "AppDomainSetup");
  D.20028 = mono_domain_get ();
  setup = mono_object_new (D.20028, class);
  if (configuration_file != 0B) goto <D.20030>; else goto <D.20031>;
  <D.20030>:
  D.20032 = mono_domain_get ();
  iftmp.15 = mono_string_new (D.20032, configuration_file);
  goto <D.20033>;
  <D.20031>:
  iftmp.15 = 0B;
  <D.20033>:
  setup->configuration_file = iftmp.15;
  ad = mono_domain_create_appdomain_internal (friendly_name, setup);
  D.20034 = mono_domain_from_appdomain (ad);
  return D.20034;
}


mono_domain_create_appdomain_internal (char * friendly_name, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20036;
  gchar * D.20037;
  struct MonoString * D.20038;
  struct MonoAppDomainSetup * D.20041;
  struct MonoString * D.20042;
  struct MonoString * * D.20045;
  mono_unichar2 * D.20046;
  int D.20047;
  struct MonoString * D.20048;
  struct MonoAppDomainSetup * D.20049;
  struct MonoAssembly * D.20050;
  int D.20051;
  struct MonoAppDomain * D.20054;
  struct MonoError error;
  struct MonoClass * adclass;
  struct MonoAppDomain * ad;
  struct MonoDomain * data;
  char * shadow_location;

  try
    {
      D.20036 = mono_defaults.corlib;
      adclass = mono_class_from_name (D.20036, "System", "AppDomain");
      data = mono_domain_create ();
      ad = mono_object_new (data, adclass);
      ad->data = data;
      data->domain = ad;
      D.20037 = monoeg_strdup (friendly_name);
      data->friendly_name = D.20037;
      D.20038 = setup->application_base;
      if (D.20038 == 0B) goto <D.20039>; else goto <D.20040>;
      <D.20039>:
      {
        struct MonoDomain * root;

        root = mono_get_root_domain ();
        D.20041 = root->setup;
        D.20042 = D.20041->application_base;
        if (D.20042 != 0B) goto <D.20043>; else goto <D.20044>;
        <D.20043>:
        D.20045 = &setup->application_base;
        D.20041 = root->setup;
        D.20042 = D.20041->application_base;
        D.20046 = mono_string_chars (D.20042);
        D.20041 = root->setup;
        D.20042 = D.20041->application_base;
        D.20047 = mono_string_length (D.20042);
        D.20048 = mono_string_new_utf16 (data, D.20046, D.20047);
        mono_gc_wbarrier_set_field (setup, D.20045, D.20048);
        <D.20044>:
      }
      <D.20040>:
      mono_context_init (data);
      D.20049 = copy_app_domain_setup (data, setup);
      data->setup = D.20049;
      mono_set_private_bin_path_from_config (data);
      D.20036 = mono_defaults.corlib;
      D.20050 = D.20036->assembly;
      add_assemblies_to_domain (data, D.20050, 0B);
      shadow_location = get_shadow_assembly_location_base (data, &error);
      D.20051 = mono_error_ok (&error);
      if (D.20051 == 0) goto <D.20052>; else goto <D.20053>;
      <D.20052>:
      mono_error_raise_exception (&error);
      <D.20053>:
      monoeg_g_free (shadow_location);
      create_domain_objects (data);
      D.20054 = ad;
      return D.20054;
    }
  finally
    {
      error = {CLOBBER};
    }
}


copy_app_domain_setup (struct MonoDomain * domain, struct MonoAppDomainSetup * setup)
{
  struct MonoImage * D.20057;
  struct MonoString * * D.20058;
  struct MonoString * D.20059;
  struct MonoObject * D.20060;
  struct MonoString * * D.20061;
  struct MonoString * D.20062;
  struct MonoObject * D.20063;
  struct MonoString * * D.20064;
  struct MonoString * D.20065;
  struct MonoObject * D.20066;
  struct MonoString * * D.20067;
  struct MonoString * D.20068;
  struct MonoObject * D.20069;
  struct MonoString * * D.20070;
  struct MonoString * D.20071;
  struct MonoObject * D.20072;
  struct MonoString * * D.20073;
  struct MonoString * D.20074;
  struct MonoObject * D.20075;
  struct MonoString * * D.20076;
  struct MonoString * D.20077;
  struct MonoObject * D.20078;
  struct MonoString * * D.20079;
  struct MonoString * D.20080;
  struct MonoObject * D.20081;
  struct MonoString * * D.20082;
  struct MonoString * D.20083;
  struct MonoObject * D.20084;
  struct MonoString * * D.20085;
  struct MonoString * D.20086;
  struct MonoObject * D.20087;
  unsigned char D.20088;
  unsigned char D.20089;
  int D.20090;
  unsigned char D.20091;
  unsigned char D.20092;
  struct MonoArray * * D.20093;
  struct MonoArray * D.20094;
  struct MonoObject * D.20095;
  unsigned char D.20096;
  struct MonoObject * * D.20097;
  struct MonoObject * D.20098;
  struct MonoObject * D.20099;
  struct MonoArray * * D.20100;
  struct MonoArray * D.20101;
  struct MonoObject * D.20102;
  struct MonoArray * * D.20103;
  struct MonoArray * D.20104;
  struct MonoObject * D.20105;
  struct MonoAppDomainSetup * D.20106;
  struct MonoDomain * caller_domain;
  struct MonoClass * ads_class;
  struct MonoAppDomainSetup * copy;

  caller_domain = mono_domain_get ();
  D.20057 = mono_defaults.corlib;
  ads_class = mono_class_from_name (D.20057, "System", "AppDomainSetup");
  copy = mono_object_new (domain, ads_class);
  mono_domain_set_internal (domain);
  D.20058 = &copy->application_base;
  D.20059 = setup->application_base;
  D.20060 = mono_marshal_xdomain_copy_value (D.20059);
  mono_gc_wbarrier_set_field (copy, D.20058, D.20060);
  D.20061 = &copy->application_name;
  D.20062 = setup->application_name;
  D.20063 = mono_marshal_xdomain_copy_value (D.20062);
  mono_gc_wbarrier_set_field (copy, D.20061, D.20063);
  D.20064 = &copy->cache_path;
  D.20065 = setup->cache_path;
  D.20066 = mono_marshal_xdomain_copy_value (D.20065);
  mono_gc_wbarrier_set_field (copy, D.20064, D.20066);
  D.20067 = &copy->configuration_file;
  D.20068 = setup->configuration_file;
  D.20069 = mono_marshal_xdomain_copy_value (D.20068);
  mono_gc_wbarrier_set_field (copy, D.20067, D.20069);
  D.20070 = &copy->dynamic_base;
  D.20071 = setup->dynamic_base;
  D.20072 = mono_marshal_xdomain_copy_value (D.20071);
  mono_gc_wbarrier_set_field (copy, D.20070, D.20072);
  D.20073 = &copy->license_file;
  D.20074 = setup->license_file;
  D.20075 = mono_marshal_xdomain_copy_value (D.20074);
  mono_gc_wbarrier_set_field (copy, D.20073, D.20075);
  D.20076 = &copy->private_bin_path;
  D.20077 = setup->private_bin_path;
  D.20078 = mono_marshal_xdomain_copy_value (D.20077);
  mono_gc_wbarrier_set_field (copy, D.20076, D.20078);
  D.20079 = &copy->private_bin_path_probe;
  D.20080 = setup->private_bin_path_probe;
  D.20081 = mono_marshal_xdomain_copy_value (D.20080);
  mono_gc_wbarrier_set_field (copy, D.20079, D.20081);
  D.20082 = &copy->shadow_copy_directories;
  D.20083 = setup->shadow_copy_directories;
  D.20084 = mono_marshal_xdomain_copy_value (D.20083);
  mono_gc_wbarrier_set_field (copy, D.20082, D.20084);
  D.20085 = &copy->shadow_copy_files;
  D.20086 = setup->shadow_copy_files;
  D.20087 = mono_marshal_xdomain_copy_value (D.20086);
  mono_gc_wbarrier_set_field (copy, D.20085, D.20087);
  D.20088 = setup->publisher_policy;
  copy->publisher_policy = D.20088;
  D.20089 = setup->path_changed;
  copy->path_changed = D.20089;
  D.20090 = setup->loader_optimization;
  copy->loader_optimization = D.20090;
  D.20091 = setup->disallow_binding_redirects;
  copy->disallow_binding_redirects = D.20091;
  D.20092 = setup->disallow_code_downloads;
  copy->disallow_code_downloads = D.20092;
  D.20093 = &copy->domain_initializer_args;
  D.20094 = setup->domain_initializer_args;
  D.20095 = mono_marshal_xdomain_copy_value (D.20094);
  mono_gc_wbarrier_set_field (copy, D.20093, D.20095);
  D.20096 = setup->disallow_appbase_probe;
  copy->disallow_appbase_probe = D.20096;
  D.20097 = &copy->application_trust;
  D.20098 = setup->application_trust;
  D.20099 = mono_marshal_xdomain_copy_value (D.20098);
  mono_gc_wbarrier_set_field (copy, D.20097, D.20099);
  D.20100 = &copy->configuration_bytes;
  D.20101 = setup->configuration_bytes;
  D.20102 = mono_marshal_xdomain_copy_value (D.20101);
  mono_gc_wbarrier_set_field (copy, D.20100, D.20102);
  D.20103 = &copy->serialized_non_primitives;
  D.20104 = setup->serialized_non_primitives;
  D.20105 = mono_marshal_xdomain_copy_value (D.20104);
  mono_gc_wbarrier_set_field (copy, D.20103, D.20105);
  mono_domain_set_internal (caller_domain);
  D.20106 = copy;
  return D.20106;
}


get_shadow_assembly_location_base (struct MonoDomain * domain, struct MonoError * error)
{
  struct MonoString * D.20110;
  struct MonoString * D.20112;
  int D.20114;
  char * D.20117;
  unsigned int D.20118;
  unsigned int D.20119;
  sizetype i.16;
  char * D.20121;
  char D.20122;
  int D.20125;
  const gchar * D.20128;
  const gchar * D.20129;
  struct MonoAppDomainSetup * setup;
  char * cache_path;
  char * appname;
  char * userdir;
  char * location;

  mono_error_init (error);
  setup = domain->setup;
  D.20110 = setup->cache_path;
  if (D.20110 != 0B) goto <D.20111>; else goto <D.20108>;
  <D.20111>:
  D.20112 = setup->application_name;
  if (D.20112 != 0B) goto <D.20113>; else goto <D.20108>;
  <D.20113>:
  D.20110 = setup->cache_path;
  cache_path = mono_string_to_utf8_checked (D.20110, error);
  D.20114 = mono_error_ok (error);
  if (D.20114 == 0) goto <D.20115>; else goto <D.20116>;
  <D.20115>:
  D.20117 = 0B;
  return D.20117;
  <D.20116>:
  {
    gint i;

    D.20118 = strlen (cache_path);
    D.20119 = D.20118 + 4294967295;
    i = (gint) D.20119;
    goto <D.19320>;
    <D.19319>:
    i.16 = (sizetype) i;
    D.20121 = cache_path + i.16;
    D.20122 = *D.20121;
    if (D.20122 == 92) goto <D.20123>; else goto <D.20124>;
    <D.20123>:
    i.16 = (sizetype) i;
    D.20121 = cache_path + i.16;
    *D.20121 = 47;
    <D.20124>:
    i = i + -1;
    <D.19320>:
    if (i >= 0) goto <D.19319>; else goto <D.19321>;
    <D.19321>:
  }
  D.20112 = setup->application_name;
  appname = mono_string_to_utf8_checked (D.20112, error);
  D.20125 = mono_error_ok (error);
  if (D.20125 == 0) goto <D.20126>; else goto <D.20127>;
  <D.20126>:
  monoeg_g_free (cache_path);
  D.20117 = 0B;
  return D.20117;
  <D.20127>:
  location = monoeg_g_build_path ("/", cache_path, appname, "assembly", "shadow", 0B);
  monoeg_g_free (appname);
  monoeg_g_free (cache_path);
  goto <D.20109>;
  <D.20108>:
  D.20128 = monoeg_g_get_user_name ();
  userdir = monoeg_g_strdup_printf ("%s-mono-cachepath", D.20128);
  D.20129 = monoeg_g_get_tmp_dir ();
  location = monoeg_g_build_path ("/", D.20129, userdir, "assembly", "shadow", 0B);
  monoeg_g_free (userdir);
  <D.20109>:
  D.20117 = location;
  return D.20117;
}


mono_domain_has_type_resolve (struct MonoDomain * domain)
{
  struct MonoClassField * field.17;
  struct MonoClass * D.20134;
  struct MonoClassField * field.18;
  _Bool D.20136;
  long int D.20137;
  long int D.20138;
  struct MonoAppDomain * D.20141;
  mono_bool D.20144;
  struct MonoObject * o.19;
  _Bool D.20146;
  static struct MonoClassField * field = 0B;
  struct MonoObject * o;

  try
    {
      field.17 = field;
      if (field.17 == 0B) goto <D.20132>; else goto <D.20133>;
      <D.20132>:
      D.20134 = mono_defaults.appdomain_class;
      field.18 = mono_class_get_field_from_name (D.20134, "TypeResolve");
      field = field.18;
      field.17 = field;
      D.20136 = field.17 == 0B;
      D.20137 = (long int) D.20136;
      D.20138 = __builtin_expect (D.20137, 0);
      if (D.20138 != 0) goto <D.20139>; else goto <D.20140>;
      <D.20139>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 503, "field");
      <D.20140>:
      <D.20133>:
      D.20141 = domain->domain;
      if (D.20141 == 0B) goto <D.20142>; else goto <D.20143>;
      <D.20142>:
      D.20144 = 0;
      return D.20144;
      <D.20143>:
      D.20141 = domain->domain;
      field.17 = field;
      mono_field_get_value (D.20141, field.17, &o);
      o.19 = o;
      D.20146 = o.19 != 0B;
      D.20144 = (mono_bool) D.20146;
      return D.20144;
    }
  finally
    {
      o = {CLOBBER};
    }
}


mono_domain_try_type_resolve (struct MonoDomain * domain, char * name, struct MonoObject * tb)
{
  int iftmp.20;
  _Bool D.20155;
  long int D.20156;
  long int D.20157;
  struct MonoMethod * method.21;
  struct MonoAppDomain * D.20163;
  struct MonoVTable * D.20164;
  _Bool D.20165;
  long int D.20166;
  long int D.20167;
  struct MonoMethod * method.22;
  struct MonoReflectionAssembly * D.20173;
  struct MonoDomain * D.20176;
  struct MonoString * D.20177;
  struct MonoClass * klass;
  void * params[1];
  static struct MonoMethod * method = 0B;

  try
    {
      if (domain == 0B) goto <D.20150>; else goto <D.20153>;
      <D.20153>:
      if (name == 0B) goto <D.20154>; else goto <D.20151>;
      <D.20154>:
      if (tb == 0B) goto <D.20150>; else goto <D.20151>;
      <D.20150>:
      iftmp.20 = 1;
      goto <D.20152>;
      <D.20151>:
      iftmp.20 = 0;
      <D.20152>:
      D.20155 = iftmp.20 != 0;
      D.20156 = (long int) D.20155;
      D.20157 = __builtin_expect (D.20156, 0);
      if (D.20157 != 0) goto <D.20158>; else goto <D.20159>;
      <D.20158>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 534, "domain != NULL && ((name != NULL) || (tb != NULL))");
      <D.20159>:
      method.21 = method;
      if (method.21 == 0B) goto <D.20161>; else goto <D.20162>;
      <D.20161>:
      D.20163 = domain->domain;
      D.20164 = D.20163->mbr.obj.vtable;
      klass = D.20164->klass;
      D.20165 = klass == 0B;
      D.20166 = (long int) D.20165;
      D.20167 = __builtin_expect (D.20166, 0);
      if (D.20167 != 0) goto <D.20168>; else goto <D.20169>;
      <D.20168>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 538, "klass");
      <D.20169>:
      method.22 = mono_class_get_method_from_name (klass, "DoTypeResolve", -1);
      method = method.22;
      method.21 = method;
      if (method.21 == 0B) goto <D.20171>; else goto <D.20172>;
      <D.20171>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoTypeResolve not found.\n");
      D.20173 = 0B;
      return D.20173;
      <D.20172>:
      <D.20162>:
      if (name != 0B) goto <D.20174>; else goto <D.20175>;
      <D.20174>:
      D.20176 = mono_domain_get ();
      D.20177 = mono_string_new (D.20176, name);
      params[0] = D.20177;
      goto <D.20178>;
      <D.20175>:
      params[0] = tb;
      <D.20178>:
      method.21 = method;
      D.20163 = domain->domain;
      D.20173 = mono_runtime_invoke (method.21, D.20163, &params, 0B);
      return D.20173;
    }
  finally
    {
      params = {CLOBBER};
    }
}


mono_domain_owns_vtable_slot (struct MonoDomain * domain, void * vtable_slot)
{
  union mono_mutex_t * D.20181;
  _Bool D.20184;
  long int D.20185;
  long int D.20186;
  struct MonoMemPool * D.20189;
  _Bool D.20192;
  long int D.20193;
  long int D.20194;
  mono_bool D.20197;
  gboolean res;

  {
    int ret;

    D.20181 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.20181);
    if (ret != 0) goto <D.20182>; else goto <D.20183>;
    <D.20182>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20183>:
    D.20184 = ret != 0;
    D.20185 = (long int) D.20184;
    D.20186 = __builtin_expect (D.20185, 0);
    if (D.20186 != 0) goto <D.20187>; else goto <D.20188>;
    <D.20187>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 564, "ret == 0");
    <D.20188>:
  }
  D.20189 = domain->mp;
  res = mono_mempool_contains_addr (D.20189, vtable_slot);
  {
    int ret;

    D.20181 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.20181);
    if (ret != 0) goto <D.20190>; else goto <D.20191>;
    <D.20190>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20191>:
    D.20192 = ret != 0;
    D.20193 = (long int) D.20192;
    D.20194 = __builtin_expect (D.20193, 0);
    if (D.20194 != 0) goto <D.20195>; else goto <D.20196>;
    <D.20195>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 566, "ret == 0");
    <D.20196>:
  }
  D.20197 = res;
  return D.20197;
}


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

  if (force == 0) goto <D.20199>; else goto <D.20200>;
  <D.20199>:
  D.20201 = domain->state;
  if (D.20201 == 3) goto <D.20202>; else goto <D.20203>;
  <D.20202>:
  D.20204 = 0;
  return D.20204;
  <D.20203>:
  <D.20200>:
  mono_domain_set_internal (domain);
  D.20204 = 1;
  return D.20204;
}


ves_icall_System_AppDomain_GetData (struct MonoAppDomain * ad, struct MonoString * name)
{
  _Bool D.20206;
  long int D.20207;
  long int D.20208;
  _Bool D.20211;
  long int D.20212;
  long int D.20213;
  struct MonoException * D.20218;
  union mono_mutex_t * D.20219;
  _Bool D.20222;
  long int D.20223;
  long int D.20224;
  int D.18966;
  int iftmp.23;
  int D.18965;
  const char[8] * D.20230;
  unsigned char D.20231;
  int D.20232;
  unsigned char D.20233;
  int D.20234;
  const unsigned char * D.20239;
  unsigned char D.20240;
  int D.20241;
  const unsigned char * D.20242;
  unsigned char D.20243;
  int D.20244;
  const unsigned char * D.20249;
  unsigned char D.20250;
  int D.20251;
  const unsigned char * D.20252;
  unsigned char D.20253;
  int D.20254;
  const unsigned char * D.20259;
  unsigned char D.20260;
  int D.20261;
  const unsigned char * D.20262;
  unsigned char D.20263;
  int D.20264;
  struct MonoAppDomainSetup * D.20268;
  int D.18975;
  int iftmp.24;
  int D.18974;
  const char[16] * D.20273;
  unsigned char D.20274;
  int D.20275;
  unsigned char D.20276;
  int D.20277;
  const unsigned char * D.20282;
  unsigned char D.20283;
  int D.20284;
  const unsigned char * D.20285;
  unsigned char D.20286;
  int D.20287;
  const unsigned char * D.20292;
  unsigned char D.20293;
  int D.20294;
  const unsigned char * D.20295;
  unsigned char D.20296;
  int D.20297;
  const unsigned char * D.20302;
  unsigned char D.20303;
  int D.20304;
  const unsigned char * D.20305;
  unsigned char D.20306;
  int D.20307;
  int D.18984;
  int iftmp.25;
  int D.18983;
  const char[13] * D.20315;
  unsigned char D.20316;
  int D.20317;
  unsigned char D.20318;
  int D.20319;
  const unsigned char * D.20324;
  unsigned char D.20325;
  int D.20326;
  const unsigned char * D.20327;
  unsigned char D.20328;
  int D.20329;
  const unsigned char * D.20334;
  unsigned char D.20335;
  int D.20336;
  const unsigned char * D.20337;
  unsigned char D.20338;
  int D.20339;
  const unsigned char * D.20344;
  unsigned char D.20345;
  int D.20346;
  const unsigned char * D.20347;
  unsigned char D.20348;
  int D.20349;
  int D.18993;
  int iftmp.26;
  int D.18992;
  const char[9] * D.20357;
  unsigned char D.20358;
  int D.20359;
  unsigned char D.20360;
  int D.20361;
  const unsigned char * D.20366;
  unsigned char D.20367;
  int D.20368;
  const unsigned char * D.20369;
  unsigned char D.20370;
  int D.20371;
  const unsigned char * D.20376;
  unsigned char D.20377;
  int D.20378;
  const unsigned char * D.20379;
  unsigned char D.20380;
  int D.20381;
  const unsigned char * D.20386;
  unsigned char D.20387;
  int D.20388;
  const unsigned char * D.20389;
  unsigned char D.20390;
  int D.20391;
  int D.19002;
  int iftmp.27;
  int D.19001;
  const char[11] * D.20399;
  unsigned char D.20400;
  int D.20401;
  unsigned char D.20402;
  int D.20403;
  const unsigned char * D.20408;
  unsigned char D.20409;
  int D.20410;
  const unsigned char * D.20411;
  unsigned char D.20412;
  int D.20413;
  const unsigned char * D.20418;
  unsigned char D.20419;
  int D.20420;
  const unsigned char * D.20421;
  unsigned char D.20422;
  int D.20423;
  const unsigned char * D.20428;
  unsigned char D.20429;
  int D.20430;
  const unsigned char * D.20431;
  unsigned char D.20432;
  int D.20433;
  int D.19011;
  int iftmp.28;
  int D.19010;
  const char[16] * D.20441;
  unsigned char D.20442;
  int D.20443;
  unsigned char D.20444;
  int D.20445;
  const unsigned char * D.20450;
  unsigned char D.20451;
  int D.20452;
  const unsigned char * D.20453;
  unsigned char D.20454;
  int D.20455;
  const unsigned char * D.20460;
  unsigned char D.20461;
  int D.20462;
  const unsigned char * D.20463;
  unsigned char D.20464;
  int D.20465;
  const unsigned char * D.20470;
  unsigned char D.20471;
  int D.20472;
  const unsigned char * D.20473;
  unsigned char D.20474;
  int D.20475;
  int D.19020;
  int iftmp.29;
  int D.19019;
  const char[19] * D.20483;
  unsigned char D.20484;
  int D.20485;
  unsigned char D.20486;
  int D.20487;
  const unsigned char * D.20492;
  unsigned char D.20493;
  int D.20494;
  const unsigned char * D.20495;
  unsigned char D.20496;
  int D.20497;
  const unsigned char * D.20502;
  unsigned char D.20503;
  int D.20504;
  const unsigned char * D.20505;
  unsigned char D.20506;
  int D.20507;
  const unsigned char * D.20512;
  unsigned char D.20513;
  int D.20514;
  const unsigned char * D.20515;
  unsigned char D.20516;
  int D.20517;
  int D.19029;
  int iftmp.30;
  int D.19028;
  const char[17] * D.20525;
  unsigned char D.20526;
  int D.20527;
  unsigned char D.20528;
  int D.20529;
  const unsigned char * D.20534;
  unsigned char D.20535;
  int D.20536;
  const unsigned char * D.20537;
  unsigned char D.20538;
  int D.20539;
  const unsigned char * D.20544;
  unsigned char D.20545;
  int D.20546;
  const unsigned char * D.20547;
  unsigned char D.20548;
  int D.20549;
  const unsigned char * D.20554;
  unsigned char D.20555;
  int D.20556;
  const unsigned char * D.20557;
  unsigned char D.20558;
  int D.20559;
  int D.19038;
  int iftmp.31;
  int D.19037;
  const char[20] * D.20567;
  unsigned char D.20568;
  int D.20569;
  unsigned char D.20570;
  int D.20571;
  const unsigned char * D.20576;
  unsigned char D.20577;
  int D.20578;
  const unsigned char * D.20579;
  unsigned char D.20580;
  int D.20581;
  const unsigned char * D.20586;
  unsigned char D.20587;
  int D.20588;
  const unsigned char * D.20589;
  unsigned char D.20590;
  int D.20591;
  const unsigned char * D.20596;
  unsigned char D.20597;
  int D.20598;
  const unsigned char * D.20599;
  unsigned char D.20600;
  int D.20601;
  struct MonoGHashTable * D.20606;
  _Bool D.20609;
  long int D.20610;
  long int D.20611;
  struct MonoObject * D.20616;
  struct MonoDomain * add;
  struct MonoObject * o;
  char * str;

  D.20206 = ad == 0B;
  D.20207 = (long int) D.20206;
  D.20208 = __builtin_expect (D.20207, 0);
  if (D.20208 != 0) goto <D.20209>; else goto <D.20210>;
  <D.20209>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 602, "ad != NULL");
  <D.20210>:
  add = ad->data;
  D.20211 = add == 0B;
  D.20212 = (long int) D.20211;
  D.20213 = __builtin_expect (D.20212, 0);
  if (D.20213 != 0) goto <D.20214>; else goto <D.20215>;
  <D.20214>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 604, "add != NULL");
  <D.20215>:
  if (name == 0B) goto <D.20216>; else goto <D.20217>;
  <D.20216>:
  D.20218 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.20218);
  <D.20217>:
  str = mono_string_to_utf8 (name);
  {
    int ret;

    D.20219 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.20219);
    if (ret != 0) goto <D.20220>; else goto <D.20221>;
    <D.20220>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20221>:
    D.20222 = ret != 0;
    D.20223 = (long int) D.20222;
    D.20224 = __builtin_expect (D.20223, 0);
    if (D.20224 != 0) goto <D.20225>; else goto <D.20226>;
    <D.20225>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 611, "ret == 0");
    <D.20226>:
  }
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20230 = "APPBASE";
      D.20231 = MEM[(const unsigned char *)D.20230];
      D.20232 = (int) D.20231;
      D.20233 = *__s2;
      D.20234 = (int) D.20233;
      __result = D.20232 - D.20234;
      {
        if (__s2_len != 0) goto <D.20235>; else goto <D.20236>;
        <D.20235>:
        if (__result == 0) goto <D.20237>; else goto <D.20238>;
        <D.20237>:
        D.20239 = &MEM[(void *)"APPBASE" + 1B];
        D.20240 = *D.20239;
        D.20241 = (int) D.20240;
        D.20242 = __s2 + 1;
        D.20243 = *D.20242;
        D.20244 = (int) D.20243;
        __result = D.20241 - D.20244;
        if (__s2_len > 1) goto <D.20245>; else goto <D.20246>;
        <D.20245>:
        if (__result == 0) goto <D.20247>; else goto <D.20248>;
        <D.20247>:
        D.20249 = &MEM[(void *)"APPBASE" + 2B];
        D.20250 = *D.20249;
        D.20251 = (int) D.20250;
        D.20252 = __s2 + 2;
        D.20253 = *D.20252;
        D.20254 = (int) D.20253;
        __result = D.20251 - D.20254;
        if (__s2_len > 2) goto <D.20255>; else goto <D.20256>;
        <D.20255>:
        if (__result == 0) goto <D.20257>; else goto <D.20258>;
        <D.20257>:
        D.20259 = &MEM[(void *)"APPBASE" + 3B];
        D.20260 = *D.20259;
        D.20261 = (int) D.20260;
        D.20262 = __s2 + 3;
        D.20263 = *D.20262;
        D.20264 = (int) D.20263;
        __result = D.20261 - D.20264;
        <D.20258>:
        <D.20256>:
        <D.20248>:
        <D.20246>:
        <D.20238>:
        <D.20236>:
      }
      D.18965 = __result;
    }
    iftmp.23 = -D.18965;
    goto <D.20265>;
    <D.20229>:
    iftmp.23 = __builtin_strcmp (str, "APPBASE");
    <D.20265>:
    D.18966 = iftmp.23;
  }
  if (D.18966 == 0) goto <D.20266>; else goto <D.20267>;
  <D.20266>:
  D.20268 = add->setup;
  o = D.20268->application_base;
  goto <D.20269>;
  <D.20267>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20273 = "APP_CONFIG_FILE";
      D.20274 = MEM[(const unsigned char *)D.20273];
      D.20275 = (int) D.20274;
      D.20276 = *__s2;
      D.20277 = (int) D.20276;
      __result = D.20275 - D.20277;
      {
        if (__s2_len != 0) goto <D.20278>; else goto <D.20279>;
        <D.20278>:
        if (__result == 0) goto <D.20280>; else goto <D.20281>;
        <D.20280>:
        D.20282 = &MEM[(void *)"APP_CONFIG_FILE" + 1B];
        D.20283 = *D.20282;
        D.20284 = (int) D.20283;
        D.20285 = __s2 + 1;
        D.20286 = *D.20285;
        D.20287 = (int) D.20286;
        __result = D.20284 - D.20287;
        if (__s2_len > 1) goto <D.20288>; else goto <D.20289>;
        <D.20288>:
        if (__result == 0) goto <D.20290>; else goto <D.20291>;
        <D.20290>:
        D.20292 = &MEM[(void *)"APP_CONFIG_FILE" + 2B];
        D.20293 = *D.20292;
        D.20294 = (int) D.20293;
        D.20295 = __s2 + 2;
        D.20296 = *D.20295;
        D.20297 = (int) D.20296;
        __result = D.20294 - D.20297;
        if (__s2_len > 2) goto <D.20298>; else goto <D.20299>;
        <D.20298>:
        if (__result == 0) goto <D.20300>; else goto <D.20301>;
        <D.20300>:
        D.20302 = &MEM[(void *)"APP_CONFIG_FILE" + 3B];
        D.20303 = *D.20302;
        D.20304 = (int) D.20303;
        D.20305 = __s2 + 3;
        D.20306 = *D.20305;
        D.20307 = (int) D.20306;
        __result = D.20304 - D.20307;
        <D.20301>:
        <D.20299>:
        <D.20291>:
        <D.20289>:
        <D.20281>:
        <D.20279>:
      }
      D.18974 = __result;
    }
    iftmp.24 = -D.18974;
    goto <D.20308>;
    <D.20272>:
    iftmp.24 = __builtin_strcmp (str, "APP_CONFIG_FILE");
    <D.20308>:
    D.18975 = iftmp.24;
  }
  if (D.18975 == 0) goto <D.20309>; else goto <D.20310>;
  <D.20309>:
  D.20268 = add->setup;
  o = D.20268->configuration_file;
  goto <D.20311>;
  <D.20310>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20315 = "DYNAMIC_BASE";
      D.20316 = MEM[(const unsigned char *)D.20315];
      D.20317 = (int) D.20316;
      D.20318 = *__s2;
      D.20319 = (int) D.20318;
      __result = D.20317 - D.20319;
      {
        if (__s2_len != 0) goto <D.20320>; else goto <D.20321>;
        <D.20320>:
        if (__result == 0) goto <D.20322>; else goto <D.20323>;
        <D.20322>:
        D.20324 = &MEM[(void *)"DYNAMIC_BASE" + 1B];
        D.20325 = *D.20324;
        D.20326 = (int) D.20325;
        D.20327 = __s2 + 1;
        D.20328 = *D.20327;
        D.20329 = (int) D.20328;
        __result = D.20326 - D.20329;
        if (__s2_len > 1) goto <D.20330>; else goto <D.20331>;
        <D.20330>:
        if (__result == 0) goto <D.20332>; else goto <D.20333>;
        <D.20332>:
        D.20334 = &MEM[(void *)"DYNAMIC_BASE" + 2B];
        D.20335 = *D.20334;
        D.20336 = (int) D.20335;
        D.20337 = __s2 + 2;
        D.20338 = *D.20337;
        D.20339 = (int) D.20338;
        __result = D.20336 - D.20339;
        if (__s2_len > 2) goto <D.20340>; else goto <D.20341>;
        <D.20340>:
        if (__result == 0) goto <D.20342>; else goto <D.20343>;
        <D.20342>:
        D.20344 = &MEM[(void *)"DYNAMIC_BASE" + 3B];
        D.20345 = *D.20344;
        D.20346 = (int) D.20345;
        D.20347 = __s2 + 3;
        D.20348 = *D.20347;
        D.20349 = (int) D.20348;
        __result = D.20346 - D.20349;
        <D.20343>:
        <D.20341>:
        <D.20333>:
        <D.20331>:
        <D.20323>:
        <D.20321>:
      }
      D.18983 = __result;
    }
    iftmp.25 = -D.18983;
    goto <D.20350>;
    <D.20314>:
    iftmp.25 = __builtin_strcmp (str, "DYNAMIC_BASE");
    <D.20350>:
    D.18984 = iftmp.25;
  }
  if (D.18984 == 0) goto <D.20351>; else goto <D.20352>;
  <D.20351>:
  D.20268 = add->setup;
  o = D.20268->dynamic_base;
  goto <D.20353>;
  <D.20352>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20357 = "APP_NAME";
      D.20358 = MEM[(const unsigned char *)D.20357];
      D.20359 = (int) D.20358;
      D.20360 = *__s2;
      D.20361 = (int) D.20360;
      __result = D.20359 - D.20361;
      {
        if (__s2_len != 0) goto <D.20362>; else goto <D.20363>;
        <D.20362>:
        if (__result == 0) goto <D.20364>; else goto <D.20365>;
        <D.20364>:
        D.20366 = &MEM[(void *)"APP_NAME" + 1B];
        D.20367 = *D.20366;
        D.20368 = (int) D.20367;
        D.20369 = __s2 + 1;
        D.20370 = *D.20369;
        D.20371 = (int) D.20370;
        __result = D.20368 - D.20371;
        if (__s2_len > 1) goto <D.20372>; else goto <D.20373>;
        <D.20372>:
        if (__result == 0) goto <D.20374>; else goto <D.20375>;
        <D.20374>:
        D.20376 = &MEM[(void *)"APP_NAME" + 2B];
        D.20377 = *D.20376;
        D.20378 = (int) D.20377;
        D.20379 = __s2 + 2;
        D.20380 = *D.20379;
        D.20381 = (int) D.20380;
        __result = D.20378 - D.20381;
        if (__s2_len > 2) goto <D.20382>; else goto <D.20383>;
        <D.20382>:
        if (__result == 0) goto <D.20384>; else goto <D.20385>;
        <D.20384>:
        D.20386 = &MEM[(void *)"APP_NAME" + 3B];
        D.20387 = *D.20386;
        D.20388 = (int) D.20387;
        D.20389 = __s2 + 3;
        D.20390 = *D.20389;
        D.20391 = (int) D.20390;
        __result = D.20388 - D.20391;
        <D.20385>:
        <D.20383>:
        <D.20375>:
        <D.20373>:
        <D.20365>:
        <D.20363>:
      }
      D.18992 = __result;
    }
    iftmp.26 = -D.18992;
    goto <D.20392>;
    <D.20356>:
    iftmp.26 = __builtin_strcmp (str, "APP_NAME");
    <D.20392>:
    D.18993 = iftmp.26;
  }
  if (D.18993 == 0) goto <D.20393>; else goto <D.20394>;
  <D.20393>:
  D.20268 = add->setup;
  o = D.20268->application_name;
  goto <D.20395>;
  <D.20394>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20399 = "CACHE_BASE";
      D.20400 = MEM[(const unsigned char *)D.20399];
      D.20401 = (int) D.20400;
      D.20402 = *__s2;
      D.20403 = (int) D.20402;
      __result = D.20401 - D.20403;
      {
        if (__s2_len != 0) goto <D.20404>; else goto <D.20405>;
        <D.20404>:
        if (__result == 0) goto <D.20406>; else goto <D.20407>;
        <D.20406>:
        D.20408 = &MEM[(void *)"CACHE_BASE" + 1B];
        D.20409 = *D.20408;
        D.20410 = (int) D.20409;
        D.20411 = __s2 + 1;
        D.20412 = *D.20411;
        D.20413 = (int) D.20412;
        __result = D.20410 - D.20413;
        if (__s2_len > 1) goto <D.20414>; else goto <D.20415>;
        <D.20414>:
        if (__result == 0) goto <D.20416>; else goto <D.20417>;
        <D.20416>:
        D.20418 = &MEM[(void *)"CACHE_BASE" + 2B];
        D.20419 = *D.20418;
        D.20420 = (int) D.20419;
        D.20421 = __s2 + 2;
        D.20422 = *D.20421;
        D.20423 = (int) D.20422;
        __result = D.20420 - D.20423;
        if (__s2_len > 2) goto <D.20424>; else goto <D.20425>;
        <D.20424>:
        if (__result == 0) goto <D.20426>; else goto <D.20427>;
        <D.20426>:
        D.20428 = &MEM[(void *)"CACHE_BASE" + 3B];
        D.20429 = *D.20428;
        D.20430 = (int) D.20429;
        D.20431 = __s2 + 3;
        D.20432 = *D.20431;
        D.20433 = (int) D.20432;
        __result = D.20430 - D.20433;
        <D.20427>:
        <D.20425>:
        <D.20417>:
        <D.20415>:
        <D.20407>:
        <D.20405>:
      }
      D.19001 = __result;
    }
    iftmp.27 = -D.19001;
    goto <D.20434>;
    <D.20398>:
    iftmp.27 = __builtin_strcmp (str, "CACHE_BASE");
    <D.20434>:
    D.19002 = iftmp.27;
  }
  if (D.19002 == 0) goto <D.20435>; else goto <D.20436>;
  <D.20435>:
  D.20268 = add->setup;
  o = D.20268->cache_path;
  goto <D.20437>;
  <D.20436>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20441 = "PRIVATE_BINPATH";
      D.20442 = MEM[(const unsigned char *)D.20441];
      D.20443 = (int) D.20442;
      D.20444 = *__s2;
      D.20445 = (int) D.20444;
      __result = D.20443 - D.20445;
      {
        if (__s2_len != 0) goto <D.20446>; else goto <D.20447>;
        <D.20446>:
        if (__result == 0) goto <D.20448>; else goto <D.20449>;
        <D.20448>:
        D.20450 = &MEM[(void *)"PRIVATE_BINPATH" + 1B];
        D.20451 = *D.20450;
        D.20452 = (int) D.20451;
        D.20453 = __s2 + 1;
        D.20454 = *D.20453;
        D.20455 = (int) D.20454;
        __result = D.20452 - D.20455;
        if (__s2_len > 1) goto <D.20456>; else goto <D.20457>;
        <D.20456>:
        if (__result == 0) goto <D.20458>; else goto <D.20459>;
        <D.20458>:
        D.20460 = &MEM[(void *)"PRIVATE_BINPATH" + 2B];
        D.20461 = *D.20460;
        D.20462 = (int) D.20461;
        D.20463 = __s2 + 2;
        D.20464 = *D.20463;
        D.20465 = (int) D.20464;
        __result = D.20462 - D.20465;
        if (__s2_len > 2) goto <D.20466>; else goto <D.20467>;
        <D.20466>:
        if (__result == 0) goto <D.20468>; else goto <D.20469>;
        <D.20468>:
        D.20470 = &MEM[(void *)"PRIVATE_BINPATH" + 3B];
        D.20471 = *D.20470;
        D.20472 = (int) D.20471;
        D.20473 = __s2 + 3;
        D.20474 = *D.20473;
        D.20475 = (int) D.20474;
        __result = D.20472 - D.20475;
        <D.20469>:
        <D.20467>:
        <D.20459>:
        <D.20457>:
        <D.20449>:
        <D.20447>:
      }
      D.19010 = __result;
    }
    iftmp.28 = -D.19010;
    goto <D.20476>;
    <D.20440>:
    iftmp.28 = __builtin_strcmp (str, "PRIVATE_BINPATH");
    <D.20476>:
    D.19011 = iftmp.28;
  }
  if (D.19011 == 0) goto <D.20477>; else goto <D.20478>;
  <D.20477>:
  D.20268 = add->setup;
  o = D.20268->private_bin_path;
  goto <D.20479>;
  <D.20478>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20483 = "BINPATH_PROBE_ONLY";
      D.20484 = MEM[(const unsigned char *)D.20483];
      D.20485 = (int) D.20484;
      D.20486 = *__s2;
      D.20487 = (int) D.20486;
      __result = D.20485 - D.20487;
      {
        if (__s2_len != 0) goto <D.20488>; else goto <D.20489>;
        <D.20488>:
        if (__result == 0) goto <D.20490>; else goto <D.20491>;
        <D.20490>:
        D.20492 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 1B];
        D.20493 = *D.20492;
        D.20494 = (int) D.20493;
        D.20495 = __s2 + 1;
        D.20496 = *D.20495;
        D.20497 = (int) D.20496;
        __result = D.20494 - D.20497;
        if (__s2_len > 1) goto <D.20498>; else goto <D.20499>;
        <D.20498>:
        if (__result == 0) goto <D.20500>; else goto <D.20501>;
        <D.20500>:
        D.20502 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 2B];
        D.20503 = *D.20502;
        D.20504 = (int) D.20503;
        D.20505 = __s2 + 2;
        D.20506 = *D.20505;
        D.20507 = (int) D.20506;
        __result = D.20504 - D.20507;
        if (__s2_len > 2) goto <D.20508>; else goto <D.20509>;
        <D.20508>:
        if (__result == 0) goto <D.20510>; else goto <D.20511>;
        <D.20510>:
        D.20512 = &MEM[(void *)"BINPATH_PROBE_ONLY" + 3B];
        D.20513 = *D.20512;
        D.20514 = (int) D.20513;
        D.20515 = __s2 + 3;
        D.20516 = *D.20515;
        D.20517 = (int) D.20516;
        __result = D.20514 - D.20517;
        <D.20511>:
        <D.20509>:
        <D.20501>:
        <D.20499>:
        <D.20491>:
        <D.20489>:
      }
      D.19019 = __result;
    }
    iftmp.29 = -D.19019;
    goto <D.20518>;
    <D.20482>:
    iftmp.29 = __builtin_strcmp (str, "BINPATH_PROBE_ONLY");
    <D.20518>:
    D.19020 = iftmp.29;
  }
  if (D.19020 == 0) goto <D.20519>; else goto <D.20520>;
  <D.20519>:
  D.20268 = add->setup;
  o = D.20268->private_bin_path_probe;
  goto <D.20521>;
  <D.20520>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20525 = "SHADOW_COPY_DIRS";
      D.20526 = MEM[(const unsigned char *)D.20525];
      D.20527 = (int) D.20526;
      D.20528 = *__s2;
      D.20529 = (int) D.20528;
      __result = D.20527 - D.20529;
      {
        if (__s2_len != 0) goto <D.20530>; else goto <D.20531>;
        <D.20530>:
        if (__result == 0) goto <D.20532>; else goto <D.20533>;
        <D.20532>:
        D.20534 = &MEM[(void *)"SHADOW_COPY_DIRS" + 1B];
        D.20535 = *D.20534;
        D.20536 = (int) D.20535;
        D.20537 = __s2 + 1;
        D.20538 = *D.20537;
        D.20539 = (int) D.20538;
        __result = D.20536 - D.20539;
        if (__s2_len > 1) goto <D.20540>; else goto <D.20541>;
        <D.20540>:
        if (__result == 0) goto <D.20542>; else goto <D.20543>;
        <D.20542>:
        D.20544 = &MEM[(void *)"SHADOW_COPY_DIRS" + 2B];
        D.20545 = *D.20544;
        D.20546 = (int) D.20545;
        D.20547 = __s2 + 2;
        D.20548 = *D.20547;
        D.20549 = (int) D.20548;
        __result = D.20546 - D.20549;
        if (__s2_len > 2) goto <D.20550>; else goto <D.20551>;
        <D.20550>:
        if (__result == 0) goto <D.20552>; else goto <D.20553>;
        <D.20552>:
        D.20554 = &MEM[(void *)"SHADOW_COPY_DIRS" + 3B];
        D.20555 = *D.20554;
        D.20556 = (int) D.20555;
        D.20557 = __s2 + 3;
        D.20558 = *D.20557;
        D.20559 = (int) D.20558;
        __result = D.20556 - D.20559;
        <D.20553>:
        <D.20551>:
        <D.20543>:
        <D.20541>:
        <D.20533>:
        <D.20531>:
      }
      D.19028 = __result;
    }
    iftmp.30 = -D.19028;
    goto <D.20560>;
    <D.20524>:
    iftmp.30 = __builtin_strcmp (str, "SHADOW_COPY_DIRS");
    <D.20560>:
    D.19029 = iftmp.30;
  }
  if (D.19029 == 0) goto <D.20561>; else goto <D.20562>;
  <D.20561>:
  D.20268 = add->setup;
  o = D.20268->shadow_copy_directories;
  goto <D.20563>;
  <D.20562>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = str;
      D.20567 = "FORCE_CACHE_INSTALL";
      D.20568 = MEM[(const unsigned char *)D.20567];
      D.20569 = (int) D.20568;
      D.20570 = *__s2;
      D.20571 = (int) D.20570;
      __result = D.20569 - D.20571;
      {
        if (__s2_len != 0) goto <D.20572>; else goto <D.20573>;
        <D.20572>:
        if (__result == 0) goto <D.20574>; else goto <D.20575>;
        <D.20574>:
        D.20576 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 1B];
        D.20577 = *D.20576;
        D.20578 = (int) D.20577;
        D.20579 = __s2 + 1;
        D.20580 = *D.20579;
        D.20581 = (int) D.20580;
        __result = D.20578 - D.20581;
        if (__s2_len > 1) goto <D.20582>; else goto <D.20583>;
        <D.20582>:
        if (__result == 0) goto <D.20584>; else goto <D.20585>;
        <D.20584>:
        D.20586 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 2B];
        D.20587 = *D.20586;
        D.20588 = (int) D.20587;
        D.20589 = __s2 + 2;
        D.20590 = *D.20589;
        D.20591 = (int) D.20590;
        __result = D.20588 - D.20591;
        if (__s2_len > 2) goto <D.20592>; else goto <D.20593>;
        <D.20592>:
        if (__result == 0) goto <D.20594>; else goto <D.20595>;
        <D.20594>:
        D.20596 = &MEM[(void *)"FORCE_CACHE_INSTALL" + 3B];
        D.20597 = *D.20596;
        D.20598 = (int) D.20597;
        D.20599 = __s2 + 3;
        D.20600 = *D.20599;
        D.20601 = (int) D.20600;
        __result = D.20598 - D.20601;
        <D.20595>:
        <D.20593>:
        <D.20585>:
        <D.20583>:
        <D.20575>:
        <D.20573>:
      }
      D.19037 = __result;
    }
    iftmp.31 = -D.19037;
    goto <D.20602>;
    <D.20566>:
    iftmp.31 = __builtin_strcmp (str, "FORCE_CACHE_INSTALL");
    <D.20602>:
    D.19038 = iftmp.31;
  }
  if (D.19038 == 0) goto <D.20603>; else goto <D.20604>;
  <D.20603>:
  D.20268 = add->setup;
  o = D.20268->shadow_copy_files;
  goto <D.20605>;
  <D.20604>:
  D.20606 = add->env;
  o = mono_g_hash_table_lookup (D.20606, name);
  <D.20605>:
  <D.20563>:
  <D.20521>:
  <D.20479>:
  <D.20437>:
  <D.20395>:
  <D.20353>:
  <D.20311>:
  <D.20269>:
  {
    int ret;

    D.20219 = &add->lock.mutex;
    ret = pthread_mutex_unlock (D.20219);
    if (ret != 0) goto <D.20607>; else goto <D.20608>;
    <D.20607>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20608>:
    D.20609 = ret != 0;
    D.20610 = (long int) D.20609;
    D.20611 = __builtin_expect (D.20610, 0);
    if (D.20611 != 0) goto <D.20612>; else goto <D.20613>;
    <D.20612>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 634, "ret == 0");
    <D.20613>:
  }
  monoeg_g_free (str);
  if (o == 0B) goto <D.20614>; else goto <D.20615>;
  <D.20614>:
  D.20616 = 0B;
  return D.20616;
  <D.20615>:
  D.20616 = o;
  return D.20616;
}


ves_icall_System_AppDomain_SetData (struct MonoAppDomain * ad, struct MonoString * name, struct MonoObject * data)
{
  _Bool D.20618;
  long int D.20619;
  long int D.20620;
  _Bool D.20623;
  long int D.20624;
  long int D.20625;
  struct MonoException * D.20630;
  union mono_mutex_t * D.20631;
  _Bool D.20634;
  long int D.20635;
  long int D.20636;
  struct MonoGHashTable * D.20639;
  _Bool D.20642;
  long int D.20643;
  long int D.20644;
  struct MonoDomain * add;

  D.20618 = ad == 0B;
  D.20619 = (long int) D.20618;
  D.20620 = __builtin_expect (D.20619, 0);
  if (D.20620 != 0) goto <D.20621>; else goto <D.20622>;
  <D.20621>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 650, "ad != NULL");
  <D.20622>:
  add = ad->data;
  D.20623 = add == 0B;
  D.20624 = (long int) D.20623;
  D.20625 = __builtin_expect (D.20624, 0);
  if (D.20625 != 0) goto <D.20626>; else goto <D.20627>;
  <D.20626>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 652, "add != NULL");
  <D.20627>:
  if (name == 0B) goto <D.20628>; else goto <D.20629>;
  <D.20628>:
  D.20630 = mono_get_exception_argument_null ("name");
  mono_raise_exception (D.20630);
  <D.20629>:
  {
    int ret;

    D.20631 = &add->lock.mutex;
    ret = pthread_mutex_lock (D.20631);
    if (ret != 0) goto <D.20632>; else goto <D.20633>;
    <D.20632>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20633>:
    D.20634 = ret != 0;
    D.20635 = (long int) D.20634;
    D.20636 = __builtin_expect (D.20635, 0);
    if (D.20636 != 0) goto <D.20637>; else goto <D.20638>;
    <D.20637>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 657, "ret == 0");
    <D.20638>:
  }
  D.20639 = add->env;
  mono_g_hash_table_insert (D.20639, name, data);
  {
    int ret;

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


ves_icall_System_AppDomain_getSetup (struct MonoAppDomain * ad)
{
  _Bool D.20647;
  long int D.20648;
  long int D.20649;
  struct MonoDomain * D.20652;
  _Bool D.20653;
  long int D.20654;
  long int D.20655;
  struct MonoAppDomainSetup * D.20658;

  D.20647 = ad == 0B;
  D.20648 = (long int) D.20647;
  D.20649 = __builtin_expect (D.20648, 0);
  if (D.20649 != 0) goto <D.20650>; else goto <D.20651>;
  <D.20650>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 669, "ad != NULL");
  <D.20651>:
  D.20652 = ad->data;
  D.20653 = D.20652 == 0B;
  D.20654 = (long int) D.20653;
  D.20655 = __builtin_expect (D.20654, 0);
  if (D.20655 != 0) goto <D.20656>; else goto <D.20657>;
  <D.20656>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 670, "ad->data != NULL");
  <D.20657>:
  D.20652 = ad->data;
  D.20658 = D.20652->setup;
  return D.20658;
}


ves_icall_System_AppDomain_getFriendlyName (struct MonoAppDomain * ad)
{
  _Bool D.20660;
  long int D.20661;
  long int D.20662;
  struct MonoDomain * D.20665;
  _Bool D.20666;
  long int D.20667;
  long int D.20668;
  struct MonoString * D.20671;
  char * D.20672;

  D.20660 = ad == 0B;
  D.20661 = (long int) D.20660;
  D.20662 = __builtin_expect (D.20661, 0);
  if (D.20662 != 0) goto <D.20663>; else goto <D.20664>;
  <D.20663>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 680, "ad != NULL");
  <D.20664>:
  D.20665 = ad->data;
  D.20666 = D.20665 == 0B;
  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", 681, "ad->data != NULL");
  <D.20670>:
  D.20665 = ad->data;
  D.20665 = ad->data;
  D.20672 = D.20665->friendly_name;
  D.20671 = mono_string_new (D.20665, D.20672);
  return D.20671;
}


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

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


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

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


mono_set_private_bin_path_from_config (struct MonoDomain * domain)
{
  struct MonoAppDomainSetup * D.20681;
  struct MonoString * D.20683;
  int D.20684;
  int D.20689;
  unsigned int len.32;
  gchar * text.33;
  char D.20695;
  gchar * D.20698;
  char D.20699;
  gchar * D.20702;
  char D.20703;
  sizetype offset.34;
  const gchar * D.20707;
  unsigned int offset.35;
  unsigned int D.20709;
  int D.20710;
  int D.20711;
  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.20678>; else goto <D.20680>;
      <D.20680>:
      D.20681 = domain->setup;
      if (D.20681 == 0B) goto <D.20678>; else goto <D.20682>;
      <D.20682>:
      D.20681 = domain->setup;
      D.20683 = D.20681->configuration_file;
      if (D.20683 == 0B) goto <D.20678>; else goto <D.20679>;
      <D.20678>:
      return;
      <D.20679>:
      D.20681 = domain->setup;
      D.20683 = D.20681->configuration_file;
      config_file_name = mono_string_to_utf8_checked (D.20683, &error);
      D.20684 = mono_error_ok (&error);
      if (D.20684 == 0) goto <D.20685>; else goto <D.20686>;
      <D.20685>:
      mono_error_cleanup (&error);
      goto free_and_out;
      <D.20686>:
      config_file_path = mono_portability_find_file (config_file_name, 1);
      if (config_file_path == 0B) goto <D.20687>; else goto <D.20688>;
      <D.20687>:
      config_file_path = config_file_name;
      <D.20688>:
      D.20689 = monoeg_g_file_get_contents (config_file_path, &text, &len, 0B);
      if (D.20689 == 0) goto free_and_out; else goto <D.20690>;
      <D.20690>:
      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.20692>; else goto <D.20693>;
      <D.20692>:
      text.33 = text;
      D.20695 = *text.33;
      if (D.20695 == -17) goto <D.20696>; else goto <D.20697>;
      <D.20696>:
      text.33 = text;
      D.20698 = text.33 + 1;
      D.20699 = *D.20698;
      if (D.20699 == -69) goto <D.20700>; else goto <D.20701>;
      <D.20700>:
      text.33 = text;
      D.20702 = text.33 + 2;
      D.20703 = *D.20702;
      if (D.20703 == -65) goto <D.20704>; else goto <D.20705>;
      <D.20704>:
      offset = 3;
      <D.20705>:
      <D.20701>:
      <D.20697>:
      <D.20693>:
      context = monoeg_g_markup_parse_context_new (&mono_parser, 0, &runtime_config, 0B);
      text.33 = text;
      offset.34 = (sizetype) offset;
      D.20707 = text.33 + offset.34;
      len.32 = len;
      offset.35 = (unsigned int) offset;
      D.20709 = len.32 - offset.35;
      D.20710 = (int) D.20709;
      D.20711 = monoeg_g_markup_parse_context_parse (context, D.20707, D.20710, 0B);
      if (D.20711 != 0) goto <D.20712>; else goto <D.20713>;
      <D.20712>:
      monoeg_g_markup_parse_context_end_parse (context, 0B);
      <D.20713>:
      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.20714>; else goto <D.20715>;
      <D.20714>:
      monoeg_g_free (config_file_name);
      <D.20715>:
      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.20723;
  const gchar * iftmp.37;
  gchar * D.20729;
  struct RuntimeConfig * state;
  const gchar * msg;
  const gchar * filename;

  state = user_data;
  if (state != 0B) goto <D.20722>; else goto <D.20720>;
  <D.20722>:
  D.20723 = state->filename;
  if (D.20723 != 0B) goto <D.20724>; else goto <D.20720>;
  <D.20724>:
  iftmp.36 = state->filename;
  goto <D.20721>;
  <D.20720>:
  iftmp.36 = "<unknown>";
  <D.20721>:
  filename = iftmp.36;
  if (error != 0B) goto <D.20728>; else goto <D.20726>;
  <D.20728>:
  D.20729 = error->message;
  if (D.20729 != 0B) goto <D.20730>; else goto <D.20726>;
  <D.20730>:
  iftmp.37 = error->message;
  goto <D.20727>;
  <D.20726>:
  iftmp.37 = "";
  <D.20727>:
  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.19129;
  int iftmp.38;
  int D.19128;
  const char[8] * D.20734;
  unsigned char D.20735;
  int D.20736;
  unsigned char D.20737;
  int D.20738;
  const unsigned char * D.20743;
  unsigned char D.20744;
  int D.20745;
  const unsigned char * D.20746;
  unsigned char D.20747;
  int D.20748;
  const unsigned char * D.20753;
  unsigned char D.20754;
  int D.20755;
  const unsigned char * D.20756;
  unsigned char D.20757;
  int D.20758;
  const unsigned char * D.20763;
  unsigned char D.20764;
  int D.20765;
  const unsigned char * D.20766;
  unsigned char D.20767;
  int D.20768;
  int D.20772;
  int D.20773;
  int D.19138;
  int iftmp.39;
  int D.19137;
  const char[16] * D.20778;
  unsigned char D.20779;
  int D.20780;
  unsigned char D.20781;
  int D.20782;
  const unsigned char * D.20787;
  unsigned char D.20788;
  int D.20789;
  const unsigned char * D.20790;
  unsigned char D.20791;
  int D.20792;
  const unsigned char * D.20797;
  unsigned char D.20798;
  int D.20799;
  const unsigned char * D.20800;
  unsigned char D.20801;
  int D.20802;
  const unsigned char * D.20807;
  unsigned char D.20808;
  int D.20809;
  const unsigned char * D.20810;
  unsigned char D.20811;
  int D.20812;
  int D.20816;
  int D.20817;
  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.20732>; else goto <D.20733>;
    <D.20732>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.20734 = "runtime";
      D.20735 = MEM[(const unsigned char *)D.20734];
      D.20736 = (int) D.20735;
      D.20737 = *__s2;
      D.20738 = (int) D.20737;
      __result = D.20736 - D.20738;
      {
        if (__s2_len != 0) goto <D.20739>; else goto <D.20740>;
        <D.20739>:
        if (__result == 0) goto <D.20741>; else goto <D.20742>;
        <D.20741>:
        D.20743 = &MEM[(void *)"runtime" + 1B];
        D.20744 = *D.20743;
        D.20745 = (int) D.20744;
        D.20746 = __s2 + 1;
        D.20747 = *D.20746;
        D.20748 = (int) D.20747;
        __result = D.20745 - D.20748;
        if (__s2_len > 1) goto <D.20749>; else goto <D.20750>;
        <D.20749>:
        if (__result == 0) goto <D.20751>; else goto <D.20752>;
        <D.20751>:
        D.20753 = &MEM[(void *)"runtime" + 2B];
        D.20754 = *D.20753;
        D.20755 = (int) D.20754;
        D.20756 = __s2 + 2;
        D.20757 = *D.20756;
        D.20758 = (int) D.20757;
        __result = D.20755 - D.20758;
        if (__s2_len > 2) goto <D.20759>; else goto <D.20760>;
        <D.20759>:
        if (__result == 0) goto <D.20761>; else goto <D.20762>;
        <D.20761>:
        D.20763 = &MEM[(void *)"runtime" + 3B];
        D.20764 = *D.20763;
        D.20765 = (int) D.20764;
        D.20766 = __s2 + 3;
        D.20767 = *D.20766;
        D.20768 = (int) D.20767;
        __result = D.20765 - D.20768;
        <D.20762>:
        <D.20760>:
        <D.20752>:
        <D.20750>:
        <D.20742>:
        <D.20740>:
      }
      D.19128 = __result;
    }
    iftmp.38 = -D.19128;
    goto <D.20769>;
    <D.20733>:
    iftmp.38 = __builtin_strcmp (element_name, "runtime");
    <D.20769>:
    D.19129 = iftmp.38;
  }
  if (D.19129 == 0) goto <D.20770>; else goto <D.20771>;
  <D.20770>:
  D.20772 = runtime_config->runtime_count;
  D.20773 = D.20772 + -1;
  runtime_config->runtime_count = D.20773;
  goto <D.20774>;
  <D.20771>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20778 = "assemblyBinding";
      D.20779 = MEM[(const unsigned char *)D.20778];
      D.20780 = (int) D.20779;
      D.20781 = *__s2;
      D.20782 = (int) D.20781;
      __result = D.20780 - D.20782;
      {
        if (__s2_len != 0) goto <D.20783>; else goto <D.20784>;
        <D.20783>:
        if (__result == 0) goto <D.20785>; else goto <D.20786>;
        <D.20785>:
        D.20787 = &MEM[(void *)"assemblyBinding" + 1B];
        D.20788 = *D.20787;
        D.20789 = (int) D.20788;
        D.20790 = __s2 + 1;
        D.20791 = *D.20790;
        D.20792 = (int) D.20791;
        __result = D.20789 - D.20792;
        if (__s2_len > 1) goto <D.20793>; else goto <D.20794>;
        <D.20793>:
        if (__result == 0) goto <D.20795>; else goto <D.20796>;
        <D.20795>:
        D.20797 = &MEM[(void *)"assemblyBinding" + 2B];
        D.20798 = *D.20797;
        D.20799 = (int) D.20798;
        D.20800 = __s2 + 2;
        D.20801 = *D.20800;
        D.20802 = (int) D.20801;
        __result = D.20799 - D.20802;
        if (__s2_len > 2) goto <D.20803>; else goto <D.20804>;
        <D.20803>:
        if (__result == 0) goto <D.20805>; else goto <D.20806>;
        <D.20805>:
        D.20807 = &MEM[(void *)"assemblyBinding" + 3B];
        D.20808 = *D.20807;
        D.20809 = (int) D.20808;
        D.20810 = __s2 + 3;
        D.20811 = *D.20810;
        D.20812 = (int) D.20811;
        __result = D.20809 - D.20812;
        <D.20806>:
        <D.20804>:
        <D.20796>:
        <D.20794>:
        <D.20786>:
        <D.20784>:
      }
      D.19137 = __result;
    }
    iftmp.39 = -D.19137;
    goto <D.20813>;
    <D.20777>:
    iftmp.39 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.20813>:
    D.19138 = iftmp.39;
  }
  if (D.19138 == 0) goto <D.20814>; else goto <D.20815>;
  <D.20814>:
  D.20816 = runtime_config->assemblybinding_count;
  D.20817 = D.20816 + -1;
  runtime_config->assemblybinding_count = D.20817;
  <D.20815>:
  <D.20774>:
}


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.19095;
  int iftmp.40;
  int D.19094;
  const char[8] * D.20821;
  unsigned char D.20822;
  int D.20823;
  unsigned char D.20824;
  int D.20825;
  const unsigned char * D.20830;
  unsigned char D.20831;
  int D.20832;
  const unsigned char * D.20833;
  unsigned char D.20834;
  int D.20835;
  const unsigned char * D.20840;
  unsigned char D.20841;
  int D.20842;
  const unsigned char * D.20843;
  unsigned char D.20844;
  int D.20845;
  const unsigned char * D.20850;
  unsigned char D.20851;
  int D.20852;
  const unsigned char * D.20853;
  unsigned char D.20854;
  int D.20855;
  int D.20859;
  int D.20860;
  int D.19104;
  int iftmp.41;
  int D.19103;
  const char[16] * D.20864;
  unsigned char D.20865;
  int D.20866;
  unsigned char D.20867;
  int D.20868;
  const unsigned char * D.20873;
  unsigned char D.20874;
  int D.20875;
  const unsigned char * D.20876;
  unsigned char D.20877;
  int D.20878;
  const unsigned char * D.20883;
  unsigned char D.20884;
  int D.20885;
  const unsigned char * D.20886;
  unsigned char D.20887;
  int D.20888;
  const unsigned char * D.20893;
  unsigned char D.20894;
  int D.20895;
  const unsigned char * D.20896;
  unsigned char D.20897;
  int D.20898;
  int D.20902;
  int D.20903;
  int D.19113;
  int iftmp.42;
  int D.19112;
  const char[8] * D.20910;
  unsigned char D.20911;
  int D.20912;
  unsigned char D.20913;
  int D.20914;
  const unsigned char * D.20919;
  unsigned char D.20920;
  int D.20921;
  const unsigned char * D.20922;
  unsigned char D.20923;
  int D.20924;
  const unsigned char * D.20929;
  unsigned char D.20930;
  int D.20931;
  const unsigned char * D.20932;
  unsigned char D.20933;
  int D.20934;
  const unsigned char * D.20939;
  unsigned char D.20940;
  int D.20941;
  const unsigned char * D.20942;
  unsigned char D.20943;
  int D.20944;
  struct MonoDomain * D.20948;
  gchar * D.20949;
  char * D.20950;
  char D.20953;
  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.20819>; else goto <D.20820>;
    <D.20819>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = element_name;
      D.20821 = "runtime";
      D.20822 = MEM[(const unsigned char *)D.20821];
      D.20823 = (int) D.20822;
      D.20824 = *__s2;
      D.20825 = (int) D.20824;
      __result = D.20823 - D.20825;
      {
        if (__s2_len != 0) goto <D.20826>; else goto <D.20827>;
        <D.20826>:
        if (__result == 0) goto <D.20828>; else goto <D.20829>;
        <D.20828>:
        D.20830 = &MEM[(void *)"runtime" + 1B];
        D.20831 = *D.20830;
        D.20832 = (int) D.20831;
        D.20833 = __s2 + 1;
        D.20834 = *D.20833;
        D.20835 = (int) D.20834;
        __result = D.20832 - D.20835;
        if (__s2_len > 1) goto <D.20836>; else goto <D.20837>;
        <D.20836>:
        if (__result == 0) goto <D.20838>; else goto <D.20839>;
        <D.20838>:
        D.20840 = &MEM[(void *)"runtime" + 2B];
        D.20841 = *D.20840;
        D.20842 = (int) D.20841;
        D.20843 = __s2 + 2;
        D.20844 = *D.20843;
        D.20845 = (int) D.20844;
        __result = D.20842 - D.20845;
        if (__s2_len > 2) goto <D.20846>; else goto <D.20847>;
        <D.20846>:
        if (__result == 0) goto <D.20848>; else goto <D.20849>;
        <D.20848>:
        D.20850 = &MEM[(void *)"runtime" + 3B];
        D.20851 = *D.20850;
        D.20852 = (int) D.20851;
        D.20853 = __s2 + 3;
        D.20854 = *D.20853;
        D.20855 = (int) D.20854;
        __result = D.20852 - D.20855;
        <D.20849>:
        <D.20847>:
        <D.20839>:
        <D.20837>:
        <D.20829>:
        <D.20827>:
      }
      D.19094 = __result;
    }
    iftmp.40 = -D.19094;
    goto <D.20856>;
    <D.20820>:
    iftmp.40 = __builtin_strcmp (element_name, "runtime");
    <D.20856>:
    D.19095 = iftmp.40;
  }
  if (D.19095 == 0) goto <D.20857>; else goto <D.20858>;
  <D.20857>:
  D.20859 = runtime_config->runtime_count;
  D.20860 = D.20859 + 1;
  runtime_config->runtime_count = D.20860;
  return;
  <D.20858>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20864 = "assemblyBinding";
      D.20865 = MEM[(const unsigned char *)D.20864];
      D.20866 = (int) D.20865;
      D.20867 = *__s2;
      D.20868 = (int) D.20867;
      __result = D.20866 - D.20868;
      {
        if (__s2_len != 0) goto <D.20869>; else goto <D.20870>;
        <D.20869>:
        if (__result == 0) goto <D.20871>; else goto <D.20872>;
        <D.20871>:
        D.20873 = &MEM[(void *)"assemblyBinding" + 1B];
        D.20874 = *D.20873;
        D.20875 = (int) D.20874;
        D.20876 = __s2 + 1;
        D.20877 = *D.20876;
        D.20878 = (int) D.20877;
        __result = D.20875 - D.20878;
        if (__s2_len > 1) goto <D.20879>; else goto <D.20880>;
        <D.20879>:
        if (__result == 0) goto <D.20881>; else goto <D.20882>;
        <D.20881>:
        D.20883 = &MEM[(void *)"assemblyBinding" + 2B];
        D.20884 = *D.20883;
        D.20885 = (int) D.20884;
        D.20886 = __s2 + 2;
        D.20887 = *D.20886;
        D.20888 = (int) D.20887;
        __result = D.20885 - D.20888;
        if (__s2_len > 2) goto <D.20889>; else goto <D.20890>;
        <D.20889>:
        if (__result == 0) goto <D.20891>; else goto <D.20892>;
        <D.20891>:
        D.20893 = &MEM[(void *)"assemblyBinding" + 3B];
        D.20894 = *D.20893;
        D.20895 = (int) D.20894;
        D.20896 = __s2 + 3;
        D.20897 = *D.20896;
        D.20898 = (int) D.20897;
        __result = D.20895 - D.20898;
        <D.20892>:
        <D.20890>:
        <D.20882>:
        <D.20880>:
        <D.20872>:
        <D.20870>:
      }
      D.19103 = __result;
    }
    iftmp.41 = -D.19103;
    goto <D.20899>;
    <D.20863>:
    iftmp.41 = __builtin_strcmp (element_name, "assemblyBinding");
    <D.20899>:
    D.19104 = iftmp.41;
  }
  if (D.19104 == 0) goto <D.20900>; else goto <D.20901>;
  <D.20900>:
  D.20902 = runtime_config->assemblybinding_count;
  D.20903 = D.20902 + 1;
  runtime_config->assemblybinding_count = D.20903;
  return;
  <D.20901>:
  D.20859 = runtime_config->runtime_count;
  if (D.20859 != 1) goto <D.20904>; else goto <D.20906>;
  <D.20906>:
  D.20902 = runtime_config->assemblybinding_count;
  if (D.20902 != 1) goto <D.20904>; else goto <D.20905>;
  <D.20904>:
  return;
  <D.20905>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = element_name;
      D.20910 = "probing";
      D.20911 = MEM[(const unsigned char *)D.20910];
      D.20912 = (int) D.20911;
      D.20913 = *__s2;
      D.20914 = (int) D.20913;
      __result = D.20912 - D.20914;
      {
        if (__s2_len != 0) goto <D.20915>; else goto <D.20916>;
        <D.20915>:
        if (__result == 0) goto <D.20917>; else goto <D.20918>;
        <D.20917>:
        D.20919 = &MEM[(void *)"probing" + 1B];
        D.20920 = *D.20919;
        D.20921 = (int) D.20920;
        D.20922 = __s2 + 1;
        D.20923 = *D.20922;
        D.20924 = (int) D.20923;
        __result = D.20921 - D.20924;
        if (__s2_len > 1) goto <D.20925>; else goto <D.20926>;
        <D.20925>:
        if (__result == 0) goto <D.20927>; else goto <D.20928>;
        <D.20927>:
        D.20929 = &MEM[(void *)"probing" + 2B];
        D.20930 = *D.20929;
        D.20931 = (int) D.20930;
        D.20932 = __s2 + 2;
        D.20933 = *D.20932;
        D.20934 = (int) D.20933;
        __result = D.20931 - D.20934;
        if (__s2_len > 2) goto <D.20935>; else goto <D.20936>;
        <D.20935>:
        if (__result == 0) goto <D.20937>; else goto <D.20938>;
        <D.20937>:
        D.20939 = &MEM[(void *)"probing" + 3B];
        D.20940 = *D.20939;
        D.20941 = (int) D.20940;
        D.20942 = __s2 + 3;
        D.20943 = *D.20942;
        D.20944 = (int) D.20943;
        __result = D.20941 - D.20944;
        <D.20938>:
        <D.20936>:
        <D.20928>:
        <D.20926>:
        <D.20918>:
        <D.20916>:
      }
      D.19112 = __result;
    }
    iftmp.42 = -D.19112;
    goto <D.20945>;
    <D.20909>:
    iftmp.42 = __builtin_strcmp (element_name, "probing");
    <D.20945>:
    D.19113 = iftmp.42;
  }
  if (D.19113 != 0) goto <D.20946>; else goto <D.20947>;
  <D.20946>:
  return;
  <D.20947>:
  D.20948 = runtime_config->domain;
  D.20949 = D.20948->private_bin_path;
  monoeg_g_free (D.20949);
  D.20948 = runtime_config->domain;
  D.20950 = get_attribute_value (attribute_names, attribute_values, "privatePath");
  D.20948->private_bin_path = D.20950;
  D.20948 = runtime_config->domain;
  D.20949 = D.20948->private_bin_path;
  if (D.20949 != 0B) goto <D.20951>; else goto <D.20952>;
  <D.20951>:
  D.20948 = runtime_config->domain;
  D.20949 = D.20948->private_bin_path;
  D.20953 = *D.20949;
  if (D.20953 == 0) goto <D.20954>; else goto <D.20955>;
  <D.20954>:
  D.20948 = runtime_config->domain;
  D.20949 = D.20948->private_bin_path;
  monoeg_g_free (D.20949);
  D.20948 = runtime_config->domain;
  D.20948->private_bin_path = 0B;
  return;
  <D.20955>:
  <D.20952>:
}


get_attribute_value (const gchar * * attribute_names, const gchar * * attribute_values, const char * att_name)
{
  int D.19074;
  unsigned int n.43;
  unsigned int D.20958;
  const gchar * * D.20959;
  const gchar * D.20960;
  char * D.20963;
  const gchar * * D.20964;
  const gchar * D.20965;
  int n;

  n = 0;
  goto <D.19076>;
  <D.19075>:
  {
    size_t __s1_len;
    size_t __s2_len;

    n.43 = (unsigned int) n;
    D.20958 = n.43 * 4;
    D.20959 = attribute_names + D.20958;
    D.20960 = *D.20959;
    D.19074 = __builtin_strcmp (D.20960, att_name);
  }
  if (D.19074 == 0) goto <D.20961>; else goto <D.20962>;
  <D.20961>:
  n.43 = (unsigned int) n;
  D.20958 = n.43 * 4;
  D.20964 = attribute_values + D.20958;
  D.20965 = *D.20964;
  D.20963 = monoeg_strdup (D.20965);
  return D.20963;
  <D.20962>:
  n = n + 1;
  <D.19076>:
  n.43 = (unsigned int) n;
  D.20958 = n.43 * 4;
  D.20959 = attribute_names + D.20958;
  D.20960 = *D.20959;
  if (D.20960 != 0B) goto <D.19075>; else goto <D.19077>;
  <D.19077>:
  D.20963 = 0B;
  return D.20963;
}


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


ves_icall_System_AppDomain_GetAssemblies (struct MonoAppDomain * ad, MonoBoolean refonly)
{
  struct MonoClass * System_Reflection_Assembly.44;
  struct MonoImage * D.20972;
  struct MonoClass * System_Reflection_Assembly.45;
  union mono_mutex_t * D.20974;
  _Bool D.20977;
  long int D.20978;
  long int D.20979;
  int D.20982;
  int D.20983;
  unsigned char D.20986;
  _Bool D.20991;
  long int D.20992;
  long int D.20993;
  unsigned int D.20996;
  void * * D.20997;
  unsigned int i.46;
  unsigned int D.20999;
  void * * D.21000;
  unsigned int i.47;
  struct MonoReflectionAssembly * D.21002;
  unsigned int i.48;
  struct MonoArray * D.21004;
  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.20970>; else goto <D.20971>;
  <D.20970>:
  D.20972 = mono_defaults.corlib;
  System_Reflection_Assembly.45 = mono_class_from_name (D.20972, "System.Reflection", "Assembly");
  System_Reflection_Assembly = System_Reflection_Assembly.45;
  <D.20971>:
  assemblies = monoeg_g_ptr_array_new ();
  {
    int ret;

    D.20974 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.20974);
    if (ret != 0) goto <D.20975>; else goto <D.20976>;
    <D.20975>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.20976>:
    D.20977 = ret != 0;
    D.20978 = (long int) D.20977;
    D.20979 = __builtin_expect (D.20978, 0);
    if (D.20979 != 0) goto <D.20980>; else goto <D.20981>;
    <D.20980>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 874, "ret == 0");
    <D.20981>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19180>;
  <D.19179>:
  ass = tmp->data;
  D.20982 = (int) refonly;
  D.20983 = ass->ref_only;
  if (D.20982 != D.20983) goto <D.20984>; else goto <D.20985>;
  <D.20984>:
  // predicted unlikely by continue predictor.
  goto <D.19178>;
  <D.20985>:
  D.20986 = ass->corlib_internal;
  if (D.20986 != 0) goto <D.20987>; else goto <D.20988>;
  <D.20987>:
  // predicted unlikely by continue predictor.
  goto <D.19178>;
  <D.20988>:
  monoeg_g_ptr_array_add (assemblies, ass);
  <D.19178>:
  tmp = tmp->next;
  <D.19180>:
  if (tmp != 0B) goto <D.19179>; else goto <D.19181>;
  <D.19181>:
  {
    int ret;

    D.20974 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.20974);
    if (ret != 0) goto <D.20989>; else goto <D.20990>;
    <D.20989>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.20990>:
    D.20991 = ret != 0;
    D.20992 = (long int) D.20991;
    D.20993 = __builtin_expect (D.20992, 0);
    if (D.20993 != 0) goto <D.20994>; else goto <D.20995>;
    <D.20994>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 883, "ret == 0");
    <D.20995>:
  }
  System_Reflection_Assembly.44 = System_Reflection_Assembly;
  D.20996 = assemblies->len;
  res = mono_array_new (domain, System_Reflection_Assembly.44, D.20996);
  i = 0;
  goto <D.19185>;
  <D.19184>:
  D.20997 = assemblies->pdata;
  i.46 = (unsigned int) i;
  D.20999 = i.46 * 4;
  D.21000 = D.20997 + D.20999;
  ass = *D.21000;
  {
    void * * __p;

    i.47 = (unsigned int) i;
    __p = mono_array_addr_with_size (res, 4, i.47);
    D.21002 = mono_assembly_get_object (domain, ass);
    mono_gc_wbarrier_set_arrayref (res, __p, D.21002);
  }
  i = i + 1;
  <D.19185>:
  i.48 = (unsigned int) i;
  D.20996 = assemblies->len;
  if (i.48 < D.20996) goto <D.19184>; else goto <D.19186>;
  <D.19186>:
  monoeg_g_ptr_array_free (assemblies, 1);
  D.21004 = res;
  return D.21004;
}


mono_try_assembly_resolve (struct MonoDomain * domain, struct MonoString * fname, gboolean refonly)
{
  int D.21006;
  struct MonoReflectionAssembly * D.21009;
  int iftmp.49;
  _Bool D.21015;
  long int D.21016;
  long int D.21017;
  struct MonoAppDomain * D.21020;
  struct MonoVTable * D.21021;
  _Bool D.21022;
  long int D.21023;
  long int D.21024;
  _Bool D.21029;
  unsigned char isrefonly.50;
  struct MonoClass * klass;
  struct MonoMethod * method;
  MonoBoolean isrefonly;
  void * params[2];

  try
    {
      D.21006 = mono_runtime_get_no_exec ();
      if (D.21006 != 0) goto <D.21007>; else goto <D.21008>;
      <D.21007>:
      D.21009 = 0B;
      return D.21009;
      <D.21008>:
      if (domain == 0B) goto <D.21011>; else goto <D.21014>;
      <D.21014>:
      if (fname == 0B) goto <D.21011>; else goto <D.21012>;
      <D.21011>:
      iftmp.49 = 1;
      goto <D.21013>;
      <D.21012>:
      iftmp.49 = 0;
      <D.21013>:
      D.21015 = iftmp.49 != 0;
      D.21016 = (long int) D.21015;
      D.21017 = __builtin_expect (D.21016, 0);
      if (D.21017 != 0) goto <D.21018>; else goto <D.21019>;
      <D.21018>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 907, "domain != NULL && fname != NULL");
      <D.21019>:
      D.21020 = domain->domain;
      D.21021 = D.21020->mbr.obj.vtable;
      klass = D.21021->klass;
      D.21022 = klass == 0B;
      D.21023 = (long int) D.21022;
      D.21024 = __builtin_expect (D.21023, 0);
      if (D.21024 != 0) goto <D.21025>; else goto <D.21026>;
      <D.21025>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 910, "klass");
      <D.21026>:
      method = mono_class_get_method_from_name (klass, "DoAssemblyResolve", -1);
      if (method == 0B) goto <D.21027>; else goto <D.21028>;
      <D.21027>:
      monoeg_g_log (0B, 16, "Method AppDomain.DoAssemblyResolve not found.\n");
      D.21009 = 0B;
      return D.21009;
      <D.21028>:
      D.21029 = refonly != 0;
      isrefonly.50 = (unsigned char) D.21029;
      isrefonly = isrefonly.50;
      params[0] = fname;
      params[1] = &isrefonly;
      D.21020 = domain->domain;
      D.21009 = mono_runtime_invoke (method, D.21020, &params, 0B);
      return D.21009;
    }
  finally
    {
      isrefonly = {CLOBBER};
      params = {CLOBBER};
    }
}


mono_is_shadow_copy_enabled (struct MonoDomain * domain, const gchar * dir_name)
{
  gboolean D.21035;
  struct MonoString * D.21039;
  int D.21040;
  int D.21043;
  _Bool D.21044;
  struct MonoString * D.21047;
  int D.21050;
  char * D.21053;
  int D.21056;
  gchar * D.21059;
  char D.21060;
  int D.19388;
  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.21033>; else goto <D.21034>;
      <D.21033>:
      D.21035 = 0;
      return D.21035;
      <D.21034>:
      setup = domain->setup;
      if (setup == 0B) goto <D.21036>; else goto <D.21038>;
      <D.21038>:
      D.21039 = setup->shadow_copy_files;
      if (D.21039 == 0B) goto <D.21036>; else goto <D.21037>;
      <D.21036>:
      D.21035 = 0;
      return D.21035;
      <D.21037>:
      D.21039 = setup->shadow_copy_files;
      shadow_status_string = mono_string_to_utf8_checked (D.21039, &error);
      D.21040 = mono_error_ok (&error);
      if (D.21040 == 0) goto <D.21041>; else goto <D.21042>;
      <D.21041>:
      mono_error_cleanup (&error);
      D.21035 = 0;
      return D.21035;
      <D.21042>:
      D.21043 = monoeg_g_ascii_strncasecmp (shadow_status_string, "true", 4);
      D.21044 = D.21043 == 0;
      shadow_enabled = (gboolean) D.21044;
      monoeg_g_free (shadow_status_string);
      if (shadow_enabled == 0) goto <D.21045>; else goto <D.21046>;
      <D.21045>:
      D.21035 = 0;
      return D.21035;
      <D.21046>:
      D.21047 = setup->shadow_copy_directories;
      if (D.21047 == 0B) goto <D.21048>; else goto <D.21049>;
      <D.21048>:
      D.21035 = 1;
      return D.21035;
      <D.21049>:
      base_dir = get_shadow_assembly_location_base (domain, &error);
      D.21050 = mono_error_ok (&error);
      if (D.21050 == 0) goto <D.21051>; else goto <D.21052>;
      <D.21051>:
      mono_error_cleanup (&error);
      D.21035 = 0;
      return D.21035;
      <D.21052>:
      D.21053 = strstr (dir_name, base_dir);
      if (D.21053 != 0B) goto <D.21054>; else goto <D.21055>;
      <D.21054>:
      monoeg_g_free (base_dir);
      D.21035 = 1;
      return D.21035;
      <D.21055>:
      monoeg_g_free (base_dir);
      D.21047 = setup->shadow_copy_directories;
      all_dirs = mono_string_to_utf8_checked (D.21047, &error);
      D.21056 = mono_error_ok (&error);
      if (D.21056 == 0) goto <D.21057>; else goto <D.21058>;
      <D.21057>:
      mono_error_cleanup (&error);
      D.21035 = 0;
      return D.21035;
      <D.21058>:
      directories = monoeg_g_strsplit (all_dirs, ":", 1000);
      dir_ptr = directories;
      goto <D.19391>;
      <D.19390>:
      D.21059 = *dir_ptr;
      D.21060 = *D.21059;
      if (D.21060 != 0) goto <D.21061>; else goto <D.21062>;
      <D.21061>:
      {
        size_t __s1_len;
        size_t __s2_len;

        D.21059 = *dir_ptr;
        D.19388 = __builtin_strcmp (D.21059, dir_name);
      }
      if (D.19388 == 0) goto <D.21063>; else goto <D.21064>;
      <D.21063>:
      found = 1;
      goto <D.19389>;
      <D.21064>:
      <D.21062>:
      dir_ptr = dir_ptr + 4;
      <D.19391>:
      D.21059 = *dir_ptr;
      if (D.21059 != 0B) goto <D.19390>; else goto <D.19389>;
      <D.19389>:
      monoeg_g_strfreev (directories);
      monoeg_g_free (all_dirs);
      D.21035 = found;
      return D.21035;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_make_shadow_copy (const char * filename)
{
  int D.21067;
  char * D.21070;
  int D.21071;
  char * D.21074;
  int D.21077;
  int D.21080;
  int D.21083;
  unsigned int D.21086;
  long int D.21087;
  unsigned int D.21088;
  long int D.21089;
  unsigned int D.21096;
  unsigned int D.21097;
  int D.21102;
  long int D.21105;
  long int D.21106;
  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.21067 = mono_is_shadow_copy_enabled (domain, dir_name);
      if (D.21067 == 0) goto <D.21068>; else goto <D.21069>;
      <D.21068>:
      monoeg_g_free (dir_name);
      D.21070 = filename;
      return D.21070;
      <D.21069>:
      shadow_dir = get_shadow_assembly_location_base (domain, &error);
      D.21071 = mono_error_ok (&error);
      if (D.21071 == 0) goto <D.21072>; else goto <D.21073>;
      <D.21072>:
      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.21073>:
      D.21074 = strstr (dir_name, shadow_dir);
      if (D.21074 != 0B) goto <D.21075>; else goto <D.21076>;
      <D.21075>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      D.21070 = filename;
      return D.21070;
      <D.21076>:
      monoeg_g_free (shadow_dir);
      monoeg_g_free (dir_name);
      shadow = get_shadow_assembly_location (filename, &error);
      D.21077 = mono_error_ok (&error);
      if (D.21077 == 0) goto <D.21078>; else goto <D.21079>;
      <D.21078>:
      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.21079>:
      D.21080 = ensure_directory_exists (shadow);
      if (D.21080 == 0) goto <D.21081>; else goto <D.21082>;
      <D.21081>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (ensure directory exists).");
      mono_raise_exception (exc);
      <D.21082>:
      D.21083 = private_file_needs_copying (filename, &src_sbuf, shadow);
      if (D.21083 == 0) goto <D.21084>; else goto <D.21085>;
      <D.21084>:
      D.21070 = shadow;
      return D.21070;
      <D.21085>:
      D.21086 = strlen (filename);
      D.21087 = (long int) D.21086;
      orig = monoeg_g_utf8_to_utf16 (filename, D.21087, 0B, 0B, 0B);
      D.21088 = strlen (shadow);
      D.21089 = (long int) D.21088;
      dest = monoeg_g_utf8_to_utf16 (shadow, D.21089, 0B, 0B, 0B);
      DeleteFile (dest);
      attrs = GetFileAttributes (orig);
      if (attrs == 4294967295) goto <D.21090>; else goto <D.21091>;
      <D.21090>:
      monoeg_g_free (shadow);
      D.21070 = filename;
      return D.21070;
      <D.21091>:
      copy_result = CopyFile (orig, dest, 0);
      if (copy_result != 0) goto <D.21092>; else goto <D.21093>;
      <D.21092>:
      copy_result = SetFileAttributes (dest, 128);
      <D.21093>:
      monoeg_g_free (dest);
      monoeg_g_free (orig);
      if (copy_result == 0) goto <D.21094>; else goto <D.21095>;
      <D.21094>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy (CopyFile).");
      mono_raise_exception (exc);
      <D.21095>:
      sibling_source = monoeg_g_strconcat (filename, ".config", 0B);
      D.21096 = strlen (sibling_source);
      sibling_source_len = (gint) D.21096;
      sibling_target = monoeg_g_strconcat (shadow, ".config", 0B);
      D.21097 = strlen (sibling_target);
      sibling_target_len = (gint) D.21097;
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".mdb", sibling_target, sibling_target_len, 7);
      if (copy_result == 1) goto <D.21098>; else goto <D.21099>;
      <D.21098>:
      copy_result = shadow_copy_sibling (sibling_source, sibling_source_len, ".config", sibling_target, sibling_target_len, 7);
      <D.21099>:
      monoeg_g_free (sibling_source);
      monoeg_g_free (sibling_target);
      if (copy_result == 0) goto <D.21100>; else goto <D.21101>;
      <D.21100>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy of sibling data (CopyFile).");
      mono_raise_exception (exc);
      <D.21101>:
      D.21102 = shadow_copy_create_ini (shadow, filename);
      if (D.21102 == 0) goto <D.21103>; else goto <D.21104>;
      <D.21103>:
      monoeg_g_free (shadow);
      exc = mono_get_exception_execution_engine ("Failed to create shadow copy .ini file.");
      mono_raise_exception (exc);
      <D.21104>:
      D.21105 = src_sbuf.st_atim.tv_sec;
      utbuf.actime = D.21105;
      D.21106 = src_sbuf.st_mtim.tv_sec;
      utbuf.modtime = D.21106;
      utime (shadow, &utbuf);
      D.21070 = shadow;
      return D.21070;
    }
  finally
    {
      error = {CLOBBER};
      src_sbuf = {CLOBBER};
      utbuf = {CLOBBER};
    }
}


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


get_cstring_hash (const char * str)
{
  char D.21120;
  gint32 D.21121;
  unsigned int D.21122;
  int D.21123;
  int D.21124;
  char D.21125;
  int D.21126;
  int len;
  int i;
  const char * p;
  gint32 h;

  h = 0;
  if (str == 0B) goto <D.21117>; else goto <D.21119>;
  <D.21119>:
  D.21120 = *str;
  if (D.21120 == 0) goto <D.21117>; else goto <D.21118>;
  <D.21117>:
  D.21121 = 0;
  return D.21121;
  <D.21118>:
  D.21122 = strlen (str);
  len = (int) D.21122;
  p = str;
  i = 0;
  goto <D.19307>;
  <D.19306>:
  D.21123 = h << 5;
  D.21124 = D.21123 - h;
  D.21125 = *p;
  D.21126 = (int) D.21125;
  h = D.21124 + D.21126;
  p = p + 1;
  i = i + 1;
  <D.19307>:
  if (i < len) goto <D.19306>; else goto <D.19308>;
  <D.19308>:
  D.21121 = h;
  return D.21121;
}


ensure_directory_exists (const char * filename)
{
  char D.21131;
  gboolean D.21132;
  int D.21133;
  unsigned int D.21136;
  unsigned int D.21137;
  char D.21140;
  int * D.21145;
  int D.21146;
  char * p.51;
  char * p;
  gchar * dir;
  int retval;
  struct stat sbuf;

  try
    {
      dir = monoeg_g_path_get_dirname (filename);
      if (dir == 0B) goto <D.21128>; else goto <D.21130>;
      <D.21130>:
      D.21131 = *dir;
      if (D.21131 == 0) goto <D.21128>; else goto <D.21129>;
      <D.21128>:
      monoeg_g_free (dir);
      D.21132 = 0;
      return D.21132;
      <D.21129>:
      D.21133 = stat (dir, &sbuf);
      if (D.21133 == 0) goto <D.21134>; else goto <D.21135>;
      <D.21134>:
      D.21136 = sbuf.st_mode;
      D.21137 = D.21136 & 61440;
      if (D.21137 == 16384) goto <D.21138>; else goto <D.21139>;
      <D.21138>:
      monoeg_g_free (dir);
      D.21132 = 1;
      return D.21132;
      <D.21139>:
      <D.21135>:
      p = dir;
      goto <D.19343>;
      <D.19342>:
      p = p + 1;
      <D.19343>:
      D.21140 = *p;
      if (D.21140 == 47) goto <D.19342>; else goto <D.19344>;
      <D.19344>:
      <D.19346>:
      p = __builtin_strchr (p, 47);
      if (p != 0B) goto <D.21141>; else goto <D.21142>;
      <D.21141>:
      *p = 0;
      <D.21142>:
      retval = mkdir (dir, 511);
      if (retval != 0) goto <D.21143>; else goto <D.21144>;
      <D.21143>:
      D.21145 = __errno_location ();
      D.21146 = *D.21145;
      if (D.21146 != 17) goto <D.21147>; else goto <D.21148>;
      <D.21147>:
      monoeg_g_free (dir);
      D.21132 = 0;
      return D.21132;
      <D.21148>:
      <D.21144>:
      if (p == 0B) goto <D.19345>; else goto <D.21149>;
      <D.21149>:
      p.51 = p;
      p = p.51 + 1;
      *p.51 = 47;
      goto <D.19346>;
      <D.19345>:
      monoeg_g_free (dir);
      D.21132 = 1;
      return D.21132;
    }
  finally
    {
      sbuf = {CLOBBER};
    }
}


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

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


private_file_needs_copying (const char * src, struct stat * sbuf_src, char * dest)
{
  int D.21158;
  gboolean D.21163;
  int D.21166;
  long long int D.21169;
  long long int D.21170;
  long int D.21173;
  long int D.21174;
  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.21155>; else goto <D.21156>;
      <D.21155>:
      stat_src = src;
      goto <D.21157>;
      <D.21156>:
      stat_src = real_src;
      <D.21157>:
      D.21158 = stat (stat_src, sbuf_src);
      if (D.21158 == -1) goto <D.21159>; else goto <D.21160>;
      <D.21159>:
      {
        time_t tnow;

        tnow = time (0B);
        if (real_src != 0B) goto <D.21161>; else goto <D.21162>;
        <D.21161>:
        monoeg_g_free (real_src);
        <D.21162>:
        memset (sbuf_src, 0, 160);
        sbuf_src->st_mtim.tv_sec = tnow;
        sbuf_src->st_atim.tv_sec = tnow;
        D.21163 = 1;
        return D.21163;
      }
      <D.21160>:
      if (real_src != 0B) goto <D.21164>; else goto <D.21165>;
      <D.21164>:
      monoeg_g_free (real_src);
      <D.21165>:
      D.21166 = stat (dest, &sbuf_dest);
      if (D.21166 == -1) goto <D.21167>; else goto <D.21168>;
      <D.21167>:
      D.21163 = 1;
      return D.21163;
      <D.21168>:
      D.21169 = sbuf_src->st_size;
      D.21170 = sbuf_dest.st_size;
      if (D.21169 == D.21170) goto <D.21171>; else goto <D.21172>;
      <D.21171>:
      D.21173 = sbuf_src->st_mtim.tv_sec;
      D.21174 = sbuf_dest.st_mtim.tv_sec;
      if (D.21173 == D.21174) goto <D.21175>; else goto <D.21176>;
      <D.21175>:
      D.21163 = 0;
      return D.21163;
      <D.21176>:
      <D.21172>:
      D.21163 = 1;
      return D.21163;
    }
  finally
    {
      sbuf_dest = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.21181;
  int D.21186;
  void * D.21188;
  unsigned int D.21189;

  D.21181 = __builtin_constant_p (__len);
  if (D.21181 != 0) goto <D.21182>; else goto <D.21183>;
  <D.21182>:
  if (__len == 0) goto <D.21184>; else goto <D.21185>;
  <D.21184>:
  D.21186 = __builtin_constant_p (__ch);
  if (D.21186 == 0) goto <D.21179>; else goto <D.21187>;
  <D.21187>:
  if (__ch != 0) goto <D.21179>; else goto <D.21180>;
  <D.21179>:
  __warn_memset_zero_len ();
  D.21188 = __dest;
  return D.21188;
  <D.21180>:
  <D.21185>:
  <D.21183>:
  D.21189 = __builtin_object_size (__dest, 0);
  D.21188 = __builtin___memset_chk (__dest, __ch, __len, D.21189);
  return D.21188;
}


shadow_copy_sibling (gchar * src, gint srclen, const char * extension, gchar * target, gint targetlen, gint tail_len)
{
  sizetype srclen.52;
  sizetype tail_len.53;
  sizetype D.21193;
  gchar * D.21194;
  int __mono_io_portability_helpers.54;
  int D.21196;
  gboolean D.21201;
  int D.21203;
  unsigned int D.21206;
  long int D.21207;
  sizetype targetlen.55;
  sizetype D.21209;
  gchar * D.21210;
  unsigned int D.21211;
  long int D.21212;
  guint16 * orig;
  guint16 * dest;
  gboolean copy_result;

  srclen.52 = (sizetype) srclen;
  tail_len.53 = (sizetype) tail_len;
  D.21193 = srclen.52 - tail_len.53;
  D.21194 = src + D.21193;
  strcpy (D.21194, extension);
  __mono_io_portability_helpers.54 = __mono_io_portability_helpers;
  D.21196 = __mono_io_portability_helpers.54 & 4;
  if (D.21196 != 0) goto <D.21197>; else goto <D.21198>;
  <D.21197>:
  {
    gchar * file;

    file = mono_portability_find_file (src, 1);
    if (file == 0B) goto <D.21199>; else goto <D.21200>;
    <D.21199>:
    D.21201 = 1;
    return D.21201;
    <D.21200>:
    monoeg_g_free (file);
  }
  goto <D.21202>;
  <D.21198>:
  D.21203 = monoeg_g_file_test (src, 1);
  if (D.21203 == 0) goto <D.21204>; else goto <D.21205>;
  <D.21204>:
  D.21201 = 1;
  return D.21201;
  <D.21205>:
  <D.21202>:
  D.21206 = strlen (src);
  D.21207 = (long int) D.21206;
  orig = monoeg_g_utf8_to_utf16 (src, D.21207, 0B, 0B, 0B);
  targetlen.55 = (sizetype) targetlen;
  tail_len.53 = (sizetype) tail_len;
  D.21209 = targetlen.55 - tail_len.53;
  D.21210 = target + D.21209;
  strcpy (D.21210, extension);
  D.21211 = strlen (target);
  D.21212 = (long int) D.21211;
  dest = monoeg_g_utf8_to_utf16 (target, D.21212, 0B, 0B, 0B);
  DeleteFile (dest);
  copy_result = CopyFile (orig, dest, 0);
  if (copy_result != 0) goto <D.21213>; else goto <D.21214>;
  <D.21213>:
  copy_result = SetFileAttributes (dest, 128);
  <D.21214>:
  monoeg_g_free (orig);
  monoeg_g_free (dest);
  D.21201 = copy_result;
  return D.21201;
}


shadow_copy_create_ini (const char * shadow, const char * filename)
{
  int D.21216;
  gboolean D.21219;
  unsigned int D.21220;
  long int D.21221;
  unsigned int D.21226;
  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.21216 = monoeg_g_file_test (ini_file, 1);
      if (D.21216 != 0) goto <D.21217>; else goto <D.21218>;
      <D.21217>:
      monoeg_g_free (ini_file);
      D.21219 = 1;
      return D.21219;
      <D.21218>:
      D.21220 = strlen (ini_file);
      D.21221 = (long int) D.21220;
      u16_ini = monoeg_g_utf8_to_utf16 (ini_file, D.21221, 0B, 0B, 0B);
      monoeg_g_free (ini_file);
      if (u16_ini == 0B) goto <D.21222>; else goto <D.21223>;
      <D.21222>:
      D.21219 = 0;
      return D.21219;
      <D.21223>:
      handle = CreateFile (u16_ini, 1073741824, 3, 0B, 1, 128, 0B);
      monoeg_g_free (u16_ini);
      if (handle == 4294967295B) goto <D.21224>; else goto <D.21225>;
      <D.21224>:
      D.21219 = 0;
      return D.21219;
      <D.21225>:
      full_path = mono_path_resolve_symlinks (filename);
      D.21226 = strlen (full_path);
      result = WriteFile (handle, full_path, D.21226, &n, 0B);
      monoeg_g_free (full_path);
      CloseHandle (handle);
      D.21219 = result;
      return D.21219;
    }
  finally
    {
      n = {CLOBBER};
    }
}


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

  if (appdomain == 0B) goto <D.21229>; else goto <D.21230>;
  <D.21229>:
  D.21231 = 0B;
  return D.21231;
  <D.21230>:
  D.21231 = appdomain->data;
  return D.21231;
}


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

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

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

        status.56 = status;
        if (status.56 == 3) goto <D.21239>; else goto <D.21240>;
        <D.21239>:
        exc = mono_get_exception_bad_image_format2 (0B, fname);
        goto <D.21241>;
        <D.21240>:
        exc = mono_get_exception_file_not_found2 (0B, fname);
        <D.21241>:
        monoeg_g_free (name);
        mono_raise_exception (exc);
      }
      <D.21237>:
      monoeg_g_free (name);
      D.21242 = mono_assembly_get_object (domain, ass);
      return D.21242;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssemblyRaw (struct MonoAppDomain * ad, struct MonoArray * raw_assembly, struct MonoArray * raw_symbol_store, struct MonoObject * evidence, MonoBoolean refonly)
{
  char * D.21245;
  int D.21246;
  struct MonoException * D.21249;
  struct MonoReflectionAssembly * D.21250;
  char * D.21253;
  unsigned int D.21254;
  int D.21255;
  struct MonoException * D.21258;
  struct MonoObject * * D.21259;
  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.21245 = mono_array_addr_with_size (raw_assembly, 1, 0);
      D.21246 = (int) refonly;
      image = mono_image_open_from_data_full (D.21245, raw_assembly_len, 1, 0B, D.21246);
      if (image == 0B) goto <D.21247>; else goto <D.21248>;
      <D.21247>:
      D.21249 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21249);
      D.21250 = 0B;
      return D.21250;
      <D.21248>:
      if (raw_symbol_store != 0B) goto <D.21251>; else goto <D.21252>;
      <D.21251>:
      D.21253 = mono_array_addr_with_size (raw_symbol_store, 1, 0);
      D.21254 = mono_array_length (raw_symbol_store);
      D.21255 = (int) D.21254;
      mono_debug_open_image_from_memory (image, D.21253, D.21255);
      <D.21252>:
      D.21246 = (int) refonly;
      ass = mono_assembly_load_from_full (image, "", &status, D.21246);
      if (ass == 0B) goto <D.21256>; else goto <D.21257>;
      <D.21256>:
      mono_image_close (image);
      D.21258 = mono_get_exception_bad_image_format ("");
      mono_raise_exception (D.21258);
      D.21250 = 0B;
      return D.21250;
      <D.21257>:
      refass = mono_assembly_get_object (domain, ass);
      D.21259 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21259, evidence);
      D.21250 = refass;
      return D.21250;
    }
  finally
    {
      status = {CLOBBER};
    }
}


ves_icall_System_AppDomain_LoadAssembly (struct MonoAppDomain * ad, struct MonoString * assRef, struct MonoObject * evidence, MonoBoolean refOnly)
{
  _Bool D.21262;
  long int D.21263;
  long int D.21264;
  int D.21271;
  struct MonoReflectionAssembly * D.21272;
  struct MonoObject * * D.21282;
  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.21262 = assRef == 0B;
      D.21263 = (long int) D.21262;
      D.21264 = __builtin_expect (D.21263, 0);
      if (D.21264 != 0) goto <D.21265>; else goto <D.21266>;
      <D.21265>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 1951, "assRef != NULL");
      <D.21266>:
      name = mono_string_to_utf8 (assRef);
      parsed = mono_assembly_name_parse (name, &aname);
      monoeg_g_free (name);
      if (parsed == 0) goto <D.21267>; else goto <D.21268>;
      <D.21267>:
      if (refOnly == 0) goto <D.21269>; else goto <D.21270>;
      <D.21269>:
      D.21271 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21271);
      <D.21270>:
      D.21272 = refass;
      return D.21272;
      <D.21268>:
      D.21271 = (int) refOnly;
      ass = mono_assembly_load_full_nosearch (&aname, 0B, &status, D.21271);
      mono_assembly_name_free (&aname);
      if (ass == 0B) goto <D.21273>; else goto <D.21274>;
      <D.21273>:
      if (refOnly == 0) goto <D.21275>; else goto <D.21276>;
      <D.21275>:
      D.21271 = (int) refOnly;
      refass = mono_try_assembly_resolve (domain, assRef, D.21271);
      goto <D.21277>;
      <D.21276>:
      refass = 0B;
      <D.21277>:
      if (refass == 0B) goto <D.21278>; else goto <D.21279>;
      <D.21278>:
      D.21272 = 0B;
      return D.21272;
      <D.21279>:
      <D.21274>:
      if (refass == 0B) goto <D.21280>; else goto <D.21281>;
      <D.21280>:
      refass = mono_assembly_get_object (domain, ass);
      <D.21281>:
      D.21282 = &refass->evidence;
      mono_gc_wbarrier_set_field (refass, D.21282, evidence);
      D.21272 = refass;
      return D.21272;
    }
  finally
    {
      status = {CLOBBER};
      aname = {CLOBBER};
    }
}


ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
  struct MonoDomain * D.21287;
  struct MonoException * D.21290;
  const gchar * D.21291;
  struct MonoDomain * domain;

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

    exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
    mono_raise_exception (exc);
  }
  <D.21286>:
  D.21287 = mono_get_root_domain ();
  if (D.21287 == domain) goto <D.21288>; else goto <D.21289>;
  <D.21288>:
  D.21290 = mono_get_exception_cannot_unload_appdomain ("The default appdomain can not be unloaded.");
  mono_raise_exception (D.21290);
  return;
  <D.21289>:
  D.21291 = monoeg_g_getenv ("MONO_NO_UNLOAD");
  if (D.21291 != 0B) goto <D.21292>; else goto <D.21293>;
  <D.21292>:
  return;
  <D.21293>:
  mono_domain_unload (domain);
}


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21295>; else goto <D.21296>;
  <D.21295>:
  D.21297 = 1;
  return D.21297;
  <D.21296>:
  D.21297 = mono_domain_is_unloading (domain);
  return D.21297;
}


ves_icall_System_AppDomain_ExecuteAssembly (struct MonoAppDomain * ad, struct MonoReflectionAssembly * refass, struct MonoArray * args)
{
  _Bool D.21299;
  long int D.21300;
  long int D.21301;
  struct MonoAssembly * D.21304;
  _Bool D.21305;
  long int D.21306;
  long int D.21307;
  unsigned int D.21310;
  char * D.21313;
  struct MonoDomain * D.21316;
  struct MonoClass * D.21317;
  gint32 D.21318;
  struct MonoImage * image;
  struct MonoMethod * method;

  D.21299 = refass == 0B;
  D.21300 = (long int) D.21299;
  D.21301 = __builtin_expect (D.21300, 0);
  if (D.21301 != 0) goto <D.21302>; else goto <D.21303>;
  <D.21302>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2035, "refass");
  <D.21303>:
  D.21304 = refass->assembly;
  image = D.21304->image;
  D.21305 = image == 0B;
  D.21306 = (long int) D.21305;
  D.21307 = __builtin_expect (D.21306, 0);
  if (D.21307 != 0) goto <D.21308>; else goto <D.21309>;
  <D.21308>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2037, "image");
  <D.21309>:
  D.21310 = mono_image_get_entry_point (image);
  method = mono_get_method (image, D.21310, 0B);
  if (method == 0B) goto <D.21311>; else goto <D.21312>;
  <D.21311>:
  D.21313 = image->name;
  monoeg_g_log (0B, 4, "No entry point method found in %s", D.21313);
  <D.19518>:
  goto <D.19518>;
  <D.21312>:
  if (args == 0B) goto <D.21314>; else goto <D.21315>;
  <D.21314>:
  D.21316 = ad->data;
  D.21317 = mono_defaults.string_class;
  args = mono_array_new (D.21316, D.21317, 0);
  <D.21315>:
  D.21318 = mono_runtime_exec_main (method, args, 0B);
  return D.21318;
}


ves_icall_System_AppDomain_GetIDFromDomain (struct MonoAppDomain * ad)
{
  gint32 D.21320;
  struct MonoDomain * D.21321;

  D.21321 = ad->data;
  D.21320 = D.21321->domain_id;
  return D.21320;
}


ves_icall_System_AppDomain_InternalSetDomain (struct MonoAppDomain * ad)
{
  struct MonoDomain * D.21323;
  int D.21324;
  struct MonoException * D.21327;
  struct MonoAppDomain * D.21328;
  struct MonoDomain * old_domain;

  old_domain = mono_domain_get ();
  D.21323 = ad->data;
  D.21324 = mono_domain_set (D.21323, 0);
  if (D.21324 == 0) goto <D.21325>; else goto <D.21326>;
  <D.21325>:
  D.21327 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21327);
  <D.21326>:
  D.21328 = old_domain->domain;
  return D.21328;
}


ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid)
{
  int D.21333;
  struct MonoException * D.21334;
  struct MonoAppDomain * D.21335;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (domainid);
  if (domain == 0B) goto <D.21330>; else goto <D.21332>;
  <D.21332>:
  D.21333 = mono_domain_set (domain, 0);
  if (D.21333 == 0) goto <D.21330>; else goto <D.21331>;
  <D.21330>:
  D.21334 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21334);
  <D.21331>:
  D.21335 = current_domain->domain;
  return D.21335;
}


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

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


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

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21338>; else goto <D.21339>;
  <D.21338>:
  D.21340 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21340);
  <D.21339>:
  mono_thread_push_appdomain_ref (domain);
}


ves_icall_System_AppDomain_InternalPopDomainRef ()
{
  mono_thread_pop_appdomain_ref ();
}


ves_icall_System_AppDomain_InternalGetContext ()
{
  struct MonoAppContext * D.21341;

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


ves_icall_System_AppDomain_InternalGetDefaultContext ()
{
  struct MonoAppContext * D.21343;
  struct MonoDomain * D.21344;

  D.21344 = mono_domain_get ();
  D.21343 = D.21344->default_context;
  return D.21343;
}


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

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


ves_icall_System_AppDomain_InternalGetProcessGuid (struct MonoString * newguid)
{
  union mono_mutex_t * D.21348;
  _Bool D.21351;
  long int D.21352;
  long int D.21353;
  int process_guid_set.57;
  _Bool D.21361;
  long int D.21362;
  long int D.21363;
  struct MonoString * D.21366;
  struct MonoDomain * D.21367;
  mono_unichar2 * D.21368;
  _Bool D.21371;
  long int D.21372;
  long int D.21373;
  struct MonoDomain * mono_root_domain;

  mono_root_domain = mono_get_root_domain ();
  {
    int ret;

    D.21348 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_lock (D.21348);
    if (ret != 0) goto <D.21349>; else goto <D.21350>;
    <D.21349>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21350>:
    D.21351 = ret != 0;
    D.21352 = (long int) D.21351;
    D.21353 = __builtin_expect (D.21352, 0);
    if (D.21353 != 0) goto <D.21354>; else goto <D.21355>;
    <D.21354>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2150, "ret == 0");
    <D.21355>:
  }
  process_guid_set.57 = process_guid_set;
  if (process_guid_set.57 != 0) goto <D.21357>; else goto <D.21358>;
  <D.21357>:
  {
    int ret;

    D.21348 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21348);
    if (ret != 0) goto <D.21359>; else goto <D.21360>;
    <D.21359>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21360>:
    D.21361 = ret != 0;
    D.21362 = (long int) D.21361;
    D.21363 = __builtin_expect (D.21362, 0);
    if (D.21363 != 0) goto <D.21364>; else goto <D.21365>;
    <D.21364>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2152, "ret == 0");
    <D.21365>:
  }
  D.21367 = mono_domain_get ();
  D.21366 = mono_string_new_utf16 (D.21367, &process_guid, 36);
  return D.21366;
  <D.21358>:
  D.21368 = mono_string_chars (newguid);
  memcpy (&process_guid, D.21368, 72);
  process_guid_set = 1;
  {
    int ret;

    D.21348 = &mono_root_domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21348);
    if (ret != 0) goto <D.21369>; else goto <D.21370>;
    <D.21369>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21370>:
    D.21371 = ret != 0;
    D.21372 = (long int) D.21371;
    D.21373 = __builtin_expect (D.21372, 0);
    if (D.21373 != 0) goto <D.21374>; else goto <D.21375>;
    <D.21374>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2157, "ret == 0");
    <D.21375>:
  }
  D.21366 = newguid;
  return D.21366;
}


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

  D.21378 = __builtin_object_size (__dest, 0);
  D.21377 = __builtin___memcpy_chk (__dest, __src, __len, D.21378);
  return D.21377;
}


mono_domain_is_unloading (struct MonoDomain * domain)
{
  unsigned int D.21380;
  unsigned int D.21381;
  mono_bool D.21384;

  D.21380 = domain->state;
  D.21381 = D.21380 + 4294967294;
  if (D.21381 <= 1) goto <D.21382>; else goto <D.21383>;
  <D.21382>:
  D.21384 = 1;
  return D.21384;
  <D.21383>:
  D.21384 = 0;
  return D.21384;
}


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

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


mono_domain_try_unload (struct MonoDomain * domain, struct MonoObject * * exc)
{
  guint32 * D.21389;
  int D.21390;
  struct MonoException * D.21393;
  struct MonoException * D.21394;
  struct MonoAppDomain * D.21395;
  struct MonoVTable * D.21396;
  struct MonoClass * D.21397;
  _Bool D.21398;
  long int D.21399;
  long int D.21400;
  struct MonoObject * D.21403;
  struct MonoInternalThread * D.21408;
  int D.21409;
  int D.21412;
  int D.21415;
  unsigned int D.21417;
  char * D.21418;
  struct MonoException * D.21421;
  void * thread_handle;
  MonoAppDomainState prev_state;
  struct MonoMethod * method;
  struct unload_data * thread_data;
  struct MonoDomain * caller_domain;

  caller_domain = mono_domain_get ();
  D.21389 = &domain->state;
  D.21390 = InterlockedCompareExchange (D.21389, 1, 0);
  prev_state = (MonoAppDomainState) D.21390;
  if (prev_state != 0) goto <D.21391>; else goto <D.21392>;
  <D.21391>:
  switch (prev_state) <default: <D.19640>, case 1: <D.19637>, case 2: <D.19638>, case 3: <D.19639>>
  <D.19637>:
  <D.19638>:
  D.21393 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded.");
  *exc = D.21393;
  return;
  <D.19639>:
  D.21394 = mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded.");
  *exc = D.21394;
  return;
  <D.19640>:
  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.21392>:
  mono_domain_set (domain, 0);
  D.21395 = domain->domain;
  D.21396 = D.21395->mbr.obj.vtable;
  D.21397 = D.21396->klass;
  method = mono_class_get_method_from_name (D.21397, "DoDomainUnload", -1);
  D.21398 = method == 0B;
  D.21399 = (long int) D.21398;
  D.21400 = __builtin_expect (D.21399, 0);
  if (D.21400 != 0) goto <D.21401>; else goto <D.21402>;
  <D.21401>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2416, "method");
  <D.21402>:
  D.21395 = domain->domain;
  mono_runtime_invoke (method, D.21395, 0B, exc);
  D.21403 = *exc;
  if (D.21403 != 0B) goto <D.21404>; else goto <D.21405>;
  <D.21404>:
  domain->state = 0;
  mono_domain_set (caller_domain, 0);
  return;
  <D.21405>:
  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.21406>; else goto <D.21407>;
  <D.21406>:
  return;
  <D.21407>:
  ResumeThread (thread_handle);
  goto <D.19642>;
  <D.19641>:
  D.21408 = mono_thread_internal_current ();
  D.21409 = mono_thread_internal_has_appdomain_ref (D.21408, domain);
  if (D.21409 != 0) goto <D.21410>; else goto <D.21411>;
  <D.21410>:
  D.21412 = mono_thread_interruption_requested ();
  if (D.21412 != 0) goto <D.21413>; else goto <D.21414>;
  <D.21413>:
  CloseHandle (thread_handle);
  unload_data_unref (thread_data);
  return;
  <D.21414>:
  <D.21411>:
  <D.19642>:
  D.21415 = thread_data->done;
  if (D.21415 == 0) goto <D.21416>; else goto <D.19643>;
  <D.21416>:
  D.21417 = WaitForSingleObjectEx (thread_handle, 4294967295, 1);
  if (D.21417 == 192) goto <D.19641>; else goto <D.19643>;
  <D.19643>:
  CloseHandle (thread_handle);
  D.21418 = thread_data->failure_reason;
  if (D.21418 != 0B) goto <D.21419>; else goto <D.21420>;
  <D.21419>:
  domain->state = 0;
  D.21418 = thread_data->failure_reason;
  monoeg_g_log (0B, 16, "%s", D.21418);
  D.21418 = thread_data->failure_reason;
  D.21421 = mono_get_exception_cannot_unload_appdomain (D.21418);
  *exc = D.21421;
  D.21418 = thread_data->failure_reason;
  monoeg_g_free (D.21418);
  thread_data->failure_reason = 0B;
  <D.21420>:
  unload_data_unref (thread_data);
}


unload_thread_main (void * arg)
{
  struct MonoDomain * D.21423;
  int D.21424;
  char * D.21427;
  gchar * D.21428;
  int D.21429;
  gchar * D.21432;
  int D.21433;
  gchar * D.21436;
  union mono_mutex_t * D.21437;
  _Bool D.21440;
  long int D.21441;
  long int D.21442;
  struct GPtrArray * D.21445;
  void * * D.21446;
  unsigned int i.59;
  unsigned int D.21448;
  void * * D.21449;
  void * D.21450;
  unsigned int i.60;
  unsigned int D.21452;
  int D.21453;
  unsigned int D.21454;
  _Bool D.21457;
  long int D.21458;
  long int D.21459;
  int D.21462;
  guint32 D.21463;
  struct unload_data * data;
  struct MonoDomain * domain;
  struct MonoThread * thread;
  int i;
  void failure = <<< error >>>;

  data = arg;
  domain = data->domain;
  D.21423 = mono_get_root_domain ();
  thread = mono_thread_attach_full (D.21423, 1);
  D.21424 = mono_threads_abort_appdomain_threads (domain, -1);
  if (D.21424 == 0) goto <D.21425>; else goto <D.21426>;
  <D.21425>:
  D.21427 = domain->friendly_name;
  D.21428 = monoeg_g_strdup_printf ("Aborting of threads in domain %s timed out.", D.21427);
  data->failure_reason = D.21428;
  goto failure;
  <D.21426>:
  D.21429 = mono_thread_pool_remove_domain_jobs (domain, -1);
  if (D.21429 == 0) goto <D.21430>; else goto <D.21431>;
  <D.21430>:
  D.21427 = domain->friendly_name;
  D.21432 = monoeg_g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", D.21427);
  data->failure_reason = D.21432;
  goto failure;
  <D.21431>:
  D.21433 = mono_domain_finalize (domain, 4294967295);
  if (D.21433 == 0) goto <D.21434>; else goto <D.21435>;
  <D.21434>:
  D.21427 = domain->friendly_name;
  D.21436 = monoeg_g_strdup_printf ("Finalization of domain %s timed out.", D.21427);
  data->failure_reason = D.21436;
  goto failure;
  <D.21435>:
  mono_loader_lock ();
  {
    int ret;

    D.21437 = &domain->lock.mutex;
    ret = pthread_mutex_lock (D.21437);
    if (ret != 0) goto <D.21438>; else goto <D.21439>;
    <D.21438>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21439>:
    D.21440 = ret != 0;
    D.21441 = (long int) D.21440;
    D.21442 = __builtin_expect (D.21441, 0);
    if (D.21442 != 0) goto <D.21443>; else goto <D.21444>;
    <D.21443>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2299, "ret == 0");
    <D.21444>:
  }
  i = 0;
  goto <D.19618>;
  <D.19617>:
  D.21445 = domain->class_vtable_array;
  D.21446 = D.21445->pdata;
  i.59 = (unsigned int) i;
  D.21448 = i.59 * 4;
  D.21449 = D.21446 + D.21448;
  D.21450 = *D.21449;
  zero_static_data (D.21450);
  i = i + 1;
  <D.19618>:
  i.60 = (unsigned int) i;
  D.21445 = domain->class_vtable_array;
  D.21452 = D.21445->len;
  if (i.60 < D.21452) goto <D.19617>; else goto <D.19619>;
  <D.19619>:
  mono_gc_collect (0);
  i = 0;
  goto <D.19621>;
  <D.19620>:
  D.21445 = domain->class_vtable_array;
  D.21446 = D.21445->pdata;
  i.59 = (unsigned int) i;
  D.21448 = i.59 * 4;
  D.21449 = D.21446 + D.21448;
  D.21450 = *D.21449;
  clear_cached_vtable (D.21450);
  i = i + 1;
  <D.19621>:
  i.60 = (unsigned int) i;
  D.21445 = domain->class_vtable_array;
  D.21452 = D.21445->len;
  if (i.60 < D.21452) goto <D.19620>; else goto <D.19622>;
  <D.19622>:
  deregister_reflection_info_roots (domain);
  D.21453 = domain->domain_id;
  D.21454 = (unsigned int) D.21453;
  mono_assembly_cleanup_domain_bindings (D.21454);
  {
    int ret;

    D.21437 = &domain->lock.mutex;
    ret = pthread_mutex_unlock (D.21437);
    if (ret != 0) goto <D.21455>; else goto <D.21456>;
    <D.21455>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21456>:
    D.21457 = ret != 0;
    D.21458 = (long int) D.21457;
    D.21459 = __builtin_expect (D.21458, 0);
    if (D.21459 != 0) goto <D.21460>; else goto <D.21461>;
    <D.21460>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2320, "ret == 0");
    <D.21461>:
  }
  mono_loader_unlock ();
  mono_threads_clear_cached_culture (domain);
  domain->state = 3;
  mono_gchandle_free_domain (domain);
  mono_domain_free (domain, 0);
  D.21462 = mono_gc_max_generation ();
  mono_gc_collect (D.21462);
  mono_memory_barrier ();
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21463 = 0;
  return D.21463;
  failure:
  mono_memory_barrier ();
  data->done = 1;
  unload_data_unref (data);
  mono_thread_detach (thread);
  D.21463 = 1;
  return D.21463;
}


zero_static_data (struct MonoVTable * vtable)
{
  unsigned int D.21465;
  unsigned int D.21466;
  int D.21471;
  unsigned int D.21472;
  struct MonoClass * klass;
  void * data;

  klass = vtable->klass;
  D.21465 = BIT_FIELD_REF <*klass, 32, 160>;
  D.21466 = D.21465 & 268435456;
  if (D.21466 != 0) goto <D.21467>; else goto <D.21468>;
  <D.21467>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21469>; else goto <D.21470>;
  <D.21469>:
  D.21471 = mono_class_data_size (klass);
  D.21472 = (unsigned int) D.21471;
  mono_gc_bzero_aligned (data, D.21472);
  <D.21470>:
  <D.21468>:
}


clear_cached_vtable (struct MonoVTable * vtable)
{
  short unsigned int D.21475;
  int D.21476;
  int D.21477;
  unsigned int D.21480;
  unsigned int D.21481;
  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.21473>; else goto <D.21474>;
  <D.21473>:
  D.21475 = runtime_info->max_domain;
  D.21476 = (int) D.21475;
  D.21477 = domain->domain_id;
  if (D.21476 >= D.21477) goto <D.21478>; else goto <D.21479>;
  <D.21478>:
  D.21477 = domain->domain_id;
  runtime_info->domain_vtables[D.21477] = 0B;
  <D.21479>:
  <D.21474>:
  D.21480 = BIT_FIELD_REF <*klass, 32, 160>;
  D.21481 = D.21480 & 268435456;
  if (D.21481 != 0) goto <D.21482>; else goto <D.21483>;
  <D.21482>:
  data = mono_vtable_get_static_field_data (vtable);
  if (data != 0B) goto <D.21484>; else goto <D.21485>;
  <D.21484>:
  mono_gc_free_fixed (data);
  <D.21485>:
  <D.21483>:
}


deregister_reflection_info_roots (struct MonoDomain * domain)
{
  union mono_mutex_t * D.21486;
  _Bool D.21489;
  long int D.21490;
  long int D.21491;
  unsigned int D.21494;
  unsigned int D.21495;
  struct MonoImage * * D.21498;
  unsigned int i.61;
  unsigned int D.21500;
  struct MonoImage * * D.21501;
  unsigned int D.21504;
  unsigned int D.21505;
  unsigned int i.62;
  unsigned int D.21509;
  _Bool D.21512;
  long int D.21513;
  long int D.21514;
  struct GSList * list;

  {
    int ret;

    D.21486 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21486);
    if (ret != 0) goto <D.21487>; else goto <D.21488>;
    <D.21487>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21488>:
    D.21489 = ret != 0;
    D.21490 = (long int) D.21489;
    D.21491 = __builtin_expect (D.21490, 0);
    if (D.21491 != 0) goto <D.21492>; else goto <D.21493>;
    <D.21492>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2237, "ret == 0");
    <D.21493>:
  }
  list = domain->domain_assemblies;
  goto <D.19605>;
  <D.19604>:
  {
    struct MonoAssembly * assembly;
    struct MonoImage * image;
    int i;

    assembly = list->data;
    image = assembly->image;
    D.21494 = BIT_FIELD_REF <*image, 32, 128>;
    D.21495 = D.21494 & 8;
    if (D.21495 != 0) goto <D.21496>; else goto <D.21497>;
    <D.21496>:
    deregister_reflection_info_roots_from_list (image);
    <D.21497>:
    i = 0;
    goto <D.19602>;
    <D.19601>:
    {
      struct MonoImage * module;

      D.21498 = image->modules;
      i.61 = (unsigned int) i;
      D.21500 = i.61 * 4;
      D.21501 = D.21498 + D.21500;
      module = *D.21501;
      if (module != 0B) goto <D.21502>; else goto <D.21503>;
      <D.21502>:
      D.21504 = BIT_FIELD_REF <*module, 32, 128>;
      D.21505 = D.21504 & 8;
      if (D.21505 != 0) goto <D.21506>; else goto <D.21507>;
      <D.21506>:
      deregister_reflection_info_roots_from_list (module);
      <D.21507>:
      <D.21503>:
    }
    i = i + 1;
    <D.19602>:
    i.62 = (unsigned int) i;
    D.21509 = image->module_count;
    if (i.62 < D.21509) goto <D.19601>; else goto <D.19603>;
    <D.19603>:
  }
  list = list->next;
  <D.19605>:
  if (list != 0B) goto <D.19604>; else goto <D.19606>;
  <D.19606>:
  {
    int ret;

    D.21486 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21486);
    if (ret != 0) goto <D.21510>; else goto <D.21511>;
    <D.21510>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21511>:
    D.21512 = ret != 0;
    D.21513 = (long int) D.21512;
    D.21514 = __builtin_expect (D.21513, 0);
    if (D.21514 != 0) goto <D.21515>; else goto <D.21516>;
    <D.21515>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2258, "ret == 0");
    <D.21516>:
  }
}


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

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

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


mono_memory_barrier ()
{
  __sync_synchronize ();
}


InterlockedCompareExchange (volatile gint32 * dest, gint32 exch, gint32 comp)
{
  gint32 D.21517;
  unsigned int comp.63;
  unsigned int exch.64;
  unsigned int D.21520;

  comp.63 = (unsigned int) comp;
  exch.64 = (unsigned int) exch;
  D.21520 = __sync_val_compare_and_swap_4 (dest, comp.63, exch.64);
  D.21517 = (gint32) D.21520;
  return D.21517;
}


unload_data_unref (struct unload_data * data)
{
  unsigned int count.65;
  unsigned int D.21523;
  _Bool D.21524;
  long int D.21525;
  long int D.21526;
  gint32 * D.21531;
  int D.21532;
  int D.21533;
  gint32 count;

  <D.19582>:
  {
    gint32 __tmp;

    __tmp = data->refcount;
    mono_memory_barrier ();
    count = __tmp;
  }
  count.65 = (unsigned int) count;
  D.21523 = count.65 + 4294967295;
  D.21524 = D.21523 > 1;
  D.21525 = (long int) D.21524;
  D.21526 = __builtin_expect (D.21525, 0);
  if (D.21526 != 0) goto <D.21527>; else goto <D.21528>;
  <D.21527>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "appdomain.c", 2208, "count >= 1 && count <= 2");
  <D.21528>:
  if (count == 1) goto <D.21529>; else goto <D.21530>;
  <D.21529>:
  monoeg_g_free (data);
  return;
  <D.21530>:
  D.21531 = &data->refcount;
  D.21532 = count + -1;
  D.21533 = InterlockedCompareExchange (D.21531, count, D.21532);
  if (D.21533 != count) goto <D.19582>; else goto <D.19583>;
  <D.19583>:
}


