mono_signature_no_pinvoke (struct MonoMethod * method)
{
  unsigned char D.21909;
  unsigned char D.21910;
  struct MonoClass * D.21913;
  struct MonoImage * D.21914;
  struct MonoMethodSignature * D.21915;
  struct MonoMethodSignature * sig;

  sig = mono_method_signature (method);
  D.21909 = BIT_FIELD_REF <*sig, 8, 120>;
  D.21910 = D.21909 & 1;
  if (D.21910 != 0) goto <D.21911>; else goto <D.21912>;
  <D.21911>:
  D.21913 = method->klass;
  D.21914 = D.21913->image;
  sig = signature_dup (D.21914, sig);
  sig->pinvoke = 0;
  <D.21912>:
  D.21915 = sig;
  return D.21915;
}


signature_dup (struct MonoImage * image, struct MonoMethodSignature * sig)
{
  short unsigned int D.21917;
  unsigned int D.21918;
  long unsigned int D.21919;
  long unsigned int D.21920;
  unsigned int D.21921;
  unsigned int D.21922;
  long unsigned int D.21923;
  struct MonoMethodSignature * D.21924;
  struct MonoMethodSignature * res;
  int sigsize;

  D.21917 = sig->param_count;
  D.21918 = (unsigned int) D.21917;
  res = mono_metadata_signature_alloc (image, D.21918);
  D.21917 = sig->param_count;
  D.21919 = (long unsigned int) D.21917;
  D.21920 = D.21919 + 2;
  D.21921 = (unsigned int) D.21920;
  D.21922 = D.21921 * 8;
  sigsize = (int) D.21922;
  D.21923 = (long unsigned int) sigsize;
  memcpy (res, sig, D.21923);
  D.21924 = res;
  return D.21924;
}


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

  D.21927 = __builtin_object_size (__dest, 0);
  D.21926 = __builtin___memcpy_chk (__dest, __src, __len, D.21927);
  return D.21926;
}


mono_marshal_init_tls ()
{
  mono_native_tls_alloc (&last_error_tls_id, 0B);
  mono_native_tls_alloc (&load_type_info_tls_id, 0B);
}


mono_native_tls_alloc (pthread_key_t * key, void * destructor)
{
  int D.21929;
  void (*<Tc2>) (void *) destructor.0;
  int D.21931;
  _Bool D.21932;

  destructor.0 = (void (*<Tc2>) (void *)) destructor;
  D.21931 = pthread_key_create (key, destructor.0);
  D.21932 = D.21931 == 0;
  D.21929 = (int) D.21932;
  return D.21929;
}


mono_marshal_init ()
{
  int module_initialized.1;
  static gboolean module_initialized = 0;

  module_initialized.1 = module_initialized;
  if (module_initialized.1 == 0) goto <D.21935>; else goto <D.21936>;
  <D.21935>:
  module_initialized = 1;
  InitializeCriticalSection (&marshal_mutex);
  marshal_mutex_initialized = 1;
  register_icall (ves_icall_System_Threading_Thread_ResetAbort, "ves_icall_System_Threading_Thread_ResetAbort", "void", 1);
  register_icall (mono_marshal_string_to_utf16, "mono_marshal_string_to_utf16", "ptr obj", 0);
  register_icall (mono_marshal_string_to_utf16_copy, "mono_marshal_string_to_utf16_copy", "ptr obj", 0);
  register_icall (mono_string_to_utf16, "mono_string_to_utf16", "ptr obj", 0);
  register_icall (mono_string_from_utf16, "mono_string_from_utf16", "obj ptr", 0);
  register_icall (mono_string_from_byvalwstr, "mono_string_from_byvalwstr", "obj ptr int", 0);
  register_icall (mono_string_new_wrapper, "mono_string_new_wrapper", "obj ptr", 0);
  register_icall (mono_string_new_len_wrapper, "mono_string_new_len_wrapper", "obj ptr int", 0);
  register_icall (mono_string_to_utf8, "mono_string_to_utf8", "ptr obj", 0);
  register_icall (mono_string_to_lpstr, "mono_string_to_lpstr", "ptr obj", 0);
  register_icall (mono_string_to_ansibstr, "mono_string_to_ansibstr", "ptr object", 0);
  register_icall (mono_string_builder_to_utf8, "mono_string_builder_to_utf8", "ptr object", 0);
  register_icall (mono_string_builder_to_utf16, "mono_string_builder_to_utf16", "ptr object", 0);
  register_icall (mono_array_to_savearray, "mono_array_to_savearray", "ptr object", 0);
  register_icall (mono_array_to_lparray, "mono_array_to_lparray", "ptr object", 0);
  register_icall (mono_free_lparray, "mono_free_lparray", "void object ptr", 0);
  register_icall (mono_byvalarray_to_array, "mono_byvalarray_to_array", "void object ptr ptr int32", 0);
  register_icall (mono_byvalarray_to_byte_array, "mono_byvalarray_to_byte_array", "void object ptr int32", 0);
  register_icall (mono_array_to_byvalarray, "mono_array_to_byvalarray", "void ptr object ptr int32", 0);
  register_icall (mono_array_to_byte_byvalarray, "mono_array_to_byte_byvalarray", "void ptr object int32", 0);
  register_icall (mono_delegate_to_ftnptr, "mono_delegate_to_ftnptr", "ptr object", 0);
  register_icall (mono_ftnptr_to_delegate, "mono_ftnptr_to_delegate", "object ptr ptr", 0);
  register_icall (mono_marshal_asany, "mono_marshal_asany", "ptr object int32 int32", 0);
  register_icall (mono_marshal_free_asany, "mono_marshal_free_asany", "void object ptr int32 int32", 0);
  register_icall (mono_marshal_alloc, "mono_marshal_alloc", "ptr int32", 0);
  register_icall (mono_marshal_free, "mono_marshal_free", "void ptr", 0);
  register_icall (mono_marshal_set_last_error, "mono_marshal_set_last_error", "void", 0);
  register_icall (mono_marshal_set_last_error_windows, "mono_marshal_set_last_error_windows", "void int32", 0);
  register_icall (mono_string_utf8_to_builder, "mono_string_utf8_to_builder", "void ptr ptr", 0);
  register_icall (mono_string_utf8_to_builder2, "mono_string_utf8_to_builder2", "object ptr", 0);
  register_icall (mono_string_utf16_to_builder, "mono_string_utf16_to_builder", "void ptr ptr", 0);
  register_icall (mono_string_utf16_to_builder2, "mono_string_utf16_to_builder2", "object ptr", 0);
  register_icall (mono_marshal_free_array, "mono_marshal_free_array", "void ptr int32", 0);
  register_icall (mono_string_to_byvalstr, "mono_string_to_byvalstr", "void ptr ptr int32", 0);
  register_icall (mono_string_to_byvalwstr, "mono_string_to_byvalwstr", "void ptr ptr int32", 0);
  register_icall (monoeg_g_free, "g_free", "void ptr", 0);
  register_icall (mono_object_isinst, "mono_object_isinst", "object object ptr", 0);
  register_icall (mono_struct_delete_old, "mono_struct_delete_old", "void ptr ptr", 0);
  register_icall (mono_delegate_begin_invoke, "mono_delegate_begin_invoke", "object object ptr", 0);
  register_icall (mono_delegate_end_invoke, "mono_delegate_end_invoke", "object object ptr", 0);
  register_icall (mono_marshal_xdomain_copy_value, "mono_marshal_xdomain_copy_value", "object object", 0);
  register_icall (mono_marshal_xdomain_copy_out_value, "mono_marshal_xdomain_copy_out_value", "void object object", 0);
  register_icall (mono_marshal_set_domain_by_id, "mono_marshal_set_domain_by_id", "int32 int32 int32", 0);
  register_icall (mono_marshal_check_domain_image, "mono_marshal_check_domain_image", "int32 int32 ptr", 0);
  register_icall (mono_compile_method, "mono_compile_method", "ptr ptr", 0);
  register_icall (mono_context_get, "mono_context_get", "object", 0);
  register_icall (mono_context_set, "mono_context_set", "void object", 0);
  register_icall (type_from_handle, "type_from_handle", "object ptr", 0);
  register_icall (mono_gc_wbarrier_generic_nostore, "wb_generic", "void ptr", 0);
  register_icall (mono_gchandle_get_target, "mono_gchandle_get_target", "object int32", 1);
  register_icall (mono_remoting_wrapper, "mono_remoting_wrapper", "object ptr ptr", 0);
  register_icall (mono_upgrade_remote_class_wrapper, "mono_upgrade_remote_class_wrapper", "void object object", 0);
  mono_cominterop_init ();
  <D.21936>:
}


mono_remoting_wrapper (struct MonoMethod * method, void * * params)
{
  void * D.21937;
  _Bool D.21938;
  long int D.21939;
  long int D.21940;
  struct MonoVTable * D.21943;
  struct MonoClass * D.21944;
  struct MonoClass * D.21945;
  _Bool D.21946;
  long int D.21947;
  long int D.21948;
  struct MonoRemoteClass * D.21951;
  struct MonoClass * D.21952;
  unsigned char D.21953;
  unsigned char D.21954;
  struct MonoRealProxy * D.21957;
  struct MonoObject * D.21958;
  struct MonoAppContext * D.21959;
  short unsigned int D.21962;
  long unsigned int D.21963;
  long unsigned int D.21964;
  struct MonoType * D.21965;
  unsigned char D.21966;
  unsigned char D.21967;
  unsigned char D.21970;
  unsigned char D.21971;
  long unsigned int D.21974;
  long unsigned int D.21975;
  void * * D.21976;
  void * * D.21977;
  void * D.21978;
  void * D.21979;
  struct MonoClass * D.21981;
  int D.21982;
  struct MonoObject * D.21985;
  void * * D.21988;
  struct MonoObject * D.21989;
  void * iftmp.2;
  struct MonoClass * D.21991;
  unsigned char D.21992;
  unsigned char D.21993;
  struct MonoObject * exc.3;
  struct MonoArray * out_args.4;
  struct MonoMethodMessage * msg;
  struct MonoTransparentProxy * this;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;

  try
    {
      D.21937 = *params;
      this = MEM[(struct MonoTransparentProxy * *)D.21937];
      D.21938 = this == 0B;
      D.21939 = (long int) D.21938;
      D.21940 = __builtin_expect (D.21939, 0);
      if (D.21940 != 0) goto <D.21941>; else goto <D.21942>;
      <D.21941>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3124, "this");
      <D.21942>:
      D.21943 = MEM[(struct MonoObject *)this].vtable;
      D.21944 = D.21943->klass;
      D.21945 = mono_defaults.transparent_proxy_class;
      D.21946 = D.21944 != D.21945;
      D.21947 = (long int) D.21946;
      D.21948 = __builtin_expect (D.21947, 0);
      if (D.21948 != 0) goto <D.21949>; else goto <D.21950>;
      <D.21949>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3125, "((MonoObject *)this)->vtable->klass == mono_defaults.transparent_proxy_class");
      <D.21950>:
      params = params + 8;
      D.21951 = this->remote_class;
      D.21952 = D.21951->proxy_class;
      D.21953 = BIT_FIELD_REF <*D.21952, 8, 272>;
      D.21954 = D.21953 & 128;
      if (D.21954 != 0) goto <D.21955>; else goto <D.21956>;
      <D.21955>:
      D.21957 = this->rp;
      D.21958 = D.21957->context;
      D.21959 = mono_context_get ();
      if (D.21958 == D.21959) goto <D.21960>; else goto <D.21961>;
      <D.21960>:
      {
        int i;
        struct MonoMethodSignature * sig;
        int count;
        void * * mparams;

        sig = mono_method_signature (method);
        D.21962 = sig->param_count;
        count = (int) D.21962;
        D.21963 = (long unsigned int) count;
        D.21964 = D.21963 * 8;
        mparams = __builtin_alloca (D.21964);
        i = 0;
        goto <D.19618>;
        <D.19617>:
        {
          struct MonoClass * class;

          D.21965 = sig->params[i];
          class = mono_class_from_mono_type (D.21965);
          D.21966 = BIT_FIELD_REF <*class, 8, 256>;
          D.21967 = D.21966 & 8;
          if (D.21967 != 0) goto <D.21968>; else goto <D.21969>;
          <D.21968>:
          D.21965 = sig->params[i];
          D.21970 = BIT_FIELD_REF <*D.21965, 8, 88>;
          D.21971 = D.21970 & 64;
          if (D.21971 != 0) goto <D.21972>; else goto <D.21973>;
          <D.21972>:
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21976 = mparams + D.21975;
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21977 = params + D.21975;
          D.21978 = *D.21977;
          D.21979 = MEM[(void * *)D.21978];
          *D.21976 = D.21979;
          goto <D.21980>;
          <D.21973>:
          D.21965 = sig->params[i];
          D.21981 = mono_class_from_mono_type (D.21965);
          D.21982 = mono_class_is_nullable (D.21981);
          if (D.21982 != 0) goto <D.21983>; else goto <D.21984>;
          <D.21983>:
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21976 = mparams + D.21975;
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21977 = params + D.21975;
          D.21978 = *D.21977;
          D.21985 = mono_nullable_box (D.21978, class);
          *D.21976 = D.21985;
          goto <D.21986>;
          <D.21984>:
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21976 = mparams + D.21975;
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21977 = params + D.21975;
          D.21978 = *D.21977;
          *D.21976 = D.21978;
          <D.21986>:
          <D.21980>:
          goto <D.21987>;
          <D.21969>:
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21976 = mparams + D.21975;
          D.21974 = (long unsigned int) i;
          D.21975 = D.21974 * 8;
          D.21977 = params + D.21975;
          D.21978 = *D.21977;
          D.21988 = MEM[(void * * *)D.21978];
          *D.21976 = D.21988;
          <D.21987>:
        }
        i = i + 1;
        <D.19618>:
        if (i < count) goto <D.19617>; else goto <D.19619>;
        <D.19619>:
        D.21991 = method->klass;
        D.21992 = BIT_FIELD_REF <*D.21991, 8, 256>;
        D.21993 = D.21992 & 8;
        if (D.21993 != 0) goto <D.21994>; else goto <D.21995>;
        <D.21994>:
        iftmp.2 = mono_object_unbox (this);
        goto <D.21996>;
        <D.21995>:
        iftmp.2 = this;
        <D.21996>:
        D.21989 = mono_runtime_invoke (method, iftmp.2, mparams, 0B);
        return D.21989;
      }
      <D.21961>:
      <D.21956>:
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.21957 = this->rp;
      res = mono_remoting_invoke (D.21957, msg, &exc, &out_args);
      exc.3 = exc;
      if (exc.3 != 0B) goto <D.21998>; else goto <D.21999>;
      <D.21998>:
      exc.3 = exc;
      mono_raise_exception (exc.3);
      <D.21999>:
      out_args.4 = out_args;
      mono_method_return_message_restore (method, params, out_args.4);
      D.21989 = res;
      return D.21989;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


type_from_handle (struct MonoType * handle)
{
  struct MonoReflectionType * D.22003;
  struct MonoDomain * domain;
  struct MonoClass * klass;

  domain = mono_domain_get ();
  klass = mono_class_from_mono_type (handle);
  mono_class_init (klass);
  D.22003 = mono_type_get_object (domain, handle);
  return D.22003;
}


mono_marshal_check_domain_image (gint32 domain_id, struct MonoImage * image)
{
  gboolean D.22007;
  union mono_mutex_t * D.22008;
  _Bool D.22011;
  long int D.22012;
  long int D.22013;
  struct MonoImage * D.22016;
  _Bool D.22020;
  long int D.22021;
  long int D.22022;
  _Bool D.22025;
  struct MonoAssembly * ass;
  struct GSList * tmp;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.22005>; else goto <D.22006>;
  <D.22005>:
  D.22007 = 0;
  return D.22007;
  <D.22006>:
  {
    int ret;

    D.22008 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.22008);
    if (ret != 0) goto <D.22009>; else goto <D.22010>;
    <D.22009>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22010>:
    D.22011 = ret != 0;
    D.22012 = (long int) D.22011;
    D.22013 = __builtin_expect (D.22012, 0);
    if (D.22013 != 0) goto <D.22014>; else goto <D.22015>;
    <D.22014>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3452, "ret == 0");
    <D.22015>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19740>;
  <D.19739>:
  ass = tmp->data;
  D.22016 = ass->image;
  if (D.22016 == image) goto <D.19738>; else goto <D.22017>;
  <D.22017>:
  tmp = tmp->next;
  <D.19740>:
  if (tmp != 0B) goto <D.19739>; else goto <D.19738>;
  <D.19738>:
  {
    int ret;

    D.22008 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.22008);
    if (ret != 0) goto <D.22018>; else goto <D.22019>;
    <D.22018>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22019>:
    D.22020 = ret != 0;
    D.22021 = (long int) D.22020;
    D.22022 = __builtin_expect (D.22021, 0);
    if (D.22022 != 0) goto <D.22023>; else goto <D.22024>;
    <D.22023>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3458, "ret == 0");
    <D.22024>:
  }
  D.22025 = tmp != 0B;
  D.22007 = (gboolean) D.22025;
  return D.22007;
}


mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push)
{
  int D.22030;
  struct MonoException * D.22031;
  gint32 D.22035;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (id);
  if (domain == 0B) goto <D.22027>; else goto <D.22029>;
  <D.22029>:
  D.22030 = mono_domain_set (domain, 0);
  if (D.22030 == 0) goto <D.22027>; else goto <D.22028>;
  <D.22027>:
  D.22031 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.22031);
  <D.22028>:
  if (push != 0) goto <D.22032>; else goto <D.22033>;
  <D.22032>:
  mono_thread_push_appdomain_ref (domain);
  goto <D.22034>;
  <D.22033>:
  mono_thread_pop_appdomain_ref ();
  <D.22034>:
  D.22035 = current_domain->domain_id;
  return D.22035;
}


mono_marshal_xdomain_copy_out_value (struct MonoObject * src, struct MonoObject * dst)
{
  _Bool D.22037;
  _Bool D.22038;
  _Bool D.22039;
  struct MonoVTable * D.22042;
  struct MonoClass * D.22043;
  struct MonoVTable * D.22044;
  struct MonoClass * D.22045;
  _Bool D.22046;
  long int D.22047;
  long int D.22048;
  unsigned char D.22051;
  int D.22052;
  struct MonoClass * D.22053;
  struct MonoType * D.22054;
  <unnamed type> D.22055;
  long unsigned int D.22060;
  long unsigned int D.22061;
  char * D.22062;
  struct MonoObject * D.22063;
  struct MonoClass * D.22066;
  struct MonoString * D.22069;
  int D.22070;
  mono_unichar2 * D.22071;
  struct MonoDomain * D.22072;
  struct MonoString * D.22073;
  struct MonoString * * D.22074;
  int D.22075;

  D.22037 = src == 0B;
  D.22038 = dst == 0B;
  D.22039 = D.22037 | D.22038;
  if (D.22039 != 0) goto <D.22040>; else goto <D.22041>;
  <D.22040>:
  return;
  <D.22041>:
  D.22042 = src->vtable;
  D.22043 = D.22042->klass;
  D.22044 = dst->vtable;
  D.22045 = D.22044->klass;
  D.22046 = D.22043 != D.22045;
  D.22047 = (long int) D.22046;
  D.22048 = __builtin_expect (D.22047, 0);
  if (D.22048 != 0) goto <D.22049>; else goto <D.22050>;
  <D.22049>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3340, "mono_object_class (src) == mono_object_class (dst)");
  <D.22050>:
  D.22042 = src->vtable;
  D.22043 = D.22042->klass;
  D.22051 = D.22043->byval_arg.type;
  D.22052 = (int) D.22051;
  switch (D.22052) <default: <D.22065>, case 20: <D.19685>, case 29: <D.19686>>
  <D.19685>:
  <D.19686>:
  {
    int mt;

    D.22042 = src->vtable;
    D.22043 = D.22042->klass;
    D.22053 = D.22043->element_class;
    D.22054 = &D.22053->byval_arg;
    D.22055 = mono_get_xdomain_marshal_type (D.22054);
    mt = (int) D.22055;
    if (mt == 3) goto <D.22056>; else goto <D.22057>;
    <D.22056>:
    return;
    <D.22057>:
    if (mt == 1) goto <D.22058>; else goto <D.22059>;
    <D.22058>:
    {
      int i;
      int len;

      D.22060 = mono_array_length (dst);
      len = (int) D.22060;
      i = 0;
      goto <D.19693>;
      <D.19692>:
      {
        struct MonoObject * item;

        D.22061 = (long unsigned int) i;
        D.22062 = mono_array_addr_with_size (src, 8, D.22061);
        item = MEM[(void * *)D.22062];
        {
          void * * __p;

          D.22061 = (long unsigned int) i;
          __p = mono_array_addr_with_size (dst, 8, D.22061);
          D.22063 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (dst, __p, D.22063);
        }
      }
      i = i + 1;
      <D.19693>:
      if (i < len) goto <D.19692>; else goto <D.19694>;
      <D.19694>:
    }
    goto <D.22064>;
    <D.22059>:
    mono_array_full_copy (src, dst);
    <D.22064>:
    return;
  }
  <D.22065>:
  D.22042 = src->vtable;
  D.22043 = D.22042->klass;
  D.22066 = mono_defaults.stringbuilder_class;
  if (D.22043 == D.22066) goto <D.22067>; else goto <D.22068>;
  <D.22067>:
  {
    struct MonoStringBuilder * src_sb;
    struct MonoStringBuilder * dst_sb;

    src_sb = src;
    dst_sb = dst;
    D.22069 = src_sb->str;
    D.22070 = mono_string_length (D.22069);
    D.22069 = src_sb->str;
    D.22071 = mono_string_chars (D.22069);
    D.22044 = dst->vtable;
    D.22072 = D.22044->domain;
    D.22073 = mono_string_new_utf16 (D.22072, D.22071, D.22070);
    D.22074 = &dst_sb->str;
    mono_gc_wbarrier_set_field (dst_sb, D.22074, D.22073);
    dst_sb->cached_str = 0B;
    D.22075 = src_sb->length;
    dst_sb->length = D.22075;
  }
  <D.22068>:
}


mono_get_xdomain_marshal_type (struct MonoType * t)
{
  unsigned char D.22077;
  int D.22078;
  MonoXDomainMarshalType D.22079;
  struct MonoClass * D.22080;
  struct MonoType * D.22081;
  <unnamed type> D.22082;

  D.22077 = t->type;
  D.22078 = (int) D.22077;
  switch (D.22078) <default: <D.22085>, case 1: <D.19631>, case 2: <D.19634>, case 3: <D.19637>, case 4: <D.19633>, case 5: <D.19632>, case 6: <D.19636>, case 7: <D.19635>, case 8: <D.19639>, case 9: <D.19638>, case 10: <D.19640>, case 11: <D.19641>, case 12: <D.19642>, case 13: <D.19643>, case 14: <D.19644>, case 20: <D.19645>, case 29: <D.19646>>
  <D.19631>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3240);
  <D.19632>:
  <D.19633>:
  <D.19634>:
  <D.19635>:
  <D.19636>:
  <D.19637>:
  <D.19638>:
  <D.19639>:
  <D.19640>:
  <D.19641>:
  <D.19642>:
  <D.19643>:
  D.22079 = 0;
  return D.22079;
  <D.19644>:
  D.22079 = 1;
  return D.22079;
  <D.19645>:
  <D.19646>:
  {
    struct MonoClass * elem_class;

    D.22080 = mono_class_from_mono_type (t);
    elem_class = D.22080->element_class;
    D.22081 = &elem_class->byval_arg;
    D.22082 = mono_get_xdomain_marshal_type (D.22081);
    if (D.22082 != 3) goto <D.22083>; else goto <D.22084>;
    <D.22083>:
    D.22079 = 1;
    return D.22079;
    <D.22084>:
    goto <D.19648>;
  }
  <D.22085>:
  <D.19648>:
  D.22079 = 3;
  return D.22079;
}


mono_delegate_end_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.22087;
  long int D.22088;
  long int D.22089;
  struct MonoReflectionMethod * D.22092;
  struct MonoMethod * D.22095;
  _Bool D.22096;
  long int D.22097;
  long int D.22098;
  struct MonoReflectionMethod * D.22101;
  struct MonoReflectionMethod * * D.22102;
  struct MonoMethod * D.22106;
  struct MonoVTable * D.22107;
  _Bool D.22108;
  long int D.22109;
  long int D.22110;
  short unsigned int D.22113;
  int D.22114;
  int D.22115;
  long unsigned int D.22116;
  struct MonoArray * D.22117;
  char * D.22118;
  struct MonoImage * D.22121;
  struct MonoException * D.22122;
  struct MonoObject * D.22123;
  struct MonoObject * D.22124;
  struct MonoException * D.22127;
  struct MonoObject * D.22130;
  struct MonoVTable * D.22132;
  struct MonoClass * D.22133;
  struct MonoClass * D.22134;
  struct MonoClass * D.22136;
  struct MonoAsyncResult * * D.22137;
  struct MonoRealProxy * D.22138;
  struct MonoObject * exc.5;
  struct MonoString * D.22142;
  struct MonoString * D.22145;
  struct MonoString * * D.22146;
  struct MonoArray * out_args.6;
  struct MonoDomain * domain;
  struct MonoAsyncResult * ares;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodMessage * msg;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;
  struct MonoClass * klass;

  try
    {
      domain = mono_domain_get ();
      method = 0B;
      D.22087 = delegate == 0B;
      D.22088 = (long int) D.22087;
      D.22089 = __builtin_expect (D.22088, 0);
      if (D.22089 != 0) goto <D.22090>; else goto <D.22091>;
      <D.22090>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2908, "delegate");
      <D.22091>:
      D.22092 = delegate->method_info;
      if (D.22092 == 0B) goto <D.22093>; else goto <D.22094>;
      <D.22093>:
      D.22095 = delegate->method;
      D.22096 = D.22095 == 0B;
      D.22097 = (long int) D.22096;
      D.22098 = __builtin_expect (D.22097, 0);
      if (D.22098 != 0) goto <D.22099>; else goto <D.22100>;
      <D.22099>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2911, "delegate->method");
      <D.22100>:
      D.22095 = delegate->method;
      D.22101 = mono_method_get_object (domain, D.22095, 0B);
      D.22102 = &delegate->method_info;
      mono_gc_wbarrier_set_field (delegate, D.22102, D.22101);
      <D.22094>:
      D.22092 = delegate->method_info;
      if (D.22092 == 0B) goto <D.22103>; else goto <D.22105>;
      <D.22105>:
      D.22092 = delegate->method_info;
      D.22106 = D.22092->method;
      if (D.22106 == 0B) goto <D.22103>; else goto <D.22104>;
      <D.22103>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2916);
      <D.22104>:
      D.22107 = delegate->object.vtable;
      klass = D.22107->klass;
      method = mono_class_get_method_from_name (klass, "EndInvoke", -1);
      D.22108 = method == 0B;
      D.22109 = (long int) D.22108;
      D.22110 = __builtin_expect (D.22109, 0);
      if (D.22110 != 0) goto <D.22111>; else goto <D.22112>;
      <D.22111>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2921, "method != NULL");
      <D.22112>:
      sig = mono_signature_no_pinvoke (method);
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.22113 = sig->param_count;
      D.22114 = (int) D.22113;
      D.22115 = D.22114 + -1;
      D.22116 = (long unsigned int) D.22115;
      D.22117 = msg->args;
      D.22118 = mono_array_addr_with_size (D.22117, 8, D.22116);
      ares = MEM[(void * *)D.22118];
      if (ares == 0B) goto <D.22119>; else goto <D.22120>;
      <D.22119>:
      D.22121 = mono_defaults.corlib;
      D.22122 = mono_exception_from_name_msg (D.22121, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.");
      mono_raise_exception (D.22122);
      D.22123 = 0B;
      return D.22123;
      <D.22120>:
      D.22124 = ares->async_delegate;
      if (D.22124 != delegate) goto <D.22125>; else goto <D.22126>;
      <D.22125>:
      D.22127 = mono_get_exception_invalid_operation ("The IAsyncResult object provided does not match this delegate.");
      mono_raise_exception (D.22127);
      D.22123 = 0B;
      return D.22123;
      <D.22126>:
      D.22130 = delegate->target;
      if (D.22130 != 0B) goto <D.22131>; else goto <D.22128>;
      <D.22131>:
      D.22130 = delegate->target;
      D.22132 = D.22130->vtable;
      D.22133 = D.22132->klass;
      D.22134 = mono_defaults.transparent_proxy_class;
      if (D.22133 == D.22134) goto <D.22135>; else goto <D.22128>;
      <D.22135>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.22136 = mono_defaults.mono_method_message_class;
        msg = mono_object_new (domain, D.22136);
        D.22092 = delegate->method_info;
        mono_message_init (domain, msg, D.22092, 0B);
        msg->call_type = 2;
        D.22137 = &msg->async_result;
        mono_gc_wbarrier_set_field (msg, D.22137, ares);
        D.22138 = tp->rp;
        res = mono_remoting_invoke (D.22138, msg, &exc, &out_args);
      }
      goto <D.22129>;
      <D.22128>:
      res = mono_thread_pool_finish (ares, &out_args, &exc);
      <D.22129>:
      exc.5 = exc;
      if (exc.5 != 0B) goto <D.22140>; else goto <D.22141>;
      <D.22140>:
      exc.5 = exc;
      D.22142 = MEM[(struct MonoException *)exc.5].stack_trace;
      if (D.22142 != 0B) goto <D.22143>; else goto <D.22144>;
      <D.22143>:
      {
        char * strace;
        char * tmp;

        exc.5 = exc;
        D.22142 = MEM[(struct MonoException *)exc.5].stack_trace;
        strace = mono_string_to_utf8 (D.22142);
        tmp = monoeg_g_strdup_printf ("%s\nException Rethrown at:\n", strace);
        monoeg_g_free (strace);
        D.22145 = mono_string_new (domain, tmp);
        exc.5 = exc;
        D.22146 = &MEM[(struct MonoException *)exc.5].stack_trace;
        exc.5 = exc;
        mono_gc_wbarrier_set_field (exc.5, D.22146, D.22145);
        monoeg_g_free (tmp);
      }
      <D.22144>:
      exc.5 = exc;
      mono_raise_exception (exc.5);
      <D.22141>:
      out_args.6 = out_args;
      mono_method_return_message_restore (method, params, out_args.6);
      D.22123 = res;
      return D.22123;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


mono_delegate_begin_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.22150;
  long int D.22151;
  long int D.22152;
  struct MonoMulticastDelegate * D.22155;
  struct MonoException * D.22158;
  struct MonoObject * D.22159;
  struct MonoVTable * D.22162;
  struct MonoClass * D.22163;
  struct MonoClass * D.22164;
  struct MonoRemoteClass * D.22169;
  struct MonoClass * D.22170;
  unsigned char D.22171;
  unsigned char D.22172;
  struct MonoRealProxy * D.22174;
  struct MonoObject * D.22175;
  struct MonoAppContext * D.22176;
  struct MonoMethod * D.22177;
  struct MonoObject * state.7;
  struct MonoDomain * D.22179;
  struct MonoObject * * D.22180;
  struct MonoDelegate * async_callback.8;
  struct MonoObject * * D.22182;
  struct MonoAsyncResult * * D.22183;
  struct MonoObject * exc.9;
  struct MonoAsyncResult * D.22187;
  struct MonoVTable * D.22188;
  _Bool D.22191;
  long int D.22192;
  long int D.22193;
  struct MonoClass * D.22196;
  struct MonoMethodMessage * msg;
  struct MonoDelegate * async_callback;
  struct MonoMulticastDelegate * mcast_delegate;
  struct MonoObject * state;
  struct MonoMethod * im;
  struct MonoClass * klass;
  struct MonoMethod * method;
  struct MonoMethod * method2;

  try
    {
      method = 0B;
      method2 = 0B;
      D.22150 = delegate == 0B;
      D.22151 = (long int) D.22150;
      D.22152 = __builtin_expect (D.22151, 0);
      if (D.22152 != 0) goto <D.22153>; else goto <D.22154>;
      <D.22153>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2147, "delegate");
      <D.22154>:
      mcast_delegate = delegate;
      D.22155 = mcast_delegate->prev;
      if (D.22155 != 0B) goto <D.22156>; else goto <D.22157>;
      <D.22156>:
      D.22158 = mono_get_exception_argument (0B, "The delegate must have only one target");
      mono_raise_exception (D.22158);
      <D.22157>:
      D.22159 = delegate->target;
      if (D.22159 != 0B) goto <D.22160>; else goto <D.22161>;
      <D.22160>:
      D.22159 = delegate->target;
      D.22162 = D.22159->vtable;
      D.22163 = D.22162->klass;
      D.22164 = mono_defaults.transparent_proxy_class;
      if (D.22163 == D.22164) goto <D.22165>; else goto <D.22166>;
      <D.22165>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.22169 = tp->remote_class;
        D.22170 = D.22169->proxy_class;
        D.22171 = BIT_FIELD_REF <*D.22170, 8, 272>;
        D.22172 = D.22171 & 128;
        if (D.22172 == 0) goto <D.22167>; else goto <D.22173>;
        <D.22173>:
        D.22174 = tp->rp;
        D.22175 = D.22174->context;
        D.22176 = mono_context_get ();
        if (D.22175 != D.22176) goto <D.22167>; else goto <D.22168>;
        <D.22167>:
        {
          struct MonoAsyncResult * ares;
          struct MonoObject * exc;
          struct MonoArray * out_args;

          try
            {
              method = delegate->method;
              D.22177 = mono_marshal_method_from_wrapper (method);
              msg = mono_method_call_message_new (D.22177, params, 0B, &async_callback, &state);
              state.7 = state;
              D.22179 = mono_domain_get ();
              ares = mono_async_result_new (D.22179, 0B, state.7, 0B, 0B);
              D.22180 = &ares->async_delegate;
              mono_gc_wbarrier_set_field (ares, D.22180, delegate);
              async_callback.8 = async_callback;
              D.22182 = &ares->async_callback;
              mono_gc_wbarrier_set_field (ares, D.22182, async_callback.8);
              D.22183 = &msg->async_result;
              mono_gc_wbarrier_set_field (msg, D.22183, ares);
              msg->call_type = 1;
              exc = 0B;
              D.22174 = tp->rp;
              mono_remoting_invoke (D.22174, msg, &exc, &out_args);
              exc.9 = exc;
              if (exc.9 != 0B) goto <D.22185>; else goto <D.22186>;
              <D.22185>:
              exc.9 = exc;
              mono_raise_exception (exc.9);
              <D.22186>:
              D.22187 = ares;
              return D.22187;
            }
          finally
            {
              exc = {CLOBBER};
              out_args = {CLOBBER};
            }
        }
        <D.22168>:
      }
      <D.22166>:
      <D.22161>:
      D.22188 = delegate->object.vtable;
      klass = D.22188->klass;
      method = mono_get_delegate_invoke (klass);
      method2 = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      if (method2 != 0B) goto <D.22189>; else goto <D.22190>;
      <D.22189>:
      method = method2;
      <D.22190>:
      D.22191 = method == 0B;
      D.22192 = (long int) D.22191;
      D.22193 = __builtin_expect (D.22192, 0);
      if (D.22193 != 0) goto <D.22194>; else goto <D.22195>;
      <D.22194>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2188, "method != NULL");
      <D.22195>:
      D.22196 = method->klass;
      im = mono_get_delegate_invoke (D.22196);
      msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
      state.7 = state;
      async_callback.8 = async_callback;
      D.22187 = mono_thread_pool_add (delegate, msg, async_callback.8, state.7);
      return D.22187;
    }
  finally
    {
      async_callback = {CLOBBER};
      state = {CLOBBER};
    }
}


mono_struct_delete_old (struct MonoClass * klass, char * ptr)
{
  struct MonoClassField * D.22200;
  short unsigned int D.22201;
  int D.22202;
  int D.22203;
  <unnamed-unsigned:1> D.22206;
  int D.22207;
  struct MonoMarshalSpec * D.22208;
  unsigned int D.22209;
  sizetype D.22210;
  <unnamed type> conv.10;
  int D.22212;
  struct MonoClass * D.22215;
  void * D.22216;
  unsigned int i.11;
  unsigned int D.22218;
  struct MonoMarshalType * info;
  int i;

  info = mono_marshal_load_type_info (klass);
  i = 0;
  goto <D.21569>;
  <D.21568>:
  {
    MonoMarshalNative ntype;
    MonoMarshalConv conv;
    struct MonoType * ftype;
    char * cpos;

    try
      {
        D.22200 = info->fields[i].field;
        ftype = D.22200->type;
        D.22201 = ftype->attrs;
        D.22202 = (int) D.22201;
        D.22203 = D.22202 & 16;
        if (D.22203 != 0) goto <D.22204>; else goto <D.22205>;
        <D.22204>:
        // predicted unlikely by continue predictor.
        goto <D.21558>;
        <D.22205>:
        D.22206 = klass->unicode;
        D.22207 = (int) D.22206;
        D.22208 = info->fields[i].mspec;
        ntype = mono_type_to_unmanaged (ftype, D.22208, 1, D.22207, &conv);
        D.22209 = info->fields[i].offset;
        D.22210 = (sizetype) D.22209;
        cpos = ptr + D.22210;
        conv.10 = conv;
        switch (conv.10) <default: <D.21567>, case 0: <D.21559>, case 3: <D.21564>, case 4: <D.21563>, case 7: <D.21561>, case 9: <D.21562>, case 10: <D.21565>, case 11: <D.21566>>
        <D.21559>:
        D.22212 = mono_type_is_struct (ftype);
        if (D.22212 != 0) goto <D.22213>; else goto <D.22214>;
        <D.22213>:
        D.22215 = ftype->data.klass;
        mono_struct_delete_old (D.22215, cpos);
        // predicted unlikely by continue predictor.
        goto <D.21558>;
        <D.22214>:
        goto <D.21560>;
        <D.21561>:
        goto <D.21560>;
        <D.21562>:
        <D.21563>:
        <D.21564>:
        <D.21565>:
        <D.21566>:
        D.22216 = MEM[(void * *)cpos];
        mono_marshal_free (D.22216);
        goto <D.21560>;
        <D.21567>:
        // predicted unlikely by continue predictor.
        goto <D.21558>;
        <D.21560>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.21558>:
  i = i + 1;
  <D.21569>:
  i.11 = (unsigned int) i;
  D.22218 = info->num_fields;
  if (i.11 < D.22218) goto <D.21568>; else goto <D.21570>;
  <D.21570>:
}


mono_string_utf16_to_builder2 (gunichar2 * text)
{
  struct MonoStringBuilder * D.22224;
  struct MonoClass * string_builder_class.12;
  struct MonoImage * D.22228;
  struct MonoClass * string_builder_class.13;
  _Bool D.22230;
  long int D.22231;
  long int D.22232;
  struct MonoMethod * sb_ctor.14;
  struct MonoMethod * sb_ctor.15;
  _Bool D.22237;
  long int D.22238;
  long int D.22239;
  int len.16;
  int len.17;
  long unsigned int D.22244;
  long unsigned int D.22245;
  gunichar2 * D.22246;
  short unsigned int D.22247;
  struct MonoDomain * D.22248;
  _Bool D.22249;
  long int D.22250;
  long int D.22251;
  struct MonoObject * exc.18;
  _Bool D.22255;
  long int D.22256;
  long int D.22257;
  int D.22260;
  long unsigned int D.22261;
  struct MonoString * D.22262;
  mono_unichar2 * D.22263;
  int len;
  struct MonoStringBuilder * sb;
  static struct MonoClass * string_builder_class;
  static struct MonoMethod * sb_ctor;
  void * args[1];
  struct MonoObject * exc;

  try
    {
      if (text == 0B) goto <D.22222>; else goto <D.22223>;
      <D.22222>:
      D.22224 = 0B;
      return D.22224;
      <D.22223>:
      string_builder_class.12 = string_builder_class;
      if (string_builder_class.12 == 0B) goto <D.22226>; else goto <D.22227>;
      <D.22226>:
      {
        struct MonoMethodDesc * desc;

        D.22228 = mono_defaults.corlib;
        string_builder_class.13 = mono_class_from_name (D.22228, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.13;
        string_builder_class.12 = string_builder_class;
        D.22230 = string_builder_class.12 == 0B;
        D.22231 = (long int) D.22230;
        D.22232 = __builtin_expect (D.22231, 0);
        if (D.22232 != 0) goto <D.22233>; else goto <D.22234>;
        <D.22233>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 846, "string_builder_class");
        <D.22234>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.12 = string_builder_class;
        sb_ctor.14 = mono_method_desc_search_in_class (desc, string_builder_class.12);
        sb_ctor = sb_ctor.14;
        sb_ctor.15 = sb_ctor;
        D.22237 = sb_ctor.15 == 0B;
        D.22238 = (long int) D.22237;
        D.22239 = __builtin_expect (D.22238, 0);
        if (D.22239 != 0) goto <D.22240>; else goto <D.22241>;
        <D.22240>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 849, "sb_ctor");
        <D.22241>:
        mono_method_desc_free (desc);
      }
      <D.22227>:
      len = 0;
      goto <D.18949>;
      <D.18948>:
      len.16 = len;
      len.17 = len.16 + 1;
      len = len.17;
      <D.18949>:
      len.16 = len;
      D.22244 = (long unsigned int) len.16;
      D.22245 = D.22244 * 2;
      D.22246 = text + D.22245;
      D.22247 = *D.22246;
      if (D.22247 != 0) goto <D.18948>; else goto <D.18950>;
      <D.18950>:
      string_builder_class.12 = string_builder_class;
      D.22248 = mono_domain_get ();
      sb = mono_object_new (D.22248, string_builder_class.12);
      D.22249 = sb == 0B;
      D.22250 = (long int) D.22249;
      D.22251 = __builtin_expect (D.22250, 0);
      if (D.22251 != 0) goto <D.22252>; else goto <D.22253>;
      <D.22252>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 857, "sb");
      <D.22253>:
      args[0] = &len;
      sb_ctor.15 = sb_ctor;
      mono_runtime_invoke (sb_ctor.15, sb, &args, &exc);
      exc.18 = exc;
      D.22255 = exc.18 != 0B;
      D.22256 = (long int) D.22255;
      D.22257 = __builtin_expect (D.22256, 0);
      if (D.22257 != 0) goto <D.22258>; else goto <D.22259>;
      <D.22258>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 860, "!exc");
      <D.22259>:
      len.16 = len;
      sb->length = len.16;
      len.16 = len;
      D.22260 = len.16 * 2;
      D.22261 = (long unsigned int) D.22260;
      D.22262 = sb->str;
      D.22263 = mono_string_chars (D.22262);
      memcpy (D.22263, text, D.22261);
      D.22224 = sb;
      return D.22224;
    }
  finally
    {
      len = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_string_utf8_to_builder2 (char * text)
{
  struct MonoStringBuilder * D.22268;
  struct MonoClass * string_builder_class.19;
  struct MonoImage * D.22272;
  struct MonoClass * string_builder_class.20;
  _Bool D.22274;
  long int D.22275;
  long int D.22276;
  struct MonoMethod * sb_ctor.21;
  struct MonoMethod * sb_ctor.22;
  _Bool D.22281;
  long int D.22282;
  long int D.22283;
  long unsigned int D.22286;
  int l.23;
  struct MonoDomain * D.22288;
  _Bool D.22289;
  long int D.22290;
  long int D.22291;
  struct MonoObject * exc.24;
  _Bool D.22295;
  long int D.22296;
  long int D.22297;
  int l;
  struct MonoStringBuilder * sb;
  static struct MonoClass * string_builder_class;
  static struct MonoMethod * sb_ctor;
  void * args[1];
  struct MonoObject * exc;

  try
    {
      if (text == 0B) goto <D.22266>; else goto <D.22267>;
      <D.22266>:
      D.22268 = 0B;
      return D.22268;
      <D.22267>:
      string_builder_class.19 = string_builder_class;
      if (string_builder_class.19 == 0B) goto <D.22270>; else goto <D.22271>;
      <D.22270>:
      {
        struct MonoMethodDesc * desc;

        D.22272 = mono_defaults.corlib;
        string_builder_class.20 = mono_class_from_name (D.22272, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.20;
        string_builder_class.19 = string_builder_class;
        D.22274 = string_builder_class.19 == 0B;
        D.22275 = (long int) D.22274;
        D.22276 = __builtin_expect (D.22275, 0);
        if (D.22276 != 0) goto <D.22277>; else goto <D.22278>;
        <D.22277>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 789, "string_builder_class");
        <D.22278>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.19 = string_builder_class;
        sb_ctor.21 = mono_method_desc_search_in_class (desc, string_builder_class.19);
        sb_ctor = sb_ctor.21;
        sb_ctor.22 = sb_ctor;
        D.22281 = sb_ctor.22 == 0B;
        D.22282 = (long int) D.22281;
        D.22283 = __builtin_expect (D.22282, 0);
        if (D.22283 != 0) goto <D.22284>; else goto <D.22285>;
        <D.22284>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 792, "sb_ctor");
        <D.22285>:
        mono_method_desc_free (desc);
      }
      <D.22271>:
      D.22286 = strlen (text);
      l.23 = (int) D.22286;
      l = l.23;
      string_builder_class.19 = string_builder_class;
      D.22288 = mono_domain_get ();
      sb = mono_object_new (D.22288, string_builder_class.19);
      D.22289 = sb == 0B;
      D.22290 = (long int) D.22289;
      D.22291 = __builtin_expect (D.22290, 0);
      if (D.22291 != 0) goto <D.22292>; else goto <D.22293>;
      <D.22292>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 799, "sb");
      <D.22293>:
      args[0] = &l;
      sb_ctor.22 = sb_ctor;
      mono_runtime_invoke (sb_ctor.22, sb, &args, &exc);
      exc.24 = exc;
      D.22295 = exc.24 != 0B;
      D.22296 = (long int) D.22295;
      D.22297 = __builtin_expect (D.22296, 0);
      if (D.22297 != 0) goto <D.22298>; else goto <D.22299>;
      <D.22298>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 802, "!exc");
      <D.22299>:
      mono_string_utf8_to_builder (sb, text);
      D.22268 = sb;
      return D.22268;
    }
  finally
    {
      l = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_marshal_set_last_error_windows (int error)
{

}


mono_array_to_byte_byvalarray (void * native_arr, struct MonoArray * arr, guint32 elnum)
{
  struct MonoClass * D.22302;

  D.22302 = mono_defaults.byte_class;
  mono_array_to_byvalarray (native_arr, arr, D.22302, elnum);
}


mono_array_to_byvalarray (void * native_arr, struct MonoArray * arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.22303;
  struct MonoClass * D.22304;
  struct MonoClass * D.22305;
  struct MonoClass * D.22306;
  _Bool D.22307;
  long int D.22308;
  long int D.22309;
  struct MonoClass * D.22312;
  long unsigned int D.22315;
  long int D.22316;
  char * D.22317;
  struct GError * error.25;
  gchar * D.22321;
  size_t iftmp.26;
  long unsigned int D.22323;
  long unsigned int D.22324;

  D.22303 = arr->obj.vtable;
  D.22304 = D.22303->klass;
  D.22305 = D.22304->element_class;
  D.22306 = mono_defaults.char_class;
  D.22307 = D.22305 != D.22306;
  D.22308 = (long int) D.22307;
  D.22309 = __builtin_expect (D.22308, 0);
  if (D.22309 != 0) goto <D.22310>; else goto <D.22311>;
  <D.22310>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 715, "arr->obj.vtable->klass->element_class == mono_defaults.char_class");
  <D.22311>:
  D.22312 = mono_defaults.byte_class;
  if (D.22312 == elclass) goto <D.22313>; else goto <D.22314>;
  <D.22313>:
  {
    char * as;
    struct GError * error;

    try
      {
        error = 0B;
        D.22315 = mono_array_length (arr);
        D.22316 = (long int) D.22315;
        D.22317 = mono_array_addr_with_size (arr, 2, 0);
        as = monoeg_g_utf16_to_utf8 (D.22317, D.22316, 0B, 0B, &error);
        error.25 = error;
        if (error.25 != 0B) goto <D.22319>; else goto <D.22320>;
        <D.22319>:
        {
          struct MonoException * exc;

          error.25 = error;
          D.22321 = error.25->message;
          exc = mono_get_exception_argument ("string", D.22321);
          error.25 = error;
          monoeg_g_error_free (error.25);
          mono_raise_exception (exc);
        }
        <D.22320>:
        D.22323 = strlen (as);
        D.22324 = (long unsigned int) elnum;
        if (D.22323 < D.22324) goto <D.22325>; else goto <D.22326>;
        <D.22325>:
        iftmp.26 = strlen (as);
        goto <D.22327>;
        <D.22326>:
        iftmp.26 = (size_t) elnum;
        <D.22327>:
        memcpy (native_arr, as, iftmp.26);
        monoeg_g_free (as);
      }
    finally
      {
        error = {CLOBBER};
      }
  }
  goto <D.22328>;
  <D.22314>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 731);
  <D.22328>:
}


mono_byvalarray_to_byte_array (struct MonoArray * arr, void * native_arr, guint32 elnum)
{
  struct MonoClass * D.22329;

  D.22329 = mono_defaults.byte_class;
  mono_byvalarray_to_array (arr, native_arr, D.22329, elnum);
}


mono_byvalarray_to_array (struct MonoArray * arr, void * native_arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.22330;
  struct MonoClass * D.22331;
  struct MonoClass * D.22332;
  struct MonoClass * D.22333;
  _Bool D.22334;
  long int D.22335;
  long int D.22336;
  struct MonoClass * D.22339;
  long int D.22342;
  struct GError * error.27;
  long int items_written.28;
  long unsigned int items_written.29;
  long unsigned int D.22348;
  char * D.22349;

  D.22330 = arr->obj.vtable;
  D.22331 = D.22330->klass;
  D.22332 = D.22331->element_class;
  D.22333 = mono_defaults.char_class;
  D.22334 = D.22332 != D.22333;
  D.22335 = (long int) D.22334;
  D.22336 = __builtin_expect (D.22335, 0);
  if (D.22336 != 0) goto <D.22337>; else goto <D.22338>;
  <D.22337>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 686, "arr->obj.vtable->klass->element_class == mono_defaults.char_class");
  <D.22338>:
  D.22339 = mono_defaults.byte_class;
  if (D.22339 == elclass) goto <D.22340>; else goto <D.22341>;
  <D.22340>:
  {
    struct GError * error;
    guint16 * ut;
    glong items_written;

    try
      {
        error = 0B;
        D.22342 = (long int) elnum;
        ut = monoeg_g_utf8_to_utf16 (native_arr, D.22342, 0B, &items_written, &error);
        error.27 = error;
        if (error.27 == 0B) goto <D.22344>; else goto <D.22345>;
        <D.22344>:
        items_written.28 = items_written;
        items_written.29 = (long unsigned int) items_written.28;
        D.22348 = items_written.29 * 2;
        D.22349 = mono_array_addr_with_size (arr, 2, 0);
        memcpy (D.22349, ut, D.22348);
        monoeg_g_free (ut);
        goto <D.22350>;
        <D.22345>:
        error.27 = error;
        monoeg_g_error_free (error.27);
        <D.22350>:
      }
    finally
      {
        error = {CLOBBER};
        items_written = {CLOBBER};
      }
  }
  goto <D.22351>;
  <D.22341>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 703);
  <D.22351>:
}


mono_string_to_lpstr (struct MonoString * s)
{
  void * D.22352;

  D.22352 = mono_string_to_utf8 (s);
  return D.22352;
}


mono_string_new_len_wrapper (const char * text, guint length)
{
  struct MonoString * D.22354;
  struct MonoDomain * D.22355;

  D.22355 = mono_domain_get ();
  D.22354 = mono_string_new_len (D.22355, text, length);
  return D.22354;
}


mono_string_from_byvalwstr (gunichar2 * data, int max_len)
{
  struct MonoString * D.22359;
  long unsigned int D.22360;
  long unsigned int D.22361;
  gunichar2 * D.22362;
  short unsigned int D.22363;
  int D.22364;
  struct MonoDomain * domain;
  int len;

  domain = mono_domain_get ();
  len = 0;
  if (data == 0B) goto <D.22357>; else goto <D.22358>;
  <D.22357>:
  D.22359 = 0B;
  return D.22359;
  <D.22358>:
  goto <D.18833>;
  <D.18832>:
  len = len + 1;
  <D.18833>:
  D.22360 = (long unsigned int) len;
  D.22361 = D.22360 * 2;
  D.22362 = data + D.22361;
  D.22363 = *D.22362;
  if (D.22363 != 0) goto <D.18832>; else goto <D.18834>;
  <D.18834>:
  D.22364 = MIN_EXPR <max_len, len>;
  D.22359 = mono_string_new_utf16 (domain, data, D.22364);
  return D.22359;
}


mono_marshal_string_to_utf16_copy (struct MonoString * s)
{
  void * D.22368;
  int D.22369;
  int D.22370;
  int D.22371;
  long unsigned int D.22372;
  int D.22373;
  int D.22374;
  long unsigned int D.22375;
  mono_unichar2 * D.22376;
  int D.22377;
  long unsigned int D.22378;
  long unsigned int D.22379;
  gunichar2 * D.22380;

  if (s == 0B) goto <D.22366>; else goto <D.22367>;
  <D.22366>:
  D.22368 = 0B;
  return D.22368;
  <D.22367>:
  {
    gunichar2 * res;

    D.22369 = mono_string_length (s);
    D.22370 = D.22369 + 1;
    D.22371 = D.22370 * 2;
    D.22372 = (long unsigned int) D.22371;
    res = mono_marshal_alloc (D.22372);
    D.22373 = mono_string_length (s);
    D.22374 = D.22373 * 2;
    D.22375 = (long unsigned int) D.22374;
    D.22376 = mono_string_chars (s);
    memcpy (res, D.22376, D.22375);
    D.22377 = mono_string_length (s);
    D.22378 = (long unsigned int) D.22377;
    D.22379 = D.22378 * 2;
    D.22380 = res + D.22379;
    *D.22380 = 0;
    D.22368 = res;
    return D.22368;
  }
}


register_icall (void * func, const char * name, const char * sigstr, gboolean save)
{
  struct MonoMethodSignature * sig;

  sig = mono_create_icall_signature (sigstr);
  mono_register_jit_icall (func, name, sig, save);
}


mono_marshal_cleanup ()
{
  unsigned int load_type_info_tls_id.30;
  unsigned int last_error_tls_id.31;

  mono_cominterop_cleanup ();
  load_type_info_tls_id.30 = load_type_info_tls_id;
  mono_native_tls_free (load_type_info_tls_id.30);
  last_error_tls_id.31 = last_error_tls_id;
  mono_native_tls_free (last_error_tls_id.31);
  DeleteCriticalSection (&marshal_mutex);
  marshal_mutex_initialized = 0;
}


mono_native_tls_free (pthread_key_t key)
{
  pthread_key_delete (key);
}


mono_delegate_to_ftnptr (struct MonoDelegate * delegate)
{
  void * D.22386;
  void * D.22387;
  struct MonoVTable * D.22390;
  unsigned char D.22391;
  unsigned char D.22392;
  _Bool D.22393;
  long int D.22394;
  long int D.22395;
  struct MonoMethodSignature * D.22398;
  unsigned char D.22399;
  unsigned char D.22400;
  const char * exc_class.32;
  _Bool D.22406;
  long int D.22407;
  long int D.22408;
  const char * exc_arg.33;
  struct MonoImage * D.22412;
  struct MonoException * D.22413;
  struct MonoObject * D.22414;
  void * D.22417;
  struct MonoMethod * method;
  struct MonoMethod * wrapper;
  struct MonoClass * klass;
  uint32_t target_handle;

  target_handle = 0;
  if (delegate == 0B) goto <D.22384>; else goto <D.22385>;
  <D.22384>:
  D.22386 = 0B;
  return D.22386;
  <D.22385>:
  D.22387 = delegate->delegate_trampoline;
  if (D.22387 != 0B) goto <D.22388>; else goto <D.22389>;
  <D.22388>:
  D.22386 = delegate->delegate_trampoline;
  return D.22386;
  <D.22389>:
  D.22390 = MEM[(struct MonoObject *)delegate].vtable;
  klass = D.22390->klass;
  D.22391 = BIT_FIELD_REF <*klass, 8, 280>;
  D.22392 = D.22391 & 1;
  D.22393 = D.22392 == 0;
  D.22394 = (long int) D.22393;
  D.22395 = __builtin_expect (D.22394, 0);
  if (D.22395 != 0) goto <D.22396>; else goto <D.22397>;
  <D.22396>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 352, "klass->delegate");
  <D.22397>:
  method = delegate->method;
  D.22398 = mono_method_signature (method);
  D.22399 = BIT_FIELD_REF <*D.22398, 8, 120>;
  D.22400 = D.22399 & 1;
  if (D.22400 != 0) goto <D.22401>; else goto <D.22402>;
  <D.22401>:
  {
    const char * exc_class;
    const char * exc_arg;
    void * ftnptr;

    try
      {
        ftnptr = mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
        if (ftnptr == 0B) goto <D.22403>; else goto <D.22404>;
        <D.22403>:
        exc_class.32 = exc_class;
        D.22406 = exc_class.32 == 0B;
        D.22407 = (long int) D.22406;
        D.22408 = __builtin_expect (D.22407, 0);
        if (D.22408 != 0) goto <D.22409>; else goto <D.22410>;
        <D.22409>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 362, "exc_class");
        <D.22410>:
        exc_arg.33 = exc_arg;
        exc_class.32 = exc_class;
        D.22412 = mono_defaults.corlib;
        D.22413 = mono_exception_from_name_msg (D.22412, "System", exc_class.32, exc_arg.33);
        mono_raise_exception (D.22413);
        <D.22404>:
        D.22386 = ftnptr;
        return D.22386;
      }
    finally
      {
        exc_class = {CLOBBER};
        exc_arg = {CLOBBER};
      }
  }
  <D.22402>:
  D.22414 = delegate->target;
  if (D.22414 != 0B) goto <D.22415>; else goto <D.22416>;
  <D.22415>:
  D.22414 = delegate->target;
  target_handle = mono_gchandle_new_weakref (D.22414, 0);
  <D.22416>:
  wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
  D.22417 = mono_compile_method (wrapper);
  delegate->delegate_trampoline = D.22417;
  delegate_hash_table_add (delegate);
  mono_object_register_finalizer (delegate);
  D.22386 = delegate->delegate_trampoline;
  return D.22386;
}


delegate_hash_table_add (struct MonoDelegate * d)
{
  _Bool D.22422;
  long int D.22423;
  long int D.22424;
  struct GHashTable * delegate_hash_table.34;
  struct GHashTable * delegate_hash_table.35;
  int D.22431;
  void * D.22434;
  void * D.22435;
  long int D.22436;
  long unsigned int D.22437;
  void * D.22438;
  _Bool D.22444;
  long int D.22445;
  long int D.22446;
  guint32 gchandle;
  guint32 old_gchandle;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22420>; else goto <D.22421>;
    <D.22420>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22421>:
    D.22422 = ret != 0;
    D.22423 = (long int) D.22422;
    D.22424 = __builtin_expect (D.22423, 0);
    if (D.22424 != 0) goto <D.22425>; else goto <D.22426>;
    <D.22425>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 420, "ret == 0");
    <D.22426>:
  }
  delegate_hash_table.34 = delegate_hash_table;
  if (delegate_hash_table.34 == 0B) goto <D.22428>; else goto <D.22429>;
  <D.22428>:
  delegate_hash_table.35 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.35;
  <D.22429>:
  D.22431 = mono_gc_is_moving ();
  if (D.22431 != 0) goto <D.22432>; else goto <D.22433>;
  <D.22432>:
  gchandle = mono_gchandle_new_weakref (d, 0);
  D.22434 = d->delegate_trampoline;
  delegate_hash_table.34 = delegate_hash_table;
  D.22435 = monoeg_g_hash_table_lookup (delegate_hash_table.34, D.22434);
  D.22436 = (long int) D.22435;
  old_gchandle = (guint32) D.22436;
  D.22437 = (long unsigned int) gchandle;
  D.22438 = (void *) D.22437;
  D.22434 = d->delegate_trampoline;
  delegate_hash_table.34 = delegate_hash_table;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.34, D.22434, D.22438, 0);
  if (old_gchandle != 0) goto <D.22439>; else goto <D.22440>;
  <D.22439>:
  mono_gchandle_free (old_gchandle);
  <D.22440>:
  goto <D.22441>;
  <D.22433>:
  D.22434 = d->delegate_trampoline;
  delegate_hash_table.34 = delegate_hash_table;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.34, D.22434, d, 0);
  <D.22441>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22442>; else goto <D.22443>;
    <D.22442>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22443>:
    D.22444 = ret != 0;
    D.22445 = (long int) D.22444;
    D.22446 = __builtin_expect (D.22445, 0);
    if (D.22446 != 0) goto <D.22447>; else goto <D.22448>;
    <D.22447>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 432, "ret == 0");
    <D.22448>:
  }
}


delegate_hash_table_new ()
{
  struct GHashTable * D.22449;

  D.22449 = monoeg_g_hash_table_new (0B, 0B);
  return D.22449;
}


mono_marshal_use_aot_wrappers (gboolean use)
{
  use_aot_wrappers = use;
}


mono_ftnptr_to_delegate (struct MonoClass * klass, void * ftn)
{
  void * ftn.36;
  struct MonoDelegate * D.22454;
  _Bool D.22457;
  long int D.22458;
  long int D.22459;
  struct GHashTable * delegate_hash_table.37;
  struct GHashTable * delegate_hash_table.38;
  int D.22466;
  void * D.22469;
  long int D.22470;
  _Bool D.22473;
  long int D.22474;
  long int D.22475;
  _Bool D.22484;
  long int D.22485;
  long int D.22486;
  int use_aot_wrappers.39;
  struct MonoClass * D.22494;
  struct MonoDomain * D.22495;
  struct MonoMethodSignature * D.22497;
  short unsigned int D.22498;
  int D.22499;
  int D.22500;
  long unsigned int D.22501;
  long unsigned int D.22502;
  struct MonoMethodSignature * D.22503;
  struct MonoImage * D.22504;
  struct MonoMethodSignature * D.22505;
  short unsigned int D.22506;
  long unsigned int D.22507;
  long unsigned int D.22508;
  struct MonoMarshalSpec * * D.22509;
  struct MonoMarshalSpec * D.22510;
  struct MonoDomain * D.22513;
  void * D.22514;
  struct MonoVTable * D.22515;
  struct MonoDomain * D.22516;
  struct MonoDomain * D.22517;
  struct MonoException * D.22520;
  guint32 gchandle;
  struct MonoDelegate * d;

  ftn.36 = ftn;
  if (ftn.36 == 0B) goto <D.22452>; else goto <D.22453>;
  <D.22452>:
  D.22454 = 0B;
  return D.22454;
  <D.22453>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22455>; else goto <D.22456>;
    <D.22455>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22456>:
    D.22457 = ret != 0;
    D.22458 = (long int) D.22457;
    D.22459 = __builtin_expect (D.22458, 0);
    if (D.22459 != 0) goto <D.22460>; else goto <D.22461>;
    <D.22460>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 483, "ret == 0");
    <D.22461>:
  }
  delegate_hash_table.37 = delegate_hash_table;
  if (delegate_hash_table.37 == 0B) goto <D.22463>; else goto <D.22464>;
  <D.22463>:
  delegate_hash_table.38 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.38;
  <D.22464>:
  D.22466 = mono_gc_is_moving ();
  if (D.22466 != 0) goto <D.22467>; else goto <D.22468>;
  <D.22467>:
  ftn.36 = ftn;
  delegate_hash_table.37 = delegate_hash_table;
  D.22469 = monoeg_g_hash_table_lookup (delegate_hash_table.37, ftn.36);
  D.22470 = (long int) D.22469;
  gchandle = (guint32) D.22470;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22471>; else goto <D.22472>;
    <D.22471>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22472>:
    D.22473 = ret != 0;
    D.22474 = (long int) D.22473;
    D.22475 = __builtin_expect (D.22474, 0);
    if (D.22475 != 0) goto <D.22476>; else goto <D.22477>;
    <D.22476>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 489, "ret == 0");
    <D.22477>:
  }
  if (gchandle != 0) goto <D.22478>; else goto <D.22479>;
  <D.22478>:
  d = mono_gchandle_get_target (gchandle);
  goto <D.22480>;
  <D.22479>:
  d = 0B;
  <D.22480>:
  goto <D.22481>;
  <D.22468>:
  ftn.36 = ftn;
  delegate_hash_table.37 = delegate_hash_table;
  d = monoeg_g_hash_table_lookup (delegate_hash_table.37, ftn.36);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22482>; else goto <D.22483>;
    <D.22482>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22483>:
    D.22484 = ret != 0;
    D.22485 = (long int) D.22484;
    D.22486 = __builtin_expect (D.22485, 0);
    if (D.22486 != 0) goto <D.22487>; else goto <D.22488>;
    <D.22487>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 496, "ret == 0");
    <D.22488>:
  }
  <D.22481>:
  if (d == 0B) goto <D.22489>; else goto <D.22490>;
  <D.22489>:
  {
    struct MonoMethodSignature * sig;
    struct MonoMethod * wrapper;
    struct MonoMarshalSpec * * mspecs;
    struct MonoMethod * invoke;
    struct MonoMethodPInvoke piinfo;
    struct MonoObject * this;
    int i;

    try
      {
        invoke = mono_get_delegate_invoke (klass);
        use_aot_wrappers.39 = use_aot_wrappers;
        if (use_aot_wrappers.39 != 0) goto <D.22492>; else goto <D.22493>;
        <D.22492>:
        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
        D.22494 = mono_defaults.int_class;
        D.22495 = mono_domain_get ();
        this = mono_value_box (D.22495, D.22494, &ftn);
        goto <D.22496>;
        <D.22493>:
        memset (&piinfo, 0, 56);
        parse_unmanaged_function_pointer_attr (klass, &piinfo);
        D.22497 = mono_method_signature (invoke);
        D.22498 = D.22497->param_count;
        D.22499 = (int) D.22498;
        D.22500 = D.22499 + 1;
        D.22501 = (long unsigned int) D.22500;
        D.22502 = D.22501 * 8;
        mspecs = monoeg_malloc0 (D.22502);
        mono_method_get_marshal_info (invoke, mspecs);
        D.22503 = mono_method_signature (invoke);
        sig = mono_metadata_signature_dup (D.22503);
        sig->hasthis = 0;
        ftn.36 = ftn;
        D.22504 = klass->image;
        wrapper = mono_marshal_get_native_func_wrapper (D.22504, sig, &piinfo, mspecs, ftn.36);
        this = 0B;
        D.22505 = mono_method_signature (invoke);
        D.22506 = D.22505->param_count;
        i = (int) D.22506;
        goto <D.18816>;
        <D.18815>:
        D.22507 = (long unsigned int) i;
        D.22508 = D.22507 * 8;
        D.22509 = mspecs + D.22508;
        D.22510 = *D.22509;
        if (D.22510 != 0B) goto <D.22511>; else goto <D.22512>;
        <D.22511>:
        D.22507 = (long unsigned int) i;
        D.22508 = D.22507 * 8;
        D.22509 = mspecs + D.22508;
        D.22510 = *D.22509;
        mono_metadata_free_marshal_spec (D.22510);
        <D.22512>:
        i = i + -1;
        <D.18816>:
        if (i >= 0) goto <D.18815>; else goto <D.18817>;
        <D.18817>:
        monoeg_g_free (mspecs);
        monoeg_g_free (sig);
        <D.22496>:
        D.22513 = mono_domain_get ();
        d = mono_object_new (D.22513, klass);
        D.22514 = mono_compile_method (wrapper);
        mono_delegate_ctor_with_method (d, this, D.22514, wrapper);
      }
    finally
      {
        piinfo = {CLOBBER};
      }
  }
  <D.22490>:
  D.22515 = d->object.vtable;
  D.22516 = D.22515->domain;
  D.22517 = mono_domain_get ();
  if (D.22516 != D.22517) goto <D.22518>; else goto <D.22519>;
  <D.22518>:
  D.22520 = mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain");
  mono_raise_exception (D.22520);
  <D.22519>:
  D.22454 = d;
  return D.22454;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.22524;
  int D.22529;
  void * D.22531;
  long unsigned int D.22532;

  D.22524 = __builtin_constant_p (__len);
  if (D.22524 != 0) goto <D.22525>; else goto <D.22526>;
  <D.22525>:
  if (__len == 0) goto <D.22527>; else goto <D.22528>;
  <D.22527>:
  D.22529 = __builtin_constant_p (__ch);
  if (D.22529 == 0) goto <D.22522>; else goto <D.22530>;
  <D.22530>:
  if (__ch != 0) goto <D.22522>; else goto <D.22523>;
  <D.22522>:
  __warn_memset_zero_len ();
  D.22531 = __dest;
  return D.22531;
  <D.22523>:
  <D.22528>:
  <D.22526>:
  D.22532 = __builtin_object_size (__dest, 0);
  D.22531 = __builtin___memset_chk (__dest, __ch, __len, D.22532);
  return D.22531;
}


parse_unmanaged_function_pointer_attr (struct MonoClass * klass, struct MonoMethodPInvoke * piinfo)
{
  struct MonoClass * UnmanagedFunctionPointerAttribute.40;
  struct MonoImage * D.22537;
  struct MonoClass * UnmanagedFunctionPointerAttribute.41;
  int D.22543;
  int D.22548;
  int D.22549;
  signed short D.22550;
  signed short iftmp.42;
  int D.22552;
  int D.22555;
  unsigned short D.22556;
  unsigned short D.22557;
  signed short D.22559;
  unsigned char D.22560;
  signed short D.22561;
  signed short D.22562;
  short unsigned int D.22563;
  int D.22564;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoCustomAttrInfo * cinfo;
  struct MonoReflectionUnmanagedFunctionPointerAttribute * attr;

  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.40 == 0B) goto <D.22535>; else goto <D.22536>;
  <D.22535>:
  D.22537 = mono_defaults.corlib;
  UnmanagedFunctionPointerAttribute.41 = mono_class_from_name (D.22537, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
  UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.41;
  <D.22536>:
  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.40 != 0B) goto <D.22539>; else goto <D.22540>;
  <D.22539>:
  cinfo = mono_custom_attrs_from_class (klass);
  if (cinfo != 0B) goto <D.22541>; else goto <D.22542>;
  <D.22541>:
  D.22543 = mono_runtime_get_no_exec ();
  if (D.22543 == 0) goto <D.22544>; else goto <D.22545>;
  <D.22544>:
  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  attr = mono_custom_attrs_get_attr (cinfo, UnmanagedFunctionPointerAttribute.40);
  if (attr != 0B) goto <D.22546>; else goto <D.22547>;
  <D.22546>:
  D.22548 = attr->call_conv;
  D.22549 = D.22548 << 8;
  D.22550 = (signed short) D.22549;
  D.22552 = attr->charset;
  if (D.22552 != 0) goto <D.22553>; else goto <D.22554>;
  <D.22553>:
  D.22552 = attr->charset;
  D.22555 = D.22552 + -1;
  D.22556 = (unsigned short) D.22555;
  D.22557 = D.22556 * 2;
  iftmp.42 = (signed short) D.22557;
  goto <D.22558>;
  <D.22554>:
  iftmp.42 = 1;
  <D.22558>:
  D.22559 = D.22550 | iftmp.42;
  D.22560 = attr->set_last_error;
  D.22561 = (signed short) D.22560;
  D.22562 = D.22559 | D.22561;
  D.22563 = (short unsigned int) D.22562;
  piinfo->piflags = D.22563;
  <D.22547>:
  D.22564 = cinfo->cached;
  if (D.22564 == 0) goto <D.22565>; else goto <D.22566>;
  <D.22565>:
  mono_custom_attrs_free (cinfo);
  <D.22566>:
  <D.22545>:
  <D.22542>:
  <D.22540>:
}


mono_delegate_free_ftnptr (struct MonoDelegate * delegate)
{
  void * * D.22567;
  struct MonoObject * D.22568;
  void * D.22573;
  struct MonoDomain * D.22574;
  _Bool D.22575;
  long int D.22576;
  long int D.22577;
  void * * D.22580;
  void * D.22581;
  long int D.22582;
  struct MonoVTable * D.22585;
  struct MonoDomain * D.22586;
  struct MonoJitInfo * ji;
  void * ptr;

  delegate_hash_table_remove (delegate);
  D.22567 = &delegate->delegate_trampoline;
  ptr = InterlockedExchangePointer (D.22567, 0B);
  D.22568 = delegate->target;
  if (D.22568 == 0B) goto <D.22569>; else goto <D.22570>;
  <D.22569>:
  return;
  <D.22570>:
  if (ptr != 0B) goto <D.22571>; else goto <D.22572>;
  <D.22571>:
  {
    uint32_t gchandle;
    void * * method_data;
    struct MonoMethod * method;

    D.22573 = mono_get_addr_from_ftnptr (ptr);
    D.22574 = mono_domain_get ();
    ji = mono_jit_info_table_find (D.22574, D.22573);
    D.22575 = ji == 0B;
    D.22576 = (long int) D.22575;
    D.22577 = __builtin_expect (D.22576, 0);
    if (D.22577 != 0) goto <D.22578>; else goto <D.22579>;
    <D.22578>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 562, "ji");
    <D.22579>:
    method = mono_jit_info_get_method (ji);
    method_data = MEM[(struct MonoMethodWrapper *)method].method_data;
    D.22580 = method_data + 16;
    D.22581 = *D.22580;
    D.22582 = (long int) D.22581;
    gchandle = (uint32_t) D.22582;
    if (gchandle != 0) goto <D.22583>; else goto <D.22584>;
    <D.22583>:
    mono_gchandle_free (gchandle);
    <D.22584>:
    D.22585 = MEM[(struct MonoObject *)delegate].vtable;
    D.22586 = D.22585->domain;
    mono_runtime_free_method (D.22586, method);
  }
  <D.22572>:
}


delegate_hash_table_remove (struct MonoDelegate * d)
{
  _Bool D.22590;
  long int D.22591;
  long int D.22592;
  struct GHashTable * delegate_hash_table.43;
  struct GHashTable * delegate_hash_table.44;
  int D.22599;
  void * D.22602;
  void * D.22603;
  long int D.22604;
  _Bool D.22607;
  long int D.22608;
  long int D.22609;
  int D.22612;
  guint32 gchandle;

  gchandle = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22588>; else goto <D.22589>;
    <D.22588>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22589>:
    D.22590 = ret != 0;
    D.22591 = (long int) D.22590;
    D.22592 = __builtin_expect (D.22591, 0);
    if (D.22592 != 0) goto <D.22593>; else goto <D.22594>;
    <D.22593>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 403, "ret == 0");
    <D.22594>:
  }
  delegate_hash_table.43 = delegate_hash_table;
  if (delegate_hash_table.43 == 0B) goto <D.22596>; else goto <D.22597>;
  <D.22596>:
  delegate_hash_table.44 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.44;
  <D.22597>:
  D.22599 = mono_gc_is_moving ();
  if (D.22599 != 0) goto <D.22600>; else goto <D.22601>;
  <D.22600>:
  D.22602 = d->delegate_trampoline;
  delegate_hash_table.43 = delegate_hash_table;
  D.22603 = monoeg_g_hash_table_lookup (delegate_hash_table.43, D.22602);
  D.22604 = (long int) D.22603;
  gchandle = (guint32) D.22604;
  <D.22601>:
  D.22602 = d->delegate_trampoline;
  delegate_hash_table.43 = delegate_hash_table;
  monoeg_g_hash_table_remove (delegate_hash_table.43, D.22602);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22605>; else goto <D.22606>;
    <D.22605>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22606>:
    D.22607 = ret != 0;
    D.22608 = (long int) D.22607;
    D.22609 = __builtin_expect (D.22608, 0);
    if (D.22609 != 0) goto <D.22610>; else goto <D.22611>;
    <D.22610>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 409, "ret == 0");
    <D.22611>:
  }
  D.22612 = mono_gc_is_moving ();
  if (D.22612 != 0) goto <D.22613>; else goto <D.22614>;
  <D.22613>:
  mono_gchandle_free (gchandle);
  <D.22614>:
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  long unsigned int new_val.45;
  long unsigned int old_val.46;
  long unsigned int D.22617;
  void * D.22618;
  void * D.22619;
  void * old_val;

  <D.18230>:
  old_val = *val;
  new_val.45 = (long unsigned int) new_val;
  old_val.46 = (long unsigned int) old_val;
  D.22617 = __sync_val_compare_and_swap_8 (val, old_val.46, new_val.45);
  D.22618 = (void *) D.22617;
  if (D.22618 != old_val) goto <D.18230>; else goto <D.18231>;
  <D.18231>:
  D.22619 = old_val;
  return D.22619;
}


mono_array_to_savearray (struct MonoArray * array)
{
  void * D.22623;

  if (array == 0B) goto <D.22621>; else goto <D.22622>;
  <D.22621>:
  D.22623 = 0B;
  return D.22623;
  <D.22622>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 597);
  D.22623 = 0B;
  return D.22623;
}


mono_array_to_lparray (struct MonoArray * array)
{
  void * D.22627;
  struct MonoVTable * D.22628;
  struct MonoClass * D.22629;
  unsigned char D.22630;
  int D.22631;
  unsigned int D.22632;
  long unsigned int D.22633;
  long unsigned int D.22634;
  long unsigned int D.22635;
  long unsigned int D.22636;
  void * * D.22637;
  sizetype D.22638;
  double * D.22639;
  void * D.22640;
  void * D.22641;
  void * * nativeArray;
  int nativeArraySize;
  int i;
  struct MonoClass * klass;

  nativeArray = 0B;
  nativeArraySize = 0;
  i = 0;
  if (array == 0B) goto <D.22625>; else goto <D.22626>;
  <D.22625>:
  D.22627 = 0B;
  return D.22627;
  <D.22626>:
  D.22628 = array->obj.vtable;
  klass = D.22628->klass;
  D.22629 = klass->element_class;
  D.22630 = D.22629->byval_arg.type;
  D.22631 = (int) D.22630;
  switch (D.22631) <default: <D.18872>, case 1: <D.18845>, case 2: <D.18851>, case 3: <D.18854>, case 4: <D.18852>, case 5: <D.18850>, case 6: <D.18855>, case 7: <D.18853>, case 8: <D.18858>, case 9: <D.18859>, case 10: <D.18861>, case 11: <D.18860>, case 12: <D.18862>, case 13: <D.18863>, case 14: <D.18871>, case 15: <D.18865>, case 17: <D.18864>, case 18: <D.18846>, case 20: <D.18869>, case 21: <D.18867>, case 24: <D.18856>, case 25: <D.18857>, case 28: <D.18868>, case 29: <D.18870>>
  <D.18845>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 620);
  <D.18846>:
  D.22632 = array->max_length;
  nativeArraySize = (int) D.22632;
  D.22633 = (long unsigned int) nativeArraySize;
  D.22634 = D.22633 * 8;
  nativeArray = malloc (D.22634);
  i = 0;
  goto <D.18848>;
  <D.18847>:
  D.22635 = (long unsigned int) i;
  D.22636 = D.22635 * 8;
  D.22637 = nativeArray + D.22636;
  D.22638 = (sizetype) i;
  D.22639 = &array->vector[D.22638];
  D.22640 = MEM[(void * *)D.22639];
  D.22641 = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (D.22640);
  *D.22637 = D.22641;
  i = i + 1;
  <D.18848>:
  if (i < nativeArraySize) goto <D.18847>; else goto <D.18849>;
  <D.18849>:
  D.22627 = nativeArray;
  return D.22627;
  <D.18850>:
  <D.18851>:
  <D.18852>:
  <D.18853>:
  <D.18854>:
  <D.18855>:
  <D.18856>:
  <D.18857>:
  <D.18858>:
  <D.18859>:
  <D.18860>:
  <D.18861>:
  <D.18862>:
  <D.18863>:
  <D.18864>:
  <D.18865>:
  goto <D.18866>;
  <D.18867>:
  <D.18868>:
  <D.18869>:
  <D.18870>:
  <D.18871>:
  <D.18872>:
  D.22629 = klass->element_class;
  D.22630 = D.22629->byval_arg.type;
  D.22631 = (int) D.22630;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.22631);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 653);
  <D.18866>:
  D.22627 = &array->vector;
  return D.22627;
}


mono_free_lparray (struct MonoArray * array, void * * nativeArray)
{
  struct MonoVTable * D.22648;
  struct MonoClass * D.22649;
  unsigned char D.22650;
  int D.22651;
  long unsigned int D.22652;
  long unsigned int D.22653;
  void * * D.22654;
  void * D.22655;
  unsigned int i.47;
  unsigned int D.22657;
  struct MonoClass * klass;
  int i;

  i = 0;
  if (array == 0B) goto <D.22644>; else goto <D.22645>;
  <D.22644>:
  return;
  <D.22645>:
  if (nativeArray == 0B) goto <D.22646>; else goto <D.22647>;
  <D.22646>:
  return;
  <D.22647>:
  D.22648 = array->obj.vtable;
  klass = D.22648->klass;
  D.22649 = klass->element_class;
  D.22650 = D.22649->byval_arg.type;
  D.22651 = (int) D.22650;
  switch (D.22651) <default: <D.22658>, case 18: <D.18879>>
  <D.18879>:
  i = 0;
  goto <D.18881>;
  <D.18880>:
  D.22652 = (long unsigned int) i;
  D.22653 = D.22652 * 8;
  D.22654 = nativeArray + D.22653;
  D.22655 = *D.22654;
  mono_marshal_free_ccw (D.22655);
  i = i + 1;
  <D.18881>:
  i.47 = (unsigned int) i;
  D.22657 = array->max_length;
  if (i.47 < D.22657) goto <D.18880>; else goto <D.18882>;
  <D.18882>:
  free (nativeArray);
  goto <D.18883>;
  <D.22658>:
  <D.18883>:
}


mono_string_utf8_to_builder (struct MonoStringBuilder * sb, char * text)
{
  _Bool D.22660;
  _Bool D.22661;
  _Bool D.22662;
  long unsigned int D.22665;
  long int D.22666;
  glong iftmp.48;
  struct MonoString * D.22668;
  int D.22671;
  long int items_written.49;
  glong iftmp.50;
  struct GError * error.51;
  struct MonoString * D.22686;
  int D.22687;
  struct MonoDomain * D.22688;
  struct MonoString * D.22689;
  struct MonoString * * D.22690;
  long int D.22691;
  long unsigned int D.22692;
  mono_unichar2 * D.22693;
  int D.22694;
  struct GError * error;
  guint16 * ut;
  glong items_written;
  int l;

  try
    {
      error = 0B;
      D.22660 = sb == 0B;
      D.22661 = text == 0B;
      D.22662 = D.22660 | D.22661;
      if (D.22662 != 0) goto <D.22663>; else goto <D.22664>;
      <D.22663>:
      return;
      <D.22664>:
      D.22665 = strlen (text);
      l = (int) D.22665;
      D.22666 = (long int) l;
      ut = monoeg_g_utf8_to_utf16 (text, D.22666, 0B, &items_written, &error);
      D.22668 = sb->str;
      if (D.22668 != 0B) goto <D.22669>; else goto <D.22670>;
      <D.22669>:
      D.22668 = sb->str;
      D.22671 = D.22668->length;
      iftmp.48 = (glong) D.22671;
      goto <D.22672>;
      <D.22670>:
      iftmp.48 = 16;
      <D.22672>:
      items_written.49 = items_written;
      if (iftmp.48 < items_written.49) goto <D.22674>; else goto <D.22675>;
      <D.22674>:
      D.22668 = sb->str;
      if (D.22668 != 0B) goto <D.22677>; else goto <D.22678>;
      <D.22677>:
      D.22668 = sb->str;
      D.22671 = D.22668->length;
      iftmp.50 = (glong) D.22671;
      goto <D.22679>;
      <D.22678>:
      iftmp.50 = 16;
      <D.22679>:
      items_written = iftmp.50;
      <D.22675>:
      error.51 = error;
      if (error.51 == 0B) goto <D.22681>; else goto <D.22682>;
      <D.22681>:
      D.22668 = sb->str;
      if (D.22668 == 0B) goto <D.22683>; else goto <D.22685>;
      <D.22685>:
      D.22668 = sb->str;
      D.22686 = sb->cached_str;
      if (D.22668 == D.22686) goto <D.22683>; else goto <D.22684>;
      <D.22683>:
      items_written.49 = items_written;
      D.22687 = (int) items_written.49;
      D.22688 = mono_domain_get ();
      D.22689 = mono_string_new_size (D.22688, D.22687);
      D.22690 = &sb->str;
      mono_gc_wbarrier_set_field (sb, D.22690, D.22689);
      <D.22684>:
      items_written.49 = items_written;
      D.22691 = items_written.49 * 2;
      D.22692 = (long unsigned int) D.22691;
      D.22668 = sb->str;
      D.22693 = mono_string_chars (D.22668);
      memcpy (D.22693, ut, D.22692);
      items_written.49 = items_written;
      D.22694 = (int) items_written.49;
      sb->length = D.22694;
      sb->cached_str = 0B;
      goto <D.22695>;
      <D.22682>:
      error.51 = error;
      monoeg_g_error_free (error.51);
      <D.22695>:
      monoeg_g_free (ut);
    }
  finally
    {
      error = {CLOBBER};
      items_written = {CLOBBER};
    }
}


mono_string_utf16_to_builder (struct MonoStringBuilder * sb, gunichar2 * text)
{
  _Bool D.22699;
  _Bool D.22700;
  _Bool D.22701;
  struct MonoString * D.22704;
  mono_unichar2 * D.22705;
  _Bool D.22706;
  long int D.22707;
  long int D.22708;
  long unsigned int D.22711;
  long unsigned int D.22712;
  gunichar2 * D.22713;
  short unsigned int D.22714;
  int len.52;
  guint32 len;

  D.22699 = sb == 0B;
  D.22700 = text == 0B;
  D.22701 = D.22699 | D.22700;
  if (D.22701 != 0) goto <D.22702>; else goto <D.22703>;
  <D.22702>:
  return;
  <D.22703>:
  D.22704 = sb->str;
  D.22705 = mono_string_chars (D.22704);
  D.22706 = D.22705 != text;
  D.22707 = (long int) D.22706;
  D.22708 = __builtin_expect (D.22707, 0);
  if (D.22708 != 0) goto <D.22709>; else goto <D.22710>;
  <D.22709>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 821, "mono_string_chars (sb->str) == text");
  <D.22710>:
  len = 0;
  goto <D.18936>;
  <D.18935>:
  len = len + 1;
  <D.18936>:
  D.22711 = (long unsigned int) len;
  D.22712 = D.22711 * 2;
  D.22713 = text + D.22712;
  D.22714 = *D.22713;
  if (D.22714 != 0) goto <D.18935>; else goto <D.18937>;
  <D.18937>:
  len.52 = (int) len;
  sb->length = len.52;
}


mono_string_builder_to_utf8 (struct MonoStringBuilder * sb)
{
  void * D.22719;
  struct MonoString * D.22720;
  struct MonoString * D.22721;
  int D.22724;
  struct MonoDomain * D.22727;
  struct MonoString * D.22728;
  struct MonoString * * D.22729;
  int D.22730;
  long int D.22731;
  mono_unichar2 * D.22732;
  struct GError * error.53;
  struct MonoException * D.22736;
  gulong iftmp.54;
  int D.22741;
  int D.22743;
  long unsigned int D.22744;
  struct GError * error;
  gchar * tmp;
  gchar * res;

  try
    {
      error = 0B;
      res = 0B;
      if (sb == 0B) goto <D.22717>; else goto <D.22718>;
      <D.22717>:
      D.22719 = 0B;
      return D.22719;
      <D.22718>:
      D.22720 = sb->str;
      D.22721 = sb->cached_str;
      if (D.22720 == D.22721) goto <D.22722>; else goto <D.22723>;
      <D.22722>:
      D.22720 = sb->str;
      D.22724 = D.22720->length;
      if (D.22724 == 0) goto <D.22725>; else goto <D.22726>;
      <D.22725>:
      D.22727 = mono_domain_get ();
      D.22728 = mono_string_new_size (D.22727, 16);
      D.22729 = &sb->str;
      mono_gc_wbarrier_set_field (sb, D.22729, D.22728);
      sb->cached_str = 0B;
      <D.22726>:
      <D.22723>:
      D.22730 = sb->length;
      D.22731 = (long int) D.22730;
      D.22720 = sb->str;
      D.22732 = mono_string_chars (D.22720);
      tmp = monoeg_g_utf16_to_utf8 (D.22732, D.22731, 0B, 0B, &error);
      error.53 = error;
      if (error.53 != 0B) goto <D.22734>; else goto <D.22735>;
      <D.22734>:
      error.53 = error;
      monoeg_g_error_free (error.53);
      D.22736 = mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8");
      mono_raise_exception (D.22736);
      goto <D.22737>;
      <D.22735>:
      D.22720 = sb->str;
      if (D.22720 != 0B) goto <D.22739>; else goto <D.22740>;
      <D.22739>:
      D.22720 = sb->str;
      D.22724 = D.22720->length;
      D.22741 = D.22724 + 1;
      iftmp.54 = (gulong) D.22741;
      goto <D.22742>;
      <D.22740>:
      iftmp.54 = 17;
      <D.22742>:
      res = mono_marshal_alloc (iftmp.54);
      D.22730 = sb->length;
      D.22743 = D.22730 + 1;
      D.22744 = (long unsigned int) D.22743;
      memcpy (res, tmp, D.22744);
      monoeg_g_free (tmp);
      <D.22737>:
      D.22719 = res;
      return D.22719;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_string_builder_to_utf16 (struct MonoStringBuilder * sb)
{
  void * D.22749;
  struct MonoString * D.22750;
  _Bool D.22751;
  long int D.22752;
  long int D.22753;
  struct MonoString * D.22756;
  int D.22759;
  struct MonoDomain * D.22762;
  struct MonoString * D.22763;
  struct MonoString * * D.22764;
  int iftmp.55;
  mono_unichar2 * D.22770;
  struct MonoDomain * D.22771;
  struct MonoString * D.22772;
  int D.22773;
  mono_unichar2 * D.22776;

  if (sb == 0B) goto <D.22747>; else goto <D.22748>;
  <D.22747>:
  D.22749 = 0B;
  return D.22749;
  <D.22748>:
  D.22750 = sb->str;
  D.22751 = D.22750 == 0B;
  D.22752 = (long int) D.22751;
  D.22753 = __builtin_expect (D.22752, 0);
  if (D.22753 != 0) goto <D.22754>; else goto <D.22755>;
  <D.22754>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 925, "sb->str");
  <D.22755>:
  D.22750 = sb->str;
  D.22756 = sb->cached_str;
  if (D.22750 == D.22756) goto <D.22757>; else goto <D.22758>;
  <D.22757>:
  D.22750 = sb->str;
  D.22759 = D.22750->length;
  if (D.22759 == 0) goto <D.22760>; else goto <D.22761>;
  <D.22760>:
  D.22762 = mono_domain_get ();
  D.22763 = mono_string_new_size (D.22762, 16);
  D.22764 = &sb->str;
  mono_gc_wbarrier_set_field (sb, D.22764, D.22763);
  goto <D.22765>;
  <D.22761>:
  D.22750 = sb->str;
  if (D.22750 != 0B) goto <D.22767>; else goto <D.22768>;
  <D.22767>:
  D.22750 = sb->str;
  iftmp.55 = D.22750->length;
  goto <D.22769>;
  <D.22768>:
  iftmp.55 = 16;
  <D.22769>:
  D.22750 = sb->str;
  D.22770 = mono_string_chars (D.22750);
  D.22771 = mono_domain_get ();
  D.22772 = mono_string_new_utf16 (D.22771, D.22770, iftmp.55);
  D.22764 = &sb->str;
  mono_gc_wbarrier_set_field (sb, D.22764, D.22772);
  <D.22765>:
  sb->cached_str = 0B;
  <D.22758>:
  D.22773 = sb->length;
  if (D.22773 == 0) goto <D.22774>; else goto <D.22775>;
  <D.22774>:
  D.22750 = sb->str;
  D.22776 = mono_string_chars (D.22750);
  *D.22776 = 0;
  <D.22775>:
  D.22750 = sb->str;
  D.22749 = mono_string_chars (D.22750);
  return D.22749;
}


mono_string_to_ansibstr (struct MonoString * string_obj)
{
  void * D.22778;

  monoeg_g_log (0B, 4, "UnmanagedMarshal.BStr is not implemented.");
  <D.18966>:
  goto <D.18966>;
  D.22778 = 0B;
  return D.22778;
}


mono_string_to_byvalstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.22780;
  long int D.22781;
  long int D.22782;
  _Bool D.22785;
  long int D.22786;
  long int D.22787;
  long unsigned int D.22790;
  int iftmp.56;
  long unsigned int D.22794;
  long unsigned int D.22797;
  long unsigned int D.22801;
  char * s;
  int len;

  D.22780 = dst == 0B;
  D.22781 = (long int) D.22780;
  D.22782 = __builtin_expect (D.22781, 0);
  if (D.22782 != 0) goto <D.22783>; else goto <D.22784>;
  <D.22783>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1006, "dst != NULL");
  <D.22784>:
  D.22785 = size <= 0;
  D.22786 = (long int) D.22785;
  D.22787 = __builtin_expect (D.22786, 0);
  if (D.22787 != 0) goto <D.22788>; else goto <D.22789>;
  <D.22788>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1007, "size > 0");
  <D.22789>:
  D.22790 = (long unsigned int) size;
  memset (dst, 0, D.22790);
  if (src == 0B) goto <D.22791>; else goto <D.22792>;
  <D.22791>:
  return;
  <D.22792>:
  s = mono_string_to_utf8 (src);
  D.22790 = (long unsigned int) size;
  D.22794 = strlen (s);
  if (D.22790 >= D.22794) goto <D.22795>; else goto <D.22796>;
  <D.22795>:
  D.22797 = strlen (s);
  iftmp.56 = (int) D.22797;
  goto <D.22798>;
  <D.22796>:
  iftmp.56 = size;
  <D.22798>:
  len = iftmp.56;
  if (len >= size) goto <D.22799>; else goto <D.22800>;
  <D.22799>:
  len = len + -1;
  <D.22800>:
  D.22801 = (long unsigned int) len;
  memcpy (dst, s, D.22801);
  monoeg_g_free (s);
}


mono_string_to_byvalwstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.22803;
  long int D.22804;
  long int D.22805;
  _Bool D.22808;
  long int D.22809;
  long int D.22810;
  int D.22815;
  long unsigned int D.22816;
  int iftmp.57;
  int D.22818;
  mono_unichar2 * D.22822;
  int D.22823;
  long unsigned int D.22826;
  long unsigned int D.22827;
  gunichar2 * D.22828;
  int len;

  D.22803 = dst == 0B;
  D.22804 = (long int) D.22803;
  D.22805 = __builtin_expect (D.22804, 0);
  if (D.22805 != 0) goto <D.22806>; else goto <D.22807>;
  <D.22806>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1036, "dst != NULL");
  <D.22807>:
  D.22808 = size <= 1;
  D.22809 = (long int) D.22808;
  D.22810 = __builtin_expect (D.22809, 0);
  if (D.22810 != 0) goto <D.22811>; else goto <D.22812>;
  <D.22811>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1037, "size > 1");
  <D.22812>:
  if (src == 0B) goto <D.22813>; else goto <D.22814>;
  <D.22813>:
  D.22815 = size * 2;
  D.22816 = (long unsigned int) D.22815;
  memset (dst, 0, D.22816);
  return;
  <D.22814>:
  D.22818 = mono_string_length (src);
  if (D.22818 <= size) goto <D.22819>; else goto <D.22820>;
  <D.22819>:
  iftmp.57 = mono_string_length (src);
  goto <D.22821>;
  <D.22820>:
  iftmp.57 = size;
  <D.22821>:
  len = iftmp.57;
  D.22815 = size * 2;
  D.22816 = (long unsigned int) D.22815;
  D.22822 = mono_string_chars (src);
  memcpy (dst, D.22822, D.22816);
  D.22823 = mono_string_length (src);
  if (D.22823 >= size) goto <D.22824>; else goto <D.22825>;
  <D.22824>:
  len = len + -1;
  <D.22825>:
  D.22826 = (long unsigned int) len;
  D.22827 = D.22826 * 2;
  D.22828 = dst + D.22827;
  *D.22828 = 0;
}


mono_type_to_ldind (struct MonoType * type)
{
  unsigned char D.22830;
  unsigned char D.22831;
  guint D.22834;
  unsigned char D.22835;
  int D.22836;
  struct MonoClass * D.22837;
  unsigned char D.22838;
  unsigned char D.22839;
  struct MonoGenericClass * D.22842;
  struct MonoClass * D.22843;
  void handle_enum = <<< error >>>;

  D.22830 = BIT_FIELD_REF <*type, 8, 88>;
  D.22831 = D.22830 & 64;
  if (D.22831 != 0) goto <D.22832>; else goto <D.22833>;
  <D.22832>:
  D.22834 = 77;
  return D.22834;
  <D.22833>:
  handle_enum:
  D.22835 = type->type;
  D.22836 = (int) D.22835;
  switch (D.22836) <default: <D.19034>, case 2: <D.19012>, case 3: <D.19015>, case 4: <D.19010>, case 5: <D.19011>, case 6: <D.19013>, case 7: <D.19014>, case 8: <D.19016>, case 9: <D.19017>, case 10: <D.19027>, case 11: <D.19028>, case 12: <D.19029>, case 13: <D.19030>, case 14: <D.19023>, case 15: <D.19020>, case 17: <D.19031>, case 18: <D.19022>, case 20: <D.19026>, case 21: <D.19033>, case 22: <D.19032>, case 24: <D.19018>, case 25: <D.19019>, case 27: <D.19021>, case 28: <D.19024>, case 29: <D.19025>>
  <D.19010>:
  D.22834 = 70;
  return D.22834;
  <D.19011>:
  <D.19012>:
  D.22834 = 71;
  return D.22834;
  <D.19013>:
  D.22834 = 72;
  return D.22834;
  <D.19014>:
  <D.19015>:
  D.22834 = 73;
  return D.22834;
  <D.19016>:
  D.22834 = 74;
  return D.22834;
  <D.19017>:
  D.22834 = 75;
  return D.22834;
  <D.19018>:
  <D.19019>:
  <D.19020>:
  <D.19021>:
  D.22834 = 77;
  return D.22834;
  <D.19022>:
  <D.19023>:
  <D.19024>:
  <D.19025>:
  <D.19026>:
  D.22834 = 80;
  return D.22834;
  <D.19027>:
  <D.19028>:
  D.22834 = 76;
  return D.22834;
  <D.19029>:
  D.22834 = 78;
  return D.22834;
  <D.19030>:
  D.22834 = 79;
  return D.22834;
  <D.19031>:
  D.22837 = type->data.klass;
  D.22838 = BIT_FIELD_REF <*D.22837, 8, 256>;
  D.22839 = D.22838 & 16;
  if (D.22839 != 0) goto <D.22840>; else goto <D.22841>;
  <D.22840>:
  D.22837 = type->data.klass;
  type = mono_class_enum_basetype (D.22837);
  goto handle_enum;
  <D.22841>:
  D.22834 = 113;
  return D.22834;
  <D.19032>:
  D.22834 = 113;
  return D.22834;
  <D.19033>:
  D.22842 = type->data.generic_class;
  D.22843 = D.22842->container_class;
  type = &D.22843->byval_arg;
  goto handle_enum;
  <D.19034>:
  D.22835 = type->type;
  D.22836 = (int) D.22835;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_ldind", D.22836);
  <D.19035>:
  goto <D.19035>;
  D.22834 = 4294967295;
  return D.22834;
}


mono_type_to_stind (struct MonoType * type)
{
  unsigned char D.22845;
  unsigned char D.22846;
  guint D.22849;
  unsigned char D.22850;
  int D.22851;
  struct MonoClass * D.22852;
  unsigned char D.22853;
  unsigned char D.22854;
  struct MonoGenericClass * D.22857;
  struct MonoClass * D.22858;
  void handle_enum = <<< error >>>;

  D.22845 = BIT_FIELD_REF <*type, 8, 88>;
  D.22846 = D.22845 & 64;
  if (D.22846 != 0) goto <D.22847>; else goto <D.22848>;
  <D.22847>:
  D.22849 = 223;
  return D.22849;
  <D.22848>:
  handle_enum:
  D.22850 = type->type;
  D.22851 = (int) D.22850;
  switch (D.22851) <default: <D.19064>, case 2: <D.19042>, case 3: <D.19045>, case 4: <D.19040>, case 5: <D.19041>, case 6: <D.19043>, case 7: <D.19044>, case 8: <D.19046>, case 9: <D.19047>, case 10: <D.19057>, case 11: <D.19058>, case 12: <D.19059>, case 13: <D.19060>, case 14: <D.19053>, case 15: <D.19050>, case 17: <D.19061>, case 18: <D.19052>, case 20: <D.19056>, case 21: <D.19063>, case 22: <D.19062>, case 24: <D.19048>, case 25: <D.19049>, case 27: <D.19051>, case 28: <D.19054>, case 29: <D.19055>>
  <D.19040>:
  <D.19041>:
  <D.19042>:
  D.22849 = 82;
  return D.22849;
  <D.19043>:
  <D.19044>:
  <D.19045>:
  D.22849 = 83;
  return D.22849;
  <D.19046>:
  <D.19047>:
  D.22849 = 84;
  return D.22849;
  <D.19048>:
  <D.19049>:
  <D.19050>:
  <D.19051>:
  D.22849 = 223;
  return D.22849;
  <D.19052>:
  <D.19053>:
  <D.19054>:
  <D.19055>:
  <D.19056>:
  D.22849 = 81;
  return D.22849;
  <D.19057>:
  <D.19058>:
  D.22849 = 85;
  return D.22849;
  <D.19059>:
  D.22849 = 86;
  return D.22849;
  <D.19060>:
  D.22849 = 87;
  return D.22849;
  <D.19061>:
  D.22852 = type->data.klass;
  D.22853 = BIT_FIELD_REF <*D.22852, 8, 256>;
  D.22854 = D.22853 & 16;
  if (D.22854 != 0) goto <D.22855>; else goto <D.22856>;
  <D.22855>:
  D.22852 = type->data.klass;
  type = mono_class_enum_basetype (D.22852);
  goto handle_enum;
  <D.22856>:
  D.22849 = 129;
  return D.22849;
  <D.19062>:
  D.22849 = 129;
  return D.22849;
  <D.19063>:
  D.22857 = type->data.generic_class;
  D.22858 = D.22857->container_class;
  type = &D.22858->byval_arg;
  goto handle_enum;
  <D.19064>:
  D.22850 = type->type;
  D.22851 = (int) D.22850;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_stind", D.22851);
  <D.19065>:
  goto <D.19065>;
  D.22849 = 4294967295;
  return D.22849;
}


mono_marshal_emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  emit_thread_interrupt_checkpoint (mb);
}


emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  char * D.22860;
  char * D.22861;

  D.22860 = mb->name;
  D.22861 = strstr (D.22860, "mono_thread_interruption_checkpoint");
  if (D.22861 != 0B) goto <D.22862>; else goto <D.22863>;
  <D.22862>:
  return;
  <D.22863>:
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
}


emit_thread_interrupt_checkpoint_call (struct MonoMethodBuilder * mb, void * checkpoint_func)
{
  gint32 * D.22865;
  unsigned int D.22866;
  unsigned int pos_noabort.58;
  int pos_noabort;

  D.22865 = mono_thread_interruption_request_flag ();
  mono_mb_emit_ptr (mb, D.22865);
  mono_mb_emit_byte (mb, 75);
  D.22866 = mono_mb_emit_branch (mb, 57);
  pos_noabort = (int) D.22866;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 12);
  mono_mb_emit_icall (mb, checkpoint_func);
  pos_noabort.58 = (unsigned int) pos_noabort;
  mono_mb_patch_branch (mb, pos_noabort.58);
}


mono_marshal_get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.22868;

  D.22868 = get_cache (var, hash_func, equal_func);
  return D.22868;
}


get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.22870;
  _Bool D.22875;
  long int D.22876;
  long int D.22877;
  _Bool D.22884;
  long int D.22885;
  long int D.22886;
  struct GHashTable * D.22889;

  D.22870 = *var;
  if (D.22870 == 0B) goto <D.22871>; else goto <D.22872>;
  <D.22871>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22873>; else goto <D.22874>;
    <D.22873>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22874>:
    D.22875 = ret != 0;
    D.22876 = (long int) D.22875;
    D.22877 = __builtin_expect (D.22876, 0);
    if (D.22877 != 0) goto <D.22878>; else goto <D.22879>;
    <D.22878>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2432, "ret == 0");
    <D.22879>:
  }
  D.22870 = *var;
  if (D.22870 == 0B) goto <D.22880>; else goto <D.22881>;
  <D.22880>:
  {
    struct GHashTable * cache;

    cache = monoeg_g_hash_table_new (hash_func, equal_func);
    mono_memory_barrier ();
    *var = cache;
  }
  <D.22881>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22882>; else goto <D.22883>;
    <D.22882>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22883>:
    D.22884 = ret != 0;
    D.22885 = (long int) D.22884;
    D.22886 = __builtin_expect (D.22885, 0);
    if (D.22886 != 0) goto <D.22887>; else goto <D.22888>;
    <D.22887>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2439, "ret == 0");
    <D.22888>:
  }
  <D.22872>:
  D.22889 = *var;
  return D.22889;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_marshal_find_in_cache (struct GHashTable * cache, void * key)
{
  _Bool D.22893;
  long int D.22894;
  long int D.22895;
  _Bool D.22900;
  long int D.22901;
  long int D.22902;
  struct MonoMethod * D.22905;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22891>; else goto <D.22892>;
    <D.22891>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22892>:
    D.22893 = ret != 0;
    D.22894 = (long int) D.22893;
    D.22895 = __builtin_expect (D.22894, 0);
    if (D.22895 != 0) goto <D.22896>; else goto <D.22897>;
    <D.22896>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2471, "ret == 0");
    <D.22897>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22898>; else goto <D.22899>;
    <D.22898>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22899>:
    D.22900 = ret != 0;
    D.22901 = (long int) D.22900;
    D.22902 = __builtin_expect (D.22901, 0);
    if (D.22902 != 0) goto <D.22903>; else goto <D.22904>;
    <D.22903>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2473, "ret == 0");
    <D.22904>:
  }
  D.22905 = res;
  return D.22905;
}


mono_mb_create_and_cache (struct GHashTable * cache, void * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  _Bool D.22909;
  long int D.22910;
  long int D.22911;
  _Bool D.22916;
  long int D.22917;
  long int D.22918;
  _Bool D.22925;
  long int D.22926;
  long int D.22927;
  _Bool D.22934;
  long int D.22935;
  long int D.22936;
  _Bool D.22942;
  long int D.22943;
  long int D.22944;
  struct MonoMethod * D.22947;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22907>; else goto <D.22908>;
    <D.22907>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22908>:
    D.22909 = ret != 0;
    D.22910 = (long int) D.22909;
    D.22911 = __builtin_expect (D.22910, 0);
    if (D.22911 != 0) goto <D.22912>; else goto <D.22913>;
    <D.22912>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2485, "ret == 0");
    <D.22913>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22914>; else goto <D.22915>;
    <D.22914>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22915>:
    D.22916 = ret != 0;
    D.22917 = (long int) D.22916;
    D.22918 = __builtin_expect (D.22917, 0);
    if (D.22918 != 0) goto <D.22919>; else goto <D.22920>;
    <D.22919>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2487, "ret == 0");
    <D.22920>:
  }
  if (res == 0B) goto <D.22921>; else goto <D.22922>;
  <D.22921>:
  {
    struct MonoMethod * newm;

    newm = mono_mb_create_method (mb, sig, max_stack);
    {
      int ret;

      ret = pthread_mutex_lock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22923>; else goto <D.22924>;
      <D.22923>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.22924>:
      D.22925 = ret != 0;
      D.22926 = (long int) D.22925;
      D.22927 = __builtin_expect (D.22926, 0);
      if (D.22927 != 0) goto <D.22928>; else goto <D.22929>;
      <D.22928>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2491, "ret == 0");
      <D.22929>:
    }
    res = monoeg_g_hash_table_lookup (cache, key);
    if (res == 0B) goto <D.22930>; else goto <D.22931>;
    <D.22930>:
    res = newm;
    monoeg_g_hash_table_insert_replace (cache, key, res, 0);
    mono_marshal_set_wrapper_info (res, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22932>; else goto <D.22933>;
      <D.22932>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22933>:
      D.22934 = ret != 0;
      D.22935 = (long int) D.22934;
      D.22936 = __builtin_expect (D.22935, 0);
      if (D.22936 != 0) goto <D.22937>; else goto <D.22938>;
      <D.22937>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2497, "ret == 0");
      <D.22938>:
    }
    goto <D.22939>;
    <D.22931>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22940>; else goto <D.22941>;
      <D.22940>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22941>:
      D.22942 = ret != 0;
      D.22943 = (long int) D.22942;
      D.22944 = __builtin_expect (D.22943, 0);
      if (D.22944 != 0) goto <D.22945>; else goto <D.22946>;
      <D.22945>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2499, "ret == 0");
      <D.22946>:
    }
    mono_free_method (newm);
    <D.22939>:
  }
  <D.22922>:
  D.22947 = res;
  return D.22947;
}


mono_marshal_method_from_wrapper (struct MonoMethod * wrapper)
{
  <unnamed-unsigned:5> D.22949;
  _Bool D.22950;
  _Bool D.22951;
  _Bool D.22952;
  struct MonoMethod * D.22955;
  unsigned char D.22958;
  unsigned char D.22959;
  struct MonoGenericContext * D.22962;
  <unnamed type> D.22965;
  _Bool D.22966;
  _Bool D.22967;
  _Bool D.22968;
  <unnamed type> D.22972;
  unsigned int D.22973;
  void * res;
  int wrapper_type;
  struct WrapperInfo * info;

  D.22949 = wrapper->wrapper_type;
  wrapper_type = (int) D.22949;
  D.22950 = wrapper_type == 0;
  D.22951 = wrapper_type == 17;
  D.22952 = D.22950 | D.22951;
  if (D.22952 != 0) goto <D.22953>; else goto <D.22954>;
  <D.22953>:
  D.22955 = wrapper;
  return D.22955;
  <D.22954>:
  switch (wrapper_type) <default: <D.19448>, case 4: <D.19447>, case 6: <D.19446>, case 8: <D.19441>, case 9: <D.19442>, case 10: <D.19443>, case 16: <D.19444>, case 22: <D.19445>>
  <D.19441>:
  <D.19442>:
  <D.19443>:
  <D.19444>:
  <D.19445>:
  res = mono_marshal_get_wrapper_info (wrapper);
  if (res == 0B) goto <D.22956>; else goto <D.22957>;
  <D.22956>:
  D.22955 = wrapper;
  return D.22955;
  <D.22957>:
  D.22958 = BIT_FIELD_REF <*wrapper, 8, 264>;
  D.22959 = D.22958 & 16;
  if (D.22959 != 0) goto <D.22960>; else goto <D.22961>;
  <D.22960>:
  D.22962 = mono_method_get_context (wrapper);
  D.22955 = mono_class_inflate_generic_method (res, D.22962);
  return D.22955;
  <D.22961>:
  D.22955 = res;
  return D.22955;
  <D.19446>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22964>; else goto <D.22963>;
  <D.22964>:
  D.22965 = info->subtype;
  D.22966 = D.22965 == 0;
  D.22967 = D.22965 == 16;
  D.22968 = D.22966 | D.22967;
  if (D.22968 != 0) goto <D.22969>; else goto <D.22963>;
  <D.22969>:
  D.22955 = info->d.managed_to_native.method;
  return D.22955;
  <D.22963>:
  D.22955 = 0B;
  return D.22955;
  <D.19447>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22971>; else goto <D.22970>;
  <D.22971>:
  D.22972 = info->subtype;
  D.22973 = D.22972 + 4294967283;
  if (D.22973 <= 1) goto <D.22974>; else goto <D.22970>;
  <D.22974>:
  D.22955 = info->d.runtime_invoke.method;
  return D.22955;
  <D.22970>:
  D.22955 = 0B;
  return D.22955;
  <D.19448>:
  D.22955 = 0B;
  return D.22955;
}


mono_marshal_get_wrapper_info (struct MonoMethod * wrapper)
{
  unsigned char D.22976;
  unsigned char D.22977;
  _Bool D.22978;
  long int D.22979;
  long int D.22980;
  void * D.22983;

  D.22976 = BIT_FIELD_REF <*wrapper, 8, 256>;
  D.22977 = D.22976 & 124;
  D.22978 = D.22977 == 0;
  D.22979 = (long int) D.22978;
  D.22980 = __builtin_expect (D.22979, 0);
  if (D.22980 != 0) goto <D.22981>; else goto <D.22982>;
  <D.22981>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2634, "wrapper->wrapper_type");
  <D.22982>:
  D.22983 = mono_method_get_wrapper_data (wrapper, 1);
  return D.22983;
}


mono_marshal_set_wrapper_info (struct MonoMethod * method, void * data)
{
  unsigned char D.22985;
  unsigned char D.22986;
  _Bool D.22987;
  _Bool D.22988;
  _Bool D.22989;
  void * * D.22992;
  void * * datav;

  D.22985 = BIT_FIELD_REF <*method, 8, 256>;
  D.22986 = D.22985 & 124;
  D.22987 = D.22986 == 0;
  D.22988 = D.22986 == 68;
  D.22989 = D.22987 | D.22988;
  if (D.22989 != 0) goto <D.22990>; else goto <D.22991>;
  <D.22990>:
  return;
  <D.22991>:
  datav = MEM[(struct MonoMethodWrapper *)method].method_data;
  D.22992 = datav + 8;
  *D.22992 = data;
}


mono_marshal_get_delegate_begin_invoke (struct MonoMethod * method)
{
  int iftmp.59;
  struct MonoClass * D.22999;
  struct MonoClass * D.23000;
  struct MonoClass * D.23001;
  int D.19530;
  int iftmp.60;
  int D.19529;
  const char[12] * D.23006;
  unsigned char D.23007;
  int D.23008;
  unsigned char D.23009;
  int D.23010;
  _Bool D.23011;
  _Bool D.23012;
  _Bool D.23013;
  const unsigned char * D.23016;
  unsigned char D.23017;
  int D.23018;
  const unsigned char * D.23019;
  unsigned char D.23020;
  int D.23021;
  _Bool D.23022;
  _Bool D.23023;
  const unsigned char * D.23026;
  unsigned char D.23027;
  int D.23028;
  const unsigned char * D.23029;
  unsigned char D.23030;
  int D.23031;
  _Bool D.23032;
  _Bool D.23033;
  const unsigned char * D.23036;
  unsigned char D.23037;
  int D.23038;
  const unsigned char * D.23039;
  unsigned char D.23040;
  int D.23041;
  const char * D.23043;
  _Bool D.23044;
  long int D.23045;
  long int D.23046;
  unsigned char D.23049;
  unsigned char D.23050;
  struct MonoImage * D.23055;
  struct GHashTable * * D.23056;
  struct MonoMethod * D.23059;
  struct GHashTable * * D.23061;
  unsigned char D.23064;
  unsigned char D.23065;
  _Bool D.23066;
  long int D.23067;
  long int D.23068;
  struct MonoClass * D.23074;
  unsigned int params_var.61;
  short unsigned int D.23078;
  int D.23079;
  int D.23080;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  int params_var;
  char * name;
  struct MonoGenericContext * ctx;
  struct MonoMethod * orig_method;

  ctx = 0B;
  orig_method = 0B;
  if (method == 0B) goto <D.22995>; else goto <D.22998>;
  <D.22998>:
  D.22999 = method->klass;
  D.23000 = D.22999->parent;
  D.23001 = mono_defaults.multicastdelegate_class;
  if (D.23000 != D.23001) goto <D.22995>; else goto <D.23002>;
  <D.23002>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23006 = "BeginInvoke";
      D.23007 = MEM[(const unsigned char *)D.23006];
      D.23008 = (int) D.23007;
      D.23009 = *__s2;
      D.23010 = (int) D.23009;
      __result = D.23008 - D.23010;
      {
        D.23011 = __s2_len != 0;
        D.23012 = __result == 0;
        D.23013 = D.23011 & D.23012;
        if (D.23013 != 0) goto <D.23014>; else goto <D.23015>;
        <D.23014>:
        D.23016 = &MEM[(void *)"BeginInvoke" + 1B];
        D.23017 = *D.23016;
        D.23018 = (int) D.23017;
        D.23019 = __s2 + 1;
        D.23020 = *D.23019;
        D.23021 = (int) D.23020;
        __result = D.23018 - D.23021;
        D.23022 = __s2_len > 1;
        D.23012 = __result == 0;
        D.23023 = D.23022 & D.23012;
        if (D.23023 != 0) goto <D.23024>; else goto <D.23025>;
        <D.23024>:
        D.23026 = &MEM[(void *)"BeginInvoke" + 2B];
        D.23027 = *D.23026;
        D.23028 = (int) D.23027;
        D.23029 = __s2 + 2;
        D.23030 = *D.23029;
        D.23031 = (int) D.23030;
        __result = D.23028 - D.23031;
        D.23032 = __s2_len > 2;
        D.23012 = __result == 0;
        D.23033 = D.23032 & D.23012;
        if (D.23033 != 0) goto <D.23034>; else goto <D.23035>;
        <D.23034>:
        D.23036 = &MEM[(void *)"BeginInvoke" + 3B];
        D.23037 = *D.23036;
        D.23038 = (int) D.23037;
        D.23039 = __s2 + 3;
        D.23040 = *D.23039;
        D.23041 = (int) D.23040;
        __result = D.23038 - D.23041;
        <D.23035>:
        <D.23025>:
        <D.23015>:
      }
      D.19529 = __result;
    }
    iftmp.60 = -D.19529;
    goto <D.23042>;
    <D.23005>:
    D.23043 = method->name;
    iftmp.60 = __builtin_strcmp (D.23043, "BeginInvoke");
    <D.23042>:
    D.19530 = iftmp.60;
  }
  if (D.19530 != 0) goto <D.22995>; else goto <D.22996>;
  <D.22995>:
  iftmp.59 = 1;
  goto <D.22997>;
  <D.22996>:
  iftmp.59 = 0;
  <D.22997>:
  D.23044 = iftmp.59 != 0;
  D.23045 = (long int) D.23044;
  D.23046 = __builtin_expect (D.23045, 0);
  if (D.23046 != 0) goto <D.23047>; else goto <D.23048>;
  <D.23047>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2837, "method && method->klass->parent == mono_defaults.multicastdelegate_class && !strcmp (method->name, \"BeginInvoke\")");
  <D.23048>:
  D.23049 = BIT_FIELD_REF <*method, 8, 264>;
  D.23050 = D.23049 & 16;
  if (D.23050 != 0) goto <D.23051>; else goto <D.23052>;
  <D.23051>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.23052>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.23053>; else goto <D.23054>;
  <D.23053>:
  D.22999 = method->klass;
  D.23055 = D.22999->image;
  D.23056 = &D.23055->delegate_begin_invoke_generic_cache;
  cache = get_cache (D.23056, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.23057>; else goto <D.23058>;
  <D.23057>:
  D.23059 = res;
  return D.23059;
  <D.23058>:
  goto <D.23060>;
  <D.23054>:
  D.22999 = method->klass;
  D.23055 = D.22999->image;
  D.23061 = &D.23055->delegate_begin_invoke_cache;
  cache = get_cache (D.23061, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.23062>; else goto <D.23063>;
  <D.23062>:
  D.23059 = res;
  return D.23059;
  <D.23063>:
  <D.23060>:
  D.23064 = BIT_FIELD_REF <*sig, 8, 112>;
  D.23065 = D.23064 & 64;
  D.23066 = D.23065 == 0;
  D.23067 = (long int) D.23066;
  D.23068 = __builtin_expect (D.23067, 0);
  if (D.23068 != 0) goto <D.23069>; else goto <D.23070>;
  <D.23069>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2866, "sig->hasthis");
  <D.23070>:
  name = mono_signature_to_name (sig, "begin_invoke");
  if (ctx != 0B) goto <D.23071>; else goto <D.23072>;
  <D.23071>:
  D.22999 = method->klass;
  mb = mono_mb_new (D.22999, name, 2);
  goto <D.23073>;
  <D.23072>:
  D.22999 = method->klass;
  D.23055 = D.22999->image;
  D.23074 = get_wrapper_target_class (D.23055);
  mb = mono_mb_new (D.23074, name, 2);
  <D.23073>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.61 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.61);
  mono_mb_emit_icall (mb, mono_delegate_begin_invoke);
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.23076>; else goto <D.23077>;
  <D.23076>:
  {
    struct MonoMethod * def;

    D.23078 = sig->param_count;
    D.23079 = (int) D.23078;
    D.23080 = D.23079 + 16;
    D.22999 = method->klass;
    def = mono_mb_create_and_cache (cache, D.22999, mb, sig, D.23080);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.23081>;
  <D.23077>:
  D.23078 = sig->param_count;
  D.23079 = (int) D.23078;
  D.23080 = D.23079 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23080);
  <D.23081>:
  mono_mb_free (mb);
  D.23059 = res;
  return D.23059;
}


check_generic_delegate_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def_method, struct MonoGenericContext * ctx)
{
  struct MonoClass * D.23083;
  struct MonoMethod * D.23086;
  struct MonoClass * D.23087;
  _Bool D.23092;
  long int D.23093;
  long int D.23094;
  _Bool D.23101;
  long int D.23102;
  long int D.23103;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;

  D.23083 = orig_method->klass;
  res = mono_marshal_find_in_cache (cache, D.23083);
  if (res != 0B) goto <D.23084>; else goto <D.23085>;
  <D.23084>:
  D.23086 = res;
  return D.23086;
  <D.23085>:
  D.23087 = def_method->klass;
  def = mono_marshal_find_in_cache (cache, D.23087);
  if (def != 0B) goto <D.23088>; else goto <D.23089>;
  <D.23088>:
  inst = mono_class_inflate_generic_method (def, ctx);
  mono_memory_barrier ();
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23090>; else goto <D.23091>;
    <D.23090>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23091>:
    D.23092 = ret != 0;
    D.23093 = (long int) D.23092;
    D.23094 = __builtin_expect (D.23093, 0);
    if (D.23094 != 0) goto <D.23095>; else goto <D.23096>;
    <D.23095>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2792, "ret == 0");
    <D.23096>:
  }
  D.23083 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.23083);
  if (res == 0B) goto <D.23097>; else goto <D.23098>;
  <D.23097>:
  D.23083 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.23083, inst, 0);
  res = inst;
  <D.23098>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23099>; else goto <D.23100>;
    <D.23099>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23100>:
    D.23101 = ret != 0;
    D.23102 = (long int) D.23101;
    D.23103 = __builtin_expect (D.23102, 0);
    if (D.23103 != 0) goto <D.23104>; else goto <D.23105>;
    <D.23104>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2798, "ret == 0");
    <D.23105>:
  }
  D.23086 = res;
  return D.23086;
  <D.23089>:
  D.23086 = 0B;
  return D.23086;
}


mono_signature_to_name (struct MonoMethodSignature * sig, const char * prefix)
{
  struct MonoType * D.23109;
  unsigned char D.23110;
  unsigned char D.23111;
  struct MonoType * D.23114;
  short unsigned int D.23115;
  int D.23116;
  char * D.23117;
  int i;
  char * result;
  struct GString * res;

  res = monoeg_g_string_new ("");
  if (prefix != 0B) goto <D.23107>; else goto <D.23108>;
  <D.23107>:
  monoeg_g_string_append (res, prefix);
  monoeg_g_string_append_c (res, 95);
  <D.23108>:
  D.23109 = sig->ret;
  mono_type_get_desc (res, D.23109, 0);
  D.23110 = BIT_FIELD_REF <*sig, 8, 112>;
  D.23111 = D.23110 & 64;
  if (D.23111 != 0) goto <D.23112>; else goto <D.23113>;
  <D.23112>:
  monoeg_g_string_append (res, "__this__");
  <D.23113>:
  i = 0;
  goto <D.19292>;
  <D.19291>:
  monoeg_g_string_append_c (res, 95);
  D.23114 = sig->params[i];
  mono_type_get_desc (res, D.23114, 0);
  i = i + 1;
  <D.19292>:
  D.23115 = sig->param_count;
  D.23116 = (int) D.23115;
  if (D.23116 > i) goto <D.19291>; else goto <D.19293>;
  <D.19293>:
  result = res->str;
  monoeg_g_string_free (res, 0);
  D.23117 = result;
  return D.23117;
}


get_wrapper_target_class (struct MonoImage * image)
{
  unsigned char D.23119;
  unsigned char D.23120;
  _Bool D.23124;
  long int D.23125;
  long int D.23126;
  struct MonoClass * D.23129;
  struct MonoClass * klass;

  D.23119 = BIT_FIELD_REF <*image, 8, 224>;
  D.23120 = D.23119 & 8;
  if (D.23120 != 0) goto <D.23121>; else goto <D.23122>;
  <D.23121>:
  klass = MEM[(struct MonoDynamicImage *)image].wrappers_type;
  goto <D.23123>;
  <D.23122>:
  klass = mono_class_get (image, 33554433);
  <D.23123>:
  D.23124 = klass == 0B;
  D.23125 = (long int) D.23124;
  D.23126 = __builtin_expect (D.23125, 0);
  if (D.23126 != 0) goto <D.23127>; else goto <D.23128>;
  <D.23127>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2695, "klass");
  <D.23128>:
  D.23129 = klass;
  return D.23129;
}


mono_mb_emit_save_args (struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, gboolean save_this)
{
  struct MonoClass * D.23131;
  struct MonoType * D.23132;
  short unsigned int D.23133;
  int D.23134;
  int D.23135;
  unsigned int D.23136;
  unsigned int D.23137;
  int D.23138;
  unsigned int params_var.62;
  unsigned int tmp_var.63;
  unsigned char D.23143;
  unsigned char D.23144;
  short unsigned int D.23149;
  int D.23150;
  <unnamed-unsigned:1> D.23151;
  int D.23152;
  int D.23153;
  unsigned int D.23154;
  int D.23155;
  int D.23158;
  int i;
  int params_var;
  int tmp_var;

  D.23131 = mono_defaults.int_class;
  D.23132 = &D.23131->byval_arg;
  params_var = mono_mb_add_local (mb, D.23132);
  D.23131 = mono_defaults.int_class;
  D.23132 = &D.23131->byval_arg;
  tmp_var = mono_mb_add_local (mb, D.23132);
  D.23133 = sig->param_count;
  D.23134 = (int) D.23133;
  D.23135 = D.23134 + 1;
  D.23136 = (unsigned int) D.23135;
  D.23137 = D.23136 * 8;
  D.23138 = (int) D.23137;
  mono_mb_emit_icon (mb, D.23138);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  params_var.62 = (unsigned int) params_var;
  mono_mb_emit_stloc (mb, params_var.62);
  params_var.62 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.62);
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_stloc (mb, tmp_var.63);
  if (save_this != 0) goto <D.23141>; else goto <D.23142>;
  <D.23141>:
  D.23143 = BIT_FIELD_REF <*sig, 8, 112>;
  D.23144 = D.23143 & 64;
  if (D.23144 != 0) goto <D.23145>; else goto <D.23146>;
  <D.23145>:
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.63);
  mono_mb_emit_ldarg_addr (mb, 0);
  mono_mb_emit_byte (mb, 223);
  D.23133 = sig->param_count;
  if (D.23133 != 0) goto <D.23147>; else goto <D.23148>;
  <D.23147>:
  D.23149 = (short unsigned int) tmp_var;
  D.23150 = (int) D.23149;
  mono_mb_emit_add_to_local (mb, D.23150, 8);
  <D.23148>:
  <D.23146>:
  <D.23142>:
  i = 0;
  goto <D.19282>;
  <D.19281>:
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.63);
  D.23151 = sig->hasthis;
  D.23152 = (int) D.23151;
  D.23153 = D.23152 + i;
  D.23154 = (unsigned int) D.23153;
  mono_mb_emit_ldarg_addr (mb, D.23154);
  mono_mb_emit_byte (mb, 223);
  D.23133 = sig->param_count;
  D.23134 = (int) D.23133;
  D.23155 = D.23134 + -1;
  if (D.23155 > i) goto <D.23156>; else goto <D.23157>;
  <D.23156>:
  D.23149 = (short unsigned int) tmp_var;
  D.23150 = (int) D.23149;
  mono_mb_emit_add_to_local (mb, D.23150, 8);
  <D.23157>:
  i = i + 1;
  <D.19282>:
  D.23133 = sig->param_count;
  D.23134 = (int) D.23133;
  if (D.23134 > i) goto <D.19281>; else goto <D.19283>;
  <D.19283>:
  D.23158 = params_var;
  return D.23158;
}


cache_generic_delegate_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx)
{
  _Bool D.23162;
  long int D.23163;
  long int D.23164;
  struct MonoClass * D.23167;
  _Bool D.23172;
  long int D.23173;
  long int D.23174;
  struct MonoMethod * D.23177;
  struct MonoMethod * inst;
  struct MonoMethod * res;

  inst = mono_class_inflate_generic_method (def, ctx);
  mono_memory_barrier ();
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23160>; else goto <D.23161>;
    <D.23160>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23161>:
    D.23162 = ret != 0;
    D.23163 = (long int) D.23162;
    D.23164 = __builtin_expect (D.23163, 0);
    if (D.23164 != 0) goto <D.23165>; else goto <D.23166>;
    <D.23165>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2814, "ret == 0");
    <D.23166>:
  }
  D.23167 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.23167);
  if (res == 0B) goto <D.23168>; else goto <D.23169>;
  <D.23168>:
  D.23167 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.23167, inst, 0);
  res = inst;
  <D.23169>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23170>; else goto <D.23171>;
    <D.23170>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23171>:
    D.23172 = ret != 0;
    D.23173 = (long int) D.23172;
    D.23174 = __builtin_expect (D.23173, 0);
    if (D.23174 != 0) goto <D.23175>; else goto <D.23176>;
    <D.23175>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2820, "ret == 0");
    <D.23176>:
  }
  D.23177 = res;
  return D.23177;
}


mono_marshal_get_delegate_end_invoke (struct MonoMethod * method)
{
  int iftmp.64;
  struct MonoClass * D.23184;
  struct MonoClass * D.23185;
  struct MonoClass * D.23186;
  int D.19601;
  int iftmp.65;
  int D.19600;
  const char[10] * D.23191;
  unsigned char D.23192;
  int D.23193;
  unsigned char D.23194;
  int D.23195;
  _Bool D.23196;
  _Bool D.23197;
  _Bool D.23198;
  const unsigned char * D.23201;
  unsigned char D.23202;
  int D.23203;
  const unsigned char * D.23204;
  unsigned char D.23205;
  int D.23206;
  _Bool D.23207;
  _Bool D.23208;
  const unsigned char * D.23211;
  unsigned char D.23212;
  int D.23213;
  const unsigned char * D.23214;
  unsigned char D.23215;
  int D.23216;
  _Bool D.23217;
  _Bool D.23218;
  const unsigned char * D.23221;
  unsigned char D.23222;
  int D.23223;
  const unsigned char * D.23224;
  unsigned char D.23225;
  int D.23226;
  const char * D.23228;
  _Bool D.23229;
  long int D.23230;
  long int D.23231;
  unsigned char D.23234;
  unsigned char D.23235;
  struct MonoImage * D.23240;
  struct GHashTable * * D.23241;
  struct MonoMethod * D.23244;
  struct GHashTable * * D.23246;
  unsigned char D.23249;
  unsigned char D.23250;
  _Bool D.23251;
  long int D.23252;
  long int D.23253;
  struct MonoClass * D.23259;
  unsigned int params_var.66;
  struct MonoType * D.23261;
  unsigned char D.23262;
  short unsigned int D.23268;
  int D.23269;
  int D.23270;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  int params_var;
  char * name;
  struct MonoGenericContext * ctx;
  struct MonoMethod * orig_method;

  ctx = 0B;
  orig_method = 0B;
  if (method == 0B) goto <D.23180>; else goto <D.23183>;
  <D.23183>:
  D.23184 = method->klass;
  D.23185 = D.23184->parent;
  D.23186 = mono_defaults.multicastdelegate_class;
  if (D.23185 != D.23186) goto <D.23180>; else goto <D.23187>;
  <D.23187>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23191 = "EndInvoke";
      D.23192 = MEM[(const unsigned char *)D.23191];
      D.23193 = (int) D.23192;
      D.23194 = *__s2;
      D.23195 = (int) D.23194;
      __result = D.23193 - D.23195;
      {
        D.23196 = __s2_len != 0;
        D.23197 = __result == 0;
        D.23198 = D.23196 & D.23197;
        if (D.23198 != 0) goto <D.23199>; else goto <D.23200>;
        <D.23199>:
        D.23201 = &MEM[(void *)"EndInvoke" + 1B];
        D.23202 = *D.23201;
        D.23203 = (int) D.23202;
        D.23204 = __s2 + 1;
        D.23205 = *D.23204;
        D.23206 = (int) D.23205;
        __result = D.23203 - D.23206;
        D.23207 = __s2_len > 1;
        D.23197 = __result == 0;
        D.23208 = D.23207 & D.23197;
        if (D.23208 != 0) goto <D.23209>; else goto <D.23210>;
        <D.23209>:
        D.23211 = &MEM[(void *)"EndInvoke" + 2B];
        D.23212 = *D.23211;
        D.23213 = (int) D.23212;
        D.23214 = __s2 + 2;
        D.23215 = *D.23214;
        D.23216 = (int) D.23215;
        __result = D.23213 - D.23216;
        D.23217 = __s2_len > 2;
        D.23197 = __result == 0;
        D.23218 = D.23217 & D.23197;
        if (D.23218 != 0) goto <D.23219>; else goto <D.23220>;
        <D.23219>:
        D.23221 = &MEM[(void *)"EndInvoke" + 3B];
        D.23222 = *D.23221;
        D.23223 = (int) D.23222;
        D.23224 = __s2 + 3;
        D.23225 = *D.23224;
        D.23226 = (int) D.23225;
        __result = D.23223 - D.23226;
        <D.23220>:
        <D.23210>:
        <D.23200>:
      }
      D.19600 = __result;
    }
    iftmp.65 = -D.19600;
    goto <D.23227>;
    <D.23190>:
    D.23228 = method->name;
    iftmp.65 = __builtin_strcmp (D.23228, "EndInvoke");
    <D.23227>:
    D.19601 = iftmp.65;
  }
  if (D.19601 != 0) goto <D.23180>; else goto <D.23181>;
  <D.23180>:
  iftmp.64 = 1;
  goto <D.23182>;
  <D.23181>:
  iftmp.64 = 0;
  <D.23182>:
  D.23229 = iftmp.64 != 0;
  D.23230 = (long int) D.23229;
  D.23231 = __builtin_expect (D.23230, 0);
  if (D.23231 != 0) goto <D.23232>; else goto <D.23233>;
  <D.23232>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3047, "method && method->klass->parent == mono_defaults.multicastdelegate_class && !strcmp (method->name, \"EndInvoke\")");
  <D.23233>:
  D.23234 = BIT_FIELD_REF <*method, 8, 264>;
  D.23235 = D.23234 & 16;
  if (D.23235 != 0) goto <D.23236>; else goto <D.23237>;
  <D.23236>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.23237>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.23238>; else goto <D.23239>;
  <D.23238>:
  D.23184 = method->klass;
  D.23240 = D.23184->image;
  D.23241 = &D.23240->delegate_end_invoke_generic_cache;
  cache = get_cache (D.23241, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.23242>; else goto <D.23243>;
  <D.23242>:
  D.23244 = res;
  return D.23244;
  <D.23243>:
  goto <D.23245>;
  <D.23239>:
  D.23184 = method->klass;
  D.23240 = D.23184->image;
  D.23246 = &D.23240->delegate_end_invoke_cache;
  cache = get_cache (D.23246, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.23247>; else goto <D.23248>;
  <D.23247>:
  D.23244 = res;
  return D.23244;
  <D.23248>:
  <D.23245>:
  D.23249 = BIT_FIELD_REF <*sig, 8, 112>;
  D.23250 = D.23249 & 64;
  D.23251 = D.23250 == 0;
  D.23252 = (long int) D.23251;
  D.23253 = __builtin_expect (D.23252, 0);
  if (D.23253 != 0) goto <D.23254>; else goto <D.23255>;
  <D.23254>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3076, "sig->hasthis");
  <D.23255>:
  name = mono_signature_to_name (sig, "end_invoke");
  if (ctx != 0B) goto <D.23256>; else goto <D.23257>;
  <D.23256>:
  D.23184 = method->klass;
  mb = mono_mb_new (D.23184, name, 3);
  goto <D.23258>;
  <D.23257>:
  D.23184 = method->klass;
  D.23240 = D.23184->image;
  D.23259 = get_wrapper_target_class (D.23240);
  mb = mono_mb_new (D.23259, name, 3);
  <D.23258>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.66 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.66);
  mono_mb_emit_icall (mb, mono_delegate_end_invoke);
  D.23261 = sig->ret;
  D.23262 = D.23261->type;
  if (D.23262 == 1) goto <D.23263>; else goto <D.23264>;
  <D.23263>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.23265>;
  <D.23264>:
  D.23261 = sig->ret;
  mono_mb_emit_restore_result (mb, D.23261);
  <D.23265>:
  if (ctx != 0B) goto <D.23266>; else goto <D.23267>;
  <D.23266>:
  {
    struct MonoMethod * def;

    D.23268 = sig->param_count;
    D.23269 = (int) D.23268;
    D.23270 = D.23269 + 16;
    D.23184 = method->klass;
    def = mono_mb_create_and_cache (cache, D.23184, mb, sig, D.23270);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.23271>;
  <D.23267>:
  D.23268 = sig->param_count;
  D.23269 = (int) D.23268;
  D.23270 = D.23269 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23270);
  <D.23271>:
  mono_mb_free (mb);
  D.23244 = res;
  return D.23244;
}


mono_mb_emit_restore_result (struct MonoMethodBuilder * mb, struct MonoType * return_type)
{
  unsigned char D.23273;
  unsigned char D.23274;
  struct MonoClass * D.23277;
  unsigned char D.23278;
  int D.23279;
  struct MonoClass * D.23280;
  unsigned int D.23281;
  unsigned char D.23282;
  int D.23283;
  int D.23284;
  unsigned char D.23286;
  int D.23287;
  struct MonoType * t;

  t = mono_type_get_underlying_type (return_type);
  D.23273 = BIT_FIELD_REF <*return_type, 8, 88>;
  D.23274 = D.23273 & 64;
  if (D.23274 != 0) goto <D.23275>; else goto <D.23276>;
  <D.23275>:
  D.23277 = mono_defaults.int_class;
  return_type = &D.23277->byval_arg;
  <D.23276>:
  D.23278 = t->type;
  D.23279 = (int) D.23278;
  switch (D.23279) <default: <D.19581>, case 1: <D.19553>, case 2: <D.19562>, case 3: <D.19565>, case 4: <D.19563>, case 5: <D.19561>, case 6: <D.19566>, case 7: <D.19564>, case 8: <D.19569>, case 9: <D.19570>, case 10: <D.19572>, case 11: <D.19571>, case 12: <D.19573>, case 13: <D.19574>, case 14: <D.19555>, case 15: <D.19554>, case 17: <D.19576>, case 18: <D.19556>, case 19: <D.19578>, case 20: <D.19558>, case 21: <D.19575>, case 24: <D.19567>, case 25: <D.19568>, case 28: <D.19557>, case 29: <D.19559>, case 30: <D.19579>>
  <D.19553>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2981);
  <D.19554>:
  <D.19555>:
  <D.19556>:
  <D.19557>:
  <D.19558>:
  <D.19559>:
  goto <D.19560>;
  <D.19561>:
  <D.19562>:
  <D.19563>:
  <D.19564>:
  <D.19565>:
  <D.19566>:
  <D.19567>:
  <D.19568>:
  <D.19569>:
  <D.19570>:
  <D.19571>:
  <D.19572>:
  <D.19573>:
  <D.19574>:
  D.23280 = mono_class_from_mono_type (return_type);
  mono_mb_emit_op (mb, 121, D.23280);
  D.23281 = mono_type_to_ldind (return_type);
  D.23282 = (unsigned char) D.23281;
  D.23283 = (int) D.23282;
  mono_mb_emit_byte (mb, D.23283);
  goto <D.19560>;
  <D.19575>:
  D.23284 = mono_type_generic_inst_is_valuetype (t);
  if (D.23284 == 0) goto <D.19560>; else goto <D.23285>;
  <D.23285>:
  <D.19576>:
  {
    struct MonoClass * klass;

    klass = mono_class_from_mono_type (return_type);
    mono_mb_emit_op (mb, 121, klass);
    mono_mb_emit_op (mb, 113, klass);
    goto <D.19560>;
  }
  <D.19578>:
  <D.19579>:
  {
    struct MonoClass * klass;

    klass = mono_class_from_mono_type (return_type);
    mono_mb_emit_op (mb, 165, klass);
    goto <D.19560>;
  }
  <D.19581>:
  D.23286 = return_type->type;
  D.23287 = (int) D.23286;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.23287);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3026);
  <D.19560>:
  mono_mb_emit_byte (mb, 42);
}


mono_marshal_get_remoting_invoke (struct MonoMethod * method)
{
  _Bool D.23289;
  long int D.23290;
  long int D.23291;
  unsigned char D.23294;
  unsigned char D.23295;
  _Bool D.23296;
  _Bool D.23297;
  _Bool D.23298;
  struct MonoMethod * D.23301;
  struct MonoClass * D.23304;
  unsigned char D.23305;
  unsigned char D.23306;
  struct MonoClass * D.23308;
  struct MonoDomain * D.23309;
  _Bool D.23310;
  long int D.23311;
  long int D.23312;
  unsigned char D.23315;
  unsigned char D.23316;
  unsigned char D.23319;
  unsigned char D.23320;
  const char * D.23325;
  struct MonoMethod * D.23326;
  unsigned int params_var.67;
  struct MonoType * D.23328;
  unsigned char D.23329;
  short unsigned int D.23333;
  int D.23334;
  int D.23335;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int params_var;

  D.23289 = method == 0B;
  D.23290 = (long int) D.23289;
  D.23291 = __builtin_expect (D.23290, 0);
  if (D.23291 != 0) goto <D.23292>; else goto <D.23293>;
  <D.23292>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3177, "method");
  <D.23293>:
  D.23294 = BIT_FIELD_REF <*method, 8, 256>;
  D.23295 = D.23294 & 124;
  D.23296 = D.23295 == 32;
  D.23297 = D.23295 == 40;
  D.23298 = D.23296 | D.23297;
  if (D.23298 != 0) goto <D.23299>; else goto <D.23300>;
  <D.23299>:
  D.23301 = method;
  return D.23301;
  <D.23300>:
  D.23304 = method->klass;
  D.23305 = BIT_FIELD_REF <*D.23304, 8, 280>;
  D.23306 = D.23305 & 64;
  if (D.23306 != 0) goto <D.23302>; else goto <D.23307>;
  <D.23307>:
  D.23304 = method->klass;
  D.23308 = mono_class_get_com_object_class ();
  if (D.23304 == D.23308) goto <D.23302>; else goto <D.23303>;
  <D.23302>:
  {
    struct MonoVTable * vtable;

    D.23304 = method->klass;
    D.23309 = mono_domain_get ();
    vtable = mono_class_vtable (D.23309, D.23304);
    D.23310 = vtable == 0B;
    D.23311 = (long int) D.23310;
    D.23312 = __builtin_expect (D.23311, 0);
    if (D.23312 != 0) goto <D.23313>; else goto <D.23314>;
    <D.23313>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3186, "vtable");
    <D.23314>:
    D.23315 = BIT_FIELD_REF <*vtable, 8, 344>;
    D.23316 = D.23315 & 1;
    if (D.23316 == 0) goto <D.23317>; else goto <D.23318>;
    <D.23317>:
    D.23301 = mono_cominterop_get_invoke (method);
    return D.23301;
    <D.23318>:
  }
  <D.23303>:
  sig = mono_signature_no_pinvoke (method);
  D.23319 = BIT_FIELD_REF <*sig, 8, 112>;
  D.23320 = D.23319 & 64;
  if (D.23320 == 0) goto <D.23321>; else goto <D.23322>;
  <D.23321>:
  D.23301 = method;
  return D.23301;
  <D.23322>:
  res = mono_marshal_remoting_find_in_cache (method, 8);
  if (res != 0B) goto <D.23323>; else goto <D.23324>;
  <D.23323>:
  D.23301 = res;
  return D.23301;
  <D.23324>:
  D.23325 = method->name;
  D.23304 = method->klass;
  mb = mono_mb_new (D.23304, D.23325, 8);
  D.23326 = mb->method;
  D.23326->save_lmf = 1;
  params_var = mono_mb_emit_save_args (mb, sig, 1);
  mono_mb_emit_ptr (mb, method);
  params_var.67 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.67);
  mono_mb_emit_icall (mb, mono_remoting_wrapper);
  emit_thread_interrupt_checkpoint (mb);
  D.23328 = sig->ret;
  D.23329 = D.23328->type;
  if (D.23329 == 1) goto <D.23330>; else goto <D.23331>;
  <D.23330>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.23332>;
  <D.23331>:
  D.23328 = sig->ret;
  mono_mb_emit_restore_result (mb, D.23328);
  <D.23332>:
  D.23333 = sig->param_count;
  D.23334 = (int) D.23333;
  D.23335 = D.23334 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23335);
  mono_mb_free (mb);
  D.23301 = res;
  return D.23301;
}


mono_marshal_remoting_find_in_cache (struct MonoMethod * method, int wrapper_type)
{
  _Bool D.23339;
  long int D.23340;
  long int D.23341;
  struct MonoClass * D.23344;
  struct MonoImage * D.23345;
  struct GHashTable * D.23346;
  _Bool D.23355;
  long int D.23356;
  long int D.23357;
  struct MonoMethod * D.23360;
  struct MonoMethod * res;
  struct MonoRemotingMethods * wrps;

  res = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23337>; else goto <D.23338>;
    <D.23337>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23338>:
    D.23339 = ret != 0;
    D.23340 = (long int) D.23339;
    D.23341 = __builtin_expect (D.23340, 0);
    if (D.23341 != 0) goto <D.23342>; else goto <D.23343>;
    <D.23342>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2514, "ret == 0");
    <D.23343>:
  }
  D.23344 = method->klass;
  D.23345 = D.23344->image;
  D.23346 = D.23345->remoting_invoke_cache;
  if (D.23346 != 0B) goto <D.23347>; else goto <D.23348>;
  <D.23347>:
  D.23344 = method->klass;
  D.23345 = D.23344->image;
  D.23346 = D.23345->remoting_invoke_cache;
  wrps = monoeg_g_hash_table_lookup (D.23346, method);
  goto <D.23349>;
  <D.23348>:
  wrps = 0B;
  <D.23349>:
  if (wrps != 0B) goto <D.23350>; else goto <D.23351>;
  <D.23350>:
  switch (wrapper_type) <default: <D.23352>, case 8: <D.19408>, case 9: <D.19410>, case 10: <D.19411>, case 11: <D.19412>>
  <D.19408>:
  res = wrps->invoke;
  goto <D.19409>;
  <D.19410>:
  res = wrps->invoke_with_check;
  goto <D.19409>;
  <D.19411>:
  res = wrps->xdomain_invoke;
  goto <D.19409>;
  <D.19412>:
  res = wrps->xdomain_dispatch;
  goto <D.19409>;
  <D.23352>:
  <D.19409>:
  <D.23351>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23353>; else goto <D.23354>;
    <D.23353>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23354>:
    D.23355 = ret != 0;
    D.23356 = (long int) D.23355;
    D.23357 = __builtin_expect (D.23356, 0);
    if (D.23357 != 0) goto <D.23358>; else goto <D.23359>;
    <D.23358>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2533, "ret == 0");
    <D.23359>:
  }
  D.23360 = res;
  return D.23360;
}


mono_remoting_mb_create_and_cache (struct MonoMethod * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  struct MonoClass * D.23362;
  struct MonoImage * D.23363;
  struct GHashTable * * D.23364;
  _Bool D.23367;
  long int D.23368;
  long int D.23369;
  struct MonoMethod * D.23374;
  <unnamed-unsigned:5> D.23375;
  int D.23376;
  _Bool D.23379;
  long int D.23380;
  long int D.23381;
  struct MonoMethod * D.23384;
  _Bool D.23389;
  long int D.23390;
  long int D.23391;
  _Bool D.23398;
  long int D.23399;
  long int D.23400;
  _Bool D.23406;
  long int D.23407;
  long int D.23408;
  struct MonoMethod * D.23411;
  struct MonoMethod * * res;
  struct MonoRemotingMethods * wrps;
  struct GHashTable * cache;

  res = 0B;
  D.23362 = key->klass;
  D.23363 = D.23362->image;
  D.23364 = &D.23363->remoting_invoke_cache;
  cache = get_cache_full (D.23364, mono_aligned_addr_hash, 0B, 0B, monoeg_g_free);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23365>; else goto <D.23366>;
    <D.23365>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23366>:
    D.23367 = ret != 0;
    D.23368 = (long int) D.23367;
    D.23369 = __builtin_expect (D.23368, 0);
    if (D.23369 != 0) goto <D.23370>; else goto <D.23371>;
    <D.23370>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2546, "ret == 0");
    <D.23371>:
  }
  wrps = monoeg_g_hash_table_lookup (cache, key);
  if (wrps == 0B) goto <D.23372>; else goto <D.23373>;
  <D.23372>:
  wrps = monoeg_malloc0 (32);
  monoeg_g_hash_table_insert_replace (cache, key, wrps, 0);
  <D.23373>:
  D.23374 = mb->method;
  D.23375 = D.23374->wrapper_type;
  D.23376 = (int) D.23375;
  switch (D.23376) <default: <D.19429>, case 8: <D.19424>, case 9: <D.19426>, case 10: <D.19427>, case 11: <D.19428>>
  <D.19424>:
  res = &wrps->invoke;
  goto <D.19425>;
  <D.19426>:
  res = &wrps->invoke_with_check;
  goto <D.19425>;
  <D.19427>:
  res = &wrps->xdomain_invoke;
  goto <D.19425>;
  <D.19428>:
  res = &wrps->xdomain_dispatch;
  goto <D.19425>;
  <D.19429>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2558);
  <D.19425>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23377>; else goto <D.23378>;
    <D.23377>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23378>:
    D.23379 = ret != 0;
    D.23380 = (long int) D.23379;
    D.23381 = __builtin_expect (D.23380, 0);
    if (D.23381 != 0) goto <D.23382>; else goto <D.23383>;
    <D.23382>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2560, "ret == 0");
    <D.23383>:
  }
  D.23384 = *res;
  if (D.23384 == 0B) goto <D.23385>; else goto <D.23386>;
  <D.23385>:
  {
    struct MonoMethod * newm;

    newm = mono_mb_create_method (mb, sig, max_stack);
    {
      int ret;

      ret = pthread_mutex_lock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23387>; else goto <D.23388>;
      <D.23387>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.23388>:
      D.23389 = ret != 0;
      D.23390 = (long int) D.23389;
      D.23391 = __builtin_expect (D.23390, 0);
      if (D.23391 != 0) goto <D.23392>; else goto <D.23393>;
      <D.23392>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2566, "ret == 0");
      <D.23393>:
    }
    D.23384 = *res;
    if (D.23384 == 0B) goto <D.23394>; else goto <D.23395>;
    <D.23394>:
    *res = newm;
    D.23384 = *res;
    mono_marshal_set_wrapper_info (D.23384, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23396>; else goto <D.23397>;
      <D.23396>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23397>:
      D.23398 = ret != 0;
      D.23399 = (long int) D.23398;
      D.23400 = __builtin_expect (D.23399, 0);
      if (D.23400 != 0) goto <D.23401>; else goto <D.23402>;
      <D.23401>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2570, "ret == 0");
      <D.23402>:
    }
    goto <D.23403>;
    <D.23395>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23404>; else goto <D.23405>;
      <D.23404>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23405>:
      D.23406 = ret != 0;
      D.23407 = (long int) D.23406;
      D.23408 = __builtin_expect (D.23407, 0);
      if (D.23408 != 0) goto <D.23409>; else goto <D.23410>;
      <D.23409>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2572, "ret == 0");
      <D.23410>:
    }
    mono_free_method (newm);
    <D.23403>:
  }
  <D.23386>:
  D.23411 = *res;
  return D.23411;
}


get_cache_full (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func, void (*GDestroyNotify) (void *) key_destroy_func, void (*GDestroyNotify) (void *) value_destroy_func)
{
  struct GHashTable * D.23413;
  _Bool D.23418;
  long int D.23419;
  long int D.23420;
  _Bool D.23427;
  long int D.23428;
  long int D.23429;
  struct GHashTable * D.23432;

  D.23413 = *var;
  if (D.23413 == 0B) goto <D.23414>; else goto <D.23415>;
  <D.23414>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23416>; else goto <D.23417>;
    <D.23416>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23417>:
    D.23418 = ret != 0;
    D.23419 = (long int) D.23418;
    D.23420 = __builtin_expect (D.23419, 0);
    if (D.23420 != 0) goto <D.23421>; else goto <D.23422>;
    <D.23421>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2448, "ret == 0");
    <D.23422>:
  }
  D.23413 = *var;
  if (D.23413 == 0B) goto <D.23423>; else goto <D.23424>;
  <D.23423>:
  {
    struct GHashTable * cache;

    cache = monoeg_g_hash_table_new_full (hash_func, equal_func, key_destroy_func, value_destroy_func);
    mono_memory_barrier ();
    *var = cache;
  }
  <D.23424>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23425>; else goto <D.23426>;
    <D.23425>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23426>:
    D.23427 = ret != 0;
    D.23428 = (long int) D.23427;
    D.23429 = __builtin_expect (D.23428, 0);
    if (D.23429 != 0) goto <D.23430>; else goto <D.23431>;
    <D.23430>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2455, "ret == 0");
    <D.23431>:
  }
  <D.23415>:
  D.23432 = *var;
  return D.23432;
}


mono_marshal_xdomain_copy_value (struct MonoObject * val)
{
  struct MonoObject * D.23436;
  struct MonoVTable * D.23437;
  struct MonoClass * D.23438;
  unsigned char D.23439;
  int D.23440;
  void * D.23441;
  int D.23442;
  mono_unichar2 * D.23443;
  struct MonoClass * D.23444;
  struct MonoType * D.23445;
  long unsigned int D.23450;
  long unsigned int D.23451;
  char * D.23452;
  struct MonoObject * D.23453;
  struct MonoClass * D.23455;
  struct MonoString * D.23458;
  int D.23459;
  mono_unichar2 * D.23460;
  struct MonoString * D.23461;
  struct MonoString * * D.23462;
  int D.23463;
  struct MonoDomain * domain;

  if (val == 0B) goto <D.23434>; else goto <D.23435>;
  <D.23434>:
  D.23436 = 0B;
  return D.23436;
  <D.23435>:
  domain = mono_domain_get ();
  D.23437 = val->vtable;
  D.23438 = D.23437->klass;
  D.23439 = D.23438->byval_arg.type;
  D.23440 = (int) D.23439;
  switch (D.23440) <default: <D.23454>, case 1: <D.19653>, case 2: <D.19656>, case 3: <D.19659>, case 4: <D.19655>, case 5: <D.19654>, case 6: <D.19658>, case 7: <D.19657>, case 8: <D.19661>, case 9: <D.19660>, case 10: <D.19662>, case 11: <D.19663>, case 12: <D.19664>, case 13: <D.19665>, case 14: <D.19666>, case 20: <D.19668>, case 29: <D.19669>>
  <D.19653>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3283);
  <D.19654>:
  <D.19655>:
  <D.19656>:
  <D.19657>:
  <D.19658>:
  <D.19659>:
  <D.19660>:
  <D.19661>:
  <D.19662>:
  <D.19663>:
  <D.19664>:
  <D.19665>:
  D.23441 = val + 16;
  D.23437 = val->vtable;
  D.23438 = D.23437->klass;
  D.23436 = mono_value_box (domain, D.23438, D.23441);
  return D.23436;
  <D.19666>:
  {
    struct MonoString * str;

    str = val;
    D.23442 = mono_string_length (str);
    D.23443 = mono_string_chars (str);
    D.23436 = mono_string_new_utf16 (domain, D.23443, D.23442);
    return D.23436;
  }
  <D.19668>:
  <D.19669>:
  {
    struct MonoArray * acopy;
    MonoXDomainMarshalType mt;

    D.23437 = val->vtable;
    D.23438 = D.23437->klass;
    D.23444 = D.23438->element_class;
    D.23445 = &D.23444->byval_arg;
    mt = mono_get_xdomain_marshal_type (D.23445);
    if (mt == 3) goto <D.23446>; else goto <D.23447>;
    <D.23446>:
    D.23436 = 0B;
    return D.23436;
    <D.23447>:
    acopy = mono_array_clone_in_domain (domain, val);
    if (mt == 1) goto <D.23448>; else goto <D.23449>;
    <D.23448>:
    {
      int i;
      int len;

      D.23450 = mono_array_length (acopy);
      len = (int) D.23450;
      i = 0;
      goto <D.19677>;
      <D.19676>:
      {
        struct MonoObject * item;

        D.23451 = (long unsigned int) i;
        D.23452 = mono_array_addr_with_size (acopy, 8, D.23451);
        item = MEM[(void * *)D.23452];
        {
          void * * __p;

          D.23451 = (long unsigned int) i;
          __p = mono_array_addr_with_size (acopy, 8, D.23451);
          D.23453 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (acopy, __p, D.23453);
        }
      }
      i = i + 1;
      <D.19677>:
      if (i < len) goto <D.19676>; else goto <D.19678>;
      <D.19678>:
    }
    <D.23449>:
    D.23436 = acopy;
    return D.23436;
  }
  <D.23454>:
  D.23437 = val->vtable;
  D.23438 = D.23437->klass;
  D.23455 = mono_defaults.stringbuilder_class;
  if (D.23438 == D.23455) goto <D.23456>; else goto <D.23457>;
  <D.23456>:
  {
    struct MonoStringBuilder * oldsb;
    struct MonoStringBuilder * newsb;

    oldsb = val;
    D.23455 = mono_defaults.stringbuilder_class;
    newsb = mono_object_new (domain, D.23455);
    D.23458 = oldsb->str;
    D.23459 = mono_string_length (D.23458);
    D.23458 = oldsb->str;
    D.23460 = mono_string_chars (D.23458);
    D.23461 = mono_string_new_utf16 (domain, D.23460, D.23459);
    D.23462 = &newsb->str;
    mono_gc_wbarrier_set_field (newsb, D.23462, D.23461);
    D.23463 = oldsb->length;
    newsb->length = D.23463;
    newsb->max_capacity = 2147483647;
    D.23436 = newsb;
    return D.23436;
  }
  <D.23457>:
  D.23436 = 0B;
  return D.23436;
}


mono_marshal_get_xappdomain_invoke (struct MonoMethod * method)
{
  _Bool D.23465;
  long int D.23466;
  long int D.23467;
  unsigned char D.23470;
  unsigned char D.23471;
  _Bool D.23472;
  _Bool D.23473;
  _Bool D.23474;
  struct MonoMethod * D.23477;
  struct MonoMethodSignature * D.23478;
  unsigned char D.23479;
  unsigned char D.23480;
  int D.23483;
  const char * D.23488;
  struct MonoClass * D.23489;
  struct MonoMethod * D.23490;
  short unsigned int D.23491;
  long unsigned int D.23492;
  long unsigned int D.23493;
  <unnamed type> D.23494;
  short unsigned int D.23497;
  int D.23498;
  int D.23499;
  unsigned char D.23502;
  unsigned char D.23503;
  long unsigned int D.23509;
  long unsigned int D.23510;
  int * D.23511;
  int D.23512;
  struct MonoType * D.23513;
  unsigned char D.23514;
  <unnamed type> D.23517;
  _Bool D.23518;
  struct MonoClass * D.23521;
  struct MonoType * D.23522;
  struct MonoClass * byte_array_class.68;
  struct MonoType * D.23524;
  struct MonoClass * D.23527;
  struct MonoType * D.23528;
  unsigned int loc_context.69;
  struct MonoMethod * method_needs_context_sink.70;
  unsigned int D.23531;
  unsigned int loc_real_proxy.71;
  unsigned int loc_domainid.72;
  struct MonoImage * D.23534;
  unsigned int D.23535;
  unsigned int pos.73;
  int D.23537;
  unsigned int D.23538;
  struct MonoMethod * D.23539;
  unsigned int pos_dispatch.74;
  int iftmp.75;
  _Bool D.23544;
  _Bool D.23545;
  _Bool D.23546;
  int D.23550;
  struct MonoType * D.23553;
  unsigned char D.23554;
  unsigned char D.23555;
  unsigned char D.23558;
  unsigned char D.23559;
  unsigned int loc_array.76;
  struct MonoMethod * method_rs_serialize.77;
  unsigned int loc_serialized_data.78;
  unsigned int loc_old_domainid.79;
  unsigned int loc_serialized_exc.80;
  struct MonoType * D.23573;
  unsigned int copy_local.81;
  struct MonoMethodSignature * D.23576;
  unsigned int loc_return.82;
  unsigned int D.23580;
  struct MonoMethod * method_rs_deserialize.83;
  struct MonoClass * D.23582;
  struct MonoMethod * method_exc_fixexc.84;
  unsigned int pos_noex.85;
  int j.86;
  int D.23589;
  unsigned int D.23590;
  struct MonoClass * D.23591;
  unsigned char D.23598;
  unsigned char D.23599;
  unsigned char D.23607;
  unsigned char D.23608;
  unsigned int D.23620;
  int D.23625;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  int j;
  int complex_count;
  int complex_out_count;
  int copy_locals_base;
  int * marshal_types;
  struct MonoClass * ret_class;
  struct MonoMethod * xdomain_method;
  int ret_marshal_type;
  int loc_array;
  int loc_serialized_data;
  int loc_real_proxy;
  int loc_old_domainid;
  int loc_domainid;
  int loc_return;
  int loc_serialized_exc;
  int loc_context;
  int pos;
  int pos_dispatch;
  int pos_noex;
  gboolean copy_return;

  ret_class = 0B;
  ret_marshal_type = 0;
  loc_array = 0;
  loc_serialized_data = -1;
  loc_return = 0;
  loc_serialized_exc = 0;
  copy_return = 0;
  D.23465 = method == 0B;
  D.23466 = (long int) D.23465;
  D.23467 = __builtin_expect (D.23466, 0);
  if (D.23467 != 0) goto <D.23468>; else goto <D.23469>;
  <D.23468>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3744, "method");
  <D.23469>:
  D.23470 = BIT_FIELD_REF <*method, 8, 256>;
  D.23471 = D.23470 & 124;
  D.23472 = D.23471 == 32;
  D.23473 = D.23471 == 40;
  D.23474 = D.23472 | D.23473;
  if (D.23474 != 0) goto <D.23475>; else goto <D.23476>;
  <D.23475>:
  D.23477 = method;
  return D.23477;
  <D.23476>:
  D.23478 = mono_method_signature (method);
  D.23479 = BIT_FIELD_REF <*D.23478, 8, 112>;
  D.23480 = D.23479 & 64;
  if (D.23480 == 0) goto <D.23481>; else goto <D.23482>;
  <D.23481>:
  D.23477 = method;
  return D.23477;
  <D.23482>:
  D.23483 = mono_marshal_supports_fast_xdomain (method);
  if (D.23483 == 0) goto <D.23484>; else goto <D.23485>;
  <D.23484>:
  D.23477 = mono_marshal_get_remoting_invoke (method);
  return D.23477;
  <D.23485>:
  mono_remoting_marshal_init ();
  res = mono_marshal_remoting_find_in_cache (method, 10);
  if (res != 0B) goto <D.23486>; else goto <D.23487>;
  <D.23486>:
  D.23477 = res;
  return D.23477;
  <D.23487>:
  sig = mono_signature_no_pinvoke (method);
  D.23488 = method->name;
  D.23489 = method->klass;
  mb = mono_mb_new (D.23489, D.23488, 10);
  D.23490 = mb->method;
  D.23490->save_lmf = 1;
  D.23491 = sig->param_count;
  D.23492 = (long unsigned int) D.23491;
  D.23493 = D.23492 * 4;
  marshal_types = __builtin_alloca (D.23493);
  complex_out_count = 0;
  complex_count = complex_out_count;
  i = 0;
  goto <D.19817>;
  <D.19816>:
  {
    struct MonoType * ptype;
    int mt;

    ptype = sig->params[i];
    D.23494 = mono_get_xdomain_marshal_type (ptype);
    mt = (int) D.23494;
    D.23497 = ptype->attrs;
    D.23498 = (int) D.23497;
    D.23499 = D.23498 & 2;
    if (D.23499 != 0) goto <D.23500>; else goto <D.23495>;
    <D.23500>:
    if (mt == 1) goto <D.23501>; else goto <D.23495>;
    <D.23501>:
    D.23502 = BIT_FIELD_REF <*ptype, 8, 88>;
    D.23503 = D.23502 & 64;
    if (D.23503 == 0) goto <D.23504>; else goto <D.23495>;
    <D.23504>:
    mt = 2;
    goto <D.23496>;
    <D.23495>:
    if (mt == 3) goto <D.23505>; else goto <D.23506>;
    <D.23505>:
    complex_count = complex_count + 1;
    D.23502 = BIT_FIELD_REF <*ptype, 8, 88>;
    D.23503 = D.23502 & 64;
    if (D.23503 != 0) goto <D.23507>; else goto <D.23508>;
    <D.23507>:
    complex_out_count = complex_out_count + 1;
    <D.23508>:
    <D.23506>:
    <D.23496>:
    D.23509 = (long unsigned int) i;
    D.23510 = D.23509 * 4;
    D.23511 = marshal_types + D.23510;
    *D.23511 = mt;
  }
  i = i + 1;
  <D.19817>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19816>; else goto <D.19818>;
  <D.19818>:
  D.23513 = sig->ret;
  D.23514 = D.23513->type;
  if (D.23514 != 1) goto <D.23515>; else goto <D.23516>;
  <D.23515>:
  D.23513 = sig->ret;
  D.23517 = mono_get_xdomain_marshal_type (D.23513);
  ret_marshal_type = (int) D.23517;
  D.23513 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23513);
  D.23518 = ret_marshal_type != 3;
  copy_return = (gboolean) D.23518;
  <D.23516>:
  if (complex_count > 0) goto <D.23519>; else goto <D.23520>;
  <D.23519>:
  D.23521 = mono_defaults.object_class;
  D.23522 = &D.23521->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23522);
  <D.23520>:
  byte_array_class.68 = byte_array_class;
  D.23524 = &byte_array_class.68->byval_arg;
  loc_serialized_data = mono_mb_add_local (mb, D.23524);
  D.23521 = mono_defaults.object_class;
  D.23522 = &D.23521->byval_arg;
  loc_real_proxy = mono_mb_add_local (mb, D.23522);
  if (copy_return != 0) goto <D.23525>; else goto <D.23526>;
  <D.23525>:
  D.23513 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23513);
  <D.23526>:
  D.23527 = mono_defaults.int32_class;
  D.23528 = &D.23527->byval_arg;
  loc_old_domainid = mono_mb_add_local (mb, D.23528);
  D.23527 = mono_defaults.int32_class;
  D.23528 = &D.23527->byval_arg;
  loc_domainid = mono_mb_add_local (mb, D.23528);
  byte_array_class.68 = byte_array_class;
  D.23524 = &byte_array_class.68->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23524);
  D.23521 = mono_defaults.object_class;
  D.23522 = &D.23521->byval_arg;
  loc_context = mono_mb_add_local (mb, D.23522);
  mono_mb_emit_icall (mb, mono_context_get);
  mono_mb_emit_byte (mb, 37);
  loc_context.69 = (unsigned int) loc_context;
  mono_mb_emit_stloc (mb, loc_context.69);
  method_needs_context_sink.70 = method_needs_context_sink;
  mono_mb_emit_managed_call (mb, method_needs_context_sink.70, 0B);
  D.23531 = mono_mb_emit_short_branch (mb, 45);
  pos = (int) D.23531;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  loc_real_proxy.71 = (unsigned int) loc_real_proxy;
  mono_mb_emit_stloc (mb, loc_real_proxy.71);
  mono_mb_emit_ldflda (mb, 40);
  mono_mb_emit_byte (mb, 74);
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_stloc (mb, loc_domainid.72);
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.72);
  D.23489 = method->klass;
  D.23534 = D.23489->image;
  mono_mb_emit_ptr (mb, D.23534);
  mono_mb_emit_icall (mb, mono_marshal_check_domain_image);
  D.23535 = mono_mb_emit_short_branch (mb, 45);
  pos_dispatch = (int) D.23535;
  pos.73 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.73);
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.19820>;
  <D.19819>:
  D.23537 = i + 1;
  D.23538 = (unsigned int) D.23537;
  mono_mb_emit_ldarg (mb, D.23538);
  i = i + 1;
  <D.19820>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19819>; else goto <D.19821>;
  <D.19821>:
  D.23539 = mono_marshal_get_remoting_invoke (method);
  mono_mb_emit_managed_call (mb, D.23539, 0B);
  mono_mb_emit_byte (mb, 42);
  pos_dispatch.74 = (unsigned int) pos_dispatch;
  mono_mb_patch_short_branch (mb, pos_dispatch.74);
  if (complex_count > 0) goto <D.23541>; else goto <D.23542>;
  <D.23541>:
  D.23544 = ret_marshal_type == 3;
  D.23545 = complex_out_count > 0;
  D.23546 = D.23544 & D.23545;
  if (D.23546 != 0) goto <D.23547>; else goto <D.23548>;
  <D.23547>:
  iftmp.75 = complex_count + 1;
  goto <D.23549>;
  <D.23548>:
  iftmp.75 = complex_count;
  <D.23549>:
  mono_mb_emit_icon (mb, iftmp.75);
  D.23521 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 141, D.23521);
  j = 0;
  i = 0;
  goto <D.19825>;
  <D.19824>:
  {
    struct MonoClass * pclass;

    D.23509 = (long unsigned int) i;
    D.23510 = D.23509 * 4;
    D.23511 = marshal_types + D.23510;
    D.23550 = *D.23511;
    if (D.23550 != 3) goto <D.23551>; else goto <D.23552>;
    <D.23551>:
    // predicted unlikely by continue predictor.
    goto <D.19823>;
    <D.23552>:
    D.23553 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23553);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_icon (mb, j);
    D.23537 = i + 1;
    D.23538 = (unsigned int) D.23537;
    mono_mb_emit_ldarg (mb, D.23538);
    D.23553 = sig->params[i];
    D.23554 = BIT_FIELD_REF <*D.23553, 8, 88>;
    D.23555 = D.23554 & 64;
    if (D.23555 != 0) goto <D.23556>; else goto <D.23557>;
    <D.23556>:
    D.23558 = BIT_FIELD_REF <*pclass, 8, 256>;
    D.23559 = D.23558 & 8;
    if (D.23559 != 0) goto <D.23560>; else goto <D.23561>;
    <D.23560>:
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23562>;
    <D.23561>:
    mono_mb_emit_byte (mb, 80);
    <D.23562>:
    <D.23557>:
    D.23558 = BIT_FIELD_REF <*pclass, 8, 256>;
    D.23559 = D.23558 & 8;
    if (D.23559 != 0) goto <D.23563>; else goto <D.23564>;
    <D.23563>:
    mono_mb_emit_op (mb, 140, pclass);
    <D.23564>:
    mono_mb_emit_byte (mb, 162);
    j = j + 1;
  }
  <D.19823>:
  i = i + 1;
  <D.19825>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19824>; else goto <D.19826>;
  <D.19826>:
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.76);
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.76);
  method_rs_serialize.77 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.77, 0B);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.78);
  goto <D.23568>;
  <D.23542>:
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.77 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.77, 0B);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.78);
  <D.23568>:
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.72);
  mono_mb_emit_byte (mb, 23);
  mono_marshal_emit_switch_domain (mb);
  loc_old_domainid.79 = (unsigned int) loc_old_domainid;
  mono_mb_emit_stloc (mb, loc_old_domainid.79);
  loc_real_proxy.71 = (unsigned int) loc_real_proxy;
  mono_mb_emit_ldloc (mb, loc_real_proxy.71);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_data.78);
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_exc.80);
  copy_locals_base = mb->locals;
  i = 0;
  goto <D.19836>;
  <D.19835>:
  D.23509 = (long unsigned int) i;
  D.23510 = D.23509 * 4;
  D.23511 = marshal_types + D.23510;
  D.23550 = *D.23511;
  switch (D.23550) <default: <D.23575>, case 0: <D.19834>, case 1: <D.19829>, case 2: <D.19833>, case 3: <D.19827>>
  <D.19827>:
  // predicted unlikely by continue predictor.
  goto <D.19828>;
  <D.19829>:
  D.23537 = i + 1;
  D.23538 = (unsigned int) D.23537;
  mono_mb_emit_ldarg (mb, D.23538);
  D.23553 = sig->params[i];
  D.23554 = BIT_FIELD_REF <*D.23553, 8, 88>;
  D.23555 = D.23554 & 64;
  if (D.23555 != 0) goto <D.23571>; else goto <D.23572>;
  <D.23571>:
  {
    struct MonoClass * pclass;
    int copy_local;

    D.23553 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23553);
    D.23573 = &pclass->byval_arg;
    copy_local = mono_mb_add_local (mb, D.23573);
    mono_mb_emit_byte (mb, 80);
    copy_local.81 = (unsigned int) copy_local;
    mono_mb_emit_stloc (mb, copy_local.81);
    copy_local.81 = (unsigned int) copy_local;
    mono_mb_emit_ldloc_addr (mb, copy_local.81);
  }
  <D.23572>:
  goto <D.19832>;
  <D.19833>:
  <D.19834>:
  D.23537 = i + 1;
  D.23538 = (unsigned int) D.23537;
  mono_mb_emit_ldarg (mb, D.23538);
  goto <D.19832>;
  <D.23575>:
  <D.19832>:
  <D.19828>:
  i = i + 1;
  <D.19836>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19835>; else goto <D.19837>;
  <D.19837>:
  xdomain_method = mono_marshal_get_xappdomain_dispatch (method, marshal_types, complex_count, complex_out_count, ret_marshal_type);
  mono_marshal_emit_load_domain_method (mb, xdomain_method);
  D.23576 = mono_method_signature (xdomain_method);
  mono_mb_emit_calli (mb, D.23576);
  if (copy_return != 0) goto <D.23577>; else goto <D.23578>;
  <D.23577>:
  loc_return.82 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.82);
  <D.23578>:
  loc_old_domainid.79 = (unsigned int) loc_old_domainid;
  mono_mb_emit_ldloc (mb, loc_old_domainid.79);
  mono_mb_emit_byte (mb, 22);
  mono_marshal_emit_switch_domain (mb);
  mono_mb_emit_byte (mb, 38);
  loc_context.69 = (unsigned int) loc_context;
  mono_mb_emit_ldloc (mb, loc_context.69);
  mono_mb_emit_icall (mb, mono_context_set);
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.80);
  D.23580 = mono_mb_emit_short_branch (mb, 44);
  pos_noex = (int) D.23580;
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.80);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  D.23582 = mono_defaults.exception_class;
  mono_mb_emit_op (mb, 116, D.23582);
  method_exc_fixexc.84 = method_exc_fixexc;
  mono_mb_emit_managed_call (mb, method_exc_fixexc.84, 0B);
  mono_mb_emit_byte (mb, 122);
  pos_noex.85 = (unsigned int) pos_noex;
  mono_mb_patch_short_branch (mb, pos_noex.85);
  j = 0;
  i = 0;
  goto <D.19840>;
  <D.19839>:
  D.23553 = sig->params[i];
  D.23554 = BIT_FIELD_REF <*D.23553, 8, 88>;
  D.23555 = D.23554 & 64;
  if (D.23555 == 0) goto <D.23585>; else goto <D.23587>;
  <D.23587>:
  D.23509 = (long unsigned int) i;
  D.23510 = D.23509 * 4;
  D.23511 = marshal_types + D.23510;
  D.23550 = *D.23511;
  if (D.23550 != 1) goto <D.23585>; else goto <D.23586>;
  <D.23585>:
  // predicted unlikely by continue predictor.
  goto <D.19838>;
  <D.23586>:
  D.23537 = i + 1;
  D.23538 = (unsigned int) D.23537;
  mono_mb_emit_ldarg (mb, D.23538);
  j.86 = j;
  j = j.86 + 1;
  D.23589 = j.86 + copy_locals_base;
  D.23590 = (unsigned int) D.23589;
  mono_mb_emit_ldloc (mb, D.23590);
  D.23553 = sig->params[i];
  D.23591 = mono_class_from_mono_type (D.23553);
  mono_marshal_emit_xdomain_copy_value (mb, D.23591);
  mono_mb_emit_byte (mb, 81);
  <D.19838>:
  i = i + 1;
  <D.19840>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19839>; else goto <D.19841>;
  <D.19841>:
  if (complex_out_count > 0) goto <D.23592>; else goto <D.23593>;
  <D.23592>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.76);
  j = 0;
  i = 0;
  goto <D.19845>;
  <D.19844>:
  D.23509 = (long unsigned int) i;
  D.23510 = D.23509 * 4;
  D.23511 = marshal_types + D.23510;
  D.23550 = *D.23511;
  if (D.23550 != 3) goto <D.23594>; else goto <D.23595>;
  <D.23594>:
  // predicted unlikely by continue predictor.
  goto <D.19842>;
  <D.23595>:
  D.23553 = sig->params[i];
  D.23554 = BIT_FIELD_REF <*D.23553, 8, 88>;
  D.23555 = D.23554 & 64;
  if (D.23555 != 0) goto <D.23596>; else goto <D.23597>;
  <D.23596>:
  {
    struct MonoClass * pclass;

    D.23553 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23553);
    D.23537 = i + 1;
    D.23538 = (unsigned int) D.23537;
    mono_mb_emit_ldarg (mb, D.23538);
    loc_array.76 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.76);
    mono_mb_emit_icon (mb, j);
    mono_mb_emit_byte (mb, 154);
    D.23598 = BIT_FIELD_REF <*pclass, 8, 256>;
    D.23599 = D.23598 & 8;
    if (D.23599 != 0) goto <D.23600>; else goto <D.23601>;
    <D.23600>:
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    mono_mb_emit_op (mb, 129, pclass);
    goto <D.23602>;
    <D.23601>:
    D.23521 = mono_defaults.object_class;
    if (D.23521 != pclass) goto <D.23603>; else goto <D.23604>;
    <D.23603>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23604>:
    mono_mb_emit_byte (mb, 81);
    <D.23602>:
  }
  <D.23597>:
  j = j + 1;
  <D.19842>:
  i = i + 1;
  <D.19845>:
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  if (D.23512 > i) goto <D.19844>; else goto <D.19846>;
  <D.19846>:
  if (ret_marshal_type == 3) goto <D.23605>; else goto <D.23606>;
  <D.23605>:
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.76);
  mono_mb_emit_icon (mb, complex_count);
  mono_mb_emit_byte (mb, 154);
  D.23607 = BIT_FIELD_REF <*ret_class, 8, 256>;
  D.23608 = D.23607 & 8;
  if (D.23608 != 0) goto <D.23609>; else goto <D.23610>;
  <D.23609>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  <D.23610>:
  <D.23606>:
  goto <D.23611>;
  <D.23593>:
  if (ret_marshal_type == 3) goto <D.23612>; else goto <D.23613>;
  <D.23612>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  D.23607 = BIT_FIELD_REF <*ret_class, 8, 256>;
  D.23608 = D.23607 & 8;
  if (D.23608 != 0) goto <D.23614>; else goto <D.23615>;
  <D.23614>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  goto <D.23616>;
  <D.23615>:
  D.23521 = mono_defaults.object_class;
  if (D.23521 != ret_class) goto <D.23617>; else goto <D.23618>;
  <D.23617>:
  mono_mb_emit_op (mb, 116, ret_class);
  <D.23618>:
  <D.23616>:
  goto <D.23619>;
  <D.23613>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  mono_mb_emit_byte (mb, 37);
  D.23620 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23620;
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  pos.73 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.73);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  mono_mb_emit_byte (mb, 38);
  <D.23619>:
  <D.23611>:
  if (copy_return != 0) goto <D.23621>; else goto <D.23622>;
  <D.23621>:
  loc_return.82 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.82);
  if (ret_marshal_type == 1) goto <D.23623>; else goto <D.23624>;
  <D.23623>:
  mono_marshal_emit_xdomain_copy_value (mb, ret_class);
  <D.23624>:
  <D.23622>:
  mono_mb_emit_byte (mb, 42);
  D.23491 = sig->param_count;
  D.23512 = (int) D.23491;
  D.23625 = D.23512 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23625);
  mono_mb_free (mb);
  D.23477 = res;
  return D.23477;
}


mono_marshal_supports_fast_xdomain (struct MonoMethod * method)
{
  gboolean D.23627;
  int iftmp.87;
  struct MonoClass * D.23632;
  unsigned char D.23633;
  unsigned char D.23634;
  short unsigned int D.23636;
  int D.23637;
  int D.23638;
  int D.19716;
  int iftmp.88;
  int D.19712;
  const char[6] * D.23643;
  unsigned char D.23644;
  int D.23645;
  unsigned char D.23646;
  int D.23647;
  _Bool D.23648;
  _Bool D.23649;
  _Bool D.23650;
  const unsigned char * D.23653;
  unsigned char D.23654;
  int D.23655;
  const unsigned char * D.23656;
  unsigned char D.23657;
  int D.23658;
  _Bool D.23659;
  _Bool D.23660;
  const unsigned char * D.23663;
  unsigned char D.23664;
  int D.23665;
  const unsigned char * D.23666;
  unsigned char D.23667;
  int D.23668;
  _Bool D.23669;
  _Bool D.23670;
  const unsigned char * D.23673;
  unsigned char D.23674;
  int D.23675;
  const unsigned char * D.23676;
  unsigned char D.23677;
  int D.23678;
  const char * D.23680;

  D.23632 = method->klass;
  D.23633 = BIT_FIELD_REF <*D.23632, 8, 272>;
  D.23634 = D.23633 & 128;
  if (D.23634 == 0) goto <D.23635>; else goto <D.23629>;
  <D.23635>:
  D.23636 = method->flags;
  D.23637 = (int) D.23636;
  D.23638 = D.23637 & 2048;
  if (D.23638 == 0) goto <D.23630>; else goto <D.23639>;
  <D.23639>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s1_len = 5;
    if (__s1_len <= 3) goto <D.23641>; else goto <D.23642>;
    <D.23641>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = method->name;
      D.23643 = ".ctor";
      D.23644 = MEM[(const unsigned char *)D.23643];
      D.23645 = (int) D.23644;
      D.23646 = *__s2;
      D.23647 = (int) D.23646;
      __result = D.23645 - D.23647;
      {
        D.23648 = __s1_len != 0;
        D.23649 = __result == 0;
        D.23650 = D.23648 & D.23649;
        if (D.23650 != 0) goto <D.23651>; else goto <D.23652>;
        <D.23651>:
        D.23653 = &MEM[(void *)".ctor" + 1B];
        D.23654 = *D.23653;
        D.23655 = (int) D.23654;
        D.23656 = __s2 + 1;
        D.23657 = *D.23656;
        D.23658 = (int) D.23657;
        __result = D.23655 - D.23658;
        D.23659 = __s1_len > 1;
        D.23649 = __result == 0;
        D.23660 = D.23659 & D.23649;
        if (D.23660 != 0) goto <D.23661>; else goto <D.23662>;
        <D.23661>:
        D.23663 = &MEM[(void *)".ctor" + 2B];
        D.23664 = *D.23663;
        D.23665 = (int) D.23664;
        D.23666 = __s2 + 2;
        D.23667 = *D.23666;
        D.23668 = (int) D.23667;
        __result = D.23665 - D.23668;
        D.23669 = __s1_len > 2;
        D.23649 = __result == 0;
        D.23670 = D.23669 & D.23649;
        if (D.23670 != 0) goto <D.23671>; else goto <D.23672>;
        <D.23671>:
        D.23673 = &MEM[(void *)".ctor" + 3B];
        D.23674 = *D.23673;
        D.23675 = (int) D.23674;
        D.23676 = __s2 + 3;
        D.23677 = *D.23676;
        D.23678 = (int) D.23677;
        __result = D.23675 - D.23678;
        <D.23672>:
        <D.23662>:
        <D.23652>:
      }
      D.19712 = __result;
    }
    iftmp.88 = D.19712;
    goto <D.23679>;
    <D.23642>:
    D.23680 = method->name;
    iftmp.88 = __builtin_strcmp (".ctor", D.23680);
    <D.23679>:
    D.19716 = iftmp.88;
  }
  if (D.19716 != 0) goto <D.23630>; else goto <D.23629>;
  <D.23630>:
  iftmp.87 = 1;
  goto <D.23631>;
  <D.23629>:
  iftmp.87 = 0;
  <D.23631>:
  D.23627 = iftmp.87;
  return D.23627;
}


mono_remoting_marshal_init ()
{
  int module_initialized.89;
  struct MonoImage * D.23685;
  struct MonoMethod * method_rs_serialize.90;
  struct MonoMethod * method_rs_deserialize.91;
  struct MonoMethod * method_rs_serialize_exc.92;
  struct MonoMethod * method_rs_appdomain_target.93;
  struct MonoMethod * method_exc_fixexc.94;
  struct MonoClass * D.23691;
  struct MonoClass * byte_array_class.95;
  struct MonoMethod * method_set_call_context.96;
  struct MonoMethod * method_needs_context_sink.97;
  struct MonoClass * klass;
  static gboolean module_initialized = 0;

  module_initialized.89 = module_initialized;
  if (module_initialized.89 == 0) goto <D.23683>; else goto <D.23684>;
  <D.23683>:
  D.23685 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23685, "System.Runtime.Remoting", "RemotingServices");
  method_rs_serialize.90 = mono_class_get_method_from_name (klass, "SerializeCallData", -1);
  method_rs_serialize = method_rs_serialize.90;
  method_rs_deserialize.91 = mono_class_get_method_from_name (klass, "DeserializeCallData", -1);
  method_rs_deserialize = method_rs_deserialize.91;
  method_rs_serialize_exc.92 = mono_class_get_method_from_name (klass, "SerializeExceptionData", -1);
  method_rs_serialize_exc = method_rs_serialize_exc.92;
  klass = mono_defaults.real_proxy_class;
  method_rs_appdomain_target.93 = mono_class_get_method_from_name (klass, "GetAppDomainTarget", -1);
  method_rs_appdomain_target = method_rs_appdomain_target.93;
  klass = mono_defaults.exception_class;
  method_exc_fixexc.94 = mono_class_get_method_from_name (klass, "FixRemotingException", -1);
  method_exc_fixexc = method_exc_fixexc.94;
  D.23691 = mono_defaults.byte_class;
  byte_array_class.95 = mono_array_class_get (D.23691, 1);
  byte_array_class = byte_array_class.95;
  D.23685 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23685, "System.Runtime.Remoting.Messaging", "CallContext");
  method_set_call_context.96 = mono_class_get_method_from_name (klass, "SetCurrentCallContext", -1);
  method_set_call_context = method_set_call_context.96;
  D.23685 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23685, "System.Runtime.Remoting.Contexts", "Context");
  method_needs_context_sink.97 = mono_class_get_method_from_name (klass, "get_NeedsContextSink", -1);
  method_needs_context_sink = method_needs_context_sink.97;
  module_initialized = 1;
  <D.23684>:
}


mono_marshal_get_xappdomain_dispatch (struct MonoMethod * method, int * marshal_types, int complex_count, int complex_out_count, int ret_marshal_type)
{
  struct MonoMethod * D.23697;
  int iftmp.98;
  struct MonoType * D.23701;
  unsigned char D.23702;
  short unsigned int D.23705;
  int D.23706;
  int D.23707;
  int D.23708;
  unsigned int D.23709;
  struct MonoImage * D.23710;
  int j.99;
  struct MonoClass * D.23712;
  struct MonoType * D.23713;
  int j.100;
  struct MonoClass * byte_array_class.101;
  struct MonoType * D.23716;
  int j.102;
  long unsigned int D.23718;
  long unsigned int D.23719;
  int * D.23720;
  int D.23721;
  int j.103;
  struct MonoType * D.23725;
  struct MonoClass * D.23729;
  struct MonoType * D.23730;
  const char * D.23731;
  struct MonoClass * D.23732;
  struct MonoMethod * D.23733;
  struct MonoType * D.23734;
  struct MonoImage * D.23739;
  int D.23740;
  unsigned int D.23741;
  struct MonoMethod * method_set_call_context.104;
  unsigned int D.23743;
  struct MonoMethod * method_rs_deserialize.105;
  unsigned int loc_array.106;
  unsigned int pos.107;
  struct MonoMethod * method_rs_appdomain_target.108;
  int j.109;
  unsigned char D.23752;
  unsigned char D.23753;
  unsigned char D.23756;
  unsigned char D.23757;
  struct MonoType * D.23767;
  int param_index.110;
  unsigned int param_index.111;
  unsigned int copy_local.112;
  unsigned int param_index.113;
  int param_index.114;
  unsigned int param_index.115;
  unsigned int loc_return.116;
  int j.117;
  int D.23786;
  unsigned int D.23787;
  struct MonoClass * D.23788;
  unsigned char D.23793;
  unsigned char D.23794;
  _Bool D.23799;
  long int D.23800;
  long int D.23801;
  unsigned char D.23804;
  unsigned char D.23805;
  struct MonoMethod * method_rs_serialize.118;
  unsigned int D.23815;
  int D.23816;
  unsigned int D.23817;
  unsigned int D.23818;
  unsigned int D.23819;
  int D.23820;
  unsigned int D.23821;
  struct MonoMethod * method_rs_serialize_exc.119;
  unsigned int loc_serialized_exc.120;
  int D.23824;
  unsigned int D.23825;
  unsigned int D.23826;
  unsigned int D.23827;
  unsigned int pos_leave.121;
  short unsigned int D.23831;
  int D.23832;
  int D.23833;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  int j;
  int param_index;
  int copy_locals_base;
  struct MonoClass * ret_class;
  int loc_array;
  int loc_return;
  int loc_serialized_exc;
  struct MonoExceptionClause * main_clause;
  int pos;
  int pos_leave;
  gboolean copy_return;

  ret_class = 0B;
  loc_array = 0;
  loc_return = 0;
  loc_serialized_exc = 0;
  res = mono_marshal_remoting_find_in_cache (method, 11);
  if (res != 0B) goto <D.23695>; else goto <D.23696>;
  <D.23695>:
  D.23697 = res;
  return D.23697;
  <D.23696>:
  sig = mono_method_signature (method);
  D.23701 = sig->ret;
  D.23702 = D.23701->type;
  if (D.23702 != 1) goto <D.23703>; else goto <D.23699>;
  <D.23703>:
  if (ret_marshal_type != 3) goto <D.23704>; else goto <D.23699>;
  <D.23704>:
  iftmp.98 = 1;
  goto <D.23700>;
  <D.23699>:
  iftmp.98 = 0;
  <D.23700>:
  copy_return = iftmp.98;
  j = 0;
  D.23705 = sig->param_count;
  D.23706 = (int) D.23705;
  D.23707 = D.23706 + 3;
  D.23708 = D.23707 - complex_count;
  D.23709 = (unsigned int) D.23708;
  D.23710 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.23710, D.23709);
  j.99 = j;
  j = j.99 + 1;
  D.23712 = mono_defaults.object_class;
  D.23713 = &D.23712->byval_arg;
  csig->params[j.99] = D.23713;
  j.100 = j;
  j = j.100 + 1;
  byte_array_class.101 = byte_array_class;
  D.23716 = &byte_array_class.101->this_arg;
  csig->params[j.100] = D.23716;
  j.102 = j;
  j = j.102 + 1;
  byte_array_class.101 = byte_array_class;
  D.23716 = &byte_array_class.101->this_arg;
  csig->params[j.102] = D.23716;
  i = 0;
  goto <D.19766>;
  <D.19765>:
  D.23718 = (long unsigned int) i;
  D.23719 = D.23718 * 4;
  D.23720 = marshal_types + D.23719;
  D.23721 = *D.23720;
  if (D.23721 != 3) goto <D.23722>; else goto <D.23723>;
  <D.23722>:
  j.103 = j;
  j = j.103 + 1;
  D.23725 = sig->params[i];
  csig->params[j.103] = D.23725;
  <D.23723>:
  i = i + 1;
  <D.19766>:
  D.23705 = sig->param_count;
  D.23706 = (int) D.23705;
  if (D.23706 > i) goto <D.19765>; else goto <D.19767>;
  <D.19767>:
  if (copy_return != 0) goto <D.23726>; else goto <D.23727>;
  <D.23726>:
  D.23701 = sig->ret;
  csig->ret = D.23701;
  goto <D.23728>;
  <D.23727>:
  D.23729 = mono_defaults.void_class;
  D.23730 = &D.23729->byval_arg;
  csig->ret = D.23730;
  <D.23728>:
  csig->pinvoke = 1;
  csig->hasthis = 0;
  D.23731 = method->name;
  D.23732 = method->klass;
  mb = mono_mb_new (D.23732, D.23731, 11);
  D.23733 = mb->method;
  D.23733->save_lmf = 1;
  byte_array_class.101 = byte_array_class;
  D.23734 = &byte_array_class.101->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23734);
  if (complex_count > 0) goto <D.23735>; else goto <D.23736>;
  <D.23735>:
  D.23712 = mono_defaults.object_class;
  D.23713 = &D.23712->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23713);
  <D.23736>:
  D.23701 = sig->ret;
  D.23702 = D.23701->type;
  if (D.23702 != 1) goto <D.23737>; else goto <D.23738>;
  <D.23737>:
  D.23701 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23701);
  D.23701 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23701);
  <D.23738>:
  D.23732 = method->klass;
  D.23739 = D.23732->image;
  main_clause = mono_image_alloc0 (D.23739, 32);
  D.23740 = mono_mb_get_label (mb);
  D.23741 = (unsigned int) D.23740;
  main_clause->try_offset = D.23741;
  mono_mb_emit_byte (mb, 20);
  method_set_call_context.104 = method_set_call_context;
  mono_mb_emit_managed_call (mb, method_set_call_context.104, 0B);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  D.23743 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23743;
  byte_array_class.101 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.101);
  method_rs_deserialize.105 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.105, 0B);
  if (complex_count > 0) goto <D.23745>; else goto <D.23746>;
  <D.23745>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.106);
  goto <D.23748>;
  <D.23746>:
  mono_mb_emit_byte (mb, 38);
  <D.23748>:
  pos.107 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.107);
  mono_mb_emit_ldarg (mb, 0);
  method_rs_appdomain_target.108 = method_rs_appdomain_target;
  mono_mb_emit_managed_call (mb, method_rs_appdomain_target.108, 0B);
  copy_locals_base = mb->locals;
  param_index = 3;
  j = 0;
  i = 0;
  goto <D.19777>;
  <D.19776>:
  {
    struct MonoType * pt;
    struct MonoClass * pclass;

    pt = sig->params[i];
    pclass = mono_class_from_mono_type (pt);
    D.23718 = (long unsigned int) i;
    D.23719 = D.23718 * 4;
    D.23720 = marshal_types + D.23719;
    D.23721 = *D.23720;
    switch (D.23721) <default: <D.23777>, case 0: <D.19775>, case 1: <D.19774>, case 2: <D.19772>, case 3: <D.19770>>
    <D.19770>:
    loc_array.106 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.106);
    j.109 = j;
    j = j.109 + 1;
    mono_mb_emit_icon (mb, j.109);
    D.23752 = BIT_FIELD_REF <*pt, 8, 88>;
    D.23753 = D.23752 & 64;
    if (D.23753 != 0) goto <D.23754>; else goto <D.23755>;
    <D.23754>:
    D.23756 = BIT_FIELD_REF <*pclass, 8, 256>;
    D.23757 = D.23756 & 8;
    if (D.23757 != 0) goto <D.23758>; else goto <D.23759>;
    <D.23758>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    goto <D.23760>;
    <D.23759>:
    mono_mb_emit_op (mb, 143, pclass);
    <D.23760>:
    goto <D.23761>;
    <D.23755>:
    D.23756 = BIT_FIELD_REF <*pclass, 8, 256>;
    D.23757 = D.23756 & 8;
    if (D.23757 != 0) goto <D.23762>; else goto <D.23763>;
    <D.23762>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23764>;
    <D.23763>:
    mono_mb_emit_byte (mb, 154);
    D.23712 = mono_defaults.object_class;
    if (D.23712 != pclass) goto <D.23765>; else goto <D.23766>;
    <D.23765>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23766>:
    <D.23764>:
    <D.23761>:
    goto <D.19771>;
    <D.19772>:
    {
      int copy_local;

      D.23767 = &pclass->byval_arg;
      copy_local = mono_mb_add_local (mb, D.23767);
      param_index.110 = param_index;
      param_index = param_index.110 + 1;
      param_index.111 = (unsigned int) param_index.110;
      mono_mb_emit_ldarg (mb, param_index.111);
      mono_marshal_emit_xdomain_copy_value (mb, pclass);
      mono_mb_emit_byte (mb, 37);
      copy_local.112 = (unsigned int) copy_local;
      mono_mb_emit_stloc (mb, copy_local.112);
      goto <D.19771>;
    }
    <D.19774>:
    param_index.113 = (unsigned int) param_index;
    mono_mb_emit_ldarg (mb, param_index.113);
    D.23752 = BIT_FIELD_REF <*pt, 8, 88>;
    D.23753 = D.23752 & 64;
    if (D.23753 != 0) goto <D.23772>; else goto <D.23773>;
    <D.23772>:
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_byte (mb, 80);
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    mono_mb_emit_byte (mb, 81);
    goto <D.23774>;
    <D.23773>:
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    <D.23774>:
    param_index = param_index + 1;
    goto <D.19771>;
    <D.19775>:
    param_index.114 = param_index;
    param_index = param_index.114 + 1;
    param_index.115 = (unsigned int) param_index.114;
    mono_mb_emit_ldarg (mb, param_index.115);
    goto <D.19771>;
    <D.23777>:
    <D.19771>:
  }
  i = i + 1;
  <D.19777>:
  D.23705 = sig->param_count;
  D.23706 = (int) D.23705;
  if (D.23706 > i) goto <D.19776>; else goto <D.19778>;
  <D.19778>:
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_op (mb, 111, method);
  D.23701 = sig->ret;
  D.23702 = D.23701->type;
  if (D.23702 != 1) goto <D.23778>; else goto <D.23779>;
  <D.23778>:
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.116);
  <D.23779>:
  j = 0;
  param_index = 3;
  i = 0;
  goto <D.19781>;
  <D.19780>:
  D.23718 = (long unsigned int) i;
  D.23719 = D.23718 * 4;
  D.23720 = marshal_types + D.23719;
  D.23721 = *D.23720;
  if (D.23721 == 3) goto <D.23781>; else goto <D.23782>;
  <D.23781>:
  // predicted unlikely by continue predictor.
  goto <D.19779>;
  <D.23782>:
  D.23718 = (long unsigned int) i;
  D.23719 = D.23718 * 4;
  D.23720 = marshal_types + D.23719;
  D.23721 = *D.23720;
  if (D.23721 == 2) goto <D.23783>; else goto <D.23784>;
  <D.23783>:
  j.117 = j;
  j = j.117 + 1;
  D.23786 = j.117 + copy_locals_base;
  D.23787 = (unsigned int) D.23786;
  mono_mb_emit_ldloc (mb, D.23787);
  param_index.113 = (unsigned int) param_index;
  mono_mb_emit_ldarg (mb, param_index.113);
  D.23725 = sig->params[i];
  D.23788 = mono_class_from_mono_type (D.23725);
  mono_marshal_emit_xdomain_copy_out_value (mb, D.23788);
  <D.23784>:
  param_index = param_index + 1;
  <D.19779>:
  i = i + 1;
  <D.19781>:
  D.23705 = sig->param_count;
  D.23706 = (int) D.23705;
  if (D.23706 > i) goto <D.19780>; else goto <D.19782>;
  <D.19782>:
  if (complex_out_count > 0) goto <D.23789>; else goto <D.23790>;
  <D.23789>:
  j = 0;
  i = 0;
  goto <D.19785>;
  <D.19784>:
  D.23718 = (long unsigned int) i;
  D.23719 = D.23718 * 4;
  D.23720 = marshal_types + D.23719;
  D.23721 = *D.23720;
  if (D.23721 != 3) goto <D.23791>; else goto <D.23792>;
  <D.23791>:
  // predicted unlikely by continue predictor.
  goto <D.19783>;
  <D.23792>:
  D.23725 = sig->params[i];
  D.23793 = BIT_FIELD_REF <*D.23725, 8, 88>;
  D.23794 = D.23793 & 64;
  if (D.23794 == 0) goto <D.23795>; else goto <D.23796>;
  <D.23795>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  mono_mb_emit_icon (mb, j);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 162);
  <D.23796>:
  j = j + 1;
  <D.19783>:
  i = i + 1;
  <D.19785>:
  D.23705 = sig->param_count;
  D.23706 = (int) D.23705;
  if (D.23706 > i) goto <D.19784>; else goto <D.19786>;
  <D.19786>:
  if (ret_marshal_type == 3) goto <D.23797>; else goto <D.23798>;
  <D.23797>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  mono_mb_emit_icon (mb, complex_count);
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  D.23799 = ret_class == 0B;
  D.23800 = (long int) D.23799;
  D.23801 = __builtin_expect (D.23800, 0);
  if (D.23801 != 0) goto <D.23802>; else goto <D.23803>;
  <D.23802>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3660, "ret_class");
  <D.23803>:
  D.23804 = BIT_FIELD_REF <*ret_class, 8, 256>;
  D.23805 = D.23804 & 8;
  if (D.23805 != 0) goto <D.23806>; else goto <D.23807>;
  <D.23806>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23807>:
  mono_mb_emit_byte (mb, 162);
  <D.23798>:
  mono_mb_emit_ldarg (mb, 1);
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.23809>;
  <D.23790>:
  if (ret_marshal_type == 3) goto <D.23810>; else goto <D.23811>;
  <D.23810>:
  mono_mb_emit_ldarg (mb, 1);
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  D.23804 = BIT_FIELD_REF <*ret_class, 8, 256>;
  D.23805 = D.23804 & 8;
  if (D.23805 != 0) goto <D.23812>; else goto <D.23813>;
  <D.23812>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23813>:
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.23814>;
  <D.23811>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  <D.23814>:
  <D.23809>:
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  D.23815 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.23815;
  main_clause->flags = 0;
  D.23816 = mono_mb_get_pos (mb);
  D.23817 = (unsigned int) D.23816;
  D.23818 = main_clause->try_offset;
  D.23819 = D.23817 - D.23818;
  main_clause->try_len = D.23819;
  D.23712 = mono_defaults.object_class;
  main_clause->data.catch_class = D.23712;
  D.23820 = mono_mb_get_label (mb);
  D.23821 = (unsigned int) D.23820;
  main_clause->handler_offset = D.23821;
  method_rs_serialize_exc.119 = method_rs_serialize_exc;
  mono_mb_emit_managed_call (mb, method_rs_serialize_exc.119, 0B);
  loc_serialized_exc.120 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_stloc (mb, loc_serialized_exc.120);
  mono_mb_emit_ldarg (mb, 2);
  loc_serialized_exc.120 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.120);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.23824 = mono_mb_get_pos (mb);
  D.23825 = (unsigned int) D.23824;
  D.23826 = main_clause->handler_offset;
  D.23827 = D.23825 - D.23826;
  main_clause->handler_len = D.23827;
  pos_leave.121 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.121);
  if (copy_return != 0) goto <D.23829>; else goto <D.23830>;
  <D.23829>:
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  <D.23830>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, main_clause);
  D.23831 = csig->param_count;
  D.23832 = (int) D.23831;
  D.23833 = D.23832 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, csig, D.23833);
  mono_mb_free (mb);
  D.23697 = res;
  return D.23697;
}


emit_thread_force_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_force_interruption_checkpoint);
}


mono_marshal_emit_xdomain_copy_out_value (struct MonoMethodBuilder * mb, struct MonoClass * pclass)
{
  mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_out_value);
}


mono_marshal_emit_load_domain_method (struct MonoMethodBuilder * mb, struct MonoMethod * method)
{
  mono_mb_emit_ptr (mb, method);
  mono_mb_emit_icall (mb, mono_compile_method);
}


mono_marshal_emit_switch_domain (struct MonoMethodBuilder * mb)
{
  mono_mb_emit_icall (mb, mono_marshal_set_domain_by_id);
}


mono_marshal_emit_xdomain_copy_value (struct MonoMethodBuilder * mb, struct MonoClass * pclass)
{
  mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_value);
  mono_mb_emit_op (mb, 116, pclass);
}


mono_marshal_get_remoting_invoke_for_target (struct MonoMethod * method, MonoRemotingTarget target_type)
{
  struct MonoMethod * D.23837;

  if (target_type == 1) goto <D.23835>; else goto <D.23836>;
  <D.23835>:
  D.23837 = mono_marshal_get_xappdomain_invoke (method);
  return D.23837;
  <D.23836>:
  if (target_type == 2) goto <D.23838>; else goto <D.23839>;
  <D.23838>:
  D.23837 = mono_cominterop_get_invoke (method);
  return D.23837;
  <D.23839>:
  D.23837 = mono_marshal_get_remoting_invoke (method);
  return D.23837;
  D.23837 = 0B;
  return D.23837;
}


mono_marshal_get_remoting_invoke_with_check (struct MonoMethod * method)
{
  _Bool D.23841;
  long int D.23842;
  long int D.23843;
  unsigned char D.23846;
  unsigned char D.23847;
  struct MonoMethod * D.23850;
  struct MonoMethodSignature * D.23851;
  unsigned char D.23852;
  unsigned char D.23853;
  _Bool D.23854;
  long int D.23855;
  long int D.23856;
  const char * D.23861;
  struct MonoClass * D.23862;
  unsigned int i.122;
  short unsigned int D.23864;
  int D.23865;
  int D.23866;
  struct MonoMethodSignature * D.23869;
  unsigned int pos_rem.123;
  struct MonoMethodSignature * D.23871;
  unsigned int pos.124;
  struct MonoMethodSignature * D.23873;
  int D.23874;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * native;
  int i;
  int pos;
  int pos_rem;

  D.23841 = method == 0B;
  D.23842 = (long int) D.23841;
  D.23843 = __builtin_expect (D.23842, 0);
  if (D.23843 != 0) goto <D.23844>; else goto <D.23845>;
  <D.23844>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4087, "method");
  <D.23845>:
  D.23846 = BIT_FIELD_REF <*method, 8, 256>;
  D.23847 = D.23846 & 124;
  if (D.23847 == 36) goto <D.23848>; else goto <D.23849>;
  <D.23848>:
  D.23850 = method;
  return D.23850;
  <D.23849>:
  D.23851 = mono_method_signature (method);
  D.23852 = BIT_FIELD_REF <*D.23851, 8, 112>;
  D.23853 = D.23852 & 64;
  D.23854 = D.23853 == 0;
  D.23855 = (long int) D.23854;
  D.23856 = __builtin_expect (D.23855, 0);
  if (D.23856 != 0) goto <D.23857>; else goto <D.23858>;
  <D.23857>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4093, "mono_method_signature (method)->hasthis");
  <D.23858>:
  res = mono_marshal_remoting_find_in_cache (method, 9);
  if (res != 0B) goto <D.23859>; else goto <D.23860>;
  <D.23859>:
  D.23850 = res;
  return D.23850;
  <D.23860>:
  sig = mono_signature_no_pinvoke (method);
  D.23861 = method->name;
  D.23862 = method->klass;
  mb = mono_mb_new (D.23862, D.23861, 9);
  i = 0;
  goto <D.19866>;
  <D.19865>:
  i.122 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.122);
  i = i + 1;
  <D.19866>:
  D.23864 = sig->param_count;
  D.23865 = (int) D.23864;
  if (D.23865 >= i) goto <D.19865>; else goto <D.19867>;
  <D.19867>:
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  D.23866 = mono_marshal_supports_fast_xdomain (method);
  if (D.23866 != 0) goto <D.23867>; else goto <D.23868>;
  <D.23867>:
  mono_mb_emit_ldarg (mb, 0);
  pos_rem = mono_mb_emit_xdomain_check (mb, 59);
  native = mono_marshal_get_xappdomain_invoke (method);
  D.23869 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23869);
  mono_mb_emit_byte (mb, 42);
  pos_rem.123 = (unsigned int) pos_rem;
  mono_mb_patch_branch (mb, pos_rem.123);
  <D.23868>:
  native = mono_marshal_get_remoting_invoke (method);
  D.23871 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23871);
  mono_mb_emit_byte (mb, 42);
  pos.124 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.124);
  D.23873 = mono_method_signature (method);
  mono_mb_emit_managed_call (mb, method, D.23873);
  mono_mb_emit_byte (mb, 42);
  D.23864 = sig->param_count;
  D.23865 = (int) D.23864;
  D.23874 = D.23865 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23874);
  mono_mb_free (mb);
  D.23850 = res;
  return D.23850;
}


mono_mb_emit_proxy_check (struct MonoMethodBuilder * mb, int branch_code)
{
  struct MonoClass * D.23876;
  unsigned int D.23877;
  int D.23878;
  unsigned char D.23879;
  int D.23880;
  unsigned int D.23881;
  int D.23882;
  int pos;

  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 11);
  D.23876 = mono_defaults.transparent_proxy_class;
  D.23877 = mono_mb_add_data (mb, D.23876);
  D.23878 = (int) D.23877;
  mono_mb_emit_i4 (mb, D.23878);
  D.23879 = (unsigned char) branch_code;
  D.23880 = (int) D.23879;
  D.23881 = mono_mb_emit_branch (mb, D.23880);
  pos = (int) D.23881;
  D.23882 = pos;
  return D.23882;
}


mono_mb_emit_xdomain_check (struct MonoMethodBuilder * mb, int branch_code)
{
  unsigned char D.23884;
  int D.23885;
  unsigned int D.23886;
  int D.23887;
  int pos;

  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 40);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_icon (mb, -1);
  D.23884 = (unsigned char) branch_code;
  D.23885 = (int) D.23884;
  D.23886 = mono_mb_emit_branch (mb, D.23885);
  pos = (int) D.23886;
  D.23887 = pos;
  return D.23887;
}


mono_marshal_get_delegate_invoke (struct MonoMethod * method, struct MonoDelegate * del)
{
  struct MonoObject * D.23891;
  struct MonoMethod * D.23894;
  struct MonoMethodSignature * D.23897;
  unsigned char D.23898;
  unsigned char D.23899;
  unsigned char D.23902;
  unsigned char D.23903;
  struct MonoMethodSignature * D.23906;
  unsigned char D.23907;
  unsigned char D.23908;
  _Bool D.23909;
  long int D.23910;
  long int D.23911;
  struct MonoGenericContext * D.23914;
  struct MonoType * D.23915;
  int iftmp.125;
  struct MonoClass * D.23922;
  struct MonoClass * D.23923;
  struct MonoClass * D.23924;
  int D.19926;
  int iftmp.126;
  int D.19925;
  const char[7] * D.23929;
  unsigned char D.23930;
  int D.23931;
  unsigned char D.23932;
  int D.23933;
  _Bool D.23934;
  _Bool D.23935;
  _Bool D.23936;
  const unsigned char * D.23939;
  unsigned char D.23940;
  int D.23941;
  const unsigned char * D.23942;
  unsigned char D.23943;
  int D.23944;
  _Bool D.23945;
  _Bool D.23946;
  const unsigned char * D.23949;
  unsigned char D.23950;
  int D.23951;
  const unsigned char * D.23952;
  unsigned char D.23953;
  int D.23954;
  _Bool D.23955;
  _Bool D.23956;
  const unsigned char * D.23959;
  unsigned char D.23960;
  int D.23961;
  const unsigned char * D.23962;
  unsigned char D.23963;
  int D.23964;
  const char * D.23966;
  _Bool D.23967;
  long int D.23968;
  long int D.23969;
  short unsigned int D.23974;
  struct MonoMethodSignature * D.23975;
  short unsigned int D.23976;
  _Bool D.23977;
  struct MonoMethodSignature * D.23982;
  short unsigned int D.23983;
  int D.23984;
  int D.23985;
  int D.23986;
  short unsigned int D.23989;
  int D.23990;
  int D.23991;
  _Bool D.23994;
  long int D.23995;
  long int D.23996;
  unsigned char D.23999;
  unsigned char D.24000;
  int D.24003;
  _Bool D.24008;
  long int D.24009;
  long int D.24010;
  struct MonoImage * D.24015;
  struct GHashTable * * D.24016;
  struct MonoMethod * D.24019;
  struct GHashTable * * D.24023;
  _Bool D.24031;
  long int D.24032;
  long int D.24033;
  struct GHashTable * D.24036;
  struct GHashTable * D.24039;
  _Bool D.24042;
  long int D.24043;
  long int D.24044;
  struct GHashTable * * D.24050;
  struct MonoClass * D.24061;
  struct MonoClass * D.24062;
  struct MonoType * D.24063;
  unsigned char D.24064;
  unsigned char D.24065;
  _Bool D.24066;
  long int D.24067;
  long int D.24068;
  unsigned int local_prev.127;
  unsigned int D.24072;
  int D.24073;
  unsigned int D.24074;
  struct MonoGenericContext * D.24077;
  struct MonoMethod * D.24078;
  struct MonoType * D.24080;
  unsigned char D.24081;
  unsigned int pos0.128;
  unsigned int local_target.129;
  unsigned int D.24088;
  struct MonoType * D.24100;
  int D.24101;
  struct MonoClass * D.24104;
  int D.24107;
  _Bool D.24116;
  long int D.24117;
  long int D.24118;
  struct MonoMethodSignature * D.24125;
  struct MonoClass * D.24126;
  struct MonoImage * D.24127;
  struct MonoMethodSignature * D.24128;
  _Bool D.24131;
  long int D.24132;
  long int D.24133;
  _Bool D.24139;
  long int D.24140;
  long int D.24141;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * static_sig;
  struct MonoMethodSignature * invoke_sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * newm;
  struct GHashTable * cache;
  struct SignatureMethodPair key;
  struct SignatureMethodPair * new_key;
  int local_prev;
  int local_target;
  int pos0;
  char * name;
  struct MonoMethod * target_method;
  struct MonoClass * target_class;
  gboolean callvirt;
  gboolean closed_over_null;
  gboolean static_method_with_first_arg_bound;
  struct MonoGenericContext * ctx;
  struct MonoGenericContainer * container;
  struct MonoMethod * orig_method;
  struct WrapperInfo * info;

  try
    {
      target_method = 0B;
      target_class = 0B;
      callvirt = 0;
      closed_over_null = 0;
      static_method_with_first_arg_bound = 0;
      ctx = 0B;
      container = 0B;
      orig_method = 0B;
      if (del != 0B) goto <D.23889>; else goto <D.23890>;
      <D.23889>:
      D.23891 = del->target;
      if (D.23891 == 0B) goto <D.23892>; else goto <D.23893>;
      <D.23892>:
      D.23894 = del->method;
      if (D.23894 != 0B) goto <D.23895>; else goto <D.23896>;
      <D.23895>:
      D.23894 = del->method;
      D.23897 = mono_method_signature (D.23894);
      D.23898 = BIT_FIELD_REF <*D.23897, 8, 112>;
      D.23899 = D.23898 & 64;
      if (D.23899 != 0) goto <D.23900>; else goto <D.23901>;
      <D.23900>:
      callvirt = 1;
      target_method = del->method;
      D.23902 = BIT_FIELD_REF <*target_method, 8, 264>;
      D.23903 = D.23902 & 16;
      if (D.23903 != 0) goto <D.23904>; else goto <D.23905>;
      <D.23904>:
      {
        struct MonoType * target_type;

        D.23906 = method->signature;
        D.23907 = BIT_FIELD_REF <*D.23906, 8, 112>;
        D.23908 = D.23907 & 64;
        D.23909 = D.23908 == 0;
        D.23910 = (long int) D.23909;
        D.23911 = __builtin_expect (D.23910, 0);
        if (D.23911 != 0) goto <D.23912>; else goto <D.23913>;
        <D.23912>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4211, "method->signature->hasthis");
        <D.23913>:
        D.23914 = mono_method_get_context (method);
        D.23906 = method->signature;
        D.23915 = D.23906->params[0];
        target_type = mono_class_inflate_generic_type (D.23915, D.23914);
        target_class = mono_class_from_mono_type (target_type);
      }
      goto <D.23916>;
      <D.23905>:
      D.23894 = del->method;
      target_class = D.23894->klass;
      <D.23916>:
      <D.23901>:
      <D.23896>:
      <D.23893>:
      <D.23890>:
      if (method == 0B) goto <D.23918>; else goto <D.23921>;
      <D.23921>:
      D.23922 = method->klass;
      D.23923 = D.23922->parent;
      D.23924 = mono_defaults.multicastdelegate_class;
      if (D.23923 != D.23924) goto <D.23918>; else goto <D.23925>;
      <D.23925>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = method->name;
          D.23929 = "Invoke";
          D.23930 = MEM[(const unsigned char *)D.23929];
          D.23931 = (int) D.23930;
          D.23932 = *__s2;
          D.23933 = (int) D.23932;
          __result = D.23931 - D.23933;
          {
            D.23934 = __s2_len != 0;
            D.23935 = __result == 0;
            D.23936 = D.23934 & D.23935;
            if (D.23936 != 0) goto <D.23937>; else goto <D.23938>;
            <D.23937>:
            D.23939 = &MEM[(void *)"Invoke" + 1B];
            D.23940 = *D.23939;
            D.23941 = (int) D.23940;
            D.23942 = __s2 + 1;
            D.23943 = *D.23942;
            D.23944 = (int) D.23943;
            __result = D.23941 - D.23944;
            D.23945 = __s2_len > 1;
            D.23935 = __result == 0;
            D.23946 = D.23945 & D.23935;
            if (D.23946 != 0) goto <D.23947>; else goto <D.23948>;
            <D.23947>:
            D.23949 = &MEM[(void *)"Invoke" + 2B];
            D.23950 = *D.23949;
            D.23951 = (int) D.23950;
            D.23952 = __s2 + 2;
            D.23953 = *D.23952;
            D.23954 = (int) D.23953;
            __result = D.23951 - D.23954;
            D.23955 = __s2_len > 2;
            D.23935 = __result == 0;
            D.23956 = D.23955 & D.23935;
            if (D.23956 != 0) goto <D.23957>; else goto <D.23958>;
            <D.23957>:
            D.23959 = &MEM[(void *)"Invoke" + 3B];
            D.23960 = *D.23959;
            D.23961 = (int) D.23960;
            D.23962 = __s2 + 3;
            D.23963 = *D.23962;
            D.23964 = (int) D.23963;
            __result = D.23961 - D.23964;
            <D.23958>:
            <D.23948>:
            <D.23938>:
          }
          D.19925 = __result;
        }
        iftmp.126 = -D.19925;
        goto <D.23965>;
        <D.23928>:
        D.23966 = method->name;
        iftmp.126 = __builtin_strcmp (D.23966, "Invoke");
        <D.23965>:
        D.19926 = iftmp.126;
      }
      if (D.19926 != 0) goto <D.23918>; else goto <D.23919>;
      <D.23918>:
      iftmp.125 = 1;
      goto <D.23920>;
      <D.23919>:
      iftmp.125 = 0;
      <D.23920>:
      D.23967 = iftmp.125 != 0;
      D.23968 = (long int) D.23967;
      D.23969 = __builtin_expect (D.23968, 0);
      if (D.23969 != 0) goto <D.23970>; else goto <D.23971>;
      <D.23970>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4221, "method && method->klass->parent == mono_defaults.multicastdelegate_class && !strcmp (method->name, \"Invoke\")");
      <D.23971>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      if (callvirt != 0) goto <D.23972>; else goto <D.23973>;
      <D.23972>:
      D.23974 = sig->param_count;
      D.23894 = del->method;
      D.23975 = mono_method_signature (D.23894);
      D.23976 = D.23975->param_count;
      D.23977 = D.23974 == D.23976;
      closed_over_null = (gboolean) D.23977;
      <D.23973>:
      if (del != 0B) goto <D.23978>; else goto <D.23979>;
      <D.23978>:
      D.23894 = del->method;
      if (D.23894 != 0B) goto <D.23980>; else goto <D.23981>;
      <D.23980>:
      D.23894 = del->method;
      D.23982 = mono_method_signature (D.23894);
      D.23983 = D.23982->param_count;
      D.23984 = (int) D.23983;
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      D.23986 = D.23985 + 1;
      if (D.23984 == D.23986) goto <D.23987>; else goto <D.23988>;
      <D.23987>:
      D.23894 = del->method;
      D.23989 = D.23894->flags;
      D.23990 = (int) D.23989;
      D.23991 = D.23990 & 16;
      if (D.23991 != 0) goto <D.23992>; else goto <D.23993>;
      <D.23992>:
      D.23994 = callvirt != 0;
      D.23995 = (long int) D.23994;
      D.23996 = __builtin_expect (D.23995, 0);
      if (D.23996 != 0) goto <D.23997>; else goto <D.23998>;
      <D.23997>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4229, "!callvirt");
      <D.23998>:
      D.23894 = del->method;
      invoke_sig = mono_method_signature (D.23894);
      target_method = 0B;
      static_method_with_first_arg_bound = 1;
      <D.23993>:
      <D.23988>:
      <D.23981>:
      <D.23979>:
      D.23999 = BIT_FIELD_REF <*method, 8, 264>;
      D.24000 = D.23999 & 16;
      if (D.24000 != 0) goto <D.24001>; else goto <D.24002>;
      <D.24001>:
      D.24003 = callvirt | static_method_with_first_arg_bound;
      if (D.24003 == 0) goto <D.24004>; else goto <D.24005>;
      <D.24004>:
      orig_method = method;
      ctx = &MEM[(struct MonoMethodInflated *)method].context;
      method = MEM[(struct MonoMethodInflated *)method].declaring;
      container = mono_method_get_generic_container (method);
      if (container == 0B) goto <D.24006>; else goto <D.24007>;
      <D.24006>:
      D.23922 = method->klass;
      container = D.23922->generic_container;
      <D.24007>:
      D.24008 = container == 0B;
      D.24009 = (long int) D.24008;
      D.24010 = __builtin_expect (D.24009, 0);
      if (D.24010 != 0) goto <D.24011>; else goto <D.24012>;
      <D.24011>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4246, "container");
      <D.24012>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      <D.24005>:
      <D.24002>:
      if (ctx != 0B) goto <D.24013>; else goto <D.24014>;
      <D.24013>:
      D.23922 = method->klass;
      D.24015 = D.23922->image;
      D.24016 = &D.24015->delegate_invoke_generic_cache;
      cache = get_cache (D.24016, mono_aligned_addr_hash, 0B);
      res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
      if (res != 0B) goto <D.24017>; else goto <D.24018>;
      <D.24017>:
      D.24019 = res;
      return D.24019;
      <D.24018>:
      goto <D.24020>;
      <D.24014>:
      if (static_method_with_first_arg_bound != 0) goto <D.24021>; else goto <D.24022>;
      <D.24021>:
      D.23922 = method->klass;
      D.24015 = D.23922->image;
      D.24023 = &D.24015->delegate_bound_static_invoke_cache;
      cache = get_cache (D.24023, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, invoke_sig);
      if (res != 0B) goto <D.24024>; else goto <D.24025>;
      <D.24024>:
      D.24019 = res;
      return D.24019;
      <D.24025>:
      goto <D.24026>;
      <D.24022>:
      if (callvirt != 0) goto <D.24027>; else goto <D.24028>;
      <D.24027>:
      {
        struct GHashTable * * cache_ptr;

        D.23922 = method->klass;
        D.24015 = D.23922->image;
        cache_ptr = &D.24015->delegate_abstract_invoke_cache;
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24029>; else goto <D.24030>;
          <D.24029>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24030>:
          D.24031 = ret != 0;
          D.24032 = (long int) D.24031;
          D.24033 = __builtin_expect (D.24032, 0);
          if (D.24033 != 0) goto <D.24034>; else goto <D.24035>;
          <D.24034>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4275, "ret == 0");
          <D.24035>:
        }
        D.24036 = *cache_ptr;
        if (D.24036 == 0B) goto <D.24037>; else goto <D.24038>;
        <D.24037>:
        D.24039 = monoeg_g_hash_table_new_full (signature_method_pair_hash, signature_method_pair_equal, free_signature_method_pair, 0B);
        *cache_ptr = D.24039;
        <D.24038>:
        cache = *cache_ptr;
        key.sig = invoke_sig;
        key.method = target_method;
        res = monoeg_g_hash_table_lookup (cache, &key);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24040>; else goto <D.24041>;
          <D.24040>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24041>:
          D.24042 = ret != 0;
          D.24043 = (long int) D.24042;
          D.24044 = __builtin_expect (D.24043, 0);
          if (D.24044 != 0) goto <D.24045>; else goto <D.24046>;
          <D.24045>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4282, "ret == 0");
          <D.24046>:
        }
        if (res != 0B) goto <D.24047>; else goto <D.24048>;
        <D.24047>:
        D.24019 = res;
        return D.24019;
        <D.24048>:
      }
      goto <D.24049>;
      <D.24028>:
      D.23922 = method->klass;
      D.24015 = D.23922->image;
      D.24050 = &D.24015->delegate_invoke_cache;
      cache = get_cache (D.24050, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, sig);
      if (res != 0B) goto <D.24051>; else goto <D.24052>;
      <D.24051>:
      D.24019 = res;
      return D.24019;
      <D.24052>:
      <D.24049>:
      <D.24026>:
      <D.24020>:
      D.23922 = method->klass;
      D.24015 = D.23922->image;
      static_sig = signature_dup (D.24015, sig);
      static_sig->hasthis = 0;
      if (static_method_with_first_arg_bound == 0) goto <D.24053>; else goto <D.24054>;
      <D.24053>:
      invoke_sig = static_sig;
      <D.24054>:
      if (static_method_with_first_arg_bound != 0) goto <D.24055>; else goto <D.24056>;
      <D.24055>:
      name = mono_signature_to_name (invoke_sig, "invoke_bound_");
      goto <D.24057>;
      <D.24056>:
      name = mono_signature_to_name (sig, "invoke");
      <D.24057>:
      if (ctx != 0B) goto <D.24058>; else goto <D.24059>;
      <D.24058>:
      D.23922 = method->klass;
      mb = mono_mb_new (D.23922, name, 1);
      goto <D.24060>;
      <D.24059>:
      D.23922 = method->klass;
      D.24015 = D.23922->image;
      D.24061 = get_wrapper_target_class (D.24015);
      mb = mono_mb_new (D.24061, name, 1);
      <D.24060>:
      monoeg_g_free (name);
      D.24062 = mono_defaults.object_class;
      D.24063 = &D.24062->byval_arg;
      local_target = mono_mb_add_local (mb, D.24063);
      D.24062 = mono_defaults.object_class;
      D.24063 = &D.24062->byval_arg;
      local_prev = mono_mb_add_local (mb, D.24063);
      D.24064 = BIT_FIELD_REF <*sig, 8, 112>;
      D.24065 = D.24064 & 64;
      D.24066 = D.24065 == 0;
      D.24067 = (long int) D.24066;
      D.24068 = __builtin_expect (D.24067, 0);
      if (D.24068 != 0) goto <D.24069>; else goto <D.24070>;
      <D.24069>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4314, "sig->hasthis");
      <D.24070>:
      emit_thread_interrupt_checkpoint (mb);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 88);
      mono_mb_emit_byte (mb, 80);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_stloc (mb, local_prev.127);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.127);
      D.24072 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.24072;
      mono_mb_emit_byte (mb, 240);
      mono_mb_emit_byte (mb, 12);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.127);
      i = 0;
      goto <D.19931>;
      <D.19930>:
      D.24073 = i + 1;
      D.24074 = (unsigned int) D.24073;
      mono_mb_emit_ldarg (mb, D.24074);
      i = i + 1;
      <D.19931>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      if (D.23985 > i) goto <D.19930>; else goto <D.19932>;
      <D.19932>:
      if (ctx != 0B) goto <D.24075>; else goto <D.24076>;
      <D.24075>:
      D.24077 = &container->context;
      D.24078 = mono_class_inflate_generic_method (method, D.24077);
      mono_mb_emit_op (mb, 111, D.24078);
      goto <D.24079>;
      <D.24076>:
      mono_mb_emit_op (mb, 111, method);
      <D.24079>:
      D.24080 = sig->ret;
      D.24081 = D.24080->type;
      if (D.24081 != 1) goto <D.24082>; else goto <D.24083>;
      <D.24082>:
      mono_mb_emit_byte (mb, 38);
      <D.24083>:
      pos0.128 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.128);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 32);
      mono_mb_emit_byte (mb, 80);
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_stloc (mb, local_target.129);
      if (static_method_with_first_arg_bound == 0) goto <D.24086>; else goto <D.24087>;
      <D.24086>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      D.24088 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.24088;
      if (callvirt != 0) goto <D.24089>; else goto <D.24090>;
      <D.24089>:
      mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
      goto <D.24091>;
      <D.24090>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      i = 0;
      goto <D.19934>;
      <D.19933>:
      D.24073 = i + 1;
      D.24074 = (unsigned int) D.24073;
      mono_mb_emit_ldarg (mb, D.24074);
      i = i + 1;
      <D.19934>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      if (D.23985 > i) goto <D.19933>; else goto <D.19935>;
      <D.19935>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, sig);
      mono_mb_emit_byte (mb, 42);
      <D.24091>:
      pos0.128 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.128);
      <D.24087>:
      if (callvirt != 0) goto <D.24092>; else goto <D.24093>;
      <D.24092>:
      if (closed_over_null == 0) goto <D.24094>; else goto <D.24095>;
      <D.24094>:
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_op (mb, 116, target_class);
      i = 1;
      goto <D.19937>;
      <D.19936>:
      D.24073 = i + 1;
      D.24074 = (unsigned int) D.24073;
      mono_mb_emit_ldarg (mb, D.24074);
      i = i + 1;
      <D.19937>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      if (D.23985 > i) goto <D.19936>; else goto <D.19938>;
      <D.19938>:
      mono_mb_emit_op (mb, 111, target_method);
      goto <D.24096>;
      <D.24095>:
      mono_mb_emit_byte (mb, 20);
      i = 0;
      goto <D.19940>;
      <D.19939>:
      D.24073 = i + 1;
      D.24074 = (unsigned int) D.24073;
      mono_mb_emit_ldarg (mb, D.24074);
      i = i + 1;
      <D.19940>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      if (D.23985 > i) goto <D.19939>; else goto <D.19941>;
      <D.19941>:
      mono_mb_emit_op (mb, 40, target_method);
      <D.24096>:
      goto <D.24097>;
      <D.24093>:
      if (static_method_with_first_arg_bound != 0) goto <D.24098>; else goto <D.24099>;
      <D.24098>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      D.24100 = invoke_sig->params[0];
      D.24101 = mono_type_is_reference (D.24100);
      if (D.24101 == 0) goto <D.24102>; else goto <D.24103>;
      <D.24102>:
      D.24100 = invoke_sig->params[0];
      D.24104 = mono_class_from_mono_type (D.24100);
      mono_mb_emit_op (mb, 165, D.24104);
      <D.24103>:
      <D.24099>:
      i = 0;
      goto <D.19943>;
      <D.19942>:
      D.24073 = i + 1;
      D.24074 = (unsigned int) D.24073;
      mono_mb_emit_ldarg (mb, D.24074);
      i = i + 1;
      <D.19943>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      if (D.23985 > i) goto <D.19942>; else goto <D.19944>;
      <D.19944>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, invoke_sig);
      <D.24097>:
      mono_mb_emit_byte (mb, 42);
      mb->skip_visibility = 1;
      if (ctx != 0B) goto <D.24105>; else goto <D.24106>;
      <D.24105>:
      {
        struct MonoMethod * def;

        D.23974 = sig->param_count;
        D.23985 = (int) D.23974;
        D.24107 = D.23985 + 16;
        D.23922 = method->klass;
        def = mono_mb_create_and_cache (cache, D.23922, mb, sig, D.24107);
        res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
      }
      goto <D.24108>;
      <D.24106>:
      if (static_method_with_first_arg_bound != 0) goto <D.24109>; else goto <D.24110>;
      <D.24109>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      D.24107 = D.23985 + 16;
      res = mono_mb_create_and_cache (cache, invoke_sig, mb, sig, D.24107);
      info = mono_wrapper_info_create (res, 23);
      mono_marshal_set_wrapper_info (res, info);
      goto <D.24111>;
      <D.24110>:
      if (callvirt != 0) goto <D.24112>; else goto <D.24113>;
      <D.24112>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      D.24107 = D.23985 + 16;
      newm = mono_mb_create_method (mb, sig, D.24107);
      mono_memory_barrier ();
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24114>; else goto <D.24115>;
        <D.24114>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.24115>:
        D.24116 = ret != 0;
        D.24117 = (long int) D.24116;
        D.24118 = __builtin_expect (D.24117, 0);
        if (D.24118 != 0) goto <D.24119>; else goto <D.24120>;
        <D.24119>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4432, "ret == 0");
        <D.24120>:
      }
      res = monoeg_g_hash_table_lookup (cache, &key);
      if (res == 0B) goto <D.24121>; else goto <D.24122>;
      <D.24121>:
      res = newm;
      new_key = monoeg_malloc0 (16);
      *new_key = key;
      if (static_method_with_first_arg_bound != 0) goto <D.24123>; else goto <D.24124>;
      <D.24123>:
      D.24125 = key.sig;
      D.23894 = del->method;
      D.24126 = D.23894->klass;
      D.24127 = D.24126->image;
      D.24128 = signature_dup (D.24127, D.24125);
      new_key->sig = D.24128;
      <D.24124>:
      monoeg_g_hash_table_insert_replace (cache, new_key, res, 0);
      info = mono_wrapper_info_create (res, 22);
      mono_marshal_set_wrapper_info (res, info);
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24129>; else goto <D.24130>;
        <D.24129>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24130>:
        D.24131 = ret != 0;
        D.24132 = (long int) D.24131;
        D.24133 = __builtin_expect (D.24132, 0);
        if (D.24133 != 0) goto <D.24134>; else goto <D.24135>;
        <D.24134>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4445, "ret == 0");
        <D.24135>:
      }
      goto <D.24136>;
      <D.24122>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24137>; else goto <D.24138>;
        <D.24137>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24138>:
        D.24139 = ret != 0;
        D.24140 = (long int) D.24139;
        D.24141 = __builtin_expect (D.24140, 0);
        if (D.24141 != 0) goto <D.24142>; else goto <D.24143>;
        <D.24142>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4447, "ret == 0");
        <D.24143>:
      }
      mono_free_method (newm);
      <D.24136>:
      goto <D.24144>;
      <D.24113>:
      D.23974 = sig->param_count;
      D.23985 = (int) D.23974;
      D.24107 = D.23985 + 16;
      res = mono_mb_create_and_cache (cache, sig, mb, sig, D.24107);
      info = mono_wrapper_info_create (res, 0);
      mono_marshal_set_wrapper_info (res, info);
      <D.24144>:
      <D.24111>:
      <D.24108>:
      mono_mb_free (mb);
      D.24019 = res;
      return D.24019;
    }
  finally
    {
      key = {CLOBBER};
    }
}


free_signature_method_pair (struct SignatureMethodPair * pair)
{
  monoeg_g_free (pair);
}


signature_method_pair_equal (struct SignatureMethodPair * pair1, struct SignatureMethodPair * pair2)
{
  gboolean D.24147;
  int iftmp.130;
  struct MonoMethodSignature * D.24151;
  struct MonoMethodSignature * D.24152;
  int D.24153;
  struct MonoMethod * D.24155;
  struct MonoMethod * D.24156;

  D.24151 = pair2->sig;
  D.24152 = pair1->sig;
  D.24153 = mono_metadata_signature_equal (D.24152, D.24151);
  if (D.24153 != 0) goto <D.24154>; else goto <D.24149>;
  <D.24154>:
  D.24155 = pair1->method;
  D.24156 = pair2->method;
  if (D.24155 == D.24156) goto <D.24157>; else goto <D.24149>;
  <D.24157>:
  iftmp.130 = 1;
  goto <D.24150>;
  <D.24149>:
  iftmp.130 = 0;
  <D.24150>:
  D.24147 = iftmp.130;
  return D.24147;
}


signature_method_pair_hash (const void * data)
{
  guint D.24159;
  struct MonoMethodSignature * D.24160;
  unsigned int D.24161;
  struct MonoMethod * D.24162;
  unsigned int D.24163;
  struct SignatureMethodPair * pair;

  pair = data;
  D.24160 = pair->sig;
  D.24161 = mono_signature_hash (D.24160);
  D.24162 = pair->method;
  D.24163 = mono_aligned_addr_hash (D.24162);
  D.24159 = D.24161 ^ D.24163;
  return D.24159;
}


mono_wrapper_info_create (struct MonoMethod * wrapper, WrapperSubtype subtype)
{
  struct MonoClass * D.24165;
  struct MonoImage * D.24166;
  struct WrapperInfo * D.24167;
  struct WrapperInfo * info;

  D.24165 = wrapper->klass;
  D.24166 = D.24165->image;
  info = mono_image_alloc0 (D.24166, 24);
  info->subtype = subtype;
  D.24167 = info;
  return D.24167;
}


mono_marshal_get_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.24169;
  struct MonoMethodSignature * D.24172;
  struct MonoMethodSignature * sig;

  D.24169 = mono_method_signature (method);
  sig = lookup_string_ctor_signature (D.24169);
  if (sig == 0B) goto <D.24170>; else goto <D.24171>;
  <D.24170>:
  sig = add_string_ctor_signature (method);
  <D.24171>:
  D.24172 = sig;
  return D.24172;
}


lookup_string_ctor_signature (struct MonoMethodSignature * sig)
{
  _Bool D.24176;
  long int D.24177;
  long int D.24178;
  struct MonoMethodSignature * D.24181;
  int D.24182;
  _Bool D.24187;
  long int D.24188;
  long int D.24189;
  struct MonoMethodSignature * D.24192;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;
  struct GSList * item;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24174>; else goto <D.24175>;
    <D.24174>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24175>:
    D.24176 = ret != 0;
    D.24177 = (long int) D.24176;
    D.24178 = __builtin_expect (D.24177, 0);
    if (D.24178 != 0) goto <D.24179>; else goto <D.24180>;
    <D.24179>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4498, "ret == 0");
    <D.24180>:
  }
  callsig = 0B;
  item = strsig_list;
  goto <D.19973>;
  <D.19972>:
  cs = item->data;
  D.24181 = cs->ctor_sig;
  D.24182 = mono_metadata_signature_equal (sig, D.24181);
  if (D.24182 != 0) goto <D.24183>; else goto <D.24184>;
  <D.24183>:
  callsig = cs->sig;
  goto <D.19971>;
  <D.24184>:
  item = item->next;
  <D.19973>:
  if (item != 0B) goto <D.19972>; else goto <D.19971>;
  <D.19971>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24185>; else goto <D.24186>;
    <D.24185>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24186>:
    D.24187 = ret != 0;
    D.24188 = (long int) D.24187;
    D.24189 = __builtin_expect (D.24188, 0);
    if (D.24189 != 0) goto <D.24190>; else goto <D.24191>;
    <D.24190>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4510, "ret == 0");
    <D.24191>:
  }
  D.24192 = callsig;
  return D.24192;
}


add_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.24194;
  struct MonoClass * D.24195;
  struct MonoImage * D.24196;
  struct MonoClass * D.24197;
  struct MonoType * D.24198;
  struct MonoMethodSignature * D.24199;
  _Bool D.24202;
  long int D.24203;
  long int D.24204;
  struct GSList * strsig_list.131;
  struct GSList * strsig_list.132;
  _Bool D.24211;
  long int D.24212;
  long int D.24213;
  struct MonoMethodSignature * D.24216;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;

  D.24194 = mono_method_signature (method);
  D.24195 = method->klass;
  D.24196 = D.24195->image;
  callsig = signature_dup (D.24196, D.24194);
  D.24197 = mono_defaults.string_class;
  D.24198 = &D.24197->byval_arg;
  callsig->ret = D.24198;
  cs = monoeg_malloc (16);
  cs->sig = callsig;
  D.24199 = mono_method_signature (method);
  cs->ctor_sig = D.24199;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24200>; else goto <D.24201>;
    <D.24200>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24201>:
    D.24202 = ret != 0;
    D.24203 = (long int) D.24202;
    D.24204 = __builtin_expect (D.24203, 0);
    if (D.24204 != 0) goto <D.24205>; else goto <D.24206>;
    <D.24205>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4526, "ret == 0");
    <D.24206>:
  }
  strsig_list.131 = strsig_list;
  strsig_list.132 = monoeg_g_slist_prepend (strsig_list.131, cs);
  strsig_list = strsig_list.132;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24209>; else goto <D.24210>;
    <D.24209>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24210>:
    D.24211 = ret != 0;
    D.24212 = (long int) D.24211;
    D.24213 = __builtin_expect (D.24212, 0);
    if (D.24213 != 0) goto <D.24214>; else goto <D.24215>;
    <D.24214>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4528, "ret == 0");
    <D.24215>:
  }
  D.24216 = callsig;
  return D.24216;
}


mono_marshal_get_runtime_invoke (struct MonoMethod * method, gboolean virtual)
{
  _Bool D.24218;
  long int D.24219;
  long int D.24220;
  struct MonoMethodSignature * cctor_signature.133;
  struct MonoImage * D.24226;
  struct MonoMethodSignature * cctor_signature.134;
  struct MonoClass * D.24228;
  struct MonoType * D.24229;
  struct MonoMethodSignature * finalize_signature.135;
  struct MonoMethodSignature * finalize_signature.136;
  struct MonoClass * D.24238;
  struct MonoImage * D.24239;
  struct GHashTable * * D.24240;
  struct GHashTable * * D.24242;
  struct MonoMethod * D.24245;
  unsigned char D.24246;
  short unsigned int D.24249;
  unsigned int D.24250;
  unsigned int D.24251;
  unsigned char D.24254;
  unsigned char D.24255;
  struct MonoMethodSignature * D.24258;
  unsigned char D.24262;
  unsigned char D.24263;
  struct MonoMethodSignature * D.24266;
  int D.24268;
  int D.24272;
  unsigned char D.24280;
  unsigned char D.24281;
  struct MonoMethodSignature * D.24283;
  unsigned char D.24284;
  unsigned char D.24285;
  struct MonoImage * D.24287;
  struct GHashTable * * D.24288;
  struct GHashTable * * D.24289;
  _Bool D.24292;
  long int D.24293;
  long int D.24294;
  _Bool D.24299;
  long int D.24300;
  long int D.24301;
  struct MonoClass * D.24306;
  struct MonoType * D.24307;
  struct MonoMethodSignature * D.24311;
  unsigned char D.24312;
  unsigned char D.24313;
  struct MonoType * D.24315;
  struct MonoType * D.24316;
  struct MonoClass * D.24317;
  struct MonoType * D.24318;
  const char * iftmp.137;
  short unsigned int D.24325;
  int D.24326;
  int D.24327;
  WrapperSubtype iftmp.138;
  _Bool D.24335;
  long int D.24336;
  long int D.24337;
  _Bool D.24342;
  long int D.24343;
  long int D.24344;
  _Bool D.24351;
  long int D.24352;
  long int D.24353;
  struct GHashTable * D.24358;
  _Bool D.24362;
  long int D.24363;
  long int D.24364;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * callsig;
  struct MonoMethodBuilder * mb;
  struct GHashTable * cache;
  struct MonoClass * target_klass;
  struct MonoMethod * res;
  static struct MonoMethodSignature * cctor_signature = 0B;
  static struct MonoMethodSignature * finalize_signature = 0B;
  char * name;
  const char * param_names[16];
  gboolean need_direct_wrapper;
  struct WrapperInfo * info;

  try
    {
      cache = 0B;
      res = 0B;
      need_direct_wrapper = 0;
      D.24218 = method == 0B;
      D.24219 = (long int) D.24218;
      D.24220 = __builtin_expect (D.24219, 0);
      if (D.24220 != 0) goto <D.24221>; else goto <D.24222>;
      <D.24221>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4932, "method");
      <D.24222>:
      cctor_signature.133 = cctor_signature;
      if (cctor_signature.133 == 0B) goto <D.24224>; else goto <D.24225>;
      <D.24224>:
      D.24226 = mono_defaults.corlib;
      cctor_signature.134 = mono_metadata_signature_alloc (D.24226, 0);
      cctor_signature = cctor_signature.134;
      cctor_signature.133 = cctor_signature;
      D.24228 = mono_defaults.void_class;
      D.24229 = &D.24228->byval_arg;
      cctor_signature.133->ret = D.24229;
      <D.24225>:
      finalize_signature.135 = finalize_signature;
      if (finalize_signature.135 == 0B) goto <D.24231>; else goto <D.24232>;
      <D.24231>:
      D.24226 = mono_defaults.corlib;
      finalize_signature.136 = mono_metadata_signature_alloc (D.24226, 0);
      finalize_signature = finalize_signature.136;
      finalize_signature.135 = finalize_signature;
      D.24228 = mono_defaults.void_class;
      D.24229 = &D.24228->byval_arg;
      finalize_signature.135->ret = D.24229;
      finalize_signature.135 = finalize_signature;
      finalize_signature.135->hasthis = 1;
      <D.24232>:
      if (virtual != 0) goto <D.24234>; else goto <D.24235>;
      <D.24234>:
      need_direct_wrapper = 1;
      <D.24235>:
      if (virtual != 0) goto <D.24236>; else goto <D.24237>;
      <D.24236>:
      D.24238 = method->klass;
      D.24239 = D.24238->image;
      D.24240 = &D.24239->runtime_invoke_vcall_cache;
      cache = get_cache (D.24240, mono_aligned_addr_hash, 0B);
      goto <D.24241>;
      <D.24237>:
      D.24238 = method->klass;
      D.24239 = D.24238->image;
      D.24242 = &D.24239->runtime_invoke_direct_cache;
      cache = get_cache (D.24242, mono_aligned_addr_hash, 0B);
      <D.24241>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.24243>; else goto <D.24244>;
      <D.24243>:
      D.24245 = res;
      return D.24245;
      <D.24244>:
      D.24238 = method->klass;
      D.24246 = D.24238->rank;
      if (D.24246 != 0) goto <D.24247>; else goto <D.24248>;
      <D.24247>:
      D.24249 = method->iflags;
      D.24250 = (unsigned int) D.24249;
      D.24251 = D.24250 & 4097;
      if (D.24251 == 4097) goto <D.24252>; else goto <D.24253>;
      <D.24252>:
      need_direct_wrapper = 1;
      <D.24253>:
      <D.24248>:
      D.24254 = BIT_FIELD_REF <*method, 8, 256>;
      D.24255 = D.24254 & 128;
      if (D.24255 != 0) goto <D.24256>; else goto <D.24257>;
      <D.24256>:
      D.24258 = mono_method_signature (method);
      callsig = lookup_string_ctor_signature (D.24258);
      if (callsig == 0B) goto <D.24259>; else goto <D.24260>;
      <D.24259>:
      callsig = add_string_ctor_signature (method);
      <D.24260>:
      need_direct_wrapper = 1;
      goto <D.24261>;
      <D.24257>:
      D.24262 = BIT_FIELD_REF <*method, 8, 264>;
      D.24263 = D.24262 & 2;
      if (D.24263 != 0) goto <D.24264>; else goto <D.24265>;
      <D.24264>:
      D.24266 = mono_method_signature (method);
      D.24238 = method->klass;
      D.24239 = D.24238->image;
      callsig = signature_dup (D.24239, D.24266);
      goto <D.24267>;
      <D.24265>:
      callsig = mono_method_signature (method);
      <D.24267>:
      <D.24261>:
      D.24238 = method->klass;
      D.24239 = D.24238->image;
      target_klass = get_wrapper_target_class (D.24239);
      cctor_signature.133 = cctor_signature;
      D.24268 = mono_metadata_signature_equal (callsig, cctor_signature.133);
      if (D.24268 != 0) goto <D.24269>; else goto <D.24270>;
      <D.24269>:
      callsig = cctor_signature;
      target_klass = mono_defaults.object_class;
      goto <D.24271>;
      <D.24270>:
      finalize_signature.135 = finalize_signature;
      D.24272 = mono_metadata_signature_equal (callsig, finalize_signature.135);
      if (D.24272 != 0) goto <D.24273>; else goto <D.24274>;
      <D.24273>:
      callsig = finalize_signature;
      target_klass = mono_defaults.object_class;
      <D.24274>:
      <D.24271>:
      if (need_direct_wrapper != 0) goto <D.24275>; else goto <D.24276>;
      <D.24275>:
      goto <D.24277>;
      <D.24276>:
      {
        struct MonoMethodSignature * tmp_sig;

        callsig = mono_marshal_get_runtime_invoke_sig (callsig);
        D.24238 = method->klass;
        D.24280 = BIT_FIELD_REF <*D.24238, 8, 256>;
        D.24281 = D.24280 & 8;
        if (D.24281 != 0) goto <D.24282>; else goto <D.24278>;
        <D.24282>:
        D.24283 = mono_method_signature (method);
        D.24284 = BIT_FIELD_REF <*D.24283, 8, 112>;
        D.24285 = D.24284 & 64;
        if (D.24285 != 0) goto <D.24286>; else goto <D.24278>;
        <D.24286>:
        D.24287 = target_klass->image;
        D.24288 = &D.24287->runtime_invoke_vtype_cache;
        cache = get_cache (D.24288, mono_signature_hash, runtime_invoke_signature_equal);
        goto <D.24279>;
        <D.24278>:
        D.24287 = target_klass->image;
        D.24289 = &D.24287->runtime_invoke_cache;
        cache = get_cache (D.24289, mono_signature_hash, runtime_invoke_signature_equal);
        <D.24279>:
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24290>; else goto <D.24291>;
          <D.24290>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24291>:
          D.24292 = ret != 0;
          D.24293 = (long int) D.24292;
          D.24294 = __builtin_expect (D.24293, 0);
          if (D.24294 != 0) goto <D.24295>; else goto <D.24296>;
          <D.24295>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5010, "ret == 0");
          <D.24296>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24297>; else goto <D.24298>;
          <D.24297>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24298>:
          D.24299 = ret != 0;
          D.24300 = (long int) D.24299;
          D.24301 = __builtin_expect (D.24300, 0);
          if (D.24301 != 0) goto <D.24302>; else goto <D.24303>;
          <D.24302>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5012, "ret == 0");
          <D.24303>:
        }
        if (res != 0B) goto <D.24304>; else goto <D.24305>;
        <D.24304>:
        monoeg_g_free (callsig);
        D.24245 = res;
        return D.24245;
        <D.24305>:
        tmp_sig = callsig;
        D.24287 = target_klass->image;
        callsig = mono_metadata_signature_dup_full (D.24287, callsig);
        monoeg_g_free (tmp_sig);
      }
      <D.24277>:
      sig = mono_method_signature (method);
      D.24287 = target_klass->image;
      csig = mono_metadata_signature_alloc (D.24287, 4);
      D.24306 = mono_defaults.object_class;
      D.24307 = &D.24306->byval_arg;
      csig->ret = D.24307;
      D.24238 = method->klass;
      D.24280 = BIT_FIELD_REF <*D.24238, 8, 256>;
      D.24281 = D.24280 & 8;
      if (D.24281 != 0) goto <D.24310>; else goto <D.24308>;
      <D.24310>:
      D.24311 = mono_method_signature (method);
      D.24312 = BIT_FIELD_REF <*D.24311, 8, 112>;
      D.24313 = D.24312 & 64;
      if (D.24313 != 0) goto <D.24314>; else goto <D.24308>;
      <D.24314>:
      D.24238 = method->klass;
      D.24315 = &D.24238->this_arg;
      D.24316 = get_runtime_invoke_type (D.24315, 0);
      csig->params[0] = D.24316;
      goto <D.24309>;
      <D.24308>:
      D.24306 = mono_defaults.object_class;
      D.24307 = &D.24306->byval_arg;
      csig->params[0] = D.24307;
      <D.24309>:
      D.24317 = mono_defaults.int_class;
      D.24318 = &D.24317->byval_arg;
      csig->params[1] = D.24318;
      D.24317 = mono_defaults.int_class;
      D.24318 = &D.24317->byval_arg;
      csig->params[2] = D.24318;
      D.24317 = mono_defaults.int_class;
      D.24318 = &D.24317->byval_arg;
      csig->params[3] = D.24318;
      csig->pinvoke = 1;
      if (virtual != 0) goto <D.24320>; else goto <D.24321>;
      <D.24320>:
      iftmp.137 = "runtime_invoke_virtual";
      goto <D.24322>;
      <D.24321>:
      iftmp.137 = "runtime_invoke";
      <D.24322>:
      name = mono_signature_to_name (callsig, iftmp.137);
      mb = mono_mb_new (target_klass, name, 4);
      monoeg_g_free (name);
      param_names[0] = "this";
      param_names[1] = "params";
      param_names[2] = "exc";
      param_names[3] = "method";
      mono_mb_set_param_names (mb, &param_names);
      emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper);
      if (need_direct_wrapper != 0) goto <D.24323>; else goto <D.24324>;
      <D.24323>:
      mb->skip_visibility = 1;
      D.24325 = sig->param_count;
      D.24326 = (int) D.24325;
      D.24327 = D.24326 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.24327);
      if (virtual != 0) goto <D.24329>; else goto <D.24330>;
      <D.24329>:
      iftmp.138 = 14;
      goto <D.24331>;
      <D.24330>:
      iftmp.138 = 13;
      <D.24331>:
      info = mono_wrapper_info_create (res, iftmp.138);
      info->d.runtime_invoke.method = method;
      mono_marshal_set_wrapper_info (res, info);
      goto <D.24332>;
      <D.24324>:
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24333>; else goto <D.24334>;
        <D.24333>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.24334>:
        D.24335 = ret != 0;
        D.24336 = (long int) D.24335;
        D.24337 = __builtin_expect (D.24336, 0);
        if (D.24337 != 0) goto <D.24338>; else goto <D.24339>;
        <D.24338>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5067, "ret == 0");
        <D.24339>:
      }
      res = monoeg_g_hash_table_lookup (cache, callsig);
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24340>; else goto <D.24341>;
        <D.24340>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24341>:
        D.24342 = ret != 0;
        D.24343 = (long int) D.24342;
        D.24344 = __builtin_expect (D.24343, 0);
        if (D.24344 != 0) goto <D.24345>; else goto <D.24346>;
        <D.24345>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5069, "ret == 0");
        <D.24346>:
      }
      if (res == 0B) goto <D.24347>; else goto <D.24348>;
      <D.24347>:
      {
        struct MonoMethod * newm;

        D.24325 = sig->param_count;
        D.24326 = (int) D.24325;
        D.24327 = D.24326 + 16;
        newm = mono_mb_create_method (mb, csig, D.24327);
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24349>; else goto <D.24350>;
          <D.24349>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24350>:
          D.24351 = ret != 0;
          D.24352 = (long int) D.24351;
          D.24353 = __builtin_expect (D.24352, 0);
          if (D.24353 != 0) goto <D.24354>; else goto <D.24355>;
          <D.24354>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5076, "ret == 0");
          <D.24355>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        if (res == 0B) goto <D.24356>; else goto <D.24357>;
        <D.24356>:
        res = newm;
        monoeg_g_hash_table_insert_replace (cache, callsig, res, 0);
        D.24238 = method->klass;
        D.24239 = D.24238->image;
        D.24358 = D.24239->runtime_invoke_direct_cache;
        monoeg_g_hash_table_insert_replace (D.24358, method, res, 0);
        info = mono_wrapper_info_create (res, 11);
        info->d.runtime_invoke.sig = callsig;
        mono_marshal_set_wrapper_info (res, info);
        goto <D.24359>;
        <D.24357>:
        mono_free_method (newm);
        <D.24359>:
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24360>; else goto <D.24361>;
          <D.24360>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24361>:
          D.24362 = ret != 0;
          D.24363 = (long int) D.24362;
          D.24364 = __builtin_expect (D.24363, 0);
          if (D.24364 != 0) goto <D.24365>; else goto <D.24366>;
          <D.24365>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5089, "ret == 0");
          <D.24366>:
        }
      }
      <D.24348>:
      <D.24332>:
      mono_mb_free (mb);
      D.24245 = res;
      return D.24245;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


runtime_invoke_signature_equal (struct MonoMethodSignature * sig1, struct MonoMethodSignature * sig2)
{
  struct MonoType * D.24371;
  struct MonoType * D.24372;
  int D.24374;
  int D.24376;
  int D.24377;
  gboolean D.24379;

  D.24371 = sig1->ret;
  D.24372 = sig2->ret;
  if (D.24371 != D.24372) goto <D.24373>; else goto <D.24369>;
  <D.24373>:
  D.24371 = sig1->ret;
  D.24374 = mono_type_is_reference (D.24371);
  if (D.24374 == 0) goto <D.24370>; else goto <D.24375>;
  <D.24375>:
  D.24372 = sig2->ret;
  D.24376 = mono_type_is_reference (D.24372);
  if (D.24376 == 0) goto <D.24370>; else goto <D.24369>;
  <D.24370>:
  D.24372 = sig2->ret;
  D.24371 = sig1->ret;
  D.24377 = mono_metadata_type_equal (D.24371, D.24372);
  if (D.24377 == 0) goto <D.24378>; else goto <D.24369>;
  <D.24378>:
  D.24379 = 0;
  return D.24379;
  <D.24369>:
  D.24379 = mono_metadata_signature_equal (sig1, sig2);
  return D.24379;
}


mono_marshal_get_runtime_invoke_sig (struct MonoMethodSignature * sig)
{
  struct MonoType * D.24381;
  struct MonoType * D.24382;
  struct MonoType * D.24383;
  struct MonoType * D.24384;
  short unsigned int D.24385;
  int D.24386;
  struct MonoMethodSignature * D.24387;
  struct MonoMethodSignature * res;
  int i;

  res = mono_metadata_signature_dup (sig);
  D.24381 = sig->ret;
  D.24382 = get_runtime_invoke_type (D.24381, 1);
  res->ret = D.24382;
  i = 0;
  goto <D.20004>;
  <D.20003>:
  D.24383 = sig->params[i];
  D.24384 = get_runtime_invoke_type (D.24383, 0);
  res->params[i] = D.24384;
  i = i + 1;
  <D.20004>:
  D.24385 = res->param_count;
  D.24386 = (int) D.24385;
  if (D.24386 > i) goto <D.20003>; else goto <D.20005>;
  <D.20005>:
  D.24387 = res;
  return D.24387;
}


get_runtime_invoke_type (struct MonoType * t, gboolean ret)
{
  unsigned char D.24389;
  unsigned char D.24390;
  unsigned char D.24393;
  struct MonoClass * D.24396;
  int D.24397;
  struct MonoType * D.24400;
  struct MonoClass * D.24401;
  int D.24402;
  struct MonoClass * D.24405;
  int D.24408;
  struct MonoClass * D.24409;
  struct MonoClass * D.24410;
  struct MonoClass * D.24411;
  struct MonoClass * D.24412;
  unsigned char D.24413;
  unsigned char D.24414;
  void handle_enum = <<< error >>>;

  D.24389 = BIT_FIELD_REF <*t, 8, 88>;
  D.24390 = D.24389 & 64;
  if (D.24390 != 0) goto <D.24391>; else goto <D.24392>;
  <D.24391>:
  D.24393 = t->type;
  if (D.24393 == 21) goto <D.24394>; else goto <D.24395>;
  <D.24394>:
  D.24396 = mono_class_from_mono_type (t);
  D.24397 = mono_class_is_nullable (D.24396);
  if (D.24397 != 0) goto <D.24398>; else goto <D.24399>;
  <D.24398>:
  D.24400 = t;
  return D.24400;
  <D.24399>:
  <D.24395>:
  D.24401 = mono_defaults.int_class;
  D.24400 = &D.24401->this_arg;
  return D.24400;
  <D.24392>:
  D.24402 = mono_type_is_reference (t);
  if (D.24402 != 0) goto <D.24403>; else goto <D.24404>;
  <D.24403>:
  D.24405 = mono_defaults.object_class;
  D.24400 = &D.24405->byval_arg;
  return D.24400;
  <D.24404>:
  if (ret != 0) goto <D.24406>; else goto <D.24407>;
  <D.24406>:
  D.24400 = t;
  return D.24400;
  <D.24407>:
  handle_enum:
  D.24393 = t->type;
  D.24408 = (int) D.24393;
  switch (D.24408) <default: <D.19997>, case 2: <D.19992>, case 3: <D.19993>, case 11: <D.19991>, case 15: <D.19995>, case 17: <D.19996>, case 25: <D.19994>>
  <D.19991>:
  D.24409 = mono_defaults.int64_class;
  D.24400 = &D.24409->byval_arg;
  return D.24400;
  <D.19992>:
  D.24410 = mono_defaults.byte_class;
  D.24400 = &D.24410->byval_arg;
  return D.24400;
  <D.19993>:
  D.24411 = mono_defaults.uint16_class;
  D.24400 = &D.24411->byval_arg;
  return D.24400;
  <D.19994>:
  <D.19995>:
  D.24401 = mono_defaults.int_class;
  D.24400 = &D.24401->byval_arg;
  return D.24400;
  <D.19996>:
  D.24412 = t->data.klass;
  D.24413 = BIT_FIELD_REF <*D.24412, 8, 256>;
  D.24414 = D.24413 & 16;
  if (D.24414 != 0) goto <D.24415>; else goto <D.24416>;
  <D.24415>:
  D.24412 = t->data.klass;
  t = mono_class_enum_basetype (D.24412);
  goto handle_enum;
  <D.24416>:
  D.24400 = t;
  return D.24400;
  <D.19997>:
  D.24400 = t;
  return D.24400;
}


emit_runtime_invoke_body (struct MonoMethodBuilder * mb, struct MonoClass * target_klass, struct MonoMethod * method, struct MonoMethodSignature * sig, struct MonoMethodSignature * callsig, gboolean virtual, gboolean need_direct_wrapper)
{
  struct MonoClass * D.24418;
  struct MonoType * D.24419;
  unsigned int D.24420;
  int D.24421;
  int D.24422;
  unsigned int D.24423;
  int D.24424;
  struct MonoImage * D.24425;
  struct MonoClass * D.24426;
  int D.24427;
  unsigned int D.24428;
  int D.24429;
  int D.24430;
  unsigned int D.24431;
  int D.24432;
  unsigned int D.24433;
  unsigned int loc_exc.139;
  int D.24435;
  unsigned int D.24436;
  unsigned int D.24437;
  unsigned int D.24438;
  int D.24439;
  unsigned int D.24440;
  unsigned int loc_res.140;
  int D.24442;
  unsigned int D.24443;
  gint32 labels[16];
  struct MonoExceptionClause * clause;
  int loc_res;
  int loc_exc;

  try
    {
      D.24418 = mono_defaults.object_class;
      D.24419 = &D.24418->byval_arg;
      loc_res = mono_mb_add_local (mb, D.24419);
      D.24418 = mono_defaults.object_class;
      D.24419 = &D.24418->byval_arg;
      loc_exc = mono_mb_add_local (mb, D.24419);
      mono_mb_emit_byte (mb, 4);
      D.24420 = mono_mb_emit_branch (mb, 57);
      D.24421 = (int) D.24420;
      labels[0] = D.24421;
      D.24422 = mono_mb_get_label (mb);
      labels[1] = D.24422;
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      D.24423 = mono_mb_emit_branch (mb, 221);
      D.24424 = (int) D.24423;
      labels[2] = D.24424;
      D.24425 = target_klass->image;
      clause = mono_image_alloc0 (D.24425, 32);
      clause->flags = 0;
      D.24426 = mono_defaults.exception_class;
      clause->data.catch_class = D.24426;
      D.24427 = labels[1];
      D.24428 = (unsigned int) D.24427;
      clause->try_offset = D.24428;
      D.24429 = mono_mb_get_label (mb);
      D.24427 = labels[1];
      D.24430 = D.24429 - D.24427;
      D.24431 = (unsigned int) D.24430;
      clause->try_len = D.24431;
      D.24432 = mono_mb_get_label (mb);
      D.24433 = (unsigned int) D.24432;
      clause->handler_offset = D.24433;
      loc_exc.139 = (unsigned int) loc_exc;
      mono_mb_emit_stloc (mb, loc_exc.139);
      mono_mb_emit_byte (mb, 4);
      loc_exc.139 = (unsigned int) loc_exc;
      mono_mb_emit_ldloc (mb, loc_exc.139);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_branch (mb, 221);
      D.24435 = mono_mb_get_pos (mb);
      D.24436 = (unsigned int) D.24435;
      D.24437 = clause->handler_offset;
      D.24438 = D.24436 - D.24437;
      clause->handler_len = D.24438;
      mono_mb_set_clauses (mb, 1, clause);
      D.24439 = labels[2];
      D.24440 = (unsigned int) D.24439;
      mono_mb_patch_branch (mb, D.24440);
      loc_res.140 = (unsigned int) loc_res;
      mono_mb_emit_ldloc (mb, loc_res.140);
      mono_mb_emit_byte (mb, 42);
      D.24442 = labels[0];
      D.24443 = (unsigned int) D.24442;
      mono_mb_patch_branch (mb, D.24443);
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 42);
    }
  finally
    {
      labels = {CLOBBER};
    }
}


emit_invoke_call (struct MonoMethodBuilder * mb, struct MonoMethod * method, struct MonoMethodSignature * sig, struct MonoMethodSignature * callsig, int loc_res, gboolean virtual, gboolean need_direct_wrapper)
{
  struct MonoString * string_dummy.141;
  void * D.24449;
  struct MonoString * string_dummy.142;
  unsigned char D.24453;
  unsigned char D.24454;
  _Bool D.24455;
  long int D.24456;
  long int D.24457;
  short unsigned int D.24460;
  int D.24461;
  int D.24462;
  _Bool D.24463;
  long int D.24464;
  long int D.24465;
  unsigned char D.24470;
  unsigned char D.24471;
  int D.24474;
  short unsigned int D.24479;
  long unsigned int D.24480;
  long unsigned int D.24481;
  unsigned int i.143;
  unsigned int D.24485;
  int D.24486;
  unsigned char D.24487;
  unsigned char D.24488;
  unsigned char D.24491;
  struct MonoClass * D.24494;
  int D.24495;
  long unsigned int D.24498;
  long unsigned int D.24499;
  int * D.24500;
  struct MonoClass * D.24501;
  struct MonoType * D.24502;
  int D.24503;
  struct MonoClass * D.24504;
  int D.24505;
  unsigned int D.24506;
  struct MonoType * D.24507;
  unsigned char D.24508;
  unsigned int D.24509;
  unsigned char D.24510;
  int D.24511;
  unsigned int D.24512;
  unsigned char D.24513;
  int D.24514;
  int D.24515;
  unsigned int D.24518;
  unsigned char D.24519;
  int D.24520;
  struct MonoClass * D.24523;
  unsigned char D.24524;
  unsigned char D.24525;
  struct MonoType * D.24528;
  unsigned char D.24529;
  struct MonoClass * D.24530;
  int D.24531;
  struct MonoClass * D.24534;
  struct MonoClass * D.24535;
  struct MonoClass * D.24537;
  int D.24538;
  struct MonoType * D.24545;
  unsigned char D.24546;
  unsigned char D.24547;
  unsigned char D.24550;
  int D.24551;
  struct MonoClass * D.24554;
  struct MonoClass * D.24555;
  unsigned int loc_res.144;
  short unsigned int D.24559;
  short unsigned int D.24560;
  struct MonoClass * D.24563;
  int D.24564;
  struct MonoClass * D.24567;
  static struct MonoString * string_dummy = 0B;
  int i;
  int * tmp_nullable_locals;
  gboolean void_ret;
  void handle_enum = <<< error >>>;

  void_ret = 0;
  string_dummy.141 = string_dummy;
  if (string_dummy.141 == 0B) goto <D.24445>; else goto <D.24446>;
  <D.24445>:
  if (0 != 0) goto <D.24447>; else goto <D.24448>;
  <D.24447>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4644, "sizeof (string_dummy) == sizeof (MonoObject*)");
  <D.24448>:
  D.24449 = mono_gc_make_root_descr_all_refs (1);
  mono_gc_register_root (&string_dummy, 8, D.24449);
  string_dummy.142 = mono_string_new_wrapper ("dummy");
  string_dummy = string_dummy.142;
  <D.24446>:
  if (virtual != 0) goto <D.24451>; else goto <D.24452>;
  <D.24451>:
  D.24453 = BIT_FIELD_REF <*sig, 8, 112>;
  D.24454 = D.24453 & 64;
  D.24455 = D.24454 == 0;
  D.24456 = (long int) D.24455;
  D.24457 = __builtin_expect (D.24456, 0);
  if (D.24457 != 0) goto <D.24458>; else goto <D.24459>;
  <D.24458>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4649, "sig->hasthis");
  <D.24459>:
  D.24460 = method->flags;
  D.24461 = (int) D.24460;
  D.24462 = D.24461 & 64;
  D.24463 = D.24462 == 0;
  D.24464 = (long int) D.24463;
  D.24465 = __builtin_expect (D.24464, 0);
  if (D.24465 != 0) goto <D.24466>; else goto <D.24467>;
  <D.24466>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4650, "method->flags & METHOD_ATTRIBUTE_VIRTUAL");
  <D.24467>:
  <D.24452>:
  D.24453 = BIT_FIELD_REF <*sig, 8, 112>;
  D.24454 = D.24453 & 64;
  if (D.24454 != 0) goto <D.24468>; else goto <D.24469>;
  <D.24468>:
  D.24470 = BIT_FIELD_REF <*method, 8, 256>;
  D.24471 = D.24470 & 128;
  if (D.24471 != 0) goto <D.24472>; else goto <D.24473>;
  <D.24472>:
  D.24474 = mono_gc_is_moving ();
  if (D.24474 != 0) goto <D.24475>; else goto <D.24476>;
  <D.24475>:
  mono_mb_emit_ptr (mb, &string_dummy);
  mono_mb_emit_byte (mb, 80);
  goto <D.24477>;
  <D.24476>:
  string_dummy.141 = string_dummy;
  mono_mb_emit_ptr (mb, string_dummy.141);
  <D.24477>:
  goto <D.24478>;
  <D.24473>:
  mono_mb_emit_ldarg (mb, 0);
  <D.24478>:
  <D.24469>:
  D.24479 = sig->param_count;
  D.24480 = (long unsigned int) D.24479;
  D.24481 = D.24480 * 4;
  tmp_nullable_locals = monoeg_malloc0 (D.24481);
  i = 0;
  goto <D.20052>;
  <D.20051>:
  {
    struct MonoType * t;
    int type;

    t = sig->params[i];
    mono_mb_emit_ldarg (mb, 1);
    if (i != 0) goto <D.24482>; else goto <D.24483>;
    <D.24482>:
    i.143 = (unsigned int) i;
    D.24485 = i.143 * 8;
    D.24486 = (int) D.24485;
    mono_mb_emit_icon (mb, D.24486);
    mono_mb_emit_byte (mb, 88);
    <D.24483>:
    D.24487 = BIT_FIELD_REF <*t, 8, 88>;
    D.24488 = D.24487 & 64;
    if (D.24488 != 0) goto <D.24489>; else goto <D.24490>;
    <D.24489>:
    mono_mb_emit_byte (mb, 77);
    D.24491 = t->type;
    if (D.24491 == 21) goto <D.24492>; else goto <D.24493>;
    <D.24492>:
    D.24494 = mono_class_from_mono_type (t);
    D.24495 = mono_class_is_nullable (D.24494);
    if (D.24495 != 0) goto <D.24496>; else goto <D.24497>;
    <D.24496>:
    D.24498 = (long unsigned int) i;
    D.24499 = D.24498 * 4;
    D.24500 = tmp_nullable_locals + D.24499;
    D.24501 = mono_class_from_mono_type (t);
    D.24502 = &D.24501->byval_arg;
    D.24503 = mono_mb_add_local (mb, D.24502);
    *D.24500 = D.24503;
    D.24504 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 165, D.24504);
    D.24498 = (long unsigned int) i;
    D.24499 = D.24498 * 4;
    D.24500 = tmp_nullable_locals + D.24499;
    D.24505 = *D.24500;
    D.24506 = (unsigned int) D.24505;
    mono_mb_emit_stloc (mb, D.24506);
    D.24498 = (long unsigned int) i;
    D.24499 = D.24498 * 4;
    D.24500 = tmp_nullable_locals + D.24499;
    D.24505 = *D.24500;
    D.24506 = (unsigned int) D.24505;
    mono_mb_emit_ldloc_addr (mb, D.24506);
    <D.24497>:
    <D.24493>:
    // predicted unlikely by continue predictor.
    goto <D.20025>;
    <D.24490>:
    D.24507 = sig->params[i];
    D.24508 = D.24507->type;
    type = (int) D.24508;
    handle_enum:
    switch (type) <default: <D.20050>, case 2: <D.20028>, case 3: <D.20032>, case 4: <D.20027>, case 5: <D.20029>, case 6: <D.20030>, case 7: <D.20031>, case 8: <D.20035>, case 9: <D.20036>, case 10: <D.20039>, case 11: <D.20040>, case 12: <D.20037>, case 13: <D.20038>, case 14: <D.20042>, case 15: <D.20045>, case 17: <D.20049>, case 18: <D.20043>, case 20: <D.20044>, case 21: <D.20048>, case 24: <D.20033>, case 25: <D.20034>, case 28: <D.20047>, case 29: <D.20046>>
    <D.20027>:
    <D.20028>:
    <D.20029>:
    <D.20030>:
    <D.20031>:
    <D.20032>:
    <D.20033>:
    <D.20034>:
    <D.20035>:
    <D.20036>:
    <D.20037>:
    <D.20038>:
    <D.20039>:
    <D.20040>:
    mono_mb_emit_byte (mb, 77);
    D.24507 = sig->params[i];
    D.24509 = mono_type_to_ldind (D.24507);
    D.24510 = (unsigned char) D.24509;
    D.24511 = (int) D.24510;
    mono_mb_emit_byte (mb, D.24511);
    goto <D.20041>;
    <D.20042>:
    <D.20043>:
    <D.20044>:
    <D.20045>:
    <D.20046>:
    <D.20047>:
    D.24507 = sig->params[i];
    D.24512 = mono_type_to_ldind (D.24507);
    D.24513 = (unsigned char) D.24512;
    D.24514 = (int) D.24513;
    mono_mb_emit_byte (mb, D.24514);
    goto <D.20041>;
    <D.20048>:
    D.24507 = sig->params[i];
    D.24515 = mono_type_generic_inst_is_valuetype (D.24507);
    if (D.24515 == 0) goto <D.24516>; else goto <D.24517>;
    <D.24516>:
    D.24507 = sig->params[i];
    D.24518 = mono_type_to_ldind (D.24507);
    D.24519 = (unsigned char) D.24518;
    D.24520 = (int) D.24519;
    mono_mb_emit_byte (mb, D.24520);
    goto <D.20041>;
    <D.24517>:
    <D.20049>:
    if (type == 17) goto <D.24521>; else goto <D.24522>;
    <D.24521>:
    D.24523 = t->data.klass;
    D.24524 = BIT_FIELD_REF <*D.24523, 8, 256>;
    D.24525 = D.24524 & 16;
    if (D.24525 != 0) goto <D.24526>; else goto <D.24527>;
    <D.24526>:
    D.24523 = t->data.klass;
    D.24528 = mono_class_enum_basetype (D.24523);
    D.24529 = D.24528->type;
    type = (int) D.24529;
    goto handle_enum;
    <D.24527>:
    <D.24522>:
    mono_mb_emit_byte (mb, 77);
    D.24507 = sig->params[i];
    D.24530 = mono_class_from_mono_type (D.24507);
    D.24531 = mono_class_is_nullable (D.24530);
    if (D.24531 != 0) goto <D.24532>; else goto <D.24533>;
    <D.24532>:
    D.24507 = sig->params[i];
    D.24534 = mono_class_from_mono_type (D.24507);
    mono_mb_emit_op (mb, 121, D.24534);
    D.24507 = sig->params[i];
    D.24535 = mono_class_from_mono_type (D.24507);
    mono_mb_emit_op (mb, 113, D.24535);
    goto <D.24536>;
    <D.24533>:
    D.24507 = sig->params[i];
    D.24537 = mono_class_from_mono_type (D.24507);
    mono_mb_emit_op (mb, 113, D.24537);
    <D.24536>:
    goto <D.20041>;
    <D.20050>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4744);
    <D.20041>:
  }
  <D.20025>:
  i = i + 1;
  <D.20052>:
  D.24479 = sig->param_count;
  D.24538 = (int) D.24479;
  if (D.24538 > i) goto <D.20051>; else goto <D.20053>;
  <D.20053>:
  if (virtual != 0) goto <D.24539>; else goto <D.24540>;
  <D.24539>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.24541>;
  <D.24540>:
  if (need_direct_wrapper != 0) goto <D.24542>; else goto <D.24543>;
  <D.24542>:
  mono_mb_emit_op (mb, 40, method);
  goto <D.24544>;
  <D.24543>:
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_calli (mb, callsig);
  <D.24544>:
  <D.24541>:
  D.24545 = sig->ret;
  D.24546 = BIT_FIELD_REF <*D.24545, 8, 88>;
  D.24547 = D.24546 & 64;
  if (D.24547 != 0) goto <D.24548>; else goto <D.24549>;
  <D.24548>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4759);
  <D.24549>:
  D.24545 = sig->ret;
  D.24550 = D.24545->type;
  D.24551 = (int) D.24550;
  switch (D.24551) <default: <D.20079>, case 1: <D.20054>, case 2: <D.20056>, case 3: <D.20057>, case 4: <D.20058>, case 5: <D.20059>, case 6: <D.20060>, case 7: <D.20061>, case 8: <D.20062>, case 9: <D.20063>, case 10: <D.20068>, case 11: <D.20069>, case 12: <D.20066>, case 13: <D.20067>, case 14: <D.20073>, case 15: <D.20078>, case 17: <D.20070>, case 18: <D.20074>, case 20: <D.20075>, case 21: <D.20072>, case 22: <D.20071>, case 24: <D.20064>, case 25: <D.20065>, case 28: <D.20077>, case 29: <D.20076>>
  <D.20054>:
  D.24470 = BIT_FIELD_REF <*method, 8, 256>;
  D.24471 = D.24470 & 128;
  if (D.24471 == 0) goto <D.24552>; else goto <D.24553>;
  <D.24552>:
  void_ret = 1;
  <D.24553>:
  goto <D.20055>;
  <D.20056>:
  <D.20057>:
  <D.20058>:
  <D.20059>:
  <D.20060>:
  <D.20061>:
  <D.20062>:
  <D.20063>:
  <D.20064>:
  <D.20065>:
  <D.20066>:
  <D.20067>:
  <D.20068>:
  <D.20069>:
  <D.20070>:
  <D.20071>:
  <D.20072>:
  D.24545 = sig->ret;
  D.24554 = mono_class_from_mono_type (D.24545);
  mono_mb_emit_op (mb, 140, D.24554);
  goto <D.20055>;
  <D.20073>:
  <D.20074>:
  <D.20075>:
  <D.20076>:
  <D.20077>:
  goto <D.20055>;
  <D.20078>:
  D.24555 = mono_defaults.int_class;
  mono_mb_emit_op (mb, 140, D.24555);
  goto <D.20055>;
  <D.20079>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4799);
  <D.20055>:
  if (void_ret == 0) goto <D.24556>; else goto <D.24557>;
  <D.24556>:
  loc_res.144 = (unsigned int) loc_res;
  mono_mb_emit_stloc (mb, loc_res.144);
  <D.24557>:
  i = 0;
  goto <D.20082>;
  <D.20081>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.24559 = BIT_FIELD_REF <*t, 16, 80>;
    D.24560 = D.24559 & 16639;
    if (D.24560 == 16405) goto <D.24561>; else goto <D.24562>;
    <D.24561>:
    D.24563 = mono_class_from_mono_type (t);
    D.24564 = mono_class_is_nullable (D.24563);
    if (D.24564 != 0) goto <D.24565>; else goto <D.24566>;
    <D.24565>:
    mono_mb_emit_ldarg (mb, 1);
    i.143 = (unsigned int) i;
    D.24485 = i.143 * 8;
    D.24486 = (int) D.24485;
    mono_mb_emit_icon (mb, D.24486);
    mono_mb_emit_byte (mb, 88);
    D.24498 = (long unsigned int) i;
    D.24499 = D.24498 * 4;
    D.24500 = tmp_nullable_locals + D.24499;
    D.24505 = *D.24500;
    D.24506 = (unsigned int) D.24505;
    mono_mb_emit_ldloc (mb, D.24506);
    D.24567 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 140, D.24567);
    mono_mb_emit_byte (mb, 81);
    <D.24566>:
    <D.24562>:
  }
  i = i + 1;
  <D.20082>:
  D.24479 = sig->param_count;
  D.24538 = (int) D.24479;
  if (D.24538 > i) goto <D.20081>; else goto <D.20083>;
  <D.20083>:
  monoeg_g_free (tmp_nullable_locals);
}


mono_marshal_get_runtime_invoke_dynamic ()
{
  struct MonoMethod * method.145;
  struct MonoMethod * D.24572;
  struct MonoImage * D.24573;
  struct MonoClass * D.24574;
  struct MonoType * D.24575;
  struct MonoClass * D.24576;
  struct MonoType * D.24577;
  struct MonoClass * D.24578;
  struct MonoType * D.24579;
  unsigned int D.24580;
  int D.24581;
  unsigned int D.24582;
  int D.24583;
  unsigned int D.24584;
  int D.24585;
  unsigned int D.24586;
  struct MonoClass * D.24587;
  unsigned int D.24588;
  unsigned int posna.146;
  int D.24590;
  unsigned int D.24591;
  unsigned int D.24592;
  unsigned int D.24593;
  unsigned int pos.147;
  _Bool D.24597;
  long int D.24598;
  long int D.24599;
  struct MonoMethod * method.148;
  _Bool D.24607;
  long int D.24608;
  long int D.24609;
  static struct MonoMethod * method;
  struct MonoMethodSignature * csig;
  struct MonoExceptionClause * clause;
  struct MonoMethodBuilder * mb;
  int pos;
  int posna;
  char * name;
  struct WrapperInfo * info;

  method.145 = method;
  if (method.145 != 0B) goto <D.24570>; else goto <D.24571>;
  <D.24570>:
  D.24572 = method;
  return D.24572;
  <D.24571>:
  D.24573 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24573, 4);
  D.24574 = mono_defaults.void_class;
  D.24575 = &D.24574->byval_arg;
  csig->ret = D.24575;
  D.24576 = mono_defaults.int_class;
  D.24577 = &D.24576->byval_arg;
  csig->params[0] = D.24577;
  D.24576 = mono_defaults.int_class;
  D.24577 = &D.24576->byval_arg;
  csig->params[1] = D.24577;
  D.24576 = mono_defaults.int_class;
  D.24577 = &D.24576->byval_arg;
  csig->params[2] = D.24577;
  D.24576 = mono_defaults.int_class;
  D.24577 = &D.24576->byval_arg;
  csig->params[3] = D.24577;
  name = monoeg_strdup ("runtime_invoke_dynamic");
  D.24578 = mono_defaults.object_class;
  mb = mono_mb_new (D.24578, name, 4);
  monoeg_g_free (name);
  D.24578 = mono_defaults.object_class;
  D.24579 = &D.24578->byval_arg;
  mono_mb_add_local (mb, D.24579);
  D.24578 = mono_defaults.object_class;
  D.24579 = &D.24578->byval_arg;
  mono_mb_add_local (mb, D.24579);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 44);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_byte (mb, 4);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 15);
  D.24580 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.24580;
  D.24573 = mono_defaults.corlib;
  clause = mono_image_alloc0 (D.24573, 32);
  clause->flags = 1;
  D.24581 = mono_mb_get_label (mb);
  D.24582 = (unsigned int) D.24581;
  clause->try_len = D.24582;
  D.24583 = mono_mb_get_label (mb);
  D.24584 = (unsigned int) D.24583;
  clause->data.filter_offset = D.24584;
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 17);
  D.24585 = mono_mb_get_label (mb);
  D.24586 = (unsigned int) D.24585;
  clause->handler_offset = D.24586;
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 1);
  D.24587 = mono_defaults.threadabortexception_class;
  mono_mb_emit_op (mb, 117, D.24587);
  D.24588 = mono_mb_emit_short_branch (mb, 44);
  posna = (int) D.24588;
  mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort);
  posna.146 = (unsigned int) posna;
  mono_mb_patch_short_branch (mb, posna.146);
  mono_mb_emit_branch (mb, 221);
  D.24590 = mono_mb_get_pos (mb);
  D.24591 = (unsigned int) D.24590;
  D.24592 = clause->handler_offset;
  D.24593 = D.24591 - D.24592;
  clause->handler_len = D.24593;
  mono_mb_set_clauses (mb, 1, clause);
  pos.147 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.147);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24595>; else goto <D.24596>;
    <D.24595>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24596>:
    D.24597 = ret != 0;
    D.24598 = (long int) D.24597;
    D.24599 = __builtin_expect (D.24598, 0);
    if (D.24599 != 0) goto <D.24600>; else goto <D.24601>;
    <D.24600>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5213, "ret == 0");
    <D.24601>:
  }
  method.145 = method;
  if (method.145 == 0B) goto <D.24602>; else goto <D.24603>;
  <D.24602>:
  method.148 = mono_mb_create_method (mb, csig, 16);
  method = method.148;
  method.145 = method;
  info = mono_wrapper_info_create (method.145, 12);
  method.145 = method;
  mono_marshal_set_wrapper_info (method.145, info);
  <D.24603>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24605>; else goto <D.24606>;
    <D.24605>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24606>:
    D.24607 = ret != 0;
    D.24608 = (long int) D.24607;
    D.24609 = __builtin_expect (D.24608, 0);
    if (D.24609 != 0) goto <D.24610>; else goto <D.24611>;
    <D.24610>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5220, "ret == 0");
    <D.24611>:
  }
  mono_mb_free (mb);
  D.24572 = method;
  return D.24572;
}


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

  if (str != 0B) goto <D.24613>; else goto <D.24614>;
  <D.24613>:
  D.24615 = __strdup (str);
  return D.24615;
  <D.24614>:
  D.24615 = 0B;
  return D.24615;
}


mono_marshal_get_ldfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24619;
  long int D.24620;
  long int D.24621;
  struct MonoMethod * cached.149;
  _Bool D.24629;
  long int D.24630;
  long int D.24631;
  struct MonoMethod * D.24634;
  _Bool D.24637;
  long int D.24638;
  long int D.24639;
  struct MonoClass * D.24642;
  struct MonoMethod * D.24643;
  struct MonoImage * D.24644;
  struct MonoType * D.24645;
  struct MonoClass * D.24646;
  struct MonoType * D.24647;
  _Bool D.24650;
  long int D.24651;
  long int D.24652;
  _Bool D.24657;
  long int D.24658;
  long int D.24659;
  _Bool D.24666;
  long int D.24667;
  long int D.24668;
  _Bool D.24675;
  long int D.24676;
  long int D.24677;
  _Bool D.24683;
  long int D.24684;
  long int D.24685;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  static struct MonoMethod * cached = 0B;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24617>; else goto <D.24618>;
    <D.24617>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24618>:
    D.24619 = ret != 0;
    D.24620 = (long int) D.24619;
    D.24621 = __builtin_expect (D.24620, 0);
    if (D.24621 != 0) goto <D.24622>; else goto <D.24623>;
    <D.24622>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5256, "ret == 0");
    <D.24623>:
  }
  cached.149 = cached;
  if (cached.149 != 0B) goto <D.24625>; else goto <D.24626>;
  <D.24625>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24627>; else goto <D.24628>;
    <D.24627>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24628>:
    D.24629 = ret != 0;
    D.24630 = (long int) D.24629;
    D.24631 = __builtin_expect (D.24630, 0);
    if (D.24631 != 0) goto <D.24632>; else goto <D.24633>;
    <D.24632>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5258, "ret == 0");
    <D.24633>:
  }
  D.24634 = cached;
  return D.24634;
  <D.24626>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24635>; else goto <D.24636>;
    <D.24635>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24636>:
    D.24637 = ret != 0;
    D.24638 = (long int) D.24637;
    D.24639 = __builtin_expect (D.24638, 0);
    if (D.24639 != 0) goto <D.24640>; else goto <D.24641>;
    <D.24640>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5261, "ret == 0");
    <D.24641>:
  }
  D.24642 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24642, "__mono_load_remote_field_new_wrapper", 14);
  D.24643 = mb->method;
  D.24643->save_lmf = 1;
  D.24644 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24644, 3);
  D.24642 = mono_defaults.object_class;
  D.24645 = &D.24642->byval_arg;
  sig->params[0] = D.24645;
  D.24646 = mono_defaults.int_class;
  D.24647 = &D.24646->byval_arg;
  sig->params[1] = D.24647;
  D.24646 = mono_defaults.int_class;
  D.24647 = &D.24646->byval_arg;
  sig->params[2] = D.24647;
  D.24642 = mono_defaults.object_class;
  D.24645 = &D.24642->byval_arg;
  sig->ret = D.24645;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.24644 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24644, 3);
  D.24642 = mono_defaults.object_class;
  D.24645 = &D.24642->byval_arg;
  csig->params[0] = D.24645;
  D.24646 = mono_defaults.int_class;
  D.24647 = &D.24646->byval_arg;
  csig->params[1] = D.24647;
  D.24646 = mono_defaults.int_class;
  D.24647 = &D.24646->byval_arg;
  csig->params[2] = D.24647;
  D.24642 = mono_defaults.object_class;
  D.24645 = &D.24642->byval_arg;
  csig->ret = D.24645;
  csig->pinvoke = 1;
  mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new);
  emit_thread_interrupt_checkpoint (mb);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24648>; else goto <D.24649>;
    <D.24648>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24649>:
    D.24650 = ret != 0;
    D.24651 = (long int) D.24650;
    D.24652 = __builtin_expect (D.24651, 0);
    if (D.24652 != 0) goto <D.24653>; else goto <D.24654>;
    <D.24653>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5291, "ret == 0");
    <D.24654>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24655>; else goto <D.24656>;
    <D.24655>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24656>:
    D.24657 = ret != 0;
    D.24658 = (long int) D.24657;
    D.24659 = __builtin_expect (D.24658, 0);
    if (D.24659 != 0) goto <D.24660>; else goto <D.24661>;
    <D.24660>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5293, "ret == 0");
    <D.24661>:
  }
  if (res == 0B) goto <D.24662>; else goto <D.24663>;
  <D.24662>:
  {
    struct MonoMethod * newm;

    newm = mono_mb_create_method (mb, sig, 4);
    {
      int ret;

      ret = pthread_mutex_lock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24664>; else goto <D.24665>;
      <D.24664>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24665>:
      D.24666 = ret != 0;
      D.24667 = (long int) D.24666;
      D.24668 = __builtin_expect (D.24667, 0);
      if (D.24668 != 0) goto <D.24669>; else goto <D.24670>;
      <D.24669>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5297, "ret == 0");
      <D.24670>:
    }
    res = cached;
    if (res == 0B) goto <D.24671>; else goto <D.24672>;
    <D.24671>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24673>; else goto <D.24674>;
      <D.24673>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24674>:
      D.24675 = ret != 0;
      D.24676 = (long int) D.24675;
      D.24677 = __builtin_expect (D.24676, 0);
      if (D.24677 != 0) goto <D.24678>; else goto <D.24679>;
      <D.24678>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5302, "ret == 0");
      <D.24679>:
    }
    goto <D.24680>;
    <D.24672>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24681>; else goto <D.24682>;
      <D.24681>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24682>:
      D.24683 = ret != 0;
      D.24684 = (long int) D.24683;
      D.24685 = __builtin_expect (D.24684, 0);
      if (D.24685 != 0) goto <D.24686>; else goto <D.24687>;
      <D.24686>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5304, "ret == 0");
      <D.24687>:
    }
    mono_free_method (newm);
    <D.24680>:
  }
  <D.24663>:
  mono_mb_free (mb);
  D.24634 = res;
  return D.24634;
}


mono_marshal_get_ldfld_wrapper (struct MonoType * type)
{
  unsigned char D.24689;
  unsigned char D.24690;
  unsigned char D.24691;
  _Bool D.24703;
  _Bool D.24704;
  _Bool D.24705;
  _Bool D.24707;
  _Bool D.24708;
  _Bool D.24709;
  int D.24715;
  struct MonoImage * D.24721;
  struct GHashTable * * D.24722;
  struct MonoMethod * D.24725;
  const char * D.24726;
  const char * D.24727;
  struct MonoClass * D.24728;
  struct MonoImage * D.24729;
  struct MonoType * D.24730;
  struct MonoClass * D.24731;
  struct MonoType * D.24732;
  struct MonoType * D.24733;
  struct MonoMethod * D.24734;
  unsigned char D.24735;
  unsigned char D.24736;
  unsigned int D.24739;
  unsigned int pos0.150;
  unsigned int pos1.151;
  unsigned int D.24745;
  unsigned char D.24746;
  int D.24747;
  unsigned char D.24748;
  _Bool D.24749;
  long int D.24750;
  long int D.24751;
  int D.24754;
  int D.24758;
  short unsigned int D.24759;
  int D.24760;
  int D.24761;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoClass * klass;
  struct GHashTable * cache;
  char * name;
  int t;
  int pos0;
  int pos1;

  pos1 = 0;
  type = mono_type_get_underlying_type (type);
  D.24689 = type->type;
  t = (int) D.24689;
  D.24690 = BIT_FIELD_REF <*type, 8, 88>;
  D.24691 = D.24690 & 64;
  if (D.24691 == 0) goto <D.24692>; else goto <D.24693>;
  <D.24692>:
  D.24689 = type->type;
  if (D.24689 == 29) goto <D.24694>; else goto <D.24695>;
  <D.24694>:
  klass = mono_defaults.array_class;
  goto <D.24696>;
  <D.24695>:
  D.24689 = type->type;
  if (D.24689 == 17) goto <D.24697>; else goto <D.24698>;
  <D.24697>:
  klass = type->data.klass;
  goto <D.24699>;
  <D.24698>:
  D.24703 = t == 28;
  D.24704 = t == 18;
  D.24705 = D.24703 | D.24704;
  if (D.24705 != 0) goto <D.24700>; else goto <D.24706>;
  <D.24706>:
  if (t == 14) goto <D.24700>; else goto <D.24701>;
  <D.24700>:
  klass = mono_defaults.object_class;
  goto <D.24702>;
  <D.24701>:
  D.24707 = t == 15;
  D.24708 = t == 27;
  D.24709 = D.24707 | D.24708;
  if (D.24709 != 0) goto <D.24710>; else goto <D.24711>;
  <D.24710>:
  klass = mono_defaults.int_class;
  goto <D.24712>;
  <D.24711>:
  if (t == 21) goto <D.24713>; else goto <D.24714>;
  <D.24713>:
  D.24715 = mono_type_generic_inst_is_valuetype (type);
  if (D.24715 != 0) goto <D.24716>; else goto <D.24717>;
  <D.24716>:
  klass = mono_class_from_mono_type (type);
  goto <D.24718>;
  <D.24717>:
  klass = mono_defaults.object_class;
  <D.24718>:
  goto <D.24719>;
  <D.24714>:
  klass = mono_class_from_mono_type (type);
  <D.24719>:
  <D.24712>:
  <D.24702>:
  <D.24699>:
  <D.24696>:
  goto <D.24720>;
  <D.24693>:
  klass = mono_defaults.int_class;
  <D.24720>:
  D.24721 = klass->image;
  D.24722 = &D.24721->ldfld_wrapper_cache;
  cache = get_cache (D.24722, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24723>; else goto <D.24724>;
  <D.24723>:
  D.24725 = res;
  return D.24725;
  <D.24724>:
  D.24726 = klass->name;
  D.24727 = klass->name_space;
  name = monoeg_g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, D.24727, D.24726);
  D.24728 = mono_defaults.object_class;
  mb = mono_mb_new (D.24728, name, 12);
  monoeg_g_free (name);
  D.24729 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24729, 4);
  D.24728 = mono_defaults.object_class;
  D.24730 = &D.24728->byval_arg;
  sig->params[0] = D.24730;
  D.24731 = mono_defaults.int_class;
  D.24732 = &D.24731->byval_arg;
  sig->params[1] = D.24732;
  D.24731 = mono_defaults.int_class;
  D.24732 = &D.24731->byval_arg;
  sig->params[2] = D.24732;
  D.24731 = mono_defaults.int_class;
  D.24732 = &D.24731->byval_arg;
  sig->params[3] = D.24732;
  D.24733 = &klass->byval_arg;
  sig->ret = D.24733;
  mono_mb_emit_ldarg (mb, 0);
  pos0 = mono_mb_emit_proxy_check (mb, 64);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.24734 = mono_marshal_get_ldfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24734, 0B);
  D.24735 = BIT_FIELD_REF <*klass, 8, 256>;
  D.24736 = D.24735 & 8;
  if (D.24736 != 0) goto <D.24737>; else goto <D.24738>;
  <D.24737>:
  mono_mb_emit_op (mb, 121, klass);
  D.24739 = mono_mb_emit_branch (mb, 56);
  pos1 = (int) D.24739;
  goto <D.24740>;
  <D.24738>:
  mono_mb_emit_byte (mb, 42);
  <D.24740>:
  pos0.150 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.150);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  D.24735 = BIT_FIELD_REF <*klass, 8, 256>;
  D.24736 = D.24735 & 8;
  if (D.24736 != 0) goto <D.24742>; else goto <D.24743>;
  <D.24742>:
  pos1.151 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.151);
  <D.24743>:
  switch (t) <default: <D.20195>, case 2: <D.20171>, case 3: <D.20172>, case 4: <D.20169>, case 5: <D.20170>, case 6: <D.20173>, case 7: <D.20174>, case 8: <D.20175>, case 9: <D.20176>, case 10: <D.20177>, case 11: <D.20178>, case 12: <D.20179>, case 13: <D.20180>, case 14: <D.20185>, case 15: <D.20188>, case 17: <D.20191>, case 18: <D.20184>, case 19: <D.20193>, case 20: <D.20181>, case 21: <D.20192>, case 24: <D.20186>, case 25: <D.20187>, case 27: <D.20189>, case 28: <D.20183>, case 29: <D.20182>, case 30: <D.20194>>
  <D.20169>:
  <D.20170>:
  <D.20171>:
  <D.20172>:
  <D.20173>:
  <D.20174>:
  <D.20175>:
  <D.20176>:
  <D.20177>:
  <D.20178>:
  <D.20179>:
  <D.20180>:
  <D.20181>:
  <D.20182>:
  <D.20183>:
  <D.20184>:
  <D.20185>:
  <D.20186>:
  <D.20187>:
  <D.20188>:
  <D.20189>:
  D.24745 = mono_type_to_ldind (type);
  D.24746 = (unsigned char) D.24745;
  D.24747 = (int) D.24746;
  mono_mb_emit_byte (mb, D.24747);
  goto <D.20190>;
  <D.20191>:
  D.24735 = BIT_FIELD_REF <*klass, 8, 256>;
  D.24748 = D.24735 & 16;
  D.24749 = D.24748 != 0;
  D.24750 = (long int) D.24749;
  D.24751 = __builtin_expect (D.24750, 0);
  if (D.24751 != 0) goto <D.24752>; else goto <D.24753>;
  <D.24752>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5439, "!klass->enumtype");
  <D.24753>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.20190>;
  <D.20192>:
  D.24754 = mono_type_generic_inst_is_valuetype (type);
  if (D.24754 != 0) goto <D.24755>; else goto <D.24756>;
  <D.24755>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.24757>;
  <D.24756>:
  mono_mb_emit_byte (mb, 80);
  <D.24757>:
  goto <D.20190>;
  <D.20193>:
  <D.20194>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.20190>;
  <D.20195>:
  D.24689 = type->type;
  D.24758 = (int) D.24689;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24758);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5455);
  <D.20190>:
  mono_mb_emit_byte (mb, 42);
  D.24759 = sig->param_count;
  D.24760 = (int) D.24759;
  D.24761 = D.24760 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24761);
  mono_mb_free (mb);
  D.24725 = res;
  return D.24725;
}


mono_marshal_get_ldflda_wrapper (struct MonoType * type)
{
  unsigned char D.24763;
  unsigned char D.24764;
  unsigned char D.24765;
  _Bool D.24774;
  _Bool D.24775;
  _Bool D.24776;
  _Bool D.24777;
  _Bool D.24778;
  _Bool D.24782;
  _Bool D.24783;
  _Bool D.24784;
  int D.24790;
  struct MonoImage * D.24796;
  struct GHashTable * * D.24797;
  struct MonoMethod * D.24800;
  const char * D.24801;
  const char * D.24802;
  struct MonoClass * D.24803;
  struct MonoImage * D.24804;
  struct MonoType * D.24805;
  struct MonoClass * D.24806;
  struct MonoType * D.24807;
  unsigned int pos1.152;
  unsigned int D.24809;
  unsigned int pos2.153;
  unsigned int pos3.154;
  unsigned int pos0.155;
  short unsigned int D.24813;
  int D.24814;
  int D.24815;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoClass * klass;
  struct GHashTable * cache;
  char * name;
  int t;
  int pos0;
  int pos1;
  int pos2;
  int pos3;

  type = mono_type_get_underlying_type (type);
  D.24763 = type->type;
  t = (int) D.24763;
  D.24764 = BIT_FIELD_REF <*type, 8, 88>;
  D.24765 = D.24764 & 64;
  if (D.24765 == 0) goto <D.24766>; else goto <D.24767>;
  <D.24766>:
  D.24763 = type->type;
  if (D.24763 == 29) goto <D.24768>; else goto <D.24769>;
  <D.24768>:
  klass = mono_defaults.array_class;
  goto <D.24770>;
  <D.24769>:
  D.24763 = type->type;
  if (D.24763 == 17) goto <D.24771>; else goto <D.24772>;
  <D.24771>:
  klass = type->data.klass;
  goto <D.24773>;
  <D.24772>:
  D.24774 = t == 28;
  D.24775 = t == 14;
  D.24776 = D.24774 | D.24775;
  D.24777 = t == 18;
  D.24778 = D.24776 | D.24777;
  if (D.24778 != 0) goto <D.24779>; else goto <D.24780>;
  <D.24779>:
  klass = mono_defaults.object_class;
  goto <D.24781>;
  <D.24780>:
  D.24782 = t == 15;
  D.24783 = t == 27;
  D.24784 = D.24782 | D.24783;
  if (D.24784 != 0) goto <D.24785>; else goto <D.24786>;
  <D.24785>:
  klass = mono_defaults.int_class;
  goto <D.24787>;
  <D.24786>:
  if (t == 21) goto <D.24788>; else goto <D.24789>;
  <D.24788>:
  D.24790 = mono_type_generic_inst_is_valuetype (type);
  if (D.24790 != 0) goto <D.24791>; else goto <D.24792>;
  <D.24791>:
  klass = mono_class_from_mono_type (type);
  goto <D.24793>;
  <D.24792>:
  klass = mono_defaults.object_class;
  <D.24793>:
  goto <D.24794>;
  <D.24789>:
  klass = mono_class_from_mono_type (type);
  <D.24794>:
  <D.24787>:
  <D.24781>:
  <D.24773>:
  <D.24770>:
  goto <D.24795>;
  <D.24767>:
  klass = mono_defaults.int_class;
  <D.24795>:
  D.24796 = klass->image;
  D.24797 = &D.24796->ldflda_wrapper_cache;
  cache = get_cache (D.24797, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24798>; else goto <D.24799>;
  <D.24798>:
  D.24800 = res;
  return D.24800;
  <D.24799>:
  D.24801 = klass->name;
  D.24802 = klass->name_space;
  name = monoeg_g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, D.24802, D.24801);
  D.24803 = mono_defaults.object_class;
  mb = mono_mb_new (D.24803, name, 23);
  monoeg_g_free (name);
  D.24804 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24804, 4);
  D.24803 = mono_defaults.object_class;
  D.24805 = &D.24803->byval_arg;
  sig->params[0] = D.24805;
  D.24806 = mono_defaults.int_class;
  D.24807 = &D.24806->byval_arg;
  sig->params[1] = D.24807;
  D.24806 = mono_defaults.int_class;
  D.24807 = &D.24806->byval_arg;
  sig->params[2] = D.24807;
  D.24806 = mono_defaults.int_class;
  D.24807 = &D.24806->byval_arg;
  sig->params[3] = D.24807;
  D.24806 = mono_defaults.int_class;
  D.24807 = &D.24806->byval_arg;
  sig->ret = D.24807;
  mono_mb_emit_ldarg (mb, 0);
  pos0 = mono_mb_emit_proxy_check (mb, 64);
  mono_mb_emit_ldarg (mb, 0);
  pos1 = mono_mb_emit_xdomain_check (mb, 59);
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another appdomain.");
  pos1.152 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.152);
  mono_mb_emit_ldarg (mb, 0);
  pos2 = mono_mb_emit_contextbound_check (mb, 59);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_icall (mb, mono_context_get);
  D.24809 = mono_mb_emit_branch (mb, 59);
  pos3 = (int) D.24809;
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context.");
  pos2.153 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.153);
  pos3.154 = (unsigned int) pos3;
  mono_mb_patch_branch (mb, pos3.154);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 32);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  pos0.155 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.155);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  D.24813 = sig->param_count;
  D.24814 = (int) D.24813;
  D.24815 = D.24814 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24815);
  mono_mb_free (mb);
  D.24800 = res;
  return D.24800;
}


mono_mb_emit_contextbound_check (struct MonoMethodBuilder * mb, int branch_code)
{
  int offset.156;
  unsigned char mask.157;
  int D.24821;
  int D.24822;
  unsigned char D.24823;
  int D.24824;
  unsigned int D.24825;
  static int offset = -1;
  static guint8 mask;

  offset.156 = offset;
  if (offset.156 < 0) goto <D.24818>; else goto <D.24819>;
  <D.24818>:
  {
    struct MonoClass tmp;

    try
      {
        memset (&tmp, 0, 272);
        tmp.contextbound = 1;
        mono_marshal_find_nonzero_bit_offset (&tmp, 272, &offset, &mask);
      }
    finally
      {
        tmp = {CLOBBER};
      }
  }
  <D.24819>:
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  offset.156 = offset;
  mono_mb_emit_ldflda (mb, offset.156);
  mono_mb_emit_byte (mb, 71);
  mask.157 = mask;
  D.24821 = (int) mask.157;
  mono_mb_emit_icon (mb, D.24821);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_icon (mb, 0);
  D.24823 = (unsigned char) branch_code;
  D.24824 = (int) D.24823;
  D.24825 = mono_mb_emit_branch (mb, D.24824);
  D.24822 = (int) D.24825;
  return D.24822;
}


mono_marshal_get_stfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24829;
  long int D.24830;
  long int D.24831;
  struct MonoMethod * cached.158;
  _Bool D.24839;
  long int D.24840;
  long int D.24841;
  struct MonoMethod * D.24844;
  _Bool D.24847;
  long int D.24848;
  long int D.24849;
  struct MonoClass * D.24852;
  struct MonoMethod * D.24853;
  struct MonoImage * D.24854;
  struct MonoType * D.24855;
  struct MonoClass * D.24856;
  struct MonoType * D.24857;
  struct MonoClass * D.24858;
  struct MonoType * D.24859;
  _Bool D.24862;
  long int D.24863;
  long int D.24864;
  _Bool D.24869;
  long int D.24870;
  long int D.24871;
  _Bool D.24878;
  long int D.24879;
  long int D.24880;
  _Bool D.24887;
  long int D.24888;
  long int D.24889;
  _Bool D.24895;
  long int D.24896;
  long int D.24897;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  static struct MonoMethod * cached = 0B;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24827>; else goto <D.24828>;
    <D.24827>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24828>:
    D.24829 = ret != 0;
    D.24830 = (long int) D.24829;
    D.24831 = __builtin_expect (D.24830, 0);
    if (D.24831 != 0) goto <D.24832>; else goto <D.24833>;
    <D.24832>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5608, "ret == 0");
    <D.24833>:
  }
  cached.158 = cached;
  if (cached.158 != 0B) goto <D.24835>; else goto <D.24836>;
  <D.24835>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24837>; else goto <D.24838>;
    <D.24837>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24838>:
    D.24839 = ret != 0;
    D.24840 = (long int) D.24839;
    D.24841 = __builtin_expect (D.24840, 0);
    if (D.24841 != 0) goto <D.24842>; else goto <D.24843>;
    <D.24842>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5610, "ret == 0");
    <D.24843>:
  }
  D.24844 = cached;
  return D.24844;
  <D.24836>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24845>; else goto <D.24846>;
    <D.24845>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24846>:
    D.24847 = ret != 0;
    D.24848 = (long int) D.24847;
    D.24849 = __builtin_expect (D.24848, 0);
    if (D.24849 != 0) goto <D.24850>; else goto <D.24851>;
    <D.24850>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5613, "ret == 0");
    <D.24851>:
  }
  D.24852 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24852, "__mono_store_remote_field_new_wrapper", 15);
  D.24853 = mb->method;
  D.24853->save_lmf = 1;
  D.24854 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24854, 4);
  D.24852 = mono_defaults.object_class;
  D.24855 = &D.24852->byval_arg;
  sig->params[0] = D.24855;
  D.24856 = mono_defaults.int_class;
  D.24857 = &D.24856->byval_arg;
  sig->params[1] = D.24857;
  D.24856 = mono_defaults.int_class;
  D.24857 = &D.24856->byval_arg;
  sig->params[2] = D.24857;
  D.24852 = mono_defaults.object_class;
  D.24855 = &D.24852->byval_arg;
  sig->params[3] = D.24855;
  D.24858 = mono_defaults.void_class;
  D.24859 = &D.24858->byval_arg;
  sig->ret = D.24859;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldarg (mb, 3);
  D.24854 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24854, 4);
  D.24852 = mono_defaults.object_class;
  D.24855 = &D.24852->byval_arg;
  csig->params[0] = D.24855;
  D.24856 = mono_defaults.int_class;
  D.24857 = &D.24856->byval_arg;
  csig->params[1] = D.24857;
  D.24856 = mono_defaults.int_class;
  D.24857 = &D.24856->byval_arg;
  csig->params[2] = D.24857;
  D.24852 = mono_defaults.object_class;
  D.24855 = &D.24852->byval_arg;
  csig->params[3] = D.24855;
  D.24858 = mono_defaults.void_class;
  D.24859 = &D.24858->byval_arg;
  csig->ret = D.24859;
  csig->pinvoke = 1;
  mono_mb_emit_native_call (mb, csig, mono_store_remote_field_new);
  emit_thread_interrupt_checkpoint (mb);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24860>; else goto <D.24861>;
    <D.24860>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24861>:
    D.24862 = ret != 0;
    D.24863 = (long int) D.24862;
    D.24864 = __builtin_expect (D.24863, 0);
    if (D.24864 != 0) goto <D.24865>; else goto <D.24866>;
    <D.24865>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5646, "ret == 0");
    <D.24866>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24867>; else goto <D.24868>;
    <D.24867>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24868>:
    D.24869 = ret != 0;
    D.24870 = (long int) D.24869;
    D.24871 = __builtin_expect (D.24870, 0);
    if (D.24871 != 0) goto <D.24872>; else goto <D.24873>;
    <D.24872>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5648, "ret == 0");
    <D.24873>:
  }
  if (res == 0B) goto <D.24874>; else goto <D.24875>;
  <D.24874>:
  {
    struct MonoMethod * newm;

    newm = mono_mb_create_method (mb, sig, 6);
    {
      int ret;

      ret = pthread_mutex_lock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24876>; else goto <D.24877>;
      <D.24876>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24877>:
      D.24878 = ret != 0;
      D.24879 = (long int) D.24878;
      D.24880 = __builtin_expect (D.24879, 0);
      if (D.24880 != 0) goto <D.24881>; else goto <D.24882>;
      <D.24881>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5652, "ret == 0");
      <D.24882>:
    }
    res = cached;
    if (res == 0B) goto <D.24883>; else goto <D.24884>;
    <D.24883>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24885>; else goto <D.24886>;
      <D.24885>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24886>:
      D.24887 = ret != 0;
      D.24888 = (long int) D.24887;
      D.24889 = __builtin_expect (D.24888, 0);
      if (D.24889 != 0) goto <D.24890>; else goto <D.24891>;
      <D.24890>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5657, "ret == 0");
      <D.24891>:
    }
    goto <D.24892>;
    <D.24884>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24893>; else goto <D.24894>;
      <D.24893>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24894>:
      D.24895 = ret != 0;
      D.24896 = (long int) D.24895;
      D.24897 = __builtin_expect (D.24896, 0);
      if (D.24897 != 0) goto <D.24898>; else goto <D.24899>;
      <D.24898>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5659, "ret == 0");
      <D.24899>:
    }
    mono_free_method (newm);
    <D.24892>:
  }
  <D.24875>:
  mono_mb_free (mb);
  D.24844 = res;
  return D.24844;
}


mono_marshal_get_stfld_wrapper (struct MonoType * type)
{
  unsigned char D.24901;
  unsigned char D.24902;
  unsigned char D.24903;
  _Bool D.24915;
  _Bool D.24916;
  _Bool D.24917;
  _Bool D.24919;
  _Bool D.24920;
  _Bool D.24921;
  int D.24927;
  struct MonoImage * D.24933;
  struct GHashTable * * D.24934;
  struct MonoMethod * D.24937;
  const char * D.24938;
  const char * D.24939;
  struct MonoClass * D.24940;
  struct MonoImage * D.24941;
  struct MonoType * D.24942;
  struct MonoClass * D.24943;
  struct MonoType * D.24944;
  struct MonoType * D.24945;
  struct MonoClass * D.24946;
  struct MonoType * D.24947;
  unsigned char D.24948;
  unsigned char D.24949;
  struct MonoMethod * D.24952;
  unsigned int pos.159;
  unsigned int D.24954;
  unsigned char D.24955;
  int D.24956;
  unsigned char D.24957;
  _Bool D.24958;
  long int D.24959;
  long int D.24960;
  int D.24963;
  short unsigned int D.24964;
  int D.24965;
  int D.24966;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoClass * klass;
  struct GHashTable * cache;
  char * name;
  int t;
  int pos;

  type = mono_type_get_underlying_type (type);
  D.24901 = type->type;
  t = (int) D.24901;
  D.24902 = BIT_FIELD_REF <*type, 8, 88>;
  D.24903 = D.24902 & 64;
  if (D.24903 == 0) goto <D.24904>; else goto <D.24905>;
  <D.24904>:
  D.24901 = type->type;
  if (D.24901 == 29) goto <D.24906>; else goto <D.24907>;
  <D.24906>:
  klass = mono_defaults.array_class;
  goto <D.24908>;
  <D.24907>:
  D.24901 = type->type;
  if (D.24901 == 17) goto <D.24909>; else goto <D.24910>;
  <D.24909>:
  klass = type->data.klass;
  goto <D.24911>;
  <D.24910>:
  D.24915 = t == 28;
  D.24916 = t == 18;
  D.24917 = D.24915 | D.24916;
  if (D.24917 != 0) goto <D.24912>; else goto <D.24918>;
  <D.24918>:
  if (t == 14) goto <D.24912>; else goto <D.24913>;
  <D.24912>:
  klass = mono_defaults.object_class;
  goto <D.24914>;
  <D.24913>:
  D.24919 = t == 15;
  D.24920 = t == 27;
  D.24921 = D.24919 | D.24920;
  if (D.24921 != 0) goto <D.24922>; else goto <D.24923>;
  <D.24922>:
  klass = mono_defaults.int_class;
  goto <D.24924>;
  <D.24923>:
  if (t == 21) goto <D.24925>; else goto <D.24926>;
  <D.24925>:
  D.24927 = mono_type_generic_inst_is_valuetype (type);
  if (D.24927 != 0) goto <D.24928>; else goto <D.24929>;
  <D.24928>:
  klass = mono_class_from_mono_type (type);
  goto <D.24930>;
  <D.24929>:
  klass = mono_defaults.object_class;
  <D.24930>:
  goto <D.24931>;
  <D.24926>:
  klass = mono_class_from_mono_type (type);
  <D.24931>:
  <D.24924>:
  <D.24914>:
  <D.24911>:
  <D.24908>:
  goto <D.24932>;
  <D.24905>:
  klass = mono_defaults.int_class;
  <D.24932>:
  D.24933 = klass->image;
  D.24934 = &D.24933->stfld_wrapper_cache;
  cache = get_cache (D.24934, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24935>; else goto <D.24936>;
  <D.24935>:
  D.24937 = res;
  return D.24937;
  <D.24936>:
  D.24938 = klass->name;
  D.24939 = klass->name_space;
  name = monoeg_g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, D.24939, D.24938);
  D.24940 = mono_defaults.object_class;
  mb = mono_mb_new (D.24940, name, 13);
  monoeg_g_free (name);
  D.24941 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24941, 5);
  D.24940 = mono_defaults.object_class;
  D.24942 = &D.24940->byval_arg;
  sig->params[0] = D.24942;
  D.24943 = mono_defaults.int_class;
  D.24944 = &D.24943->byval_arg;
  sig->params[1] = D.24944;
  D.24943 = mono_defaults.int_class;
  D.24944 = &D.24943->byval_arg;
  sig->params[2] = D.24944;
  D.24943 = mono_defaults.int_class;
  D.24944 = &D.24943->byval_arg;
  sig->params[3] = D.24944;
  D.24945 = &klass->byval_arg;
  sig->params[4] = D.24945;
  D.24946 = mono_defaults.void_class;
  D.24947 = &D.24946->byval_arg;
  sig->ret = D.24947;
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldarg (mb, 4);
  D.24948 = BIT_FIELD_REF <*klass, 8, 256>;
  D.24949 = D.24948 & 8;
  if (D.24949 != 0) goto <D.24950>; else goto <D.24951>;
  <D.24950>:
  mono_mb_emit_op (mb, 140, klass);
  <D.24951>:
  D.24952 = mono_marshal_get_stfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24952, 0B);
  mono_mb_emit_byte (mb, 42);
  pos.159 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.159);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 4);
  switch (t) <default: <D.20264>, case 2: <D.20240>, case 3: <D.20241>, case 4: <D.20238>, case 5: <D.20239>, case 6: <D.20242>, case 7: <D.20243>, case 8: <D.20244>, case 9: <D.20245>, case 10: <D.20246>, case 11: <D.20247>, case 12: <D.20248>, case 13: <D.20249>, case 14: <D.20254>, case 15: <D.20257>, case 17: <D.20260>, case 18: <D.20253>, case 19: <D.20262>, case 20: <D.20250>, case 21: <D.20261>, case 24: <D.20255>, case 25: <D.20256>, case 27: <D.20258>, case 28: <D.20252>, case 29: <D.20251>, case 30: <D.20263>>
  <D.20238>:
  <D.20239>:
  <D.20240>:
  <D.20241>:
  <D.20242>:
  <D.20243>:
  <D.20244>:
  <D.20245>:
  <D.20246>:
  <D.20247>:
  <D.20248>:
  <D.20249>:
  <D.20250>:
  <D.20251>:
  <D.20252>:
  <D.20253>:
  <D.20254>:
  <D.20255>:
  <D.20256>:
  <D.20257>:
  <D.20258>:
  D.24954 = mono_type_to_stind (type);
  D.24955 = (unsigned char) D.24954;
  D.24956 = (int) D.24955;
  mono_mb_emit_byte (mb, D.24956);
  goto <D.20259>;
  <D.20260>:
  D.24948 = BIT_FIELD_REF <*klass, 8, 256>;
  D.24957 = D.24948 & 16;
  D.24958 = D.24957 != 0;
  D.24959 = (long int) D.24958;
  D.24960 = __builtin_expect (D.24959, 0);
  if (D.24960 != 0) goto <D.24961>; else goto <D.24962>;
  <D.24961>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5777, "!klass->enumtype");
  <D.24962>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.20259>;
  <D.20261>:
  <D.20262>:
  <D.20263>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.20259>;
  <D.20264>:
  D.24901 = type->type;
  D.24963 = (int) D.24901;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24963);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5787);
  <D.20259>:
  mono_mb_emit_byte (mb, 42);
  D.24964 = sig->param_count;
  D.24965 = (int) D.24964;
  D.24966 = D.24965 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24966);
  mono_mb_free (mb);
  D.24937 = res;
  return D.24937;
}


mono_marshal_get_icall_wrapper (struct MonoMethodSignature * sig, const char * name, const void * func, gboolean check_exceptions)
{
  unsigned char D.24968;
  unsigned char D.24969;
  _Bool D.24970;
  long int D.24971;
  long int D.24972;
  struct MonoClass * D.24975;
  struct MonoMethod * D.24976;
  unsigned char D.24977;
  unsigned char D.24978;
  struct MonoImage * D.24981;
  <unnamed-unsigned:1> D.24985;
  int D.24986;
  int D.24987;
  unsigned int D.24988;
  short unsigned int D.24989;
  int D.24990;
  unsigned char D.24993;
  unsigned char D.24994;
  short unsigned int D.24997;
  int D.24998;
  int D.24999;
  struct MonoMethod * D.25000;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * csig2;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  struct WrapperInfo * info;

  D.24968 = BIT_FIELD_REF <*sig, 8, 120>;
  D.24969 = D.24968 & 1;
  D.24970 = D.24969 == 0;
  D.24971 = (long int) D.24970;
  D.24972 = __builtin_expect (D.24971, 0);
  if (D.24972 != 0) goto <D.24973>; else goto <D.24974>;
  <D.24973>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5815, "sig->pinvoke");
  <D.24974>:
  D.24975 = mono_defaults.object_class;
  mb = mono_mb_new (D.24975, name, 6);
  D.24976 = mb->method;
  D.24976->save_lmf = 1;
  D.24977 = BIT_FIELD_REF <*sig, 8, 112>;
  D.24978 = D.24977 & 64;
  if (D.24978 != 0) goto <D.24979>; else goto <D.24980>;
  <D.24979>:
  D.24975 = mono_defaults.object_class;
  D.24981 = mono_defaults.corlib;
  csig2 = signature_dup_add_this (D.24981, sig, D.24975);
  goto <D.24982>;
  <D.24980>:
  D.24981 = mono_defaults.corlib;
  csig2 = signature_dup (D.24981, sig);
  <D.24982>:
  D.24977 = BIT_FIELD_REF <*sig, 8, 112>;
  D.24978 = D.24977 & 64;
  if (D.24978 != 0) goto <D.24983>; else goto <D.24984>;
  <D.24983>:
  mono_mb_emit_byte (mb, 2);
  <D.24984>:
  i = 0;
  goto <D.20278>;
  <D.20277>:
  D.24985 = sig->hasthis;
  D.24986 = (int) D.24985;
  D.24987 = D.24986 + i;
  D.24988 = (unsigned int) D.24987;
  mono_mb_emit_ldarg (mb, D.24988);
  i = i + 1;
  <D.20278>:
  D.24989 = sig->param_count;
  D.24990 = (int) D.24989;
  if (D.24990 > i) goto <D.20277>; else goto <D.20279>;
  <D.20279>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 19, func);
  mono_mb_emit_calli (mb, csig2);
  if (check_exceptions != 0) goto <D.24991>; else goto <D.24992>;
  <D.24991>:
  emit_thread_interrupt_checkpoint (mb);
  <D.24992>:
  mono_mb_emit_byte (mb, 42);
  D.24981 = mono_defaults.corlib;
  csig = signature_dup (D.24981, sig);
  csig->pinvoke = 0;
  D.24993 = BIT_FIELD_REF <*csig, 8, 112>;
  D.24994 = D.24993 & 63;
  if (D.24994 == 5) goto <D.24995>; else goto <D.24996>;
  <D.24995>:
  csig->call_convention = 0;
  <D.24996>:
  D.24997 = csig->param_count;
  D.24998 = (int) D.24997;
  D.24999 = D.24998 + 16;
  res = mono_mb_create_method (mb, csig, D.24999);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 15);
  info->d.icall.func = func;
  mono_marshal_set_wrapper_info (res, info);
  D.25000 = res;
  return D.25000;
}


signature_dup_add_this (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoClass * klass)
{
  short unsigned int D.25002;
  int D.25003;
  int D.25004;
  unsigned int D.25005;
  short unsigned int D.25006;
  int D.25007;
  struct MonoType * D.25008;
  struct MonoType * iftmp.160;
  unsigned char D.25010;
  unsigned char D.25011;
  struct MonoMethodSignature * D.25015;
  struct MonoMethodSignature * res;
  int i;

  D.25002 = sig->param_count;
  D.25003 = (int) D.25002;
  D.25004 = D.25003 + 1;
  D.25005 = (unsigned int) D.25004;
  res = mono_metadata_signature_alloc (image, D.25005);
  memcpy (res, sig, 16);
  D.25002 = sig->param_count;
  D.25006 = D.25002 + 1;
  res->param_count = D.25006;
  res->hasthis = 0;
  D.25002 = sig->param_count;
  D.25003 = (int) D.25002;
  i = D.25003 + -1;
  goto <D.19957>;
  <D.19956>:
  D.25007 = i + 1;
  D.25008 = sig->params[i];
  res->params[D.25007] = D.25008;
  i = i + -1;
  <D.19957>:
  if (i >= 0) goto <D.19956>; else goto <D.19958>;
  <D.19958>:
  D.25010 = BIT_FIELD_REF <*klass, 8, 256>;
  D.25011 = D.25010 & 8;
  if (D.25011 != 0) goto <D.25012>; else goto <D.25013>;
  <D.25012>:
  iftmp.160 = &klass->this_arg;
  goto <D.25014>;
  <D.25013>:
  iftmp.160 = &klass->byval_arg;
  <D.25014>:
  res->params[0] = iftmp.160;
  D.25015 = res;
  return D.25015;
}


mono_marshal_emit_native_wrapper (struct MonoImage * image, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * * mspecs, void * func, gboolean aot, gboolean check_exceptions, gboolean func_param)
{
  unsigned char D.25019;
  unsigned char D.25020;
  _Bool D.25021;
  long int D.25022;
  long int D.25023;
  struct MonoMethod * D.25026;
  struct MonoClass * D.25027;
  struct MonoImage * D.25028;
  struct MonoClass * D.25031;
  struct MonoType * D.25032;
  struct MonoClass * D.25033;
  struct MonoType * D.25034;
  struct MonoType * D.25035;
  int D.25036;
  struct MonoMarshalSpec * D.25039;
  <unnamed type> D.25042;
  short unsigned int D.25045;
  long unsigned int D.25046;
  long unsigned int D.25047;
  int D.25048;
  int D.25049;
  long unsigned int D.25050;
  long unsigned int D.25051;
  void * D.25052;
  long unsigned int D.25053;
  long unsigned int D.25054;
  int * D.25055;
  struct MonoType * * D.25056;
  sizetype D.25057;
  sizetype D.25058;
  sizetype D.25059;
  struct MonoMarshalSpec * * D.25060;
  struct MonoMarshalSpec * D.25061;
  struct MonoType * D.25062;
  int D.25063;
  int D.25064;
  int D.25067;
  unsigned int D.25071;
  unsigned int D.25072;
  struct MonoMethod * D.25075;
  short unsigned int D.25080;
  int D.25081;
  int D.25082;
  struct MonoMethodSignature * get_last_error_sig.161;
  struct MonoImage * D.25088;
  struct MonoMethodSignature * get_last_error_sig.162;
  unsigned char D.25090;
  unsigned char D.25091;
  unsigned char D.25094;
  <unnamed type> D.25097;
  unsigned char D.25099;
  unsigned char D.25100;
  struct MonoClass * D.25103;
  struct MonoType * D.25104;
  unsigned char D.25105;
  int D.25106;
  <unnamed type> D.25112;
  _Bool D.25113;
  _Bool D.25114;
  _Bool D.25115;
  unsigned char D.25118;
  int D.25119;
  int D.25121;
  struct EmitMarshalContext m;
  struct MonoMethodSignature * csig;
  struct MonoClass * klass;
  int i;
  int argnum;
  int * tmp_locals;
  int type;
  int param_shift;
  static struct MonoMethodSignature * get_last_error_sig = 0B;
  void handle_enum = <<< error >>>;

  try
    {
      param_shift = 0;
      m.mb = mb;
      m.piinfo = piinfo;
      if (func_param != 0) goto <D.25017>; else goto <D.25018>;
      <D.25017>:
      D.25019 = BIT_FIELD_REF <*sig, 8, 112>;
      D.25020 = D.25019 & 64;
      D.25021 = D.25020 != 0;
      D.25022 = (long int) D.25021;
      D.25023 = __builtin_expect (D.25022, 0);
      if (D.25023 != 0) goto <D.25024>; else goto <D.25025>;
      <D.25024>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8635, "!sig->hasthis");
      <D.25025>:
      param_shift = param_shift + 1;
      <D.25018>:
      D.25026 = mb->method;
      D.25027 = D.25026->klass;
      D.25028 = D.25027->image;
      csig = signature_dup (D.25028, sig);
      csig->pinvoke = 1;
      m.csig = csig;
      m.image = image;
      D.25019 = BIT_FIELD_REF <*sig, 8, 112>;
      D.25020 = D.25019 & 64;
      if (D.25020 != 0) goto <D.25029>; else goto <D.25030>;
      <D.25029>:
      param_shift = param_shift + 1;
      <D.25030>:
      D.25031 = mono_defaults.int_class;
      D.25032 = &D.25031->byval_arg;
      mono_mb_add_local (mb, D.25032);
      D.25031 = mono_defaults.int_class;
      D.25032 = &D.25031->byval_arg;
      mono_mb_add_local (mb, D.25032);
      D.25033 = mono_defaults.boolean_class;
      D.25034 = &D.25033->byval_arg;
      mono_mb_add_local (mb, D.25034);
      mono_mb_emit_icon (mb, 0);
      mono_mb_emit_stloc (mb, 2);
      D.25035 = sig->ret;
      D.25036 = mono_type_is_void (D.25035);
      if (D.25036 == 0) goto <D.25037>; else goto <D.25038>;
      <D.25037>:
      D.25035 = sig->ret;
      mono_mb_add_local (mb, D.25035);
      <D.25038>:
      D.25039 = *mspecs;
      if (D.25039 != 0B) goto <D.25040>; else goto <D.25041>;
      <D.25040>:
      D.25039 = *mspecs;
      D.25042 = D.25039->native;
      if (D.25042 == 44) goto <D.25043>; else goto <D.25044>;
      <D.25043>:
      D.25031 = mono_defaults.int_class;
      D.25032 = &D.25031->byval_arg;
      csig->ret = D.25032;
      <D.25044>:
      <D.25041>:
      D.25045 = sig->param_count;
      D.25046 = (long unsigned int) D.25045;
      D.25047 = D.25046 * 4;
      tmp_locals = __builtin_alloca (D.25047);
      D.25045 = sig->param_count;
      D.25048 = (int) D.25045;
      D.25049 = D.25048 + 1;
      D.25050 = (long unsigned int) D.25049;
      D.25051 = D.25050 * 4;
      D.25052 = __builtin_alloca (D.25051);
      m.orig_conv_args = D.25052;
      i = 0;
      goto <D.20767>;
      <D.20766>:
      D.25053 = (long unsigned int) i;
      D.25054 = D.25053 * 4;
      D.25055 = tmp_locals + D.25054;
      D.25056 = &csig->params[i];
      D.25057 = (sizetype) i;
      D.25058 = D.25057 + 1;
      D.25059 = D.25058 * 8;
      D.25060 = mspecs + D.25059;
      D.25061 = *D.25060;
      D.25062 = sig->params[i];
      D.25063 = i + param_shift;
      D.25064 = emit_marshal (&m, D.25063, D.25062, D.25061, 0, D.25056, 0);
      *D.25055 = D.25064;
      i = i + 1;
      <D.20767>:
      D.25045 = sig->param_count;
      D.25048 = (int) D.25045;
      if (D.25048 > i) goto <D.20766>; else goto <D.20768>;
      <D.20768>:
      D.25019 = BIT_FIELD_REF <*sig, 8, 112>;
      D.25020 = D.25019 & 64;
      if (D.25020 != 0) goto <D.25065>; else goto <D.25066>;
      <D.25065>:
      mono_mb_emit_byte (mb, 2);
      <D.25066>:
      i = 0;
      goto <D.20770>;
      <D.20769>:
      D.25053 = (long unsigned int) i;
      D.25054 = D.25053 * 4;
      D.25055 = tmp_locals + D.25054;
      D.25067 = *D.25055;
      D.25057 = (sizetype) i;
      D.25058 = D.25057 + 1;
      D.25059 = D.25058 * 8;
      D.25060 = mspecs + D.25059;
      D.25061 = *D.25060;
      D.25062 = sig->params[i];
      D.25063 = i + param_shift;
      emit_marshal (&m, D.25063, D.25062, D.25061, D.25067, 0B, 1);
      i = i + 1;
      <D.20770>:
      D.25045 = sig->param_count;
      D.25048 = (int) D.25045;
      if (D.25048 > i) goto <D.20769>; else goto <D.20771>;
      <D.20771>:
      if (func_param != 0) goto <D.25068>; else goto <D.25069>;
      <D.25068>:
      mono_mb_emit_byte (mb, 2);
      D.25031 = mono_defaults.int_class;
      mono_mb_emit_op (mb, 121, D.25031);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_calli (mb, csig);
      goto <D.25070>;
      <D.25069>:
      D.25026 = mb->method;
      D.25027 = D.25026->klass;
      D.25071 = D.25027->flags;
      D.25072 = D.25071 & 4096;
      if (D.25072 != 0) goto <D.25073>; else goto <D.25074>;
      <D.25073>:
      D.25075 = &piinfo->method;
      mono_mb_emit_cominterop_call (mb, csig, D.25075);
      goto <D.25076>;
      <D.25074>:
      if (aot != 0) goto <D.25077>; else goto <D.25078>;
      <D.25077>:
      mono_mb_emit_byte (mb, 240);
      D.25075 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.25075);
      mono_mb_emit_calli (mb, csig);
      goto <D.25079>;
      <D.25078>:
      mono_mb_emit_native_call (mb, csig, func);
      <D.25079>:
      <D.25076>:
      <D.25070>:
      D.25080 = piinfo->piflags;
      D.25081 = (int) D.25080;
      D.25082 = D.25081 & 64;
      if (D.25082 != 0) goto <D.25083>; else goto <D.25084>;
      <D.25083>:
      get_last_error_sig.161 = get_last_error_sig;
      if (get_last_error_sig.161 == 0B) goto <D.25086>; else goto <D.25087>;
      <D.25086>:
      D.25088 = mono_defaults.corlib;
      get_last_error_sig.162 = mono_metadata_signature_alloc (D.25088, 0);
      get_last_error_sig = get_last_error_sig.162;
      get_last_error_sig.161 = get_last_error_sig;
      D.25031 = mono_defaults.int_class;
      D.25032 = &D.25031->byval_arg;
      get_last_error_sig.161->ret = D.25032;
      get_last_error_sig.161 = get_last_error_sig;
      get_last_error_sig.161->pinvoke = 1;
      <D.25087>:
      mono_mb_emit_icall (mb, mono_marshal_set_last_error);
      <D.25084>:
      D.25035 = sig->ret;
      D.25090 = BIT_FIELD_REF <*D.25035, 8, 88>;
      D.25091 = D.25090 & 64;
      if (D.25091 == 0) goto <D.25092>; else goto <D.25093>;
      <D.25092>:
      {
        struct MonoMarshalSpec * spec;

        spec = *mspecs;
        D.25035 = sig->ret;
        D.25094 = D.25035->type;
        type = (int) D.25094;
        if (spec != 0B) goto <D.25096>; else goto <D.25095>;
        <D.25096>:
        D.25097 = spec->native;
        if (D.25097 == 44) goto <D.25098>; else goto <D.25095>;
        <D.25098>:
        D.25035 = sig->ret;
        emit_marshal (&m, 0, D.25035, spec, 0, 0B, 3);
        goto <D.20775>;
        <D.25095>:
        handle_enum:
        switch (type) <default: <D.20800>, case 1: <D.20774>, case 2: <D.20793>, case 3: <D.20796>, case 4: <D.20777>, case 5: <D.20778>, case 6: <D.20779>, case 7: <D.20780>, case 8: <D.20781>, case 9: <D.20782>, case 10: <D.20787>, case 11: <D.20788>, case 12: <D.20785>, case 13: <D.20786>, case 14: <D.20790>, case 15: <D.20797>, case 17: <D.20776>, case 18: <D.20791>, case 20: <D.20794>, case 21: <D.20798>, case 22: <D.20799>, case 24: <D.20783>, case 25: <D.20784>, case 27: <D.20789>, case 28: <D.20792>, case 29: <D.20795>>
        <D.20774>:
        goto <D.20775>;
        <D.20776>:
        D.25035 = sig->ret;
        klass = D.25035->data.klass;
        D.25099 = BIT_FIELD_REF <*klass, 8, 256>;
        D.25100 = D.25099 & 16;
        if (D.25100 != 0) goto <D.25101>; else goto <D.25102>;
        <D.25101>:
        D.25035 = sig->ret;
        D.25103 = D.25035->data.klass;
        D.25104 = mono_class_enum_basetype (D.25103);
        D.25105 = D.25104->type;
        type = (int) D.25105;
        goto handle_enum;
        <D.25102>:
        D.25035 = sig->ret;
        emit_marshal (&m, 0, D.25035, spec, 0, 0B, 3);
        goto <D.20775>;
        <D.20777>:
        <D.20778>:
        <D.20779>:
        <D.20780>:
        <D.20781>:
        <D.20782>:
        <D.20783>:
        <D.20784>:
        <D.20785>:
        <D.20786>:
        <D.20787>:
        <D.20788>:
        <D.20789>:
        <D.20790>:
        <D.20791>:
        <D.20792>:
        <D.20793>:
        <D.20794>:
        <D.20795>:
        <D.20796>:
        <D.20797>:
        <D.20798>:
        D.25035 = sig->ret;
        emit_marshal (&m, 0, D.25035, spec, 0, 0B, 3);
        goto <D.20775>;
        <D.20799>:
        <D.20800>:
        D.25035 = sig->ret;
        D.25094 = D.25035->type;
        D.25106 = (int) D.25094;
        monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.25106);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8782);
        <D.20775>:
      }
      goto <D.25107>;
      <D.25093>:
      mono_mb_emit_stloc (mb, 3);
      <D.25107>:
      if (check_exceptions != 0) goto <D.25108>; else goto <D.25109>;
      <D.25108>:
      emit_thread_interrupt_checkpoint (mb);
      <D.25109>:
      i = 0;
      goto <D.20812>;
      <D.20811>:
      {
        struct MonoType * t;
        struct MonoMarshalSpec * spec;

        t = sig->params[i];
        D.25057 = (sizetype) i;
        D.25058 = D.25057 + 1;
        D.25059 = D.25058 * 8;
        D.25060 = mspecs + D.25059;
        spec = *D.25060;
        argnum = i + param_shift;
        if (spec != 0B) goto <D.25110>; else goto <D.25111>;
        <D.25110>:
        D.25112 = spec->native;
        D.25113 = D.25112 == 44;
        D.25114 = D.25112 == 40;
        D.25115 = D.25113 | D.25114;
        if (D.25115 != 0) goto <D.25116>; else goto <D.25117>;
        <D.25116>:
        D.25053 = (long unsigned int) i;
        D.25054 = D.25053 * 4;
        D.25055 = tmp_locals + D.25054;
        D.25067 = *D.25055;
        emit_marshal (&m, argnum, t, spec, D.25067, 0B, 2);
        // predicted unlikely by continue predictor.
        goto <D.20803>;
        <D.25117>:
        <D.25111>:
        D.25118 = t->type;
        D.25119 = (int) D.25118;
        switch (D.25119) <default: <D.25120>, case 2: <D.20809>, case 14: <D.20804>, case 17: <D.20805>, case 18: <D.20806>, case 28: <D.20807>, case 29: <D.20808>>
        <D.20804>:
        <D.20805>:
        <D.20806>:
        <D.20807>:
        <D.20808>:
        <D.20809>:
        D.25053 = (long unsigned int) i;
        D.25054 = D.25053 * 4;
        D.25055 = tmp_locals + D.25054;
        D.25067 = *D.25055;
        emit_marshal (&m, argnum, t, spec, D.25067, 0B, 2);
        goto <D.20810>;
        <D.25120>:
        <D.20810>:
      }
      <D.20803>:
      i = i + 1;
      <D.20812>:
      D.25045 = sig->param_count;
      D.25048 = (int) D.25045;
      if (D.25048 > i) goto <D.20811>; else goto <D.20813>;
      <D.20813>:
      D.25035 = sig->ret;
      D.25121 = mono_type_is_void (D.25035);
      if (D.25121 == 0) goto <D.25122>; else goto <D.25123>;
      <D.25122>:
      mono_mb_emit_ldloc (mb, 3);
      <D.25123>:
      mono_mb_emit_byte (mb, 42);
    }
  finally
    {
      m = {CLOBBER};
    }
}


emit_marshal (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * D.25126;
  <unnamed type> D.25129;
  int D.25132;
  unsigned char D.25137;
  int D.25138;
  struct MonoClass * D.25139;
  struct MonoClass * D.25140;
  <unnamed type> D.25149;
  unsigned int D.25150;
  _Bool D.25151;
  _Bool D.25152;
  _Bool D.25153;
  <unnamed type> D.25162;
  _Bool D.25165;
  _Bool D.25166;
  _Bool D.25167;
  struct MonoClass * D.25169;
  int D.25174;
  int D.25177;

  D.25126 = mono_class_from_mono_type (t);
  mono_marshal_load_type_info (D.25126);
  if (spec != 0B) goto <D.25127>; else goto <D.25128>;
  <D.25127>:
  D.25129 = spec->native;
  if (D.25129 == 44) goto <D.25130>; else goto <D.25131>;
  <D.25130>:
  D.25132 = emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25131>:
  <D.25128>:
  if (spec != 0B) goto <D.25133>; else goto <D.25134>;
  <D.25133>:
  D.25129 = spec->native;
  if (D.25129 == 40) goto <D.25135>; else goto <D.25136>;
  <D.25135>:
  D.25132 = emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25136>:
  <D.25134>:
  D.25137 = t->type;
  D.25138 = (int) D.25137;
  switch (D.25138) <default: <D.25180>, case 2: <D.20729>, case 3: <D.20731>, case 4: <D.20732>, case 5: <D.20733>, case 6: <D.20734>, case 7: <D.20735>, case 8: <D.20736>, case 9: <D.20737>, case 10: <D.20742>, case 11: <D.20743>, case 12: <D.20740>, case 13: <D.20741>, case 14: <D.20724>, case 15: <D.20730>, case 17: <D.20723>, case 18: <D.20725>, case 20: <D.20727>, case 21: <D.20745>, case 24: <D.20738>, case 25: <D.20739>, case 27: <D.20744>, case 28: <D.20726>, case 29: <D.20728>>
  <D.20723>:
  D.25139 = t->data.klass;
  D.25140 = mono_defaults.handleref_class;
  if (D.25139 == D.25140) goto <D.25141>; else goto <D.25142>;
  <D.25141>:
  D.25132 = emit_marshal_handleref (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25142>:
  D.25132 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20724>:
  D.25132 = emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20725>:
  <D.20726>:
  if (spec != 0B) goto <D.25143>; else goto <D.25144>;
  <D.25143>:
  D.25129 = spec->native;
  if (D.25129 == 27) goto <D.25145>; else goto <D.25146>;
  <D.25145>:
  D.25132 = emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25146>:
  <D.25144>:
  if (spec != 0B) goto <D.25147>; else goto <D.25148>;
  <D.25147>:
  D.25149 = spec->native;
  D.25150 = D.25149 + 4294967271;
  D.25151 = D.25150 <= 1;
  D.25152 = D.25149 == 28;
  D.25153 = D.25151 | D.25152;
  if (D.25153 != 0) goto <D.25154>; else goto <D.25155>;
  <D.25154>:
  D.25132 = mono_cominterop_emit_marshal_com_interface (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25155>:
  <D.25148>:
  if (spec != 0B) goto <D.25158>; else goto <D.25159>;
  <D.25158>:
  D.25129 = spec->native;
  if (D.25129 == 29) goto <D.25160>; else goto <D.25161>;
  <D.25160>:
  D.25162 = spec->data.safearray_data.elem_type;
  if (D.25162 == 12) goto <D.25163>; else goto <D.25164>;
  <D.25163>:
  D.25165 = action == 2;
  D.25166 = action == 0;
  D.25167 = D.25165 | D.25166;
  if (D.25167 != 0) goto <D.25156>; else goto <D.25168>;
  <D.25168>:
  if (action == 1) goto <D.25156>; else goto <D.25157>;
  <D.25156>:
  D.25132 = mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25157>:
  <D.25164>:
  <D.25161>:
  <D.25159>:
  D.25169 = mono_defaults.safehandle_class;
  if (D.25169 != 0B) goto <D.25170>; else goto <D.25171>;
  <D.25170>:
  D.25139 = t->data.klass;
  if (D.25139 != 0B) goto <D.25172>; else goto <D.25173>;
  <D.25172>:
  D.25169 = mono_defaults.safehandle_class;
  D.25139 = t->data.klass;
  D.25174 = mono_class_is_subclass_of (D.25139, D.25169, 0);
  if (D.25174 != 0) goto <D.25175>; else goto <D.25176>;
  <D.25175>:
  D.25132 = emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25176>:
  <D.25173>:
  <D.25171>:
  D.25132 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20727>:
  <D.20728>:
  D.25132 = emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20729>:
  D.25132 = emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20730>:
  D.25132 = emit_marshal_ptr (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20731>:
  D.25132 = emit_marshal_char (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20732>:
  <D.20733>:
  <D.20734>:
  <D.20735>:
  <D.20736>:
  <D.20737>:
  <D.20738>:
  <D.20739>:
  <D.20740>:
  <D.20741>:
  <D.20742>:
  <D.20743>:
  <D.20744>:
  D.25132 = emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.20745>:
  D.25177 = mono_type_generic_inst_is_valuetype (t);
  if (D.25177 != 0) goto <D.25178>; else goto <D.25179>;
  <D.25178>:
  D.25132 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25179>:
  D.25132 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25132;
  <D.25180>:
  D.25132 = conv_arg;
  return D.25132;
}


emit_marshal_custom (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * ICustomMarshaler.163;
  struct MonoImage * D.25185;
  struct MonoClass * ICustomMarshaler.164;
  struct MonoMethod * cleanup_native.165;
  struct MonoMethod * cleanup_native.166;
  _Bool D.25191;
  long int D.25192;
  long int D.25193;
  struct MonoMethod * cleanup_managed.167;
  struct MonoMethod * cleanup_managed.168;
  _Bool D.25198;
  long int D.25199;
  long int D.25200;
  struct MonoMethod * marshal_managed_to_native.169;
  struct MonoMethod * marshal_managed_to_native.170;
  _Bool D.25205;
  long int D.25206;
  long int D.25207;
  struct MonoMethod * marshal_native_to_managed.171;
  struct MonoMethod * marshal_native_to_managed.172;
  _Bool D.25212;
  long int D.25213;
  long int D.25214;
  struct MonoImage * D.25217;
  char * D.25218;
  _Bool D.25219;
  long int D.25220;
  long int D.25221;
  _Bool D.25224;
  long int D.25225;
  long int D.25226;
  int D.25229;
  const char * D.25232;
  struct MonoType * D.25237;
  unsigned char D.25238;
  struct MonoClass * D.25240;
  struct MonoType * D.25242;
  unsigned char D.25243;
  _Bool D.25248;
  _Bool D.25249;
  _Bool D.25250;
  int D.25253;
  unsigned char D.25254;
  int D.25255;
  struct MonoClass * D.25256;
  struct MonoType * D.25257;
  unsigned int conv_arg.173;
  unsigned char D.25259;
  unsigned char D.25260;
  short unsigned int D.25263;
  int D.25264;
  int D.25265;
  unsigned int D.25269;
  unsigned int D.25270;
  unsigned int argnum.174;
  unsigned int D.25275;
  char * D.25276;
  gchar * D.25277;
  struct MonoClass * D.25282;
  unsigned int pos2.175;
  unsigned int D.25284;
  gchar * D.25287;
  gchar * D.25291;
  gchar * D.25292;
  int D.25296;
  unsigned int D.25297;
  gchar * D.25298;
  struct MonoClass * D.25299;
  struct MonoType * D.25300;
  unsigned int D.25306;
  gchar * D.25307;
  _Bool D.25310;
  long int D.25311;
  long int D.25312;
  int D.25315;
  unsigned int D.25316;
  gchar * D.25317;
  unsigned int D.25318;
  gchar * D.25321;
  gchar * D.25322;
  struct MonoType * mtype;
  struct MonoClass * mklass;
  static struct MonoClass * ICustomMarshaler = 0B;
  static struct MonoMethod * cleanup_native;
  static struct MonoMethod * cleanup_managed;
  static struct MonoMethod * marshal_managed_to_native;
  static struct MonoMethod * marshal_native_to_managed;
  struct MonoMethod * get_instance;
  struct MonoMethodBuilder * mb;
  char * exception_msg;
  guint32 loc1;
  int pos2;
  void handle_exception = <<< error >>>;

  get_instance = 0B;
  mb = m->mb;
  exception_msg = 0B;
  ICustomMarshaler.163 = ICustomMarshaler;
  if (ICustomMarshaler.163 == 0B) goto <D.25183>; else goto <D.25184>;
  <D.25183>:
  D.25185 = mono_defaults.corlib;
  ICustomMarshaler.164 = mono_class_from_name (D.25185, "System.Runtime.InteropServices", "ICustomMarshaler");
  ICustomMarshaler = ICustomMarshaler.164;
  ICustomMarshaler.163 = ICustomMarshaler;
  if (ICustomMarshaler.163 == 0B) goto <D.25187>; else goto <D.25188>;
  <D.25187>:
  exception_msg = monoeg_strdup ("Current profile doesn\'t support ICustomMarshaler");
  goto handle_exception;
  <D.25188>:
  ICustomMarshaler.163 = ICustomMarshaler;
  cleanup_native.165 = mono_class_get_method_from_name (ICustomMarshaler.163, "CleanUpNativeData", 1);
  cleanup_native = cleanup_native.165;
  cleanup_native.166 = cleanup_native;
  D.25191 = cleanup_native.166 == 0B;
  D.25192 = (long int) D.25191;
  D.25193 = __builtin_expect (D.25192, 0);
  if (D.25193 != 0) goto <D.25194>; else goto <D.25195>;
  <D.25194>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5887, "cleanup_native");
  <D.25195>:
  ICustomMarshaler.163 = ICustomMarshaler;
  cleanup_managed.167 = mono_class_get_method_from_name (ICustomMarshaler.163, "CleanUpManagedData", 1);
  cleanup_managed = cleanup_managed.167;
  cleanup_managed.168 = cleanup_managed;
  D.25198 = cleanup_managed.168 == 0B;
  D.25199 = (long int) D.25198;
  D.25200 = __builtin_expect (D.25199, 0);
  if (D.25200 != 0) goto <D.25201>; else goto <D.25202>;
  <D.25201>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5889, "cleanup_managed");
  <D.25202>:
  ICustomMarshaler.163 = ICustomMarshaler;
  marshal_managed_to_native.169 = mono_class_get_method_from_name (ICustomMarshaler.163, "MarshalManagedToNative", 1);
  marshal_managed_to_native = marshal_managed_to_native.169;
  marshal_managed_to_native.170 = marshal_managed_to_native;
  D.25205 = marshal_managed_to_native.170 == 0B;
  D.25206 = (long int) D.25205;
  D.25207 = __builtin_expect (D.25206, 0);
  if (D.25207 != 0) goto <D.25208>; else goto <D.25209>;
  <D.25208>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5891, "marshal_managed_to_native");
  <D.25209>:
  ICustomMarshaler.163 = ICustomMarshaler;
  marshal_native_to_managed.171 = mono_class_get_method_from_name (ICustomMarshaler.163, "MarshalNativeToManaged", 1);
  marshal_native_to_managed = marshal_native_to_managed.171;
  marshal_native_to_managed.172 = marshal_native_to_managed;
  D.25212 = marshal_native_to_managed.172 == 0B;
  D.25213 = (long int) D.25212;
  D.25214 = __builtin_expect (D.25213, 0);
  if (D.25214 != 0) goto <D.25215>; else goto <D.25216>;
  <D.25215>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5893, "marshal_native_to_managed");
  <D.25216>:
  <D.25184>:
  D.25217 = m->image;
  D.25218 = spec->data.custom_data.custom_name;
  mtype = mono_reflection_type_from_name (D.25218, D.25217);
  D.25219 = mtype == 0B;
  D.25220 = (long int) D.25219;
  D.25221 = __builtin_expect (D.25220, 0);
  if (D.25221 != 0) goto <D.25222>; else goto <D.25223>;
  <D.25222>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5897, "mtype != NULL");
  <D.25223>:
  mklass = mono_class_from_mono_type (mtype);
  D.25224 = mklass == 0B;
  D.25225 = (long int) D.25224;
  D.25226 = __builtin_expect (D.25225, 0);
  if (D.25226 != 0) goto <D.25227>; else goto <D.25228>;
  <D.25227>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5899, "mklass != NULL");
  <D.25228>:
  ICustomMarshaler.163 = ICustomMarshaler;
  D.25229 = mono_class_is_assignable_from (ICustomMarshaler.163, mklass);
  if (D.25229 == 0) goto <D.25230>; else goto <D.25231>;
  <D.25230>:
  D.25232 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement the ICustomMarshaler interface.", D.25232);
  <D.25231>:
  get_instance = mono_class_get_method_from_name_flags (mklass, "GetInstance", 1, 16);
  if (get_instance != 0B) goto <D.25233>; else goto <D.25234>;
  <D.25233>:
  {
    struct MonoMethodSignature * get_sig;

    get_sig = mono_method_signature (get_instance);
    D.25237 = get_sig->ret;
    D.25238 = D.25237->type;
    if (D.25238 != 18) goto <D.25235>; else goto <D.25239>;
    <D.25239>:
    D.25237 = get_sig->ret;
    D.25240 = mono_class_from_mono_type (D.25237);
    ICustomMarshaler.163 = ICustomMarshaler;
    if (D.25240 != ICustomMarshaler.163) goto <D.25235>; else goto <D.25241>;
    <D.25241>:
    D.25242 = get_sig->params[0];
    D.25243 = D.25242->type;
    if (D.25243 != 14) goto <D.25235>; else goto <D.25236>;
    <D.25235>:
    get_instance = 0B;
    <D.25236>:
  }
  <D.25234>:
  if (get_instance == 0B) goto <D.25244>; else goto <D.25245>;
  <D.25244>:
  D.25232 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement a static GetInstance method that takes a single string parameter and returns an ICustomMarshaler.", D.25232);
  <D.25245>:
  handle_exception:
  if (exception_msg != 0B) goto <D.25246>; else goto <D.25247>;
  <D.25246>:
  switch (action) <default: <D.20308>, case 0: <D.20303>, case 1: <D.20307>, case 3: <D.20304>, case 6: <D.20305>>
  <D.20303>:
  <D.20304>:
  <D.20305>:
  D.25248 = action == 3;
  D.25249 = action == 6;
  D.25250 = D.25248 | D.25249;
  if (D.25250 != 0) goto <D.25251>; else goto <D.25252>;
  <D.25251>:
  mono_mb_emit_byte (mb, 38);
  <D.25252>:
  mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
  monoeg_g_free (exception_msg);
  goto <D.20306>;
  <D.20307>:
  mono_mb_emit_byte (mb, 20);
  goto <D.20306>;
  <D.20308>:
  goto <D.20306>;
  <D.20306>:
  D.25253 = 0;
  return D.25253;
  <D.25247>:
  switch (action) <default: <D.20325>, case 0: <D.20309>, case 1: <D.20320>, case 2: <D.20319>, case 3: <D.20321>, case 4: <D.20322>, case 5: <D.20324>, case 6: <D.20323>>
  <D.20309>:
  D.25254 = t->type;
  D.25255 = (int) D.25254;
  switch (D.25255) <default: <D.20317>, case 14: <D.20312>, case 17: <D.20315>, case 18: <D.20310>, case 20: <D.20313>, case 28: <D.20311>, case 29: <D.20314>>
  <D.20310>:
  <D.20311>:
  <D.20312>:
  <D.20313>:
  <D.20314>:
  <D.20315>:
  goto <D.20316>;
  <D.20317>:
  D.25254 = t->type;
  D.25255 = (int) D.25254;
  monoeg_g_log (0B, 16, "custom marshalling of type %x is currently not supported", D.25255);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5955);
  <D.20316>:
  D.25256 = mono_defaults.int_class;
  D.25257 = &D.25256->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25257);
  mono_mb_emit_byte (mb, 20);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25261>; else goto <D.25262>;
  <D.25261>:
  D.25263 = t->attrs;
  D.25264 = (int) D.25263;
  D.25265 = D.25264 & 2;
  if (D.25265 != 0) goto <D.20318>; else goto <D.25266>;
  <D.25266>:
  <D.25262>:
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 == 0) goto <D.25267>; else goto <D.25268>;
  <D.25267>:
  D.25263 = t->attrs;
  D.25269 = (unsigned int) D.25263;
  D.25270 = D.25269 & 3;
  if (D.25270 == 2) goto <D.20318>; else goto <D.25271>;
  <D.25271>:
  <D.25268>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25273>; else goto <D.25274>;
  <D.25273>:
  mono_mb_emit_byte (mb, 77);
  <D.25274>:
  D.25275 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25275;
  D.25276 = spec->data.custom_data.cookie;
  D.25277 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25277);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25278>; else goto <D.25279>;
  <D.25278>:
  mono_mb_emit_byte (mb, 80);
  <D.25279>:
  D.25254 = t->type;
  if (D.25254 == 17) goto <D.25280>; else goto <D.25281>;
  <D.25280>:
  D.25256 = mono_defaults.int_class;
  D.25257 = &D.25256->byval_arg;
  *conv_arg_type = D.25257;
  D.25282 = mono_class_from_mono_type (t);
  mono_mb_emit_op (mb, 140, D.25282);
  <D.25281>:
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20319>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  D.25284 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25284;
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25285>; else goto <D.25286>;
  <D.25285>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25276 = spec->data.custom_data.cookie;
  D.25287 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25287);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_byte (mb, 81);
  goto <D.25288>;
  <D.25286>:
  D.25263 = t->attrs;
  D.25264 = (int) D.25263;
  D.25265 = D.25264 & 2;
  if (D.25265 != 0) goto <D.25289>; else goto <D.25290>;
  <D.25289>:
  D.25276 = spec->data.custom_data.cookie;
  D.25291 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25291);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_byte (mb, 38);
  <D.25290>:
  <D.25288>:
  D.25276 = spec->data.custom_data.cookie;
  D.25292 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25292);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  cleanup_native.166 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.166);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20320>:
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25293>; else goto <D.25294>;
  <D.25293>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.173);
  goto <D.25295>;
  <D.25294>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  <D.25295>:
  goto <D.20318>;
  <D.20321>:
  D.25256 = mono_defaults.int_class;
  D.25257 = &D.25256->byval_arg;
  D.25296 = mono_mb_add_local (mb, D.25257);
  loc1 = (guint32) D.25296;
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 3);
  mono_mb_emit_stloc (mb, loc1);
  mono_mb_emit_ldloc (mb, 3);
  D.25297 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25297;
  D.25276 = spec->data.custom_data.cookie;
  D.25298 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25298);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_native.166 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.166);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20322>:
  D.25299 = mono_defaults.object_class;
  D.25300 = &D.25299->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25300);
  mono_mb_emit_byte (mb, 20);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25301>; else goto <D.25302>;
  <D.25301>:
  D.25263 = t->attrs;
  D.25264 = (int) D.25263;
  D.25265 = D.25264 & 2;
  if (D.25265 != 0) goto <D.20318>; else goto <D.25303>;
  <D.25303>:
  <D.25302>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25304>; else goto <D.25305>;
  <D.25304>:
  mono_mb_emit_byte (mb, 77);
  <D.25305>:
  D.25306 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25306;
  D.25276 = spec->data.custom_data.cookie;
  D.25307 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25307);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25308>; else goto <D.25309>;
  <D.25308>:
  mono_mb_emit_byte (mb, 77);
  <D.25309>:
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20323>:
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  D.25310 = D.25260 != 0;
  D.25311 = (long int) D.25310;
  D.25312 = __builtin_expect (D.25311, 0);
  if (D.25312 != 0) goto <D.25313>; else goto <D.25314>;
  <D.25313>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6102, "!t->byref");
  <D.25314>:
  D.25299 = mono_defaults.object_class;
  D.25300 = &D.25299->byval_arg;
  D.25315 = mono_mb_add_local (mb, D.25300);
  loc1 = (guint32) D.25315;
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 3);
  mono_mb_emit_stloc (mb, loc1);
  mono_mb_emit_ldloc (mb, 3);
  D.25316 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25316;
  D.25276 = spec->data.custom_data.cookie;
  D.25317 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25317);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_managed.168 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.168);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20324>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  D.25318 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25318;
  D.25259 = BIT_FIELD_REF <*t, 8, 88>;
  D.25260 = D.25259 & 64;
  if (D.25260 != 0) goto <D.25319>; else goto <D.25320>;
  <D.25319>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25276 = spec->data.custom_data.cookie;
  D.25321 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25321);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  mono_mb_emit_byte (mb, 223);
  <D.25320>:
  D.25276 = spec->data.custom_data.cookie;
  D.25322 = monoeg_strdup (D.25276);
  mono_mb_emit_ldstr (mb, D.25322);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  cleanup_managed.168 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.168);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20318>;
  <D.20325>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6159);
  <D.20318>:
  D.25253 = conv_arg;
  return D.25253;
}


emit_marshal_asany (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethodPInvoke * D.25326;
  unsigned char D.25327;
  _Bool D.25328;
  long int D.25329;
  long int D.25330;
  unsigned char D.25333;
  unsigned char D.25334;
  _Bool D.25335;
  long int D.25336;
  long int D.25337;
  struct MonoClass * D.25340;
  struct MonoType * D.25341;
  unsigned int argnum.176;
  int encoding.177;
  short unsigned int D.25344;
  int D.25345;
  unsigned int conv_arg.178;
  int encoding.179;
  int D.25348;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20342>, case 0: <D.20336>, case 1: <D.20339>, case 2: <D.20340>>
  <D.20336>:
  {
    MonoMarshalNative encoding;

    D.25326 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.25326, 0B);
    D.25327 = t->type;
    D.25328 = D.25327 != 28;
    D.25329 = (long int) D.25328;
    D.25330 = __builtin_expect (D.25329, 0);
    if (D.25330 != 0) goto <D.25331>; else goto <D.25332>;
    <D.25331>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6179, "t->type == MONO_TYPE_OBJECT");
    <D.25332>:
    D.25333 = BIT_FIELD_REF <*t, 8, 88>;
    D.25334 = D.25333 & 64;
    D.25335 = D.25334 != 0;
    D.25336 = (long int) D.25335;
    D.25337 = __builtin_expect (D.25336, 0);
    if (D.25337 != 0) goto <D.25338>; else goto <D.25339>;
    <D.25338>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6180, "!t->byref");
    <D.25339>:
    D.25340 = mono_defaults.int_class;
    D.25341 = &D.25340->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.25341);
    argnum.176 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.176);
    encoding.177 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.177);
    D.25344 = t->attrs;
    D.25345 = (int) D.25344;
    mono_mb_emit_icon (mb, D.25345);
    mono_mb_emit_icall (mb, mono_marshal_asany);
    conv_arg.178 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.178);
    goto <D.20338>;
  }
  <D.20339>:
  conv_arg.178 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.178);
  goto <D.20338>;
  <D.20340>:
  {
    MonoMarshalNative encoding;

    D.25326 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.25326, 0B);
    argnum.176 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.176);
    conv_arg.178 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.178);
    encoding.179 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.179);
    D.25344 = t->attrs;
    D.25345 = (int) D.25344;
    mono_mb_emit_icon (mb, D.25345);
    mono_mb_emit_icall (mb, mono_marshal_free_asany);
    goto <D.20338>;
  }
  <D.20342>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6207);
  <D.20338>:
  D.25348 = conv_arg;
  return D.25348;
}


mono_marshal_get_string_encoding (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  <unnamed type> D.25352;
  <unnamed type> D.25355;
  _Bool D.25356;
  _Bool D.25357;
  _Bool D.25358;
  MonoMarshalNative D.25361;
  short unsigned int D.25365;
  int D.25366;
  int D.25367;

  if (spec != 0B) goto <D.25350>; else goto <D.25351>;
  <D.25350>:
  D.25352 = spec->native;
  if (D.25352 == 42) goto <D.25353>; else goto <D.25354>;
  <D.25353>:
  D.25355 = spec->data.array_data.elem_type;
  D.25356 = D.25355 != 0;
  D.25357 = D.25355 != 80;
  D.25358 = D.25356 & D.25357;
  if (D.25358 != 0) goto <D.25359>; else goto <D.25360>;
  <D.25359>:
  D.25361 = spec->data.array_data.elem_type;
  return D.25361;
  <D.25360>:
  goto <D.25362>;
  <D.25354>:
  D.25361 = spec->native;
  return D.25361;
  <D.25362>:
  <D.25351>:
  if (piinfo == 0B) goto <D.25363>; else goto <D.25364>;
  <D.25363>:
  D.25361 = 20;
  return D.25361;
  <D.25364>:
  D.25365 = piinfo->piflags;
  D.25366 = (int) D.25365;
  D.25367 = D.25366 & 6;
  switch (D.25367) <default: <D.19301>, case 2: <D.19298>, case 4: <D.19299>, case 6: <D.19300>>
  <D.19298>:
  D.25361 = 20;
  return D.25361;
  <D.19299>:
  D.25361 = 21;
  return D.25361;
  <D.19300>:
  D.25361 = 20;
  return D.25361;
  <D.19301>:
  D.25361 = 20;
  return D.25361;
}


emit_marshal_handleref (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * D.25369;
  unsigned char D.25370;
  unsigned char D.25371;
  unsigned int argnum.180;
  unsigned int conv_arg.181;
  struct _IO_FILE * stderr.182;
  int D.25377;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20446>, case 0: <D.20435>, case 1: <D.20439>, case 2: <D.20440>, case 3: <D.20441>, case 4: <D.20443>, case 5: <D.20444>, case 6: <D.20445>>
  <D.20435>:
  {
    struct MonoType * intptr_type;

    D.25369 = mono_defaults.int_class;
    intptr_type = &D.25369->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    D.25370 = BIT_FIELD_REF <*t, 8, 88>;
    D.25371 = D.25370 & 64;
    if (D.25371 != 0) goto <D.25372>; else goto <D.25373>;
    <D.25372>:
    {
      char * msg;

      msg = monoeg_strdup ("HandleRefs can not be returned from unmanaged code (or passed by ref)");
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.20438>;
    }
    <D.25373>:
    argnum.180 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.180);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 77);
    conv_arg.181 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.181);
    goto <D.20438>;
  }
  <D.20439>:
  conv_arg.181 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.181);
  goto <D.20438>;
  <D.20440>:
  goto <D.20438>;
  <D.20441>:
  {
    char * msg;

    msg = monoeg_strdup ("HandleRefs can not be returned from unmanaged code (or passed by ref)");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20438>;
  }
  <D.20443>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20438>;
  <D.20444>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20438>;
  <D.20445>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20438>;
  <D.20446>:
  stderr.182 = stderr;
  fprintf (stderr.182, "Unhandled case for MarshalAction: %d\n", action);
  <D.20438>:
  D.25377 = conv_arg;
  return D.25377;
}


mono_mb_emit_exception_marshal_directive (struct MonoMethodBuilder * mb, char * msg)
{
  int D.25380;
  struct MonoMethod * D.25383;
  struct MonoClass * D.25384;
  struct MonoImage * D.25385;
  char * s;

  D.25380 = mb->dynamic;
  if (D.25380 == 0) goto <D.25381>; else goto <D.25382>;
  <D.25381>:
  D.25383 = mb->method;
  D.25384 = D.25383->klass;
  D.25385 = D.25384->image;
  s = mono_image_strdup (D.25385, msg);
  monoeg_g_free (msg);
  goto <D.25386>;
  <D.25382>:
  s = monoeg_strdup (msg);
  <D.25386>:
  mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
}


fprintf (struct FILE * restrict __stream, const char * restrict __fmt)
{
  int D.25387;

  D.25387 = __fprintf_chk (__stream, 1, __fmt, __builtin_va_arg_pack ());
  return D.25387;
}


emit_marshal_string (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethodPInvoke * D.25389;
  struct MonoClass * D.25390;
  struct MonoType * D.25391;
  unsigned char D.25392;
  unsigned char D.25393;
  short unsigned int D.25396;
  int D.25397;
  int D.25398;
  unsigned int argnum.183;
  void * D.25405;
  unsigned int conv_arg.184;
  struct MonoMethod * m.185;
  struct MonoClass * D.25414;
  struct MonoMethod * m.186;
  _Bool D.25416;
  long int D.25417;
  long int D.25418;
  _Bool D.25423;
  long int D.25424;
  long int D.25425;
  unsigned int D.25431;
  unsigned int D.25432;
  void * D.25435;
  int need_free.187;
  void * D.25448;
  struct MonoClass * D.25452;
  struct MonoType * D.25453;
  void * D.25461;
  void * D.25466;
  void * D.25467;
  void * D.25471;
  int D.25472;
  struct MonoMethodBuilder * mb;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;
  gboolean need_free;

  try
    {
      mb = m->mb;
      D.25389 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25389, spec);
      D.25389 = m->piinfo;
      conv = mono_marshal_get_string_to_ptr_conv (D.25389, spec);
      switch (action) <default: <D.20397>, case 0: <D.20383>, case 1: <D.20390>, case 2: <D.20386>, case 3: <D.20391>, case 4: <D.20393>, case 5: <D.20395>, case 6: <D.20396>>
      <D.20383>:
      D.25390 = mono_defaults.int_class;
      D.25391 = &D.25390->byval_arg;
      *conv_arg_type = D.25391;
      D.25390 = mono_defaults.int_class;
      D.25391 = &D.25390->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25391);
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25394>; else goto <D.25395>;
      <D.25394>:
      D.25396 = t->attrs;
      D.25397 = (int) D.25396;
      D.25398 = D.25397 & 2;
      if (D.25398 != 0) goto <D.20384>; else goto <D.25399>;
      <D.25399>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      mono_mb_emit_byte (mb, 77);
      goto <D.25401>;
      <D.25395>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      <D.25401>:
      if (conv == 4294967295) goto <D.25402>; else goto <D.25403>;
      <D.25402>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
      }
      goto <D.25404>;
      <D.25403>:
      D.25405 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25405);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.184);
      <D.25404>:
      goto <D.20384>;
      <D.20386>:
      D.25389 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25389, spec, &need_free);
      if (conv == 4294967295) goto <D.25407>; else goto <D.25408>;
      <D.25407>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20384>;
      }
      <D.25408>:
      if (encoding == 34) goto <D.25409>; else goto <D.25410>;
      <D.25409>:
      {
        static struct MonoMethod * m;

        m.185 = m;
        if (m.185 == 0B) goto <D.25412>; else goto <D.25413>;
        <D.25412>:
        D.25414 = mono_defaults.string_class;
        m.186 = mono_class_get_method_from_name_flags (D.25414, "get_Length", -1, 0);
        m = m.186;
        m.185 = m;
        D.25416 = m.185 == 0B;
        D.25417 = (long int) D.25416;
        D.25418 = __builtin_expect (D.25417, 0);
        if (D.25418 != 0) goto <D.25419>; else goto <D.25420>;
        <D.25419>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6559, "m");
        <D.25420>:
        <D.25413>:
        D.25392 = BIT_FIELD_REF <*t, 8, 88>;
        D.25393 = D.25392 & 64;
        if (D.25393 == 0) goto <D.25421>; else goto <D.25422>;
        <D.25421>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("VBByRefStr marshalling requires a ref parameter.", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.20384>;
        }
        <D.25422>:
        D.25392 = BIT_FIELD_REF <*t, 8, 88>;
        D.25393 = D.25392 & 64;
        D.25423 = D.25393 == 0;
        D.25424 = (long int) D.25423;
        D.25425 = __builtin_expect (D.25424, 0);
        if (D.25425 != 0) goto <D.25426>; else goto <D.25427>;
        <D.25426>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6572, "t->byref");
        <D.25427>:
        argnum.183 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.183);
        conv_arg.184 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.184);
        argnum.183 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.183);
        mono_mb_emit_byte (mb, 77);
        m.185 = m;
        mono_mb_emit_managed_call (mb, m.185, 0B);
        mono_mb_emit_icall (mb, mono_string_new_len_wrapper);
        mono_mb_emit_byte (mb, 81);
      }
      goto <D.25428>;
      <D.25410>:
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25429>; else goto <D.25430>;
      <D.25429>:
      D.25396 = t->attrs;
      D.25431 = (unsigned int) D.25396;
      D.25432 = D.25431 & 3;
      if (D.25432 != 1) goto <D.25433>; else goto <D.25434>;
      <D.25433>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      D.25435 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25435);
      mono_mb_emit_byte (mb, 81);
      need_free = 1;
      <D.25434>:
      <D.25430>:
      <D.25428>:
      need_free.187 = need_free;
      if (need_free.187 != 0) goto <D.25437>; else goto <D.25438>;
      <D.25437>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      if (conv == 32) goto <D.25439>; else goto <D.25440>;
      <D.25439>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25441>;
      <D.25440>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25441>:
      <D.25438>:
      goto <D.20384>;
      <D.20390>:
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25444>; else goto <D.25442>;
      <D.25444>:
      if (encoding != 34) goto <D.25445>; else goto <D.25442>;
      <D.25445>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.184);
      goto <D.25443>;
      <D.25442>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      <D.25443>:
      goto <D.20384>;
      <D.20391>:
      mono_mb_emit_stloc (mb, 0);
      D.25389 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25389, spec, &need_free);
      if (conv == 4294967295) goto <D.25446>; else goto <D.25447>;
      <D.25446>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20384>;
      }
      <D.25447>:
      mono_mb_emit_ldloc (mb, 0);
      D.25448 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25448);
      mono_mb_emit_stloc (mb, 3);
      mono_mb_emit_ldloc (mb, 0);
      if (conv == 32) goto <D.25449>; else goto <D.25450>;
      <D.25449>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25451>;
      <D.25450>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25451>:
      goto <D.20384>;
      <D.20393>:
      D.25452 = mono_defaults.object_class;
      D.25453 = &D.25452->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25453);
      D.25390 = mono_defaults.int_class;
      D.25391 = &D.25390->byval_arg;
      *conv_arg_type = D.25391;
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25454>; else goto <D.25455>;
      <D.25454>:
      D.25396 = t->attrs;
      D.25397 = (int) D.25396;
      D.25398 = D.25397 & 2;
      if (D.25398 != 0) goto <D.20384>; else goto <D.25456>;
      <D.25456>:
      <D.25455>:
      D.25389 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25389, spec, &need_free);
      if (conv == 4294967295) goto <D.25457>; else goto <D.25458>;
      <D.25457>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20384>;
      }
      <D.25458>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25459>; else goto <D.25460>;
      <D.25459>:
      mono_mb_emit_byte (mb, 77);
      <D.25460>:
      D.25461 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25461);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.184);
      goto <D.20384>;
      <D.20395>:
      D.25392 = BIT_FIELD_REF <*t, 8, 88>;
      D.25393 = D.25392 & 64;
      if (D.25393 != 0) goto <D.25462>; else goto <D.25463>;
      <D.25462>:
      if (conv_arg != 0) goto <D.25464>; else goto <D.25465>;
      <D.25464>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      D.25466 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25466);
      mono_mb_emit_byte (mb, 223);
      <D.25465>:
      <D.25463>:
      goto <D.20384>;
      <D.20396>:
      D.25467 = conv_to_icall (conv);
      if (D.25467 == mono_marshal_string_to_utf16) goto <D.25468>; else goto <D.25469>;
      <D.25468>:
      mono_mb_emit_icall (mb, mono_marshal_string_to_utf16_copy);
      goto <D.25470>;
      <D.25469>:
      D.25471 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25471);
      <D.25470>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20384>;
      <D.20397>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6671);
      <D.20384>:
      D.25472 = conv_arg;
      return D.25472;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_get_string_to_ptr_conv (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  MonoMarshalConv D.25475;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.19312>, case 19: <D.19311>, case 20: <D.19308>, case 21: <D.19307>, case 22: <D.19310>, case 34: <D.19309>>
  <D.19307>:
  D.25475 = 7;
  return D.25475;
  <D.19308>:
  <D.19309>:
  D.25475 = 4;
  return D.25475;
  <D.19310>:
  D.25475 = 9;
  return D.25475;
  <D.19311>:
  D.25475 = 3;
  return D.25475;
  <D.19312>:
  D.25475 = 4294967295;
  return D.25475;
}


mono_marshal_get_ptr_to_string_conv (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec, gboolean * need_free)
{
  MonoMarshalConv D.25477;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.19333>, case 19: <D.19332>, case 20: <D.19329>, case 21: <D.19328>, case 22: <D.19331>, case 34: <D.19330>>
  <D.19328>:
  *need_free = 0;
  D.25477 = 8;
  return D.25477;
  <D.19329>:
  <D.19330>:
  D.25477 = 5;
  return D.25477;
  <D.19331>:
  D.25477 = 6;
  return D.25477;
  <D.19332>:
  D.25477 = 32;
  return D.25477;
  <D.19333>:
  D.25477 = 4294967295;
  return D.25477;
}


conv_to_icall (MonoMarshalConv conv)
{
  void * D.25479;

  switch (conv) <default: <D.19137>, case 3: <D.19119>, case 4: <D.19118>, case 5: <D.19116>, case 6: <D.19115>, case 7: <D.19113>, case 8: <D.19114>, case 9: <D.19117>, case 10: <D.19122>, case 11: <D.19121>, case 12: <D.19135>, case 13: <D.19136>, case 14: <D.19123>, case 15: <D.19124>, case 16: <D.19125>, case 17: <D.19131>, case 18: <D.19132>, case 19: <D.19133>, case 22: <D.19126>, case 23: <D.19127>, case 24: <D.19128>, case 29: <D.19129>, case 30: <D.19130>, case 31: <D.19134>, case 32: <D.19120>>
  <D.19113>:
  D.25479 = mono_marshal_string_to_utf16;
  return D.25479;
  <D.19114>:
  D.25479 = mono_string_from_utf16;
  return D.25479;
  <D.19115>:
  D.25479 = mono_string_new_wrapper;
  return D.25479;
  <D.19116>:
  D.25479 = mono_string_new_wrapper;
  return D.25479;
  <D.19117>:
  D.25479 = mono_string_to_lpstr;
  return D.25479;
  <D.19118>:
  D.25479 = mono_string_to_lpstr;
  return D.25479;
  <D.19119>:
  D.25479 = mono_string_to_bstr;
  return D.25479;
  <D.19120>:
  D.25479 = mono_string_from_bstr;
  return D.25479;
  <D.19121>:
  <D.19122>:
  D.25479 = mono_string_to_ansibstr;
  return D.25479;
  <D.19123>:
  D.25479 = mono_string_builder_to_utf8;
  return D.25479;
  <D.19124>:
  D.25479 = mono_string_builder_to_utf8;
  return D.25479;
  <D.19125>:
  D.25479 = mono_string_builder_to_utf16;
  return D.25479;
  <D.19126>:
  D.25479 = mono_array_to_savearray;
  return D.25479;
  <D.19127>:
  D.25479 = mono_array_to_lparray;
  return D.25479;
  <D.19128>:
  D.25479 = mono_free_lparray;
  return D.25479;
  <D.19129>:
  D.25479 = mono_delegate_to_ftnptr;
  return D.25479;
  <D.19130>:
  D.25479 = mono_ftnptr_to_delegate;
  return D.25479;
  <D.19131>:
  D.25479 = mono_string_utf8_to_builder;
  return D.25479;
  <D.19132>:
  D.25479 = mono_string_utf8_to_builder;
  return D.25479;
  <D.19133>:
  D.25479 = mono_string_utf16_to_builder;
  return D.25479;
  <D.19134>:
  D.25479 = mono_marshal_free_array;
  return D.25479;
  <D.19135>:
  D.25479 = mono_string_to_byvalstr;
  return D.25479;
  <D.19136>:
  D.25479 = mono_string_to_byvalwstr;
  return D.25479;
  <D.19137>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1582);
  D.25479 = 0B;
  return D.25479;
}


emit_marshal_variant (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethod * get_object_for_native_variant.188;
  struct MonoClass * D.25484;
  struct MonoMethod * get_object_for_native_variant.189;
  _Bool D.25486;
  long int D.25487;
  long int D.25488;
  struct MonoMethod * get_native_variant_for_object.190;
  struct MonoMethod * get_native_variant_for_object.191;
  _Bool D.25495;
  long int D.25496;
  long int D.25497;
  struct MonoClass * D.25500;
  struct MonoType * D.25501;
  unsigned char D.25502;
  unsigned char D.25503;
  struct MonoClass * D.25506;
  struct MonoType * D.25507;
  struct MonoClass * D.25509;
  struct MonoType * D.25510;
  short unsigned int D.25513;
  unsigned int D.25514;
  unsigned int D.25515;
  unsigned int argnum.192;
  unsigned int conv_arg.193;
  struct MonoMethod * variant_clear.194;
  struct MonoClass * D.25524;
  struct MonoMethod * variant_clear.195;
  _Bool D.25526;
  long int D.25527;
  long int D.25528;
  struct MonoClass * D.25538;
  struct MonoType * D.25539;
  struct MonoClass * D.25542;
  struct MonoType * D.25543;
  struct MonoClass * D.25545;
  struct MonoType * D.25546;
  int D.25557;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * get_object_for_native_variant = 0B;
  static struct MonoMethod * get_native_variant_for_object = 0B;

  mb = m->mb;
  get_object_for_native_variant.188 = get_object_for_native_variant;
  if (get_object_for_native_variant.188 == 0B) goto <D.25482>; else goto <D.25483>;
  <D.25482>:
  D.25484 = mono_defaults.marshal_class;
  get_object_for_native_variant.189 = mono_class_get_method_from_name (D.25484, "GetObjectForNativeVariant", 1);
  get_object_for_native_variant = get_object_for_native_variant.189;
  <D.25483>:
  get_object_for_native_variant.188 = get_object_for_native_variant;
  D.25486 = get_object_for_native_variant.188 == 0B;
  D.25487 = (long int) D.25486;
  D.25488 = __builtin_expect (D.25487, 0);
  if (D.25488 != 0) goto <D.25489>; else goto <D.25490>;
  <D.25489>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7411, "get_object_for_native_variant");
  <D.25490>:
  get_native_variant_for_object.190 = get_native_variant_for_object;
  if (get_native_variant_for_object.190 == 0B) goto <D.25492>; else goto <D.25493>;
  <D.25492>:
  D.25484 = mono_defaults.marshal_class;
  get_native_variant_for_object.191 = mono_class_get_method_from_name (D.25484, "GetNativeVariantForObject", 2);
  get_native_variant_for_object = get_native_variant_for_object.191;
  <D.25493>:
  get_native_variant_for_object.190 = get_native_variant_for_object;
  D.25495 = get_native_variant_for_object.190 == 0B;
  D.25496 = (long int) D.25495;
  D.25497 = __builtin_expect (D.25496, 0);
  if (D.25497 != 0) goto <D.25498>; else goto <D.25499>;
  <D.25498>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7415, "get_native_variant_for_object");
  <D.25499>:
  switch (action) <default: <D.20507>, case 0: <D.20496>, case 1: <D.20500>, case 2: <D.20498>, case 3: <D.20501>, case 4: <D.20503>, case 5: <D.20504>, case 6: <D.20505>>
  <D.20496>:
  D.25500 = mono_class_get_variant_class ();
  D.25501 = &D.25500->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25501);
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25504>; else goto <D.25505>;
  <D.25504>:
  D.25506 = mono_class_get_variant_class ();
  D.25507 = &D.25506->this_arg;
  *conv_arg_type = D.25507;
  goto <D.25508>;
  <D.25505>:
  D.25509 = mono_class_get_variant_class ();
  D.25510 = &D.25509->byval_arg;
  *conv_arg_type = D.25510;
  <D.25508>:
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25511>; else goto <D.25512>;
  <D.25511>:
  D.25513 = t->attrs;
  D.25514 = (unsigned int) D.25513;
  D.25515 = D.25514 & 3;
  if (D.25515 == 2) goto <D.20497>; else goto <D.25516>;
  <D.25516>:
  <D.25512>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25518>; else goto <D.25519>;
  <D.25518>:
  mono_mb_emit_byte (mb, 80);
  <D.25519>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  get_native_variant_for_object.190 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.190, 0B);
  goto <D.20497>;
  <D.20498>:
  {
    static struct MonoMethod * variant_clear = 0B;

    variant_clear.194 = variant_clear;
    if (variant_clear.194 == 0B) goto <D.25522>; else goto <D.25523>;
    <D.25522>:
    D.25524 = mono_class_get_variant_class ();
    variant_clear.195 = mono_class_get_method_from_name (D.25524, "Clear", 0);
    variant_clear = variant_clear.195;
    <D.25523>:
    variant_clear.194 = variant_clear;
    D.25526 = variant_clear.194 == 0B;
    D.25527 = (long int) D.25526;
    D.25528 = __builtin_expect (D.25527, 0);
    if (D.25528 != 0) goto <D.25529>; else goto <D.25530>;
    <D.25529>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7442, "variant_clear");
    <D.25530>:
    D.25502 = BIT_FIELD_REF <*t, 8, 88>;
    D.25503 = D.25502 & 64;
    if (D.25503 != 0) goto <D.25531>; else goto <D.25532>;
    <D.25531>:
    D.25513 = t->attrs;
    D.25514 = (unsigned int) D.25513;
    D.25515 = D.25514 & 3;
    if (D.25515 != 1) goto <D.25533>; else goto <D.25534>;
    <D.25533>:
    argnum.192 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.192);
    conv_arg.193 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.193);
    get_object_for_native_variant.188 = get_object_for_native_variant;
    mono_mb_emit_managed_call (mb, get_object_for_native_variant.188, 0B);
    mono_mb_emit_byte (mb, 81);
    <D.25534>:
    <D.25532>:
    conv_arg.193 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.193);
    variant_clear.194 = variant_clear;
    mono_mb_emit_managed_call (mb, variant_clear.194, 0B);
    goto <D.20497>;
  }
  <D.20500>:
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25535>; else goto <D.25536>;
  <D.25535>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  goto <D.25537>;
  <D.25536>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  <D.25537>:
  goto <D.20497>;
  <D.20501>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20497>;
  }
  <D.20503>:
  D.25538 = mono_defaults.object_class;
  D.25539 = &D.25538->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25539);
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25540>; else goto <D.25541>;
  <D.25540>:
  D.25542 = mono_class_get_variant_class ();
  D.25543 = &D.25542->this_arg;
  *conv_arg_type = D.25543;
  goto <D.25544>;
  <D.25541>:
  D.25545 = mono_class_get_variant_class ();
  D.25546 = &D.25545->byval_arg;
  *conv_arg_type = D.25546;
  <D.25544>:
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25547>; else goto <D.25548>;
  <D.25547>:
  D.25513 = t->attrs;
  D.25514 = (unsigned int) D.25513;
  D.25515 = D.25514 & 3;
  if (D.25515 == 2) goto <D.20497>; else goto <D.25549>;
  <D.25549>:
  <D.25548>:
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25550>; else goto <D.25551>;
  <D.25550>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  goto <D.25552>;
  <D.25551>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.192);
  <D.25552>:
  get_object_for_native_variant.188 = get_object_for_native_variant;
  mono_mb_emit_managed_call (mb, get_object_for_native_variant.188, 0B);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  goto <D.20497>;
  <D.20504>:
  D.25502 = BIT_FIELD_REF <*t, 8, 88>;
  D.25503 = D.25502 & 64;
  if (D.25503 != 0) goto <D.25553>; else goto <D.25554>;
  <D.25553>:
  D.25513 = t->attrs;
  D.25514 = (unsigned int) D.25513;
  D.25515 = D.25514 & 3;
  if (D.25515 != 1) goto <D.25555>; else goto <D.25556>;
  <D.25555>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  get_native_variant_for_object.190 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.190, 0B);
  <D.25556>:
  <D.25554>:
  goto <D.20497>;
  <D.20505>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20497>;
  }
  <D.20507>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7506);
  <D.20497>:
  D.25557 = conv_arg;
  return D.25557;
}


emit_marshal_safehandle (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * D.25559;
  struct MonoMethod * sh_dangerous_add_ref.196;
  unsigned int argnum.197;
  unsigned int D.25564;
  unsigned int pos.198;
  unsigned char D.25566;
  unsigned char D.25567;
  unsigned int conv_arg.199;
  struct MonoClass * D.25571;
  struct MonoType * D.25572;
  unsigned int dar_release_slot.200;
  struct MonoMethod * sh_dangerous_release.201;
  struct MonoClass * D.25582;
  unsigned int dar_release_slot.202;
  unsigned int D.25587;
  unsigned int label_next.203;
  unsigned int D.25589;
  unsigned int D.25590;
  gchar * D.25593;
  struct MonoType * D.25596;
  unsigned int intptr_handle_slot.204;
  struct _IO_FILE * stderr.205;
  int D.25599;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20424>, case 0: <D.20408>, case 1: <D.20413>, case 2: <D.20414>, case 3: <D.20418>, case 4: <D.20421>, case 5: <D.20422>, case 6: <D.20423>>
  <D.20408>:
  {
    struct MonoType * intptr_type;
    int dar_release_slot;
    int pos;

    D.25559 = mono_defaults.int_class;
    intptr_type = &D.25559->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    sh_dangerous_add_ref.196 = sh_dangerous_add_ref;
    if (sh_dangerous_add_ref.196 == 0B) goto <D.25561>; else goto <D.25562>;
    <D.25561>:
    init_safe_handle ();
    <D.25562>:
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    D.25564 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.25564;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.198 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.198);
    D.25566 = BIT_FIELD_REF <*t, 8, 88>;
    D.25567 = D.25566 & 64;
    if (D.25567 != 0) goto <D.25568>; else goto <D.25569>;
    <D.25568>:
    mono_mb_emit_icon (mb, 0);
    conv_arg.199 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.199);
    goto <D.20412>;
    <D.25569>:
    D.25571 = mono_defaults.boolean_class;
    D.25572 = &D.25571->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.25572);
    mono_mb_emit_icon (mb, 0);
    dar_release_slot.200 = (unsigned int) dar_release_slot;
    mono_mb_emit_stloc (mb, dar_release_slot.200);
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    dar_release_slot.200 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc_addr (mb, dar_release_slot.200);
    sh_dangerous_add_ref.196 = sh_dangerous_add_ref;
    mono_mb_emit_managed_call (mb, sh_dangerous_add_ref.196, 0B);
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    mono_mb_emit_ldflda (mb, 16);
    mono_mb_emit_byte (mb, 77);
    conv_arg.199 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.199);
    goto <D.20412>;
  }
  <D.20413>:
  D.25566 = BIT_FIELD_REF <*t, 8, 88>;
  D.25567 = D.25566 & 64;
  if (D.25567 != 0) goto <D.25574>; else goto <D.25575>;
  <D.25574>:
  conv_arg.199 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.199);
  goto <D.25576>;
  <D.25575>:
  conv_arg.199 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.199);
  <D.25576>:
  goto <D.20412>;
  <D.20414>:
  {
    int dar_release_slot;
    int label_next;

    dar_release_slot = conv_arg + 1;
    sh_dangerous_release.201 = sh_dangerous_release;
    if (sh_dangerous_release.201 == 0B) goto <D.25578>; else goto <D.25579>;
    <D.25578>:
    init_safe_handle ();
    <D.25579>:
    D.25566 = BIT_FIELD_REF <*t, 8, 88>;
    D.25567 = D.25566 & 64;
    if (D.25567 != 0) goto <D.25580>; else goto <D.25581>;
    <D.25580>:
    {
      struct MonoMethod * ctor;

      D.25582 = t->data.klass;
      ctor = mono_class_get_method_from_name (D.25582, ".ctor", 0);
      if (ctor == 0B) goto <D.25583>; else goto <D.25584>;
      <D.25583>:
      mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
      goto <D.20412>;
      <D.25584>:
      argnum.197 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.197);
      mono_mb_emit_op (mb, 115, ctor);
      mono_mb_emit_byte (mb, 81);
      argnum.197 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.197);
      mono_mb_emit_byte (mb, 80);
      mono_mb_emit_ldflda (mb, 16);
      conv_arg.199 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.199);
      mono_mb_emit_byte (mb, 223);
    }
    goto <D.25585>;
    <D.25581>:
    dar_release_slot.202 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc (mb, dar_release_slot.202);
    D.25587 = mono_mb_emit_branch (mb, 57);
    label_next = (int) D.25587;
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    sh_dangerous_release.201 = sh_dangerous_release;
    mono_mb_emit_managed_call (mb, sh_dangerous_release.201, 0B);
    label_next.203 = (unsigned int) label_next;
    mono_mb_patch_branch (mb, label_next.203);
    <D.25585>:
    goto <D.20412>;
  }
  <D.20418>:
  {
    struct MonoMethod * ctor;
    int intptr_handle_slot;

    ctor = 0B;
    D.25582 = t->data.klass;
    D.25589 = D.25582->flags;
    D.25590 = D.25589 & 128;
    if (D.25590 != 0) goto <D.25591>; else goto <D.25592>;
    <D.25591>:
    mono_mb_emit_byte (mb, 38);
    D.25593 = monoeg_strdup ("Returned SafeHandles should not be abstract");
    mono_mb_emit_exception_marshal_directive (mb, D.25593);
    goto <D.20412>;
    <D.25592>:
    D.25582 = t->data.klass;
    ctor = mono_class_get_method_from_name (D.25582, ".ctor", 0);
    if (ctor == 0B) goto <D.25594>; else goto <D.25595>;
    <D.25594>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
    goto <D.20412>;
    <D.25595>:
    D.25559 = mono_defaults.int_class;
    D.25596 = &D.25559->byval_arg;
    intptr_handle_slot = mono_mb_add_local (mb, D.25596);
    intptr_handle_slot.204 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_stloc (mb, intptr_handle_slot.204);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_stloc (mb, 3);
    mono_mb_emit_ldloc (mb, 3);
    mono_mb_emit_ldflda (mb, 16);
    intptr_handle_slot.204 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_ldloc (mb, intptr_handle_slot.204);
    mono_mb_emit_byte (mb, 223);
    goto <D.20412>;
  }
  <D.20421>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20412>;
  <D.20422>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20412>;
  <D.20423>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20412>;
  <D.20424>:
  printf ("Unhandled case for MarshalAction: %d\n", action);
  <D.20412>:
  D.25599 = conv_arg;
  return D.25599;
}


init_safe_handle ()
{
  struct MonoClass * D.25601;
  struct MonoMethod * sh_dangerous_add_ref.206;
  struct MonoMethod * sh_dangerous_release.207;

  D.25601 = mono_defaults.safehandle_class;
  sh_dangerous_add_ref.206 = mono_class_get_method_from_name (D.25601, "DangerousAddRef", 1);
  sh_dangerous_add_ref = sh_dangerous_add_ref.206;
  D.25601 = mono_defaults.safehandle_class;
  sh_dangerous_release.207 = mono_class_get_method_from_name (D.25601, "DangerousRelease", 0);
  sh_dangerous_release = sh_dangerous_release.207;
}


printf (const char * restrict __fmt)
{
  int D.25604;

  D.25604 = __printf_chk (1, __fmt, __builtin_va_arg_pack ());
  return D.25604;
}


emit_marshal_array (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethodPInvoke * D.25606;
  struct MonoClass * D.25607;
  struct MonoType * D.25608;
  struct MonoClass * D.25609;
  unsigned char D.25610;
  unsigned char D.25611;
  unsigned int argnum.208;
  unsigned char D.25615;
  unsigned char D.25616;
  void * D.25619;
  unsigned int conv_arg.209;
  struct MonoClass * D.25622;
  struct MonoType * D.25623;
  struct MonoClass * D.25624;
  struct MonoClass * D.25628;
  _Bool D.25632;
  _Bool D.25633;
  _Bool D.25634;
  unsigned int src_var.210;
  struct MonoClass * D.25643;
  int iftmp.211;
  int D.25647;
  unsigned int dest_ptr.212;
  unsigned int index_var.213;
  int D.25656;
  void * D.25659;
  MonoMarshalNative iftmp.214;
  short unsigned int D.25665;
  int D.25666;
  short unsigned int D.25667;
  int D.25668;
  int iftmp.215;
  short unsigned int D.25678;
  int D.25679;
  int D.25680;
  struct MonoType * D.25681;
  int need_free.216;
  int need_free.217;
  int D.25684;
  int iftmp.218;
  int D.25694;
  unsigned int src_ptr.219;
  unsigned int index_var.220;
  int D.25703;
  _Bool D.25708;
  long int D.25709;
  long int D.25710;
  void * D.25715;
  MonoMarshalNative iftmp.221;
  unsigned int loc.222;
  short unsigned int D.25735;
  int D.25736;
  short unsigned int D.25737;
  int D.25738;
  void * D.25741;
  int D.25747;
  <unnamed type> D.25750;
  short int D.25753;
  short int D.25754;
  struct MonoMethodSignature * D.25772;
  short unsigned int D.25773;
  int D.25774;
  struct MonoType * D.25777;
  unsigned char D.25778;
  int D.25779;
  unsigned int src_ptr.223;
  unsigned int param_num.224;
  unsigned char D.25787;
  unsigned char D.25788;
  unsigned int index_var.225;
  int D.25792;
  _Bool D.25795;
  long int D.25796;
  long int D.25797;
  void * D.25800;
  short unsigned int D.25802;
  int D.25803;
  short unsigned int D.25804;
  int D.25805;
  _Bool D.25807;
  long int D.25808;
  long int D.25809;
  _Bool D.25812;
  long int D.25813;
  long int D.25814;
  _Bool D.25817;
  long int D.25818;
  long int D.25819;
  unsigned int dest_ptr.226;
  unsigned char D.25838;
  unsigned char D.25839;
  unsigned int index_var.227;
  int D.25843;
  _Bool D.25846;
  long int D.25847;
  long int D.25848;
  void * D.25851;
  short unsigned int D.25853;
  int D.25854;
  short unsigned int D.25855;
  int D.25856;
  int iftmp.228;
  int D.25868;
  unsigned int src.229;
  unsigned int dest.230;
  unsigned int index_var.231;
  int D.25878;
  _Bool D.25881;
  long int D.25882;
  long int D.25883;
  void * D.25886;
  short unsigned int D.25888;
  int D.25889;
  short unsigned int D.25890;
  int D.25891;
  struct MonoMethodBuilder * mb;
  struct MonoClass * klass;
  gboolean need_convert;
  gboolean need_free;
  MonoMarshalNative encoding;

  try
    {
      mb = m->mb;
      klass = mono_class_from_mono_type (t);
      D.25606 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25606, spec);
      switch (action) <default: <D.20613>, case 0: <D.20529>, case 1: <D.20553>, case 2: <D.20542>, case 3: <D.20554>, case 4: <D.20555>, case 5: <D.20587>, case 6: <D.20601>>
      <D.20529>:
      D.25607 = mono_defaults.object_class;
      D.25608 = &D.25607->byval_arg;
      *conv_arg_type = D.25608;
      D.25607 = mono_defaults.object_class;
      D.25608 = &D.25607->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25608);
      D.25609 = klass->element_class;
      D.25610 = BIT_FIELD_REF <*D.25609, 8, 256>;
      D.25611 = D.25610 & 32;
      if (D.25611 != 0) goto <D.25612>; else goto <D.25613>;
      <D.25612>:
      argnum.208 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.208);
      D.25615 = BIT_FIELD_REF <*t, 8, 88>;
      D.25616 = D.25615 & 64;
      if (D.25616 != 0) goto <D.25617>; else goto <D.25618>;
      <D.25617>:
      mono_mb_emit_byte (mb, 77);
      <D.25618>:
      D.25619 = conv_to_icall (23);
      mono_mb_emit_icall (mb, D.25619);
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.209);
      goto <D.25621>;
      <D.25613>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_var;
        int dest_ptr;
        int esize;
        MonoMarshalConv conv;
        gboolean is_string;

        is_string = 0;
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25623);
        eklass = klass->element_class;
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25625>; else goto <D.25626>;
        <D.25625>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25606, spec);
        goto <D.25627>;
        <D.25626>:
        D.25628 = mono_defaults.stringbuilder_class;
        if (D.25628 == eklass) goto <D.25629>; else goto <D.25630>;
        <D.25629>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25606, spec);
        goto <D.25631>;
        <D.25630>:
        conv = 4294967295;
        <D.25631>:
        <D.25627>:
        D.25632 = is_string != 0;
        D.25633 = conv == 4294967295;
        D.25634 = D.25632 & D.25633;
        if (D.25634 != 0) goto <D.25635>; else goto <D.25636>;
        <D.25635>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("string/stringbuilder marshalling conversion %d not implemented", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.20541>;
        }
        <D.25636>:
        D.25607 = mono_defaults.object_class;
        D.25608 = &D.25607->byval_arg;
        src_var = mono_mb_add_local (mb, D.25608);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        if (D.25616 != 0) goto <D.25637>; else goto <D.25638>;
        <D.25637>:
        mono_mb_emit_byte (mb, 77);
        <D.25638>:
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_stloc (mb, src_var.210);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        label1 = mono_mb_emit_branch (mb, 57);
        if (is_string != 0) goto <D.25640>; else goto <D.25641>;
        <D.25640>:
        esize = 8;
        goto <D.25642>;
        <D.25641>:
        D.25643 = mono_defaults.char_class;
        if (D.25643 == eklass) goto <D.25644>; else goto <D.25645>;
        <D.25644>:
        D.25606 = m->piinfo;
        D.25647 = mono_pinvoke_is_unicode (D.25606);
        if (D.25647 != 0) goto <D.25648>; else goto <D.25649>;
        <D.25648>:
        iftmp.211 = 2;
        goto <D.25650>;
        <D.25649>:
        iftmp.211 = 1;
        <D.25650>:
        esize = iftmp.211;
        goto <D.25651>;
        <D.25645>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25651>:
        <D.25642>:
        mono_mb_emit_icon (mb, esize);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        mono_mb_emit_byte (mb, 142);
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25652>; else goto <D.25653>;
        <D.25652>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25653>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 15);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.212);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        index_var = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 22);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.213);
        D.25656 = mono_mb_get_label (mb);
        label2 = (guint32) D.25656;
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25657>; else goto <D.25658>;
        <D.25657>:
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        mono_mb_emit_byte (mb, 154);
        D.25659 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25659);
        mono_mb_emit_byte (mb, 223);
        goto <D.25660>;
        <D.25658>:
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 0);
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        mono_mb_emit_stloc (mb, 1);
        D.25643 = mono_defaults.char_class;
        if (D.25643 == eklass) goto <D.25662>; else goto <D.25663>;
        <D.25662>:
        iftmp.214 = encoding;
        goto <D.25664>;
        <D.25663>:
        iftmp.214 = 4294967295;
        <D.25664>:
        emit_struct_conv_full (mb, eklass, 0, iftmp.214);
        <D.25660>:
        D.25665 = (short unsigned int) index_var;
        D.25666 = (int) D.25665;
        mono_mb_emit_add_to_local (mb, D.25666, 1);
        D.25667 = (short unsigned int) dest_ptr;
        D.25668 = (int) D.25667;
        mono_mb_emit_add_to_local (mb, D.25668, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25669>; else goto <D.25670>;
        <D.25669>:
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        mono_mb_emit_byte (mb, 22);
        mono_mb_emit_byte (mb, 81);
        <D.25670>:
        mono_mb_patch_branch (mb, label1);
      }
      <D.25621>:
      goto <D.20541>;
      <D.20542>:
      D.25609 = klass->element_class;
      D.25643 = mono_defaults.char_class;
      if (D.25609 == D.25643) goto <D.25676>; else goto <D.25672>;
      <D.25676>:
      if (encoding == 21) goto <D.25673>; else goto <D.25672>;
      <D.25672>:
      D.25609 = klass->element_class;
      D.25628 = mono_defaults.stringbuilder_class;
      if (D.25609 == D.25628) goto <D.25673>; else goto <D.25677>;
      <D.25677>:
      D.25678 = t->attrs;
      D.25679 = (int) D.25678;
      D.25680 = D.25679 & 2;
      if (D.25680 != 0) goto <D.25673>; else goto <D.25674>;
      <D.25673>:
      iftmp.215 = 1;
      goto <D.25675>;
      <D.25674>:
      iftmp.215 = 0;
      <D.25675>:
      need_convert = iftmp.215;
      D.25606 = m->piinfo;
      D.25609 = klass->element_class;
      D.25681 = &D.25609->byval_arg;
      need_free.216 = mono_marshal_need_free (D.25681, D.25606, spec);
      need_free = need_free.216;
      need_free.217 = need_free;
      D.25684 = need_convert | need_free.217;
      if (D.25684 != 0) goto <D.25685>; else goto <D.25686>;
      <D.25685>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;

        eklass = klass->element_class;
        D.25628 = mono_defaults.stringbuilder_class;
        if (D.25628 == eklass) goto <D.25687>; else goto <D.25690>;
        <D.25690>:
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25687>; else goto <D.25688>;
        <D.25687>:
        esize = 8;
        goto <D.25689>;
        <D.25688>:
        D.25643 = mono_defaults.char_class;
        if (D.25643 == eklass) goto <D.25691>; else goto <D.25692>;
        <D.25691>:
        D.25606 = m->piinfo;
        D.25694 = mono_pinvoke_is_unicode (D.25606);
        if (D.25694 != 0) goto <D.25695>; else goto <D.25696>;
        <D.25695>:
        iftmp.218 = 2;
        goto <D.25697>;
        <D.25696>:
        iftmp.218 = 1;
        <D.25697>:
        esize = iftmp.218;
        goto <D.25698>;
        <D.25692>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25698>:
        <D.25689>:
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25623);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        loc = mono_mb_add_local (mb, D.25623);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        if (D.25616 != 0) goto <D.25699>; else goto <D.25700>;
        <D.25699>:
        mono_mb_emit_byte (mb, 77);
        <D.25700>:
        label1 = mono_mb_emit_branch (mb, 57);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.219);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        index_var = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 22);
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.220);
        D.25703 = mono_mb_get_label (mb);
        label2 = (guint32) D.25703;
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.220);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        if (D.25616 != 0) goto <D.25704>; else goto <D.25705>;
        <D.25704>:
        mono_mb_emit_byte (mb, 80);
        <D.25705>:
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        D.25628 = mono_defaults.stringbuilder_class;
        if (D.25628 == eklass) goto <D.25706>; else goto <D.25707>;
        <D.25706>:
        {
          gboolean need_free2;
          MonoMarshalConv conv;

          try
            {
              D.25606 = m->piinfo;
              conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25606, spec, &need_free2);
              D.25708 = conv == 4294967295;
              D.25709 = (long int) D.25708;
              D.25710 = __builtin_expect (D.25709, 0);
              if (D.25710 != 0) goto <D.25711>; else goto <D.25712>;
              <D.25711>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7735, "conv != -1");
              <D.25712>:
              argnum.208 = (unsigned int) argnum;
              mono_mb_emit_ldarg (mb, argnum.208);
              D.25615 = BIT_FIELD_REF <*t, 8, 88>;
              D.25616 = D.25615 & 64;
              if (D.25616 != 0) goto <D.25713>; else goto <D.25714>;
              <D.25713>:
              mono_mb_emit_byte (mb, 77);
              <D.25714>:
              index_var.220 = (unsigned int) index_var;
              mono_mb_emit_ldloc (mb, index_var.220);
              mono_mb_emit_byte (mb, 154);
              src_ptr.219 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.219);
              mono_mb_emit_byte (mb, 77);
              D.25715 = conv_to_icall (conv);
              mono_mb_emit_icall (mb, D.25715);
              need_free.217 = need_free;
              if (need_free.217 != 0) goto <D.25716>; else goto <D.25717>;
              <D.25716>:
              src_ptr.219 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.219);
              mono_mb_emit_byte (mb, 77);
              mono_mb_emit_icall (mb, mono_marshal_free);
              <D.25717>:
            }
          finally
            {
              need_free2 = {CLOBBER};
            }
        }
        goto <D.25718>;
        <D.25707>:
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25719>; else goto <D.25720>;
        <D.25719>:
        need_free.217 = need_free;
        if (need_free.217 != 0) goto <D.25721>; else goto <D.25722>;
        <D.25721>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        mono_mb_emit_byte (mb, 77);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.25722>:
        goto <D.25723>;
        <D.25720>:
        if (need_convert != 0) goto <D.25724>; else goto <D.25725>;
        <D.25724>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        mono_mb_emit_stloc (mb, 0);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        if (D.25616 != 0) goto <D.25726>; else goto <D.25727>;
        <D.25726>:
        mono_mb_emit_byte (mb, 80);
        <D.25727>:
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.220);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 1);
        D.25643 = mono_defaults.char_class;
        if (D.25643 == eklass) goto <D.25729>; else goto <D.25730>;
        <D.25729>:
        iftmp.221 = encoding;
        goto <D.25731>;
        <D.25730>:
        iftmp.221 = 4294967295;
        <D.25731>:
        emit_struct_conv_full (mb, eklass, 1, iftmp.221);
        <D.25725>:
        need_free.217 = need_free;
        if (need_free.217 != 0) goto <D.25732>; else goto <D.25733>;
        <D.25732>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        loc.222 = (unsigned int) loc;
        mono_mb_emit_stloc (mb, loc.222);
        loc.222 = (unsigned int) loc;
        mono_mb_emit_ldloc (mb, loc.222);
        emit_struct_free (mb, eklass, loc);
        <D.25733>:
        <D.25723>:
        <D.25718>:
        D.25735 = (short unsigned int) index_var;
        D.25736 = (int) D.25735;
        mono_mb_emit_add_to_local (mb, D.25736, 1);
        D.25737 = (short unsigned int) src_ptr;
        D.25738 = (int) D.25737;
        mono_mb_emit_add_to_local (mb, D.25738, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
      }
      <D.25686>:
      D.25609 = klass->element_class;
      D.25610 = BIT_FIELD_REF <*D.25609, 8, 256>;
      D.25611 = D.25610 & 32;
      if (D.25611 != 0) goto <D.25739>; else goto <D.25740>;
      <D.25739>:
      argnum.208 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.208);
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.209);
      D.25741 = conv_to_icall (24);
      mono_mb_emit_icall (mb, D.25741);
      <D.25740>:
      goto <D.20541>;
      <D.20553>:
      D.25615 = BIT_FIELD_REF <*t, 8, 88>;
      D.25616 = D.25615 & 64;
      if (D.25616 != 0) goto <D.25742>; else goto <D.25743>;
      <D.25742>:
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.209);
      goto <D.25744>;
      <D.25743>:
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.209);
      <D.25744>:
      goto <D.20541>;
      <D.20554>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20541>;
      <D.20555>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;
        int param_num;
        int num_elem;
        MonoMarshalConv conv;
        gboolean is_string;

        is_string = 0;
        D.25607 = mono_defaults.object_class;
        D.25608 = &D.25607->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.25608);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        *conv_arg_type = D.25623;
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        if (D.25616 != 0) goto <D.25745>; else goto <D.25746>;
        <D.25745>:
        {
          char * msg;

          msg = monoeg_strdup ("Byref array marshalling to managed code is not implemented.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25746>:
        if (spec == 0B) goto <D.25748>; else goto <D.25749>;
        <D.25748>:
        {
          char * msg;

          msg = monoeg_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25749>:
        D.25750 = spec->native;
        if (D.25750 != 42) goto <D.25751>; else goto <D.25752>;
        <D.25751>:
        {
          char * msg;

          msg = monoeg_strdup ("Non LPArray marshalling of arrays to managed code is not implemented.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25752>:
        D.25753 = spec->data.array_data.param_num;
        param_num = (int) D.25753;
        num_elem = spec->data.array_data.num_elem;
        D.25754 = spec->data.array_data.elem_mult;
        if (D.25754 == 0) goto <D.25755>; else goto <D.25756>;
        <D.25755>:
        param_num = -1;
        <D.25756>:
        if (param_num == -1) goto <D.25757>; else goto <D.25758>;
        <D.25757>:
        if (num_elem <= 0) goto <D.25759>; else goto <D.25760>;
        <D.25759>:
        {
          char * msg;

          msg = monoeg_strdup ("Either SizeConst or SizeParamIndex should be specified when marshalling arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25760>:
        <D.25758>:
        eklass = klass->element_class;
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25761>; else goto <D.25762>;
        <D.25761>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_ptr_to_string_conv (D.25606, spec, &need_free);
        goto <D.25763>;
        <D.25762>:
        D.25628 = mono_defaults.stringbuilder_class;
        if (D.25628 == eklass) goto <D.25764>; else goto <D.25765>;
        <D.25764>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25606, spec, &need_free);
        goto <D.25766>;
        <D.25765>:
        conv = 4294967295;
        <D.25766>:
        <D.25763>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.25767>; else goto <D.25768>;
        <D.25767>:
        esize = 8;
        goto <D.25769>;
        <D.25768>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25769>:
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25623);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        loc = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 20);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        if (param_num != -1) goto <D.25770>; else goto <D.25771>;
        <D.25770>:
        D.25772 = m->sig;
        D.25773 = D.25772->param_count;
        D.25774 = (int) D.25773;
        if (D.25774 <= param_num) goto <D.25775>; else goto <D.25776>;
        <D.25775>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter index is out of range.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25776>:
        D.25772 = m->sig;
        D.25777 = D.25772->params[param_num];
        D.25778 = D.25777->type;
        D.25779 = (int) D.25778;
        switch (D.25779) <default: <D.20584>, case 4: <D.20573>, case 5: <D.20574>, case 6: <D.20575>, case 7: <D.20576>, case 8: <D.20577>, case 9: <D.20578>, case 10: <D.20581>, case 11: <D.20582>, case 24: <D.20579>, case 25: <D.20580>>
        <D.20573>:
        <D.20574>:
        <D.20575>:
        <D.20576>:
        <D.20577>:
        <D.20578>:
        <D.20579>:
        <D.20580>:
        <D.20581>:
        <D.20582>:
        goto <D.20583>;
        <D.20584>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter must be an integral type.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.20583>:
        <D.25771>:
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        src_ptr.223 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.223);
        if (param_num == -1) goto <D.25781>; else goto <D.25782>;
        <D.25781>:
        mono_mb_emit_icon (mb, num_elem);
        goto <D.25783>;
        <D.25782>:
        param_num.224 = (unsigned int) param_num;
        mono_mb_emit_ldarg (mb, param_num.224);
        if (num_elem > 0) goto <D.25785>; else goto <D.25786>;
        <D.25785>:
        mono_mb_emit_icon (mb, num_elem);
        mono_mb_emit_byte (mb, 88);
        <D.25786>:
        mono_mb_emit_byte (mb, 212);
        <D.25783>:
        mono_mb_emit_op (mb, 141, eklass);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        D.25787 = BIT_FIELD_REF <*eklass, 8, 256>;
        D.25788 = D.25787 & 32;
        if (D.25788 != 0) goto <D.25789>; else goto <D.25790>;
        <D.25789>:
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 32);
        mono_mb_emit_byte (mb, 88);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.20541>;
        <D.25790>:
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        index_var = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 22);
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.225);
        D.25792 = mono_mb_get_label (mb);
        label2 = (guint32) D.25792;
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.225);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25793>; else goto <D.25794>;
        <D.25793>:
        D.25795 = conv == 4294967295;
        D.25796 = (long int) D.25795;
        D.25797 = __builtin_expect (D.25796, 0);
        if (D.25797 != 0) goto <D.25798>; else goto <D.25799>;
        <D.25798>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7976, "conv != -1");
        <D.25799>:
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.225);
        src_ptr.223 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.223);
        mono_mb_emit_byte (mb, 77);
        D.25800 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25800);
        mono_mb_emit_byte (mb, 162);
        goto <D.25801>;
        <D.25794>:
        {
          char * msg;

          msg = monoeg_strdup ("Marshalling of non-string and non-blittable arrays to managed code is not implemented.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25801>:
        D.25802 = (short unsigned int) index_var;
        D.25803 = (int) D.25802;
        mono_mb_emit_add_to_local (mb, D.25803, 1);
        D.25804 = (short unsigned int) src_ptr;
        D.25805 = (int) D.25804;
        mono_mb_emit_add_to_local (mb, D.25805, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.20541>;
      }
      <D.20587>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int dest_ptr;
        int loc;
        int esize;
        int param_num;
        int num_elem;
        MonoMarshalConv conv;
        gboolean is_string;

        is_string = 0;
        if (spec == 0B) goto <D.20541>; else goto <D.25806>;
        <D.25806>:
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        D.25807 = D.25616 != 0;
        D.25808 = (long int) D.25807;
        D.25809 = __builtin_expect (D.25808, 0);
        if (D.25809 != 0) goto <D.25810>; else goto <D.25811>;
        <D.25810>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8015, "!t->byref");
        <D.25811>:
        D.25750 = spec->native;
        D.25812 = D.25750 != 42;
        D.25813 = (long int) D.25812;
        D.25814 = __builtin_expect (D.25813, 0);
        if (D.25814 != 0) goto <D.25815>; else goto <D.25816>;
        <D.25815>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8016, "spec->native == MONO_NATIVE_LPARRAY");
        <D.25816>:
        D.25678 = t->attrs;
        D.25679 = (int) D.25678;
        D.25680 = D.25679 & 2;
        D.25817 = D.25680 == 0;
        D.25818 = (long int) D.25817;
        D.25819 = __builtin_expect (D.25818, 0);
        if (D.25819 != 0) goto <D.25820>; else goto <D.25821>;
        <D.25820>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8017, "t->attrs & PARAM_ATTRIBUTE_OUT");
        <D.25821>:
        D.25753 = spec->data.array_data.param_num;
        param_num = (int) D.25753;
        num_elem = spec->data.array_data.num_elem;
        D.25754 = spec->data.array_data.elem_mult;
        if (D.25754 == 0) goto <D.25822>; else goto <D.25823>;
        <D.25822>:
        param_num = -1;
        <D.25823>:
        if (param_num == -1) goto <D.25824>; else goto <D.25825>;
        <D.25824>:
        if (num_elem <= 0) goto <D.25826>; else goto <D.25827>;
        <D.25826>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8028);
        <D.25827>:
        <D.25825>:
        eklass = klass->element_class;
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25828>; else goto <D.25829>;
        <D.25828>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25606, spec);
        goto <D.25830>;
        <D.25829>:
        D.25628 = mono_defaults.stringbuilder_class;
        if (D.25628 == eklass) goto <D.25831>; else goto <D.25832>;
        <D.25831>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25606, spec);
        goto <D.25833>;
        <D.25832>:
        conv = 4294967295;
        <D.25833>:
        <D.25830>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.25834>; else goto <D.25835>;
        <D.25834>:
        esize = 8;
        goto <D.25836>;
        <D.25835>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25836>:
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25623);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        loc = mono_mb_add_local (mb, D.25623);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        dest_ptr.226 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.226);
        D.25838 = BIT_FIELD_REF <*eklass, 8, 256>;
        D.25839 = D.25838 & 32;
        if (D.25839 != 0) goto <D.25840>; else goto <D.25841>;
        <D.25840>:
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 32);
        mono_mb_emit_byte (mb, 88);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.20541>;
        <D.25841>:
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        index_var = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 22);
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.227);
        D.25843 = mono_mb_get_label (mb);
        label2 = (guint32) D.25843;
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.227);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25844>; else goto <D.25845>;
        <D.25844>:
        D.25846 = conv == 4294967295;
        D.25847 = (long int) D.25846;
        D.25848 = __builtin_expect (D.25847, 0);
        if (D.25848 != 0) goto <D.25849>; else goto <D.25850>;
        <D.25849>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8093, "conv != -1");
        <D.25850>:
        dest_ptr.226 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.226);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.227);
        mono_mb_emit_byte (mb, 154);
        D.25851 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25851);
        mono_mb_emit_byte (mb, 223);
        goto <D.25852>;
        <D.25845>:
        {
          char * msg;

          msg = monoeg_strdup ("Marshalling of non-string and non-blittable arrays to managed code is not implemented.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25852>:
        D.25853 = (short unsigned int) index_var;
        D.25854 = (int) D.25853;
        mono_mb_emit_add_to_local (mb, D.25854, 1);
        D.25855 = (short unsigned int) dest_ptr;
        D.25856 = (int) D.25855;
        mono_mb_emit_add_to_local (mb, D.25856, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.20541>;
      }
      <D.20601>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src;
        int dest;
        int esize;
        MonoMarshalConv conv;
        gboolean is_string;

        conv = 4294967295;
        is_string = 0;
        D.25615 = BIT_FIELD_REF <*t, 8, 88>;
        D.25616 = D.25615 & 64;
        D.25807 = D.25616 != 0;
        D.25808 = (long int) D.25807;
        D.25809 = __builtin_expect (D.25808, 0);
        if (D.25809 != 0) goto <D.25857>; else goto <D.25858>;
        <D.25857>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8130, "!t->byref");
        <D.25858>:
        eklass = klass->element_class;
        mono_marshal_load_type_info (eklass);
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25859>; else goto <D.25860>;
        <D.25859>:
        is_string = 1;
        D.25606 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25606, spec);
        goto <D.25861>;
        <D.25860>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8141);
        <D.25861>:
        if (is_string != 0) goto <D.25862>; else goto <D.25863>;
        <D.25862>:
        esize = 8;
        goto <D.25864>;
        <D.25863>:
        D.25643 = mono_defaults.char_class;
        if (D.25643 == eklass) goto <D.25865>; else goto <D.25866>;
        <D.25865>:
        D.25606 = m->piinfo;
        D.25868 = mono_pinvoke_is_unicode (D.25606);
        if (D.25868 != 0) goto <D.25869>; else goto <D.25870>;
        <D.25869>:
        iftmp.228 = 2;
        goto <D.25871>;
        <D.25870>:
        iftmp.228 = 1;
        <D.25871>:
        esize = iftmp.228;
        goto <D.25872>;
        <D.25866>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25872>:
        <D.25864>:
        D.25607 = mono_defaults.object_class;
        D.25608 = &D.25607->byval_arg;
        src = mono_mb_add_local (mb, D.25608);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        dest = mono_mb_add_local (mb, D.25623);
        src.229 = (unsigned int) src;
        mono_mb_emit_stloc (mb, src.229);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_stloc (mb, 3);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        label1 = mono_mb_emit_branch (mb, 57);
        mono_mb_emit_icon (mb, esize);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_byte (mb, 142);
        D.25624 = mono_defaults.string_class;
        if (D.25624 == eklass) goto <D.25874>; else goto <D.25875>;
        <D.25874>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25875>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_icall (mb, mono_marshal_alloc);
        dest.230 = (unsigned int) dest;
        mono_mb_emit_stloc (mb, dest.230);
        dest.230 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.230);
        mono_mb_emit_stloc (mb, 3);
        D.25622 = mono_defaults.int_class;
        D.25623 = &D.25622->byval_arg;
        index_var = mono_mb_add_local (mb, D.25623);
        mono_mb_emit_byte (mb, 22);
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.231);
        D.25878 = mono_mb_get_label (mb);
        label2 = (guint32) D.25878;
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.231);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25879>; else goto <D.25880>;
        <D.25879>:
        D.25881 = conv == 4294967295;
        D.25882 = (long int) D.25881;
        D.25883 = __builtin_expect (D.25882, 0);
        if (D.25883 != 0) goto <D.25884>; else goto <D.25885>;
        <D.25884>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8190, "conv != -1");
        <D.25885>:
        dest.230 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.230);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.231);
        mono_mb_emit_byte (mb, 154);
        D.25886 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25886);
        mono_mb_emit_byte (mb, 223);
        goto <D.25887>;
        <D.25880>:
        {
          char * msg;

          msg = monoeg_strdup ("Marshalling of non-string arrays to managed code is not implemented.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25747 = conv_arg;
          return D.25747;
        }
        <D.25887>:
        D.25888 = (short unsigned int) index_var;
        D.25889 = (int) D.25888;
        mono_mb_emit_add_to_local (mb, D.25889, 1);
        D.25890 = (short unsigned int) dest;
        D.25891 = (int) D.25890;
        mono_mb_emit_add_to_local (mb, D.25891, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        mono_mb_patch_branch (mb, label1);
        goto <D.20541>;
      }
      <D.20613>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8220);
      <D.20541>:
      D.25747 = conv_arg;
      return D.25747;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_need_free (struct MonoType * t, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  unsigned char D.25895;
  int D.25896;
  gboolean D.25897;
  struct MonoClass * D.25898;
  struct MonoClass * D.25899;
  _Bool D.25902;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;

  D.25895 = t->type;
  D.25896 = (int) D.25895;
  switch (D.25896) <default: <D.19356>, case 14: <D.19355>, case 17: <D.19351>, case 18: <D.19353>, case 28: <D.19352>>
  <D.19351>:
  D.25897 = 1;
  return D.25897;
  <D.19352>:
  <D.19353>:
  D.25898 = t->data.klass;
  D.25899 = mono_defaults.stringbuilder_class;
  if (D.25898 == D.25899) goto <D.25900>; else goto <D.25901>;
  <D.25900>:
  {
    gboolean need_free;

    try
      {
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
        D.25897 = need_free;
        return D.25897;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.25901>:
  D.25897 = 0;
  return D.25897;
  <D.19355>:
  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  D.25902 = encoding != 21;
  D.25897 = (gboolean) D.25902;
  return D.25897;
  <D.19356>:
  D.25897 = 0;
  return D.25897;
}


emit_struct_conv_full (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object, MonoMarshalNative string_encoding)
{
  struct MonoClass * D.25905;
  unsigned int D.25908;
  unsigned char D.25911;
  unsigned char D.25912;
  unsigned int msize.232;
  _Bool D.25916;
  long int D.25917;
  long int D.25918;
  struct MonoClass * D.25921;
  unsigned int D.25924;
  unsigned int D.25925;
  struct MonoType * D.25928;
  char * D.25929;
  struct MonoClassField * D.25930;
  unsigned int i.233;
  unsigned int D.25932;
  unsigned int D.25933;
  _Bool D.25934;
  short unsigned int D.25935;
  int D.25936;
  int D.25937;
  <unnamed-unsigned:1> D.25940;
  int D.25941;
  struct MonoMarshalSpec * D.25942;
  int D.25945;
  int D.25946;
  unsigned int D.25947;
  unsigned int D.25948;
  int D.25950;
  struct MonoClassField * D.25951;
  int D.25952;
  unsigned int D.25953;
  unsigned int D.25954;
  struct MonoType * D.25963;
  int D.25964;
  struct MonoType * D.25967;
  int D.25968;
  char * D.25969;
  <unnamed type> conv.234;
  unsigned char D.25973;
  unsigned char D.25974;
  unsigned char D.25976;
  _Bool D.25980;
  _Bool D.25981;
  _Bool D.25982;
  unsigned int D.25988;
  unsigned char D.25989;
  int D.25990;
  unsigned int D.25991;
  unsigned char D.25992;
  int D.25993;
  struct MonoClass * D.25994;
  unsigned char D.25995;
  unsigned char D.25996;
  struct MonoClass * D.25999;
  struct MonoType * D.26000;
  unsigned int src_var.235;
  unsigned int dst_var.236;
  struct MonoMethod * variant_clear.237;
  struct MonoClass * D.26008;
  struct MonoMethod * variant_clear.238;
  struct MonoMethod * get_object_for_native_variant.239;
  struct MonoClass * D.26013;
  struct MonoMethod * get_object_for_native_variant.240;
  struct MonoMethod * get_native_variant_for_object.241;
  struct MonoMethod * get_native_variant_for_object.242;
  int D.26020;
  unsigned int src_var.243;
  unsigned int dst_var.244;
  struct MonoMarshalType * info;
  int i;
  void handle_enum = <<< error >>>;

  D.25905 = klass->parent;
  if (D.25905 != 0B) goto <D.25906>; else goto <D.25907>;
  <D.25906>:
  D.25905 = klass->parent;
  emit_struct_conv (mb, D.25905, to_object);
  <D.25907>:
  info = mono_marshal_load_type_info (klass);
  D.25908 = info->native_size;
  if (D.25908 == 0) goto <D.25909>; else goto <D.25910>;
  <D.25909>:
  return;
  <D.25910>:
  D.25911 = BIT_FIELD_REF <*klass, 8, 256>;
  D.25912 = D.25911 & 32;
  if (D.25912 != 0) goto <D.25913>; else goto <D.25914>;
  <D.25913>:
  {
    int msize;

    msize = mono_class_value_size (klass, 0B);
    msize.232 = (unsigned int) msize;
    D.25908 = info->native_size;
    D.25916 = msize.232 != D.25908;
    D.25917 = (long int) D.25916;
    D.25918 = __builtin_expect (D.25917, 0);
    if (D.25918 != 0) goto <D.25919>; else goto <D.25920>;
    <D.25919>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1871, "msize == info->native_size");
    <D.25920>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_icon (mb, msize);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    mono_mb_emit_add_to_local (mb, 0, msize);
    mono_mb_emit_add_to_local (mb, 1, msize);
    return;
  }
  <D.25914>:
  D.25921 = mono_defaults.safehandle_class;
  if (D.25921 != klass) goto <D.25922>; else goto <D.25923>;
  <D.25922>:
  D.25924 = klass->flags;
  D.25925 = D.25924 & 24;
  if (D.25925 == 0) goto <D.25926>; else goto <D.25927>;
  <D.25926>:
  {
    char * msg;

    D.25928 = &klass->byval_arg;
    D.25929 = mono_type_full_name (D.25928);
    msg = monoeg_g_strdup_printf ("Type %s which is passed to unmanaged code must have a StructLayout attribute.", D.25929);
    mono_mb_emit_exception_marshal_directive (mb, msg);
    return;
  }
  <D.25927>:
  <D.25923>:
  i = 0;
  goto <D.19231>;
  <D.19230>:
  {
    MonoMarshalNative ntype;
    MonoMarshalConv conv;
    struct MonoType * ftype;
    int msize;
    int usize;
    gboolean last_field;

    try
      {
        D.25930 = info->fields[i].field;
        ftype = D.25930->type;
        msize = 0;
        usize = 0;
        i.233 = (unsigned int) i;
        D.25932 = info->num_fields;
        D.25933 = D.25932 + 4294967295;
        D.25934 = i.233 >= D.25933;
        last_field = (gboolean) D.25934;
        D.25935 = ftype->attrs;
        D.25936 = (int) D.25935;
        D.25937 = D.25936 & 16;
        if (D.25937 != 0) goto <D.25938>; else goto <D.25939>;
        <D.25938>:
        // predicted unlikely by continue predictor.
        goto <D.19199>;
        <D.25939>:
        D.25940 = klass->unicode;
        D.25941 = (int) D.25940;
        D.25942 = info->fields[i].mspec;
        ntype = mono_type_to_unmanaged (ftype, D.25942, 1, D.25941, &conv);
        if (last_field != 0) goto <D.25943>; else goto <D.25944>;
        <D.25943>:
        D.25945 = klass->instance_size;
        D.25930 = info->fields[i].field;
        D.25946 = D.25930->offset;
        msize = D.25945 - D.25946;
        D.25908 = info->native_size;
        D.25947 = info->fields[i].offset;
        D.25948 = D.25908 - D.25947;
        usize = (int) D.25948;
        goto <D.25949>;
        <D.25944>:
        D.25950 = i + 1;
        D.25951 = info->fields[D.25950].field;
        D.25952 = D.25951->offset;
        D.25930 = info->fields[i].field;
        D.25946 = D.25930->offset;
        msize = D.25952 - D.25946;
        D.25950 = i + 1;
        D.25953 = info->fields[D.25950].offset;
        D.25947 = info->fields[i].offset;
        D.25954 = D.25953 - D.25947;
        usize = (int) D.25954;
        <D.25949>:
        D.25921 = mono_defaults.safehandle_class;
        if (D.25921 != klass) goto <D.25955>; else goto <D.25956>;
        <D.25955>:
        D.25924 = klass->flags;
        D.25925 = D.25924 & 24;
        if (D.25925 == 16) goto <D.25957>; else goto <D.25958>;
        <D.25957>:
        if (usize == 0) goto <D.25959>; else goto <D.25960>;
        <D.25959>:
        D.25930 = info->fields[i].field;
        D.25963 = D.25930->type;
        D.25964 = mono_type_is_reference (D.25963);
        if (D.25964 != 0) goto <D.25961>; else goto <D.25965>;
        <D.25965>:
        if (last_field == 0) goto <D.25966>; else goto <D.25962>;
        <D.25966>:
        D.25950 = i + 1;
        D.25951 = info->fields[D.25950].field;
        D.25967 = D.25951->type;
        D.25968 = mono_type_is_reference (D.25967);
        if (D.25968 != 0) goto <D.25961>; else goto <D.25962>;
        <D.25961>:
        D.25928 = &klass->byval_arg;
        D.25969 = mono_type_full_name (D.25928);
        monoeg_g_log (0B, 4, "Type %s which has an [ExplicitLayout] attribute cannot have a reference field at the same offset as another field.", D.25969);
        <D.19200>:
        goto <D.19200>;
        <D.25962>:
        <D.25960>:
        <D.25958>:
        <D.25956>:
        conv.234 = conv;
        switch (conv.234) <default: <D.19227>, case 0: <D.19201>>
        <D.19201>:
        {
          int t;

          D.25973 = BIT_FIELD_REF <*ftype, 8, 88>;
          D.25974 = D.25973 & 64;
          if (D.25974 != 0) goto <D.25971>; else goto <D.25975>;
          <D.25975>:
          D.25976 = ftype->type;
          if (D.25976 == 24) goto <D.25971>; else goto <D.25977>;
          <D.25977>:
          D.25976 = ftype->type;
          if (D.25976 == 25) goto <D.25971>; else goto <D.25972>;
          <D.25971>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          mono_mb_emit_byte (mb, 77);
          mono_mb_emit_byte (mb, 223);
          goto <D.19203>;
          <D.25972>:
          handle_enum:
          D.25976 = ftype->type;
          t = (int) D.25976;
          switch (t) <default: <D.19226>, case 2: <D.19209>, case 3: <D.19212>, case 4: <D.19207>, case 5: <D.19208>, case 6: <D.19210>, case 7: <D.19211>, case 8: <D.19205>, case 9: <D.19206>, case 10: <D.19213>, case 11: <D.19214>, case 12: <D.19216>, case 13: <D.19217>, case 15: <D.19215>, case 17: <D.19219>, case 28: <D.19222>>
          <D.19205>:
          <D.19206>:
          <D.19207>:
          <D.19208>:
          <D.19209>:
          <D.19210>:
          <D.19211>:
          <D.19212>:
          <D.19213>:
          <D.19214>:
          <D.19215>:
          <D.19216>:
          <D.19217>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          D.25980 = t == 3;
          D.25981 = ntype == 4;
          D.25982 = D.25980 & D.25981;
          if (D.25982 != 0) goto <D.25983>; else goto <D.25978>;
          <D.25983>:
          if (string_encoding != 21) goto <D.25984>; else goto <D.25978>;
          <D.25984>:
          if (to_object != 0) goto <D.25985>; else goto <D.25986>;
          <D.25985>:
          mono_mb_emit_byte (mb, 71);
          mono_mb_emit_byte (mb, 83);
          goto <D.25987>;
          <D.25986>:
          mono_mb_emit_byte (mb, 73);
          mono_mb_emit_byte (mb, 82);
          <D.25987>:
          goto <D.25979>;
          <D.25978>:
          D.25988 = mono_type_to_ldind (ftype);
          D.25989 = (unsigned char) D.25988;
          D.25990 = (int) D.25989;
          mono_mb_emit_byte (mb, D.25990);
          D.25991 = mono_type_to_stind (ftype);
          D.25992 = (unsigned char) D.25991;
          D.25993 = (int) D.25992;
          mono_mb_emit_byte (mb, D.25993);
          <D.25979>:
          goto <D.19218>;
          <D.19219>:
          {
            int src_var;
            int dst_var;

            D.25994 = ftype->data.klass;
            D.25995 = BIT_FIELD_REF <*D.25994, 8, 256>;
            D.25996 = D.25995 & 16;
            if (D.25996 != 0) goto <D.25997>; else goto <D.25998>;
            <D.25997>:
            D.25994 = ftype->data.klass;
            ftype = mono_class_enum_basetype (D.25994);
            goto handle_enum;
            <D.25998>:
            D.25999 = mono_defaults.int_class;
            D.26000 = &D.25999->byval_arg;
            src_var = mono_mb_add_local (mb, D.26000);
            D.25999 = mono_defaults.int_class;
            D.26000 = &D.25999->byval_arg;
            dst_var = mono_mb_add_local (mb, D.26000);
            mono_mb_emit_ldloc (mb, 0);
            src_var.235 = (unsigned int) src_var;
            mono_mb_emit_stloc (mb, src_var.235);
            mono_mb_emit_ldloc (mb, 1);
            dst_var.236 = (unsigned int) dst_var;
            mono_mb_emit_stloc (mb, dst_var.236);
            D.25994 = ftype->data.klass;
            emit_struct_conv (mb, D.25994, to_object);
            src_var.235 = (unsigned int) src_var;
            mono_mb_emit_ldloc (mb, src_var.235);
            mono_mb_emit_stloc (mb, 0);
            dst_var.236 = (unsigned int) dst_var;
            mono_mb_emit_ldloc (mb, dst_var.236);
            mono_mb_emit_stloc (mb, 1);
            goto <D.19218>;
          }
          <D.19222>:
          if (to_object != 0) goto <D.26003>; else goto <D.26004>;
          <D.26003>:
          {
            static struct MonoMethod * variant_clear = 0B;
            static struct MonoMethod * get_object_for_native_variant = 0B;

            variant_clear.237 = variant_clear;
            if (variant_clear.237 == 0B) goto <D.26006>; else goto <D.26007>;
            <D.26006>:
            D.26008 = mono_class_get_variant_class ();
            variant_clear.238 = mono_class_get_method_from_name (D.26008, "Clear", 0);
            variant_clear = variant_clear.238;
            <D.26007>:
            get_object_for_native_variant.239 = get_object_for_native_variant;
            if (get_object_for_native_variant.239 == 0B) goto <D.26011>; else goto <D.26012>;
            <D.26011>:
            D.26013 = mono_defaults.marshal_class;
            get_object_for_native_variant.240 = mono_class_get_method_from_name (D.26013, "GetObjectForNativeVariant", 1);
            get_object_for_native_variant = get_object_for_native_variant.240;
            <D.26012>:
            mono_mb_emit_ldloc (mb, 1);
            mono_mb_emit_ldloc (mb, 0);
            get_object_for_native_variant.239 = get_object_for_native_variant;
            mono_mb_emit_managed_call (mb, get_object_for_native_variant.239, 0B);
            mono_mb_emit_byte (mb, 81);
            mono_mb_emit_ldloc (mb, 0);
            variant_clear.237 = variant_clear;
            mono_mb_emit_managed_call (mb, variant_clear.237, 0B);
          }
          goto <D.26015>;
          <D.26004>:
          {
            static struct MonoMethod * get_native_variant_for_object = 0B;

            get_native_variant_for_object.241 = get_native_variant_for_object;
            if (get_native_variant_for_object.241 == 0B) goto <D.26017>; else goto <D.26018>;
            <D.26017>:
            D.26013 = mono_defaults.marshal_class;
            get_native_variant_for_object.242 = mono_class_get_method_from_name (D.26013, "GetNativeVariantForObject", 2);
            get_native_variant_for_object = get_native_variant_for_object.242;
            <D.26018>:
            mono_mb_emit_ldloc (mb, 0);
            mono_mb_emit_byte (mb, 80);
            mono_mb_emit_ldloc (mb, 1);
            get_native_variant_for_object.241 = get_native_variant_for_object;
            mono_mb_emit_managed_call (mb, get_native_variant_for_object.241, 0B);
          }
          <D.26015>:
          goto <D.19218>;
          <D.19226>:
          D.25976 = ftype->type;
          D.26020 = (int) D.25976;
          monoeg_g_log (0B, 16, "marshaling type %02x not implemented", D.26020);
          monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2038);
          <D.19218>:
          goto <D.19203>;
        }
        <D.19227>:
        {
          int src_var;
          int dst_var;

          D.25999 = mono_defaults.int_class;
          D.26000 = &D.25999->byval_arg;
          src_var = mono_mb_add_local (mb, D.26000);
          D.25999 = mono_defaults.int_class;
          D.26000 = &D.25999->byval_arg;
          dst_var = mono_mb_add_local (mb, D.26000);
          mono_mb_emit_ldloc (mb, 0);
          src_var.243 = (unsigned int) src_var;
          mono_mb_emit_stloc (mb, src_var.243);
          mono_mb_emit_ldloc (mb, 1);
          dst_var.244 = (unsigned int) dst_var;
          mono_mb_emit_stloc (mb, dst_var.244);
          if (to_object != 0) goto <D.26023>; else goto <D.26024>;
          <D.26023>:
          D.25942 = info->fields[i].mspec;
          conv.234 = conv;
          emit_ptr_to_object_conv (mb, ftype, conv.234, D.25942);
          goto <D.26025>;
          <D.26024>:
          D.25942 = info->fields[i].mspec;
          conv.234 = conv;
          emit_object_to_ptr_conv (mb, ftype, conv.234, D.25942);
          <D.26025>:
          src_var.243 = (unsigned int) src_var;
          mono_mb_emit_ldloc (mb, src_var.243);
          mono_mb_emit_stloc (mb, 0);
          dst_var.244 = (unsigned int) dst_var;
          mono_mb_emit_ldloc (mb, dst_var.244);
          mono_mb_emit_stloc (mb, 1);
        }
        <D.19203>:
        if (to_object != 0) goto <D.26026>; else goto <D.26027>;
        <D.26026>:
        mono_mb_emit_add_to_local (mb, 0, usize);
        mono_mb_emit_add_to_local (mb, 1, msize);
        goto <D.26028>;
        <D.26027>:
        mono_mb_emit_add_to_local (mb, 0, msize);
        mono_mb_emit_add_to_local (mb, 1, usize);
        <D.26028>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.19199>:
  i = i + 1;
  <D.19231>:
  i.233 = (unsigned int) i;
  D.25932 = info->num_fields;
  if (i.233 < D.25932) goto <D.19230>; else goto <D.19232>;
  <D.19232>:
}


emit_struct_conv (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object)
{
  emit_struct_conv_full (mb, klass, to_object, 4294967295);
}


emit_ptr_to_object_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned char D.26032;
  int D.26036;
  unsigned char D.26037;
  unsigned char D.26038;
  int D.26041;
  struct MonoClass * D.26043;
  struct MonoType * D.26044;
  struct MonoClass * D.26045;
  struct MonoType * D.26046;
  unsigned int array_var.245;
  unsigned int src_var.246;
  unsigned int dst_var.247;
  unsigned int index_var.248;
  int D.26051;
  short unsigned int D.26052;
  int D.26053;
  <unnamed type> D.26057;
  unsigned int src_var.249;
  unsigned int dst_var.250;
  struct MonoClass * D.26062;
  const char * D.26063;

  switch (conv) <default: <D.19108>, case 1: <D.19074>, case 2: <D.19072>, case 3: <D.19104>, case 4: <D.19089>, case 7: <D.19090>, case 9: <D.19088>, case 10: <D.19105>, case 11: <D.19106>, case 12: <D.19086>, case 13: <D.19087>, case 20: <D.19075>, case 21: <D.19084>, case 22: <D.19107>, case 23: <D.19097>, case 25: <D.19099>, case 26: <D.19101>, case 27: <D.19100>, case 28: <D.19091>, case 29: <D.19095>, case 33: <D.19102>, case 34: <D.19103>>
  <D.19072>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 44);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 43);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 82);
  goto <D.19073>;
  <D.19074>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 72);
  mono_mb_emit_byte (mb, 44);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 43);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 82);
  goto <D.19073>;
  <D.19075>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.26032 = type->type;
    if (D.26032 == 29) goto <D.26033>; else goto <D.26034>;
    <D.26033>:
    eklass = type->data.klass;
    goto <D.26035>;
    <D.26034>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1279);
    <D.26035>:
    esize = mono_class_native_size (eklass, 0B);
    mono_mb_emit_ldloc (mb, 1);
    D.26036 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26036);
    mono_mb_emit_op (mb, 141, eklass);
    mono_mb_emit_byte (mb, 223);
    D.26037 = BIT_FIELD_REF <*eklass, 8, 256>;
    D.26038 = D.26037 & 32;
    if (D.26038 != 0) goto <D.26039>; else goto <D.26040>;
    <D.26039>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 32);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_ldloc (mb, 0);
    D.26036 = mspec->data.array_data.num_elem;
    D.26041 = D.26036 * esize;
    mono_mb_emit_icon (mb, D.26041);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.26042>;
    <D.26040>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.26043 = mono_defaults.object_class;
      D.26044 = &D.26043->byval_arg;
      array_var = mono_mb_add_local (mb, D.26044);
      D.26045 = mono_defaults.int_class;
      D.26046 = &D.26045->byval_arg;
      src_var = mono_mb_add_local (mb, D.26046);
      D.26045 = mono_defaults.int_class;
      D.26046 = &D.26045->byval_arg;
      dst_var = mono_mb_add_local (mb, D.26046);
      mono_mb_emit_ldloc (mb, 1);
      mono_mb_emit_byte (mb, 80);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.245);
      mono_mb_emit_ldloc (mb, 0);
      src_var.246 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.246);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.247 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.247);
      D.26045 = mono_defaults.int_class;
      D.26046 = &D.26045->byval_arg;
      index_var = mono_mb_add_local (mb, D.26046);
      mono_mb_emit_byte (mb, 22);
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.248);
      D.26051 = mono_mb_get_label (mb);
      label2 = (guint32) D.26051;
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.248);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.245);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.245);
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.248);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 1);
      emit_struct_conv (mb, eklass, 1);
      D.26052 = (short unsigned int) index_var;
      D.26053 = (int) D.26052;
      mono_mb_emit_add_to_local (mb, D.26053, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.246 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.246);
      mono_mb_emit_stloc (mb, 0);
      dst_var.247 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.247);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.26042>:
    goto <D.19073>;
  }
  <D.19084>:
  {
    struct MonoClass * eclass;

    eclass = mono_defaults.char_class;
    mono_mb_emit_ldloc (mb, 1);
    D.26036 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26036);
    mono_mb_emit_op (mb, 141, eclass);
    mono_mb_emit_byte (mb, 81);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 80);
    mono_mb_emit_ldloc (mb, 0);
    D.26036 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26036);
    mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
    goto <D.19073>;
  }
  <D.19086>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_new_wrapper);
  mono_mb_emit_byte (mb, 81);
  goto <D.19073>;
  <D.19087>:
  if (mspec != 0B) goto <D.26056>; else goto <D.26054>;
  <D.26056>:
  D.26057 = mspec->native;
  if (D.26057 == 23) goto <D.26058>; else goto <D.26054>;
  <D.26058>:
  D.26036 = mspec->data.array_data.num_elem;
  if (D.26036 != 0) goto <D.26059>; else goto <D.26054>;
  <D.26059>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  D.26036 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26036);
  mono_mb_emit_icall (mb, mono_string_from_byvalwstr);
  goto <D.26055>;
  <D.26054>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  <D.26055>:
  mono_mb_emit_byte (mb, 81);
  goto <D.19073>;
  <D.19088>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icall (mb, mono_string_new_wrapper);
  mono_mb_emit_byte (mb, 81);
  goto <D.19073>;
  <D.19089>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icall (mb, mono_string_new_wrapper);
  mono_mb_emit_byte (mb, 81);
  goto <D.19073>;
  <D.19090>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  mono_mb_emit_byte (mb, 81);
  goto <D.19073>;
  <D.19091>:
  {
    struct MonoClass * klass;
    int src_var;
    int dst_var;

    klass = mono_class_from_mono_type (type);
    D.26045 = mono_defaults.int_class;
    D.26046 = &D.26045->byval_arg;
    src_var = mono_mb_add_local (mb, D.26046);
    D.26045 = mono_defaults.int_class;
    D.26046 = &D.26045->byval_arg;
    dst_var = mono_mb_add_local (mb, D.26046);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 240);
    mono_mb_emit_op (mb, 4, klass);
    mono_mb_emit_byte (mb, 81);
    mono_mb_emit_ldloc (mb, 0);
    src_var.249 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.249);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.250 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.250);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 1);
    emit_struct_conv (mb, klass, 1);
    src_var.249 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.249);
    mono_mb_emit_stloc (mb, 0);
    dst_var.250 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.250);
    mono_mb_emit_stloc (mb, 1);
    goto <D.19073>;
  }
  <D.19095>:
  {
    struct MonoClass * klass;

    klass = mono_class_from_mono_type (type);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 240);
    mono_mb_emit_op (mb, 11, klass);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icall (mb, mono_ftnptr_to_delegate);
    mono_mb_emit_byte (mb, 81);
    goto <D.19073>;
  }
  <D.19097>:
  D.26062 = mono_class_from_mono_type (type);
  D.26063 = D.26062->name;
  monoeg_g_log (0B, 4, "Structure field of type %s can\'t be marshalled as LPArray", D.26063);
  <D.19098>:
  goto <D.19098>;
  <D.19099>:
  <D.19100>:
  <D.19101>:
  mono_cominterop_emit_ptr_to_object_conv (mb, type, conv, mspec);
  goto <D.19073>;
  <D.19102>:
  goto <D.19073>;
  <D.19103>:
  goto <D.19073>;
  <D.19104>:
  <D.19105>:
  <D.19106>:
  <D.19107>:
  <D.19108>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("marshaling conversion %d not implemented", conv);
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.19073>;
  }
  <D.19073>:
}


emit_object_to_ptr_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned int D.26065;
  unsigned int pos.251;
  void * D.26067;
  void * D.26068;
  _Bool D.26069;
  long int D.26070;
  long int D.26071;
  int D.26074;
  void * D.26075;
  unsigned char D.26076;
  unsigned char D.26080;
  unsigned char D.26081;
  unsigned int D.26085;
  unsigned char D.26086;
  int D.26089;
  struct MonoClass * D.26091;
  struct MonoType * D.26092;
  struct MonoClass * D.26093;
  struct MonoType * D.26094;
  unsigned int array_var.252;
  unsigned int src_var.253;
  unsigned int dst_var.254;
  unsigned int index_var.255;
  int D.26099;
  short unsigned int D.26100;
  int D.26101;
  unsigned int pos.256;
  unsigned int D.26103;
  unsigned int D.26104;
  unsigned int src_var.257;
  unsigned int dst_var.258;
  struct MonoClass * D.26107;
  struct MonoClass * D.26108;
  struct MonoType * D.26109;
  unsigned int D.26110;
  unsigned int pos.259;
  int pos;

  switch (conv) <default: <D.19180>, case 1: <D.19147>, case 2: <D.19145>, case 3: <D.19151>, case 4: <D.19149>, case 7: <D.19148>, case 9: <D.19150>, case 10: <D.19152>, case 11: <D.19153>, case 12: <D.19158>, case 13: <D.19159>, case 20: <D.19160>, case 21: <D.19169>, case 22: <D.19155>, case 23: <D.19156>, case 25: <D.19173>, case 26: <D.19174>, case 27: <D.19175>, case 28: <D.19170>, case 29: <D.19157>, case 33: <D.19176>, case 34: <D.19179>>
  <D.19145>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 71);
  mono_mb_emit_byte (mb, 84);
  goto <D.19146>;
  <D.19147>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 71);
  mono_mb_emit_byte (mb, 101);
  mono_mb_emit_byte (mb, 83);
  goto <D.19146>;
  <D.19148>:
  <D.19149>:
  <D.19150>:
  <D.19151>:
  <D.19152>:
  <D.19153>:
  {
    int pos;

    mono_mb_emit_ldloc (mb, 2);
    D.26065 = mono_mb_emit_short_branch (mb, 44);
    pos = (int) D.26065;
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icall (mb, monoeg_g_free);
    pos.251 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.251);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.26067 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.26067);
    mono_mb_emit_byte (mb, 223);
    goto <D.19146>;
  }
  <D.19155>:
  <D.19156>:
  <D.19157>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26068 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.26068);
  mono_mb_emit_byte (mb, 223);
  goto <D.19146>;
  <D.19158>:
  <D.19159>:
  D.26069 = mspec == 0B;
  D.26070 = (long int) D.26069;
  D.26071 = __builtin_expect (D.26070, 0);
  if (D.26071 != 0) goto <D.26072>; else goto <D.26073>;
  <D.26072>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1641, "mspec");
  <D.26073>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26074 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26074);
  D.26075 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.26075);
  goto <D.19146>;
  <D.19160>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.26076 = type->type;
    if (D.26076 == 29) goto <D.26077>; else goto <D.26078>;
    <D.26077>:
    eklass = type->data.klass;
    goto <D.26079>;
    <D.26078>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1657);
    <D.26079>:
    D.26080 = BIT_FIELD_REF <*eklass, 8, 256>;
    D.26081 = D.26080 & 8;
    if (D.26081 != 0) goto <D.26082>; else goto <D.26083>;
    <D.26082>:
    esize = mono_class_native_size (eklass, 0B);
    goto <D.26084>;
    <D.26083>:
    esize = 8;
    <D.26084>:
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.26085 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26085;
    D.26080 = BIT_FIELD_REF <*eklass, 8, 256>;
    D.26086 = D.26080 & 32;
    if (D.26086 != 0) goto <D.26087>; else goto <D.26088>;
    <D.26087>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    mono_mb_emit_ldflda (mb, 32);
    D.26074 = mspec->data.array_data.num_elem;
    D.26089 = D.26074 * esize;
    mono_mb_emit_icon (mb, D.26089);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.26090>;
    <D.26088>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.26091 = mono_defaults.object_class;
      D.26092 = &D.26091->byval_arg;
      array_var = mono_mb_add_local (mb, D.26092);
      D.26093 = mono_defaults.int_class;
      D.26094 = &D.26093->byval_arg;
      src_var = mono_mb_add_local (mb, D.26094);
      D.26093 = mono_defaults.int_class;
      D.26094 = &D.26093->byval_arg;
      dst_var = mono_mb_add_local (mb, D.26094);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 80);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.252);
      mono_mb_emit_ldloc (mb, 0);
      src_var.253 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.253);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.254 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.254);
      D.26093 = mono_defaults.int_class;
      D.26094 = &D.26093->byval_arg;
      index_var = mono_mb_add_local (mb, D.26094);
      mono_mb_emit_byte (mb, 22);
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.255);
      D.26099 = mono_mb_get_label (mb);
      label2 = (guint32) D.26099;
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.255);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.252);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.252);
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.255);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 0);
      emit_struct_conv (mb, eklass, 0);
      D.26100 = (short unsigned int) index_var;
      D.26101 = (int) D.26100;
      mono_mb_emit_add_to_local (mb, D.26101, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.253 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.253);
      mono_mb_emit_stloc (mb, 0);
      dst_var.254 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.254);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.26090>:
    pos.256 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.256);
    goto <D.19146>;
  }
  <D.19169>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26103 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.26103;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26074 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26074);
  mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
  pos.256 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.256);
  goto <D.19146>;
  <D.19170>:
  {
    int src_var;
    int dst_var;

    D.26093 = mono_defaults.int_class;
    D.26094 = &D.26093->byval_arg;
    src_var = mono_mb_add_local (mb, D.26094);
    D.26093 = mono_defaults.int_class;
    D.26094 = &D.26093->byval_arg;
    dst_var = mono_mb_add_local (mb, D.26094);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.26104 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26104;
    mono_mb_emit_ldloc (mb, 0);
    src_var.257 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.257);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.258 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.258);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 0);
    D.26107 = mono_class_from_mono_type (type);
    emit_struct_conv (mb, D.26107, 0);
    src_var.257 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.257);
    mono_mb_emit_stloc (mb, 0);
    dst_var.258 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.258);
    mono_mb_emit_stloc (mb, 1);
    pos.256 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.256);
    goto <D.19146>;
  }
  <D.19173>:
  <D.19174>:
  <D.19175>:
  mono_cominterop_emit_object_to_ptr_conv (mb, type, conv, mspec);
  goto <D.19146>;
  <D.19176>:
  {
    int dar_release_slot;
    int pos;

    D.26108 = mono_defaults.boolean_class;
    D.26109 = &D.26108->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.26109);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.26110 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.26110;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.259 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.259);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_ldflda (mb, 16);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_byte (mb, 223);
    goto <D.19146>;
  }
  <D.19179>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 223);
  goto <D.19146>;
  <D.19180>:
  {
    char * msg;
    struct MonoException * exc;

    msg = monoeg_g_strdup_printf ("marshalling conversion %d not implemented", conv);
    exc = mono_get_exception_not_implemented (msg);
    monoeg_g_log (0B, 16, "%s", msg);
    monoeg_g_free (msg);
    mono_raise_exception (exc);
  }
  <D.19146>:
}


emit_struct_free (struct MonoMethodBuilder * mb, struct MonoClass * klass, int struct_var)
{
  unsigned int struct_var.260;

  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  struct_var.260 = (unsigned int) struct_var;
  mono_mb_emit_ldloc (mb, struct_var.260);
  mono_mb_emit_icall (mb, mono_struct_delete_old);
}


mono_marshal_get_ptr_to_stringbuilder_conv (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec, gboolean * need_free)
{
  MonoMarshalConv D.26113;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.19343>, case 20: <D.19341>, case 21: <D.19340>, case 22: <D.19342>>
  <D.19340>:
  *need_free = 0;
  D.26113 = 19;
  return D.26113;
  <D.19341>:
  D.26113 = 17;
  return D.26113;
  <D.19342>:
  D.26113 = 18;
  return D.26113;
  <D.19343>:
  D.26113 = 4294967295;
  return D.26113;
}


mono_marshal_get_stringbuilder_to_ptr_conv (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  MonoMarshalConv D.26115;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.19321>, case 20: <D.19319>, case 21: <D.19318>, case 22: <D.19320>>
  <D.19318>:
  D.26115 = 16;
  return D.26115;
  <D.19319>:
  D.26115 = 14;
  return D.26115;
  <D.19320>:
  D.26115 = 15;
  return D.26115;
  <D.19321>:
  D.26115 = 4294967295;
  return D.26115;
}


mono_pinvoke_is_unicode (struct MonoMethodPInvoke * piinfo)
{
  short unsigned int D.26117;
  int D.26118;
  int D.26119;
  gboolean D.26120;

  D.26117 = piinfo->piflags;
  D.26118 = (int) D.26117;
  D.26119 = D.26118 & 6;
  switch (D.26119) <default: <D.20514>, case 2: <D.20511>, case 4: <D.20512>, case 6: <D.20513>>
  <D.20511>:
  D.26120 = 0;
  return D.26120;
  <D.20512>:
  D.26120 = 1;
  return D.26120;
  <D.20513>:
  <D.20514>:
  D.26120 = 0;
  return D.26120;
}


emit_marshal_boolean (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  unsigned char D.26122;
  unsigned char D.26123;
  struct MonoClass * D.26126;
  struct MonoType * D.26127;
  unsigned int argnum.261;
  unsigned int D.26132;
  unsigned char ldc_op.262;
  int D.26134;
  unsigned int conv_arg.263;
  unsigned int label_false.264;
  unsigned int D.26138;
  unsigned int D.26139;
  unsigned int label_false.265;
  unsigned int label_end.266;
  struct MonoClass * D.26148;
  struct MonoType * D.26149;
  struct MonoType * D.26152;
  struct MonoType * D.26154;
  unsigned int D.26157;
  unsigned char ldop.267;
  int D.26159;
  unsigned int D.26161;
  unsigned int label_false.268;
  unsigned int label_null.269;
  <unnamed type> D.26169;
  unsigned int D.26170;
  unsigned int D.26171;
  int D.26172;
  unsigned int D.26173;
  unsigned int label_false.270;
  unsigned int label_end.271;
  int D.26176;
  unsigned int label_null.272;
  int D.26178;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20670>, case 0: <D.20644>, case 1: <D.20652>, case 2: <D.20649>, case 3: <D.20653>, case 4: <D.20654>, case 5: <D.20659>>
  <D.20644>:
  {
    struct MonoType * local_type;
    int label_false;
    guint8 ldc_op;

    try
      {
        ldc_op = 23;
        local_type = marshal_boolean_conv_in_get_local_type (spec, &ldc_op);
        D.26122 = BIT_FIELD_REF <*t, 8, 88>;
        D.26123 = D.26122 & 64;
        if (D.26123 != 0) goto <D.26124>; else goto <D.26125>;
        <D.26124>:
        D.26126 = mono_defaults.int_class;
        D.26127 = &D.26126->byval_arg;
        *conv_arg_type = D.26127;
        goto <D.26128>;
        <D.26125>:
        *conv_arg_type = local_type;
        <D.26128>:
        conv_arg = mono_mb_add_local (mb, local_type);
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        D.26122 = BIT_FIELD_REF <*t, 8, 88>;
        D.26123 = D.26122 & 64;
        if (D.26123 != 0) goto <D.26130>; else goto <D.26131>;
        <D.26130>:
        mono_mb_emit_byte (mb, 70);
        <D.26131>:
        D.26132 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.26132;
        ldc_op.262 = ldc_op;
        D.26134 = (int) ldc_op.262;
        mono_mb_emit_byte (mb, D.26134);
        conv_arg.263 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.263);
        label_false.264 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.264);
        goto <D.20648>;
      }
    finally
      {
        ldc_op = {CLOBBER};
      }
  }
  <D.20649>:
  {
    int label_false;
    int label_end;

    D.26122 = BIT_FIELD_REF <*t, 8, 88>;
    D.26123 = D.26122 & 64;
    if (D.26123 == 0) goto <D.20648>; else goto <D.26137>;
    <D.26137>:
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    conv_arg.263 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.263);
    D.26138 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.26138;
    mono_mb_emit_byte (mb, 23);
    D.26139 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.26139;
    label_false.265 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.265);
    mono_mb_emit_byte (mb, 22);
    label_end.266 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.266);
    mono_mb_emit_byte (mb, 82);
    goto <D.20648>;
  }
  <D.20652>:
  D.26122 = BIT_FIELD_REF <*t, 8, 88>;
  D.26123 = D.26122 & 64;
  if (D.26123 != 0) goto <D.26142>; else goto <D.26143>;
  <D.26142>:
  conv_arg.263 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.263);
  goto <D.26144>;
  <D.26143>:
  if (conv_arg != 0) goto <D.26145>; else goto <D.26146>;
  <D.26145>:
  conv_arg.263 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.263);
  goto <D.26147>;
  <D.26146>:
  argnum.261 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.261);
  <D.26147>:
  <D.26144>:
  goto <D.20648>;
  <D.20653>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20648>;
  <D.20654>:
  {
    struct MonoClass * conv_arg_class;
    guint8 ldop;
    int label_null;
    int label_false;

    try
      {
        conv_arg_class = mono_defaults.int32_class;
        ldop = 74;
        conv_arg_class = marshal_boolean_managed_conv_in_get_conv_arg_class (spec, &ldop);
        D.26148 = mono_defaults.boolean_class;
        D.26149 = &D.26148->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.26149);
        D.26122 = BIT_FIELD_REF <*t, 8, 88>;
        D.26123 = D.26122 & 64;
        if (D.26123 != 0) goto <D.26150>; else goto <D.26151>;
        <D.26150>:
        D.26152 = &conv_arg_class->this_arg;
        *conv_arg_type = D.26152;
        goto <D.26153>;
        <D.26151>:
        D.26154 = &conv_arg_class->byval_arg;
        *conv_arg_type = D.26154;
        <D.26153>:
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        D.26122 = BIT_FIELD_REF <*t, 8, 88>;
        D.26123 = D.26122 & 64;
        if (D.26123 != 0) goto <D.26155>; else goto <D.26156>;
        <D.26155>:
        D.26157 = mono_mb_emit_branch (mb, 57);
        label_null = (int) D.26157;
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        ldop.267 = ldop;
        D.26159 = (int) ldop.267;
        mono_mb_emit_byte (mb, D.26159);
        goto <D.26160>;
        <D.26156>:
        label_null = 0;
        <D.26160>:
        D.26161 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.26161;
        mono_mb_emit_byte (mb, 23);
        conv_arg.263 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.263);
        label_false.268 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.268);
        D.26122 = BIT_FIELD_REF <*t, 8, 88>;
        D.26123 = D.26122 & 64;
        if (D.26123 != 0) goto <D.26163>; else goto <D.26164>;
        <D.26163>:
        label_null.269 = (unsigned int) label_null;
        mono_mb_patch_branch (mb, label_null.269);
        <D.26164>:
        goto <D.20648>;
      }
    finally
      {
        ldop = {CLOBBER};
      }
  }
  <D.20659>:
  {
    guint8 stop;
    guint8 ldc_op;
    int label_null;
    int label_false;
    int label_end;

    stop = 84;
    ldc_op = 23;
    D.26122 = BIT_FIELD_REF <*t, 8, 88>;
    D.26123 = D.26122 & 64;
    if (D.26123 == 0) goto <D.20648>; else goto <D.26166>;
    <D.26166>:
    if (spec != 0B) goto <D.26167>; else goto <D.26168>;
    <D.26167>:
    D.26169 = spec->native;
    switch (D.26169) <default: <D.20669>, case 3: <D.20665>, case 4: <D.20666>, case 37: <D.20668>>
    <D.20665>:
    <D.20666>:
    stop = 82;
    goto <D.20667>;
    <D.20668>:
    stop = 83;
    ldc_op = 21;
    goto <D.20667>;
    <D.20669>:
    goto <D.20667>;
    <D.20667>:
    <D.26168>:
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    D.26170 = mono_mb_emit_branch (mb, 57);
    label_null = (int) D.26170;
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    conv_arg.263 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.263);
    D.26171 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.26171;
    D.26172 = (int) ldc_op;
    mono_mb_emit_byte (mb, D.26172);
    D.26173 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.26173;
    label_false.270 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.270);
    mono_mb_emit_byte (mb, 22);
    label_end.271 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.271);
    D.26176 = (int) stop;
    mono_mb_emit_byte (mb, D.26176);
    label_null.272 = (unsigned int) label_null;
    mono_mb_patch_branch (mb, label_null.272);
    goto <D.20648>;
  }
  <D.20670>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8436);
  <D.20648>:
  D.26178 = conv_arg;
  return D.26178;
}


marshal_boolean_conv_in_get_local_type (struct MonoMarshalSpec * spec, guint8 * ldc_op)
{
  struct MonoType * D.26185;
  struct MonoClass * D.26186;
  <unnamed type> D.26187;
  struct MonoClass * D.26188;
  struct MonoClass * D.26191;

  if (spec == 0B) goto <D.26183>; else goto <D.26184>;
  <D.26183>:
  D.26186 = mono_defaults.int32_class;
  D.26185 = &D.26186->byval_arg;
  return D.26185;
  <D.26184>:
  D.26187 = spec->native;
  switch (D.26187) <default: <D.20622>, case 2: <D.20621>, case 3: <D.20618>, case 4: <D.20619>, case 37: <D.20620>>
  <D.20618>:
  <D.20619>:
  D.26188 = mono_defaults.byte_class;
  D.26185 = &D.26188->byval_arg;
  return D.26185;
  <D.20620>:
  if (ldc_op != 0B) goto <D.26189>; else goto <D.26190>;
  <D.26189>:
  *ldc_op = 21;
  <D.26190>:
  D.26191 = mono_defaults.int16_class;
  D.26185 = &D.26191->byval_arg;
  return D.26185;
  <D.20621>:
  D.26186 = mono_defaults.int32_class;
  D.26185 = &D.26186->byval_arg;
  return D.26185;
  <D.20622>:
  D.26187 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.26187);
  D.26186 = mono_defaults.int32_class;
  D.26185 = &D.26186->byval_arg;
  return D.26185;
}


marshal_boolean_managed_conv_in_get_conv_arg_class (struct MonoMarshalSpec * spec, guint8 * ldop)
{
  <unnamed type> D.26195;
  struct MonoClass * D.26200;
  struct MonoClass * conv_arg_class;

  conv_arg_class = mono_defaults.int32_class;
  if (spec != 0B) goto <D.26193>; else goto <D.26194>;
  <D.26193>:
  D.26195 = spec->native;
  switch (D.26195) <default: <D.20633>, case 2: <D.20632>, case 3: <D.20628>, case 4: <D.20629>, case 37: <D.20631>>
  <D.20628>:
  <D.20629>:
  conv_arg_class = mono_defaults.byte_class;
  if (ldop != 0B) goto <D.26196>; else goto <D.26197>;
  <D.26196>:
  *ldop = 70;
  <D.26197>:
  goto <D.20630>;
  <D.20631>:
  conv_arg_class = mono_defaults.int16_class;
  if (ldop != 0B) goto <D.26198>; else goto <D.26199>;
  <D.26198>:
  *ldop = 72;
  <D.26199>:
  goto <D.20630>;
  <D.20632>:
  goto <D.20630>;
  <D.20633>:
  D.26195 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.26195);
  <D.20630>:
  <D.26194>:
  D.26200 = conv_arg_class;
  return D.26200;
}


emit_marshal_ptr (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  unsigned int argnum.273;
  int D.26204;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20685>, case 0: <D.20681>, case 1: <D.20683>, case 3: <D.20684>>
  <D.20681>:
  goto <D.20682>;
  <D.20683>:
  argnum.273 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.273);
  goto <D.20682>;
  <D.20684>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20682>;
  <D.20685>:
  goto <D.20682>;
  <D.20682>:
  D.26204 = conv_arg;
  return D.26204;
}


emit_marshal_char (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  unsigned int argnum.274;
  int D.26208;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20699>, case 1: <D.20696>, case 3: <D.20698>>
  <D.20696>:
  argnum.274 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.274);
  goto <D.20697>;
  <D.20698>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20697>;
  <D.20699>:
  goto <D.20697>;
  <D.20697>:
  D.26208 = conv_arg;
  return D.26208;
}


emit_marshal_scalar (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  unsigned int argnum.275;
  int D.26212;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20713>, case 1: <D.20710>, case 3: <D.20712>>
  <D.20710>:
  argnum.275 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.275);
  goto <D.20711>;
  <D.20712>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20711>;
  <D.20713>:
  goto <D.20711>;
  <D.20711>:
  D.26212 = conv_arg;
  return D.26212;
}


emit_marshal_vtype (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * date_time_class.278;
  struct MonoClass * tmp_klass.276;
  struct MonoImage * D.26220;
  struct MonoClass * tmp_klass.277;
  _Bool D.26222;
  long int D.26223;
  long int D.26224;
  struct MonoMethod * to_oadate.279;
  struct MonoMethod * to_oadate.280;
  _Bool D.26233;
  long int D.26234;
  long int D.26235;
  struct MonoClass * D.26238;
  struct MonoType * D.26239;
  unsigned char D.26240;
  unsigned char D.26241;
  unsigned int argnum.281;
  unsigned int D.26245;
  short unsigned int D.26249;
  unsigned int D.26250;
  unsigned int D.26251;
  struct MonoMethodSignature * D.26254;
  <unnamed-unsigned:1> D.26255;
  int D.26256;
  int D.26257;
  unsigned int conv_arg.282;
  unsigned int pos.283;
  unsigned int D.26262;
  unsigned int D.26263;
  unsigned char D.26265;
  unsigned char D.26266;
  struct MonoClass * D.26268;
  struct MonoType * D.26269;
  int D.26273;
  unsigned int D.26276;
  <unnamed type> D.26284;
  _Bool D.26287;
  long int D.26288;
  long int D.26289;
  struct MonoMethod * from_oadate.284;
  struct MonoMethod * from_oadate.285;
  _Bool D.26315;
  long int D.26316;
  long int D.26317;
  unsigned int D.26324;
  unsigned char D.26332;
  struct MonoType * D.26336;
  int D.26337;
  int D.26338;
  unsigned int D.26345;
  unsigned int D.26353;
  unsigned int pos2.286;
  int D.26358;
  int D.26359;
  _Bool D.26360;
  long int D.26361;
  long int D.26362;
  int D.26365;
  unsigned int D.26366;
  int D.26367;
  struct MonoMethodBuilder * mb;
  struct MonoClass * klass;
  struct MonoClass * date_time_class;
  int pos;
  int pos2;

  mb = m->mb;
  pos = 0;
  klass = mono_class_from_mono_type (t);
  {
    static struct MonoClass * tmp_klass;

    {
      tmp_klass.276 = tmp_klass;
      if (tmp_klass.276 == 0B) goto <D.26216>; else goto <D.26217>;
      <D.26216>:
      if (0 != 0) goto <D.26218>; else goto <D.26219>;
      <D.26218>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "mono_defaults.corlib == mono_defaults.corlib");
      <D.26219>:
      D.26220 = mono_defaults.corlib;
      tmp_klass.277 = mono_class_from_name (D.26220, "System", "DateTime");
      tmp_klass = tmp_klass.277;
      tmp_klass.276 = tmp_klass;
      D.26222 = tmp_klass.276 == 0B;
      D.26223 = (long int) D.26222;
      D.26224 = __builtin_expect (D.26223, 0);
      if (D.26224 != 0) goto <D.26225>; else goto <D.26226>;
      <D.26225>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "tmp_klass");
      <D.26226>:
      <D.26217>:
    }
    date_time_class.278 = tmp_klass;
  }
  date_time_class = date_time_class.278;
  switch (action) <default: <D.20369>, case 0: <D.20359>, case 1: <D.20362>, case 2: <D.20363>, case 3: <D.20365>, case 4: <D.20366>, case 5: <D.20367>, case 6: <D.20368>>
  <D.20359>:
  if (klass == date_time_class) goto <D.26227>; else goto <D.26228>;
  <D.26227>:
  {
    static struct MonoMethod * to_oadate;

    to_oadate.279 = to_oadate;
    if (to_oadate.279 == 0B) goto <D.26230>; else goto <D.26231>;
    <D.26230>:
    to_oadate.280 = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
    to_oadate = to_oadate.280;
    <D.26231>:
    to_oadate.279 = to_oadate;
    D.26233 = to_oadate.279 == 0B;
    D.26234 = (long int) D.26233;
    D.26235 = __builtin_expect (D.26234, 0);
    if (D.26235 != 0) goto <D.26236>; else goto <D.26237>;
    <D.26236>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6236, "to_oadate");
    <D.26237>:
    D.26238 = mono_defaults.double_class;
    D.26239 = &D.26238->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.26239);
    D.26240 = BIT_FIELD_REF <*t, 8, 88>;
    D.26241 = D.26240 & 64;
    if (D.26241 != 0) goto <D.26242>; else goto <D.26243>;
    <D.26242>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    D.26245 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26245;
    <D.26243>:
    D.26240 = BIT_FIELD_REF <*t, 8, 88>;
    D.26241 = D.26240 & 64;
    if (D.26241 == 0) goto <D.26246>; else goto <D.26248>;
    <D.26248>:
    D.26249 = t->attrs;
    D.26250 = (unsigned int) D.26249;
    D.26251 = D.26250 & 3;
    if (D.26251 != 2) goto <D.26246>; else goto <D.26247>;
    <D.26246>:
    D.26240 = BIT_FIELD_REF <*t, 8, 88>;
    D.26241 = D.26240 & 64;
    if (D.26241 == 0) goto <D.26252>; else goto <D.26253>;
    <D.26252>:
    D.26254 = m->csig;
    D.26254 = m->csig;
    D.26255 = D.26254->hasthis;
    D.26256 = (int) D.26255;
    D.26257 = argnum - D.26256;
    D.26238 = mono_defaults.double_class;
    D.26239 = &D.26238->byval_arg;
    D.26254->params[D.26257] = D.26239;
    <D.26253>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.281);
    to_oadate.279 = to_oadate;
    mono_mb_emit_managed_call (mb, to_oadate.279, 0B);
    conv_arg.282 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.282);
    <D.26247>:
    D.26240 = BIT_FIELD_REF <*t, 8, 88>;
    D.26241 = D.26240 & 64;
    if (D.26241 != 0) goto <D.26259>; else goto <D.26260>;
    <D.26259>:
    pos.283 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.283);
    <D.26260>:
    goto <D.20361>;
  }
  <D.26228>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.20361>; else goto <D.26264>;
  <D.26264>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.20361>; else goto <D.26267>;
  <D.26267>:
  D.26268 = mono_defaults.int_class;
  D.26269 = &D.26268->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26269);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26270>; else goto <D.26271>;
  <D.26270>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.26272>;
  <D.26271>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  <D.26272>:
  mono_mb_emit_stloc (mb, 0);
  D.26273 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26273);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.282);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26274>; else goto <D.26275>;
  <D.26274>:
  mono_mb_emit_ldloc (mb, 0);
  D.26276 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26276;
  <D.26275>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 == 0) goto <D.26277>; else goto <D.26279>;
  <D.26279>:
  D.26249 = t->attrs;
  D.26250 = (unsigned int) D.26249;
  D.26251 = D.26250 & 3;
  if (D.26251 != 2) goto <D.26277>; else goto <D.26278>;
  <D.26277>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.26278>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26280>; else goto <D.26281>;
  <D.26280>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26281>:
  goto <D.20361>;
  <D.20362>:
  if (spec != 0B) goto <D.26282>; else goto <D.26283>;
  <D.26282>:
  D.26284 = spec->native;
  if (D.26284 == 43) goto <D.26285>; else goto <D.26286>;
  <D.26285>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  D.26287 = D.26241 != 0;
  D.26288 = (long int) D.26287;
  D.26289 = __builtin_expect (D.26288, 0);
  if (D.26289 != 0) goto <D.26290>; else goto <D.26291>;
  <D.26290>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6301, "!t->byref");
  <D.26291>:
  D.26254 = m->csig;
  D.26254 = m->csig;
  D.26255 = D.26254->hasthis;
  D.26256 = (int) D.26255;
  D.26257 = argnum - D.26256;
  D.26268 = mono_defaults.int_class;
  D.26269 = &D.26268->byval_arg;
  D.26254->params[D.26257] = D.26269;
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.26292>; else goto <D.26295>;
  <D.26295>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.26292>; else goto <D.26293>;
  <D.26292>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  goto <D.26294>;
  <D.26293>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  <D.26294>:
  goto <D.20361>;
  <D.26286>:
  <D.26283>:
  if (klass == date_time_class) goto <D.26296>; else goto <D.26297>;
  <D.26296>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26298>; else goto <D.26299>;
  <D.26298>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  goto <D.26300>;
  <D.26299>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  <D.26300>:
  goto <D.20361>;
  <D.26297>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.26301>; else goto <D.26303>;
  <D.26303>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.26301>; else goto <D.26302>;
  <D.26301>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.20361>;
  <D.26302>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 == 0) goto <D.26304>; else goto <D.26305>;
  <D.26304>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 6, klass);
  <D.26305>:
  goto <D.20361>;
  <D.20363>:
  if (klass == date_time_class) goto <D.26306>; else goto <D.26307>;
  <D.26306>:
  {
    static struct MonoMethod * from_oadate;

    D.26240 = BIT_FIELD_REF <*t, 8, 88>;
    D.26241 = D.26240 & 64;
    if (D.26241 == 0) goto <D.20361>; else goto <D.26308>;
    <D.26308>:
    D.26249 = t->attrs;
    D.26250 = (unsigned int) D.26249;
    D.26251 = D.26250 & 3;
    if (D.26251 != 1) goto <D.26309>; else goto <D.26310>;
    <D.26309>:
    from_oadate.284 = from_oadate;
    if (from_oadate.284 == 0B) goto <D.26312>; else goto <D.26313>;
    <D.26312>:
    from_oadate.285 = mono_class_get_method_from_name (date_time_class, "FromOADate", 1);
    from_oadate = from_oadate.285;
    <D.26313>:
    from_oadate.284 = from_oadate;
    D.26315 = from_oadate.284 == 0B;
    D.26316 = (long int) D.26315;
    D.26317 = __builtin_expect (D.26316, 0);
    if (D.26317 != 0) goto <D.26318>; else goto <D.26319>;
    <D.26318>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6345, "from_oadate");
    <D.26319>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.282 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.282);
    from_oadate.284 = from_oadate;
    mono_mb_emit_managed_call (mb, from_oadate.284, 0B);
    mono_mb_emit_op (mb, 129, date_time_class);
    <D.26310>:
    goto <D.20361>;
  }
  <D.26307>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.20361>; else goto <D.26320>;
  <D.26320>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.20361>; else goto <D.26321>;
  <D.26321>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26322>; else goto <D.26323>;
  <D.26322>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26324 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26324;
  D.26249 = t->attrs;
  D.26250 = (unsigned int) D.26249;
  D.26251 = D.26250 & 3;
  if (D.26251 != 1) goto <D.26325>; else goto <D.26326>;
  <D.26325>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  <D.26326>:
  <D.26323>:
  emit_struct_free (mb, klass, conv_arg);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26327>; else goto <D.26328>;
  <D.26327>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26328>:
  goto <D.20361>;
  <D.20365>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.26329>; else goto <D.26331>;
  <D.26331>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26332 = D.26265 & 32;
  if (D.26332 != 0) goto <D.26329>; else goto <D.26330>;
  <D.26329>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20361>;
  <D.26330>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc_addr (mb, 3);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  goto <D.20361>;
  <D.20366>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.26333>; else goto <D.26335>;
  <D.26335>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.26333>; else goto <D.26334>;
  <D.26333>:
  conv_arg = 0;
  goto <D.20361>;
  <D.26334>:
  D.26336 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26336);
  D.26249 = t->attrs;
  D.26337 = (int) D.26249;
  D.26338 = D.26337 & 2;
  if (D.26338 != 0) goto <D.20361>; else goto <D.26339>;
  <D.26339>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26340>; else goto <D.26341>;
  <D.26340>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.26342>;
  <D.26341>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  <D.26342>:
  mono_mb_emit_stloc (mb, 0);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26343>; else goto <D.26344>;
  <D.26343>:
  mono_mb_emit_ldloc (mb, 0);
  D.26345 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26345;
  <D.26344>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26346>; else goto <D.26347>;
  <D.26346>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26347>:
  goto <D.20361>;
  <D.20367>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.20361>; else goto <D.26348>;
  <D.26348>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.20361>; else goto <D.26349>;
  <D.26349>:
  D.26240 = BIT_FIELD_REF <*t, 8, 88>;
  D.26241 = D.26240 & 64;
  if (D.26241 != 0) goto <D.26350>; else goto <D.26351>;
  <D.26350>:
  D.26249 = t->attrs;
  D.26250 = (unsigned int) D.26249;
  D.26251 = D.26250 & 3;
  if (D.26251 == 1) goto <D.20361>; else goto <D.26352>;
  <D.26352>:
  <D.26351>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  D.26353 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.26353;
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 0);
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos2.286 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.286);
  goto <D.20361>;
  <D.20368>:
  D.26262 = klass->flags;
  D.26263 = D.26262 & 24;
  if (D.26263 == 16) goto <D.26355>; else goto <D.26357>;
  <D.26357>:
  D.26265 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26266 = D.26265 & 48;
  if (D.26266 != 0) goto <D.26355>; else goto <D.26356>;
  <D.26355>:
  mono_mb_emit_stloc (mb, 3);
  m->retobj_var = 0;
  goto <D.20361>;
  <D.26356>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  D.26268 = mono_defaults.int_class;
  D.26269 = &D.26268->byval_arg;
  D.26358 = mono_mb_add_local (mb, D.26269);
  m->retobj_var = D.26358;
  m->retobj_class = klass;
  D.26359 = m->retobj_var;
  D.26360 = D.26359 == 0;
  D.26361 = (long int) D.26360;
  D.26362 = __builtin_expect (D.26361, 0);
  if (D.26362 != 0) goto <D.26363>; else goto <D.26364>;
  <D.26363>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6481, "m->retobj_var");
  <D.26364>:
  D.26365 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26365);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26359 = m->retobj_var;
  D.26366 = (unsigned int) D.26359;
  mono_mb_emit_stloc (mb, D.26366);
  emit_struct_conv (mb, klass, 0);
  goto <D.20361>;
  <D.20369>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6494);
  <D.20361>:
  D.26367 = conv_arg;
  return D.26367;
}


emit_marshal_object (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * D.26369;
  struct MonoType * D.26370;
  int * D.26371;
  long unsigned int D.26372;
  long unsigned int D.26373;
  int * D.26374;
  struct MonoClass * D.26375;
  struct MonoClass * D.26376;
  unsigned char D.26379;
  unsigned char D.26380;
  unsigned char D.26383;
  unsigned char D.26384;
  short unsigned int D.26387;
  int D.26388;
  int D.26389;
  unsigned int conv_arg.287;
  unsigned int argnum.288;
  void * D.26395;
  struct MonoClass * D.26397;
  struct MonoMethodPInvoke * D.26400;
  unsigned int D.26403;
  unsigned int D.26404;
  void * D.26410;
  unsigned char D.26412;
  unsigned char D.26413;
  unsigned int D.26416;
  unsigned int pos.289;
  unsigned int D.26422;
  int D.26423;
  int D.26426;
  int D.26427;
  unsigned int D.26428;
  _Bool D.26431;
  long int D.26432;
  long int D.26433;
  void * D.26439;
  int need_free.290;
  void * D.26447;
  unsigned int D.26454;
  unsigned int D.26461;
  _Bool D.26464;
  long int D.26465;
  long int D.26466;
  unsigned int pos2.291;
  _Bool D.26475;
  long int D.26476;
  long int D.26477;
  void * D.26480;
  unsigned int loc.292;
  unsigned int D.26483;
  struct MonoType * D.26484;
  void * D.26489;
  _Bool D.26492;
  long int D.26493;
  long int D.26494;
  _Bool D.26499;
  long int D.26500;
  long int D.26501;
  unsigned int D.26504;
  unsigned int D.26505;
  unsigned int D.26512;
  unsigned int pos2.293;
  unsigned int D.26514;
  unsigned int D.26517;
  unsigned int D.26518;
  int D.26519;
  void * D.26523;
  unsigned int D.26526;
  unsigned int D.26527;
  int D.26528;
  int D.26529;
  struct MonoMethodBuilder * mb;
  struct MonoClass * klass;
  int pos;
  int pos2;
  int loc;

  mb = m->mb;
  klass = mono_class_from_mono_type (t);
  switch (action) <default: <D.20483>, case 0: <D.20461>, case 1: <D.20476>, case 2: <D.20468>, case 3: <D.20477>, case 4: <D.20478>, case 5: <D.20481>, case 6: <D.20482>>
  <D.20461>:
  D.26369 = mono_defaults.int_class;
  D.26370 = &D.26369->byval_arg;
  *conv_arg_type = D.26370;
  D.26369 = mono_defaults.int_class;
  D.26370 = &D.26369->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26370);
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  *D.26374 = 0;
  D.26375 = mono_class_from_mono_type (t);
  D.26376 = mono_defaults.object_class;
  if (D.26375 == D.26376) goto <D.26377>; else goto <D.26378>;
  <D.26377>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Marshalling of type object is not implemented");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20463>;
  }
  <D.26378>:
  D.26379 = BIT_FIELD_REF <*klass, 8, 280>;
  D.26380 = D.26379 & 1;
  if (D.26380 != 0) goto <D.26381>; else goto <D.26382>;
  <D.26381>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26385>; else goto <D.26386>;
  <D.26385>:
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 == 0) goto <D.26390>; else goto <D.26391>;
  <D.26390>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Byref marshalling of delegates is not implemented.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
  }
  <D.26391>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.26393>;
  <D.26386>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26395 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26395);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  <D.26393>:
  goto <D.26396>;
  <D.26382>:
  D.26397 = mono_defaults.stringbuilder_class;
  if (D.26397 == klass) goto <D.26398>; else goto <D.26399>;
  <D.26398>:
  {
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    D.26400 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26400, spec);
    D.26400 = m->piinfo;
    conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.26400, spec);
    D.26383 = BIT_FIELD_REF <*t, 8, 88>;
    D.26384 = D.26383 & 64;
    if (D.26384 != 0) goto <D.26401>; else goto <D.26402>;
    <D.26401>:
    D.26387 = t->attrs;
    D.26403 = (unsigned int) D.26387;
    D.26404 = D.26403 & 3;
    if (D.26404 == 2) goto <D.20463>; else goto <D.26405>;
    <D.26405>:
    <D.26402>:
    if (conv == 4294967295) goto <D.26406>; else goto <D.26407>;
    <D.26406>:
    {
      char * msg;

      msg = monoeg_g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.20463>;
    }
    <D.26407>:
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    D.26383 = BIT_FIELD_REF <*t, 8, 88>;
    D.26384 = D.26383 & 64;
    if (D.26384 != 0) goto <D.26408>; else goto <D.26409>;
    <D.26408>:
    mono_mb_emit_byte (mb, 77);
    <D.26409>:
    D.26410 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.26410);
    conv_arg.287 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.287);
  }
  goto <D.26411>;
  <D.26399>:
  D.26412 = BIT_FIELD_REF <*klass, 8, 256>;
  D.26413 = D.26412 & 32;
  if (D.26413 != 0) goto <D.26414>; else goto <D.26415>;
  <D.26414>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26416 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26416;
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_ldflda (mb, 16);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20463>;
  <D.26415>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26418>; else goto <D.26419>;
  <D.26418>:
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 != 0) goto <D.20463>; else goto <D.26420>;
  <D.26420>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 77);
  goto <D.26421>;
  <D.26419>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  <D.26421>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26422 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26422;
  D.26423 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26423);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26424>; else goto <D.26425>;
  <D.26424>:
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26369 = mono_defaults.int_class;
  D.26370 = &D.26369->byval_arg;
  D.26426 = mono_mb_add_local (mb, D.26370);
  *D.26374 = D.26426;
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26427 = *D.26374;
  D.26428 = (unsigned int) D.26427;
  mono_mb_emit_stloc (mb, D.26428);
  <D.26425>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  <D.26411>:
  <D.26396>:
  goto <D.20463>;
  <D.20468>:
  D.26397 = mono_defaults.stringbuilder_class;
  if (D.26397 == klass) goto <D.26429>; else goto <D.26430>;
  <D.26429>:
  {
    gboolean need_free;
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    try
      {
        D.26400 = m->piinfo;
        encoding = mono_marshal_get_string_encoding (D.26400, spec);
        D.26400 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.26400, spec, &need_free);
        D.26431 = encoding == 4294967295;
        D.26432 = (long int) D.26431;
        D.26433 = __builtin_expect (D.26432, 0);
        if (D.26433 != 0) goto <D.26434>; else goto <D.26435>;
        <D.26434>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7051, "encoding != -1");
        <D.26435>:
        D.26383 = BIT_FIELD_REF <*t, 8, 88>;
        D.26384 = D.26383 & 64;
        if (D.26384 != 0) goto <D.26436>; else goto <D.26437>;
        <D.26436>:
        need_free = 1;
        argnum.288 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.288);
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        switch (encoding) <default: <D.20475>, case 20: <D.20474>, case 21: <D.20472>>
        <D.20472>:
        mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
        goto <D.20473>;
        <D.20474>:
        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
        goto <D.20473>;
        <D.20475>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7069);
        <D.20473>:
        mono_mb_emit_byte (mb, 81);
        goto <D.26438>;
        <D.26437>:
        argnum.288 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.288);
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        D.26439 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26439);
        <D.26438>:
        need_free.290 = need_free;
        if (need_free.290 != 0) goto <D.26441>; else goto <D.26442>;
        <D.26441>:
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.26442>:
        goto <D.20463>;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.26430>:
  D.26379 = BIT_FIELD_REF <*klass, 8, 280>;
  D.26380 = D.26379 & 1;
  if (D.26380 != 0) goto <D.26443>; else goto <D.26444>;
  <D.26443>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26445>; else goto <D.26446>;
  <D.26445>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26447 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26447);
  mono_mb_emit_byte (mb, 81);
  <D.26446>:
  goto <D.20463>;
  <D.26444>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26448>; else goto <D.26449>;
  <D.26448>:
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 != 0) goto <D.26450>; else goto <D.26451>;
  <D.26450>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_byte (mb, 81);
  <D.26451>:
  <D.26449>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26452>; else goto <D.26453>;
  <D.26452>:
  mono_mb_emit_byte (mb, 77);
  <D.26453>:
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26454 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26454;
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26455>; else goto <D.26458>;
  <D.26458>:
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 != 0) goto <D.26455>; else goto <D.26456>;
  <D.26455>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_stloc (mb, 1);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, conv_arg);
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26427 = *D.26374;
  if (D.26427 != 0) goto <D.26459>; else goto <D.26460>;
  <D.26459>:
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26427 = *D.26374;
  D.26428 = (unsigned int) D.26427;
  mono_mb_emit_ldloc (mb, D.26428);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26461 = mono_mb_emit_branch (mb, 59);
  pos2 = (int) D.26461;
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 == 0) goto <D.26462>; else goto <D.26463>;
  <D.26462>:
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26427 = *D.26374;
  D.26464 = D.26427 == 0;
  D.26465 = (long int) D.26464;
  D.26466 = __builtin_expect (D.26465, 0);
  if (D.26466 != 0) goto <D.26467>; else goto <D.26468>;
  <D.26467>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7144, "m->orig_conv_args [argnum]");
  <D.26468>:
  D.26371 = m->orig_conv_args;
  D.26372 = (long unsigned int) argnum;
  D.26373 = D.26372 * 4;
  D.26374 = D.26371 + D.26373;
  D.26427 = *D.26374;
  emit_struct_free (mb, klass, D.26427);
  <D.26463>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  <D.26460>:
  goto <D.26457>;
  <D.26456>:
  emit_struct_free (mb, klass, conv_arg);
  <D.26457>:
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20463>;
  <D.20476>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26470>; else goto <D.26471>;
  <D.26470>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.287);
  goto <D.26472>;
  <D.26471>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  <D.26472>:
  goto <D.20463>;
  <D.20477>:
  D.26379 = BIT_FIELD_REF <*klass, 8, 280>;
  D.26380 = D.26379 & 1;
  if (D.26380 != 0) goto <D.26473>; else goto <D.26474>;
  <D.26473>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  D.26475 = D.26384 != 0;
  D.26476 = (long int) D.26475;
  D.26477 = __builtin_expect (D.26476, 0);
  if (D.26477 != 0) goto <D.26478>; else goto <D.26479>;
  <D.26478>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7171, "!t->byref");
  <D.26479>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  mono_mb_emit_ldloc (mb, 0);
  D.26480 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26480);
  mono_mb_emit_stloc (mb, 3);
  goto <D.26481>;
  <D.26474>:
  mono_mb_emit_stloc (mb, 0);
  D.26369 = mono_defaults.int_class;
  D.26370 = &D.26369->byval_arg;
  loc = mono_mb_add_local (mb, D.26370);
  mono_mb_emit_ldloc (mb, 0);
  loc.292 = (unsigned int) loc;
  mono_mb_emit_stloc (mb, loc.292);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 0);
  D.26483 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26483;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 3);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, loc);
  loc.292 = (unsigned int) loc;
  mono_mb_emit_ldloc (mb, loc.292);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  <D.26481>:
  goto <D.20463>;
  <D.20478>:
  D.26484 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26484);
  D.26379 = BIT_FIELD_REF <*klass, 8, 280>;
  D.26380 = D.26379 & 1;
  if (D.26380 != 0) goto <D.26485>; else goto <D.26486>;
  <D.26485>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  D.26475 = D.26384 != 0;
  D.26476 = (long int) D.26475;
  D.26477 = __builtin_expect (D.26476, 0);
  if (D.26477 != 0) goto <D.26487>; else goto <D.26488>;
  <D.26487>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7221, "!t->byref");
  <D.26488>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26489 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26489);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.20463>;
  <D.26486>:
  D.26397 = mono_defaults.stringbuilder_class;
  if (D.26397 == klass) goto <D.26490>; else goto <D.26491>;
  <D.26490>:
  {
    MonoMarshalNative encoding;

    D.26400 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26400, spec);
    D.26492 = encoding != 20;
    D.26493 = (long int) D.26492;
    D.26494 = __builtin_expect (D.26493, 0);
    if (D.26494 != 0) goto <D.26495>; else goto <D.26496>;
    <D.26495>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7236, "encoding == MONO_NATIVE_LPSTR");
    <D.26496>:
    D.26383 = BIT_FIELD_REF <*t, 8, 88>;
    D.26384 = D.26383 & 64;
    D.26475 = D.26384 != 0;
    D.26476 = (long int) D.26475;
    D.26477 = __builtin_expect (D.26476, 0);
    if (D.26477 != 0) goto <D.26497>; else goto <D.26498>;
    <D.26497>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7238, "!t->byref");
    <D.26498>:
    D.26499 = encoding == 4294967295;
    D.26500 = (long int) D.26499;
    D.26501 = __builtin_expect (D.26500, 0);
    if (D.26501 != 0) goto <D.26502>; else goto <D.26503>;
    <D.26502>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7239, "encoding != -1");
    <D.26503>:
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
    conv_arg.287 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.287);
    goto <D.20463>;
  }
  <D.26491>:
  D.26504 = klass->flags;
  D.26505 = D.26504 & 24;
  if (D.26505 == 0) goto <D.26506>; else goto <D.26507>;
  <D.26506>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20463>;
  <D.26507>:
  D.26387 = t->attrs;
  D.26388 = (int) D.26387;
  D.26389 = D.26388 & 2;
  if (D.26389 != 0) goto <D.26508>; else goto <D.26509>;
  <D.26508>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.20463>;
  <D.26509>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26510>; else goto <D.26511>;
  <D.26510>:
  {
    int pos2;

    D.26512 = mono_mb_emit_branch (mb, 58);
    pos2 = (int) D.26512;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos2.293 = (unsigned int) pos2;
    mono_mb_patch_branch (mb, pos2.293);
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    mono_mb_emit_byte (mb, 77);
  }
  <D.26511>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 22);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  mono_mb_emit_ldloc (mb, 0);
  D.26514 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26514;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20463>;
  <D.20481>:
  D.26383 = BIT_FIELD_REF <*t, 8, 88>;
  D.26384 = D.26383 & 64;
  if (D.26384 != 0) goto <D.26515>; else goto <D.26516>;
  <D.26515>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26517 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26517;
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 81);
  D.26518 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26518;
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  D.26519 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26519);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_stloc (mb, 1);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 223);
  emit_struct_conv (mb, klass, 0);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  goto <D.26520>;
  <D.26516>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.26520>:
  goto <D.20463>;
  <D.20482>:
  D.26379 = BIT_FIELD_REF <*klass, 8, 280>;
  D.26380 = D.26379 & 1;
  if (D.26380 != 0) goto <D.26521>; else goto <D.26522>;
  <D.26521>:
  D.26523 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26523);
  mono_mb_emit_stloc (mb, 3);
  goto <D.20463>;
  <D.26522>:
  D.26504 = klass->flags;
  D.26505 = D.26504 & 24;
  if (D.26505 == 0) goto <D.26524>; else goto <D.26525>;
  <D.26524>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20463>;
  <D.26525>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26526 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26526;
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  D.26527 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26527;
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  D.26528 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26528);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_stloc (mb, 3);
  emit_struct_conv (mb, klass, 0);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  goto <D.20463>;
  <D.20483>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7389);
  <D.20463>:
  D.26529 = conv_arg;
  return D.26529;
}


mono_mb_emit_auto_layout_exception (struct MonoMethodBuilder * mb, struct MonoClass * klass)
{
  const char * D.26532;
  const char * D.26533;
  char * msg;

  D.26532 = klass->name;
  D.26533 = klass->name_space;
  msg = monoeg_g_strdup_printf ("The type `%s.%s\' layout needs to be Sequential or Explicit", D.26533, D.26532);
  mono_mb_emit_exception_marshal_directive (mb, msg);
}


mono_marshal_get_native_wrapper (struct MonoMethod * method, gboolean check_exceptions, gboolean aot)
{
  _Bool D.26534;
  long int D.26535;
  long int D.26536;
  struct MonoMethodSignature * D.26539;
  unsigned char D.26540;
  unsigned char D.26541;
  _Bool D.26542;
  long int D.26543;
  long int D.26544;
  struct MonoClass * D.26549;
  struct MonoImage * D.26550;
  struct GHashTable * * D.26551;
  struct GHashTable * * D.26553;
  struct MonoMethod * D.26556;
  unsigned int D.26557;
  unsigned int D.26558;
  short unsigned int D.26561;
  int D.26562;
  int D.26563;
  short unsigned int D.26566;
  int D.26567;
  int D.26568;
  void * D.26571;
  int D.26576;
  void * D.26583;
  _Bool D.26586;
  long int D.26587;
  long int D.26588;
  unsigned char D.26591;
  signed char D.26592;
  _Bool D.26593;
  long int D.26594;
  long int D.26595;
  unsigned char D.26598;
  unsigned char D.26599;
  _Bool D.26600;
  long int D.26601;
  long int D.26602;
  struct MonoClass * D.26605;
  struct MonoType * D.26606;
  int D.20844;
  int iftmp.294;
  int D.20840;
  const char[13] * D.26610;
  unsigned char D.26611;
  int D.26612;
  unsigned char D.26613;
  int D.26614;
  _Bool D.26615;
  _Bool D.26616;
  _Bool D.26617;
  const unsigned char * D.26620;
  unsigned char D.26621;
  int D.26622;
  const unsigned char * D.26623;
  unsigned char D.26624;
  int D.26625;
  _Bool D.26626;
  _Bool D.26627;
  const unsigned char * D.26630;
  unsigned char D.26631;
  int D.26632;
  const unsigned char * D.26633;
  unsigned char D.26634;
  int D.26635;
  _Bool D.26636;
  _Bool D.26637;
  const unsigned char * D.26640;
  unsigned char D.26641;
  int D.26642;
  const unsigned char * D.26643;
  unsigned char D.26644;
  int D.26645;
  const char * D.26647;
  struct MonoMethodSignature * D.26650;
  int D.26651;
  short unsigned int D.26654;
  int D.26655;
  int D.26656;
  _Bool D.26657;
  long int D.26658;
  long int D.26659;
  short unsigned int D.26662;
  int D.26663;
  int D.26664;
  _Bool D.26665;
  long int D.26666;
  long int D.26667;
  const char * D.26670;
  unsigned int i.295;
  short unsigned int D.26672;
  int D.26673;
  int D.26674;
  struct MonoMethod * D.26675;
  const char * exc_arg.296;
  const char * exc_class.297;
  int D.26682;
  int D.26683;
  unsigned char D.26689;
  unsigned int D.26694;
  unsigned int pos.298;
  <unnamed-unsigned:1> D.26696;
  int D.26697;
  int D.26698;
  unsigned int D.26699;
  short unsigned int D.26700;
  int D.26701;
  struct MonoMethod * D.26704;
  _Bool D.26706;
  long int D.26707;
  long int D.26708;
  _Bool D.26713;
  long int D.26714;
  long int D.26715;
  int D.26722;
  long unsigned int D.26723;
  long unsigned int D.26724;
  struct MonoClass * D.26725;
  struct MonoImage * D.26726;
  long unsigned int D.26727;
  long unsigned int D.26728;
  struct MonoMarshalSpec * * D.26729;
  struct MonoMarshalSpec * D.26730;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodPInvoke * piinfo;
  struct MonoMethodBuilder * mb;
  struct MonoMarshalSpec * * mspecs;
  struct MonoMethod * res;
  struct GHashTable * cache;
  gboolean pinvoke;
  void * iter;
  int i;
  const char * exc_class;
  const char * exc_arg;
  struct WrapperInfo * info;

  try
    {
      piinfo = method;
      pinvoke = 0;
      exc_class = "MissingMethodException";
      exc_arg = 0B;
      D.26534 = method == 0B;
      D.26535 = (long int) D.26534;
      D.26536 = __builtin_expect (D.26535, 0);
      if (D.26536 != 0) goto <D.26537>; else goto <D.26538>;
      <D.26537>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8859, "method != NULL");
      <D.26538>:
      D.26539 = mono_method_signature (method);
      D.26540 = BIT_FIELD_REF <*D.26539, 8, 120>;
      D.26541 = D.26540 & 1;
      D.26542 = D.26541 == 0;
      D.26543 = (long int) D.26542;
      D.26544 = __builtin_expect (D.26543, 0);
      if (D.26544 != 0) goto <D.26545>; else goto <D.26546>;
      <D.26545>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8860, "mono_method_signature (method)->pinvoke");
      <D.26546>:
      if (aot != 0) goto <D.26547>; else goto <D.26548>;
      <D.26547>:
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      D.26551 = &D.26550->native_wrapper_aot_cache;
      cache = get_cache (D.26551, mono_aligned_addr_hash, 0B);
      goto <D.26552>;
      <D.26548>:
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      D.26553 = &D.26550->native_wrapper_cache;
      cache = get_cache (D.26553, mono_aligned_addr_hash, 0B);
      <D.26552>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26554>; else goto <D.26555>;
      <D.26554>:
      D.26556 = res;
      return D.26556;
      <D.26555>:
      D.26549 = method->klass;
      D.26557 = D.26549->flags;
      D.26558 = D.26557 & 4096;
      if (D.26558 != 0) goto <D.26559>; else goto <D.26560>;
      <D.26559>:
      D.26556 = mono_cominterop_get_native_wrapper (method);
      return D.26556;
      <D.26560>:
      sig = mono_method_signature (method);
      D.26561 = method->iflags;
      D.26562 = (int) D.26561;
      D.26563 = D.26562 & 4096;
      if (D.26563 == 0) goto <D.26564>; else goto <D.26565>;
      <D.26564>:
      D.26566 = method->flags;
      D.26567 = (int) D.26566;
      D.26568 = D.26567 & 8192;
      if (D.26568 != 0) goto <D.26569>; else goto <D.26570>;
      <D.26569>:
      pinvoke = 1;
      <D.26570>:
      <D.26565>:
      D.26571 = piinfo->addr;
      if (D.26571 == 0B) goto <D.26572>; else goto <D.26573>;
      <D.26572>:
      if (pinvoke != 0) goto <D.26574>; else goto <D.26575>;
      <D.26574>:
      D.26561 = method->iflags;
      D.26562 = (int) D.26561;
      D.26576 = D.26562 & 1;
      if (D.26576 != 0) goto <D.26577>; else goto <D.26578>;
      <D.26577>:
      exc_arg = "Method contains unsupported native code";
      goto <D.26579>;
      <D.26578>:
      if (aot == 0) goto <D.26580>; else goto <D.26581>;
      <D.26580>:
      mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
      <D.26581>:
      <D.26579>:
      goto <D.26582>;
      <D.26575>:
      D.26583 = mono_lookup_internal_call (method);
      piinfo->addr = D.26583;
      <D.26582>:
      <D.26573>:
      D.26571 = piinfo->addr;
      if (D.26571 == ves_icall_System_String_ctor_RedirectToCreateString) goto <D.26584>; else goto <D.26585>;
      <D.26584>:
      D.26586 = pinvoke != 0;
      D.26587 = (long int) D.26586;
      D.26588 = __builtin_expect (D.26587, 0);
      if (D.26588 != 0) goto <D.26589>; else goto <D.26590>;
      <D.26589>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8896, "!pinvoke");
      <D.26590>:
      D.26591 = BIT_FIELD_REF <*method, 8, 256>;
      D.26592 = (signed char) D.26591;
      D.26593 = D.26592 >= 0;
      D.26594 = (long int) D.26593;
      D.26595 = __builtin_expect (D.26594, 0);
      if (D.26595 != 0) goto <D.26596>; else goto <D.26597>;
      <D.26596>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8897, "method->string_ctor");
      <D.26597>:
      D.26598 = BIT_FIELD_REF <*sig, 8, 112>;
      D.26599 = D.26598 & 64;
      D.26600 = D.26599 == 0;
      D.26601 = (long int) D.26600;
      D.26602 = __builtin_expect (D.26601, 0);
      if (D.26602 != 0) goto <D.26603>; else goto <D.26604>;
      <D.26603>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8898, "sig->hasthis");
      <D.26604>:
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup (D.26550, sig);
      D.26605 = mono_defaults.string_class;
      D.26606 = &D.26605->byval_arg;
      csig->ret = D.26606;
      csig->pinvoke = 0;
      iter = 0B;
      goto <D.20850>;
      <D.20849>:
      {
        size_t __s1_len;
        size_t __s2_len;

        __s1_len = 12;
        if (__s1_len <= 3) goto <D.26608>; else goto <D.26609>;
        <D.26608>:
        {
          const unsigned char * __s2;
          int __result;

          __s2 = res->name;
          D.26610 = "CreateString";
          D.26611 = MEM[(const unsigned char *)D.26610];
          D.26612 = (int) D.26611;
          D.26613 = *__s2;
          D.26614 = (int) D.26613;
          __result = D.26612 - D.26614;
          {
            D.26615 = __s1_len != 0;
            D.26616 = __result == 0;
            D.26617 = D.26615 & D.26616;
            if (D.26617 != 0) goto <D.26618>; else goto <D.26619>;
            <D.26618>:
            D.26620 = &MEM[(void *)"CreateString" + 1B];
            D.26621 = *D.26620;
            D.26622 = (int) D.26621;
            D.26623 = __s2 + 1;
            D.26624 = *D.26623;
            D.26625 = (int) D.26624;
            __result = D.26622 - D.26625;
            D.26626 = __s1_len > 1;
            D.26616 = __result == 0;
            D.26627 = D.26626 & D.26616;
            if (D.26627 != 0) goto <D.26628>; else goto <D.26629>;
            <D.26628>:
            D.26630 = &MEM[(void *)"CreateString" + 2B];
            D.26631 = *D.26630;
            D.26632 = (int) D.26631;
            D.26633 = __s2 + 2;
            D.26634 = *D.26633;
            D.26635 = (int) D.26634;
            __result = D.26632 - D.26635;
            D.26636 = __s1_len > 2;
            D.26616 = __result == 0;
            D.26637 = D.26636 & D.26616;
            if (D.26637 != 0) goto <D.26638>; else goto <D.26639>;
            <D.26638>:
            D.26640 = &MEM[(void *)"CreateString" + 3B];
            D.26641 = *D.26640;
            D.26642 = (int) D.26641;
            D.26643 = __s2 + 3;
            D.26644 = *D.26643;
            D.26645 = (int) D.26644;
            __result = D.26642 - D.26645;
            <D.26639>:
            <D.26629>:
            <D.26619>:
          }
          D.20840 = __result;
        }
        iftmp.294 = D.20840;
        goto <D.26646>;
        <D.26609>:
        D.26647 = res->name;
        iftmp.294 = __builtin_strcmp ("CreateString", D.26647);
        <D.26646>:
        D.20844 = iftmp.294;
      }
      if (D.20844 == 0) goto <D.26648>; else goto <D.26649>;
      <D.26648>:
      D.26650 = mono_method_signature (res);
      D.26651 = mono_metadata_signature_equal (csig, D.26650);
      if (D.26651 != 0) goto <D.26652>; else goto <D.26653>;
      <D.26652>:
      {
        struct WrapperInfo * info;

        D.26654 = res->iflags;
        D.26655 = (int) D.26654;
        D.26656 = D.26655 & 4096;
        D.26657 = D.26656 != 0;
        D.26658 = (long int) D.26657;
        D.26659 = __builtin_expect (D.26658, 0);
        if (D.26659 != 0) goto <D.26660>; else goto <D.26661>;
        <D.26660>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8911, "!(res->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)");
        <D.26661>:
        D.26662 = res->flags;
        D.26663 = (int) D.26662;
        D.26664 = D.26663 & 8192;
        D.26665 = D.26664 != 0;
        D.26666 = (long int) D.26665;
        D.26667 = __builtin_expect (D.26666, 0);
        if (D.26667 != 0) goto <D.26668>; else goto <D.26669>;
        <D.26668>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8912, "!(res->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)");
        <D.26669>:
        D.26670 = method->name;
        D.26549 = method->klass;
        mb = mono_mb_new (D.26549, D.26670, 7);
        mono_mb_emit_byte (mb, 2);
        i = 1;
        goto <D.20847>;
        <D.20846>:
        i.295 = (unsigned int) i;
        mono_mb_emit_ldarg (mb, i.295);
        i = i + 1;
        <D.20847>:
        D.26672 = csig->param_count;
        D.26673 = (int) D.26672;
        if (D.26673 >= i) goto <D.20846>; else goto <D.20848>;
        <D.20848>:
        mono_mb_emit_managed_call (mb, res, 0B);
        mono_mb_emit_byte (mb, 42);
        D.26672 = csig->param_count;
        D.26673 = (int) D.26672;
        D.26674 = D.26673 + 1;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.26674);
        mono_mb_free (mb);
        info = mono_wrapper_info_create (res, 2);
        info->d.string_ctor.method = method;
        mono_marshal_set_wrapper_info (res, info);
        D.26556 = res;
        return D.26556;
      }
      <D.26653>:
      <D.26649>:
      <D.20850>:
      D.26605 = mono_defaults.string_class;
      res = mono_class_get_methods (D.26605, &iter);
      if (res != 0B) goto <D.20849>; else goto <D.20851>;
      <D.20851>:
      piinfo->addr = 0B;
      monoeg_g_log (0B, 16, "cannot find CreateString for .ctor");
      <D.26585>:
      D.26670 = method->name;
      D.26549 = method->klass;
      mb = mono_mb_new (D.26549, D.26670, 6);
      D.26675 = mb->method;
      D.26675->save_lmf = 1;
      D.26571 = piinfo->addr;
      if (D.26571 == 0B) goto <D.26676>; else goto <D.26677>;
      <D.26676>:
      if (aot == 0) goto <D.26678>; else goto <D.26679>;
      <D.26678>:
      exc_arg.296 = exc_arg;
      exc_class.297 = exc_class;
      mono_mb_emit_exception (mb, exc_class.297, exc_arg.296);
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup (D.26550, sig);
      csig->pinvoke = 0;
      D.26672 = csig->param_count;
      D.26673 = (int) D.26672;
      D.26682 = D.26673 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26682);
      mono_mb_free (mb);
      info = mono_wrapper_info_create (res, 0);
      info->d.managed_to_native.method = method;
      mono_marshal_set_wrapper_info (res, info);
      D.26556 = res;
      return D.26556;
      <D.26679>:
      <D.26677>:
      D.26561 = method->iflags;
      D.26562 = (int) D.26561;
      D.26683 = D.26562 & 4099;
      if (D.26683 != 0) goto <D.26684>; else goto <D.26685>;
      <D.26684>:
      D.26598 = BIT_FIELD_REF <*sig, 8, 112>;
      D.26599 = D.26598 & 64;
      if (D.26599 != 0) goto <D.26686>; else goto <D.26687>;
      <D.26686>:
      D.26549 = method->klass;
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup_add_this (D.26550, sig, D.26549);
      goto <D.26688>;
      <D.26687>:
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup (D.26550, sig);
      <D.26688>:
      D.26591 = BIT_FIELD_REF <*method, 8, 256>;
      D.26689 = D.26591 & 128;
      if (D.26689 != 0) goto <D.26690>; else goto <D.26691>;
      <D.26690>:
      D.26605 = mono_defaults.string_class;
      D.26606 = &D.26605->byval_arg;
      csig->ret = D.26606;
      <D.26691>:
      D.26598 = BIT_FIELD_REF <*sig, 8, 112>;
      D.26599 = D.26598 & 64;
      if (D.26599 != 0) goto <D.26692>; else goto <D.26693>;
      <D.26692>:
      {
        int pos;

        mono_mb_emit_byte (mb, 2);
        D.26694 = mono_mb_emit_branch (mb, 58);
        pos = (int) D.26694;
        mono_mb_emit_exception (mb, "NullReferenceException", 0B);
        pos.298 = (unsigned int) pos;
        mono_mb_patch_branch (mb, pos.298);
        mono_mb_emit_byte (mb, 2);
      }
      <D.26693>:
      i = 0;
      goto <D.20854>;
      <D.20853>:
      D.26696 = sig->hasthis;
      D.26697 = (int) D.26696;
      D.26698 = D.26697 + i;
      D.26699 = (unsigned int) D.26698;
      mono_mb_emit_ldarg (mb, D.26699);
      i = i + 1;
      <D.20854>:
      D.26700 = sig->param_count;
      D.26701 = (int) D.26700;
      if (D.26701 > i) goto <D.20853>; else goto <D.20855>;
      <D.20855>:
      if (aot != 0) goto <D.26702>; else goto <D.26703>;
      <D.26702>:
      mono_mb_emit_byte (mb, 240);
      D.26704 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.26704);
      mono_mb_emit_calli (mb, csig);
      goto <D.26705>;
      <D.26703>:
      D.26571 = piinfo->addr;
      D.26706 = D.26571 == 0B;
      D.26707 = (long int) D.26706;
      D.26708 = __builtin_expect (D.26707, 0);
      if (D.26708 != 0) goto <D.26709>; else goto <D.26710>;
      <D.26709>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9005, "piinfo->addr");
      <D.26710>:
      D.26571 = piinfo->addr;
      mono_mb_emit_native_call (mb, csig, D.26571);
      <D.26705>:
      if (check_exceptions != 0) goto <D.26711>; else goto <D.26712>;
      <D.26711>:
      emit_thread_interrupt_checkpoint (mb);
      <D.26712>:
      mono_mb_emit_byte (mb, 42);
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup (D.26550, csig);
      csig->pinvoke = 0;
      D.26672 = csig->param_count;
      D.26673 = (int) D.26672;
      D.26682 = D.26673 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26682);
      info = mono_wrapper_info_create (res, 0);
      info->d.managed_to_native.method = method;
      mono_marshal_set_wrapper_info (res, info);
      mono_mb_free (mb);
      D.26556 = res;
      return D.26556;
      <D.26685>:
      D.26713 = pinvoke == 0;
      D.26714 = (long int) D.26713;
      D.26715 = __builtin_expect (D.26714, 0);
      if (D.26715 != 0) goto <D.26716>; else goto <D.26717>;
      <D.26716>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9026, "pinvoke");
      <D.26717>:
      if (aot == 0) goto <D.26718>; else goto <D.26719>;
      <D.26718>:
      D.26571 = piinfo->addr;
      D.26706 = D.26571 == 0B;
      D.26707 = (long int) D.26706;
      D.26708 = __builtin_expect (D.26707, 0);
      if (D.26708 != 0) goto <D.26720>; else goto <D.26721>;
      <D.26720>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9028, "piinfo->addr");
      <D.26721>:
      <D.26719>:
      D.26700 = sig->param_count;
      D.26701 = (int) D.26700;
      D.26722 = D.26701 + 1;
      D.26723 = (long unsigned int) D.26722;
      D.26724 = D.26723 * 8;
      mspecs = monoeg_malloc (D.26724);
      mono_method_get_marshal_info (method, mspecs);
      D.26571 = piinfo->addr;
      D.26675 = mb->method;
      D.26725 = D.26675->klass;
      D.26726 = D.26725->image;
      mono_marshal_emit_native_wrapper (D.26726, mb, sig, piinfo, mspecs, D.26571, aot, check_exceptions, 0);
      D.26549 = method->klass;
      D.26550 = D.26549->image;
      csig = signature_dup (D.26550, sig);
      csig->pinvoke = 0;
      D.26672 = csig->param_count;
      D.26673 = (int) D.26672;
      D.26682 = D.26673 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26682);
      mono_mb_free (mb);
      info = mono_wrapper_info_create (res, 0);
      info->d.managed_to_native.method = method;
      mono_marshal_set_wrapper_info (res, info);
      D.26700 = sig->param_count;
      i = (int) D.26700;
      goto <D.20857>;
      <D.20856>:
      D.26727 = (long unsigned int) i;
      D.26728 = D.26727 * 8;
      D.26729 = mspecs + D.26728;
      D.26730 = *D.26729;
      if (D.26730 != 0B) goto <D.26731>; else goto <D.26732>;
      <D.26731>:
      D.26727 = (long unsigned int) i;
      D.26728 = D.26727 * 8;
      D.26729 = mspecs + D.26728;
      D.26730 = *D.26729;
      mono_metadata_free_marshal_spec (D.26730);
      <D.26732>:
      i = i + -1;
      <D.20857>:
      if (i >= 0) goto <D.20856>; else goto <D.20858>;
      <D.20858>:
      monoeg_g_free (mspecs);
      D.26556 = res;
      return D.26556;
    }
  finally
    {
      iter = {CLOBBER};
      exc_class = {CLOBBER};
      exc_arg = {CLOBBER};
    }
}


mono_marshal_get_native_func_wrapper (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * * mspecs, void * func)
{
  struct GHashTable * * D.26735;
  struct MonoMethod * D.26738;
  struct MonoClass * D.26739;
  struct MonoMethod * D.26740;
  short unsigned int D.26741;
  int D.26742;
  int D.26743;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;

  D.26735 = &image->native_wrapper_cache;
  cache = get_cache (D.26735, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, func);
  if (res != 0B) goto <D.26736>; else goto <D.26737>;
  <D.26736>:
  D.26738 = res;
  return D.26738;
  <D.26737>:
  name = monoeg_g_strdup_printf ("wrapper_native_%p", func);
  D.26739 = mono_defaults.object_class;
  mb = mono_mb_new (D.26739, name, 6);
  D.26740 = mb->method;
  D.26740->save_lmf = 1;
  mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, func, 0, 1, 0);
  csig = signature_dup (image, sig);
  csig->pinvoke = 0;
  D.26741 = csig->param_count;
  D.26742 = (int) D.26741;
  D.26743 = D.26742 + 16;
  res = mono_mb_create_and_cache (cache, func, mb, csig, D.26743);
  mono_mb_free (mb);
  mono_marshal_set_wrapper_info (res, 0B);
  D.26738 = res;
  return D.26738;
}


mono_marshal_get_native_func_wrapper_aot (struct MonoClass * klass)
{
  struct MonoClass * D.26745;
  struct GHashTable * * D.26746;
  struct MonoMethod * D.26749;
  struct MonoMethodSignature * D.26750;
  short unsigned int D.26751;
  int D.26752;
  int D.26753;
  long unsigned int D.26754;
  long unsigned int D.26755;
  struct MonoMethodSignature * D.26756;
  struct MonoMethod * D.26757;
  unsigned char D.26758;
  unsigned char D.26759;
  _Bool D.26760;
  long int D.26761;
  long int D.26762;
  struct MonoClass * D.26765;
  short unsigned int D.26766;
  int D.26767;
  int D.26768;
  struct MonoMethodSignature * D.26769;
  short unsigned int D.26770;
  long unsigned int D.26771;
  long unsigned int D.26772;
  struct MonoMarshalSpec * * D.26773;
  struct MonoMarshalSpec * D.26774;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;
  struct WrapperInfo * info;
  struct MonoMethodPInvoke mpiinfo;
  struct MonoMethodPInvoke * piinfo;
  struct MonoMarshalSpec * * mspecs;
  struct MonoMethod * invoke;
  struct MonoImage * image;
  int i;

  try
    {
      piinfo = &mpiinfo;
      invoke = mono_get_delegate_invoke (klass);
      D.26745 = invoke->klass;
      image = D.26745->image;
      D.26746 = &image->native_func_wrapper_aot_cache;
      cache = get_cache (D.26746, mono_aligned_addr_hash, 0B);
      res = mono_marshal_find_in_cache (cache, invoke);
      if (res != 0B) goto <D.26747>; else goto <D.26748>;
      <D.26747>:
      D.26749 = res;
      return D.26749;
      <D.26748>:
      memset (&mpiinfo, 0, 56);
      parse_unmanaged_function_pointer_attr (klass, &mpiinfo);
      D.26750 = mono_method_signature (invoke);
      D.26751 = D.26750->param_count;
      D.26752 = (int) D.26751;
      D.26753 = D.26752 + 1;
      D.26754 = (long unsigned int) D.26753;
      D.26755 = D.26754 * 8;
      mspecs = monoeg_malloc0 (D.26755);
      mono_method_get_marshal_info (invoke, mspecs);
      D.26756 = mono_method_signature (invoke);
      sig = mono_metadata_signature_dup (D.26756);
      sig->hasthis = 0;
      name = monoeg_g_strdup_printf ("wrapper_aot_native");
      D.26745 = invoke->klass;
      mb = mono_mb_new (D.26745, name, 6);
      D.26757 = mb->method;
      D.26757->save_lmf = 1;
      mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, 0B, 0, 1, 1);
      D.26758 = BIT_FIELD_REF <*sig, 8, 112>;
      D.26759 = D.26758 & 64;
      D.26760 = D.26759 != 0;
      D.26761 = (long int) D.26760;
      D.26762 = __builtin_expect (D.26761, 0);
      if (D.26762 != 0) goto <D.26763>; else goto <D.26764>;
      <D.26763>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9148, "!sig->hasthis");
      <D.26764>:
      D.26765 = mono_defaults.int_class;
      csig = signature_dup_add_this (image, sig, D.26765);
      csig->pinvoke = 0;
      D.26766 = csig->param_count;
      D.26767 = (int) D.26766;
      D.26768 = D.26767 + 16;
      res = mono_mb_create_and_cache (cache, invoke, mb, csig, D.26768);
      mono_mb_free (mb);
      info = mono_wrapper_info_create (res, 16);
      info->d.managed_to_native.method = invoke;
      mono_marshal_set_wrapper_info (res, info);
      D.26769 = mono_method_signature (invoke);
      D.26770 = D.26769->param_count;
      i = (int) D.26770;
      goto <D.20888>;
      <D.20887>:
      D.26771 = (long unsigned int) i;
      D.26772 = D.26771 * 8;
      D.26773 = mspecs + D.26772;
      D.26774 = *D.26773;
      if (D.26774 != 0B) goto <D.26775>; else goto <D.26776>;
      <D.26775>:
      D.26771 = (long unsigned int) i;
      D.26772 = D.26771 * 8;
      D.26773 = mspecs + D.26772;
      D.26774 = *D.26773;
      mono_metadata_free_marshal_spec (D.26774);
      <D.26776>:
      i = i + -1;
      <D.20888>:
      if (i >= 0) goto <D.20887>; else goto <D.20889>;
      <D.20889>:
      monoeg_g_free (mspecs);
      monoeg_g_free (sig);
      D.26749 = res;
      return D.26749;
    }
  finally
    {
      mpiinfo = {CLOBBER};
    }
}


mono_marshal_emit_managed_wrapper (struct MonoMethodBuilder * mb, struct MonoMethodSignature * invoke_sig, struct MonoMarshalSpec * * mspecs, struct EmitMarshalContext * m, struct MonoMethod * method, uint32_t target_handle)
{
  struct MonoClass * D.26779;
  struct MonoType * D.26780;
  struct MonoClass * D.26781;
  struct MonoType * D.26782;
  unsigned char D.26783;
  unsigned char D.26784;
  short unsigned int D.26787;
  short unsigned int D.26788;
  int D.26791;
  int D.26792;
  int D.26793;
  _Bool D.26794;
  long int D.26795;
  long int D.26796;
  int D.26799;
  long unsigned int D.26800;
  long unsigned int D.26801;
  struct MonoType * * D.26802;
  struct MonoType * * D.26803;
  short unsigned int D.26804;
  short unsigned int D.26805;
  struct MonoType * D.26806;
  int D.26807;
  long unsigned int D.26810;
  long unsigned int D.26811;
  unsigned char D.26812;
  int D.26813;
  long unsigned int D.26814;
  long unsigned int D.26815;
  int * D.26816;
  struct MonoType * * D.26817;
  sizetype D.26818;
  sizetype D.26819;
  sizetype D.26820;
  struct MonoMarshalSpec * * D.26821;
  struct MonoMarshalSpec * D.26822;
  struct MonoType * D.26823;
  int D.26824;
  int target_handle.299;
  int D.26834;
  unsigned char D.26837;
  unsigned char D.26838;
  unsigned int D.26841;
  unsigned int i.300;
  struct MonoMarshalSpec * D.26847;
  <unnamed type> D.26849;
  unsigned char D.26851;
  unsigned char D.26852;
  unsigned char D.26855;
  int D.26856;
  <unnamed type> D.26861;
  unsigned char D.26863;
  unsigned char D.26864;
  unsigned char D.26867;
  int D.26868;
  struct MonoType * D.26871;
  short unsigned int D.26872;
  int D.26873;
  int D.26874;
  int D.26877;
  unsigned int D.26880;
  struct MonoClass * D.26881;
  int D.26883;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  int i;
  int * tmp_locals;
  gboolean closed;

  closed = 0;
  sig = m->sig;
  csig = m->csig;
  D.26779 = mono_defaults.int_class;
  D.26780 = &D.26779->byval_arg;
  mono_mb_add_local (mb, D.26780);
  D.26779 = mono_defaults.int_class;
  D.26780 = &D.26779->byval_arg;
  mono_mb_add_local (mb, D.26780);
  D.26781 = mono_defaults.boolean_class;
  D.26782 = &D.26781->byval_arg;
  mono_mb_add_local (mb, D.26782);
  D.26783 = BIT_FIELD_REF <*sig, 8, 112>;
  D.26784 = D.26783 & 64;
  if (D.26784 == 0) goto <D.26785>; else goto <D.26786>;
  <D.26785>:
  D.26787 = sig->param_count;
  D.26788 = invoke_sig->param_count;
  if (D.26787 != D.26788) goto <D.26789>; else goto <D.26790>;
  <D.26789>:
  D.26787 = sig->param_count;
  D.26791 = (int) D.26787;
  D.26788 = invoke_sig->param_count;
  D.26792 = (int) D.26788;
  D.26793 = D.26792 + 1;
  D.26794 = D.26791 != D.26793;
  D.26795 = (long int) D.26794;
  D.26796 = __builtin_expect (D.26795, 0);
  if (D.26796 != 0) goto <D.26797>; else goto <D.26798>;
  <D.26797>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9229, "sig->param_count == invoke_sig->param_count + 1");
  <D.26798>:
  closed = 1;
  sig = mono_metadata_signature_dup (sig);
  D.26787 = sig->param_count;
  D.26791 = (int) D.26787;
  D.26799 = D.26791 + -1;
  D.26800 = (long unsigned int) D.26799;
  D.26801 = D.26800 * 8;
  D.26802 = &sig->params[1];
  D.26803 = &sig->params[0];
  memmove (D.26803, D.26802, D.26801);
  D.26787 = sig->param_count;
  D.26804 = D.26787;
  D.26805 = D.26804 + 65535;
  sig->param_count = D.26805;
  <D.26790>:
  <D.26786>:
  D.26806 = sig->ret;
  D.26807 = mono_type_is_void (D.26806);
  if (D.26807 == 0) goto <D.26808>; else goto <D.26809>;
  <D.26808>:
  D.26806 = sig->ret;
  mono_mb_add_local (mb, D.26806);
  <D.26809>:
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_stloc (mb, 2);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 17);
  D.26787 = sig->param_count;
  D.26810 = (long unsigned int) D.26787;
  D.26811 = D.26810 * 4;
  tmp_locals = __builtin_alloca (D.26811);
  i = 0;
  goto <D.20914>;
  <D.20913>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.26812 = t->type;
    D.26813 = (int) D.26812;
    switch (D.26813) <default: <D.20912>, case 2: <D.20910>, case 14: <D.20909>, case 17: <D.20906>, case 18: <D.20905>, case 20: <D.20907>, case 28: <D.20904>, case 29: <D.20908>>
    <D.20904>:
    <D.20905>:
    <D.20906>:
    <D.20907>:
    <D.20908>:
    <D.20909>:
    <D.20910>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26817 = &csig->params[i];
    D.26818 = (sizetype) i;
    D.26819 = D.26818 + 1;
    D.26820 = D.26819 * 8;
    D.26821 = mspecs + D.26820;
    D.26822 = *D.26821;
    D.26823 = sig->params[i];
    D.26824 = emit_marshal (m, i, D.26823, D.26822, 0, D.26817, 4);
    *D.26816 = D.26824;
    goto <D.20911>;
    <D.20912>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    *D.26816 = 0;
    goto <D.20911>;
    <D.20911>:
  }
  i = i + 1;
  <D.20914>:
  D.26787 = sig->param_count;
  D.26791 = (int) D.26787;
  if (D.26791 > i) goto <D.20913>; else goto <D.20915>;
  <D.20915>:
  emit_thread_interrupt_checkpoint (mb);
  D.26783 = BIT_FIELD_REF <*sig, 8, 112>;
  D.26784 = D.26783 & 64;
  if (D.26784 != 0) goto <D.26825>; else goto <D.26826>;
  <D.26825>:
  if (target_handle != 0) goto <D.26827>; else goto <D.26828>;
  <D.26827>:
  target_handle.299 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.299);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  goto <D.26830>;
  <D.26828>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9282);
  <D.26830>:
  goto <D.26831>;
  <D.26826>:
  if (closed != 0) goto <D.26832>; else goto <D.26833>;
  <D.26832>:
  target_handle.299 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.299);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  <D.26833>:
  <D.26831>:
  i = 0;
  goto <D.20918>;
  <D.20917>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    if (D.26834 != 0) goto <D.26835>; else goto <D.26836>;
    <D.26835>:
    D.26837 = BIT_FIELD_REF <*t, 8, 88>;
    D.26838 = D.26837 & 64;
    if (D.26838 != 0) goto <D.26839>; else goto <D.26840>;
    <D.26839>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    D.26841 = (unsigned int) D.26834;
    mono_mb_emit_ldloc_addr (mb, D.26841);
    goto <D.26842>;
    <D.26840>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    D.26841 = (unsigned int) D.26834;
    mono_mb_emit_ldloc (mb, D.26841);
    <D.26842>:
    goto <D.26843>;
    <D.26836>:
    i.300 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.300);
    <D.26843>:
  }
  i = i + 1;
  <D.20918>:
  D.26787 = sig->param_count;
  D.26791 = (int) D.26787;
  if (D.26791 > i) goto <D.20917>; else goto <D.20919>;
  <D.20919>:
  mono_mb_emit_managed_call (mb, method, 0B);
  D.26847 = *mspecs;
  if (D.26847 != 0B) goto <D.26848>; else goto <D.26845>;
  <D.26848>:
  D.26847 = *mspecs;
  D.26849 = D.26847->native;
  if (D.26849 == 44) goto <D.26850>; else goto <D.26845>;
  <D.26850>:
  D.26847 = *mspecs;
  D.26806 = sig->ret;
  emit_marshal (m, 0, D.26806, D.26847, 0, 0B, 6);
  goto <D.26846>;
  <D.26845>:
  D.26806 = sig->ret;
  D.26851 = BIT_FIELD_REF <*D.26806, 8, 88>;
  D.26852 = D.26851 & 64;
  if (D.26852 == 0) goto <D.26853>; else goto <D.26854>;
  <D.26853>:
  D.26806 = sig->ret;
  D.26855 = D.26806->type;
  D.26856 = (int) D.26855;
  switch (D.26856) <default: <D.20942>, case 1: <D.20920>, case 2: <D.20922>, case 3: <D.20925>, case 4: <D.20923>, case 5: <D.20924>, case 6: <D.20926>, case 7: <D.20927>, case 8: <D.20928>, case 9: <D.20929>, case 10: <D.20935>, case 11: <D.20936>, case 12: <D.20933>, case 13: <D.20934>, case 14: <D.20938>, case 15: <D.20932>, case 17: <D.20939>, case 18: <D.20940>, case 24: <D.20930>, case 25: <D.20931>, case 28: <D.20937>, case 29: <D.20941>>
  <D.20920>:
  goto <D.20921>;
  <D.20922>:
  <D.20923>:
  <D.20924>:
  <D.20925>:
  <D.20926>:
  <D.20927>:
  <D.20928>:
  <D.20929>:
  <D.20930>:
  <D.20931>:
  <D.20932>:
  <D.20933>:
  <D.20934>:
  <D.20935>:
  <D.20936>:
  <D.20937>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20921>;
  <D.20938>:
  D.26779 = mono_defaults.int_class;
  D.26780 = &D.26779->byval_arg;
  csig->ret = D.26780;
  D.26847 = *mspecs;
  D.26806 = sig->ret;
  emit_marshal (m, 0, D.26806, D.26847, 0, 0B, 6);
  goto <D.20921>;
  <D.20939>:
  <D.20940>:
  <D.20941>:
  D.26847 = *mspecs;
  D.26806 = sig->ret;
  emit_marshal (m, 0, D.26806, D.26847, 0, 0B, 6);
  goto <D.20921>;
  <D.20942>:
  D.26806 = sig->ret;
  D.26855 = D.26806->type;
  D.26856 = (int) D.26855;
  monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.26856);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9339);
  <D.20921>:
  goto <D.26857>;
  <D.26854>:
  mono_mb_emit_stloc (mb, 3);
  <D.26857>:
  <D.26846>:
  i = 0;
  goto <D.20957>;
  <D.20956>:
  {
    struct MonoType * t;
    struct MonoMarshalSpec * spec;

    t = sig->params[i];
    D.26818 = (sizetype) i;
    D.26819 = D.26818 + 1;
    D.26820 = D.26819 * 8;
    D.26821 = mspecs + D.26820;
    spec = *D.26821;
    if (spec != 0B) goto <D.26860>; else goto <D.26858>;
    <D.26860>:
    D.26861 = spec->native;
    if (D.26861 == 44) goto <D.26862>; else goto <D.26858>;
    <D.26862>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    D.26818 = (sizetype) i;
    D.26819 = D.26818 + 1;
    D.26820 = D.26819 * 8;
    D.26821 = mspecs + D.26820;
    D.26822 = *D.26821;
    emit_marshal (m, i, t, D.26822, D.26834, 0B, 5);
    goto <D.26859>;
    <D.26858>:
    D.26863 = BIT_FIELD_REF <*t, 8, 88>;
    D.26864 = D.26863 & 64;
    if (D.26864 != 0) goto <D.26865>; else goto <D.26866>;
    <D.26865>:
    D.26867 = t->type;
    D.26868 = (int) D.26867;
    switch (D.26868) <default: <D.26869>, case 2: <D.20949>, case 14: <D.20948>, case 17: <D.20946>, case 18: <D.20945>, case 28: <D.20947>>
    <D.20945>:
    <D.20946>:
    <D.20947>:
    <D.20948>:
    <D.20949>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    D.26818 = (sizetype) i;
    D.26819 = D.26818 + 1;
    D.26820 = D.26819 * 8;
    D.26821 = mspecs + D.26820;
    D.26822 = *D.26821;
    emit_marshal (m, i, t, D.26822, D.26834, 0B, 5);
    goto <D.20950>;
    <D.26869>:
    <D.20950>:
    goto <D.26870>;
    <D.26866>:
    D.26871 = invoke_sig->params[i];
    D.26872 = D.26871->attrs;
    D.26873 = (int) D.26872;
    D.26874 = D.26873 & 2;
    if (D.26874 != 0) goto <D.26875>; else goto <D.26876>;
    <D.26875>:
    D.26867 = t->type;
    D.26868 = (int) D.26867;
    switch (D.26868) <default: <D.20955>, case 17: <D.20953>, case 18: <D.20952>, case 29: <D.20951>>
    <D.20951>:
    <D.20952>:
    <D.20953>:
    D.26814 = (long unsigned int) i;
    D.26815 = D.26814 * 4;
    D.26816 = tmp_locals + D.26815;
    D.26834 = *D.26816;
    D.26818 = (sizetype) i;
    D.26819 = D.26818 + 1;
    D.26820 = D.26819 * 8;
    D.26821 = mspecs + D.26820;
    D.26822 = *D.26821;
    D.26871 = invoke_sig->params[i];
    emit_marshal (m, i, D.26871, D.26822, D.26834, 0B, 5);
    goto <D.20954>;
    <D.20955>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9373);
    <D.20954>:
    <D.26876>:
    <D.26870>:
    <D.26859>:
  }
  i = i + 1;
  <D.20957>:
  D.26787 = sig->param_count;
  D.26791 = (int) D.26787;
  if (D.26791 > i) goto <D.20956>; else goto <D.20958>;
  <D.20958>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 18);
  D.26877 = m->retobj_var;
  if (D.26877 != 0) goto <D.26878>; else goto <D.26879>;
  <D.26878>:
  D.26877 = m->retobj_var;
  D.26880 = (unsigned int) D.26877;
  mono_mb_emit_ldloc (mb, D.26880);
  mono_mb_emit_byte (mb, 240);
  D.26881 = m->retobj_class;
  mono_mb_emit_op (mb, 5, D.26881);
  goto <D.26882>;
  <D.26879>:
  D.26806 = sig->ret;
  D.26883 = mono_type_is_void (D.26806);
  if (D.26883 == 0) goto <D.26884>; else goto <D.26885>;
  <D.26884>:
  mono_mb_emit_ldloc (mb, 3);
  <D.26885>:
  mono_mb_emit_byte (mb, 42);
  <D.26882>:
  if (closed != 0) goto <D.26886>; else goto <D.26887>;
  <D.26886>:
  monoeg_g_free (sig);
  <D.26887>:
}


memmove (void * __dest, const void * __src, size_t __len)
{
  void * D.26891;
  long unsigned int D.26892;

  D.26892 = __builtin_object_size (__dest, 0);
  D.26891 = __builtin___memmove_chk (__dest, __src, __len, D.26892);
  return D.26891;
}


mono_marshal_get_managed_wrapper (struct MonoMethod * method, struct MonoClass * delegate_klass, uint32_t target_handle)
{
  _Bool D.26894;
  long int D.26895;
  long int D.26896;
  struct MonoMethodSignature * D.26899;
  unsigned char D.26900;
  unsigned char D.26901;
  _Bool D.26902;
  long int D.26903;
  long int D.26904;
  struct MonoClass * D.26907;
  struct MonoImage * D.26908;
  struct GHashTable * * D.26909;
  struct MonoMethod * D.26914;
  struct MonoMethodSignature * D.26915;
  short unsigned int D.26916;
  int D.26917;
  int D.26918;
  long unsigned int D.26919;
  long unsigned int D.26920;
  const char * D.26921;
  long unsigned int D.26922;
  void * D.26923;
  struct MonoClass * UnmanagedFunctionPointerAttribute.301;
  struct MonoImage * D.26930;
  struct MonoClass * UnmanagedFunctionPointerAttribute.302;
  struct MonoMethod * D.26936;
  int D.26937;
  int D.26940;
  unsigned int D.26943;
  const mono_byte * D.26944;
  struct MonoMethod * D.26945;
  int D.26946;
  _Bool D.26947;
  long int D.26948;
  long int D.26949;
  struct MonoArray * typed_args.303;
  long unsigned int D.26953;
  _Bool D.26954;
  long int D.26955;
  long int D.26956;
  char * D.26959;
  void * D.26960;
  struct CattrNamedArg * arginfo.304;
  long unsigned int D.26962;
  long unsigned int D.26963;
  long unsigned int D.26964;
  struct MonoArray * named_args.305;
  char * D.26966;
  struct MonoClassField * D.26967;
  _Bool D.26968;
  long int D.26969;
  long int D.26970;
  int D.21056;
  int iftmp.306;
  int D.21055;
  const char[8] * D.26976;
  unsigned char D.26977;
  int D.26978;
  unsigned char D.26979;
  int D.26980;
  _Bool D.26981;
  _Bool D.26982;
  _Bool D.26983;
  const unsigned char * D.26986;
  unsigned char D.26987;
  int D.26988;
  const unsigned char * D.26989;
  unsigned char D.26990;
  int D.26991;
  _Bool D.26992;
  _Bool D.26993;
  const unsigned char * D.26996;
  unsigned char D.26997;
  int D.26998;
  const unsigned char * D.26999;
  unsigned char D.27000;
  int D.27001;
  _Bool D.27002;
  _Bool D.27003;
  const unsigned char * D.27006;
  unsigned char D.27007;
  int D.27008;
  const unsigned char * D.27009;
  unsigned char D.27010;
  int D.27011;
  const char * D.27013;
  void * D.27016;
  int D.21065;
  int iftmp.307;
  int D.21064;
  const char[13] * D.27021;
  unsigned char D.27022;
  int D.27023;
  unsigned char D.27024;
  int D.27025;
  _Bool D.27026;
  _Bool D.27027;
  _Bool D.27028;
  const unsigned char * D.27031;
  unsigned char D.27032;
  int D.27033;
  const unsigned char * D.27034;
  unsigned char D.27035;
  int D.27036;
  _Bool D.27037;
  _Bool D.27038;
  const unsigned char * D.27041;
  unsigned char D.27042;
  int D.27043;
  const unsigned char * D.27044;
  unsigned char D.27045;
  int D.27046;
  _Bool D.27047;
  _Bool D.27048;
  const unsigned char * D.27051;
  unsigned char D.27052;
  int D.27053;
  const unsigned char * D.27054;
  unsigned char D.27055;
  int D.27056;
  void * D.27060;
  int D.21074;
  int iftmp.308;
  int D.21073;
  const char[15] * D.27065;
  unsigned char D.27066;
  int D.27067;
  unsigned char D.27068;
  int D.27069;
  _Bool D.27070;
  _Bool D.27071;
  _Bool D.27072;
  const unsigned char * D.27075;
  unsigned char D.27076;
  int D.27077;
  const unsigned char * D.27078;
  unsigned char D.27079;
  int D.27080;
  _Bool D.27081;
  _Bool D.27082;
  const unsigned char * D.27085;
  unsigned char D.27086;
  int D.27087;
  const unsigned char * D.27088;
  unsigned char D.27089;
  int D.27090;
  _Bool D.27091;
  _Bool D.27092;
  const unsigned char * D.27095;
  unsigned char D.27096;
  int D.27097;
  const unsigned char * D.27098;
  unsigned char D.27099;
  int D.27100;
  void * D.27104;
  int D.21083;
  int iftmp.309;
  int D.21082;
  const char[22] * D.27109;
  unsigned char D.27110;
  int D.27111;
  unsigned char D.27112;
  int D.27113;
  _Bool D.27114;
  _Bool D.27115;
  _Bool D.27116;
  const unsigned char * D.27119;
  unsigned char D.27120;
  int D.27121;
  const unsigned char * D.27122;
  unsigned char D.27123;
  int D.27124;
  _Bool D.27125;
  _Bool D.27126;
  const unsigned char * D.27129;
  unsigned char D.27130;
  int D.27131;
  const unsigned char * D.27132;
  unsigned char D.27133;
  int D.27134;
  _Bool D.27135;
  _Bool D.27136;
  const unsigned char * D.27139;
  unsigned char D.27140;
  int D.27141;
  const unsigned char * D.27142;
  unsigned char D.27143;
  int D.27144;
  void * D.27148;
  long unsigned int D.27150;
  int D.27151;
  signed short D.27152;
  signed short iftmp.310;
  int D.27156;
  unsigned short D.27157;
  unsigned short D.27158;
  signed short D.27160;
  signed short D.27161;
  signed short D.27162;
  short unsigned int D.27163;
  unsigned char D.27164;
  unsigned char D.27165;
  <unnamed-unsigned:6> D.27166;
  int D.27169;
  short unsigned int D.27174;
  int D.27175;
  int D.27176;
  struct MonoMethodSignature * D.27178;
  short unsigned int D.27179;
  long unsigned int D.27180;
  struct MonoMarshalSpec * * D.27181;
  struct MonoMarshalSpec * D.27182;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * invoke_sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * invoke;
  struct MonoMarshalSpec * * mspecs;
  struct MonoMethodPInvoke piinfo;
  struct GHashTable * cache;
  int i;
  struct EmitMarshalContext m;

  try
    {
      D.26894 = method == 0B;
      D.26895 = (long int) D.26894;
      D.26896 = __builtin_expect (D.26895, 0);
      if (D.26896 != 0) goto <D.26897>; else goto <D.26898>;
      <D.26897>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9450, "method != NULL");
      <D.26898>:
      D.26899 = mono_method_signature (method);
      D.26900 = BIT_FIELD_REF <*D.26899, 8, 120>;
      D.26901 = D.26900 & 1;
      D.26902 = D.26901 != 0;
      D.26903 = (long int) D.26902;
      D.26904 = __builtin_expect (D.26903, 0);
      if (D.26904 != 0) goto <D.26905>; else goto <D.26906>;
      <D.26905>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9451, "!mono_method_signature (method)->pinvoke");
      <D.26906>:
      D.26907 = method->klass;
      D.26908 = D.26907->image;
      D.26909 = &D.26908->managed_wrapper_cache;
      cache = get_cache (D.26909, mono_aligned_addr_hash, 0B);
      if (target_handle == 0) goto <D.26910>; else goto <D.26911>;
      <D.26910>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26912>; else goto <D.26913>;
      <D.26912>:
      D.26914 = res;
      return D.26914;
      <D.26913>:
      <D.26911>:
      invoke = mono_get_delegate_invoke (delegate_klass);
      invoke_sig = mono_method_signature (invoke);
      D.26915 = mono_method_signature (invoke);
      D.26916 = D.26915->param_count;
      D.26917 = (int) D.26916;
      D.26918 = D.26917 + 1;
      D.26919 = (long unsigned int) D.26918;
      D.26920 = D.26919 * 8;
      mspecs = monoeg_malloc0 (D.26920);
      mono_method_get_marshal_info (invoke, mspecs);
      sig = mono_method_signature (method);
      D.26921 = method->name;
      D.26907 = method->klass;
      mb = mono_mb_new (D.26907, D.26921, 5);
      D.26922 = (long unsigned int) target_handle;
      D.26923 = (void *) D.26922;
      mono_mb_add_data (mb, D.26923);
      if (target_handle != 0) goto <D.26924>; else goto <D.26925>;
      <D.26924>:
      csig = mono_metadata_signature_dup (invoke_sig);
      goto <D.26926>;
      <D.26925>:
      D.26907 = method->klass;
      D.26908 = D.26907->image;
      csig = signature_dup (D.26908, invoke_sig);
      <D.26926>:
      csig->hasthis = 0;
      csig->pinvoke = 1;
      m.mb = mb;
      m.sig = sig;
      m.piinfo = 0B;
      m.retobj_var = 0;
      m.csig = csig;
      D.26907 = method->klass;
      D.26908 = D.26907->image;
      m.image = D.26908;
      mono_marshal_set_callconv_from_modopt (invoke, csig);
      UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.301 == 0B) goto <D.26928>; else goto <D.26929>;
      <D.26928>:
      D.26930 = mono_defaults.corlib;
      UnmanagedFunctionPointerAttribute.302 = mono_class_from_name (D.26930, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
      UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.302;
      <D.26929>:
      UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.301 != 0B) goto <D.26932>; else goto <D.26933>;
      <D.26932>:
      {
        struct MonoCustomAttrInfo * cinfo;
        struct MonoCustomAttrEntry * attr;

        cinfo = mono_custom_attrs_from_class (delegate_klass);
        attr = 0B;
        if (cinfo != 0B) goto <D.26934>; else goto <D.26935>;
        <D.26934>:
        i = 0;
        goto <D.21036>;
        <D.21035>:
        {
          struct MonoClass * ctor_class;

          D.26936 = cinfo->attrs[i].ctor;
          ctor_class = D.26936->klass;
          UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
          D.26937 = mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute.301);
          if (D.26937 != 0) goto <D.26938>; else goto <D.26939>;
          <D.26938>:
          attr = &cinfo->attrs[i];
          goto <D.21034>;
          <D.26939>:
        }
        i = i + 1;
        <D.21036>:
        D.26940 = cinfo->num_attrs;
        if (D.26940 > i) goto <D.21035>; else goto <D.21034>;
        <D.21034>:
        <D.26935>:
        if (attr != 0B) goto <D.26941>; else goto <D.26942>;
        <D.26941>:
        {
          struct MonoArray * typed_args;
          struct MonoArray * named_args;
          struct CattrNamedArg * arginfo;
          struct MonoObject * o;
          gint32 call_conv;
          gint32 charset;
          MonoBoolean set_last_error;
          MonoBoolean best_fit_mapping;
          MonoBoolean throw_on_unmappable;
          struct MonoError error;

          try
            {
              charset = 0;
              set_last_error = 0;
              best_fit_mapping = 0;
              throw_on_unmappable = 0;
              D.26943 = attr->data_size;
              D.26944 = attr->data;
              D.26945 = attr->ctor;
              D.26930 = mono_defaults.corlib;
              mono_reflection_create_custom_attr_data_args (D.26930, D.26945, D.26944, D.26943, &typed_args, &named_args, &arginfo, &error);
              D.26946 = mono_error_ok (&error);
              D.26947 = D.26946 == 0;
              D.26948 = (long int) D.26947;
              D.26949 = __builtin_expect (D.26948, 0);
              if (D.26949 != 0) goto <D.26950>; else goto <D.26951>;
              <D.26950>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9530, "mono_error_ok (&error)");
              <D.26951>:
              typed_args.303 = typed_args;
              D.26953 = mono_array_length (typed_args.303);
              D.26954 = D.26953 != 1;
              D.26955 = (long int) D.26954;
              D.26956 = __builtin_expect (D.26955, 0);
              if (D.26956 != 0) goto <D.26957>; else goto <D.26958>;
              <D.26957>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9531, "mono_array_length (typed_args) == 1");
              <D.26958>:
              typed_args.303 = typed_args;
              D.26959 = mono_array_addr_with_size (typed_args.303, 8, 0);
              o = MEM[(struct MonoObject * *)D.26959];
              D.26960 = mono_object_unbox (o);
              call_conv = MEM[(gint32 *)D.26960];
              i = 0;
              goto <D.21085>;
              <D.21084>:
              {
                struct CattrNamedArg * narg;

                arginfo.304 = arginfo;
                D.26962 = (long unsigned int) i;
                D.26963 = D.26962 * 24;
                narg = arginfo.304 + D.26963;
                D.26964 = (long unsigned int) i;
                named_args.305 = named_args;
                D.26966 = mono_array_addr_with_size (named_args.305, 8, D.26964);
                o = MEM[(struct MonoObject * *)D.26966];
                D.26967 = narg->field;
                D.26968 = D.26967 == 0B;
                D.26969 = (long int) D.26968;
                D.26970 = __builtin_expect (D.26969, 0);
                if (D.26970 != 0) goto <D.26971>; else goto <D.26972>;
                <D.26971>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9543, "narg->field");
                <D.26972>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26967 = narg->field;
                    __s2 = D.26967->name;
                    D.26976 = "CharSet";
                    D.26977 = MEM[(const unsigned char *)D.26976];
                    D.26978 = (int) D.26977;
                    D.26979 = *__s2;
                    D.26980 = (int) D.26979;
                    __result = D.26978 - D.26980;
                    {
                      D.26981 = __s2_len != 0;
                      D.26982 = __result == 0;
                      D.26983 = D.26981 & D.26982;
                      if (D.26983 != 0) goto <D.26984>; else goto <D.26985>;
                      <D.26984>:
                      D.26986 = &MEM[(void *)"CharSet" + 1B];
                      D.26987 = *D.26986;
                      D.26988 = (int) D.26987;
                      D.26989 = __s2 + 1;
                      D.26990 = *D.26989;
                      D.26991 = (int) D.26990;
                      __result = D.26988 - D.26991;
                      D.26992 = __s2_len > 1;
                      D.26982 = __result == 0;
                      D.26993 = D.26992 & D.26982;
                      if (D.26993 != 0) goto <D.26994>; else goto <D.26995>;
                      <D.26994>:
                      D.26996 = &MEM[(void *)"CharSet" + 2B];
                      D.26997 = *D.26996;
                      D.26998 = (int) D.26997;
                      D.26999 = __s2 + 2;
                      D.27000 = *D.26999;
                      D.27001 = (int) D.27000;
                      __result = D.26998 - D.27001;
                      D.27002 = __s2_len > 2;
                      D.26982 = __result == 0;
                      D.27003 = D.27002 & D.26982;
                      if (D.27003 != 0) goto <D.27004>; else goto <D.27005>;
                      <D.27004>:
                      D.27006 = &MEM[(void *)"CharSet" + 3B];
                      D.27007 = *D.27006;
                      D.27008 = (int) D.27007;
                      D.27009 = __s2 + 3;
                      D.27010 = *D.27009;
                      D.27011 = (int) D.27010;
                      __result = D.27008 - D.27011;
                      <D.27005>:
                      <D.26995>:
                      <D.26985>:
                    }
                    D.21055 = __result;
                  }
                  iftmp.306 = -D.21055;
                  goto <D.27012>;
                  <D.26975>:
                  D.26967 = narg->field;
                  D.27013 = D.26967->name;
                  iftmp.306 = __builtin_strcmp (D.27013, "CharSet");
                  <D.27012>:
                  D.21056 = iftmp.306;
                }
                if (D.21056 == 0) goto <D.27014>; else goto <D.27015>;
                <D.27014>:
                D.27016 = mono_object_unbox (o);
                charset = MEM[(gint32 *)D.27016];
                goto <D.27017>;
                <D.27015>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26967 = narg->field;
                    __s2 = D.26967->name;
                    D.27021 = "SetLastError";
                    D.27022 = MEM[(const unsigned char *)D.27021];
                    D.27023 = (int) D.27022;
                    D.27024 = *__s2;
                    D.27025 = (int) D.27024;
                    __result = D.27023 - D.27025;
                    {
                      D.27026 = __s2_len != 0;
                      D.27027 = __result == 0;
                      D.27028 = D.27026 & D.27027;
                      if (D.27028 != 0) goto <D.27029>; else goto <D.27030>;
                      <D.27029>:
                      D.27031 = &MEM[(void *)"SetLastError" + 1B];
                      D.27032 = *D.27031;
                      D.27033 = (int) D.27032;
                      D.27034 = __s2 + 1;
                      D.27035 = *D.27034;
                      D.27036 = (int) D.27035;
                      __result = D.27033 - D.27036;
                      D.27037 = __s2_len > 1;
                      D.27027 = __result == 0;
                      D.27038 = D.27037 & D.27027;
                      if (D.27038 != 0) goto <D.27039>; else goto <D.27040>;
                      <D.27039>:
                      D.27041 = &MEM[(void *)"SetLastError" + 2B];
                      D.27042 = *D.27041;
                      D.27043 = (int) D.27042;
                      D.27044 = __s2 + 2;
                      D.27045 = *D.27044;
                      D.27046 = (int) D.27045;
                      __result = D.27043 - D.27046;
                      D.27047 = __s2_len > 2;
                      D.27027 = __result == 0;
                      D.27048 = D.27047 & D.27027;
                      if (D.27048 != 0) goto <D.27049>; else goto <D.27050>;
                      <D.27049>:
                      D.27051 = &MEM[(void *)"SetLastError" + 3B];
                      D.27052 = *D.27051;
                      D.27053 = (int) D.27052;
                      D.27054 = __s2 + 3;
                      D.27055 = *D.27054;
                      D.27056 = (int) D.27055;
                      __result = D.27053 - D.27056;
                      <D.27050>:
                      <D.27040>:
                      <D.27030>:
                    }
                    D.21064 = __result;
                  }
                  iftmp.307 = -D.21064;
                  goto <D.27057>;
                  <D.27020>:
                  D.26967 = narg->field;
                  D.27013 = D.26967->name;
                  iftmp.307 = __builtin_strcmp (D.27013, "SetLastError");
                  <D.27057>:
                  D.21065 = iftmp.307;
                }
                if (D.21065 == 0) goto <D.27058>; else goto <D.27059>;
                <D.27058>:
                D.27060 = mono_object_unbox (o);
                set_last_error = MEM[(MonoBoolean *)D.27060];
                goto <D.27061>;
                <D.27059>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26967 = narg->field;
                    __s2 = D.26967->name;
                    D.27065 = "BestFitMapping";
                    D.27066 = MEM[(const unsigned char *)D.27065];
                    D.27067 = (int) D.27066;
                    D.27068 = *__s2;
                    D.27069 = (int) D.27068;
                    __result = D.27067 - D.27069;
                    {
                      D.27070 = __s2_len != 0;
                      D.27071 = __result == 0;
                      D.27072 = D.27070 & D.27071;
                      if (D.27072 != 0) goto <D.27073>; else goto <D.27074>;
                      <D.27073>:
                      D.27075 = &MEM[(void *)"BestFitMapping" + 1B];
                      D.27076 = *D.27075;
                      D.27077 = (int) D.27076;
                      D.27078 = __s2 + 1;
                      D.27079 = *D.27078;
                      D.27080 = (int) D.27079;
                      __result = D.27077 - D.27080;
                      D.27081 = __s2_len > 1;
                      D.27071 = __result == 0;
                      D.27082 = D.27081 & D.27071;
                      if (D.27082 != 0) goto <D.27083>; else goto <D.27084>;
                      <D.27083>:
                      D.27085 = &MEM[(void *)"BestFitMapping" + 2B];
                      D.27086 = *D.27085;
                      D.27087 = (int) D.27086;
                      D.27088 = __s2 + 2;
                      D.27089 = *D.27088;
                      D.27090 = (int) D.27089;
                      __result = D.27087 - D.27090;
                      D.27091 = __s2_len > 2;
                      D.27071 = __result == 0;
                      D.27092 = D.27091 & D.27071;
                      if (D.27092 != 0) goto <D.27093>; else goto <D.27094>;
                      <D.27093>:
                      D.27095 = &MEM[(void *)"BestFitMapping" + 3B];
                      D.27096 = *D.27095;
                      D.27097 = (int) D.27096;
                      D.27098 = __s2 + 3;
                      D.27099 = *D.27098;
                      D.27100 = (int) D.27099;
                      __result = D.27097 - D.27100;
                      <D.27094>:
                      <D.27084>:
                      <D.27074>:
                    }
                    D.21073 = __result;
                  }
                  iftmp.308 = -D.21073;
                  goto <D.27101>;
                  <D.27064>:
                  D.26967 = narg->field;
                  D.27013 = D.26967->name;
                  iftmp.308 = __builtin_strcmp (D.27013, "BestFitMapping");
                  <D.27101>:
                  D.21074 = iftmp.308;
                }
                if (D.21074 == 0) goto <D.27102>; else goto <D.27103>;
                <D.27102>:
                D.27104 = mono_object_unbox (o);
                best_fit_mapping = MEM[(MonoBoolean *)D.27104];
                goto <D.27105>;
                <D.27103>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26967 = narg->field;
                    __s2 = D.26967->name;
                    D.27109 = "ThrowOnUnmappableChar";
                    D.27110 = MEM[(const unsigned char *)D.27109];
                    D.27111 = (int) D.27110;
                    D.27112 = *__s2;
                    D.27113 = (int) D.27112;
                    __result = D.27111 - D.27113;
                    {
                      D.27114 = __s2_len != 0;
                      D.27115 = __result == 0;
                      D.27116 = D.27114 & D.27115;
                      if (D.27116 != 0) goto <D.27117>; else goto <D.27118>;
                      <D.27117>:
                      D.27119 = &MEM[(void *)"ThrowOnUnmappableChar" + 1B];
                      D.27120 = *D.27119;
                      D.27121 = (int) D.27120;
                      D.27122 = __s2 + 1;
                      D.27123 = *D.27122;
                      D.27124 = (int) D.27123;
                      __result = D.27121 - D.27124;
                      D.27125 = __s2_len > 1;
                      D.27115 = __result == 0;
                      D.27126 = D.27125 & D.27115;
                      if (D.27126 != 0) goto <D.27127>; else goto <D.27128>;
                      <D.27127>:
                      D.27129 = &MEM[(void *)"ThrowOnUnmappableChar" + 2B];
                      D.27130 = *D.27129;
                      D.27131 = (int) D.27130;
                      D.27132 = __s2 + 2;
                      D.27133 = *D.27132;
                      D.27134 = (int) D.27133;
                      __result = D.27131 - D.27134;
                      D.27135 = __s2_len > 2;
                      D.27115 = __result == 0;
                      D.27136 = D.27135 & D.27115;
                      if (D.27136 != 0) goto <D.27137>; else goto <D.27138>;
                      <D.27137>:
                      D.27139 = &MEM[(void *)"ThrowOnUnmappableChar" + 3B];
                      D.27140 = *D.27139;
                      D.27141 = (int) D.27140;
                      D.27142 = __s2 + 3;
                      D.27143 = *D.27142;
                      D.27144 = (int) D.27143;
                      __result = D.27141 - D.27144;
                      <D.27138>:
                      <D.27128>:
                      <D.27118>:
                    }
                    D.21082 = __result;
                  }
                  iftmp.309 = -D.21082;
                  goto <D.27145>;
                  <D.27108>:
                  D.26967 = narg->field;
                  D.27013 = D.26967->name;
                  iftmp.309 = __builtin_strcmp (D.27013, "ThrowOnUnmappableChar");
                  <D.27145>:
                  D.21083 = iftmp.309;
                }
                if (D.21083 == 0) goto <D.27146>; else goto <D.27147>;
                <D.27146>:
                D.27148 = mono_object_unbox (o);
                throw_on_unmappable = MEM[(MonoBoolean *)D.27148];
                goto <D.27149>;
                <D.27147>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9553);
                <D.27149>:
                <D.27105>:
                <D.27061>:
                <D.27017>:
              }
              i = i + 1;
              <D.21085>:
              D.26964 = (long unsigned int) i;
              named_args.305 = named_args;
              D.27150 = mono_array_length (named_args.305);
              if (D.26964 < D.27150) goto <D.21084>; else goto <D.21086>;
              <D.21086>:
              arginfo.304 = arginfo;
              monoeg_g_free (arginfo.304);
              memset (&piinfo, 0, 56);
              m.piinfo = &piinfo;
              D.27151 = call_conv << 8;
              D.27152 = (signed short) D.27151;
              if (charset != 0) goto <D.27154>; else goto <D.27155>;
              <D.27154>:
              D.27156 = charset + -1;
              D.27157 = (unsigned short) D.27156;
              D.27158 = D.27157 * 2;
              iftmp.310 = (signed short) D.27158;
              goto <D.27159>;
              <D.27155>:
              iftmp.310 = 1;
              <D.27159>:
              D.27160 = D.27152 | iftmp.310;
              D.27161 = (signed short) set_last_error;
              D.27162 = D.27160 | D.27161;
              D.27163 = (short unsigned int) D.27162;
              piinfo.piflags = D.27163;
              D.27164 = (unsigned char) call_conv;
              D.27165 = D.27164 + 255;
              D.27166 = (<unnamed-unsigned:6>) D.27165;
              csig->call_convention = D.27166;
            }
          finally
            {
              typed_args = {CLOBBER};
              named_args = {CLOBBER};
              arginfo = {CLOBBER};
              error = {CLOBBER};
            }
        }
        <D.26942>:
        if (cinfo != 0B) goto <D.27167>; else goto <D.27168>;
        <D.27167>:
        D.27169 = cinfo->cached;
        if (D.27169 == 0) goto <D.27170>; else goto <D.27171>;
        <D.27170>:
        mono_custom_attrs_free (cinfo);
        <D.27171>:
        <D.27168>:
      }
      <D.26933>:
      mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
      if (target_handle == 0) goto <D.27172>; else goto <D.27173>;
      <D.27172>:
      {
        struct WrapperInfo * info;

        D.27174 = sig->param_count;
        D.27175 = (int) D.27174;
        D.27176 = D.27175 + 16;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.27176);
        info = mono_wrapper_info_create (res, 0);
        info->d.native_to_managed.method = method;
        info->d.native_to_managed.klass = delegate_klass;
        mono_marshal_set_wrapper_info (res, info);
      }
      goto <D.27177>;
      <D.27173>:
      mb->dynamic = 1;
      D.27174 = sig->param_count;
      D.27175 = (int) D.27174;
      D.27176 = D.27175 + 16;
      res = mono_mb_create_method (mb, csig, D.27176);
      <D.27177>:
      mono_mb_free (mb);
      D.27178 = mono_method_signature (invoke);
      D.27179 = D.27178->param_count;
      i = (int) D.27179;
      goto <D.21089>;
      <D.21088>:
      D.26962 = (long unsigned int) i;
      D.27180 = D.26962 * 8;
      D.27181 = mspecs + D.27180;
      D.27182 = *D.27181;
      if (D.27182 != 0B) goto <D.27183>; else goto <D.27184>;
      <D.27183>:
      D.26962 = (long unsigned int) i;
      D.27180 = D.26962 * 8;
      D.27181 = mspecs + D.27180;
      D.27182 = *D.27181;
      mono_metadata_free_marshal_spec (D.27182);
      <D.27184>:
      i = i + -1;
      <D.21089>:
      if (i >= 0) goto <D.21088>; else goto <D.21090>;
      <D.21090>:
      monoeg_g_free (mspecs);
      D.26914 = res;
      return D.26914;
    }
  finally
    {
      piinfo = {CLOBBER};
      m = {CLOBBER};
    }
}


mono_marshal_set_callconv_from_modopt (struct MonoMethod * method, struct MonoMethodSignature * csig)
{
  struct MonoType * D.27187;
  unsigned char D.27190;
  unsigned char D.27191;
  <unnamed-unsigned:31> D.27194;
  unsigned int D.27195;
  struct MonoClass * D.27196;
  struct MonoImage * D.27197;
  _Bool D.27198;
  long int D.27199;
  long int D.27200;
  struct MonoImage * D.27203;
  struct MonoImage * D.27204;
  int D.20974;
  int iftmp.311;
  int D.20973;
  const char[32] * D.27210;
  unsigned char D.27211;
  int D.27212;
  unsigned char D.27213;
  int D.27214;
  _Bool D.27215;
  _Bool D.27216;
  _Bool D.27217;
  const unsigned char * D.27220;
  unsigned char D.27221;
  int D.27222;
  const unsigned char * D.27223;
  unsigned char D.27224;
  int D.27225;
  _Bool D.27226;
  _Bool D.27227;
  const unsigned char * D.27230;
  unsigned char D.27231;
  int D.27232;
  const unsigned char * D.27233;
  unsigned char D.27234;
  int D.27235;
  _Bool D.27236;
  _Bool D.27237;
  const unsigned char * D.27240;
  unsigned char D.27241;
  int D.27242;
  const unsigned char * D.27243;
  unsigned char D.27244;
  int D.27245;
  const char * D.27247;
  int D.20983;
  int iftmp.312;
  int D.20982;
  const char[14] * D.27253;
  unsigned char D.27254;
  int D.27255;
  unsigned char D.27256;
  int D.27257;
  _Bool D.27258;
  _Bool D.27259;
  _Bool D.27260;
  const unsigned char * D.27263;
  unsigned char D.27264;
  int D.27265;
  const unsigned char * D.27266;
  unsigned char D.27267;
  int D.27268;
  _Bool D.27269;
  _Bool D.27270;
  const unsigned char * D.27273;
  unsigned char D.27274;
  int D.27275;
  const unsigned char * D.27276;
  unsigned char D.27277;
  int D.27278;
  _Bool D.27279;
  _Bool D.27280;
  const unsigned char * D.27283;
  unsigned char D.27284;
  int D.27285;
  const unsigned char * D.27286;
  unsigned char D.27287;
  int D.27288;
  const char * D.27290;
  int D.20992;
  int iftmp.313;
  int D.20991;
  const char[16] * D.27297;
  unsigned char D.27298;
  int D.27299;
  unsigned char D.27300;
  int D.27301;
  _Bool D.27302;
  _Bool D.27303;
  _Bool D.27304;
  const unsigned char * D.27307;
  unsigned char D.27308;
  int D.27309;
  const unsigned char * D.27310;
  unsigned char D.27311;
  int D.27312;
  _Bool D.27313;
  _Bool D.27314;
  const unsigned char * D.27317;
  unsigned char D.27318;
  int D.27319;
  const unsigned char * D.27320;
  unsigned char D.27321;
  int D.27322;
  _Bool D.27323;
  _Bool D.27324;
  const unsigned char * D.27327;
  unsigned char D.27328;
  int D.27329;
  const unsigned char * D.27330;
  unsigned char D.27331;
  int D.27332;
  int D.21001;
  int iftmp.314;
  int D.21000;
  const char[17] * D.27340;
  unsigned char D.27341;
  int D.27342;
  unsigned char D.27343;
  int D.27344;
  _Bool D.27345;
  _Bool D.27346;
  _Bool D.27347;
  const unsigned char * D.27350;
  unsigned char D.27351;
  int D.27352;
  const unsigned char * D.27353;
  unsigned char D.27354;
  int D.27355;
  _Bool D.27356;
  _Bool D.27357;
  const unsigned char * D.27360;
  unsigned char D.27361;
  int D.27362;
  const unsigned char * D.27363;
  unsigned char D.27364;
  int D.27365;
  _Bool D.27366;
  _Bool D.27367;
  const unsigned char * D.27370;
  unsigned char D.27371;
  int D.27372;
  const unsigned char * D.27373;
  unsigned char D.27374;
  int D.27375;
  int D.21010;
  int iftmp.315;
  int D.21009;
  const char[17] * D.27383;
  unsigned char D.27384;
  int D.27385;
  unsigned char D.27386;
  int D.27387;
  _Bool D.27388;
  _Bool D.27389;
  _Bool D.27390;
  const unsigned char * D.27393;
  unsigned char D.27394;
  int D.27395;
  const unsigned char * D.27396;
  unsigned char D.27397;
  int D.27398;
  _Bool D.27399;
  _Bool D.27400;
  const unsigned char * D.27403;
  unsigned char D.27404;
  int D.27405;
  const unsigned char * D.27406;
  unsigned char D.27407;
  int D.27408;
  _Bool D.27409;
  _Bool D.27410;
  const unsigned char * D.27413;
  unsigned char D.27414;
  int D.27415;
  const unsigned char * D.27416;
  unsigned char D.27417;
  int D.27418;
  <unnamed-unsigned:6> D.27422;
  int D.27423;
  struct MonoMethodSignature * sig;
  int i;

  sig = mono_method_signature (method);
  D.27187 = sig->ret;
  if (D.27187 != 0B) goto <D.27188>; else goto <D.27189>;
  <D.27188>:
  D.27187 = sig->ret;
  D.27190 = BIT_FIELD_REF <*D.27187, 8, 88>;
  D.27191 = D.27190 & 63;
  if (D.27191 != 0) goto <D.27192>; else goto <D.27193>;
  <D.27192>:
  i = 0;
  goto <D.21012>;
  <D.21011>:
  {
    struct MonoClass * cmod_class;

    D.27187 = sig->ret;
    D.27194 = D.27187->modifiers[i].token;
    D.27195 = (unsigned int) D.27194;
    D.27196 = method->klass;
    D.27197 = D.27196->image;
    cmod_class = mono_class_get (D.27197, D.27195);
    D.27198 = cmod_class == 0B;
    D.27199 = (long int) D.27198;
    D.27200 = __builtin_expect (D.27199, 0);
    if (D.27200 != 0) goto <D.27201>; else goto <D.27202>;
    <D.27201>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9418, "cmod_class");
    <D.27202>:
    D.27203 = cmod_class->image;
    D.27204 = mono_defaults.corlib;
    if (D.27203 == D.27204) goto <D.27205>; else goto <D.27206>;
    <D.27205>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name_space;
        D.27210 = "System.Runtime.CompilerServices";
        D.27211 = MEM[(const unsigned char *)D.27210];
        D.27212 = (int) D.27211;
        D.27213 = *__s2;
        D.27214 = (int) D.27213;
        __result = D.27212 - D.27214;
        {
          D.27215 = __s2_len != 0;
          D.27216 = __result == 0;
          D.27217 = D.27215 & D.27216;
          if (D.27217 != 0) goto <D.27218>; else goto <D.27219>;
          <D.27218>:
          D.27220 = &MEM[(void *)"System.Runtime.CompilerServices" + 1B];
          D.27221 = *D.27220;
          D.27222 = (int) D.27221;
          D.27223 = __s2 + 1;
          D.27224 = *D.27223;
          D.27225 = (int) D.27224;
          __result = D.27222 - D.27225;
          D.27226 = __s2_len > 1;
          D.27216 = __result == 0;
          D.27227 = D.27226 & D.27216;
          if (D.27227 != 0) goto <D.27228>; else goto <D.27229>;
          <D.27228>:
          D.27230 = &MEM[(void *)"System.Runtime.CompilerServices" + 2B];
          D.27231 = *D.27230;
          D.27232 = (int) D.27231;
          D.27233 = __s2 + 2;
          D.27234 = *D.27233;
          D.27235 = (int) D.27234;
          __result = D.27232 - D.27235;
          D.27236 = __s2_len > 2;
          D.27216 = __result == 0;
          D.27237 = D.27236 & D.27216;
          if (D.27237 != 0) goto <D.27238>; else goto <D.27239>;
          <D.27238>:
          D.27240 = &MEM[(void *)"System.Runtime.CompilerServices" + 3B];
          D.27241 = *D.27240;
          D.27242 = (int) D.27241;
          D.27243 = __s2 + 3;
          D.27244 = *D.27243;
          D.27245 = (int) D.27244;
          __result = D.27242 - D.27245;
          <D.27239>:
          <D.27229>:
          <D.27219>:
        }
        D.20973 = __result;
      }
      iftmp.311 = -D.20973;
      goto <D.27246>;
      <D.27209>:
      D.27247 = cmod_class->name_space;
      iftmp.311 = __builtin_strcmp (D.27247, "System.Runtime.CompilerServices");
      <D.27246>:
      D.20974 = iftmp.311;
    }
    if (D.20974 == 0) goto <D.27248>; else goto <D.27249>;
    <D.27248>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27253 = "CallConvCdecl";
        D.27254 = MEM[(const unsigned char *)D.27253];
        D.27255 = (int) D.27254;
        D.27256 = *__s2;
        D.27257 = (int) D.27256;
        __result = D.27255 - D.27257;
        {
          D.27258 = __s2_len != 0;
          D.27259 = __result == 0;
          D.27260 = D.27258 & D.27259;
          if (D.27260 != 0) goto <D.27261>; else goto <D.27262>;
          <D.27261>:
          D.27263 = &MEM[(void *)"CallConvCdecl" + 1B];
          D.27264 = *D.27263;
          D.27265 = (int) D.27264;
          D.27266 = __s2 + 1;
          D.27267 = *D.27266;
          D.27268 = (int) D.27267;
          __result = D.27265 - D.27268;
          D.27269 = __s2_len > 1;
          D.27259 = __result == 0;
          D.27270 = D.27269 & D.27259;
          if (D.27270 != 0) goto <D.27271>; else goto <D.27272>;
          <D.27271>:
          D.27273 = &MEM[(void *)"CallConvCdecl" + 2B];
          D.27274 = *D.27273;
          D.27275 = (int) D.27274;
          D.27276 = __s2 + 2;
          D.27277 = *D.27276;
          D.27278 = (int) D.27277;
          __result = D.27275 - D.27278;
          D.27279 = __s2_len > 2;
          D.27259 = __result == 0;
          D.27280 = D.27279 & D.27259;
          if (D.27280 != 0) goto <D.27281>; else goto <D.27282>;
          <D.27281>:
          D.27283 = &MEM[(void *)"CallConvCdecl" + 3B];
          D.27284 = *D.27283;
          D.27285 = (int) D.27284;
          D.27286 = __s2 + 3;
          D.27287 = *D.27286;
          D.27288 = (int) D.27287;
          __result = D.27285 - D.27288;
          <D.27282>:
          <D.27272>:
          <D.27262>:
        }
        D.20982 = __result;
      }
      iftmp.312 = -D.20982;
      goto <D.27289>;
      <D.27252>:
      D.27290 = cmod_class->name;
      iftmp.312 = __builtin_strcmp (D.27290, "CallConvCdecl");
      <D.27289>:
      D.20983 = iftmp.312;
    }
    if (D.20983 == 0) goto <D.27291>; else goto <D.27292>;
    <D.27291>:
    csig->call_convention = 1;
    goto <D.27293>;
    <D.27292>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27297 = "CallConvStdcall";
        D.27298 = MEM[(const unsigned char *)D.27297];
        D.27299 = (int) D.27298;
        D.27300 = *__s2;
        D.27301 = (int) D.27300;
        __result = D.27299 - D.27301;
        {
          D.27302 = __s2_len != 0;
          D.27303 = __result == 0;
          D.27304 = D.27302 & D.27303;
          if (D.27304 != 0) goto <D.27305>; else goto <D.27306>;
          <D.27305>:
          D.27307 = &MEM[(void *)"CallConvStdcall" + 1B];
          D.27308 = *D.27307;
          D.27309 = (int) D.27308;
          D.27310 = __s2 + 1;
          D.27311 = *D.27310;
          D.27312 = (int) D.27311;
          __result = D.27309 - D.27312;
          D.27313 = __s2_len > 1;
          D.27303 = __result == 0;
          D.27314 = D.27313 & D.27303;
          if (D.27314 != 0) goto <D.27315>; else goto <D.27316>;
          <D.27315>:
          D.27317 = &MEM[(void *)"CallConvStdcall" + 2B];
          D.27318 = *D.27317;
          D.27319 = (int) D.27318;
          D.27320 = __s2 + 2;
          D.27321 = *D.27320;
          D.27322 = (int) D.27321;
          __result = D.27319 - D.27322;
          D.27323 = __s2_len > 2;
          D.27303 = __result == 0;
          D.27324 = D.27323 & D.27303;
          if (D.27324 != 0) goto <D.27325>; else goto <D.27326>;
          <D.27325>:
          D.27327 = &MEM[(void *)"CallConvStdcall" + 3B];
          D.27328 = *D.27327;
          D.27329 = (int) D.27328;
          D.27330 = __s2 + 3;
          D.27331 = *D.27330;
          D.27332 = (int) D.27331;
          __result = D.27329 - D.27332;
          <D.27326>:
          <D.27316>:
          <D.27306>:
        }
        D.20991 = __result;
      }
      iftmp.313 = -D.20991;
      goto <D.27333>;
      <D.27296>:
      D.27290 = cmod_class->name;
      iftmp.313 = __builtin_strcmp (D.27290, "CallConvStdcall");
      <D.27333>:
      D.20992 = iftmp.313;
    }
    if (D.20992 == 0) goto <D.27334>; else goto <D.27335>;
    <D.27334>:
    csig->call_convention = 2;
    goto <D.27336>;
    <D.27335>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27340 = "CallConvFastcall";
        D.27341 = MEM[(const unsigned char *)D.27340];
        D.27342 = (int) D.27341;
        D.27343 = *__s2;
        D.27344 = (int) D.27343;
        __result = D.27342 - D.27344;
        {
          D.27345 = __s2_len != 0;
          D.27346 = __result == 0;
          D.27347 = D.27345 & D.27346;
          if (D.27347 != 0) goto <D.27348>; else goto <D.27349>;
          <D.27348>:
          D.27350 = &MEM[(void *)"CallConvFastcall" + 1B];
          D.27351 = *D.27350;
          D.27352 = (int) D.27351;
          D.27353 = __s2 + 1;
          D.27354 = *D.27353;
          D.27355 = (int) D.27354;
          __result = D.27352 - D.27355;
          D.27356 = __s2_len > 1;
          D.27346 = __result == 0;
          D.27357 = D.27356 & D.27346;
          if (D.27357 != 0) goto <D.27358>; else goto <D.27359>;
          <D.27358>:
          D.27360 = &MEM[(void *)"CallConvFastcall" + 2B];
          D.27361 = *D.27360;
          D.27362 = (int) D.27361;
          D.27363 = __s2 + 2;
          D.27364 = *D.27363;
          D.27365 = (int) D.27364;
          __result = D.27362 - D.27365;
          D.27366 = __s2_len > 2;
          D.27346 = __result == 0;
          D.27367 = D.27366 & D.27346;
          if (D.27367 != 0) goto <D.27368>; else goto <D.27369>;
          <D.27368>:
          D.27370 = &MEM[(void *)"CallConvFastcall" + 3B];
          D.27371 = *D.27370;
          D.27372 = (int) D.27371;
          D.27373 = __s2 + 3;
          D.27374 = *D.27373;
          D.27375 = (int) D.27374;
          __result = D.27372 - D.27375;
          <D.27369>:
          <D.27359>:
          <D.27349>:
        }
        D.21000 = __result;
      }
      iftmp.314 = -D.21000;
      goto <D.27376>;
      <D.27339>:
      D.27290 = cmod_class->name;
      iftmp.314 = __builtin_strcmp (D.27290, "CallConvFastcall");
      <D.27376>:
      D.21001 = iftmp.314;
    }
    if (D.21001 == 0) goto <D.27377>; else goto <D.27378>;
    <D.27377>:
    csig->call_convention = 4;
    goto <D.27379>;
    <D.27378>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27383 = "CallConvThiscall";
        D.27384 = MEM[(const unsigned char *)D.27383];
        D.27385 = (int) D.27384;
        D.27386 = *__s2;
        D.27387 = (int) D.27386;
        __result = D.27385 - D.27387;
        {
          D.27388 = __s2_len != 0;
          D.27389 = __result == 0;
          D.27390 = D.27388 & D.27389;
          if (D.27390 != 0) goto <D.27391>; else goto <D.27392>;
          <D.27391>:
          D.27393 = &MEM[(void *)"CallConvThiscall" + 1B];
          D.27394 = *D.27393;
          D.27395 = (int) D.27394;
          D.27396 = __s2 + 1;
          D.27397 = *D.27396;
          D.27398 = (int) D.27397;
          __result = D.27395 - D.27398;
          D.27399 = __s2_len > 1;
          D.27389 = __result == 0;
          D.27400 = D.27399 & D.27389;
          if (D.27400 != 0) goto <D.27401>; else goto <D.27402>;
          <D.27401>:
          D.27403 = &MEM[(void *)"CallConvThiscall" + 2B];
          D.27404 = *D.27403;
          D.27405 = (int) D.27404;
          D.27406 = __s2 + 2;
          D.27407 = *D.27406;
          D.27408 = (int) D.27407;
          __result = D.27405 - D.27408;
          D.27409 = __s2_len > 2;
          D.27389 = __result == 0;
          D.27410 = D.27409 & D.27389;
          if (D.27410 != 0) goto <D.27411>; else goto <D.27412>;
          <D.27411>:
          D.27413 = &MEM[(void *)"CallConvThiscall" + 3B];
          D.27414 = *D.27413;
          D.27415 = (int) D.27414;
          D.27416 = __s2 + 3;
          D.27417 = *D.27416;
          D.27418 = (int) D.27417;
          __result = D.27415 - D.27418;
          <D.27412>:
          <D.27402>:
          <D.27392>:
        }
        D.21009 = __result;
      }
      iftmp.315 = -D.21009;
      goto <D.27419>;
      <D.27382>:
      D.27290 = cmod_class->name;
      iftmp.315 = __builtin_strcmp (D.27290, "CallConvThiscall");
      <D.27419>:
      D.21010 = iftmp.315;
    }
    if (D.21010 == 0) goto <D.27420>; else goto <D.27421>;
    <D.27420>:
    csig->call_convention = 3;
    <D.27421>:
    <D.27379>:
    <D.27336>:
    <D.27293>:
    <D.27249>:
    <D.27206>:
  }
  i = i + 1;
  <D.21012>:
  D.27187 = sig->ret;
  D.27422 = D.27187->num_mods;
  D.27423 = (int) D.27422;
  if (D.27423 > i) goto <D.21011>; else goto <D.21013>;
  <D.21013>:
  <D.27193>:
  <D.27189>:
}


mono_class_has_parent (struct MonoClass * klass, struct MonoClass * parent)
{
  struct MonoClass * * D.27424;
  _Bool D.27425;
  long int D.27426;
  long int D.27427;
  struct MonoClass * * D.27430;
  _Bool D.27431;
  long int D.27432;
  long int D.27433;
  gboolean D.27436;

  D.27424 = klass->supertypes;
  D.27425 = D.27424 == 0B;
  D.27426 = (long int) D.27425;
  D.27427 = __builtin_expect (D.27426, 0);
  if (D.27427 != 0) goto <D.27428>; else goto <D.27429>;
  <D.27428>:
  mono_class_setup_supertypes (klass);
  <D.27429>:
  D.27430 = parent->supertypes;
  D.27431 = D.27430 == 0B;
  D.27432 = (long int) D.27431;
  D.27433 = __builtin_expect (D.27432, 0);
  if (D.27433 != 0) goto <D.27434>; else goto <D.27435>;
  <D.27434>:
  mono_class_setup_supertypes (parent);
  <D.27435>:
  D.27436 = mono_class_has_parent_fast (klass, parent);
  return D.27436;
}


mono_class_has_parent_fast (struct MonoClass * klass, struct MonoClass * parent)
{
  gboolean D.27438;
  int iftmp.316;
  short unsigned int D.27442;
  short unsigned int D.27443;
  struct MonoClass * * D.27445;
  long unsigned int D.27446;
  long unsigned int D.27447;
  sizetype D.27448;
  struct MonoClass * * D.27449;
  struct MonoClass * D.27450;

  D.27442 = klass->idepth;
  D.27443 = parent->idepth;
  if (D.27442 >= D.27443) goto <D.27444>; else goto <D.27440>;
  <D.27444>:
  D.27445 = klass->supertypes;
  D.27443 = parent->idepth;
  D.27446 = (long unsigned int) D.27443;
  D.27447 = D.27446 * 8;
  D.27448 = D.27447 + 18446744073709551608;
  D.27449 = D.27445 + D.27448;
  D.27450 = *D.27449;
  if (D.27450 == parent) goto <D.27451>; else goto <D.27440>;
  <D.27451>:
  iftmp.316 = 1;
  goto <D.27441>;
  <D.27440>:
  iftmp.316 = 0;
  <D.27441>:
  D.27438 = iftmp.316;
  return D.27438;
}


mono_marshal_get_vtfixup_ftnptr (struct MonoImage * image, guint32 token, guint16 type)
{
  _Bool D.27453;
  long int D.27454;
  long int D.27455;
  _Bool D.27458;
  long int D.27459;
  long int D.27460;
  int D.27463;
  int D.27464;
  unsigned char D.27467;
  unsigned char D.27468;
  _Bool D.27469;
  long int D.27470;
  long int D.27471;
  short unsigned int D.27474;
  int D.27475;
  int D.27476;
  long unsigned int D.27477;
  long unsigned int D.27478;
  const char * D.27479;
  struct MonoClass * D.27480;
  int D.27481;
  long unsigned int D.27482;
  long unsigned int D.27483;
  struct MonoMarshalSpec * * D.27484;
  struct MonoMarshalSpec * D.27485;
  void * D.27488;
  <unnamed-unsigned:1> D.27489;
  int D.27490;
  unsigned int i.317;
  int D.27492;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  int i;
  int param_count;

  D.27453 = token == 0;
  D.27454 = (long int) D.27453;
  D.27455 = __builtin_expect (D.27454, 0);
  if (D.27455 != 0) goto <D.27456>; else goto <D.27457>;
  <D.27456>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9608, "token");
  <D.27457>:
  method = mono_get_method (image, token, 0B);
  D.27458 = method == 0B;
  D.27459 = (long int) D.27458;
  D.27460 = __builtin_expect (D.27459, 0);
  if (D.27460 != 0) goto <D.27461>; else goto <D.27462>;
  <D.27461>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9611, "method");
  <D.27462>:
  D.27463 = (int) type;
  D.27464 = D.27463 & 12;
  if (D.27464 != 0) goto <D.27465>; else goto <D.27466>;
  <D.27465>:
  {
    struct MonoMethodSignature * csig;
    struct MonoMarshalSpec * * mspecs;
    struct EmitMarshalContext m;

    try
      {
        sig = mono_method_signature (method);
        D.27467 = BIT_FIELD_REF <*sig, 8, 112>;
        D.27468 = D.27467 & 64;
        D.27469 = D.27468 != 0;
        D.27470 = (long int) D.27469;
        D.27471 = __builtin_expect (D.27470, 0);
        if (D.27471 != 0) goto <D.27472>; else goto <D.27473>;
        <D.27472>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9619, "!sig->hasthis");
        <D.27473>:
        D.27474 = sig->param_count;
        D.27475 = (int) D.27474;
        D.27476 = D.27475 + 1;
        D.27477 = (long unsigned int) D.27476;
        D.27478 = D.27477 * 8;
        mspecs = monoeg_malloc0 (D.27478);
        mono_method_get_marshal_info (method, mspecs);
        D.27479 = method->name;
        D.27480 = method->klass;
        mb = mono_mb_new (D.27480, D.27479, 5);
        csig = signature_dup (image, sig);
        csig->hasthis = 0;
        csig->pinvoke = 1;
        m.mb = mb;
        m.sig = sig;
        m.piinfo = 0B;
        m.retobj_var = 0;
        m.csig = csig;
        m.image = image;
        mono_marshal_set_callconv_from_modopt (method, csig);
        mono_marshal_emit_managed_wrapper (mb, sig, mspecs, &m, method, 0);
        mb->dynamic = 1;
        D.27474 = sig->param_count;
        D.27475 = (int) D.27474;
        D.27481 = D.27475 + 16;
        method = mono_mb_create_method (mb, csig, D.27481);
        mono_mb_free (mb);
        D.27474 = sig->param_count;
        i = (int) D.27474;
        goto <D.21105>;
        <D.21104>:
        D.27482 = (long unsigned int) i;
        D.27483 = D.27482 * 8;
        D.27484 = mspecs + D.27483;
        D.27485 = *D.27484;
        if (D.27485 != 0B) goto <D.27486>; else goto <D.27487>;
        <D.27486>:
        D.27482 = (long unsigned int) i;
        D.27483 = D.27482 * 8;
        D.27484 = mspecs + D.27483;
        D.27485 = *D.27484;
        mono_metadata_free_marshal_spec (D.27485);
        <D.27487>:
        i = i + -1;
        <D.21105>:
        if (i >= 0) goto <D.21104>; else goto <D.21106>;
        <D.21106>:
        monoeg_g_free (mspecs);
        D.27488 = mono_compile_method (method);
        return D.27488;
      }
    finally
      {
        m = {CLOBBER};
      }
  }
  <D.27466>:
  sig = mono_method_signature (method);
  D.27479 = method->name;
  D.27480 = method->klass;
  mb = mono_mb_new (D.27480, D.27479, 7);
  D.27474 = sig->param_count;
  D.27475 = (int) D.27474;
  D.27489 = sig->hasthis;
  D.27490 = (int) D.27489;
  param_count = D.27475 + D.27490;
  i = 0;
  goto <D.21108>;
  <D.21107>:
  i.317 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.317);
  i = i + 1;
  <D.21108>:
  if (i < param_count) goto <D.21107>; else goto <D.21109>;
  <D.21109>:
  D.27463 = (int) type;
  D.27492 = D.27463 & 16;
  if (D.27492 != 0) goto <D.27493>; else goto <D.27494>;
  <D.27493>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.27495>;
  <D.27494>:
  mono_mb_emit_op (mb, 40, method);
  <D.27495>:
  mono_mb_emit_byte (mb, 42);
  mb->dynamic = 1;
  method = mono_mb_create_method (mb, sig, param_count);
  mono_mb_free (mb);
  D.27488 = mono_compile_method (method);
  return D.27488;
}


mono_marshal_get_castclass_with_cache ()
{
  struct MonoMethod * cached.318;
  struct MonoMethod * D.27501;
  struct MonoClass * D.27502;
  struct MonoImage * D.27503;
  struct MonoType * D.27504;
  struct MonoClass * D.27505;
  struct MonoType * D.27506;
  unsigned int D.27507;
  unsigned int D.27508;
  unsigned int cache_miss_pos.319;
  unsigned int D.27510;
  unsigned int invalid_cast_pos.320;
  unsigned int return_null_pos.321;
  void * D.27513;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int invalid_cast_pos;
  struct WrapperInfo * info;

  cached.318 = cached;
  if (cached.318 != 0B) goto <D.27499>; else goto <D.27500>;
  <D.27499>:
  D.27501 = cached;
  return D.27501;
  <D.27500>:
  D.27502 = mono_defaults.object_class;
  mb = mono_mb_new (D.27502, "__castclass_with_cache", 19);
  D.27503 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27503, 3);
  D.27502 = mono_defaults.object_class;
  D.27504 = &D.27502->byval_arg;
  sig->params[0] = D.27504;
  D.27505 = mono_defaults.int_class;
  D.27506 = &D.27505->byval_arg;
  sig->params[1] = D.27506;
  D.27505 = mono_defaults.int_class;
  D.27506 = &D.27505->byval_arg;
  sig->params[2] = D.27506;
  D.27502 = mono_defaults.object_class;
  D.27504 = &D.27502->byval_arg;
  sig->ret = D.27504;
  sig->pinvoke = 0;
  D.27505 = mono_defaults.int_class;
  D.27506 = &D.27505->byval_arg;
  mono_mb_add_local (mb, D.27506);
  mono_mb_emit_ldarg (mb, 0);
  D.27507 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27507;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldloc (mb, 0);
  D.27508 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27508;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.319 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.319);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27510 = mono_mb_emit_branch (mb, 57);
  invalid_cast_pos = (int) D.27510;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  invalid_cast_pos.320 = (unsigned int) invalid_cast_pos;
  mono_mb_patch_branch (mb, invalid_cast_pos.320);
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  return_null_pos.321 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.321);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 9);
  mono_marshal_set_wrapper_info (res, info);
  D.27513 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27513 != 0B) goto <D.27514>; else goto <D.27515>;
  <D.27514>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27515>:
  mono_mb_free (mb);
  D.27501 = cached;
  return D.27501;
}


InterlockedCompareExchangePointer (void * volatile * dest, void * exch, void * comp)
{
  void * D.27517;
  long unsigned int exch.322;
  long unsigned int comp.323;
  long unsigned int D.27520;

  exch.322 = (long unsigned int) exch;
  comp.323 = (long unsigned int) comp;
  D.27520 = __sync_val_compare_and_swap_8 (dest, comp.323, exch.322);
  D.27517 = (void *) D.27520;
  return D.27517;
}


mono_marshal_get_isinst_with_cache ()
{
  struct MonoMethod * cached.324;
  struct MonoMethod * D.27525;
  struct MonoClass * D.27526;
  struct MonoImage * D.27527;
  struct MonoType * D.27528;
  struct MonoClass * D.27529;
  struct MonoType * D.27530;
  unsigned int D.27531;
  unsigned int D.27532;
  unsigned int D.27533;
  unsigned int D.27534;
  unsigned int negative_cache_hit_pos.325;
  unsigned int cache_hit_pos.326;
  unsigned int cache_miss_pos.327;
  unsigned int D.27538;
  unsigned int not_an_instance_pos.328;
  unsigned int return_null_pos.329;
  void * D.27541;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int cache_hit_pos;
  int not_an_instance_pos;
  int negative_cache_hit_pos;
  struct WrapperInfo * info;

  cached.324 = cached;
  if (cached.324 != 0B) goto <D.27523>; else goto <D.27524>;
  <D.27523>:
  D.27525 = cached;
  return D.27525;
  <D.27524>:
  D.27526 = mono_defaults.object_class;
  mb = mono_mb_new (D.27526, "__isinst_with_cache", 19);
  D.27527 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27527, 3);
  D.27526 = mono_defaults.object_class;
  D.27528 = &D.27526->byval_arg;
  sig->params[0] = D.27528;
  D.27529 = mono_defaults.int_class;
  D.27530 = &D.27529->byval_arg;
  sig->params[1] = D.27530;
  D.27529 = mono_defaults.int_class;
  D.27530 = &D.27529->byval_arg;
  sig->params[2] = D.27530;
  D.27526 = mono_defaults.object_class;
  D.27528 = &D.27526->byval_arg;
  sig->ret = D.27528;
  sig->pinvoke = 0;
  D.27529 = mono_defaults.int_class;
  D.27530 = &D.27529->byval_arg;
  mono_mb_add_local (mb, D.27530);
  D.27529 = mono_defaults.int_class;
  D.27530 = &D.27529->byval_arg;
  mono_mb_add_local (mb, D.27530);
  mono_mb_emit_ldarg (mb, 0);
  D.27531 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27531;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 32);
  mono_mb_emit_i4 (mb, -2);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_ldloc (mb, 0);
  D.27532 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27532;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 95);
  D.27533 = mono_mb_emit_branch (mb, 58);
  negative_cache_hit_pos = (int) D.27533;
  mono_mb_emit_ldarg (mb, 0);
  D.27534 = mono_mb_emit_branch (mb, 56);
  cache_hit_pos = (int) D.27534;
  negative_cache_hit_pos.325 = (unsigned int) negative_cache_hit_pos;
  mono_mb_patch_branch (mb, negative_cache_hit_pos.325);
  mono_mb_emit_byte (mb, 20);
  cache_hit_pos.326 = (unsigned int) cache_hit_pos;
  mono_mb_patch_branch (mb, cache_hit_pos.326);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.327 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.327);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27538 = mono_mb_emit_branch (mb, 57);
  not_an_instance_pos = (int) D.27538;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  not_an_instance_pos.328 = (unsigned int) not_an_instance_pos;
  mono_mb_patch_branch (mb, not_an_instance_pos.328);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 96);
  mono_mb_emit_byte (mb, 223);
  return_null_pos.329 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.329);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 10);
  mono_marshal_set_wrapper_info (res, info);
  D.27541 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27541 != 0B) goto <D.27542>; else goto <D.27543>;
  <D.27542>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27543>:
  mono_mb_free (mb);
  D.27525 = cached;
  return D.27525;
}


mono_marshal_get_isinst (struct MonoClass * klass)
{
  struct MonoImage * D.27545;
  struct GHashTable * * D.27546;
  struct MonoMethod * D.27549;
  struct MonoMethodSignature * isint_sig.330;
  struct MonoImage * D.27553;
  struct MonoMethodSignature * isint_sig.331;
  struct MonoClass * D.27555;
  struct MonoType * D.27556;
  const char * D.27557;
  struct MonoMethod * D.27558;
  unsigned int D.27559;
  unsigned int D.27560;
  struct MonoMethod * D.27561;
  unsigned int D.27562;
  unsigned int pos_failed.332;
  unsigned int D.27564;
  unsigned int pos_was_ok.333;
  unsigned int pos_end.334;
  unsigned int pos_end2.335;
  short unsigned int D.27568;
  int D.27569;
  int D.27570;
  static struct MonoMethodSignature * isint_sig = 0B;
  struct GHashTable * cache;
  struct MonoMethod * res;
  int pos_was_ok;
  int pos_end;
  int pos_end2;
  int pos_failed;
  char * name;
  struct MonoMethodBuilder * mb;

  D.27545 = klass->image;
  D.27546 = &D.27545->isinst_cache;
  cache = get_cache (D.27546, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27547>; else goto <D.27548>;
  <D.27547>:
  D.27549 = res;
  return D.27549;
  <D.27548>:
  isint_sig.330 = isint_sig;
  if (isint_sig.330 == 0B) goto <D.27551>; else goto <D.27552>;
  <D.27551>:
  D.27553 = mono_defaults.corlib;
  isint_sig.331 = mono_metadata_signature_alloc (D.27553, 1);
  isint_sig = isint_sig.331;
  isint_sig.330 = isint_sig;
  D.27555 = mono_defaults.object_class;
  D.27556 = &D.27555->byval_arg;
  isint_sig.330->params[0] = D.27556;
  isint_sig.330 = isint_sig;
  D.27555 = mono_defaults.object_class;
  D.27556 = &D.27555->byval_arg;
  isint_sig.330->ret = D.27556;
  isint_sig.330 = isint_sig;
  isint_sig.330->pinvoke = 0;
  <D.27552>:
  D.27557 = klass->name;
  name = monoeg_g_strdup_printf ("__isinst_wrapper_%s", D.27557);
  D.27555 = mono_defaults.object_class;
  mb = mono_mb_new (D.27555, name, 18);
  monoeg_g_free (name);
  D.27558 = mb->method;
  D.27558->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 7, klass);
  mono_mb_emit_byte (mb, 37);
  D.27559 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27559;
  mono_mb_emit_byte (mb, 24);
  D.27560 = mono_mb_emit_branch (mb, 64);
  pos_failed = (int) D.27560;
  mono_mb_emit_ldarg (mb, 0);
  D.27561 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27561, 0B);
  D.27562 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27562;
  pos_failed.332 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.332);
  mono_mb_emit_byte (mb, 20);
  D.27564 = mono_mb_emit_branch (mb, 56);
  pos_end2 = (int) D.27564;
  pos_was_ok.333 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.333);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 0);
  pos_end.334 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.334);
  pos_end2.335 = (unsigned int) pos_end2;
  mono_mb_patch_branch (mb, pos_end2.335);
  mono_mb_emit_byte (mb, 42);
  isint_sig.330 = isint_sig;
  D.27568 = isint_sig.330->param_count;
  D.27569 = (int) D.27568;
  D.27570 = D.27569 + 16;
  isint_sig.330 = isint_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.330, D.27570);
  mono_mb_free (mb);
  D.27549 = res;
  return D.27549;
}


mono_marshal_get_castclass (struct MonoClass * klass)
{
  struct MonoImage * D.27572;
  struct GHashTable * * D.27573;
  struct MonoMethod * D.27576;
  struct MonoMethodSignature * castclass_sig.336;
  struct MonoImage * D.27580;
  struct MonoMethodSignature * castclass_sig.337;
  struct MonoClass * D.27582;
  struct MonoType * D.27583;
  const char * D.27584;
  struct MonoMethod * D.27585;
  unsigned int D.27586;
  struct MonoMethod * D.27587;
  unsigned int D.27588;
  unsigned int pos_was_ok.338;
  unsigned int pos_was_ok2.339;
  short unsigned int D.27591;
  int D.27592;
  int D.27593;
  static struct MonoMethodSignature * castclass_sig = 0B;
  struct GHashTable * cache;
  struct MonoMethod * res;
  int pos_was_ok;
  int pos_was_ok2;
  char * name;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  D.27572 = klass->image;
  D.27573 = &D.27572->castclass_cache;
  cache = get_cache (D.27573, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27574>; else goto <D.27575>;
  <D.27574>:
  D.27576 = res;
  return D.27576;
  <D.27575>:
  castclass_sig.336 = castclass_sig;
  if (castclass_sig.336 == 0B) goto <D.27578>; else goto <D.27579>;
  <D.27578>:
  D.27580 = mono_defaults.corlib;
  castclass_sig.337 = mono_metadata_signature_alloc (D.27580, 1);
  castclass_sig = castclass_sig.337;
  castclass_sig.336 = castclass_sig;
  D.27582 = mono_defaults.object_class;
  D.27583 = &D.27582->byval_arg;
  castclass_sig.336->params[0] = D.27583;
  castclass_sig.336 = castclass_sig;
  D.27582 = mono_defaults.object_class;
  D.27583 = &D.27582->byval_arg;
  castclass_sig.336->ret = D.27583;
  castclass_sig.336 = castclass_sig;
  castclass_sig.336->pinvoke = 0;
  <D.27579>:
  D.27584 = klass->name;
  name = monoeg_g_strdup_printf ("__castclass_wrapper_%s", D.27584);
  D.27582 = mono_defaults.object_class;
  mb = mono_mb_new (D.27582, name, 19);
  monoeg_g_free (name);
  D.27585 = mb->method;
  D.27585->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 8, klass);
  D.27586 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27586;
  mono_mb_emit_ldarg (mb, 0);
  D.27587 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27587, 0B);
  D.27588 = mono_mb_emit_branch (mb, 58);
  pos_was_ok2 = (int) D.27588;
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  pos_was_ok.338 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.338);
  pos_was_ok2.339 = (unsigned int) pos_was_ok2;
  mono_mb_patch_branch (mb, pos_was_ok2.339);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  castclass_sig.336 = castclass_sig;
  D.27591 = castclass_sig.336->param_count;
  D.27592 = (int) D.27591;
  D.27593 = D.27592 + 16;
  castclass_sig.336 = castclass_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig.336, D.27593);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 0);
  mono_marshal_set_wrapper_info (res, info);
  D.27576 = res;
  return D.27576;
}


mono_marshal_get_proxy_cancast (struct MonoClass * klass)
{
  struct MonoImage * D.27595;
  struct GHashTable * * D.27596;
  struct MonoMethod * D.27599;
  struct MonoMethodSignature * isint_sig.340;
  struct MonoImage * D.27603;
  struct MonoMethodSignature * isint_sig.341;
  struct MonoClass * D.27605;
  struct MonoType * D.27606;
  struct MonoType * D.27607;
  struct MonoMethod * D.27608;
  struct MonoClass * D.27609;
  _Bool D.27610;
  long int D.27611;
  long int D.27612;
  unsigned int D.27615;
  unsigned int D.27616;
  unsigned int pos_failed.342;
  unsigned int pos_end.343;
  short unsigned int D.27619;
  int D.27620;
  int D.27621;
  static struct MonoMethodSignature * isint_sig = 0B;
  struct GHashTable * cache;
  struct MonoMethod * res;
  int pos_failed;
  int pos_end;
  char * name;
  char * klass_name;
  struct MonoMethod * can_cast_to;
  struct MonoMethodDesc * desc;
  struct MonoMethodBuilder * mb;

  D.27595 = klass->image;
  D.27596 = &D.27595->proxy_isinst_cache;
  cache = get_cache (D.27596, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27597>; else goto <D.27598>;
  <D.27597>:
  D.27599 = res;
  return D.27599;
  <D.27598>:
  isint_sig.340 = isint_sig;
  if (isint_sig.340 == 0B) goto <D.27601>; else goto <D.27602>;
  <D.27601>:
  D.27603 = mono_defaults.corlib;
  isint_sig.341 = mono_metadata_signature_alloc (D.27603, 1);
  isint_sig = isint_sig.341;
  isint_sig.340 = isint_sig;
  D.27605 = mono_defaults.object_class;
  D.27606 = &D.27605->byval_arg;
  isint_sig.340->params[0] = D.27606;
  isint_sig.340 = isint_sig;
  D.27605 = mono_defaults.object_class;
  D.27606 = &D.27605->byval_arg;
  isint_sig.340->ret = D.27606;
  isint_sig.340 = isint_sig;
  isint_sig.340->pinvoke = 0;
  <D.27602>:
  D.27607 = &klass->byval_arg;
  klass_name = mono_type_full_name (D.27607);
  name = monoeg_g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name);
  D.27605 = mono_defaults.object_class;
  mb = mono_mb_new (D.27605, name, 20);
  monoeg_g_free (klass_name);
  monoeg_g_free (name);
  D.27608 = mb->method;
  D.27608->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  D.27607 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27607);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", 0);
  D.27609 = mono_defaults.iremotingtypeinfo_class;
  can_cast_to = mono_method_desc_search_in_class (desc, D.27609);
  D.27610 = can_cast_to == 0B;
  D.27611 = (long int) D.27610;
  D.27612 = __builtin_expect (D.27611, 0);
  if (D.27612 != 0) goto <D.27613>; else goto <D.27614>;
  <D.27613>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10142, "can_cast_to");
  <D.27614>:
  mono_method_desc_free (desc);
  mono_mb_emit_op (mb, 111, can_cast_to);
  D.27615 = mono_mb_emit_branch (mb, 57);
  pos_failed = (int) D.27615;
  D.27607 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27607);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icall (mb, mono_upgrade_remote_class_wrapper);
  emit_thread_interrupt_checkpoint (mb);
  mono_mb_emit_ldarg (mb, 0);
  D.27616 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27616;
  pos_failed.342 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.342);
  mono_mb_emit_byte (mb, 20);
  pos_end.343 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.343);
  mono_mb_emit_byte (mb, 42);
  isint_sig.340 = isint_sig;
  D.27619 = isint_sig.340->param_count;
  D.27620 = (int) D.27619;
  D.27621 = D.27620 + 16;
  isint_sig.340 = isint_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.340, D.27621);
  mono_mb_free (mb);
  D.27599 = res;
  return D.27599;
}


mono_upgrade_remote_class_wrapper (struct MonoReflectionType * rtype, struct MonoTransparentProxy * tproxy)
{
  struct MonoVTable * D.27623;
  struct MonoType * D.27624;
  struct MonoClass * klass;
  struct MonoDomain * domain;

  D.27623 = MEM[(struct MonoObject *)tproxy].vtable;
  domain = D.27623->domain;
  D.27624 = rtype->type;
  klass = mono_class_from_mono_type (D.27624);
  mono_upgrade_remote_class (domain, tproxy, klass);
}


mono_marshal_get_struct_to_ptr (struct MonoClass * klass)
{
  _Bool D.27625;
  long int D.27626;
  long int D.27627;
  struct MonoMarshalType * D.27630;
  struct MonoMethod * D.27631;
  struct MonoMethod * D.27634;
  struct MonoMethod * stoptr.344;
  struct MonoClass * D.27638;
  struct MonoMethod * stoptr.345;
  _Bool D.27640;
  long int D.27641;
  long int D.27642;
  const char * D.27645;
  unsigned char D.27646;
  unsigned char D.27647;
  int D.27650;
  struct MonoClass * D.27652;
  struct MonoType * D.27653;
  struct MonoClass * D.27654;
  struct MonoType * D.27655;
  struct MonoMethodSignature * D.27656;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * stoptr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27625 = klass == 0B;
  D.27626 = (long int) D.27625;
  D.27627 = __builtin_expect (D.27626, 0);
  if (D.27627 != 0) goto <D.27628>; else goto <D.27629>;
  <D.27628>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10201, "klass != NULL");
  <D.27629>:
  mono_marshal_load_type_info (klass);
  D.27630 = klass->marshal_info;
  D.27631 = D.27630->str_to_ptr;
  if (D.27631 != 0B) goto <D.27632>; else goto <D.27633>;
  <D.27632>:
  D.27630 = klass->marshal_info;
  D.27634 = D.27630->str_to_ptr;
  return D.27634;
  <D.27633>:
  stoptr.344 = stoptr;
  if (stoptr.344 == 0B) goto <D.27636>; else goto <D.27637>;
  <D.27636>:
  D.27638 = mono_defaults.marshal_class;
  stoptr.345 = mono_class_get_method_from_name (D.27638, "StructureToPtr", 3);
  stoptr = stoptr.345;
  <D.27637>:
  stoptr.344 = stoptr;
  D.27640 = stoptr.344 == 0B;
  D.27641 = (long int) D.27640;
  D.27642 = __builtin_expect (D.27641, 0);
  if (D.27642 != 0) goto <D.27643>; else goto <D.27644>;
  <D.27643>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10210, "stoptr");
  <D.27644>:
  stoptr.344 = stoptr;
  D.27645 = stoptr.344->name;
  mb = mono_mb_new (klass, D.27645, 25);
  D.27646 = BIT_FIELD_REF <*klass, 8, 256>;
  D.27647 = D.27646 & 32;
  if (D.27647 != 0) goto <D.27648>; else goto <D.27649>;
  <D.27648>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 16);
  D.27650 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27650);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27651>;
  <D.27649>:
  D.27652 = mono_defaults.int_class;
  D.27653 = &D.27652->byval_arg;
  mono_mb_add_local (mb, D.27653);
  D.27652 = mono_defaults.int_class;
  D.27653 = &D.27652->byval_arg;
  mono_mb_add_local (mb, D.27653);
  D.27654 = mono_defaults.boolean_class;
  D.27655 = &D.27654->byval_arg;
  mono_mb_add_local (mb, D.27655);
  mono_mb_emit_byte (mb, 4);
  mono_mb_emit_stloc (mb, 2);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.27651>:
  mono_mb_emit_byte (mb, 42);
  stoptr.344 = stoptr;
  D.27656 = mono_signature_no_pinvoke (stoptr.344);
  res = mono_mb_create_method (mb, D.27656, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 8);
  mono_marshal_set_wrapper_info (res, info);
  D.27630 = klass->marshal_info;
  D.27630->str_to_ptr = res;
  D.27634 = res;
  return D.27634;
}


mono_marshal_get_ptr_to_struct (struct MonoClass * klass)
{
  _Bool D.27658;
  long int D.27659;
  long int D.27660;
  struct MonoMarshalType * D.27663;
  struct MonoMethod * D.27664;
  struct MonoMethod * D.27667;
  struct MonoMethodSignature * ptostr.346;
  struct MonoImage * D.27671;
  unsigned char D.27672;
  unsigned char D.27673;
  int D.27676;
  struct MonoClass * D.27678;
  struct MonoType * D.27679;
  struct MonoType * D.27680;
  struct MonoMethodBuilder * mb;
  static struct MonoMethodSignature * ptostr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27658 = klass == 0B;
  D.27659 = (long int) D.27658;
  D.27660 = __builtin_expect (D.27659, 0);
  if (D.27660 != 0) goto <D.27661>; else goto <D.27662>;
  <D.27661>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10273, "klass != NULL");
  <D.27662>:
  mono_marshal_load_type_info (klass);
  D.27663 = klass->marshal_info;
  D.27664 = D.27663->ptr_to_str;
  if (D.27664 != 0B) goto <D.27665>; else goto <D.27666>;
  <D.27665>:
  D.27663 = klass->marshal_info;
  D.27667 = D.27663->ptr_to_str;
  return D.27667;
  <D.27666>:
  ptostr.346 = ptostr;
  if (ptostr.346 == 0B) goto <D.27669>; else goto <D.27670>;
  <D.27669>:
  {
    struct MonoMethodSignature * sig;

    sig = mono_create_icall_signature ("void ptr object");
    D.27671 = mono_defaults.corlib;
    sig = signature_dup (D.27671, sig);
    sig->pinvoke = 0;
    mono_memory_barrier ();
    ptostr = sig;
  }
  <D.27670>:
  mb = mono_mb_new (klass, "PtrToStructure", 25);
  D.27672 = BIT_FIELD_REF <*klass, 8, 256>;
  D.27673 = D.27672 & 32;
  if (D.27673 != 0) goto <D.27674>; else goto <D.27675>;
  <D.27674>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 2);
  D.27676 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27676);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27677>;
  <D.27675>:
  D.27678 = mono_defaults.int_class;
  D.27679 = &D.27678->byval_arg;
  mono_mb_add_local (mb, D.27679);
  D.27680 = &klass->this_arg;
  mono_mb_add_local (mb, D.27680);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_op (mb, 121, klass);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  <D.27677>:
  mono_mb_emit_byte (mb, 42);
  ptostr.346 = ptostr;
  res = mono_mb_create_method (mb, ptostr.346, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 7);
  mono_marshal_set_wrapper_info (res, info);
  D.27663 = klass->marshal_info;
  D.27663->ptr_to_str = res;
  D.27667 = res;
  return D.27667;
}


mono_marshal_get_synchronized_inner_wrapper (struct MonoMethod * method)
{
  unsigned char D.27682;
  unsigned char D.27683;
  struct MonoGenericContext * D.27686;
  struct MonoGenericInst * D.27687;
  struct MonoClass * D.27692;
  _Bool D.27693;
  long int D.27694;
  long int D.27695;
  const char * D.27698;
  struct MonoMethodSignature * D.27699;
  struct MonoImage * D.27700;
  struct MonoMethod * D.27703;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;
  struct MonoMethodSignature * sig;
  struct MonoMethod * res;
  struct MonoGenericContext * ctx;
  struct MonoMethod * orig_method;
  struct MonoGenericContainer * container;

  ctx = 0B;
  orig_method = 0B;
  container = 0B;
  D.27682 = BIT_FIELD_REF <*method, 8, 264>;
  D.27683 = D.27682 & 16;
  if (D.27683 != 0) goto <D.27684>; else goto <D.27685>;
  <D.27684>:
  D.27686 = mono_method_get_context (method);
  D.27687 = D.27686->method_inst;
  if (D.27687 == 0B) goto <D.27688>; else goto <D.27689>;
  <D.27688>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  container = mono_method_get_generic_container (method);
  if (container == 0B) goto <D.27690>; else goto <D.27691>;
  <D.27690>:
  D.27692 = method->klass;
  container = D.27692->generic_container;
  <D.27691>:
  D.27693 = container == 0B;
  D.27694 = (long int) D.27693;
  D.27695 = __builtin_expect (D.27694, 0);
  if (D.27695 != 0) goto <D.27696>; else goto <D.27697>;
  <D.27696>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10360, "container");
  <D.27697>:
  <D.27689>:
  <D.27685>:
  D.27698 = method->name;
  D.27692 = method->klass;
  mb = mono_mb_new (D.27692, D.27698, 25);
  mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn\'t be called.");
  mono_mb_emit_byte (mb, 42);
  D.27699 = mono_method_signature (method);
  D.27692 = method->klass;
  D.27700 = D.27692->image;
  sig = signature_dup (D.27700, D.27699);
  res = mono_mb_create_method (mb, sig, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 17);
  info->d.synchronized_inner.method = method;
  mono_marshal_set_wrapper_info (res, info);
  if (ctx != 0B) goto <D.27701>; else goto <D.27702>;
  <D.27701>:
  res = mono_class_inflate_generic_method (res, ctx);
  <D.27702>:
  D.27703 = res;
  return D.27703;
}


mono_marshal_get_synchronized_wrapper (struct MonoMethod * method)
{
  _Bool D.27705;
  long int D.27706;
  long int D.27707;
  unsigned char D.27710;
  unsigned char D.27711;
  struct MonoMethod * D.27714;
  unsigned char D.27715;
  unsigned char D.27716;
  struct MonoGenericContext * D.27719;
  struct MonoGenericInst * D.27720;
  struct MonoClass * D.27725;
  _Bool D.27726;
  long int D.27727;
  long int D.27728;
  struct MonoImage * D.27733;
  struct GHashTable * * D.27734;
  struct GHashTable * * D.27738;
  struct MonoMethodSignature * D.27741;
  const char * D.27742;
  struct MonoType * D.27743;
  int D.27744;
  unsigned char D.27747;
  unsigned char D.27748;
  short unsigned int D.27751;
  int D.27752;
  int D.27753;
  int D.27756;
  unsigned int ret_local.347;
  short unsigned int D.27760;
  int D.27761;
  int D.27762;
  struct MonoClass * D.27763;
  struct MonoType * D.27764;
  _Bool D.27767;
  long int D.27768;
  long int D.27769;
  struct MonoMethod * enter_method.348;
  struct MonoClass * D.27775;
  struct MonoMethod * enter_method.349;
  _Bool D.27777;
  long int D.27778;
  long int D.27779;
  struct MonoMethod * exit_method.350;
  struct MonoMethod * exit_method.351;
  _Bool D.27784;
  long int D.27785;
  long int D.27786;
  struct MonoClass * D.27789;
  struct MonoMethod * gettypefromhandle_method.352;
  struct MonoMethod * gettypefromhandle_method.353;
  _Bool D.27792;
  long int D.27793;
  long int D.27794;
  _Bool D.27799;
  long int D.27800;
  long int D.27801;
  unsigned int D.27806;
  struct MonoClass * D.27807;
  unsigned int this_local.354;
  int D.27810;
  unsigned int D.27811;
  unsigned char D.27812;
  unsigned char D.27813;
  _Bool D.27816;
  int D.27817;
  int D.27818;
  unsigned int D.27819;
  struct MonoGenericContext * D.27822;
  struct MonoMethod * D.27823;
  int D.27825;
  unsigned int D.27828;
  int D.27829;
  unsigned int D.27830;
  unsigned int D.27831;
  unsigned int D.27832;
  int D.27833;
  unsigned int D.27834;
  int D.27835;
  unsigned int D.27836;
  unsigned int D.27837;
  unsigned int D.27838;
  unsigned int pos.355;
  int D.27840;
  static struct MonoMethod * enter_method;
  static struct MonoMethod * exit_method;
  static struct MonoMethod * gettypefromhandle_method;
  struct MonoMethodSignature * sig;
  struct MonoExceptionClause * clause;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  int i;
  int pos;
  int this_local;
  int ret_local;
  struct MonoGenericContext * ctx;
  struct MonoMethod * orig_method;
  struct MonoGenericContainer * container;

  ret_local = 0;
  ctx = 0B;
  orig_method = 0B;
  container = 0B;
  D.27705 = method == 0B;
  D.27706 = (long int) D.27705;
  D.27707 = __builtin_expect (D.27706, 0);
  if (D.27707 != 0) goto <D.27708>; else goto <D.27709>;
  <D.27708>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10397, "method");
  <D.27709>:
  D.27710 = BIT_FIELD_REF <*method, 8, 256>;
  D.27711 = D.27710 & 124;
  if (D.27711 == 64) goto <D.27712>; else goto <D.27713>;
  <D.27712>:
  D.27714 = method;
  return D.27714;
  <D.27713>:
  D.27715 = BIT_FIELD_REF <*method, 8, 264>;
  D.27716 = D.27715 & 16;
  if (D.27716 != 0) goto <D.27717>; else goto <D.27718>;
  <D.27717>:
  D.27719 = mono_method_get_context (method);
  D.27720 = D.27719->method_inst;
  if (D.27720 == 0B) goto <D.27721>; else goto <D.27722>;
  <D.27721>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  container = mono_method_get_generic_container (method);
  if (container == 0B) goto <D.27723>; else goto <D.27724>;
  <D.27723>:
  D.27725 = method->klass;
  container = D.27725->generic_container;
  <D.27724>:
  D.27726 = container == 0B;
  D.27727 = (long int) D.27726;
  D.27728 = __builtin_expect (D.27727, 0);
  if (D.27728 != 0) goto <D.27729>; else goto <D.27730>;
  <D.27729>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10410, "container");
  <D.27730>:
  <D.27722>:
  <D.27718>:
  if (ctx != 0B) goto <D.27731>; else goto <D.27732>;
  <D.27731>:
  D.27725 = method->klass;
  D.27733 = D.27725->image;
  D.27734 = &D.27733->synchronized_generic_cache;
  cache = get_cache (D.27734, mono_aligned_addr_hash, 0B);
  res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
  if (res != 0B) goto <D.27735>; else goto <D.27736>;
  <D.27735>:
  D.27714 = res;
  return D.27714;
  <D.27736>:
  goto <D.27737>;
  <D.27732>:
  D.27725 = method->klass;
  D.27733 = D.27725->image;
  D.27738 = &D.27733->synchronized_cache;
  cache = get_cache (D.27738, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27739>; else goto <D.27740>;
  <D.27739>:
  D.27714 = res;
  return D.27714;
  <D.27740>:
  <D.27737>:
  D.27741 = mono_method_signature (method);
  D.27725 = method->klass;
  D.27733 = D.27725->image;
  sig = signature_dup (D.27733, D.27741);
  sig->pinvoke = 0;
  D.27742 = method->name;
  D.27725 = method->klass;
  mb = mono_mb_new (D.27725, D.27742, 16);
  D.27743 = sig->ret;
  D.27744 = mono_type_is_void (D.27743);
  if (D.27744 == 0) goto <D.27745>; else goto <D.27746>;
  <D.27745>:
  D.27743 = sig->ret;
  ret_local = mono_mb_add_local (mb, D.27743);
  <D.27746>:
  D.27725 = method->klass;
  D.27747 = BIT_FIELD_REF <*D.27725, 8, 256>;
  D.27748 = D.27747 & 8;
  if (D.27748 != 0) goto <D.27749>; else goto <D.27750>;
  <D.27749>:
  D.27751 = method->flags;
  D.27752 = (int) D.27751;
  D.27753 = D.27752 & 16;
  if (D.27753 == 0) goto <D.27754>; else goto <D.27755>;
  <D.27754>:
  D.27725 = method->klass;
  mono_class_set_failure (D.27725, 7, 0B);
  mono_mb_emit_byte (mb, 20);
  D.27725 = method->klass;
  mono_mb_emit_op (mb, 117, D.27725);
  mono_mb_emit_byte (mb, 38);
  D.27743 = sig->ret;
  D.27756 = mono_type_is_void (D.27743);
  if (D.27756 == 0) goto <D.27757>; else goto <D.27758>;
  <D.27757>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.347);
  <D.27758>:
  mono_mb_emit_byte (mb, 42);
  D.27760 = sig->param_count;
  D.27761 = (int) D.27760;
  D.27762 = D.27761 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27762);
  mono_mb_free (mb);
  D.27714 = res;
  return D.27714;
  <D.27755>:
  <D.27750>:
  D.27763 = mono_defaults.object_class;
  D.27764 = &D.27763->byval_arg;
  this_local = mono_mb_add_local (mb, D.27764);
  D.27725 = method->klass;
  D.27733 = D.27725->image;
  clause = mono_image_alloc0 (D.27733, 32);
  clause->flags = 2;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27765>; else goto <D.27766>;
    <D.27765>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27766>:
    D.27767 = ret != 0;
    D.27768 = (long int) D.27767;
    D.27769 = __builtin_expect (D.27768, 0);
    if (D.27769 != 0) goto <D.27770>; else goto <D.27771>;
    <D.27770>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10466, "ret == 0");
    <D.27771>:
  }
  enter_method.348 = enter_method;
  if (enter_method.348 == 0B) goto <D.27773>; else goto <D.27774>;
  <D.27773>:
  {
    struct MonoMethodDesc * desc;

    desc = mono_method_desc_new ("Monitor:Enter", 0);
    D.27775 = mono_defaults.monitor_class;
    enter_method.349 = mono_method_desc_search_in_class (desc, D.27775);
    enter_method = enter_method.349;
    enter_method.348 = enter_method;
    D.27777 = enter_method.348 == 0B;
    D.27778 = (long int) D.27777;
    D.27779 = __builtin_expect (D.27778, 0);
    if (D.27779 != 0) goto <D.27780>; else goto <D.27781>;
    <D.27780>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10473, "enter_method");
    <D.27781>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Monitor:Exit", 0);
    D.27775 = mono_defaults.monitor_class;
    exit_method.350 = mono_method_desc_search_in_class (desc, D.27775);
    exit_method = exit_method.350;
    exit_method.351 = exit_method;
    D.27784 = exit_method.351 == 0B;
    D.27785 = (long int) D.27784;
    D.27786 = __builtin_expect (D.27785, 0);
    if (D.27786 != 0) goto <D.27787>; else goto <D.27788>;
    <D.27787>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10478, "exit_method");
    <D.27788>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Type:GetTypeFromHandle", 0);
    D.27789 = mono_defaults.systemtype_class;
    gettypefromhandle_method.352 = mono_method_desc_search_in_class (desc, D.27789);
    gettypefromhandle_method = gettypefromhandle_method.352;
    gettypefromhandle_method.353 = gettypefromhandle_method;
    D.27792 = gettypefromhandle_method.353 == 0B;
    D.27793 = (long int) D.27792;
    D.27794 = __builtin_expect (D.27793, 0);
    if (D.27794 != 0) goto <D.27795>; else goto <D.27796>;
    <D.27795>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10483, "gettypefromhandle_method");
    <D.27796>:
    mono_method_desc_free (desc);
  }
  <D.27774>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27797>; else goto <D.27798>;
    <D.27797>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27798>:
    D.27799 = ret != 0;
    D.27800 = (long int) D.27799;
    D.27801 = __builtin_expect (D.27800, 0);
    if (D.27801 != 0) goto <D.27802>; else goto <D.27803>;
    <D.27802>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10487, "ret == 0");
    <D.27803>:
  }
  D.27751 = method->flags;
  D.27752 = (int) D.27751;
  D.27753 = D.27752 & 16;
  if (D.27753 != 0) goto <D.27804>; else goto <D.27805>;
  <D.27804>:
  {
    int index;

    D.27725 = method->klass;
    D.27806 = mono_mb_add_data (mb, D.27725);
    index = (int) D.27806;
    D.27807 = mono_defaults.typehandle_class;
    mono_mb_add_data (mb, D.27807);
    mono_mb_emit_byte (mb, 208);
    mono_mb_emit_i4 (mb, index);
    gettypefromhandle_method.353 = gettypefromhandle_method;
    mono_mb_emit_managed_call (mb, gettypefromhandle_method.353, 0B);
  }
  goto <D.27808>;
  <D.27805>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27808>:
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_stloc (mb, this_local.354);
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.354);
  enter_method.348 = enter_method;
  mono_mb_emit_managed_call (mb, enter_method.348, 0B);
  D.27810 = mono_mb_get_label (mb);
  D.27811 = (unsigned int) D.27810;
  clause->try_offset = D.27811;
  D.27812 = BIT_FIELD_REF <*sig, 8, 112>;
  D.27813 = D.27812 & 64;
  if (D.27813 != 0) goto <D.27814>; else goto <D.27815>;
  <D.27814>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27815>:
  i = 0;
  goto <D.21229>;
  <D.21228>:
  D.27812 = BIT_FIELD_REF <*sig, 8, 112>;
  D.27813 = D.27812 & 64;
  D.27816 = D.27813 != 0;
  D.27817 = (int) D.27816;
  D.27818 = D.27817 + i;
  D.27819 = (unsigned int) D.27818;
  mono_mb_emit_ldarg (mb, D.27819);
  i = i + 1;
  <D.21229>:
  D.27760 = sig->param_count;
  D.27761 = (int) D.27760;
  if (D.27761 > i) goto <D.21228>; else goto <D.21230>;
  <D.21230>:
  if (ctx != 0B) goto <D.27820>; else goto <D.27821>;
  <D.27820>:
  D.27822 = &container->context;
  D.27823 = mono_class_inflate_generic_method (method, D.27822);
  mono_mb_emit_managed_call (mb, D.27823, 0B);
  goto <D.27824>;
  <D.27821>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.27824>:
  D.27743 = sig->ret;
  D.27825 = mono_type_is_void (D.27743);
  if (D.27825 == 0) goto <D.27826>; else goto <D.27827>;
  <D.27826>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_stloc (mb, ret_local.347);
  <D.27827>:
  D.27828 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.27828;
  D.27829 = mono_mb_get_pos (mb);
  D.27830 = (unsigned int) D.27829;
  D.27831 = clause->try_offset;
  D.27832 = D.27830 - D.27831;
  clause->try_len = D.27832;
  D.27833 = mono_mb_get_label (mb);
  D.27834 = (unsigned int) D.27833;
  clause->handler_offset = D.27834;
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.354);
  exit_method.351 = exit_method;
  mono_mb_emit_managed_call (mb, exit_method.351, 0B);
  mono_mb_emit_byte (mb, 220);
  D.27835 = mono_mb_get_pos (mb);
  D.27836 = (unsigned int) D.27835;
  D.27837 = clause->handler_offset;
  D.27838 = D.27836 - D.27837;
  clause->handler_len = D.27838;
  pos.355 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.355);
  D.27743 = sig->ret;
  D.27840 = mono_type_is_void (D.27743);
  if (D.27840 == 0) goto <D.27841>; else goto <D.27842>;
  <D.27841>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.347);
  <D.27842>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, clause);
  if (ctx != 0B) goto <D.27843>; else goto <D.27844>;
  <D.27843>:
  {
    struct MonoMethod * def;

    D.27760 = sig->param_count;
    D.27761 = (int) D.27760;
    D.27762 = D.27761 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.27762);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.27845>;
  <D.27844>:
  D.27760 = sig->param_count;
  D.27761 = (int) D.27760;
  D.27762 = D.27761 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27762);
  <D.27845>:
  mono_mb_free (mb);
  D.27714 = res;
  return D.27714;
}


check_generic_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, void * key, void * def_key)
{
  unsigned char D.27847;
  unsigned char D.27848;
  _Bool D.27849;
  long int D.27850;
  long int D.27851;
  struct MonoMethod * D.27856;
  _Bool D.27861;
  long int D.27862;
  long int D.27863;
  _Bool D.27870;
  long int D.27871;
  long int D.27872;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;
  struct MonoGenericContext * ctx;
  struct MonoMethod * def_method;

  D.27847 = BIT_FIELD_REF <*orig_method, 8, 264>;
  D.27848 = D.27847 & 16;
  D.27849 = D.27848 == 0;
  D.27850 = (long int) D.27849;
  D.27851 = __builtin_expect (D.27850, 0);
  if (D.27851 != 0) goto <D.27852>; else goto <D.27853>;
  <D.27852>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2720, "orig_method->is_inflated");
  <D.27853>:
  def_method = MEM[(struct MonoMethodInflated *)orig_method].declaring;
  ctx = mono_method_get_context (orig_method);
  res = mono_marshal_find_in_cache (cache, key);
  if (res != 0B) goto <D.27854>; else goto <D.27855>;
  <D.27854>:
  D.27856 = res;
  return D.27856;
  <D.27855>:
  def = mono_marshal_find_in_cache (cache, def_key);
  if (def != 0B) goto <D.27857>; else goto <D.27858>;
  <D.27857>:
  inst = mono_class_inflate_generic_method (def, ctx);
  mono_memory_barrier ();
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27859>; else goto <D.27860>;
    <D.27859>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27860>:
    D.27861 = ret != 0;
    D.27862 = (long int) D.27861;
    D.27863 = __builtin_expect (D.27862, 0);
    if (D.27863 != 0) goto <D.27864>; else goto <D.27865>;
    <D.27864>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2739, "ret == 0");
    <D.27865>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27866>; else goto <D.27867>;
  <D.27866>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27867>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27868>; else goto <D.27869>;
    <D.27868>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27869>:
    D.27870 = ret != 0;
    D.27871 = (long int) D.27870;
    D.27872 = __builtin_expect (D.27871, 0);
    if (D.27872 != 0) goto <D.27873>; else goto <D.27874>;
    <D.27873>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2745, "ret == 0");
    <D.27874>:
  }
  D.27856 = res;
  return D.27856;
  <D.27858>:
  D.27856 = 0B;
  return D.27856;
}


cache_generic_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx, void * key)
{
  _Bool D.27878;
  long int D.27879;
  long int D.27880;
  _Bool D.27887;
  long int D.27888;
  long int D.27889;
  struct MonoMethod * D.27892;
  struct MonoMethod * inst;
  struct MonoMethod * res;

  inst = mono_class_inflate_generic_method (def, ctx);
  mono_memory_barrier ();
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27876>; else goto <D.27877>;
    <D.27876>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27877>:
    D.27878 = ret != 0;
    D.27879 = (long int) D.27878;
    D.27880 = __builtin_expect (D.27879, 0);
    if (D.27880 != 0) goto <D.27881>; else goto <D.27882>;
    <D.27881>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2761, "ret == 0");
    <D.27882>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27883>; else goto <D.27884>;
  <D.27883>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27884>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27885>; else goto <D.27886>;
    <D.27885>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27886>:
    D.27887 = ret != 0;
    D.27888 = (long int) D.27887;
    D.27889 = __builtin_expect (D.27888, 0);
    if (D.27889 != 0) goto <D.27890>; else goto <D.27891>;
    <D.27890>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2767, "ret == 0");
    <D.27891>:
  }
  D.27892 = res;
  return D.27892;
}


mono_marshal_get_unbox_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.27894;
  struct MonoImage * D.27895;
  struct GHashTable * * D.27896;
  struct MonoMethod * D.27899;
  const char * D.27900;
  unsigned char D.27901;
  unsigned char D.27902;
  _Bool D.27903;
  long int D.27904;
  long int D.27905;
  int D.27908;
  unsigned int D.27909;
  short unsigned int D.27910;
  int D.27911;
  int D.27912;
  struct MonoMethodSignature * sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;

  sig = mono_method_signature (method);
  D.27894 = method->klass;
  D.27895 = D.27894->image;
  D.27896 = &D.27895->unbox_wrapper_cache;
  cache = get_cache (D.27896, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27897>; else goto <D.27898>;
  <D.27897>:
  D.27899 = res;
  return D.27899;
  <D.27898>:
  D.27900 = method->name;
  D.27894 = method->klass;
  mb = mono_mb_new (D.27894, D.27900, 22);
  D.27901 = BIT_FIELD_REF <*sig, 8, 112>;
  D.27902 = D.27901 & 64;
  D.27903 = D.27902 == 0;
  D.27904 = (long int) D.27903;
  D.27905 = __builtin_expect (D.27904, 0);
  if (D.27905 != 0) goto <D.27906>; else goto <D.27907>;
  <D.27906>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10576, "sig->hasthis");
  <D.27907>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  i = 0;
  goto <D.21241>;
  <D.21240>:
  D.27908 = i + 1;
  D.27909 = (unsigned int) D.27908;
  mono_mb_emit_ldarg (mb, D.27909);
  i = i + 1;
  <D.21241>:
  D.27910 = sig->param_count;
  D.27911 = (int) D.27910;
  if (D.27911 > i) goto <D.21240>; else goto <D.21242>;
  <D.21242>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  D.27910 = sig->param_count;
  D.27911 = (int) D.27910;
  D.27912 = D.27911 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27912);
  mono_mb_free (mb);
  D.27899 = res;
  return D.27899;
}


mono_marshal_get_virtual_stelemref (struct MonoClass * array_class)
{
  unsigned char D.27914;
  _Bool D.27915;
  long int D.27916;
  long int D.27917;
  struct MonoClass * D.27920;
  struct MonoMethod * D.27921;
  int kind;

  D.27914 = array_class->rank;
  D.27915 = D.27914 != 1;
  D.27916 = (long int) D.27915;
  D.27917 = __builtin_expect (D.27916, 0);
  if (D.27917 != 0) goto <D.27918>; else goto <D.27919>;
  <D.27918>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11083, "array_class->rank == 1");
  <D.27919>:
  D.27920 = array_class->element_class;
  kind = get_virtual_stelemref_kind (D.27920);
  D.27921 = get_virtual_stelemref_wrapper (kind);
  return D.27921;
}


get_virtual_stelemref_kind (struct MonoClass * element_class)
{
  struct MonoClass * D.27923;
  int D.27926;
  int D.27927;
  unsigned int D.27932;
  unsigned int D.27933;
  unsigned char D.27935;
  int D.27937;
  unsigned char D.27942;
  unsigned char D.27943;
  unsigned char D.27945;
  int D.27947;
  unsigned int D.27948;

  D.27923 = mono_defaults.object_class;
  if (D.27923 == element_class) goto <D.27924>; else goto <D.27925>;
  <D.27924>:
  D.27926 = 0;
  return D.27926;
  <D.27925>:
  D.27927 = is_monomorphic_array (element_class);
  if (D.27927 != 0) goto <D.27928>; else goto <D.27929>;
  <D.27928>:
  D.27926 = 1;
  return D.27926;
  <D.27929>:
  D.27932 = element_class->flags;
  D.27933 = D.27932 & 32;
  if (D.27933 != 0) goto <D.27930>; else goto <D.27934>;
  <D.27934>:
  D.27935 = element_class->byval_arg.type;
  if (D.27935 == 19) goto <D.27930>; else goto <D.27936>;
  <D.27936>:
  D.27935 = element_class->byval_arg.type;
  if (D.27935 == 30) goto <D.27930>; else goto <D.27931>;
  <D.27930>:
  D.27937 = mono_class_has_variant_generic_params (element_class);
  if (D.27937 == 0) goto <D.27938>; else goto <D.27939>;
  <D.27938>:
  D.27926 = 3;
  return D.27926;
  <D.27939>:
  <D.27931>:
  D.27942 = BIT_FIELD_REF <*element_class, 8, 272>;
  D.27943 = D.27942 & 64;
  if (D.27943 != 0) goto <D.27940>; else goto <D.27944>;
  <D.27944>:
  D.27945 = element_class->rank;
  if (D.27945 != 0) goto <D.27940>; else goto <D.27946>;
  <D.27946>:
  D.27947 = mono_class_has_variant_generic_params (element_class);
  if (D.27947 != 0) goto <D.27940>; else goto <D.27941>;
  <D.27940>:
  D.27926 = 4;
  return D.27926;
  <D.27941>:
  D.27932 = element_class->flags;
  D.27948 = D.27932 & 256;
  if (D.27948 != 0) goto <D.27949>; else goto <D.27950>;
  <D.27949>:
  D.27926 = 1;
  return D.27926;
  <D.27950>:
  D.27926 = 2;
  return D.27926;
}


is_monomorphic_array (struct MonoClass * klass)
{
  unsigned char D.27952;
  gboolean D.27955;
  int iftmp.356;
  unsigned int D.27960;
  unsigned int D.27961;
  unsigned char D.27963;
  unsigned char D.27964;
  struct MonoClass * element_class;

  D.27952 = klass->rank;
  if (D.27952 != 1) goto <D.27953>; else goto <D.27954>;
  <D.27953>:
  D.27955 = 0;
  return D.27955;
  <D.27954>:
  element_class = klass->element_class;
  D.27960 = element_class->flags;
  D.27961 = D.27960 & 256;
  if (D.27961 != 0) goto <D.27957>; else goto <D.27962>;
  <D.27962>:
  D.27963 = BIT_FIELD_REF <*element_class, 8, 256>;
  D.27964 = D.27963 & 8;
  if (D.27964 != 0) goto <D.27957>; else goto <D.27958>;
  <D.27957>:
  iftmp.356 = 1;
  goto <D.27959>;
  <D.27958>:
  iftmp.356 = 0;
  <D.27959>:
  D.27955 = iftmp.356;
  return D.27955;
}


get_virtual_stelemref_wrapper (int kind)
{
  struct MonoMethod * D.27966;
  struct MonoMethod * D.27969;
  const char * D.27970;
  struct MonoClass * D.27971;
  struct MonoMethodSignature * signature.357;
  struct MonoImage * D.27975;
  struct MonoClass * D.27976;
  struct MonoType * D.27977;
  struct MonoClass * D.27978;
  struct MonoType * D.27979;
  struct MonoType * D.27980;
  struct MonoType * D.27981;
  unsigned int array_slot_addr.358;
  unsigned int aklass.359;
  unsigned int vklass.360;
  struct MonoClass * D.27985;
  struct MonoType * D.27986;
  unsigned int vtable.361;
  unsigned int uiid.362;
  struct MonoMethod * D.27989;
  short unsigned int D.27992;
  short unsigned int D.27993;
  _Bool D.27996;
  long int D.27997;
  long int D.27998;
  _Bool D.28005;
  long int D.28006;
  long int D.28007;
  _Bool D.28013;
  long int D.28014;
  long int D.28015;
  static struct MonoMethod * cached_methods[5] = {0B};
  static struct MonoMethodSignature * signature;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  char * name;
  const char * param_names[16];
  guint32 b1;
  guint32 b2;
  guint32 b3;
  int aklass;
  int vklass;
  int vtable;
  int uiid;
  int array_slot_addr;
  struct WrapperInfo * info;

  try
    {
      D.27966 = cached_methods[kind];
      if (D.27966 != 0B) goto <D.27967>; else goto <D.27968>;
      <D.27967>:
      D.27969 = cached_methods[kind];
      return D.27969;
      <D.27968>:
      D.27970 = strelemref_wrapper_name[kind];
      name = monoeg_g_strdup_printf ("virt_stelemref_%s", D.27970);
      D.27971 = mono_defaults.object_class;
      mb = mono_mb_new (D.27971, name, 21);
      monoeg_g_free (name);
      signature.357 = signature;
      if (signature.357 == 0B) goto <D.27973>; else goto <D.27974>;
      <D.27973>:
      {
        struct MonoMethodSignature * sig;

        D.27975 = mono_defaults.corlib;
        sig = mono_metadata_signature_alloc (D.27975, 2);
        D.27976 = mono_defaults.void_class;
        D.27977 = &D.27976->byval_arg;
        sig->ret = D.27977;
        sig->hasthis = 1;
        D.27978 = mono_defaults.int_class;
        D.27979 = &D.27978->byval_arg;
        sig->params[0] = D.27979;
        D.27971 = mono_defaults.object_class;
        D.27980 = &D.27971->byval_arg;
        sig->params[1] = D.27980;
        signature = sig;
      }
      <D.27974>:
      param_names[0] = "index";
      param_names[1] = "value";
      mono_mb_set_param_names (mb, &param_names);
      switch (kind) <default: <D.21294>, case 0: <D.21288>, case 1: <D.21291>, case 2: <D.21292>, case 3: <D.21293>, case 4: <D.21290>>
      <D.21288>:
      load_array_element_address (mb);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      goto <D.21289>;
      <D.21290>:
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      aklass = mono_mb_add_local (mb, D.27979);
      D.27971 = mono_defaults.object_class;
      D.27981 = &D.27971->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27981);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21289>;
      <D.21291>:
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      aklass = mono_mb_add_local (mb, D.27979);
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      vklass = mono_mb_add_local (mb, D.27979);
      D.27971 = mono_defaults.object_class;
      D.27981 = &D.27971->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27981);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      b2 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21289>;
      <D.21292>:
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      aklass = mono_mb_add_local (mb, D.27979);
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      vklass = mono_mb_add_local (mb, D.27979);
      D.27971 = mono_defaults.object_class;
      D.27981 = &D.27971->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27981);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 68);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      mono_mb_emit_icon (mb, 1);
      mono_mb_emit_byte (mb, 89);
      mono_mb_emit_icon (mb, 8);
      mono_mb_emit_byte (mb, 90);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 77);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      b3 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21289>;
      <D.21293>:
      D.27971 = mono_defaults.object_class;
      D.27981 = &D.27971->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27981);
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      aklass = mono_mb_add_local (mb, D.27979);
      D.27978 = mono_defaults.int_class;
      D.27979 = &D.27978->byval_arg;
      vtable = mono_mb_add_local (mb, D.27979);
      D.27985 = mono_defaults.int32_class;
      D.27986 = &D.27985->byval_arg;
      uiid = mono_mb_add_local (mb, D.27986);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_ldflda (mb, 0);
      mono_mb_emit_byte (mb, 77);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_stloc (mb, vtable.361);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 90);
      mono_mb_emit_byte (mb, 73);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_stloc (mb, uiid.362);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.361);
      mono_mb_emit_ldflda (mb, 40);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 66);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.361);
      mono_mb_emit_ldflda (mb, 32);
      mono_mb_emit_byte (mb, 77);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      mono_mb_emit_icon (mb, 3);
      mono_mb_emit_byte (mb, 100);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 71);
      mono_mb_emit_icon (mb, 1);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      mono_mb_emit_icon (mb, 7);
      mono_mb_emit_byte (mb, 95);
      mono_mb_emit_byte (mb, 98);
      mono_mb_emit_byte (mb, 95);
      b3 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21289>;
      <D.21294>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_ldarg (mb, 2);
      D.27989 = mono_marshal_get_stelemref ();
      mono_mb_emit_managed_call (mb, D.27989, 0B);
      mono_mb_emit_byte (mb, 42);
      if (1 != 0) goto <D.27990>; else goto <D.27991>;
      <D.27990>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11054, "0");
      <D.27991>:
      <D.21289>:
      signature.357 = signature;
      res = mono_mb_create_method (mb, signature.357, 4);
      D.27992 = res->flags;
      D.27993 = D.27992 | 64;
      res->flags = D.27993;
      info = mono_wrapper_info_create (res, 3);
      info->d.virtual_stelemref.kind = kind;
      mono_marshal_set_wrapper_info (res, info);
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.27994>; else goto <D.27995>;
        <D.27994>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.27995>:
        D.27996 = ret != 0;
        D.27997 = (long int) D.27996;
        D.27998 = __builtin_expect (D.27997, 0);
        if (D.27998 != 0) goto <D.27999>; else goto <D.28000>;
        <D.27999>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11065, "ret == 0");
        <D.28000>:
      }
      D.27966 = cached_methods[kind];
      if (D.27966 == 0B) goto <D.28001>; else goto <D.28002>;
      <D.28001>:
      cached_methods[kind] = res;
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28003>; else goto <D.28004>;
        <D.28003>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28004>:
        D.28005 = ret != 0;
        D.28006 = (long int) D.28005;
        D.28007 = __builtin_expect (D.28006, 0);
        if (D.28007 != 0) goto <D.28008>; else goto <D.28009>;
        <D.28008>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11068, "ret == 0");
        <D.28009>:
      }
      goto <D.28010>;
      <D.28002>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28011>; else goto <D.28012>;
        <D.28011>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28012>:
        D.28013 = ret != 0;
        D.28014 = (long int) D.28013;
        D.28015 = __builtin_expect (D.28014, 0);
        if (D.28015 != 0) goto <D.28016>; else goto <D.28017>;
        <D.28016>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11070, "ret == 0");
        <D.28017>:
      }
      mono_free_method (res);
      <D.28010>:
      mono_mb_free (mb);
      D.27969 = cached_methods[kind];
      return D.27969;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


load_value_class (struct MonoMethodBuilder * mb, int vklass)
{
  unsigned int vklass.363;

  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  vklass.363 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.363);
}


load_array_element_address (struct MonoMethodBuilder * mb)
{
  struct MonoClass * D.28021;

  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.28021 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.28021);
}


load_array_class (struct MonoMethodBuilder * mb, int aklass)
{
  unsigned int aklass.364;

  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  aklass.364 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.364);
}


mono_marshal_get_virtual_stelemref_wrappers (int * nwrappers)
{
  long unsigned int D.28023;
  long unsigned int D.28024;
  struct MonoMethod * * D.28025;
  struct MonoMethod * D.28026;
  struct MonoMethod * * D.28027;
  struct MonoMethod * * res;
  int i;

  *nwrappers = 5;
  res = monoeg_malloc0 (40);
  i = 0;
  goto <D.21308>;
  <D.21307>:
  D.28023 = (long unsigned int) i;
  D.28024 = D.28023 * 8;
  D.28025 = res + D.28024;
  D.28026 = get_virtual_stelemref_wrapper (i);
  *D.28025 = D.28026;
  i = i + 1;
  <D.21308>:
  if (i <= 4) goto <D.21307>; else goto <D.21309>;
  <D.21309>:
  D.28027 = res;
  return D.28027;
}


mono_marshal_get_stelemref ()
{
  struct MonoMethod * ret.365;
  struct MonoMethod * D.28032;
  struct MonoClass * D.28033;
  struct MonoImage * D.28034;
  struct MonoClass * D.28035;
  struct MonoType * D.28036;
  struct MonoType * D.28037;
  struct MonoClass * D.28038;
  struct MonoType * D.28039;
  struct MonoType * D.28040;
  unsigned int array_slot_addr.366;
  unsigned int aklass.367;
  unsigned int vklass.368;
  int D.28044;
  unsigned int D.28045;
  unsigned int D.28046;
  int D.28047;
  int b4.369;
  struct MonoMethod * ret.370;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;
  guint32 b1;
  guint32 b2;
  guint32 b3;
  guint32 b4;
  guint32 copy_pos;
  int aklass;
  int vklass;
  int array_slot_addr;

  ret.365 = ret;
  if (ret.365 != 0B) goto <D.28030>; else goto <D.28031>;
  <D.28030>:
  D.28032 = ret;
  return D.28032;
  <D.28031>:
  D.28033 = mono_defaults.object_class;
  mb = mono_mb_new (D.28033, "stelemref", 21);
  D.28034 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28034, 3);
  D.28035 = mono_defaults.void_class;
  D.28036 = &D.28035->byval_arg;
  sig->ret = D.28036;
  D.28033 = mono_defaults.object_class;
  D.28037 = &D.28033->byval_arg;
  sig->params[0] = D.28037;
  D.28038 = mono_defaults.int_class;
  D.28039 = &D.28038->byval_arg;
  sig->params[1] = D.28039;
  D.28033 = mono_defaults.object_class;
  D.28037 = &D.28033->byval_arg;
  sig->params[2] = D.28037;
  D.28038 = mono_defaults.int_class;
  D.28039 = &D.28038->byval_arg;
  aklass = mono_mb_add_local (mb, D.28039);
  D.28038 = mono_defaults.int_class;
  D.28039 = &D.28038->byval_arg;
  vklass = mono_mb_add_local (mb, D.28039);
  D.28033 = mono_defaults.object_class;
  D.28040 = &D.28033->this_arg;
  array_slot_addr = mono_mb_add_local (mb, D.28040);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.28033 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.28033);
  array_slot_addr.366 = (unsigned int) array_slot_addr;
  mono_mb_emit_stloc (mb, array_slot_addr.366);
  mono_mb_emit_ldarg (mb, 2);
  b1 = mono_mb_emit_branch (mb, 57);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.367);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.368);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.368);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  b2 = mono_mb_emit_branch (mb, 68);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.368);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  b3 = mono_mb_emit_branch (mb, 64);
  D.28044 = mono_mb_get_label (mb);
  copy_pos = (guint32) D.28044;
  mono_mb_patch_branch (mb, b1);
  array_slot_addr.366 = (unsigned int) array_slot_addr;
  mono_mb_emit_ldloc (mb, array_slot_addr.366);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_branch (mb, b2);
  mono_mb_patch_branch (mb, b3);
  mono_mb_emit_ldarg (mb, 2);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_icall (mb, mono_object_isinst);
  b4 = mono_mb_emit_branch (mb, 58);
  D.28045 = copy_pos - b4;
  D.28046 = D.28045 + 4294967292;
  D.28047 = (int) D.28046;
  b4.369 = (int) b4;
  mono_mb_patch_addr (mb, b4.369, D.28047);
  mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
  mono_mb_emit_byte (mb, 42);
  ret.370 = mono_mb_create_method (mb, sig, 4);
  ret = ret.370;
  mono_mb_free (mb);
  ret.365 = ret;
  info = mono_wrapper_info_create (ret.365, 0);
  ret.365 = ret;
  mono_marshal_set_wrapper_info (ret.365, info);
  D.28032 = ret;
  return D.28032;
}


mono_marshal_get_gsharedvt_in_wrapper ()
{
  struct MonoMethod * ret.371;
  struct MonoMethod * D.28054;
  struct MonoClass * D.28055;
  struct MonoImage * D.28056;
  struct MonoClass * D.28057;
  struct MonoType * D.28058;
  struct MonoMethod * ret.372;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.371 = ret;
  if (ret.371 != 0B) goto <D.28052>; else goto <D.28053>;
  <D.28052>:
  D.28054 = ret;
  return D.28054;
  <D.28053>:
  D.28055 = mono_defaults.object_class;
  mb = mono_mb_new (D.28055, "gsharedvt_in", 25);
  D.28056 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28056, 0);
  D.28057 = mono_defaults.void_class;
  D.28058 = &D.28057->byval_arg;
  sig->ret = D.28058;
  mono_mb_emit_byte (mb, 42);
  ret.372 = mono_mb_create_method (mb, sig, 4);
  ret = ret.372;
  mono_mb_free (mb);
  ret.371 = ret;
  info = mono_wrapper_info_create (ret.371, 18);
  ret.371 = ret;
  mono_marshal_set_wrapper_info (ret.371, info);
  D.28054 = ret;
  return D.28054;
}


mono_marshal_get_gsharedvt_out_wrapper ()
{
  struct MonoMethod * ret.373;
  struct MonoMethod * D.28064;
  struct MonoClass * D.28065;
  struct MonoImage * D.28066;
  struct MonoClass * D.28067;
  struct MonoType * D.28068;
  struct MonoMethod * ret.374;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.373 = ret;
  if (ret.373 != 0B) goto <D.28062>; else goto <D.28063>;
  <D.28062>:
  D.28064 = ret;
  return D.28064;
  <D.28063>:
  D.28065 = mono_defaults.object_class;
  mb = mono_mb_new (D.28065, "gsharedvt_out", 25);
  D.28066 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28066, 0);
  D.28067 = mono_defaults.void_class;
  D.28068 = &D.28067->byval_arg;
  sig->ret = D.28068;
  mono_mb_emit_byte (mb, 42);
  ret.374 = mono_mb_create_method (mb, sig, 4);
  ret = ret.374;
  mono_mb_free (mb);
  ret.373 = ret;
  info = mono_wrapper_info_create (ret.373, 19);
  ret.373 = ret;
  mono_marshal_set_wrapper_info (ret.373, info);
  D.28064 = ret;
  return D.28064;
}


mono_marshal_get_array_address (int rank, int elem_size)
{
  _Bool D.28073;
  long int D.28074;
  long int D.28075;
  struct ArrayElemAddr * elem_addr_cache.375;
  long unsigned int D.28079;
  long unsigned int D.28080;
  struct ArrayElemAddr * D.28081;
  int D.28082;
  int D.28085;
  int elem_addr_cache_next.376;
  _Bool D.28091;
  long int D.28092;
  long int D.28093;
  struct MonoMethod * D.28098;
  long unsigned int D.28099;
  long unsigned int D.28100;
  int D.28101;
  unsigned int D.28102;
  struct MonoImage * D.28103;
  struct MonoClass * D.28104;
  struct MonoType * D.28105;
  struct MonoClass * D.28106;
  struct MonoType * D.28107;
  int D.28108;
  struct MonoClass * D.28109;
  struct MonoType * D.28110;
  unsigned int bounds.377;
  unsigned int ind.378;
  unsigned int D.28113;
  unsigned int D.28114;
  unsigned int D.28115;
  unsigned int D.28116;
  unsigned int D.28117;
  int D.28118;
  unsigned int realidx.379;
  unsigned int i.380;
  unsigned int D.28121;
  int D.28122;
  long unsigned int D.28123;
  int * D.28124;
  unsigned int D.28125;
  int D.28126;
  int D.28127;
  unsigned int D.28128;
  unsigned int branch_pos.381;
  _Bool D.28132;
  long int D.28133;
  long int D.28134;
  int elem_addr_cache_size.382;
  long unsigned int D.28146;
  long unsigned int D.28147;
  long unsigned int D.28148;
  long unsigned int D.28149;
  long unsigned int D.28150;
  long unsigned int D.28151;
  struct ArrayElemAddr * D.28152;
  int elem_addr_cache_next.383;
  unsigned int rank.384;
  unsigned int elem_size.385;
  _Bool D.28158;
  long int D.28159;
  long int D.28160;
  struct MonoMethod * ret;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int i;
  int bounds;
  int ind;
  int realidx;
  int branch_pos;
  int * branch_positions;
  int cached;

  ret = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28071>; else goto <D.28072>;
    <D.28071>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28072>:
    D.28073 = ret != 0;
    D.28074 = (long int) D.28073;
    D.28075 = __builtin_expect (D.28074, 0);
    if (D.28075 != 0) goto <D.28076>; else goto <D.28077>;
    <D.28076>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11364, "ret == 0");
    <D.28077>:
  }
  i = 0;
  goto <D.21363>;
  <D.21362>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  D.28082 = D.28081->rank;
  if (D.28082 == rank) goto <D.28083>; else goto <D.28084>;
  <D.28083>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  D.28085 = D.28081->elem_size;
  if (D.28085 == elem_size) goto <D.28086>; else goto <D.28087>;
  <D.28086>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  ret = D.28081->method;
  goto <D.21361>;
  <D.28087>:
  <D.28084>:
  i = i + 1;
  <D.21363>:
  elem_addr_cache_next.376 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.376) goto <D.21362>; else goto <D.21361>;
  <D.21361>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28089>; else goto <D.28090>;
    <D.28089>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28090>:
    D.28091 = ret != 0;
    D.28092 = (long int) D.28091;
    D.28093 = __builtin_expect (D.28092, 0);
    if (D.28093 != 0) goto <D.28094>; else goto <D.28095>;
    <D.28094>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11371, "ret == 0");
    <D.28095>:
  }
  if (ret != 0B) goto <D.28096>; else goto <D.28097>;
  <D.28096>:
  D.28098 = ret;
  return D.28098;
  <D.28097>:
  D.28099 = (long unsigned int) rank;
  D.28100 = D.28099 * 4;
  branch_positions = monoeg_malloc0 (D.28100);
  D.28101 = rank + 1;
  D.28102 = (unsigned int) D.28101;
  D.28103 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28103, D.28102);
  D.28104 = mono_defaults.int_class;
  D.28105 = &D.28104->byval_arg;
  sig->ret = D.28105;
  D.28106 = mono_defaults.object_class;
  D.28107 = &D.28106->byval_arg;
  sig->params[0] = D.28107;
  i = 0;
  goto <D.21366>;
  <D.21365>:
  D.28108 = i + 1;
  D.28109 = mono_defaults.int32_class;
  D.28110 = &D.28109->byval_arg;
  sig->params[D.28108] = D.28110;
  i = i + 1;
  <D.21366>:
  if (i < rank) goto <D.21365>; else goto <D.21367>;
  <D.21367>:
  D.28106 = mono_defaults.object_class;
  mb = mono_mb_new (D.28106, "ElementAddr", 7);
  D.28104 = mono_defaults.int_class;
  D.28105 = &D.28104->byval_arg;
  bounds = mono_mb_add_local (mb, D.28105);
  D.28109 = mono_defaults.int32_class;
  D.28110 = &D.28109->byval_arg;
  ind = mono_mb_add_local (mb, D.28110);
  D.28109 = mono_defaults.int32_class;
  D.28110 = &D.28109->byval_arg;
  realidx = mono_mb_add_local (mb, D.28110);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 77);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_stloc (mb, bounds.377);
  mono_mb_emit_ldarg (mb, 1);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.378);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.28113 = mono_mb_emit_branch (mb, 65);
  branch_pos = (int) D.28113;
  i = 1;
  goto <D.21369>;
  <D.21368>:
  D.28108 = i + 1;
  D.28114 = (unsigned int) D.28108;
  mono_mb_emit_ldarg (mb, D.28114);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  D.28079 = (long unsigned int) i;
  D.28115 = (unsigned int) D.28079;
  D.28116 = D.28115 * 8;
  D.28117 = D.28116 + 4;
  D.28118 = (int) D.28117;
  mono_mb_emit_icon (mb, D.28118);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_stloc (mb, realidx.379);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.379);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  i.380 = (unsigned int) i;
  D.28121 = i.380 * 8;
  D.28122 = (int) D.28121;
  mono_mb_emit_icon (mb, D.28122);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.28079 = (long unsigned int) i;
  D.28123 = D.28079 * 4;
  D.28124 = branch_positions + D.28123;
  D.28125 = mono_mb_emit_branch (mb, 65);
  D.28126 = (int) D.28125;
  *D.28124 = D.28126;
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  i.380 = (unsigned int) i;
  D.28121 = i.380 * 8;
  D.28122 = (int) D.28121;
  mono_mb_emit_icon (mb, D.28122);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 90);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.379);
  mono_mb_emit_byte (mb, 88);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.378);
  i = i + 1;
  <D.21369>:
  if (i < rank) goto <D.21368>; else goto <D.21370>;
  <D.21370>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 32);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  mono_mb_emit_icon (mb, elem_size);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  i = 1;
  goto <D.21372>;
  <D.21371>:
  D.28079 = (long unsigned int) i;
  D.28123 = D.28079 * 4;
  D.28124 = branch_positions + D.28123;
  D.28127 = *D.28124;
  D.28128 = (unsigned int) D.28127;
  mono_mb_patch_branch (mb, D.28128);
  i = i + 1;
  <D.21372>:
  if (i < rank) goto <D.21371>; else goto <D.21373>;
  <D.21373>:
  branch_pos.381 = (unsigned int) branch_pos;
  mono_mb_patch_branch (mb, branch_pos.381);
  mono_mb_emit_exception (mb, "IndexOutOfRangeException", 0B);
  monoeg_g_free (branch_positions);
  ret = mono_mb_create_method (mb, sig, 4);
  mono_mb_free (mb);
  cached = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28130>; else goto <D.28131>;
    <D.28130>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28131>:
    D.28132 = ret != 0;
    D.28133 = (long int) D.28132;
    D.28134 = __builtin_expect (D.28133, 0);
    if (D.28134 != 0) goto <D.28135>; else goto <D.28136>;
    <D.28135>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11475, "ret == 0");
    <D.28136>:
  }
  i = 0;
  goto <D.21377>;
  <D.21376>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  D.28082 = D.28081->rank;
  if (D.28082 == rank) goto <D.28137>; else goto <D.28138>;
  <D.28137>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  D.28085 = D.28081->elem_size;
  if (D.28085 == elem_size) goto <D.28139>; else goto <D.28140>;
  <D.28139>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28079 = (long unsigned int) i;
  D.28080 = D.28079 * 16;
  D.28081 = elem_addr_cache.375 + D.28080;
  ret = D.28081->method;
  cached = 1;
  goto <D.21375>;
  <D.28140>:
  <D.28138>:
  i = i + 1;
  <D.21377>:
  elem_addr_cache_next.376 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.376) goto <D.21376>; else goto <D.21375>;
  <D.21375>:
  if (cached == 0) goto <D.28141>; else goto <D.28142>;
  <D.28141>:
  {
    struct WrapperInfo * info;

    elem_addr_cache_next.376 = elem_addr_cache_next;
    elem_addr_cache_size.382 = elem_addr_cache_size;
    if (elem_addr_cache_next.376 >= elem_addr_cache_size.382) goto <D.28144>; else goto <D.28145>;
    <D.28144>:
    {
      int new_size;
      struct ArrayElemAddr * new_array;

      elem_addr_cache_size.382 = elem_addr_cache_size;
      new_size = elem_addr_cache_size.382 + 4;
      D.28146 = (long unsigned int) new_size;
      D.28147 = D.28146 * 16;
      new_array = monoeg_malloc0 (D.28147);
      elem_addr_cache_size.382 = elem_addr_cache_size;
      D.28148 = (long unsigned int) elem_addr_cache_size.382;
      D.28149 = D.28148 * 16;
      elem_addr_cache.375 = elem_addr_cache;
      memcpy (new_array, elem_addr_cache.375, D.28149);
      elem_addr_cache.375 = elem_addr_cache;
      monoeg_g_free (elem_addr_cache.375);
      elem_addr_cache = new_array;
      elem_addr_cache_size = new_size;
    }
    <D.28145>:
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28150 = (long unsigned int) elem_addr_cache_next.376;
    D.28151 = D.28150 * 16;
    D.28152 = elem_addr_cache.375 + D.28151;
    D.28152->rank = rank;
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28150 = (long unsigned int) elem_addr_cache_next.376;
    D.28151 = D.28150 * 16;
    D.28152 = elem_addr_cache.375 + D.28151;
    D.28152->elem_size = elem_size;
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28150 = (long unsigned int) elem_addr_cache_next.376;
    D.28151 = D.28150 * 16;
    D.28152 = elem_addr_cache.375 + D.28151;
    D.28152->method = ret;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    elem_addr_cache_next.383 = elem_addr_cache_next.376 + 1;
    elem_addr_cache_next = elem_addr_cache_next.383;
    info = mono_wrapper_info_create (ret, 1);
    rank.384 = (unsigned int) rank;
    info->d.element_addr.rank = rank.384;
    elem_size.385 = (unsigned int) elem_size;
    info->d.element_addr.elem_size = elem_size.385;
    mono_marshal_set_wrapper_info (ret, info);
  }
  <D.28142>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28156>; else goto <D.28157>;
    <D.28156>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28157>:
    D.28158 = ret != 0;
    D.28159 = (long int) D.28158;
    D.28160 = __builtin_expect (D.28159, 0);
    if (D.28160 != 0) goto <D.28161>; else goto <D.28162>;
    <D.28161>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11505, "ret == 0");
    <D.28162>:
  }
  D.28098 = ret;
  return D.28098;
}


mono_marshal_get_array_accessor_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.28166;
  struct MonoImage * D.28167;
  struct GHashTable * * D.28168;
  struct MonoMethod * D.28171;
  struct MonoMethodSignature * D.28172;
  const char * D.28173;
  unsigned char D.28174;
  unsigned char D.28175;
  _Bool D.28178;
  int D.28179;
  int D.28180;
  unsigned int D.28181;
  short unsigned int D.28182;
  int D.28183;
  struct MonoGenericContext * D.28186;
  struct MonoMethod * D.28187;
  int D.28191;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  int i;
  struct MonoGenericContext * ctx;
  struct MonoMethod * orig_method;
  struct MonoGenericContainer * container;
  struct WrapperInfo * info;

  ctx = 0B;
  orig_method = 0B;
  container = 0B;
  if (ctx != 0B) goto <D.28164>; else goto <D.28165>;
  <D.28164>:
  cache = 0B;
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11537);
  <D.28165>:
  D.28166 = method->klass;
  D.28167 = D.28166->image;
  D.28168 = &D.28167->array_accessor_cache;
  cache = get_cache (D.28168, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28169>; else goto <D.28170>;
  <D.28169>:
  D.28171 = res;
  return D.28171;
  <D.28170>:
  D.28172 = mono_method_signature (method);
  D.28166 = method->klass;
  D.28167 = D.28166->image;
  sig = signature_dup (D.28167, D.28172);
  sig->pinvoke = 0;
  D.28173 = method->name;
  D.28166 = method->klass;
  mb = mono_mb_new (D.28166, D.28173, 25);
  D.28174 = BIT_FIELD_REF <*sig, 8, 112>;
  D.28175 = D.28174 & 64;
  if (D.28175 != 0) goto <D.28176>; else goto <D.28177>;
  <D.28176>:
  mono_mb_emit_ldarg (mb, 0);
  <D.28177>:
  i = 0;
  goto <D.21395>;
  <D.21394>:
  D.28174 = BIT_FIELD_REF <*sig, 8, 112>;
  D.28175 = D.28174 & 64;
  D.28178 = D.28175 != 0;
  D.28179 = (int) D.28178;
  D.28180 = D.28179 + i;
  D.28181 = (unsigned int) D.28180;
  mono_mb_emit_ldarg (mb, D.28181);
  i = i + 1;
  <D.21395>:
  D.28182 = sig->param_count;
  D.28183 = (int) D.28182;
  if (D.28183 > i) goto <D.21394>; else goto <D.21396>;
  <D.21396>:
  if (ctx != 0B) goto <D.28184>; else goto <D.28185>;
  <D.28184>:
  D.28186 = &container->context;
  D.28187 = mono_class_inflate_generic_method (method, D.28186);
  mono_mb_emit_managed_call (mb, D.28187, 0B);
  goto <D.28188>;
  <D.28185>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.28188>:
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.28189>; else goto <D.28190>;
  <D.28189>:
  {
    struct MonoMethod * def;

    D.28182 = sig->param_count;
    D.28183 = (int) D.28182;
    D.28191 = D.28183 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.28191);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.28192>;
  <D.28190>:
  D.28182 = sig->param_count;
  D.28183 = (int) D.28182;
  D.28191 = D.28183 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.28191);
  info = mono_wrapper_info_create (res, 20);
  info->d.array_accessor.method = method;
  mono_marshal_set_wrapper_info (res, info);
  <D.28192>:
  mono_mb_free (mb);
  D.28171 = res;
  return D.28171;
}


mono_marshal_alloc (gulong size)
{
  void * D.28196;
  void * res;

  res = monoeg_try_malloc (size);
  if (res == 0B) goto <D.28194>; else goto <D.28195>;
  <D.28194>:
  mono_gc_out_of_memory (size);
  <D.28195>:
  D.28196 = res;
  return D.28196;
}


mono_marshal_free (void * ptr)
{
  monoeg_g_free (ptr);
}


mono_marshal_free_array (void * * ptr, int size)
{
  long unsigned int D.28200;
  long unsigned int D.28201;
  void * * D.28202;
  void * D.28203;
  int i;

  if (ptr == 0B) goto <D.28198>; else goto <D.28199>;
  <D.28198>:
  return;
  <D.28199>:
  i = 0;
  goto <D.21411>;
  <D.21410>:
  D.28200 = (long unsigned int) i;
  D.28201 = D.28200 * 8;
  D.28202 = ptr + D.28201;
  D.28203 = *D.28202;
  if (D.28203 != 0B) goto <D.28204>; else goto <D.28205>;
  <D.28204>:
  D.28200 = (long unsigned int) i;
  D.28201 = D.28200 * 8;
  D.28202 = ptr + D.28201;
  D.28203 = *D.28202;
  monoeg_g_free (D.28203);
  <D.28205>:
  i = i + 1;
  <D.21411>:
  if (i < size) goto <D.21410>; else goto <D.21412>;
  <D.21412>:
}


mono_marshal_string_to_utf16 (struct MonoString * s)
{
  void * D.28207;
  void * iftmp.386;

  if (s != 0B) goto <D.28209>; else goto <D.28210>;
  <D.28209>:
  iftmp.386 = mono_string_chars (s);
  goto <D.28211>;
  <D.28210>:
  iftmp.386 = 0B;
  <D.28211>:
  D.28207 = iftmp.386;
  return D.28207;
}


mono_marshal_set_last_error ()
{
  int * D.28213;
  int D.28214;
  long int D.28215;
  void * D.28216;
  unsigned int last_error_tls_id.387;

  D.28213 = __errno_location ();
  D.28214 = *D.28213;
  D.28215 = (long int) D.28214;
  D.28216 = (void *) D.28215;
  last_error_tls_id.387 = last_error_tls_id;
  mono_native_tls_set_value (last_error_tls_id.387, D.28216);
}


mono_native_tls_set_value (pthread_key_t key, void * value)
{
  int D.28218;
  int D.28219;
  _Bool D.28220;

  D.28219 = pthread_setspecific (key, value);
  D.28220 = D.28219 == 0;
  D.28218 = (int) D.28220;
  return D.28218;
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (struct MonoArray * src, gint32 start_index, void * dest, gint32 length)
{
  _Bool D.28222;
  long int D.28223;
  long int D.28224;
  _Bool D.28229;
  long int D.28230;
  long int D.28231;
  struct MonoVTable * D.28236;
  struct MonoClass * D.28237;
  unsigned char D.28238;
  struct MonoException * D.28241;
  struct MonoException * D.28244;
  struct MonoException * D.28247;
  int D.28248;
  long unsigned int D.28249;
  long unsigned int D.28250;
  struct MonoException * D.28253;
  double[0:] * D.28254;
  int D.28255;
  sizetype D.28256;
  int D.28257;
  long unsigned int D.28258;
  int element_size;
  void * source_addr;

  D.28222 = src == 0B;
  D.28223 = (long int) D.28222;
  D.28224 = __builtin_expect (D.28223, 0);
  if (D.28224 != 0) goto <D.28225>; else goto <D.28226>;
  <D.28225>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28227>; else goto <D.28228>;
    <D.28227>:
    <D.28228>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28226>:
  D.28229 = dest == 0B;
  D.28230 = (long int) D.28229;
  D.28231 = __builtin_expect (D.28230, 0);
  if (D.28231 != 0) goto <D.28232>; else goto <D.28233>;
  <D.28232>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.28234>; else goto <D.28235>;
    <D.28234>:
    <D.28235>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.28233>:
  D.28236 = src->obj.vtable;
  D.28237 = D.28236->klass;
  D.28238 = D.28237->rank;
  if (D.28238 != 1) goto <D.28239>; else goto <D.28240>;
  <D.28239>:
  D.28241 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.28241);
  <D.28240>:
  if (start_index < 0) goto <D.28242>; else goto <D.28243>;
  <D.28242>:
  D.28244 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.28244);
  <D.28243>:
  if (length < 0) goto <D.28245>; else goto <D.28246>;
  <D.28245>:
  D.28247 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.28247);
  <D.28246>:
  D.28248 = start_index + length;
  D.28249 = (long unsigned int) D.28248;
  D.28250 = mono_array_length (src);
  if (D.28249 > D.28250) goto <D.28251>; else goto <D.28252>;
  <D.28251>:
  D.28253 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.28253);
  <D.28252>:
  D.28236 = src->obj.vtable;
  D.28237 = D.28236->klass;
  element_size = mono_array_element_size (D.28237);
  D.28254 = &src->vector;
  D.28255 = element_size * start_index;
  D.28256 = (sizetype) D.28255;
  source_addr = D.28254 + D.28256;
  D.28257 = length * element_size;
  D.28258 = (long unsigned int) D.28257;
  memcpy (dest, source_addr, D.28258);
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (void * src, gint32 start_index, struct MonoArray * dest, gint32 length)
{
  _Bool D.28259;
  long int D.28260;
  long int D.28261;
  _Bool D.28266;
  long int D.28267;
  long int D.28268;
  struct MonoVTable * D.28273;
  struct MonoClass * D.28274;
  unsigned char D.28275;
  struct MonoException * D.28278;
  struct MonoException * D.28281;
  struct MonoException * D.28284;
  int D.28285;
  long unsigned int D.28286;
  long unsigned int D.28287;
  struct MonoException * D.28290;
  double[0:] * D.28291;
  int D.28292;
  sizetype D.28293;
  int D.28294;
  long unsigned int D.28295;
  int element_size;
  void * dest_addr;

  D.28259 = src == 0B;
  D.28260 = (long int) D.28259;
  D.28261 = __builtin_expect (D.28260, 0);
  if (D.28261 != 0) goto <D.28262>; else goto <D.28263>;
  <D.28262>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28264>; else goto <D.28265>;
    <D.28264>:
    <D.28265>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28263>:
  D.28266 = dest == 0B;
  D.28267 = (long int) D.28266;
  D.28268 = __builtin_expect (D.28267, 0);
  if (D.28268 != 0) goto <D.28269>; else goto <D.28270>;
  <D.28269>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.28271>; else goto <D.28272>;
    <D.28271>:
    <D.28272>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.28270>:
  D.28273 = dest->obj.vtable;
  D.28274 = D.28273->klass;
  D.28275 = D.28274->rank;
  if (D.28275 != 1) goto <D.28276>; else goto <D.28277>;
  <D.28276>:
  D.28278 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.28278);
  <D.28277>:
  if (start_index < 0) goto <D.28279>; else goto <D.28280>;
  <D.28279>:
  D.28281 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.28281);
  <D.28280>:
  if (length < 0) goto <D.28282>; else goto <D.28283>;
  <D.28282>:
  D.28284 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.28284);
  <D.28283>:
  D.28285 = start_index + length;
  D.28286 = (long unsigned int) D.28285;
  D.28287 = mono_array_length (dest);
  if (D.28286 > D.28287) goto <D.28288>; else goto <D.28289>;
  <D.28288>:
  D.28290 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.28290);
  <D.28289>:
  D.28273 = dest->obj.vtable;
  D.28274 = D.28273->klass;
  element_size = mono_array_element_size (D.28274);
  D.28291 = &dest->vector;
  D.28292 = element_size * start_index;
  D.28293 = (sizetype) D.28292;
  dest_addr = D.28291 + D.28293;
  D.28294 = length * element_size;
  D.28295 = (long unsigned int) D.28294;
  memcpy (dest_addr, src, D.28295);
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char * ptr)
{
  struct MonoString * D.28298;
  struct MonoDomain * D.28299;

  if (ptr == 0B) goto <D.28296>; else goto <D.28297>;
  <D.28296>:
  D.28298 = 0B;
  return D.28298;
  <D.28297>:
  D.28299 = mono_domain_get ();
  D.28298 = mono_string_new (D.28299, ptr);
  return D.28298;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char * ptr, gint32 len)
{
  struct MonoException * D.28303;
  struct MonoString * D.28304;
  unsigned int len.388;
  struct MonoDomain * D.28306;

  if (ptr == 0B) goto <D.28301>; else goto <D.28302>;
  <D.28301>:
  D.28303 = mono_get_exception_argument_null ("ptr");
  mono_raise_exception (D.28303);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11736);
  D.28304 = 0B;
  return D.28304;
  <D.28302>:
  len.388 = (unsigned int) len;
  D.28306 = mono_domain_get ();
  D.28304 = mono_string_new_len (D.28306, ptr, len.388);
  return D.28304;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni (guint16 * ptr)
{
  struct MonoString * D.28310;
  guint16 * t.389;
  short unsigned int D.28312;
  struct MonoDomain * domain;
  int len;
  guint16 * t;

  domain = mono_domain_get ();
  len = 0;
  t = ptr;
  if (ptr == 0B) goto <D.28308>; else goto <D.28309>;
  <D.28308>:
  D.28310 = 0B;
  return D.28310;
  <D.28309>:
  goto <D.21460>;
  <D.21459>:
  len = len + 1;
  <D.21460>:
  t.389 = t;
  t = t.389 + 2;
  D.28312 = *t.389;
  if (D.28312 != 0) goto <D.21459>; else goto <D.21461>;
  <D.21461>:
  D.28310 = mono_string_new_utf16 (domain, ptr, len);
  return D.28310;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len (guint16 * ptr, gint32 len)
{
  struct MonoException * D.28316;
  struct MonoString * D.28317;
  struct MonoDomain * domain;

  domain = mono_domain_get ();
  if (ptr == 0B) goto <D.28314>; else goto <D.28315>;
  <D.28314>:
  D.28316 = mono_get_exception_argument_null ("ptr");
  mono_raise_exception (D.28316);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11770);
  D.28317 = 0B;
  return D.28317;
  <D.28315>:
  D.28317 = mono_string_new_utf16 (domain, ptr, len);
  return D.28317;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error ()
{
  guint32 D.28319;
  unsigned int last_error_tls_id.390;
  void * D.28321;
  long int D.28322;

  last_error_tls_id.390 = last_error_tls_id;
  D.28321 = pthread_getspecific (last_error_tls_id.390);
  D.28322 = (long int) D.28321;
  D.28319 = (guint32) D.28322;
  return D.28319;
}


ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (struct MonoReflectionType * rtype)
{
  _Bool D.28324;
  long int D.28325;
  long int D.28326;
  int D.28331;
  struct MonoException * D.28334;
  unsigned int D.28335;
  const char * D.28338;
  guint32 D.28339;
  int D.28340;
  struct MonoClass * klass;
  struct MonoType * type;
  guint32 layout;

  D.28324 = rtype == 0B;
  D.28325 = (long int) D.28324;
  D.28326 = __builtin_expect (D.28325, 0);
  if (D.28326 != 0) goto <D.28327>; else goto <D.28328>;
  <D.28327>:
  {
    struct MonoException * ex;

    if (rtype != 0B) goto <D.28329>; else goto <D.28330>;
    <D.28329>:
    <D.28330>:
    ex = mono_get_exception_argument_null ("rtype");
    mono_raise_exception (ex);
  }
  <D.28328>:
  type = rtype->type;
  klass = mono_class_from_mono_type (type);
  D.28331 = mono_class_init (klass);
  if (D.28331 == 0) goto <D.28332>; else goto <D.28333>;
  <D.28332>:
  D.28334 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28334);
  <D.28333>:
  D.28335 = klass->flags;
  layout = D.28335 & 24;
  if (layout == 0) goto <D.28336>; else goto <D.28337>;
  <D.28336>:
  {
    gchar * msg;
    struct MonoException * exc;

    D.28338 = klass->name;
    msg = monoeg_g_strdup_printf ("Type %s cannot be marshaled as an unmanaged structure.", D.28338);
    exc = mono_get_exception_argument ("t", msg);
    monoeg_g_free (msg);
    mono_raise_exception (exc);
  }
  <D.28337>:
  D.28340 = mono_class_native_size (klass, 0B);
  D.28339 = (guint32) D.28340;
  return D.28339;
}


ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (struct MonoObject * obj, void * dst, MonoBoolean delete_old)
{
  _Bool D.28342;
  long int D.28343;
  long int D.28344;
  void * dst.391;
  _Bool D.28350;
  long int D.28351;
  long int D.28352;
  struct MonoVTable * D.28357;
  struct MonoClass * D.28358;
  struct MonoMethod * method;
  void * pa[3];

  try
    {
      D.28342 = obj == 0B;
      D.28343 = (long int) D.28342;
      D.28344 = __builtin_expect (D.28343, 0);
      if (D.28344 != 0) goto <D.28345>; else goto <D.28346>;
      <D.28345>:
      {
        struct MonoException * ex;

        if (obj != 0B) goto <D.28347>; else goto <D.28348>;
        <D.28347>:
        <D.28348>:
        ex = mono_get_exception_argument_null ("obj");
        mono_raise_exception (ex);
      }
      <D.28346>:
      dst.391 = dst;
      D.28350 = dst.391 == 0B;
      D.28351 = (long int) D.28350;
      D.28352 = __builtin_expect (D.28351, 0);
      if (D.28352 != 0) goto <D.28353>; else goto <D.28354>;
      <D.28353>:
      {
        struct MonoException * ex;

        dst.391 = dst;
        if (dst.391 != 0B) goto <D.28355>; else goto <D.28356>;
        <D.28355>:
        <D.28356>:
        ex = mono_get_exception_argument_null ("dst");
        mono_raise_exception (ex);
      }
      <D.28354>:
      D.28357 = obj->vtable;
      D.28358 = D.28357->klass;
      method = mono_marshal_get_struct_to_ptr (D.28358);
      pa[0] = obj;
      pa[1] = &dst;
      pa[2] = &delete_old;
      mono_runtime_invoke (method, 0B, &pa, 0B);
    }
  finally
    {
      pa = {CLOBBER};
    }
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure (void * src, struct MonoObject * dst)
{
  _Bool D.28359;
  long int D.28360;
  long int D.28361;
  _Bool D.28366;
  long int D.28367;
  long int D.28368;
  struct MonoVTable * D.28373;
  struct MonoClass * D.28374;
  struct MonoType * D.28375;
  unsigned char D.28376;
  struct MonoType * t;

  D.28359 = src == 0B;
  D.28360 = (long int) D.28359;
  D.28361 = __builtin_expect (D.28360, 0);
  if (D.28361 != 0) goto <D.28362>; else goto <D.28363>;
  <D.28362>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28364>; else goto <D.28365>;
    <D.28364>:
    <D.28365>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28363>:
  D.28366 = dst == 0B;
  D.28367 = (long int) D.28366;
  D.28368 = __builtin_expect (D.28367, 0);
  if (D.28368 != 0) goto <D.28369>; else goto <D.28370>;
  <D.28369>:
  {
    struct MonoException * ex;

    if (dst != 0B) goto <D.28371>; else goto <D.28372>;
    <D.28371>:
    <D.28372>:
    ex = mono_get_exception_argument_null ("dst");
    mono_raise_exception (ex);
  }
  <D.28370>:
  D.28373 = dst->vtable;
  D.28374 = D.28373->klass;
  D.28375 = mono_class_get_type (D.28374);
  t = mono_type_get_underlying_type (D.28375);
  D.28376 = t->type;
  if (D.28376 == 17) goto <D.28377>; else goto <D.28378>;
  <D.28377>:
  {
    struct MonoException * exc;
    gchar * tmp;

    tmp = monoeg_g_strdup_printf ("Destination is a boxed value type.");
    exc = mono_get_exception_argument ("dst", tmp);
    monoeg_g_free (tmp);
    mono_raise_exception (exc);
    return;
  }
  <D.28378>:
  ptr_to_structure (src, dst);
}


ptr_to_structure (void * src, struct MonoObject * dst)
{
  struct MonoVTable * D.28380;
  struct MonoClass * D.28381;
  struct MonoMethod * method;
  void * pa[2];

  try
    {
      D.28380 = dst->vtable;
      D.28381 = D.28380->klass;
      method = mono_marshal_get_ptr_to_struct (D.28381);
      pa[0] = &src;
      pa[1] = dst;
      mono_runtime_invoke (method, 0B, &pa, 0B);
    }
  finally
    {
      pa = {CLOBBER};
    }
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (void * src, struct MonoReflectionType * type)
{
  struct MonoObject * D.28384;
  _Bool D.28385;
  long int D.28386;
  long int D.28387;
  struct MonoType * D.28392;
  int D.28393;
  struct MonoException * D.28396;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoObject * res;

  domain = mono_domain_get ();
  if (src == 0B) goto <D.28382>; else goto <D.28383>;
  <D.28382>:
  D.28384 = 0B;
  return D.28384;
  <D.28383>:
  D.28385 = type == 0B;
  D.28386 = (long int) D.28385;
  D.28387 = __builtin_expect (D.28386, 0);
  if (D.28387 != 0) goto <D.28388>; else goto <D.28389>;
  <D.28388>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28390>; else goto <D.28391>;
    <D.28390>:
    <D.28391>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28389>:
  D.28392 = type->type;
  klass = mono_class_from_mono_type (D.28392);
  D.28393 = mono_class_init (klass);
  if (D.28393 == 0) goto <D.28394>; else goto <D.28395>;
  <D.28394>:
  D.28396 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28396);
  <D.28395>:
  res = mono_object_new (domain, klass);
  ptr_to_structure (src, res);
  D.28384 = res;
  return D.28384;
}


ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (struct MonoReflectionType * type, struct MonoString * field_name)
{
  _Bool D.28398;
  long int D.28399;
  long int D.28400;
  _Bool D.28405;
  long int D.28406;
  long int D.28407;
  struct MonoType * D.28412;
  int D.28413;
  struct MonoException * D.28416;
  struct MonoType * D.28417;
  short unsigned int D.28418;
  int D.28419;
  int D.28420;
  int D.21533;
  const char * D.28423;
  _Bool D.28428;
  _Bool D.28429;
  _Bool D.28430;
  const char * D.28433;
  int D.28434;
  unsigned int D.28435;
  struct MonoMarshalType * info;
  struct MonoClass * klass;
  char * fname;
  int match_index;

  match_index = -1;
  D.28398 = type == 0B;
  D.28399 = (long int) D.28398;
  D.28400 = __builtin_expect (D.28399, 0);
  if (D.28400 != 0) goto <D.28401>; else goto <D.28402>;
  <D.28401>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28403>; else goto <D.28404>;
    <D.28403>:
    <D.28404>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28402>:
  D.28405 = field_name == 0B;
  D.28406 = (long int) D.28405;
  D.28407 = __builtin_expect (D.28406, 0);
  if (D.28407 != 0) goto <D.28408>; else goto <D.28409>;
  <D.28408>:
  {
    struct MonoException * ex;

    if (field_name != 0B) goto <D.28410>; else goto <D.28411>;
    <D.28410>:
    <D.28411>:
    ex = mono_get_exception_argument_null ("field_name");
    mono_raise_exception (ex);
  }
  <D.28409>:
  fname = mono_string_to_utf8 (field_name);
  D.28412 = type->type;
  klass = mono_class_from_mono_type (D.28412);
  D.28413 = mono_class_init (klass);
  if (D.28413 == 0) goto <D.28414>; else goto <D.28415>;
  <D.28414>:
  D.28416 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28416);
  <D.28415>:
  goto <D.21537>;
  <D.21536>:
  {
    struct MonoClassField * field;
    int i;
    void * iter;

    try
      {
        i = 0;
        iter = 0B;
        goto <D.21524>;
        <D.21535>:
        D.28417 = field->type;
        D.28418 = D.28417->attrs;
        D.28419 = (int) D.28418;
        D.28420 = D.28419 & 16;
        if (D.28420 != 0) goto <D.28421>; else goto <D.28422>;
        <D.28421>:
        // predicted unlikely by continue predictor.
        goto <D.21524>;
        <D.28422>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.28423 = mono_field_get_name (field);
          D.21533 = __builtin_strcmp (fname, D.28423);
        }
        if (D.21533 == 0) goto <D.28424>; else goto <D.28425>;
        <D.28424>:
        match_index = i;
        goto <D.21534>;
        <D.28425>:
        i = i + 1;
        <D.21524>:
        field = mono_class_get_fields (klass, &iter);
        if (field != 0B) goto <D.21535>; else goto <D.21534>;
        <D.21534>:
        if (match_index == -1) goto <D.28426>; else goto <D.28427>;
        <D.28426>:
        klass = klass->parent;
        <D.28427>:
      }
    finally
      {
        iter = {CLOBBER};
      }
  }
  <D.21537>:
  D.28428 = klass != 0B;
  D.28429 = match_index == -1;
  D.28430 = D.28428 & D.28429;
  if (D.28430 != 0) goto <D.21536>; else goto <D.21538>;
  <D.21538>:
  monoeg_g_free (fname);
  if (match_index == -1) goto <D.28431>; else goto <D.28432>;
  <D.28431>:
  {
    struct MonoException * exc;
    gchar * tmp;

    D.28412 = type->type;
    klass = mono_class_from_mono_type (D.28412);
    D.28433 = klass->name;
    tmp = monoeg_g_strdup_printf ("Field passed in is not a marshaled member of the type %s", D.28433);
    exc = mono_get_exception_argument ("fieldName", tmp);
    monoeg_g_free (tmp);
    mono_raise_exception (exc);
  }
  <D.28432>:
  info = mono_marshal_load_type_info (klass);
  D.28435 = info->fields[match_index].offset;
  D.28434 = (int) D.28435;
  return D.28434;
}


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (struct MonoString * string)
{
  void * D.28437;

  D.28437 = mono_string_to_utf8 (string);
  return D.28437;
}


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (struct MonoString * string)
{
  void * D.28441;
  int D.28442;
  int D.28443;
  int D.28444;
  long unsigned int D.28445;
  int D.28446;
  int D.28447;
  long unsigned int D.28448;
  mono_unichar2 * D.28449;
  int D.28450;
  long unsigned int D.28451;
  long unsigned int D.28452;
  gunichar2 * D.28453;

  if (string == 0B) goto <D.28439>; else goto <D.28440>;
  <D.28439>:
  D.28441 = 0B;
  return D.28441;
  <D.28440>:
  {
    gunichar2 * res;

    D.28442 = mono_string_length (string);
    D.28443 = D.28442 + 1;
    D.28444 = D.28443 * 2;
    D.28445 = (long unsigned int) D.28444;
    res = monoeg_malloc (D.28445);
    D.28446 = mono_string_length (string);
    D.28447 = D.28446 * 2;
    D.28448 = (long unsigned int) D.28447;
    D.28449 = mono_string_chars (string);
    memcpy (res, D.28449, D.28448);
    D.28450 = mono_string_length (string);
    D.28451 = (long unsigned int) D.28450;
    D.28452 = D.28451 * 2;
    D.28453 = res + D.28452;
    *D.28453 = 0;
    D.28441 = res;
    return D.28441;
  }
}


ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (void * src, struct MonoReflectionType * type)
{
  _Bool D.28455;
  long int D.28456;
  long int D.28457;
  _Bool D.28462;
  long int D.28463;
  long int D.28464;
  struct MonoType * D.28469;
  int D.28470;
  struct MonoException * D.28473;
  struct MonoClass * klass;

  D.28455 = src == 0B;
  D.28456 = (long int) D.28455;
  D.28457 = __builtin_expect (D.28456, 0);
  if (D.28457 != 0) goto <D.28458>; else goto <D.28459>;
  <D.28458>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28460>; else goto <D.28461>;
    <D.28460>:
    <D.28461>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28459>:
  D.28462 = type == 0B;
  D.28463 = (long int) D.28462;
  D.28464 = __builtin_expect (D.28463, 0);
  if (D.28464 != 0) goto <D.28465>; else goto <D.28466>;
  <D.28465>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28467>; else goto <D.28468>;
    <D.28467>:
    <D.28468>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28466>:
  D.28469 = type->type;
  klass = mono_class_from_mono_type (D.28469);
  D.28470 = mono_class_init (klass);
  if (D.28470 == 0) goto <D.28471>; else goto <D.28472>;
  <D.28471>:
  D.28473 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28473);
  <D.28472>:
  mono_struct_delete_old (klass, src);
}


ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (int size)
{
  long unsigned int D.28476;
  void * D.28479;
  void * res;

  if (size == 0) goto <D.28474>; else goto <D.28475>;
  <D.28474>:
  size = 4;
  <D.28475>:
  D.28476 = (long unsigned int) size;
  res = monoeg_try_malloc (D.28476);
  if (res == 0B) goto <D.28477>; else goto <D.28478>;
  <D.28477>:
  D.28476 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28476);
  <D.28478>:
  D.28479 = res;
  return D.28479;
}


ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (void * ptr, int size)
{
  long unsigned int D.28483;
  void * D.28484;
  void * res;

  if (ptr == 0B) goto <D.28481>; else goto <D.28482>;
  <D.28481>:
  D.28483 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28483);
  D.28484 = 0B;
  return D.28484;
  <D.28482>:
  D.28483 = (long unsigned int) size;
  res = monoeg_try_realloc (ptr, D.28483);
  if (res == 0B) goto <D.28485>; else goto <D.28486>;
  <D.28485>:
  D.28483 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28483);
  <D.28486>:
  D.28484 = res;
  return D.28484;
}


ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void * ptr)
{
  monoeg_g_free (ptr);
}


ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
{
  void * D.28488;
  long unsigned int D.28489;

  D.28489 = (long unsigned int) size;
  D.28488 = monoeg_try_malloc (D.28489);
  return D.28488;
}


ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem (void * ptr)
{
  monoeg_g_free (ptr);
}


ves_icall_System_Runtime_InteropServices_Marshal_ReAllocCoTaskMem (void * ptr, int size)
{
  void * D.28491;
  long unsigned int D.28492;

  D.28492 = (long unsigned int) size;
  D.28491 = monoeg_try_realloc (ptr, D.28492);
  return D.28491;
}


ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (struct MonoArray * arrayobj, int index)
{
  void * D.28494;
  double[0:] * D.28495;
  struct MonoVTable * D.28496;
  struct MonoClass * D.28497;
  int D.28498;
  int D.28499;
  sizetype D.28500;

  D.28495 = &arrayobj->vector;
  D.28496 = arrayobj->obj.vtable;
  D.28497 = D.28496->klass;
  D.28498 = mono_array_element_size (D.28497);
  D.28499 = D.28498 * index;
  D.28500 = (sizetype) D.28499;
  D.28494 = D.28495 + D.28500;
  return D.28494;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void * ftn, struct MonoReflectionType * type)
{
  struct MonoType * D.28502;
  int D.28503;
  struct MonoException * D.28506;
  struct MonoDelegate * D.28507;
  struct MonoClass * klass;

  D.28502 = type->type;
  klass = mono_type_get_class (D.28502);
  D.28503 = mono_class_init (klass);
  if (D.28503 == 0) goto <D.28504>; else goto <D.28505>;
  <D.28504>:
  D.28506 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28506);
  <D.28505>:
  D.28507 = mono_ftnptr_to_delegate (klass, ftn);
  return D.28507;
}


mono_marshal_load_type_info (struct MonoClass * klass)
{
  _Bool D.28509;
  long int D.28510;
  long int D.28511;
  struct MonoMarshalType * D.28514;
  struct MonoMarshalType * D.28517;
  unsigned char D.28518;
  unsigned char D.28519;
  int D.28524;
  _Bool D.28525;
  long int D.28526;
  long int D.28527;
  unsigned int load_type_info_tls_id.392;
  struct MonoType * D.28531;
  short unsigned int D.28532;
  int D.28533;
  int D.28534;
  int D.28537;
  int D.21635;
  int iftmp.393;
  int D.21634;
  const char[9] * D.28543;
  unsigned char D.28544;
  int D.28545;
  unsigned char D.28546;
  int D.28547;
  _Bool D.28548;
  _Bool D.28549;
  _Bool D.28550;
  const unsigned char * D.28553;
  unsigned char D.28554;
  int D.28555;
  const unsigned char * D.28556;
  unsigned char D.28557;
  int D.28558;
  _Bool D.28559;
  _Bool D.28560;
  const unsigned char * D.28563;
  unsigned char D.28564;
  int D.28565;
  const unsigned char * D.28566;
  unsigned char D.28567;
  int D.28568;
  _Bool D.28569;
  _Bool D.28570;
  const unsigned char * D.28573;
  unsigned char D.28574;
  int D.28575;
  const unsigned char * D.28576;
  unsigned char D.28577;
  int D.28578;
  const char * D.28580;
  unsigned int D.28583;
  long unsigned int D.28584;
  unsigned int D.28585;
  unsigned int D.28586;
  unsigned int D.28587;
  struct MonoImage * D.28588;
  unsigned int count.394;
  unsigned int D.28590;
  struct MonoClass * D.28591;
  unsigned int native_size.395;
  unsigned int parent_size.396;
  unsigned int native_size.397;
  guint32 iftmp.398;
  unsigned char D.28598;
  unsigned char D.28599;
  <unnamed-unsigned:4> D.28602;
  int D.21650;
  int iftmp.399;
  int D.21649;
  unsigned char D.28611;
  int D.28612;
  _Bool D.28613;
  _Bool D.28614;
  _Bool D.28615;
  const unsigned char * D.28618;
  unsigned char D.28619;
  int D.28620;
  _Bool D.28621;
  _Bool D.28622;
  const unsigned char * D.28625;
  unsigned char D.28626;
  int D.28627;
  _Bool D.28628;
  _Bool D.28629;
  const unsigned char * D.28632;
  unsigned char D.28633;
  int D.28634;
  const char * D.28636;
  int D.28639;
  struct MonoMarshalSpec * * D.28642;
  unsigned int D.28643;
  unsigned int D.28644;
  unsigned int D.28645;
  int D.28646;
  int D.28649;
  int D.21659;
  int iftmp.400;
  int D.21658;
  const char[10] * D.28655;
  unsigned char D.28656;
  int D.28657;
  unsigned char D.28658;
  int D.28659;
  _Bool D.28660;
  _Bool D.28661;
  _Bool D.28662;
  const unsigned char * D.28665;
  unsigned char D.28666;
  int D.28667;
  const unsigned char * D.28668;
  unsigned char D.28669;
  int D.28670;
  _Bool D.28671;
  _Bool D.28672;
  const unsigned char * D.28675;
  unsigned char D.28676;
  int D.28677;
  const unsigned char * D.28678;
  unsigned char D.28679;
  int D.28680;
  _Bool D.28681;
  _Bool D.28682;
  const unsigned char * D.28685;
  unsigned char D.28686;
  int D.28687;
  const unsigned char * D.28688;
  unsigned char D.28689;
  int D.28690;
  const char * D.28692;
  <unnamed-unsigned:1> D.28695;
  int D.28696;
  struct MonoMarshalSpec * D.28697;
  guint32 iftmp.401;
  unsigned int D.28701;
  unsigned int align.402;
  unsigned int D.28704;
  unsigned int D.28705;
  unsigned int D.28706;
  unsigned int D.28707;
  unsigned int D.28708;
  unsigned int D.28709;
  unsigned int size.403;
  unsigned int D.28711;
  int D.28712;
  unsigned int D.28713;
  unsigned int D.28714;
  unsigned int D.28715;
  unsigned int D.28719;
  unsigned int D.28727;
  unsigned int D.28728;
  unsigned int D.28731;
  unsigned int D.28732;
  unsigned int D.28733;
  unsigned int D.28734;
  int D.28735;
  unsigned int D.28736;
  unsigned char D.28739;
  struct MonoClass * D.28742;
  int D.28743;
  _Bool D.28748;
  long int D.28749;
  long int D.28750;
  _Bool D.28757;
  long int D.28758;
  long int D.28759;
  int j;
  int count;
  guint32 native_size;
  guint32 min_align;
  guint32 packing;
  struct MonoMarshalType * info;
  struct MonoClassField * field;
  void * iter;
  guint32 layout;
  struct GSList * loads_list;

  try
    {
      count = 0;
      native_size = 0;
      min_align = 1;
      D.28509 = klass == 0B;
      D.28510 = (long int) D.28509;
      D.28511 = __builtin_expect (D.28510, 0);
      if (D.28511 != 0) goto <D.28512>; else goto <D.28513>;
      <D.28512>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12208, "klass != NULL");
      <D.28513>:
      D.28514 = klass->marshal_info;
      if (D.28514 != 0B) goto <D.28515>; else goto <D.28516>;
      <D.28515>:
      D.28517 = klass->marshal_info;
      return D.28517;
      <D.28516>:
      D.28518 = BIT_FIELD_REF <*klass, 8, 256>;
      D.28519 = D.28518 & 1;
      if (D.28519 == 0) goto <D.28520>; else goto <D.28521>;
      <D.28520>:
      mono_class_init (klass);
      <D.28521>:
      D.28514 = klass->marshal_info;
      if (D.28514 != 0B) goto <D.28522>; else goto <D.28523>;
      <D.28522>:
      D.28517 = klass->marshal_info;
      return D.28517;
      <D.28523>:
      D.28524 = mono_marshal_is_loading_type_info (klass);
      D.28525 = D.28524 != 0;
      D.28526 = (long int) D.28525;
      D.28527 = __builtin_expect (D.28526, 0);
      if (D.28527 != 0) goto <D.28528>; else goto <D.28529>;
      <D.28528>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12223, "!mono_marshal_is_loading_type_info (klass)");
      <D.28529>:
      load_type_info_tls_id.392 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.392);
      loads_list = monoeg_g_slist_prepend (loads_list, klass);
      load_type_info_tls_id.392 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.392, loads_list);
      iter = 0B;
      goto <D.21626>;
      <D.21636>:
      D.28531 = field->type;
      D.28532 = D.28531->attrs;
      D.28533 = (int) D.28532;
      D.28534 = D.28533 & 16;
      if (D.28534 != 0) goto <D.28535>; else goto <D.28536>;
      <D.28535>:
      // predicted unlikely by continue predictor.
      goto <D.21626>;
      <D.28536>:
      D.28531 = field->type;
      D.28532 = D.28531->attrs;
      D.28533 = (int) D.28532;
      D.28537 = D.28533 & 1536;
      if (D.28537 != 0) goto <D.28538>; else goto <D.28539>;
      <D.28538>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_field_get_name (field);
          D.28543 = "_Deleted";
          D.28544 = MEM[(const unsigned char *)D.28543];
          D.28545 = (int) D.28544;
          D.28546 = *__s2;
          D.28547 = (int) D.28546;
          __result = D.28545 - D.28547;
          {
            D.28548 = __s2_len != 0;
            D.28549 = __result == 0;
            D.28550 = D.28548 & D.28549;
            if (D.28550 != 0) goto <D.28551>; else goto <D.28552>;
            <D.28551>:
            D.28553 = &MEM[(void *)"_Deleted" + 1B];
            D.28554 = *D.28553;
            D.28555 = (int) D.28554;
            D.28556 = __s2 + 1;
            D.28557 = *D.28556;
            D.28558 = (int) D.28557;
            __result = D.28555 - D.28558;
            D.28559 = __s2_len > 1;
            D.28549 = __result == 0;
            D.28560 = D.28559 & D.28549;
            if (D.28560 != 0) goto <D.28561>; else goto <D.28562>;
            <D.28561>:
            D.28563 = &MEM[(void *)"_Deleted" + 2B];
            D.28564 = *D.28563;
            D.28565 = (int) D.28564;
            D.28566 = __s2 + 2;
            D.28567 = *D.28566;
            D.28568 = (int) D.28567;
            __result = D.28565 - D.28568;
            D.28569 = __s2_len > 2;
            D.28549 = __result == 0;
            D.28570 = D.28569 & D.28549;
            if (D.28570 != 0) goto <D.28571>; else goto <D.28572>;
            <D.28571>:
            D.28573 = &MEM[(void *)"_Deleted" + 3B];
            D.28574 = *D.28573;
            D.28575 = (int) D.28574;
            D.28576 = __s2 + 3;
            D.28577 = *D.28576;
            D.28578 = (int) D.28577;
            __result = D.28575 - D.28578;
            <D.28572>:
            <D.28562>:
            <D.28552>:
          }
          D.21634 = __result;
        }
        iftmp.393 = -D.21634;
        goto <D.28579>;
        <D.28542>:
        D.28580 = mono_field_get_name (field);
        iftmp.393 = __builtin_strcmp (D.28580, "_Deleted");
        <D.28579>:
        D.21635 = iftmp.393;
      }
      if (D.21635 == 0) goto <D.28581>; else goto <D.28582>;
      <D.28581>:
      // predicted unlikely by continue predictor.
      goto <D.21626>;
      <D.28582>:
      <D.28539>:
      count = count + 1;
      <D.21626>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21636>; else goto <D.21637>;
      <D.21637>:
      D.28583 = klass->flags;
      layout = D.28583 & 24;
      D.28584 = (long unsigned int) count;
      D.28585 = (unsigned int) D.28584;
      D.28586 = D.28585 * 24;
      D.28587 = D.28586 + 32;
      D.28588 = klass->image;
      info = mono_image_alloc0 (D.28588, D.28587);
      count.394 = (unsigned int) count;
      info->num_fields = count.394;
      D.28590 = klass->type_token;
      D.28588 = klass->image;
      mono_metadata_packing_from_typedef (D.28588, D.28590, 0B, &native_size);
      D.28591 = klass->parent;
      if (D.28591 != 0B) goto <D.28592>; else goto <D.28593>;
      <D.28592>:
      {
        int parent_size;

        D.28591 = klass->parent;
        parent_size = mono_class_native_size (D.28591, 0B);
        native_size.395 = native_size;
        parent_size.396 = (unsigned int) parent_size;
        native_size.397 = native_size.395 + parent_size.396;
        native_size = native_size.397;
        parent_size.396 = (unsigned int) parent_size;
        info->native_size = parent_size.396;
      }
      <D.28593>:
      D.28598 = BIT_FIELD_REF <*klass, 8, 272>;
      D.28599 = D.28598 & 15;
      if (D.28599 != 0) goto <D.28600>; else goto <D.28601>;
      <D.28600>:
      D.28602 = klass->packing_size;
      iftmp.398 = (guint32) D.28602;
      goto <D.28603>;
      <D.28601>:
      iftmp.398 = 8;
      <D.28603>:
      packing = iftmp.398;
      iter = 0B;
      j = 0;
      goto <D.21641>;
      <D.21664>:
      {
        int size;
        guint32 align;

        try
          {
            D.28531 = field->type;
            D.28532 = D.28531->attrs;
            D.28533 = (int) D.28532;
            D.28534 = D.28533 & 16;
            if (D.28534 != 0) goto <D.28604>; else goto <D.28605>;
            <D.28604>:
            // predicted unlikely by continue predictor.
            goto <D.21641>;
            <D.28605>:
            D.28531 = field->type;
            D.28532 = D.28531->attrs;
            D.28533 = (int) D.28532;
            D.28537 = D.28533 & 1536;
            if (D.28537 != 0) goto <D.28606>; else goto <D.28607>;
            <D.28606>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28543 = "_Deleted";
                D.28544 = MEM[(const unsigned char *)D.28543];
                D.28545 = (int) D.28544;
                D.28611 = *__s2;
                D.28612 = (int) D.28611;
                __result = D.28545 - D.28612;
                {
                  D.28613 = __s2_len != 0;
                  D.28614 = __result == 0;
                  D.28615 = D.28613 & D.28614;
                  if (D.28615 != 0) goto <D.28616>; else goto <D.28617>;
                  <D.28616>:
                  D.28553 = &MEM[(void *)"_Deleted" + 1B];
                  D.28554 = *D.28553;
                  D.28555 = (int) D.28554;
                  D.28618 = __s2 + 1;
                  D.28619 = *D.28618;
                  D.28620 = (int) D.28619;
                  __result = D.28555 - D.28620;
                  D.28621 = __s2_len > 1;
                  D.28614 = __result == 0;
                  D.28622 = D.28621 & D.28614;
                  if (D.28622 != 0) goto <D.28623>; else goto <D.28624>;
                  <D.28623>:
                  D.28563 = &MEM[(void *)"_Deleted" + 2B];
                  D.28564 = *D.28563;
                  D.28565 = (int) D.28564;
                  D.28625 = __s2 + 2;
                  D.28626 = *D.28625;
                  D.28627 = (int) D.28626;
                  __result = D.28565 - D.28627;
                  D.28628 = __s2_len > 2;
                  D.28614 = __result == 0;
                  D.28629 = D.28628 & D.28614;
                  if (D.28629 != 0) goto <D.28630>; else goto <D.28631>;
                  <D.28630>:
                  D.28573 = &MEM[(void *)"_Deleted" + 3B];
                  D.28574 = *D.28573;
                  D.28575 = (int) D.28574;
                  D.28632 = __s2 + 3;
                  D.28633 = *D.28632;
                  D.28634 = (int) D.28633;
                  __result = D.28575 - D.28634;
                  <D.28631>:
                  <D.28624>:
                  <D.28617>:
                }
                D.21649 = __result;
              }
              iftmp.399 = -D.21649;
              goto <D.28635>;
              <D.28610>:
              D.28636 = mono_field_get_name (field);
              iftmp.399 = __builtin_strcmp (D.28636, "_Deleted");
              <D.28635>:
              D.21650 = iftmp.399;
            }
            if (D.21650 == 0) goto <D.28637>; else goto <D.28638>;
            <D.28637>:
            // predicted unlikely by continue predictor.
            goto <D.21641>;
            <D.28638>:
            <D.28607>:
            D.28531 = field->type;
            D.28532 = D.28531->attrs;
            D.28533 = (int) D.28532;
            D.28639 = D.28533 & 4096;
            if (D.28639 != 0) goto <D.28640>; else goto <D.28641>;
            <D.28640>:
            D.28642 = &info->fields[j].mspec;
            D.28643 = mono_class_get_field_token (field);
            D.28644 = D.28643 & 16777215;
            D.28645 = D.28644 + 4294967295;
            D.28588 = klass->image;
            mono_metadata_field_info_with_mempool (D.28588, D.28645, 0B, 0B, D.28642);
            <D.28641>:
            info->fields[j].field = field;
            D.28646 = mono_class_num_fields (klass);
            if (D.28646 == 1) goto <D.28647>; else goto <D.28648>;
            <D.28647>:
            D.28649 = klass->instance_size;
            if (D.28649 == 16) goto <D.28650>; else goto <D.28651>;
            <D.28650>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28655 = "$PRIVATE$";
                D.28656 = MEM[(const unsigned char *)D.28655];
                D.28657 = (int) D.28656;
                D.28658 = *__s2;
                D.28659 = (int) D.28658;
                __result = D.28657 - D.28659;
                {
                  D.28660 = __s2_len != 0;
                  D.28661 = __result == 0;
                  D.28662 = D.28660 & D.28661;
                  if (D.28662 != 0) goto <D.28663>; else goto <D.28664>;
                  <D.28663>:
                  D.28665 = &MEM[(void *)"$PRIVATE$" + 1B];
                  D.28666 = *D.28665;
                  D.28667 = (int) D.28666;
                  D.28668 = __s2 + 1;
                  D.28669 = *D.28668;
                  D.28670 = (int) D.28669;
                  __result = D.28667 - D.28670;
                  D.28671 = __s2_len > 1;
                  D.28661 = __result == 0;
                  D.28672 = D.28671 & D.28661;
                  if (D.28672 != 0) goto <D.28673>; else goto <D.28674>;
                  <D.28673>:
                  D.28675 = &MEM[(void *)"$PRIVATE$" + 2B];
                  D.28676 = *D.28675;
                  D.28677 = (int) D.28676;
                  D.28678 = __s2 + 2;
                  D.28679 = *D.28678;
                  D.28680 = (int) D.28679;
                  __result = D.28677 - D.28680;
                  D.28681 = __s2_len > 2;
                  D.28661 = __result == 0;
                  D.28682 = D.28681 & D.28661;
                  if (D.28682 != 0) goto <D.28683>; else goto <D.28684>;
                  <D.28683>:
                  D.28685 = &MEM[(void *)"$PRIVATE$" + 3B];
                  D.28686 = *D.28685;
                  D.28687 = (int) D.28686;
                  D.28688 = __s2 + 3;
                  D.28689 = *D.28688;
                  D.28690 = (int) D.28689;
                  __result = D.28687 - D.28690;
                  <D.28684>:
                  <D.28674>:
                  <D.28664>:
                }
                D.21658 = __result;
              }
              iftmp.400 = -D.21658;
              goto <D.28691>;
              <D.28654>:
              D.28692 = mono_field_get_name (field);
              iftmp.400 = __builtin_strcmp (D.28692, "$PRIVATE$");
              <D.28691>:
              D.21659 = iftmp.400;
            }
            if (D.21659 == 0) goto <D.28693>; else goto <D.28694>;
            <D.28693>:
            // predicted unlikely by continue predictor.
            goto <D.21641>;
            <D.28694>:
            <D.28651>:
            <D.28648>:
            switch (layout) <default: <D.28716>, case 0: <D.21660>, case 8: <D.21661>, case 16: <D.21663>>
            <D.21660>:
            <D.21661>:
            D.28695 = klass->unicode;
            D.28696 = (int) D.28695;
            D.28697 = info->fields[j].mspec;
            D.28531 = field->type;
            size = mono_marshal_type_size (D.28531, D.28697, &align, 1, D.28696);
            D.28598 = BIT_FIELD_REF <*klass, 8, 272>;
            D.28599 = D.28598 & 15;
            if (D.28599 != 0) goto <D.28699>; else goto <D.28700>;
            <D.28699>:
            D.28602 = klass->packing_size;
            D.28701 = (unsigned int) D.28602;
            align.402 = align;
            iftmp.401 = MIN_EXPR <D.28701, align.402>;
            goto <D.28703>;
            <D.28700>:
            iftmp.401 = align;
            <D.28703>:
            align = iftmp.401;
            align.402 = align;
            min_align = MAX_EXPR <min_align, align.402>;
            D.28704 = info->native_size;
            info->fields[j].offset = D.28704;
            D.28705 = info->fields[j].offset;
            align.402 = align;
            D.28706 = D.28705 + align.402;
            D.28707 = D.28706 + 4294967295;
            info->fields[j].offset = D.28707;
            D.28705 = info->fields[j].offset;
            align.402 = align;
            D.28708 = -align.402;
            D.28709 = D.28705 & D.28708;
            info->fields[j].offset = D.28709;
            D.28705 = info->fields[j].offset;
            size.403 = (unsigned int) size;
            D.28711 = D.28705 + size.403;
            info->native_size = D.28711;
            goto <D.21662>;
            <D.21663>:
            D.28695 = klass->unicode;
            D.28696 = (int) D.28695;
            D.28697 = info->fields[j].mspec;
            D.28531 = field->type;
            size = mono_marshal_type_size (D.28531, D.28697, &align, 1, D.28696);
            align.402 = align;
            min_align = MAX_EXPR <min_align, align.402>;
            D.28712 = field->offset;
            D.28713 = (unsigned int) D.28712;
            D.28714 = D.28713 + 4294967280;
            info->fields[j].offset = D.28714;
            D.28705 = info->fields[j].offset;
            size.403 = (unsigned int) size;
            D.28711 = D.28705 + size.403;
            D.28704 = info->native_size;
            D.28715 = MAX_EXPR <D.28711, D.28704>;
            info->native_size = D.28715;
            goto <D.21662>;
            <D.28716>:
            <D.21662>:
            j = j + 1;
          }
        finally
          {
            align = {CLOBBER};
          }
      }
      <D.21641>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21664>; else goto <D.21665>;
      <D.21665>:
      if (layout != 0) goto <D.28717>; else goto <D.28718>;
      <D.28717>:
      D.28704 = info->native_size;
      native_size.395 = native_size;
      D.28719 = MAX_EXPR <D.28704, native_size.395>;
      info->native_size = D.28719;
      if (layout == 16) goto <D.28720>; else goto <D.28721>;
      <D.28720>:
      native_size.395 = native_size;
      if (native_size.395 != 0) goto <D.28724>; else goto <D.28722>;
      <D.28724>:
      D.28704 = info->native_size;
      native_size.395 = native_size;
      if (D.28704 == native_size.395) goto <D.28725>; else goto <D.28722>;
      <D.28725>:
      D.28598 = BIT_FIELD_REF <*klass, 8, 272>;
      D.28599 = D.28598 & 15;
      if (D.28599 == 0) goto <D.28726>; else goto <D.28722>;
      <D.28726>:
      min_align = 1;
      goto <D.28723>;
      <D.28722>:
      min_align = MIN_EXPR <packing, min_align>;
      <D.28723>:
      <D.28721>:
      <D.28718>:
      D.28704 = info->native_size;
      D.28727 = min_align + 4294967295;
      D.28728 = D.28704 & D.28727;
      if (D.28728 != 0) goto <D.28729>; else goto <D.28730>;
      <D.28729>:
      D.28704 = info->native_size;
      D.28731 = D.28704 + min_align;
      D.28732 = D.28731 + 4294967295;
      info->native_size = D.28732;
      D.28704 = info->native_size;
      D.28733 = -min_align;
      D.28734 = D.28704 & D.28733;
      info->native_size = D.28734;
      <D.28730>:
      info->min_align = min_align;
      D.28704 = info->native_size;
      D.28735 = mono_class_value_size (klass, 0B);
      D.28736 = (unsigned int) D.28735;
      if (D.28704 != D.28736) goto <D.28737>; else goto <D.28738>;
      <D.28737>:
      klass->blittable = 0;
      <D.28738>:
      D.28739 = klass->rank;
      if (D.28739 != 0) goto <D.28740>; else goto <D.28741>;
      <D.28740>:
      D.28742 = klass->element_class;
      D.28743 = mono_marshal_is_loading_type_info (D.28742);
      if (D.28743 == 0) goto <D.28744>; else goto <D.28745>;
      <D.28744>:
      D.28742 = klass->element_class;
      mono_marshal_load_type_info (D.28742);
      <D.28745>:
      <D.28741>:
      load_type_info_tls_id.392 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.392);
      loads_list = monoeg_g_slist_remove (loads_list, klass);
      load_type_info_tls_id.392 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.392, loads_list);
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28746>; else goto <D.28747>;
        <D.28746>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.28747>:
        D.28748 = ret != 0;
        D.28749 = (long int) D.28748;
        D.28750 = __builtin_expect (D.28749, 0);
        if (D.28750 != 0) goto <D.28751>; else goto <D.28752>;
        <D.28751>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12335, "ret == 0");
        <D.28752>:
      }
      D.28514 = klass->marshal_info;
      if (D.28514 == 0B) goto <D.28753>; else goto <D.28754>;
      <D.28753>:
      mono_memory_barrier ();
      klass->marshal_info = info;
      <D.28754>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28755>; else goto <D.28756>;
        <D.28755>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28756>:
        D.28757 = ret != 0;
        D.28758 = (long int) D.28757;
        D.28759 = __builtin_expect (D.28758, 0);
        if (D.28759 != 0) goto <D.28760>; else goto <D.28761>;
        <D.28760>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12341, "ret == 0");
        <D.28761>:
      }
      D.28517 = klass->marshal_info;
      return D.28517;
    }
  finally
    {
      native_size = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_marshal_is_loading_type_info (struct MonoClass * klass)
{
  unsigned int load_type_info_tls_id.404;
  gboolean D.28767;
  struct GSList * D.28768;
  _Bool D.28769;
  struct GSList * loads_list;

  load_type_info_tls_id.404 = load_type_info_tls_id;
  loads_list = pthread_getspecific (load_type_info_tls_id.404);
  D.28768 = monoeg_g_slist_find (loads_list, klass);
  D.28769 = D.28768 != 0B;
  D.28767 = (gboolean) D.28769;
  return D.28767;
}


mono_class_native_size (struct MonoClass * klass, guint32 * align)
{
  struct MonoMarshalType * D.28771;
  int D.28774;
  gint32 D.28779;
  unsigned int D.28782;
  unsigned int D.28783;

  D.28771 = klass->marshal_info;
  if (D.28771 == 0B) goto <D.28772>; else goto <D.28773>;
  <D.28772>:
  D.28774 = mono_marshal_is_loading_type_info (klass);
  if (D.28774 != 0) goto <D.28775>; else goto <D.28776>;
  <D.28775>:
  if (align != 0B) goto <D.28777>; else goto <D.28778>;
  <D.28777>:
  *align = 0;
  <D.28778>:
  D.28779 = 0;
  return D.28779;
  <D.28776>:
  mono_marshal_load_type_info (klass);
  <D.28773>:
  if (align != 0B) goto <D.28780>; else goto <D.28781>;
  <D.28780>:
  D.28771 = klass->marshal_info;
  D.28782 = D.28771->min_align;
  *align = D.28782;
  <D.28781>:
  D.28771 = klass->marshal_info;
  D.28783 = D.28771->native_size;
  D.28779 = (gint32) D.28783;
  return D.28779;
}


mono_type_native_stack_size (struct MonoType * t, guint32 * align)
{
  _Bool D.28785;
  long int D.28786;
  long int D.28787;
  unsigned char D.28792;
  unsigned char D.28793;
  int D.28796;
  unsigned char D.28797;
  int D.28798;
  int D.28799;
  unsigned char D.28802;
  unsigned char D.28803;
  struct MonoType * D.28806;
  int D.28807;
  unsigned int D.28808;
  unsigned int D.28809;
  unsigned int D.28810;
  guint32 tmp;

  try
    {
      D.28785 = t == 0B;
      D.28786 = (long int) D.28785;
      D.28787 = __builtin_expect (D.28786, 0);
      if (D.28787 != 0) goto <D.28788>; else goto <D.28789>;
      <D.28788>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12389, "t != NULL");
      <D.28789>:
      if (align == 0B) goto <D.28790>; else goto <D.28791>;
      <D.28790>:
      align = &tmp;
      <D.28791>:
      D.28792 = BIT_FIELD_REF <*t, 8, 88>;
      D.28793 = D.28792 & 64;
      if (D.28793 != 0) goto <D.28794>; else goto <D.28795>;
      <D.28794>:
      *align = 8;
      D.28796 = 8;
      return D.28796;
      <D.28795>:
      D.28797 = t->type;
      D.28798 = (int) D.28797;
      switch (D.28798) <default: <D.21709>, case 2: <D.21677>, case 3: <D.21678>, case 4: <D.21679>, case 5: <D.21680>, case 6: <D.21681>, case 7: <D.21682>, case 8: <D.21683>, case 9: <D.21684>, case 10: <D.21699>, case 11: <D.21700>, case 12: <D.21694>, case 13: <D.21695>, case 14: <D.21687>, case 15: <D.21691>, case 17: <D.21706>, case 18: <D.21689>, case 20: <D.21693>, case 21: <D.21704>, case 22: <D.21705>, case 24: <D.21685>, case 25: <D.21686>, case 27: <D.21692>, case 28: <D.21688>, case 29: <D.21690>>
      {
        typedef struct 
      {
        char c;
        gdouble x;
      } struct struct 
      {
        char c;
        gdouble x;
      };
        typedef struct 
      {
        char c;
        glong x;
      } struct struct 
      {
        char c;
        glong x;
      };

        <D.21677>:
        <D.21678>:
        <D.21679>:
        <D.21680>:
        <D.21681>:
        <D.21682>:
        <D.21683>:
        <D.21684>:
        *align = 4;
        D.28796 = 4;
        return D.28796;
        <D.21685>:
        <D.21686>:
        <D.21687>:
        <D.21688>:
        <D.21689>:
        <D.21690>:
        <D.21691>:
        <D.21692>:
        <D.21693>:
        *align = 8;
        D.28796 = 8;
        return D.28796;
        <D.21694>:
        *align = 4;
        D.28796 = 4;
        return D.28796;
        <D.21695>:
        *align = 8;
        D.28796 = 8;
        return D.28796;
        <D.21699>:
        <D.21700>:
        *align = 8;
        D.28796 = 8;
        return D.28796;
        <D.21704>:
        D.28799 = mono_type_generic_inst_is_valuetype (t);
        if (D.28799 == 0) goto <D.28800>; else goto <D.28801>;
        <D.28800>:
        *align = 8;
        D.28796 = 8;
        return D.28796;
        <D.28801>:
        <D.21705>:
        <D.21706>:
        {
          guint32 size;
          struct MonoClass * klass;

          klass = mono_class_from_mono_type (t);
          D.28802 = BIT_FIELD_REF <*klass, 8, 256>;
          D.28803 = D.28802 & 16;
          if (D.28803 != 0) goto <D.28804>; else goto <D.28805>;
          <D.28804>:
          D.28806 = mono_class_enum_basetype (klass);
          D.28796 = mono_type_native_stack_size (D.28806, align);
          return D.28796;
          <D.28805>:
          D.28807 = mono_class_native_size (klass, align);
          size = (guint32) D.28807;
          D.28808 = *align;
          D.28809 = D.28808 + 3;
          *align = D.28809;
          D.28808 = *align;
          D.28810 = D.28808 & 4294967292;
          *align = D.28810;
          size = size + 3;
          size = size & 4294967292;
          D.28796 = (int) size;
          return D.28796;
        }
        <D.21709>:
        D.28797 = t->type;
        D.28798 = (int) D.28797;
        monoeg_g_log (0B, 4, "type 0x%02x unknown", D.28798);
        <D.21710>:
        goto <D.21710>;
      }
      D.28796 = 0;
      return D.28796;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


mono_marshal_type_size (struct MonoType * type, struct MonoMarshalSpec * mspec, guint32 * align, gboolean as_field, gboolean unicode)
{
  gint32 D.28813;
  struct MonoClass * D.28814;
  <unnamed type> D.28819;
  int iftmp.405;
  _Bool D.28826;
  long int D.28827;
  long int D.28828;
  unsigned int esize.406;
  int D.28832;
  struct MonoClass * D.28833;
  struct MonoClass * D.28834;
  int iftmp.407;
  unsigned int esize.408;
  MonoMarshalNative native_type;
  struct MonoClass * klass;

  native_type = mono_type_to_unmanaged (type, mspec, as_field, unicode, 0B);
  switch (native_type) <default: <D.21766>, case 2: <D.21720>, case 3: <D.21721>, case 4: <D.21722>, case 5: <D.21723>, case 6: <D.21724>, case 7: <D.21726>, case 8: <D.21727>, case 9: <D.21729>, case 10: <D.21730>, case 11: <D.21734>, case 12: <D.21735>, case 15: <D.21764>, case 19: <D.21744>, case 20: <D.21741>, case 21: <D.21742>, case 22: <D.21743>, case 23: <D.21759>, case 25: <D.21749>, case 26: <D.21750>, case 27: <D.21758>, case 28: <D.21751>, case 29: <D.21748>, case 30: <D.21761>, case 31: <D.21739>, case 32: <D.21740>, case 34: <D.21765>, case 35: <D.21745>, case 36: <D.21746>, case 37: <D.21725>, case 38: <D.21753>, case 40: <D.21752>, case 42: <D.21747>, case 43: <D.21754>, case 44: <D.21763>, case 45: <D.21728>>
  {
    typedef struct 
  {
    char c;
    guint64 x;
  } struct struct 
  {
    char c;
    guint64 x;
  };
    typedef struct 
  {
    char c;
    double x;
  } struct struct 
  {
    char c;
    double x;
  };
    typedef struct 
  {
    char c;
    void * x;
  } struct struct 
  {
    char c;
    void * x;
  };

    <D.21720>:
    *align = 4;
    D.28813 = 4;
    return D.28813;
    <D.21721>:
    <D.21722>:
    *align = 1;
    D.28813 = 1;
    return D.28813;
    <D.21723>:
    <D.21724>:
    <D.21725>:
    *align = 2;
    D.28813 = 2;
    return D.28813;
    <D.21726>:
    <D.21727>:
    <D.21728>:
    *align = 4;
    D.28813 = 4;
    return D.28813;
    <D.21729>:
    <D.21730>:
    *align = 8;
    D.28813 = 8;
    return D.28813;
    <D.21734>:
    *align = 4;
    D.28813 = 4;
    return D.28813;
    <D.21735>:
    *align = 8;
    D.28813 = 8;
    return D.28813;
    <D.21739>:
    <D.21740>:
    <D.21741>:
    <D.21742>:
    <D.21743>:
    <D.21744>:
    <D.21745>:
    <D.21746>:
    <D.21747>:
    <D.21748>:
    <D.21749>:
    <D.21750>:
    <D.21751>:
    <D.21752>:
    <D.21753>:
    <D.21754>:
    *align = 8;
    D.28813 = 8;
    return D.28813;
    <D.21758>:
    klass = mono_class_from_mono_type (type);
    D.28814 = mono_defaults.object_class;
    if (D.28814 == klass) goto <D.28815>; else goto <D.28816>;
    <D.28815>:
    if (mspec != 0B) goto <D.28817>; else goto <D.28818>;
    <D.28817>:
    D.28819 = mspec->native;
    if (D.28819 == 27) goto <D.28820>; else goto <D.28821>;
    <D.28820>:
    *align = 16;
    D.28813 = 16;
    return D.28813;
    <D.28821>:
    <D.28818>:
    <D.28816>:
    D.28813 = mono_class_native_size (klass, align);
    return D.28813;
    <D.21759>:
    {
      int esize;

      if (unicode != 0) goto <D.28823>; else goto <D.28824>;
      <D.28823>:
      iftmp.405 = 2;
      goto <D.28825>;
      <D.28824>:
      iftmp.405 = 1;
      <D.28825>:
      esize = iftmp.405;
      D.28826 = mspec == 0B;
      D.28827 = (long int) D.28826;
      D.28828 = __builtin_expect (D.28827, 0);
      if (D.28828 != 0) goto <D.28829>; else goto <D.28830>;
      <D.28829>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12524, "mspec");
      <D.28830>:
      esize.406 = (unsigned int) esize;
      *align = esize.406;
      D.28832 = mspec->data.array_data.num_elem;
      D.28813 = D.28832 * esize;
      return D.28813;
    }
    <D.21761>:
    {
      int esize;

      klass = mono_class_from_mono_type (type);
      D.28833 = klass->element_class;
      D.28834 = mono_defaults.char_class;
      if (D.28833 == D.28834) goto <D.28835>; else goto <D.28836>;
      <D.28835>:
      if (unicode != 0) goto <D.28838>; else goto <D.28839>;
      <D.28838>:
      iftmp.407 = 2;
      goto <D.28840>;
      <D.28839>:
      iftmp.407 = 1;
      <D.28840>:
      esize = iftmp.407;
      esize.408 = (unsigned int) esize;
      *align = esize.408;
      goto <D.28842>;
      <D.28836>:
      D.28833 = klass->element_class;
      esize = mono_class_native_size (D.28833, align);
      <D.28842>:
      D.28826 = mspec == 0B;
      D.28827 = (long int) D.28826;
      D.28828 = __builtin_expect (D.28827, 0);
      if (D.28828 != 0) goto <D.28843>; else goto <D.28844>;
      <D.28843>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12538, "mspec");
      <D.28844>:
      D.28832 = mspec->data.array_data.num_elem;
      D.28813 = D.28832 * esize;
      return D.28813;
    }
    <D.21763>:
    *align = 8;
    D.28813 = 8;
    return D.28813;
    <D.21764>:
    <D.21765>:
    <D.21766>:
    monoeg_g_log (0B, 4, "native type %02x not implemented", native_type);
    <D.21767>:
    goto <D.21767>;
  }
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12551);
  D.28813 = 0;
  return D.28813;
}


mono_marshal_asany (struct MonoObject * o, MonoMarshalNative string_encoding, int param_attrs)
{
  void * D.28848;
  struct MonoVTable * D.28849;
  struct MonoClass * D.28850;
  unsigned char D.28851;
  int D.28852;
  unsigned int D.28853;
  unsigned int D.28854;
  unsigned char D.28858;
  unsigned char D.28859;
  unsigned char D.28863;
  int D.28864;
  long unsigned int D.28865;
  void * res.409;
  unsigned int param_attrs.410;
  unsigned int D.28868;
  struct MonoException * D.28872;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28846>; else goto <D.28847>;
  <D.28846>:
  D.28848 = 0B;
  return D.28848;
  <D.28847>:
  D.28849 = o->vtable;
  D.28850 = D.28849->klass;
  t = &D.28850->byval_arg;
  D.28851 = t->type;
  D.28852 = (int) D.28851;
  switch (D.28852) <default: <D.28871>, case 2: <D.21780>, case 3: <D.21783>, case 4: <D.21778>, case 5: <D.21779>, case 6: <D.21781>, case 7: <D.21782>, case 8: <D.21775>, case 9: <D.21776>, case 10: <D.21784>, case 11: <D.21785>, case 12: <D.21786>, case 13: <D.21787>, case 14: <D.21788>, case 15: <D.21777>, case 17: <D.21794>, case 18: <D.21793>>
  <D.21775>:
  <D.21776>:
  <D.21777>:
  <D.21778>:
  <D.21779>:
  <D.21780>:
  <D.21781>:
  <D.21782>:
  <D.21783>:
  <D.21784>:
  <D.21785>:
  <D.21786>:
  <D.21787>:
  D.28848 = mono_object_unbox (o);
  return D.28848;
  <D.21788>:
  switch (string_encoding) <default: <D.21791>, case 20: <D.21790>, case 21: <D.21789>>
  <D.21789>:
  D.28848 = mono_marshal_string_to_utf16_copy (o);
  return D.28848;
  <D.21790>:
  D.28848 = mono_string_to_lpstr (o);
  return D.28848;
  <D.21791>:
  monoeg_g_log (0B, 16, "marshaling conversion %d not implemented", string_encoding);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12591);
  goto <D.21792>;
  <D.21793>:
  <D.21794>:
  {
    struct MonoMethod * method;
    void * pa[3];
    void * res;
    MonoBoolean delete_old;

    try
      {
        delete_old = 0;
        klass = t->data.klass;
        D.28853 = klass->flags;
        D.28854 = D.28853 & 24;
        if (D.28854 == 0) goto <D.21792>; else goto <D.28855>;
        <D.28855>:
        D.28858 = BIT_FIELD_REF <*klass, 8, 256>;
        D.28859 = D.28858 & 8;
        if (D.28859 != 0) goto <D.28860>; else goto <D.28861>;
        <D.28860>:
        D.28853 = klass->flags;
        D.28854 = D.28853 & 24;
        if (D.28854 == 16) goto <D.28856>; else goto <D.28862>;
        <D.28862>:
        D.28858 = BIT_FIELD_REF <*klass, 8, 256>;
        D.28863 = D.28858 & 48;
        if (D.28863 != 0) goto <D.28856>; else goto <D.28857>;
        <D.28856>:
        D.28848 = mono_object_unbox (o);
        return D.28848;
        <D.28857>:
        <D.28861>:
        D.28864 = mono_class_native_size (klass, 0B);
        D.28865 = (long unsigned int) D.28864;
        res.409 = mono_marshal_alloc (D.28865);
        res = res.409;
        param_attrs.410 = (unsigned int) param_attrs;
        D.28868 = param_attrs.410 & 3;
        if (D.28868 != 2) goto <D.28869>; else goto <D.28870>;
        <D.28869>:
        D.28849 = o->vtable;
        D.28850 = D.28849->klass;
        method = mono_marshal_get_struct_to_ptr (D.28850);
        pa[0] = o;
        pa[1] = &res;
        pa[2] = &delete_old;
        mono_runtime_invoke (method, 0B, &pa, 0B);
        <D.28870>:
        D.28848 = res;
        return D.28848;
      }
    finally
      {
        pa = {CLOBBER};
        res = {CLOBBER};
        delete_old = {CLOBBER};
      }
  }
  <D.28871>:
  <D.21792>:
  D.28872 = mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter.");
  mono_raise_exception (D.28872);
  D.28848 = 0B;
  return D.28848;
}


mono_marshal_free_asany (struct MonoObject * o, void * ptr, MonoMarshalNative string_encoding, int param_attrs)
{
  struct MonoVTable * D.28878;
  struct MonoClass * D.28879;
  unsigned char D.28880;
  int D.28881;
  void * ptr.411;
  unsigned char D.28883;
  unsigned char D.28884;
  unsigned int D.28887;
  unsigned int D.28888;
  unsigned char D.28890;
  int D.28892;
  unsigned int param_attrs.412;
  unsigned int D.28896;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28876>; else goto <D.28877>;
  <D.28876>:
  return;
  <D.28877>:
  D.28878 = o->vtable;
  D.28879 = D.28878->klass;
  t = &D.28879->byval_arg;
  D.28880 = t->type;
  D.28881 = (int) D.28880;
  switch (D.28881) <default: <D.21817>, case 14: <D.21807>, case 17: <D.21814>, case 18: <D.21813>>
  <D.21807>:
  switch (string_encoding) <default: <D.21811>, case 20: <D.21809>, case 21: <D.21808>>
  <D.21808>:
  <D.21809>:
  ptr.411 = ptr;
  mono_marshal_free (ptr.411);
  goto <D.21810>;
  <D.21811>:
  monoeg_g_log (0B, 16, "marshaling conversion %d not implemented", string_encoding);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12650);
  <D.21810>:
  goto <D.21812>;
  <D.21813>:
  <D.21814>:
  klass = t->data.klass;
  D.28883 = BIT_FIELD_REF <*klass, 8, 256>;
  D.28884 = D.28883 & 8;
  if (D.28884 != 0) goto <D.28885>; else goto <D.28886>;
  <D.28885>:
  D.28887 = klass->flags;
  D.28888 = D.28887 & 24;
  if (D.28888 == 16) goto <D.21812>; else goto <D.28889>;
  <D.28889>:
  D.28883 = BIT_FIELD_REF <*klass, 8, 256>;
  D.28890 = D.28883 & 48;
  if (D.28890 != 0) goto <D.21812>; else goto <D.28891>;
  <D.28891>:
  <D.28886>:
  D.28892 = param_attrs & 2;
  if (D.28892 != 0) goto <D.28893>; else goto <D.28894>;
  <D.28893>:
  {
    struct MonoMethod * method;
    void * pa[2];

    try
      {
        D.28878 = o->vtable;
        D.28879 = D.28878->klass;
        method = mono_marshal_get_ptr_to_struct (D.28879);
        pa[0] = &ptr;
        pa[1] = o;
        mono_runtime_invoke (method, 0B, &pa, 0B);
      }
    finally
      {
        pa = {CLOBBER};
      }
  }
  <D.28894>:
  param_attrs.412 = (unsigned int) param_attrs;
  D.28896 = param_attrs.412 & 3;
  if (D.28896 != 2) goto <D.28897>; else goto <D.28898>;
  <D.28897>:
  ptr.411 = ptr;
  mono_struct_delete_old (klass, ptr.411);
  <D.28898>:
  ptr.411 = ptr;
  mono_marshal_free (ptr.411);
  goto <D.21812>;
  <D.21817>:
  goto <D.21812>;
  <D.21812>:
}


mono_marshal_get_generic_array_helper (struct MonoClass * class, struct MonoClass * iface, gchar * name, struct MonoMethod * method)
{
  struct MonoMethod * D.28901;
  struct MonoClass * D.28902;
  struct MonoImage * D.28903;
  int D.28904;
  unsigned int D.28905;
  short unsigned int D.28906;
  int D.28907;
  int D.28908;
  struct MonoMethod * D.28909;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct WrapperInfo * info;
  int i;

  mb = mono_mb_new_no_dup_name (class, name, 7);
  D.28901 = mb->method;
  D.28901->slot = -1;
  D.28901 = mb->method;
  D.28901->flags = 481;
  sig = mono_method_signature (method);
  D.28902 = method->klass;
  D.28903 = D.28902->image;
  csig = signature_dup (D.28903, sig);
  csig->generic_param_count = 0;
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.21831>;
  <D.21830>:
  D.28904 = i + 1;
  D.28905 = (unsigned int) D.28904;
  mono_mb_emit_ldarg (mb, D.28905);
  i = i + 1;
  <D.21831>:
  D.28906 = csig->param_count;
  D.28907 = (int) D.28906;
  if (D.28907 > i) goto <D.21830>; else goto <D.21832>;
  <D.21832>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  mb->skip_visibility = 1;
  D.28906 = csig->param_count;
  D.28907 = (int) D.28906;
  D.28908 = D.28907 + 16;
  res = mono_mb_create_method (mb, csig, D.28908);
  info = mono_wrapper_info_create (res, 21);
  info->d.generic_array_helper.method = method;
  mono_marshal_set_wrapper_info (res, info);
  mono_mb_free (mb);
  D.28909 = res;
  return D.28909;
}


mono_win32_compat_CopyMemory (void * dest, const void * source, gsize length)
{
  _Bool D.28911;
  _Bool D.28912;
  _Bool D.28913;

  D.28911 = dest == 0B;
  D.28912 = source == 0B;
  D.28913 = D.28911 | D.28912;
  if (D.28913 != 0) goto <D.28914>; else goto <D.28915>;
  <D.28914>:
  return;
  <D.28915>:
  memcpy (dest, source, length);
}


mono_win32_compat_FillMemory (void * dest, gsize length, guchar fill)
{
  int D.28917;

  D.28917 = (int) fill;
  memset (dest, D.28917, length);
}


mono_win32_compat_MoveMemory (void * dest, const void * source, gsize length)
{
  _Bool D.28918;
  _Bool D.28919;
  _Bool D.28920;

  D.28918 = dest == 0B;
  D.28919 = source == 0B;
  D.28920 = D.28918 | D.28919;
  if (D.28920 != 0) goto <D.28921>; else goto <D.28922>;
  <D.28921>:
  return;
  <D.28922>:
  memmove (dest, source, length);
}


mono_win32_compat_ZeroMemory (void * dest, gsize length)
{
  memset (dest, 0, length);
}


mono_marshal_find_nonzero_bit_offset (guint8 * buf, int len, int * byte_offset, guint8 * bitmask)
{
  sizetype D.28924;
  guint8 * D.28925;
  unsigned char D.28926;
  _Bool D.28928;
  long int D.28929;
  long int D.28930;
  int D.28934;
  int D.28935;
  _Bool D.28936;
  long int D.28937;
  long int D.28938;
  int i;
  guint8 byte;

  i = 0;
  goto <D.21862>;
  <D.21861>:
  D.28924 = (sizetype) i;
  D.28925 = buf + D.28924;
  D.28926 = *D.28925;
  if (D.28926 != 0) goto <D.21860>; else goto <D.28927>;
  <D.28927>:
  i = i + 1;
  <D.21862>:
  if (i < len) goto <D.21861>; else goto <D.21860>;
  <D.21860>:
  D.28928 = i >= len;
  D.28929 = (long int) D.28928;
  D.28930 = __builtin_expect (D.28929, 0);
  if (D.28930 != 0) goto <D.28931>; else goto <D.28932>;
  <D.28931>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12773, "i < len");
  <D.28932>:
  D.28924 = (sizetype) i;
  D.28925 = buf + D.28924;
  byte = *D.28925;
  goto <D.21864>;
  <D.21863>:
  byte = byte >> 1;
  <D.21864>:
  if (byte != 0) goto <D.28933>; else goto <D.21865>;
  <D.28933>:
  D.28934 = (int) byte;
  D.28935 = D.28934 & 1;
  if (D.28935 == 0) goto <D.21863>; else goto <D.21865>;
  <D.21865>:
  D.28936 = byte != 1;
  D.28937 = (long int) D.28936;
  D.28938 = __builtin_expect (D.28937, 0);
  if (D.28938 != 0) goto <D.28939>; else goto <D.28940>;
  <D.28939>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12778, "byte == 1");
  <D.28940>:
  *byte_offset = i;
  D.28924 = (sizetype) i;
  D.28925 = buf + D.28924;
  D.28926 = *D.28925;
  *bitmask = D.28926;
}


mono_marshal_get_thunk_invoke_wrapper (struct MonoMethod * method)
{
  _Bool D.28941;
  long int D.28942;
  long int D.28943;
  struct MonoClass * D.28946;
  struct GHashTable * * D.28947;
  struct MonoMethod * D.28950;
  const char * D.28951;
  short unsigned int D.28952;
  int D.28953;
  <unnamed-unsigned:1> D.28954;
  int D.28955;
  int D.28956;
  unsigned int param_count.413;
  long unsigned int D.28958;
  long unsigned int D.28959;
  unsigned int D.28960;
  unsigned int D.28961;
  long unsigned int D.28962;
  short unsigned int D.28963;
  unsigned char D.28964;
  unsigned char D.28965;
  struct MonoType * D.28968;
  int D.28969;
  struct MonoType * D.28970;
  int D.28971;
  struct MonoClass * D.28972;
  struct MonoType * D.28973;
  struct MonoType * D.28974;
  struct MonoType * D.28975;
  struct MonoType * D.28976;
  int D.28977;
  struct MonoClass * D.28980;
  struct MonoType * D.28981;
  int D.28982;
  unsigned int D.28985;
  int D.28986;
  unsigned int D.28987;
  unsigned int i.414;
  struct MonoType * D.28989;
  int D.28990;
  unsigned char D.28995;
  unsigned char D.28996;
  short unsigned int D.29000;
  int D.29001;
  int D.29002;
  int D.29006;
  unsigned int D.29009;
  int D.29010;
  unsigned int D.29011;
  unsigned int D.29012;
  unsigned int D.29013;
  int D.29014;
  unsigned int D.29015;
  int D.29016;
  unsigned int D.29017;
  unsigned int D.29018;
  unsigned int D.29019;
  unsigned int pos_leave.415;
  int D.29021;
  int D.29024;
  struct MonoClass * D.29027;
  int D.29028;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  struct MonoExceptionClause * clause;
  struct MonoImage * image;
  struct MonoClass * klass;
  struct GHashTable * cache;
  struct MonoMethod * res;
  int i;
  int param_count;
  int sig_size;
  int pos_leave;

  D.28941 = method == 0B;
  D.28942 = (long int) D.28941;
  D.28943 = __builtin_expect (D.28942, 0);
  if (D.28943 != 0) goto <D.28944>; else goto <D.28945>;
  <D.28944>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12796, "method");
  <D.28945>:
  klass = method->klass;
  D.28946 = method->klass;
  image = D.28946->image;
  D.28947 = &image->thunk_invoke_cache;
  cache = get_cache (D.28947, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28948>; else goto <D.28949>;
  <D.28948>:
  D.28950 = res;
  return D.28950;
  <D.28949>:
  sig = mono_method_signature (method);
  D.28951 = method->name;
  mb = mono_mb_new (klass, D.28951, 5);
  D.28952 = sig->param_count;
  D.28953 = (int) D.28952;
  D.28954 = sig->hasthis;
  D.28955 = (int) D.28954;
  D.28956 = D.28953 + D.28955;
  param_count = D.28956 + 1;
  param_count.413 = (unsigned int) param_count;
  csig = mono_metadata_signature_alloc (image, param_count.413);
  D.28952 = sig->param_count;
  D.28958 = (long unsigned int) D.28952;
  D.28959 = D.28958 + 2;
  D.28960 = (unsigned int) D.28959;
  D.28961 = D.28960 * 8;
  sig_size = (int) D.28961;
  D.28962 = (long unsigned int) sig_size;
  memcpy (csig, sig, D.28962);
  D.28963 = (short unsigned int) param_count;
  csig->param_count = D.28963;
  csig->hasthis = 0;
  csig->pinvoke = 1;
  csig->call_convention = 0;
  D.28964 = BIT_FIELD_REF <*sig, 8, 112>;
  D.28965 = D.28964 & 64;
  if (D.28965 != 0) goto <D.28966>; else goto <D.28967>;
  <D.28966>:
  D.28968 = &klass->byval_arg;
  csig->params[0] = D.28968;
  i = 0;
  goto <D.21882>;
  <D.21881>:
  D.28969 = i + 1;
  D.28970 = sig->params[i];
  csig->params[D.28969] = D.28970;
  i = i + 1;
  <D.21882>:
  D.28952 = sig->param_count;
  D.28953 = (int) D.28952;
  if (D.28953 > i) goto <D.21881>; else goto <D.21883>;
  <D.21883>:
  <D.28967>:
  D.28971 = param_count + -1;
  D.28972 = mono_defaults.exception_class;
  D.28973 = &D.28972->byval_arg;
  D.28974 = mono_metadata_type_dup (image, D.28973);
  csig->params[D.28971] = D.28974;
  D.28971 = param_count + -1;
  D.28975 = csig->params[D.28971];
  D.28975->byref = 1;
  D.28971 = param_count + -1;
  D.28975 = csig->params[D.28971];
  D.28975->attrs = 2;
  D.28976 = sig->ret;
  D.28977 = mono_type_is_struct (D.28976);
  if (D.28977 != 0) goto <D.28978>; else goto <D.28979>;
  <D.28978>:
  D.28980 = mono_defaults.object_class;
  D.28981 = &D.28980->byval_arg;
  csig->ret = D.28981;
  <D.28979>:
  D.28980 = mono_defaults.object_class;
  D.28981 = &D.28980->byval_arg;
  mono_mb_add_local (mb, D.28981);
  D.28976 = sig->ret;
  D.28982 = mono_type_is_void (D.28976);
  if (D.28982 == 0) goto <D.28983>; else goto <D.28984>;
  <D.28983>:
  D.28976 = sig->ret;
  mono_mb_add_local (mb, D.28976);
  <D.28984>:
  D.28971 = param_count + -1;
  D.28985 = (unsigned int) D.28971;
  mono_mb_emit_ldarg (mb, D.28985);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  clause = mono_image_alloc0 (image, 32);
  D.28986 = mono_mb_get_label (mb);
  D.28987 = (unsigned int) D.28986;
  clause->try_offset = D.28987;
  i = 0;
  goto <D.21887>;
  <D.21886>:
  {
    struct MonoType * type;
    struct MonoClass * klass;

    i.414 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.414);
    D.28989 = csig->params[i];
    klass = mono_class_from_mono_type (D.28989);
    type = &klass->byval_arg;
    D.28990 = mono_type_is_struct (type);
    if (D.28990 != 0) goto <D.28991>; else goto <D.28992>;
    <D.28991>:
    mono_mb_emit_op (mb, 121, klass);
    D.28989 = csig->params[i];
    D.28995 = BIT_FIELD_REF <*D.28989, 8, 88>;
    D.28996 = D.28995 & 64;
    if (D.28996 == 0) goto <D.28997>; else goto <D.28998>;
    <D.28997>:
    if (i != 0) goto <D.28993>; else goto <D.28999>;
    <D.28999>:
    D.28964 = BIT_FIELD_REF <*sig, 8, 112>;
    D.28965 = D.28964 & 64;
    if (D.28965 == 0) goto <D.28993>; else goto <D.28994>;
    <D.28993>:
    mono_mb_emit_op (mb, 113, klass);
    <D.28994>:
    <D.28998>:
    D.28980 = mono_defaults.object_class;
    D.28981 = &D.28980->byval_arg;
    csig->params[i] = D.28981;
    <D.28992>:
  }
  i = i + 1;
  <D.21887>:
  D.28971 = param_count + -1;
  if (D.28971 > i) goto <D.21886>; else goto <D.21888>;
  <D.21888>:
  D.29000 = method->flags;
  D.29001 = (int) D.29000;
  D.29002 = D.29001 & 64;
  if (D.29002 != 0) goto <D.29003>; else goto <D.29004>;
  <D.29003>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.29005>;
  <D.29004>:
  mono_mb_emit_op (mb, 40, method);
  <D.29005>:
  D.28976 = sig->ret;
  D.29006 = mono_type_is_void (D.28976);
  if (D.29006 == 0) goto <D.29007>; else goto <D.29008>;
  <D.29007>:
  mono_mb_emit_stloc (mb, 1);
  <D.29008>:
  D.29009 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.29009;
  clause->flags = 0;
  D.29010 = mono_mb_get_pos (mb);
  D.29011 = (unsigned int) D.29010;
  D.29012 = clause->try_offset;
  D.29013 = D.29011 - D.29012;
  clause->try_len = D.29013;
  D.28980 = mono_defaults.object_class;
  clause->data.catch_class = D.28980;
  D.29014 = mono_mb_get_label (mb);
  D.29015 = (unsigned int) D.29014;
  clause->handler_offset = D.29015;
  mono_mb_emit_stloc (mb, 0);
  D.28971 = param_count + -1;
  D.28985 = (unsigned int) D.28971;
  mono_mb_emit_ldarg (mb, D.28985);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.29016 = mono_mb_get_pos (mb);
  D.29017 = (unsigned int) D.29016;
  D.29018 = clause->handler_offset;
  D.29019 = D.29017 - D.29018;
  clause->handler_len = D.29019;
  mono_mb_set_clauses (mb, 1, clause);
  pos_leave.415 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.415);
  D.28976 = sig->ret;
  D.29021 = mono_type_is_void (D.28976);
  if (D.29021 == 0) goto <D.29022>; else goto <D.29023>;
  <D.29022>:
  mono_mb_emit_ldloc (mb, 1);
  D.28976 = sig->ret;
  D.29024 = mono_type_is_struct (D.28976);
  if (D.29024 != 0) goto <D.29025>; else goto <D.29026>;
  <D.29025>:
  D.28976 = sig->ret;
  D.29027 = mono_class_from_mono_type (D.28976);
  mono_mb_emit_op (mb, 140, D.29027);
  <D.29026>:
  <D.29023>:
  mono_mb_emit_byte (mb, 42);
  D.29028 = param_count + 16;
  res = mono_mb_create_and_cache (cache, method, mb, csig, D.29028);
  mono_mb_free (mb);
  D.28950 = res;
  return D.28950;
}


mono_marshal_free_dynamic_wrappers (struct MonoMethod * method)
{
  struct MonoClass * D.29030;
  unsigned char D.29031;
  unsigned char D.29032;
  _Bool D.29033;
  long int D.29034;
  long int D.29035;
  int marshal_mutex_initialized.416;
  _Bool D.29043;
  long int D.29044;
  long int D.29045;
  struct GHashTable * D.29048;
  struct GHashTable * D.29051;
  _Bool D.29058;
  long int D.29059;
  long int D.29060;
  struct MonoImage * image;

  D.29030 = method->klass;
  image = D.29030->image;
  D.29031 = BIT_FIELD_REF <*method, 8, 264>;
  D.29032 = D.29031 & 2;
  D.29033 = D.29032 == 0;
  D.29034 = (long int) D.29033;
  D.29035 = __builtin_expect (D.29034, 0);
  if (D.29035 != 0) goto <D.29036>; else goto <D.29037>;
  <D.29036>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12939, "method->dynamic");
  <D.29037>:
  marshal_mutex_initialized.416 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.416 != 0) goto <D.29039>; else goto <D.29040>;
  <D.29039>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29041>; else goto <D.29042>;
    <D.29041>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.29042>:
    D.29043 = ret != 0;
    D.29044 = (long int) D.29043;
    D.29045 = __builtin_expect (D.29044, 0);
    if (D.29045 != 0) goto <D.29046>; else goto <D.29047>;
    <D.29046>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12943, "ret == 0");
    <D.29047>:
  }
  <D.29040>:
  D.29048 = image->runtime_invoke_direct_cache;
  if (D.29048 != 0B) goto <D.29049>; else goto <D.29050>;
  <D.29049>:
  D.29048 = image->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.29048, method);
  <D.29050>:
  D.29051 = image->delegate_abstract_invoke_cache;
  if (D.29051 != 0B) goto <D.29052>; else goto <D.29053>;
  <D.29052>:
  D.29051 = image->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.29051, signature_method_pair_matches_method, method);
  <D.29053>:
  marshal_mutex_initialized.416 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.416 != 0) goto <D.29054>; else goto <D.29055>;
  <D.29054>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29056>; else goto <D.29057>;
    <D.29056>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.29057>:
    D.29058 = ret != 0;
    D.29059 = (long int) D.29058;
    D.29060 = __builtin_expect (D.29059, 0);
    if (D.29060 != 0) goto <D.29061>; else goto <D.29062>;
    <D.29061>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12954, "ret == 0");
    <D.29062>:
  }
  <D.29055>:
}


signature_method_pair_matches_method (void * key, void * value, void * user_data)
{
  gboolean D.29063;
  struct MonoMethod * D.29064;
  _Bool D.29065;
  struct SignatureMethodPair * pair;
  struct MonoMethod * method;

  pair = key;
  method = user_data;
  D.29064 = pair->method;
  D.29065 = D.29064 == method;
  D.29063 = (gboolean) D.29065;
  return D.29063;
}


mono_marshal_free_inflated_wrappers (struct MonoMethod * method)
{
  unsigned char D.29067;
  unsigned char D.29068;
  _Bool D.29069;
  long int D.29070;
  long int D.29071;
  int marshal_mutex_initialized.417;
  _Bool D.29079;
  long int D.29080;
  long int D.29081;
  struct MonoClass * D.29086;
  struct MonoImage * D.29087;
  struct GHashTable * D.29088;
  struct GHashTable * D.29093;
  struct GHashTable * D.29098;
  struct GHashTable * D.29103;
  struct GHashTable * D.29108;
  struct GHashTable * D.29113;
  struct GHashTable * D.29116;
  struct GHashTable * D.29119;
  struct GHashTable * D.29122;
  struct GHashTable * D.29125;
  struct GHashTable * D.29128;
  struct GHashTable * D.29131;
  struct GHashTable * D.29134;
  struct GHashTable * D.29137;
  struct GHashTable * D.29140;
  struct GHashTable * D.29143;
  _Bool D.29148;
  long int D.29149;
  long int D.29150;
  struct MonoMethodSignature * sig;

  sig = method->signature;
  D.29067 = BIT_FIELD_REF <*method, 8, 264>;
  D.29068 = D.29067 & 16;
  D.29069 = D.29068 == 0;
  D.29070 = (long int) D.29069;
  D.29071 = __builtin_expect (D.29070, 0);
  if (D.29071 != 0) goto <D.29072>; else goto <D.29073>;
  <D.29072>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12976, "method->is_inflated");
  <D.29073>:
  marshal_mutex_initialized.417 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.417 == 0) goto <D.29075>; else goto <D.29076>;
  <D.29075>:
  return;
  <D.29076>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29077>; else goto <D.29078>;
    <D.29077>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.29078>:
    D.29079 = ret != 0;
    D.29080 = (long int) D.29079;
    D.29081 = __builtin_expect (D.29080, 0);
    if (D.29081 != 0) goto <D.29082>; else goto <D.29083>;
    <D.29082>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12982, "ret == 0");
    <D.29083>:
  }
  if (sig != 0B) goto <D.29084>; else goto <D.29085>;
  <D.29084>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29088 = D.29087->delegate_begin_invoke_cache;
  if (D.29088 != 0B) goto <D.29089>; else goto <D.29090>;
  <D.29089>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29088 = D.29087->delegate_begin_invoke_cache;
  monoeg_g_hash_table_remove (D.29088, sig);
  <D.29090>:
  <D.29085>:
  if (sig != 0B) goto <D.29091>; else goto <D.29092>;
  <D.29091>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29093 = D.29087->delegate_end_invoke_cache;
  if (D.29093 != 0B) goto <D.29094>; else goto <D.29095>;
  <D.29094>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29093 = D.29087->delegate_end_invoke_cache;
  monoeg_g_hash_table_remove (D.29093, sig);
  <D.29095>:
  <D.29092>:
  if (sig != 0B) goto <D.29096>; else goto <D.29097>;
  <D.29096>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29098 = D.29087->delegate_invoke_cache;
  if (D.29098 != 0B) goto <D.29099>; else goto <D.29100>;
  <D.29099>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29098 = D.29087->delegate_invoke_cache;
  monoeg_g_hash_table_remove (D.29098, sig);
  <D.29100>:
  <D.29097>:
  if (sig != 0B) goto <D.29101>; else goto <D.29102>;
  <D.29101>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29103 = D.29087->runtime_invoke_cache;
  if (D.29103 != 0B) goto <D.29104>; else goto <D.29105>;
  <D.29104>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29103 = D.29087->runtime_invoke_cache;
  monoeg_g_hash_table_remove (D.29103, sig);
  <D.29105>:
  <D.29102>:
  if (sig != 0B) goto <D.29106>; else goto <D.29107>;
  <D.29106>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29108 = D.29087->runtime_invoke_vtype_cache;
  if (D.29108 != 0B) goto <D.29109>; else goto <D.29110>;
  <D.29109>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29108 = D.29087->runtime_invoke_vtype_cache;
  monoeg_g_hash_table_remove (D.29108, sig);
  <D.29110>:
  <D.29107>:
  if (sig != 0B) goto <D.29111>; else goto <D.29112>;
  <D.29111>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29113 = D.29087->delegate_abstract_invoke_cache;
  if (D.29113 != 0B) goto <D.29114>; else goto <D.29115>;
  <D.29114>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29113 = D.29087->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.29113, signature_method_pair_matches_signature, sig);
  <D.29115>:
  <D.29112>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29116 = D.29087->runtime_invoke_direct_cache;
  if (D.29116 != 0B) goto <D.29117>; else goto <D.29118>;
  <D.29117>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29116 = D.29087->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.29116, method);
  <D.29118>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29119 = D.29087->managed_wrapper_cache;
  if (D.29119 != 0B) goto <D.29120>; else goto <D.29121>;
  <D.29120>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29119 = D.29087->managed_wrapper_cache;
  monoeg_g_hash_table_remove (D.29119, method);
  <D.29121>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29122 = D.29087->native_wrapper_cache;
  if (D.29122 != 0B) goto <D.29123>; else goto <D.29124>;
  <D.29123>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29122 = D.29087->native_wrapper_cache;
  monoeg_g_hash_table_remove (D.29122, method);
  <D.29124>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29125 = D.29087->remoting_invoke_cache;
  if (D.29125 != 0B) goto <D.29126>; else goto <D.29127>;
  <D.29126>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29125 = D.29087->remoting_invoke_cache;
  monoeg_g_hash_table_remove (D.29125, method);
  <D.29127>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29128 = D.29087->synchronized_cache;
  if (D.29128 != 0B) goto <D.29129>; else goto <D.29130>;
  <D.29129>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29128 = D.29087->synchronized_cache;
  monoeg_g_hash_table_remove (D.29128, method);
  <D.29130>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29131 = D.29087->unbox_wrapper_cache;
  if (D.29131 != 0B) goto <D.29132>; else goto <D.29133>;
  <D.29132>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29131 = D.29087->unbox_wrapper_cache;
  monoeg_g_hash_table_remove (D.29131, method);
  <D.29133>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29134 = D.29087->cominterop_invoke_cache;
  if (D.29134 != 0B) goto <D.29135>; else goto <D.29136>;
  <D.29135>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29134 = D.29087->cominterop_invoke_cache;
  monoeg_g_hash_table_remove (D.29134, method);
  <D.29136>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29137 = D.29087->cominterop_wrapper_cache;
  if (D.29137 != 0B) goto <D.29138>; else goto <D.29139>;
  <D.29138>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29137 = D.29087->cominterop_wrapper_cache;
  monoeg_g_hash_table_remove (D.29137, method);
  <D.29139>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29140 = D.29087->thunk_invoke_cache;
  if (D.29140 != 0B) goto <D.29141>; else goto <D.29142>;
  <D.29141>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29140 = D.29087->thunk_invoke_cache;
  monoeg_g_hash_table_remove (D.29140, method);
  <D.29142>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29143 = D.29087->native_func_wrapper_aot_cache;
  if (D.29143 != 0B) goto <D.29144>; else goto <D.29145>;
  <D.29144>:
  D.29086 = method->klass;
  D.29087 = D.29086->image;
  D.29143 = D.29087->native_func_wrapper_aot_cache;
  monoeg_g_hash_table_remove (D.29143, method);
  <D.29145>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29146>; else goto <D.29147>;
    <D.29146>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.29147>:
    D.29148 = ret != 0;
    D.29149 = (long int) D.29148;
    D.29150 = __builtin_expect (D.29149, 0);
    if (D.29150 != 0) goto <D.29151>; else goto <D.29152>;
    <D.29151>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 13034, "ret == 0");
    <D.29152>:
  }
}


signature_method_pair_matches_signature (void * key, void * value, void * user_data)
{
  gboolean D.29154;
  struct MonoMethodSignature * D.29155;
  struct SignatureMethodPair * pair;
  struct MonoMethodSignature * sig;

  pair = key;
  sig = user_data;
  D.29155 = pair->sig;
  D.29154 = mono_metadata_signature_equal (D.29155, sig);
  return D.29154;
}


