mono_signature_no_pinvoke (struct MonoMethod * method)
{
  unsigned char D.24110;
  unsigned char D.24111;
  struct MonoClass * D.24114;
  struct MonoImage * D.24115;
  struct MonoMethodSignature * D.24116;
  struct MonoMethodSignature * sig;

  sig = mono_method_signature (method);
  D.24110 = BIT_FIELD_REF <*sig, 8, 88>;
  D.24111 = D.24110 & 1;
  if (D.24111 != 0) goto <D.24112>; else goto <D.24113>;
  <D.24112>:
  D.24114 = method->klass;
  D.24115 = D.24114->image;
  sig = signature_dup (D.24115, sig);
  sig->pinvoke = 0;
  <D.24113>:
  D.24116 = sig;
  return D.24116;
}


signature_dup (struct MonoImage * image, struct MonoMethodSignature * sig)
{
  short unsigned int D.24118;
  unsigned int D.24119;
  unsigned int D.24120;
  unsigned int D.24121;
  unsigned int D.24122;
  unsigned int sigsize.0;
  struct MonoMethodSignature * D.24124;
  struct MonoMethodSignature * res;
  int sigsize;

  D.24118 = sig->param_count;
  D.24119 = (unsigned int) D.24118;
  res = mono_metadata_signature_alloc (image, D.24119);
  D.24118 = sig->param_count;
  D.24120 = (unsigned int) D.24118;
  D.24121 = D.24120 + 3;
  D.24122 = D.24121 * 4;
  sigsize = (int) D.24122;
  sigsize.0 = (unsigned int) sigsize;
  memcpy (res, sig, sigsize.0);
  D.24124 = res;
  return D.24124;
}


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

  D.24127 = __builtin_object_size (__dest, 0);
  D.24126 = __builtin___memcpy_chk (__dest, __src, __len, D.24127);
  return D.24126;
}


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.24129;
  void (*<Tc1>) (void *) destructor.1;
  int D.24131;
  _Bool D.24132;

  destructor.1 = (void (*<Tc1>) (void *)) destructor;
  D.24131 = pthread_key_create (key, destructor.1);
  D.24132 = D.24131 == 0;
  D.24129 = (int) D.24132;
  return D.24129;
}


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

  module_initialized.2 = module_initialized;
  if (module_initialized.2 == 0) goto <D.24135>; else goto <D.24136>;
  <D.24135>:
  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.24136>:
}


mono_remoting_wrapper (struct MonoMethod * method, void * * params)
{
  void * D.24137;
  _Bool D.24138;
  long int D.24139;
  long int D.24140;
  struct MonoVTable * D.24143;
  struct MonoClass * D.24144;
  struct MonoClass * D.24145;
  _Bool D.24146;
  long int D.24147;
  long int D.24148;
  struct MonoRemoteClass * D.24151;
  struct MonoClass * D.24152;
  unsigned char D.24153;
  unsigned char D.24154;
  struct MonoRealProxy * D.24157;
  struct MonoObject * D.24158;
  struct MonoAppContext * D.24159;
  short unsigned int D.24162;
  unsigned int count.3;
  unsigned int D.24164;
  struct MonoType * D.24165;
  unsigned char D.24166;
  unsigned char D.24167;
  unsigned char D.24170;
  unsigned char D.24171;
  unsigned int i.4;
  unsigned int D.24175;
  void * * D.24176;
  void * * D.24177;
  void * D.24178;
  void * D.24179;
  struct MonoClass * D.24181;
  int D.24182;
  struct MonoObject * D.24185;
  void * * D.24188;
  struct MonoObject * D.24189;
  void * iftmp.5;
  struct MonoClass * D.24191;
  unsigned char D.24192;
  unsigned char D.24193;
  struct MonoObject * exc.6;
  struct MonoArray * out_args.7;
  struct MonoMethodMessage * msg;
  struct MonoTransparentProxy * this;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;

  try
    {
      D.24137 = *params;
      this = MEM[(struct MonoTransparentProxy * *)D.24137];
      D.24138 = this == 0B;
      D.24139 = (long int) D.24138;
      D.24140 = __builtin_expect (D.24139, 0);
      if (D.24140 != 0) goto <D.24141>; else goto <D.24142>;
      <D.24141>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3124, "this");
      <D.24142>:
      D.24143 = MEM[(struct MonoObject *)this].vtable;
      D.24144 = D.24143->klass;
      D.24145 = mono_defaults.transparent_proxy_class;
      D.24146 = D.24144 != D.24145;
      D.24147 = (long int) D.24146;
      D.24148 = __builtin_expect (D.24147, 0);
      if (D.24148 != 0) goto <D.24149>; else goto <D.24150>;
      <D.24149>:
      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.24150>:
      params = params + 4;
      D.24151 = this->remote_class;
      D.24152 = D.24151->proxy_class;
      D.24153 = BIT_FIELD_REF <*D.24152, 8, 176>;
      D.24154 = D.24153 & 128;
      if (D.24154 != 0) goto <D.24155>; else goto <D.24156>;
      <D.24155>:
      D.24157 = this->rp;
      D.24158 = D.24157->context;
      D.24159 = mono_context_get ();
      if (D.24158 == D.24159) goto <D.24160>; else goto <D.24161>;
      <D.24160>:
      {
        int i;
        struct MonoMethodSignature * sig;
        int count;
        void * * mparams;

        sig = mono_method_signature (method);
        D.24162 = sig->param_count;
        count = (int) D.24162;
        count.3 = (unsigned int) count;
        D.24164 = count.3 * 4;
        mparams = __builtin_alloca (D.24164);
        i = 0;
        goto <D.21817>;
        <D.21816>:
        {
          struct MonoClass * class;

          D.24165 = sig->params[i];
          class = mono_class_from_mono_type (D.24165);
          D.24166 = BIT_FIELD_REF <*class, 8, 160>;
          D.24167 = D.24166 & 8;
          if (D.24167 != 0) goto <D.24168>; else goto <D.24169>;
          <D.24168>:
          D.24165 = sig->params[i];
          D.24170 = BIT_FIELD_REF <*D.24165, 8, 56>;
          D.24171 = D.24170 & 64;
          if (D.24171 != 0) goto <D.24172>; else goto <D.24173>;
          <D.24172>:
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24176 = mparams + D.24175;
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24177 = params + D.24175;
          D.24178 = *D.24177;
          D.24179 = MEM[(void * *)D.24178];
          *D.24176 = D.24179;
          goto <D.24180>;
          <D.24173>:
          D.24165 = sig->params[i];
          D.24181 = mono_class_from_mono_type (D.24165);
          D.24182 = mono_class_is_nullable (D.24181);
          if (D.24182 != 0) goto <D.24183>; else goto <D.24184>;
          <D.24183>:
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24176 = mparams + D.24175;
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24177 = params + D.24175;
          D.24178 = *D.24177;
          D.24185 = mono_nullable_box (D.24178, class);
          *D.24176 = D.24185;
          goto <D.24186>;
          <D.24184>:
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24176 = mparams + D.24175;
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24177 = params + D.24175;
          D.24178 = *D.24177;
          *D.24176 = D.24178;
          <D.24186>:
          <D.24180>:
          goto <D.24187>;
          <D.24169>:
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24176 = mparams + D.24175;
          i.4 = (unsigned int) i;
          D.24175 = i.4 * 4;
          D.24177 = params + D.24175;
          D.24178 = *D.24177;
          D.24188 = MEM[(void * * *)D.24178];
          *D.24176 = D.24188;
          <D.24187>:
        }
        i = i + 1;
        <D.21817>:
        if (i < count) goto <D.21816>; else goto <D.21818>;
        <D.21818>:
        D.24191 = method->klass;
        D.24192 = BIT_FIELD_REF <*D.24191, 8, 160>;
        D.24193 = D.24192 & 8;
        if (D.24193 != 0) goto <D.24194>; else goto <D.24195>;
        <D.24194>:
        iftmp.5 = mono_object_unbox (this);
        goto <D.24196>;
        <D.24195>:
        iftmp.5 = this;
        <D.24196>:
        D.24189 = mono_runtime_invoke (method, iftmp.5, mparams, 0B);
        return D.24189;
      }
      <D.24161>:
      <D.24156>:
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.24157 = this->rp;
      res = mono_remoting_invoke (D.24157, msg, &exc, &out_args);
      exc.6 = exc;
      if (exc.6 != 0B) goto <D.24198>; else goto <D.24199>;
      <D.24198>:
      exc.6 = exc;
      mono_raise_exception (exc.6);
      <D.24199>:
      out_args.7 = out_args;
      mono_method_return_message_restore (method, params, out_args.7);
      D.24189 = res;
      return D.24189;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


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

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


mono_marshal_check_domain_image (gint32 domain_id, struct MonoImage * image)
{
  gboolean D.24207;
  union mono_mutex_t * D.24208;
  _Bool D.24211;
  long int D.24212;
  long int D.24213;
  struct MonoImage * D.24216;
  _Bool D.24220;
  long int D.24221;
  long int D.24222;
  _Bool D.24225;
  struct MonoAssembly * ass;
  struct GSList * tmp;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.24205>; else goto <D.24206>;
  <D.24205>:
  D.24207 = 0;
  return D.24207;
  <D.24206>:
  {
    int ret;

    D.24208 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.24208);
    if (ret != 0) goto <D.24209>; else goto <D.24210>;
    <D.24209>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock 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", 3452, "ret == 0");
    <D.24215>:
  }
  tmp = domain->domain_assemblies;
  goto <D.21939>;
  <D.21938>:
  ass = tmp->data;
  D.24216 = ass->image;
  if (D.24216 == image) goto <D.21937>; else goto <D.24217>;
  <D.24217>:
  tmp = tmp->next;
  <D.21939>:
  if (tmp != 0B) goto <D.21938>; else goto <D.21937>;
  <D.21937>:
  {
    int ret;

    D.24208 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.24208);
    if (ret != 0) goto <D.24218>; else goto <D.24219>;
    <D.24218>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24219>:
    D.24220 = ret != 0;
    D.24221 = (long int) D.24220;
    D.24222 = __builtin_expect (D.24221, 0);
    if (D.24222 != 0) goto <D.24223>; else goto <D.24224>;
    <D.24223>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3458, "ret == 0");
    <D.24224>:
  }
  D.24225 = tmp != 0B;
  D.24207 = (gboolean) D.24225;
  return D.24207;
}


mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push)
{
  int D.24230;
  struct MonoException * D.24231;
  gint32 D.24235;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (id);
  if (domain == 0B) goto <D.24227>; else goto <D.24229>;
  <D.24229>:
  D.24230 = mono_domain_set (domain, 0);
  if (D.24230 == 0) goto <D.24227>; else goto <D.24228>;
  <D.24227>:
  D.24231 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.24231);
  <D.24228>:
  if (push != 0) goto <D.24232>; else goto <D.24233>;
  <D.24232>:
  mono_thread_push_appdomain_ref (domain);
  goto <D.24234>;
  <D.24233>:
  mono_thread_pop_appdomain_ref ();
  <D.24234>:
  D.24235 = current_domain->domain_id;
  return D.24235;
}


mono_marshal_xdomain_copy_out_value (struct MonoObject * src, struct MonoObject * dst)
{
  _Bool D.24237;
  _Bool D.24238;
  _Bool D.24239;
  struct MonoVTable * D.24242;
  struct MonoClass * D.24243;
  struct MonoVTable * D.24244;
  struct MonoClass * D.24245;
  _Bool D.24246;
  long int D.24247;
  long int D.24248;
  unsigned char D.24251;
  int D.24252;
  struct MonoClass * D.24253;
  struct MonoType * D.24254;
  <unnamed type> D.24255;
  unsigned int D.24260;
  unsigned int i.8;
  char * D.24262;
  struct MonoObject * D.24263;
  struct MonoClass * D.24266;
  struct MonoString * * D.24269;
  struct MonoDomain * D.24270;
  struct MonoString * D.24271;
  mono_unichar2 * D.24272;
  int D.24273;
  struct MonoString * D.24274;
  int D.24275;

  D.24237 = src == 0B;
  D.24238 = dst == 0B;
  D.24239 = D.24237 | D.24238;
  if (D.24239 != 0) goto <D.24240>; else goto <D.24241>;
  <D.24240>:
  return;
  <D.24241>:
  D.24242 = src->vtable;
  D.24243 = D.24242->klass;
  D.24244 = dst->vtable;
  D.24245 = D.24244->klass;
  D.24246 = D.24243 != D.24245;
  D.24247 = (long int) D.24246;
  D.24248 = __builtin_expect (D.24247, 0);
  if (D.24248 != 0) goto <D.24249>; else goto <D.24250>;
  <D.24249>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3340, "mono_object_class (src) == mono_object_class (dst)");
  <D.24250>:
  D.24242 = src->vtable;
  D.24243 = D.24242->klass;
  D.24251 = D.24243->byval_arg.type;
  D.24252 = (int) D.24251;
  switch (D.24252) <default: <D.24265>, case 20: <D.21884>, case 29: <D.21885>>
  <D.21884>:
  <D.21885>:
  {
    int mt;

    D.24242 = src->vtable;
    D.24243 = D.24242->klass;
    D.24253 = D.24243->element_class;
    D.24254 = &D.24253->byval_arg;
    D.24255 = mono_get_xdomain_marshal_type (D.24254);
    mt = (int) D.24255;
    if (mt == 3) goto <D.24256>; else goto <D.24257>;
    <D.24256>:
    return;
    <D.24257>:
    if (mt == 1) goto <D.24258>; else goto <D.24259>;
    <D.24258>:
    {
      int i;
      int len;

      D.24260 = mono_array_length (dst);
      len = (int) D.24260;
      i = 0;
      goto <D.21892>;
      <D.21891>:
      {
        struct MonoObject * item;

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

          i.8 = (unsigned int) i;
          __p = mono_array_addr_with_size (dst, 4, i.8);
          D.24263 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (dst, __p, D.24263);
        }
      }
      i = i + 1;
      <D.21892>:
      if (i < len) goto <D.21891>; else goto <D.21893>;
      <D.21893>:
    }
    goto <D.24264>;
    <D.24259>:
    mono_array_full_copy (src, dst);
    <D.24264>:
    return;
  }
  <D.24265>:
  D.24242 = src->vtable;
  D.24243 = D.24242->klass;
  D.24266 = mono_defaults.stringbuilder_class;
  if (D.24243 == D.24266) goto <D.24267>; else goto <D.24268>;
  <D.24267>:
  {
    struct MonoStringBuilder * src_sb;
    struct MonoStringBuilder * dst_sb;

    src_sb = src;
    dst_sb = dst;
    D.24269 = &dst_sb->str;
    D.24244 = dst->vtable;
    D.24270 = D.24244->domain;
    D.24271 = src_sb->str;
    D.24272 = mono_string_chars (D.24271);
    D.24271 = src_sb->str;
    D.24273 = mono_string_length (D.24271);
    D.24274 = mono_string_new_utf16 (D.24270, D.24272, D.24273);
    mono_gc_wbarrier_set_field (dst_sb, D.24269, D.24274);
    dst_sb->cached_str = 0B;
    D.24275 = src_sb->length;
    dst_sb->length = D.24275;
  }
  <D.24268>:
}


mono_get_xdomain_marshal_type (struct MonoType * t)
{
  unsigned char D.24277;
  int D.24278;
  MonoXDomainMarshalType D.24279;
  struct MonoClass * D.24280;
  struct MonoType * D.24281;
  <unnamed type> D.24282;

  D.24277 = t->type;
  D.24278 = (int) D.24277;
  switch (D.24278) <default: <D.24285>, case 1: <D.21830>, case 2: <D.21833>, case 3: <D.21836>, case 4: <D.21832>, case 5: <D.21831>, case 6: <D.21835>, case 7: <D.21834>, case 8: <D.21838>, case 9: <D.21837>, case 10: <D.21839>, case 11: <D.21840>, case 12: <D.21841>, case 13: <D.21842>, case 14: <D.21843>, case 20: <D.21844>, case 29: <D.21845>>
  <D.21830>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3240);
  <D.21831>:
  <D.21832>:
  <D.21833>:
  <D.21834>:
  <D.21835>:
  <D.21836>:
  <D.21837>:
  <D.21838>:
  <D.21839>:
  <D.21840>:
  <D.21841>:
  <D.21842>:
  D.24279 = 0;
  return D.24279;
  <D.21843>:
  D.24279 = 1;
  return D.24279;
  <D.21844>:
  <D.21845>:
  {
    struct MonoClass * elem_class;

    D.24280 = mono_class_from_mono_type (t);
    elem_class = D.24280->element_class;
    D.24281 = &elem_class->byval_arg;
    D.24282 = mono_get_xdomain_marshal_type (D.24281);
    if (D.24282 != 3) goto <D.24283>; else goto <D.24284>;
    <D.24283>:
    D.24279 = 1;
    return D.24279;
    <D.24284>:
    goto <D.21847>;
  }
  <D.24285>:
  <D.21847>:
  D.24279 = 3;
  return D.24279;
}


mono_delegate_end_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.24287;
  long int D.24288;
  long int D.24289;
  struct MonoReflectionMethod * D.24292;
  struct MonoMethod * D.24295;
  _Bool D.24296;
  long int D.24297;
  long int D.24298;
  struct MonoReflectionMethod * * D.24301;
  struct MonoReflectionMethod * D.24302;
  struct MonoMethod * D.24306;
  struct MonoVTable * D.24307;
  _Bool D.24308;
  long int D.24309;
  long int D.24310;
  struct MonoArray * D.24313;
  short unsigned int D.24314;
  int D.24315;
  int D.24316;
  unsigned int D.24317;
  char * D.24318;
  struct MonoImage * D.24321;
  struct MonoException * D.24322;
  struct MonoObject * D.24323;
  struct MonoObject * D.24324;
  struct MonoException * D.24327;
  struct MonoObject * D.24330;
  struct MonoVTable * D.24332;
  struct MonoClass * D.24333;
  struct MonoClass * D.24334;
  struct MonoClass * D.24336;
  struct MonoAsyncResult * * D.24337;
  struct MonoRealProxy * D.24338;
  struct MonoObject * exc.9;
  struct MonoString * D.24342;
  struct MonoString * * D.24345;
  struct MonoString * D.24346;
  struct MonoArray * out_args.10;
  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.24287 = delegate == 0B;
      D.24288 = (long int) D.24287;
      D.24289 = __builtin_expect (D.24288, 0);
      if (D.24289 != 0) goto <D.24290>; else goto <D.24291>;
      <D.24290>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2908, "delegate");
      <D.24291>:
      D.24292 = delegate->method_info;
      if (D.24292 == 0B) goto <D.24293>; else goto <D.24294>;
      <D.24293>:
      D.24295 = delegate->method;
      D.24296 = D.24295 == 0B;
      D.24297 = (long int) D.24296;
      D.24298 = __builtin_expect (D.24297, 0);
      if (D.24298 != 0) goto <D.24299>; else goto <D.24300>;
      <D.24299>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2911, "delegate->method");
      <D.24300>:
      D.24301 = &delegate->method_info;
      D.24295 = delegate->method;
      D.24302 = mono_method_get_object (domain, D.24295, 0B);
      mono_gc_wbarrier_set_field (delegate, D.24301, D.24302);
      <D.24294>:
      D.24292 = delegate->method_info;
      if (D.24292 == 0B) goto <D.24303>; else goto <D.24305>;
      <D.24305>:
      D.24292 = delegate->method_info;
      D.24306 = D.24292->method;
      if (D.24306 == 0B) goto <D.24303>; else goto <D.24304>;
      <D.24303>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2916);
      <D.24304>:
      D.24307 = delegate->object.vtable;
      klass = D.24307->klass;
      method = mono_class_get_method_from_name (klass, "EndInvoke", -1);
      D.24308 = method == 0B;
      D.24309 = (long int) D.24308;
      D.24310 = __builtin_expect (D.24309, 0);
      if (D.24310 != 0) goto <D.24311>; else goto <D.24312>;
      <D.24311>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2921, "method != NULL");
      <D.24312>:
      sig = mono_signature_no_pinvoke (method);
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.24313 = msg->args;
      D.24314 = sig->param_count;
      D.24315 = (int) D.24314;
      D.24316 = D.24315 + -1;
      D.24317 = (unsigned int) D.24316;
      D.24318 = mono_array_addr_with_size (D.24313, 4, D.24317);
      ares = MEM[(void * *)D.24318];
      if (ares == 0B) goto <D.24319>; else goto <D.24320>;
      <D.24319>:
      D.24321 = mono_defaults.corlib;
      D.24322 = mono_exception_from_name_msg (D.24321, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.");
      mono_raise_exception (D.24322);
      D.24323 = 0B;
      return D.24323;
      <D.24320>:
      D.24324 = ares->async_delegate;
      if (D.24324 != delegate) goto <D.24325>; else goto <D.24326>;
      <D.24325>:
      D.24327 = mono_get_exception_invalid_operation ("The IAsyncResult object provided does not match this delegate.");
      mono_raise_exception (D.24327);
      D.24323 = 0B;
      return D.24323;
      <D.24326>:
      D.24330 = delegate->target;
      if (D.24330 != 0B) goto <D.24331>; else goto <D.24328>;
      <D.24331>:
      D.24330 = delegate->target;
      D.24332 = D.24330->vtable;
      D.24333 = D.24332->klass;
      D.24334 = mono_defaults.transparent_proxy_class;
      if (D.24333 == D.24334) goto <D.24335>; else goto <D.24328>;
      <D.24335>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.24336 = mono_defaults.mono_method_message_class;
        msg = mono_object_new (domain, D.24336);
        D.24292 = delegate->method_info;
        mono_message_init (domain, msg, D.24292, 0B);
        msg->call_type = 2;
        D.24337 = &msg->async_result;
        mono_gc_wbarrier_set_field (msg, D.24337, ares);
        D.24338 = tp->rp;
        res = mono_remoting_invoke (D.24338, msg, &exc, &out_args);
      }
      goto <D.24329>;
      <D.24328>:
      res = mono_thread_pool_finish (ares, &out_args, &exc);
      <D.24329>:
      exc.9 = exc;
      if (exc.9 != 0B) goto <D.24340>; else goto <D.24341>;
      <D.24340>:
      exc.9 = exc;
      D.24342 = MEM[(struct MonoException *)exc.9].stack_trace;
      if (D.24342 != 0B) goto <D.24343>; else goto <D.24344>;
      <D.24343>:
      {
        char * strace;
        char * tmp;

        exc.9 = exc;
        D.24342 = MEM[(struct MonoException *)exc.9].stack_trace;
        strace = mono_string_to_utf8 (D.24342);
        tmp = monoeg_g_strdup_printf ("%s\nException Rethrown at:\n", strace);
        monoeg_g_free (strace);
        exc.9 = exc;
        exc.9 = exc;
        D.24345 = &MEM[(struct MonoException *)exc.9].stack_trace;
        D.24346 = mono_string_new (domain, tmp);
        mono_gc_wbarrier_set_field (exc.9, D.24345, D.24346);
        monoeg_g_free (tmp);
      }
      <D.24344>:
      exc.9 = exc;
      mono_raise_exception (exc.9);
      <D.24341>:
      out_args.10 = out_args;
      mono_method_return_message_restore (method, params, out_args.10);
      D.24323 = res;
      return D.24323;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


mono_delegate_begin_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.24350;
  long int D.24351;
  long int D.24352;
  struct MonoMulticastDelegate * D.24355;
  struct MonoException * D.24358;
  struct MonoObject * D.24359;
  struct MonoVTable * D.24362;
  struct MonoClass * D.24363;
  struct MonoClass * D.24364;
  struct MonoRemoteClass * D.24369;
  struct MonoClass * D.24370;
  unsigned char D.24371;
  unsigned char D.24372;
  struct MonoRealProxy * D.24374;
  struct MonoObject * D.24375;
  struct MonoAppContext * D.24376;
  struct MonoMethod * D.24377;
  struct MonoDomain * D.24378;
  struct MonoObject * state.11;
  struct MonoObject * * D.24380;
  struct MonoObject * * D.24381;
  struct MonoDelegate * async_callback.12;
  struct MonoAsyncResult * * D.24383;
  struct MonoObject * exc.13;
  struct MonoAsyncResult * D.24387;
  struct MonoVTable * D.24388;
  _Bool D.24391;
  long int D.24392;
  long int D.24393;
  struct MonoClass * D.24396;
  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.24350 = delegate == 0B;
      D.24351 = (long int) D.24350;
      D.24352 = __builtin_expect (D.24351, 0);
      if (D.24352 != 0) goto <D.24353>; else goto <D.24354>;
      <D.24353>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2147, "delegate");
      <D.24354>:
      mcast_delegate = delegate;
      D.24355 = mcast_delegate->prev;
      if (D.24355 != 0B) goto <D.24356>; else goto <D.24357>;
      <D.24356>:
      D.24358 = mono_get_exception_argument (0B, "The delegate must have only one target");
      mono_raise_exception (D.24358);
      <D.24357>:
      D.24359 = delegate->target;
      if (D.24359 != 0B) goto <D.24360>; else goto <D.24361>;
      <D.24360>:
      D.24359 = delegate->target;
      D.24362 = D.24359->vtable;
      D.24363 = D.24362->klass;
      D.24364 = mono_defaults.transparent_proxy_class;
      if (D.24363 == D.24364) goto <D.24365>; else goto <D.24366>;
      <D.24365>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.24369 = tp->remote_class;
        D.24370 = D.24369->proxy_class;
        D.24371 = BIT_FIELD_REF <*D.24370, 8, 176>;
        D.24372 = D.24371 & 128;
        if (D.24372 == 0) goto <D.24367>; else goto <D.24373>;
        <D.24373>:
        D.24374 = tp->rp;
        D.24375 = D.24374->context;
        D.24376 = mono_context_get ();
        if (D.24375 != D.24376) goto <D.24367>; else goto <D.24368>;
        <D.24367>:
        {
          struct MonoAsyncResult * ares;
          struct MonoObject * exc;
          struct MonoArray * out_args;

          try
            {
              method = delegate->method;
              D.24377 = mono_marshal_method_from_wrapper (method);
              msg = mono_method_call_message_new (D.24377, params, 0B, &async_callback, &state);
              D.24378 = mono_domain_get ();
              state.11 = state;
              ares = mono_async_result_new (D.24378, 0B, state.11, 0B, 0B);
              D.24380 = &ares->async_delegate;
              mono_gc_wbarrier_set_field (ares, D.24380, delegate);
              D.24381 = &ares->async_callback;
              async_callback.12 = async_callback;
              mono_gc_wbarrier_set_field (ares, D.24381, async_callback.12);
              D.24383 = &msg->async_result;
              mono_gc_wbarrier_set_field (msg, D.24383, ares);
              msg->call_type = 1;
              exc = 0B;
              D.24374 = tp->rp;
              mono_remoting_invoke (D.24374, msg, &exc, &out_args);
              exc.13 = exc;
              if (exc.13 != 0B) goto <D.24385>; else goto <D.24386>;
              <D.24385>:
              exc.13 = exc;
              mono_raise_exception (exc.13);
              <D.24386>:
              D.24387 = ares;
              return D.24387;
            }
          finally
            {
              exc = {CLOBBER};
              out_args = {CLOBBER};
            }
        }
        <D.24368>:
      }
      <D.24366>:
      <D.24361>:
      D.24388 = delegate->object.vtable;
      klass = D.24388->klass;
      method = mono_get_delegate_invoke (klass);
      method2 = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      if (method2 != 0B) goto <D.24389>; else goto <D.24390>;
      <D.24389>:
      method = method2;
      <D.24390>:
      D.24391 = method == 0B;
      D.24392 = (long int) D.24391;
      D.24393 = __builtin_expect (D.24392, 0);
      if (D.24393 != 0) goto <D.24394>; else goto <D.24395>;
      <D.24394>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2188, "method != NULL");
      <D.24395>:
      D.24396 = method->klass;
      im = mono_get_delegate_invoke (D.24396);
      msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
      async_callback.12 = async_callback;
      state.11 = state;
      D.24387 = mono_thread_pool_add (delegate, msg, async_callback.12, state.11);
      return D.24387;
    }
  finally
    {
      async_callback = {CLOBBER};
      state = {CLOBBER};
    }
}


mono_struct_delete_old (struct MonoClass * klass, char * ptr)
{
  struct MonoClassField * D.24400;
  short unsigned int D.24401;
  int D.24402;
  int D.24403;
  struct MonoMarshalSpec * D.24406;
  <unnamed-unsigned:1> D.24407;
  int D.24408;
  unsigned int D.24409;
  <unnamed type> conv.14;
  int D.24411;
  struct MonoClass * D.24414;
  void * D.24415;
  unsigned int i.15;
  unsigned int D.24417;
  struct MonoMarshalType * info;
  int i;

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

    try
      {
        D.24400 = info->fields[i].field;
        ftype = D.24400->type;
        D.24401 = ftype->attrs;
        D.24402 = (int) D.24401;
        D.24403 = D.24402 & 16;
        if (D.24403 != 0) goto <D.24404>; else goto <D.24405>;
        <D.24404>:
        // predicted unlikely by continue predictor.
        goto <D.23757>;
        <D.24405>:
        D.24406 = info->fields[i].mspec;
        D.24407 = klass->unicode;
        D.24408 = (int) D.24407;
        ntype = mono_type_to_unmanaged (ftype, D.24406, 1, D.24408, &conv);
        D.24409 = info->fields[i].offset;
        cpos = ptr + D.24409;
        conv.14 = conv;
        switch (conv.14) <default: <D.23766>, case 0: <D.23758>, case 3: <D.23763>, case 4: <D.23762>, case 7: <D.23760>, case 9: <D.23761>, case 10: <D.23764>, case 11: <D.23765>>
        <D.23758>:
        D.24411 = mono_type_is_struct (ftype);
        if (D.24411 != 0) goto <D.24412>; else goto <D.24413>;
        <D.24412>:
        D.24414 = ftype->data.klass;
        mono_struct_delete_old (D.24414, cpos);
        // predicted unlikely by continue predictor.
        goto <D.23757>;
        <D.24413>:
        goto <D.23759>;
        <D.23760>:
        goto <D.23759>;
        <D.23761>:
        <D.23762>:
        <D.23763>:
        <D.23764>:
        <D.23765>:
        D.24415 = MEM[(void * *)cpos];
        mono_marshal_free (D.24415);
        goto <D.23759>;
        <D.23766>:
        // predicted unlikely by continue predictor.
        goto <D.23757>;
        <D.23759>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.23757>:
  i = i + 1;
  <D.23768>:
  i.15 = (unsigned int) i;
  D.24417 = info->num_fields;
  if (i.15 < D.24417) goto <D.23767>; else goto <D.23769>;
  <D.23769>:
}


mono_string_utf16_to_builder2 (gunichar2 * text)
{
  struct MonoStringBuilder * D.24423;
  struct MonoClass * string_builder_class.16;
  struct MonoImage * D.24427;
  struct MonoClass * string_builder_class.17;
  _Bool D.24429;
  long int D.24430;
  long int D.24431;
  struct MonoMethod * sb_ctor.18;
  struct MonoMethod * sb_ctor.19;
  _Bool D.24436;
  long int D.24437;
  long int D.24438;
  int len.20;
  int len.21;
  unsigned int len.22;
  unsigned int D.24444;
  gunichar2 * D.24445;
  short unsigned int D.24446;
  struct MonoDomain * D.24447;
  _Bool D.24448;
  long int D.24449;
  long int D.24450;
  struct MonoObject * exc.23;
  _Bool D.24454;
  long int D.24455;
  long int D.24456;
  struct MonoString * D.24459;
  mono_unichar2 * D.24460;
  int D.24461;
  unsigned int D.24462;
  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.24421>; else goto <D.24422>;
      <D.24421>:
      D.24423 = 0B;
      return D.24423;
      <D.24422>:
      string_builder_class.16 = string_builder_class;
      if (string_builder_class.16 == 0B) goto <D.24425>; else goto <D.24426>;
      <D.24425>:
      {
        struct MonoMethodDesc * desc;

        D.24427 = mono_defaults.corlib;
        string_builder_class.17 = mono_class_from_name (D.24427, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.17;
        string_builder_class.16 = string_builder_class;
        D.24429 = string_builder_class.16 == 0B;
        D.24430 = (long int) D.24429;
        D.24431 = __builtin_expect (D.24430, 0);
        if (D.24431 != 0) goto <D.24432>; else goto <D.24433>;
        <D.24432>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 846, "string_builder_class");
        <D.24433>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.16 = string_builder_class;
        sb_ctor.18 = mono_method_desc_search_in_class (desc, string_builder_class.16);
        sb_ctor = sb_ctor.18;
        sb_ctor.19 = sb_ctor;
        D.24436 = sb_ctor.19 == 0B;
        D.24437 = (long int) D.24436;
        D.24438 = __builtin_expect (D.24437, 0);
        if (D.24438 != 0) goto <D.24439>; else goto <D.24440>;
        <D.24439>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 849, "sb_ctor");
        <D.24440>:
        mono_method_desc_free (desc);
      }
      <D.24426>:
      len = 0;
      goto <D.21148>;
      <D.21147>:
      len.20 = len;
      len.21 = len.20 + 1;
      len = len.21;
      <D.21148>:
      len.20 = len;
      len.22 = (unsigned int) len.20;
      D.24444 = len.22 * 2;
      D.24445 = text + D.24444;
      D.24446 = *D.24445;
      if (D.24446 != 0) goto <D.21147>; else goto <D.21149>;
      <D.21149>:
      D.24447 = mono_domain_get ();
      string_builder_class.16 = string_builder_class;
      sb = mono_object_new (D.24447, string_builder_class.16);
      D.24448 = sb == 0B;
      D.24449 = (long int) D.24448;
      D.24450 = __builtin_expect (D.24449, 0);
      if (D.24450 != 0) goto <D.24451>; else goto <D.24452>;
      <D.24451>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 857, "sb");
      <D.24452>:
      args[0] = &len;
      sb_ctor.19 = sb_ctor;
      mono_runtime_invoke (sb_ctor.19, sb, &args, &exc);
      exc.23 = exc;
      D.24454 = exc.23 != 0B;
      D.24455 = (long int) D.24454;
      D.24456 = __builtin_expect (D.24455, 0);
      if (D.24456 != 0) goto <D.24457>; else goto <D.24458>;
      <D.24457>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 860, "!exc");
      <D.24458>:
      len.20 = len;
      sb->length = len.20;
      D.24459 = sb->str;
      D.24460 = mono_string_chars (D.24459);
      len.20 = len;
      D.24461 = len.20 * 2;
      D.24462 = (unsigned int) D.24461;
      memcpy (D.24460, text, D.24462);
      D.24423 = sb;
      return D.24423;
    }
  finally
    {
      len = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_string_utf8_to_builder2 (char * text)
{
  struct MonoStringBuilder * D.24467;
  struct MonoClass * string_builder_class.24;
  struct MonoImage * D.24471;
  struct MonoClass * string_builder_class.25;
  _Bool D.24473;
  long int D.24474;
  long int D.24475;
  struct MonoMethod * sb_ctor.26;
  struct MonoMethod * sb_ctor.27;
  _Bool D.24480;
  long int D.24481;
  long int D.24482;
  unsigned int D.24485;
  int l.28;
  struct MonoDomain * D.24487;
  _Bool D.24488;
  long int D.24489;
  long int D.24490;
  struct MonoObject * exc.29;
  _Bool D.24494;
  long int D.24495;
  long int D.24496;
  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.24465>; else goto <D.24466>;
      <D.24465>:
      D.24467 = 0B;
      return D.24467;
      <D.24466>:
      string_builder_class.24 = string_builder_class;
      if (string_builder_class.24 == 0B) goto <D.24469>; else goto <D.24470>;
      <D.24469>:
      {
        struct MonoMethodDesc * desc;

        D.24471 = mono_defaults.corlib;
        string_builder_class.25 = mono_class_from_name (D.24471, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.25;
        string_builder_class.24 = string_builder_class;
        D.24473 = string_builder_class.24 == 0B;
        D.24474 = (long int) D.24473;
        D.24475 = __builtin_expect (D.24474, 0);
        if (D.24475 != 0) goto <D.24476>; else goto <D.24477>;
        <D.24476>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 789, "string_builder_class");
        <D.24477>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.24 = string_builder_class;
        sb_ctor.26 = mono_method_desc_search_in_class (desc, string_builder_class.24);
        sb_ctor = sb_ctor.26;
        sb_ctor.27 = sb_ctor;
        D.24480 = sb_ctor.27 == 0B;
        D.24481 = (long int) D.24480;
        D.24482 = __builtin_expect (D.24481, 0);
        if (D.24482 != 0) goto <D.24483>; else goto <D.24484>;
        <D.24483>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 792, "sb_ctor");
        <D.24484>:
        mono_method_desc_free (desc);
      }
      <D.24470>:
      D.24485 = strlen (text);
      l.28 = (int) D.24485;
      l = l.28;
      D.24487 = mono_domain_get ();
      string_builder_class.24 = string_builder_class;
      sb = mono_object_new (D.24487, string_builder_class.24);
      D.24488 = sb == 0B;
      D.24489 = (long int) D.24488;
      D.24490 = __builtin_expect (D.24489, 0);
      if (D.24490 != 0) goto <D.24491>; else goto <D.24492>;
      <D.24491>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 799, "sb");
      <D.24492>:
      args[0] = &l;
      sb_ctor.27 = sb_ctor;
      mono_runtime_invoke (sb_ctor.27, sb, &args, &exc);
      exc.29 = exc;
      D.24494 = exc.29 != 0B;
      D.24495 = (long int) D.24494;
      D.24496 = __builtin_expect (D.24495, 0);
      if (D.24496 != 0) goto <D.24497>; else goto <D.24498>;
      <D.24497>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 802, "!exc");
      <D.24498>:
      mono_string_utf8_to_builder (sb, text);
      D.24467 = sb;
      return D.24467;
    }
  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.24501;

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


mono_array_to_byvalarray (void * native_arr, struct MonoArray * arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.24502;
  struct MonoClass * D.24503;
  struct MonoClass * D.24504;
  struct MonoClass * D.24505;
  _Bool D.24506;
  long int D.24507;
  long int D.24508;
  struct MonoClass * D.24511;
  char * D.24514;
  unsigned int D.24515;
  long int D.24516;
  struct GError * error.30;
  gchar * D.24520;
  unsigned int iftmp.31;
  unsigned int D.24522;

  D.24502 = arr->obj.vtable;
  D.24503 = D.24502->klass;
  D.24504 = D.24503->element_class;
  D.24505 = mono_defaults.char_class;
  D.24506 = D.24504 != D.24505;
  D.24507 = (long int) D.24506;
  D.24508 = __builtin_expect (D.24507, 0);
  if (D.24508 != 0) goto <D.24509>; else goto <D.24510>;
  <D.24509>:
  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.24510>:
  D.24511 = mono_defaults.byte_class;
  if (D.24511 == elclass) goto <D.24512>; else goto <D.24513>;
  <D.24512>:
  {
    char * as;
    struct GError * error;

    try
      {
        error = 0B;
        D.24514 = mono_array_addr_with_size (arr, 2, 0);
        D.24515 = mono_array_length (arr);
        D.24516 = (long int) D.24515;
        as = monoeg_g_utf16_to_utf8 (D.24514, D.24516, 0B, 0B, &error);
        error.30 = error;
        if (error.30 != 0B) goto <D.24518>; else goto <D.24519>;
        <D.24518>:
        {
          struct MonoException * exc;

          error.30 = error;
          D.24520 = error.30->message;
          exc = mono_get_exception_argument ("string", D.24520);
          error.30 = error;
          monoeg_g_error_free (error.30);
          mono_raise_exception (exc);
        }
        <D.24519>:
        D.24522 = strlen (as);
        if (D.24522 < elnum) goto <D.24523>; else goto <D.24524>;
        <D.24523>:
        iftmp.31 = strlen (as);
        goto <D.24525>;
        <D.24524>:
        iftmp.31 = elnum;
        <D.24525>:
        memcpy (native_arr, as, iftmp.31);
        monoeg_g_free (as);
      }
    finally
      {
        error = {CLOBBER};
      }
  }
  goto <D.24526>;
  <D.24513>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 731);
  <D.24526>:
}


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

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


mono_byvalarray_to_array (struct MonoArray * arr, void * native_arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.24528;
  struct MonoClass * D.24529;
  struct MonoClass * D.24530;
  struct MonoClass * D.24531;
  _Bool D.24532;
  long int D.24533;
  long int D.24534;
  struct MonoClass * D.24537;
  long int elnum.32;
  struct GError * error.33;
  char * D.24544;
  long int items_written.34;
  long unsigned int items_written.35;
  long unsigned int D.24547;

  D.24528 = arr->obj.vtable;
  D.24529 = D.24528->klass;
  D.24530 = D.24529->element_class;
  D.24531 = mono_defaults.char_class;
  D.24532 = D.24530 != D.24531;
  D.24533 = (long int) D.24532;
  D.24534 = __builtin_expect (D.24533, 0);
  if (D.24534 != 0) goto <D.24535>; else goto <D.24536>;
  <D.24535>:
  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.24536>:
  D.24537 = mono_defaults.byte_class;
  if (D.24537 == elclass) goto <D.24538>; else goto <D.24539>;
  <D.24538>:
  {
    struct GError * error;
    guint16 * ut;
    glong items_written;

    try
      {
        error = 0B;
        elnum.32 = (long int) elnum;
        ut = monoeg_g_utf8_to_utf16 (native_arr, elnum.32, 0B, &items_written, &error);
        error.33 = error;
        if (error.33 == 0B) goto <D.24542>; else goto <D.24543>;
        <D.24542>:
        D.24544 = mono_array_addr_with_size (arr, 2, 0);
        items_written.34 = items_written;
        items_written.35 = (long unsigned int) items_written.34;
        D.24547 = items_written.35 * 2;
        memcpy (D.24544, ut, D.24547);
        monoeg_g_free (ut);
        goto <D.24548>;
        <D.24543>:
        error.33 = error;
        monoeg_g_error_free (error.33);
        <D.24548>:
      }
    finally
      {
        error = {CLOBBER};
        items_written = {CLOBBER};
      }
  }
  goto <D.24549>;
  <D.24539>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 703);
  <D.24549>:
}


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

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


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

  D.24553 = mono_domain_get ();
  D.24552 = mono_string_new_len (D.24553, text, length);
  return D.24552;
}


mono_string_from_byvalwstr (gunichar2 * data, int max_len)
{
  struct MonoString * D.24557;
  unsigned int len.36;
  unsigned int D.24559;
  gunichar2 * D.24560;
  short unsigned int D.24561;
  int D.24562;
  struct MonoDomain * domain;
  int len;

  domain = mono_domain_get ();
  len = 0;
  if (data == 0B) goto <D.24555>; else goto <D.24556>;
  <D.24555>:
  D.24557 = 0B;
  return D.24557;
  <D.24556>:
  goto <D.21032>;
  <D.21031>:
  len = len + 1;
  <D.21032>:
  len.36 = (unsigned int) len;
  D.24559 = len.36 * 2;
  D.24560 = data + D.24559;
  D.24561 = *D.24560;
  if (D.24561 != 0) goto <D.21031>; else goto <D.21033>;
  <D.21033>:
  D.24562 = MIN_EXPR <max_len, len>;
  D.24557 = mono_string_new_utf16 (domain, data, D.24562);
  return D.24557;
}


mono_marshal_string_to_utf16_copy (struct MonoString * s)
{
  void * D.24566;
  int D.24567;
  int D.24568;
  int D.24569;
  long unsigned int D.24570;
  mono_unichar2 * D.24571;
  int D.24572;
  int D.24573;
  unsigned int D.24574;
  int D.24575;
  unsigned int D.24576;
  unsigned int D.24577;
  gunichar2 * D.24578;

  if (s == 0B) goto <D.24564>; else goto <D.24565>;
  <D.24564>:
  D.24566 = 0B;
  return D.24566;
  <D.24565>:
  {
    gunichar2 * res;

    D.24567 = mono_string_length (s);
    D.24568 = D.24567 + 1;
    D.24569 = D.24568 * 2;
    D.24570 = (long unsigned int) D.24569;
    res = mono_marshal_alloc (D.24570);
    D.24571 = mono_string_chars (s);
    D.24572 = mono_string_length (s);
    D.24573 = D.24572 * 2;
    D.24574 = (unsigned int) D.24573;
    memcpy (res, D.24571, D.24574);
    D.24575 = mono_string_length (s);
    D.24576 = (unsigned int) D.24575;
    D.24577 = D.24576 * 2;
    D.24578 = res + D.24577;
    *D.24578 = 0;
    D.24566 = res;
    return D.24566;
  }
}


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.37;
  unsigned int last_error_tls_id.38;

  mono_cominterop_cleanup ();
  load_type_info_tls_id.37 = load_type_info_tls_id;
  mono_native_tls_free (load_type_info_tls_id.37);
  last_error_tls_id.38 = last_error_tls_id;
  mono_native_tls_free (last_error_tls_id.38);
  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.24584;
  void * D.24585;
  struct MonoVTable * D.24588;
  unsigned char D.24589;
  unsigned char D.24590;
  _Bool D.24591;
  long int D.24592;
  long int D.24593;
  struct MonoMethodSignature * D.24596;
  unsigned char D.24597;
  unsigned char D.24598;
  const char * exc_class.39;
  _Bool D.24604;
  long int D.24605;
  long int D.24606;
  struct MonoImage * D.24609;
  const char * exc_arg.40;
  struct MonoException * D.24611;
  struct MonoObject * D.24612;
  void * D.24615;
  struct MonoMethod * method;
  struct MonoMethod * wrapper;
  struct MonoClass * klass;
  uint32_t target_handle;

  target_handle = 0;
  if (delegate == 0B) goto <D.24582>; else goto <D.24583>;
  <D.24582>:
  D.24584 = 0B;
  return D.24584;
  <D.24583>:
  D.24585 = delegate->delegate_trampoline;
  if (D.24585 != 0B) goto <D.24586>; else goto <D.24587>;
  <D.24586>:
  D.24584 = delegate->delegate_trampoline;
  return D.24584;
  <D.24587>:
  D.24588 = MEM[(struct MonoObject *)delegate].vtable;
  klass = D.24588->klass;
  D.24589 = BIT_FIELD_REF <*klass, 8, 184>;
  D.24590 = D.24589 & 1;
  D.24591 = D.24590 == 0;
  D.24592 = (long int) D.24591;
  D.24593 = __builtin_expect (D.24592, 0);
  if (D.24593 != 0) goto <D.24594>; else goto <D.24595>;
  <D.24594>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 352, "klass->delegate");
  <D.24595>:
  method = delegate->method;
  D.24596 = mono_method_signature (method);
  D.24597 = BIT_FIELD_REF <*D.24596, 8, 88>;
  D.24598 = D.24597 & 1;
  if (D.24598 != 0) goto <D.24599>; else goto <D.24600>;
  <D.24599>:
  {
    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.24601>; else goto <D.24602>;
        <D.24601>:
        exc_class.39 = exc_class;
        D.24604 = exc_class.39 == 0B;
        D.24605 = (long int) D.24604;
        D.24606 = __builtin_expect (D.24605, 0);
        if (D.24606 != 0) goto <D.24607>; else goto <D.24608>;
        <D.24607>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 362, "exc_class");
        <D.24608>:
        D.24609 = mono_defaults.corlib;
        exc_class.39 = exc_class;
        exc_arg.40 = exc_arg;
        D.24611 = mono_exception_from_name_msg (D.24609, "System", exc_class.39, exc_arg.40);
        mono_raise_exception (D.24611);
        <D.24602>:
        D.24584 = ftnptr;
        return D.24584;
      }
    finally
      {
        exc_class = {CLOBBER};
        exc_arg = {CLOBBER};
      }
  }
  <D.24600>:
  D.24612 = delegate->target;
  if (D.24612 != 0B) goto <D.24613>; else goto <D.24614>;
  <D.24613>:
  D.24612 = delegate->target;
  target_handle = mono_gchandle_new_weakref (D.24612, 0);
  <D.24614>:
  wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
  D.24615 = mono_compile_method (wrapper);
  delegate->delegate_trampoline = D.24615;
  delegate_hash_table_add (delegate);
  mono_object_register_finalizer (delegate);
  D.24584 = delegate->delegate_trampoline;
  return D.24584;
}


delegate_hash_table_add (struct MonoDelegate * d)
{
  _Bool D.24620;
  long int D.24621;
  long int D.24622;
  struct GHashTable * delegate_hash_table.41;
  struct GHashTable * delegate_hash_table.42;
  int D.24629;
  void * D.24632;
  void * D.24633;
  void * gchandle.43;
  _Bool D.24640;
  long int D.24641;
  long int D.24642;
  guint32 gchandle;
  guint32 old_gchandle;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24618>; else goto <D.24619>;
    <D.24618>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24619>:
    D.24620 = ret != 0;
    D.24621 = (long int) D.24620;
    D.24622 = __builtin_expect (D.24621, 0);
    if (D.24622 != 0) goto <D.24623>; else goto <D.24624>;
    <D.24623>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 420, "ret == 0");
    <D.24624>:
  }
  delegate_hash_table.41 = delegate_hash_table;
  if (delegate_hash_table.41 == 0B) goto <D.24626>; else goto <D.24627>;
  <D.24626>:
  delegate_hash_table.42 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.42;
  <D.24627>:
  D.24629 = mono_gc_is_moving ();
  if (D.24629 != 0) goto <D.24630>; else goto <D.24631>;
  <D.24630>:
  gchandle = mono_gchandle_new_weakref (d, 0);
  delegate_hash_table.41 = delegate_hash_table;
  D.24632 = d->delegate_trampoline;
  D.24633 = monoeg_g_hash_table_lookup (delegate_hash_table.41, D.24632);
  old_gchandle = (guint32) D.24633;
  delegate_hash_table.41 = delegate_hash_table;
  D.24632 = d->delegate_trampoline;
  gchandle.43 = (void *) gchandle;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.24632, gchandle.43, 0);
  if (old_gchandle != 0) goto <D.24635>; else goto <D.24636>;
  <D.24635>:
  mono_gchandle_free (old_gchandle);
  <D.24636>:
  goto <D.24637>;
  <D.24631>:
  delegate_hash_table.41 = delegate_hash_table;
  D.24632 = d->delegate_trampoline;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.24632, d, 0);
  <D.24637>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24638>; else goto <D.24639>;
    <D.24638>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24639>:
    D.24640 = ret != 0;
    D.24641 = (long int) D.24640;
    D.24642 = __builtin_expect (D.24641, 0);
    if (D.24642 != 0) goto <D.24643>; else goto <D.24644>;
    <D.24643>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 432, "ret == 0");
    <D.24644>:
  }
}


delegate_hash_table_new ()
{
  struct GHashTable * D.24645;

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


mono_marshal_use_aot_wrappers (gboolean use)
{
  use_aot_wrappers = use;
}


mono_ftnptr_to_delegate (struct MonoClass * klass, void * ftn)
{
  void * ftn.44;
  struct MonoDelegate * D.24650;
  _Bool D.24653;
  long int D.24654;
  long int D.24655;
  struct GHashTable * delegate_hash_table.45;
  struct GHashTable * delegate_hash_table.46;
  int D.24662;
  void * D.24665;
  _Bool D.24668;
  long int D.24669;
  long int D.24670;
  _Bool D.24679;
  long int D.24680;
  long int D.24681;
  int use_aot_wrappers.47;
  struct MonoDomain * D.24689;
  struct MonoClass * D.24690;
  struct MonoMethodSignature * D.24692;
  short unsigned int D.24693;
  int D.24694;
  int D.24695;
  unsigned int D.24696;
  unsigned int D.24697;
  struct MonoMethodSignature * D.24698;
  struct MonoImage * D.24699;
  struct MonoMethodSignature * D.24700;
  short unsigned int D.24701;
  unsigned int i.48;
  unsigned int D.24703;
  struct MonoMarshalSpec * * D.24704;
  struct MonoMarshalSpec * D.24705;
  struct MonoDomain * D.24708;
  void * D.24709;
  struct MonoVTable * D.24710;
  struct MonoDomain * D.24711;
  struct MonoDomain * D.24712;
  struct MonoException * D.24715;
  guint32 gchandle;
  struct MonoDelegate * d;

  ftn.44 = ftn;
  if (ftn.44 == 0B) goto <D.24648>; else goto <D.24649>;
  <D.24648>:
  D.24650 = 0B;
  return D.24650;
  <D.24649>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24651>; else goto <D.24652>;
    <D.24651>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24652>:
    D.24653 = ret != 0;
    D.24654 = (long int) D.24653;
    D.24655 = __builtin_expect (D.24654, 0);
    if (D.24655 != 0) goto <D.24656>; else goto <D.24657>;
    <D.24656>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 483, "ret == 0");
    <D.24657>:
  }
  delegate_hash_table.45 = delegate_hash_table;
  if (delegate_hash_table.45 == 0B) goto <D.24659>; else goto <D.24660>;
  <D.24659>:
  delegate_hash_table.46 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.46;
  <D.24660>:
  D.24662 = mono_gc_is_moving ();
  if (D.24662 != 0) goto <D.24663>; else goto <D.24664>;
  <D.24663>:
  delegate_hash_table.45 = delegate_hash_table;
  ftn.44 = ftn;
  D.24665 = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  gchandle = (guint32) D.24665;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24666>; else goto <D.24667>;
    <D.24666>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24667>:
    D.24668 = ret != 0;
    D.24669 = (long int) D.24668;
    D.24670 = __builtin_expect (D.24669, 0);
    if (D.24670 != 0) goto <D.24671>; else goto <D.24672>;
    <D.24671>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 489, "ret == 0");
    <D.24672>:
  }
  if (gchandle != 0) goto <D.24673>; else goto <D.24674>;
  <D.24673>:
  d = mono_gchandle_get_target (gchandle);
  goto <D.24675>;
  <D.24674>:
  d = 0B;
  <D.24675>:
  goto <D.24676>;
  <D.24664>:
  delegate_hash_table.45 = delegate_hash_table;
  ftn.44 = ftn;
  d = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24677>; else goto <D.24678>;
    <D.24677>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24678>:
    D.24679 = ret != 0;
    D.24680 = (long int) D.24679;
    D.24681 = __builtin_expect (D.24680, 0);
    if (D.24681 != 0) goto <D.24682>; else goto <D.24683>;
    <D.24682>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 496, "ret == 0");
    <D.24683>:
  }
  <D.24676>:
  if (d == 0B) goto <D.24684>; else goto <D.24685>;
  <D.24684>:
  {
    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.47 = use_aot_wrappers;
        if (use_aot_wrappers.47 != 0) goto <D.24687>; else goto <D.24688>;
        <D.24687>:
        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
        D.24689 = mono_domain_get ();
        D.24690 = mono_defaults.int_class;
        this = mono_value_box (D.24689, D.24690, &ftn);
        goto <D.24691>;
        <D.24688>:
        memset (&piinfo, 0, 32);
        parse_unmanaged_function_pointer_attr (klass, &piinfo);
        D.24692 = mono_method_signature (invoke);
        D.24693 = D.24692->param_count;
        D.24694 = (int) D.24693;
        D.24695 = D.24694 + 1;
        D.24696 = (unsigned int) D.24695;
        D.24697 = D.24696 * 4;
        mspecs = monoeg_malloc0 (D.24697);
        mono_method_get_marshal_info (invoke, mspecs);
        D.24698 = mono_method_signature (invoke);
        sig = mono_metadata_signature_dup (D.24698);
        sig->hasthis = 0;
        D.24699 = klass->image;
        ftn.44 = ftn;
        wrapper = mono_marshal_get_native_func_wrapper (D.24699, sig, &piinfo, mspecs, ftn.44);
        this = 0B;
        D.24700 = mono_method_signature (invoke);
        D.24701 = D.24700->param_count;
        i = (int) D.24701;
        goto <D.21015>;
        <D.21014>:
        i.48 = (unsigned int) i;
        D.24703 = i.48 * 4;
        D.24704 = mspecs + D.24703;
        D.24705 = *D.24704;
        if (D.24705 != 0B) goto <D.24706>; else goto <D.24707>;
        <D.24706>:
        i.48 = (unsigned int) i;
        D.24703 = i.48 * 4;
        D.24704 = mspecs + D.24703;
        D.24705 = *D.24704;
        mono_metadata_free_marshal_spec (D.24705);
        <D.24707>:
        i = i + -1;
        <D.21015>:
        if (i >= 0) goto <D.21014>; else goto <D.21016>;
        <D.21016>:
        monoeg_g_free (mspecs);
        monoeg_g_free (sig);
        <D.24691>:
        D.24708 = mono_domain_get ();
        d = mono_object_new (D.24708, klass);
        D.24709 = mono_compile_method (wrapper);
        mono_delegate_ctor_with_method (d, this, D.24709, wrapper);
      }
    finally
      {
        piinfo = {CLOBBER};
      }
  }
  <D.24685>:
  D.24710 = d->object.vtable;
  D.24711 = D.24710->domain;
  D.24712 = mono_domain_get ();
  if (D.24711 != D.24712) goto <D.24713>; else goto <D.24714>;
  <D.24713>:
  D.24715 = mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain");
  mono_raise_exception (D.24715);
  <D.24714>:
  D.24650 = d;
  return D.24650;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.24719;
  int D.24724;
  void * D.24726;
  unsigned int D.24727;

  D.24719 = __builtin_constant_p (__len);
  if (D.24719 != 0) goto <D.24720>; else goto <D.24721>;
  <D.24720>:
  if (__len == 0) goto <D.24722>; else goto <D.24723>;
  <D.24722>:
  D.24724 = __builtin_constant_p (__ch);
  if (D.24724 == 0) goto <D.24717>; else goto <D.24725>;
  <D.24725>:
  if (__ch != 0) goto <D.24717>; else goto <D.24718>;
  <D.24717>:
  __warn_memset_zero_len ();
  D.24726 = __dest;
  return D.24726;
  <D.24718>:
  <D.24723>:
  <D.24721>:
  D.24727 = __builtin_object_size (__dest, 0);
  D.24726 = __builtin___memset_chk (__dest, __ch, __len, D.24727);
  return D.24726;
}


parse_unmanaged_function_pointer_attr (struct MonoClass * klass, struct MonoMethodPInvoke * piinfo)
{
  struct MonoClass * UnmanagedFunctionPointerAttribute.49;
  struct MonoImage * D.24732;
  struct MonoClass * UnmanagedFunctionPointerAttribute.50;
  int D.24738;
  int D.24743;
  int D.24744;
  signed short D.24745;
  signed short iftmp.51;
  int D.24747;
  int D.24750;
  unsigned short D.24751;
  unsigned short D.24752;
  signed short D.24754;
  unsigned char D.24755;
  signed short D.24756;
  signed short D.24757;
  short unsigned int D.24758;
  int D.24759;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoCustomAttrInfo * cinfo;
  struct MonoReflectionUnmanagedFunctionPointerAttribute * attr;

  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 == 0B) goto <D.24730>; else goto <D.24731>;
  <D.24730>:
  D.24732 = mono_defaults.corlib;
  UnmanagedFunctionPointerAttribute.50 = mono_class_from_name (D.24732, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
  UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.50;
  <D.24731>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 != 0B) goto <D.24734>; else goto <D.24735>;
  <D.24734>:
  cinfo = mono_custom_attrs_from_class (klass);
  if (cinfo != 0B) goto <D.24736>; else goto <D.24737>;
  <D.24736>:
  D.24738 = mono_runtime_get_no_exec ();
  if (D.24738 == 0) goto <D.24739>; else goto <D.24740>;
  <D.24739>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  attr = mono_custom_attrs_get_attr (cinfo, UnmanagedFunctionPointerAttribute.49);
  if (attr != 0B) goto <D.24741>; else goto <D.24742>;
  <D.24741>:
  D.24743 = attr->call_conv;
  D.24744 = D.24743 << 8;
  D.24745 = (signed short) D.24744;
  D.24747 = attr->charset;
  if (D.24747 != 0) goto <D.24748>; else goto <D.24749>;
  <D.24748>:
  D.24747 = attr->charset;
  D.24750 = D.24747 + -1;
  D.24751 = (unsigned short) D.24750;
  D.24752 = D.24751 * 2;
  iftmp.51 = (signed short) D.24752;
  goto <D.24753>;
  <D.24749>:
  iftmp.51 = 1;
  <D.24753>:
  D.24754 = D.24745 | iftmp.51;
  D.24755 = attr->set_last_error;
  D.24756 = (signed short) D.24755;
  D.24757 = D.24754 | D.24756;
  D.24758 = (short unsigned int) D.24757;
  piinfo->piflags = D.24758;
  <D.24742>:
  D.24759 = cinfo->cached;
  if (D.24759 == 0) goto <D.24760>; else goto <D.24761>;
  <D.24760>:
  mono_custom_attrs_free (cinfo);
  <D.24761>:
  <D.24740>:
  <D.24737>:
  <D.24735>:
}


mono_delegate_free_ftnptr (struct MonoDelegate * delegate)
{
  void * * D.24762;
  struct MonoObject * D.24763;
  struct MonoDomain * D.24768;
  void * D.24769;
  _Bool D.24770;
  long int D.24771;
  long int D.24772;
  void * * D.24775;
  void * D.24776;
  struct MonoVTable * D.24779;
  struct MonoDomain * D.24780;
  struct MonoJitInfo * ji;
  void * ptr;

  delegate_hash_table_remove (delegate);
  D.24762 = &delegate->delegate_trampoline;
  ptr = InterlockedExchangePointer (D.24762, 0B);
  D.24763 = delegate->target;
  if (D.24763 == 0B) goto <D.24764>; else goto <D.24765>;
  <D.24764>:
  return;
  <D.24765>:
  if (ptr != 0B) goto <D.24766>; else goto <D.24767>;
  <D.24766>:
  {
    uint32_t gchandle;
    void * * method_data;
    struct MonoMethod * method;

    D.24768 = mono_domain_get ();
    D.24769 = mono_get_addr_from_ftnptr (ptr);
    ji = mono_jit_info_table_find (D.24768, D.24769);
    D.24770 = ji == 0B;
    D.24771 = (long int) D.24770;
    D.24772 = __builtin_expect (D.24771, 0);
    if (D.24772 != 0) goto <D.24773>; else goto <D.24774>;
    <D.24773>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 562, "ji");
    <D.24774>:
    method = mono_jit_info_get_method (ji);
    method_data = MEM[(struct MonoMethodWrapper *)method].method_data;
    D.24775 = method_data + 8;
    D.24776 = *D.24775;
    gchandle = (uint32_t) D.24776;
    if (gchandle != 0) goto <D.24777>; else goto <D.24778>;
    <D.24777>:
    mono_gchandle_free (gchandle);
    <D.24778>:
    D.24779 = MEM[(struct MonoObject *)delegate].vtable;
    D.24780 = D.24779->domain;
    mono_runtime_free_method (D.24780, method);
  }
  <D.24767>:
}


delegate_hash_table_remove (struct MonoDelegate * d)
{
  _Bool D.24784;
  long int D.24785;
  long int D.24786;
  struct GHashTable * delegate_hash_table.52;
  struct GHashTable * delegate_hash_table.53;
  int D.24793;
  void * D.24796;
  void * D.24797;
  _Bool D.24800;
  long int D.24801;
  long int D.24802;
  int D.24805;
  guint32 gchandle;

  gchandle = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24782>; else goto <D.24783>;
    <D.24782>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24783>:
    D.24784 = ret != 0;
    D.24785 = (long int) D.24784;
    D.24786 = __builtin_expect (D.24785, 0);
    if (D.24786 != 0) goto <D.24787>; else goto <D.24788>;
    <D.24787>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 403, "ret == 0");
    <D.24788>:
  }
  delegate_hash_table.52 = delegate_hash_table;
  if (delegate_hash_table.52 == 0B) goto <D.24790>; else goto <D.24791>;
  <D.24790>:
  delegate_hash_table.53 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.53;
  <D.24791>:
  D.24793 = mono_gc_is_moving ();
  if (D.24793 != 0) goto <D.24794>; else goto <D.24795>;
  <D.24794>:
  delegate_hash_table.52 = delegate_hash_table;
  D.24796 = d->delegate_trampoline;
  D.24797 = monoeg_g_hash_table_lookup (delegate_hash_table.52, D.24796);
  gchandle = (guint32) D.24797;
  <D.24795>:
  delegate_hash_table.52 = delegate_hash_table;
  D.24796 = d->delegate_trampoline;
  monoeg_g_hash_table_remove (delegate_hash_table.52, D.24796);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24798>; else goto <D.24799>;
    <D.24798>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24799>:
    D.24800 = ret != 0;
    D.24801 = (long int) D.24800;
    D.24802 = __builtin_expect (D.24801, 0);
    if (D.24802 != 0) goto <D.24803>; else goto <D.24804>;
    <D.24803>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 409, "ret == 0");
    <D.24804>:
  }
  D.24805 = mono_gc_is_moving ();
  if (D.24805 != 0) goto <D.24806>; else goto <D.24807>;
  <D.24806>:
  mono_gchandle_free (gchandle);
  <D.24807>:
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  unsigned int old_val.54;
  unsigned int new_val.55;
  unsigned int D.24810;
  void * D.24811;
  void * D.24812;
  void * old_val;

  <D.20415>:
  old_val = *val;
  old_val.54 = (unsigned int) old_val;
  new_val.55 = (unsigned int) new_val;
  D.24810 = __sync_val_compare_and_swap_4 (val, old_val.54, new_val.55);
  D.24811 = (void *) D.24810;
  if (D.24811 != old_val) goto <D.20415>; else goto <D.20416>;
  <D.20416>:
  D.24812 = old_val;
  return D.24812;
}


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

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


mono_array_to_lparray (struct MonoArray * array)
{
  void * D.24820;
  struct MonoVTable * D.24821;
  struct MonoClass * D.24822;
  unsigned char D.24823;
  int D.24824;
  unsigned int D.24825;
  unsigned int nativeArraySize.56;
  unsigned int D.24827;
  unsigned int i.57;
  unsigned int D.24829;
  void * * D.24830;
  double[0:] * D.24831;
  void * * D.24832;
  void * D.24833;
  void * D.24834;
  void * * nativeArray;
  int nativeArraySize;
  int i;
  struct MonoClass * klass;

  nativeArray = 0B;
  nativeArraySize = 0;
  i = 0;
  if (array == 0B) goto <D.24818>; else goto <D.24819>;
  <D.24818>:
  D.24820 = 0B;
  return D.24820;
  <D.24819>:
  D.24821 = array->obj.vtable;
  klass = D.24821->klass;
  D.24822 = klass->element_class;
  D.24823 = D.24822->byval_arg.type;
  D.24824 = (int) D.24823;
  switch (D.24824) <default: <D.21071>, case 1: <D.21044>, case 2: <D.21050>, case 3: <D.21053>, case 4: <D.21051>, case 5: <D.21049>, case 6: <D.21054>, case 7: <D.21052>, case 8: <D.21057>, case 9: <D.21058>, case 10: <D.21060>, case 11: <D.21059>, case 12: <D.21061>, case 13: <D.21062>, case 14: <D.21070>, case 15: <D.21064>, case 17: <D.21063>, case 18: <D.21045>, case 20: <D.21068>, case 21: <D.21066>, case 24: <D.21055>, case 25: <D.21056>, case 28: <D.21067>, case 29: <D.21069>>
  <D.21044>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 620);
  <D.21045>:
  D.24825 = array->max_length;
  nativeArraySize = (int) D.24825;
  nativeArraySize.56 = (unsigned int) nativeArraySize;
  D.24827 = nativeArraySize.56 * 4;
  nativeArray = malloc (D.24827);
  i = 0;
  goto <D.21047>;
  <D.21046>:
  i.57 = (unsigned int) i;
  D.24829 = i.57 * 4;
  D.24830 = nativeArray + D.24829;
  D.24831 = &array->vector;
  i.57 = (unsigned int) i;
  D.24829 = i.57 * 4;
  D.24832 = D.24831 + D.24829;
  D.24833 = *D.24832;
  D.24834 = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (D.24833);
  *D.24830 = D.24834;
  i = i + 1;
  <D.21047>:
  if (i < nativeArraySize) goto <D.21046>; else goto <D.21048>;
  <D.21048>:
  D.24820 = nativeArray;
  return D.24820;
  <D.21049>:
  <D.21050>:
  <D.21051>:
  <D.21052>:
  <D.21053>:
  <D.21054>:
  <D.21055>:
  <D.21056>:
  <D.21057>:
  <D.21058>:
  <D.21059>:
  <D.21060>:
  <D.21061>:
  <D.21062>:
  <D.21063>:
  <D.21064>:
  goto <D.21065>;
  <D.21066>:
  <D.21067>:
  <D.21068>:
  <D.21069>:
  <D.21070>:
  <D.21071>:
  D.24822 = klass->element_class;
  D.24823 = D.24822->byval_arg.type;
  D.24824 = (int) D.24823;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.24824);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 653);
  <D.21065>:
  D.24820 = &array->vector;
  return D.24820;
}


mono_free_lparray (struct MonoArray * array, void * * nativeArray)
{
  struct MonoVTable * D.24841;
  struct MonoClass * D.24842;
  unsigned char D.24843;
  int D.24844;
  unsigned int i.58;
  unsigned int D.24846;
  void * * D.24847;
  void * D.24848;
  unsigned int i.59;
  unsigned int D.24850;
  struct MonoClass * klass;
  int i;

  i = 0;
  if (array == 0B) goto <D.24837>; else goto <D.24838>;
  <D.24837>:
  return;
  <D.24838>:
  if (nativeArray == 0B) goto <D.24839>; else goto <D.24840>;
  <D.24839>:
  return;
  <D.24840>:
  D.24841 = array->obj.vtable;
  klass = D.24841->klass;
  D.24842 = klass->element_class;
  D.24843 = D.24842->byval_arg.type;
  D.24844 = (int) D.24843;
  switch (D.24844) <default: <D.24851>, case 18: <D.21078>>
  <D.21078>:
  i = 0;
  goto <D.21080>;
  <D.21079>:
  i.58 = (unsigned int) i;
  D.24846 = i.58 * 4;
  D.24847 = nativeArray + D.24846;
  D.24848 = *D.24847;
  mono_marshal_free_ccw (D.24848);
  i = i + 1;
  <D.21080>:
  i.59 = (unsigned int) i;
  D.24850 = array->max_length;
  if (i.59 < D.24850) goto <D.21079>; else goto <D.21081>;
  <D.21081>:
  free (nativeArray);
  goto <D.21082>;
  <D.24851>:
  <D.21082>:
}


mono_string_utf8_to_builder (struct MonoStringBuilder * sb, char * text)
{
  _Bool D.24853;
  _Bool D.24854;
  _Bool D.24855;
  unsigned int D.24858;
  long int iftmp.60;
  struct MonoString * D.24860;
  long int items_written.61;
  glong iftmp.62;
  struct GError * error.63;
  struct MonoString * D.24877;
  struct MonoString * * D.24878;
  struct MonoDomain * D.24879;
  struct MonoString * D.24880;
  mono_unichar2 * D.24881;
  long int D.24882;
  unsigned int D.24883;
  struct GError * error;
  guint16 * ut;
  glong items_written;
  int l;

  try
    {
      error = 0B;
      D.24853 = sb == 0B;
      D.24854 = text == 0B;
      D.24855 = D.24853 | D.24854;
      if (D.24855 != 0) goto <D.24856>; else goto <D.24857>;
      <D.24856>:
      return;
      <D.24857>:
      D.24858 = strlen (text);
      l = (int) D.24858;
      ut = monoeg_g_utf8_to_utf16 (text, l, 0B, &items_written, &error);
      D.24860 = sb->str;
      if (D.24860 != 0B) goto <D.24861>; else goto <D.24862>;
      <D.24861>:
      D.24860 = sb->str;
      iftmp.60 = D.24860->length;
      goto <D.24863>;
      <D.24862>:
      iftmp.60 = 16;
      <D.24863>:
      items_written.61 = items_written;
      if (iftmp.60 < items_written.61) goto <D.24865>; else goto <D.24866>;
      <D.24865>:
      D.24860 = sb->str;
      if (D.24860 != 0B) goto <D.24868>; else goto <D.24869>;
      <D.24868>:
      D.24860 = sb->str;
      iftmp.62 = D.24860->length;
      goto <D.24870>;
      <D.24869>:
      iftmp.62 = 16;
      <D.24870>:
      items_written = iftmp.62;
      <D.24866>:
      error.63 = error;
      if (error.63 == 0B) goto <D.24872>; else goto <D.24873>;
      <D.24872>:
      D.24860 = sb->str;
      if (D.24860 == 0B) goto <D.24874>; else goto <D.24876>;
      <D.24876>:
      D.24860 = sb->str;
      D.24877 = sb->cached_str;
      if (D.24860 == D.24877) goto <D.24874>; else goto <D.24875>;
      <D.24874>:
      D.24878 = &sb->str;
      D.24879 = mono_domain_get ();
      items_written.61 = items_written;
      D.24880 = mono_string_new_size (D.24879, items_written.61);
      mono_gc_wbarrier_set_field (sb, D.24878, D.24880);
      <D.24875>:
      D.24860 = sb->str;
      D.24881 = mono_string_chars (D.24860);
      items_written.61 = items_written;
      D.24882 = items_written.61 * 2;
      D.24883 = (unsigned int) D.24882;
      memcpy (D.24881, ut, D.24883);
      items_written.61 = items_written;
      sb->length = items_written.61;
      sb->cached_str = 0B;
      goto <D.24884>;
      <D.24873>:
      error.63 = error;
      monoeg_g_error_free (error.63);
      <D.24884>:
      monoeg_g_free (ut);
    }
  finally
    {
      error = {CLOBBER};
      items_written = {CLOBBER};
    }
}


mono_string_utf16_to_builder (struct MonoStringBuilder * sb, gunichar2 * text)
{
  _Bool D.24888;
  _Bool D.24889;
  _Bool D.24890;
  struct MonoString * D.24893;
  mono_unichar2 * D.24894;
  _Bool D.24895;
  long int D.24896;
  long int D.24897;
  unsigned int D.24900;
  gunichar2 * D.24901;
  short unsigned int D.24902;
  int len.64;
  guint32 len;

  D.24888 = sb == 0B;
  D.24889 = text == 0B;
  D.24890 = D.24888 | D.24889;
  if (D.24890 != 0) goto <D.24891>; else goto <D.24892>;
  <D.24891>:
  return;
  <D.24892>:
  D.24893 = sb->str;
  D.24894 = mono_string_chars (D.24893);
  D.24895 = D.24894 != text;
  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", 821, "mono_string_chars (sb->str) == text");
  <D.24899>:
  len = 0;
  goto <D.21135>;
  <D.21134>:
  len = len + 1;
  <D.21135>:
  D.24900 = len * 2;
  D.24901 = text + D.24900;
  D.24902 = *D.24901;
  if (D.24902 != 0) goto <D.21134>; else goto <D.21136>;
  <D.21136>:
  len.64 = (int) len;
  sb->length = len.64;
}


mono_string_builder_to_utf8 (struct MonoStringBuilder * sb)
{
  void * D.24907;
  struct MonoString * D.24908;
  struct MonoString * D.24909;
  int D.24912;
  struct MonoString * * D.24915;
  struct MonoDomain * D.24916;
  struct MonoString * D.24917;
  mono_unichar2 * D.24918;
  int D.24919;
  struct GError * error.65;
  struct MonoException * D.24923;
  gulong iftmp.66;
  int D.24928;
  int D.24930;
  unsigned int D.24931;
  struct GError * error;
  gchar * tmp;
  gchar * res;

  try
    {
      error = 0B;
      res = 0B;
      if (sb == 0B) goto <D.24905>; else goto <D.24906>;
      <D.24905>:
      D.24907 = 0B;
      return D.24907;
      <D.24906>:
      D.24908 = sb->str;
      D.24909 = sb->cached_str;
      if (D.24908 == D.24909) goto <D.24910>; else goto <D.24911>;
      <D.24910>:
      D.24908 = sb->str;
      D.24912 = D.24908->length;
      if (D.24912 == 0) goto <D.24913>; else goto <D.24914>;
      <D.24913>:
      D.24915 = &sb->str;
      D.24916 = mono_domain_get ();
      D.24917 = mono_string_new_size (D.24916, 16);
      mono_gc_wbarrier_set_field (sb, D.24915, D.24917);
      sb->cached_str = 0B;
      <D.24914>:
      <D.24911>:
      D.24908 = sb->str;
      D.24918 = mono_string_chars (D.24908);
      D.24919 = sb->length;
      tmp = monoeg_g_utf16_to_utf8 (D.24918, D.24919, 0B, 0B, &error);
      error.65 = error;
      if (error.65 != 0B) goto <D.24921>; else goto <D.24922>;
      <D.24921>:
      error.65 = error;
      monoeg_g_error_free (error.65);
      D.24923 = mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8");
      mono_raise_exception (D.24923);
      goto <D.24924>;
      <D.24922>:
      D.24908 = sb->str;
      if (D.24908 != 0B) goto <D.24926>; else goto <D.24927>;
      <D.24926>:
      D.24908 = sb->str;
      D.24912 = D.24908->length;
      D.24928 = D.24912 + 1;
      iftmp.66 = (gulong) D.24928;
      goto <D.24929>;
      <D.24927>:
      iftmp.66 = 17;
      <D.24929>:
      res = mono_marshal_alloc (iftmp.66);
      D.24919 = sb->length;
      D.24930 = D.24919 + 1;
      D.24931 = (unsigned int) D.24930;
      memcpy (res, tmp, D.24931);
      monoeg_g_free (tmp);
      <D.24924>:
      D.24907 = res;
      return D.24907;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_string_builder_to_utf16 (struct MonoStringBuilder * sb)
{
  void * D.24936;
  struct MonoString * D.24937;
  _Bool D.24938;
  long int D.24939;
  long int D.24940;
  struct MonoString * D.24943;
  int D.24946;
  struct MonoString * * D.24949;
  struct MonoDomain * D.24950;
  struct MonoString * D.24951;
  struct MonoDomain * D.24953;
  mono_unichar2 * D.24954;
  int iftmp.67;
  struct MonoString * D.24959;
  int D.24960;
  mono_unichar2 * D.24963;

  if (sb == 0B) goto <D.24934>; else goto <D.24935>;
  <D.24934>:
  D.24936 = 0B;
  return D.24936;
  <D.24935>:
  D.24937 = sb->str;
  D.24938 = D.24937 == 0B;
  D.24939 = (long int) D.24938;
  D.24940 = __builtin_expect (D.24939, 0);
  if (D.24940 != 0) goto <D.24941>; else goto <D.24942>;
  <D.24941>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 925, "sb->str");
  <D.24942>:
  D.24937 = sb->str;
  D.24943 = sb->cached_str;
  if (D.24937 == D.24943) goto <D.24944>; else goto <D.24945>;
  <D.24944>:
  D.24937 = sb->str;
  D.24946 = D.24937->length;
  if (D.24946 == 0) goto <D.24947>; else goto <D.24948>;
  <D.24947>:
  D.24949 = &sb->str;
  D.24950 = mono_domain_get ();
  D.24951 = mono_string_new_size (D.24950, 16);
  mono_gc_wbarrier_set_field (sb, D.24949, D.24951);
  goto <D.24952>;
  <D.24948>:
  D.24949 = &sb->str;
  D.24953 = mono_domain_get ();
  D.24937 = sb->str;
  D.24954 = mono_string_chars (D.24937);
  D.24937 = sb->str;
  if (D.24937 != 0B) goto <D.24956>; else goto <D.24957>;
  <D.24956>:
  D.24937 = sb->str;
  iftmp.67 = D.24937->length;
  goto <D.24958>;
  <D.24957>:
  iftmp.67 = 16;
  <D.24958>:
  D.24959 = mono_string_new_utf16 (D.24953, D.24954, iftmp.67);
  mono_gc_wbarrier_set_field (sb, D.24949, D.24959);
  <D.24952>:
  sb->cached_str = 0B;
  <D.24945>:
  D.24960 = sb->length;
  if (D.24960 == 0) goto <D.24961>; else goto <D.24962>;
  <D.24961>:
  D.24937 = sb->str;
  D.24963 = mono_string_chars (D.24937);
  *D.24963 = 0;
  <D.24962>:
  D.24937 = sb->str;
  D.24936 = mono_string_chars (D.24937);
  return D.24936;
}


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

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


mono_string_to_byvalstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.24967;
  long int D.24968;
  long int D.24969;
  _Bool D.24972;
  long int D.24973;
  long int D.24974;
  unsigned int size.68;
  int iftmp.69;
  unsigned int D.24981;
  unsigned int D.24984;
  unsigned int len.70;
  char * s;
  int len;

  D.24967 = dst == 0B;
  D.24968 = (long int) D.24967;
  D.24969 = __builtin_expect (D.24968, 0);
  if (D.24969 != 0) goto <D.24970>; else goto <D.24971>;
  <D.24970>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1006, "dst != NULL");
  <D.24971>:
  D.24972 = size <= 0;
  D.24973 = (long int) D.24972;
  D.24974 = __builtin_expect (D.24973, 0);
  if (D.24974 != 0) goto <D.24975>; else goto <D.24976>;
  <D.24975>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1007, "size > 0");
  <D.24976>:
  size.68 = (unsigned int) size;
  memset (dst, 0, size.68);
  if (src == 0B) goto <D.24978>; else goto <D.24979>;
  <D.24978>:
  return;
  <D.24979>:
  s = mono_string_to_utf8 (src);
  size.68 = (unsigned int) size;
  D.24981 = strlen (s);
  if (size.68 >= D.24981) goto <D.24982>; else goto <D.24983>;
  <D.24982>:
  D.24984 = strlen (s);
  iftmp.69 = (int) D.24984;
  goto <D.24985>;
  <D.24983>:
  iftmp.69 = size;
  <D.24985>:
  len = iftmp.69;
  if (len >= size) goto <D.24986>; else goto <D.24987>;
  <D.24986>:
  len = len + -1;
  <D.24987>:
  len.70 = (unsigned int) len;
  memcpy (dst, s, len.70);
  monoeg_g_free (s);
}


mono_string_to_byvalwstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.24990;
  long int D.24991;
  long int D.24992;
  _Bool D.24995;
  long int D.24996;
  long int D.24997;
  int D.25002;
  unsigned int D.25003;
  int iftmp.71;
  int D.25005;
  mono_unichar2 * D.25009;
  int D.25010;
  unsigned int len.72;
  unsigned int D.25014;
  gunichar2 * D.25015;
  int len;

  D.24990 = dst == 0B;
  D.24991 = (long int) D.24990;
  D.24992 = __builtin_expect (D.24991, 0);
  if (D.24992 != 0) goto <D.24993>; else goto <D.24994>;
  <D.24993>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1036, "dst != NULL");
  <D.24994>:
  D.24995 = size <= 1;
  D.24996 = (long int) D.24995;
  D.24997 = __builtin_expect (D.24996, 0);
  if (D.24997 != 0) goto <D.24998>; else goto <D.24999>;
  <D.24998>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1037, "size > 1");
  <D.24999>:
  if (src == 0B) goto <D.25000>; else goto <D.25001>;
  <D.25000>:
  D.25002 = size * 2;
  D.25003 = (unsigned int) D.25002;
  memset (dst, 0, D.25003);
  return;
  <D.25001>:
  D.25005 = mono_string_length (src);
  if (D.25005 <= size) goto <D.25006>; else goto <D.25007>;
  <D.25006>:
  iftmp.71 = mono_string_length (src);
  goto <D.25008>;
  <D.25007>:
  iftmp.71 = size;
  <D.25008>:
  len = iftmp.71;
  D.25009 = mono_string_chars (src);
  D.25002 = size * 2;
  D.25003 = (unsigned int) D.25002;
  memcpy (dst, D.25009, D.25003);
  D.25010 = mono_string_length (src);
  if (D.25010 >= size) goto <D.25011>; else goto <D.25012>;
  <D.25011>:
  len = len + -1;
  <D.25012>:
  len.72 = (unsigned int) len;
  D.25014 = len.72 * 2;
  D.25015 = dst + D.25014;
  *D.25015 = 0;
}


mono_type_to_ldind (struct MonoType * type)
{
  unsigned char D.25017;
  unsigned char D.25018;
  guint D.25021;
  unsigned char D.25022;
  int D.25023;
  struct MonoClass * D.25024;
  unsigned char D.25025;
  unsigned char D.25026;
  struct MonoGenericClass * D.25029;
  struct MonoClass * D.25030;
  void handle_enum = <<< error >>>;

  D.25017 = BIT_FIELD_REF <*type, 8, 56>;
  D.25018 = D.25017 & 64;
  if (D.25018 != 0) goto <D.25019>; else goto <D.25020>;
  <D.25019>:
  D.25021 = 77;
  return D.25021;
  <D.25020>:
  handle_enum:
  D.25022 = type->type;
  D.25023 = (int) D.25022;
  switch (D.25023) <default: <D.21233>, case 2: <D.21211>, case 3: <D.21214>, case 4: <D.21209>, case 5: <D.21210>, case 6: <D.21212>, case 7: <D.21213>, case 8: <D.21215>, case 9: <D.21216>, case 10: <D.21226>, case 11: <D.21227>, case 12: <D.21228>, case 13: <D.21229>, case 14: <D.21222>, case 15: <D.21219>, case 17: <D.21230>, case 18: <D.21221>, case 20: <D.21225>, case 21: <D.21232>, case 22: <D.21231>, case 24: <D.21217>, case 25: <D.21218>, case 27: <D.21220>, case 28: <D.21223>, case 29: <D.21224>>
  <D.21209>:
  D.25021 = 70;
  return D.25021;
  <D.21210>:
  <D.21211>:
  D.25021 = 71;
  return D.25021;
  <D.21212>:
  D.25021 = 72;
  return D.25021;
  <D.21213>:
  <D.21214>:
  D.25021 = 73;
  return D.25021;
  <D.21215>:
  D.25021 = 74;
  return D.25021;
  <D.21216>:
  D.25021 = 75;
  return D.25021;
  <D.21217>:
  <D.21218>:
  <D.21219>:
  <D.21220>:
  D.25021 = 77;
  return D.25021;
  <D.21221>:
  <D.21222>:
  <D.21223>:
  <D.21224>:
  <D.21225>:
  D.25021 = 80;
  return D.25021;
  <D.21226>:
  <D.21227>:
  D.25021 = 76;
  return D.25021;
  <D.21228>:
  D.25021 = 78;
  return D.25021;
  <D.21229>:
  D.25021 = 79;
  return D.25021;
  <D.21230>:
  D.25024 = type->data.klass;
  D.25025 = BIT_FIELD_REF <*D.25024, 8, 160>;
  D.25026 = D.25025 & 16;
  if (D.25026 != 0) goto <D.25027>; else goto <D.25028>;
  <D.25027>:
  D.25024 = type->data.klass;
  type = mono_class_enum_basetype (D.25024);
  goto handle_enum;
  <D.25028>:
  D.25021 = 113;
  return D.25021;
  <D.21231>:
  D.25021 = 113;
  return D.25021;
  <D.21232>:
  D.25029 = type->data.generic_class;
  D.25030 = D.25029->container_class;
  type = &D.25030->byval_arg;
  goto handle_enum;
  <D.21233>:
  D.25022 = type->type;
  D.25023 = (int) D.25022;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_ldind", D.25023);
  <D.21234>:
  goto <D.21234>;
  D.25021 = 4294967295;
  return D.25021;
}


mono_type_to_stind (struct MonoType * type)
{
  unsigned char D.25032;
  unsigned char D.25033;
  guint D.25036;
  unsigned char D.25037;
  int D.25038;
  struct MonoClass * D.25039;
  unsigned char D.25040;
  unsigned char D.25041;
  struct MonoGenericClass * D.25044;
  struct MonoClass * D.25045;
  void handle_enum = <<< error >>>;

  D.25032 = BIT_FIELD_REF <*type, 8, 56>;
  D.25033 = D.25032 & 64;
  if (D.25033 != 0) goto <D.25034>; else goto <D.25035>;
  <D.25034>:
  D.25036 = 223;
  return D.25036;
  <D.25035>:
  handle_enum:
  D.25037 = type->type;
  D.25038 = (int) D.25037;
  switch (D.25038) <default: <D.21263>, case 2: <D.21241>, case 3: <D.21244>, case 4: <D.21239>, case 5: <D.21240>, case 6: <D.21242>, case 7: <D.21243>, case 8: <D.21245>, case 9: <D.21246>, case 10: <D.21256>, case 11: <D.21257>, case 12: <D.21258>, case 13: <D.21259>, case 14: <D.21252>, case 15: <D.21249>, case 17: <D.21260>, case 18: <D.21251>, case 20: <D.21255>, case 21: <D.21262>, case 22: <D.21261>, case 24: <D.21247>, case 25: <D.21248>, case 27: <D.21250>, case 28: <D.21253>, case 29: <D.21254>>
  <D.21239>:
  <D.21240>:
  <D.21241>:
  D.25036 = 82;
  return D.25036;
  <D.21242>:
  <D.21243>:
  <D.21244>:
  D.25036 = 83;
  return D.25036;
  <D.21245>:
  <D.21246>:
  D.25036 = 84;
  return D.25036;
  <D.21247>:
  <D.21248>:
  <D.21249>:
  <D.21250>:
  D.25036 = 223;
  return D.25036;
  <D.21251>:
  <D.21252>:
  <D.21253>:
  <D.21254>:
  <D.21255>:
  D.25036 = 81;
  return D.25036;
  <D.21256>:
  <D.21257>:
  D.25036 = 85;
  return D.25036;
  <D.21258>:
  D.25036 = 86;
  return D.25036;
  <D.21259>:
  D.25036 = 87;
  return D.25036;
  <D.21260>:
  D.25039 = type->data.klass;
  D.25040 = BIT_FIELD_REF <*D.25039, 8, 160>;
  D.25041 = D.25040 & 16;
  if (D.25041 != 0) goto <D.25042>; else goto <D.25043>;
  <D.25042>:
  D.25039 = type->data.klass;
  type = mono_class_enum_basetype (D.25039);
  goto handle_enum;
  <D.25043>:
  D.25036 = 129;
  return D.25036;
  <D.21261>:
  D.25036 = 129;
  return D.25036;
  <D.21262>:
  D.25044 = type->data.generic_class;
  D.25045 = D.25044->container_class;
  type = &D.25045->byval_arg;
  goto handle_enum;
  <D.21263>:
  D.25037 = type->type;
  D.25038 = (int) D.25037;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_stind", D.25038);
  <D.21264>:
  goto <D.21264>;
  D.25036 = 4294967295;
  return D.25036;
}


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


emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  char * D.25047;
  char * D.25048;

  D.25047 = mb->name;
  D.25048 = strstr (D.25047, "mono_thread_interruption_checkpoint");
  if (D.25048 != 0B) goto <D.25049>; else goto <D.25050>;
  <D.25049>:
  return;
  <D.25050>:
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
}


emit_thread_interrupt_checkpoint_call (struct MonoMethodBuilder * mb, void * checkpoint_func)
{
  gint32 * D.25052;
  unsigned int D.25053;
  unsigned int pos_noabort.73;
  int pos_noabort;

  D.25052 = mono_thread_interruption_request_flag ();
  mono_mb_emit_ptr (mb, D.25052);
  mono_mb_emit_byte (mb, 75);
  D.25053 = mono_mb_emit_branch (mb, 57);
  pos_noabort = (int) D.25053;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 12);
  mono_mb_emit_icall (mb, checkpoint_func);
  pos_noabort.73 = (unsigned int) pos_noabort;
  mono_mb_patch_branch (mb, pos_noabort.73);
}


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

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


get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.25057;
  _Bool D.25062;
  long int D.25063;
  long int D.25064;
  _Bool D.25071;
  long int D.25072;
  long int D.25073;
  struct GHashTable * D.25076;

  D.25057 = *var;
  if (D.25057 == 0B) goto <D.25058>; else goto <D.25059>;
  <D.25058>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25060>; else goto <D.25061>;
    <D.25060>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25061>:
    D.25062 = ret != 0;
    D.25063 = (long int) D.25062;
    D.25064 = __builtin_expect (D.25063, 0);
    if (D.25064 != 0) goto <D.25065>; else goto <D.25066>;
    <D.25065>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2432, "ret == 0");
    <D.25066>:
  }
  D.25057 = *var;
  if (D.25057 == 0B) goto <D.25067>; else goto <D.25068>;
  <D.25067>:
  {
    struct GHashTable * cache;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25069>; else goto <D.25070>;
    <D.25069>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25070>:
    D.25071 = ret != 0;
    D.25072 = (long int) D.25071;
    D.25073 = __builtin_expect (D.25072, 0);
    if (D.25073 != 0) goto <D.25074>; else goto <D.25075>;
    <D.25074>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2439, "ret == 0");
    <D.25075>:
  }
  <D.25059>:
  D.25076 = *var;
  return D.25076;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_marshal_find_in_cache (struct GHashTable * cache, void * key)
{
  _Bool D.25080;
  long int D.25081;
  long int D.25082;
  _Bool D.25087;
  long int D.25088;
  long int D.25089;
  struct MonoMethod * D.25092;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25078>; else goto <D.25079>;
    <D.25078>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25079>:
    D.25080 = ret != 0;
    D.25081 = (long int) D.25080;
    D.25082 = __builtin_expect (D.25081, 0);
    if (D.25082 != 0) goto <D.25083>; else goto <D.25084>;
    <D.25083>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2471, "ret == 0");
    <D.25084>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25085>; else goto <D.25086>;
    <D.25085>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25086>:
    D.25087 = ret != 0;
    D.25088 = (long int) D.25087;
    D.25089 = __builtin_expect (D.25088, 0);
    if (D.25089 != 0) goto <D.25090>; else goto <D.25091>;
    <D.25090>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2473, "ret == 0");
    <D.25091>:
  }
  D.25092 = res;
  return D.25092;
}


mono_mb_create_and_cache (struct GHashTable * cache, void * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  _Bool D.25096;
  long int D.25097;
  long int D.25098;
  _Bool D.25103;
  long int D.25104;
  long int D.25105;
  _Bool D.25112;
  long int D.25113;
  long int D.25114;
  _Bool D.25121;
  long int D.25122;
  long int D.25123;
  _Bool D.25129;
  long int D.25130;
  long int D.25131;
  struct MonoMethod * D.25134;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25094>; else goto <D.25095>;
    <D.25094>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25095>:
    D.25096 = ret != 0;
    D.25097 = (long int) D.25096;
    D.25098 = __builtin_expect (D.25097, 0);
    if (D.25098 != 0) goto <D.25099>; else goto <D.25100>;
    <D.25099>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2485, "ret == 0");
    <D.25100>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25101>; else goto <D.25102>;
    <D.25101>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25102>:
    D.25103 = ret != 0;
    D.25104 = (long int) D.25103;
    D.25105 = __builtin_expect (D.25104, 0);
    if (D.25105 != 0) goto <D.25106>; else goto <D.25107>;
    <D.25106>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2487, "ret == 0");
    <D.25107>:
  }
  if (res == 0B) goto <D.25108>; else goto <D.25109>;
  <D.25108>:
  {
    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.25110>; else goto <D.25111>;
      <D.25110>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.25111>:
      D.25112 = ret != 0;
      D.25113 = (long int) D.25112;
      D.25114 = __builtin_expect (D.25113, 0);
      if (D.25114 != 0) goto <D.25115>; else goto <D.25116>;
      <D.25115>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2491, "ret == 0");
      <D.25116>:
    }
    res = monoeg_g_hash_table_lookup (cache, key);
    if (res == 0B) goto <D.25117>; else goto <D.25118>;
    <D.25117>:
    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.25119>; else goto <D.25120>;
      <D.25119>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25120>:
      D.25121 = ret != 0;
      D.25122 = (long int) D.25121;
      D.25123 = __builtin_expect (D.25122, 0);
      if (D.25123 != 0) goto <D.25124>; else goto <D.25125>;
      <D.25124>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2497, "ret == 0");
      <D.25125>:
    }
    goto <D.25126>;
    <D.25118>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25127>; else goto <D.25128>;
      <D.25127>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25128>:
      D.25129 = ret != 0;
      D.25130 = (long int) D.25129;
      D.25131 = __builtin_expect (D.25130, 0);
      if (D.25131 != 0) goto <D.25132>; else goto <D.25133>;
      <D.25132>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2499, "ret == 0");
      <D.25133>:
    }
    mono_free_method (newm);
    <D.25126>:
  }
  <D.25109>:
  D.25134 = res;
  return D.25134;
}


mono_marshal_method_from_wrapper (struct MonoMethod * wrapper)
{
  <unnamed-unsigned:5> D.25136;
  _Bool D.25137;
  _Bool D.25138;
  _Bool D.25139;
  struct MonoMethod * D.25142;
  unsigned char D.25145;
  unsigned char D.25146;
  struct MonoGenericContext * D.25149;
  <unnamed type> D.25152;
  _Bool D.25153;
  _Bool D.25154;
  _Bool D.25155;
  <unnamed type> D.25159;
  unsigned int D.25160;
  void * res;
  int wrapper_type;
  struct WrapperInfo * info;

  D.25136 = wrapper->wrapper_type;
  wrapper_type = (int) D.25136;
  D.25137 = wrapper_type == 0;
  D.25138 = wrapper_type == 17;
  D.25139 = D.25137 | D.25138;
  if (D.25139 != 0) goto <D.25140>; else goto <D.25141>;
  <D.25140>:
  D.25142 = wrapper;
  return D.25142;
  <D.25141>:
  switch (wrapper_type) <default: <D.21647>, case 4: <D.21646>, case 6: <D.21645>, case 8: <D.21640>, case 9: <D.21641>, case 10: <D.21642>, case 16: <D.21643>, case 22: <D.21644>>
  <D.21640>:
  <D.21641>:
  <D.21642>:
  <D.21643>:
  <D.21644>:
  res = mono_marshal_get_wrapper_info (wrapper);
  if (res == 0B) goto <D.25143>; else goto <D.25144>;
  <D.25143>:
  D.25142 = wrapper;
  return D.25142;
  <D.25144>:
  D.25145 = BIT_FIELD_REF <*wrapper, 8, 168>;
  D.25146 = D.25145 & 16;
  if (D.25146 != 0) goto <D.25147>; else goto <D.25148>;
  <D.25147>:
  D.25149 = mono_method_get_context (wrapper);
  D.25142 = mono_class_inflate_generic_method (res, D.25149);
  return D.25142;
  <D.25148>:
  D.25142 = res;
  return D.25142;
  <D.21645>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.25151>; else goto <D.25150>;
  <D.25151>:
  D.25152 = info->subtype;
  D.25153 = D.25152 == 0;
  D.25154 = D.25152 == 16;
  D.25155 = D.25153 | D.25154;
  if (D.25155 != 0) goto <D.25156>; else goto <D.25150>;
  <D.25156>:
  D.25142 = info->d.managed_to_native.method;
  return D.25142;
  <D.25150>:
  D.25142 = 0B;
  return D.25142;
  <D.21646>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.25158>; else goto <D.25157>;
  <D.25158>:
  D.25159 = info->subtype;
  D.25160 = D.25159 + 4294967283;
  if (D.25160 <= 1) goto <D.25161>; else goto <D.25157>;
  <D.25161>:
  D.25142 = info->d.runtime_invoke.method;
  return D.25142;
  <D.25157>:
  D.25142 = 0B;
  return D.25142;
  <D.21647>:
  D.25142 = 0B;
  return D.25142;
}


mono_marshal_get_wrapper_info (struct MonoMethod * wrapper)
{
  unsigned char D.25163;
  unsigned char D.25164;
  _Bool D.25165;
  long int D.25166;
  long int D.25167;
  void * D.25170;

  D.25163 = BIT_FIELD_REF <*wrapper, 8, 160>;
  D.25164 = D.25163 & 124;
  D.25165 = D.25164 == 0;
  D.25166 = (long int) D.25165;
  D.25167 = __builtin_expect (D.25166, 0);
  if (D.25167 != 0) goto <D.25168>; else goto <D.25169>;
  <D.25168>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2634, "wrapper->wrapper_type");
  <D.25169>:
  D.25170 = mono_method_get_wrapper_data (wrapper, 1);
  return D.25170;
}


mono_marshal_set_wrapper_info (struct MonoMethod * method, void * data)
{
  unsigned char D.25172;
  unsigned char D.25173;
  _Bool D.25174;
  _Bool D.25175;
  _Bool D.25176;
  void * * D.25179;
  void * * datav;

  D.25172 = BIT_FIELD_REF <*method, 8, 160>;
  D.25173 = D.25172 & 124;
  D.25174 = D.25173 == 0;
  D.25175 = D.25173 == 68;
  D.25176 = D.25174 | D.25175;
  if (D.25176 != 0) goto <D.25177>; else goto <D.25178>;
  <D.25177>:
  return;
  <D.25178>:
  datav = MEM[(struct MonoMethodWrapper *)method].method_data;
  D.25179 = datav + 4;
  *D.25179 = data;
}


mono_marshal_get_delegate_begin_invoke (struct MonoMethod * method)
{
  int iftmp.74;
  struct MonoClass * D.25186;
  struct MonoClass * D.25187;
  struct MonoClass * D.25188;
  int D.21729;
  int iftmp.75;
  int D.21728;
  const char[12] * D.25193;
  unsigned char D.25194;
  int D.25195;
  unsigned char D.25196;
  int D.25197;
  _Bool D.25198;
  _Bool D.25199;
  _Bool D.25200;
  const unsigned char * D.25203;
  unsigned char D.25204;
  int D.25205;
  const unsigned char * D.25206;
  unsigned char D.25207;
  int D.25208;
  _Bool D.25209;
  _Bool D.25210;
  const unsigned char * D.25213;
  unsigned char D.25214;
  int D.25215;
  const unsigned char * D.25216;
  unsigned char D.25217;
  int D.25218;
  _Bool D.25219;
  _Bool D.25220;
  const unsigned char * D.25223;
  unsigned char D.25224;
  int D.25225;
  const unsigned char * D.25226;
  unsigned char D.25227;
  int D.25228;
  const char * D.25230;
  _Bool D.25231;
  long int D.25232;
  long int D.25233;
  unsigned char D.25236;
  unsigned char D.25237;
  struct MonoImage * D.25242;
  struct GHashTable * * D.25243;
  struct MonoMethod * D.25246;
  struct GHashTable * * D.25248;
  unsigned char D.25251;
  unsigned char D.25252;
  _Bool D.25253;
  long int D.25254;
  long int D.25255;
  struct MonoClass * D.25261;
  unsigned int params_var.76;
  short unsigned int D.25265;
  int D.25266;
  int D.25267;
  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.25182>; else goto <D.25185>;
  <D.25185>:
  D.25186 = method->klass;
  D.25187 = D.25186->parent;
  D.25188 = mono_defaults.multicastdelegate_class;
  if (D.25187 != D.25188) goto <D.25182>; else goto <D.25189>;
  <D.25189>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.25193 = "BeginInvoke";
      D.25194 = MEM[(const unsigned char *)D.25193];
      D.25195 = (int) D.25194;
      D.25196 = *__s2;
      D.25197 = (int) D.25196;
      __result = D.25195 - D.25197;
      {
        D.25198 = __s2_len != 0;
        D.25199 = __result == 0;
        D.25200 = D.25198 & D.25199;
        if (D.25200 != 0) goto <D.25201>; else goto <D.25202>;
        <D.25201>:
        D.25203 = &MEM[(void *)"BeginInvoke" + 1B];
        D.25204 = *D.25203;
        D.25205 = (int) D.25204;
        D.25206 = __s2 + 1;
        D.25207 = *D.25206;
        D.25208 = (int) D.25207;
        __result = D.25205 - D.25208;
        D.25209 = __s2_len > 1;
        D.25199 = __result == 0;
        D.25210 = D.25209 & D.25199;
        if (D.25210 != 0) goto <D.25211>; else goto <D.25212>;
        <D.25211>:
        D.25213 = &MEM[(void *)"BeginInvoke" + 2B];
        D.25214 = *D.25213;
        D.25215 = (int) D.25214;
        D.25216 = __s2 + 2;
        D.25217 = *D.25216;
        D.25218 = (int) D.25217;
        __result = D.25215 - D.25218;
        D.25219 = __s2_len > 2;
        D.25199 = __result == 0;
        D.25220 = D.25219 & D.25199;
        if (D.25220 != 0) goto <D.25221>; else goto <D.25222>;
        <D.25221>:
        D.25223 = &MEM[(void *)"BeginInvoke" + 3B];
        D.25224 = *D.25223;
        D.25225 = (int) D.25224;
        D.25226 = __s2 + 3;
        D.25227 = *D.25226;
        D.25228 = (int) D.25227;
        __result = D.25225 - D.25228;
        <D.25222>:
        <D.25212>:
        <D.25202>:
      }
      D.21728 = __result;
    }
    iftmp.75 = -D.21728;
    goto <D.25229>;
    <D.25192>:
    D.25230 = method->name;
    iftmp.75 = __builtin_strcmp (D.25230, "BeginInvoke");
    <D.25229>:
    D.21729 = iftmp.75;
  }
  if (D.21729 != 0) goto <D.25182>; else goto <D.25183>;
  <D.25182>:
  iftmp.74 = 1;
  goto <D.25184>;
  <D.25183>:
  iftmp.74 = 0;
  <D.25184>:
  D.25231 = iftmp.74 != 0;
  D.25232 = (long int) D.25231;
  D.25233 = __builtin_expect (D.25232, 0);
  if (D.25233 != 0) goto <D.25234>; else goto <D.25235>;
  <D.25234>:
  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.25235>:
  D.25236 = BIT_FIELD_REF <*method, 8, 168>;
  D.25237 = D.25236 & 16;
  if (D.25237 != 0) goto <D.25238>; else goto <D.25239>;
  <D.25238>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.25239>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.25240>; else goto <D.25241>;
  <D.25240>:
  D.25186 = method->klass;
  D.25242 = D.25186->image;
  D.25243 = &D.25242->delegate_begin_invoke_generic_cache;
  cache = get_cache (D.25243, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.25244>; else goto <D.25245>;
  <D.25244>:
  D.25246 = res;
  return D.25246;
  <D.25245>:
  goto <D.25247>;
  <D.25241>:
  D.25186 = method->klass;
  D.25242 = D.25186->image;
  D.25248 = &D.25242->delegate_begin_invoke_cache;
  cache = get_cache (D.25248, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.25249>; else goto <D.25250>;
  <D.25249>:
  D.25246 = res;
  return D.25246;
  <D.25250>:
  <D.25247>:
  D.25251 = BIT_FIELD_REF <*sig, 8, 80>;
  D.25252 = D.25251 & 64;
  D.25253 = D.25252 == 0;
  D.25254 = (long int) D.25253;
  D.25255 = __builtin_expect (D.25254, 0);
  if (D.25255 != 0) goto <D.25256>; else goto <D.25257>;
  <D.25256>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2866, "sig->hasthis");
  <D.25257>:
  name = mono_signature_to_name (sig, "begin_invoke");
  if (ctx != 0B) goto <D.25258>; else goto <D.25259>;
  <D.25258>:
  D.25186 = method->klass;
  mb = mono_mb_new (D.25186, name, 2);
  goto <D.25260>;
  <D.25259>:
  D.25186 = method->klass;
  D.25242 = D.25186->image;
  D.25261 = get_wrapper_target_class (D.25242);
  mb = mono_mb_new (D.25261, name, 2);
  <D.25260>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.76 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.76);
  mono_mb_emit_icall (mb, mono_delegate_begin_invoke);
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.25263>; else goto <D.25264>;
  <D.25263>:
  {
    struct MonoMethod * def;

    D.25186 = method->klass;
    D.25265 = sig->param_count;
    D.25266 = (int) D.25265;
    D.25267 = D.25266 + 16;
    def = mono_mb_create_and_cache (cache, D.25186, mb, sig, D.25267);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.25268>;
  <D.25264>:
  D.25265 = sig->param_count;
  D.25266 = (int) D.25265;
  D.25267 = D.25266 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.25267);
  <D.25268>:
  mono_mb_free (mb);
  D.25246 = res;
  return D.25246;
}


check_generic_delegate_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def_method, struct MonoGenericContext * ctx)
{
  struct MonoClass * D.25270;
  struct MonoMethod * D.25273;
  struct MonoClass * D.25274;
  _Bool D.25279;
  long int D.25280;
  long int D.25281;
  _Bool D.25288;
  long int D.25289;
  long int D.25290;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;

  D.25270 = orig_method->klass;
  res = mono_marshal_find_in_cache (cache, D.25270);
  if (res != 0B) goto <D.25271>; else goto <D.25272>;
  <D.25271>:
  D.25273 = res;
  return D.25273;
  <D.25272>:
  D.25274 = def_method->klass;
  def = mono_marshal_find_in_cache (cache, D.25274);
  if (def != 0B) goto <D.25275>; else goto <D.25276>;
  <D.25275>:
  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.25277>; else goto <D.25278>;
    <D.25277>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25278>:
    D.25279 = ret != 0;
    D.25280 = (long int) D.25279;
    D.25281 = __builtin_expect (D.25280, 0);
    if (D.25281 != 0) goto <D.25282>; else goto <D.25283>;
    <D.25282>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2792, "ret == 0");
    <D.25283>:
  }
  D.25270 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.25270);
  if (res == 0B) goto <D.25284>; else goto <D.25285>;
  <D.25284>:
  D.25270 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.25270, inst, 0);
  res = inst;
  <D.25285>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25286>; else goto <D.25287>;
    <D.25286>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25287>:
    D.25288 = ret != 0;
    D.25289 = (long int) D.25288;
    D.25290 = __builtin_expect (D.25289, 0);
    if (D.25290 != 0) goto <D.25291>; else goto <D.25292>;
    <D.25291>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2798, "ret == 0");
    <D.25292>:
  }
  D.25273 = res;
  return D.25273;
  <D.25276>:
  D.25273 = 0B;
  return D.25273;
}


mono_signature_to_name (struct MonoMethodSignature * sig, const char * prefix)
{
  struct MonoType * D.25296;
  unsigned char D.25297;
  unsigned char D.25298;
  struct MonoType * D.25301;
  short unsigned int D.25302;
  int D.25303;
  char * D.25304;
  int i;
  char * result;
  struct GString * res;

  res = monoeg_g_string_new ("");
  if (prefix != 0B) goto <D.25294>; else goto <D.25295>;
  <D.25294>:
  monoeg_g_string_append (res, prefix);
  monoeg_g_string_append_c (res, 95);
  <D.25295>:
  D.25296 = sig->ret;
  mono_type_get_desc (res, D.25296, 0);
  D.25297 = BIT_FIELD_REF <*sig, 8, 80>;
  D.25298 = D.25297 & 64;
  if (D.25298 != 0) goto <D.25299>; else goto <D.25300>;
  <D.25299>:
  monoeg_g_string_append (res, "__this__");
  <D.25300>:
  i = 0;
  goto <D.21491>;
  <D.21490>:
  monoeg_g_string_append_c (res, 95);
  D.25301 = sig->params[i];
  mono_type_get_desc (res, D.25301, 0);
  i = i + 1;
  <D.21491>:
  D.25302 = sig->param_count;
  D.25303 = (int) D.25302;
  if (D.25303 > i) goto <D.21490>; else goto <D.21492>;
  <D.21492>:
  result = res->str;
  monoeg_g_string_free (res, 0);
  D.25304 = result;
  return D.25304;
}


get_wrapper_target_class (struct MonoImage * image)
{
  unsigned char D.25306;
  unsigned char D.25307;
  _Bool D.25311;
  long int D.25312;
  long int D.25313;
  struct MonoClass * D.25316;
  struct MonoClass * klass;

  D.25306 = BIT_FIELD_REF <*image, 8, 128>;
  D.25307 = D.25306 & 8;
  if (D.25307 != 0) goto <D.25308>; else goto <D.25309>;
  <D.25308>:
  klass = MEM[(struct MonoDynamicImage *)image].wrappers_type;
  goto <D.25310>;
  <D.25309>:
  klass = mono_class_get (image, 33554433);
  <D.25310>:
  D.25311 = klass == 0B;
  D.25312 = (long int) D.25311;
  D.25313 = __builtin_expect (D.25312, 0);
  if (D.25313 != 0) goto <D.25314>; else goto <D.25315>;
  <D.25314>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2695, "klass");
  <D.25315>:
  D.25316 = klass;
  return D.25316;
}


mono_mb_emit_save_args (struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, gboolean save_this)
{
  struct MonoClass * D.25318;
  struct MonoType * D.25319;
  short unsigned int D.25320;
  int D.25321;
  int D.25322;
  unsigned int D.25323;
  unsigned int D.25324;
  int D.25325;
  unsigned int params_var.77;
  unsigned int tmp_var.78;
  unsigned char D.25330;
  unsigned char D.25331;
  short unsigned int D.25336;
  <unnamed-unsigned:1> D.25337;
  int D.25338;
  int D.25339;
  unsigned int D.25340;
  int D.25341;
  int D.25344;
  int i;
  int params_var;
  int tmp_var;

  D.25318 = mono_defaults.int_class;
  D.25319 = &D.25318->byval_arg;
  params_var = mono_mb_add_local (mb, D.25319);
  D.25318 = mono_defaults.int_class;
  D.25319 = &D.25318->byval_arg;
  tmp_var = mono_mb_add_local (mb, D.25319);
  D.25320 = sig->param_count;
  D.25321 = (int) D.25320;
  D.25322 = D.25321 + 1;
  D.25323 = (unsigned int) D.25322;
  D.25324 = D.25323 * 4;
  D.25325 = (int) D.25324;
  mono_mb_emit_icon (mb, D.25325);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  params_var.77 = (unsigned int) params_var;
  mono_mb_emit_stloc (mb, params_var.77);
  params_var.77 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.77);
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_stloc (mb, tmp_var.78);
  if (save_this != 0) goto <D.25328>; else goto <D.25329>;
  <D.25328>:
  D.25330 = BIT_FIELD_REF <*sig, 8, 80>;
  D.25331 = D.25330 & 64;
  if (D.25331 != 0) goto <D.25332>; else goto <D.25333>;
  <D.25332>:
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.78);
  mono_mb_emit_ldarg_addr (mb, 0);
  mono_mb_emit_byte (mb, 223);
  D.25320 = sig->param_count;
  if (D.25320 != 0) goto <D.25334>; else goto <D.25335>;
  <D.25334>:
  D.25336 = (short unsigned int) tmp_var;
  mono_mb_emit_add_to_local (mb, D.25336, 4);
  <D.25335>:
  <D.25333>:
  <D.25329>:
  i = 0;
  goto <D.21481>;
  <D.21480>:
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.78);
  D.25337 = sig->hasthis;
  D.25338 = (int) D.25337;
  D.25339 = D.25338 + i;
  D.25340 = (unsigned int) D.25339;
  mono_mb_emit_ldarg_addr (mb, D.25340);
  mono_mb_emit_byte (mb, 223);
  D.25320 = sig->param_count;
  D.25321 = (int) D.25320;
  D.25341 = D.25321 + -1;
  if (D.25341 > i) goto <D.25342>; else goto <D.25343>;
  <D.25342>:
  D.25336 = (short unsigned int) tmp_var;
  mono_mb_emit_add_to_local (mb, D.25336, 4);
  <D.25343>:
  i = i + 1;
  <D.21481>:
  D.25320 = sig->param_count;
  D.25321 = (int) D.25320;
  if (D.25321 > i) goto <D.21480>; else goto <D.21482>;
  <D.21482>:
  D.25344 = params_var;
  return D.25344;
}


cache_generic_delegate_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx)
{
  _Bool D.25348;
  long int D.25349;
  long int D.25350;
  struct MonoClass * D.25353;
  _Bool D.25358;
  long int D.25359;
  long int D.25360;
  struct MonoMethod * D.25363;
  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.25346>; else goto <D.25347>;
    <D.25346>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25347>:
    D.25348 = ret != 0;
    D.25349 = (long int) D.25348;
    D.25350 = __builtin_expect (D.25349, 0);
    if (D.25350 != 0) goto <D.25351>; else goto <D.25352>;
    <D.25351>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2814, "ret == 0");
    <D.25352>:
  }
  D.25353 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.25353);
  if (res == 0B) goto <D.25354>; else goto <D.25355>;
  <D.25354>:
  D.25353 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.25353, inst, 0);
  res = inst;
  <D.25355>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25356>; else goto <D.25357>;
    <D.25356>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25357>:
    D.25358 = ret != 0;
    D.25359 = (long int) D.25358;
    D.25360 = __builtin_expect (D.25359, 0);
    if (D.25360 != 0) goto <D.25361>; else goto <D.25362>;
    <D.25361>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2820, "ret == 0");
    <D.25362>:
  }
  D.25363 = res;
  return D.25363;
}


mono_marshal_get_delegate_end_invoke (struct MonoMethod * method)
{
  int iftmp.79;
  struct MonoClass * D.25370;
  struct MonoClass * D.25371;
  struct MonoClass * D.25372;
  int D.21800;
  int iftmp.80;
  int D.21799;
  const char[10] * D.25377;
  unsigned char D.25378;
  int D.25379;
  unsigned char D.25380;
  int D.25381;
  _Bool D.25382;
  _Bool D.25383;
  _Bool D.25384;
  const unsigned char * D.25387;
  unsigned char D.25388;
  int D.25389;
  const unsigned char * D.25390;
  unsigned char D.25391;
  int D.25392;
  _Bool D.25393;
  _Bool D.25394;
  const unsigned char * D.25397;
  unsigned char D.25398;
  int D.25399;
  const unsigned char * D.25400;
  unsigned char D.25401;
  int D.25402;
  _Bool D.25403;
  _Bool D.25404;
  const unsigned char * D.25407;
  unsigned char D.25408;
  int D.25409;
  const unsigned char * D.25410;
  unsigned char D.25411;
  int D.25412;
  const char * D.25414;
  _Bool D.25415;
  long int D.25416;
  long int D.25417;
  unsigned char D.25420;
  unsigned char D.25421;
  struct MonoImage * D.25426;
  struct GHashTable * * D.25427;
  struct MonoMethod * D.25430;
  struct GHashTable * * D.25432;
  unsigned char D.25435;
  unsigned char D.25436;
  _Bool D.25437;
  long int D.25438;
  long int D.25439;
  struct MonoClass * D.25445;
  unsigned int params_var.81;
  struct MonoType * D.25447;
  unsigned char D.25448;
  short unsigned int D.25454;
  int D.25455;
  int D.25456;
  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.25366>; else goto <D.25369>;
  <D.25369>:
  D.25370 = method->klass;
  D.25371 = D.25370->parent;
  D.25372 = mono_defaults.multicastdelegate_class;
  if (D.25371 != D.25372) goto <D.25366>; else goto <D.25373>;
  <D.25373>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.25377 = "EndInvoke";
      D.25378 = MEM[(const unsigned char *)D.25377];
      D.25379 = (int) D.25378;
      D.25380 = *__s2;
      D.25381 = (int) D.25380;
      __result = D.25379 - D.25381;
      {
        D.25382 = __s2_len != 0;
        D.25383 = __result == 0;
        D.25384 = D.25382 & D.25383;
        if (D.25384 != 0) goto <D.25385>; else goto <D.25386>;
        <D.25385>:
        D.25387 = &MEM[(void *)"EndInvoke" + 1B];
        D.25388 = *D.25387;
        D.25389 = (int) D.25388;
        D.25390 = __s2 + 1;
        D.25391 = *D.25390;
        D.25392 = (int) D.25391;
        __result = D.25389 - D.25392;
        D.25393 = __s2_len > 1;
        D.25383 = __result == 0;
        D.25394 = D.25393 & D.25383;
        if (D.25394 != 0) goto <D.25395>; else goto <D.25396>;
        <D.25395>:
        D.25397 = &MEM[(void *)"EndInvoke" + 2B];
        D.25398 = *D.25397;
        D.25399 = (int) D.25398;
        D.25400 = __s2 + 2;
        D.25401 = *D.25400;
        D.25402 = (int) D.25401;
        __result = D.25399 - D.25402;
        D.25403 = __s2_len > 2;
        D.25383 = __result == 0;
        D.25404 = D.25403 & D.25383;
        if (D.25404 != 0) goto <D.25405>; else goto <D.25406>;
        <D.25405>:
        D.25407 = &MEM[(void *)"EndInvoke" + 3B];
        D.25408 = *D.25407;
        D.25409 = (int) D.25408;
        D.25410 = __s2 + 3;
        D.25411 = *D.25410;
        D.25412 = (int) D.25411;
        __result = D.25409 - D.25412;
        <D.25406>:
        <D.25396>:
        <D.25386>:
      }
      D.21799 = __result;
    }
    iftmp.80 = -D.21799;
    goto <D.25413>;
    <D.25376>:
    D.25414 = method->name;
    iftmp.80 = __builtin_strcmp (D.25414, "EndInvoke");
    <D.25413>:
    D.21800 = iftmp.80;
  }
  if (D.21800 != 0) goto <D.25366>; else goto <D.25367>;
  <D.25366>:
  iftmp.79 = 1;
  goto <D.25368>;
  <D.25367>:
  iftmp.79 = 0;
  <D.25368>:
  D.25415 = iftmp.79 != 0;
  D.25416 = (long int) D.25415;
  D.25417 = __builtin_expect (D.25416, 0);
  if (D.25417 != 0) goto <D.25418>; else goto <D.25419>;
  <D.25418>:
  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.25419>:
  D.25420 = BIT_FIELD_REF <*method, 8, 168>;
  D.25421 = D.25420 & 16;
  if (D.25421 != 0) goto <D.25422>; else goto <D.25423>;
  <D.25422>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.25423>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.25424>; else goto <D.25425>;
  <D.25424>:
  D.25370 = method->klass;
  D.25426 = D.25370->image;
  D.25427 = &D.25426->delegate_end_invoke_generic_cache;
  cache = get_cache (D.25427, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.25428>; else goto <D.25429>;
  <D.25428>:
  D.25430 = res;
  return D.25430;
  <D.25429>:
  goto <D.25431>;
  <D.25425>:
  D.25370 = method->klass;
  D.25426 = D.25370->image;
  D.25432 = &D.25426->delegate_end_invoke_cache;
  cache = get_cache (D.25432, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.25433>; else goto <D.25434>;
  <D.25433>:
  D.25430 = res;
  return D.25430;
  <D.25434>:
  <D.25431>:
  D.25435 = BIT_FIELD_REF <*sig, 8, 80>;
  D.25436 = D.25435 & 64;
  D.25437 = D.25436 == 0;
  D.25438 = (long int) D.25437;
  D.25439 = __builtin_expect (D.25438, 0);
  if (D.25439 != 0) goto <D.25440>; else goto <D.25441>;
  <D.25440>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3076, "sig->hasthis");
  <D.25441>:
  name = mono_signature_to_name (sig, "end_invoke");
  if (ctx != 0B) goto <D.25442>; else goto <D.25443>;
  <D.25442>:
  D.25370 = method->klass;
  mb = mono_mb_new (D.25370, name, 3);
  goto <D.25444>;
  <D.25443>:
  D.25370 = method->klass;
  D.25426 = D.25370->image;
  D.25445 = get_wrapper_target_class (D.25426);
  mb = mono_mb_new (D.25445, name, 3);
  <D.25444>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.81 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.81);
  mono_mb_emit_icall (mb, mono_delegate_end_invoke);
  D.25447 = sig->ret;
  D.25448 = D.25447->type;
  if (D.25448 == 1) goto <D.25449>; else goto <D.25450>;
  <D.25449>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.25451>;
  <D.25450>:
  D.25447 = sig->ret;
  mono_mb_emit_restore_result (mb, D.25447);
  <D.25451>:
  if (ctx != 0B) goto <D.25452>; else goto <D.25453>;
  <D.25452>:
  {
    struct MonoMethod * def;

    D.25370 = method->klass;
    D.25454 = sig->param_count;
    D.25455 = (int) D.25454;
    D.25456 = D.25455 + 16;
    def = mono_mb_create_and_cache (cache, D.25370, mb, sig, D.25456);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.25457>;
  <D.25453>:
  D.25454 = sig->param_count;
  D.25455 = (int) D.25454;
  D.25456 = D.25455 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.25456);
  <D.25457>:
  mono_mb_free (mb);
  D.25430 = res;
  return D.25430;
}


mono_mb_emit_restore_result (struct MonoMethodBuilder * mb, struct MonoType * return_type)
{
  unsigned char D.25459;
  unsigned char D.25460;
  struct MonoClass * D.25463;
  unsigned char D.25464;
  int D.25465;
  struct MonoClass * D.25466;
  unsigned int D.25467;
  unsigned char D.25468;
  int D.25469;
  unsigned char D.25471;
  int D.25472;
  struct MonoType * t;

  t = mono_type_get_underlying_type (return_type);
  D.25459 = BIT_FIELD_REF <*return_type, 8, 56>;
  D.25460 = D.25459 & 64;
  if (D.25460 != 0) goto <D.25461>; else goto <D.25462>;
  <D.25461>:
  D.25463 = mono_defaults.int_class;
  return_type = &D.25463->byval_arg;
  <D.25462>:
  D.25464 = t->type;
  D.25465 = (int) D.25464;
  switch (D.25465) <default: <D.21780>, case 1: <D.21752>, case 2: <D.21761>, case 3: <D.21764>, case 4: <D.21762>, case 5: <D.21760>, case 6: <D.21765>, case 7: <D.21763>, case 8: <D.21768>, case 9: <D.21769>, case 10: <D.21771>, case 11: <D.21770>, case 12: <D.21772>, case 13: <D.21773>, case 14: <D.21754>, case 15: <D.21753>, case 17: <D.21775>, case 18: <D.21755>, case 19: <D.21777>, case 20: <D.21757>, case 21: <D.21774>, case 24: <D.21766>, case 25: <D.21767>, case 28: <D.21756>, case 29: <D.21758>, case 30: <D.21778>>
  <D.21752>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2981);
  <D.21753>:
  <D.21754>:
  <D.21755>:
  <D.21756>:
  <D.21757>:
  <D.21758>:
  goto <D.21759>;
  <D.21760>:
  <D.21761>:
  <D.21762>:
  <D.21763>:
  <D.21764>:
  <D.21765>:
  <D.21766>:
  <D.21767>:
  <D.21768>:
  <D.21769>:
  <D.21770>:
  <D.21771>:
  <D.21772>:
  <D.21773>:
  D.25466 = mono_class_from_mono_type (return_type);
  mono_mb_emit_op (mb, 121, D.25466);
  D.25467 = mono_type_to_ldind (return_type);
  D.25468 = (unsigned char) D.25467;
  mono_mb_emit_byte (mb, D.25468);
  goto <D.21759>;
  <D.21774>:
  D.25469 = mono_type_generic_inst_is_valuetype (t);
  if (D.25469 == 0) goto <D.21759>; else goto <D.25470>;
  <D.25470>:
  <D.21775>:
  {
    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.21759>;
  }
  <D.21777>:
  <D.21778>:
  {
    struct MonoClass * klass;

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


mono_marshal_get_remoting_invoke (struct MonoMethod * method)
{
  _Bool D.25474;
  long int D.25475;
  long int D.25476;
  unsigned char D.25479;
  unsigned char D.25480;
  _Bool D.25481;
  _Bool D.25482;
  _Bool D.25483;
  struct MonoMethod * D.25486;
  struct MonoClass * D.25489;
  unsigned char D.25490;
  unsigned char D.25491;
  struct MonoClass * D.25493;
  struct MonoDomain * D.25494;
  _Bool D.25495;
  long int D.25496;
  long int D.25497;
  unsigned char D.25500;
  unsigned char D.25501;
  unsigned char D.25504;
  unsigned char D.25505;
  const char * D.25510;
  struct MonoMethod * D.25511;
  unsigned int params_var.82;
  struct MonoType * D.25513;
  unsigned char D.25514;
  short unsigned int D.25518;
  int D.25519;
  int D.25520;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int params_var;

  D.25474 = method == 0B;
  D.25475 = (long int) D.25474;
  D.25476 = __builtin_expect (D.25475, 0);
  if (D.25476 != 0) goto <D.25477>; else goto <D.25478>;
  <D.25477>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3177, "method");
  <D.25478>:
  D.25479 = BIT_FIELD_REF <*method, 8, 160>;
  D.25480 = D.25479 & 124;
  D.25481 = D.25480 == 32;
  D.25482 = D.25480 == 40;
  D.25483 = D.25481 | D.25482;
  if (D.25483 != 0) goto <D.25484>; else goto <D.25485>;
  <D.25484>:
  D.25486 = method;
  return D.25486;
  <D.25485>:
  D.25489 = method->klass;
  D.25490 = BIT_FIELD_REF <*D.25489, 8, 184>;
  D.25491 = D.25490 & 64;
  if (D.25491 != 0) goto <D.25487>; else goto <D.25492>;
  <D.25492>:
  D.25489 = method->klass;
  D.25493 = mono_class_get_com_object_class ();
  if (D.25489 == D.25493) goto <D.25487>; else goto <D.25488>;
  <D.25487>:
  {
    struct MonoVTable * vtable;

    D.25494 = mono_domain_get ();
    D.25489 = method->klass;
    vtable = mono_class_vtable (D.25494, D.25489);
    D.25495 = vtable == 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", 3186, "vtable");
    <D.25499>:
    D.25500 = BIT_FIELD_REF <*vtable, 8, 184>;
    D.25501 = D.25500 & 1;
    if (D.25501 == 0) goto <D.25502>; else goto <D.25503>;
    <D.25502>:
    D.25486 = mono_cominterop_get_invoke (method);
    return D.25486;
    <D.25503>:
  }
  <D.25488>:
  sig = mono_signature_no_pinvoke (method);
  D.25504 = BIT_FIELD_REF <*sig, 8, 80>;
  D.25505 = D.25504 & 64;
  if (D.25505 == 0) goto <D.25506>; else goto <D.25507>;
  <D.25506>:
  D.25486 = method;
  return D.25486;
  <D.25507>:
  res = mono_marshal_remoting_find_in_cache (method, 8);
  if (res != 0B) goto <D.25508>; else goto <D.25509>;
  <D.25508>:
  D.25486 = res;
  return D.25486;
  <D.25509>:
  D.25489 = method->klass;
  D.25510 = method->name;
  mb = mono_mb_new (D.25489, D.25510, 8);
  D.25511 = mb->method;
  D.25511->save_lmf = 1;
  params_var = mono_mb_emit_save_args (mb, sig, 1);
  mono_mb_emit_ptr (mb, method);
  params_var.82 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.82);
  mono_mb_emit_icall (mb, mono_remoting_wrapper);
  emit_thread_interrupt_checkpoint (mb);
  D.25513 = sig->ret;
  D.25514 = D.25513->type;
  if (D.25514 == 1) goto <D.25515>; else goto <D.25516>;
  <D.25515>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.25517>;
  <D.25516>:
  D.25513 = sig->ret;
  mono_mb_emit_restore_result (mb, D.25513);
  <D.25517>:
  D.25518 = sig->param_count;
  D.25519 = (int) D.25518;
  D.25520 = D.25519 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.25520);
  mono_mb_free (mb);
  D.25486 = res;
  return D.25486;
}


mono_marshal_remoting_find_in_cache (struct MonoMethod * method, int wrapper_type)
{
  _Bool D.25524;
  long int D.25525;
  long int D.25526;
  struct MonoClass * D.25529;
  struct MonoImage * D.25530;
  struct GHashTable * D.25531;
  _Bool D.25540;
  long int D.25541;
  long int D.25542;
  struct MonoMethod * D.25545;
  struct MonoMethod * res;
  struct MonoRemotingMethods * wrps;

  res = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25522>; else goto <D.25523>;
    <D.25522>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25523>:
    D.25524 = ret != 0;
    D.25525 = (long int) D.25524;
    D.25526 = __builtin_expect (D.25525, 0);
    if (D.25526 != 0) goto <D.25527>; else goto <D.25528>;
    <D.25527>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2514, "ret == 0");
    <D.25528>:
  }
  D.25529 = method->klass;
  D.25530 = D.25529->image;
  D.25531 = D.25530->remoting_invoke_cache;
  if (D.25531 != 0B) goto <D.25532>; else goto <D.25533>;
  <D.25532>:
  D.25529 = method->klass;
  D.25530 = D.25529->image;
  D.25531 = D.25530->remoting_invoke_cache;
  wrps = monoeg_g_hash_table_lookup (D.25531, method);
  goto <D.25534>;
  <D.25533>:
  wrps = 0B;
  <D.25534>:
  if (wrps != 0B) goto <D.25535>; else goto <D.25536>;
  <D.25535>:
  switch (wrapper_type) <default: <D.25537>, case 8: <D.21607>, case 9: <D.21609>, case 10: <D.21610>, case 11: <D.21611>>
  <D.21607>:
  res = wrps->invoke;
  goto <D.21608>;
  <D.21609>:
  res = wrps->invoke_with_check;
  goto <D.21608>;
  <D.21610>:
  res = wrps->xdomain_invoke;
  goto <D.21608>;
  <D.21611>:
  res = wrps->xdomain_dispatch;
  goto <D.21608>;
  <D.25537>:
  <D.21608>:
  <D.25536>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25538>; else goto <D.25539>;
    <D.25538>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25539>:
    D.25540 = ret != 0;
    D.25541 = (long int) D.25540;
    D.25542 = __builtin_expect (D.25541, 0);
    if (D.25542 != 0) goto <D.25543>; else goto <D.25544>;
    <D.25543>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2533, "ret == 0");
    <D.25544>:
  }
  D.25545 = res;
  return D.25545;
}


mono_remoting_mb_create_and_cache (struct MonoMethod * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  struct MonoClass * D.25547;
  struct MonoImage * D.25548;
  struct GHashTable * * D.25549;
  _Bool D.25552;
  long int D.25553;
  long int D.25554;
  struct MonoMethod * D.25559;
  <unnamed-unsigned:5> D.25560;
  int D.25561;
  _Bool D.25564;
  long int D.25565;
  long int D.25566;
  struct MonoMethod * D.25569;
  _Bool D.25574;
  long int D.25575;
  long int D.25576;
  _Bool D.25583;
  long int D.25584;
  long int D.25585;
  _Bool D.25591;
  long int D.25592;
  long int D.25593;
  struct MonoMethod * D.25596;
  struct MonoMethod * * res;
  struct MonoRemotingMethods * wrps;
  struct GHashTable * cache;

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

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25550>; else goto <D.25551>;
    <D.25550>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25551>:
    D.25552 = ret != 0;
    D.25553 = (long int) D.25552;
    D.25554 = __builtin_expect (D.25553, 0);
    if (D.25554 != 0) goto <D.25555>; else goto <D.25556>;
    <D.25555>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2546, "ret == 0");
    <D.25556>:
  }
  wrps = monoeg_g_hash_table_lookup (cache, key);
  if (wrps == 0B) goto <D.25557>; else goto <D.25558>;
  <D.25557>:
  wrps = monoeg_malloc0 (16);
  monoeg_g_hash_table_insert_replace (cache, key, wrps, 0);
  <D.25558>:
  D.25559 = mb->method;
  D.25560 = D.25559->wrapper_type;
  D.25561 = (int) D.25560;
  switch (D.25561) <default: <D.21628>, case 8: <D.21623>, case 9: <D.21625>, case 10: <D.21626>, case 11: <D.21627>>
  <D.21623>:
  res = &wrps->invoke;
  goto <D.21624>;
  <D.21625>:
  res = &wrps->invoke_with_check;
  goto <D.21624>;
  <D.21626>:
  res = &wrps->xdomain_invoke;
  goto <D.21624>;
  <D.21627>:
  res = &wrps->xdomain_dispatch;
  goto <D.21624>;
  <D.21628>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2558);
  <D.21624>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25562>; else goto <D.25563>;
    <D.25562>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25563>:
    D.25564 = ret != 0;
    D.25565 = (long int) D.25564;
    D.25566 = __builtin_expect (D.25565, 0);
    if (D.25566 != 0) goto <D.25567>; else goto <D.25568>;
    <D.25567>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2560, "ret == 0");
    <D.25568>:
  }
  D.25569 = *res;
  if (D.25569 == 0B) goto <D.25570>; else goto <D.25571>;
  <D.25570>:
  {
    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.25572>; else goto <D.25573>;
      <D.25572>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.25573>:
      D.25574 = ret != 0;
      D.25575 = (long int) D.25574;
      D.25576 = __builtin_expect (D.25575, 0);
      if (D.25576 != 0) goto <D.25577>; else goto <D.25578>;
      <D.25577>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2566, "ret == 0");
      <D.25578>:
    }
    D.25569 = *res;
    if (D.25569 == 0B) goto <D.25579>; else goto <D.25580>;
    <D.25579>:
    *res = newm;
    D.25569 = *res;
    mono_marshal_set_wrapper_info (D.25569, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25581>; else goto <D.25582>;
      <D.25581>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25582>:
      D.25583 = ret != 0;
      D.25584 = (long int) D.25583;
      D.25585 = __builtin_expect (D.25584, 0);
      if (D.25585 != 0) goto <D.25586>; else goto <D.25587>;
      <D.25586>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2570, "ret == 0");
      <D.25587>:
    }
    goto <D.25588>;
    <D.25580>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25589>; else goto <D.25590>;
      <D.25589>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25590>:
      D.25591 = ret != 0;
      D.25592 = (long int) D.25591;
      D.25593 = __builtin_expect (D.25592, 0);
      if (D.25593 != 0) goto <D.25594>; else goto <D.25595>;
      <D.25594>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2572, "ret == 0");
      <D.25595>:
    }
    mono_free_method (newm);
    <D.25588>:
  }
  <D.25571>:
  D.25596 = *res;
  return D.25596;
}


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.25598;
  _Bool D.25603;
  long int D.25604;
  long int D.25605;
  _Bool D.25612;
  long int D.25613;
  long int D.25614;
  struct GHashTable * D.25617;

  D.25598 = *var;
  if (D.25598 == 0B) goto <D.25599>; else goto <D.25600>;
  <D.25599>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25601>; else goto <D.25602>;
    <D.25601>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25602>:
    D.25603 = ret != 0;
    D.25604 = (long int) D.25603;
    D.25605 = __builtin_expect (D.25604, 0);
    if (D.25605 != 0) goto <D.25606>; else goto <D.25607>;
    <D.25606>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2448, "ret == 0");
    <D.25607>:
  }
  D.25598 = *var;
  if (D.25598 == 0B) goto <D.25608>; else goto <D.25609>;
  <D.25608>:
  {
    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.25609>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25610>; else goto <D.25611>;
    <D.25610>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25611>:
    D.25612 = ret != 0;
    D.25613 = (long int) D.25612;
    D.25614 = __builtin_expect (D.25613, 0);
    if (D.25614 != 0) goto <D.25615>; else goto <D.25616>;
    <D.25615>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2455, "ret == 0");
    <D.25616>:
  }
  <D.25600>:
  D.25617 = *var;
  return D.25617;
}


mono_marshal_xdomain_copy_value (struct MonoObject * val)
{
  struct MonoObject * D.25621;
  struct MonoVTable * D.25622;
  struct MonoClass * D.25623;
  unsigned char D.25624;
  int D.25625;
  void * D.25626;
  mono_unichar2 * D.25627;
  int D.25628;
  struct MonoClass * D.25629;
  struct MonoType * D.25630;
  unsigned int D.25635;
  unsigned int i.83;
  char * D.25637;
  struct MonoObject * D.25638;
  struct MonoClass * D.25640;
  struct MonoString * * D.25643;
  struct MonoString * D.25644;
  mono_unichar2 * D.25645;
  int D.25646;
  struct MonoString * D.25647;
  int D.25648;
  struct MonoDomain * domain;

  if (val == 0B) goto <D.25619>; else goto <D.25620>;
  <D.25619>:
  D.25621 = 0B;
  return D.25621;
  <D.25620>:
  domain = mono_domain_get ();
  D.25622 = val->vtable;
  D.25623 = D.25622->klass;
  D.25624 = D.25623->byval_arg.type;
  D.25625 = (int) D.25624;
  switch (D.25625) <default: <D.25639>, case 1: <D.21852>, case 2: <D.21855>, case 3: <D.21858>, case 4: <D.21854>, case 5: <D.21853>, case 6: <D.21857>, case 7: <D.21856>, case 8: <D.21860>, case 9: <D.21859>, case 10: <D.21861>, case 11: <D.21862>, case 12: <D.21863>, case 13: <D.21864>, case 14: <D.21865>, case 20: <D.21867>, case 29: <D.21868>>
  <D.21852>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3283);
  <D.21853>:
  <D.21854>:
  <D.21855>:
  <D.21856>:
  <D.21857>:
  <D.21858>:
  <D.21859>:
  <D.21860>:
  <D.21861>:
  <D.21862>:
  <D.21863>:
  <D.21864>:
  D.25622 = val->vtable;
  D.25623 = D.25622->klass;
  D.25626 = val + 8;
  D.25621 = mono_value_box (domain, D.25623, D.25626);
  return D.25621;
  <D.21865>:
  {
    struct MonoString * str;

    str = val;
    D.25627 = mono_string_chars (str);
    D.25628 = mono_string_length (str);
    D.25621 = mono_string_new_utf16 (domain, D.25627, D.25628);
    return D.25621;
  }
  <D.21867>:
  <D.21868>:
  {
    struct MonoArray * acopy;
    MonoXDomainMarshalType mt;

    D.25622 = val->vtable;
    D.25623 = D.25622->klass;
    D.25629 = D.25623->element_class;
    D.25630 = &D.25629->byval_arg;
    mt = mono_get_xdomain_marshal_type (D.25630);
    if (mt == 3) goto <D.25631>; else goto <D.25632>;
    <D.25631>:
    D.25621 = 0B;
    return D.25621;
    <D.25632>:
    acopy = mono_array_clone_in_domain (domain, val);
    if (mt == 1) goto <D.25633>; else goto <D.25634>;
    <D.25633>:
    {
      int i;
      int len;

      D.25635 = mono_array_length (acopy);
      len = (int) D.25635;
      i = 0;
      goto <D.21876>;
      <D.21875>:
      {
        struct MonoObject * item;

        i.83 = (unsigned int) i;
        D.25637 = mono_array_addr_with_size (acopy, 4, i.83);
        item = MEM[(void * *)D.25637];
        {
          void * * __p;

          i.83 = (unsigned int) i;
          __p = mono_array_addr_with_size (acopy, 4, i.83);
          D.25638 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (acopy, __p, D.25638);
        }
      }
      i = i + 1;
      <D.21876>:
      if (i < len) goto <D.21875>; else goto <D.21877>;
      <D.21877>:
    }
    <D.25634>:
    D.25621 = acopy;
    return D.25621;
  }
  <D.25639>:
  D.25622 = val->vtable;
  D.25623 = D.25622->klass;
  D.25640 = mono_defaults.stringbuilder_class;
  if (D.25623 == D.25640) goto <D.25641>; else goto <D.25642>;
  <D.25641>:
  {
    struct MonoStringBuilder * oldsb;
    struct MonoStringBuilder * newsb;

    oldsb = val;
    D.25640 = mono_defaults.stringbuilder_class;
    newsb = mono_object_new (domain, D.25640);
    D.25643 = &newsb->str;
    D.25644 = oldsb->str;
    D.25645 = mono_string_chars (D.25644);
    D.25644 = oldsb->str;
    D.25646 = mono_string_length (D.25644);
    D.25647 = mono_string_new_utf16 (domain, D.25645, D.25646);
    mono_gc_wbarrier_set_field (newsb, D.25643, D.25647);
    D.25648 = oldsb->length;
    newsb->length = D.25648;
    newsb->max_capacity = 2147483647;
    D.25621 = newsb;
    return D.25621;
  }
  <D.25642>:
  D.25621 = 0B;
  return D.25621;
}


mono_marshal_get_xappdomain_invoke (struct MonoMethod * method)
{
  _Bool D.25650;
  long int D.25651;
  long int D.25652;
  unsigned char D.25655;
  unsigned char D.25656;
  _Bool D.25657;
  _Bool D.25658;
  _Bool D.25659;
  struct MonoMethod * D.25662;
  struct MonoMethodSignature * D.25663;
  unsigned char D.25664;
  unsigned char D.25665;
  int D.25668;
  struct MonoClass * D.25673;
  const char * D.25674;
  struct MonoMethod * D.25675;
  short unsigned int D.25676;
  unsigned int D.25677;
  unsigned int D.25678;
  <unnamed type> D.25679;
  short unsigned int D.25682;
  int D.25683;
  int D.25684;
  unsigned char D.25687;
  unsigned char D.25688;
  unsigned int i.84;
  unsigned int D.25695;
  int * D.25696;
  int D.25697;
  struct MonoType * D.25698;
  unsigned char D.25699;
  <unnamed type> D.25702;
  _Bool D.25703;
  struct MonoClass * D.25706;
  struct MonoType * D.25707;
  struct MonoClass * byte_array_class.85;
  struct MonoType * D.25709;
  struct MonoClass * D.25712;
  struct MonoType * D.25713;
  unsigned int loc_context.86;
  struct MonoMethod * method_needs_context_sink.87;
  unsigned int D.25716;
  unsigned int loc_real_proxy.88;
  unsigned int loc_domainid.89;
  struct MonoImage * D.25719;
  unsigned int D.25720;
  unsigned int pos.90;
  int D.25722;
  unsigned int D.25723;
  struct MonoMethod * D.25724;
  unsigned int pos_dispatch.91;
  int iftmp.92;
  _Bool D.25729;
  _Bool D.25730;
  _Bool D.25731;
  int D.25735;
  struct MonoType * D.25738;
  unsigned char D.25739;
  unsigned char D.25740;
  unsigned char D.25743;
  unsigned char D.25744;
  unsigned int loc_array.93;
  struct MonoMethod * method_rs_serialize.94;
  unsigned int loc_serialized_data.95;
  unsigned int loc_old_domainid.96;
  unsigned int loc_serialized_exc.97;
  struct MonoType * D.25758;
  unsigned int copy_local.98;
  struct MonoMethodSignature * D.25761;
  unsigned int loc_return.99;
  unsigned int D.25765;
  struct MonoMethod * method_rs_deserialize.100;
  struct MonoClass * D.25767;
  struct MonoMethod * method_exc_fixexc.101;
  unsigned int pos_noex.102;
  int j.103;
  int D.25774;
  unsigned int D.25775;
  struct MonoClass * D.25776;
  unsigned char D.25783;
  unsigned char D.25784;
  unsigned char D.25792;
  unsigned char D.25793;
  unsigned int D.25805;
  int D.25810;
  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.25650 = method == 0B;
  D.25651 = (long int) D.25650;
  D.25652 = __builtin_expect (D.25651, 0);
  if (D.25652 != 0) goto <D.25653>; else goto <D.25654>;
  <D.25653>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3744, "method");
  <D.25654>:
  D.25655 = BIT_FIELD_REF <*method, 8, 160>;
  D.25656 = D.25655 & 124;
  D.25657 = D.25656 == 32;
  D.25658 = D.25656 == 40;
  D.25659 = D.25657 | D.25658;
  if (D.25659 != 0) goto <D.25660>; else goto <D.25661>;
  <D.25660>:
  D.25662 = method;
  return D.25662;
  <D.25661>:
  D.25663 = mono_method_signature (method);
  D.25664 = BIT_FIELD_REF <*D.25663, 8, 80>;
  D.25665 = D.25664 & 64;
  if (D.25665 == 0) goto <D.25666>; else goto <D.25667>;
  <D.25666>:
  D.25662 = method;
  return D.25662;
  <D.25667>:
  D.25668 = mono_marshal_supports_fast_xdomain (method);
  if (D.25668 == 0) goto <D.25669>; else goto <D.25670>;
  <D.25669>:
  D.25662 = mono_marshal_get_remoting_invoke (method);
  return D.25662;
  <D.25670>:
  mono_remoting_marshal_init ();
  res = mono_marshal_remoting_find_in_cache (method, 10);
  if (res != 0B) goto <D.25671>; else goto <D.25672>;
  <D.25671>:
  D.25662 = res;
  return D.25662;
  <D.25672>:
  sig = mono_signature_no_pinvoke (method);
  D.25673 = method->klass;
  D.25674 = method->name;
  mb = mono_mb_new (D.25673, D.25674, 10);
  D.25675 = mb->method;
  D.25675->save_lmf = 1;
  D.25676 = sig->param_count;
  D.25677 = (unsigned int) D.25676;
  D.25678 = D.25677 * 4;
  marshal_types = __builtin_alloca (D.25678);
  complex_out_count = 0;
  complex_count = complex_out_count;
  i = 0;
  goto <D.22016>;
  <D.22015>:
  {
    struct MonoType * ptype;
    int mt;

    ptype = sig->params[i];
    D.25679 = mono_get_xdomain_marshal_type (ptype);
    mt = (int) D.25679;
    D.25682 = ptype->attrs;
    D.25683 = (int) D.25682;
    D.25684 = D.25683 & 2;
    if (D.25684 != 0) goto <D.25685>; else goto <D.25680>;
    <D.25685>:
    if (mt == 1) goto <D.25686>; else goto <D.25680>;
    <D.25686>:
    D.25687 = BIT_FIELD_REF <*ptype, 8, 56>;
    D.25688 = D.25687 & 64;
    if (D.25688 == 0) goto <D.25689>; else goto <D.25680>;
    <D.25689>:
    mt = 2;
    goto <D.25681>;
    <D.25680>:
    if (mt == 3) goto <D.25690>; else goto <D.25691>;
    <D.25690>:
    complex_count = complex_count + 1;
    D.25687 = BIT_FIELD_REF <*ptype, 8, 56>;
    D.25688 = D.25687 & 64;
    if (D.25688 != 0) goto <D.25692>; else goto <D.25693>;
    <D.25692>:
    complex_out_count = complex_out_count + 1;
    <D.25693>:
    <D.25691>:
    <D.25681>:
    i.84 = (unsigned int) i;
    D.25695 = i.84 * 4;
    D.25696 = marshal_types + D.25695;
    *D.25696 = mt;
  }
  i = i + 1;
  <D.22016>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22015>; else goto <D.22017>;
  <D.22017>:
  D.25698 = sig->ret;
  D.25699 = D.25698->type;
  if (D.25699 != 1) goto <D.25700>; else goto <D.25701>;
  <D.25700>:
  D.25698 = sig->ret;
  D.25702 = mono_get_xdomain_marshal_type (D.25698);
  ret_marshal_type = (int) D.25702;
  D.25698 = sig->ret;
  ret_class = mono_class_from_mono_type (D.25698);
  D.25703 = ret_marshal_type != 3;
  copy_return = (gboolean) D.25703;
  <D.25701>:
  if (complex_count > 0) goto <D.25704>; else goto <D.25705>;
  <D.25704>:
  D.25706 = mono_defaults.object_class;
  D.25707 = &D.25706->byval_arg;
  loc_array = mono_mb_add_local (mb, D.25707);
  <D.25705>:
  byte_array_class.85 = byte_array_class;
  D.25709 = &byte_array_class.85->byval_arg;
  loc_serialized_data = mono_mb_add_local (mb, D.25709);
  D.25706 = mono_defaults.object_class;
  D.25707 = &D.25706->byval_arg;
  loc_real_proxy = mono_mb_add_local (mb, D.25707);
  if (copy_return != 0) goto <D.25710>; else goto <D.25711>;
  <D.25710>:
  D.25698 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.25698);
  <D.25711>:
  D.25712 = mono_defaults.int32_class;
  D.25713 = &D.25712->byval_arg;
  loc_old_domainid = mono_mb_add_local (mb, D.25713);
  D.25712 = mono_defaults.int32_class;
  D.25713 = &D.25712->byval_arg;
  loc_domainid = mono_mb_add_local (mb, D.25713);
  byte_array_class.85 = byte_array_class;
  D.25709 = &byte_array_class.85->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.25709);
  D.25706 = mono_defaults.object_class;
  D.25707 = &D.25706->byval_arg;
  loc_context = mono_mb_add_local (mb, D.25707);
  mono_mb_emit_icall (mb, mono_context_get);
  mono_mb_emit_byte (mb, 37);
  loc_context.86 = (unsigned int) loc_context;
  mono_mb_emit_stloc (mb, loc_context.86);
  method_needs_context_sink.87 = method_needs_context_sink;
  mono_mb_emit_managed_call (mb, method_needs_context_sink.87, 0B);
  D.25716 = mono_mb_emit_short_branch (mb, 45);
  pos = (int) D.25716;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  loc_real_proxy.88 = (unsigned int) loc_real_proxy;
  mono_mb_emit_stloc (mb, loc_real_proxy.88);
  mono_mb_emit_ldflda (mb, 20);
  mono_mb_emit_byte (mb, 74);
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_stloc (mb, loc_domainid.89);
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.89);
  D.25673 = method->klass;
  D.25719 = D.25673->image;
  mono_mb_emit_ptr (mb, D.25719);
  mono_mb_emit_icall (mb, mono_marshal_check_domain_image);
  D.25720 = mono_mb_emit_short_branch (mb, 45);
  pos_dispatch = (int) D.25720;
  pos.90 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.90);
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.22019>;
  <D.22018>:
  D.25722 = i + 1;
  D.25723 = (unsigned int) D.25722;
  mono_mb_emit_ldarg (mb, D.25723);
  i = i + 1;
  <D.22019>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22018>; else goto <D.22020>;
  <D.22020>:
  D.25724 = mono_marshal_get_remoting_invoke (method);
  mono_mb_emit_managed_call (mb, D.25724, 0B);
  mono_mb_emit_byte (mb, 42);
  pos_dispatch.91 = (unsigned int) pos_dispatch;
  mono_mb_patch_short_branch (mb, pos_dispatch.91);
  if (complex_count > 0) goto <D.25726>; else goto <D.25727>;
  <D.25726>:
  D.25729 = ret_marshal_type == 3;
  D.25730 = complex_out_count > 0;
  D.25731 = D.25729 & D.25730;
  if (D.25731 != 0) goto <D.25732>; else goto <D.25733>;
  <D.25732>:
  iftmp.92 = complex_count + 1;
  goto <D.25734>;
  <D.25733>:
  iftmp.92 = complex_count;
  <D.25734>:
  mono_mb_emit_icon (mb, iftmp.92);
  D.25706 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 141, D.25706);
  j = 0;
  i = 0;
  goto <D.22024>;
  <D.22023>:
  {
    struct MonoClass * pclass;

    i.84 = (unsigned int) i;
    D.25695 = i.84 * 4;
    D.25696 = marshal_types + D.25695;
    D.25735 = *D.25696;
    if (D.25735 != 3) goto <D.25736>; else goto <D.25737>;
    <D.25736>:
    // predicted unlikely by continue predictor.
    goto <D.22022>;
    <D.25737>:
    D.25738 = sig->params[i];
    pclass = mono_class_from_mono_type (D.25738);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_icon (mb, j);
    D.25722 = i + 1;
    D.25723 = (unsigned int) D.25722;
    mono_mb_emit_ldarg (mb, D.25723);
    D.25738 = sig->params[i];
    D.25739 = BIT_FIELD_REF <*D.25738, 8, 56>;
    D.25740 = D.25739 & 64;
    if (D.25740 != 0) goto <D.25741>; else goto <D.25742>;
    <D.25741>:
    D.25743 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.25744 = D.25743 & 8;
    if (D.25744 != 0) goto <D.25745>; else goto <D.25746>;
    <D.25745>:
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.25747>;
    <D.25746>:
    mono_mb_emit_byte (mb, 80);
    <D.25747>:
    <D.25742>:
    D.25743 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.25744 = D.25743 & 8;
    if (D.25744 != 0) goto <D.25748>; else goto <D.25749>;
    <D.25748>:
    mono_mb_emit_op (mb, 140, pclass);
    <D.25749>:
    mono_mb_emit_byte (mb, 162);
    j = j + 1;
  }
  <D.22022>:
  i = i + 1;
  <D.22024>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22023>; else goto <D.22025>;
  <D.22025>:
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.93);
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.93);
  method_rs_serialize.94 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.94, 0B);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.95);
  goto <D.25753>;
  <D.25727>:
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.94 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.94, 0B);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.95);
  <D.25753>:
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.89);
  mono_mb_emit_byte (mb, 23);
  mono_marshal_emit_switch_domain (mb);
  loc_old_domainid.96 = (unsigned int) loc_old_domainid;
  mono_mb_emit_stloc (mb, loc_old_domainid.96);
  loc_real_proxy.88 = (unsigned int) loc_real_proxy;
  mono_mb_emit_ldloc (mb, loc_real_proxy.88);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_data.95);
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_exc.97);
  copy_locals_base = mb->locals;
  i = 0;
  goto <D.22035>;
  <D.22034>:
  i.84 = (unsigned int) i;
  D.25695 = i.84 * 4;
  D.25696 = marshal_types + D.25695;
  D.25735 = *D.25696;
  switch (D.25735) <default: <D.25760>, case 0: <D.22033>, case 1: <D.22028>, case 2: <D.22032>, case 3: <D.22026>>
  <D.22026>:
  // predicted unlikely by continue predictor.
  goto <D.22027>;
  <D.22028>:
  D.25722 = i + 1;
  D.25723 = (unsigned int) D.25722;
  mono_mb_emit_ldarg (mb, D.25723);
  D.25738 = sig->params[i];
  D.25739 = BIT_FIELD_REF <*D.25738, 8, 56>;
  D.25740 = D.25739 & 64;
  if (D.25740 != 0) goto <D.25756>; else goto <D.25757>;
  <D.25756>:
  {
    struct MonoClass * pclass;
    int copy_local;

    D.25738 = sig->params[i];
    pclass = mono_class_from_mono_type (D.25738);
    D.25758 = &pclass->byval_arg;
    copy_local = mono_mb_add_local (mb, D.25758);
    mono_mb_emit_byte (mb, 80);
    copy_local.98 = (unsigned int) copy_local;
    mono_mb_emit_stloc (mb, copy_local.98);
    copy_local.98 = (unsigned int) copy_local;
    mono_mb_emit_ldloc_addr (mb, copy_local.98);
  }
  <D.25757>:
  goto <D.22031>;
  <D.22032>:
  <D.22033>:
  D.25722 = i + 1;
  D.25723 = (unsigned int) D.25722;
  mono_mb_emit_ldarg (mb, D.25723);
  goto <D.22031>;
  <D.25760>:
  <D.22031>:
  <D.22027>:
  i = i + 1;
  <D.22035>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22034>; else goto <D.22036>;
  <D.22036>:
  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.25761 = mono_method_signature (xdomain_method);
  mono_mb_emit_calli (mb, D.25761);
  if (copy_return != 0) goto <D.25762>; else goto <D.25763>;
  <D.25762>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.99);
  <D.25763>:
  loc_old_domainid.96 = (unsigned int) loc_old_domainid;
  mono_mb_emit_ldloc (mb, loc_old_domainid.96);
  mono_mb_emit_byte (mb, 22);
  mono_marshal_emit_switch_domain (mb);
  mono_mb_emit_byte (mb, 38);
  loc_context.86 = (unsigned int) loc_context;
  mono_mb_emit_ldloc (mb, loc_context.86);
  mono_mb_emit_icall (mb, mono_context_set);
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.97);
  D.25765 = mono_mb_emit_short_branch (mb, 44);
  pos_noex = (int) D.25765;
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.97);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  D.25767 = mono_defaults.exception_class;
  mono_mb_emit_op (mb, 116, D.25767);
  method_exc_fixexc.101 = method_exc_fixexc;
  mono_mb_emit_managed_call (mb, method_exc_fixexc.101, 0B);
  mono_mb_emit_byte (mb, 122);
  pos_noex.102 = (unsigned int) pos_noex;
  mono_mb_patch_short_branch (mb, pos_noex.102);
  j = 0;
  i = 0;
  goto <D.22039>;
  <D.22038>:
  D.25738 = sig->params[i];
  D.25739 = BIT_FIELD_REF <*D.25738, 8, 56>;
  D.25740 = D.25739 & 64;
  if (D.25740 == 0) goto <D.25770>; else goto <D.25772>;
  <D.25772>:
  i.84 = (unsigned int) i;
  D.25695 = i.84 * 4;
  D.25696 = marshal_types + D.25695;
  D.25735 = *D.25696;
  if (D.25735 != 1) goto <D.25770>; else goto <D.25771>;
  <D.25770>:
  // predicted unlikely by continue predictor.
  goto <D.22037>;
  <D.25771>:
  D.25722 = i + 1;
  D.25723 = (unsigned int) D.25722;
  mono_mb_emit_ldarg (mb, D.25723);
  j.103 = j;
  j = j.103 + 1;
  D.25774 = j.103 + copy_locals_base;
  D.25775 = (unsigned int) D.25774;
  mono_mb_emit_ldloc (mb, D.25775);
  D.25738 = sig->params[i];
  D.25776 = mono_class_from_mono_type (D.25738);
  mono_marshal_emit_xdomain_copy_value (mb, D.25776);
  mono_mb_emit_byte (mb, 81);
  <D.22037>:
  i = i + 1;
  <D.22039>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22038>; else goto <D.22040>;
  <D.22040>:
  if (complex_out_count > 0) goto <D.25777>; else goto <D.25778>;
  <D.25777>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.93);
  j = 0;
  i = 0;
  goto <D.22044>;
  <D.22043>:
  i.84 = (unsigned int) i;
  D.25695 = i.84 * 4;
  D.25696 = marshal_types + D.25695;
  D.25735 = *D.25696;
  if (D.25735 != 3) goto <D.25779>; else goto <D.25780>;
  <D.25779>:
  // predicted unlikely by continue predictor.
  goto <D.22041>;
  <D.25780>:
  D.25738 = sig->params[i];
  D.25739 = BIT_FIELD_REF <*D.25738, 8, 56>;
  D.25740 = D.25739 & 64;
  if (D.25740 != 0) goto <D.25781>; else goto <D.25782>;
  <D.25781>:
  {
    struct MonoClass * pclass;

    D.25738 = sig->params[i];
    pclass = mono_class_from_mono_type (D.25738);
    D.25722 = i + 1;
    D.25723 = (unsigned int) D.25722;
    mono_mb_emit_ldarg (mb, D.25723);
    loc_array.93 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.93);
    mono_mb_emit_icon (mb, j);
    mono_mb_emit_byte (mb, 154);
    D.25783 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.25784 = D.25783 & 8;
    if (D.25784 != 0) goto <D.25785>; else goto <D.25786>;
    <D.25785>:
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    mono_mb_emit_op (mb, 129, pclass);
    goto <D.25787>;
    <D.25786>:
    D.25706 = mono_defaults.object_class;
    if (D.25706 != pclass) goto <D.25788>; else goto <D.25789>;
    <D.25788>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.25789>:
    mono_mb_emit_byte (mb, 81);
    <D.25787>:
  }
  <D.25782>:
  j = j + 1;
  <D.22041>:
  i = i + 1;
  <D.22044>:
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  if (D.25697 > i) goto <D.22043>; else goto <D.22045>;
  <D.22045>:
  if (ret_marshal_type == 3) goto <D.25790>; else goto <D.25791>;
  <D.25790>:
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.93);
  mono_mb_emit_icon (mb, complex_count);
  mono_mb_emit_byte (mb, 154);
  D.25792 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.25793 = D.25792 & 8;
  if (D.25793 != 0) goto <D.25794>; else goto <D.25795>;
  <D.25794>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  <D.25795>:
  <D.25791>:
  goto <D.25796>;
  <D.25778>:
  if (ret_marshal_type == 3) goto <D.25797>; else goto <D.25798>;
  <D.25797>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  D.25792 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.25793 = D.25792 & 8;
  if (D.25793 != 0) goto <D.25799>; else goto <D.25800>;
  <D.25799>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  goto <D.25801>;
  <D.25800>:
  D.25706 = mono_defaults.object_class;
  if (D.25706 != ret_class) goto <D.25802>; else goto <D.25803>;
  <D.25802>:
  mono_mb_emit_op (mb, 116, ret_class);
  <D.25803>:
  <D.25801>:
  goto <D.25804>;
  <D.25798>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  mono_mb_emit_byte (mb, 37);
  D.25805 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.25805;
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  pos.90 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.90);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  mono_mb_emit_byte (mb, 38);
  <D.25804>:
  <D.25796>:
  if (copy_return != 0) goto <D.25806>; else goto <D.25807>;
  <D.25806>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.99);
  if (ret_marshal_type == 1) goto <D.25808>; else goto <D.25809>;
  <D.25808>:
  mono_marshal_emit_xdomain_copy_value (mb, ret_class);
  <D.25809>:
  <D.25807>:
  mono_mb_emit_byte (mb, 42);
  D.25676 = sig->param_count;
  D.25697 = (int) D.25676;
  D.25810 = D.25697 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.25810);
  mono_mb_free (mb);
  D.25662 = res;
  return D.25662;
}


mono_marshal_supports_fast_xdomain (struct MonoMethod * method)
{
  gboolean D.25812;
  int iftmp.104;
  struct MonoClass * D.25817;
  unsigned char D.25818;
  unsigned char D.25819;
  short unsigned int D.25821;
  int D.25822;
  int D.25823;
  int D.21915;
  int iftmp.105;
  int D.21911;
  const char[6] * D.25828;
  unsigned char D.25829;
  int D.25830;
  unsigned char D.25831;
  int D.25832;
  _Bool D.25833;
  _Bool D.25834;
  _Bool D.25835;
  const unsigned char * D.25838;
  unsigned char D.25839;
  int D.25840;
  const unsigned char * D.25841;
  unsigned char D.25842;
  int D.25843;
  _Bool D.25844;
  _Bool D.25845;
  const unsigned char * D.25848;
  unsigned char D.25849;
  int D.25850;
  const unsigned char * D.25851;
  unsigned char D.25852;
  int D.25853;
  _Bool D.25854;
  _Bool D.25855;
  const unsigned char * D.25858;
  unsigned char D.25859;
  int D.25860;
  const unsigned char * D.25861;
  unsigned char D.25862;
  int D.25863;
  const char * D.25865;

  D.25817 = method->klass;
  D.25818 = BIT_FIELD_REF <*D.25817, 8, 176>;
  D.25819 = D.25818 & 128;
  if (D.25819 == 0) goto <D.25820>; else goto <D.25814>;
  <D.25820>:
  D.25821 = method->flags;
  D.25822 = (int) D.25821;
  D.25823 = D.25822 & 2048;
  if (D.25823 == 0) goto <D.25815>; else goto <D.25824>;
  <D.25824>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.25828 = ".ctor";
      D.25829 = MEM[(const unsigned char *)D.25828];
      D.25830 = (int) D.25829;
      D.25831 = *__s2;
      D.25832 = (int) D.25831;
      __result = D.25830 - D.25832;
      {
        D.25833 = __s1_len != 0;
        D.25834 = __result == 0;
        D.25835 = D.25833 & D.25834;
        if (D.25835 != 0) goto <D.25836>; else goto <D.25837>;
        <D.25836>:
        D.25838 = &MEM[(void *)".ctor" + 1B];
        D.25839 = *D.25838;
        D.25840 = (int) D.25839;
        D.25841 = __s2 + 1;
        D.25842 = *D.25841;
        D.25843 = (int) D.25842;
        __result = D.25840 - D.25843;
        D.25844 = __s1_len > 1;
        D.25834 = __result == 0;
        D.25845 = D.25844 & D.25834;
        if (D.25845 != 0) goto <D.25846>; else goto <D.25847>;
        <D.25846>:
        D.25848 = &MEM[(void *)".ctor" + 2B];
        D.25849 = *D.25848;
        D.25850 = (int) D.25849;
        D.25851 = __s2 + 2;
        D.25852 = *D.25851;
        D.25853 = (int) D.25852;
        __result = D.25850 - D.25853;
        D.25854 = __s1_len > 2;
        D.25834 = __result == 0;
        D.25855 = D.25854 & D.25834;
        if (D.25855 != 0) goto <D.25856>; else goto <D.25857>;
        <D.25856>:
        D.25858 = &MEM[(void *)".ctor" + 3B];
        D.25859 = *D.25858;
        D.25860 = (int) D.25859;
        D.25861 = __s2 + 3;
        D.25862 = *D.25861;
        D.25863 = (int) D.25862;
        __result = D.25860 - D.25863;
        <D.25857>:
        <D.25847>:
        <D.25837>:
      }
      D.21911 = __result;
    }
    iftmp.105 = D.21911;
    goto <D.25864>;
    <D.25827>:
    D.25865 = method->name;
    iftmp.105 = __builtin_strcmp (".ctor", D.25865);
    <D.25864>:
    D.21915 = iftmp.105;
  }
  if (D.21915 != 0) goto <D.25815>; else goto <D.25814>;
  <D.25815>:
  iftmp.104 = 1;
  goto <D.25816>;
  <D.25814>:
  iftmp.104 = 0;
  <D.25816>:
  D.25812 = iftmp.104;
  return D.25812;
}


mono_remoting_marshal_init ()
{
  int module_initialized.106;
  struct MonoImage * D.25870;
  struct MonoMethod * method_rs_serialize.107;
  struct MonoMethod * method_rs_deserialize.108;
  struct MonoMethod * method_rs_serialize_exc.109;
  struct MonoMethod * method_rs_appdomain_target.110;
  struct MonoMethod * method_exc_fixexc.111;
  struct MonoClass * D.25876;
  struct MonoClass * byte_array_class.112;
  struct MonoMethod * method_set_call_context.113;
  struct MonoMethod * method_needs_context_sink.114;
  struct MonoClass * klass;
  static gboolean module_initialized = 0;

  module_initialized.106 = module_initialized;
  if (module_initialized.106 == 0) goto <D.25868>; else goto <D.25869>;
  <D.25868>:
  D.25870 = mono_defaults.corlib;
  klass = mono_class_from_name (D.25870, "System.Runtime.Remoting", "RemotingServices");
  method_rs_serialize.107 = mono_class_get_method_from_name (klass, "SerializeCallData", -1);
  method_rs_serialize = method_rs_serialize.107;
  method_rs_deserialize.108 = mono_class_get_method_from_name (klass, "DeserializeCallData", -1);
  method_rs_deserialize = method_rs_deserialize.108;
  method_rs_serialize_exc.109 = mono_class_get_method_from_name (klass, "SerializeExceptionData", -1);
  method_rs_serialize_exc = method_rs_serialize_exc.109;
  klass = mono_defaults.real_proxy_class;
  method_rs_appdomain_target.110 = mono_class_get_method_from_name (klass, "GetAppDomainTarget", -1);
  method_rs_appdomain_target = method_rs_appdomain_target.110;
  klass = mono_defaults.exception_class;
  method_exc_fixexc.111 = mono_class_get_method_from_name (klass, "FixRemotingException", -1);
  method_exc_fixexc = method_exc_fixexc.111;
  D.25876 = mono_defaults.byte_class;
  byte_array_class.112 = mono_array_class_get (D.25876, 1);
  byte_array_class = byte_array_class.112;
  D.25870 = mono_defaults.corlib;
  klass = mono_class_from_name (D.25870, "System.Runtime.Remoting.Messaging", "CallContext");
  method_set_call_context.113 = mono_class_get_method_from_name (klass, "SetCurrentCallContext", -1);
  method_set_call_context = method_set_call_context.113;
  D.25870 = mono_defaults.corlib;
  klass = mono_class_from_name (D.25870, "System.Runtime.Remoting.Contexts", "Context");
  method_needs_context_sink.114 = mono_class_get_method_from_name (klass, "get_NeedsContextSink", -1);
  method_needs_context_sink = method_needs_context_sink.114;
  module_initialized = 1;
  <D.25869>:
}


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.25882;
  int iftmp.115;
  struct MonoType * D.25886;
  unsigned char D.25887;
  struct MonoImage * D.25890;
  short unsigned int D.25891;
  int D.25892;
  int D.25893;
  int D.25894;
  unsigned int D.25895;
  int j.116;
  struct MonoClass * D.25897;
  struct MonoType * D.25898;
  int j.117;
  struct MonoClass * byte_array_class.118;
  struct MonoType * D.25901;
  int j.119;
  unsigned int i.120;
  unsigned int D.25904;
  int * D.25905;
  int D.25906;
  int j.121;
  struct MonoType * D.25910;
  struct MonoClass * D.25914;
  struct MonoType * D.25915;
  struct MonoClass * D.25916;
  const char * D.25917;
  struct MonoMethod * D.25918;
  struct MonoType * D.25919;
  struct MonoImage * D.25924;
  int D.25925;
  unsigned int D.25926;
  struct MonoMethod * method_set_call_context.122;
  unsigned int D.25928;
  struct MonoMethod * method_rs_deserialize.123;
  unsigned int loc_array.124;
  unsigned int pos.125;
  struct MonoMethod * method_rs_appdomain_target.126;
  int j.127;
  unsigned char D.25937;
  unsigned char D.25938;
  unsigned char D.25941;
  unsigned char D.25942;
  struct MonoType * D.25952;
  int param_index.128;
  unsigned int param_index.129;
  unsigned int copy_local.130;
  unsigned int param_index.131;
  int param_index.132;
  unsigned int param_index.133;
  unsigned int loc_return.134;
  int j.135;
  int D.25971;
  unsigned int D.25972;
  struct MonoClass * D.25973;
  unsigned char D.25978;
  unsigned char D.25979;
  _Bool D.25984;
  long int D.25985;
  long int D.25986;
  unsigned char D.25989;
  unsigned char D.25990;
  struct MonoMethod * method_rs_serialize.136;
  unsigned int D.26000;
  int D.26001;
  unsigned int D.26002;
  unsigned int D.26003;
  unsigned int D.26004;
  int D.26005;
  unsigned int D.26006;
  struct MonoMethod * method_rs_serialize_exc.137;
  unsigned int loc_serialized_exc.138;
  int D.26009;
  unsigned int D.26010;
  unsigned int D.26011;
  unsigned int D.26012;
  unsigned int pos_leave.139;
  short unsigned int D.26016;
  int D.26017;
  int D.26018;
  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.25880>; else goto <D.25881>;
  <D.25880>:
  D.25882 = res;
  return D.25882;
  <D.25881>:
  sig = mono_method_signature (method);
  D.25886 = sig->ret;
  D.25887 = D.25886->type;
  if (D.25887 != 1) goto <D.25888>; else goto <D.25884>;
  <D.25888>:
  if (ret_marshal_type != 3) goto <D.25889>; else goto <D.25884>;
  <D.25889>:
  iftmp.115 = 1;
  goto <D.25885>;
  <D.25884>:
  iftmp.115 = 0;
  <D.25885>:
  copy_return = iftmp.115;
  j = 0;
  D.25890 = mono_defaults.corlib;
  D.25891 = sig->param_count;
  D.25892 = (int) D.25891;
  D.25893 = D.25892 + 3;
  D.25894 = D.25893 - complex_count;
  D.25895 = (unsigned int) D.25894;
  csig = mono_metadata_signature_alloc (D.25890, D.25895);
  j.116 = j;
  j = j.116 + 1;
  D.25897 = mono_defaults.object_class;
  D.25898 = &D.25897->byval_arg;
  csig->params[j.116] = D.25898;
  j.117 = j;
  j = j.117 + 1;
  byte_array_class.118 = byte_array_class;
  D.25901 = &byte_array_class.118->this_arg;
  csig->params[j.117] = D.25901;
  j.119 = j;
  j = j.119 + 1;
  byte_array_class.118 = byte_array_class;
  D.25901 = &byte_array_class.118->this_arg;
  csig->params[j.119] = D.25901;
  i = 0;
  goto <D.21965>;
  <D.21964>:
  i.120 = (unsigned int) i;
  D.25904 = i.120 * 4;
  D.25905 = marshal_types + D.25904;
  D.25906 = *D.25905;
  if (D.25906 != 3) goto <D.25907>; else goto <D.25908>;
  <D.25907>:
  j.121 = j;
  j = j.121 + 1;
  D.25910 = sig->params[i];
  csig->params[j.121] = D.25910;
  <D.25908>:
  i = i + 1;
  <D.21965>:
  D.25891 = sig->param_count;
  D.25892 = (int) D.25891;
  if (D.25892 > i) goto <D.21964>; else goto <D.21966>;
  <D.21966>:
  if (copy_return != 0) goto <D.25911>; else goto <D.25912>;
  <D.25911>:
  D.25886 = sig->ret;
  csig->ret = D.25886;
  goto <D.25913>;
  <D.25912>:
  D.25914 = mono_defaults.void_class;
  D.25915 = &D.25914->byval_arg;
  csig->ret = D.25915;
  <D.25913>:
  csig->pinvoke = 1;
  csig->hasthis = 0;
  D.25916 = method->klass;
  D.25917 = method->name;
  mb = mono_mb_new (D.25916, D.25917, 11);
  D.25918 = mb->method;
  D.25918->save_lmf = 1;
  byte_array_class.118 = byte_array_class;
  D.25919 = &byte_array_class.118->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.25919);
  if (complex_count > 0) goto <D.25920>; else goto <D.25921>;
  <D.25920>:
  D.25897 = mono_defaults.object_class;
  D.25898 = &D.25897->byval_arg;
  loc_array = mono_mb_add_local (mb, D.25898);
  <D.25921>:
  D.25886 = sig->ret;
  D.25887 = D.25886->type;
  if (D.25887 != 1) goto <D.25922>; else goto <D.25923>;
  <D.25922>:
  D.25886 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.25886);
  D.25886 = sig->ret;
  ret_class = mono_class_from_mono_type (D.25886);
  <D.25923>:
  D.25916 = method->klass;
  D.25924 = D.25916->image;
  main_clause = mono_image_alloc0 (D.25924, 24);
  D.25925 = mono_mb_get_label (mb);
  D.25926 = (unsigned int) D.25925;
  main_clause->try_offset = D.25926;
  mono_mb_emit_byte (mb, 20);
  method_set_call_context.122 = method_set_call_context;
  mono_mb_emit_managed_call (mb, method_set_call_context.122, 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.25928 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.25928;
  byte_array_class.118 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.118);
  method_rs_deserialize.123 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.123, 0B);
  if (complex_count > 0) goto <D.25930>; else goto <D.25931>;
  <D.25930>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.124);
  goto <D.25933>;
  <D.25931>:
  mono_mb_emit_byte (mb, 38);
  <D.25933>:
  pos.125 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.125);
  mono_mb_emit_ldarg (mb, 0);
  method_rs_appdomain_target.126 = method_rs_appdomain_target;
  mono_mb_emit_managed_call (mb, method_rs_appdomain_target.126, 0B);
  copy_locals_base = mb->locals;
  param_index = 3;
  j = 0;
  i = 0;
  goto <D.21976>;
  <D.21975>:
  {
    struct MonoType * pt;
    struct MonoClass * pclass;

    pt = sig->params[i];
    pclass = mono_class_from_mono_type (pt);
    i.120 = (unsigned int) i;
    D.25904 = i.120 * 4;
    D.25905 = marshal_types + D.25904;
    D.25906 = *D.25905;
    switch (D.25906) <default: <D.25962>, case 0: <D.21974>, case 1: <D.21973>, case 2: <D.21971>, case 3: <D.21969>>
    <D.21969>:
    loc_array.124 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.124);
    j.127 = j;
    j = j.127 + 1;
    mono_mb_emit_icon (mb, j.127);
    D.25937 = BIT_FIELD_REF <*pt, 8, 56>;
    D.25938 = D.25937 & 64;
    if (D.25938 != 0) goto <D.25939>; else goto <D.25940>;
    <D.25939>:
    D.25941 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.25942 = D.25941 & 8;
    if (D.25942 != 0) goto <D.25943>; else goto <D.25944>;
    <D.25943>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    goto <D.25945>;
    <D.25944>:
    mono_mb_emit_op (mb, 143, pclass);
    <D.25945>:
    goto <D.25946>;
    <D.25940>:
    D.25941 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.25942 = D.25941 & 8;
    if (D.25942 != 0) goto <D.25947>; else goto <D.25948>;
    <D.25947>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.25949>;
    <D.25948>:
    mono_mb_emit_byte (mb, 154);
    D.25897 = mono_defaults.object_class;
    if (D.25897 != pclass) goto <D.25950>; else goto <D.25951>;
    <D.25950>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.25951>:
    <D.25949>:
    <D.25946>:
    goto <D.21970>;
    <D.21971>:
    {
      int copy_local;

      D.25952 = &pclass->byval_arg;
      copy_local = mono_mb_add_local (mb, D.25952);
      param_index.128 = param_index;
      param_index = param_index.128 + 1;
      param_index.129 = (unsigned int) param_index.128;
      mono_mb_emit_ldarg (mb, param_index.129);
      mono_marshal_emit_xdomain_copy_value (mb, pclass);
      mono_mb_emit_byte (mb, 37);
      copy_local.130 = (unsigned int) copy_local;
      mono_mb_emit_stloc (mb, copy_local.130);
      goto <D.21970>;
    }
    <D.21973>:
    param_index.131 = (unsigned int) param_index;
    mono_mb_emit_ldarg (mb, param_index.131);
    D.25937 = BIT_FIELD_REF <*pt, 8, 56>;
    D.25938 = D.25937 & 64;
    if (D.25938 != 0) goto <D.25957>; else goto <D.25958>;
    <D.25957>:
    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.25959>;
    <D.25958>:
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    <D.25959>:
    param_index = param_index + 1;
    goto <D.21970>;
    <D.21974>:
    param_index.132 = param_index;
    param_index = param_index.132 + 1;
    param_index.133 = (unsigned int) param_index.132;
    mono_mb_emit_ldarg (mb, param_index.133);
    goto <D.21970>;
    <D.25962>:
    <D.21970>:
  }
  i = i + 1;
  <D.21976>:
  D.25891 = sig->param_count;
  D.25892 = (int) D.25891;
  if (D.25892 > i) goto <D.21975>; else goto <D.21977>;
  <D.21977>:
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_op (mb, 111, method);
  D.25886 = sig->ret;
  D.25887 = D.25886->type;
  if (D.25887 != 1) goto <D.25963>; else goto <D.25964>;
  <D.25963>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.134);
  <D.25964>:
  j = 0;
  param_index = 3;
  i = 0;
  goto <D.21980>;
  <D.21979>:
  i.120 = (unsigned int) i;
  D.25904 = i.120 * 4;
  D.25905 = marshal_types + D.25904;
  D.25906 = *D.25905;
  if (D.25906 == 3) goto <D.25966>; else goto <D.25967>;
  <D.25966>:
  // predicted unlikely by continue predictor.
  goto <D.21978>;
  <D.25967>:
  i.120 = (unsigned int) i;
  D.25904 = i.120 * 4;
  D.25905 = marshal_types + D.25904;
  D.25906 = *D.25905;
  if (D.25906 == 2) goto <D.25968>; else goto <D.25969>;
  <D.25968>:
  j.135 = j;
  j = j.135 + 1;
  D.25971 = j.135 + copy_locals_base;
  D.25972 = (unsigned int) D.25971;
  mono_mb_emit_ldloc (mb, D.25972);
  param_index.131 = (unsigned int) param_index;
  mono_mb_emit_ldarg (mb, param_index.131);
  D.25910 = sig->params[i];
  D.25973 = mono_class_from_mono_type (D.25910);
  mono_marshal_emit_xdomain_copy_out_value (mb, D.25973);
  <D.25969>:
  param_index = param_index + 1;
  <D.21978>:
  i = i + 1;
  <D.21980>:
  D.25891 = sig->param_count;
  D.25892 = (int) D.25891;
  if (D.25892 > i) goto <D.21979>; else goto <D.21981>;
  <D.21981>:
  if (complex_out_count > 0) goto <D.25974>; else goto <D.25975>;
  <D.25974>:
  j = 0;
  i = 0;
  goto <D.21984>;
  <D.21983>:
  i.120 = (unsigned int) i;
  D.25904 = i.120 * 4;
  D.25905 = marshal_types + D.25904;
  D.25906 = *D.25905;
  if (D.25906 != 3) goto <D.25976>; else goto <D.25977>;
  <D.25976>:
  // predicted unlikely by continue predictor.
  goto <D.21982>;
  <D.25977>:
  D.25910 = sig->params[i];
  D.25978 = BIT_FIELD_REF <*D.25910, 8, 56>;
  D.25979 = D.25978 & 64;
  if (D.25979 == 0) goto <D.25980>; else goto <D.25981>;
  <D.25980>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  mono_mb_emit_icon (mb, j);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 162);
  <D.25981>:
  j = j + 1;
  <D.21982>:
  i = i + 1;
  <D.21984>:
  D.25891 = sig->param_count;
  D.25892 = (int) D.25891;
  if (D.25892 > i) goto <D.21983>; else goto <D.21985>;
  <D.21985>:
  if (ret_marshal_type == 3) goto <D.25982>; else goto <D.25983>;
  <D.25982>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  mono_mb_emit_icon (mb, complex_count);
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  D.25984 = ret_class == 0B;
  D.25985 = (long int) D.25984;
  D.25986 = __builtin_expect (D.25985, 0);
  if (D.25986 != 0) goto <D.25987>; else goto <D.25988>;
  <D.25987>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3660, "ret_class");
  <D.25988>:
  D.25989 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.25990 = D.25989 & 8;
  if (D.25990 != 0) goto <D.25991>; else goto <D.25992>;
  <D.25991>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.25992>:
  mono_mb_emit_byte (mb, 162);
  <D.25983>:
  mono_mb_emit_ldarg (mb, 1);
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.25994>;
  <D.25975>:
  if (ret_marshal_type == 3) goto <D.25995>; else goto <D.25996>;
  <D.25995>:
  mono_mb_emit_ldarg (mb, 1);
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  D.25989 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.25990 = D.25989 & 8;
  if (D.25990 != 0) goto <D.25997>; else goto <D.25998>;
  <D.25997>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.25998>:
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.25999>;
  <D.25996>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  <D.25999>:
  <D.25994>:
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  D.26000 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.26000;
  main_clause->flags = 0;
  D.26001 = mono_mb_get_pos (mb);
  D.26002 = (unsigned int) D.26001;
  D.26003 = main_clause->try_offset;
  D.26004 = D.26002 - D.26003;
  main_clause->try_len = D.26004;
  D.25897 = mono_defaults.object_class;
  main_clause->data.catch_class = D.25897;
  D.26005 = mono_mb_get_label (mb);
  D.26006 = (unsigned int) D.26005;
  main_clause->handler_offset = D.26006;
  method_rs_serialize_exc.137 = method_rs_serialize_exc;
  mono_mb_emit_managed_call (mb, method_rs_serialize_exc.137, 0B);
  loc_serialized_exc.138 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_stloc (mb, loc_serialized_exc.138);
  mono_mb_emit_ldarg (mb, 2);
  loc_serialized_exc.138 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.138);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.26009 = mono_mb_get_pos (mb);
  D.26010 = (unsigned int) D.26009;
  D.26011 = main_clause->handler_offset;
  D.26012 = D.26010 - D.26011;
  main_clause->handler_len = D.26012;
  pos_leave.139 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.139);
  if (copy_return != 0) goto <D.26014>; else goto <D.26015>;
  <D.26014>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  <D.26015>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, main_clause);
  D.26016 = csig->param_count;
  D.26017 = (int) D.26016;
  D.26018 = D.26017 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, csig, D.26018);
  mono_mb_free (mb);
  D.25882 = res;
  return D.25882;
}


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.26022;

  if (target_type == 1) goto <D.26020>; else goto <D.26021>;
  <D.26020>:
  D.26022 = mono_marshal_get_xappdomain_invoke (method);
  return D.26022;
  <D.26021>:
  if (target_type == 2) goto <D.26023>; else goto <D.26024>;
  <D.26023>:
  D.26022 = mono_cominterop_get_invoke (method);
  return D.26022;
  <D.26024>:
  D.26022 = mono_marshal_get_remoting_invoke (method);
  return D.26022;
  D.26022 = 0B;
  return D.26022;
}


mono_marshal_get_remoting_invoke_with_check (struct MonoMethod * method)
{
  _Bool D.26026;
  long int D.26027;
  long int D.26028;
  unsigned char D.26031;
  unsigned char D.26032;
  struct MonoMethod * D.26035;
  struct MonoMethodSignature * D.26036;
  unsigned char D.26037;
  unsigned char D.26038;
  _Bool D.26039;
  long int D.26040;
  long int D.26041;
  struct MonoClass * D.26046;
  const char * D.26047;
  unsigned int i.140;
  short unsigned int D.26049;
  int D.26050;
  int D.26051;
  struct MonoMethodSignature * D.26054;
  unsigned int pos_rem.141;
  struct MonoMethodSignature * D.26056;
  unsigned int pos.142;
  struct MonoMethodSignature * D.26058;
  int D.26059;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * native;
  int i;
  int pos;
  int pos_rem;

  D.26026 = method == 0B;
  D.26027 = (long int) D.26026;
  D.26028 = __builtin_expect (D.26027, 0);
  if (D.26028 != 0) goto <D.26029>; else goto <D.26030>;
  <D.26029>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4087, "method");
  <D.26030>:
  D.26031 = BIT_FIELD_REF <*method, 8, 160>;
  D.26032 = D.26031 & 124;
  if (D.26032 == 36) goto <D.26033>; else goto <D.26034>;
  <D.26033>:
  D.26035 = method;
  return D.26035;
  <D.26034>:
  D.26036 = mono_method_signature (method);
  D.26037 = BIT_FIELD_REF <*D.26036, 8, 80>;
  D.26038 = D.26037 & 64;
  D.26039 = D.26038 == 0;
  D.26040 = (long int) D.26039;
  D.26041 = __builtin_expect (D.26040, 0);
  if (D.26041 != 0) goto <D.26042>; else goto <D.26043>;
  <D.26042>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4093, "mono_method_signature (method)->hasthis");
  <D.26043>:
  res = mono_marshal_remoting_find_in_cache (method, 9);
  if (res != 0B) goto <D.26044>; else goto <D.26045>;
  <D.26044>:
  D.26035 = res;
  return D.26035;
  <D.26045>:
  sig = mono_signature_no_pinvoke (method);
  D.26046 = method->klass;
  D.26047 = method->name;
  mb = mono_mb_new (D.26046, D.26047, 9);
  i = 0;
  goto <D.22065>;
  <D.22064>:
  i.140 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.140);
  i = i + 1;
  <D.22065>:
  D.26049 = sig->param_count;
  D.26050 = (int) D.26049;
  if (D.26050 >= i) goto <D.22064>; else goto <D.22066>;
  <D.22066>:
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  D.26051 = mono_marshal_supports_fast_xdomain (method);
  if (D.26051 != 0) goto <D.26052>; else goto <D.26053>;
  <D.26052>:
  mono_mb_emit_ldarg (mb, 0);
  pos_rem = mono_mb_emit_xdomain_check (mb, 59);
  native = mono_marshal_get_xappdomain_invoke (method);
  D.26054 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.26054);
  mono_mb_emit_byte (mb, 42);
  pos_rem.141 = (unsigned int) pos_rem;
  mono_mb_patch_branch (mb, pos_rem.141);
  <D.26053>:
  native = mono_marshal_get_remoting_invoke (method);
  D.26056 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.26056);
  mono_mb_emit_byte (mb, 42);
  pos.142 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.142);
  D.26058 = mono_method_signature (method);
  mono_mb_emit_managed_call (mb, method, D.26058);
  mono_mb_emit_byte (mb, 42);
  D.26049 = sig->param_count;
  D.26050 = (int) D.26049;
  D.26059 = D.26050 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.26059);
  mono_mb_free (mb);
  D.26035 = res;
  return D.26035;
}


mono_mb_emit_proxy_check (struct MonoMethodBuilder * mb, int branch_code)
{
  struct MonoClass * D.26061;
  unsigned int D.26062;
  int D.26063;
  unsigned char D.26064;
  unsigned int D.26065;
  int D.26066;
  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.26061 = mono_defaults.transparent_proxy_class;
  D.26062 = mono_mb_add_data (mb, D.26061);
  D.26063 = (int) D.26062;
  mono_mb_emit_i4 (mb, D.26063);
  D.26064 = (unsigned char) branch_code;
  D.26065 = mono_mb_emit_branch (mb, D.26064);
  pos = (int) D.26065;
  D.26066 = pos;
  return D.26066;
}


mono_mb_emit_xdomain_check (struct MonoMethodBuilder * mb, int branch_code)
{
  unsigned char D.26068;
  unsigned int D.26069;
  int D.26070;
  int pos;

  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 20);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_icon (mb, -1);
  D.26068 = (unsigned char) branch_code;
  D.26069 = mono_mb_emit_branch (mb, D.26068);
  pos = (int) D.26069;
  D.26070 = pos;
  return D.26070;
}


mono_marshal_get_delegate_invoke (struct MonoMethod * method, struct MonoDelegate * del)
{
  struct MonoObject * D.26074;
  struct MonoMethod * D.26077;
  struct MonoMethodSignature * D.26080;
  unsigned char D.26081;
  unsigned char D.26082;
  unsigned char D.26085;
  unsigned char D.26086;
  struct MonoMethodSignature * D.26089;
  unsigned char D.26090;
  unsigned char D.26091;
  _Bool D.26092;
  long int D.26093;
  long int D.26094;
  struct MonoType * D.26097;
  struct MonoGenericContext * D.26098;
  int iftmp.143;
  struct MonoClass * D.26105;
  struct MonoClass * D.26106;
  struct MonoClass * D.26107;
  int D.22125;
  int iftmp.144;
  int D.22124;
  const char[7] * D.26112;
  unsigned char D.26113;
  int D.26114;
  unsigned char D.26115;
  int D.26116;
  _Bool D.26117;
  _Bool D.26118;
  _Bool D.26119;
  const unsigned char * D.26122;
  unsigned char D.26123;
  int D.26124;
  const unsigned char * D.26125;
  unsigned char D.26126;
  int D.26127;
  _Bool D.26128;
  _Bool D.26129;
  const unsigned char * D.26132;
  unsigned char D.26133;
  int D.26134;
  const unsigned char * D.26135;
  unsigned char D.26136;
  int D.26137;
  _Bool D.26138;
  _Bool D.26139;
  const unsigned char * D.26142;
  unsigned char D.26143;
  int D.26144;
  const unsigned char * D.26145;
  unsigned char D.26146;
  int D.26147;
  const char * D.26149;
  _Bool D.26150;
  long int D.26151;
  long int D.26152;
  short unsigned int D.26157;
  struct MonoMethodSignature * D.26158;
  short unsigned int D.26159;
  _Bool D.26160;
  struct MonoMethodSignature * D.26165;
  short unsigned int D.26166;
  int D.26167;
  int D.26168;
  int D.26169;
  short unsigned int D.26172;
  int D.26173;
  int D.26174;
  _Bool D.26177;
  long int D.26178;
  long int D.26179;
  unsigned char D.26182;
  unsigned char D.26183;
  int D.26186;
  _Bool D.26191;
  long int D.26192;
  long int D.26193;
  struct MonoImage * D.26198;
  struct GHashTable * * D.26199;
  struct MonoMethod * D.26202;
  struct GHashTable * * D.26206;
  _Bool D.26214;
  long int D.26215;
  long int D.26216;
  struct GHashTable * D.26219;
  struct GHashTable * D.26222;
  _Bool D.26225;
  long int D.26226;
  long int D.26227;
  struct GHashTable * * D.26233;
  struct MonoClass * D.26244;
  struct MonoClass * D.26245;
  struct MonoType * D.26246;
  unsigned char D.26247;
  unsigned char D.26248;
  _Bool D.26249;
  long int D.26250;
  long int D.26251;
  unsigned int local_prev.145;
  unsigned int D.26255;
  int D.26256;
  unsigned int D.26257;
  struct MonoGenericContext * D.26260;
  struct MonoMethod * D.26261;
  struct MonoType * D.26263;
  unsigned char D.26264;
  unsigned int pos0.146;
  unsigned int local_target.147;
  unsigned int D.26271;
  struct MonoType * D.26283;
  int D.26284;
  struct MonoClass * D.26287;
  int D.26290;
  _Bool D.26299;
  long int D.26300;
  long int D.26301;
  struct MonoClass * D.26308;
  struct MonoImage * D.26309;
  struct MonoMethodSignature * D.26310;
  struct MonoMethodSignature * D.26311;
  _Bool D.26314;
  long int D.26315;
  long int D.26316;
  _Bool D.26322;
  long int D.26323;
  long int D.26324;
  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.26072>; else goto <D.26073>;
      <D.26072>:
      D.26074 = del->target;
      if (D.26074 == 0B) goto <D.26075>; else goto <D.26076>;
      <D.26075>:
      D.26077 = del->method;
      if (D.26077 != 0B) goto <D.26078>; else goto <D.26079>;
      <D.26078>:
      D.26077 = del->method;
      D.26080 = mono_method_signature (D.26077);
      D.26081 = BIT_FIELD_REF <*D.26080, 8, 80>;
      D.26082 = D.26081 & 64;
      if (D.26082 != 0) goto <D.26083>; else goto <D.26084>;
      <D.26083>:
      callvirt = 1;
      target_method = del->method;
      D.26085 = BIT_FIELD_REF <*target_method, 8, 168>;
      D.26086 = D.26085 & 16;
      if (D.26086 != 0) goto <D.26087>; else goto <D.26088>;
      <D.26087>:
      {
        struct MonoType * target_type;

        D.26089 = method->signature;
        D.26090 = BIT_FIELD_REF <*D.26089, 8, 80>;
        D.26091 = D.26090 & 64;
        D.26092 = D.26091 == 0;
        D.26093 = (long int) D.26092;
        D.26094 = __builtin_expect (D.26093, 0);
        if (D.26094 != 0) goto <D.26095>; else goto <D.26096>;
        <D.26095>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4211, "method->signature->hasthis");
        <D.26096>:
        D.26089 = method->signature;
        D.26097 = D.26089->params[0];
        D.26098 = mono_method_get_context (method);
        target_type = mono_class_inflate_generic_type (D.26097, D.26098);
        target_class = mono_class_from_mono_type (target_type);
      }
      goto <D.26099>;
      <D.26088>:
      D.26077 = del->method;
      target_class = D.26077->klass;
      <D.26099>:
      <D.26084>:
      <D.26079>:
      <D.26076>:
      <D.26073>:
      if (method == 0B) goto <D.26101>; else goto <D.26104>;
      <D.26104>:
      D.26105 = method->klass;
      D.26106 = D.26105->parent;
      D.26107 = mono_defaults.multicastdelegate_class;
      if (D.26106 != D.26107) goto <D.26101>; else goto <D.26108>;
      <D.26108>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = method->name;
          D.26112 = "Invoke";
          D.26113 = MEM[(const unsigned char *)D.26112];
          D.26114 = (int) D.26113;
          D.26115 = *__s2;
          D.26116 = (int) D.26115;
          __result = D.26114 - D.26116;
          {
            D.26117 = __s2_len != 0;
            D.26118 = __result == 0;
            D.26119 = D.26117 & D.26118;
            if (D.26119 != 0) goto <D.26120>; else goto <D.26121>;
            <D.26120>:
            D.26122 = &MEM[(void *)"Invoke" + 1B];
            D.26123 = *D.26122;
            D.26124 = (int) D.26123;
            D.26125 = __s2 + 1;
            D.26126 = *D.26125;
            D.26127 = (int) D.26126;
            __result = D.26124 - D.26127;
            D.26128 = __s2_len > 1;
            D.26118 = __result == 0;
            D.26129 = D.26128 & D.26118;
            if (D.26129 != 0) goto <D.26130>; else goto <D.26131>;
            <D.26130>:
            D.26132 = &MEM[(void *)"Invoke" + 2B];
            D.26133 = *D.26132;
            D.26134 = (int) D.26133;
            D.26135 = __s2 + 2;
            D.26136 = *D.26135;
            D.26137 = (int) D.26136;
            __result = D.26134 - D.26137;
            D.26138 = __s2_len > 2;
            D.26118 = __result == 0;
            D.26139 = D.26138 & D.26118;
            if (D.26139 != 0) goto <D.26140>; else goto <D.26141>;
            <D.26140>:
            D.26142 = &MEM[(void *)"Invoke" + 3B];
            D.26143 = *D.26142;
            D.26144 = (int) D.26143;
            D.26145 = __s2 + 3;
            D.26146 = *D.26145;
            D.26147 = (int) D.26146;
            __result = D.26144 - D.26147;
            <D.26141>:
            <D.26131>:
            <D.26121>:
          }
          D.22124 = __result;
        }
        iftmp.144 = -D.22124;
        goto <D.26148>;
        <D.26111>:
        D.26149 = method->name;
        iftmp.144 = __builtin_strcmp (D.26149, "Invoke");
        <D.26148>:
        D.22125 = iftmp.144;
      }
      if (D.22125 != 0) goto <D.26101>; else goto <D.26102>;
      <D.26101>:
      iftmp.143 = 1;
      goto <D.26103>;
      <D.26102>:
      iftmp.143 = 0;
      <D.26103>:
      D.26150 = iftmp.143 != 0;
      D.26151 = (long int) D.26150;
      D.26152 = __builtin_expect (D.26151, 0);
      if (D.26152 != 0) goto <D.26153>; else goto <D.26154>;
      <D.26153>:
      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.26154>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      if (callvirt != 0) goto <D.26155>; else goto <D.26156>;
      <D.26155>:
      D.26157 = sig->param_count;
      D.26077 = del->method;
      D.26158 = mono_method_signature (D.26077);
      D.26159 = D.26158->param_count;
      D.26160 = D.26157 == D.26159;
      closed_over_null = (gboolean) D.26160;
      <D.26156>:
      if (del != 0B) goto <D.26161>; else goto <D.26162>;
      <D.26161>:
      D.26077 = del->method;
      if (D.26077 != 0B) goto <D.26163>; else goto <D.26164>;
      <D.26163>:
      D.26077 = del->method;
      D.26165 = mono_method_signature (D.26077);
      D.26166 = D.26165->param_count;
      D.26167 = (int) D.26166;
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      D.26169 = D.26168 + 1;
      if (D.26167 == D.26169) goto <D.26170>; else goto <D.26171>;
      <D.26170>:
      D.26077 = del->method;
      D.26172 = D.26077->flags;
      D.26173 = (int) D.26172;
      D.26174 = D.26173 & 16;
      if (D.26174 != 0) goto <D.26175>; else goto <D.26176>;
      <D.26175>:
      D.26177 = callvirt != 0;
      D.26178 = (long int) D.26177;
      D.26179 = __builtin_expect (D.26178, 0);
      if (D.26179 != 0) goto <D.26180>; else goto <D.26181>;
      <D.26180>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4229, "!callvirt");
      <D.26181>:
      D.26077 = del->method;
      invoke_sig = mono_method_signature (D.26077);
      target_method = 0B;
      static_method_with_first_arg_bound = 1;
      <D.26176>:
      <D.26171>:
      <D.26164>:
      <D.26162>:
      D.26182 = BIT_FIELD_REF <*method, 8, 168>;
      D.26183 = D.26182 & 16;
      if (D.26183 != 0) goto <D.26184>; else goto <D.26185>;
      <D.26184>:
      D.26186 = callvirt | static_method_with_first_arg_bound;
      if (D.26186 == 0) goto <D.26187>; else goto <D.26188>;
      <D.26187>:
      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.26189>; else goto <D.26190>;
      <D.26189>:
      D.26105 = method->klass;
      container = D.26105->generic_container;
      <D.26190>:
      D.26191 = container == 0B;
      D.26192 = (long int) D.26191;
      D.26193 = __builtin_expect (D.26192, 0);
      if (D.26193 != 0) goto <D.26194>; else goto <D.26195>;
      <D.26194>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4246, "container");
      <D.26195>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      <D.26188>:
      <D.26185>:
      if (ctx != 0B) goto <D.26196>; else goto <D.26197>;
      <D.26196>:
      D.26105 = method->klass;
      D.26198 = D.26105->image;
      D.26199 = &D.26198->delegate_invoke_generic_cache;
      cache = get_cache (D.26199, mono_aligned_addr_hash, 0B);
      res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
      if (res != 0B) goto <D.26200>; else goto <D.26201>;
      <D.26200>:
      D.26202 = res;
      return D.26202;
      <D.26201>:
      goto <D.26203>;
      <D.26197>:
      if (static_method_with_first_arg_bound != 0) goto <D.26204>; else goto <D.26205>;
      <D.26204>:
      D.26105 = method->klass;
      D.26198 = D.26105->image;
      D.26206 = &D.26198->delegate_bound_static_invoke_cache;
      cache = get_cache (D.26206, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, invoke_sig);
      if (res != 0B) goto <D.26207>; else goto <D.26208>;
      <D.26207>:
      D.26202 = res;
      return D.26202;
      <D.26208>:
      goto <D.26209>;
      <D.26205>:
      if (callvirt != 0) goto <D.26210>; else goto <D.26211>;
      <D.26210>:
      {
        struct GHashTable * * cache_ptr;

        D.26105 = method->klass;
        D.26198 = D.26105->image;
        cache_ptr = &D.26198->delegate_abstract_invoke_cache;
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.26212>; else goto <D.26213>;
          <D.26212>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.26213>:
          D.26214 = ret != 0;
          D.26215 = (long int) D.26214;
          D.26216 = __builtin_expect (D.26215, 0);
          if (D.26216 != 0) goto <D.26217>; else goto <D.26218>;
          <D.26217>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4275, "ret == 0");
          <D.26218>:
        }
        D.26219 = *cache_ptr;
        if (D.26219 == 0B) goto <D.26220>; else goto <D.26221>;
        <D.26220>:
        D.26222 = monoeg_g_hash_table_new_full (signature_method_pair_hash, signature_method_pair_equal, free_signature_method_pair, 0B);
        *cache_ptr = D.26222;
        <D.26221>:
        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.26223>; else goto <D.26224>;
          <D.26223>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.26224>:
          D.26225 = ret != 0;
          D.26226 = (long int) D.26225;
          D.26227 = __builtin_expect (D.26226, 0);
          if (D.26227 != 0) goto <D.26228>; else goto <D.26229>;
          <D.26228>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4282, "ret == 0");
          <D.26229>:
        }
        if (res != 0B) goto <D.26230>; else goto <D.26231>;
        <D.26230>:
        D.26202 = res;
        return D.26202;
        <D.26231>:
      }
      goto <D.26232>;
      <D.26211>:
      D.26105 = method->klass;
      D.26198 = D.26105->image;
      D.26233 = &D.26198->delegate_invoke_cache;
      cache = get_cache (D.26233, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, sig);
      if (res != 0B) goto <D.26234>; else goto <D.26235>;
      <D.26234>:
      D.26202 = res;
      return D.26202;
      <D.26235>:
      <D.26232>:
      <D.26209>:
      <D.26203>:
      D.26105 = method->klass;
      D.26198 = D.26105->image;
      static_sig = signature_dup (D.26198, sig);
      static_sig->hasthis = 0;
      if (static_method_with_first_arg_bound == 0) goto <D.26236>; else goto <D.26237>;
      <D.26236>:
      invoke_sig = static_sig;
      <D.26237>:
      if (static_method_with_first_arg_bound != 0) goto <D.26238>; else goto <D.26239>;
      <D.26238>:
      name = mono_signature_to_name (invoke_sig, "invoke_bound_");
      goto <D.26240>;
      <D.26239>:
      name = mono_signature_to_name (sig, "invoke");
      <D.26240>:
      if (ctx != 0B) goto <D.26241>; else goto <D.26242>;
      <D.26241>:
      D.26105 = method->klass;
      mb = mono_mb_new (D.26105, name, 1);
      goto <D.26243>;
      <D.26242>:
      D.26105 = method->klass;
      D.26198 = D.26105->image;
      D.26244 = get_wrapper_target_class (D.26198);
      mb = mono_mb_new (D.26244, name, 1);
      <D.26243>:
      monoeg_g_free (name);
      D.26245 = mono_defaults.object_class;
      D.26246 = &D.26245->byval_arg;
      local_target = mono_mb_add_local (mb, D.26246);
      D.26245 = mono_defaults.object_class;
      D.26246 = &D.26245->byval_arg;
      local_prev = mono_mb_add_local (mb, D.26246);
      D.26247 = BIT_FIELD_REF <*sig, 8, 80>;
      D.26248 = D.26247 & 64;
      D.26249 = D.26248 == 0;
      D.26250 = (long int) D.26249;
      D.26251 = __builtin_expect (D.26250, 0);
      if (D.26251 != 0) goto <D.26252>; else goto <D.26253>;
      <D.26252>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4314, "sig->hasthis");
      <D.26253>:
      emit_thread_interrupt_checkpoint (mb);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 44);
      mono_mb_emit_byte (mb, 80);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_stloc (mb, local_prev.145);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.145);
      D.26255 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.26255;
      mono_mb_emit_byte (mb, 240);
      mono_mb_emit_byte (mb, 12);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.145);
      i = 0;
      goto <D.22130>;
      <D.22129>:
      D.26256 = i + 1;
      D.26257 = (unsigned int) D.26256;
      mono_mb_emit_ldarg (mb, D.26257);
      i = i + 1;
      <D.22130>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      if (D.26168 > i) goto <D.22129>; else goto <D.22131>;
      <D.22131>:
      if (ctx != 0B) goto <D.26258>; else goto <D.26259>;
      <D.26258>:
      D.26260 = &container->context;
      D.26261 = mono_class_inflate_generic_method (method, D.26260);
      mono_mb_emit_op (mb, 111, D.26261);
      goto <D.26262>;
      <D.26259>:
      mono_mb_emit_op (mb, 111, method);
      <D.26262>:
      D.26263 = sig->ret;
      D.26264 = D.26263->type;
      if (D.26264 != 1) goto <D.26265>; else goto <D.26266>;
      <D.26265>:
      mono_mb_emit_byte (mb, 38);
      <D.26266>:
      pos0.146 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.146);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 80);
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_stloc (mb, local_target.147);
      if (static_method_with_first_arg_bound == 0) goto <D.26269>; else goto <D.26270>;
      <D.26269>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.26271 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.26271;
      if (callvirt != 0) goto <D.26272>; else goto <D.26273>;
      <D.26272>:
      mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
      goto <D.26274>;
      <D.26273>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      i = 0;
      goto <D.22133>;
      <D.22132>:
      D.26256 = i + 1;
      D.26257 = (unsigned int) D.26256;
      mono_mb_emit_ldarg (mb, D.26257);
      i = i + 1;
      <D.22133>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      if (D.26168 > i) goto <D.22132>; else goto <D.22134>;
      <D.22134>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, sig);
      mono_mb_emit_byte (mb, 42);
      <D.26274>:
      pos0.146 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.146);
      <D.26270>:
      if (callvirt != 0) goto <D.26275>; else goto <D.26276>;
      <D.26275>:
      if (closed_over_null == 0) goto <D.26277>; else goto <D.26278>;
      <D.26277>:
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_op (mb, 116, target_class);
      i = 1;
      goto <D.22136>;
      <D.22135>:
      D.26256 = i + 1;
      D.26257 = (unsigned int) D.26256;
      mono_mb_emit_ldarg (mb, D.26257);
      i = i + 1;
      <D.22136>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      if (D.26168 > i) goto <D.22135>; else goto <D.22137>;
      <D.22137>:
      mono_mb_emit_op (mb, 111, target_method);
      goto <D.26279>;
      <D.26278>:
      mono_mb_emit_byte (mb, 20);
      i = 0;
      goto <D.22139>;
      <D.22138>:
      D.26256 = i + 1;
      D.26257 = (unsigned int) D.26256;
      mono_mb_emit_ldarg (mb, D.26257);
      i = i + 1;
      <D.22139>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      if (D.26168 > i) goto <D.22138>; else goto <D.22140>;
      <D.22140>:
      mono_mb_emit_op (mb, 40, target_method);
      <D.26279>:
      goto <D.26280>;
      <D.26276>:
      if (static_method_with_first_arg_bound != 0) goto <D.26281>; else goto <D.26282>;
      <D.26281>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.26283 = invoke_sig->params[0];
      D.26284 = mono_type_is_reference (D.26283);
      if (D.26284 == 0) goto <D.26285>; else goto <D.26286>;
      <D.26285>:
      D.26283 = invoke_sig->params[0];
      D.26287 = mono_class_from_mono_type (D.26283);
      mono_mb_emit_op (mb, 165, D.26287);
      <D.26286>:
      <D.26282>:
      i = 0;
      goto <D.22142>;
      <D.22141>:
      D.26256 = i + 1;
      D.26257 = (unsigned int) D.26256;
      mono_mb_emit_ldarg (mb, D.26257);
      i = i + 1;
      <D.22142>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      if (D.26168 > i) goto <D.22141>; else goto <D.22143>;
      <D.22143>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, invoke_sig);
      <D.26280>:
      mono_mb_emit_byte (mb, 42);
      mb->skip_visibility = 1;
      if (ctx != 0B) goto <D.26288>; else goto <D.26289>;
      <D.26288>:
      {
        struct MonoMethod * def;

        D.26105 = method->klass;
        D.26157 = sig->param_count;
        D.26168 = (int) D.26157;
        D.26290 = D.26168 + 16;
        def = mono_mb_create_and_cache (cache, D.26105, mb, sig, D.26290);
        res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
      }
      goto <D.26291>;
      <D.26289>:
      if (static_method_with_first_arg_bound != 0) goto <D.26292>; else goto <D.26293>;
      <D.26292>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      D.26290 = D.26168 + 16;
      res = mono_mb_create_and_cache (cache, invoke_sig, mb, sig, D.26290);
      info = mono_wrapper_info_create (res, 23);
      mono_marshal_set_wrapper_info (res, info);
      goto <D.26294>;
      <D.26293>:
      if (callvirt != 0) goto <D.26295>; else goto <D.26296>;
      <D.26295>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      D.26290 = D.26168 + 16;
      newm = mono_mb_create_method (mb, sig, D.26290);
      mono_memory_barrier ();
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.26297>; else goto <D.26298>;
        <D.26297>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.26298>:
        D.26299 = ret != 0;
        D.26300 = (long int) D.26299;
        D.26301 = __builtin_expect (D.26300, 0);
        if (D.26301 != 0) goto <D.26302>; else goto <D.26303>;
        <D.26302>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4432, "ret == 0");
        <D.26303>:
      }
      res = monoeg_g_hash_table_lookup (cache, &key);
      if (res == 0B) goto <D.26304>; else goto <D.26305>;
      <D.26304>:
      res = newm;
      new_key = monoeg_malloc0 (8);
      *new_key = key;
      if (static_method_with_first_arg_bound != 0) goto <D.26306>; else goto <D.26307>;
      <D.26306>:
      D.26077 = del->method;
      D.26308 = D.26077->klass;
      D.26309 = D.26308->image;
      D.26310 = key.sig;
      D.26311 = signature_dup (D.26309, D.26310);
      new_key->sig = D.26311;
      <D.26307>:
      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.26312>; else goto <D.26313>;
        <D.26312>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.26313>:
        D.26314 = ret != 0;
        D.26315 = (long int) D.26314;
        D.26316 = __builtin_expect (D.26315, 0);
        if (D.26316 != 0) goto <D.26317>; else goto <D.26318>;
        <D.26317>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4445, "ret == 0");
        <D.26318>:
      }
      goto <D.26319>;
      <D.26305>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.26320>; else goto <D.26321>;
        <D.26320>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.26321>:
        D.26322 = ret != 0;
        D.26323 = (long int) D.26322;
        D.26324 = __builtin_expect (D.26323, 0);
        if (D.26324 != 0) goto <D.26325>; else goto <D.26326>;
        <D.26325>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4447, "ret == 0");
        <D.26326>:
      }
      mono_free_method (newm);
      <D.26319>:
      goto <D.26327>;
      <D.26296>:
      D.26157 = sig->param_count;
      D.26168 = (int) D.26157;
      D.26290 = D.26168 + 16;
      res = mono_mb_create_and_cache (cache, sig, mb, sig, D.26290);
      info = mono_wrapper_info_create (res, 0);
      mono_marshal_set_wrapper_info (res, info);
      <D.26327>:
      <D.26294>:
      <D.26291>:
      mono_mb_free (mb);
      D.26202 = res;
      return D.26202;
    }
  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.26330;
  int iftmp.148;
  struct MonoMethodSignature * D.26334;
  struct MonoMethodSignature * D.26335;
  int D.26336;
  struct MonoMethod * D.26338;
  struct MonoMethod * D.26339;

  D.26334 = pair1->sig;
  D.26335 = pair2->sig;
  D.26336 = mono_metadata_signature_equal (D.26334, D.26335);
  if (D.26336 != 0) goto <D.26337>; else goto <D.26332>;
  <D.26337>:
  D.26338 = pair1->method;
  D.26339 = pair2->method;
  if (D.26338 == D.26339) goto <D.26340>; else goto <D.26332>;
  <D.26340>:
  iftmp.148 = 1;
  goto <D.26333>;
  <D.26332>:
  iftmp.148 = 0;
  <D.26333>:
  D.26330 = iftmp.148;
  return D.26330;
}


signature_method_pair_hash (const void * data)
{
  guint D.26342;
  struct MonoMethodSignature * D.26343;
  unsigned int D.26344;
  struct MonoMethod * D.26345;
  unsigned int D.26346;
  struct SignatureMethodPair * pair;

  pair = data;
  D.26343 = pair->sig;
  D.26344 = mono_signature_hash (D.26343);
  D.26345 = pair->method;
  D.26346 = mono_aligned_addr_hash (D.26345);
  D.26342 = D.26344 ^ D.26346;
  return D.26342;
}


mono_wrapper_info_create (struct MonoMethod * wrapper, WrapperSubtype subtype)
{
  struct MonoClass * D.26348;
  struct MonoImage * D.26349;
  struct WrapperInfo * D.26350;
  struct WrapperInfo * info;

  D.26348 = wrapper->klass;
  D.26349 = D.26348->image;
  info = mono_image_alloc0 (D.26349, 12);
  info->subtype = subtype;
  D.26350 = info;
  return D.26350;
}


mono_marshal_get_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.26352;
  struct MonoMethodSignature * D.26355;
  struct MonoMethodSignature * sig;

  D.26352 = mono_method_signature (method);
  sig = lookup_string_ctor_signature (D.26352);
  if (sig == 0B) goto <D.26353>; else goto <D.26354>;
  <D.26353>:
  sig = add_string_ctor_signature (method);
  <D.26354>:
  D.26355 = sig;
  return D.26355;
}


lookup_string_ctor_signature (struct MonoMethodSignature * sig)
{
  _Bool D.26359;
  long int D.26360;
  long int D.26361;
  struct MonoMethodSignature * D.26364;
  int D.26365;
  _Bool D.26370;
  long int D.26371;
  long int D.26372;
  struct MonoMethodSignature * D.26375;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;
  struct GSList * item;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26357>; else goto <D.26358>;
    <D.26357>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.26358>:
    D.26359 = ret != 0;
    D.26360 = (long int) D.26359;
    D.26361 = __builtin_expect (D.26360, 0);
    if (D.26361 != 0) goto <D.26362>; else goto <D.26363>;
    <D.26362>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4498, "ret == 0");
    <D.26363>:
  }
  callsig = 0B;
  item = strsig_list;
  goto <D.22172>;
  <D.22171>:
  cs = item->data;
  D.26364 = cs->ctor_sig;
  D.26365 = mono_metadata_signature_equal (sig, D.26364);
  if (D.26365 != 0) goto <D.26366>; else goto <D.26367>;
  <D.26366>:
  callsig = cs->sig;
  goto <D.22170>;
  <D.26367>:
  item = item->next;
  <D.22172>:
  if (item != 0B) goto <D.22171>; else goto <D.22170>;
  <D.22170>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26368>; else goto <D.26369>;
    <D.26368>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26369>:
    D.26370 = ret != 0;
    D.26371 = (long int) D.26370;
    D.26372 = __builtin_expect (D.26371, 0);
    if (D.26372 != 0) goto <D.26373>; else goto <D.26374>;
    <D.26373>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4510, "ret == 0");
    <D.26374>:
  }
  D.26375 = callsig;
  return D.26375;
}


add_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoClass * D.26377;
  struct MonoImage * D.26378;
  struct MonoMethodSignature * D.26379;
  struct MonoClass * D.26380;
  struct MonoType * D.26381;
  struct MonoMethodSignature * D.26382;
  _Bool D.26385;
  long int D.26386;
  long int D.26387;
  struct GSList * strsig_list.149;
  struct GSList * strsig_list.150;
  _Bool D.26394;
  long int D.26395;
  long int D.26396;
  struct MonoMethodSignature * D.26399;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;

  D.26377 = method->klass;
  D.26378 = D.26377->image;
  D.26379 = mono_method_signature (method);
  callsig = signature_dup (D.26378, D.26379);
  D.26380 = mono_defaults.string_class;
  D.26381 = &D.26380->byval_arg;
  callsig->ret = D.26381;
  cs = monoeg_malloc (8);
  cs->sig = callsig;
  D.26382 = mono_method_signature (method);
  cs->ctor_sig = D.26382;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26383>; else goto <D.26384>;
    <D.26383>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.26384>:
    D.26385 = ret != 0;
    D.26386 = (long int) D.26385;
    D.26387 = __builtin_expect (D.26386, 0);
    if (D.26387 != 0) goto <D.26388>; else goto <D.26389>;
    <D.26388>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4526, "ret == 0");
    <D.26389>:
  }
  strsig_list.149 = strsig_list;
  strsig_list.150 = monoeg_g_slist_prepend (strsig_list.149, cs);
  strsig_list = strsig_list.150;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26392>; else goto <D.26393>;
    <D.26392>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26393>:
    D.26394 = ret != 0;
    D.26395 = (long int) D.26394;
    D.26396 = __builtin_expect (D.26395, 0);
    if (D.26396 != 0) goto <D.26397>; else goto <D.26398>;
    <D.26397>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4528, "ret == 0");
    <D.26398>:
  }
  D.26399 = callsig;
  return D.26399;
}


mono_marshal_get_runtime_invoke (struct MonoMethod * method, gboolean virtual)
{
  _Bool D.26401;
  long int D.26402;
  long int D.26403;
  struct MonoMethodSignature * cctor_signature.151;
  struct MonoImage * D.26409;
  struct MonoMethodSignature * cctor_signature.152;
  struct MonoClass * D.26411;
  struct MonoType * D.26412;
  struct MonoMethodSignature * finalize_signature.153;
  struct MonoMethodSignature * finalize_signature.154;
  struct MonoClass * D.26421;
  struct MonoImage * D.26422;
  struct GHashTable * * D.26423;
  struct GHashTable * * D.26425;
  struct MonoMethod * D.26428;
  unsigned char D.26429;
  short unsigned int D.26432;
  unsigned int D.26433;
  unsigned int D.26434;
  unsigned char D.26437;
  unsigned char D.26438;
  struct MonoMethodSignature * D.26441;
  unsigned char D.26445;
  unsigned char D.26446;
  struct MonoMethodSignature * D.26449;
  int D.26451;
  int D.26455;
  unsigned char D.26463;
  unsigned char D.26464;
  struct MonoMethodSignature * D.26466;
  unsigned char D.26467;
  unsigned char D.26468;
  struct MonoImage * D.26470;
  struct GHashTable * * D.26471;
  struct GHashTable * * D.26472;
  _Bool D.26475;
  long int D.26476;
  long int D.26477;
  _Bool D.26482;
  long int D.26483;
  long int D.26484;
  struct MonoClass * D.26489;
  struct MonoType * D.26490;
  struct MonoMethodSignature * D.26494;
  unsigned char D.26495;
  unsigned char D.26496;
  struct MonoType * D.26498;
  struct MonoType * D.26499;
  struct MonoClass * D.26500;
  struct MonoType * D.26501;
  const char * iftmp.155;
  short unsigned int D.26508;
  int D.26509;
  int D.26510;
  WrapperSubtype iftmp.156;
  _Bool D.26518;
  long int D.26519;
  long int D.26520;
  _Bool D.26525;
  long int D.26526;
  long int D.26527;
  _Bool D.26534;
  long int D.26535;
  long int D.26536;
  struct GHashTable * D.26541;
  _Bool D.26545;
  long int D.26546;
  long int D.26547;
  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.26401 = method == 0B;
      D.26402 = (long int) D.26401;
      D.26403 = __builtin_expect (D.26402, 0);
      if (D.26403 != 0) goto <D.26404>; else goto <D.26405>;
      <D.26404>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4932, "method");
      <D.26405>:
      cctor_signature.151 = cctor_signature;
      if (cctor_signature.151 == 0B) goto <D.26407>; else goto <D.26408>;
      <D.26407>:
      D.26409 = mono_defaults.corlib;
      cctor_signature.152 = mono_metadata_signature_alloc (D.26409, 0);
      cctor_signature = cctor_signature.152;
      cctor_signature.151 = cctor_signature;
      D.26411 = mono_defaults.void_class;
      D.26412 = &D.26411->byval_arg;
      cctor_signature.151->ret = D.26412;
      <D.26408>:
      finalize_signature.153 = finalize_signature;
      if (finalize_signature.153 == 0B) goto <D.26414>; else goto <D.26415>;
      <D.26414>:
      D.26409 = mono_defaults.corlib;
      finalize_signature.154 = mono_metadata_signature_alloc (D.26409, 0);
      finalize_signature = finalize_signature.154;
      finalize_signature.153 = finalize_signature;
      D.26411 = mono_defaults.void_class;
      D.26412 = &D.26411->byval_arg;
      finalize_signature.153->ret = D.26412;
      finalize_signature.153 = finalize_signature;
      finalize_signature.153->hasthis = 1;
      <D.26415>:
      if (virtual != 0) goto <D.26417>; else goto <D.26418>;
      <D.26417>:
      need_direct_wrapper = 1;
      <D.26418>:
      if (virtual != 0) goto <D.26419>; else goto <D.26420>;
      <D.26419>:
      D.26421 = method->klass;
      D.26422 = D.26421->image;
      D.26423 = &D.26422->runtime_invoke_vcall_cache;
      cache = get_cache (D.26423, mono_aligned_addr_hash, 0B);
      goto <D.26424>;
      <D.26420>:
      D.26421 = method->klass;
      D.26422 = D.26421->image;
      D.26425 = &D.26422->runtime_invoke_direct_cache;
      cache = get_cache (D.26425, mono_aligned_addr_hash, 0B);
      <D.26424>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26426>; else goto <D.26427>;
      <D.26426>:
      D.26428 = res;
      return D.26428;
      <D.26427>:
      D.26421 = method->klass;
      D.26429 = D.26421->rank;
      if (D.26429 != 0) goto <D.26430>; else goto <D.26431>;
      <D.26430>:
      D.26432 = method->iflags;
      D.26433 = (unsigned int) D.26432;
      D.26434 = D.26433 & 4097;
      if (D.26434 == 4097) goto <D.26435>; else goto <D.26436>;
      <D.26435>:
      need_direct_wrapper = 1;
      <D.26436>:
      <D.26431>:
      D.26437 = BIT_FIELD_REF <*method, 8, 160>;
      D.26438 = D.26437 & 128;
      if (D.26438 != 0) goto <D.26439>; else goto <D.26440>;
      <D.26439>:
      D.26441 = mono_method_signature (method);
      callsig = lookup_string_ctor_signature (D.26441);
      if (callsig == 0B) goto <D.26442>; else goto <D.26443>;
      <D.26442>:
      callsig = add_string_ctor_signature (method);
      <D.26443>:
      need_direct_wrapper = 1;
      goto <D.26444>;
      <D.26440>:
      D.26445 = BIT_FIELD_REF <*method, 8, 168>;
      D.26446 = D.26445 & 2;
      if (D.26446 != 0) goto <D.26447>; else goto <D.26448>;
      <D.26447>:
      D.26421 = method->klass;
      D.26422 = D.26421->image;
      D.26449 = mono_method_signature (method);
      callsig = signature_dup (D.26422, D.26449);
      goto <D.26450>;
      <D.26448>:
      callsig = mono_method_signature (method);
      <D.26450>:
      <D.26444>:
      D.26421 = method->klass;
      D.26422 = D.26421->image;
      target_klass = get_wrapper_target_class (D.26422);
      cctor_signature.151 = cctor_signature;
      D.26451 = mono_metadata_signature_equal (callsig, cctor_signature.151);
      if (D.26451 != 0) goto <D.26452>; else goto <D.26453>;
      <D.26452>:
      callsig = cctor_signature;
      target_klass = mono_defaults.object_class;
      goto <D.26454>;
      <D.26453>:
      finalize_signature.153 = finalize_signature;
      D.26455 = mono_metadata_signature_equal (callsig, finalize_signature.153);
      if (D.26455 != 0) goto <D.26456>; else goto <D.26457>;
      <D.26456>:
      callsig = finalize_signature;
      target_klass = mono_defaults.object_class;
      <D.26457>:
      <D.26454>:
      if (need_direct_wrapper != 0) goto <D.26458>; else goto <D.26459>;
      <D.26458>:
      goto <D.26460>;
      <D.26459>:
      {
        struct MonoMethodSignature * tmp_sig;

        callsig = mono_marshal_get_runtime_invoke_sig (callsig);
        D.26421 = method->klass;
        D.26463 = BIT_FIELD_REF <*D.26421, 8, 160>;
        D.26464 = D.26463 & 8;
        if (D.26464 != 0) goto <D.26465>; else goto <D.26461>;
        <D.26465>:
        D.26466 = mono_method_signature (method);
        D.26467 = BIT_FIELD_REF <*D.26466, 8, 80>;
        D.26468 = D.26467 & 64;
        if (D.26468 != 0) goto <D.26469>; else goto <D.26461>;
        <D.26469>:
        D.26470 = target_klass->image;
        D.26471 = &D.26470->runtime_invoke_vtype_cache;
        cache = get_cache (D.26471, mono_signature_hash, runtime_invoke_signature_equal);
        goto <D.26462>;
        <D.26461>:
        D.26470 = target_klass->image;
        D.26472 = &D.26470->runtime_invoke_cache;
        cache = get_cache (D.26472, mono_signature_hash, runtime_invoke_signature_equal);
        <D.26462>:
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.26473>; else goto <D.26474>;
          <D.26473>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.26474>:
          D.26475 = ret != 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", 5010, "ret == 0");
          <D.26479>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.26480>; else goto <D.26481>;
          <D.26480>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.26481>:
          D.26482 = ret != 0;
          D.26483 = (long int) D.26482;
          D.26484 = __builtin_expect (D.26483, 0);
          if (D.26484 != 0) goto <D.26485>; else goto <D.26486>;
          <D.26485>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5012, "ret == 0");
          <D.26486>:
        }
        if (res != 0B) goto <D.26487>; else goto <D.26488>;
        <D.26487>:
        monoeg_g_free (callsig);
        D.26428 = res;
        return D.26428;
        <D.26488>:
        tmp_sig = callsig;
        D.26470 = target_klass->image;
        callsig = mono_metadata_signature_dup_full (D.26470, callsig);
        monoeg_g_free (tmp_sig);
      }
      <D.26460>:
      sig = mono_method_signature (method);
      D.26470 = target_klass->image;
      csig = mono_metadata_signature_alloc (D.26470, 4);
      D.26489 = mono_defaults.object_class;
      D.26490 = &D.26489->byval_arg;
      csig->ret = D.26490;
      D.26421 = method->klass;
      D.26463 = BIT_FIELD_REF <*D.26421, 8, 160>;
      D.26464 = D.26463 & 8;
      if (D.26464 != 0) goto <D.26493>; else goto <D.26491>;
      <D.26493>:
      D.26494 = mono_method_signature (method);
      D.26495 = BIT_FIELD_REF <*D.26494, 8, 80>;
      D.26496 = D.26495 & 64;
      if (D.26496 != 0) goto <D.26497>; else goto <D.26491>;
      <D.26497>:
      D.26421 = method->klass;
      D.26498 = &D.26421->this_arg;
      D.26499 = get_runtime_invoke_type (D.26498, 0);
      csig->params[0] = D.26499;
      goto <D.26492>;
      <D.26491>:
      D.26489 = mono_defaults.object_class;
      D.26490 = &D.26489->byval_arg;
      csig->params[0] = D.26490;
      <D.26492>:
      D.26500 = mono_defaults.int_class;
      D.26501 = &D.26500->byval_arg;
      csig->params[1] = D.26501;
      D.26500 = mono_defaults.int_class;
      D.26501 = &D.26500->byval_arg;
      csig->params[2] = D.26501;
      D.26500 = mono_defaults.int_class;
      D.26501 = &D.26500->byval_arg;
      csig->params[3] = D.26501;
      csig->pinvoke = 1;
      if (virtual != 0) goto <D.26503>; else goto <D.26504>;
      <D.26503>:
      iftmp.155 = "runtime_invoke_virtual";
      goto <D.26505>;
      <D.26504>:
      iftmp.155 = "runtime_invoke";
      <D.26505>:
      name = mono_signature_to_name (callsig, iftmp.155);
      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.26506>; else goto <D.26507>;
      <D.26506>:
      mb->skip_visibility = 1;
      D.26508 = sig->param_count;
      D.26509 = (int) D.26508;
      D.26510 = D.26509 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26510);
      if (virtual != 0) goto <D.26512>; else goto <D.26513>;
      <D.26512>:
      iftmp.156 = 14;
      goto <D.26514>;
      <D.26513>:
      iftmp.156 = 13;
      <D.26514>:
      info = mono_wrapper_info_create (res, iftmp.156);
      info->d.runtime_invoke.method = method;
      mono_marshal_set_wrapper_info (res, info);
      goto <D.26515>;
      <D.26507>:
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.26516>; else goto <D.26517>;
        <D.26516>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.26517>:
        D.26518 = ret != 0;
        D.26519 = (long int) D.26518;
        D.26520 = __builtin_expect (D.26519, 0);
        if (D.26520 != 0) goto <D.26521>; else goto <D.26522>;
        <D.26521>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5067, "ret == 0");
        <D.26522>:
      }
      res = monoeg_g_hash_table_lookup (cache, callsig);
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.26523>; else goto <D.26524>;
        <D.26523>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.26524>:
        D.26525 = ret != 0;
        D.26526 = (long int) D.26525;
        D.26527 = __builtin_expect (D.26526, 0);
        if (D.26527 != 0) goto <D.26528>; else goto <D.26529>;
        <D.26528>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5069, "ret == 0");
        <D.26529>:
      }
      if (res == 0B) goto <D.26530>; else goto <D.26531>;
      <D.26530>:
      {
        struct MonoMethod * newm;

        D.26508 = sig->param_count;
        D.26509 = (int) D.26508;
        D.26510 = D.26509 + 16;
        newm = mono_mb_create_method (mb, csig, D.26510);
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.26532>; else goto <D.26533>;
          <D.26532>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.26533>:
          D.26534 = ret != 0;
          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", 5076, "ret == 0");
          <D.26538>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        if (res == 0B) goto <D.26539>; else goto <D.26540>;
        <D.26539>:
        res = newm;
        monoeg_g_hash_table_insert_replace (cache, callsig, res, 0);
        D.26421 = method->klass;
        D.26422 = D.26421->image;
        D.26541 = D.26422->runtime_invoke_direct_cache;
        monoeg_g_hash_table_insert_replace (D.26541, 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.26542>;
        <D.26540>:
        mono_free_method (newm);
        <D.26542>:
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.26543>; else goto <D.26544>;
          <D.26543>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.26544>:
          D.26545 = ret != 0;
          D.26546 = (long int) D.26545;
          D.26547 = __builtin_expect (D.26546, 0);
          if (D.26547 != 0) goto <D.26548>; else goto <D.26549>;
          <D.26548>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5089, "ret == 0");
          <D.26549>:
        }
      }
      <D.26531>:
      <D.26515>:
      mono_mb_free (mb);
      D.26428 = res;
      return D.26428;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


runtime_invoke_signature_equal (struct MonoMethodSignature * sig1, struct MonoMethodSignature * sig2)
{
  struct MonoType * D.26554;
  struct MonoType * D.26555;
  int D.26557;
  int D.26559;
  int D.26560;
  gboolean D.26562;

  D.26554 = sig1->ret;
  D.26555 = sig2->ret;
  if (D.26554 != D.26555) goto <D.26556>; else goto <D.26552>;
  <D.26556>:
  D.26554 = sig1->ret;
  D.26557 = mono_type_is_reference (D.26554);
  if (D.26557 == 0) goto <D.26553>; else goto <D.26558>;
  <D.26558>:
  D.26555 = sig2->ret;
  D.26559 = mono_type_is_reference (D.26555);
  if (D.26559 == 0) goto <D.26553>; else goto <D.26552>;
  <D.26553>:
  D.26554 = sig1->ret;
  D.26555 = sig2->ret;
  D.26560 = mono_metadata_type_equal (D.26554, D.26555);
  if (D.26560 == 0) goto <D.26561>; else goto <D.26552>;
  <D.26561>:
  D.26562 = 0;
  return D.26562;
  <D.26552>:
  D.26562 = mono_metadata_signature_equal (sig1, sig2);
  return D.26562;
}


mono_marshal_get_runtime_invoke_sig (struct MonoMethodSignature * sig)
{
  struct MonoType * D.26564;
  struct MonoType * D.26565;
  struct MonoType * D.26566;
  struct MonoType * D.26567;
  short unsigned int D.26568;
  int D.26569;
  struct MonoMethodSignature * D.26570;
  struct MonoMethodSignature * res;
  int i;

  res = mono_metadata_signature_dup (sig);
  D.26564 = sig->ret;
  D.26565 = get_runtime_invoke_type (D.26564, 1);
  res->ret = D.26565;
  i = 0;
  goto <D.22203>;
  <D.22202>:
  D.26566 = sig->params[i];
  D.26567 = get_runtime_invoke_type (D.26566, 0);
  res->params[i] = D.26567;
  i = i + 1;
  <D.22203>:
  D.26568 = res->param_count;
  D.26569 = (int) D.26568;
  if (D.26569 > i) goto <D.22202>; else goto <D.22204>;
  <D.22204>:
  D.26570 = res;
  return D.26570;
}


get_runtime_invoke_type (struct MonoType * t, gboolean ret)
{
  unsigned char D.26572;
  unsigned char D.26573;
  unsigned char D.26576;
  struct MonoClass * D.26579;
  int D.26580;
  struct MonoType * D.26583;
  struct MonoClass * D.26584;
  int D.26585;
  struct MonoClass * D.26588;
  int D.26591;
  struct MonoClass * D.26592;
  struct MonoClass * D.26593;
  struct MonoClass * D.26594;
  struct MonoClass * D.26595;
  unsigned char D.26596;
  unsigned char D.26597;
  void handle_enum = <<< error >>>;

  D.26572 = BIT_FIELD_REF <*t, 8, 56>;
  D.26573 = D.26572 & 64;
  if (D.26573 != 0) goto <D.26574>; else goto <D.26575>;
  <D.26574>:
  D.26576 = t->type;
  if (D.26576 == 21) goto <D.26577>; else goto <D.26578>;
  <D.26577>:
  D.26579 = mono_class_from_mono_type (t);
  D.26580 = mono_class_is_nullable (D.26579);
  if (D.26580 != 0) goto <D.26581>; else goto <D.26582>;
  <D.26581>:
  D.26583 = t;
  return D.26583;
  <D.26582>:
  <D.26578>:
  D.26584 = mono_defaults.int_class;
  D.26583 = &D.26584->this_arg;
  return D.26583;
  <D.26575>:
  D.26585 = mono_type_is_reference (t);
  if (D.26585 != 0) goto <D.26586>; else goto <D.26587>;
  <D.26586>:
  D.26588 = mono_defaults.object_class;
  D.26583 = &D.26588->byval_arg;
  return D.26583;
  <D.26587>:
  if (ret != 0) goto <D.26589>; else goto <D.26590>;
  <D.26589>:
  D.26583 = t;
  return D.26583;
  <D.26590>:
  handle_enum:
  D.26576 = t->type;
  D.26591 = (int) D.26576;
  switch (D.26591) <default: <D.22196>, case 2: <D.22191>, case 3: <D.22192>, case 11: <D.22190>, case 15: <D.22194>, case 17: <D.22195>, case 25: <D.22193>>
  <D.22190>:
  D.26592 = mono_defaults.int64_class;
  D.26583 = &D.26592->byval_arg;
  return D.26583;
  <D.22191>:
  D.26593 = mono_defaults.byte_class;
  D.26583 = &D.26593->byval_arg;
  return D.26583;
  <D.22192>:
  D.26594 = mono_defaults.uint16_class;
  D.26583 = &D.26594->byval_arg;
  return D.26583;
  <D.22193>:
  <D.22194>:
  D.26584 = mono_defaults.int_class;
  D.26583 = &D.26584->byval_arg;
  return D.26583;
  <D.22195>:
  D.26595 = t->data.klass;
  D.26596 = BIT_FIELD_REF <*D.26595, 8, 160>;
  D.26597 = D.26596 & 16;
  if (D.26597 != 0) goto <D.26598>; else goto <D.26599>;
  <D.26598>:
  D.26595 = t->data.klass;
  t = mono_class_enum_basetype (D.26595);
  goto handle_enum;
  <D.26599>:
  D.26583 = t;
  return D.26583;
  <D.22196>:
  D.26583 = t;
  return D.26583;
}


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.26601;
  struct MonoType * D.26602;
  unsigned int D.26603;
  int D.26604;
  int D.26605;
  unsigned int D.26606;
  int D.26607;
  struct MonoImage * D.26608;
  struct MonoClass * D.26609;
  int D.26610;
  unsigned int D.26611;
  int D.26612;
  int D.26613;
  unsigned int D.26614;
  int D.26615;
  unsigned int D.26616;
  unsigned int loc_exc.157;
  int D.26618;
  unsigned int D.26619;
  unsigned int D.26620;
  unsigned int D.26621;
  int D.26622;
  unsigned int D.26623;
  unsigned int loc_res.158;
  int D.26625;
  unsigned int D.26626;
  gint32 labels[16];
  struct MonoExceptionClause * clause;
  int loc_res;
  int loc_exc;

  try
    {
      D.26601 = mono_defaults.object_class;
      D.26602 = &D.26601->byval_arg;
      loc_res = mono_mb_add_local (mb, D.26602);
      D.26601 = mono_defaults.object_class;
      D.26602 = &D.26601->byval_arg;
      loc_exc = mono_mb_add_local (mb, D.26602);
      mono_mb_emit_byte (mb, 4);
      D.26603 = mono_mb_emit_branch (mb, 57);
      D.26604 = (int) D.26603;
      labels[0] = D.26604;
      D.26605 = mono_mb_get_label (mb);
      labels[1] = D.26605;
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      D.26606 = mono_mb_emit_branch (mb, 221);
      D.26607 = (int) D.26606;
      labels[2] = D.26607;
      D.26608 = target_klass->image;
      clause = mono_image_alloc0 (D.26608, 24);
      clause->flags = 0;
      D.26609 = mono_defaults.exception_class;
      clause->data.catch_class = D.26609;
      D.26610 = labels[1];
      D.26611 = (unsigned int) D.26610;
      clause->try_offset = D.26611;
      D.26612 = mono_mb_get_label (mb);
      D.26610 = labels[1];
      D.26613 = D.26612 - D.26610;
      D.26614 = (unsigned int) D.26613;
      clause->try_len = D.26614;
      D.26615 = mono_mb_get_label (mb);
      D.26616 = (unsigned int) D.26615;
      clause->handler_offset = D.26616;
      loc_exc.157 = (unsigned int) loc_exc;
      mono_mb_emit_stloc (mb, loc_exc.157);
      mono_mb_emit_byte (mb, 4);
      loc_exc.157 = (unsigned int) loc_exc;
      mono_mb_emit_ldloc (mb, loc_exc.157);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_branch (mb, 221);
      D.26618 = mono_mb_get_pos (mb);
      D.26619 = (unsigned int) D.26618;
      D.26620 = clause->handler_offset;
      D.26621 = D.26619 - D.26620;
      clause->handler_len = D.26621;
      mono_mb_set_clauses (mb, 1, clause);
      D.26622 = labels[2];
      D.26623 = (unsigned int) D.26622;
      mono_mb_patch_branch (mb, D.26623);
      loc_res.158 = (unsigned int) loc_res;
      mono_mb_emit_ldloc (mb, loc_res.158);
      mono_mb_emit_byte (mb, 42);
      D.26625 = labels[0];
      D.26626 = (unsigned int) D.26625;
      mono_mb_patch_branch (mb, D.26626);
      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.159;
  void * D.26632;
  struct MonoString * string_dummy.160;
  unsigned char D.26636;
  unsigned char D.26637;
  _Bool D.26638;
  long int D.26639;
  long int D.26640;
  short unsigned int D.26643;
  int D.26644;
  int D.26645;
  _Bool D.26646;
  long int D.26647;
  long int D.26648;
  unsigned char D.26653;
  unsigned char D.26654;
  int D.26657;
  short unsigned int D.26662;
  unsigned int D.26663;
  unsigned int D.26664;
  unsigned int i.161;
  unsigned int D.26668;
  int D.26669;
  unsigned char D.26670;
  unsigned char D.26671;
  unsigned char D.26674;
  struct MonoClass * D.26677;
  int D.26678;
  int * D.26681;
  struct MonoClass * D.26682;
  struct MonoType * D.26683;
  int D.26684;
  struct MonoClass * D.26685;
  int D.26686;
  unsigned int D.26687;
  struct MonoType * D.26688;
  unsigned char D.26689;
  unsigned int D.26690;
  unsigned char D.26691;
  unsigned int D.26692;
  unsigned char D.26693;
  int D.26694;
  unsigned int D.26697;
  unsigned char D.26698;
  struct MonoClass * D.26701;
  unsigned char D.26702;
  unsigned char D.26703;
  struct MonoType * D.26706;
  unsigned char D.26707;
  struct MonoClass * D.26708;
  int D.26709;
  struct MonoClass * D.26712;
  struct MonoClass * D.26713;
  struct MonoClass * D.26715;
  int D.26716;
  struct MonoType * D.26723;
  unsigned char D.26724;
  unsigned char D.26725;
  unsigned char D.26728;
  int D.26729;
  struct MonoClass * D.26732;
  struct MonoClass * D.26733;
  unsigned int loc_res.162;
  short unsigned int D.26737;
  short unsigned int D.26738;
  struct MonoClass * D.26741;
  int D.26742;
  struct MonoClass * D.26745;
  static struct MonoString * string_dummy = 0B;
  int i;
  int * tmp_nullable_locals;
  gboolean void_ret;
  void handle_enum = <<< error >>>;

  void_ret = 0;
  string_dummy.159 = string_dummy;
  if (string_dummy.159 == 0B) goto <D.26628>; else goto <D.26629>;
  <D.26628>:
  if (0 != 0) goto <D.26630>; else goto <D.26631>;
  <D.26630>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4644, "sizeof (string_dummy) == sizeof (MonoObject*)");
  <D.26631>:
  D.26632 = mono_gc_make_root_descr_all_refs (1);
  mono_gc_register_root (&string_dummy, 4, D.26632);
  string_dummy.160 = mono_string_new_wrapper ("dummy");
  string_dummy = string_dummy.160;
  <D.26629>:
  if (virtual != 0) goto <D.26634>; else goto <D.26635>;
  <D.26634>:
  D.26636 = BIT_FIELD_REF <*sig, 8, 80>;
  D.26637 = D.26636 & 64;
  D.26638 = D.26637 == 0;
  D.26639 = (long int) D.26638;
  D.26640 = __builtin_expect (D.26639, 0);
  if (D.26640 != 0) goto <D.26641>; else goto <D.26642>;
  <D.26641>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4649, "sig->hasthis");
  <D.26642>:
  D.26643 = method->flags;
  D.26644 = (int) D.26643;
  D.26645 = D.26644 & 64;
  D.26646 = D.26645 == 0;
  D.26647 = (long int) D.26646;
  D.26648 = __builtin_expect (D.26647, 0);
  if (D.26648 != 0) goto <D.26649>; else goto <D.26650>;
  <D.26649>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4650, "method->flags & METHOD_ATTRIBUTE_VIRTUAL");
  <D.26650>:
  <D.26635>:
  D.26636 = BIT_FIELD_REF <*sig, 8, 80>;
  D.26637 = D.26636 & 64;
  if (D.26637 != 0) goto <D.26651>; else goto <D.26652>;
  <D.26651>:
  D.26653 = BIT_FIELD_REF <*method, 8, 160>;
  D.26654 = D.26653 & 128;
  if (D.26654 != 0) goto <D.26655>; else goto <D.26656>;
  <D.26655>:
  D.26657 = mono_gc_is_moving ();
  if (D.26657 != 0) goto <D.26658>; else goto <D.26659>;
  <D.26658>:
  mono_mb_emit_ptr (mb, &string_dummy);
  mono_mb_emit_byte (mb, 80);
  goto <D.26660>;
  <D.26659>:
  string_dummy.159 = string_dummy;
  mono_mb_emit_ptr (mb, string_dummy.159);
  <D.26660>:
  goto <D.26661>;
  <D.26656>:
  mono_mb_emit_ldarg (mb, 0);
  <D.26661>:
  <D.26652>:
  D.26662 = sig->param_count;
  D.26663 = (unsigned int) D.26662;
  D.26664 = D.26663 * 4;
  tmp_nullable_locals = monoeg_malloc0 (D.26664);
  i = 0;
  goto <D.22251>;
  <D.22250>:
  {
    struct MonoType * t;
    int type;

    t = sig->params[i];
    mono_mb_emit_ldarg (mb, 1);
    if (i != 0) goto <D.26665>; else goto <D.26666>;
    <D.26665>:
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26669 = (int) D.26668;
    mono_mb_emit_icon (mb, D.26669);
    mono_mb_emit_byte (mb, 88);
    <D.26666>:
    D.26670 = BIT_FIELD_REF <*t, 8, 56>;
    D.26671 = D.26670 & 64;
    if (D.26671 != 0) goto <D.26672>; else goto <D.26673>;
    <D.26672>:
    mono_mb_emit_byte (mb, 77);
    D.26674 = t->type;
    if (D.26674 == 21) goto <D.26675>; else goto <D.26676>;
    <D.26675>:
    D.26677 = mono_class_from_mono_type (t);
    D.26678 = mono_class_is_nullable (D.26677);
    if (D.26678 != 0) goto <D.26679>; else goto <D.26680>;
    <D.26679>:
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26681 = tmp_nullable_locals + D.26668;
    D.26682 = mono_class_from_mono_type (t);
    D.26683 = &D.26682->byval_arg;
    D.26684 = mono_mb_add_local (mb, D.26683);
    *D.26681 = D.26684;
    D.26685 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 165, D.26685);
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26681 = tmp_nullable_locals + D.26668;
    D.26686 = *D.26681;
    D.26687 = (unsigned int) D.26686;
    mono_mb_emit_stloc (mb, D.26687);
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26681 = tmp_nullable_locals + D.26668;
    D.26686 = *D.26681;
    D.26687 = (unsigned int) D.26686;
    mono_mb_emit_ldloc_addr (mb, D.26687);
    <D.26680>:
    <D.26676>:
    // predicted unlikely by continue predictor.
    goto <D.22224>;
    <D.26673>:
    D.26688 = sig->params[i];
    D.26689 = D.26688->type;
    type = (int) D.26689;
    handle_enum:
    switch (type) <default: <D.22249>, case 2: <D.22227>, case 3: <D.22231>, case 4: <D.22226>, case 5: <D.22228>, case 6: <D.22229>, case 7: <D.22230>, case 8: <D.22234>, case 9: <D.22235>, case 10: <D.22238>, case 11: <D.22239>, case 12: <D.22236>, case 13: <D.22237>, case 14: <D.22241>, case 15: <D.22244>, case 17: <D.22248>, case 18: <D.22242>, case 20: <D.22243>, case 21: <D.22247>, case 24: <D.22232>, case 25: <D.22233>, case 28: <D.22246>, case 29: <D.22245>>
    <D.22226>:
    <D.22227>:
    <D.22228>:
    <D.22229>:
    <D.22230>:
    <D.22231>:
    <D.22232>:
    <D.22233>:
    <D.22234>:
    <D.22235>:
    <D.22236>:
    <D.22237>:
    <D.22238>:
    <D.22239>:
    mono_mb_emit_byte (mb, 77);
    D.26688 = sig->params[i];
    D.26690 = mono_type_to_ldind (D.26688);
    D.26691 = (unsigned char) D.26690;
    mono_mb_emit_byte (mb, D.26691);
    goto <D.22240>;
    <D.22241>:
    <D.22242>:
    <D.22243>:
    <D.22244>:
    <D.22245>:
    <D.22246>:
    D.26688 = sig->params[i];
    D.26692 = mono_type_to_ldind (D.26688);
    D.26693 = (unsigned char) D.26692;
    mono_mb_emit_byte (mb, D.26693);
    goto <D.22240>;
    <D.22247>:
    D.26688 = sig->params[i];
    D.26694 = mono_type_generic_inst_is_valuetype (D.26688);
    if (D.26694 == 0) goto <D.26695>; else goto <D.26696>;
    <D.26695>:
    D.26688 = sig->params[i];
    D.26697 = mono_type_to_ldind (D.26688);
    D.26698 = (unsigned char) D.26697;
    mono_mb_emit_byte (mb, D.26698);
    goto <D.22240>;
    <D.26696>:
    <D.22248>:
    if (type == 17) goto <D.26699>; else goto <D.26700>;
    <D.26699>:
    D.26701 = t->data.klass;
    D.26702 = BIT_FIELD_REF <*D.26701, 8, 160>;
    D.26703 = D.26702 & 16;
    if (D.26703 != 0) goto <D.26704>; else goto <D.26705>;
    <D.26704>:
    D.26701 = t->data.klass;
    D.26706 = mono_class_enum_basetype (D.26701);
    D.26707 = D.26706->type;
    type = (int) D.26707;
    goto handle_enum;
    <D.26705>:
    <D.26700>:
    mono_mb_emit_byte (mb, 77);
    D.26688 = sig->params[i];
    D.26708 = mono_class_from_mono_type (D.26688);
    D.26709 = mono_class_is_nullable (D.26708);
    if (D.26709 != 0) goto <D.26710>; else goto <D.26711>;
    <D.26710>:
    D.26688 = sig->params[i];
    D.26712 = mono_class_from_mono_type (D.26688);
    mono_mb_emit_op (mb, 121, D.26712);
    D.26688 = sig->params[i];
    D.26713 = mono_class_from_mono_type (D.26688);
    mono_mb_emit_op (mb, 113, D.26713);
    goto <D.26714>;
    <D.26711>:
    D.26688 = sig->params[i];
    D.26715 = mono_class_from_mono_type (D.26688);
    mono_mb_emit_op (mb, 113, D.26715);
    <D.26714>:
    goto <D.22240>;
    <D.22249>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4744);
    <D.22240>:
  }
  <D.22224>:
  i = i + 1;
  <D.22251>:
  D.26662 = sig->param_count;
  D.26716 = (int) D.26662;
  if (D.26716 > i) goto <D.22250>; else goto <D.22252>;
  <D.22252>:
  if (virtual != 0) goto <D.26717>; else goto <D.26718>;
  <D.26717>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.26719>;
  <D.26718>:
  if (need_direct_wrapper != 0) goto <D.26720>; else goto <D.26721>;
  <D.26720>:
  mono_mb_emit_op (mb, 40, method);
  goto <D.26722>;
  <D.26721>:
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_calli (mb, callsig);
  <D.26722>:
  <D.26719>:
  D.26723 = sig->ret;
  D.26724 = BIT_FIELD_REF <*D.26723, 8, 56>;
  D.26725 = D.26724 & 64;
  if (D.26725 != 0) goto <D.26726>; else goto <D.26727>;
  <D.26726>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4759);
  <D.26727>:
  D.26723 = sig->ret;
  D.26728 = D.26723->type;
  D.26729 = (int) D.26728;
  switch (D.26729) <default: <D.22278>, case 1: <D.22253>, case 2: <D.22255>, case 3: <D.22256>, case 4: <D.22257>, case 5: <D.22258>, case 6: <D.22259>, case 7: <D.22260>, case 8: <D.22261>, case 9: <D.22262>, case 10: <D.22267>, case 11: <D.22268>, case 12: <D.22265>, case 13: <D.22266>, case 14: <D.22272>, case 15: <D.22277>, case 17: <D.22269>, case 18: <D.22273>, case 20: <D.22274>, case 21: <D.22271>, case 22: <D.22270>, case 24: <D.22263>, case 25: <D.22264>, case 28: <D.22276>, case 29: <D.22275>>
  <D.22253>:
  D.26653 = BIT_FIELD_REF <*method, 8, 160>;
  D.26654 = D.26653 & 128;
  if (D.26654 == 0) goto <D.26730>; else goto <D.26731>;
  <D.26730>:
  void_ret = 1;
  <D.26731>:
  goto <D.22254>;
  <D.22255>:
  <D.22256>:
  <D.22257>:
  <D.22258>:
  <D.22259>:
  <D.22260>:
  <D.22261>:
  <D.22262>:
  <D.22263>:
  <D.22264>:
  <D.22265>:
  <D.22266>:
  <D.22267>:
  <D.22268>:
  <D.22269>:
  <D.22270>:
  <D.22271>:
  D.26723 = sig->ret;
  D.26732 = mono_class_from_mono_type (D.26723);
  mono_mb_emit_op (mb, 140, D.26732);
  goto <D.22254>;
  <D.22272>:
  <D.22273>:
  <D.22274>:
  <D.22275>:
  <D.22276>:
  goto <D.22254>;
  <D.22277>:
  D.26733 = mono_defaults.int_class;
  mono_mb_emit_op (mb, 140, D.26733);
  goto <D.22254>;
  <D.22278>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4799);
  <D.22254>:
  if (void_ret == 0) goto <D.26734>; else goto <D.26735>;
  <D.26734>:
  loc_res.162 = (unsigned int) loc_res;
  mono_mb_emit_stloc (mb, loc_res.162);
  <D.26735>:
  i = 0;
  goto <D.22281>;
  <D.22280>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.26737 = BIT_FIELD_REF <*t, 16, 48>;
    D.26738 = D.26737 & 16639;
    if (D.26738 == 16405) goto <D.26739>; else goto <D.26740>;
    <D.26739>:
    D.26741 = mono_class_from_mono_type (t);
    D.26742 = mono_class_is_nullable (D.26741);
    if (D.26742 != 0) goto <D.26743>; else goto <D.26744>;
    <D.26743>:
    mono_mb_emit_ldarg (mb, 1);
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26669 = (int) D.26668;
    mono_mb_emit_icon (mb, D.26669);
    mono_mb_emit_byte (mb, 88);
    i.161 = (unsigned int) i;
    D.26668 = i.161 * 4;
    D.26681 = tmp_nullable_locals + D.26668;
    D.26686 = *D.26681;
    D.26687 = (unsigned int) D.26686;
    mono_mb_emit_ldloc (mb, D.26687);
    D.26745 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 140, D.26745);
    mono_mb_emit_byte (mb, 81);
    <D.26744>:
    <D.26740>:
  }
  i = i + 1;
  <D.22281>:
  D.26662 = sig->param_count;
  D.26716 = (int) D.26662;
  if (D.26716 > i) goto <D.22280>; else goto <D.22282>;
  <D.22282>:
  monoeg_g_free (tmp_nullable_locals);
}


mono_marshal_get_runtime_invoke_dynamic ()
{
  struct MonoMethod * method.163;
  struct MonoMethod * D.26750;
  struct MonoImage * D.26751;
  struct MonoClass * D.26752;
  struct MonoType * D.26753;
  struct MonoClass * D.26754;
  struct MonoType * D.26755;
  struct MonoClass * D.26756;
  struct MonoType * D.26757;
  unsigned int D.26758;
  int D.26759;
  unsigned int D.26760;
  int D.26761;
  unsigned int D.26762;
  int D.26763;
  unsigned int D.26764;
  struct MonoClass * D.26765;
  unsigned int D.26766;
  unsigned int posna.164;
  int D.26768;
  unsigned int D.26769;
  unsigned int D.26770;
  unsigned int D.26771;
  unsigned int pos.165;
  _Bool D.26775;
  long int D.26776;
  long int D.26777;
  struct MonoMethod * method.166;
  _Bool D.26785;
  long int D.26786;
  long int D.26787;
  static struct MonoMethod * method;
  struct MonoMethodSignature * csig;
  struct MonoExceptionClause * clause;
  struct MonoMethodBuilder * mb;
  int pos;
  int posna;
  char * name;
  struct WrapperInfo * info;

  method.163 = method;
  if (method.163 != 0B) goto <D.26748>; else goto <D.26749>;
  <D.26748>:
  D.26750 = method;
  return D.26750;
  <D.26749>:
  D.26751 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.26751, 4);
  D.26752 = mono_defaults.void_class;
  D.26753 = &D.26752->byval_arg;
  csig->ret = D.26753;
  D.26754 = mono_defaults.int_class;
  D.26755 = &D.26754->byval_arg;
  csig->params[0] = D.26755;
  D.26754 = mono_defaults.int_class;
  D.26755 = &D.26754->byval_arg;
  csig->params[1] = D.26755;
  D.26754 = mono_defaults.int_class;
  D.26755 = &D.26754->byval_arg;
  csig->params[2] = D.26755;
  D.26754 = mono_defaults.int_class;
  D.26755 = &D.26754->byval_arg;
  csig->params[3] = D.26755;
  name = monoeg_strdup ("runtime_invoke_dynamic");
  D.26756 = mono_defaults.object_class;
  mb = mono_mb_new (D.26756, name, 4);
  monoeg_g_free (name);
  D.26756 = mono_defaults.object_class;
  D.26757 = &D.26756->byval_arg;
  mono_mb_add_local (mb, D.26757);
  D.26756 = mono_defaults.object_class;
  D.26757 = &D.26756->byval_arg;
  mono_mb_add_local (mb, D.26757);
  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.26758 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.26758;
  D.26751 = mono_defaults.corlib;
  clause = mono_image_alloc0 (D.26751, 24);
  clause->flags = 1;
  D.26759 = mono_mb_get_label (mb);
  D.26760 = (unsigned int) D.26759;
  clause->try_len = D.26760;
  D.26761 = mono_mb_get_label (mb);
  D.26762 = (unsigned int) D.26761;
  clause->data.filter_offset = D.26762;
  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.26763 = mono_mb_get_label (mb);
  D.26764 = (unsigned int) D.26763;
  clause->handler_offset = D.26764;
  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.26765 = mono_defaults.threadabortexception_class;
  mono_mb_emit_op (mb, 117, D.26765);
  D.26766 = mono_mb_emit_short_branch (mb, 44);
  posna = (int) D.26766;
  mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort);
  posna.164 = (unsigned int) posna;
  mono_mb_patch_short_branch (mb, posna.164);
  mono_mb_emit_branch (mb, 221);
  D.26768 = mono_mb_get_pos (mb);
  D.26769 = (unsigned int) D.26768;
  D.26770 = clause->handler_offset;
  D.26771 = D.26769 - D.26770;
  clause->handler_len = D.26771;
  mono_mb_set_clauses (mb, 1, clause);
  pos.165 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.165);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26773>; else goto <D.26774>;
    <D.26773>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.26774>:
    D.26775 = ret != 0;
    D.26776 = (long int) D.26775;
    D.26777 = __builtin_expect (D.26776, 0);
    if (D.26777 != 0) goto <D.26778>; else goto <D.26779>;
    <D.26778>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5213, "ret == 0");
    <D.26779>:
  }
  method.163 = method;
  if (method.163 == 0B) goto <D.26780>; else goto <D.26781>;
  <D.26780>:
  method.166 = mono_mb_create_method (mb, csig, 16);
  method = method.166;
  method.163 = method;
  info = mono_wrapper_info_create (method.163, 12);
  method.163 = method;
  mono_marshal_set_wrapper_info (method.163, info);
  <D.26781>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26783>; else goto <D.26784>;
    <D.26783>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26784>:
    D.26785 = ret != 0;
    D.26786 = (long int) D.26785;
    D.26787 = __builtin_expect (D.26786, 0);
    if (D.26787 != 0) goto <D.26788>; else goto <D.26789>;
    <D.26788>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5220, "ret == 0");
    <D.26789>:
  }
  mono_mb_free (mb);
  D.26750 = method;
  return D.26750;
}


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

  if (str != 0B) goto <D.26791>; else goto <D.26792>;
  <D.26791>:
  D.26793 = __strdup (str);
  return D.26793;
  <D.26792>:
  D.26793 = 0B;
  return D.26793;
}


mono_marshal_get_ldfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.26797;
  long int D.26798;
  long int D.26799;
  struct MonoMethod * cached.167;
  _Bool D.26807;
  long int D.26808;
  long int D.26809;
  struct MonoMethod * D.26812;
  _Bool D.26815;
  long int D.26816;
  long int D.26817;
  struct MonoClass * D.26820;
  struct MonoMethod * D.26821;
  struct MonoImage * D.26822;
  struct MonoType * D.26823;
  struct MonoClass * D.26824;
  struct MonoType * D.26825;
  _Bool D.26828;
  long int D.26829;
  long int D.26830;
  _Bool D.26835;
  long int D.26836;
  long int D.26837;
  _Bool D.26844;
  long int D.26845;
  long int D.26846;
  _Bool D.26853;
  long int D.26854;
  long int D.26855;
  _Bool D.26861;
  long int D.26862;
  long int D.26863;
  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.26795>; else goto <D.26796>;
    <D.26795>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.26796>:
    D.26797 = ret != 0;
    D.26798 = (long int) D.26797;
    D.26799 = __builtin_expect (D.26798, 0);
    if (D.26799 != 0) goto <D.26800>; else goto <D.26801>;
    <D.26800>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5256, "ret == 0");
    <D.26801>:
  }
  cached.167 = cached;
  if (cached.167 != 0B) goto <D.26803>; else goto <D.26804>;
  <D.26803>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26805>; else goto <D.26806>;
    <D.26805>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26806>:
    D.26807 = ret != 0;
    D.26808 = (long int) D.26807;
    D.26809 = __builtin_expect (D.26808, 0);
    if (D.26809 != 0) goto <D.26810>; else goto <D.26811>;
    <D.26810>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5258, "ret == 0");
    <D.26811>:
  }
  D.26812 = cached;
  return D.26812;
  <D.26804>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26813>; else goto <D.26814>;
    <D.26813>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26814>:
    D.26815 = ret != 0;
    D.26816 = (long int) D.26815;
    D.26817 = __builtin_expect (D.26816, 0);
    if (D.26817 != 0) goto <D.26818>; else goto <D.26819>;
    <D.26818>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5261, "ret == 0");
    <D.26819>:
  }
  D.26820 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.26820, "__mono_load_remote_field_new_wrapper", 14);
  D.26821 = mb->method;
  D.26821->save_lmf = 1;
  D.26822 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.26822, 3);
  D.26820 = mono_defaults.object_class;
  D.26823 = &D.26820->byval_arg;
  sig->params[0] = D.26823;
  D.26824 = mono_defaults.int_class;
  D.26825 = &D.26824->byval_arg;
  sig->params[1] = D.26825;
  D.26824 = mono_defaults.int_class;
  D.26825 = &D.26824->byval_arg;
  sig->params[2] = D.26825;
  D.26820 = mono_defaults.object_class;
  D.26823 = &D.26820->byval_arg;
  sig->ret = D.26823;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.26822 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.26822, 3);
  D.26820 = mono_defaults.object_class;
  D.26823 = &D.26820->byval_arg;
  csig->params[0] = D.26823;
  D.26824 = mono_defaults.int_class;
  D.26825 = &D.26824->byval_arg;
  csig->params[1] = D.26825;
  D.26824 = mono_defaults.int_class;
  D.26825 = &D.26824->byval_arg;
  csig->params[2] = D.26825;
  D.26820 = mono_defaults.object_class;
  D.26823 = &D.26820->byval_arg;
  csig->ret = D.26823;
  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.26826>; else goto <D.26827>;
    <D.26826>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.26827>:
    D.26828 = ret != 0;
    D.26829 = (long int) D.26828;
    D.26830 = __builtin_expect (D.26829, 0);
    if (D.26830 != 0) goto <D.26831>; else goto <D.26832>;
    <D.26831>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5291, "ret == 0");
    <D.26832>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.26833>; else goto <D.26834>;
    <D.26833>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.26834>:
    D.26835 = ret != 0;
    D.26836 = (long int) D.26835;
    D.26837 = __builtin_expect (D.26836, 0);
    if (D.26837 != 0) goto <D.26838>; else goto <D.26839>;
    <D.26838>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5293, "ret == 0");
    <D.26839>:
  }
  if (res == 0B) goto <D.26840>; else goto <D.26841>;
  <D.26840>:
  {
    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.26842>; else goto <D.26843>;
      <D.26842>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.26843>:
      D.26844 = ret != 0;
      D.26845 = (long int) D.26844;
      D.26846 = __builtin_expect (D.26845, 0);
      if (D.26846 != 0) goto <D.26847>; else goto <D.26848>;
      <D.26847>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5297, "ret == 0");
      <D.26848>:
    }
    res = cached;
    if (res == 0B) goto <D.26849>; else goto <D.26850>;
    <D.26849>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.26851>; else goto <D.26852>;
      <D.26851>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.26852>:
      D.26853 = ret != 0;
      D.26854 = (long int) D.26853;
      D.26855 = __builtin_expect (D.26854, 0);
      if (D.26855 != 0) goto <D.26856>; else goto <D.26857>;
      <D.26856>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5302, "ret == 0");
      <D.26857>:
    }
    goto <D.26858>;
    <D.26850>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.26859>; else goto <D.26860>;
      <D.26859>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.26860>:
      D.26861 = ret != 0;
      D.26862 = (long int) D.26861;
      D.26863 = __builtin_expect (D.26862, 0);
      if (D.26863 != 0) goto <D.26864>; else goto <D.26865>;
      <D.26864>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5304, "ret == 0");
      <D.26865>:
    }
    mono_free_method (newm);
    <D.26858>:
  }
  <D.26841>:
  mono_mb_free (mb);
  D.26812 = res;
  return D.26812;
}


mono_marshal_get_ldfld_wrapper (struct MonoType * type)
{
  unsigned char D.26867;
  unsigned char D.26868;
  unsigned char D.26869;
  _Bool D.26881;
  _Bool D.26882;
  _Bool D.26883;
  _Bool D.26885;
  _Bool D.26886;
  _Bool D.26887;
  int D.26893;
  struct MonoImage * D.26899;
  struct GHashTable * * D.26900;
  struct MonoMethod * D.26903;
  const char * D.26904;
  const char * D.26905;
  struct MonoClass * D.26906;
  struct MonoImage * D.26907;
  struct MonoType * D.26908;
  struct MonoClass * D.26909;
  struct MonoType * D.26910;
  struct MonoType * D.26911;
  struct MonoMethod * D.26912;
  unsigned char D.26913;
  unsigned char D.26914;
  unsigned int D.26917;
  unsigned int pos0.168;
  unsigned int pos1.169;
  unsigned int D.26923;
  unsigned char D.26924;
  unsigned char D.26925;
  _Bool D.26926;
  long int D.26927;
  long int D.26928;
  int D.26931;
  int D.26935;
  short unsigned int D.26936;
  int D.26937;
  int D.26938;
  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.26867 = type->type;
  t = (int) D.26867;
  D.26868 = BIT_FIELD_REF <*type, 8, 56>;
  D.26869 = D.26868 & 64;
  if (D.26869 == 0) goto <D.26870>; else goto <D.26871>;
  <D.26870>:
  D.26867 = type->type;
  if (D.26867 == 29) goto <D.26872>; else goto <D.26873>;
  <D.26872>:
  klass = mono_defaults.array_class;
  goto <D.26874>;
  <D.26873>:
  D.26867 = type->type;
  if (D.26867 == 17) goto <D.26875>; else goto <D.26876>;
  <D.26875>:
  klass = type->data.klass;
  goto <D.26877>;
  <D.26876>:
  D.26881 = t == 28;
  D.26882 = t == 18;
  D.26883 = D.26881 | D.26882;
  if (D.26883 != 0) goto <D.26878>; else goto <D.26884>;
  <D.26884>:
  if (t == 14) goto <D.26878>; else goto <D.26879>;
  <D.26878>:
  klass = mono_defaults.object_class;
  goto <D.26880>;
  <D.26879>:
  D.26885 = t == 15;
  D.26886 = t == 27;
  D.26887 = D.26885 | D.26886;
  if (D.26887 != 0) goto <D.26888>; else goto <D.26889>;
  <D.26888>:
  klass = mono_defaults.int_class;
  goto <D.26890>;
  <D.26889>:
  if (t == 21) goto <D.26891>; else goto <D.26892>;
  <D.26891>:
  D.26893 = mono_type_generic_inst_is_valuetype (type);
  if (D.26893 != 0) goto <D.26894>; else goto <D.26895>;
  <D.26894>:
  klass = mono_class_from_mono_type (type);
  goto <D.26896>;
  <D.26895>:
  klass = mono_defaults.object_class;
  <D.26896>:
  goto <D.26897>;
  <D.26892>:
  klass = mono_class_from_mono_type (type);
  <D.26897>:
  <D.26890>:
  <D.26880>:
  <D.26877>:
  <D.26874>:
  goto <D.26898>;
  <D.26871>:
  klass = mono_defaults.int_class;
  <D.26898>:
  D.26899 = klass->image;
  D.26900 = &D.26899->ldfld_wrapper_cache;
  cache = get_cache (D.26900, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.26901>; else goto <D.26902>;
  <D.26901>:
  D.26903 = res;
  return D.26903;
  <D.26902>:
  D.26904 = klass->name_space;
  D.26905 = klass->name;
  name = monoeg_g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, D.26904, D.26905);
  D.26906 = mono_defaults.object_class;
  mb = mono_mb_new (D.26906, name, 12);
  monoeg_g_free (name);
  D.26907 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.26907, 4);
  D.26906 = mono_defaults.object_class;
  D.26908 = &D.26906->byval_arg;
  sig->params[0] = D.26908;
  D.26909 = mono_defaults.int_class;
  D.26910 = &D.26909->byval_arg;
  sig->params[1] = D.26910;
  D.26909 = mono_defaults.int_class;
  D.26910 = &D.26909->byval_arg;
  sig->params[2] = D.26910;
  D.26909 = mono_defaults.int_class;
  D.26910 = &D.26909->byval_arg;
  sig->params[3] = D.26910;
  D.26911 = &klass->byval_arg;
  sig->ret = D.26911;
  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.26912 = mono_marshal_get_ldfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.26912, 0B);
  D.26913 = BIT_FIELD_REF <*klass, 8, 160>;
  D.26914 = D.26913 & 8;
  if (D.26914 != 0) goto <D.26915>; else goto <D.26916>;
  <D.26915>:
  mono_mb_emit_op (mb, 121, klass);
  D.26917 = mono_mb_emit_branch (mb, 56);
  pos1 = (int) D.26917;
  goto <D.26918>;
  <D.26916>:
  mono_mb_emit_byte (mb, 42);
  <D.26918>:
  pos0.168 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.168);
  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.26913 = BIT_FIELD_REF <*klass, 8, 160>;
  D.26914 = D.26913 & 8;
  if (D.26914 != 0) goto <D.26920>; else goto <D.26921>;
  <D.26920>:
  pos1.169 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.169);
  <D.26921>:
  switch (t) <default: <D.22394>, case 2: <D.22370>, case 3: <D.22371>, case 4: <D.22368>, case 5: <D.22369>, case 6: <D.22372>, case 7: <D.22373>, case 8: <D.22374>, case 9: <D.22375>, case 10: <D.22376>, case 11: <D.22377>, case 12: <D.22378>, case 13: <D.22379>, case 14: <D.22384>, case 15: <D.22387>, case 17: <D.22390>, case 18: <D.22383>, case 19: <D.22392>, case 20: <D.22380>, case 21: <D.22391>, case 24: <D.22385>, case 25: <D.22386>, case 27: <D.22388>, case 28: <D.22382>, case 29: <D.22381>, case 30: <D.22393>>
  <D.22368>:
  <D.22369>:
  <D.22370>:
  <D.22371>:
  <D.22372>:
  <D.22373>:
  <D.22374>:
  <D.22375>:
  <D.22376>:
  <D.22377>:
  <D.22378>:
  <D.22379>:
  <D.22380>:
  <D.22381>:
  <D.22382>:
  <D.22383>:
  <D.22384>:
  <D.22385>:
  <D.22386>:
  <D.22387>:
  <D.22388>:
  D.26923 = mono_type_to_ldind (type);
  D.26924 = (unsigned char) D.26923;
  mono_mb_emit_byte (mb, D.26924);
  goto <D.22389>;
  <D.22390>:
  D.26913 = BIT_FIELD_REF <*klass, 8, 160>;
  D.26925 = D.26913 & 16;
  D.26926 = D.26925 != 0;
  D.26927 = (long int) D.26926;
  D.26928 = __builtin_expect (D.26927, 0);
  if (D.26928 != 0) goto <D.26929>; else goto <D.26930>;
  <D.26929>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5439, "!klass->enumtype");
  <D.26930>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.22389>;
  <D.22391>:
  D.26931 = mono_type_generic_inst_is_valuetype (type);
  if (D.26931 != 0) goto <D.26932>; else goto <D.26933>;
  <D.26932>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.26934>;
  <D.26933>:
  mono_mb_emit_byte (mb, 80);
  <D.26934>:
  goto <D.22389>;
  <D.22392>:
  <D.22393>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.22389>;
  <D.22394>:
  D.26867 = type->type;
  D.26935 = (int) D.26867;
  monoeg_g_log (0B, 16, "type %x not implemented", D.26935);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5455);
  <D.22389>:
  mono_mb_emit_byte (mb, 42);
  D.26936 = sig->param_count;
  D.26937 = (int) D.26936;
  D.26938 = D.26937 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.26938);
  mono_mb_free (mb);
  D.26903 = res;
  return D.26903;
}


mono_marshal_get_ldflda_wrapper (struct MonoType * type)
{
  unsigned char D.26940;
  unsigned char D.26941;
  unsigned char D.26942;
  _Bool D.26951;
  _Bool D.26952;
  _Bool D.26953;
  _Bool D.26954;
  _Bool D.26955;
  _Bool D.26959;
  _Bool D.26960;
  _Bool D.26961;
  int D.26967;
  struct MonoImage * D.26973;
  struct GHashTable * * D.26974;
  struct MonoMethod * D.26977;
  const char * D.26978;
  const char * D.26979;
  struct MonoClass * D.26980;
  struct MonoImage * D.26981;
  struct MonoType * D.26982;
  struct MonoClass * D.26983;
  struct MonoType * D.26984;
  unsigned int pos1.170;
  unsigned int D.26986;
  unsigned int pos2.171;
  unsigned int pos3.172;
  unsigned int pos0.173;
  short unsigned int D.26990;
  int D.26991;
  int D.26992;
  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.26940 = type->type;
  t = (int) D.26940;
  D.26941 = BIT_FIELD_REF <*type, 8, 56>;
  D.26942 = D.26941 & 64;
  if (D.26942 == 0) goto <D.26943>; else goto <D.26944>;
  <D.26943>:
  D.26940 = type->type;
  if (D.26940 == 29) goto <D.26945>; else goto <D.26946>;
  <D.26945>:
  klass = mono_defaults.array_class;
  goto <D.26947>;
  <D.26946>:
  D.26940 = type->type;
  if (D.26940 == 17) goto <D.26948>; else goto <D.26949>;
  <D.26948>:
  klass = type->data.klass;
  goto <D.26950>;
  <D.26949>:
  D.26951 = t == 28;
  D.26952 = t == 14;
  D.26953 = D.26951 | D.26952;
  D.26954 = t == 18;
  D.26955 = D.26953 | D.26954;
  if (D.26955 != 0) goto <D.26956>; else goto <D.26957>;
  <D.26956>:
  klass = mono_defaults.object_class;
  goto <D.26958>;
  <D.26957>:
  D.26959 = t == 15;
  D.26960 = t == 27;
  D.26961 = D.26959 | D.26960;
  if (D.26961 != 0) goto <D.26962>; else goto <D.26963>;
  <D.26962>:
  klass = mono_defaults.int_class;
  goto <D.26964>;
  <D.26963>:
  if (t == 21) goto <D.26965>; else goto <D.26966>;
  <D.26965>:
  D.26967 = mono_type_generic_inst_is_valuetype (type);
  if (D.26967 != 0) goto <D.26968>; else goto <D.26969>;
  <D.26968>:
  klass = mono_class_from_mono_type (type);
  goto <D.26970>;
  <D.26969>:
  klass = mono_defaults.object_class;
  <D.26970>:
  goto <D.26971>;
  <D.26966>:
  klass = mono_class_from_mono_type (type);
  <D.26971>:
  <D.26964>:
  <D.26958>:
  <D.26950>:
  <D.26947>:
  goto <D.26972>;
  <D.26944>:
  klass = mono_defaults.int_class;
  <D.26972>:
  D.26973 = klass->image;
  D.26974 = &D.26973->ldflda_wrapper_cache;
  cache = get_cache (D.26974, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.26975>; else goto <D.26976>;
  <D.26975>:
  D.26977 = res;
  return D.26977;
  <D.26976>:
  D.26978 = klass->name_space;
  D.26979 = klass->name;
  name = monoeg_g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, D.26978, D.26979);
  D.26980 = mono_defaults.object_class;
  mb = mono_mb_new (D.26980, name, 23);
  monoeg_g_free (name);
  D.26981 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.26981, 4);
  D.26980 = mono_defaults.object_class;
  D.26982 = &D.26980->byval_arg;
  sig->params[0] = D.26982;
  D.26983 = mono_defaults.int_class;
  D.26984 = &D.26983->byval_arg;
  sig->params[1] = D.26984;
  D.26983 = mono_defaults.int_class;
  D.26984 = &D.26983->byval_arg;
  sig->params[2] = D.26984;
  D.26983 = mono_defaults.int_class;
  D.26984 = &D.26983->byval_arg;
  sig->params[3] = D.26984;
  D.26983 = mono_defaults.int_class;
  D.26984 = &D.26983->byval_arg;
  sig->ret = D.26984;
  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.170 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.170);
  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, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_icall (mb, mono_context_get);
  D.26986 = mono_mb_emit_branch (mb, 59);
  pos3 = (int) D.26986;
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context.");
  pos2.171 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.171);
  pos3.172 = (unsigned int) pos3;
  mono_mb_patch_branch (mb, pos3.172);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 16);
  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.173 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.173);
  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.26990 = sig->param_count;
  D.26991 = (int) D.26990;
  D.26992 = D.26991 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.26992);
  mono_mb_free (mb);
  D.26977 = res;
  return D.26977;
}


mono_mb_emit_contextbound_check (struct MonoMethodBuilder * mb, int branch_code)
{
  int offset.174;
  unsigned char mask.175;
  int D.26998;
  int D.26999;
  unsigned char D.27000;
  unsigned int D.27001;
  static int offset = -1;
  static guint8 mask;

  offset.174 = offset;
  if (offset.174 < 0) goto <D.26995>; else goto <D.26996>;
  <D.26995>:
  {
    struct MonoClass tmp;

    try
      {
        memset (&tmp, 0, 164);
        tmp.contextbound = 1;
        mono_marshal_find_nonzero_bit_offset (&tmp, 164, &offset, &mask);
      }
    finally
      {
        tmp = {CLOBBER};
      }
  }
  <D.26996>:
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  offset.174 = offset;
  mono_mb_emit_ldflda (mb, offset.174);
  mono_mb_emit_byte (mb, 71);
  mask.175 = mask;
  D.26998 = (int) mask.175;
  mono_mb_emit_icon (mb, D.26998);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_icon (mb, 0);
  D.27000 = (unsigned char) branch_code;
  D.27001 = mono_mb_emit_branch (mb, D.27000);
  D.26999 = (int) D.27001;
  return D.26999;
}


mono_marshal_get_stfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.27005;
  long int D.27006;
  long int D.27007;
  struct MonoMethod * cached.176;
  _Bool D.27015;
  long int D.27016;
  long int D.27017;
  struct MonoMethod * D.27020;
  _Bool D.27023;
  long int D.27024;
  long int D.27025;
  struct MonoClass * D.27028;
  struct MonoMethod * D.27029;
  struct MonoImage * D.27030;
  struct MonoType * D.27031;
  struct MonoClass * D.27032;
  struct MonoType * D.27033;
  struct MonoClass * D.27034;
  struct MonoType * D.27035;
  _Bool D.27038;
  long int D.27039;
  long int D.27040;
  _Bool D.27045;
  long int D.27046;
  long int D.27047;
  _Bool D.27054;
  long int D.27055;
  long int D.27056;
  _Bool D.27063;
  long int D.27064;
  long int D.27065;
  _Bool D.27071;
  long int D.27072;
  long int D.27073;
  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.27003>; else goto <D.27004>;
    <D.27003>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27004>:
    D.27005 = ret != 0;
    D.27006 = (long int) D.27005;
    D.27007 = __builtin_expect (D.27006, 0);
    if (D.27007 != 0) goto <D.27008>; else goto <D.27009>;
    <D.27008>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5608, "ret == 0");
    <D.27009>:
  }
  cached.176 = cached;
  if (cached.176 != 0B) goto <D.27011>; else goto <D.27012>;
  <D.27011>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27013>; else goto <D.27014>;
    <D.27013>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27014>:
    D.27015 = ret != 0;
    D.27016 = (long int) D.27015;
    D.27017 = __builtin_expect (D.27016, 0);
    if (D.27017 != 0) goto <D.27018>; else goto <D.27019>;
    <D.27018>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5610, "ret == 0");
    <D.27019>:
  }
  D.27020 = cached;
  return D.27020;
  <D.27012>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27021>; else goto <D.27022>;
    <D.27021>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27022>:
    D.27023 = ret != 0;
    D.27024 = (long int) D.27023;
    D.27025 = __builtin_expect (D.27024, 0);
    if (D.27025 != 0) goto <D.27026>; else goto <D.27027>;
    <D.27026>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5613, "ret == 0");
    <D.27027>:
  }
  D.27028 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.27028, "__mono_store_remote_field_new_wrapper", 15);
  D.27029 = mb->method;
  D.27029->save_lmf = 1;
  D.27030 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27030, 4);
  D.27028 = mono_defaults.object_class;
  D.27031 = &D.27028->byval_arg;
  sig->params[0] = D.27031;
  D.27032 = mono_defaults.int_class;
  D.27033 = &D.27032->byval_arg;
  sig->params[1] = D.27033;
  D.27032 = mono_defaults.int_class;
  D.27033 = &D.27032->byval_arg;
  sig->params[2] = D.27033;
  D.27028 = mono_defaults.object_class;
  D.27031 = &D.27028->byval_arg;
  sig->params[3] = D.27031;
  D.27034 = mono_defaults.void_class;
  D.27035 = &D.27034->byval_arg;
  sig->ret = D.27035;
  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.27030 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.27030, 4);
  D.27028 = mono_defaults.object_class;
  D.27031 = &D.27028->byval_arg;
  csig->params[0] = D.27031;
  D.27032 = mono_defaults.int_class;
  D.27033 = &D.27032->byval_arg;
  csig->params[1] = D.27033;
  D.27032 = mono_defaults.int_class;
  D.27033 = &D.27032->byval_arg;
  csig->params[2] = D.27033;
  D.27028 = mono_defaults.object_class;
  D.27031 = &D.27028->byval_arg;
  csig->params[3] = D.27031;
  D.27034 = mono_defaults.void_class;
  D.27035 = &D.27034->byval_arg;
  csig->ret = D.27035;
  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.27036>; else goto <D.27037>;
    <D.27036>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27037>:
    D.27038 = ret != 0;
    D.27039 = (long int) D.27038;
    D.27040 = __builtin_expect (D.27039, 0);
    if (D.27040 != 0) goto <D.27041>; else goto <D.27042>;
    <D.27041>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5646, "ret == 0");
    <D.27042>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27043>; else goto <D.27044>;
    <D.27043>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27044>:
    D.27045 = ret != 0;
    D.27046 = (long int) D.27045;
    D.27047 = __builtin_expect (D.27046, 0);
    if (D.27047 != 0) goto <D.27048>; else goto <D.27049>;
    <D.27048>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5648, "ret == 0");
    <D.27049>:
  }
  if (res == 0B) goto <D.27050>; else goto <D.27051>;
  <D.27050>:
  {
    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.27052>; else goto <D.27053>;
      <D.27052>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.27053>:
      D.27054 = ret != 0;
      D.27055 = (long int) D.27054;
      D.27056 = __builtin_expect (D.27055, 0);
      if (D.27056 != 0) goto <D.27057>; else goto <D.27058>;
      <D.27057>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5652, "ret == 0");
      <D.27058>:
    }
    res = cached;
    if (res == 0B) goto <D.27059>; else goto <D.27060>;
    <D.27059>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.27061>; else goto <D.27062>;
      <D.27061>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.27062>:
      D.27063 = ret != 0;
      D.27064 = (long int) D.27063;
      D.27065 = __builtin_expect (D.27064, 0);
      if (D.27065 != 0) goto <D.27066>; else goto <D.27067>;
      <D.27066>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5657, "ret == 0");
      <D.27067>:
    }
    goto <D.27068>;
    <D.27060>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.27069>; else goto <D.27070>;
      <D.27069>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.27070>:
      D.27071 = ret != 0;
      D.27072 = (long int) D.27071;
      D.27073 = __builtin_expect (D.27072, 0);
      if (D.27073 != 0) goto <D.27074>; else goto <D.27075>;
      <D.27074>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5659, "ret == 0");
      <D.27075>:
    }
    mono_free_method (newm);
    <D.27068>:
  }
  <D.27051>:
  mono_mb_free (mb);
  D.27020 = res;
  return D.27020;
}


mono_marshal_get_stfld_wrapper (struct MonoType * type)
{
  unsigned char D.27077;
  unsigned char D.27078;
  unsigned char D.27079;
  _Bool D.27091;
  _Bool D.27092;
  _Bool D.27093;
  _Bool D.27095;
  _Bool D.27096;
  _Bool D.27097;
  int D.27103;
  struct MonoImage * D.27109;
  struct GHashTable * * D.27110;
  struct MonoMethod * D.27113;
  const char * D.27114;
  const char * D.27115;
  struct MonoClass * D.27116;
  struct MonoImage * D.27117;
  struct MonoType * D.27118;
  struct MonoClass * D.27119;
  struct MonoType * D.27120;
  struct MonoType * D.27121;
  struct MonoClass * D.27122;
  struct MonoType * D.27123;
  unsigned char D.27124;
  unsigned char D.27125;
  struct MonoMethod * D.27128;
  unsigned int pos.177;
  unsigned int D.27130;
  unsigned char D.27131;
  unsigned char D.27132;
  _Bool D.27133;
  long int D.27134;
  long int D.27135;
  int D.27138;
  short unsigned int D.27139;
  int D.27140;
  int D.27141;
  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.27077 = type->type;
  t = (int) D.27077;
  D.27078 = BIT_FIELD_REF <*type, 8, 56>;
  D.27079 = D.27078 & 64;
  if (D.27079 == 0) goto <D.27080>; else goto <D.27081>;
  <D.27080>:
  D.27077 = type->type;
  if (D.27077 == 29) goto <D.27082>; else goto <D.27083>;
  <D.27082>:
  klass = mono_defaults.array_class;
  goto <D.27084>;
  <D.27083>:
  D.27077 = type->type;
  if (D.27077 == 17) goto <D.27085>; else goto <D.27086>;
  <D.27085>:
  klass = type->data.klass;
  goto <D.27087>;
  <D.27086>:
  D.27091 = t == 28;
  D.27092 = t == 18;
  D.27093 = D.27091 | D.27092;
  if (D.27093 != 0) goto <D.27088>; else goto <D.27094>;
  <D.27094>:
  if (t == 14) goto <D.27088>; else goto <D.27089>;
  <D.27088>:
  klass = mono_defaults.object_class;
  goto <D.27090>;
  <D.27089>:
  D.27095 = t == 15;
  D.27096 = t == 27;
  D.27097 = D.27095 | D.27096;
  if (D.27097 != 0) goto <D.27098>; else goto <D.27099>;
  <D.27098>:
  klass = mono_defaults.int_class;
  goto <D.27100>;
  <D.27099>:
  if (t == 21) goto <D.27101>; else goto <D.27102>;
  <D.27101>:
  D.27103 = mono_type_generic_inst_is_valuetype (type);
  if (D.27103 != 0) goto <D.27104>; else goto <D.27105>;
  <D.27104>:
  klass = mono_class_from_mono_type (type);
  goto <D.27106>;
  <D.27105>:
  klass = mono_defaults.object_class;
  <D.27106>:
  goto <D.27107>;
  <D.27102>:
  klass = mono_class_from_mono_type (type);
  <D.27107>:
  <D.27100>:
  <D.27090>:
  <D.27087>:
  <D.27084>:
  goto <D.27108>;
  <D.27081>:
  klass = mono_defaults.int_class;
  <D.27108>:
  D.27109 = klass->image;
  D.27110 = &D.27109->stfld_wrapper_cache;
  cache = get_cache (D.27110, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27111>; else goto <D.27112>;
  <D.27111>:
  D.27113 = res;
  return D.27113;
  <D.27112>:
  D.27114 = klass->name_space;
  D.27115 = klass->name;
  name = monoeg_g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, D.27114, D.27115);
  D.27116 = mono_defaults.object_class;
  mb = mono_mb_new (D.27116, name, 13);
  monoeg_g_free (name);
  D.27117 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27117, 5);
  D.27116 = mono_defaults.object_class;
  D.27118 = &D.27116->byval_arg;
  sig->params[0] = D.27118;
  D.27119 = mono_defaults.int_class;
  D.27120 = &D.27119->byval_arg;
  sig->params[1] = D.27120;
  D.27119 = mono_defaults.int_class;
  D.27120 = &D.27119->byval_arg;
  sig->params[2] = D.27120;
  D.27119 = mono_defaults.int_class;
  D.27120 = &D.27119->byval_arg;
  sig->params[3] = D.27120;
  D.27121 = &klass->byval_arg;
  sig->params[4] = D.27121;
  D.27122 = mono_defaults.void_class;
  D.27123 = &D.27122->byval_arg;
  sig->ret = D.27123;
  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.27124 = BIT_FIELD_REF <*klass, 8, 160>;
  D.27125 = D.27124 & 8;
  if (D.27125 != 0) goto <D.27126>; else goto <D.27127>;
  <D.27126>:
  mono_mb_emit_op (mb, 140, klass);
  <D.27127>:
  D.27128 = mono_marshal_get_stfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.27128, 0B);
  mono_mb_emit_byte (mb, 42);
  pos.177 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.177);
  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.22463>, case 2: <D.22439>, case 3: <D.22440>, case 4: <D.22437>, case 5: <D.22438>, case 6: <D.22441>, case 7: <D.22442>, case 8: <D.22443>, case 9: <D.22444>, case 10: <D.22445>, case 11: <D.22446>, case 12: <D.22447>, case 13: <D.22448>, case 14: <D.22453>, case 15: <D.22456>, case 17: <D.22459>, case 18: <D.22452>, case 19: <D.22461>, case 20: <D.22449>, case 21: <D.22460>, case 24: <D.22454>, case 25: <D.22455>, case 27: <D.22457>, case 28: <D.22451>, case 29: <D.22450>, case 30: <D.22462>>
  <D.22437>:
  <D.22438>:
  <D.22439>:
  <D.22440>:
  <D.22441>:
  <D.22442>:
  <D.22443>:
  <D.22444>:
  <D.22445>:
  <D.22446>:
  <D.22447>:
  <D.22448>:
  <D.22449>:
  <D.22450>:
  <D.22451>:
  <D.22452>:
  <D.22453>:
  <D.22454>:
  <D.22455>:
  <D.22456>:
  <D.22457>:
  D.27130 = mono_type_to_stind (type);
  D.27131 = (unsigned char) D.27130;
  mono_mb_emit_byte (mb, D.27131);
  goto <D.22458>;
  <D.22459>:
  D.27124 = BIT_FIELD_REF <*klass, 8, 160>;
  D.27132 = D.27124 & 16;
  D.27133 = D.27132 != 0;
  D.27134 = (long int) D.27133;
  D.27135 = __builtin_expect (D.27134, 0);
  if (D.27135 != 0) goto <D.27136>; else goto <D.27137>;
  <D.27136>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5777, "!klass->enumtype");
  <D.27137>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.22458>;
  <D.22460>:
  <D.22461>:
  <D.22462>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.22458>;
  <D.22463>:
  D.27077 = type->type;
  D.27138 = (int) D.27077;
  monoeg_g_log (0B, 16, "type %x not implemented", D.27138);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5787);
  <D.22458>:
  mono_mb_emit_byte (mb, 42);
  D.27139 = sig->param_count;
  D.27140 = (int) D.27139;
  D.27141 = D.27140 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.27141);
  mono_mb_free (mb);
  D.27113 = res;
  return D.27113;
}


mono_marshal_get_icall_wrapper (struct MonoMethodSignature * sig, const char * name, const void * func, gboolean check_exceptions)
{
  unsigned char D.27143;
  unsigned char D.27144;
  _Bool D.27145;
  long int D.27146;
  long int D.27147;
  struct MonoClass * D.27150;
  struct MonoMethod * D.27151;
  unsigned char D.27152;
  unsigned char D.27153;
  struct MonoImage * D.27156;
  <unnamed-unsigned:1> D.27160;
  int D.27161;
  int D.27162;
  unsigned int D.27163;
  short unsigned int D.27164;
  int D.27165;
  unsigned char D.27168;
  unsigned char D.27169;
  short unsigned int D.27172;
  int D.27173;
  int D.27174;
  struct MonoMethod * D.27175;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * csig2;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  struct WrapperInfo * info;

  D.27143 = BIT_FIELD_REF <*sig, 8, 88>;
  D.27144 = D.27143 & 1;
  D.27145 = D.27144 == 0;
  D.27146 = (long int) D.27145;
  D.27147 = __builtin_expect (D.27146, 0);
  if (D.27147 != 0) goto <D.27148>; else goto <D.27149>;
  <D.27148>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5815, "sig->pinvoke");
  <D.27149>:
  D.27150 = mono_defaults.object_class;
  mb = mono_mb_new (D.27150, name, 6);
  D.27151 = mb->method;
  D.27151->save_lmf = 1;
  D.27152 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27153 = D.27152 & 64;
  if (D.27153 != 0) goto <D.27154>; else goto <D.27155>;
  <D.27154>:
  D.27156 = mono_defaults.corlib;
  D.27150 = mono_defaults.object_class;
  csig2 = signature_dup_add_this (D.27156, sig, D.27150);
  goto <D.27157>;
  <D.27155>:
  D.27156 = mono_defaults.corlib;
  csig2 = signature_dup (D.27156, sig);
  <D.27157>:
  D.27152 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27153 = D.27152 & 64;
  if (D.27153 != 0) goto <D.27158>; else goto <D.27159>;
  <D.27158>:
  mono_mb_emit_byte (mb, 2);
  <D.27159>:
  i = 0;
  goto <D.22477>;
  <D.22476>:
  D.27160 = sig->hasthis;
  D.27161 = (int) D.27160;
  D.27162 = D.27161 + i;
  D.27163 = (unsigned int) D.27162;
  mono_mb_emit_ldarg (mb, D.27163);
  i = i + 1;
  <D.22477>:
  D.27164 = sig->param_count;
  D.27165 = (int) D.27164;
  if (D.27165 > i) goto <D.22476>; else goto <D.22478>;
  <D.22478>:
  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.27166>; else goto <D.27167>;
  <D.27166>:
  emit_thread_interrupt_checkpoint (mb);
  <D.27167>:
  mono_mb_emit_byte (mb, 42);
  D.27156 = mono_defaults.corlib;
  csig = signature_dup (D.27156, sig);
  csig->pinvoke = 0;
  D.27168 = BIT_FIELD_REF <*csig, 8, 80>;
  D.27169 = D.27168 & 63;
  if (D.27169 == 5) goto <D.27170>; else goto <D.27171>;
  <D.27170>:
  csig->call_convention = 0;
  <D.27171>:
  D.27172 = csig->param_count;
  D.27173 = (int) D.27172;
  D.27174 = D.27173 + 16;
  res = mono_mb_create_method (mb, csig, D.27174);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 15);
  info->d.icall.func = func;
  mono_marshal_set_wrapper_info (res, info);
  D.27175 = res;
  return D.27175;
}


signature_dup_add_this (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoClass * klass)
{
  short unsigned int D.27177;
  int D.27178;
  int D.27179;
  unsigned int D.27180;
  short unsigned int D.27181;
  int D.27182;
  struct MonoType * D.27183;
  struct MonoType * iftmp.178;
  unsigned char D.27185;
  unsigned char D.27186;
  struct MonoMethodSignature * D.27190;
  struct MonoMethodSignature * res;
  int i;

  D.27177 = sig->param_count;
  D.27178 = (int) D.27177;
  D.27179 = D.27178 + 1;
  D.27180 = (unsigned int) D.27179;
  res = mono_metadata_signature_alloc (image, D.27180);
  memcpy (res, sig, 12);
  D.27177 = sig->param_count;
  D.27181 = D.27177 + 1;
  res->param_count = D.27181;
  res->hasthis = 0;
  D.27177 = sig->param_count;
  D.27178 = (int) D.27177;
  i = D.27178 + -1;
  goto <D.22156>;
  <D.22155>:
  D.27182 = i + 1;
  D.27183 = sig->params[i];
  res->params[D.27182] = D.27183;
  i = i + -1;
  <D.22156>:
  if (i >= 0) goto <D.22155>; else goto <D.22157>;
  <D.22157>:
  D.27185 = BIT_FIELD_REF <*klass, 8, 160>;
  D.27186 = D.27185 & 8;
  if (D.27186 != 0) goto <D.27187>; else goto <D.27188>;
  <D.27187>:
  iftmp.178 = &klass->this_arg;
  goto <D.27189>;
  <D.27188>:
  iftmp.178 = &klass->byval_arg;
  <D.27189>:
  res->params[0] = iftmp.178;
  D.27190 = res;
  return D.27190;
}


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.27194;
  unsigned char D.27195;
  _Bool D.27196;
  long int D.27197;
  long int D.27198;
  struct MonoMethod * D.27201;
  struct MonoClass * D.27202;
  struct MonoImage * D.27203;
  struct MonoClass * D.27206;
  struct MonoType * D.27207;
  struct MonoClass * D.27208;
  struct MonoType * D.27209;
  struct MonoType * D.27210;
  int D.27211;
  struct MonoMarshalSpec * D.27214;
  <unnamed type> D.27217;
  short unsigned int D.27220;
  unsigned int D.27221;
  unsigned int D.27222;
  int D.27223;
  int D.27224;
  unsigned int D.27225;
  unsigned int D.27226;
  void * D.27227;
  unsigned int i.179;
  unsigned int D.27229;
  int * D.27230;
  int D.27231;
  struct MonoType * D.27232;
  sizetype i.180;
  sizetype D.27234;
  sizetype D.27235;
  struct MonoMarshalSpec * * D.27236;
  struct MonoMarshalSpec * D.27237;
  struct MonoType * * D.27238;
  int D.27239;
  int D.27242;
  unsigned int D.27246;
  unsigned int D.27247;
  struct MonoMethod * D.27250;
  short unsigned int D.27255;
  int D.27256;
  int D.27257;
  struct MonoMethodSignature * get_last_error_sig.181;
  struct MonoImage * D.27263;
  struct MonoMethodSignature * get_last_error_sig.182;
  unsigned char D.27265;
  unsigned char D.27266;
  unsigned char D.27269;
  <unnamed type> D.27272;
  unsigned char D.27274;
  unsigned char D.27275;
  struct MonoClass * D.27278;
  struct MonoType * D.27279;
  unsigned char D.27280;
  int D.27281;
  <unnamed type> D.27287;
  _Bool D.27288;
  _Bool D.27289;
  _Bool D.27290;
  unsigned char D.27293;
  int D.27294;
  int D.27296;
  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.27192>; else goto <D.27193>;
      <D.27192>:
      D.27194 = BIT_FIELD_REF <*sig, 8, 80>;
      D.27195 = D.27194 & 64;
      D.27196 = D.27195 != 0;
      D.27197 = (long int) D.27196;
      D.27198 = __builtin_expect (D.27197, 0);
      if (D.27198 != 0) goto <D.27199>; else goto <D.27200>;
      <D.27199>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8635, "!sig->hasthis");
      <D.27200>:
      param_shift = param_shift + 1;
      <D.27193>:
      D.27201 = mb->method;
      D.27202 = D.27201->klass;
      D.27203 = D.27202->image;
      csig = signature_dup (D.27203, sig);
      csig->pinvoke = 1;
      m.csig = csig;
      m.image = image;
      D.27194 = BIT_FIELD_REF <*sig, 8, 80>;
      D.27195 = D.27194 & 64;
      if (D.27195 != 0) goto <D.27204>; else goto <D.27205>;
      <D.27204>:
      param_shift = param_shift + 1;
      <D.27205>:
      D.27206 = mono_defaults.int_class;
      D.27207 = &D.27206->byval_arg;
      mono_mb_add_local (mb, D.27207);
      D.27206 = mono_defaults.int_class;
      D.27207 = &D.27206->byval_arg;
      mono_mb_add_local (mb, D.27207);
      D.27208 = mono_defaults.boolean_class;
      D.27209 = &D.27208->byval_arg;
      mono_mb_add_local (mb, D.27209);
      mono_mb_emit_icon (mb, 0);
      mono_mb_emit_stloc (mb, 2);
      D.27210 = sig->ret;
      D.27211 = mono_type_is_void (D.27210);
      if (D.27211 == 0) goto <D.27212>; else goto <D.27213>;
      <D.27212>:
      D.27210 = sig->ret;
      mono_mb_add_local (mb, D.27210);
      <D.27213>:
      D.27214 = *mspecs;
      if (D.27214 != 0B) goto <D.27215>; else goto <D.27216>;
      <D.27215>:
      D.27214 = *mspecs;
      D.27217 = D.27214->native;
      if (D.27217 == 44) goto <D.27218>; else goto <D.27219>;
      <D.27218>:
      D.27206 = mono_defaults.int_class;
      D.27207 = &D.27206->byval_arg;
      csig->ret = D.27207;
      <D.27219>:
      <D.27216>:
      D.27220 = sig->param_count;
      D.27221 = (unsigned int) D.27220;
      D.27222 = D.27221 * 4;
      tmp_locals = __builtin_alloca (D.27222);
      D.27220 = sig->param_count;
      D.27223 = (int) D.27220;
      D.27224 = D.27223 + 1;
      D.27225 = (unsigned int) D.27224;
      D.27226 = D.27225 * 4;
      D.27227 = __builtin_alloca (D.27226);
      m.orig_conv_args = D.27227;
      i = 0;
      goto <D.22966>;
      <D.22965>:
      i.179 = (unsigned int) i;
      D.27229 = i.179 * 4;
      D.27230 = tmp_locals + D.27229;
      D.27231 = i + param_shift;
      D.27232 = sig->params[i];
      i.180 = (sizetype) i;
      D.27234 = i.180 + 1;
      D.27235 = D.27234 * 4;
      D.27236 = mspecs + D.27235;
      D.27237 = *D.27236;
      D.27238 = &csig->params[i];
      D.27239 = emit_marshal (&m, D.27231, D.27232, D.27237, 0, D.27238, 0);
      *D.27230 = D.27239;
      i = i + 1;
      <D.22966>:
      D.27220 = sig->param_count;
      D.27223 = (int) D.27220;
      if (D.27223 > i) goto <D.22965>; else goto <D.22967>;
      <D.22967>:
      D.27194 = BIT_FIELD_REF <*sig, 8, 80>;
      D.27195 = D.27194 & 64;
      if (D.27195 != 0) goto <D.27240>; else goto <D.27241>;
      <D.27240>:
      mono_mb_emit_byte (mb, 2);
      <D.27241>:
      i = 0;
      goto <D.22969>;
      <D.22968>:
      D.27231 = i + param_shift;
      D.27232 = sig->params[i];
      i.180 = (sizetype) i;
      D.27234 = i.180 + 1;
      D.27235 = D.27234 * 4;
      D.27236 = mspecs + D.27235;
      D.27237 = *D.27236;
      i.179 = (unsigned int) i;
      D.27229 = i.179 * 4;
      D.27230 = tmp_locals + D.27229;
      D.27242 = *D.27230;
      emit_marshal (&m, D.27231, D.27232, D.27237, D.27242, 0B, 1);
      i = i + 1;
      <D.22969>:
      D.27220 = sig->param_count;
      D.27223 = (int) D.27220;
      if (D.27223 > i) goto <D.22968>; else goto <D.22970>;
      <D.22970>:
      if (func_param != 0) goto <D.27243>; else goto <D.27244>;
      <D.27243>:
      mono_mb_emit_byte (mb, 2);
      D.27206 = mono_defaults.int_class;
      mono_mb_emit_op (mb, 121, D.27206);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_calli (mb, csig);
      goto <D.27245>;
      <D.27244>:
      D.27201 = mb->method;
      D.27202 = D.27201->klass;
      D.27246 = D.27202->flags;
      D.27247 = D.27246 & 4096;
      if (D.27247 != 0) goto <D.27248>; else goto <D.27249>;
      <D.27248>:
      D.27250 = &piinfo->method;
      mono_mb_emit_cominterop_call (mb, csig, D.27250);
      goto <D.27251>;
      <D.27249>:
      if (aot != 0) goto <D.27252>; else goto <D.27253>;
      <D.27252>:
      mono_mb_emit_byte (mb, 240);
      D.27250 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.27250);
      mono_mb_emit_calli (mb, csig);
      goto <D.27254>;
      <D.27253>:
      mono_mb_emit_native_call (mb, csig, func);
      <D.27254>:
      <D.27251>:
      <D.27245>:
      D.27255 = piinfo->piflags;
      D.27256 = (int) D.27255;
      D.27257 = D.27256 & 64;
      if (D.27257 != 0) goto <D.27258>; else goto <D.27259>;
      <D.27258>:
      get_last_error_sig.181 = get_last_error_sig;
      if (get_last_error_sig.181 == 0B) goto <D.27261>; else goto <D.27262>;
      <D.27261>:
      D.27263 = mono_defaults.corlib;
      get_last_error_sig.182 = mono_metadata_signature_alloc (D.27263, 0);
      get_last_error_sig = get_last_error_sig.182;
      get_last_error_sig.181 = get_last_error_sig;
      D.27206 = mono_defaults.int_class;
      D.27207 = &D.27206->byval_arg;
      get_last_error_sig.181->ret = D.27207;
      get_last_error_sig.181 = get_last_error_sig;
      get_last_error_sig.181->pinvoke = 1;
      <D.27262>:
      mono_mb_emit_icall (mb, mono_marshal_set_last_error);
      <D.27259>:
      D.27210 = sig->ret;
      D.27265 = BIT_FIELD_REF <*D.27210, 8, 56>;
      D.27266 = D.27265 & 64;
      if (D.27266 == 0) goto <D.27267>; else goto <D.27268>;
      <D.27267>:
      {
        struct MonoMarshalSpec * spec;

        spec = *mspecs;
        D.27210 = sig->ret;
        D.27269 = D.27210->type;
        type = (int) D.27269;
        if (spec != 0B) goto <D.27271>; else goto <D.27270>;
        <D.27271>:
        D.27272 = spec->native;
        if (D.27272 == 44) goto <D.27273>; else goto <D.27270>;
        <D.27273>:
        D.27210 = sig->ret;
        emit_marshal (&m, 0, D.27210, spec, 0, 0B, 3);
        goto <D.22974>;
        <D.27270>:
        handle_enum:
        switch (type) <default: <D.22999>, case 1: <D.22973>, case 2: <D.22992>, case 3: <D.22995>, case 4: <D.22976>, case 5: <D.22977>, case 6: <D.22978>, case 7: <D.22979>, case 8: <D.22980>, case 9: <D.22981>, case 10: <D.22986>, case 11: <D.22987>, case 12: <D.22984>, case 13: <D.22985>, case 14: <D.22989>, case 15: <D.22996>, case 17: <D.22975>, case 18: <D.22990>, case 20: <D.22993>, case 21: <D.22997>, case 22: <D.22998>, case 24: <D.22982>, case 25: <D.22983>, case 27: <D.22988>, case 28: <D.22991>, case 29: <D.22994>>
        <D.22973>:
        goto <D.22974>;
        <D.22975>:
        D.27210 = sig->ret;
        klass = D.27210->data.klass;
        D.27274 = BIT_FIELD_REF <*klass, 8, 160>;
        D.27275 = D.27274 & 16;
        if (D.27275 != 0) goto <D.27276>; else goto <D.27277>;
        <D.27276>:
        D.27210 = sig->ret;
        D.27278 = D.27210->data.klass;
        D.27279 = mono_class_enum_basetype (D.27278);
        D.27280 = D.27279->type;
        type = (int) D.27280;
        goto handle_enum;
        <D.27277>:
        D.27210 = sig->ret;
        emit_marshal (&m, 0, D.27210, spec, 0, 0B, 3);
        goto <D.22974>;
        <D.22976>:
        <D.22977>:
        <D.22978>:
        <D.22979>:
        <D.22980>:
        <D.22981>:
        <D.22982>:
        <D.22983>:
        <D.22984>:
        <D.22985>:
        <D.22986>:
        <D.22987>:
        <D.22988>:
        <D.22989>:
        <D.22990>:
        <D.22991>:
        <D.22992>:
        <D.22993>:
        <D.22994>:
        <D.22995>:
        <D.22996>:
        <D.22997>:
        D.27210 = sig->ret;
        emit_marshal (&m, 0, D.27210, spec, 0, 0B, 3);
        goto <D.22974>;
        <D.22998>:
        <D.22999>:
        D.27210 = sig->ret;
        D.27269 = D.27210->type;
        D.27281 = (int) D.27269;
        monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.27281);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8782);
        <D.22974>:
      }
      goto <D.27282>;
      <D.27268>:
      mono_mb_emit_stloc (mb, 3);
      <D.27282>:
      if (check_exceptions != 0) goto <D.27283>; else goto <D.27284>;
      <D.27283>:
      emit_thread_interrupt_checkpoint (mb);
      <D.27284>:
      i = 0;
      goto <D.23011>;
      <D.23010>:
      {
        struct MonoType * t;
        struct MonoMarshalSpec * spec;

        t = sig->params[i];
        i.180 = (sizetype) i;
        D.27234 = i.180 + 1;
        D.27235 = D.27234 * 4;
        D.27236 = mspecs + D.27235;
        spec = *D.27236;
        argnum = i + param_shift;
        if (spec != 0B) goto <D.27285>; else goto <D.27286>;
        <D.27285>:
        D.27287 = spec->native;
        D.27288 = D.27287 == 44;
        D.27289 = D.27287 == 40;
        D.27290 = D.27288 | D.27289;
        if (D.27290 != 0) goto <D.27291>; else goto <D.27292>;
        <D.27291>:
        i.179 = (unsigned int) i;
        D.27229 = i.179 * 4;
        D.27230 = tmp_locals + D.27229;
        D.27242 = *D.27230;
        emit_marshal (&m, argnum, t, spec, D.27242, 0B, 2);
        // predicted unlikely by continue predictor.
        goto <D.23002>;
        <D.27292>:
        <D.27286>:
        D.27293 = t->type;
        D.27294 = (int) D.27293;
        switch (D.27294) <default: <D.27295>, case 2: <D.23008>, case 14: <D.23003>, case 17: <D.23004>, case 18: <D.23005>, case 28: <D.23006>, case 29: <D.23007>>
        <D.23003>:
        <D.23004>:
        <D.23005>:
        <D.23006>:
        <D.23007>:
        <D.23008>:
        i.179 = (unsigned int) i;
        D.27229 = i.179 * 4;
        D.27230 = tmp_locals + D.27229;
        D.27242 = *D.27230;
        emit_marshal (&m, argnum, t, spec, D.27242, 0B, 2);
        goto <D.23009>;
        <D.27295>:
        <D.23009>:
      }
      <D.23002>:
      i = i + 1;
      <D.23011>:
      D.27220 = sig->param_count;
      D.27223 = (int) D.27220;
      if (D.27223 > i) goto <D.23010>; else goto <D.23012>;
      <D.23012>:
      D.27210 = sig->ret;
      D.27296 = mono_type_is_void (D.27210);
      if (D.27296 == 0) goto <D.27297>; else goto <D.27298>;
      <D.27297>:
      mono_mb_emit_ldloc (mb, 3);
      <D.27298>:
      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.27301;
  <unnamed type> D.27304;
  int D.27307;
  unsigned char D.27312;
  int D.27313;
  struct MonoClass * D.27314;
  struct MonoClass * D.27315;
  <unnamed type> D.27324;
  unsigned int D.27325;
  _Bool D.27326;
  _Bool D.27327;
  _Bool D.27328;
  <unnamed type> D.27337;
  _Bool D.27340;
  _Bool D.27341;
  _Bool D.27342;
  struct MonoClass * D.27344;
  int D.27349;
  int D.27352;

  D.27301 = mono_class_from_mono_type (t);
  mono_marshal_load_type_info (D.27301);
  if (spec != 0B) goto <D.27302>; else goto <D.27303>;
  <D.27302>:
  D.27304 = spec->native;
  if (D.27304 == 44) goto <D.27305>; else goto <D.27306>;
  <D.27305>:
  D.27307 = emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27306>:
  <D.27303>:
  if (spec != 0B) goto <D.27308>; else goto <D.27309>;
  <D.27308>:
  D.27304 = spec->native;
  if (D.27304 == 40) goto <D.27310>; else goto <D.27311>;
  <D.27310>:
  D.27307 = emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27311>:
  <D.27309>:
  D.27312 = t->type;
  D.27313 = (int) D.27312;
  switch (D.27313) <default: <D.27355>, case 2: <D.22928>, case 3: <D.22930>, case 4: <D.22931>, case 5: <D.22932>, case 6: <D.22933>, case 7: <D.22934>, case 8: <D.22935>, case 9: <D.22936>, case 10: <D.22941>, case 11: <D.22942>, case 12: <D.22939>, case 13: <D.22940>, case 14: <D.22923>, case 15: <D.22929>, case 17: <D.22922>, case 18: <D.22924>, case 20: <D.22926>, case 21: <D.22944>, case 24: <D.22937>, case 25: <D.22938>, case 27: <D.22943>, case 28: <D.22925>, case 29: <D.22927>>
  <D.22922>:
  D.27314 = t->data.klass;
  D.27315 = mono_defaults.handleref_class;
  if (D.27314 == D.27315) goto <D.27316>; else goto <D.27317>;
  <D.27316>:
  D.27307 = emit_marshal_handleref (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27317>:
  D.27307 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22923>:
  D.27307 = emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22924>:
  <D.22925>:
  if (spec != 0B) goto <D.27318>; else goto <D.27319>;
  <D.27318>:
  D.27304 = spec->native;
  if (D.27304 == 27) goto <D.27320>; else goto <D.27321>;
  <D.27320>:
  D.27307 = emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27321>:
  <D.27319>:
  if (spec != 0B) goto <D.27322>; else goto <D.27323>;
  <D.27322>:
  D.27324 = spec->native;
  D.27325 = D.27324 + 4294967271;
  D.27326 = D.27325 <= 1;
  D.27327 = D.27324 == 28;
  D.27328 = D.27326 | D.27327;
  if (D.27328 != 0) goto <D.27329>; else goto <D.27330>;
  <D.27329>:
  D.27307 = mono_cominterop_emit_marshal_com_interface (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27330>:
  <D.27323>:
  if (spec != 0B) goto <D.27333>; else goto <D.27334>;
  <D.27333>:
  D.27304 = spec->native;
  if (D.27304 == 29) goto <D.27335>; else goto <D.27336>;
  <D.27335>:
  D.27337 = spec->data.safearray_data.elem_type;
  if (D.27337 == 12) goto <D.27338>; else goto <D.27339>;
  <D.27338>:
  D.27340 = action == 2;
  D.27341 = action == 0;
  D.27342 = D.27340 | D.27341;
  if (D.27342 != 0) goto <D.27331>; else goto <D.27343>;
  <D.27343>:
  if (action == 1) goto <D.27331>; else goto <D.27332>;
  <D.27331>:
  D.27307 = mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27332>:
  <D.27339>:
  <D.27336>:
  <D.27334>:
  D.27344 = mono_defaults.safehandle_class;
  if (D.27344 != 0B) goto <D.27345>; else goto <D.27346>;
  <D.27345>:
  D.27314 = t->data.klass;
  if (D.27314 != 0B) goto <D.27347>; else goto <D.27348>;
  <D.27347>:
  D.27314 = t->data.klass;
  D.27344 = mono_defaults.safehandle_class;
  D.27349 = mono_class_is_subclass_of (D.27314, D.27344, 0);
  if (D.27349 != 0) goto <D.27350>; else goto <D.27351>;
  <D.27350>:
  D.27307 = emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27351>:
  <D.27348>:
  <D.27346>:
  D.27307 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22926>:
  <D.22927>:
  D.27307 = emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22928>:
  D.27307 = emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22929>:
  D.27307 = emit_marshal_ptr (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22930>:
  D.27307 = emit_marshal_char (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22931>:
  <D.22932>:
  <D.22933>:
  <D.22934>:
  <D.22935>:
  <D.22936>:
  <D.22937>:
  <D.22938>:
  <D.22939>:
  <D.22940>:
  <D.22941>:
  <D.22942>:
  <D.22943>:
  D.27307 = emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.22944>:
  D.27352 = mono_type_generic_inst_is_valuetype (t);
  if (D.27352 != 0) goto <D.27353>; else goto <D.27354>;
  <D.27353>:
  D.27307 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27354>:
  D.27307 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.27307;
  <D.27355>:
  D.27307 = conv_arg;
  return D.27307;
}


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.183;
  struct MonoImage * D.27360;
  struct MonoClass * ICustomMarshaler.184;
  struct MonoMethod * cleanup_native.185;
  struct MonoMethod * cleanup_native.186;
  _Bool D.27366;
  long int D.27367;
  long int D.27368;
  struct MonoMethod * cleanup_managed.187;
  struct MonoMethod * cleanup_managed.188;
  _Bool D.27373;
  long int D.27374;
  long int D.27375;
  struct MonoMethod * marshal_managed_to_native.189;
  struct MonoMethod * marshal_managed_to_native.190;
  _Bool D.27380;
  long int D.27381;
  long int D.27382;
  struct MonoMethod * marshal_native_to_managed.191;
  struct MonoMethod * marshal_native_to_managed.192;
  _Bool D.27387;
  long int D.27388;
  long int D.27389;
  char * D.27392;
  struct MonoImage * D.27393;
  _Bool D.27394;
  long int D.27395;
  long int D.27396;
  _Bool D.27399;
  long int D.27400;
  long int D.27401;
  int D.27404;
  const char * D.27407;
  struct MonoType * D.27412;
  unsigned char D.27413;
  struct MonoClass * D.27415;
  struct MonoType * D.27417;
  unsigned char D.27418;
  _Bool D.27423;
  _Bool D.27424;
  _Bool D.27425;
  int D.27428;
  unsigned char D.27429;
  int D.27430;
  struct MonoClass * D.27431;
  struct MonoType * D.27432;
  unsigned int conv_arg.193;
  unsigned char D.27434;
  unsigned char D.27435;
  short unsigned int D.27438;
  int D.27439;
  int D.27440;
  unsigned int D.27444;
  unsigned int D.27445;
  unsigned int argnum.194;
  unsigned int D.27450;
  char * D.27451;
  gchar * D.27452;
  struct MonoClass * D.27457;
  unsigned int pos2.195;
  unsigned int D.27459;
  gchar * D.27462;
  gchar * D.27466;
  gchar * D.27467;
  int D.27471;
  unsigned int D.27472;
  gchar * D.27473;
  struct MonoClass * D.27474;
  struct MonoType * D.27475;
  unsigned int D.27481;
  gchar * D.27482;
  _Bool D.27485;
  long int D.27486;
  long int D.27487;
  int D.27490;
  unsigned int D.27491;
  gchar * D.27492;
  unsigned int D.27493;
  gchar * D.27496;
  gchar * D.27497;
  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.183 = ICustomMarshaler;
  if (ICustomMarshaler.183 == 0B) goto <D.27358>; else goto <D.27359>;
  <D.27358>:
  D.27360 = mono_defaults.corlib;
  ICustomMarshaler.184 = mono_class_from_name (D.27360, "System.Runtime.InteropServices", "ICustomMarshaler");
  ICustomMarshaler = ICustomMarshaler.184;
  ICustomMarshaler.183 = ICustomMarshaler;
  if (ICustomMarshaler.183 == 0B) goto <D.27362>; else goto <D.27363>;
  <D.27362>:
  exception_msg = monoeg_strdup ("Current profile doesn\'t support ICustomMarshaler");
  goto handle_exception;
  <D.27363>:
  ICustomMarshaler.183 = ICustomMarshaler;
  cleanup_native.185 = mono_class_get_method_from_name (ICustomMarshaler.183, "CleanUpNativeData", 1);
  cleanup_native = cleanup_native.185;
  cleanup_native.186 = cleanup_native;
  D.27366 = cleanup_native.186 == 0B;
  D.27367 = (long int) D.27366;
  D.27368 = __builtin_expect (D.27367, 0);
  if (D.27368 != 0) goto <D.27369>; else goto <D.27370>;
  <D.27369>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5887, "cleanup_native");
  <D.27370>:
  ICustomMarshaler.183 = ICustomMarshaler;
  cleanup_managed.187 = mono_class_get_method_from_name (ICustomMarshaler.183, "CleanUpManagedData", 1);
  cleanup_managed = cleanup_managed.187;
  cleanup_managed.188 = cleanup_managed;
  D.27373 = cleanup_managed.188 == 0B;
  D.27374 = (long int) D.27373;
  D.27375 = __builtin_expect (D.27374, 0);
  if (D.27375 != 0) goto <D.27376>; else goto <D.27377>;
  <D.27376>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5889, "cleanup_managed");
  <D.27377>:
  ICustomMarshaler.183 = ICustomMarshaler;
  marshal_managed_to_native.189 = mono_class_get_method_from_name (ICustomMarshaler.183, "MarshalManagedToNative", 1);
  marshal_managed_to_native = marshal_managed_to_native.189;
  marshal_managed_to_native.190 = marshal_managed_to_native;
  D.27380 = marshal_managed_to_native.190 == 0B;
  D.27381 = (long int) D.27380;
  D.27382 = __builtin_expect (D.27381, 0);
  if (D.27382 != 0) goto <D.27383>; else goto <D.27384>;
  <D.27383>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5891, "marshal_managed_to_native");
  <D.27384>:
  ICustomMarshaler.183 = ICustomMarshaler;
  marshal_native_to_managed.191 = mono_class_get_method_from_name (ICustomMarshaler.183, "MarshalNativeToManaged", 1);
  marshal_native_to_managed = marshal_native_to_managed.191;
  marshal_native_to_managed.192 = marshal_native_to_managed;
  D.27387 = marshal_native_to_managed.192 == 0B;
  D.27388 = (long int) D.27387;
  D.27389 = __builtin_expect (D.27388, 0);
  if (D.27389 != 0) goto <D.27390>; else goto <D.27391>;
  <D.27390>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5893, "marshal_native_to_managed");
  <D.27391>:
  <D.27359>:
  D.27392 = spec->data.custom_data.custom_name;
  D.27393 = m->image;
  mtype = mono_reflection_type_from_name (D.27392, D.27393);
  D.27394 = mtype == 0B;
  D.27395 = (long int) D.27394;
  D.27396 = __builtin_expect (D.27395, 0);
  if (D.27396 != 0) goto <D.27397>; else goto <D.27398>;
  <D.27397>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5897, "mtype != NULL");
  <D.27398>:
  mklass = mono_class_from_mono_type (mtype);
  D.27399 = mklass == 0B;
  D.27400 = (long int) D.27399;
  D.27401 = __builtin_expect (D.27400, 0);
  if (D.27401 != 0) goto <D.27402>; else goto <D.27403>;
  <D.27402>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5899, "mklass != NULL");
  <D.27403>:
  ICustomMarshaler.183 = ICustomMarshaler;
  D.27404 = mono_class_is_assignable_from (ICustomMarshaler.183, mklass);
  if (D.27404 == 0) goto <D.27405>; else goto <D.27406>;
  <D.27405>:
  D.27407 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement the ICustomMarshaler interface.", D.27407);
  <D.27406>:
  get_instance = mono_class_get_method_from_name_flags (mklass, "GetInstance", 1, 16);
  if (get_instance != 0B) goto <D.27408>; else goto <D.27409>;
  <D.27408>:
  {
    struct MonoMethodSignature * get_sig;

    get_sig = mono_method_signature (get_instance);
    D.27412 = get_sig->ret;
    D.27413 = D.27412->type;
    if (D.27413 != 18) goto <D.27410>; else goto <D.27414>;
    <D.27414>:
    D.27412 = get_sig->ret;
    D.27415 = mono_class_from_mono_type (D.27412);
    ICustomMarshaler.183 = ICustomMarshaler;
    if (D.27415 != ICustomMarshaler.183) goto <D.27410>; else goto <D.27416>;
    <D.27416>:
    D.27417 = get_sig->params[0];
    D.27418 = D.27417->type;
    if (D.27418 != 14) goto <D.27410>; else goto <D.27411>;
    <D.27410>:
    get_instance = 0B;
    <D.27411>:
  }
  <D.27409>:
  if (get_instance == 0B) goto <D.27419>; else goto <D.27420>;
  <D.27419>:
  D.27407 = 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.27407);
  <D.27420>:
  handle_exception:
  if (exception_msg != 0B) goto <D.27421>; else goto <D.27422>;
  <D.27421>:
  switch (action) <default: <D.22507>, case 0: <D.22502>, case 1: <D.22506>, case 3: <D.22503>, case 6: <D.22504>>
  <D.22502>:
  <D.22503>:
  <D.22504>:
  D.27423 = action == 3;
  D.27424 = action == 6;
  D.27425 = D.27423 | D.27424;
  if (D.27425 != 0) goto <D.27426>; else goto <D.27427>;
  <D.27426>:
  mono_mb_emit_byte (mb, 38);
  <D.27427>:
  mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
  monoeg_g_free (exception_msg);
  goto <D.22505>;
  <D.22506>:
  mono_mb_emit_byte (mb, 20);
  goto <D.22505>;
  <D.22507>:
  goto <D.22505>;
  <D.22505>:
  D.27428 = 0;
  return D.27428;
  <D.27422>:
  switch (action) <default: <D.22524>, case 0: <D.22508>, case 1: <D.22519>, case 2: <D.22518>, case 3: <D.22520>, case 4: <D.22521>, case 5: <D.22523>, case 6: <D.22522>>
  <D.22508>:
  D.27429 = t->type;
  D.27430 = (int) D.27429;
  switch (D.27430) <default: <D.22516>, case 14: <D.22511>, case 17: <D.22514>, case 18: <D.22509>, case 20: <D.22512>, case 28: <D.22510>, case 29: <D.22513>>
  <D.22509>:
  <D.22510>:
  <D.22511>:
  <D.22512>:
  <D.22513>:
  <D.22514>:
  goto <D.22515>;
  <D.22516>:
  D.27429 = t->type;
  D.27430 = (int) D.27429;
  monoeg_g_log (0B, 16, "custom marshalling of type %x is currently not supported", D.27430);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5955);
  <D.22515>:
  D.27431 = mono_defaults.int_class;
  D.27432 = &D.27431->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.27432);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27436>; else goto <D.27437>;
  <D.27436>:
  D.27438 = t->attrs;
  D.27439 = (int) D.27438;
  D.27440 = D.27439 & 2;
  if (D.27440 != 0) goto <D.22517>; else goto <D.27441>;
  <D.27441>:
  <D.27437>:
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 == 0) goto <D.27442>; else goto <D.27443>;
  <D.27442>:
  D.27438 = t->attrs;
  D.27444 = (unsigned int) D.27438;
  D.27445 = D.27444 & 3;
  if (D.27445 == 2) goto <D.22517>; else goto <D.27446>;
  <D.27446>:
  <D.27443>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27448>; else goto <D.27449>;
  <D.27448>:
  mono_mb_emit_byte (mb, 77);
  <D.27449>:
  D.27450 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27450;
  D.27451 = spec->data.custom_data.cookie;
  D.27452 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27452);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27453>; else goto <D.27454>;
  <D.27453>:
  mono_mb_emit_byte (mb, 80);
  <D.27454>:
  D.27429 = t->type;
  if (D.27429 == 17) goto <D.27455>; else goto <D.27456>;
  <D.27455>:
  D.27431 = mono_defaults.int_class;
  D.27432 = &D.27431->byval_arg;
  *conv_arg_type = D.27432;
  D.27457 = mono_class_from_mono_type (t);
  mono_mb_emit_op (mb, 140, D.27457);
  <D.27456>:
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22518>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.27459 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27459;
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27460>; else goto <D.27461>;
  <D.27460>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27451 = spec->data.custom_data.cookie;
  D.27462 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27462);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_byte (mb, 81);
  goto <D.27463>;
  <D.27461>:
  D.27438 = t->attrs;
  D.27439 = (int) D.27438;
  D.27440 = D.27439 & 2;
  if (D.27440 != 0) goto <D.27464>; else goto <D.27465>;
  <D.27464>:
  D.27451 = spec->data.custom_data.cookie;
  D.27466 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27466);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_byte (mb, 38);
  <D.27465>:
  <D.27463>:
  D.27451 = spec->data.custom_data.cookie;
  D.27467 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27467);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  cleanup_native.186 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.186);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22519>:
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27468>; else goto <D.27469>;
  <D.27468>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  goto <D.27470>;
  <D.27469>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  <D.27470>:
  goto <D.22517>;
  <D.22520>:
  D.27431 = mono_defaults.int_class;
  D.27432 = &D.27431->byval_arg;
  D.27471 = mono_mb_add_local (mb, D.27432);
  loc1 = (guint32) D.27471;
  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.27472 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27472;
  D.27451 = spec->data.custom_data.cookie;
  D.27473 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27473);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_native.186 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.186);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22521>:
  D.27474 = mono_defaults.object_class;
  D.27475 = &D.27474->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.27475);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27476>; else goto <D.27477>;
  <D.27476>:
  D.27438 = t->attrs;
  D.27439 = (int) D.27438;
  D.27440 = D.27439 & 2;
  if (D.27440 != 0) goto <D.22517>; else goto <D.27478>;
  <D.27478>:
  <D.27477>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27479>; else goto <D.27480>;
  <D.27479>:
  mono_mb_emit_byte (mb, 77);
  <D.27480>:
  D.27481 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27481;
  D.27451 = spec->data.custom_data.cookie;
  D.27482 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27482);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27483>; else goto <D.27484>;
  <D.27483>:
  mono_mb_emit_byte (mb, 77);
  <D.27484>:
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22522>:
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  D.27485 = D.27435 != 0;
  D.27486 = (long int) D.27485;
  D.27487 = __builtin_expect (D.27486, 0);
  if (D.27487 != 0) goto <D.27488>; else goto <D.27489>;
  <D.27488>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6102, "!t->byref");
  <D.27489>:
  D.27474 = mono_defaults.object_class;
  D.27475 = &D.27474->byval_arg;
  D.27490 = mono_mb_add_local (mb, D.27475);
  loc1 = (guint32) D.27490;
  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.27491 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27491;
  D.27451 = spec->data.custom_data.cookie;
  D.27492 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27492);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_managed.188 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.188);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22523>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.27493 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.27493;
  D.27434 = BIT_FIELD_REF <*t, 8, 56>;
  D.27435 = D.27434 & 64;
  if (D.27435 != 0) goto <D.27494>; else goto <D.27495>;
  <D.27494>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.27451 = spec->data.custom_data.cookie;
  D.27496 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27496);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  mono_mb_emit_byte (mb, 223);
  <D.27495>:
  D.27451 = spec->data.custom_data.cookie;
  D.27497 = monoeg_strdup (D.27451);
  mono_mb_emit_ldstr (mb, D.27497);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  cleanup_managed.188 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.188);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.22517>;
  <D.22524>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6159);
  <D.22517>:
  D.27428 = conv_arg;
  return D.27428;
}


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.27501;
  unsigned char D.27502;
  _Bool D.27503;
  long int D.27504;
  long int D.27505;
  unsigned char D.27508;
  unsigned char D.27509;
  _Bool D.27510;
  long int D.27511;
  long int D.27512;
  struct MonoClass * D.27515;
  struct MonoType * D.27516;
  unsigned int argnum.196;
  int encoding.197;
  short unsigned int D.27519;
  int D.27520;
  unsigned int conv_arg.198;
  int encoding.199;
  int D.27523;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22541>, case 0: <D.22535>, case 1: <D.22538>, case 2: <D.22539>>
  <D.22535>:
  {
    MonoMarshalNative encoding;

    D.27501 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.27501, 0B);
    D.27502 = t->type;
    D.27503 = D.27502 != 28;
    D.27504 = (long int) D.27503;
    D.27505 = __builtin_expect (D.27504, 0);
    if (D.27505 != 0) goto <D.27506>; else goto <D.27507>;
    <D.27506>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6179, "t->type == MONO_TYPE_OBJECT");
    <D.27507>:
    D.27508 = BIT_FIELD_REF <*t, 8, 56>;
    D.27509 = D.27508 & 64;
    D.27510 = D.27509 != 0;
    D.27511 = (long int) D.27510;
    D.27512 = __builtin_expect (D.27511, 0);
    if (D.27512 != 0) goto <D.27513>; else goto <D.27514>;
    <D.27513>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6180, "!t->byref");
    <D.27514>:
    D.27515 = mono_defaults.int_class;
    D.27516 = &D.27515->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.27516);
    argnum.196 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.196);
    encoding.197 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.197);
    D.27519 = t->attrs;
    D.27520 = (int) D.27519;
    mono_mb_emit_icon (mb, D.27520);
    mono_mb_emit_icall (mb, mono_marshal_asany);
    conv_arg.198 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.198);
    goto <D.22537>;
  }
  <D.22538>:
  conv_arg.198 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.198);
  goto <D.22537>;
  <D.22539>:
  {
    MonoMarshalNative encoding;

    D.27501 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.27501, 0B);
    argnum.196 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.196);
    conv_arg.198 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.198);
    encoding.199 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.199);
    D.27519 = t->attrs;
    D.27520 = (int) D.27519;
    mono_mb_emit_icon (mb, D.27520);
    mono_mb_emit_icall (mb, mono_marshal_free_asany);
    goto <D.22537>;
  }
  <D.22541>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6207);
  <D.22537>:
  D.27523 = conv_arg;
  return D.27523;
}


mono_marshal_get_string_encoding (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  <unnamed type> D.27527;
  <unnamed type> D.27530;
  _Bool D.27531;
  _Bool D.27532;
  _Bool D.27533;
  MonoMarshalNative D.27536;
  short unsigned int D.27540;
  int D.27541;
  int D.27542;

  if (spec != 0B) goto <D.27525>; else goto <D.27526>;
  <D.27525>:
  D.27527 = spec->native;
  if (D.27527 == 42) goto <D.27528>; else goto <D.27529>;
  <D.27528>:
  D.27530 = spec->data.array_data.elem_type;
  D.27531 = D.27530 != 0;
  D.27532 = D.27530 != 80;
  D.27533 = D.27531 & D.27532;
  if (D.27533 != 0) goto <D.27534>; else goto <D.27535>;
  <D.27534>:
  D.27536 = spec->data.array_data.elem_type;
  return D.27536;
  <D.27535>:
  goto <D.27537>;
  <D.27529>:
  D.27536 = spec->native;
  return D.27536;
  <D.27537>:
  <D.27526>:
  if (piinfo == 0B) goto <D.27538>; else goto <D.27539>;
  <D.27538>:
  D.27536 = 20;
  return D.27536;
  <D.27539>:
  D.27540 = piinfo->piflags;
  D.27541 = (int) D.27540;
  D.27542 = D.27541 & 6;
  switch (D.27542) <default: <D.21500>, case 2: <D.21497>, case 4: <D.21498>, case 6: <D.21499>>
  <D.21497>:
  D.27536 = 20;
  return D.27536;
  <D.21498>:
  D.27536 = 21;
  return D.27536;
  <D.21499>:
  D.27536 = 20;
  return D.27536;
  <D.21500>:
  D.27536 = 20;
  return D.27536;
}


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.27544;
  unsigned char D.27545;
  unsigned char D.27546;
  unsigned int argnum.200;
  unsigned int conv_arg.201;
  struct _IO_FILE * stderr.202;
  int D.27552;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22645>, case 0: <D.22634>, case 1: <D.22638>, case 2: <D.22639>, case 3: <D.22640>, case 4: <D.22642>, case 5: <D.22643>, case 6: <D.22644>>
  <D.22634>:
  {
    struct MonoType * intptr_type;

    D.27544 = mono_defaults.int_class;
    intptr_type = &D.27544->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    D.27545 = BIT_FIELD_REF <*t, 8, 56>;
    D.27546 = D.27545 & 64;
    if (D.27546 != 0) goto <D.27547>; else goto <D.27548>;
    <D.27547>:
    {
      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.22637>;
    }
    <D.27548>:
    argnum.200 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.200);
    mono_mb_emit_icon (mb, 4);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 77);
    conv_arg.201 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.201);
    goto <D.22637>;
  }
  <D.22638>:
  conv_arg.201 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.201);
  goto <D.22637>;
  <D.22639>:
  goto <D.22637>;
  <D.22640>:
  {
    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.22637>;
  }
  <D.22642>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.22637>;
  <D.22643>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.22637>;
  <D.22644>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.22637>;
  <D.22645>:
  stderr.202 = stderr;
  fprintf (stderr.202, "Unhandled case for MarshalAction: %d\n", action);
  <D.22637>:
  D.27552 = conv_arg;
  return D.27552;
}


mono_mb_emit_exception_marshal_directive (struct MonoMethodBuilder * mb, char * msg)
{
  int D.27555;
  struct MonoMethod * D.27558;
  struct MonoClass * D.27559;
  struct MonoImage * D.27560;
  char * s;

  D.27555 = mb->dynamic;
  if (D.27555 == 0) goto <D.27556>; else goto <D.27557>;
  <D.27556>:
  D.27558 = mb->method;
  D.27559 = D.27558->klass;
  D.27560 = D.27559->image;
  s = mono_image_strdup (D.27560, msg);
  monoeg_g_free (msg);
  goto <D.27561>;
  <D.27557>:
  s = monoeg_strdup (msg);
  <D.27561>:
  mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
}


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

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


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.27564;
  struct MonoClass * D.27565;
  struct MonoType * D.27566;
  unsigned char D.27567;
  unsigned char D.27568;
  short unsigned int D.27571;
  int D.27572;
  int D.27573;
  unsigned int argnum.203;
  void * D.27580;
  unsigned int conv_arg.204;
  struct MonoMethod * m.205;
  struct MonoClass * D.27589;
  struct MonoMethod * m.206;
  _Bool D.27591;
  long int D.27592;
  long int D.27593;
  _Bool D.27598;
  long int D.27599;
  long int D.27600;
  unsigned int D.27606;
  unsigned int D.27607;
  void * D.27610;
  int need_free.207;
  void * D.27623;
  struct MonoClass * D.27627;
  struct MonoType * D.27628;
  void * D.27636;
  void * D.27641;
  void * D.27642;
  void * D.27646;
  int D.27647;
  struct MonoMethodBuilder * mb;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;
  gboolean need_free;

  try
    {
      mb = m->mb;
      D.27564 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.27564, spec);
      D.27564 = m->piinfo;
      conv = mono_marshal_get_string_to_ptr_conv (D.27564, spec);
      switch (action) <default: <D.22596>, case 0: <D.22582>, case 1: <D.22589>, case 2: <D.22585>, case 3: <D.22590>, case 4: <D.22592>, case 5: <D.22594>, case 6: <D.22595>>
      <D.22582>:
      D.27565 = mono_defaults.int_class;
      D.27566 = &D.27565->byval_arg;
      *conv_arg_type = D.27566;
      D.27565 = mono_defaults.int_class;
      D.27566 = &D.27565->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.27566);
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27569>; else goto <D.27570>;
      <D.27569>:
      D.27571 = t->attrs;
      D.27572 = (int) D.27571;
      D.27573 = D.27572 & 2;
      if (D.27573 != 0) goto <D.22583>; else goto <D.27574>;
      <D.27574>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      mono_mb_emit_byte (mb, 77);
      goto <D.27576>;
      <D.27570>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      <D.27576>:
      if (conv == 4294967295) goto <D.27577>; else goto <D.27578>;
      <D.27577>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
      }
      goto <D.27579>;
      <D.27578>:
      D.27580 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27580);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      <D.27579>:
      goto <D.22583>;
      <D.22585>:
      D.27564 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.27564, spec, &need_free);
      if (conv == 4294967295) goto <D.27582>; else goto <D.27583>;
      <D.27582>:
      {
        char * msg;

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

        m.205 = m;
        if (m.205 == 0B) goto <D.27587>; else goto <D.27588>;
        <D.27587>:
        D.27589 = mono_defaults.string_class;
        m.206 = mono_class_get_method_from_name_flags (D.27589, "get_Length", -1, 0);
        m = m.206;
        m.205 = m;
        D.27591 = m.205 == 0B;
        D.27592 = (long int) D.27591;
        D.27593 = __builtin_expect (D.27592, 0);
        if (D.27593 != 0) goto <D.27594>; else goto <D.27595>;
        <D.27594>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6559, "m");
        <D.27595>:
        <D.27588>:
        D.27567 = BIT_FIELD_REF <*t, 8, 56>;
        D.27568 = D.27567 & 64;
        if (D.27568 == 0) goto <D.27596>; else goto <D.27597>;
        <D.27596>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("VBByRefStr marshalling requires a ref parameter.", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.22583>;
        }
        <D.27597>:
        D.27567 = BIT_FIELD_REF <*t, 8, 56>;
        D.27568 = D.27567 & 64;
        D.27598 = D.27568 == 0;
        D.27599 = (long int) D.27598;
        D.27600 = __builtin_expect (D.27599, 0);
        if (D.27600 != 0) goto <D.27601>; else goto <D.27602>;
        <D.27601>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6572, "t->byref");
        <D.27602>:
        argnum.203 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.203);
        conv_arg.204 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.204);
        argnum.203 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.203);
        mono_mb_emit_byte (mb, 77);
        m.205 = m;
        mono_mb_emit_managed_call (mb, m.205, 0B);
        mono_mb_emit_icall (mb, mono_string_new_len_wrapper);
        mono_mb_emit_byte (mb, 81);
      }
      goto <D.27603>;
      <D.27585>:
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27604>; else goto <D.27605>;
      <D.27604>:
      D.27571 = t->attrs;
      D.27606 = (unsigned int) D.27571;
      D.27607 = D.27606 & 3;
      if (D.27607 != 1) goto <D.27608>; else goto <D.27609>;
      <D.27608>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      D.27610 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27610);
      mono_mb_emit_byte (mb, 81);
      need_free = 1;
      <D.27609>:
      <D.27605>:
      <D.27603>:
      need_free.207 = need_free;
      if (need_free.207 != 0) goto <D.27612>; else goto <D.27613>;
      <D.27612>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      if (conv == 32) goto <D.27614>; else goto <D.27615>;
      <D.27614>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.27616>;
      <D.27615>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.27616>:
      <D.27613>:
      goto <D.22583>;
      <D.22589>:
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27619>; else goto <D.27617>;
      <D.27619>:
      if (encoding != 34) goto <D.27620>; else goto <D.27617>;
      <D.27620>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.204);
      goto <D.27618>;
      <D.27617>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      <D.27618>:
      goto <D.22583>;
      <D.22590>:
      mono_mb_emit_stloc (mb, 0);
      D.27564 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.27564, spec, &need_free);
      if (conv == 4294967295) goto <D.27621>; else goto <D.27622>;
      <D.27621>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.22583>;
      }
      <D.27622>:
      mono_mb_emit_ldloc (mb, 0);
      D.27623 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27623);
      mono_mb_emit_stloc (mb, 3);
      mono_mb_emit_ldloc (mb, 0);
      if (conv == 32) goto <D.27624>; else goto <D.27625>;
      <D.27624>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.27626>;
      <D.27625>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.27626>:
      goto <D.22583>;
      <D.22592>:
      D.27627 = mono_defaults.object_class;
      D.27628 = &D.27627->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.27628);
      D.27565 = mono_defaults.int_class;
      D.27566 = &D.27565->byval_arg;
      *conv_arg_type = D.27566;
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27629>; else goto <D.27630>;
      <D.27629>:
      D.27571 = t->attrs;
      D.27572 = (int) D.27571;
      D.27573 = D.27572 & 2;
      if (D.27573 != 0) goto <D.22583>; else goto <D.27631>;
      <D.27631>:
      <D.27630>:
      D.27564 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.27564, spec, &need_free);
      if (conv == 4294967295) goto <D.27632>; else goto <D.27633>;
      <D.27632>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.22583>;
      }
      <D.27633>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27634>; else goto <D.27635>;
      <D.27634>:
      mono_mb_emit_byte (mb, 77);
      <D.27635>:
      D.27636 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27636);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      goto <D.22583>;
      <D.22594>:
      D.27567 = BIT_FIELD_REF <*t, 8, 56>;
      D.27568 = D.27567 & 64;
      if (D.27568 != 0) goto <D.27637>; else goto <D.27638>;
      <D.27637>:
      if (conv_arg != 0) goto <D.27639>; else goto <D.27640>;
      <D.27639>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      D.27641 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27641);
      mono_mb_emit_byte (mb, 223);
      <D.27640>:
      <D.27638>:
      goto <D.22583>;
      <D.22595>:
      D.27642 = conv_to_icall (conv);
      if (D.27642 == mono_marshal_string_to_utf16) goto <D.27643>; else goto <D.27644>;
      <D.27643>:
      mono_mb_emit_icall (mb, mono_marshal_string_to_utf16_copy);
      goto <D.27645>;
      <D.27644>:
      D.27646 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.27646);
      <D.27645>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.22583>;
      <D.22596>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6671);
      <D.22583>:
      D.27647 = conv_arg;
      return D.27647;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.21511>, case 19: <D.21510>, case 20: <D.21507>, case 21: <D.21506>, case 22: <D.21509>, case 34: <D.21508>>
  <D.21506>:
  D.27650 = 7;
  return D.27650;
  <D.21507>:
  <D.21508>:
  D.27650 = 4;
  return D.27650;
  <D.21509>:
  D.27650 = 9;
  return D.27650;
  <D.21510>:
  D.27650 = 3;
  return D.27650;
  <D.21511>:
  D.27650 = 4294967295;
  return D.27650;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.21532>, case 19: <D.21531>, case 20: <D.21528>, case 21: <D.21527>, case 22: <D.21530>, case 34: <D.21529>>
  <D.21527>:
  *need_free = 0;
  D.27652 = 8;
  return D.27652;
  <D.21528>:
  <D.21529>:
  D.27652 = 5;
  return D.27652;
  <D.21530>:
  D.27652 = 6;
  return D.27652;
  <D.21531>:
  D.27652 = 32;
  return D.27652;
  <D.21532>:
  D.27652 = 4294967295;
  return D.27652;
}


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

  switch (conv) <default: <D.21336>, case 3: <D.21318>, case 4: <D.21317>, case 5: <D.21315>, case 6: <D.21314>, case 7: <D.21312>, case 8: <D.21313>, case 9: <D.21316>, case 10: <D.21321>, case 11: <D.21320>, case 12: <D.21334>, case 13: <D.21335>, case 14: <D.21322>, case 15: <D.21323>, case 16: <D.21324>, case 17: <D.21330>, case 18: <D.21331>, case 19: <D.21332>, case 22: <D.21325>, case 23: <D.21326>, case 24: <D.21327>, case 29: <D.21328>, case 30: <D.21329>, case 31: <D.21333>, case 32: <D.21319>>
  <D.21312>:
  D.27654 = mono_marshal_string_to_utf16;
  return D.27654;
  <D.21313>:
  D.27654 = mono_string_from_utf16;
  return D.27654;
  <D.21314>:
  D.27654 = mono_string_new_wrapper;
  return D.27654;
  <D.21315>:
  D.27654 = mono_string_new_wrapper;
  return D.27654;
  <D.21316>:
  D.27654 = mono_string_to_lpstr;
  return D.27654;
  <D.21317>:
  D.27654 = mono_string_to_lpstr;
  return D.27654;
  <D.21318>:
  D.27654 = mono_string_to_bstr;
  return D.27654;
  <D.21319>:
  D.27654 = mono_string_from_bstr;
  return D.27654;
  <D.21320>:
  <D.21321>:
  D.27654 = mono_string_to_ansibstr;
  return D.27654;
  <D.21322>:
  D.27654 = mono_string_builder_to_utf8;
  return D.27654;
  <D.21323>:
  D.27654 = mono_string_builder_to_utf8;
  return D.27654;
  <D.21324>:
  D.27654 = mono_string_builder_to_utf16;
  return D.27654;
  <D.21325>:
  D.27654 = mono_array_to_savearray;
  return D.27654;
  <D.21326>:
  D.27654 = mono_array_to_lparray;
  return D.27654;
  <D.21327>:
  D.27654 = mono_free_lparray;
  return D.27654;
  <D.21328>:
  D.27654 = mono_delegate_to_ftnptr;
  return D.27654;
  <D.21329>:
  D.27654 = mono_ftnptr_to_delegate;
  return D.27654;
  <D.21330>:
  D.27654 = mono_string_utf8_to_builder;
  return D.27654;
  <D.21331>:
  D.27654 = mono_string_utf8_to_builder;
  return D.27654;
  <D.21332>:
  D.27654 = mono_string_utf16_to_builder;
  return D.27654;
  <D.21333>:
  D.27654 = mono_marshal_free_array;
  return D.27654;
  <D.21334>:
  D.27654 = mono_string_to_byvalstr;
  return D.27654;
  <D.21335>:
  D.27654 = mono_string_to_byvalwstr;
  return D.27654;
  <D.21336>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1582);
  D.27654 = 0B;
  return D.27654;
}


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.208;
  struct MonoClass * D.27659;
  struct MonoMethod * get_object_for_native_variant.209;
  _Bool D.27661;
  long int D.27662;
  long int D.27663;
  struct MonoMethod * get_native_variant_for_object.210;
  struct MonoMethod * get_native_variant_for_object.211;
  _Bool D.27670;
  long int D.27671;
  long int D.27672;
  struct MonoClass * D.27675;
  struct MonoType * D.27676;
  unsigned char D.27677;
  unsigned char D.27678;
  struct MonoClass * D.27681;
  struct MonoType * D.27682;
  struct MonoClass * D.27684;
  struct MonoType * D.27685;
  short unsigned int D.27688;
  unsigned int D.27689;
  unsigned int D.27690;
  unsigned int argnum.212;
  unsigned int conv_arg.213;
  struct MonoMethod * variant_clear.214;
  struct MonoClass * D.27699;
  struct MonoMethod * variant_clear.215;
  _Bool D.27701;
  long int D.27702;
  long int D.27703;
  struct MonoClass * D.27713;
  struct MonoType * D.27714;
  struct MonoClass * D.27717;
  struct MonoType * D.27718;
  struct MonoClass * D.27720;
  struct MonoType * D.27721;
  int D.27732;
  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.208 = get_object_for_native_variant;
  if (get_object_for_native_variant.208 == 0B) goto <D.27657>; else goto <D.27658>;
  <D.27657>:
  D.27659 = mono_defaults.marshal_class;
  get_object_for_native_variant.209 = mono_class_get_method_from_name (D.27659, "GetObjectForNativeVariant", 1);
  get_object_for_native_variant = get_object_for_native_variant.209;
  <D.27658>:
  get_object_for_native_variant.208 = get_object_for_native_variant;
  D.27661 = get_object_for_native_variant.208 == 0B;
  D.27662 = (long int) D.27661;
  D.27663 = __builtin_expect (D.27662, 0);
  if (D.27663 != 0) goto <D.27664>; else goto <D.27665>;
  <D.27664>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7411, "get_object_for_native_variant");
  <D.27665>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  if (get_native_variant_for_object.210 == 0B) goto <D.27667>; else goto <D.27668>;
  <D.27667>:
  D.27659 = mono_defaults.marshal_class;
  get_native_variant_for_object.211 = mono_class_get_method_from_name (D.27659, "GetNativeVariantForObject", 2);
  get_native_variant_for_object = get_native_variant_for_object.211;
  <D.27668>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  D.27670 = get_native_variant_for_object.210 == 0B;
  D.27671 = (long int) D.27670;
  D.27672 = __builtin_expect (D.27671, 0);
  if (D.27672 != 0) goto <D.27673>; else goto <D.27674>;
  <D.27673>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7415, "get_native_variant_for_object");
  <D.27674>:
  switch (action) <default: <D.22706>, case 0: <D.22695>, case 1: <D.22699>, case 2: <D.22697>, case 3: <D.22700>, case 4: <D.22702>, case 5: <D.22703>, case 6: <D.22704>>
  <D.22695>:
  D.27675 = mono_class_get_variant_class ();
  D.27676 = &D.27675->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.27676);
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27679>; else goto <D.27680>;
  <D.27679>:
  D.27681 = mono_class_get_variant_class ();
  D.27682 = &D.27681->this_arg;
  *conv_arg_type = D.27682;
  goto <D.27683>;
  <D.27680>:
  D.27684 = mono_class_get_variant_class ();
  D.27685 = &D.27684->byval_arg;
  *conv_arg_type = D.27685;
  <D.27683>:
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27686>; else goto <D.27687>;
  <D.27686>:
  D.27688 = t->attrs;
  D.27689 = (unsigned int) D.27688;
  D.27690 = D.27689 & 3;
  if (D.27690 == 2) goto <D.22696>; else goto <D.27691>;
  <D.27691>:
  <D.27687>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27693>; else goto <D.27694>;
  <D.27693>:
  mono_mb_emit_byte (mb, 80);
  <D.27694>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.213);
  get_native_variant_for_object.210 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.210, 0B);
  goto <D.22696>;
  <D.22697>:
  {
    static struct MonoMethod * variant_clear = 0B;

    variant_clear.214 = variant_clear;
    if (variant_clear.214 == 0B) goto <D.27697>; else goto <D.27698>;
    <D.27697>:
    D.27699 = mono_class_get_variant_class ();
    variant_clear.215 = mono_class_get_method_from_name (D.27699, "Clear", 0);
    variant_clear = variant_clear.215;
    <D.27698>:
    variant_clear.214 = variant_clear;
    D.27701 = variant_clear.214 == 0B;
    D.27702 = (long int) D.27701;
    D.27703 = __builtin_expect (D.27702, 0);
    if (D.27703 != 0) goto <D.27704>; else goto <D.27705>;
    <D.27704>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7442, "variant_clear");
    <D.27705>:
    D.27677 = BIT_FIELD_REF <*t, 8, 56>;
    D.27678 = D.27677 & 64;
    if (D.27678 != 0) goto <D.27706>; else goto <D.27707>;
    <D.27706>:
    D.27688 = t->attrs;
    D.27689 = (unsigned int) D.27688;
    D.27690 = D.27689 & 3;
    if (D.27690 != 1) goto <D.27708>; else goto <D.27709>;
    <D.27708>:
    argnum.212 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.212);
    conv_arg.213 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.213);
    get_object_for_native_variant.208 = get_object_for_native_variant;
    mono_mb_emit_managed_call (mb, get_object_for_native_variant.208, 0B);
    mono_mb_emit_byte (mb, 81);
    <D.27709>:
    <D.27707>:
    conv_arg.213 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.213);
    variant_clear.214 = variant_clear;
    mono_mb_emit_managed_call (mb, variant_clear.214, 0B);
    goto <D.22696>;
  }
  <D.22699>:
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27710>; else goto <D.27711>;
  <D.27710>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.213);
  goto <D.27712>;
  <D.27711>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.213);
  <D.27712>:
  goto <D.22696>;
  <D.22700>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.22696>;
  }
  <D.22702>:
  D.27713 = mono_defaults.object_class;
  D.27714 = &D.27713->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.27714);
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27715>; else goto <D.27716>;
  <D.27715>:
  D.27717 = mono_class_get_variant_class ();
  D.27718 = &D.27717->this_arg;
  *conv_arg_type = D.27718;
  goto <D.27719>;
  <D.27716>:
  D.27720 = mono_class_get_variant_class ();
  D.27721 = &D.27720->byval_arg;
  *conv_arg_type = D.27721;
  <D.27719>:
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27722>; else goto <D.27723>;
  <D.27722>:
  D.27688 = t->attrs;
  D.27689 = (unsigned int) D.27688;
  D.27690 = D.27689 & 3;
  if (D.27690 == 2) goto <D.22696>; else goto <D.27724>;
  <D.27724>:
  <D.27723>:
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27725>; else goto <D.27726>;
  <D.27725>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  goto <D.27727>;
  <D.27726>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.212);
  <D.27727>:
  get_object_for_native_variant.208 = get_object_for_native_variant;
  mono_mb_emit_managed_call (mb, get_object_for_native_variant.208, 0B);
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.213);
  goto <D.22696>;
  <D.22703>:
  D.27677 = BIT_FIELD_REF <*t, 8, 56>;
  D.27678 = D.27677 & 64;
  if (D.27678 != 0) goto <D.27728>; else goto <D.27729>;
  <D.27728>:
  D.27688 = t->attrs;
  D.27689 = (unsigned int) D.27688;
  D.27690 = D.27689 & 3;
  if (D.27690 != 1) goto <D.27730>; else goto <D.27731>;
  <D.27730>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.213);
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  get_native_variant_for_object.210 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.210, 0B);
  <D.27731>:
  <D.27729>:
  goto <D.22696>;
  <D.22704>:
  {
    char * msg;

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


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.27734;
  struct MonoMethod * sh_dangerous_add_ref.216;
  unsigned int argnum.217;
  unsigned int D.27739;
  unsigned int pos.218;
  unsigned char D.27741;
  unsigned char D.27742;
  unsigned int conv_arg.219;
  struct MonoClass * D.27746;
  struct MonoType * D.27747;
  unsigned int dar_release_slot.220;
  struct MonoMethod * sh_dangerous_release.221;
  struct MonoClass * D.27757;
  unsigned int dar_release_slot.222;
  unsigned int D.27762;
  unsigned int label_next.223;
  unsigned int D.27764;
  unsigned int D.27765;
  gchar * D.27768;
  struct MonoType * D.27771;
  unsigned int intptr_handle_slot.224;
  struct _IO_FILE * stderr.225;
  int D.27774;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22623>, case 0: <D.22607>, case 1: <D.22612>, case 2: <D.22613>, case 3: <D.22617>, case 4: <D.22620>, case 5: <D.22621>, case 6: <D.22622>>
  <D.22607>:
  {
    struct MonoType * intptr_type;
    int dar_release_slot;
    int pos;

    D.27734 = mono_defaults.int_class;
    intptr_type = &D.27734->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    sh_dangerous_add_ref.216 = sh_dangerous_add_ref;
    if (sh_dangerous_add_ref.216 == 0B) goto <D.27736>; else goto <D.27737>;
    <D.27736>:
    init_safe_handle ();
    <D.27737>:
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    D.27739 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.27739;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.218 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.218);
    D.27741 = BIT_FIELD_REF <*t, 8, 56>;
    D.27742 = D.27741 & 64;
    if (D.27742 != 0) goto <D.27743>; else goto <D.27744>;
    <D.27743>:
    mono_mb_emit_icon (mb, 0);
    conv_arg.219 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.219);
    goto <D.22611>;
    <D.27744>:
    D.27746 = mono_defaults.boolean_class;
    D.27747 = &D.27746->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.27747);
    mono_mb_emit_icon (mb, 0);
    dar_release_slot.220 = (unsigned int) dar_release_slot;
    mono_mb_emit_stloc (mb, dar_release_slot.220);
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    dar_release_slot.220 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc_addr (mb, dar_release_slot.220);
    sh_dangerous_add_ref.216 = sh_dangerous_add_ref;
    mono_mb_emit_managed_call (mb, sh_dangerous_add_ref.216, 0B);
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    mono_mb_emit_ldflda (mb, 8);
    mono_mb_emit_byte (mb, 77);
    conv_arg.219 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.219);
    goto <D.22611>;
  }
  <D.22612>:
  D.27741 = BIT_FIELD_REF <*t, 8, 56>;
  D.27742 = D.27741 & 64;
  if (D.27742 != 0) goto <D.27749>; else goto <D.27750>;
  <D.27749>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.219);
  goto <D.27751>;
  <D.27750>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.219);
  <D.27751>:
  goto <D.22611>;
  <D.22613>:
  {
    int dar_release_slot;
    int label_next;

    dar_release_slot = conv_arg + 1;
    sh_dangerous_release.221 = sh_dangerous_release;
    if (sh_dangerous_release.221 == 0B) goto <D.27753>; else goto <D.27754>;
    <D.27753>:
    init_safe_handle ();
    <D.27754>:
    D.27741 = BIT_FIELD_REF <*t, 8, 56>;
    D.27742 = D.27741 & 64;
    if (D.27742 != 0) goto <D.27755>; else goto <D.27756>;
    <D.27755>:
    {
      struct MonoMethod * ctor;

      D.27757 = t->data.klass;
      ctor = mono_class_get_method_from_name (D.27757, ".ctor", 0);
      if (ctor == 0B) goto <D.27758>; else goto <D.27759>;
      <D.27758>:
      mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
      goto <D.22611>;
      <D.27759>:
      argnum.217 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.217);
      mono_mb_emit_op (mb, 115, ctor);
      mono_mb_emit_byte (mb, 81);
      argnum.217 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.217);
      mono_mb_emit_byte (mb, 80);
      mono_mb_emit_ldflda (mb, 8);
      conv_arg.219 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.219);
      mono_mb_emit_byte (mb, 223);
    }
    goto <D.27760>;
    <D.27756>:
    dar_release_slot.222 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc (mb, dar_release_slot.222);
    D.27762 = mono_mb_emit_branch (mb, 57);
    label_next = (int) D.27762;
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    sh_dangerous_release.221 = sh_dangerous_release;
    mono_mb_emit_managed_call (mb, sh_dangerous_release.221, 0B);
    label_next.223 = (unsigned int) label_next;
    mono_mb_patch_branch (mb, label_next.223);
    <D.27760>:
    goto <D.22611>;
  }
  <D.22617>:
  {
    struct MonoMethod * ctor;
    int intptr_handle_slot;

    ctor = 0B;
    D.27757 = t->data.klass;
    D.27764 = D.27757->flags;
    D.27765 = D.27764 & 128;
    if (D.27765 != 0) goto <D.27766>; else goto <D.27767>;
    <D.27766>:
    mono_mb_emit_byte (mb, 38);
    D.27768 = monoeg_strdup ("Returned SafeHandles should not be abstract");
    mono_mb_emit_exception_marshal_directive (mb, D.27768);
    goto <D.22611>;
    <D.27767>:
    D.27757 = t->data.klass;
    ctor = mono_class_get_method_from_name (D.27757, ".ctor", 0);
    if (ctor == 0B) goto <D.27769>; else goto <D.27770>;
    <D.27769>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
    goto <D.22611>;
    <D.27770>:
    D.27734 = mono_defaults.int_class;
    D.27771 = &D.27734->byval_arg;
    intptr_handle_slot = mono_mb_add_local (mb, D.27771);
    intptr_handle_slot.224 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_stloc (mb, intptr_handle_slot.224);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_stloc (mb, 3);
    mono_mb_emit_ldloc (mb, 3);
    mono_mb_emit_ldflda (mb, 8);
    intptr_handle_slot.224 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_ldloc (mb, intptr_handle_slot.224);
    mono_mb_emit_byte (mb, 223);
    goto <D.22611>;
  }
  <D.22620>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.22611>;
  <D.22621>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.22611>;
  <D.22622>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.22611>;
  <D.22623>:
  printf ("Unhandled case for MarshalAction: %d\n", action);
  <D.22611>:
  D.27774 = conv_arg;
  return D.27774;
}


init_safe_handle ()
{
  struct MonoClass * D.27776;
  struct MonoMethod * sh_dangerous_add_ref.226;
  struct MonoMethod * sh_dangerous_release.227;

  D.27776 = mono_defaults.safehandle_class;
  sh_dangerous_add_ref.226 = mono_class_get_method_from_name (D.27776, "DangerousAddRef", 1);
  sh_dangerous_add_ref = sh_dangerous_add_ref.226;
  D.27776 = mono_defaults.safehandle_class;
  sh_dangerous_release.227 = mono_class_get_method_from_name (D.27776, "DangerousRelease", 0);
  sh_dangerous_release = sh_dangerous_release.227;
}


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

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


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.27781;
  struct MonoClass * D.27782;
  struct MonoType * D.27783;
  struct MonoClass * D.27784;
  unsigned char D.27785;
  unsigned char D.27786;
  unsigned int argnum.228;
  unsigned char D.27790;
  unsigned char D.27791;
  void * D.27794;
  unsigned int conv_arg.229;
  struct MonoClass * D.27797;
  struct MonoType * D.27798;
  struct MonoClass * D.27799;
  struct MonoClass * D.27803;
  _Bool D.27807;
  _Bool D.27808;
  _Bool D.27809;
  unsigned int src_var.230;
  struct MonoClass * D.27818;
  int iftmp.231;
  int D.27822;
  unsigned int dest_ptr.232;
  unsigned int index_var.233;
  int D.27831;
  void * D.27834;
  MonoMarshalNative iftmp.234;
  short unsigned int D.27840;
  short unsigned int D.27841;
  int iftmp.235;
  short unsigned int D.27851;
  int D.27852;
  int D.27853;
  struct MonoType * D.27854;
  int need_free.236;
  int need_free.237;
  int D.27857;
  int iftmp.238;
  int D.27867;
  unsigned int src_ptr.239;
  unsigned int index_var.240;
  int D.27876;
  _Bool D.27881;
  long int D.27882;
  long int D.27883;
  void * D.27888;
  MonoMarshalNative iftmp.241;
  unsigned int loc.242;
  short unsigned int D.27908;
  short unsigned int D.27909;
  void * D.27912;
  int D.27918;
  <unnamed type> D.27921;
  short int D.27924;
  short int D.27925;
  struct MonoMethodSignature * D.27943;
  short unsigned int D.27944;
  int D.27945;
  struct MonoType * D.27948;
  unsigned char D.27949;
  int D.27950;
  unsigned int src_ptr.243;
  unsigned int param_num.244;
  unsigned char D.27958;
  unsigned char D.27959;
  unsigned int index_var.245;
  int D.27963;
  _Bool D.27966;
  long int D.27967;
  long int D.27968;
  void * D.27971;
  short unsigned int D.27973;
  short unsigned int D.27974;
  _Bool D.27976;
  long int D.27977;
  long int D.27978;
  _Bool D.27981;
  long int D.27982;
  long int D.27983;
  _Bool D.27986;
  long int D.27987;
  long int D.27988;
  unsigned int dest_ptr.246;
  unsigned char D.28007;
  unsigned char D.28008;
  unsigned int index_var.247;
  int D.28012;
  _Bool D.28015;
  long int D.28016;
  long int D.28017;
  void * D.28020;
  short unsigned int D.28022;
  short unsigned int D.28023;
  int iftmp.248;
  int D.28035;
  unsigned int src.249;
  unsigned int dest.250;
  unsigned int index_var.251;
  int D.28045;
  _Bool D.28048;
  long int D.28049;
  long int D.28050;
  void * D.28053;
  short unsigned int D.28055;
  short unsigned int D.28056;
  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.27781 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.27781, spec);
      switch (action) <default: <D.22812>, case 0: <D.22728>, case 1: <D.22752>, case 2: <D.22741>, case 3: <D.22753>, case 4: <D.22754>, case 5: <D.22786>, case 6: <D.22800>>
      <D.22728>:
      D.27782 = mono_defaults.object_class;
      D.27783 = &D.27782->byval_arg;
      *conv_arg_type = D.27783;
      D.27782 = mono_defaults.object_class;
      D.27783 = &D.27782->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.27783);
      D.27784 = klass->element_class;
      D.27785 = BIT_FIELD_REF <*D.27784, 8, 160>;
      D.27786 = D.27785 & 32;
      if (D.27786 != 0) goto <D.27787>; else goto <D.27788>;
      <D.27787>:
      argnum.228 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.228);
      D.27790 = BIT_FIELD_REF <*t, 8, 56>;
      D.27791 = D.27790 & 64;
      if (D.27791 != 0) goto <D.27792>; else goto <D.27793>;
      <D.27792>:
      mono_mb_emit_byte (mb, 77);
      <D.27793>:
      D.27794 = conv_to_icall (23);
      mono_mb_emit_icall (mb, D.27794);
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.229);
      goto <D.27796>;
      <D.27788>:
      {
        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.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.27798);
        eklass = klass->element_class;
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27800>; else goto <D.27801>;
        <D.27800>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.27781, spec);
        goto <D.27802>;
        <D.27801>:
        D.27803 = mono_defaults.stringbuilder_class;
        if (D.27803 == eklass) goto <D.27804>; else goto <D.27805>;
        <D.27804>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.27781, spec);
        goto <D.27806>;
        <D.27805>:
        conv = 4294967295;
        <D.27806>:
        <D.27802>:
        D.27807 = is_string != 0;
        D.27808 = conv == 4294967295;
        D.27809 = D.27807 & D.27808;
        if (D.27809 != 0) goto <D.27810>; else goto <D.27811>;
        <D.27810>:
        {
          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.22740>;
        }
        <D.27811>:
        D.27782 = mono_defaults.object_class;
        D.27783 = &D.27782->byval_arg;
        src_var = mono_mb_add_local (mb, D.27783);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        if (D.27791 != 0) goto <D.27812>; else goto <D.27813>;
        <D.27812>:
        mono_mb_emit_byte (mb, 77);
        <D.27813>:
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_stloc (mb, src_var.230);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        label1 = mono_mb_emit_branch (mb, 57);
        if (is_string != 0) goto <D.27815>; else goto <D.27816>;
        <D.27815>:
        esize = 4;
        goto <D.27817>;
        <D.27816>:
        D.27818 = mono_defaults.char_class;
        if (D.27818 == eklass) goto <D.27819>; else goto <D.27820>;
        <D.27819>:
        D.27781 = m->piinfo;
        D.27822 = mono_pinvoke_is_unicode (D.27781);
        if (D.27822 != 0) goto <D.27823>; else goto <D.27824>;
        <D.27823>:
        iftmp.231 = 2;
        goto <D.27825>;
        <D.27824>:
        iftmp.231 = 1;
        <D.27825>:
        esize = iftmp.231;
        goto <D.27826>;
        <D.27820>:
        esize = mono_class_native_size (eklass, 0B);
        <D.27826>:
        <D.27817>:
        mono_mb_emit_icon (mb, esize);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        mono_mb_emit_byte (mb, 142);
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27827>; else goto <D.27828>;
        <D.27827>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.27828>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 15);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.232);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        index_var = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 22);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.233);
        D.27831 = mono_mb_get_label (mb);
        label2 = (guint32) D.27831;
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.27832>; else goto <D.27833>;
        <D.27832>:
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        mono_mb_emit_byte (mb, 154);
        D.27834 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.27834);
        mono_mb_emit_byte (mb, 223);
        goto <D.27835>;
        <D.27833>:
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 0);
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        mono_mb_emit_stloc (mb, 1);
        D.27818 = mono_defaults.char_class;
        if (D.27818 == eklass) goto <D.27837>; else goto <D.27838>;
        <D.27837>:
        iftmp.234 = encoding;
        goto <D.27839>;
        <D.27838>:
        iftmp.234 = 4294967295;
        <D.27839>:
        emit_struct_conv_full (mb, eklass, 0, iftmp.234);
        <D.27835>:
        D.27840 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.27840, 1);
        D.27841 = (short unsigned int) dest_ptr;
        mono_mb_emit_add_to_local (mb, D.27841, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27842>; else goto <D.27843>;
        <D.27842>:
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        mono_mb_emit_byte (mb, 22);
        mono_mb_emit_byte (mb, 81);
        <D.27843>:
        mono_mb_patch_branch (mb, label1);
      }
      <D.27796>:
      goto <D.22740>;
      <D.22741>:
      D.27784 = klass->element_class;
      D.27818 = mono_defaults.char_class;
      if (D.27784 == D.27818) goto <D.27849>; else goto <D.27845>;
      <D.27849>:
      if (encoding == 21) goto <D.27846>; else goto <D.27845>;
      <D.27845>:
      D.27784 = klass->element_class;
      D.27803 = mono_defaults.stringbuilder_class;
      if (D.27784 == D.27803) goto <D.27846>; else goto <D.27850>;
      <D.27850>:
      D.27851 = t->attrs;
      D.27852 = (int) D.27851;
      D.27853 = D.27852 & 2;
      if (D.27853 != 0) goto <D.27846>; else goto <D.27847>;
      <D.27846>:
      iftmp.235 = 1;
      goto <D.27848>;
      <D.27847>:
      iftmp.235 = 0;
      <D.27848>:
      need_convert = iftmp.235;
      D.27784 = klass->element_class;
      D.27854 = &D.27784->byval_arg;
      D.27781 = m->piinfo;
      need_free.236 = mono_marshal_need_free (D.27854, D.27781, spec);
      need_free = need_free.236;
      need_free.237 = need_free;
      D.27857 = need_convert | need_free.237;
      if (D.27857 != 0) goto <D.27858>; else goto <D.27859>;
      <D.27858>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;

        eklass = klass->element_class;
        D.27803 = mono_defaults.stringbuilder_class;
        if (D.27803 == eklass) goto <D.27860>; else goto <D.27863>;
        <D.27863>:
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27860>; else goto <D.27861>;
        <D.27860>:
        esize = 4;
        goto <D.27862>;
        <D.27861>:
        D.27818 = mono_defaults.char_class;
        if (D.27818 == eklass) goto <D.27864>; else goto <D.27865>;
        <D.27864>:
        D.27781 = m->piinfo;
        D.27867 = mono_pinvoke_is_unicode (D.27781);
        if (D.27867 != 0) goto <D.27868>; else goto <D.27869>;
        <D.27868>:
        iftmp.238 = 2;
        goto <D.27870>;
        <D.27869>:
        iftmp.238 = 1;
        <D.27870>:
        esize = iftmp.238;
        goto <D.27871>;
        <D.27865>:
        esize = mono_class_native_size (eklass, 0B);
        <D.27871>:
        <D.27862>:
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.27798);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        loc = mono_mb_add_local (mb, D.27798);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        if (D.27791 != 0) goto <D.27872>; else goto <D.27873>;
        <D.27872>:
        mono_mb_emit_byte (mb, 77);
        <D.27873>:
        label1 = mono_mb_emit_branch (mb, 57);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.239);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        index_var = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 22);
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.240);
        D.27876 = mono_mb_get_label (mb);
        label2 = (guint32) D.27876;
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.240);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        if (D.27791 != 0) goto <D.27877>; else goto <D.27878>;
        <D.27877>:
        mono_mb_emit_byte (mb, 80);
        <D.27878>:
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        D.27803 = mono_defaults.stringbuilder_class;
        if (D.27803 == eklass) goto <D.27879>; else goto <D.27880>;
        <D.27879>:
        {
          gboolean need_free2;
          MonoMarshalConv conv;

          try
            {
              D.27781 = m->piinfo;
              conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.27781, spec, &need_free2);
              D.27881 = conv == 4294967295;
              D.27882 = (long int) D.27881;
              D.27883 = __builtin_expect (D.27882, 0);
              if (D.27883 != 0) goto <D.27884>; else goto <D.27885>;
              <D.27884>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7735, "conv != -1");
              <D.27885>:
              argnum.228 = (unsigned int) argnum;
              mono_mb_emit_ldarg (mb, argnum.228);
              D.27790 = BIT_FIELD_REF <*t, 8, 56>;
              D.27791 = D.27790 & 64;
              if (D.27791 != 0) goto <D.27886>; else goto <D.27887>;
              <D.27886>:
              mono_mb_emit_byte (mb, 77);
              <D.27887>:
              index_var.240 = (unsigned int) index_var;
              mono_mb_emit_ldloc (mb, index_var.240);
              mono_mb_emit_byte (mb, 154);
              src_ptr.239 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.239);
              mono_mb_emit_byte (mb, 77);
              D.27888 = conv_to_icall (conv);
              mono_mb_emit_icall (mb, D.27888);
              need_free.237 = need_free;
              if (need_free.237 != 0) goto <D.27889>; else goto <D.27890>;
              <D.27889>:
              src_ptr.239 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.239);
              mono_mb_emit_byte (mb, 77);
              mono_mb_emit_icall (mb, mono_marshal_free);
              <D.27890>:
            }
          finally
            {
              need_free2 = {CLOBBER};
            }
        }
        goto <D.27891>;
        <D.27880>:
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27892>; else goto <D.27893>;
        <D.27892>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.27894>; else goto <D.27895>;
        <D.27894>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        mono_mb_emit_byte (mb, 77);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.27895>:
        goto <D.27896>;
        <D.27893>:
        if (need_convert != 0) goto <D.27897>; else goto <D.27898>;
        <D.27897>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        mono_mb_emit_stloc (mb, 0);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        if (D.27791 != 0) goto <D.27899>; else goto <D.27900>;
        <D.27899>:
        mono_mb_emit_byte (mb, 80);
        <D.27900>:
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.240);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 1);
        D.27818 = mono_defaults.char_class;
        if (D.27818 == eklass) goto <D.27902>; else goto <D.27903>;
        <D.27902>:
        iftmp.241 = encoding;
        goto <D.27904>;
        <D.27903>:
        iftmp.241 = 4294967295;
        <D.27904>:
        emit_struct_conv_full (mb, eklass, 1, iftmp.241);
        <D.27898>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.27905>; else goto <D.27906>;
        <D.27905>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        loc.242 = (unsigned int) loc;
        mono_mb_emit_stloc (mb, loc.242);
        loc.242 = (unsigned int) loc;
        mono_mb_emit_ldloc (mb, loc.242);
        emit_struct_free (mb, eklass, loc);
        <D.27906>:
        <D.27896>:
        <D.27891>:
        D.27908 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.27908, 1);
        D.27909 = (short unsigned int) src_ptr;
        mono_mb_emit_add_to_local (mb, D.27909, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
      }
      <D.27859>:
      D.27784 = klass->element_class;
      D.27785 = BIT_FIELD_REF <*D.27784, 8, 160>;
      D.27786 = D.27785 & 32;
      if (D.27786 != 0) goto <D.27910>; else goto <D.27911>;
      <D.27910>:
      argnum.228 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.228);
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.229);
      D.27912 = conv_to_icall (24);
      mono_mb_emit_icall (mb, D.27912);
      <D.27911>:
      goto <D.22740>;
      <D.22752>:
      D.27790 = BIT_FIELD_REF <*t, 8, 56>;
      D.27791 = D.27790 & 64;
      if (D.27791 != 0) goto <D.27913>; else goto <D.27914>;
      <D.27913>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.229);
      goto <D.27915>;
      <D.27914>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.229);
      <D.27915>:
      goto <D.22740>;
      <D.22753>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.22740>;
      <D.22754>:
      {
        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.27782 = mono_defaults.object_class;
        D.27783 = &D.27782->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.27783);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        *conv_arg_type = D.27798;
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        if (D.27791 != 0) goto <D.27916>; else goto <D.27917>;
        <D.27916>:
        {
          char * msg;

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

          msg = monoeg_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.27918 = conv_arg;
          return D.27918;
        }
        <D.27920>:
        D.27921 = spec->native;
        if (D.27921 != 42) goto <D.27922>; else goto <D.27923>;
        <D.27922>:
        {
          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.27918 = conv_arg;
          return D.27918;
        }
        <D.27923>:
        D.27924 = spec->data.array_data.param_num;
        param_num = (int) D.27924;
        num_elem = spec->data.array_data.num_elem;
        D.27925 = spec->data.array_data.elem_mult;
        if (D.27925 == 0) goto <D.27926>; else goto <D.27927>;
        <D.27926>:
        param_num = -1;
        <D.27927>:
        if (param_num == -1) goto <D.27928>; else goto <D.27929>;
        <D.27928>:
        if (num_elem <= 0) goto <D.27930>; else goto <D.27931>;
        <D.27930>:
        {
          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.27918 = conv_arg;
          return D.27918;
        }
        <D.27931>:
        <D.27929>:
        eklass = klass->element_class;
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27932>; else goto <D.27933>;
        <D.27932>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_ptr_to_string_conv (D.27781, spec, &need_free);
        goto <D.27934>;
        <D.27933>:
        D.27803 = mono_defaults.stringbuilder_class;
        if (D.27803 == eklass) goto <D.27935>; else goto <D.27936>;
        <D.27935>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.27781, spec, &need_free);
        goto <D.27937>;
        <D.27936>:
        conv = 4294967295;
        <D.27937>:
        <D.27934>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.27938>; else goto <D.27939>;
        <D.27938>:
        esize = 4;
        goto <D.27940>;
        <D.27939>:
        esize = mono_class_native_size (eklass, 0B);
        <D.27940>:
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.27798);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        loc = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 20);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        if (param_num != -1) goto <D.27941>; else goto <D.27942>;
        <D.27941>:
        D.27943 = m->sig;
        D.27944 = D.27943->param_count;
        D.27945 = (int) D.27944;
        if (D.27945 <= param_num) goto <D.27946>; else goto <D.27947>;
        <D.27946>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter index is out of range.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.27918 = conv_arg;
          return D.27918;
        }
        <D.27947>:
        D.27943 = m->sig;
        D.27948 = D.27943->params[param_num];
        D.27949 = D.27948->type;
        D.27950 = (int) D.27949;
        switch (D.27950) <default: <D.22783>, case 4: <D.22772>, case 5: <D.22773>, case 6: <D.22774>, case 7: <D.22775>, case 8: <D.22776>, case 9: <D.22777>, case 10: <D.22780>, case 11: <D.22781>, case 24: <D.22778>, case 25: <D.22779>>
        <D.22772>:
        <D.22773>:
        <D.22774>:
        <D.22775>:
        <D.22776>:
        <D.22777>:
        <D.22778>:
        <D.22779>:
        <D.22780>:
        <D.22781>:
        goto <D.22782>;
        <D.22783>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter must be an integral type.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.27918 = conv_arg;
          return D.27918;
        }
        <D.22782>:
        <D.27942>:
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        src_ptr.243 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.243);
        if (param_num == -1) goto <D.27952>; else goto <D.27953>;
        <D.27952>:
        mono_mb_emit_icon (mb, num_elem);
        goto <D.27954>;
        <D.27953>:
        param_num.244 = (unsigned int) param_num;
        mono_mb_emit_ldarg (mb, param_num.244);
        if (num_elem > 0) goto <D.27956>; else goto <D.27957>;
        <D.27956>:
        mono_mb_emit_icon (mb, num_elem);
        mono_mb_emit_byte (mb, 88);
        <D.27957>:
        mono_mb_emit_byte (mb, 212);
        <D.27954>:
        mono_mb_emit_op (mb, 141, eklass);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        D.27958 = BIT_FIELD_REF <*eklass, 8, 160>;
        D.27959 = D.27958 & 32;
        if (D.27959 != 0) goto <D.27960>; else goto <D.27961>;
        <D.27960>:
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 16);
        mono_mb_emit_byte (mb, 88);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        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.22740>;
        <D.27961>:
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        index_var = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 22);
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.245);
        D.27963 = mono_mb_get_label (mb);
        label2 = (guint32) D.27963;
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.245);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.27964>; else goto <D.27965>;
        <D.27964>:
        D.27966 = conv == 4294967295;
        D.27967 = (long int) D.27966;
        D.27968 = __builtin_expect (D.27967, 0);
        if (D.27968 != 0) goto <D.27969>; else goto <D.27970>;
        <D.27969>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7976, "conv != -1");
        <D.27970>:
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.245);
        src_ptr.243 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.243);
        mono_mb_emit_byte (mb, 77);
        D.27971 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.27971);
        mono_mb_emit_byte (mb, 162);
        goto <D.27972>;
        <D.27965>:
        {
          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.27918 = conv_arg;
          return D.27918;
        }
        <D.27972>:
        D.27973 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.27973, 1);
        D.27974 = (short unsigned int) src_ptr;
        mono_mb_emit_add_to_local (mb, D.27974, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.22740>;
      }
      <D.22786>:
      {
        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.22740>; else goto <D.27975>;
        <D.27975>:
        D.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        D.27976 = D.27791 != 0;
        D.27977 = (long int) D.27976;
        D.27978 = __builtin_expect (D.27977, 0);
        if (D.27978 != 0) goto <D.27979>; else goto <D.27980>;
        <D.27979>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8015, "!t->byref");
        <D.27980>:
        D.27921 = spec->native;
        D.27981 = D.27921 != 42;
        D.27982 = (long int) D.27981;
        D.27983 = __builtin_expect (D.27982, 0);
        if (D.27983 != 0) goto <D.27984>; else goto <D.27985>;
        <D.27984>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8016, "spec->native == MONO_NATIVE_LPARRAY");
        <D.27985>:
        D.27851 = t->attrs;
        D.27852 = (int) D.27851;
        D.27853 = D.27852 & 2;
        D.27986 = D.27853 == 0;
        D.27987 = (long int) D.27986;
        D.27988 = __builtin_expect (D.27987, 0);
        if (D.27988 != 0) goto <D.27989>; else goto <D.27990>;
        <D.27989>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8017, "t->attrs & PARAM_ATTRIBUTE_OUT");
        <D.27990>:
        D.27924 = spec->data.array_data.param_num;
        param_num = (int) D.27924;
        num_elem = spec->data.array_data.num_elem;
        D.27925 = spec->data.array_data.elem_mult;
        if (D.27925 == 0) goto <D.27991>; else goto <D.27992>;
        <D.27991>:
        param_num = -1;
        <D.27992>:
        if (param_num == -1) goto <D.27993>; else goto <D.27994>;
        <D.27993>:
        if (num_elem <= 0) goto <D.27995>; else goto <D.27996>;
        <D.27995>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8028);
        <D.27996>:
        <D.27994>:
        eklass = klass->element_class;
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.27997>; else goto <D.27998>;
        <D.27997>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.27781, spec);
        goto <D.27999>;
        <D.27998>:
        D.27803 = mono_defaults.stringbuilder_class;
        if (D.27803 == eklass) goto <D.28000>; else goto <D.28001>;
        <D.28000>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.27781, spec);
        goto <D.28002>;
        <D.28001>:
        conv = 4294967295;
        <D.28002>:
        <D.27999>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.28003>; else goto <D.28004>;
        <D.28003>:
        esize = 4;
        goto <D.28005>;
        <D.28004>:
        esize = mono_class_native_size (eklass, 0B);
        <D.28005>:
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.27798);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        loc = mono_mb_add_local (mb, D.27798);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        dest_ptr.246 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.246);
        D.28007 = BIT_FIELD_REF <*eklass, 8, 160>;
        D.28008 = D.28007 & 32;
        if (D.28008 != 0) goto <D.28009>; else goto <D.28010>;
        <D.28009>:
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 16);
        mono_mb_emit_byte (mb, 88);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        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.22740>;
        <D.28010>:
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        index_var = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 22);
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.247);
        D.28012 = mono_mb_get_label (mb);
        label2 = (guint32) D.28012;
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.247);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.28013>; else goto <D.28014>;
        <D.28013>:
        D.28015 = conv == 4294967295;
        D.28016 = (long int) D.28015;
        D.28017 = __builtin_expect (D.28016, 0);
        if (D.28017 != 0) goto <D.28018>; else goto <D.28019>;
        <D.28018>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8093, "conv != -1");
        <D.28019>:
        dest_ptr.246 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.246);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.247);
        mono_mb_emit_byte (mb, 154);
        D.28020 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.28020);
        mono_mb_emit_byte (mb, 223);
        goto <D.28021>;
        <D.28014>:
        {
          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.27918 = conv_arg;
          return D.27918;
        }
        <D.28021>:
        D.28022 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.28022, 1);
        D.28023 = (short unsigned int) dest_ptr;
        mono_mb_emit_add_to_local (mb, D.28023, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.22740>;
      }
      <D.22800>:
      {
        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.27790 = BIT_FIELD_REF <*t, 8, 56>;
        D.27791 = D.27790 & 64;
        D.27976 = D.27791 != 0;
        D.27977 = (long int) D.27976;
        D.27978 = __builtin_expect (D.27977, 0);
        if (D.27978 != 0) goto <D.28024>; else goto <D.28025>;
        <D.28024>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8130, "!t->byref");
        <D.28025>:
        eklass = klass->element_class;
        mono_marshal_load_type_info (eklass);
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.28026>; else goto <D.28027>;
        <D.28026>:
        is_string = 1;
        D.27781 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.27781, spec);
        goto <D.28028>;
        <D.28027>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8141);
        <D.28028>:
        if (is_string != 0) goto <D.28029>; else goto <D.28030>;
        <D.28029>:
        esize = 4;
        goto <D.28031>;
        <D.28030>:
        D.27818 = mono_defaults.char_class;
        if (D.27818 == eklass) goto <D.28032>; else goto <D.28033>;
        <D.28032>:
        D.27781 = m->piinfo;
        D.28035 = mono_pinvoke_is_unicode (D.27781);
        if (D.28035 != 0) goto <D.28036>; else goto <D.28037>;
        <D.28036>:
        iftmp.248 = 2;
        goto <D.28038>;
        <D.28037>:
        iftmp.248 = 1;
        <D.28038>:
        esize = iftmp.248;
        goto <D.28039>;
        <D.28033>:
        esize = mono_class_native_size (eklass, 0B);
        <D.28039>:
        <D.28031>:
        D.27782 = mono_defaults.object_class;
        D.27783 = &D.27782->byval_arg;
        src = mono_mb_add_local (mb, D.27783);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        dest = mono_mb_add_local (mb, D.27798);
        src.249 = (unsigned int) src;
        mono_mb_emit_stloc (mb, src.249);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_stloc (mb, 3);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        label1 = mono_mb_emit_branch (mb, 57);
        mono_mb_emit_icon (mb, esize);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_byte (mb, 142);
        D.27799 = mono_defaults.string_class;
        if (D.27799 == eklass) goto <D.28041>; else goto <D.28042>;
        <D.28041>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.28042>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_icall (mb, mono_marshal_alloc);
        dest.250 = (unsigned int) dest;
        mono_mb_emit_stloc (mb, dest.250);
        dest.250 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.250);
        mono_mb_emit_stloc (mb, 3);
        D.27797 = mono_defaults.int_class;
        D.27798 = &D.27797->byval_arg;
        index_var = mono_mb_add_local (mb, D.27798);
        mono_mb_emit_byte (mb, 22);
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.251);
        D.28045 = mono_mb_get_label (mb);
        label2 = (guint32) D.28045;
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.251);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.28046>; else goto <D.28047>;
        <D.28046>:
        D.28048 = conv == 4294967295;
        D.28049 = (long int) D.28048;
        D.28050 = __builtin_expect (D.28049, 0);
        if (D.28050 != 0) goto <D.28051>; else goto <D.28052>;
        <D.28051>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8190, "conv != -1");
        <D.28052>:
        dest.250 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.250);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.251);
        mono_mb_emit_byte (mb, 154);
        D.28053 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.28053);
        mono_mb_emit_byte (mb, 223);
        goto <D.28054>;
        <D.28047>:
        {
          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.27918 = conv_arg;
          return D.27918;
        }
        <D.28054>:
        D.28055 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.28055, 1);
        D.28056 = (short unsigned int) dest;
        mono_mb_emit_add_to_local (mb, D.28056, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        mono_mb_patch_branch (mb, label1);
        goto <D.22740>;
      }
      <D.22812>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8220);
      <D.22740>:
      D.27918 = conv_arg;
      return D.27918;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_need_free (struct MonoType * t, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  unsigned char D.28060;
  int D.28061;
  gboolean D.28062;
  struct MonoClass * D.28063;
  struct MonoClass * D.28064;
  _Bool D.28067;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;

  D.28060 = t->type;
  D.28061 = (int) D.28060;
  switch (D.28061) <default: <D.21555>, case 14: <D.21554>, case 17: <D.21550>, case 18: <D.21552>, case 28: <D.21551>>
  <D.21550>:
  D.28062 = 1;
  return D.28062;
  <D.21551>:
  <D.21552>:
  D.28063 = t->data.klass;
  D.28064 = mono_defaults.stringbuilder_class;
  if (D.28063 == D.28064) goto <D.28065>; else goto <D.28066>;
  <D.28065>:
  {
    gboolean need_free;

    try
      {
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
        D.28062 = need_free;
        return D.28062;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.28066>:
  D.28062 = 0;
  return D.28062;
  <D.21554>:
  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  D.28067 = encoding != 21;
  D.28062 = (gboolean) D.28067;
  return D.28062;
  <D.21555>:
  D.28062 = 0;
  return D.28062;
}


emit_struct_conv_full (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object, MonoMarshalNative string_encoding)
{
  struct MonoClass * D.28070;
  unsigned int D.28073;
  unsigned char D.28076;
  unsigned char D.28077;
  unsigned int msize.252;
  _Bool D.28081;
  long int D.28082;
  long int D.28083;
  struct MonoClass * D.28086;
  unsigned int D.28089;
  unsigned int D.28090;
  struct MonoType * D.28093;
  char * D.28094;
  struct MonoClassField * D.28095;
  unsigned int i.253;
  unsigned int D.28097;
  unsigned int D.28098;
  _Bool D.28099;
  short unsigned int D.28100;
  int D.28101;
  int D.28102;
  struct MonoMarshalSpec * D.28105;
  <unnamed-unsigned:1> D.28106;
  int D.28107;
  int D.28110;
  int D.28111;
  unsigned int D.28112;
  unsigned int D.28113;
  int D.28115;
  struct MonoClassField * D.28116;
  int D.28117;
  unsigned int D.28118;
  unsigned int D.28119;
  struct MonoType * D.28128;
  int D.28129;
  struct MonoType * D.28132;
  int D.28133;
  char * D.28134;
  <unnamed type> conv.254;
  unsigned char D.28138;
  unsigned char D.28139;
  unsigned char D.28141;
  _Bool D.28145;
  _Bool D.28146;
  _Bool D.28147;
  unsigned int D.28153;
  unsigned char D.28154;
  unsigned int D.28155;
  unsigned char D.28156;
  struct MonoClass * D.28157;
  unsigned char D.28158;
  unsigned char D.28159;
  struct MonoClass * D.28162;
  struct MonoType * D.28163;
  unsigned int src_var.255;
  unsigned int dst_var.256;
  struct MonoMethod * variant_clear.257;
  struct MonoClass * D.28171;
  struct MonoMethod * variant_clear.258;
  struct MonoMethod * get_object_for_native_variant.259;
  struct MonoClass * D.28176;
  struct MonoMethod * get_object_for_native_variant.260;
  struct MonoMethod * get_native_variant_for_object.261;
  struct MonoMethod * get_native_variant_for_object.262;
  int D.28183;
  unsigned int src_var.263;
  unsigned int dst_var.264;
  struct MonoMarshalType * info;
  int i;
  void handle_enum = <<< error >>>;

  D.28070 = klass->parent;
  if (D.28070 != 0B) goto <D.28071>; else goto <D.28072>;
  <D.28071>:
  D.28070 = klass->parent;
  emit_struct_conv (mb, D.28070, to_object);
  <D.28072>:
  info = mono_marshal_load_type_info (klass);
  D.28073 = info->native_size;
  if (D.28073 == 0) goto <D.28074>; else goto <D.28075>;
  <D.28074>:
  return;
  <D.28075>:
  D.28076 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28077 = D.28076 & 32;
  if (D.28077 != 0) goto <D.28078>; else goto <D.28079>;
  <D.28078>:
  {
    int msize;

    msize = mono_class_value_size (klass, 0B);
    msize.252 = (unsigned int) msize;
    D.28073 = info->native_size;
    D.28081 = msize.252 != D.28073;
    D.28082 = (long int) D.28081;
    D.28083 = __builtin_expect (D.28082, 0);
    if (D.28083 != 0) goto <D.28084>; else goto <D.28085>;
    <D.28084>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1871, "msize == info->native_size");
    <D.28085>:
    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.28079>:
  D.28086 = mono_defaults.safehandle_class;
  if (D.28086 != klass) goto <D.28087>; else goto <D.28088>;
  <D.28087>:
  D.28089 = klass->flags;
  D.28090 = D.28089 & 24;
  if (D.28090 == 0) goto <D.28091>; else goto <D.28092>;
  <D.28091>:
  {
    char * msg;

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

    try
      {
        D.28095 = info->fields[i].field;
        ftype = D.28095->type;
        msize = 0;
        usize = 0;
        i.253 = (unsigned int) i;
        D.28097 = info->num_fields;
        D.28098 = D.28097 + 4294967295;
        D.28099 = i.253 >= D.28098;
        last_field = (gboolean) D.28099;
        D.28100 = ftype->attrs;
        D.28101 = (int) D.28100;
        D.28102 = D.28101 & 16;
        if (D.28102 != 0) goto <D.28103>; else goto <D.28104>;
        <D.28103>:
        // predicted unlikely by continue predictor.
        goto <D.21398>;
        <D.28104>:
        D.28105 = info->fields[i].mspec;
        D.28106 = klass->unicode;
        D.28107 = (int) D.28106;
        ntype = mono_type_to_unmanaged (ftype, D.28105, 1, D.28107, &conv);
        if (last_field != 0) goto <D.28108>; else goto <D.28109>;
        <D.28108>:
        D.28110 = klass->instance_size;
        D.28095 = info->fields[i].field;
        D.28111 = D.28095->offset;
        msize = D.28110 - D.28111;
        D.28073 = info->native_size;
        D.28112 = info->fields[i].offset;
        D.28113 = D.28073 - D.28112;
        usize = (int) D.28113;
        goto <D.28114>;
        <D.28109>:
        D.28115 = i + 1;
        D.28116 = info->fields[D.28115].field;
        D.28117 = D.28116->offset;
        D.28095 = info->fields[i].field;
        D.28111 = D.28095->offset;
        msize = D.28117 - D.28111;
        D.28115 = i + 1;
        D.28118 = info->fields[D.28115].offset;
        D.28112 = info->fields[i].offset;
        D.28119 = D.28118 - D.28112;
        usize = (int) D.28119;
        <D.28114>:
        D.28086 = mono_defaults.safehandle_class;
        if (D.28086 != klass) goto <D.28120>; else goto <D.28121>;
        <D.28120>:
        D.28089 = klass->flags;
        D.28090 = D.28089 & 24;
        if (D.28090 == 16) goto <D.28122>; else goto <D.28123>;
        <D.28122>:
        if (usize == 0) goto <D.28124>; else goto <D.28125>;
        <D.28124>:
        D.28095 = info->fields[i].field;
        D.28128 = D.28095->type;
        D.28129 = mono_type_is_reference (D.28128);
        if (D.28129 != 0) goto <D.28126>; else goto <D.28130>;
        <D.28130>:
        if (last_field == 0) goto <D.28131>; else goto <D.28127>;
        <D.28131>:
        D.28115 = i + 1;
        D.28116 = info->fields[D.28115].field;
        D.28132 = D.28116->type;
        D.28133 = mono_type_is_reference (D.28132);
        if (D.28133 != 0) goto <D.28126>; else goto <D.28127>;
        <D.28126>:
        D.28093 = &klass->byval_arg;
        D.28134 = mono_type_full_name (D.28093);
        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.28134);
        <D.21399>:
        goto <D.21399>;
        <D.28127>:
        <D.28125>:
        <D.28123>:
        <D.28121>:
        conv.254 = conv;
        switch (conv.254) <default: <D.21426>, case 0: <D.21400>>
        <D.21400>:
        {
          int t;

          D.28138 = BIT_FIELD_REF <*ftype, 8, 56>;
          D.28139 = D.28138 & 64;
          if (D.28139 != 0) goto <D.28136>; else goto <D.28140>;
          <D.28140>:
          D.28141 = ftype->type;
          if (D.28141 == 24) goto <D.28136>; else goto <D.28142>;
          <D.28142>:
          D.28141 = ftype->type;
          if (D.28141 == 25) goto <D.28136>; else goto <D.28137>;
          <D.28136>:
          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.21402>;
          <D.28137>:
          handle_enum:
          D.28141 = ftype->type;
          t = (int) D.28141;
          switch (t) <default: <D.21425>, case 2: <D.21408>, case 3: <D.21411>, case 4: <D.21406>, case 5: <D.21407>, case 6: <D.21409>, case 7: <D.21410>, case 8: <D.21404>, case 9: <D.21405>, case 10: <D.21412>, case 11: <D.21413>, case 12: <D.21415>, case 13: <D.21416>, case 15: <D.21414>, case 17: <D.21418>, case 28: <D.21421>>
          <D.21404>:
          <D.21405>:
          <D.21406>:
          <D.21407>:
          <D.21408>:
          <D.21409>:
          <D.21410>:
          <D.21411>:
          <D.21412>:
          <D.21413>:
          <D.21414>:
          <D.21415>:
          <D.21416>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          D.28145 = t == 3;
          D.28146 = ntype == 4;
          D.28147 = D.28145 & D.28146;
          if (D.28147 != 0) goto <D.28148>; else goto <D.28143>;
          <D.28148>:
          if (string_encoding != 21) goto <D.28149>; else goto <D.28143>;
          <D.28149>:
          if (to_object != 0) goto <D.28150>; else goto <D.28151>;
          <D.28150>:
          mono_mb_emit_byte (mb, 71);
          mono_mb_emit_byte (mb, 83);
          goto <D.28152>;
          <D.28151>:
          mono_mb_emit_byte (mb, 73);
          mono_mb_emit_byte (mb, 82);
          <D.28152>:
          goto <D.28144>;
          <D.28143>:
          D.28153 = mono_type_to_ldind (ftype);
          D.28154 = (unsigned char) D.28153;
          mono_mb_emit_byte (mb, D.28154);
          D.28155 = mono_type_to_stind (ftype);
          D.28156 = (unsigned char) D.28155;
          mono_mb_emit_byte (mb, D.28156);
          <D.28144>:
          goto <D.21417>;
          <D.21418>:
          {
            int src_var;
            int dst_var;

            D.28157 = ftype->data.klass;
            D.28158 = BIT_FIELD_REF <*D.28157, 8, 160>;
            D.28159 = D.28158 & 16;
            if (D.28159 != 0) goto <D.28160>; else goto <D.28161>;
            <D.28160>:
            D.28157 = ftype->data.klass;
            ftype = mono_class_enum_basetype (D.28157);
            goto handle_enum;
            <D.28161>:
            D.28162 = mono_defaults.int_class;
            D.28163 = &D.28162->byval_arg;
            src_var = mono_mb_add_local (mb, D.28163);
            D.28162 = mono_defaults.int_class;
            D.28163 = &D.28162->byval_arg;
            dst_var = mono_mb_add_local (mb, D.28163);
            mono_mb_emit_ldloc (mb, 0);
            src_var.255 = (unsigned int) src_var;
            mono_mb_emit_stloc (mb, src_var.255);
            mono_mb_emit_ldloc (mb, 1);
            dst_var.256 = (unsigned int) dst_var;
            mono_mb_emit_stloc (mb, dst_var.256);
            D.28157 = ftype->data.klass;
            emit_struct_conv (mb, D.28157, to_object);
            src_var.255 = (unsigned int) src_var;
            mono_mb_emit_ldloc (mb, src_var.255);
            mono_mb_emit_stloc (mb, 0);
            dst_var.256 = (unsigned int) dst_var;
            mono_mb_emit_ldloc (mb, dst_var.256);
            mono_mb_emit_stloc (mb, 1);
            goto <D.21417>;
          }
          <D.21421>:
          if (to_object != 0) goto <D.28166>; else goto <D.28167>;
          <D.28166>:
          {
            static struct MonoMethod * variant_clear = 0B;
            static struct MonoMethod * get_object_for_native_variant = 0B;

            variant_clear.257 = variant_clear;
            if (variant_clear.257 == 0B) goto <D.28169>; else goto <D.28170>;
            <D.28169>:
            D.28171 = mono_class_get_variant_class ();
            variant_clear.258 = mono_class_get_method_from_name (D.28171, "Clear", 0);
            variant_clear = variant_clear.258;
            <D.28170>:
            get_object_for_native_variant.259 = get_object_for_native_variant;
            if (get_object_for_native_variant.259 == 0B) goto <D.28174>; else goto <D.28175>;
            <D.28174>:
            D.28176 = mono_defaults.marshal_class;
            get_object_for_native_variant.260 = mono_class_get_method_from_name (D.28176, "GetObjectForNativeVariant", 1);
            get_object_for_native_variant = get_object_for_native_variant.260;
            <D.28175>:
            mono_mb_emit_ldloc (mb, 1);
            mono_mb_emit_ldloc (mb, 0);
            get_object_for_native_variant.259 = get_object_for_native_variant;
            mono_mb_emit_managed_call (mb, get_object_for_native_variant.259, 0B);
            mono_mb_emit_byte (mb, 81);
            mono_mb_emit_ldloc (mb, 0);
            variant_clear.257 = variant_clear;
            mono_mb_emit_managed_call (mb, variant_clear.257, 0B);
          }
          goto <D.28178>;
          <D.28167>:
          {
            static struct MonoMethod * get_native_variant_for_object = 0B;

            get_native_variant_for_object.261 = get_native_variant_for_object;
            if (get_native_variant_for_object.261 == 0B) goto <D.28180>; else goto <D.28181>;
            <D.28180>:
            D.28176 = mono_defaults.marshal_class;
            get_native_variant_for_object.262 = mono_class_get_method_from_name (D.28176, "GetNativeVariantForObject", 2);
            get_native_variant_for_object = get_native_variant_for_object.262;
            <D.28181>:
            mono_mb_emit_ldloc (mb, 0);
            mono_mb_emit_byte (mb, 80);
            mono_mb_emit_ldloc (mb, 1);
            get_native_variant_for_object.261 = get_native_variant_for_object;
            mono_mb_emit_managed_call (mb, get_native_variant_for_object.261, 0B);
          }
          <D.28178>:
          goto <D.21417>;
          <D.21425>:
          D.28141 = ftype->type;
          D.28183 = (int) D.28141;
          monoeg_g_log (0B, 16, "marshaling type %02x not implemented", D.28183);
          monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2038);
          <D.21417>:
          goto <D.21402>;
        }
        <D.21426>:
        {
          int src_var;
          int dst_var;

          D.28162 = mono_defaults.int_class;
          D.28163 = &D.28162->byval_arg;
          src_var = mono_mb_add_local (mb, D.28163);
          D.28162 = mono_defaults.int_class;
          D.28163 = &D.28162->byval_arg;
          dst_var = mono_mb_add_local (mb, D.28163);
          mono_mb_emit_ldloc (mb, 0);
          src_var.263 = (unsigned int) src_var;
          mono_mb_emit_stloc (mb, src_var.263);
          mono_mb_emit_ldloc (mb, 1);
          dst_var.264 = (unsigned int) dst_var;
          mono_mb_emit_stloc (mb, dst_var.264);
          if (to_object != 0) goto <D.28186>; else goto <D.28187>;
          <D.28186>:
          conv.254 = conv;
          D.28105 = info->fields[i].mspec;
          emit_ptr_to_object_conv (mb, ftype, conv.254, D.28105);
          goto <D.28188>;
          <D.28187>:
          conv.254 = conv;
          D.28105 = info->fields[i].mspec;
          emit_object_to_ptr_conv (mb, ftype, conv.254, D.28105);
          <D.28188>:
          src_var.263 = (unsigned int) src_var;
          mono_mb_emit_ldloc (mb, src_var.263);
          mono_mb_emit_stloc (mb, 0);
          dst_var.264 = (unsigned int) dst_var;
          mono_mb_emit_ldloc (mb, dst_var.264);
          mono_mb_emit_stloc (mb, 1);
        }
        <D.21402>:
        if (to_object != 0) goto <D.28189>; else goto <D.28190>;
        <D.28189>:
        mono_mb_emit_add_to_local (mb, 0, usize);
        mono_mb_emit_add_to_local (mb, 1, msize);
        goto <D.28191>;
        <D.28190>:
        mono_mb_emit_add_to_local (mb, 0, msize);
        mono_mb_emit_add_to_local (mb, 1, usize);
        <D.28191>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.21398>:
  i = i + 1;
  <D.21430>:
  i.253 = (unsigned int) i;
  D.28097 = info->num_fields;
  if (i.253 < D.28097) goto <D.21429>; else goto <D.21431>;
  <D.21431>:
}


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.28195;
  int D.28199;
  unsigned char D.28200;
  unsigned char D.28201;
  int D.28204;
  struct MonoClass * D.28206;
  struct MonoType * D.28207;
  struct MonoClass * D.28208;
  struct MonoType * D.28209;
  unsigned int array_var.265;
  unsigned int src_var.266;
  unsigned int dst_var.267;
  unsigned int index_var.268;
  int D.28214;
  short unsigned int D.28215;
  <unnamed type> D.28219;
  unsigned int src_var.269;
  unsigned int dst_var.270;
  struct MonoClass * D.28224;
  const char * D.28225;

  switch (conv) <default: <D.21307>, case 1: <D.21273>, case 2: <D.21271>, case 3: <D.21303>, case 4: <D.21288>, case 7: <D.21289>, case 9: <D.21287>, case 10: <D.21304>, case 11: <D.21305>, case 12: <D.21285>, case 13: <D.21286>, case 20: <D.21274>, case 21: <D.21283>, case 22: <D.21306>, case 23: <D.21296>, case 25: <D.21298>, case 26: <D.21300>, case 27: <D.21299>, case 28: <D.21290>, case 29: <D.21294>, case 33: <D.21301>, case 34: <D.21302>>
  <D.21271>:
  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.21272>;
  <D.21273>:
  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.21272>;
  <D.21274>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.28195 = type->type;
    if (D.28195 == 29) goto <D.28196>; else goto <D.28197>;
    <D.28196>:
    eklass = type->data.klass;
    goto <D.28198>;
    <D.28197>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1279);
    <D.28198>:
    esize = mono_class_native_size (eklass, 0B);
    mono_mb_emit_ldloc (mb, 1);
    D.28199 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.28199);
    mono_mb_emit_op (mb, 141, eklass);
    mono_mb_emit_byte (mb, 223);
    D.28200 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.28201 = D.28200 & 32;
    if (D.28201 != 0) goto <D.28202>; else goto <D.28203>;
    <D.28202>:
    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_ldloc (mb, 0);
    D.28199 = mspec->data.array_data.num_elem;
    D.28204 = D.28199 * esize;
    mono_mb_emit_icon (mb, D.28204);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.28205>;
    <D.28203>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.28206 = mono_defaults.object_class;
      D.28207 = &D.28206->byval_arg;
      array_var = mono_mb_add_local (mb, D.28207);
      D.28208 = mono_defaults.int_class;
      D.28209 = &D.28208->byval_arg;
      src_var = mono_mb_add_local (mb, D.28209);
      D.28208 = mono_defaults.int_class;
      D.28209 = &D.28208->byval_arg;
      dst_var = mono_mb_add_local (mb, D.28209);
      mono_mb_emit_ldloc (mb, 1);
      mono_mb_emit_byte (mb, 80);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.265);
      mono_mb_emit_ldloc (mb, 0);
      src_var.266 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.266);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.267 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.267);
      D.28208 = mono_defaults.int_class;
      D.28209 = &D.28208->byval_arg;
      index_var = mono_mb_add_local (mb, D.28209);
      mono_mb_emit_byte (mb, 22);
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.268);
      D.28214 = mono_mb_get_label (mb);
      label2 = (guint32) D.28214;
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.268);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.265);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.265);
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.268);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 1);
      emit_struct_conv (mb, eklass, 1);
      D.28215 = (short unsigned int) index_var;
      mono_mb_emit_add_to_local (mb, D.28215, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.266 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.266);
      mono_mb_emit_stloc (mb, 0);
      dst_var.267 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.267);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.28205>:
    goto <D.21272>;
  }
  <D.21283>:
  {
    struct MonoClass * eclass;

    eclass = mono_defaults.char_class;
    mono_mb_emit_ldloc (mb, 1);
    D.28199 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.28199);
    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.28199 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.28199);
    mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
    goto <D.21272>;
  }
  <D.21285>:
  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.21272>;
  <D.21286>:
  if (mspec != 0B) goto <D.28218>; else goto <D.28216>;
  <D.28218>:
  D.28219 = mspec->native;
  if (D.28219 == 23) goto <D.28220>; else goto <D.28216>;
  <D.28220>:
  D.28199 = mspec->data.array_data.num_elem;
  if (D.28199 != 0) goto <D.28221>; else goto <D.28216>;
  <D.28221>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  D.28199 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.28199);
  mono_mb_emit_icall (mb, mono_string_from_byvalwstr);
  goto <D.28217>;
  <D.28216>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  <D.28217>:
  mono_mb_emit_byte (mb, 81);
  goto <D.21272>;
  <D.21287>:
  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.21272>;
  <D.21288>:
  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.21272>;
  <D.21289>:
  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.21272>;
  <D.21290>:
  {
    struct MonoClass * klass;
    int src_var;
    int dst_var;

    klass = mono_class_from_mono_type (type);
    D.28208 = mono_defaults.int_class;
    D.28209 = &D.28208->byval_arg;
    src_var = mono_mb_add_local (mb, D.28209);
    D.28208 = mono_defaults.int_class;
    D.28209 = &D.28208->byval_arg;
    dst_var = mono_mb_add_local (mb, D.28209);
    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.269 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.269);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.270 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.270);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 1);
    emit_struct_conv (mb, klass, 1);
    src_var.269 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.269);
    mono_mb_emit_stloc (mb, 0);
    dst_var.270 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.270);
    mono_mb_emit_stloc (mb, 1);
    goto <D.21272>;
  }
  <D.21294>:
  {
    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.21272>;
  }
  <D.21296>:
  D.28224 = mono_class_from_mono_type (type);
  D.28225 = D.28224->name;
  monoeg_g_log (0B, 4, "Structure field of type %s can\'t be marshalled as LPArray", D.28225);
  <D.21297>:
  goto <D.21297>;
  <D.21298>:
  <D.21299>:
  <D.21300>:
  mono_cominterop_emit_ptr_to_object_conv (mb, type, conv, mspec);
  goto <D.21272>;
  <D.21301>:
  goto <D.21272>;
  <D.21302>:
  goto <D.21272>;
  <D.21303>:
  <D.21304>:
  <D.21305>:
  <D.21306>:
  <D.21307>:
  {
    char * msg;

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


emit_object_to_ptr_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned int D.28227;
  unsigned int pos.271;
  void * D.28229;
  void * D.28230;
  _Bool D.28231;
  long int D.28232;
  long int D.28233;
  int D.28236;
  void * D.28237;
  unsigned char D.28238;
  unsigned char D.28242;
  unsigned char D.28243;
  unsigned int D.28247;
  unsigned char D.28248;
  int D.28251;
  struct MonoClass * D.28253;
  struct MonoType * D.28254;
  struct MonoClass * D.28255;
  struct MonoType * D.28256;
  unsigned int array_var.272;
  unsigned int src_var.273;
  unsigned int dst_var.274;
  unsigned int index_var.275;
  int D.28261;
  short unsigned int D.28262;
  unsigned int pos.276;
  unsigned int D.28264;
  unsigned int D.28265;
  unsigned int src_var.277;
  unsigned int dst_var.278;
  struct MonoClass * D.28268;
  struct MonoClass * D.28269;
  struct MonoType * D.28270;
  unsigned int D.28271;
  unsigned int pos.279;
  int pos;

  switch (conv) <default: <D.21379>, case 1: <D.21346>, case 2: <D.21344>, case 3: <D.21350>, case 4: <D.21348>, case 7: <D.21347>, case 9: <D.21349>, case 10: <D.21351>, case 11: <D.21352>, case 12: <D.21357>, case 13: <D.21358>, case 20: <D.21359>, case 21: <D.21368>, case 22: <D.21354>, case 23: <D.21355>, case 25: <D.21372>, case 26: <D.21373>, case 27: <D.21374>, case 28: <D.21369>, case 29: <D.21356>, case 33: <D.21375>, case 34: <D.21378>>
  <D.21344>:
  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.21345>;
  <D.21346>:
  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.21345>;
  <D.21347>:
  <D.21348>:
  <D.21349>:
  <D.21350>:
  <D.21351>:
  <D.21352>:
  {
    int pos;

    mono_mb_emit_ldloc (mb, 2);
    D.28227 = mono_mb_emit_short_branch (mb, 44);
    pos = (int) D.28227;
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icall (mb, monoeg_g_free);
    pos.271 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.271);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.28229 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.28229);
    mono_mb_emit_byte (mb, 223);
    goto <D.21345>;
  }
  <D.21354>:
  <D.21355>:
  <D.21356>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.28230 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.28230);
  mono_mb_emit_byte (mb, 223);
  goto <D.21345>;
  <D.21357>:
  <D.21358>:
  D.28231 = mspec == 0B;
  D.28232 = (long int) D.28231;
  D.28233 = __builtin_expect (D.28232, 0);
  if (D.28233 != 0) goto <D.28234>; else goto <D.28235>;
  <D.28234>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1641, "mspec");
  <D.28235>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.28236 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.28236);
  D.28237 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.28237);
  goto <D.21345>;
  <D.21359>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.28238 = type->type;
    if (D.28238 == 29) goto <D.28239>; else goto <D.28240>;
    <D.28239>:
    eklass = type->data.klass;
    goto <D.28241>;
    <D.28240>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1657);
    <D.28241>:
    D.28242 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.28243 = D.28242 & 8;
    if (D.28243 != 0) goto <D.28244>; else goto <D.28245>;
    <D.28244>:
    esize = mono_class_native_size (eklass, 0B);
    goto <D.28246>;
    <D.28245>:
    esize = 4;
    <D.28246>:
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.28247 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.28247;
    D.28242 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.28248 = D.28242 & 32;
    if (D.28248 != 0) goto <D.28249>; else goto <D.28250>;
    <D.28249>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    mono_mb_emit_ldflda (mb, 16);
    D.28236 = mspec->data.array_data.num_elem;
    D.28251 = D.28236 * esize;
    mono_mb_emit_icon (mb, D.28251);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.28252>;
    <D.28250>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.28253 = mono_defaults.object_class;
      D.28254 = &D.28253->byval_arg;
      array_var = mono_mb_add_local (mb, D.28254);
      D.28255 = mono_defaults.int_class;
      D.28256 = &D.28255->byval_arg;
      src_var = mono_mb_add_local (mb, D.28256);
      D.28255 = mono_defaults.int_class;
      D.28256 = &D.28255->byval_arg;
      dst_var = mono_mb_add_local (mb, D.28256);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 80);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.272);
      mono_mb_emit_ldloc (mb, 0);
      src_var.273 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.273);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.274 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.274);
      D.28255 = mono_defaults.int_class;
      D.28256 = &D.28255->byval_arg;
      index_var = mono_mb_add_local (mb, D.28256);
      mono_mb_emit_byte (mb, 22);
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.275);
      D.28261 = mono_mb_get_label (mb);
      label2 = (guint32) D.28261;
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.275);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.272);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.272);
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.275);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 0);
      emit_struct_conv (mb, eklass, 0);
      D.28262 = (short unsigned int) index_var;
      mono_mb_emit_add_to_local (mb, D.28262, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.273 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.273);
      mono_mb_emit_stloc (mb, 0);
      dst_var.274 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.274);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.28252>:
    pos.276 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.276);
    goto <D.21345>;
  }
  <D.21368>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.28264 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.28264;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.28236 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.28236);
  mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
  pos.276 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.276);
  goto <D.21345>;
  <D.21369>:
  {
    int src_var;
    int dst_var;

    D.28255 = mono_defaults.int_class;
    D.28256 = &D.28255->byval_arg;
    src_var = mono_mb_add_local (mb, D.28256);
    D.28255 = mono_defaults.int_class;
    D.28256 = &D.28255->byval_arg;
    dst_var = mono_mb_add_local (mb, D.28256);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.28265 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.28265;
    mono_mb_emit_ldloc (mb, 0);
    src_var.277 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.277);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.278 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.278);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 0);
    D.28268 = mono_class_from_mono_type (type);
    emit_struct_conv (mb, D.28268, 0);
    src_var.277 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.277);
    mono_mb_emit_stloc (mb, 0);
    dst_var.278 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.278);
    mono_mb_emit_stloc (mb, 1);
    pos.276 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.276);
    goto <D.21345>;
  }
  <D.21372>:
  <D.21373>:
  <D.21374>:
  mono_cominterop_emit_object_to_ptr_conv (mb, type, conv, mspec);
  goto <D.21345>;
  <D.21375>:
  {
    int dar_release_slot;
    int pos;

    D.28269 = mono_defaults.boolean_class;
    D.28270 = &D.28269->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.28270);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.28271 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.28271;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.279 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.279);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_ldflda (mb, 8);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_byte (mb, 223);
    goto <D.21345>;
  }
  <D.21378>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 223);
  goto <D.21345>;
  <D.21379>:
  {
    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.21345>:
}


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

  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  struct_var.280 = (unsigned int) struct_var;
  mono_mb_emit_ldloc (mb, struct_var.280);
  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.28274;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.21542>, case 20: <D.21540>, case 21: <D.21539>, case 22: <D.21541>>
  <D.21539>:
  *need_free = 0;
  D.28274 = 19;
  return D.28274;
  <D.21540>:
  D.28274 = 17;
  return D.28274;
  <D.21541>:
  D.28274 = 18;
  return D.28274;
  <D.21542>:
  D.28274 = 4294967295;
  return D.28274;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.21520>, case 20: <D.21518>, case 21: <D.21517>, case 22: <D.21519>>
  <D.21517>:
  D.28276 = 16;
  return D.28276;
  <D.21518>:
  D.28276 = 14;
  return D.28276;
  <D.21519>:
  D.28276 = 15;
  return D.28276;
  <D.21520>:
  D.28276 = 4294967295;
  return D.28276;
}


mono_pinvoke_is_unicode (struct MonoMethodPInvoke * piinfo)
{
  short unsigned int D.28278;
  int D.28279;
  int D.28280;
  gboolean D.28281;

  D.28278 = piinfo->piflags;
  D.28279 = (int) D.28278;
  D.28280 = D.28279 & 6;
  switch (D.28280) <default: <D.22713>, case 2: <D.22710>, case 4: <D.22711>, case 6: <D.22712>>
  <D.22710>:
  D.28281 = 0;
  return D.28281;
  <D.22711>:
  D.28281 = 1;
  return D.28281;
  <D.22712>:
  <D.22713>:
  D.28281 = 0;
  return D.28281;
}


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.28283;
  unsigned char D.28284;
  struct MonoClass * D.28287;
  struct MonoType * D.28288;
  unsigned int argnum.281;
  unsigned int D.28293;
  unsigned char ldc_op.282;
  unsigned int conv_arg.283;
  unsigned int label_false.284;
  unsigned int D.28298;
  unsigned int D.28299;
  unsigned int label_false.285;
  unsigned int label_end.286;
  struct MonoClass * D.28308;
  struct MonoType * D.28309;
  struct MonoType * D.28312;
  struct MonoType * D.28314;
  unsigned int D.28317;
  unsigned char ldop.287;
  unsigned int D.28320;
  unsigned int label_false.288;
  unsigned int label_null.289;
  <unnamed type> D.28328;
  unsigned int D.28329;
  unsigned int D.28330;
  unsigned int D.28331;
  unsigned int label_false.290;
  unsigned int label_end.291;
  unsigned int label_null.292;
  int D.28335;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22869>, case 0: <D.22843>, case 1: <D.22851>, case 2: <D.22848>, case 3: <D.22852>, case 4: <D.22853>, case 5: <D.22858>>
  <D.22843>:
  {
    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.28283 = BIT_FIELD_REF <*t, 8, 56>;
        D.28284 = D.28283 & 64;
        if (D.28284 != 0) goto <D.28285>; else goto <D.28286>;
        <D.28285>:
        D.28287 = mono_defaults.int_class;
        D.28288 = &D.28287->byval_arg;
        *conv_arg_type = D.28288;
        goto <D.28289>;
        <D.28286>:
        *conv_arg_type = local_type;
        <D.28289>:
        conv_arg = mono_mb_add_local (mb, local_type);
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.28283 = BIT_FIELD_REF <*t, 8, 56>;
        D.28284 = D.28283 & 64;
        if (D.28284 != 0) goto <D.28291>; else goto <D.28292>;
        <D.28291>:
        mono_mb_emit_byte (mb, 70);
        <D.28292>:
        D.28293 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.28293;
        ldc_op.282 = ldc_op;
        mono_mb_emit_byte (mb, ldc_op.282);
        conv_arg.283 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.283);
        label_false.284 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.284);
        goto <D.22847>;
      }
    finally
      {
        ldc_op = {CLOBBER};
      }
  }
  <D.22848>:
  {
    int label_false;
    int label_end;

    D.28283 = BIT_FIELD_REF <*t, 8, 56>;
    D.28284 = D.28283 & 64;
    if (D.28284 == 0) goto <D.22847>; else goto <D.28297>;
    <D.28297>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.283 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.283);
    D.28298 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.28298;
    mono_mb_emit_byte (mb, 23);
    D.28299 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.28299;
    label_false.285 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.285);
    mono_mb_emit_byte (mb, 22);
    label_end.286 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.286);
    mono_mb_emit_byte (mb, 82);
    goto <D.22847>;
  }
  <D.22851>:
  D.28283 = BIT_FIELD_REF <*t, 8, 56>;
  D.28284 = D.28283 & 64;
  if (D.28284 != 0) goto <D.28302>; else goto <D.28303>;
  <D.28302>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.283);
  goto <D.28304>;
  <D.28303>:
  if (conv_arg != 0) goto <D.28305>; else goto <D.28306>;
  <D.28305>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.283);
  goto <D.28307>;
  <D.28306>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  <D.28307>:
  <D.28304>:
  goto <D.22847>;
  <D.22852>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.22847>;
  <D.22853>:
  {
    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.28308 = mono_defaults.boolean_class;
        D.28309 = &D.28308->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.28309);
        D.28283 = BIT_FIELD_REF <*t, 8, 56>;
        D.28284 = D.28283 & 64;
        if (D.28284 != 0) goto <D.28310>; else goto <D.28311>;
        <D.28310>:
        D.28312 = &conv_arg_class->this_arg;
        *conv_arg_type = D.28312;
        goto <D.28313>;
        <D.28311>:
        D.28314 = &conv_arg_class->byval_arg;
        *conv_arg_type = D.28314;
        <D.28313>:
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.28283 = BIT_FIELD_REF <*t, 8, 56>;
        D.28284 = D.28283 & 64;
        if (D.28284 != 0) goto <D.28315>; else goto <D.28316>;
        <D.28315>:
        D.28317 = mono_mb_emit_branch (mb, 57);
        label_null = (int) D.28317;
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        ldop.287 = ldop;
        mono_mb_emit_byte (mb, ldop.287);
        goto <D.28319>;
        <D.28316>:
        label_null = 0;
        <D.28319>:
        D.28320 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.28320;
        mono_mb_emit_byte (mb, 23);
        conv_arg.283 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.283);
        label_false.288 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.288);
        D.28283 = BIT_FIELD_REF <*t, 8, 56>;
        D.28284 = D.28283 & 64;
        if (D.28284 != 0) goto <D.28322>; else goto <D.28323>;
        <D.28322>:
        label_null.289 = (unsigned int) label_null;
        mono_mb_patch_branch (mb, label_null.289);
        <D.28323>:
        goto <D.22847>;
      }
    finally
      {
        ldop = {CLOBBER};
      }
  }
  <D.22858>:
  {
    guint8 stop;
    guint8 ldc_op;
    int label_null;
    int label_false;
    int label_end;

    stop = 84;
    ldc_op = 23;
    D.28283 = BIT_FIELD_REF <*t, 8, 56>;
    D.28284 = D.28283 & 64;
    if (D.28284 == 0) goto <D.22847>; else goto <D.28325>;
    <D.28325>:
    if (spec != 0B) goto <D.28326>; else goto <D.28327>;
    <D.28326>:
    D.28328 = spec->native;
    switch (D.28328) <default: <D.22868>, case 3: <D.22864>, case 4: <D.22865>, case 37: <D.22867>>
    <D.22864>:
    <D.22865>:
    stop = 82;
    goto <D.22866>;
    <D.22867>:
    stop = 83;
    ldc_op = 21;
    goto <D.22866>;
    <D.22868>:
    goto <D.22866>;
    <D.22866>:
    <D.28327>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    D.28329 = mono_mb_emit_branch (mb, 57);
    label_null = (int) D.28329;
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.283 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.283);
    D.28330 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.28330;
    mono_mb_emit_byte (mb, ldc_op);
    D.28331 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.28331;
    label_false.290 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.290);
    mono_mb_emit_byte (mb, 22);
    label_end.291 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.291);
    mono_mb_emit_byte (mb, stop);
    label_null.292 = (unsigned int) label_null;
    mono_mb_patch_branch (mb, label_null.292);
    goto <D.22847>;
  }
  <D.22869>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8436);
  <D.22847>:
  D.28335 = conv_arg;
  return D.28335;
}


marshal_boolean_conv_in_get_local_type (struct MonoMarshalSpec * spec, guint8 * ldc_op)
{
  struct MonoType * D.28342;
  struct MonoClass * D.28343;
  <unnamed type> D.28344;
  struct MonoClass * D.28345;
  struct MonoClass * D.28348;

  if (spec == 0B) goto <D.28340>; else goto <D.28341>;
  <D.28340>:
  D.28343 = mono_defaults.int32_class;
  D.28342 = &D.28343->byval_arg;
  return D.28342;
  <D.28341>:
  D.28344 = spec->native;
  switch (D.28344) <default: <D.22821>, case 2: <D.22820>, case 3: <D.22817>, case 4: <D.22818>, case 37: <D.22819>>
  <D.22817>:
  <D.22818>:
  D.28345 = mono_defaults.byte_class;
  D.28342 = &D.28345->byval_arg;
  return D.28342;
  <D.22819>:
  if (ldc_op != 0B) goto <D.28346>; else goto <D.28347>;
  <D.28346>:
  *ldc_op = 21;
  <D.28347>:
  D.28348 = mono_defaults.int16_class;
  D.28342 = &D.28348->byval_arg;
  return D.28342;
  <D.22820>:
  D.28343 = mono_defaults.int32_class;
  D.28342 = &D.28343->byval_arg;
  return D.28342;
  <D.22821>:
  D.28344 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.28344);
  D.28343 = mono_defaults.int32_class;
  D.28342 = &D.28343->byval_arg;
  return D.28342;
}


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

  conv_arg_class = mono_defaults.int32_class;
  if (spec != 0B) goto <D.28350>; else goto <D.28351>;
  <D.28350>:
  D.28352 = spec->native;
  switch (D.28352) <default: <D.22832>, case 2: <D.22831>, case 3: <D.22827>, case 4: <D.22828>, case 37: <D.22830>>
  <D.22827>:
  <D.22828>:
  conv_arg_class = mono_defaults.byte_class;
  if (ldop != 0B) goto <D.28353>; else goto <D.28354>;
  <D.28353>:
  *ldop = 70;
  <D.28354>:
  goto <D.22829>;
  <D.22830>:
  conv_arg_class = mono_defaults.int16_class;
  if (ldop != 0B) goto <D.28355>; else goto <D.28356>;
  <D.28355>:
  *ldop = 72;
  <D.28356>:
  goto <D.22829>;
  <D.22831>:
  goto <D.22829>;
  <D.22832>:
  D.28352 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.28352);
  <D.22829>:
  <D.28351>:
  D.28357 = conv_arg_class;
  return D.28357;
}


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.293;
  int D.28361;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22884>, case 0: <D.22880>, case 1: <D.22882>, case 3: <D.22883>>
  <D.22880>:
  goto <D.22881>;
  <D.22882>:
  argnum.293 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.293);
  goto <D.22881>;
  <D.22883>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.22881>;
  <D.22884>:
  goto <D.22881>;
  <D.22881>:
  D.28361 = conv_arg;
  return D.28361;
}


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.294;
  int D.28365;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22898>, case 1: <D.22895>, case 3: <D.22897>>
  <D.22895>:
  argnum.294 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.294);
  goto <D.22896>;
  <D.22897>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.22896>;
  <D.22898>:
  goto <D.22896>;
  <D.22896>:
  D.28365 = conv_arg;
  return D.28365;
}


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.295;
  int D.28369;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.22912>, case 1: <D.22909>, case 3: <D.22911>>
  <D.22909>:
  argnum.295 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.295);
  goto <D.22910>;
  <D.22911>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.22910>;
  <D.22912>:
  goto <D.22910>;
  <D.22910>:
  D.28369 = conv_arg;
  return D.28369;
}


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.298;
  struct MonoClass * tmp_klass.296;
  struct MonoImage * D.28377;
  struct MonoClass * tmp_klass.297;
  _Bool D.28379;
  long int D.28380;
  long int D.28381;
  struct MonoMethod * to_oadate.299;
  struct MonoMethod * to_oadate.300;
  _Bool D.28390;
  long int D.28391;
  long int D.28392;
  struct MonoClass * D.28395;
  struct MonoType * D.28396;
  unsigned char D.28397;
  unsigned char D.28398;
  unsigned int argnum.301;
  unsigned int D.28402;
  short unsigned int D.28406;
  unsigned int D.28407;
  unsigned int D.28408;
  struct MonoMethodSignature * D.28411;
  <unnamed-unsigned:1> D.28412;
  int D.28413;
  int D.28414;
  unsigned int conv_arg.302;
  unsigned int pos.303;
  unsigned int D.28419;
  unsigned int D.28420;
  unsigned char D.28422;
  unsigned char D.28423;
  struct MonoClass * D.28425;
  struct MonoType * D.28426;
  int D.28430;
  unsigned int D.28433;
  <unnamed type> D.28441;
  _Bool D.28444;
  long int D.28445;
  long int D.28446;
  struct MonoMethod * from_oadate.304;
  struct MonoMethod * from_oadate.305;
  _Bool D.28472;
  long int D.28473;
  long int D.28474;
  unsigned int D.28481;
  unsigned char D.28489;
  struct MonoType * D.28493;
  int D.28494;
  int D.28495;
  unsigned int D.28502;
  unsigned int D.28510;
  unsigned int pos2.306;
  int D.28515;
  int D.28516;
  _Bool D.28517;
  long int D.28518;
  long int D.28519;
  int D.28522;
  unsigned int D.28523;
  int D.28524;
  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.296 = tmp_klass;
      if (tmp_klass.296 == 0B) goto <D.28373>; else goto <D.28374>;
      <D.28373>:
      if (0 != 0) goto <D.28375>; else goto <D.28376>;
      <D.28375>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "mono_defaults.corlib == mono_defaults.corlib");
      <D.28376>:
      D.28377 = mono_defaults.corlib;
      tmp_klass.297 = mono_class_from_name (D.28377, "System", "DateTime");
      tmp_klass = tmp_klass.297;
      tmp_klass.296 = tmp_klass;
      D.28379 = tmp_klass.296 == 0B;
      D.28380 = (long int) D.28379;
      D.28381 = __builtin_expect (D.28380, 0);
      if (D.28381 != 0) goto <D.28382>; else goto <D.28383>;
      <D.28382>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "tmp_klass");
      <D.28383>:
      <D.28374>:
    }
    date_time_class.298 = tmp_klass;
  }
  date_time_class = date_time_class.298;
  switch (action) <default: <D.22568>, case 0: <D.22558>, case 1: <D.22561>, case 2: <D.22562>, case 3: <D.22564>, case 4: <D.22565>, case 5: <D.22566>, case 6: <D.22567>>
  <D.22558>:
  if (klass == date_time_class) goto <D.28384>; else goto <D.28385>;
  <D.28384>:
  {
    static struct MonoMethod * to_oadate;

    to_oadate.299 = to_oadate;
    if (to_oadate.299 == 0B) goto <D.28387>; else goto <D.28388>;
    <D.28387>:
    to_oadate.300 = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
    to_oadate = to_oadate.300;
    <D.28388>:
    to_oadate.299 = to_oadate;
    D.28390 = to_oadate.299 == 0B;
    D.28391 = (long int) D.28390;
    D.28392 = __builtin_expect (D.28391, 0);
    if (D.28392 != 0) goto <D.28393>; else goto <D.28394>;
    <D.28393>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6236, "to_oadate");
    <D.28394>:
    D.28395 = mono_defaults.double_class;
    D.28396 = &D.28395->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.28396);
    D.28397 = BIT_FIELD_REF <*t, 8, 56>;
    D.28398 = D.28397 & 64;
    if (D.28398 != 0) goto <D.28399>; else goto <D.28400>;
    <D.28399>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.301);
    D.28402 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.28402;
    <D.28400>:
    D.28397 = BIT_FIELD_REF <*t, 8, 56>;
    D.28398 = D.28397 & 64;
    if (D.28398 == 0) goto <D.28403>; else goto <D.28405>;
    <D.28405>:
    D.28406 = t->attrs;
    D.28407 = (unsigned int) D.28406;
    D.28408 = D.28407 & 3;
    if (D.28408 != 2) goto <D.28403>; else goto <D.28404>;
    <D.28403>:
    D.28397 = BIT_FIELD_REF <*t, 8, 56>;
    D.28398 = D.28397 & 64;
    if (D.28398 == 0) goto <D.28409>; else goto <D.28410>;
    <D.28409>:
    D.28411 = m->csig;
    D.28411 = m->csig;
    D.28412 = D.28411->hasthis;
    D.28413 = (int) D.28412;
    D.28414 = argnum - D.28413;
    D.28395 = mono_defaults.double_class;
    D.28396 = &D.28395->byval_arg;
    D.28411->params[D.28414] = D.28396;
    <D.28410>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.301);
    to_oadate.299 = to_oadate;
    mono_mb_emit_managed_call (mb, to_oadate.299, 0B);
    conv_arg.302 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.302);
    <D.28404>:
    D.28397 = BIT_FIELD_REF <*t, 8, 56>;
    D.28398 = D.28397 & 64;
    if (D.28398 != 0) goto <D.28416>; else goto <D.28417>;
    <D.28416>:
    pos.303 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.303);
    <D.28417>:
    goto <D.22560>;
  }
  <D.28385>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.22560>; else goto <D.28421>;
  <D.28421>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.22560>; else goto <D.28424>;
  <D.28424>:
  D.28425 = mono_defaults.int_class;
  D.28426 = &D.28425->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.28426);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28427>; else goto <D.28428>;
  <D.28427>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.28429>;
  <D.28428>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.28429>:
  mono_mb_emit_stloc (mb, 0);
  D.28430 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28430);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.302);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28431>; else goto <D.28432>;
  <D.28431>:
  mono_mb_emit_ldloc (mb, 0);
  D.28433 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28433;
  <D.28432>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 == 0) goto <D.28434>; else goto <D.28436>;
  <D.28436>:
  D.28406 = t->attrs;
  D.28407 = (unsigned int) D.28406;
  D.28408 = D.28407 & 3;
  if (D.28408 != 2) goto <D.28434>; else goto <D.28435>;
  <D.28434>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.28435>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28437>; else goto <D.28438>;
  <D.28437>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.28438>:
  goto <D.22560>;
  <D.22561>:
  if (spec != 0B) goto <D.28439>; else goto <D.28440>;
  <D.28439>:
  D.28441 = spec->native;
  if (D.28441 == 43) goto <D.28442>; else goto <D.28443>;
  <D.28442>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  D.28444 = D.28398 != 0;
  D.28445 = (long int) D.28444;
  D.28446 = __builtin_expect (D.28445, 0);
  if (D.28446 != 0) goto <D.28447>; else goto <D.28448>;
  <D.28447>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6301, "!t->byref");
  <D.28448>:
  D.28411 = m->csig;
  D.28411 = m->csig;
  D.28412 = D.28411->hasthis;
  D.28413 = (int) D.28412;
  D.28414 = argnum - D.28413;
  D.28425 = mono_defaults.int_class;
  D.28426 = &D.28425->byval_arg;
  D.28411->params[D.28414] = D.28426;
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.28449>; else goto <D.28452>;
  <D.28452>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.28449>; else goto <D.28450>;
  <D.28449>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  goto <D.28451>;
  <D.28450>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.28451>:
  goto <D.22560>;
  <D.28443>:
  <D.28440>:
  if (klass == date_time_class) goto <D.28453>; else goto <D.28454>;
  <D.28453>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28455>; else goto <D.28456>;
  <D.28455>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  goto <D.28457>;
  <D.28456>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.28457>:
  goto <D.22560>;
  <D.28454>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.28458>; else goto <D.28460>;
  <D.28460>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.28458>; else goto <D.28459>;
  <D.28458>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.22560>;
  <D.28459>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 == 0) goto <D.28461>; else goto <D.28462>;
  <D.28461>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 6, klass);
  <D.28462>:
  goto <D.22560>;
  <D.22562>:
  if (klass == date_time_class) goto <D.28463>; else goto <D.28464>;
  <D.28463>:
  {
    static struct MonoMethod * from_oadate;

    D.28397 = BIT_FIELD_REF <*t, 8, 56>;
    D.28398 = D.28397 & 64;
    if (D.28398 == 0) goto <D.22560>; else goto <D.28465>;
    <D.28465>:
    D.28406 = t->attrs;
    D.28407 = (unsigned int) D.28406;
    D.28408 = D.28407 & 3;
    if (D.28408 != 1) goto <D.28466>; else goto <D.28467>;
    <D.28466>:
    from_oadate.304 = from_oadate;
    if (from_oadate.304 == 0B) goto <D.28469>; else goto <D.28470>;
    <D.28469>:
    from_oadate.305 = mono_class_get_method_from_name (date_time_class, "FromOADate", 1);
    from_oadate = from_oadate.305;
    <D.28470>:
    from_oadate.304 = from_oadate;
    D.28472 = from_oadate.304 == 0B;
    D.28473 = (long int) D.28472;
    D.28474 = __builtin_expect (D.28473, 0);
    if (D.28474 != 0) goto <D.28475>; else goto <D.28476>;
    <D.28475>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6345, "from_oadate");
    <D.28476>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.301);
    conv_arg.302 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.302);
    from_oadate.304 = from_oadate;
    mono_mb_emit_managed_call (mb, from_oadate.304, 0B);
    mono_mb_emit_op (mb, 129, date_time_class);
    <D.28467>:
    goto <D.22560>;
  }
  <D.28464>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.22560>; else goto <D.28477>;
  <D.28477>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.22560>; else goto <D.28478>;
  <D.28478>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28479>; else goto <D.28480>;
  <D.28479>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.28481 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28481;
  D.28406 = t->attrs;
  D.28407 = (unsigned int) D.28406;
  D.28408 = D.28407 & 3;
  if (D.28408 != 1) goto <D.28482>; else goto <D.28483>;
  <D.28482>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  <D.28483>:
  <D.28480>:
  emit_struct_free (mb, klass, conv_arg);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28484>; else goto <D.28485>;
  <D.28484>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.28485>:
  goto <D.22560>;
  <D.22564>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.28486>; else goto <D.28488>;
  <D.28488>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28489 = D.28422 & 32;
  if (D.28489 != 0) goto <D.28486>; else goto <D.28487>;
  <D.28486>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.22560>;
  <D.28487>:
  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.22560>;
  <D.22565>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.28490>; else goto <D.28492>;
  <D.28492>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.28490>; else goto <D.28491>;
  <D.28490>:
  conv_arg = 0;
  goto <D.22560>;
  <D.28491>:
  D.28493 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.28493);
  D.28406 = t->attrs;
  D.28494 = (int) D.28406;
  D.28495 = D.28494 & 2;
  if (D.28495 != 0) goto <D.22560>; else goto <D.28496>;
  <D.28496>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28497>; else goto <D.28498>;
  <D.28497>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.28499>;
  <D.28498>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.28499>:
  mono_mb_emit_stloc (mb, 0);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28500>; else goto <D.28501>;
  <D.28500>:
  mono_mb_emit_ldloc (mb, 0);
  D.28502 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28502;
  <D.28501>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28503>; else goto <D.28504>;
  <D.28503>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.28504>:
  goto <D.22560>;
  <D.22566>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.22560>; else goto <D.28505>;
  <D.28505>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.22560>; else goto <D.28506>;
  <D.28506>:
  D.28397 = BIT_FIELD_REF <*t, 8, 56>;
  D.28398 = D.28397 & 64;
  if (D.28398 != 0) goto <D.28507>; else goto <D.28508>;
  <D.28507>:
  D.28406 = t->attrs;
  D.28407 = (unsigned int) D.28406;
  D.28408 = D.28407 & 3;
  if (D.28408 == 1) goto <D.22560>; else goto <D.28509>;
  <D.28509>:
  <D.28508>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  D.28510 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.28510;
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 0);
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos2.306 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.306);
  goto <D.22560>;
  <D.22567>:
  D.28419 = klass->flags;
  D.28420 = D.28419 & 24;
  if (D.28420 == 16) goto <D.28512>; else goto <D.28514>;
  <D.28514>:
  D.28422 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28423 = D.28422 & 48;
  if (D.28423 != 0) goto <D.28512>; else goto <D.28513>;
  <D.28512>:
  mono_mb_emit_stloc (mb, 3);
  m->retobj_var = 0;
  goto <D.22560>;
  <D.28513>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  D.28425 = mono_defaults.int_class;
  D.28426 = &D.28425->byval_arg;
  D.28515 = mono_mb_add_local (mb, D.28426);
  m->retobj_var = D.28515;
  m->retobj_class = klass;
  D.28516 = m->retobj_var;
  D.28517 = D.28516 == 0;
  D.28518 = (long int) D.28517;
  D.28519 = __builtin_expect (D.28518, 0);
  if (D.28519 != 0) goto <D.28520>; else goto <D.28521>;
  <D.28520>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6481, "m->retobj_var");
  <D.28521>:
  D.28522 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28522);
  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.28516 = m->retobj_var;
  D.28523 = (unsigned int) D.28516;
  mono_mb_emit_stloc (mb, D.28523);
  emit_struct_conv (mb, klass, 0);
  goto <D.22560>;
  <D.22568>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6494);
  <D.22560>:
  D.28524 = conv_arg;
  return D.28524;
}


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.28526;
  struct MonoType * D.28527;
  int * D.28528;
  unsigned int argnum.307;
  unsigned int D.28530;
  int * D.28531;
  struct MonoClass * D.28532;
  struct MonoClass * D.28533;
  unsigned char D.28536;
  unsigned char D.28537;
  unsigned char D.28540;
  unsigned char D.28541;
  short unsigned int D.28544;
  int D.28545;
  int D.28546;
  unsigned int conv_arg.308;
  unsigned int argnum.309;
  void * D.28552;
  struct MonoClass * D.28554;
  struct MonoMethodPInvoke * D.28557;
  unsigned int D.28560;
  unsigned int D.28561;
  void * D.28567;
  unsigned char D.28569;
  unsigned char D.28570;
  unsigned int D.28573;
  unsigned int pos.310;
  unsigned int D.28579;
  int D.28580;
  int D.28583;
  int D.28584;
  unsigned int D.28585;
  _Bool D.28588;
  long int D.28589;
  long int D.28590;
  void * D.28596;
  int need_free.311;
  void * D.28604;
  unsigned int D.28611;
  unsigned int D.28618;
  _Bool D.28621;
  long int D.28622;
  long int D.28623;
  unsigned int pos2.312;
  _Bool D.28632;
  long int D.28633;
  long int D.28634;
  void * D.28637;
  unsigned int loc.313;
  unsigned int D.28640;
  struct MonoType * D.28641;
  void * D.28646;
  _Bool D.28649;
  long int D.28650;
  long int D.28651;
  _Bool D.28656;
  long int D.28657;
  long int D.28658;
  unsigned int D.28661;
  unsigned int D.28662;
  unsigned int D.28669;
  unsigned int pos2.314;
  unsigned int D.28671;
  unsigned int D.28674;
  unsigned int D.28675;
  int D.28676;
  void * D.28680;
  unsigned int D.28683;
  unsigned int D.28684;
  int D.28685;
  int D.28686;
  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.22682>, case 0: <D.22660>, case 1: <D.22675>, case 2: <D.22667>, case 3: <D.22676>, case 4: <D.22677>, case 5: <D.22680>, case 6: <D.22681>>
  <D.22660>:
  D.28526 = mono_defaults.int_class;
  D.28527 = &D.28526->byval_arg;
  *conv_arg_type = D.28527;
  D.28526 = mono_defaults.int_class;
  D.28527 = &D.28526->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.28527);
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  *D.28531 = 0;
  D.28532 = mono_class_from_mono_type (t);
  D.28533 = mono_defaults.object_class;
  if (D.28532 == D.28533) goto <D.28534>; else goto <D.28535>;
  <D.28534>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Marshalling of type object is not implemented");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.22662>;
  }
  <D.28535>:
  D.28536 = BIT_FIELD_REF <*klass, 8, 184>;
  D.28537 = D.28536 & 1;
  if (D.28537 != 0) goto <D.28538>; else goto <D.28539>;
  <D.28538>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28542>; else goto <D.28543>;
  <D.28542>:
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 == 0) goto <D.28547>; else goto <D.28548>;
  <D.28547>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Byref marshalling of delegates is not implemented.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
  }
  <D.28548>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.28550>;
  <D.28543>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.28552 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.28552);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  <D.28550>:
  goto <D.28553>;
  <D.28539>:
  D.28554 = mono_defaults.stringbuilder_class;
  if (D.28554 == klass) goto <D.28555>; else goto <D.28556>;
  <D.28555>:
  {
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    D.28557 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.28557, spec);
    D.28557 = m->piinfo;
    conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.28557, spec);
    D.28540 = BIT_FIELD_REF <*t, 8, 56>;
    D.28541 = D.28540 & 64;
    if (D.28541 != 0) goto <D.28558>; else goto <D.28559>;
    <D.28558>:
    D.28544 = t->attrs;
    D.28560 = (unsigned int) D.28544;
    D.28561 = D.28560 & 3;
    if (D.28561 == 2) goto <D.22662>; else goto <D.28562>;
    <D.28562>:
    <D.28559>:
    if (conv == 4294967295) goto <D.28563>; else goto <D.28564>;
    <D.28563>:
    {
      char * msg;

      msg = monoeg_g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.22662>;
    }
    <D.28564>:
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    D.28540 = BIT_FIELD_REF <*t, 8, 56>;
    D.28541 = D.28540 & 64;
    if (D.28541 != 0) goto <D.28565>; else goto <D.28566>;
    <D.28565>:
    mono_mb_emit_byte (mb, 77);
    <D.28566>:
    D.28567 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.28567);
    conv_arg.308 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.308);
  }
  goto <D.28568>;
  <D.28556>:
  D.28569 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28570 = D.28569 & 32;
  if (D.28570 != 0) goto <D.28571>; else goto <D.28572>;
  <D.28571>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.28573 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28573;
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_ldflda (mb, 8);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.22662>;
  <D.28572>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28575>; else goto <D.28576>;
  <D.28575>:
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 != 0) goto <D.22662>; else goto <D.28577>;
  <D.28577>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 77);
  goto <D.28578>;
  <D.28576>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  <D.28578>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.28579 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28579;
  D.28580 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28580);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28581>; else goto <D.28582>;
  <D.28581>:
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28526 = mono_defaults.int_class;
  D.28527 = &D.28526->byval_arg;
  D.28583 = mono_mb_add_local (mb, D.28527);
  *D.28531 = D.28583;
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28584 = *D.28531;
  D.28585 = (unsigned int) D.28584;
  mono_mb_emit_stloc (mb, D.28585);
  <D.28582>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  <D.28568>:
  <D.28553>:
  goto <D.22662>;
  <D.22667>:
  D.28554 = mono_defaults.stringbuilder_class;
  if (D.28554 == klass) goto <D.28586>; else goto <D.28587>;
  <D.28586>:
  {
    gboolean need_free;
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    try
      {
        D.28557 = m->piinfo;
        encoding = mono_marshal_get_string_encoding (D.28557, spec);
        D.28557 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.28557, spec, &need_free);
        D.28588 = encoding == 4294967295;
        D.28589 = (long int) D.28588;
        D.28590 = __builtin_expect (D.28589, 0);
        if (D.28590 != 0) goto <D.28591>; else goto <D.28592>;
        <D.28591>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7051, "encoding != -1");
        <D.28592>:
        D.28540 = BIT_FIELD_REF <*t, 8, 56>;
        D.28541 = D.28540 & 64;
        if (D.28541 != 0) goto <D.28593>; else goto <D.28594>;
        <D.28593>:
        need_free = 1;
        argnum.309 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.309);
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        switch (encoding) <default: <D.22674>, case 20: <D.22673>, case 21: <D.22671>>
        <D.22671>:
        mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
        goto <D.22672>;
        <D.22673>:
        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
        goto <D.22672>;
        <D.22674>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7069);
        <D.22672>:
        mono_mb_emit_byte (mb, 81);
        goto <D.28595>;
        <D.28594>:
        argnum.309 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.309);
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        D.28596 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.28596);
        <D.28595>:
        need_free.311 = need_free;
        if (need_free.311 != 0) goto <D.28598>; else goto <D.28599>;
        <D.28598>:
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.28599>:
        goto <D.22662>;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.28587>:
  D.28536 = BIT_FIELD_REF <*klass, 8, 184>;
  D.28537 = D.28536 & 1;
  if (D.28537 != 0) goto <D.28600>; else goto <D.28601>;
  <D.28600>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28602>; else goto <D.28603>;
  <D.28602>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.28604 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.28604);
  mono_mb_emit_byte (mb, 81);
  <D.28603>:
  goto <D.22662>;
  <D.28601>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28605>; else goto <D.28606>;
  <D.28605>:
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 != 0) goto <D.28607>; else goto <D.28608>;
  <D.28607>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_byte (mb, 81);
  <D.28608>:
  <D.28606>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28609>; else goto <D.28610>;
  <D.28609>:
  mono_mb_emit_byte (mb, 77);
  <D.28610>:
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.28611 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28611;
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28612>; else goto <D.28615>;
  <D.28615>:
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 != 0) goto <D.28612>; else goto <D.28613>;
  <D.28612>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_stloc (mb, 1);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, conv_arg);
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28584 = *D.28531;
  if (D.28584 != 0) goto <D.28616>; else goto <D.28617>;
  <D.28616>:
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28584 = *D.28531;
  D.28585 = (unsigned int) D.28584;
  mono_mb_emit_ldloc (mb, D.28585);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.28618 = mono_mb_emit_branch (mb, 59);
  pos2 = (int) D.28618;
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 == 0) goto <D.28619>; else goto <D.28620>;
  <D.28619>:
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28584 = *D.28531;
  D.28621 = D.28584 == 0;
  D.28622 = (long int) D.28621;
  D.28623 = __builtin_expect (D.28622, 0);
  if (D.28623 != 0) goto <D.28624>; else goto <D.28625>;
  <D.28624>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7144, "m->orig_conv_args [argnum]");
  <D.28625>:
  D.28528 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.28530 = argnum.307 * 4;
  D.28531 = D.28528 + D.28530;
  D.28584 = *D.28531;
  emit_struct_free (mb, klass, D.28584);
  <D.28620>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos2.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  <D.28617>:
  goto <D.28614>;
  <D.28613>:
  emit_struct_free (mb, klass, conv_arg);
  <D.28614>:
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.22662>;
  <D.22675>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28627>; else goto <D.28628>;
  <D.28627>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.308);
  goto <D.28629>;
  <D.28628>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  <D.28629>:
  goto <D.22662>;
  <D.22676>:
  D.28536 = BIT_FIELD_REF <*klass, 8, 184>;
  D.28537 = D.28536 & 1;
  if (D.28537 != 0) goto <D.28630>; else goto <D.28631>;
  <D.28630>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  D.28632 = D.28541 != 0;
  D.28633 = (long int) D.28632;
  D.28634 = __builtin_expect (D.28633, 0);
  if (D.28634 != 0) goto <D.28635>; else goto <D.28636>;
  <D.28635>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7171, "!t->byref");
  <D.28636>:
  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.28637 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.28637);
  mono_mb_emit_stloc (mb, 3);
  goto <D.28638>;
  <D.28631>:
  mono_mb_emit_stloc (mb, 0);
  D.28526 = mono_defaults.int_class;
  D.28527 = &D.28526->byval_arg;
  loc = mono_mb_add_local (mb, D.28527);
  mono_mb_emit_ldloc (mb, 0);
  loc.313 = (unsigned int) loc;
  mono_mb_emit_stloc (mb, loc.313);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 0);
  D.28640 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28640;
  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, 8);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, loc);
  loc.313 = (unsigned int) loc;
  mono_mb_emit_ldloc (mb, loc.313);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  <D.28638>:
  goto <D.22662>;
  <D.22677>:
  D.28641 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.28641);
  D.28536 = BIT_FIELD_REF <*klass, 8, 184>;
  D.28537 = D.28536 & 1;
  if (D.28537 != 0) goto <D.28642>; else goto <D.28643>;
  <D.28642>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  D.28632 = D.28541 != 0;
  D.28633 = (long int) D.28632;
  D.28634 = __builtin_expect (D.28633, 0);
  if (D.28634 != 0) goto <D.28644>; else goto <D.28645>;
  <D.28644>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7221, "!t->byref");
  <D.28645>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.28646 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.28646);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.22662>;
  <D.28643>:
  D.28554 = mono_defaults.stringbuilder_class;
  if (D.28554 == klass) goto <D.28647>; else goto <D.28648>;
  <D.28647>:
  {
    MonoMarshalNative encoding;

    D.28557 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.28557, spec);
    D.28649 = encoding != 20;
    D.28650 = (long int) D.28649;
    D.28651 = __builtin_expect (D.28650, 0);
    if (D.28651 != 0) goto <D.28652>; else goto <D.28653>;
    <D.28652>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7236, "encoding == MONO_NATIVE_LPSTR");
    <D.28653>:
    D.28540 = BIT_FIELD_REF <*t, 8, 56>;
    D.28541 = D.28540 & 64;
    D.28632 = D.28541 != 0;
    D.28633 = (long int) D.28632;
    D.28634 = __builtin_expect (D.28633, 0);
    if (D.28634 != 0) goto <D.28654>; else goto <D.28655>;
    <D.28654>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7238, "!t->byref");
    <D.28655>:
    D.28656 = encoding == 4294967295;
    D.28657 = (long int) D.28656;
    D.28658 = __builtin_expect (D.28657, 0);
    if (D.28658 != 0) goto <D.28659>; else goto <D.28660>;
    <D.28659>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7239, "encoding != -1");
    <D.28660>:
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
    conv_arg.308 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.308);
    goto <D.22662>;
  }
  <D.28648>:
  D.28661 = klass->flags;
  D.28662 = D.28661 & 24;
  if (D.28662 == 0) goto <D.28663>; else goto <D.28664>;
  <D.28663>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.22662>;
  <D.28664>:
  D.28544 = t->attrs;
  D.28545 = (int) D.28544;
  D.28546 = D.28545 & 2;
  if (D.28546 != 0) goto <D.28665>; else goto <D.28666>;
  <D.28665>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.22662>;
  <D.28666>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28667>; else goto <D.28668>;
  <D.28667>:
  {
    int pos2;

    D.28669 = mono_mb_emit_branch (mb, 58);
    pos2 = (int) D.28669;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos2.314 = (unsigned int) pos2;
    mono_mb_patch_branch (mb, pos2.314);
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    mono_mb_emit_byte (mb, 77);
  }
  <D.28668>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 22);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  mono_mb_emit_ldloc (mb, 0);
  D.28671 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.28671;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.22662>;
  <D.22680>:
  D.28540 = BIT_FIELD_REF <*t, 8, 56>;
  D.28541 = D.28540 & 64;
  if (D.28541 != 0) goto <D.28672>; else goto <D.28673>;
  <D.28672>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.28674 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.28674;
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 81);
  D.28675 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.28675;
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  D.28676 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28676);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_stloc (mb, 1);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 223);
  emit_struct_conv (mb, klass, 0);
  pos2.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  goto <D.28677>;
  <D.28673>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.28677>:
  goto <D.22662>;
  <D.22681>:
  D.28536 = BIT_FIELD_REF <*klass, 8, 184>;
  D.28537 = D.28536 & 1;
  if (D.28537 != 0) goto <D.28678>; else goto <D.28679>;
  <D.28678>:
  D.28680 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.28680);
  mono_mb_emit_stloc (mb, 3);
  goto <D.22662>;
  <D.28679>:
  D.28661 = klass->flags;
  D.28662 = D.28661 & 24;
  if (D.28662 == 0) goto <D.28681>; else goto <D.28682>;
  <D.28681>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.22662>;
  <D.28682>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.28683 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.28683;
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  D.28684 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.28684;
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  D.28685 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28685);
  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.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  goto <D.22662>;
  <D.22682>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7389);
  <D.22662>:
  D.28686 = conv_arg;
  return D.28686;
}


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

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


mono_marshal_get_native_wrapper (struct MonoMethod * method, gboolean check_exceptions, gboolean aot)
{
  _Bool D.28691;
  long int D.28692;
  long int D.28693;
  struct MonoMethodSignature * D.28696;
  unsigned char D.28697;
  unsigned char D.28698;
  _Bool D.28699;
  long int D.28700;
  long int D.28701;
  struct MonoClass * D.28706;
  struct MonoImage * D.28707;
  struct GHashTable * * D.28708;
  struct GHashTable * * D.28710;
  struct MonoMethod * D.28713;
  unsigned int D.28714;
  unsigned int D.28715;
  short unsigned int D.28718;
  int D.28719;
  int D.28720;
  short unsigned int D.28723;
  int D.28724;
  int D.28725;
  void * D.28728;
  int D.28733;
  void * D.28740;
  _Bool D.28743;
  long int D.28744;
  long int D.28745;
  unsigned char D.28748;
  signed char D.28749;
  _Bool D.28750;
  long int D.28751;
  long int D.28752;
  unsigned char D.28755;
  unsigned char D.28756;
  _Bool D.28757;
  long int D.28758;
  long int D.28759;
  struct MonoClass * D.28762;
  struct MonoType * D.28763;
  int D.23043;
  int iftmp.315;
  int D.23039;
  const char[13] * D.28767;
  unsigned char D.28768;
  int D.28769;
  unsigned char D.28770;
  int D.28771;
  _Bool D.28772;
  _Bool D.28773;
  _Bool D.28774;
  const unsigned char * D.28777;
  unsigned char D.28778;
  int D.28779;
  const unsigned char * D.28780;
  unsigned char D.28781;
  int D.28782;
  _Bool D.28783;
  _Bool D.28784;
  const unsigned char * D.28787;
  unsigned char D.28788;
  int D.28789;
  const unsigned char * D.28790;
  unsigned char D.28791;
  int D.28792;
  _Bool D.28793;
  _Bool D.28794;
  const unsigned char * D.28797;
  unsigned char D.28798;
  int D.28799;
  const unsigned char * D.28800;
  unsigned char D.28801;
  int D.28802;
  const char * D.28804;
  struct MonoMethodSignature * D.28807;
  int D.28808;
  short unsigned int D.28811;
  int D.28812;
  int D.28813;
  _Bool D.28814;
  long int D.28815;
  long int D.28816;
  short unsigned int D.28819;
  int D.28820;
  int D.28821;
  _Bool D.28822;
  long int D.28823;
  long int D.28824;
  const char * D.28827;
  unsigned int i.316;
  short unsigned int D.28829;
  int D.28830;
  int D.28831;
  struct MonoMethod * D.28832;
  const char * exc_class.317;
  const char * exc_arg.318;
  int D.28839;
  int D.28840;
  unsigned char D.28846;
  unsigned int D.28851;
  unsigned int pos.319;
  <unnamed-unsigned:1> D.28853;
  int D.28854;
  int D.28855;
  unsigned int D.28856;
  short unsigned int D.28857;
  int D.28858;
  struct MonoMethod * D.28861;
  _Bool D.28863;
  long int D.28864;
  long int D.28865;
  _Bool D.28870;
  long int D.28871;
  long int D.28872;
  int D.28879;
  unsigned int D.28880;
  unsigned int D.28881;
  struct MonoClass * D.28882;
  struct MonoImage * D.28883;
  unsigned int i.320;
  unsigned int D.28885;
  struct MonoMarshalSpec * * D.28886;
  struct MonoMarshalSpec * D.28887;
  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.28691 = method == 0B;
      D.28692 = (long int) D.28691;
      D.28693 = __builtin_expect (D.28692, 0);
      if (D.28693 != 0) goto <D.28694>; else goto <D.28695>;
      <D.28694>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8859, "method != NULL");
      <D.28695>:
      D.28696 = mono_method_signature (method);
      D.28697 = BIT_FIELD_REF <*D.28696, 8, 88>;
      D.28698 = D.28697 & 1;
      D.28699 = D.28698 == 0;
      D.28700 = (long int) D.28699;
      D.28701 = __builtin_expect (D.28700, 0);
      if (D.28701 != 0) goto <D.28702>; else goto <D.28703>;
      <D.28702>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8860, "mono_method_signature (method)->pinvoke");
      <D.28703>:
      if (aot != 0) goto <D.28704>; else goto <D.28705>;
      <D.28704>:
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      D.28708 = &D.28707->native_wrapper_aot_cache;
      cache = get_cache (D.28708, mono_aligned_addr_hash, 0B);
      goto <D.28709>;
      <D.28705>:
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      D.28710 = &D.28707->native_wrapper_cache;
      cache = get_cache (D.28710, mono_aligned_addr_hash, 0B);
      <D.28709>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.28711>; else goto <D.28712>;
      <D.28711>:
      D.28713 = res;
      return D.28713;
      <D.28712>:
      D.28706 = method->klass;
      D.28714 = D.28706->flags;
      D.28715 = D.28714 & 4096;
      if (D.28715 != 0) goto <D.28716>; else goto <D.28717>;
      <D.28716>:
      D.28713 = mono_cominterop_get_native_wrapper (method);
      return D.28713;
      <D.28717>:
      sig = mono_method_signature (method);
      D.28718 = method->iflags;
      D.28719 = (int) D.28718;
      D.28720 = D.28719 & 4096;
      if (D.28720 == 0) goto <D.28721>; else goto <D.28722>;
      <D.28721>:
      D.28723 = method->flags;
      D.28724 = (int) D.28723;
      D.28725 = D.28724 & 8192;
      if (D.28725 != 0) goto <D.28726>; else goto <D.28727>;
      <D.28726>:
      pinvoke = 1;
      <D.28727>:
      <D.28722>:
      D.28728 = piinfo->addr;
      if (D.28728 == 0B) goto <D.28729>; else goto <D.28730>;
      <D.28729>:
      if (pinvoke != 0) goto <D.28731>; else goto <D.28732>;
      <D.28731>:
      D.28718 = method->iflags;
      D.28719 = (int) D.28718;
      D.28733 = D.28719 & 1;
      if (D.28733 != 0) goto <D.28734>; else goto <D.28735>;
      <D.28734>:
      exc_arg = "Method contains unsupported native code";
      goto <D.28736>;
      <D.28735>:
      if (aot == 0) goto <D.28737>; else goto <D.28738>;
      <D.28737>:
      mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
      <D.28738>:
      <D.28736>:
      goto <D.28739>;
      <D.28732>:
      D.28740 = mono_lookup_internal_call (method);
      piinfo->addr = D.28740;
      <D.28739>:
      <D.28730>:
      D.28728 = piinfo->addr;
      if (D.28728 == ves_icall_System_String_ctor_RedirectToCreateString) goto <D.28741>; else goto <D.28742>;
      <D.28741>:
      D.28743 = pinvoke != 0;
      D.28744 = (long int) D.28743;
      D.28745 = __builtin_expect (D.28744, 0);
      if (D.28745 != 0) goto <D.28746>; else goto <D.28747>;
      <D.28746>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8896, "!pinvoke");
      <D.28747>:
      D.28748 = BIT_FIELD_REF <*method, 8, 160>;
      D.28749 = (signed char) D.28748;
      D.28750 = D.28749 >= 0;
      D.28751 = (long int) D.28750;
      D.28752 = __builtin_expect (D.28751, 0);
      if (D.28752 != 0) goto <D.28753>; else goto <D.28754>;
      <D.28753>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8897, "method->string_ctor");
      <D.28754>:
      D.28755 = BIT_FIELD_REF <*sig, 8, 80>;
      D.28756 = D.28755 & 64;
      D.28757 = D.28756 == 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", 8898, "sig->hasthis");
      <D.28761>:
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      csig = signature_dup (D.28707, sig);
      D.28762 = mono_defaults.string_class;
      D.28763 = &D.28762->byval_arg;
      csig->ret = D.28763;
      csig->pinvoke = 0;
      iter = 0B;
      goto <D.23049>;
      <D.23048>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = res->name;
          D.28767 = "CreateString";
          D.28768 = MEM[(const unsigned char *)D.28767];
          D.28769 = (int) D.28768;
          D.28770 = *__s2;
          D.28771 = (int) D.28770;
          __result = D.28769 - D.28771;
          {
            D.28772 = __s1_len != 0;
            D.28773 = __result == 0;
            D.28774 = D.28772 & D.28773;
            if (D.28774 != 0) goto <D.28775>; else goto <D.28776>;
            <D.28775>:
            D.28777 = &MEM[(void *)"CreateString" + 1B];
            D.28778 = *D.28777;
            D.28779 = (int) D.28778;
            D.28780 = __s2 + 1;
            D.28781 = *D.28780;
            D.28782 = (int) D.28781;
            __result = D.28779 - D.28782;
            D.28783 = __s1_len > 1;
            D.28773 = __result == 0;
            D.28784 = D.28783 & D.28773;
            if (D.28784 != 0) goto <D.28785>; else goto <D.28786>;
            <D.28785>:
            D.28787 = &MEM[(void *)"CreateString" + 2B];
            D.28788 = *D.28787;
            D.28789 = (int) D.28788;
            D.28790 = __s2 + 2;
            D.28791 = *D.28790;
            D.28792 = (int) D.28791;
            __result = D.28789 - D.28792;
            D.28793 = __s1_len > 2;
            D.28773 = __result == 0;
            D.28794 = D.28793 & D.28773;
            if (D.28794 != 0) goto <D.28795>; else goto <D.28796>;
            <D.28795>:
            D.28797 = &MEM[(void *)"CreateString" + 3B];
            D.28798 = *D.28797;
            D.28799 = (int) D.28798;
            D.28800 = __s2 + 3;
            D.28801 = *D.28800;
            D.28802 = (int) D.28801;
            __result = D.28799 - D.28802;
            <D.28796>:
            <D.28786>:
            <D.28776>:
          }
          D.23039 = __result;
        }
        iftmp.315 = D.23039;
        goto <D.28803>;
        <D.28766>:
        D.28804 = res->name;
        iftmp.315 = __builtin_strcmp ("CreateString", D.28804);
        <D.28803>:
        D.23043 = iftmp.315;
      }
      if (D.23043 == 0) goto <D.28805>; else goto <D.28806>;
      <D.28805>:
      D.28807 = mono_method_signature (res);
      D.28808 = mono_metadata_signature_equal (csig, D.28807);
      if (D.28808 != 0) goto <D.28809>; else goto <D.28810>;
      <D.28809>:
      {
        struct WrapperInfo * info;

        D.28811 = res->iflags;
        D.28812 = (int) D.28811;
        D.28813 = D.28812 & 4096;
        D.28814 = D.28813 != 0;
        D.28815 = (long int) D.28814;
        D.28816 = __builtin_expect (D.28815, 0);
        if (D.28816 != 0) goto <D.28817>; else goto <D.28818>;
        <D.28817>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8911, "!(res->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)");
        <D.28818>:
        D.28819 = res->flags;
        D.28820 = (int) D.28819;
        D.28821 = D.28820 & 8192;
        D.28822 = D.28821 != 0;
        D.28823 = (long int) D.28822;
        D.28824 = __builtin_expect (D.28823, 0);
        if (D.28824 != 0) goto <D.28825>; else goto <D.28826>;
        <D.28825>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8912, "!(res->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)");
        <D.28826>:
        D.28706 = method->klass;
        D.28827 = method->name;
        mb = mono_mb_new (D.28706, D.28827, 7);
        mono_mb_emit_byte (mb, 2);
        i = 1;
        goto <D.23046>;
        <D.23045>:
        i.316 = (unsigned int) i;
        mono_mb_emit_ldarg (mb, i.316);
        i = i + 1;
        <D.23046>:
        D.28829 = csig->param_count;
        D.28830 = (int) D.28829;
        if (D.28830 >= i) goto <D.23045>; else goto <D.23047>;
        <D.23047>:
        mono_mb_emit_managed_call (mb, res, 0B);
        mono_mb_emit_byte (mb, 42);
        D.28829 = csig->param_count;
        D.28830 = (int) D.28829;
        D.28831 = D.28830 + 1;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.28831);
        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.28713 = res;
        return D.28713;
      }
      <D.28810>:
      <D.28806>:
      <D.23049>:
      D.28762 = mono_defaults.string_class;
      res = mono_class_get_methods (D.28762, &iter);
      if (res != 0B) goto <D.23048>; else goto <D.23050>;
      <D.23050>:
      piinfo->addr = 0B;
      monoeg_g_log (0B, 16, "cannot find CreateString for .ctor");
      <D.28742>:
      D.28706 = method->klass;
      D.28827 = method->name;
      mb = mono_mb_new (D.28706, D.28827, 6);
      D.28832 = mb->method;
      D.28832->save_lmf = 1;
      D.28728 = piinfo->addr;
      if (D.28728 == 0B) goto <D.28833>; else goto <D.28834>;
      <D.28833>:
      if (aot == 0) goto <D.28835>; else goto <D.28836>;
      <D.28835>:
      exc_class.317 = exc_class;
      exc_arg.318 = exc_arg;
      mono_mb_emit_exception (mb, exc_class.317, exc_arg.318);
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      csig = signature_dup (D.28707, sig);
      csig->pinvoke = 0;
      D.28829 = csig->param_count;
      D.28830 = (int) D.28829;
      D.28839 = D.28830 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.28839);
      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.28713 = res;
      return D.28713;
      <D.28836>:
      <D.28834>:
      D.28718 = method->iflags;
      D.28719 = (int) D.28718;
      D.28840 = D.28719 & 4099;
      if (D.28840 != 0) goto <D.28841>; else goto <D.28842>;
      <D.28841>:
      D.28755 = BIT_FIELD_REF <*sig, 8, 80>;
      D.28756 = D.28755 & 64;
      if (D.28756 != 0) goto <D.28843>; else goto <D.28844>;
      <D.28843>:
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      D.28706 = method->klass;
      csig = signature_dup_add_this (D.28707, sig, D.28706);
      goto <D.28845>;
      <D.28844>:
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      csig = signature_dup (D.28707, sig);
      <D.28845>:
      D.28748 = BIT_FIELD_REF <*method, 8, 160>;
      D.28846 = D.28748 & 128;
      if (D.28846 != 0) goto <D.28847>; else goto <D.28848>;
      <D.28847>:
      D.28762 = mono_defaults.string_class;
      D.28763 = &D.28762->byval_arg;
      csig->ret = D.28763;
      <D.28848>:
      D.28755 = BIT_FIELD_REF <*sig, 8, 80>;
      D.28756 = D.28755 & 64;
      if (D.28756 != 0) goto <D.28849>; else goto <D.28850>;
      <D.28849>:
      {
        int pos;

        mono_mb_emit_byte (mb, 2);
        D.28851 = mono_mb_emit_branch (mb, 58);
        pos = (int) D.28851;
        mono_mb_emit_exception (mb, "NullReferenceException", 0B);
        pos.319 = (unsigned int) pos;
        mono_mb_patch_branch (mb, pos.319);
        mono_mb_emit_byte (mb, 2);
      }
      <D.28850>:
      i = 0;
      goto <D.23053>;
      <D.23052>:
      D.28853 = sig->hasthis;
      D.28854 = (int) D.28853;
      D.28855 = D.28854 + i;
      D.28856 = (unsigned int) D.28855;
      mono_mb_emit_ldarg (mb, D.28856);
      i = i + 1;
      <D.23053>:
      D.28857 = sig->param_count;
      D.28858 = (int) D.28857;
      if (D.28858 > i) goto <D.23052>; else goto <D.23054>;
      <D.23054>:
      if (aot != 0) goto <D.28859>; else goto <D.28860>;
      <D.28859>:
      mono_mb_emit_byte (mb, 240);
      D.28861 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.28861);
      mono_mb_emit_calli (mb, csig);
      goto <D.28862>;
      <D.28860>:
      D.28728 = piinfo->addr;
      D.28863 = D.28728 == 0B;
      D.28864 = (long int) D.28863;
      D.28865 = __builtin_expect (D.28864, 0);
      if (D.28865 != 0) goto <D.28866>; else goto <D.28867>;
      <D.28866>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9005, "piinfo->addr");
      <D.28867>:
      D.28728 = piinfo->addr;
      mono_mb_emit_native_call (mb, csig, D.28728);
      <D.28862>:
      if (check_exceptions != 0) goto <D.28868>; else goto <D.28869>;
      <D.28868>:
      emit_thread_interrupt_checkpoint (mb);
      <D.28869>:
      mono_mb_emit_byte (mb, 42);
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      csig = signature_dup (D.28707, csig);
      csig->pinvoke = 0;
      D.28829 = csig->param_count;
      D.28830 = (int) D.28829;
      D.28839 = D.28830 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.28839);
      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.28713 = res;
      return D.28713;
      <D.28842>:
      D.28870 = pinvoke == 0;
      D.28871 = (long int) D.28870;
      D.28872 = __builtin_expect (D.28871, 0);
      if (D.28872 != 0) goto <D.28873>; else goto <D.28874>;
      <D.28873>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9026, "pinvoke");
      <D.28874>:
      if (aot == 0) goto <D.28875>; else goto <D.28876>;
      <D.28875>:
      D.28728 = piinfo->addr;
      D.28863 = D.28728 == 0B;
      D.28864 = (long int) D.28863;
      D.28865 = __builtin_expect (D.28864, 0);
      if (D.28865 != 0) goto <D.28877>; else goto <D.28878>;
      <D.28877>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9028, "piinfo->addr");
      <D.28878>:
      <D.28876>:
      D.28857 = sig->param_count;
      D.28858 = (int) D.28857;
      D.28879 = D.28858 + 1;
      D.28880 = (unsigned int) D.28879;
      D.28881 = D.28880 * 4;
      mspecs = monoeg_malloc (D.28881);
      mono_method_get_marshal_info (method, mspecs);
      D.28832 = mb->method;
      D.28882 = D.28832->klass;
      D.28883 = D.28882->image;
      D.28728 = piinfo->addr;
      mono_marshal_emit_native_wrapper (D.28883, mb, sig, piinfo, mspecs, D.28728, aot, check_exceptions, 0);
      D.28706 = method->klass;
      D.28707 = D.28706->image;
      csig = signature_dup (D.28707, sig);
      csig->pinvoke = 0;
      D.28829 = csig->param_count;
      D.28830 = (int) D.28829;
      D.28839 = D.28830 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.28839);
      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.28857 = sig->param_count;
      i = (int) D.28857;
      goto <D.23056>;
      <D.23055>:
      i.320 = (unsigned int) i;
      D.28885 = i.320 * 4;
      D.28886 = mspecs + D.28885;
      D.28887 = *D.28886;
      if (D.28887 != 0B) goto <D.28888>; else goto <D.28889>;
      <D.28888>:
      i.320 = (unsigned int) i;
      D.28885 = i.320 * 4;
      D.28886 = mspecs + D.28885;
      D.28887 = *D.28886;
      mono_metadata_free_marshal_spec (D.28887);
      <D.28889>:
      i = i + -1;
      <D.23056>:
      if (i >= 0) goto <D.23055>; else goto <D.23057>;
      <D.23057>:
      monoeg_g_free (mspecs);
      D.28713 = res;
      return D.28713;
    }
  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.28892;
  struct MonoMethod * D.28895;
  struct MonoClass * D.28896;
  struct MonoMethod * D.28897;
  short unsigned int D.28898;
  int D.28899;
  int D.28900;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;

  D.28892 = &image->native_wrapper_cache;
  cache = get_cache (D.28892, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, func);
  if (res != 0B) goto <D.28893>; else goto <D.28894>;
  <D.28893>:
  D.28895 = res;
  return D.28895;
  <D.28894>:
  name = monoeg_g_strdup_printf ("wrapper_native_%p", func);
  D.28896 = mono_defaults.object_class;
  mb = mono_mb_new (D.28896, name, 6);
  D.28897 = mb->method;
  D.28897->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.28898 = csig->param_count;
  D.28899 = (int) D.28898;
  D.28900 = D.28899 + 16;
  res = mono_mb_create_and_cache (cache, func, mb, csig, D.28900);
  mono_mb_free (mb);
  mono_marshal_set_wrapper_info (res, 0B);
  D.28895 = res;
  return D.28895;
}


mono_marshal_get_native_func_wrapper_aot (struct MonoClass * klass)
{
  struct MonoClass * D.28902;
  struct GHashTable * * D.28903;
  struct MonoMethod * D.28906;
  struct MonoMethodSignature * D.28907;
  short unsigned int D.28908;
  int D.28909;
  int D.28910;
  unsigned int D.28911;
  unsigned int D.28912;
  struct MonoMethodSignature * D.28913;
  struct MonoMethod * D.28914;
  unsigned char D.28915;
  unsigned char D.28916;
  _Bool D.28917;
  long int D.28918;
  long int D.28919;
  struct MonoClass * D.28922;
  short unsigned int D.28923;
  int D.28924;
  int D.28925;
  struct MonoMethodSignature * D.28926;
  short unsigned int D.28927;
  unsigned int i.321;
  unsigned int D.28929;
  struct MonoMarshalSpec * * D.28930;
  struct MonoMarshalSpec * D.28931;
  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.28902 = invoke->klass;
      image = D.28902->image;
      D.28903 = &image->native_func_wrapper_aot_cache;
      cache = get_cache (D.28903, mono_aligned_addr_hash, 0B);
      res = mono_marshal_find_in_cache (cache, invoke);
      if (res != 0B) goto <D.28904>; else goto <D.28905>;
      <D.28904>:
      D.28906 = res;
      return D.28906;
      <D.28905>:
      memset (&mpiinfo, 0, 32);
      parse_unmanaged_function_pointer_attr (klass, &mpiinfo);
      D.28907 = mono_method_signature (invoke);
      D.28908 = D.28907->param_count;
      D.28909 = (int) D.28908;
      D.28910 = D.28909 + 1;
      D.28911 = (unsigned int) D.28910;
      D.28912 = D.28911 * 4;
      mspecs = monoeg_malloc0 (D.28912);
      mono_method_get_marshal_info (invoke, mspecs);
      D.28913 = mono_method_signature (invoke);
      sig = mono_metadata_signature_dup (D.28913);
      sig->hasthis = 0;
      name = monoeg_g_strdup_printf ("wrapper_aot_native");
      D.28902 = invoke->klass;
      mb = mono_mb_new (D.28902, name, 6);
      D.28914 = mb->method;
      D.28914->save_lmf = 1;
      mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, 0B, 0, 1, 1);
      D.28915 = BIT_FIELD_REF <*sig, 8, 80>;
      D.28916 = D.28915 & 64;
      D.28917 = D.28916 != 0;
      D.28918 = (long int) D.28917;
      D.28919 = __builtin_expect (D.28918, 0);
      if (D.28919 != 0) goto <D.28920>; else goto <D.28921>;
      <D.28920>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9148, "!sig->hasthis");
      <D.28921>:
      D.28922 = mono_defaults.int_class;
      csig = signature_dup_add_this (image, sig, D.28922);
      csig->pinvoke = 0;
      D.28923 = csig->param_count;
      D.28924 = (int) D.28923;
      D.28925 = D.28924 + 16;
      res = mono_mb_create_and_cache (cache, invoke, mb, csig, D.28925);
      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.28926 = mono_method_signature (invoke);
      D.28927 = D.28926->param_count;
      i = (int) D.28927;
      goto <D.23087>;
      <D.23086>:
      i.321 = (unsigned int) i;
      D.28929 = i.321 * 4;
      D.28930 = mspecs + D.28929;
      D.28931 = *D.28930;
      if (D.28931 != 0B) goto <D.28932>; else goto <D.28933>;
      <D.28932>:
      i.321 = (unsigned int) i;
      D.28929 = i.321 * 4;
      D.28930 = mspecs + D.28929;
      D.28931 = *D.28930;
      mono_metadata_free_marshal_spec (D.28931);
      <D.28933>:
      i = i + -1;
      <D.23087>:
      if (i >= 0) goto <D.23086>; else goto <D.23088>;
      <D.23088>:
      monoeg_g_free (mspecs);
      monoeg_g_free (sig);
      D.28906 = res;
      return D.28906;
    }
  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.28936;
  struct MonoType * D.28937;
  struct MonoClass * D.28938;
  struct MonoType * D.28939;
  unsigned char D.28940;
  unsigned char D.28941;
  short unsigned int D.28944;
  short unsigned int D.28945;
  int D.28948;
  int D.28949;
  int D.28950;
  _Bool D.28951;
  long int D.28952;
  long int D.28953;
  struct MonoType * * D.28956;
  struct MonoType * * D.28957;
  int D.28958;
  unsigned int D.28959;
  unsigned int D.28960;
  short unsigned int D.28961;
  short unsigned int D.28962;
  struct MonoType * D.28963;
  int D.28964;
  unsigned int D.28967;
  unsigned int D.28968;
  unsigned char D.28969;
  int D.28970;
  unsigned int i.322;
  unsigned int D.28972;
  int * D.28973;
  struct MonoType * D.28974;
  sizetype i.323;
  sizetype D.28976;
  sizetype D.28977;
  struct MonoMarshalSpec * * D.28978;
  struct MonoMarshalSpec * D.28979;
  struct MonoType * * D.28980;
  int D.28981;
  int target_handle.324;
  int D.28991;
  unsigned char D.28994;
  unsigned char D.28995;
  unsigned int D.28998;
  unsigned int i.325;
  struct MonoMarshalSpec * D.29004;
  <unnamed type> D.29006;
  unsigned char D.29008;
  unsigned char D.29009;
  unsigned char D.29012;
  int D.29013;
  <unnamed type> D.29018;
  unsigned char D.29020;
  unsigned char D.29021;
  unsigned char D.29024;
  int D.29025;
  struct MonoType * D.29028;
  short unsigned int D.29029;
  int D.29030;
  int D.29031;
  int D.29034;
  unsigned int D.29037;
  struct MonoClass * D.29038;
  int D.29040;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  int i;
  int * tmp_locals;
  gboolean closed;

  closed = 0;
  sig = m->sig;
  csig = m->csig;
  D.28936 = mono_defaults.int_class;
  D.28937 = &D.28936->byval_arg;
  mono_mb_add_local (mb, D.28937);
  D.28936 = mono_defaults.int_class;
  D.28937 = &D.28936->byval_arg;
  mono_mb_add_local (mb, D.28937);
  D.28938 = mono_defaults.boolean_class;
  D.28939 = &D.28938->byval_arg;
  mono_mb_add_local (mb, D.28939);
  D.28940 = BIT_FIELD_REF <*sig, 8, 80>;
  D.28941 = D.28940 & 64;
  if (D.28941 == 0) goto <D.28942>; else goto <D.28943>;
  <D.28942>:
  D.28944 = sig->param_count;
  D.28945 = invoke_sig->param_count;
  if (D.28944 != D.28945) goto <D.28946>; else goto <D.28947>;
  <D.28946>:
  D.28944 = sig->param_count;
  D.28948 = (int) D.28944;
  D.28945 = invoke_sig->param_count;
  D.28949 = (int) D.28945;
  D.28950 = D.28949 + 1;
  D.28951 = D.28948 != D.28950;
  D.28952 = (long int) D.28951;
  D.28953 = __builtin_expect (D.28952, 0);
  if (D.28953 != 0) goto <D.28954>; else goto <D.28955>;
  <D.28954>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9229, "sig->param_count == invoke_sig->param_count + 1");
  <D.28955>:
  closed = 1;
  sig = mono_metadata_signature_dup (sig);
  D.28956 = &sig->params[0];
  D.28957 = &sig->params[1];
  D.28944 = sig->param_count;
  D.28948 = (int) D.28944;
  D.28958 = D.28948 + -1;
  D.28959 = (unsigned int) D.28958;
  D.28960 = D.28959 * 4;
  memmove (D.28956, D.28957, D.28960);
  D.28944 = sig->param_count;
  D.28961 = D.28944;
  D.28962 = D.28961 + 65535;
  sig->param_count = D.28962;
  <D.28947>:
  <D.28943>:
  D.28963 = sig->ret;
  D.28964 = mono_type_is_void (D.28963);
  if (D.28964 == 0) goto <D.28965>; else goto <D.28966>;
  <D.28965>:
  D.28963 = sig->ret;
  mono_mb_add_local (mb, D.28963);
  <D.28966>:
  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.28944 = sig->param_count;
  D.28967 = (unsigned int) D.28944;
  D.28968 = D.28967 * 4;
  tmp_locals = __builtin_alloca (D.28968);
  i = 0;
  goto <D.23113>;
  <D.23112>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.28969 = t->type;
    D.28970 = (int) D.28969;
    switch (D.28970) <default: <D.23111>, case 2: <D.23109>, case 14: <D.23108>, case 17: <D.23105>, case 18: <D.23104>, case 20: <D.23106>, case 28: <D.23103>, case 29: <D.23107>>
    <D.23103>:
    <D.23104>:
    <D.23105>:
    <D.23106>:
    <D.23107>:
    <D.23108>:
    <D.23109>:
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28974 = sig->params[i];
    i.323 = (sizetype) i;
    D.28976 = i.323 + 1;
    D.28977 = D.28976 * 4;
    D.28978 = mspecs + D.28977;
    D.28979 = *D.28978;
    D.28980 = &csig->params[i];
    D.28981 = emit_marshal (m, i, D.28974, D.28979, 0, D.28980, 4);
    *D.28973 = D.28981;
    goto <D.23110>;
    <D.23111>:
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    *D.28973 = 0;
    goto <D.23110>;
    <D.23110>:
  }
  i = i + 1;
  <D.23113>:
  D.28944 = sig->param_count;
  D.28948 = (int) D.28944;
  if (D.28948 > i) goto <D.23112>; else goto <D.23114>;
  <D.23114>:
  emit_thread_interrupt_checkpoint (mb);
  D.28940 = BIT_FIELD_REF <*sig, 8, 80>;
  D.28941 = D.28940 & 64;
  if (D.28941 != 0) goto <D.28982>; else goto <D.28983>;
  <D.28982>:
  if (target_handle != 0) goto <D.28984>; else goto <D.28985>;
  <D.28984>:
  target_handle.324 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.324);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  goto <D.28987>;
  <D.28985>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9282);
  <D.28987>:
  goto <D.28988>;
  <D.28983>:
  if (closed != 0) goto <D.28989>; else goto <D.28990>;
  <D.28989>:
  target_handle.324 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.324);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  <D.28990>:
  <D.28988>:
  i = 0;
  goto <D.23117>;
  <D.23116>:
  {
    struct MonoType * t;

    t = sig->params[i];
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    if (D.28991 != 0) goto <D.28992>; else goto <D.28993>;
    <D.28992>:
    D.28994 = BIT_FIELD_REF <*t, 8, 56>;
    D.28995 = D.28994 & 64;
    if (D.28995 != 0) goto <D.28996>; else goto <D.28997>;
    <D.28996>:
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    D.28998 = (unsigned int) D.28991;
    mono_mb_emit_ldloc_addr (mb, D.28998);
    goto <D.28999>;
    <D.28997>:
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    D.28998 = (unsigned int) D.28991;
    mono_mb_emit_ldloc (mb, D.28998);
    <D.28999>:
    goto <D.29000>;
    <D.28993>:
    i.325 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.325);
    <D.29000>:
  }
  i = i + 1;
  <D.23117>:
  D.28944 = sig->param_count;
  D.28948 = (int) D.28944;
  if (D.28948 > i) goto <D.23116>; else goto <D.23118>;
  <D.23118>:
  mono_mb_emit_managed_call (mb, method, 0B);
  D.29004 = *mspecs;
  if (D.29004 != 0B) goto <D.29005>; else goto <D.29002>;
  <D.29005>:
  D.29004 = *mspecs;
  D.29006 = D.29004->native;
  if (D.29006 == 44) goto <D.29007>; else goto <D.29002>;
  <D.29007>:
  D.28963 = sig->ret;
  D.29004 = *mspecs;
  emit_marshal (m, 0, D.28963, D.29004, 0, 0B, 6);
  goto <D.29003>;
  <D.29002>:
  D.28963 = sig->ret;
  D.29008 = BIT_FIELD_REF <*D.28963, 8, 56>;
  D.29009 = D.29008 & 64;
  if (D.29009 == 0) goto <D.29010>; else goto <D.29011>;
  <D.29010>:
  D.28963 = sig->ret;
  D.29012 = D.28963->type;
  D.29013 = (int) D.29012;
  switch (D.29013) <default: <D.23141>, case 1: <D.23119>, case 2: <D.23121>, case 3: <D.23124>, case 4: <D.23122>, case 5: <D.23123>, case 6: <D.23125>, case 7: <D.23126>, case 8: <D.23127>, case 9: <D.23128>, case 10: <D.23134>, case 11: <D.23135>, case 12: <D.23132>, case 13: <D.23133>, case 14: <D.23137>, case 15: <D.23131>, case 17: <D.23138>, case 18: <D.23139>, case 24: <D.23129>, case 25: <D.23130>, case 28: <D.23136>, case 29: <D.23140>>
  <D.23119>:
  goto <D.23120>;
  <D.23121>:
  <D.23122>:
  <D.23123>:
  <D.23124>:
  <D.23125>:
  <D.23126>:
  <D.23127>:
  <D.23128>:
  <D.23129>:
  <D.23130>:
  <D.23131>:
  <D.23132>:
  <D.23133>:
  <D.23134>:
  <D.23135>:
  <D.23136>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.23120>;
  <D.23137>:
  D.28936 = mono_defaults.int_class;
  D.28937 = &D.28936->byval_arg;
  csig->ret = D.28937;
  D.28963 = sig->ret;
  D.29004 = *mspecs;
  emit_marshal (m, 0, D.28963, D.29004, 0, 0B, 6);
  goto <D.23120>;
  <D.23138>:
  <D.23139>:
  <D.23140>:
  D.28963 = sig->ret;
  D.29004 = *mspecs;
  emit_marshal (m, 0, D.28963, D.29004, 0, 0B, 6);
  goto <D.23120>;
  <D.23141>:
  D.28963 = sig->ret;
  D.29012 = D.28963->type;
  D.29013 = (int) D.29012;
  monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.29013);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9339);
  <D.23120>:
  goto <D.29014>;
  <D.29011>:
  mono_mb_emit_stloc (mb, 3);
  <D.29014>:
  <D.29003>:
  i = 0;
  goto <D.23156>;
  <D.23155>:
  {
    struct MonoType * t;
    struct MonoMarshalSpec * spec;

    t = sig->params[i];
    i.323 = (sizetype) i;
    D.28976 = i.323 + 1;
    D.28977 = D.28976 * 4;
    D.28978 = mspecs + D.28977;
    spec = *D.28978;
    if (spec != 0B) goto <D.29017>; else goto <D.29015>;
    <D.29017>:
    D.29018 = spec->native;
    if (D.29018 == 44) goto <D.29019>; else goto <D.29015>;
    <D.29019>:
    i.323 = (sizetype) i;
    D.28976 = i.323 + 1;
    D.28977 = D.28976 * 4;
    D.28978 = mspecs + D.28977;
    D.28979 = *D.28978;
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    emit_marshal (m, i, t, D.28979, D.28991, 0B, 5);
    goto <D.29016>;
    <D.29015>:
    D.29020 = BIT_FIELD_REF <*t, 8, 56>;
    D.29021 = D.29020 & 64;
    if (D.29021 != 0) goto <D.29022>; else goto <D.29023>;
    <D.29022>:
    D.29024 = t->type;
    D.29025 = (int) D.29024;
    switch (D.29025) <default: <D.29026>, case 2: <D.23148>, case 14: <D.23147>, case 17: <D.23145>, case 18: <D.23144>, case 28: <D.23146>>
    <D.23144>:
    <D.23145>:
    <D.23146>:
    <D.23147>:
    <D.23148>:
    i.323 = (sizetype) i;
    D.28976 = i.323 + 1;
    D.28977 = D.28976 * 4;
    D.28978 = mspecs + D.28977;
    D.28979 = *D.28978;
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    emit_marshal (m, i, t, D.28979, D.28991, 0B, 5);
    goto <D.23149>;
    <D.29026>:
    <D.23149>:
    goto <D.29027>;
    <D.29023>:
    D.29028 = invoke_sig->params[i];
    D.29029 = D.29028->attrs;
    D.29030 = (int) D.29029;
    D.29031 = D.29030 & 2;
    if (D.29031 != 0) goto <D.29032>; else goto <D.29033>;
    <D.29032>:
    D.29024 = t->type;
    D.29025 = (int) D.29024;
    switch (D.29025) <default: <D.23154>, case 17: <D.23152>, case 18: <D.23151>, case 29: <D.23150>>
    <D.23150>:
    <D.23151>:
    <D.23152>:
    D.29028 = invoke_sig->params[i];
    i.323 = (sizetype) i;
    D.28976 = i.323 + 1;
    D.28977 = D.28976 * 4;
    D.28978 = mspecs + D.28977;
    D.28979 = *D.28978;
    i.322 = (unsigned int) i;
    D.28972 = i.322 * 4;
    D.28973 = tmp_locals + D.28972;
    D.28991 = *D.28973;
    emit_marshal (m, i, D.29028, D.28979, D.28991, 0B, 5);
    goto <D.23153>;
    <D.23154>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9373);
    <D.23153>:
    <D.29033>:
    <D.29027>:
    <D.29016>:
  }
  i = i + 1;
  <D.23156>:
  D.28944 = sig->param_count;
  D.28948 = (int) D.28944;
  if (D.28948 > i) goto <D.23155>; else goto <D.23157>;
  <D.23157>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 18);
  D.29034 = m->retobj_var;
  if (D.29034 != 0) goto <D.29035>; else goto <D.29036>;
  <D.29035>:
  D.29034 = m->retobj_var;
  D.29037 = (unsigned int) D.29034;
  mono_mb_emit_ldloc (mb, D.29037);
  mono_mb_emit_byte (mb, 240);
  D.29038 = m->retobj_class;
  mono_mb_emit_op (mb, 5, D.29038);
  goto <D.29039>;
  <D.29036>:
  D.28963 = sig->ret;
  D.29040 = mono_type_is_void (D.28963);
  if (D.29040 == 0) goto <D.29041>; else goto <D.29042>;
  <D.29041>:
  mono_mb_emit_ldloc (mb, 3);
  <D.29042>:
  mono_mb_emit_byte (mb, 42);
  <D.29039>:
  if (closed != 0) goto <D.29043>; else goto <D.29044>;
  <D.29043>:
  monoeg_g_free (sig);
  <D.29044>:
}


memmove (void * __dest, const void * __src, size_t __len)
{
  void * D.29048;
  unsigned int D.29049;

  D.29049 = __builtin_object_size (__dest, 0);
  D.29048 = __builtin___memmove_chk (__dest, __src, __len, D.29049);
  return D.29048;
}


mono_marshal_get_managed_wrapper (struct MonoMethod * method, struct MonoClass * delegate_klass, uint32_t target_handle)
{
  _Bool D.29051;
  long int D.29052;
  long int D.29053;
  struct MonoMethodSignature * D.29056;
  unsigned char D.29057;
  unsigned char D.29058;
  _Bool D.29059;
  long int D.29060;
  long int D.29061;
  struct MonoClass * D.29064;
  struct MonoImage * D.29065;
  struct GHashTable * * D.29066;
  struct MonoMethod * D.29071;
  struct MonoMethodSignature * D.29072;
  short unsigned int D.29073;
  int D.29074;
  int D.29075;
  unsigned int D.29076;
  unsigned int D.29077;
  const char * D.29078;
  void * target_handle.326;
  struct MonoClass * UnmanagedFunctionPointerAttribute.327;
  struct MonoImage * D.29086;
  struct MonoClass * UnmanagedFunctionPointerAttribute.328;
  struct MonoMethod * D.29092;
  int D.29093;
  int D.29096;
  struct MonoMethod * D.29099;
  const mono_byte * D.29100;
  unsigned int D.29101;
  int D.29102;
  _Bool D.29103;
  long int D.29104;
  long int D.29105;
  struct MonoArray * typed_args.329;
  unsigned int D.29109;
  _Bool D.29110;
  long int D.29111;
  long int D.29112;
  char * D.29115;
  void * D.29116;
  struct CattrNamedArg * arginfo.330;
  unsigned int i.331;
  unsigned int D.29119;
  struct MonoArray * named_args.332;
  unsigned int i.333;
  char * D.29122;
  struct MonoClassField * D.29123;
  _Bool D.29124;
  long int D.29125;
  long int D.29126;
  int D.23255;
  int iftmp.334;
  int D.23254;
  const char[8] * D.29132;
  unsigned char D.29133;
  int D.29134;
  unsigned char D.29135;
  int D.29136;
  _Bool D.29137;
  _Bool D.29138;
  _Bool D.29139;
  const unsigned char * D.29142;
  unsigned char D.29143;
  int D.29144;
  const unsigned char * D.29145;
  unsigned char D.29146;
  int D.29147;
  _Bool D.29148;
  _Bool D.29149;
  const unsigned char * D.29152;
  unsigned char D.29153;
  int D.29154;
  const unsigned char * D.29155;
  unsigned char D.29156;
  int D.29157;
  _Bool D.29158;
  _Bool D.29159;
  const unsigned char * D.29162;
  unsigned char D.29163;
  int D.29164;
  const unsigned char * D.29165;
  unsigned char D.29166;
  int D.29167;
  const char * D.29169;
  void * D.29172;
  int D.23264;
  int iftmp.335;
  int D.23263;
  const char[13] * D.29177;
  unsigned char D.29178;
  int D.29179;
  unsigned char D.29180;
  int D.29181;
  _Bool D.29182;
  _Bool D.29183;
  _Bool D.29184;
  const unsigned char * D.29187;
  unsigned char D.29188;
  int D.29189;
  const unsigned char * D.29190;
  unsigned char D.29191;
  int D.29192;
  _Bool D.29193;
  _Bool D.29194;
  const unsigned char * D.29197;
  unsigned char D.29198;
  int D.29199;
  const unsigned char * D.29200;
  unsigned char D.29201;
  int D.29202;
  _Bool D.29203;
  _Bool D.29204;
  const unsigned char * D.29207;
  unsigned char D.29208;
  int D.29209;
  const unsigned char * D.29210;
  unsigned char D.29211;
  int D.29212;
  void * D.29216;
  int D.23273;
  int iftmp.336;
  int D.23272;
  const char[15] * D.29221;
  unsigned char D.29222;
  int D.29223;
  unsigned char D.29224;
  int D.29225;
  _Bool D.29226;
  _Bool D.29227;
  _Bool D.29228;
  const unsigned char * D.29231;
  unsigned char D.29232;
  int D.29233;
  const unsigned char * D.29234;
  unsigned char D.29235;
  int D.29236;
  _Bool D.29237;
  _Bool D.29238;
  const unsigned char * D.29241;
  unsigned char D.29242;
  int D.29243;
  const unsigned char * D.29244;
  unsigned char D.29245;
  int D.29246;
  _Bool D.29247;
  _Bool D.29248;
  const unsigned char * D.29251;
  unsigned char D.29252;
  int D.29253;
  const unsigned char * D.29254;
  unsigned char D.29255;
  int D.29256;
  void * D.29260;
  int D.23282;
  int iftmp.337;
  int D.23281;
  const char[22] * D.29265;
  unsigned char D.29266;
  int D.29267;
  unsigned char D.29268;
  int D.29269;
  _Bool D.29270;
  _Bool D.29271;
  _Bool D.29272;
  const unsigned char * D.29275;
  unsigned char D.29276;
  int D.29277;
  const unsigned char * D.29278;
  unsigned char D.29279;
  int D.29280;
  _Bool D.29281;
  _Bool D.29282;
  const unsigned char * D.29285;
  unsigned char D.29286;
  int D.29287;
  const unsigned char * D.29288;
  unsigned char D.29289;
  int D.29290;
  _Bool D.29291;
  _Bool D.29292;
  const unsigned char * D.29295;
  unsigned char D.29296;
  int D.29297;
  const unsigned char * D.29298;
  unsigned char D.29299;
  int D.29300;
  void * D.29304;
  unsigned int D.29306;
  int D.29307;
  signed short D.29308;
  signed short iftmp.338;
  int D.29312;
  unsigned short D.29313;
  unsigned short D.29314;
  signed short D.29316;
  signed short D.29317;
  signed short D.29318;
  short unsigned int D.29319;
  unsigned char D.29320;
  unsigned char D.29321;
  <unnamed-unsigned:6> D.29322;
  int D.29325;
  short unsigned int D.29330;
  int D.29331;
  int D.29332;
  struct MonoMethodSignature * D.29334;
  short unsigned int D.29335;
  unsigned int D.29336;
  struct MonoMarshalSpec * * D.29337;
  struct MonoMarshalSpec * D.29338;
  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.29051 = method == 0B;
      D.29052 = (long int) D.29051;
      D.29053 = __builtin_expect (D.29052, 0);
      if (D.29053 != 0) goto <D.29054>; else goto <D.29055>;
      <D.29054>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9450, "method != NULL");
      <D.29055>:
      D.29056 = mono_method_signature (method);
      D.29057 = BIT_FIELD_REF <*D.29056, 8, 88>;
      D.29058 = D.29057 & 1;
      D.29059 = D.29058 != 0;
      D.29060 = (long int) D.29059;
      D.29061 = __builtin_expect (D.29060, 0);
      if (D.29061 != 0) goto <D.29062>; else goto <D.29063>;
      <D.29062>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9451, "!mono_method_signature (method)->pinvoke");
      <D.29063>:
      D.29064 = method->klass;
      D.29065 = D.29064->image;
      D.29066 = &D.29065->managed_wrapper_cache;
      cache = get_cache (D.29066, mono_aligned_addr_hash, 0B);
      if (target_handle == 0) goto <D.29067>; else goto <D.29068>;
      <D.29067>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.29069>; else goto <D.29070>;
      <D.29069>:
      D.29071 = res;
      return D.29071;
      <D.29070>:
      <D.29068>:
      invoke = mono_get_delegate_invoke (delegate_klass);
      invoke_sig = mono_method_signature (invoke);
      D.29072 = mono_method_signature (invoke);
      D.29073 = D.29072->param_count;
      D.29074 = (int) D.29073;
      D.29075 = D.29074 + 1;
      D.29076 = (unsigned int) D.29075;
      D.29077 = D.29076 * 4;
      mspecs = monoeg_malloc0 (D.29077);
      mono_method_get_marshal_info (invoke, mspecs);
      sig = mono_method_signature (method);
      D.29064 = method->klass;
      D.29078 = method->name;
      mb = mono_mb_new (D.29064, D.29078, 5);
      target_handle.326 = (void *) target_handle;
      mono_mb_add_data (mb, target_handle.326);
      if (target_handle != 0) goto <D.29080>; else goto <D.29081>;
      <D.29080>:
      csig = mono_metadata_signature_dup (invoke_sig);
      goto <D.29082>;
      <D.29081>:
      D.29064 = method->klass;
      D.29065 = D.29064->image;
      csig = signature_dup (D.29065, invoke_sig);
      <D.29082>:
      csig->hasthis = 0;
      csig->pinvoke = 1;
      m.mb = mb;
      m.sig = sig;
      m.piinfo = 0B;
      m.retobj_var = 0;
      m.csig = csig;
      D.29064 = method->klass;
      D.29065 = D.29064->image;
      m.image = D.29065;
      mono_marshal_set_callconv_from_modopt (invoke, csig);
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 == 0B) goto <D.29084>; else goto <D.29085>;
      <D.29084>:
      D.29086 = mono_defaults.corlib;
      UnmanagedFunctionPointerAttribute.328 = mono_class_from_name (D.29086, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
      UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.328;
      <D.29085>:
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 != 0B) goto <D.29088>; else goto <D.29089>;
      <D.29088>:
      {
        struct MonoCustomAttrInfo * cinfo;
        struct MonoCustomAttrEntry * attr;

        cinfo = mono_custom_attrs_from_class (delegate_klass);
        attr = 0B;
        if (cinfo != 0B) goto <D.29090>; else goto <D.29091>;
        <D.29090>:
        i = 0;
        goto <D.23235>;
        <D.23234>:
        {
          struct MonoClass * ctor_class;

          D.29092 = cinfo->attrs[i].ctor;
          ctor_class = D.29092->klass;
          UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
          D.29093 = mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute.327);
          if (D.29093 != 0) goto <D.29094>; else goto <D.29095>;
          <D.29094>:
          attr = &cinfo->attrs[i];
          goto <D.23233>;
          <D.29095>:
        }
        i = i + 1;
        <D.23235>:
        D.29096 = cinfo->num_attrs;
        if (D.29096 > i) goto <D.23234>; else goto <D.23233>;
        <D.23233>:
        <D.29091>:
        if (attr != 0B) goto <D.29097>; else goto <D.29098>;
        <D.29097>:
        {
          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.29086 = mono_defaults.corlib;
              D.29099 = attr->ctor;
              D.29100 = attr->data;
              D.29101 = attr->data_size;
              mono_reflection_create_custom_attr_data_args (D.29086, D.29099, D.29100, D.29101, &typed_args, &named_args, &arginfo, &error);
              D.29102 = mono_error_ok (&error);
              D.29103 = D.29102 == 0;
              D.29104 = (long int) D.29103;
              D.29105 = __builtin_expect (D.29104, 0);
              if (D.29105 != 0) goto <D.29106>; else goto <D.29107>;
              <D.29106>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9530, "mono_error_ok (&error)");
              <D.29107>:
              typed_args.329 = typed_args;
              D.29109 = mono_array_length (typed_args.329);
              D.29110 = D.29109 != 1;
              D.29111 = (long int) D.29110;
              D.29112 = __builtin_expect (D.29111, 0);
              if (D.29112 != 0) goto <D.29113>; else goto <D.29114>;
              <D.29113>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9531, "mono_array_length (typed_args) == 1");
              <D.29114>:
              typed_args.329 = typed_args;
              D.29115 = mono_array_addr_with_size (typed_args.329, 4, 0);
              o = MEM[(struct MonoObject * *)D.29115];
              D.29116 = mono_object_unbox (o);
              call_conv = MEM[(gint32 *)D.29116];
              i = 0;
              goto <D.23284>;
              <D.23283>:
              {
                struct CattrNamedArg * narg;

                arginfo.330 = arginfo;
                i.331 = (unsigned int) i;
                D.29119 = i.331 * 12;
                narg = arginfo.330 + D.29119;
                named_args.332 = named_args;
                i.333 = (unsigned int) i;
                D.29122 = mono_array_addr_with_size (named_args.332, 4, i.333);
                o = MEM[(struct MonoObject * *)D.29122];
                D.29123 = narg->field;
                D.29124 = D.29123 == 0B;
                D.29125 = (long int) D.29124;
                D.29126 = __builtin_expect (D.29125, 0);
                if (D.29126 != 0) goto <D.29127>; else goto <D.29128>;
                <D.29127>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9543, "narg->field");
                <D.29128>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.29123 = narg->field;
                    __s2 = D.29123->name;
                    D.29132 = "CharSet";
                    D.29133 = MEM[(const unsigned char *)D.29132];
                    D.29134 = (int) D.29133;
                    D.29135 = *__s2;
                    D.29136 = (int) D.29135;
                    __result = D.29134 - D.29136;
                    {
                      D.29137 = __s2_len != 0;
                      D.29138 = __result == 0;
                      D.29139 = D.29137 & D.29138;
                      if (D.29139 != 0) goto <D.29140>; else goto <D.29141>;
                      <D.29140>:
                      D.29142 = &MEM[(void *)"CharSet" + 1B];
                      D.29143 = *D.29142;
                      D.29144 = (int) D.29143;
                      D.29145 = __s2 + 1;
                      D.29146 = *D.29145;
                      D.29147 = (int) D.29146;
                      __result = D.29144 - D.29147;
                      D.29148 = __s2_len > 1;
                      D.29138 = __result == 0;
                      D.29149 = D.29148 & D.29138;
                      if (D.29149 != 0) goto <D.29150>; else goto <D.29151>;
                      <D.29150>:
                      D.29152 = &MEM[(void *)"CharSet" + 2B];
                      D.29153 = *D.29152;
                      D.29154 = (int) D.29153;
                      D.29155 = __s2 + 2;
                      D.29156 = *D.29155;
                      D.29157 = (int) D.29156;
                      __result = D.29154 - D.29157;
                      D.29158 = __s2_len > 2;
                      D.29138 = __result == 0;
                      D.29159 = D.29158 & D.29138;
                      if (D.29159 != 0) goto <D.29160>; else goto <D.29161>;
                      <D.29160>:
                      D.29162 = &MEM[(void *)"CharSet" + 3B];
                      D.29163 = *D.29162;
                      D.29164 = (int) D.29163;
                      D.29165 = __s2 + 3;
                      D.29166 = *D.29165;
                      D.29167 = (int) D.29166;
                      __result = D.29164 - D.29167;
                      <D.29161>:
                      <D.29151>:
                      <D.29141>:
                    }
                    D.23254 = __result;
                  }
                  iftmp.334 = -D.23254;
                  goto <D.29168>;
                  <D.29131>:
                  D.29123 = narg->field;
                  D.29169 = D.29123->name;
                  iftmp.334 = __builtin_strcmp (D.29169, "CharSet");
                  <D.29168>:
                  D.23255 = iftmp.334;
                }
                if (D.23255 == 0) goto <D.29170>; else goto <D.29171>;
                <D.29170>:
                D.29172 = mono_object_unbox (o);
                charset = MEM[(gint32 *)D.29172];
                goto <D.29173>;
                <D.29171>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.29123 = narg->field;
                    __s2 = D.29123->name;
                    D.29177 = "SetLastError";
                    D.29178 = MEM[(const unsigned char *)D.29177];
                    D.29179 = (int) D.29178;
                    D.29180 = *__s2;
                    D.29181 = (int) D.29180;
                    __result = D.29179 - D.29181;
                    {
                      D.29182 = __s2_len != 0;
                      D.29183 = __result == 0;
                      D.29184 = D.29182 & D.29183;
                      if (D.29184 != 0) goto <D.29185>; else goto <D.29186>;
                      <D.29185>:
                      D.29187 = &MEM[(void *)"SetLastError" + 1B];
                      D.29188 = *D.29187;
                      D.29189 = (int) D.29188;
                      D.29190 = __s2 + 1;
                      D.29191 = *D.29190;
                      D.29192 = (int) D.29191;
                      __result = D.29189 - D.29192;
                      D.29193 = __s2_len > 1;
                      D.29183 = __result == 0;
                      D.29194 = D.29193 & D.29183;
                      if (D.29194 != 0) goto <D.29195>; else goto <D.29196>;
                      <D.29195>:
                      D.29197 = &MEM[(void *)"SetLastError" + 2B];
                      D.29198 = *D.29197;
                      D.29199 = (int) D.29198;
                      D.29200 = __s2 + 2;
                      D.29201 = *D.29200;
                      D.29202 = (int) D.29201;
                      __result = D.29199 - D.29202;
                      D.29203 = __s2_len > 2;
                      D.29183 = __result == 0;
                      D.29204 = D.29203 & D.29183;
                      if (D.29204 != 0) goto <D.29205>; else goto <D.29206>;
                      <D.29205>:
                      D.29207 = &MEM[(void *)"SetLastError" + 3B];
                      D.29208 = *D.29207;
                      D.29209 = (int) D.29208;
                      D.29210 = __s2 + 3;
                      D.29211 = *D.29210;
                      D.29212 = (int) D.29211;
                      __result = D.29209 - D.29212;
                      <D.29206>:
                      <D.29196>:
                      <D.29186>:
                    }
                    D.23263 = __result;
                  }
                  iftmp.335 = -D.23263;
                  goto <D.29213>;
                  <D.29176>:
                  D.29123 = narg->field;
                  D.29169 = D.29123->name;
                  iftmp.335 = __builtin_strcmp (D.29169, "SetLastError");
                  <D.29213>:
                  D.23264 = iftmp.335;
                }
                if (D.23264 == 0) goto <D.29214>; else goto <D.29215>;
                <D.29214>:
                D.29216 = mono_object_unbox (o);
                set_last_error = MEM[(MonoBoolean *)D.29216];
                goto <D.29217>;
                <D.29215>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.29123 = narg->field;
                    __s2 = D.29123->name;
                    D.29221 = "BestFitMapping";
                    D.29222 = MEM[(const unsigned char *)D.29221];
                    D.29223 = (int) D.29222;
                    D.29224 = *__s2;
                    D.29225 = (int) D.29224;
                    __result = D.29223 - D.29225;
                    {
                      D.29226 = __s2_len != 0;
                      D.29227 = __result == 0;
                      D.29228 = D.29226 & D.29227;
                      if (D.29228 != 0) goto <D.29229>; else goto <D.29230>;
                      <D.29229>:
                      D.29231 = &MEM[(void *)"BestFitMapping" + 1B];
                      D.29232 = *D.29231;
                      D.29233 = (int) D.29232;
                      D.29234 = __s2 + 1;
                      D.29235 = *D.29234;
                      D.29236 = (int) D.29235;
                      __result = D.29233 - D.29236;
                      D.29237 = __s2_len > 1;
                      D.29227 = __result == 0;
                      D.29238 = D.29237 & D.29227;
                      if (D.29238 != 0) goto <D.29239>; else goto <D.29240>;
                      <D.29239>:
                      D.29241 = &MEM[(void *)"BestFitMapping" + 2B];
                      D.29242 = *D.29241;
                      D.29243 = (int) D.29242;
                      D.29244 = __s2 + 2;
                      D.29245 = *D.29244;
                      D.29246 = (int) D.29245;
                      __result = D.29243 - D.29246;
                      D.29247 = __s2_len > 2;
                      D.29227 = __result == 0;
                      D.29248 = D.29247 & D.29227;
                      if (D.29248 != 0) goto <D.29249>; else goto <D.29250>;
                      <D.29249>:
                      D.29251 = &MEM[(void *)"BestFitMapping" + 3B];
                      D.29252 = *D.29251;
                      D.29253 = (int) D.29252;
                      D.29254 = __s2 + 3;
                      D.29255 = *D.29254;
                      D.29256 = (int) D.29255;
                      __result = D.29253 - D.29256;
                      <D.29250>:
                      <D.29240>:
                      <D.29230>:
                    }
                    D.23272 = __result;
                  }
                  iftmp.336 = -D.23272;
                  goto <D.29257>;
                  <D.29220>:
                  D.29123 = narg->field;
                  D.29169 = D.29123->name;
                  iftmp.336 = __builtin_strcmp (D.29169, "BestFitMapping");
                  <D.29257>:
                  D.23273 = iftmp.336;
                }
                if (D.23273 == 0) goto <D.29258>; else goto <D.29259>;
                <D.29258>:
                D.29260 = mono_object_unbox (o);
                best_fit_mapping = MEM[(MonoBoolean *)D.29260];
                goto <D.29261>;
                <D.29259>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.29123 = narg->field;
                    __s2 = D.29123->name;
                    D.29265 = "ThrowOnUnmappableChar";
                    D.29266 = MEM[(const unsigned char *)D.29265];
                    D.29267 = (int) D.29266;
                    D.29268 = *__s2;
                    D.29269 = (int) D.29268;
                    __result = D.29267 - D.29269;
                    {
                      D.29270 = __s2_len != 0;
                      D.29271 = __result == 0;
                      D.29272 = D.29270 & D.29271;
                      if (D.29272 != 0) goto <D.29273>; else goto <D.29274>;
                      <D.29273>:
                      D.29275 = &MEM[(void *)"ThrowOnUnmappableChar" + 1B];
                      D.29276 = *D.29275;
                      D.29277 = (int) D.29276;
                      D.29278 = __s2 + 1;
                      D.29279 = *D.29278;
                      D.29280 = (int) D.29279;
                      __result = D.29277 - D.29280;
                      D.29281 = __s2_len > 1;
                      D.29271 = __result == 0;
                      D.29282 = D.29281 & D.29271;
                      if (D.29282 != 0) goto <D.29283>; else goto <D.29284>;
                      <D.29283>:
                      D.29285 = &MEM[(void *)"ThrowOnUnmappableChar" + 2B];
                      D.29286 = *D.29285;
                      D.29287 = (int) D.29286;
                      D.29288 = __s2 + 2;
                      D.29289 = *D.29288;
                      D.29290 = (int) D.29289;
                      __result = D.29287 - D.29290;
                      D.29291 = __s2_len > 2;
                      D.29271 = __result == 0;
                      D.29292 = D.29291 & D.29271;
                      if (D.29292 != 0) goto <D.29293>; else goto <D.29294>;
                      <D.29293>:
                      D.29295 = &MEM[(void *)"ThrowOnUnmappableChar" + 3B];
                      D.29296 = *D.29295;
                      D.29297 = (int) D.29296;
                      D.29298 = __s2 + 3;
                      D.29299 = *D.29298;
                      D.29300 = (int) D.29299;
                      __result = D.29297 - D.29300;
                      <D.29294>:
                      <D.29284>:
                      <D.29274>:
                    }
                    D.23281 = __result;
                  }
                  iftmp.337 = -D.23281;
                  goto <D.29301>;
                  <D.29264>:
                  D.29123 = narg->field;
                  D.29169 = D.29123->name;
                  iftmp.337 = __builtin_strcmp (D.29169, "ThrowOnUnmappableChar");
                  <D.29301>:
                  D.23282 = iftmp.337;
                }
                if (D.23282 == 0) goto <D.29302>; else goto <D.29303>;
                <D.29302>:
                D.29304 = mono_object_unbox (o);
                throw_on_unmappable = MEM[(MonoBoolean *)D.29304];
                goto <D.29305>;
                <D.29303>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9553);
                <D.29305>:
                <D.29261>:
                <D.29217>:
                <D.29173>:
              }
              i = i + 1;
              <D.23284>:
              i.333 = (unsigned int) i;
              named_args.332 = named_args;
              D.29306 = mono_array_length (named_args.332);
              if (i.333 < D.29306) goto <D.23283>; else goto <D.23285>;
              <D.23285>:
              arginfo.330 = arginfo;
              monoeg_g_free (arginfo.330);
              memset (&piinfo, 0, 32);
              m.piinfo = &piinfo;
              D.29307 = call_conv << 8;
              D.29308 = (signed short) D.29307;
              if (charset != 0) goto <D.29310>; else goto <D.29311>;
              <D.29310>:
              D.29312 = charset + -1;
              D.29313 = (unsigned short) D.29312;
              D.29314 = D.29313 * 2;
              iftmp.338 = (signed short) D.29314;
              goto <D.29315>;
              <D.29311>:
              iftmp.338 = 1;
              <D.29315>:
              D.29316 = D.29308 | iftmp.338;
              D.29317 = (signed short) set_last_error;
              D.29318 = D.29316 | D.29317;
              D.29319 = (short unsigned int) D.29318;
              piinfo.piflags = D.29319;
              D.29320 = (unsigned char) call_conv;
              D.29321 = D.29320 + 255;
              D.29322 = (<unnamed-unsigned:6>) D.29321;
              csig->call_convention = D.29322;
            }
          finally
            {
              typed_args = {CLOBBER};
              named_args = {CLOBBER};
              arginfo = {CLOBBER};
              error = {CLOBBER};
            }
        }
        <D.29098>:
        if (cinfo != 0B) goto <D.29323>; else goto <D.29324>;
        <D.29323>:
        D.29325 = cinfo->cached;
        if (D.29325 == 0) goto <D.29326>; else goto <D.29327>;
        <D.29326>:
        mono_custom_attrs_free (cinfo);
        <D.29327>:
        <D.29324>:
      }
      <D.29089>:
      mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
      if (target_handle == 0) goto <D.29328>; else goto <D.29329>;
      <D.29328>:
      {
        struct WrapperInfo * info;

        D.29330 = sig->param_count;
        D.29331 = (int) D.29330;
        D.29332 = D.29331 + 16;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.29332);
        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.29333>;
      <D.29329>:
      mb->dynamic = 1;
      D.29330 = sig->param_count;
      D.29331 = (int) D.29330;
      D.29332 = D.29331 + 16;
      res = mono_mb_create_method (mb, csig, D.29332);
      <D.29333>:
      mono_mb_free (mb);
      D.29334 = mono_method_signature (invoke);
      D.29335 = D.29334->param_count;
      i = (int) D.29335;
      goto <D.23288>;
      <D.23287>:
      i.331 = (unsigned int) i;
      D.29336 = i.331 * 4;
      D.29337 = mspecs + D.29336;
      D.29338 = *D.29337;
      if (D.29338 != 0B) goto <D.29339>; else goto <D.29340>;
      <D.29339>:
      i.331 = (unsigned int) i;
      D.29336 = i.331 * 4;
      D.29337 = mspecs + D.29336;
      D.29338 = *D.29337;
      mono_metadata_free_marshal_spec (D.29338);
      <D.29340>:
      i = i + -1;
      <D.23288>:
      if (i >= 0) goto <D.23287>; else goto <D.23289>;
      <D.23289>:
      monoeg_g_free (mspecs);
      D.29071 = res;
      return D.29071;
    }
  finally
    {
      piinfo = {CLOBBER};
      m = {CLOBBER};
    }
}


mono_marshal_set_callconv_from_modopt (struct MonoMethod * method, struct MonoMethodSignature * csig)
{
  struct MonoType * D.29343;
  unsigned char D.29346;
  unsigned char D.29347;
  struct MonoClass * D.29350;
  struct MonoImage * D.29351;
  <unnamed-unsigned:31> D.29352;
  unsigned int D.29353;
  _Bool D.29354;
  long int D.29355;
  long int D.29356;
  struct MonoImage * D.29359;
  struct MonoImage * D.29360;
  int D.23173;
  int iftmp.339;
  int D.23172;
  const char[32] * D.29366;
  unsigned char D.29367;
  int D.29368;
  unsigned char D.29369;
  int D.29370;
  _Bool D.29371;
  _Bool D.29372;
  _Bool D.29373;
  const unsigned char * D.29376;
  unsigned char D.29377;
  int D.29378;
  const unsigned char * D.29379;
  unsigned char D.29380;
  int D.29381;
  _Bool D.29382;
  _Bool D.29383;
  const unsigned char * D.29386;
  unsigned char D.29387;
  int D.29388;
  const unsigned char * D.29389;
  unsigned char D.29390;
  int D.29391;
  _Bool D.29392;
  _Bool D.29393;
  const unsigned char * D.29396;
  unsigned char D.29397;
  int D.29398;
  const unsigned char * D.29399;
  unsigned char D.29400;
  int D.29401;
  const char * D.29403;
  int D.23182;
  int iftmp.340;
  int D.23181;
  const char[14] * D.29409;
  unsigned char D.29410;
  int D.29411;
  unsigned char D.29412;
  int D.29413;
  _Bool D.29414;
  _Bool D.29415;
  _Bool D.29416;
  const unsigned char * D.29419;
  unsigned char D.29420;
  int D.29421;
  const unsigned char * D.29422;
  unsigned char D.29423;
  int D.29424;
  _Bool D.29425;
  _Bool D.29426;
  const unsigned char * D.29429;
  unsigned char D.29430;
  int D.29431;
  const unsigned char * D.29432;
  unsigned char D.29433;
  int D.29434;
  _Bool D.29435;
  _Bool D.29436;
  const unsigned char * D.29439;
  unsigned char D.29440;
  int D.29441;
  const unsigned char * D.29442;
  unsigned char D.29443;
  int D.29444;
  const char * D.29446;
  int D.23191;
  int iftmp.341;
  int D.23190;
  const char[16] * D.29453;
  unsigned char D.29454;
  int D.29455;
  unsigned char D.29456;
  int D.29457;
  _Bool D.29458;
  _Bool D.29459;
  _Bool D.29460;
  const unsigned char * D.29463;
  unsigned char D.29464;
  int D.29465;
  const unsigned char * D.29466;
  unsigned char D.29467;
  int D.29468;
  _Bool D.29469;
  _Bool D.29470;
  const unsigned char * D.29473;
  unsigned char D.29474;
  int D.29475;
  const unsigned char * D.29476;
  unsigned char D.29477;
  int D.29478;
  _Bool D.29479;
  _Bool D.29480;
  const unsigned char * D.29483;
  unsigned char D.29484;
  int D.29485;
  const unsigned char * D.29486;
  unsigned char D.29487;
  int D.29488;
  int D.23200;
  int iftmp.342;
  int D.23199;
  const char[17] * D.29496;
  unsigned char D.29497;
  int D.29498;
  unsigned char D.29499;
  int D.29500;
  _Bool D.29501;
  _Bool D.29502;
  _Bool D.29503;
  const unsigned char * D.29506;
  unsigned char D.29507;
  int D.29508;
  const unsigned char * D.29509;
  unsigned char D.29510;
  int D.29511;
  _Bool D.29512;
  _Bool D.29513;
  const unsigned char * D.29516;
  unsigned char D.29517;
  int D.29518;
  const unsigned char * D.29519;
  unsigned char D.29520;
  int D.29521;
  _Bool D.29522;
  _Bool D.29523;
  const unsigned char * D.29526;
  unsigned char D.29527;
  int D.29528;
  const unsigned char * D.29529;
  unsigned char D.29530;
  int D.29531;
  int D.23209;
  int iftmp.343;
  int D.23208;
  const char[17] * D.29539;
  unsigned char D.29540;
  int D.29541;
  unsigned char D.29542;
  int D.29543;
  _Bool D.29544;
  _Bool D.29545;
  _Bool D.29546;
  const unsigned char * D.29549;
  unsigned char D.29550;
  int D.29551;
  const unsigned char * D.29552;
  unsigned char D.29553;
  int D.29554;
  _Bool D.29555;
  _Bool D.29556;
  const unsigned char * D.29559;
  unsigned char D.29560;
  int D.29561;
  const unsigned char * D.29562;
  unsigned char D.29563;
  int D.29564;
  _Bool D.29565;
  _Bool D.29566;
  const unsigned char * D.29569;
  unsigned char D.29570;
  int D.29571;
  const unsigned char * D.29572;
  unsigned char D.29573;
  int D.29574;
  <unnamed-unsigned:6> D.29578;
  int D.29579;
  struct MonoMethodSignature * sig;
  int i;

  sig = mono_method_signature (method);
  D.29343 = sig->ret;
  if (D.29343 != 0B) goto <D.29344>; else goto <D.29345>;
  <D.29344>:
  D.29343 = sig->ret;
  D.29346 = BIT_FIELD_REF <*D.29343, 8, 56>;
  D.29347 = D.29346 & 63;
  if (D.29347 != 0) goto <D.29348>; else goto <D.29349>;
  <D.29348>:
  i = 0;
  goto <D.23211>;
  <D.23210>:
  {
    struct MonoClass * cmod_class;

    D.29350 = method->klass;
    D.29351 = D.29350->image;
    D.29343 = sig->ret;
    D.29352 = D.29343->modifiers[i].token;
    D.29353 = (unsigned int) D.29352;
    cmod_class = mono_class_get (D.29351, D.29353);
    D.29354 = cmod_class == 0B;
    D.29355 = (long int) D.29354;
    D.29356 = __builtin_expect (D.29355, 0);
    if (D.29356 != 0) goto <D.29357>; else goto <D.29358>;
    <D.29357>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9418, "cmod_class");
    <D.29358>:
    D.29359 = cmod_class->image;
    D.29360 = mono_defaults.corlib;
    if (D.29359 == D.29360) goto <D.29361>; else goto <D.29362>;
    <D.29361>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name_space;
        D.29366 = "System.Runtime.CompilerServices";
        D.29367 = MEM[(const unsigned char *)D.29366];
        D.29368 = (int) D.29367;
        D.29369 = *__s2;
        D.29370 = (int) D.29369;
        __result = D.29368 - D.29370;
        {
          D.29371 = __s2_len != 0;
          D.29372 = __result == 0;
          D.29373 = D.29371 & D.29372;
          if (D.29373 != 0) goto <D.29374>; else goto <D.29375>;
          <D.29374>:
          D.29376 = &MEM[(void *)"System.Runtime.CompilerServices" + 1B];
          D.29377 = *D.29376;
          D.29378 = (int) D.29377;
          D.29379 = __s2 + 1;
          D.29380 = *D.29379;
          D.29381 = (int) D.29380;
          __result = D.29378 - D.29381;
          D.29382 = __s2_len > 1;
          D.29372 = __result == 0;
          D.29383 = D.29382 & D.29372;
          if (D.29383 != 0) goto <D.29384>; else goto <D.29385>;
          <D.29384>:
          D.29386 = &MEM[(void *)"System.Runtime.CompilerServices" + 2B];
          D.29387 = *D.29386;
          D.29388 = (int) D.29387;
          D.29389 = __s2 + 2;
          D.29390 = *D.29389;
          D.29391 = (int) D.29390;
          __result = D.29388 - D.29391;
          D.29392 = __s2_len > 2;
          D.29372 = __result == 0;
          D.29393 = D.29392 & D.29372;
          if (D.29393 != 0) goto <D.29394>; else goto <D.29395>;
          <D.29394>:
          D.29396 = &MEM[(void *)"System.Runtime.CompilerServices" + 3B];
          D.29397 = *D.29396;
          D.29398 = (int) D.29397;
          D.29399 = __s2 + 3;
          D.29400 = *D.29399;
          D.29401 = (int) D.29400;
          __result = D.29398 - D.29401;
          <D.29395>:
          <D.29385>:
          <D.29375>:
        }
        D.23172 = __result;
      }
      iftmp.339 = -D.23172;
      goto <D.29402>;
      <D.29365>:
      D.29403 = cmod_class->name_space;
      iftmp.339 = __builtin_strcmp (D.29403, "System.Runtime.CompilerServices");
      <D.29402>:
      D.23173 = iftmp.339;
    }
    if (D.23173 == 0) goto <D.29404>; else goto <D.29405>;
    <D.29404>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.29409 = "CallConvCdecl";
        D.29410 = MEM[(const unsigned char *)D.29409];
        D.29411 = (int) D.29410;
        D.29412 = *__s2;
        D.29413 = (int) D.29412;
        __result = D.29411 - D.29413;
        {
          D.29414 = __s2_len != 0;
          D.29415 = __result == 0;
          D.29416 = D.29414 & D.29415;
          if (D.29416 != 0) goto <D.29417>; else goto <D.29418>;
          <D.29417>:
          D.29419 = &MEM[(void *)"CallConvCdecl" + 1B];
          D.29420 = *D.29419;
          D.29421 = (int) D.29420;
          D.29422 = __s2 + 1;
          D.29423 = *D.29422;
          D.29424 = (int) D.29423;
          __result = D.29421 - D.29424;
          D.29425 = __s2_len > 1;
          D.29415 = __result == 0;
          D.29426 = D.29425 & D.29415;
          if (D.29426 != 0) goto <D.29427>; else goto <D.29428>;
          <D.29427>:
          D.29429 = &MEM[(void *)"CallConvCdecl" + 2B];
          D.29430 = *D.29429;
          D.29431 = (int) D.29430;
          D.29432 = __s2 + 2;
          D.29433 = *D.29432;
          D.29434 = (int) D.29433;
          __result = D.29431 - D.29434;
          D.29435 = __s2_len > 2;
          D.29415 = __result == 0;
          D.29436 = D.29435 & D.29415;
          if (D.29436 != 0) goto <D.29437>; else goto <D.29438>;
          <D.29437>:
          D.29439 = &MEM[(void *)"CallConvCdecl" + 3B];
          D.29440 = *D.29439;
          D.29441 = (int) D.29440;
          D.29442 = __s2 + 3;
          D.29443 = *D.29442;
          D.29444 = (int) D.29443;
          __result = D.29441 - D.29444;
          <D.29438>:
          <D.29428>:
          <D.29418>:
        }
        D.23181 = __result;
      }
      iftmp.340 = -D.23181;
      goto <D.29445>;
      <D.29408>:
      D.29446 = cmod_class->name;
      iftmp.340 = __builtin_strcmp (D.29446, "CallConvCdecl");
      <D.29445>:
      D.23182 = iftmp.340;
    }
    if (D.23182 == 0) goto <D.29447>; else goto <D.29448>;
    <D.29447>:
    csig->call_convention = 1;
    goto <D.29449>;
    <D.29448>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.29453 = "CallConvStdcall";
        D.29454 = MEM[(const unsigned char *)D.29453];
        D.29455 = (int) D.29454;
        D.29456 = *__s2;
        D.29457 = (int) D.29456;
        __result = D.29455 - D.29457;
        {
          D.29458 = __s2_len != 0;
          D.29459 = __result == 0;
          D.29460 = D.29458 & D.29459;
          if (D.29460 != 0) goto <D.29461>; else goto <D.29462>;
          <D.29461>:
          D.29463 = &MEM[(void *)"CallConvStdcall" + 1B];
          D.29464 = *D.29463;
          D.29465 = (int) D.29464;
          D.29466 = __s2 + 1;
          D.29467 = *D.29466;
          D.29468 = (int) D.29467;
          __result = D.29465 - D.29468;
          D.29469 = __s2_len > 1;
          D.29459 = __result == 0;
          D.29470 = D.29469 & D.29459;
          if (D.29470 != 0) goto <D.29471>; else goto <D.29472>;
          <D.29471>:
          D.29473 = &MEM[(void *)"CallConvStdcall" + 2B];
          D.29474 = *D.29473;
          D.29475 = (int) D.29474;
          D.29476 = __s2 + 2;
          D.29477 = *D.29476;
          D.29478 = (int) D.29477;
          __result = D.29475 - D.29478;
          D.29479 = __s2_len > 2;
          D.29459 = __result == 0;
          D.29480 = D.29479 & D.29459;
          if (D.29480 != 0) goto <D.29481>; else goto <D.29482>;
          <D.29481>:
          D.29483 = &MEM[(void *)"CallConvStdcall" + 3B];
          D.29484 = *D.29483;
          D.29485 = (int) D.29484;
          D.29486 = __s2 + 3;
          D.29487 = *D.29486;
          D.29488 = (int) D.29487;
          __result = D.29485 - D.29488;
          <D.29482>:
          <D.29472>:
          <D.29462>:
        }
        D.23190 = __result;
      }
      iftmp.341 = -D.23190;
      goto <D.29489>;
      <D.29452>:
      D.29446 = cmod_class->name;
      iftmp.341 = __builtin_strcmp (D.29446, "CallConvStdcall");
      <D.29489>:
      D.23191 = iftmp.341;
    }
    if (D.23191 == 0) goto <D.29490>; else goto <D.29491>;
    <D.29490>:
    csig->call_convention = 2;
    goto <D.29492>;
    <D.29491>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.29496 = "CallConvFastcall";
        D.29497 = MEM[(const unsigned char *)D.29496];
        D.29498 = (int) D.29497;
        D.29499 = *__s2;
        D.29500 = (int) D.29499;
        __result = D.29498 - D.29500;
        {
          D.29501 = __s2_len != 0;
          D.29502 = __result == 0;
          D.29503 = D.29501 & D.29502;
          if (D.29503 != 0) goto <D.29504>; else goto <D.29505>;
          <D.29504>:
          D.29506 = &MEM[(void *)"CallConvFastcall" + 1B];
          D.29507 = *D.29506;
          D.29508 = (int) D.29507;
          D.29509 = __s2 + 1;
          D.29510 = *D.29509;
          D.29511 = (int) D.29510;
          __result = D.29508 - D.29511;
          D.29512 = __s2_len > 1;
          D.29502 = __result == 0;
          D.29513 = D.29512 & D.29502;
          if (D.29513 != 0) goto <D.29514>; else goto <D.29515>;
          <D.29514>:
          D.29516 = &MEM[(void *)"CallConvFastcall" + 2B];
          D.29517 = *D.29516;
          D.29518 = (int) D.29517;
          D.29519 = __s2 + 2;
          D.29520 = *D.29519;
          D.29521 = (int) D.29520;
          __result = D.29518 - D.29521;
          D.29522 = __s2_len > 2;
          D.29502 = __result == 0;
          D.29523 = D.29522 & D.29502;
          if (D.29523 != 0) goto <D.29524>; else goto <D.29525>;
          <D.29524>:
          D.29526 = &MEM[(void *)"CallConvFastcall" + 3B];
          D.29527 = *D.29526;
          D.29528 = (int) D.29527;
          D.29529 = __s2 + 3;
          D.29530 = *D.29529;
          D.29531 = (int) D.29530;
          __result = D.29528 - D.29531;
          <D.29525>:
          <D.29515>:
          <D.29505>:
        }
        D.23199 = __result;
      }
      iftmp.342 = -D.23199;
      goto <D.29532>;
      <D.29495>:
      D.29446 = cmod_class->name;
      iftmp.342 = __builtin_strcmp (D.29446, "CallConvFastcall");
      <D.29532>:
      D.23200 = iftmp.342;
    }
    if (D.23200 == 0) goto <D.29533>; else goto <D.29534>;
    <D.29533>:
    csig->call_convention = 4;
    goto <D.29535>;
    <D.29534>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.29539 = "CallConvThiscall";
        D.29540 = MEM[(const unsigned char *)D.29539];
        D.29541 = (int) D.29540;
        D.29542 = *__s2;
        D.29543 = (int) D.29542;
        __result = D.29541 - D.29543;
        {
          D.29544 = __s2_len != 0;
          D.29545 = __result == 0;
          D.29546 = D.29544 & D.29545;
          if (D.29546 != 0) goto <D.29547>; else goto <D.29548>;
          <D.29547>:
          D.29549 = &MEM[(void *)"CallConvThiscall" + 1B];
          D.29550 = *D.29549;
          D.29551 = (int) D.29550;
          D.29552 = __s2 + 1;
          D.29553 = *D.29552;
          D.29554 = (int) D.29553;
          __result = D.29551 - D.29554;
          D.29555 = __s2_len > 1;
          D.29545 = __result == 0;
          D.29556 = D.29555 & D.29545;
          if (D.29556 != 0) goto <D.29557>; else goto <D.29558>;
          <D.29557>:
          D.29559 = &MEM[(void *)"CallConvThiscall" + 2B];
          D.29560 = *D.29559;
          D.29561 = (int) D.29560;
          D.29562 = __s2 + 2;
          D.29563 = *D.29562;
          D.29564 = (int) D.29563;
          __result = D.29561 - D.29564;
          D.29565 = __s2_len > 2;
          D.29545 = __result == 0;
          D.29566 = D.29565 & D.29545;
          if (D.29566 != 0) goto <D.29567>; else goto <D.29568>;
          <D.29567>:
          D.29569 = &MEM[(void *)"CallConvThiscall" + 3B];
          D.29570 = *D.29569;
          D.29571 = (int) D.29570;
          D.29572 = __s2 + 3;
          D.29573 = *D.29572;
          D.29574 = (int) D.29573;
          __result = D.29571 - D.29574;
          <D.29568>:
          <D.29558>:
          <D.29548>:
        }
        D.23208 = __result;
      }
      iftmp.343 = -D.23208;
      goto <D.29575>;
      <D.29538>:
      D.29446 = cmod_class->name;
      iftmp.343 = __builtin_strcmp (D.29446, "CallConvThiscall");
      <D.29575>:
      D.23209 = iftmp.343;
    }
    if (D.23209 == 0) goto <D.29576>; else goto <D.29577>;
    <D.29576>:
    csig->call_convention = 3;
    <D.29577>:
    <D.29535>:
    <D.29492>:
    <D.29449>:
    <D.29405>:
    <D.29362>:
  }
  i = i + 1;
  <D.23211>:
  D.29343 = sig->ret;
  D.29578 = D.29343->num_mods;
  D.29579 = (int) D.29578;
  if (D.29579 > i) goto <D.23210>; else goto <D.23212>;
  <D.23212>:
  <D.29349>:
  <D.29345>:
}


mono_class_has_parent (struct MonoClass * klass, struct MonoClass * parent)
{
  struct MonoClass * * D.29580;
  _Bool D.29581;
  long int D.29582;
  long int D.29583;
  struct MonoClass * * D.29586;
  _Bool D.29587;
  long int D.29588;
  long int D.29589;
  gboolean D.29592;

  D.29580 = klass->supertypes;
  D.29581 = D.29580 == 0B;
  D.29582 = (long int) D.29581;
  D.29583 = __builtin_expect (D.29582, 0);
  if (D.29583 != 0) goto <D.29584>; else goto <D.29585>;
  <D.29584>:
  mono_class_setup_supertypes (klass);
  <D.29585>:
  D.29586 = parent->supertypes;
  D.29587 = D.29586 == 0B;
  D.29588 = (long int) D.29587;
  D.29589 = __builtin_expect (D.29588, 0);
  if (D.29589 != 0) goto <D.29590>; else goto <D.29591>;
  <D.29590>:
  mono_class_setup_supertypes (parent);
  <D.29591>:
  D.29592 = mono_class_has_parent_fast (klass, parent);
  return D.29592;
}


mono_class_has_parent_fast (struct MonoClass * klass, struct MonoClass * parent)
{
  gboolean D.29594;
  int iftmp.344;
  short unsigned int D.29598;
  short unsigned int D.29599;
  struct MonoClass * * D.29601;
  sizetype D.29602;
  sizetype D.29603;
  sizetype D.29604;
  struct MonoClass * * D.29605;
  struct MonoClass * D.29606;

  D.29598 = klass->idepth;
  D.29599 = parent->idepth;
  if (D.29598 >= D.29599) goto <D.29600>; else goto <D.29596>;
  <D.29600>:
  D.29601 = klass->supertypes;
  D.29599 = parent->idepth;
  D.29602 = (sizetype) D.29599;
  D.29603 = D.29602 + 1073741823;
  D.29604 = D.29603 * 4;
  D.29605 = D.29601 + D.29604;
  D.29606 = *D.29605;
  if (D.29606 == parent) goto <D.29607>; else goto <D.29596>;
  <D.29607>:
  iftmp.344 = 1;
  goto <D.29597>;
  <D.29596>:
  iftmp.344 = 0;
  <D.29597>:
  D.29594 = iftmp.344;
  return D.29594;
}


mono_marshal_get_vtfixup_ftnptr (struct MonoImage * image, guint32 token, guint16 type)
{
  _Bool D.29609;
  long int D.29610;
  long int D.29611;
  _Bool D.29614;
  long int D.29615;
  long int D.29616;
  int D.29619;
  int D.29620;
  unsigned char D.29623;
  unsigned char D.29624;
  _Bool D.29625;
  long int D.29626;
  long int D.29627;
  short unsigned int D.29630;
  int D.29631;
  int D.29632;
  unsigned int D.29633;
  unsigned int D.29634;
  struct MonoClass * D.29635;
  const char * D.29636;
  int D.29637;
  unsigned int i.345;
  unsigned int D.29639;
  struct MonoMarshalSpec * * D.29640;
  struct MonoMarshalSpec * D.29641;
  void * D.29644;
  <unnamed-unsigned:1> D.29645;
  int D.29646;
  unsigned int i.346;
  int D.29648;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  int i;
  int param_count;

  D.29609 = token == 0;
  D.29610 = (long int) D.29609;
  D.29611 = __builtin_expect (D.29610, 0);
  if (D.29611 != 0) goto <D.29612>; else goto <D.29613>;
  <D.29612>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9608, "token");
  <D.29613>:
  method = mono_get_method (image, token, 0B);
  D.29614 = method == 0B;
  D.29615 = (long int) D.29614;
  D.29616 = __builtin_expect (D.29615, 0);
  if (D.29616 != 0) goto <D.29617>; else goto <D.29618>;
  <D.29617>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9611, "method");
  <D.29618>:
  D.29619 = (int) type;
  D.29620 = D.29619 & 12;
  if (D.29620 != 0) goto <D.29621>; else goto <D.29622>;
  <D.29621>:
  {
    struct MonoMethodSignature * csig;
    struct MonoMarshalSpec * * mspecs;
    struct EmitMarshalContext m;

    try
      {
        sig = mono_method_signature (method);
        D.29623 = BIT_FIELD_REF <*sig, 8, 80>;
        D.29624 = D.29623 & 64;
        D.29625 = D.29624 != 0;
        D.29626 = (long int) D.29625;
        D.29627 = __builtin_expect (D.29626, 0);
        if (D.29627 != 0) goto <D.29628>; else goto <D.29629>;
        <D.29628>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9619, "!sig->hasthis");
        <D.29629>:
        D.29630 = sig->param_count;
        D.29631 = (int) D.29630;
        D.29632 = D.29631 + 1;
        D.29633 = (unsigned int) D.29632;
        D.29634 = D.29633 * 4;
        mspecs = monoeg_malloc0 (D.29634);
        mono_method_get_marshal_info (method, mspecs);
        D.29635 = method->klass;
        D.29636 = method->name;
        mb = mono_mb_new (D.29635, D.29636, 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.29630 = sig->param_count;
        D.29631 = (int) D.29630;
        D.29637 = D.29631 + 16;
        method = mono_mb_create_method (mb, csig, D.29637);
        mono_mb_free (mb);
        D.29630 = sig->param_count;
        i = (int) D.29630;
        goto <D.23304>;
        <D.23303>:
        i.345 = (unsigned int) i;
        D.29639 = i.345 * 4;
        D.29640 = mspecs + D.29639;
        D.29641 = *D.29640;
        if (D.29641 != 0B) goto <D.29642>; else goto <D.29643>;
        <D.29642>:
        i.345 = (unsigned int) i;
        D.29639 = i.345 * 4;
        D.29640 = mspecs + D.29639;
        D.29641 = *D.29640;
        mono_metadata_free_marshal_spec (D.29641);
        <D.29643>:
        i = i + -1;
        <D.23304>:
        if (i >= 0) goto <D.23303>; else goto <D.23305>;
        <D.23305>:
        monoeg_g_free (mspecs);
        D.29644 = mono_compile_method (method);
        return D.29644;
      }
    finally
      {
        m = {CLOBBER};
      }
  }
  <D.29622>:
  sig = mono_method_signature (method);
  D.29635 = method->klass;
  D.29636 = method->name;
  mb = mono_mb_new (D.29635, D.29636, 7);
  D.29630 = sig->param_count;
  D.29631 = (int) D.29630;
  D.29645 = sig->hasthis;
  D.29646 = (int) D.29645;
  param_count = D.29631 + D.29646;
  i = 0;
  goto <D.23307>;
  <D.23306>:
  i.346 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.346);
  i = i + 1;
  <D.23307>:
  if (i < param_count) goto <D.23306>; else goto <D.23308>;
  <D.23308>:
  D.29619 = (int) type;
  D.29648 = D.29619 & 16;
  if (D.29648 != 0) goto <D.29649>; else goto <D.29650>;
  <D.29649>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.29651>;
  <D.29650>:
  mono_mb_emit_op (mb, 40, method);
  <D.29651>:
  mono_mb_emit_byte (mb, 42);
  mb->dynamic = 1;
  method = mono_mb_create_method (mb, sig, param_count);
  mono_mb_free (mb);
  D.29644 = mono_compile_method (method);
  return D.29644;
}


mono_marshal_get_castclass_with_cache ()
{
  struct MonoMethod * cached.347;
  struct MonoMethod * D.29657;
  struct MonoClass * D.29658;
  struct MonoImage * D.29659;
  struct MonoType * D.29660;
  struct MonoClass * D.29661;
  struct MonoType * D.29662;
  unsigned int D.29663;
  unsigned int D.29664;
  unsigned int cache_miss_pos.348;
  unsigned int D.29666;
  unsigned int invalid_cast_pos.349;
  unsigned int return_null_pos.350;
  void * D.29669;
  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.347 = cached;
  if (cached.347 != 0B) goto <D.29655>; else goto <D.29656>;
  <D.29655>:
  D.29657 = cached;
  return D.29657;
  <D.29656>:
  D.29658 = mono_defaults.object_class;
  mb = mono_mb_new (D.29658, "__castclass_with_cache", 19);
  D.29659 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.29659, 3);
  D.29658 = mono_defaults.object_class;
  D.29660 = &D.29658->byval_arg;
  sig->params[0] = D.29660;
  D.29661 = mono_defaults.int_class;
  D.29662 = &D.29661->byval_arg;
  sig->params[1] = D.29662;
  D.29661 = mono_defaults.int_class;
  D.29662 = &D.29661->byval_arg;
  sig->params[2] = D.29662;
  D.29658 = mono_defaults.object_class;
  D.29660 = &D.29658->byval_arg;
  sig->ret = D.29660;
  sig->pinvoke = 0;
  D.29661 = mono_defaults.int_class;
  D.29662 = &D.29661->byval_arg;
  mono_mb_add_local (mb, D.29662);
  mono_mb_emit_ldarg (mb, 0);
  D.29663 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.29663;
  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.29664 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.29664;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.348 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.348);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.29666 = mono_mb_emit_branch (mb, 57);
  invalid_cast_pos = (int) D.29666;
  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.349 = (unsigned int) invalid_cast_pos;
  mono_mb_patch_branch (mb, invalid_cast_pos.349);
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  return_null_pos.350 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.350);
  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);
  mono_memory_write_barrier ();
  D.29669 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.29669 != 0B) goto <D.29670>; else goto <D.29671>;
  <D.29670>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.29671>:
  mono_mb_free (mb);
  D.29657 = cached;
  return D.29657;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


InterlockedCompareExchangePointer (void * volatile * dest, void * exch, void * comp)
{
  void * D.29673;
  unsigned int comp.351;
  unsigned int exch.352;
  unsigned int D.29676;

  comp.351 = (unsigned int) comp;
  exch.352 = (unsigned int) exch;
  D.29676 = __sync_val_compare_and_swap_4 (dest, comp.351, exch.352);
  D.29673 = (void *) D.29676;
  return D.29673;
}


mono_marshal_get_isinst_with_cache ()
{
  struct MonoMethod * cached.353;
  struct MonoMethod * D.29681;
  struct MonoClass * D.29682;
  struct MonoImage * D.29683;
  struct MonoType * D.29684;
  struct MonoClass * D.29685;
  struct MonoType * D.29686;
  unsigned int D.29687;
  unsigned int D.29688;
  unsigned int D.29689;
  unsigned int D.29690;
  unsigned int negative_cache_hit_pos.354;
  unsigned int cache_hit_pos.355;
  unsigned int cache_miss_pos.356;
  unsigned int D.29694;
  unsigned int not_an_instance_pos.357;
  unsigned int return_null_pos.358;
  void * D.29697;
  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.353 = cached;
  if (cached.353 != 0B) goto <D.29679>; else goto <D.29680>;
  <D.29679>:
  D.29681 = cached;
  return D.29681;
  <D.29680>:
  D.29682 = mono_defaults.object_class;
  mb = mono_mb_new (D.29682, "__isinst_with_cache", 19);
  D.29683 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.29683, 3);
  D.29682 = mono_defaults.object_class;
  D.29684 = &D.29682->byval_arg;
  sig->params[0] = D.29684;
  D.29685 = mono_defaults.int_class;
  D.29686 = &D.29685->byval_arg;
  sig->params[1] = D.29686;
  D.29685 = mono_defaults.int_class;
  D.29686 = &D.29685->byval_arg;
  sig->params[2] = D.29686;
  D.29682 = mono_defaults.object_class;
  D.29684 = &D.29682->byval_arg;
  sig->ret = D.29684;
  sig->pinvoke = 0;
  D.29685 = mono_defaults.int_class;
  D.29686 = &D.29685->byval_arg;
  mono_mb_add_local (mb, D.29686);
  D.29685 = mono_defaults.int_class;
  D.29686 = &D.29685->byval_arg;
  mono_mb_add_local (mb, D.29686);
  mono_mb_emit_ldarg (mb, 0);
  D.29687 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.29687;
  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.29688 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.29688;
  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.29689 = mono_mb_emit_branch (mb, 58);
  negative_cache_hit_pos = (int) D.29689;
  mono_mb_emit_ldarg (mb, 0);
  D.29690 = mono_mb_emit_branch (mb, 56);
  cache_hit_pos = (int) D.29690;
  negative_cache_hit_pos.354 = (unsigned int) negative_cache_hit_pos;
  mono_mb_patch_branch (mb, negative_cache_hit_pos.354);
  mono_mb_emit_byte (mb, 20);
  cache_hit_pos.355 = (unsigned int) cache_hit_pos;
  mono_mb_patch_branch (mb, cache_hit_pos.355);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.356 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.356);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.29694 = mono_mb_emit_branch (mb, 57);
  not_an_instance_pos = (int) D.29694;
  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.357 = (unsigned int) not_an_instance_pos;
  mono_mb_patch_branch (mb, not_an_instance_pos.357);
  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.358 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.358);
  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);
  mono_memory_write_barrier ();
  D.29697 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.29697 != 0B) goto <D.29698>; else goto <D.29699>;
  <D.29698>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.29699>:
  mono_mb_free (mb);
  D.29681 = cached;
  return D.29681;
}


mono_marshal_get_isinst (struct MonoClass * klass)
{
  struct MonoImage * D.29701;
  struct GHashTable * * D.29702;
  struct MonoMethod * D.29705;
  struct MonoMethodSignature * isint_sig.359;
  struct MonoImage * D.29709;
  struct MonoMethodSignature * isint_sig.360;
  struct MonoClass * D.29711;
  struct MonoType * D.29712;
  const char * D.29713;
  struct MonoMethod * D.29714;
  unsigned int D.29715;
  unsigned int D.29716;
  struct MonoMethod * D.29717;
  unsigned int D.29718;
  unsigned int pos_failed.361;
  unsigned int D.29720;
  unsigned int pos_was_ok.362;
  unsigned int pos_end.363;
  unsigned int pos_end2.364;
  short unsigned int D.29724;
  int D.29725;
  int D.29726;
  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.29701 = klass->image;
  D.29702 = &D.29701->isinst_cache;
  cache = get_cache (D.29702, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.29703>; else goto <D.29704>;
  <D.29703>:
  D.29705 = res;
  return D.29705;
  <D.29704>:
  isint_sig.359 = isint_sig;
  if (isint_sig.359 == 0B) goto <D.29707>; else goto <D.29708>;
  <D.29707>:
  D.29709 = mono_defaults.corlib;
  isint_sig.360 = mono_metadata_signature_alloc (D.29709, 1);
  isint_sig = isint_sig.360;
  isint_sig.359 = isint_sig;
  D.29711 = mono_defaults.object_class;
  D.29712 = &D.29711->byval_arg;
  isint_sig.359->params[0] = D.29712;
  isint_sig.359 = isint_sig;
  D.29711 = mono_defaults.object_class;
  D.29712 = &D.29711->byval_arg;
  isint_sig.359->ret = D.29712;
  isint_sig.359 = isint_sig;
  isint_sig.359->pinvoke = 0;
  <D.29708>:
  D.29713 = klass->name;
  name = monoeg_g_strdup_printf ("__isinst_wrapper_%s", D.29713);
  D.29711 = mono_defaults.object_class;
  mb = mono_mb_new (D.29711, name, 18);
  monoeg_g_free (name);
  D.29714 = mb->method;
  D.29714->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.29715 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.29715;
  mono_mb_emit_byte (mb, 24);
  D.29716 = mono_mb_emit_branch (mb, 64);
  pos_failed = (int) D.29716;
  mono_mb_emit_ldarg (mb, 0);
  D.29717 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.29717, 0B);
  D.29718 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.29718;
  pos_failed.361 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.361);
  mono_mb_emit_byte (mb, 20);
  D.29720 = mono_mb_emit_branch (mb, 56);
  pos_end2 = (int) D.29720;
  pos_was_ok.362 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.362);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 0);
  pos_end.363 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.363);
  pos_end2.364 = (unsigned int) pos_end2;
  mono_mb_patch_branch (mb, pos_end2.364);
  mono_mb_emit_byte (mb, 42);
  isint_sig.359 = isint_sig;
  isint_sig.359 = isint_sig;
  D.29724 = isint_sig.359->param_count;
  D.29725 = (int) D.29724;
  D.29726 = D.29725 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.359, D.29726);
  mono_mb_free (mb);
  D.29705 = res;
  return D.29705;
}


mono_marshal_get_castclass (struct MonoClass * klass)
{
  struct MonoImage * D.29728;
  struct GHashTable * * D.29729;
  struct MonoMethod * D.29732;
  struct MonoMethodSignature * castclass_sig.365;
  struct MonoImage * D.29736;
  struct MonoMethodSignature * castclass_sig.366;
  struct MonoClass * D.29738;
  struct MonoType * D.29739;
  const char * D.29740;
  struct MonoMethod * D.29741;
  unsigned int D.29742;
  struct MonoMethod * D.29743;
  unsigned int D.29744;
  unsigned int pos_was_ok.367;
  unsigned int pos_was_ok2.368;
  short unsigned int D.29747;
  int D.29748;
  int D.29749;
  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.29728 = klass->image;
  D.29729 = &D.29728->castclass_cache;
  cache = get_cache (D.29729, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.29730>; else goto <D.29731>;
  <D.29730>:
  D.29732 = res;
  return D.29732;
  <D.29731>:
  castclass_sig.365 = castclass_sig;
  if (castclass_sig.365 == 0B) goto <D.29734>; else goto <D.29735>;
  <D.29734>:
  D.29736 = mono_defaults.corlib;
  castclass_sig.366 = mono_metadata_signature_alloc (D.29736, 1);
  castclass_sig = castclass_sig.366;
  castclass_sig.365 = castclass_sig;
  D.29738 = mono_defaults.object_class;
  D.29739 = &D.29738->byval_arg;
  castclass_sig.365->params[0] = D.29739;
  castclass_sig.365 = castclass_sig;
  D.29738 = mono_defaults.object_class;
  D.29739 = &D.29738->byval_arg;
  castclass_sig.365->ret = D.29739;
  castclass_sig.365 = castclass_sig;
  castclass_sig.365->pinvoke = 0;
  <D.29735>:
  D.29740 = klass->name;
  name = monoeg_g_strdup_printf ("__castclass_wrapper_%s", D.29740);
  D.29738 = mono_defaults.object_class;
  mb = mono_mb_new (D.29738, name, 19);
  monoeg_g_free (name);
  D.29741 = mb->method;
  D.29741->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 8, klass);
  D.29742 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.29742;
  mono_mb_emit_ldarg (mb, 0);
  D.29743 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.29743, 0B);
  D.29744 = mono_mb_emit_branch (mb, 58);
  pos_was_ok2 = (int) D.29744;
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  pos_was_ok.367 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.367);
  pos_was_ok2.368 = (unsigned int) pos_was_ok2;
  mono_mb_patch_branch (mb, pos_was_ok2.368);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  castclass_sig.365 = castclass_sig;
  castclass_sig.365 = castclass_sig;
  D.29747 = castclass_sig.365->param_count;
  D.29748 = (int) D.29747;
  D.29749 = D.29748 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig.365, D.29749);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 0);
  mono_marshal_set_wrapper_info (res, info);
  D.29732 = res;
  return D.29732;
}


mono_marshal_get_proxy_cancast (struct MonoClass * klass)
{
  struct MonoImage * D.29751;
  struct GHashTable * * D.29752;
  struct MonoMethod * D.29755;
  struct MonoMethodSignature * isint_sig.369;
  struct MonoImage * D.29759;
  struct MonoMethodSignature * isint_sig.370;
  struct MonoClass * D.29761;
  struct MonoType * D.29762;
  struct MonoType * D.29763;
  struct MonoMethod * D.29764;
  struct MonoClass * D.29765;
  _Bool D.29766;
  long int D.29767;
  long int D.29768;
  unsigned int D.29771;
  unsigned int D.29772;
  unsigned int pos_failed.371;
  unsigned int pos_end.372;
  short unsigned int D.29775;
  int D.29776;
  int D.29777;
  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.29751 = klass->image;
  D.29752 = &D.29751->proxy_isinst_cache;
  cache = get_cache (D.29752, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.29753>; else goto <D.29754>;
  <D.29753>:
  D.29755 = res;
  return D.29755;
  <D.29754>:
  isint_sig.369 = isint_sig;
  if (isint_sig.369 == 0B) goto <D.29757>; else goto <D.29758>;
  <D.29757>:
  D.29759 = mono_defaults.corlib;
  isint_sig.370 = mono_metadata_signature_alloc (D.29759, 1);
  isint_sig = isint_sig.370;
  isint_sig.369 = isint_sig;
  D.29761 = mono_defaults.object_class;
  D.29762 = &D.29761->byval_arg;
  isint_sig.369->params[0] = D.29762;
  isint_sig.369 = isint_sig;
  D.29761 = mono_defaults.object_class;
  D.29762 = &D.29761->byval_arg;
  isint_sig.369->ret = D.29762;
  isint_sig.369 = isint_sig;
  isint_sig.369->pinvoke = 0;
  <D.29758>:
  D.29763 = &klass->byval_arg;
  klass_name = mono_type_full_name (D.29763);
  name = monoeg_g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name);
  D.29761 = mono_defaults.object_class;
  mb = mono_mb_new (D.29761, name, 20);
  monoeg_g_free (klass_name);
  monoeg_g_free (name);
  D.29764 = mb->method;
  D.29764->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  D.29763 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.29763);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", 0);
  D.29765 = mono_defaults.iremotingtypeinfo_class;
  can_cast_to = mono_method_desc_search_in_class (desc, D.29765);
  D.29766 = can_cast_to == 0B;
  D.29767 = (long int) D.29766;
  D.29768 = __builtin_expect (D.29767, 0);
  if (D.29768 != 0) goto <D.29769>; else goto <D.29770>;
  <D.29769>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10142, "can_cast_to");
  <D.29770>:
  mono_method_desc_free (desc);
  mono_mb_emit_op (mb, 111, can_cast_to);
  D.29771 = mono_mb_emit_branch (mb, 57);
  pos_failed = (int) D.29771;
  D.29763 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.29763);
  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.29772 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.29772;
  pos_failed.371 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.371);
  mono_mb_emit_byte (mb, 20);
  pos_end.372 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.372);
  mono_mb_emit_byte (mb, 42);
  isint_sig.369 = isint_sig;
  isint_sig.369 = isint_sig;
  D.29775 = isint_sig.369->param_count;
  D.29776 = (int) D.29775;
  D.29777 = D.29776 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.369, D.29777);
  mono_mb_free (mb);
  D.29755 = res;
  return D.29755;
}


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

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


mono_marshal_get_struct_to_ptr (struct MonoClass * klass)
{
  _Bool D.29781;
  long int D.29782;
  long int D.29783;
  struct MonoMarshalType * D.29786;
  struct MonoMethod * D.29787;
  struct MonoMethod * D.29790;
  struct MonoMethod * stoptr.373;
  struct MonoClass * D.29794;
  struct MonoMethod * stoptr.374;
  _Bool D.29796;
  long int D.29797;
  long int D.29798;
  const char * D.29801;
  unsigned char D.29802;
  unsigned char D.29803;
  int D.29806;
  struct MonoClass * D.29808;
  struct MonoType * D.29809;
  struct MonoClass * D.29810;
  struct MonoType * D.29811;
  struct MonoMethodSignature * D.29812;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * stoptr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.29781 = klass == 0B;
  D.29782 = (long int) D.29781;
  D.29783 = __builtin_expect (D.29782, 0);
  if (D.29783 != 0) goto <D.29784>; else goto <D.29785>;
  <D.29784>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10201, "klass != NULL");
  <D.29785>:
  mono_marshal_load_type_info (klass);
  D.29786 = klass->marshal_info;
  D.29787 = D.29786->str_to_ptr;
  if (D.29787 != 0B) goto <D.29788>; else goto <D.29789>;
  <D.29788>:
  D.29786 = klass->marshal_info;
  D.29790 = D.29786->str_to_ptr;
  return D.29790;
  <D.29789>:
  stoptr.373 = stoptr;
  if (stoptr.373 == 0B) goto <D.29792>; else goto <D.29793>;
  <D.29792>:
  D.29794 = mono_defaults.marshal_class;
  stoptr.374 = mono_class_get_method_from_name (D.29794, "StructureToPtr", 3);
  stoptr = stoptr.374;
  <D.29793>:
  stoptr.373 = stoptr;
  D.29796 = stoptr.373 == 0B;
  D.29797 = (long int) D.29796;
  D.29798 = __builtin_expect (D.29797, 0);
  if (D.29798 != 0) goto <D.29799>; else goto <D.29800>;
  <D.29799>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10210, "stoptr");
  <D.29800>:
  stoptr.373 = stoptr;
  D.29801 = stoptr.373->name;
  mb = mono_mb_new (klass, D.29801, 25);
  D.29802 = BIT_FIELD_REF <*klass, 8, 160>;
  D.29803 = D.29802 & 32;
  if (D.29803 != 0) goto <D.29804>; else goto <D.29805>;
  <D.29804>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 8);
  D.29806 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.29806);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.29807>;
  <D.29805>:
  D.29808 = mono_defaults.int_class;
  D.29809 = &D.29808->byval_arg;
  mono_mb_add_local (mb, D.29809);
  D.29808 = mono_defaults.int_class;
  D.29809 = &D.29808->byval_arg;
  mono_mb_add_local (mb, D.29809);
  D.29810 = mono_defaults.boolean_class;
  D.29811 = &D.29810->byval_arg;
  mono_mb_add_local (mb, D.29811);
  mono_mb_emit_byte (mb, 4);
  mono_mb_emit_stloc (mb, 2);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 8);
  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.29807>:
  mono_mb_emit_byte (mb, 42);
  stoptr.373 = stoptr;
  D.29812 = mono_signature_no_pinvoke (stoptr.373);
  res = mono_mb_create_method (mb, D.29812, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 8);
  mono_marshal_set_wrapper_info (res, info);
  D.29786 = klass->marshal_info;
  D.29786->str_to_ptr = res;
  D.29790 = res;
  return D.29790;
}


mono_marshal_get_ptr_to_struct (struct MonoClass * klass)
{
  _Bool D.29814;
  long int D.29815;
  long int D.29816;
  struct MonoMarshalType * D.29819;
  struct MonoMethod * D.29820;
  struct MonoMethod * D.29823;
  struct MonoMethodSignature * ptostr.375;
  struct MonoImage * D.29827;
  unsigned char D.29828;
  unsigned char D.29829;
  int D.29832;
  struct MonoClass * D.29834;
  struct MonoType * D.29835;
  struct MonoType * D.29836;
  struct MonoMethodBuilder * mb;
  static struct MonoMethodSignature * ptostr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.29814 = klass == 0B;
  D.29815 = (long int) D.29814;
  D.29816 = __builtin_expect (D.29815, 0);
  if (D.29816 != 0) goto <D.29817>; else goto <D.29818>;
  <D.29817>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10273, "klass != NULL");
  <D.29818>:
  mono_marshal_load_type_info (klass);
  D.29819 = klass->marshal_info;
  D.29820 = D.29819->ptr_to_str;
  if (D.29820 != 0B) goto <D.29821>; else goto <D.29822>;
  <D.29821>:
  D.29819 = klass->marshal_info;
  D.29823 = D.29819->ptr_to_str;
  return D.29823;
  <D.29822>:
  ptostr.375 = ptostr;
  if (ptostr.375 == 0B) goto <D.29825>; else goto <D.29826>;
  <D.29825>:
  {
    struct MonoMethodSignature * sig;

    sig = mono_create_icall_signature ("void ptr object");
    D.29827 = mono_defaults.corlib;
    sig = signature_dup (D.29827, sig);
    sig->pinvoke = 0;
    mono_memory_barrier ();
    ptostr = sig;
  }
  <D.29826>:
  mb = mono_mb_new (klass, "PtrToStructure", 25);
  D.29828 = BIT_FIELD_REF <*klass, 8, 160>;
  D.29829 = D.29828 & 32;
  if (D.29829 != 0) goto <D.29830>; else goto <D.29831>;
  <D.29830>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 2);
  D.29832 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.29832);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.29833>;
  <D.29831>:
  D.29834 = mono_defaults.int_class;
  D.29835 = &D.29834->byval_arg;
  mono_mb_add_local (mb, D.29835);
  D.29836 = &klass->this_arg;
  mono_mb_add_local (mb, D.29836);
  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.29833>:
  mono_mb_emit_byte (mb, 42);
  ptostr.375 = ptostr;
  res = mono_mb_create_method (mb, ptostr.375, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 7);
  mono_marshal_set_wrapper_info (res, info);
  D.29819 = klass->marshal_info;
  D.29819->ptr_to_str = res;
  D.29823 = res;
  return D.29823;
}


mono_marshal_get_synchronized_inner_wrapper (struct MonoMethod * method)
{
  unsigned char D.29838;
  unsigned char D.29839;
  struct MonoGenericContext * D.29842;
  struct MonoGenericInst * D.29843;
  struct MonoClass * D.29848;
  _Bool D.29849;
  long int D.29850;
  long int D.29851;
  const char * D.29854;
  struct MonoImage * D.29855;
  struct MonoMethodSignature * D.29856;
  struct MonoMethod * D.29859;
  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.29838 = BIT_FIELD_REF <*method, 8, 168>;
  D.29839 = D.29838 & 16;
  if (D.29839 != 0) goto <D.29840>; else goto <D.29841>;
  <D.29840>:
  D.29842 = mono_method_get_context (method);
  D.29843 = D.29842->method_inst;
  if (D.29843 == 0B) goto <D.29844>; else goto <D.29845>;
  <D.29844>:
  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.29846>; else goto <D.29847>;
  <D.29846>:
  D.29848 = method->klass;
  container = D.29848->generic_container;
  <D.29847>:
  D.29849 = container == 0B;
  D.29850 = (long int) D.29849;
  D.29851 = __builtin_expect (D.29850, 0);
  if (D.29851 != 0) goto <D.29852>; else goto <D.29853>;
  <D.29852>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10360, "container");
  <D.29853>:
  <D.29845>:
  <D.29841>:
  D.29848 = method->klass;
  D.29854 = method->name;
  mb = mono_mb_new (D.29848, D.29854, 25);
  mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn\'t be called.");
  mono_mb_emit_byte (mb, 42);
  D.29848 = method->klass;
  D.29855 = D.29848->image;
  D.29856 = mono_method_signature (method);
  sig = signature_dup (D.29855, D.29856);
  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.29857>; else goto <D.29858>;
  <D.29857>:
  res = mono_class_inflate_generic_method (res, ctx);
  <D.29858>:
  D.29859 = res;
  return D.29859;
}


mono_marshal_get_synchronized_wrapper (struct MonoMethod * method)
{
  _Bool D.29861;
  long int D.29862;
  long int D.29863;
  unsigned char D.29866;
  unsigned char D.29867;
  struct MonoMethod * D.29870;
  unsigned char D.29871;
  unsigned char D.29872;
  struct MonoGenericContext * D.29875;
  struct MonoGenericInst * D.29876;
  struct MonoClass * D.29881;
  _Bool D.29882;
  long int D.29883;
  long int D.29884;
  struct MonoImage * D.29889;
  struct GHashTable * * D.29890;
  struct GHashTable * * D.29894;
  struct MonoMethodSignature * D.29897;
  const char * D.29898;
  struct MonoType * D.29899;
  int D.29900;
  unsigned char D.29903;
  unsigned char D.29904;
  short unsigned int D.29907;
  int D.29908;
  int D.29909;
  int D.29912;
  unsigned int ret_local.376;
  short unsigned int D.29916;
  int D.29917;
  int D.29918;
  struct MonoClass * D.29919;
  struct MonoType * D.29920;
  _Bool D.29923;
  long int D.29924;
  long int D.29925;
  struct MonoMethod * enter_method.377;
  struct MonoClass * D.29931;
  struct MonoMethod * enter_method.378;
  _Bool D.29933;
  long int D.29934;
  long int D.29935;
  struct MonoMethod * exit_method.379;
  struct MonoMethod * exit_method.380;
  _Bool D.29940;
  long int D.29941;
  long int D.29942;
  struct MonoClass * D.29945;
  struct MonoMethod * gettypefromhandle_method.381;
  struct MonoMethod * gettypefromhandle_method.382;
  _Bool D.29948;
  long int D.29949;
  long int D.29950;
  _Bool D.29955;
  long int D.29956;
  long int D.29957;
  unsigned int D.29962;
  struct MonoClass * D.29963;
  unsigned int this_local.383;
  int D.29966;
  unsigned int D.29967;
  unsigned char D.29968;
  unsigned char D.29969;
  _Bool D.29972;
  int D.29973;
  int D.29974;
  unsigned int D.29975;
  struct MonoGenericContext * D.29978;
  struct MonoMethod * D.29979;
  int D.29981;
  unsigned int D.29984;
  int D.29985;
  unsigned int D.29986;
  unsigned int D.29987;
  unsigned int D.29988;
  int D.29989;
  unsigned int D.29990;
  int D.29991;
  unsigned int D.29992;
  unsigned int D.29993;
  unsigned int D.29994;
  unsigned int pos.384;
  int D.29996;
  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.29861 = method == 0B;
  D.29862 = (long int) D.29861;
  D.29863 = __builtin_expect (D.29862, 0);
  if (D.29863 != 0) goto <D.29864>; else goto <D.29865>;
  <D.29864>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10397, "method");
  <D.29865>:
  D.29866 = BIT_FIELD_REF <*method, 8, 160>;
  D.29867 = D.29866 & 124;
  if (D.29867 == 64) goto <D.29868>; else goto <D.29869>;
  <D.29868>:
  D.29870 = method;
  return D.29870;
  <D.29869>:
  D.29871 = BIT_FIELD_REF <*method, 8, 168>;
  D.29872 = D.29871 & 16;
  if (D.29872 != 0) goto <D.29873>; else goto <D.29874>;
  <D.29873>:
  D.29875 = mono_method_get_context (method);
  D.29876 = D.29875->method_inst;
  if (D.29876 == 0B) goto <D.29877>; else goto <D.29878>;
  <D.29877>:
  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.29879>; else goto <D.29880>;
  <D.29879>:
  D.29881 = method->klass;
  container = D.29881->generic_container;
  <D.29880>:
  D.29882 = container == 0B;
  D.29883 = (long int) D.29882;
  D.29884 = __builtin_expect (D.29883, 0);
  if (D.29884 != 0) goto <D.29885>; else goto <D.29886>;
  <D.29885>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10410, "container");
  <D.29886>:
  <D.29878>:
  <D.29874>:
  if (ctx != 0B) goto <D.29887>; else goto <D.29888>;
  <D.29887>:
  D.29881 = method->klass;
  D.29889 = D.29881->image;
  D.29890 = &D.29889->synchronized_generic_cache;
  cache = get_cache (D.29890, mono_aligned_addr_hash, 0B);
  res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
  if (res != 0B) goto <D.29891>; else goto <D.29892>;
  <D.29891>:
  D.29870 = res;
  return D.29870;
  <D.29892>:
  goto <D.29893>;
  <D.29888>:
  D.29881 = method->klass;
  D.29889 = D.29881->image;
  D.29894 = &D.29889->synchronized_cache;
  cache = get_cache (D.29894, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.29895>; else goto <D.29896>;
  <D.29895>:
  D.29870 = res;
  return D.29870;
  <D.29896>:
  <D.29893>:
  D.29881 = method->klass;
  D.29889 = D.29881->image;
  D.29897 = mono_method_signature (method);
  sig = signature_dup (D.29889, D.29897);
  sig->pinvoke = 0;
  D.29881 = method->klass;
  D.29898 = method->name;
  mb = mono_mb_new (D.29881, D.29898, 16);
  D.29899 = sig->ret;
  D.29900 = mono_type_is_void (D.29899);
  if (D.29900 == 0) goto <D.29901>; else goto <D.29902>;
  <D.29901>:
  D.29899 = sig->ret;
  ret_local = mono_mb_add_local (mb, D.29899);
  <D.29902>:
  D.29881 = method->klass;
  D.29903 = BIT_FIELD_REF <*D.29881, 8, 160>;
  D.29904 = D.29903 & 8;
  if (D.29904 != 0) goto <D.29905>; else goto <D.29906>;
  <D.29905>:
  D.29907 = method->flags;
  D.29908 = (int) D.29907;
  D.29909 = D.29908 & 16;
  if (D.29909 == 0) goto <D.29910>; else goto <D.29911>;
  <D.29910>:
  D.29881 = method->klass;
  mono_class_set_failure (D.29881, 7, 0B);
  mono_mb_emit_byte (mb, 20);
  D.29881 = method->klass;
  mono_mb_emit_op (mb, 117, D.29881);
  mono_mb_emit_byte (mb, 38);
  D.29899 = sig->ret;
  D.29912 = mono_type_is_void (D.29899);
  if (D.29912 == 0) goto <D.29913>; else goto <D.29914>;
  <D.29913>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.29914>:
  mono_mb_emit_byte (mb, 42);
  D.29916 = sig->param_count;
  D.29917 = (int) D.29916;
  D.29918 = D.29917 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.29918);
  mono_mb_free (mb);
  D.29870 = res;
  return D.29870;
  <D.29911>:
  <D.29906>:
  D.29919 = mono_defaults.object_class;
  D.29920 = &D.29919->byval_arg;
  this_local = mono_mb_add_local (mb, D.29920);
  D.29881 = method->klass;
  D.29889 = D.29881->image;
  clause = mono_image_alloc0 (D.29889, 24);
  clause->flags = 2;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29921>; else goto <D.29922>;
    <D.29921>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.29922>:
    D.29923 = ret != 0;
    D.29924 = (long int) D.29923;
    D.29925 = __builtin_expect (D.29924, 0);
    if (D.29925 != 0) goto <D.29926>; else goto <D.29927>;
    <D.29926>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10466, "ret == 0");
    <D.29927>:
  }
  enter_method.377 = enter_method;
  if (enter_method.377 == 0B) goto <D.29929>; else goto <D.29930>;
  <D.29929>:
  {
    struct MonoMethodDesc * desc;

    desc = mono_method_desc_new ("Monitor:Enter", 0);
    D.29931 = mono_defaults.monitor_class;
    enter_method.378 = mono_method_desc_search_in_class (desc, D.29931);
    enter_method = enter_method.378;
    enter_method.377 = enter_method;
    D.29933 = enter_method.377 == 0B;
    D.29934 = (long int) D.29933;
    D.29935 = __builtin_expect (D.29934, 0);
    if (D.29935 != 0) goto <D.29936>; else goto <D.29937>;
    <D.29936>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10473, "enter_method");
    <D.29937>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Monitor:Exit", 0);
    D.29931 = mono_defaults.monitor_class;
    exit_method.379 = mono_method_desc_search_in_class (desc, D.29931);
    exit_method = exit_method.379;
    exit_method.380 = exit_method;
    D.29940 = exit_method.380 == 0B;
    D.29941 = (long int) D.29940;
    D.29942 = __builtin_expect (D.29941, 0);
    if (D.29942 != 0) goto <D.29943>; else goto <D.29944>;
    <D.29943>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10478, "exit_method");
    <D.29944>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Type:GetTypeFromHandle", 0);
    D.29945 = mono_defaults.systemtype_class;
    gettypefromhandle_method.381 = mono_method_desc_search_in_class (desc, D.29945);
    gettypefromhandle_method = gettypefromhandle_method.381;
    gettypefromhandle_method.382 = gettypefromhandle_method;
    D.29948 = gettypefromhandle_method.382 == 0B;
    D.29949 = (long int) D.29948;
    D.29950 = __builtin_expect (D.29949, 0);
    if (D.29950 != 0) goto <D.29951>; else goto <D.29952>;
    <D.29951>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10483, "gettypefromhandle_method");
    <D.29952>:
    mono_method_desc_free (desc);
  }
  <D.29930>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29953>; else goto <D.29954>;
    <D.29953>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.29954>:
    D.29955 = ret != 0;
    D.29956 = (long int) D.29955;
    D.29957 = __builtin_expect (D.29956, 0);
    if (D.29957 != 0) goto <D.29958>; else goto <D.29959>;
    <D.29958>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10487, "ret == 0");
    <D.29959>:
  }
  D.29907 = method->flags;
  D.29908 = (int) D.29907;
  D.29909 = D.29908 & 16;
  if (D.29909 != 0) goto <D.29960>; else goto <D.29961>;
  <D.29960>:
  {
    int index;

    D.29881 = method->klass;
    D.29962 = mono_mb_add_data (mb, D.29881);
    index = (int) D.29962;
    D.29963 = mono_defaults.typehandle_class;
    mono_mb_add_data (mb, D.29963);
    mono_mb_emit_byte (mb, 208);
    mono_mb_emit_i4 (mb, index);
    gettypefromhandle_method.382 = gettypefromhandle_method;
    mono_mb_emit_managed_call (mb, gettypefromhandle_method.382, 0B);
  }
  goto <D.29964>;
  <D.29961>:
  mono_mb_emit_ldarg (mb, 0);
  <D.29964>:
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_stloc (mb, this_local.383);
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.383);
  enter_method.377 = enter_method;
  mono_mb_emit_managed_call (mb, enter_method.377, 0B);
  D.29966 = mono_mb_get_label (mb);
  D.29967 = (unsigned int) D.29966;
  clause->try_offset = D.29967;
  D.29968 = BIT_FIELD_REF <*sig, 8, 80>;
  D.29969 = D.29968 & 64;
  if (D.29969 != 0) goto <D.29970>; else goto <D.29971>;
  <D.29970>:
  mono_mb_emit_ldarg (mb, 0);
  <D.29971>:
  i = 0;
  goto <D.23428>;
  <D.23427>:
  D.29968 = BIT_FIELD_REF <*sig, 8, 80>;
  D.29969 = D.29968 & 64;
  D.29972 = D.29969 != 0;
  D.29973 = (int) D.29972;
  D.29974 = D.29973 + i;
  D.29975 = (unsigned int) D.29974;
  mono_mb_emit_ldarg (mb, D.29975);
  i = i + 1;
  <D.23428>:
  D.29916 = sig->param_count;
  D.29917 = (int) D.29916;
  if (D.29917 > i) goto <D.23427>; else goto <D.23429>;
  <D.23429>:
  if (ctx != 0B) goto <D.29976>; else goto <D.29977>;
  <D.29976>:
  D.29978 = &container->context;
  D.29979 = mono_class_inflate_generic_method (method, D.29978);
  mono_mb_emit_managed_call (mb, D.29979, 0B);
  goto <D.29980>;
  <D.29977>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.29980>:
  D.29899 = sig->ret;
  D.29981 = mono_type_is_void (D.29899);
  if (D.29981 == 0) goto <D.29982>; else goto <D.29983>;
  <D.29982>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_stloc (mb, ret_local.376);
  <D.29983>:
  D.29984 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.29984;
  D.29985 = mono_mb_get_pos (mb);
  D.29986 = (unsigned int) D.29985;
  D.29987 = clause->try_offset;
  D.29988 = D.29986 - D.29987;
  clause->try_len = D.29988;
  D.29989 = mono_mb_get_label (mb);
  D.29990 = (unsigned int) D.29989;
  clause->handler_offset = D.29990;
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.383);
  exit_method.380 = exit_method;
  mono_mb_emit_managed_call (mb, exit_method.380, 0B);
  mono_mb_emit_byte (mb, 220);
  D.29991 = mono_mb_get_pos (mb);
  D.29992 = (unsigned int) D.29991;
  D.29993 = clause->handler_offset;
  D.29994 = D.29992 - D.29993;
  clause->handler_len = D.29994;
  pos.384 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.384);
  D.29899 = sig->ret;
  D.29996 = mono_type_is_void (D.29899);
  if (D.29996 == 0) goto <D.29997>; else goto <D.29998>;
  <D.29997>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.29998>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, clause);
  if (ctx != 0B) goto <D.29999>; else goto <D.30000>;
  <D.29999>:
  {
    struct MonoMethod * def;

    D.29916 = sig->param_count;
    D.29917 = (int) D.29916;
    D.29918 = D.29917 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.29918);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.30001>;
  <D.30000>:
  D.29916 = sig->param_count;
  D.29917 = (int) D.29916;
  D.29918 = D.29917 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.29918);
  <D.30001>:
  mono_mb_free (mb);
  D.29870 = res;
  return D.29870;
}


check_generic_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, void * key, void * def_key)
{
  unsigned char D.30003;
  unsigned char D.30004;
  _Bool D.30005;
  long int D.30006;
  long int D.30007;
  struct MonoMethod * D.30012;
  _Bool D.30017;
  long int D.30018;
  long int D.30019;
  _Bool D.30026;
  long int D.30027;
  long int D.30028;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;
  struct MonoGenericContext * ctx;
  struct MonoMethod * def_method;

  D.30003 = BIT_FIELD_REF <*orig_method, 8, 168>;
  D.30004 = D.30003 & 16;
  D.30005 = D.30004 == 0;
  D.30006 = (long int) D.30005;
  D.30007 = __builtin_expect (D.30006, 0);
  if (D.30007 != 0) goto <D.30008>; else goto <D.30009>;
  <D.30008>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2720, "orig_method->is_inflated");
  <D.30009>:
  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.30010>; else goto <D.30011>;
  <D.30010>:
  D.30012 = res;
  return D.30012;
  <D.30011>:
  def = mono_marshal_find_in_cache (cache, def_key);
  if (def != 0B) goto <D.30013>; else goto <D.30014>;
  <D.30013>:
  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.30015>; else goto <D.30016>;
    <D.30015>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.30016>:
    D.30017 = ret != 0;
    D.30018 = (long int) D.30017;
    D.30019 = __builtin_expect (D.30018, 0);
    if (D.30019 != 0) goto <D.30020>; else goto <D.30021>;
    <D.30020>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2739, "ret == 0");
    <D.30021>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.30022>; else goto <D.30023>;
  <D.30022>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.30023>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.30024>; else goto <D.30025>;
    <D.30024>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.30025>:
    D.30026 = ret != 0;
    D.30027 = (long int) D.30026;
    D.30028 = __builtin_expect (D.30027, 0);
    if (D.30028 != 0) goto <D.30029>; else goto <D.30030>;
    <D.30029>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2745, "ret == 0");
    <D.30030>:
  }
  D.30012 = res;
  return D.30012;
  <D.30014>:
  D.30012 = 0B;
  return D.30012;
}


cache_generic_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx, void * key)
{
  _Bool D.30034;
  long int D.30035;
  long int D.30036;
  _Bool D.30043;
  long int D.30044;
  long int D.30045;
  struct MonoMethod * D.30048;
  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.30032>; else goto <D.30033>;
    <D.30032>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.30033>:
    D.30034 = ret != 0;
    D.30035 = (long int) D.30034;
    D.30036 = __builtin_expect (D.30035, 0);
    if (D.30036 != 0) goto <D.30037>; else goto <D.30038>;
    <D.30037>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2761, "ret == 0");
    <D.30038>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.30039>; else goto <D.30040>;
  <D.30039>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.30040>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.30041>; else goto <D.30042>;
    <D.30041>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.30042>:
    D.30043 = ret != 0;
    D.30044 = (long int) D.30043;
    D.30045 = __builtin_expect (D.30044, 0);
    if (D.30045 != 0) goto <D.30046>; else goto <D.30047>;
    <D.30046>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2767, "ret == 0");
    <D.30047>:
  }
  D.30048 = res;
  return D.30048;
}


mono_marshal_get_unbox_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.30050;
  struct MonoImage * D.30051;
  struct GHashTable * * D.30052;
  struct MonoMethod * D.30055;
  const char * D.30056;
  unsigned char D.30057;
  unsigned char D.30058;
  _Bool D.30059;
  long int D.30060;
  long int D.30061;
  int D.30064;
  unsigned int D.30065;
  short unsigned int D.30066;
  int D.30067;
  int D.30068;
  struct MonoMethodSignature * sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;

  sig = mono_method_signature (method);
  D.30050 = method->klass;
  D.30051 = D.30050->image;
  D.30052 = &D.30051->unbox_wrapper_cache;
  cache = get_cache (D.30052, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.30053>; else goto <D.30054>;
  <D.30053>:
  D.30055 = res;
  return D.30055;
  <D.30054>:
  D.30050 = method->klass;
  D.30056 = method->name;
  mb = mono_mb_new (D.30050, D.30056, 22);
  D.30057 = BIT_FIELD_REF <*sig, 8, 80>;
  D.30058 = D.30057 & 64;
  D.30059 = D.30058 == 0;
  D.30060 = (long int) D.30059;
  D.30061 = __builtin_expect (D.30060, 0);
  if (D.30061 != 0) goto <D.30062>; else goto <D.30063>;
  <D.30062>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10576, "sig->hasthis");
  <D.30063>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  i = 0;
  goto <D.23440>;
  <D.23439>:
  D.30064 = i + 1;
  D.30065 = (unsigned int) D.30064;
  mono_mb_emit_ldarg (mb, D.30065);
  i = i + 1;
  <D.23440>:
  D.30066 = sig->param_count;
  D.30067 = (int) D.30066;
  if (D.30067 > i) goto <D.23439>; else goto <D.23441>;
  <D.23441>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  D.30066 = sig->param_count;
  D.30067 = (int) D.30066;
  D.30068 = D.30067 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.30068);
  mono_mb_free (mb);
  D.30055 = res;
  return D.30055;
}


mono_marshal_get_virtual_stelemref (struct MonoClass * array_class)
{
  unsigned char D.30070;
  _Bool D.30071;
  long int D.30072;
  long int D.30073;
  struct MonoClass * D.30076;
  struct MonoMethod * D.30077;
  int kind;

  D.30070 = array_class->rank;
  D.30071 = D.30070 != 1;
  D.30072 = (long int) D.30071;
  D.30073 = __builtin_expect (D.30072, 0);
  if (D.30073 != 0) goto <D.30074>; else goto <D.30075>;
  <D.30074>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11083, "array_class->rank == 1");
  <D.30075>:
  D.30076 = array_class->element_class;
  kind = get_virtual_stelemref_kind (D.30076);
  D.30077 = get_virtual_stelemref_wrapper (kind);
  return D.30077;
}


get_virtual_stelemref_kind (struct MonoClass * element_class)
{
  struct MonoClass * D.30079;
  int D.30082;
  int D.30083;
  unsigned int D.30088;
  unsigned int D.30089;
  unsigned char D.30091;
  int D.30093;
  unsigned char D.30098;
  unsigned char D.30099;
  unsigned char D.30101;
  int D.30103;
  unsigned int D.30104;

  D.30079 = mono_defaults.object_class;
  if (D.30079 == element_class) goto <D.30080>; else goto <D.30081>;
  <D.30080>:
  D.30082 = 0;
  return D.30082;
  <D.30081>:
  D.30083 = is_monomorphic_array (element_class);
  if (D.30083 != 0) goto <D.30084>; else goto <D.30085>;
  <D.30084>:
  D.30082 = 1;
  return D.30082;
  <D.30085>:
  D.30088 = element_class->flags;
  D.30089 = D.30088 & 32;
  if (D.30089 != 0) goto <D.30086>; else goto <D.30090>;
  <D.30090>:
  D.30091 = element_class->byval_arg.type;
  if (D.30091 == 19) goto <D.30086>; else goto <D.30092>;
  <D.30092>:
  D.30091 = element_class->byval_arg.type;
  if (D.30091 == 30) goto <D.30086>; else goto <D.30087>;
  <D.30086>:
  D.30093 = mono_class_has_variant_generic_params (element_class);
  if (D.30093 == 0) goto <D.30094>; else goto <D.30095>;
  <D.30094>:
  D.30082 = 3;
  return D.30082;
  <D.30095>:
  <D.30087>:
  D.30098 = BIT_FIELD_REF <*element_class, 8, 176>;
  D.30099 = D.30098 & 64;
  if (D.30099 != 0) goto <D.30096>; else goto <D.30100>;
  <D.30100>:
  D.30101 = element_class->rank;
  if (D.30101 != 0) goto <D.30096>; else goto <D.30102>;
  <D.30102>:
  D.30103 = mono_class_has_variant_generic_params (element_class);
  if (D.30103 != 0) goto <D.30096>; else goto <D.30097>;
  <D.30096>:
  D.30082 = 4;
  return D.30082;
  <D.30097>:
  D.30088 = element_class->flags;
  D.30104 = D.30088 & 256;
  if (D.30104 != 0) goto <D.30105>; else goto <D.30106>;
  <D.30105>:
  D.30082 = 1;
  return D.30082;
  <D.30106>:
  D.30082 = 2;
  return D.30082;
}


is_monomorphic_array (struct MonoClass * klass)
{
  unsigned char D.30108;
  gboolean D.30111;
  int iftmp.385;
  unsigned int D.30116;
  unsigned int D.30117;
  unsigned char D.30119;
  unsigned char D.30120;
  struct MonoClass * element_class;

  D.30108 = klass->rank;
  if (D.30108 != 1) goto <D.30109>; else goto <D.30110>;
  <D.30109>:
  D.30111 = 0;
  return D.30111;
  <D.30110>:
  element_class = klass->element_class;
  D.30116 = element_class->flags;
  D.30117 = D.30116 & 256;
  if (D.30117 != 0) goto <D.30113>; else goto <D.30118>;
  <D.30118>:
  D.30119 = BIT_FIELD_REF <*element_class, 8, 160>;
  D.30120 = D.30119 & 8;
  if (D.30120 != 0) goto <D.30113>; else goto <D.30114>;
  <D.30113>:
  iftmp.385 = 1;
  goto <D.30115>;
  <D.30114>:
  iftmp.385 = 0;
  <D.30115>:
  D.30111 = iftmp.385;
  return D.30111;
}


get_virtual_stelemref_wrapper (int kind)
{
  struct MonoMethod * D.30122;
  struct MonoMethod * D.30125;
  const char * D.30126;
  struct MonoClass * D.30127;
  struct MonoMethodSignature * signature.386;
  struct MonoImage * D.30131;
  struct MonoClass * D.30132;
  struct MonoType * D.30133;
  struct MonoClass * D.30134;
  struct MonoType * D.30135;
  struct MonoType * D.30136;
  struct MonoType * D.30137;
  unsigned int array_slot_addr.387;
  unsigned int aklass.388;
  unsigned int vklass.389;
  struct MonoClass * D.30141;
  struct MonoType * D.30142;
  unsigned int vtable.390;
  unsigned int uiid.391;
  struct MonoMethod * D.30145;
  short unsigned int D.30148;
  short unsigned int D.30149;
  _Bool D.30152;
  long int D.30153;
  long int D.30154;
  _Bool D.30161;
  long int D.30162;
  long int D.30163;
  _Bool D.30169;
  long int D.30170;
  long int D.30171;
  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.30122 = cached_methods[kind];
      if (D.30122 != 0B) goto <D.30123>; else goto <D.30124>;
      <D.30123>:
      D.30125 = cached_methods[kind];
      return D.30125;
      <D.30124>:
      D.30126 = strelemref_wrapper_name[kind];
      name = monoeg_g_strdup_printf ("virt_stelemref_%s", D.30126);
      D.30127 = mono_defaults.object_class;
      mb = mono_mb_new (D.30127, name, 21);
      monoeg_g_free (name);
      signature.386 = signature;
      if (signature.386 == 0B) goto <D.30129>; else goto <D.30130>;
      <D.30129>:
      {
        struct MonoMethodSignature * sig;

        D.30131 = mono_defaults.corlib;
        sig = mono_metadata_signature_alloc (D.30131, 2);
        D.30132 = mono_defaults.void_class;
        D.30133 = &D.30132->byval_arg;
        sig->ret = D.30133;
        sig->hasthis = 1;
        D.30134 = mono_defaults.int_class;
        D.30135 = &D.30134->byval_arg;
        sig->params[0] = D.30135;
        D.30127 = mono_defaults.object_class;
        D.30136 = &D.30127->byval_arg;
        sig->params[1] = D.30136;
        signature = sig;
      }
      <D.30130>:
      param_names[0] = "index";
      param_names[1] = "value";
      mono_mb_set_param_names (mb, &param_names);
      switch (kind) <default: <D.23493>, case 0: <D.23487>, case 1: <D.23490>, case 2: <D.23491>, case 3: <D.23492>, case 4: <D.23489>>
      <D.23487>:
      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.23488>;
      <D.23489>:
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      aklass = mono_mb_add_local (mb, D.30135);
      D.30127 = mono_defaults.object_class;
      D.30137 = &D.30127->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.30137);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      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.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      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.23488>;
      <D.23490>:
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      aklass = mono_mb_add_local (mb, D.30135);
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      vklass = mono_mb_add_local (mb, D.30135);
      D.30127 = mono_defaults.object_class;
      D.30137 = &D.30127->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.30137);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      b2 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      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.23488>;
      <D.23491>:
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      aklass = mono_mb_add_local (mb, D.30135);
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      vklass = mono_mb_add_local (mb, D.30135);
      D.30127 = mono_defaults.object_class;
      D.30137 = &D.30127->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.30137);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      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.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 68);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      mono_mb_emit_icon (mb, 1);
      mono_mb_emit_byte (mb, 89);
      mono_mb_emit_icon (mb, 4);
      mono_mb_emit_byte (mb, 90);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 77);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      b3 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      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.23488>;
      <D.23492>:
      D.30127 = mono_defaults.object_class;
      D.30137 = &D.30127->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.30137);
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      aklass = mono_mb_add_local (mb, D.30135);
      D.30134 = mono_defaults.int_class;
      D.30135 = &D.30134->byval_arg;
      vtable = mono_mb_add_local (mb, D.30135);
      D.30141 = mono_defaults.int32_class;
      D.30142 = &D.30141->byval_arg;
      uiid = mono_mb_add_local (mb, D.30142);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      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.390 = (unsigned int) vtable;
      mono_mb_emit_stloc (mb, vtable.390);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 58);
      mono_mb_emit_byte (mb, 73);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_stloc (mb, uiid.391);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      vtable.390 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.390);
      mono_mb_emit_ldflda (mb, 20);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 66);
      vtable.390 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.390);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      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.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      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.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      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.23488>;
      <D.23493>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_ldarg (mb, 2);
      D.30145 = mono_marshal_get_stelemref ();
      mono_mb_emit_managed_call (mb, D.30145, 0B);
      mono_mb_emit_byte (mb, 42);
      if (1 != 0) goto <D.30146>; else goto <D.30147>;
      <D.30146>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11054, "0");
      <D.30147>:
      <D.23488>:
      signature.386 = signature;
      res = mono_mb_create_method (mb, signature.386, 4);
      D.30148 = res->flags;
      D.30149 = D.30148 | 64;
      res->flags = D.30149;
      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.30150>; else goto <D.30151>;
        <D.30150>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.30151>:
        D.30152 = ret != 0;
        D.30153 = (long int) D.30152;
        D.30154 = __builtin_expect (D.30153, 0);
        if (D.30154 != 0) goto <D.30155>; else goto <D.30156>;
        <D.30155>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11065, "ret == 0");
        <D.30156>:
      }
      D.30122 = cached_methods[kind];
      if (D.30122 == 0B) goto <D.30157>; else goto <D.30158>;
      <D.30157>:
      cached_methods[kind] = res;
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.30159>; else goto <D.30160>;
        <D.30159>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.30160>:
        D.30161 = ret != 0;
        D.30162 = (long int) D.30161;
        D.30163 = __builtin_expect (D.30162, 0);
        if (D.30163 != 0) goto <D.30164>; else goto <D.30165>;
        <D.30164>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11068, "ret == 0");
        <D.30165>:
      }
      goto <D.30166>;
      <D.30158>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.30167>; else goto <D.30168>;
        <D.30167>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.30168>:
        D.30169 = ret != 0;
        D.30170 = (long int) D.30169;
        D.30171 = __builtin_expect (D.30170, 0);
        if (D.30171 != 0) goto <D.30172>; else goto <D.30173>;
        <D.30172>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11070, "ret == 0");
        <D.30173>:
      }
      mono_free_method (res);
      <D.30166>:
      mono_mb_free (mb);
      D.30125 = cached_methods[kind];
      return D.30125;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


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

  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.392 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.392);
}


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

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


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

  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.393 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.393);
}


mono_marshal_get_virtual_stelemref_wrappers (int * nwrappers)
{
  unsigned int i.394;
  unsigned int D.30180;
  struct MonoMethod * * D.30181;
  struct MonoMethod * D.30182;
  struct MonoMethod * * D.30183;
  struct MonoMethod * * res;
  int i;

  *nwrappers = 5;
  res = monoeg_malloc0 (20);
  i = 0;
  goto <D.23507>;
  <D.23506>:
  i.394 = (unsigned int) i;
  D.30180 = i.394 * 4;
  D.30181 = res + D.30180;
  D.30182 = get_virtual_stelemref_wrapper (i);
  *D.30181 = D.30182;
  i = i + 1;
  <D.23507>:
  if (i <= 4) goto <D.23506>; else goto <D.23508>;
  <D.23508>:
  D.30183 = res;
  return D.30183;
}


mono_marshal_get_stelemref ()
{
  struct MonoMethod * ret.395;
  struct MonoMethod * D.30188;
  struct MonoClass * D.30189;
  struct MonoImage * D.30190;
  struct MonoClass * D.30191;
  struct MonoType * D.30192;
  struct MonoType * D.30193;
  struct MonoClass * D.30194;
  struct MonoType * D.30195;
  struct MonoType * D.30196;
  unsigned int array_slot_addr.396;
  unsigned int aklass.397;
  unsigned int vklass.398;
  int D.30200;
  int b4.399;
  unsigned int D.30202;
  unsigned int D.30203;
  int D.30204;
  struct MonoMethod * ret.400;
  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.395 = ret;
  if (ret.395 != 0B) goto <D.30186>; else goto <D.30187>;
  <D.30186>:
  D.30188 = ret;
  return D.30188;
  <D.30187>:
  D.30189 = mono_defaults.object_class;
  mb = mono_mb_new (D.30189, "stelemref", 21);
  D.30190 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.30190, 3);
  D.30191 = mono_defaults.void_class;
  D.30192 = &D.30191->byval_arg;
  sig->ret = D.30192;
  D.30189 = mono_defaults.object_class;
  D.30193 = &D.30189->byval_arg;
  sig->params[0] = D.30193;
  D.30194 = mono_defaults.int_class;
  D.30195 = &D.30194->byval_arg;
  sig->params[1] = D.30195;
  D.30189 = mono_defaults.object_class;
  D.30193 = &D.30189->byval_arg;
  sig->params[2] = D.30193;
  D.30194 = mono_defaults.int_class;
  D.30195 = &D.30194->byval_arg;
  aklass = mono_mb_add_local (mb, D.30195);
  D.30194 = mono_defaults.int_class;
  D.30195 = &D.30194->byval_arg;
  vklass = mono_mb_add_local (mb, D.30195);
  D.30189 = mono_defaults.object_class;
  D.30196 = &D.30189->this_arg;
  array_slot_addr = mono_mb_add_local (mb, D.30196);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.30189 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.30189);
  array_slot_addr.396 = (unsigned int) array_slot_addr;
  mono_mb_emit_stloc (mb, array_slot_addr.396);
  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.397 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.397);
  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.398 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.398);
  vklass.398 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.398);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  b2 = mono_mb_emit_branch (mb, 68);
  vklass.398 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.398);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 77);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  b3 = mono_mb_emit_branch (mb, 64);
  D.30200 = mono_mb_get_label (mb);
  copy_pos = (guint32) D.30200;
  mono_mb_patch_branch (mb, b1);
  array_slot_addr.396 = (unsigned int) array_slot_addr;
  mono_mb_emit_ldloc (mb, array_slot_addr.396);
  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.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_icall (mb, mono_object_isinst);
  b4 = mono_mb_emit_branch (mb, 58);
  b4.399 = (int) b4;
  D.30202 = copy_pos - b4;
  D.30203 = D.30202 + 4294967292;
  D.30204 = (int) D.30203;
  mono_mb_patch_addr (mb, b4.399, D.30204);
  mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
  mono_mb_emit_byte (mb, 42);
  ret.400 = mono_mb_create_method (mb, sig, 4);
  ret = ret.400;
  mono_mb_free (mb);
  ret.395 = ret;
  info = mono_wrapper_info_create (ret.395, 0);
  ret.395 = ret;
  mono_marshal_set_wrapper_info (ret.395, info);
  D.30188 = ret;
  return D.30188;
}


mono_marshal_get_gsharedvt_in_wrapper ()
{
  struct MonoMethod * ret.401;
  struct MonoMethod * D.30210;
  struct MonoClass * D.30211;
  struct MonoImage * D.30212;
  struct MonoClass * D.30213;
  struct MonoType * D.30214;
  struct MonoMethod * ret.402;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.401 = ret;
  if (ret.401 != 0B) goto <D.30208>; else goto <D.30209>;
  <D.30208>:
  D.30210 = ret;
  return D.30210;
  <D.30209>:
  D.30211 = mono_defaults.object_class;
  mb = mono_mb_new (D.30211, "gsharedvt_in", 25);
  D.30212 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.30212, 0);
  D.30213 = mono_defaults.void_class;
  D.30214 = &D.30213->byval_arg;
  sig->ret = D.30214;
  mono_mb_emit_byte (mb, 42);
  ret.402 = mono_mb_create_method (mb, sig, 4);
  ret = ret.402;
  mono_mb_free (mb);
  ret.401 = ret;
  info = mono_wrapper_info_create (ret.401, 18);
  ret.401 = ret;
  mono_marshal_set_wrapper_info (ret.401, info);
  D.30210 = ret;
  return D.30210;
}


mono_marshal_get_gsharedvt_out_wrapper ()
{
  struct MonoMethod * ret.403;
  struct MonoMethod * D.30220;
  struct MonoClass * D.30221;
  struct MonoImage * D.30222;
  struct MonoClass * D.30223;
  struct MonoType * D.30224;
  struct MonoMethod * ret.404;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.403 = ret;
  if (ret.403 != 0B) goto <D.30218>; else goto <D.30219>;
  <D.30218>:
  D.30220 = ret;
  return D.30220;
  <D.30219>:
  D.30221 = mono_defaults.object_class;
  mb = mono_mb_new (D.30221, "gsharedvt_out", 25);
  D.30222 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.30222, 0);
  D.30223 = mono_defaults.void_class;
  D.30224 = &D.30223->byval_arg;
  sig->ret = D.30224;
  mono_mb_emit_byte (mb, 42);
  ret.404 = mono_mb_create_method (mb, sig, 4);
  ret = ret.404;
  mono_mb_free (mb);
  ret.403 = ret;
  info = mono_wrapper_info_create (ret.403, 19);
  ret.403 = ret;
  mono_marshal_set_wrapper_info (ret.403, info);
  D.30220 = ret;
  return D.30220;
}


mono_marshal_get_array_address (int rank, int elem_size)
{
  _Bool D.30229;
  long int D.30230;
  long int D.30231;
  struct ArrayElemAddr * elem_addr_cache.405;
  unsigned int i.406;
  unsigned int D.30236;
  struct ArrayElemAddr * D.30237;
  int D.30238;
  int D.30241;
  int elem_addr_cache_next.407;
  _Bool D.30247;
  long int D.30248;
  long int D.30249;
  struct MonoMethod * D.30254;
  unsigned int rank.408;
  unsigned int D.30256;
  struct MonoImage * D.30257;
  int D.30258;
  unsigned int D.30259;
  struct MonoClass * D.30260;
  struct MonoType * D.30261;
  struct MonoClass * D.30262;
  struct MonoType * D.30263;
  int D.30264;
  struct MonoClass * D.30265;
  struct MonoType * D.30266;
  unsigned int bounds.409;
  unsigned int ind.410;
  unsigned int D.30269;
  unsigned int D.30270;
  unsigned int D.30271;
  unsigned int D.30272;
  int D.30273;
  unsigned int realidx.411;
  int D.30275;
  unsigned int D.30276;
  int * D.30277;
  unsigned int D.30278;
  int D.30279;
  int D.30280;
  unsigned int D.30281;
  unsigned int branch_pos.412;
  _Bool D.30285;
  long int D.30286;
  long int D.30287;
  int elem_addr_cache_size.413;
  unsigned int new_size.414;
  unsigned int D.30300;
  unsigned int elem_addr_cache_size.415;
  unsigned int D.30302;
  unsigned int elem_addr_cache_next.416;
  unsigned int D.30304;
  struct ArrayElemAddr * D.30305;
  int elem_addr_cache_next.417;
  unsigned int rank.418;
  unsigned int elem_size.419;
  _Bool D.30311;
  long int D.30312;
  long int D.30313;
  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.30227>; else goto <D.30228>;
    <D.30227>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.30228>:
    D.30229 = ret != 0;
    D.30230 = (long int) D.30229;
    D.30231 = __builtin_expect (D.30230, 0);
    if (D.30231 != 0) goto <D.30232>; else goto <D.30233>;
    <D.30232>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11364, "ret == 0");
    <D.30233>:
  }
  i = 0;
  goto <D.23562>;
  <D.23561>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  D.30238 = D.30237->rank;
  if (D.30238 == rank) goto <D.30239>; else goto <D.30240>;
  <D.30239>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  D.30241 = D.30237->elem_size;
  if (D.30241 == elem_size) goto <D.30242>; else goto <D.30243>;
  <D.30242>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  ret = D.30237->method;
  goto <D.23560>;
  <D.30243>:
  <D.30240>:
  i = i + 1;
  <D.23562>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.23561>; else goto <D.23560>;
  <D.23560>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.30245>; else goto <D.30246>;
    <D.30245>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.30246>:
    D.30247 = ret != 0;
    D.30248 = (long int) D.30247;
    D.30249 = __builtin_expect (D.30248, 0);
    if (D.30249 != 0) goto <D.30250>; else goto <D.30251>;
    <D.30250>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11371, "ret == 0");
    <D.30251>:
  }
  if (ret != 0B) goto <D.30252>; else goto <D.30253>;
  <D.30252>:
  D.30254 = ret;
  return D.30254;
  <D.30253>:
  rank.408 = (unsigned int) rank;
  D.30256 = rank.408 * 4;
  branch_positions = monoeg_malloc0 (D.30256);
  D.30257 = mono_defaults.corlib;
  D.30258 = rank + 1;
  D.30259 = (unsigned int) D.30258;
  sig = mono_metadata_signature_alloc (D.30257, D.30259);
  D.30260 = mono_defaults.int_class;
  D.30261 = &D.30260->byval_arg;
  sig->ret = D.30261;
  D.30262 = mono_defaults.object_class;
  D.30263 = &D.30262->byval_arg;
  sig->params[0] = D.30263;
  i = 0;
  goto <D.23565>;
  <D.23564>:
  D.30264 = i + 1;
  D.30265 = mono_defaults.int32_class;
  D.30266 = &D.30265->byval_arg;
  sig->params[D.30264] = D.30266;
  i = i + 1;
  <D.23565>:
  if (i < rank) goto <D.23564>; else goto <D.23566>;
  <D.23566>:
  D.30262 = mono_defaults.object_class;
  mb = mono_mb_new (D.30262, "ElementAddr", 7);
  D.30260 = mono_defaults.int_class;
  D.30261 = &D.30260->byval_arg;
  bounds = mono_mb_add_local (mb, D.30261);
  D.30265 = mono_defaults.int32_class;
  D.30266 = &D.30265->byval_arg;
  ind = mono_mb_add_local (mb, D.30266);
  D.30265 = mono_defaults.int32_class;
  D.30266 = &D.30265->byval_arg;
  realidx = mono_mb_add_local (mb, D.30266);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 77);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_stloc (mb, bounds.409);
  mono_mb_emit_ldarg (mb, 1);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  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.410 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.410);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.30269 = mono_mb_emit_branch (mb, 65);
  branch_pos = (int) D.30269;
  i = 1;
  goto <D.23568>;
  <D.23567>:
  D.30264 = i + 1;
  D.30270 = (unsigned int) D.30264;
  mono_mb_emit_ldarg (mb, D.30270);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.30271 = i.406 * 8;
  D.30272 = D.30271 + 4;
  D.30273 = (int) D.30272;
  mono_mb_emit_icon (mb, D.30273);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_stloc (mb, realidx.411);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.411);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.30271 = i.406 * 8;
  D.30275 = (int) D.30271;
  mono_mb_emit_icon (mb, D.30275);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  i.406 = (unsigned int) i;
  D.30276 = i.406 * 4;
  D.30277 = branch_positions + D.30276;
  D.30278 = mono_mb_emit_branch (mb, 65);
  D.30279 = (int) D.30278;
  *D.30277 = D.30279;
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.30271 = i.406 * 8;
  D.30275 = (int) D.30271;
  mono_mb_emit_icon (mb, D.30275);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 90);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.411);
  mono_mb_emit_byte (mb, 88);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.410);
  i = i + 1;
  <D.23568>:
  if (i < rank) goto <D.23567>; else goto <D.23569>;
  <D.23569>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  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.23571>;
  <D.23570>:
  i.406 = (unsigned int) i;
  D.30276 = i.406 * 4;
  D.30277 = branch_positions + D.30276;
  D.30280 = *D.30277;
  D.30281 = (unsigned int) D.30280;
  mono_mb_patch_branch (mb, D.30281);
  i = i + 1;
  <D.23571>:
  if (i < rank) goto <D.23570>; else goto <D.23572>;
  <D.23572>:
  branch_pos.412 = (unsigned int) branch_pos;
  mono_mb_patch_branch (mb, branch_pos.412);
  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.30283>; else goto <D.30284>;
    <D.30283>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.30284>:
    D.30285 = ret != 0;
    D.30286 = (long int) D.30285;
    D.30287 = __builtin_expect (D.30286, 0);
    if (D.30287 != 0) goto <D.30288>; else goto <D.30289>;
    <D.30288>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11475, "ret == 0");
    <D.30289>:
  }
  i = 0;
  goto <D.23576>;
  <D.23575>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  D.30238 = D.30237->rank;
  if (D.30238 == rank) goto <D.30290>; else goto <D.30291>;
  <D.30290>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  D.30241 = D.30237->elem_size;
  if (D.30241 == elem_size) goto <D.30292>; else goto <D.30293>;
  <D.30292>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.30236 = i.406 * 12;
  D.30237 = elem_addr_cache.405 + D.30236;
  ret = D.30237->method;
  cached = 1;
  goto <D.23574>;
  <D.30293>:
  <D.30291>:
  i = i + 1;
  <D.23576>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.23575>; else goto <D.23574>;
  <D.23574>:
  if (cached == 0) goto <D.30294>; else goto <D.30295>;
  <D.30294>:
  {
    struct WrapperInfo * info;

    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_size.413 = elem_addr_cache_size;
    if (elem_addr_cache_next.407 >= elem_addr_cache_size.413) goto <D.30297>; else goto <D.30298>;
    <D.30297>:
    {
      int new_size;
      struct ArrayElemAddr * new_array;

      elem_addr_cache_size.413 = elem_addr_cache_size;
      new_size = elem_addr_cache_size.413 + 4;
      new_size.414 = (unsigned int) new_size;
      D.30300 = new_size.414 * 12;
      new_array = monoeg_malloc0 (D.30300);
      elem_addr_cache.405 = elem_addr_cache;
      elem_addr_cache_size.413 = elem_addr_cache_size;
      elem_addr_cache_size.415 = (unsigned int) elem_addr_cache_size.413;
      D.30302 = elem_addr_cache_size.415 * 12;
      memcpy (new_array, elem_addr_cache.405, D.30302);
      elem_addr_cache.405 = elem_addr_cache;
      monoeg_g_free (elem_addr_cache.405);
      elem_addr_cache = new_array;
      elem_addr_cache_size = new_size;
    }
    <D.30298>:
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.30304 = elem_addr_cache_next.416 * 12;
    D.30305 = elem_addr_cache.405 + D.30304;
    D.30305->rank = rank;
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.30304 = elem_addr_cache_next.416 * 12;
    D.30305 = elem_addr_cache.405 + D.30304;
    D.30305->elem_size = elem_size;
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.30304 = elem_addr_cache_next.416 * 12;
    D.30305 = elem_addr_cache.405 + D.30304;
    D.30305->method = ret;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.417 = elem_addr_cache_next.407 + 1;
    elem_addr_cache_next = elem_addr_cache_next.417;
    info = mono_wrapper_info_create (ret, 1);
    rank.418 = (unsigned int) rank;
    info->d.element_addr.rank = rank.418;
    elem_size.419 = (unsigned int) elem_size;
    info->d.element_addr.elem_size = elem_size.419;
    mono_marshal_set_wrapper_info (ret, info);
  }
  <D.30295>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.30309>; else goto <D.30310>;
    <D.30309>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.30310>:
    D.30311 = ret != 0;
    D.30312 = (long int) D.30311;
    D.30313 = __builtin_expect (D.30312, 0);
    if (D.30313 != 0) goto <D.30314>; else goto <D.30315>;
    <D.30314>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11505, "ret == 0");
    <D.30315>:
  }
  D.30254 = ret;
  return D.30254;
}


mono_marshal_get_array_accessor_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.30319;
  struct MonoImage * D.30320;
  struct GHashTable * * D.30321;
  struct MonoMethod * D.30324;
  struct MonoMethodSignature * D.30325;
  const char * D.30326;
  unsigned char D.30327;
  unsigned char D.30328;
  _Bool D.30331;
  int D.30332;
  int D.30333;
  unsigned int D.30334;
  short unsigned int D.30335;
  int D.30336;
  struct MonoGenericContext * D.30339;
  struct MonoMethod * D.30340;
  int D.30344;
  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.30317>; else goto <D.30318>;
  <D.30317>:
  cache = 0B;
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11537);
  <D.30318>:
  D.30319 = method->klass;
  D.30320 = D.30319->image;
  D.30321 = &D.30320->array_accessor_cache;
  cache = get_cache (D.30321, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.30322>; else goto <D.30323>;
  <D.30322>:
  D.30324 = res;
  return D.30324;
  <D.30323>:
  D.30319 = method->klass;
  D.30320 = D.30319->image;
  D.30325 = mono_method_signature (method);
  sig = signature_dup (D.30320, D.30325);
  sig->pinvoke = 0;
  D.30319 = method->klass;
  D.30326 = method->name;
  mb = mono_mb_new (D.30319, D.30326, 25);
  D.30327 = BIT_FIELD_REF <*sig, 8, 80>;
  D.30328 = D.30327 & 64;
  if (D.30328 != 0) goto <D.30329>; else goto <D.30330>;
  <D.30329>:
  mono_mb_emit_ldarg (mb, 0);
  <D.30330>:
  i = 0;
  goto <D.23594>;
  <D.23593>:
  D.30327 = BIT_FIELD_REF <*sig, 8, 80>;
  D.30328 = D.30327 & 64;
  D.30331 = D.30328 != 0;
  D.30332 = (int) D.30331;
  D.30333 = D.30332 + i;
  D.30334 = (unsigned int) D.30333;
  mono_mb_emit_ldarg (mb, D.30334);
  i = i + 1;
  <D.23594>:
  D.30335 = sig->param_count;
  D.30336 = (int) D.30335;
  if (D.30336 > i) goto <D.23593>; else goto <D.23595>;
  <D.23595>:
  if (ctx != 0B) goto <D.30337>; else goto <D.30338>;
  <D.30337>:
  D.30339 = &container->context;
  D.30340 = mono_class_inflate_generic_method (method, D.30339);
  mono_mb_emit_managed_call (mb, D.30340, 0B);
  goto <D.30341>;
  <D.30338>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.30341>:
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.30342>; else goto <D.30343>;
  <D.30342>:
  {
    struct MonoMethod * def;

    D.30335 = sig->param_count;
    D.30336 = (int) D.30335;
    D.30344 = D.30336 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.30344);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.30345>;
  <D.30343>:
  D.30335 = sig->param_count;
  D.30336 = (int) D.30335;
  D.30344 = D.30336 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.30344);
  info = mono_wrapper_info_create (res, 20);
  info->d.array_accessor.method = method;
  mono_marshal_set_wrapper_info (res, info);
  <D.30345>:
  mono_mb_free (mb);
  D.30324 = res;
  return D.30324;
}


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

  res = monoeg_try_malloc (size);
  if (res == 0B) goto <D.30347>; else goto <D.30348>;
  <D.30347>:
  mono_gc_out_of_memory (size);
  <D.30348>:
  D.30349 = res;
  return D.30349;
}


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


mono_marshal_free_array (void * * ptr, int size)
{
  unsigned int i.420;
  unsigned int D.30354;
  void * * D.30355;
  void * D.30356;
  int i;

  if (ptr == 0B) goto <D.30351>; else goto <D.30352>;
  <D.30351>:
  return;
  <D.30352>:
  i = 0;
  goto <D.23610>;
  <D.23609>:
  i.420 = (unsigned int) i;
  D.30354 = i.420 * 4;
  D.30355 = ptr + D.30354;
  D.30356 = *D.30355;
  if (D.30356 != 0B) goto <D.30357>; else goto <D.30358>;
  <D.30357>:
  i.420 = (unsigned int) i;
  D.30354 = i.420 * 4;
  D.30355 = ptr + D.30354;
  D.30356 = *D.30355;
  monoeg_g_free (D.30356);
  <D.30358>:
  i = i + 1;
  <D.23610>:
  if (i < size) goto <D.23609>; else goto <D.23611>;
  <D.23611>:
}


mono_marshal_string_to_utf16 (struct MonoString * s)
{
  void * D.30360;
  void * iftmp.421;

  if (s != 0B) goto <D.30362>; else goto <D.30363>;
  <D.30362>:
  iftmp.421 = mono_string_chars (s);
  goto <D.30364>;
  <D.30363>:
  iftmp.421 = 0B;
  <D.30364>:
  D.30360 = iftmp.421;
  return D.30360;
}


mono_marshal_set_last_error ()
{
  unsigned int last_error_tls_id.422;
  int * D.30367;
  int D.30368;
  void * D.30369;

  last_error_tls_id.422 = last_error_tls_id;
  D.30367 = __errno_location ();
  D.30368 = *D.30367;
  D.30369 = (void *) D.30368;
  mono_native_tls_set_value (last_error_tls_id.422, D.30369);
}


mono_native_tls_set_value (pthread_key_t key, void * value)
{
  int D.30370;
  int D.30371;
  _Bool D.30372;

  D.30371 = pthread_setspecific (key, value);
  D.30372 = D.30371 == 0;
  D.30370 = (int) D.30372;
  return D.30370;
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (struct MonoArray * src, gint32 start_index, void * dest, gint32 length)
{
  _Bool D.30374;
  long int D.30375;
  long int D.30376;
  _Bool D.30381;
  long int D.30382;
  long int D.30383;
  struct MonoVTable * D.30388;
  struct MonoClass * D.30389;
  unsigned char D.30390;
  struct MonoException * D.30393;
  struct MonoException * D.30396;
  struct MonoException * D.30399;
  int D.30400;
  unsigned int D.30401;
  unsigned int D.30402;
  struct MonoException * D.30405;
  double[0:] * D.30406;
  int D.30407;
  sizetype D.30408;
  int D.30409;
  unsigned int D.30410;
  int element_size;
  void * source_addr;

  D.30374 = src == 0B;
  D.30375 = (long int) D.30374;
  D.30376 = __builtin_expect (D.30375, 0);
  if (D.30376 != 0) goto <D.30377>; else goto <D.30378>;
  <D.30377>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.30379>; else goto <D.30380>;
    <D.30379>:
    <D.30380>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.30378>:
  D.30381 = dest == 0B;
  D.30382 = (long int) D.30381;
  D.30383 = __builtin_expect (D.30382, 0);
  if (D.30383 != 0) goto <D.30384>; else goto <D.30385>;
  <D.30384>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.30386>; else goto <D.30387>;
    <D.30386>:
    <D.30387>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.30385>:
  D.30388 = src->obj.vtable;
  D.30389 = D.30388->klass;
  D.30390 = D.30389->rank;
  if (D.30390 != 1) goto <D.30391>; else goto <D.30392>;
  <D.30391>:
  D.30393 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.30393);
  <D.30392>:
  if (start_index < 0) goto <D.30394>; else goto <D.30395>;
  <D.30394>:
  D.30396 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.30396);
  <D.30395>:
  if (length < 0) goto <D.30397>; else goto <D.30398>;
  <D.30397>:
  D.30399 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.30399);
  <D.30398>:
  D.30400 = start_index + length;
  D.30401 = (unsigned int) D.30400;
  D.30402 = mono_array_length (src);
  if (D.30401 > D.30402) goto <D.30403>; else goto <D.30404>;
  <D.30403>:
  D.30405 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.30405);
  <D.30404>:
  D.30388 = src->obj.vtable;
  D.30389 = D.30388->klass;
  element_size = mono_array_element_size (D.30389);
  D.30406 = &src->vector;
  D.30407 = element_size * start_index;
  D.30408 = (sizetype) D.30407;
  source_addr = D.30406 + D.30408;
  D.30409 = length * element_size;
  D.30410 = (unsigned int) D.30409;
  memcpy (dest, source_addr, D.30410);
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (void * src, gint32 start_index, struct MonoArray * dest, gint32 length)
{
  _Bool D.30411;
  long int D.30412;
  long int D.30413;
  _Bool D.30418;
  long int D.30419;
  long int D.30420;
  struct MonoVTable * D.30425;
  struct MonoClass * D.30426;
  unsigned char D.30427;
  struct MonoException * D.30430;
  struct MonoException * D.30433;
  struct MonoException * D.30436;
  int D.30437;
  unsigned int D.30438;
  unsigned int D.30439;
  struct MonoException * D.30442;
  double[0:] * D.30443;
  int D.30444;
  sizetype D.30445;
  int D.30446;
  unsigned int D.30447;
  int element_size;
  void * dest_addr;

  D.30411 = src == 0B;
  D.30412 = (long int) D.30411;
  D.30413 = __builtin_expect (D.30412, 0);
  if (D.30413 != 0) goto <D.30414>; else goto <D.30415>;
  <D.30414>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.30416>; else goto <D.30417>;
    <D.30416>:
    <D.30417>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.30415>:
  D.30418 = dest == 0B;
  D.30419 = (long int) D.30418;
  D.30420 = __builtin_expect (D.30419, 0);
  if (D.30420 != 0) goto <D.30421>; else goto <D.30422>;
  <D.30421>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.30423>; else goto <D.30424>;
    <D.30423>:
    <D.30424>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.30422>:
  D.30425 = dest->obj.vtable;
  D.30426 = D.30425->klass;
  D.30427 = D.30426->rank;
  if (D.30427 != 1) goto <D.30428>; else goto <D.30429>;
  <D.30428>:
  D.30430 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.30430);
  <D.30429>:
  if (start_index < 0) goto <D.30431>; else goto <D.30432>;
  <D.30431>:
  D.30433 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.30433);
  <D.30432>:
  if (length < 0) goto <D.30434>; else goto <D.30435>;
  <D.30434>:
  D.30436 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.30436);
  <D.30435>:
  D.30437 = start_index + length;
  D.30438 = (unsigned int) D.30437;
  D.30439 = mono_array_length (dest);
  if (D.30438 > D.30439) goto <D.30440>; else goto <D.30441>;
  <D.30440>:
  D.30442 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.30442);
  <D.30441>:
  D.30425 = dest->obj.vtable;
  D.30426 = D.30425->klass;
  element_size = mono_array_element_size (D.30426);
  D.30443 = &dest->vector;
  D.30444 = element_size * start_index;
  D.30445 = (sizetype) D.30444;
  dest_addr = D.30443 + D.30445;
  D.30446 = length * element_size;
  D.30447 = (unsigned int) D.30446;
  memcpy (dest_addr, src, D.30447);
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char * ptr)
{
  struct MonoString * D.30450;
  struct MonoDomain * D.30451;

  if (ptr == 0B) goto <D.30448>; else goto <D.30449>;
  <D.30448>:
  D.30450 = 0B;
  return D.30450;
  <D.30449>:
  D.30451 = mono_domain_get ();
  D.30450 = mono_string_new (D.30451, ptr);
  return D.30450;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char * ptr, gint32 len)
{
  struct MonoException * D.30455;
  struct MonoString * D.30456;
  struct MonoDomain * D.30457;
  unsigned int len.423;

  if (ptr == 0B) goto <D.30453>; else goto <D.30454>;
  <D.30453>:
  D.30455 = mono_get_exception_argument_null ("ptr");
  mono_raise_exception (D.30455);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11736);
  D.30456 = 0B;
  return D.30456;
  <D.30454>:
  D.30457 = mono_domain_get ();
  len.423 = (unsigned int) len;
  D.30456 = mono_string_new_len (D.30457, ptr, len.423);
  return D.30456;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni (guint16 * ptr)
{
  struct MonoString * D.30462;
  guint16 * t.424;
  short unsigned int D.30464;
  struct MonoDomain * domain;
  int len;
  guint16 * t;

  domain = mono_domain_get ();
  len = 0;
  t = ptr;
  if (ptr == 0B) goto <D.30460>; else goto <D.30461>;
  <D.30460>:
  D.30462 = 0B;
  return D.30462;
  <D.30461>:
  goto <D.23659>;
  <D.23658>:
  len = len + 1;
  <D.23659>:
  t.424 = t;
  t = t.424 + 2;
  D.30464 = *t.424;
  if (D.30464 != 0) goto <D.23658>; else goto <D.23660>;
  <D.23660>:
  D.30462 = mono_string_new_utf16 (domain, ptr, len);
  return D.30462;
}


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

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


ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error ()
{
  guint32 D.30471;
  unsigned int last_error_tls_id.425;
  void * D.30473;

  last_error_tls_id.425 = last_error_tls_id;
  D.30473 = pthread_getspecific (last_error_tls_id.425);
  D.30471 = (guint32) D.30473;
  return D.30471;
}


ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (struct MonoReflectionType * rtype)
{
  _Bool D.30475;
  long int D.30476;
  long int D.30477;
  int D.30482;
  struct MonoException * D.30485;
  unsigned int D.30486;
  const char * D.30489;
  guint32 D.30490;
  int D.30491;
  struct MonoClass * klass;
  struct MonoType * type;
  guint32 layout;

  D.30475 = rtype == 0B;
  D.30476 = (long int) D.30475;
  D.30477 = __builtin_expect (D.30476, 0);
  if (D.30477 != 0) goto <D.30478>; else goto <D.30479>;
  <D.30478>:
  {
    struct MonoException * ex;

    if (rtype != 0B) goto <D.30480>; else goto <D.30481>;
    <D.30480>:
    <D.30481>:
    ex = mono_get_exception_argument_null ("rtype");
    mono_raise_exception (ex);
  }
  <D.30479>:
  type = rtype->type;
  klass = mono_class_from_mono_type (type);
  D.30482 = mono_class_init (klass);
  if (D.30482 == 0) goto <D.30483>; else goto <D.30484>;
  <D.30483>:
  D.30485 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.30485);
  <D.30484>:
  D.30486 = klass->flags;
  layout = D.30486 & 24;
  if (layout == 0) goto <D.30487>; else goto <D.30488>;
  <D.30487>:
  {
    gchar * msg;
    struct MonoException * exc;

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


ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (struct MonoObject * obj, void * dst, MonoBoolean delete_old)
{
  _Bool D.30493;
  long int D.30494;
  long int D.30495;
  void * dst.426;
  _Bool D.30501;
  long int D.30502;
  long int D.30503;
  struct MonoVTable * D.30508;
  struct MonoClass * D.30509;
  struct MonoMethod * method;
  void * pa[3];

  try
    {
      D.30493 = obj == 0B;
      D.30494 = (long int) D.30493;
      D.30495 = __builtin_expect (D.30494, 0);
      if (D.30495 != 0) goto <D.30496>; else goto <D.30497>;
      <D.30496>:
      {
        struct MonoException * ex;

        if (obj != 0B) goto <D.30498>; else goto <D.30499>;
        <D.30498>:
        <D.30499>:
        ex = mono_get_exception_argument_null ("obj");
        mono_raise_exception (ex);
      }
      <D.30497>:
      dst.426 = dst;
      D.30501 = dst.426 == 0B;
      D.30502 = (long int) D.30501;
      D.30503 = __builtin_expect (D.30502, 0);
      if (D.30503 != 0) goto <D.30504>; else goto <D.30505>;
      <D.30504>:
      {
        struct MonoException * ex;

        dst.426 = dst;
        if (dst.426 != 0B) goto <D.30506>; else goto <D.30507>;
        <D.30506>:
        <D.30507>:
        ex = mono_get_exception_argument_null ("dst");
        mono_raise_exception (ex);
      }
      <D.30505>:
      D.30508 = obj->vtable;
      D.30509 = D.30508->klass;
      method = mono_marshal_get_struct_to_ptr (D.30509);
      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.30510;
  long int D.30511;
  long int D.30512;
  _Bool D.30517;
  long int D.30518;
  long int D.30519;
  struct MonoVTable * D.30524;
  struct MonoClass * D.30525;
  struct MonoType * D.30526;
  unsigned char D.30527;
  struct MonoType * t;

  D.30510 = src == 0B;
  D.30511 = (long int) D.30510;
  D.30512 = __builtin_expect (D.30511, 0);
  if (D.30512 != 0) goto <D.30513>; else goto <D.30514>;
  <D.30513>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.30515>; else goto <D.30516>;
    <D.30515>:
    <D.30516>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.30514>:
  D.30517 = dst == 0B;
  D.30518 = (long int) D.30517;
  D.30519 = __builtin_expect (D.30518, 0);
  if (D.30519 != 0) goto <D.30520>; else goto <D.30521>;
  <D.30520>:
  {
    struct MonoException * ex;

    if (dst != 0B) goto <D.30522>; else goto <D.30523>;
    <D.30522>:
    <D.30523>:
    ex = mono_get_exception_argument_null ("dst");
    mono_raise_exception (ex);
  }
  <D.30521>:
  D.30524 = dst->vtable;
  D.30525 = D.30524->klass;
  D.30526 = mono_class_get_type (D.30525);
  t = mono_type_get_underlying_type (D.30526);
  D.30527 = t->type;
  if (D.30527 == 17) goto <D.30528>; else goto <D.30529>;
  <D.30528>:
  {
    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.30529>:
  ptr_to_structure (src, dst);
}


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

  try
    {
      D.30531 = dst->vtable;
      D.30532 = D.30531->klass;
      method = mono_marshal_get_ptr_to_struct (D.30532);
      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.30535;
  _Bool D.30536;
  long int D.30537;
  long int D.30538;
  struct MonoType * D.30543;
  int D.30544;
  struct MonoException * D.30547;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoObject * res;

  domain = mono_domain_get ();
  if (src == 0B) goto <D.30533>; else goto <D.30534>;
  <D.30533>:
  D.30535 = 0B;
  return D.30535;
  <D.30534>:
  D.30536 = type == 0B;
  D.30537 = (long int) D.30536;
  D.30538 = __builtin_expect (D.30537, 0);
  if (D.30538 != 0) goto <D.30539>; else goto <D.30540>;
  <D.30539>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.30541>; else goto <D.30542>;
    <D.30541>:
    <D.30542>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.30540>:
  D.30543 = type->type;
  klass = mono_class_from_mono_type (D.30543);
  D.30544 = mono_class_init (klass);
  if (D.30544 == 0) goto <D.30545>; else goto <D.30546>;
  <D.30545>:
  D.30547 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.30547);
  <D.30546>:
  res = mono_object_new (domain, klass);
  ptr_to_structure (src, res);
  D.30535 = res;
  return D.30535;
}


ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (struct MonoReflectionType * type, struct MonoString * field_name)
{
  _Bool D.30549;
  long int D.30550;
  long int D.30551;
  _Bool D.30556;
  long int D.30557;
  long int D.30558;
  struct MonoType * D.30563;
  int D.30564;
  struct MonoException * D.30567;
  struct MonoType * D.30568;
  short unsigned int D.30569;
  int D.30570;
  int D.30571;
  int D.23732;
  const char * D.30574;
  _Bool D.30579;
  _Bool D.30580;
  _Bool D.30581;
  const char * D.30584;
  int D.30585;
  unsigned int D.30586;
  struct MonoMarshalType * info;
  struct MonoClass * klass;
  char * fname;
  int match_index;

  match_index = -1;
  D.30549 = type == 0B;
  D.30550 = (long int) D.30549;
  D.30551 = __builtin_expect (D.30550, 0);
  if (D.30551 != 0) goto <D.30552>; else goto <D.30553>;
  <D.30552>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.30554>; else goto <D.30555>;
    <D.30554>:
    <D.30555>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.30553>:
  D.30556 = field_name == 0B;
  D.30557 = (long int) D.30556;
  D.30558 = __builtin_expect (D.30557, 0);
  if (D.30558 != 0) goto <D.30559>; else goto <D.30560>;
  <D.30559>:
  {
    struct MonoException * ex;

    if (field_name != 0B) goto <D.30561>; else goto <D.30562>;
    <D.30561>:
    <D.30562>:
    ex = mono_get_exception_argument_null ("field_name");
    mono_raise_exception (ex);
  }
  <D.30560>:
  fname = mono_string_to_utf8 (field_name);
  D.30563 = type->type;
  klass = mono_class_from_mono_type (D.30563);
  D.30564 = mono_class_init (klass);
  if (D.30564 == 0) goto <D.30565>; else goto <D.30566>;
  <D.30565>:
  D.30567 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.30567);
  <D.30566>:
  goto <D.23736>;
  <D.23735>:
  {
    struct MonoClassField * field;
    int i;
    void * iter;

    try
      {
        i = 0;
        iter = 0B;
        goto <D.23723>;
        <D.23734>:
        D.30568 = field->type;
        D.30569 = D.30568->attrs;
        D.30570 = (int) D.30569;
        D.30571 = D.30570 & 16;
        if (D.30571 != 0) goto <D.30572>; else goto <D.30573>;
        <D.30572>:
        // predicted unlikely by continue predictor.
        goto <D.23723>;
        <D.30573>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.30574 = mono_field_get_name (field);
          D.23732 = __builtin_strcmp (fname, D.30574);
        }
        if (D.23732 == 0) goto <D.30575>; else goto <D.30576>;
        <D.30575>:
        match_index = i;
        goto <D.23733>;
        <D.30576>:
        i = i + 1;
        <D.23723>:
        field = mono_class_get_fields (klass, &iter);
        if (field != 0B) goto <D.23734>; else goto <D.23733>;
        <D.23733>:
        if (match_index == -1) goto <D.30577>; else goto <D.30578>;
        <D.30577>:
        klass = klass->parent;
        <D.30578>:
      }
    finally
      {
        iter = {CLOBBER};
      }
  }
  <D.23736>:
  D.30579 = klass != 0B;
  D.30580 = match_index == -1;
  D.30581 = D.30579 & D.30580;
  if (D.30581 != 0) goto <D.23735>; else goto <D.23737>;
  <D.23737>:
  monoeg_g_free (fname);
  if (match_index == -1) goto <D.30582>; else goto <D.30583>;
  <D.30582>:
  {
    struct MonoException * exc;
    gchar * tmp;

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (struct MonoString * string)
{
  void * D.30592;
  int D.30593;
  int D.30594;
  int D.30595;
  unsigned int D.30596;
  mono_unichar2 * D.30597;
  int D.30598;
  int D.30599;
  unsigned int D.30600;
  int D.30601;
  unsigned int D.30602;
  unsigned int D.30603;
  gunichar2 * D.30604;

  if (string == 0B) goto <D.30590>; else goto <D.30591>;
  <D.30590>:
  D.30592 = 0B;
  return D.30592;
  <D.30591>:
  {
    gunichar2 * res;

    D.30593 = mono_string_length (string);
    D.30594 = D.30593 + 1;
    D.30595 = D.30594 * 2;
    D.30596 = (unsigned int) D.30595;
    res = monoeg_malloc (D.30596);
    D.30597 = mono_string_chars (string);
    D.30598 = mono_string_length (string);
    D.30599 = D.30598 * 2;
    D.30600 = (unsigned int) D.30599;
    memcpy (res, D.30597, D.30600);
    D.30601 = mono_string_length (string);
    D.30602 = (unsigned int) D.30601;
    D.30603 = D.30602 * 2;
    D.30604 = res + D.30603;
    *D.30604 = 0;
    D.30592 = res;
    return D.30592;
  }
}


ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (void * src, struct MonoReflectionType * type)
{
  _Bool D.30606;
  long int D.30607;
  long int D.30608;
  _Bool D.30613;
  long int D.30614;
  long int D.30615;
  struct MonoType * D.30620;
  int D.30621;
  struct MonoException * D.30624;
  struct MonoClass * klass;

  D.30606 = src == 0B;
  D.30607 = (long int) D.30606;
  D.30608 = __builtin_expect (D.30607, 0);
  if (D.30608 != 0) goto <D.30609>; else goto <D.30610>;
  <D.30609>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.30611>; else goto <D.30612>;
    <D.30611>:
    <D.30612>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.30610>:
  D.30613 = type == 0B;
  D.30614 = (long int) D.30613;
  D.30615 = __builtin_expect (D.30614, 0);
  if (D.30615 != 0) goto <D.30616>; else goto <D.30617>;
  <D.30616>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.30618>; else goto <D.30619>;
    <D.30618>:
    <D.30619>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.30617>:
  D.30620 = type->type;
  klass = mono_class_from_mono_type (D.30620);
  D.30621 = mono_class_init (klass);
  if (D.30621 == 0) goto <D.30622>; else goto <D.30623>;
  <D.30622>:
  D.30624 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.30624);
  <D.30623>:
  mono_struct_delete_old (klass, src);
}


ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (int size)
{
  unsigned int size.427;
  unsigned int size.428;
  void * D.30631;
  void * res;

  if (size == 0) goto <D.30625>; else goto <D.30626>;
  <D.30625>:
  size = 4;
  <D.30626>:
  size.427 = (unsigned int) size;
  res = monoeg_try_malloc (size.427);
  if (res == 0B) goto <D.30628>; else goto <D.30629>;
  <D.30628>:
  size.428 = (unsigned int) size;
  mono_gc_out_of_memory (size.428);
  <D.30629>:
  D.30631 = res;
  return D.30631;
}


ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (void * ptr, int size)
{
  unsigned int size.429;
  void * D.30636;
  unsigned int size.430;
  void * res;

  if (ptr == 0B) goto <D.30633>; else goto <D.30634>;
  <D.30633>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  D.30636 = 0B;
  return D.30636;
  <D.30634>:
  size.430 = (unsigned int) size;
  res = monoeg_try_realloc (ptr, size.430);
  if (res == 0B) goto <D.30638>; else goto <D.30639>;
  <D.30638>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  <D.30639>:
  D.30636 = res;
  return D.30636;
}


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


ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
{
  void * D.30641;
  unsigned int size.431;

  size.431 = (unsigned int) size;
  D.30641 = monoeg_try_malloc (size.431);
  return D.30641;
}


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.30644;
  unsigned int size.432;

  size.432 = (unsigned int) size;
  D.30644 = monoeg_try_realloc (ptr, size.432);
  return D.30644;
}


ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (struct MonoArray * arrayobj, int index)
{
  void * D.30647;
  double[0:] * D.30648;
  struct MonoVTable * D.30649;
  struct MonoClass * D.30650;
  int D.30651;
  int D.30652;
  sizetype D.30653;

  D.30648 = &arrayobj->vector;
  D.30649 = arrayobj->obj.vtable;
  D.30650 = D.30649->klass;
  D.30651 = mono_array_element_size (D.30650);
  D.30652 = D.30651 * index;
  D.30653 = (sizetype) D.30652;
  D.30647 = D.30648 + D.30653;
  return D.30647;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void * ftn, struct MonoReflectionType * type)
{
  struct MonoType * D.30655;
  int D.30656;
  struct MonoException * D.30659;
  struct MonoDelegate * D.30660;
  struct MonoClass * klass;

  D.30655 = type->type;
  klass = mono_type_get_class (D.30655);
  D.30656 = mono_class_init (klass);
  if (D.30656 == 0) goto <D.30657>; else goto <D.30658>;
  <D.30657>:
  D.30659 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.30659);
  <D.30658>:
  D.30660 = mono_ftnptr_to_delegate (klass, ftn);
  return D.30660;
}


mono_marshal_load_type_info (struct MonoClass * klass)
{
  _Bool D.30662;
  long int D.30663;
  long int D.30664;
  struct MonoMarshalType * D.30667;
  struct MonoMarshalType * D.30670;
  unsigned char D.30671;
  unsigned char D.30672;
  int D.30677;
  _Bool D.30678;
  long int D.30679;
  long int D.30680;
  unsigned int load_type_info_tls_id.433;
  struct MonoType * D.30684;
  short unsigned int D.30685;
  int D.30686;
  int D.30687;
  int D.30690;
  int D.23834;
  int iftmp.434;
  int D.23833;
  const char[9] * D.30696;
  unsigned char D.30697;
  int D.30698;
  unsigned char D.30699;
  int D.30700;
  _Bool D.30701;
  _Bool D.30702;
  _Bool D.30703;
  const unsigned char * D.30706;
  unsigned char D.30707;
  int D.30708;
  const unsigned char * D.30709;
  unsigned char D.30710;
  int D.30711;
  _Bool D.30712;
  _Bool D.30713;
  const unsigned char * D.30716;
  unsigned char D.30717;
  int D.30718;
  const unsigned char * D.30719;
  unsigned char D.30720;
  int D.30721;
  _Bool D.30722;
  _Bool D.30723;
  const unsigned char * D.30726;
  unsigned char D.30727;
  int D.30728;
  const unsigned char * D.30729;
  unsigned char D.30730;
  int D.30731;
  const char * D.30733;
  unsigned int D.30736;
  struct MonoImage * D.30737;
  unsigned int count.435;
  unsigned int D.30739;
  unsigned int D.30740;
  unsigned int count.436;
  unsigned int D.30742;
  struct MonoClass * D.30743;
  unsigned int native_size.437;
  unsigned int parent_size.438;
  unsigned int native_size.439;
  guint32 iftmp.440;
  unsigned char D.30750;
  unsigned char D.30751;
  <unnamed-unsigned:4> D.30754;
  int D.23849;
  int iftmp.441;
  int D.23848;
  unsigned char D.30763;
  int D.30764;
  _Bool D.30765;
  _Bool D.30766;
  _Bool D.30767;
  const unsigned char * D.30770;
  unsigned char D.30771;
  int D.30772;
  _Bool D.30773;
  _Bool D.30774;
  const unsigned char * D.30777;
  unsigned char D.30778;
  int D.30779;
  _Bool D.30780;
  _Bool D.30781;
  const unsigned char * D.30784;
  unsigned char D.30785;
  int D.30786;
  const char * D.30788;
  int D.30791;
  unsigned int D.30794;
  unsigned int D.30795;
  unsigned int D.30796;
  struct MonoMarshalSpec * * D.30797;
  int D.30798;
  int D.30801;
  int D.23858;
  int iftmp.442;
  int D.23857;
  const char[10] * D.30807;
  unsigned char D.30808;
  int D.30809;
  unsigned char D.30810;
  int D.30811;
  _Bool D.30812;
  _Bool D.30813;
  _Bool D.30814;
  const unsigned char * D.30817;
  unsigned char D.30818;
  int D.30819;
  const unsigned char * D.30820;
  unsigned char D.30821;
  int D.30822;
  _Bool D.30823;
  _Bool D.30824;
  const unsigned char * D.30827;
  unsigned char D.30828;
  int D.30829;
  const unsigned char * D.30830;
  unsigned char D.30831;
  int D.30832;
  _Bool D.30833;
  _Bool D.30834;
  const unsigned char * D.30837;
  unsigned char D.30838;
  int D.30839;
  const unsigned char * D.30840;
  unsigned char D.30841;
  int D.30842;
  const char * D.30844;
  struct MonoMarshalSpec * D.30847;
  <unnamed-unsigned:1> D.30848;
  int D.30849;
  guint32 iftmp.443;
  unsigned int D.30853;
  unsigned int align.444;
  unsigned int D.30856;
  unsigned int D.30857;
  unsigned int D.30858;
  unsigned int D.30859;
  unsigned int D.30860;
  unsigned int D.30861;
  unsigned int size.445;
  unsigned int D.30863;
  int D.30864;
  unsigned int D.30865;
  unsigned int D.30866;
  unsigned int D.30867;
  unsigned int D.30871;
  unsigned int D.30879;
  unsigned int D.30880;
  unsigned int D.30883;
  unsigned int D.30884;
  unsigned int D.30885;
  unsigned int D.30886;
  int D.30887;
  unsigned int D.30888;
  unsigned char D.30891;
  struct MonoClass * D.30894;
  int D.30895;
  _Bool D.30900;
  long int D.30901;
  long int D.30902;
  _Bool D.30909;
  long int D.30910;
  long int D.30911;
  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.30662 = klass == 0B;
      D.30663 = (long int) D.30662;
      D.30664 = __builtin_expect (D.30663, 0);
      if (D.30664 != 0) goto <D.30665>; else goto <D.30666>;
      <D.30665>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12208, "klass != NULL");
      <D.30666>:
      D.30667 = klass->marshal_info;
      if (D.30667 != 0B) goto <D.30668>; else goto <D.30669>;
      <D.30668>:
      D.30670 = klass->marshal_info;
      return D.30670;
      <D.30669>:
      D.30671 = BIT_FIELD_REF <*klass, 8, 160>;
      D.30672 = D.30671 & 1;
      if (D.30672 == 0) goto <D.30673>; else goto <D.30674>;
      <D.30673>:
      mono_class_init (klass);
      <D.30674>:
      D.30667 = klass->marshal_info;
      if (D.30667 != 0B) goto <D.30675>; else goto <D.30676>;
      <D.30675>:
      D.30670 = klass->marshal_info;
      return D.30670;
      <D.30676>:
      D.30677 = mono_marshal_is_loading_type_info (klass);
      D.30678 = D.30677 != 0;
      D.30679 = (long int) D.30678;
      D.30680 = __builtin_expect (D.30679, 0);
      if (D.30680 != 0) goto <D.30681>; else goto <D.30682>;
      <D.30681>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12223, "!mono_marshal_is_loading_type_info (klass)");
      <D.30682>:
      load_type_info_tls_id.433 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.433);
      loads_list = monoeg_g_slist_prepend (loads_list, klass);
      load_type_info_tls_id.433 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.433, loads_list);
      iter = 0B;
      goto <D.23825>;
      <D.23835>:
      D.30684 = field->type;
      D.30685 = D.30684->attrs;
      D.30686 = (int) D.30685;
      D.30687 = D.30686 & 16;
      if (D.30687 != 0) goto <D.30688>; else goto <D.30689>;
      <D.30688>:
      // predicted unlikely by continue predictor.
      goto <D.23825>;
      <D.30689>:
      D.30684 = field->type;
      D.30685 = D.30684->attrs;
      D.30686 = (int) D.30685;
      D.30690 = D.30686 & 1536;
      if (D.30690 != 0) goto <D.30691>; else goto <D.30692>;
      <D.30691>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_field_get_name (field);
          D.30696 = "_Deleted";
          D.30697 = MEM[(const unsigned char *)D.30696];
          D.30698 = (int) D.30697;
          D.30699 = *__s2;
          D.30700 = (int) D.30699;
          __result = D.30698 - D.30700;
          {
            D.30701 = __s2_len != 0;
            D.30702 = __result == 0;
            D.30703 = D.30701 & D.30702;
            if (D.30703 != 0) goto <D.30704>; else goto <D.30705>;
            <D.30704>:
            D.30706 = &MEM[(void *)"_Deleted" + 1B];
            D.30707 = *D.30706;
            D.30708 = (int) D.30707;
            D.30709 = __s2 + 1;
            D.30710 = *D.30709;
            D.30711 = (int) D.30710;
            __result = D.30708 - D.30711;
            D.30712 = __s2_len > 1;
            D.30702 = __result == 0;
            D.30713 = D.30712 & D.30702;
            if (D.30713 != 0) goto <D.30714>; else goto <D.30715>;
            <D.30714>:
            D.30716 = &MEM[(void *)"_Deleted" + 2B];
            D.30717 = *D.30716;
            D.30718 = (int) D.30717;
            D.30719 = __s2 + 2;
            D.30720 = *D.30719;
            D.30721 = (int) D.30720;
            __result = D.30718 - D.30721;
            D.30722 = __s2_len > 2;
            D.30702 = __result == 0;
            D.30723 = D.30722 & D.30702;
            if (D.30723 != 0) goto <D.30724>; else goto <D.30725>;
            <D.30724>:
            D.30726 = &MEM[(void *)"_Deleted" + 3B];
            D.30727 = *D.30726;
            D.30728 = (int) D.30727;
            D.30729 = __s2 + 3;
            D.30730 = *D.30729;
            D.30731 = (int) D.30730;
            __result = D.30728 - D.30731;
            <D.30725>:
            <D.30715>:
            <D.30705>:
          }
          D.23833 = __result;
        }
        iftmp.434 = -D.23833;
        goto <D.30732>;
        <D.30695>:
        D.30733 = mono_field_get_name (field);
        iftmp.434 = __builtin_strcmp (D.30733, "_Deleted");
        <D.30732>:
        D.23834 = iftmp.434;
      }
      if (D.23834 == 0) goto <D.30734>; else goto <D.30735>;
      <D.30734>:
      // predicted unlikely by continue predictor.
      goto <D.23825>;
      <D.30735>:
      <D.30692>:
      count = count + 1;
      <D.23825>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.23835>; else goto <D.23836>;
      <D.23836>:
      D.30736 = klass->flags;
      layout = D.30736 & 24;
      D.30737 = klass->image;
      count.435 = (unsigned int) count;
      D.30739 = count.435 * 12;
      D.30740 = D.30739 + 20;
      info = mono_image_alloc0 (D.30737, D.30740);
      count.436 = (unsigned int) count;
      info->num_fields = count.436;
      D.30737 = klass->image;
      D.30742 = klass->type_token;
      mono_metadata_packing_from_typedef (D.30737, D.30742, 0B, &native_size);
      D.30743 = klass->parent;
      if (D.30743 != 0B) goto <D.30744>; else goto <D.30745>;
      <D.30744>:
      {
        int parent_size;

        D.30743 = klass->parent;
        parent_size = mono_class_native_size (D.30743, 0B);
        native_size.437 = native_size;
        parent_size.438 = (unsigned int) parent_size;
        native_size.439 = native_size.437 + parent_size.438;
        native_size = native_size.439;
        parent_size.438 = (unsigned int) parent_size;
        info->native_size = parent_size.438;
      }
      <D.30745>:
      D.30750 = BIT_FIELD_REF <*klass, 8, 176>;
      D.30751 = D.30750 & 15;
      if (D.30751 != 0) goto <D.30752>; else goto <D.30753>;
      <D.30752>:
      D.30754 = klass->packing_size;
      iftmp.440 = (guint32) D.30754;
      goto <D.30755>;
      <D.30753>:
      iftmp.440 = 8;
      <D.30755>:
      packing = iftmp.440;
      iter = 0B;
      j = 0;
      goto <D.23840>;
      <D.23863>:
      {
        int size;
        guint32 align;

        try
          {
            D.30684 = field->type;
            D.30685 = D.30684->attrs;
            D.30686 = (int) D.30685;
            D.30687 = D.30686 & 16;
            if (D.30687 != 0) goto <D.30756>; else goto <D.30757>;
            <D.30756>:
            // predicted unlikely by continue predictor.
            goto <D.23840>;
            <D.30757>:
            D.30684 = field->type;
            D.30685 = D.30684->attrs;
            D.30686 = (int) D.30685;
            D.30690 = D.30686 & 1536;
            if (D.30690 != 0) goto <D.30758>; else goto <D.30759>;
            <D.30758>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.30696 = "_Deleted";
                D.30697 = MEM[(const unsigned char *)D.30696];
                D.30698 = (int) D.30697;
                D.30763 = *__s2;
                D.30764 = (int) D.30763;
                __result = D.30698 - D.30764;
                {
                  D.30765 = __s2_len != 0;
                  D.30766 = __result == 0;
                  D.30767 = D.30765 & D.30766;
                  if (D.30767 != 0) goto <D.30768>; else goto <D.30769>;
                  <D.30768>:
                  D.30706 = &MEM[(void *)"_Deleted" + 1B];
                  D.30707 = *D.30706;
                  D.30708 = (int) D.30707;
                  D.30770 = __s2 + 1;
                  D.30771 = *D.30770;
                  D.30772 = (int) D.30771;
                  __result = D.30708 - D.30772;
                  D.30773 = __s2_len > 1;
                  D.30766 = __result == 0;
                  D.30774 = D.30773 & D.30766;
                  if (D.30774 != 0) goto <D.30775>; else goto <D.30776>;
                  <D.30775>:
                  D.30716 = &MEM[(void *)"_Deleted" + 2B];
                  D.30717 = *D.30716;
                  D.30718 = (int) D.30717;
                  D.30777 = __s2 + 2;
                  D.30778 = *D.30777;
                  D.30779 = (int) D.30778;
                  __result = D.30718 - D.30779;
                  D.30780 = __s2_len > 2;
                  D.30766 = __result == 0;
                  D.30781 = D.30780 & D.30766;
                  if (D.30781 != 0) goto <D.30782>; else goto <D.30783>;
                  <D.30782>:
                  D.30726 = &MEM[(void *)"_Deleted" + 3B];
                  D.30727 = *D.30726;
                  D.30728 = (int) D.30727;
                  D.30784 = __s2 + 3;
                  D.30785 = *D.30784;
                  D.30786 = (int) D.30785;
                  __result = D.30728 - D.30786;
                  <D.30783>:
                  <D.30776>:
                  <D.30769>:
                }
                D.23848 = __result;
              }
              iftmp.441 = -D.23848;
              goto <D.30787>;
              <D.30762>:
              D.30788 = mono_field_get_name (field);
              iftmp.441 = __builtin_strcmp (D.30788, "_Deleted");
              <D.30787>:
              D.23849 = iftmp.441;
            }
            if (D.23849 == 0) goto <D.30789>; else goto <D.30790>;
            <D.30789>:
            // predicted unlikely by continue predictor.
            goto <D.23840>;
            <D.30790>:
            <D.30759>:
            D.30684 = field->type;
            D.30685 = D.30684->attrs;
            D.30686 = (int) D.30685;
            D.30791 = D.30686 & 4096;
            if (D.30791 != 0) goto <D.30792>; else goto <D.30793>;
            <D.30792>:
            D.30737 = klass->image;
            D.30794 = mono_class_get_field_token (field);
            D.30795 = D.30794 & 16777215;
            D.30796 = D.30795 + 4294967295;
            D.30797 = &info->fields[j].mspec;
            mono_metadata_field_info_with_mempool (D.30737, D.30796, 0B, 0B, D.30797);
            <D.30793>:
            info->fields[j].field = field;
            D.30798 = mono_class_num_fields (klass);
            if (D.30798 == 1) goto <D.30799>; else goto <D.30800>;
            <D.30799>:
            D.30801 = klass->instance_size;
            if (D.30801 == 8) goto <D.30802>; else goto <D.30803>;
            <D.30802>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.30807 = "$PRIVATE$";
                D.30808 = MEM[(const unsigned char *)D.30807];
                D.30809 = (int) D.30808;
                D.30810 = *__s2;
                D.30811 = (int) D.30810;
                __result = D.30809 - D.30811;
                {
                  D.30812 = __s2_len != 0;
                  D.30813 = __result == 0;
                  D.30814 = D.30812 & D.30813;
                  if (D.30814 != 0) goto <D.30815>; else goto <D.30816>;
                  <D.30815>:
                  D.30817 = &MEM[(void *)"$PRIVATE$" + 1B];
                  D.30818 = *D.30817;
                  D.30819 = (int) D.30818;
                  D.30820 = __s2 + 1;
                  D.30821 = *D.30820;
                  D.30822 = (int) D.30821;
                  __result = D.30819 - D.30822;
                  D.30823 = __s2_len > 1;
                  D.30813 = __result == 0;
                  D.30824 = D.30823 & D.30813;
                  if (D.30824 != 0) goto <D.30825>; else goto <D.30826>;
                  <D.30825>:
                  D.30827 = &MEM[(void *)"$PRIVATE$" + 2B];
                  D.30828 = *D.30827;
                  D.30829 = (int) D.30828;
                  D.30830 = __s2 + 2;
                  D.30831 = *D.30830;
                  D.30832 = (int) D.30831;
                  __result = D.30829 - D.30832;
                  D.30833 = __s2_len > 2;
                  D.30813 = __result == 0;
                  D.30834 = D.30833 & D.30813;
                  if (D.30834 != 0) goto <D.30835>; else goto <D.30836>;
                  <D.30835>:
                  D.30837 = &MEM[(void *)"$PRIVATE$" + 3B];
                  D.30838 = *D.30837;
                  D.30839 = (int) D.30838;
                  D.30840 = __s2 + 3;
                  D.30841 = *D.30840;
                  D.30842 = (int) D.30841;
                  __result = D.30839 - D.30842;
                  <D.30836>:
                  <D.30826>:
                  <D.30816>:
                }
                D.23857 = __result;
              }
              iftmp.442 = -D.23857;
              goto <D.30843>;
              <D.30806>:
              D.30844 = mono_field_get_name (field);
              iftmp.442 = __builtin_strcmp (D.30844, "$PRIVATE$");
              <D.30843>:
              D.23858 = iftmp.442;
            }
            if (D.23858 == 0) goto <D.30845>; else goto <D.30846>;
            <D.30845>:
            // predicted unlikely by continue predictor.
            goto <D.23840>;
            <D.30846>:
            <D.30803>:
            <D.30800>:
            switch (layout) <default: <D.30868>, case 0: <D.23859>, case 8: <D.23860>, case 16: <D.23862>>
            <D.23859>:
            <D.23860>:
            D.30684 = field->type;
            D.30847 = info->fields[j].mspec;
            D.30848 = klass->unicode;
            D.30849 = (int) D.30848;
            size = mono_marshal_type_size (D.30684, D.30847, &align, 1, D.30849);
            D.30750 = BIT_FIELD_REF <*klass, 8, 176>;
            D.30751 = D.30750 & 15;
            if (D.30751 != 0) goto <D.30851>; else goto <D.30852>;
            <D.30851>:
            D.30754 = klass->packing_size;
            D.30853 = (unsigned int) D.30754;
            align.444 = align;
            iftmp.443 = MIN_EXPR <D.30853, align.444>;
            goto <D.30855>;
            <D.30852>:
            iftmp.443 = align;
            <D.30855>:
            align = iftmp.443;
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.30856 = info->native_size;
            info->fields[j].offset = D.30856;
            D.30857 = info->fields[j].offset;
            align.444 = align;
            D.30858 = D.30857 + align.444;
            D.30859 = D.30858 + 4294967295;
            info->fields[j].offset = D.30859;
            D.30857 = info->fields[j].offset;
            align.444 = align;
            D.30860 = -align.444;
            D.30861 = D.30857 & D.30860;
            info->fields[j].offset = D.30861;
            D.30857 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.30863 = D.30857 + size.445;
            info->native_size = D.30863;
            goto <D.23861>;
            <D.23862>:
            D.30684 = field->type;
            D.30847 = info->fields[j].mspec;
            D.30848 = klass->unicode;
            D.30849 = (int) D.30848;
            size = mono_marshal_type_size (D.30684, D.30847, &align, 1, D.30849);
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.30864 = field->offset;
            D.30865 = (unsigned int) D.30864;
            D.30866 = D.30865 + 4294967288;
            info->fields[j].offset = D.30866;
            D.30857 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.30863 = D.30857 + size.445;
            D.30856 = info->native_size;
            D.30867 = MAX_EXPR <D.30863, D.30856>;
            info->native_size = D.30867;
            goto <D.23861>;
            <D.30868>:
            <D.23861>:
            j = j + 1;
          }
        finally
          {
            align = {CLOBBER};
          }
      }
      <D.23840>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.23863>; else goto <D.23864>;
      <D.23864>:
      if (layout != 0) goto <D.30869>; else goto <D.30870>;
      <D.30869>:
      D.30856 = info->native_size;
      native_size.437 = native_size;
      D.30871 = MAX_EXPR <D.30856, native_size.437>;
      info->native_size = D.30871;
      if (layout == 16) goto <D.30872>; else goto <D.30873>;
      <D.30872>:
      native_size.437 = native_size;
      if (native_size.437 != 0) goto <D.30876>; else goto <D.30874>;
      <D.30876>:
      D.30856 = info->native_size;
      native_size.437 = native_size;
      if (D.30856 == native_size.437) goto <D.30877>; else goto <D.30874>;
      <D.30877>:
      D.30750 = BIT_FIELD_REF <*klass, 8, 176>;
      D.30751 = D.30750 & 15;
      if (D.30751 == 0) goto <D.30878>; else goto <D.30874>;
      <D.30878>:
      min_align = 1;
      goto <D.30875>;
      <D.30874>:
      min_align = MIN_EXPR <packing, min_align>;
      <D.30875>:
      <D.30873>:
      <D.30870>:
      D.30856 = info->native_size;
      D.30879 = min_align + 4294967295;
      D.30880 = D.30856 & D.30879;
      if (D.30880 != 0) goto <D.30881>; else goto <D.30882>;
      <D.30881>:
      D.30856 = info->native_size;
      D.30883 = D.30856 + min_align;
      D.30884 = D.30883 + 4294967295;
      info->native_size = D.30884;
      D.30856 = info->native_size;
      D.30885 = -min_align;
      D.30886 = D.30856 & D.30885;
      info->native_size = D.30886;
      <D.30882>:
      info->min_align = min_align;
      D.30856 = info->native_size;
      D.30887 = mono_class_value_size (klass, 0B);
      D.30888 = (unsigned int) D.30887;
      if (D.30856 != D.30888) goto <D.30889>; else goto <D.30890>;
      <D.30889>:
      klass->blittable = 0;
      <D.30890>:
      D.30891 = klass->rank;
      if (D.30891 != 0) goto <D.30892>; else goto <D.30893>;
      <D.30892>:
      D.30894 = klass->element_class;
      D.30895 = mono_marshal_is_loading_type_info (D.30894);
      if (D.30895 == 0) goto <D.30896>; else goto <D.30897>;
      <D.30896>:
      D.30894 = klass->element_class;
      mono_marshal_load_type_info (D.30894);
      <D.30897>:
      <D.30893>:
      load_type_info_tls_id.433 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.433);
      loads_list = monoeg_g_slist_remove (loads_list, klass);
      load_type_info_tls_id.433 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.433, loads_list);
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.30898>; else goto <D.30899>;
        <D.30898>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.30899>:
        D.30900 = ret != 0;
        D.30901 = (long int) D.30900;
        D.30902 = __builtin_expect (D.30901, 0);
        if (D.30902 != 0) goto <D.30903>; else goto <D.30904>;
        <D.30903>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12335, "ret == 0");
        <D.30904>:
      }
      D.30667 = klass->marshal_info;
      if (D.30667 == 0B) goto <D.30905>; else goto <D.30906>;
      <D.30905>:
      mono_memory_barrier ();
      klass->marshal_info = info;
      <D.30906>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.30907>; else goto <D.30908>;
        <D.30907>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.30908>:
        D.30909 = ret != 0;
        D.30910 = (long int) D.30909;
        D.30911 = __builtin_expect (D.30910, 0);
        if (D.30911 != 0) goto <D.30912>; else goto <D.30913>;
        <D.30912>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12341, "ret == 0");
        <D.30913>:
      }
      D.30670 = klass->marshal_info;
      return D.30670;
    }
  finally
    {
      native_size = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_marshal_is_loading_type_info (struct MonoClass * klass)
{
  unsigned int load_type_info_tls_id.446;
  gboolean D.30919;
  struct GSList * D.30920;
  _Bool D.30921;
  struct GSList * loads_list;

  load_type_info_tls_id.446 = load_type_info_tls_id;
  loads_list = pthread_getspecific (load_type_info_tls_id.446);
  D.30920 = monoeg_g_slist_find (loads_list, klass);
  D.30921 = D.30920 != 0B;
  D.30919 = (gboolean) D.30921;
  return D.30919;
}


mono_class_native_size (struct MonoClass * klass, guint32 * align)
{
  struct MonoMarshalType * D.30923;
  int D.30926;
  gint32 D.30931;
  unsigned int D.30934;
  unsigned int D.30935;

  D.30923 = klass->marshal_info;
  if (D.30923 == 0B) goto <D.30924>; else goto <D.30925>;
  <D.30924>:
  D.30926 = mono_marshal_is_loading_type_info (klass);
  if (D.30926 != 0) goto <D.30927>; else goto <D.30928>;
  <D.30927>:
  if (align != 0B) goto <D.30929>; else goto <D.30930>;
  <D.30929>:
  *align = 0;
  <D.30930>:
  D.30931 = 0;
  return D.30931;
  <D.30928>:
  mono_marshal_load_type_info (klass);
  <D.30925>:
  if (align != 0B) goto <D.30932>; else goto <D.30933>;
  <D.30932>:
  D.30923 = klass->marshal_info;
  D.30934 = D.30923->min_align;
  *align = D.30934;
  <D.30933>:
  D.30923 = klass->marshal_info;
  D.30935 = D.30923->native_size;
  D.30931 = (gint32) D.30935;
  return D.30931;
}


mono_type_native_stack_size (struct MonoType * t, guint32 * align)
{
  _Bool D.30937;
  long int D.30938;
  long int D.30939;
  unsigned char D.30944;
  unsigned char D.30945;
  int D.30948;
  unsigned char D.30949;
  int D.30950;
  int D.30951;
  unsigned char D.30954;
  unsigned char D.30955;
  struct MonoType * D.30958;
  int D.30959;
  unsigned int D.30960;
  unsigned int D.30961;
  unsigned int D.30962;
  guint32 tmp;

  try
    {
      D.30937 = t == 0B;
      D.30938 = (long int) D.30937;
      D.30939 = __builtin_expect (D.30938, 0);
      if (D.30939 != 0) goto <D.30940>; else goto <D.30941>;
      <D.30940>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12389, "t != NULL");
      <D.30941>:
      if (align == 0B) goto <D.30942>; else goto <D.30943>;
      <D.30942>:
      align = &tmp;
      <D.30943>:
      D.30944 = BIT_FIELD_REF <*t, 8, 56>;
      D.30945 = D.30944 & 64;
      if (D.30945 != 0) goto <D.30946>; else goto <D.30947>;
      <D.30946>:
      *align = 4;
      D.30948 = 4;
      return D.30948;
      <D.30947>:
      D.30949 = t->type;
      D.30950 = (int) D.30949;
      switch (D.30950) <default: <D.23908>, case 2: <D.23876>, case 3: <D.23877>, case 4: <D.23878>, case 5: <D.23879>, case 6: <D.23880>, case 7: <D.23881>, case 8: <D.23882>, case 9: <D.23883>, case 10: <D.23898>, case 11: <D.23899>, case 12: <D.23893>, case 13: <D.23894>, case 14: <D.23886>, case 15: <D.23890>, case 17: <D.23905>, case 18: <D.23888>, case 20: <D.23892>, case 21: <D.23903>, case 22: <D.23904>, case 24: <D.23884>, case 25: <D.23885>, case 27: <D.23891>, case 28: <D.23887>, case 29: <D.23889>>
      {
        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.23876>:
        <D.23877>:
        <D.23878>:
        <D.23879>:
        <D.23880>:
        <D.23881>:
        <D.23882>:
        <D.23883>:
        *align = 4;
        D.30948 = 4;
        return D.30948;
        <D.23884>:
        <D.23885>:
        <D.23886>:
        <D.23887>:
        <D.23888>:
        <D.23889>:
        <D.23890>:
        <D.23891>:
        <D.23892>:
        *align = 4;
        D.30948 = 4;
        return D.30948;
        <D.23893>:
        *align = 4;
        D.30948 = 4;
        return D.30948;
        <D.23894>:
        *align = 8;
        D.30948 = 8;
        return D.30948;
        <D.23898>:
        <D.23899>:
        *align = 4;
        D.30948 = 8;
        return D.30948;
        <D.23903>:
        D.30951 = mono_type_generic_inst_is_valuetype (t);
        if (D.30951 == 0) goto <D.30952>; else goto <D.30953>;
        <D.30952>:
        *align = 4;
        D.30948 = 4;
        return D.30948;
        <D.30953>:
        <D.23904>:
        <D.23905>:
        {
          guint32 size;
          struct MonoClass * klass;

          klass = mono_class_from_mono_type (t);
          D.30954 = BIT_FIELD_REF <*klass, 8, 160>;
          D.30955 = D.30954 & 16;
          if (D.30955 != 0) goto <D.30956>; else goto <D.30957>;
          <D.30956>:
          D.30958 = mono_class_enum_basetype (klass);
          D.30948 = mono_type_native_stack_size (D.30958, align);
          return D.30948;
          <D.30957>:
          D.30959 = mono_class_native_size (klass, align);
          size = (guint32) D.30959;
          D.30960 = *align;
          D.30961 = D.30960 + 3;
          *align = D.30961;
          D.30960 = *align;
          D.30962 = D.30960 & 4294967292;
          *align = D.30962;
          size = size + 3;
          size = size & 4294967292;
          D.30948 = (int) size;
          return D.30948;
        }
        <D.23908>:
        D.30949 = t->type;
        D.30950 = (int) D.30949;
        monoeg_g_log (0B, 4, "type 0x%02x unknown", D.30950);
        <D.23909>:
        goto <D.23909>;
      }
      D.30948 = 0;
      return D.30948;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


mono_marshal_type_size (struct MonoType * type, struct MonoMarshalSpec * mspec, guint32 * align, gboolean as_field, gboolean unicode)
{
  gint32 D.30965;
  struct MonoClass * D.30966;
  <unnamed type> D.30971;
  int iftmp.447;
  _Bool D.30978;
  long int D.30979;
  long int D.30980;
  unsigned int esize.448;
  int D.30984;
  struct MonoClass * D.30985;
  struct MonoClass * D.30986;
  int iftmp.449;
  unsigned int esize.450;
  MonoMarshalNative native_type;
  struct MonoClass * klass;

  native_type = mono_type_to_unmanaged (type, mspec, as_field, unicode, 0B);
  switch (native_type) <default: <D.23965>, case 2: <D.23919>, case 3: <D.23920>, case 4: <D.23921>, case 5: <D.23922>, case 6: <D.23923>, case 7: <D.23925>, case 8: <D.23926>, case 9: <D.23928>, case 10: <D.23929>, case 11: <D.23933>, case 12: <D.23934>, case 15: <D.23963>, case 19: <D.23943>, case 20: <D.23940>, case 21: <D.23941>, case 22: <D.23942>, case 23: <D.23958>, case 25: <D.23948>, case 26: <D.23949>, case 27: <D.23957>, case 28: <D.23950>, case 29: <D.23947>, case 30: <D.23960>, case 31: <D.23938>, case 32: <D.23939>, case 34: <D.23964>, case 35: <D.23944>, case 36: <D.23945>, case 37: <D.23924>, case 38: <D.23952>, case 40: <D.23951>, case 42: <D.23946>, case 43: <D.23953>, case 44: <D.23962>, case 45: <D.23927>>
  {
    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.23919>:
    *align = 4;
    D.30965 = 4;
    return D.30965;
    <D.23920>:
    <D.23921>:
    *align = 1;
    D.30965 = 1;
    return D.30965;
    <D.23922>:
    <D.23923>:
    <D.23924>:
    *align = 2;
    D.30965 = 2;
    return D.30965;
    <D.23925>:
    <D.23926>:
    <D.23927>:
    *align = 4;
    D.30965 = 4;
    return D.30965;
    <D.23928>:
    <D.23929>:
    *align = 8;
    D.30965 = 8;
    return D.30965;
    <D.23933>:
    *align = 4;
    D.30965 = 4;
    return D.30965;
    <D.23934>:
    *align = 8;
    D.30965 = 8;
    return D.30965;
    <D.23938>:
    <D.23939>:
    <D.23940>:
    <D.23941>:
    <D.23942>:
    <D.23943>:
    <D.23944>:
    <D.23945>:
    <D.23946>:
    <D.23947>:
    <D.23948>:
    <D.23949>:
    <D.23950>:
    <D.23951>:
    <D.23952>:
    <D.23953>:
    *align = 4;
    D.30965 = 4;
    return D.30965;
    <D.23957>:
    klass = mono_class_from_mono_type (type);
    D.30966 = mono_defaults.object_class;
    if (D.30966 == klass) goto <D.30967>; else goto <D.30968>;
    <D.30967>:
    if (mspec != 0B) goto <D.30969>; else goto <D.30970>;
    <D.30969>:
    D.30971 = mspec->native;
    if (D.30971 == 27) goto <D.30972>; else goto <D.30973>;
    <D.30972>:
    *align = 16;
    D.30965 = 16;
    return D.30965;
    <D.30973>:
    <D.30970>:
    <D.30968>:
    D.30965 = mono_class_native_size (klass, align);
    return D.30965;
    <D.23958>:
    {
      int esize;

      if (unicode != 0) goto <D.30975>; else goto <D.30976>;
      <D.30975>:
      iftmp.447 = 2;
      goto <D.30977>;
      <D.30976>:
      iftmp.447 = 1;
      <D.30977>:
      esize = iftmp.447;
      D.30978 = mspec == 0B;
      D.30979 = (long int) D.30978;
      D.30980 = __builtin_expect (D.30979, 0);
      if (D.30980 != 0) goto <D.30981>; else goto <D.30982>;
      <D.30981>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12524, "mspec");
      <D.30982>:
      esize.448 = (unsigned int) esize;
      *align = esize.448;
      D.30984 = mspec->data.array_data.num_elem;
      D.30965 = D.30984 * esize;
      return D.30965;
    }
    <D.23960>:
    {
      int esize;

      klass = mono_class_from_mono_type (type);
      D.30985 = klass->element_class;
      D.30986 = mono_defaults.char_class;
      if (D.30985 == D.30986) goto <D.30987>; else goto <D.30988>;
      <D.30987>:
      if (unicode != 0) goto <D.30990>; else goto <D.30991>;
      <D.30990>:
      iftmp.449 = 2;
      goto <D.30992>;
      <D.30991>:
      iftmp.449 = 1;
      <D.30992>:
      esize = iftmp.449;
      esize.450 = (unsigned int) esize;
      *align = esize.450;
      goto <D.30994>;
      <D.30988>:
      D.30985 = klass->element_class;
      esize = mono_class_native_size (D.30985, align);
      <D.30994>:
      D.30978 = mspec == 0B;
      D.30979 = (long int) D.30978;
      D.30980 = __builtin_expect (D.30979, 0);
      if (D.30980 != 0) goto <D.30995>; else goto <D.30996>;
      <D.30995>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12538, "mspec");
      <D.30996>:
      D.30984 = mspec->data.array_data.num_elem;
      D.30965 = D.30984 * esize;
      return D.30965;
    }
    <D.23962>:
    *align = 4;
    D.30965 = 4;
    return D.30965;
    <D.23963>:
    <D.23964>:
    <D.23965>:
    monoeg_g_log (0B, 4, "native type %02x not implemented", native_type);
    <D.23966>:
    goto <D.23966>;
  }
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12551);
  D.30965 = 0;
  return D.30965;
}


mono_marshal_asany (struct MonoObject * o, MonoMarshalNative string_encoding, int param_attrs)
{
  void * D.31000;
  struct MonoVTable * D.31001;
  struct MonoClass * D.31002;
  unsigned char D.31003;
  int D.31004;
  unsigned int D.31005;
  unsigned int D.31006;
  unsigned char D.31010;
  unsigned char D.31011;
  unsigned char D.31015;
  int D.31016;
  long unsigned int D.31017;
  void * res.451;
  unsigned int param_attrs.452;
  unsigned int D.31020;
  struct MonoException * D.31024;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.30998>; else goto <D.30999>;
  <D.30998>:
  D.31000 = 0B;
  return D.31000;
  <D.30999>:
  D.31001 = o->vtable;
  D.31002 = D.31001->klass;
  t = &D.31002->byval_arg;
  D.31003 = t->type;
  D.31004 = (int) D.31003;
  switch (D.31004) <default: <D.31023>, case 2: <D.23979>, case 3: <D.23982>, case 4: <D.23977>, case 5: <D.23978>, case 6: <D.23980>, case 7: <D.23981>, case 8: <D.23974>, case 9: <D.23975>, case 10: <D.23983>, case 11: <D.23984>, case 12: <D.23985>, case 13: <D.23986>, case 14: <D.23987>, case 15: <D.23976>, case 17: <D.23993>, case 18: <D.23992>>
  <D.23974>:
  <D.23975>:
  <D.23976>:
  <D.23977>:
  <D.23978>:
  <D.23979>:
  <D.23980>:
  <D.23981>:
  <D.23982>:
  <D.23983>:
  <D.23984>:
  <D.23985>:
  <D.23986>:
  D.31000 = mono_object_unbox (o);
  return D.31000;
  <D.23987>:
  switch (string_encoding) <default: <D.23990>, case 20: <D.23989>, case 21: <D.23988>>
  <D.23988>:
  D.31000 = mono_marshal_string_to_utf16_copy (o);
  return D.31000;
  <D.23989>:
  D.31000 = mono_string_to_lpstr (o);
  return D.31000;
  <D.23990>:
  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.23991>;
  <D.23992>:
  <D.23993>:
  {
    struct MonoMethod * method;
    void * pa[3];
    void * res;
    MonoBoolean delete_old;

    try
      {
        delete_old = 0;
        klass = t->data.klass;
        D.31005 = klass->flags;
        D.31006 = D.31005 & 24;
        if (D.31006 == 0) goto <D.23991>; else goto <D.31007>;
        <D.31007>:
        D.31010 = BIT_FIELD_REF <*klass, 8, 160>;
        D.31011 = D.31010 & 8;
        if (D.31011 != 0) goto <D.31012>; else goto <D.31013>;
        <D.31012>:
        D.31005 = klass->flags;
        D.31006 = D.31005 & 24;
        if (D.31006 == 16) goto <D.31008>; else goto <D.31014>;
        <D.31014>:
        D.31010 = BIT_FIELD_REF <*klass, 8, 160>;
        D.31015 = D.31010 & 48;
        if (D.31015 != 0) goto <D.31008>; else goto <D.31009>;
        <D.31008>:
        D.31000 = mono_object_unbox (o);
        return D.31000;
        <D.31009>:
        <D.31013>:
        D.31016 = mono_class_native_size (klass, 0B);
        D.31017 = (long unsigned int) D.31016;
        res.451 = mono_marshal_alloc (D.31017);
        res = res.451;
        param_attrs.452 = (unsigned int) param_attrs;
        D.31020 = param_attrs.452 & 3;
        if (D.31020 != 2) goto <D.31021>; else goto <D.31022>;
        <D.31021>:
        D.31001 = o->vtable;
        D.31002 = D.31001->klass;
        method = mono_marshal_get_struct_to_ptr (D.31002);
        pa[0] = o;
        pa[1] = &res;
        pa[2] = &delete_old;
        mono_runtime_invoke (method, 0B, &pa, 0B);
        <D.31022>:
        D.31000 = res;
        return D.31000;
      }
    finally
      {
        pa = {CLOBBER};
        res = {CLOBBER};
        delete_old = {CLOBBER};
      }
  }
  <D.31023>:
  <D.23991>:
  D.31024 = mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter.");
  mono_raise_exception (D.31024);
  D.31000 = 0B;
  return D.31000;
}


mono_marshal_free_asany (struct MonoObject * o, void * ptr, MonoMarshalNative string_encoding, int param_attrs)
{
  struct MonoVTable * D.31030;
  struct MonoClass * D.31031;
  unsigned char D.31032;
  int D.31033;
  void * ptr.453;
  unsigned char D.31035;
  unsigned char D.31036;
  unsigned int D.31039;
  unsigned int D.31040;
  unsigned char D.31042;
  int D.31044;
  unsigned int param_attrs.454;
  unsigned int D.31048;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.31028>; else goto <D.31029>;
  <D.31028>:
  return;
  <D.31029>:
  D.31030 = o->vtable;
  D.31031 = D.31030->klass;
  t = &D.31031->byval_arg;
  D.31032 = t->type;
  D.31033 = (int) D.31032;
  switch (D.31033) <default: <D.24016>, case 14: <D.24006>, case 17: <D.24013>, case 18: <D.24012>>
  <D.24006>:
  switch (string_encoding) <default: <D.24010>, case 20: <D.24008>, case 21: <D.24007>>
  <D.24007>:
  <D.24008>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.24009>;
  <D.24010>:
  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.24009>:
  goto <D.24011>;
  <D.24012>:
  <D.24013>:
  klass = t->data.klass;
  D.31035 = BIT_FIELD_REF <*klass, 8, 160>;
  D.31036 = D.31035 & 8;
  if (D.31036 != 0) goto <D.31037>; else goto <D.31038>;
  <D.31037>:
  D.31039 = klass->flags;
  D.31040 = D.31039 & 24;
  if (D.31040 == 16) goto <D.24011>; else goto <D.31041>;
  <D.31041>:
  D.31035 = BIT_FIELD_REF <*klass, 8, 160>;
  D.31042 = D.31035 & 48;
  if (D.31042 != 0) goto <D.24011>; else goto <D.31043>;
  <D.31043>:
  <D.31038>:
  D.31044 = param_attrs & 2;
  if (D.31044 != 0) goto <D.31045>; else goto <D.31046>;
  <D.31045>:
  {
    struct MonoMethod * method;
    void * pa[2];

    try
      {
        D.31030 = o->vtable;
        D.31031 = D.31030->klass;
        method = mono_marshal_get_ptr_to_struct (D.31031);
        pa[0] = &ptr;
        pa[1] = o;
        mono_runtime_invoke (method, 0B, &pa, 0B);
      }
    finally
      {
        pa = {CLOBBER};
      }
  }
  <D.31046>:
  param_attrs.454 = (unsigned int) param_attrs;
  D.31048 = param_attrs.454 & 3;
  if (D.31048 != 2) goto <D.31049>; else goto <D.31050>;
  <D.31049>:
  ptr.453 = ptr;
  mono_struct_delete_old (klass, ptr.453);
  <D.31050>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.24011>;
  <D.24016>:
  goto <D.24011>;
  <D.24011>:
}


mono_marshal_get_generic_array_helper (struct MonoClass * class, struct MonoClass * iface, gchar * name, struct MonoMethod * method)
{
  struct MonoMethod * D.31053;
  struct MonoClass * D.31054;
  struct MonoImage * D.31055;
  int D.31056;
  unsigned int D.31057;
  short unsigned int D.31058;
  int D.31059;
  int D.31060;
  struct MonoMethod * D.31061;
  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.31053 = mb->method;
  D.31053->slot = -1;
  D.31053 = mb->method;
  D.31053->flags = 481;
  sig = mono_method_signature (method);
  D.31054 = method->klass;
  D.31055 = D.31054->image;
  csig = signature_dup (D.31055, sig);
  csig->generic_param_count = 0;
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.24030>;
  <D.24029>:
  D.31056 = i + 1;
  D.31057 = (unsigned int) D.31056;
  mono_mb_emit_ldarg (mb, D.31057);
  i = i + 1;
  <D.24030>:
  D.31058 = csig->param_count;
  D.31059 = (int) D.31058;
  if (D.31059 > i) goto <D.24029>; else goto <D.24031>;
  <D.24031>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  mb->skip_visibility = 1;
  D.31058 = csig->param_count;
  D.31059 = (int) D.31058;
  D.31060 = D.31059 + 16;
  res = mono_mb_create_method (mb, csig, D.31060);
  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.31061 = res;
  return D.31061;
}


mono_win32_compat_CopyMemory (void * dest, const void * source, gsize length)
{
  _Bool D.31063;
  _Bool D.31064;
  _Bool D.31065;

  D.31063 = dest == 0B;
  D.31064 = source == 0B;
  D.31065 = D.31063 | D.31064;
  if (D.31065 != 0) goto <D.31066>; else goto <D.31067>;
  <D.31066>:
  return;
  <D.31067>:
  memcpy (dest, source, length);
}


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

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


mono_win32_compat_MoveMemory (void * dest, const void * source, gsize length)
{
  _Bool D.31070;
  _Bool D.31071;
  _Bool D.31072;

  D.31070 = dest == 0B;
  D.31071 = source == 0B;
  D.31072 = D.31070 | D.31071;
  if (D.31072 != 0) goto <D.31073>; else goto <D.31074>;
  <D.31073>:
  return;
  <D.31074>:
  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 i.455;
  guint8 * D.31077;
  unsigned char D.31078;
  _Bool D.31080;
  long int D.31081;
  long int D.31082;
  int D.31086;
  int D.31087;
  _Bool D.31088;
  long int D.31089;
  long int D.31090;
  int i;
  guint8 byte;

  i = 0;
  goto <D.24061>;
  <D.24060>:
  i.455 = (sizetype) i;
  D.31077 = buf + i.455;
  D.31078 = *D.31077;
  if (D.31078 != 0) goto <D.24059>; else goto <D.31079>;
  <D.31079>:
  i = i + 1;
  <D.24061>:
  if (i < len) goto <D.24060>; else goto <D.24059>;
  <D.24059>:
  D.31080 = i >= len;
  D.31081 = (long int) D.31080;
  D.31082 = __builtin_expect (D.31081, 0);
  if (D.31082 != 0) goto <D.31083>; else goto <D.31084>;
  <D.31083>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12773, "i < len");
  <D.31084>:
  i.455 = (sizetype) i;
  D.31077 = buf + i.455;
  byte = *D.31077;
  goto <D.24063>;
  <D.24062>:
  byte = byte >> 1;
  <D.24063>:
  if (byte != 0) goto <D.31085>; else goto <D.24064>;
  <D.31085>:
  D.31086 = (int) byte;
  D.31087 = D.31086 & 1;
  if (D.31087 == 0) goto <D.24062>; else goto <D.24064>;
  <D.24064>:
  D.31088 = byte != 1;
  D.31089 = (long int) D.31088;
  D.31090 = __builtin_expect (D.31089, 0);
  if (D.31090 != 0) goto <D.31091>; else goto <D.31092>;
  <D.31091>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12778, "byte == 1");
  <D.31092>:
  *byte_offset = i;
  i.455 = (sizetype) i;
  D.31077 = buf + i.455;
  D.31078 = *D.31077;
  *bitmask = D.31078;
}


mono_marshal_get_thunk_invoke_wrapper (struct MonoMethod * method)
{
  _Bool D.31093;
  long int D.31094;
  long int D.31095;
  struct MonoClass * D.31098;
  struct GHashTable * * D.31099;
  struct MonoMethod * D.31102;
  const char * D.31103;
  short unsigned int D.31104;
  int D.31105;
  <unnamed-unsigned:1> D.31106;
  int D.31107;
  int D.31108;
  unsigned int param_count.456;
  unsigned int D.31110;
  unsigned int D.31111;
  unsigned int D.31112;
  unsigned int sig_size.457;
  short unsigned int D.31114;
  unsigned char D.31115;
  unsigned char D.31116;
  struct MonoType * D.31119;
  int D.31120;
  struct MonoType * D.31121;
  int D.31122;
  struct MonoClass * D.31123;
  struct MonoType * D.31124;
  struct MonoType * D.31125;
  struct MonoType * D.31126;
  struct MonoType * D.31127;
  int D.31128;
  struct MonoClass * D.31131;
  struct MonoType * D.31132;
  int D.31133;
  unsigned int D.31136;
  int D.31137;
  unsigned int D.31138;
  unsigned int i.458;
  struct MonoType * D.31140;
  int D.31141;
  unsigned char D.31146;
  unsigned char D.31147;
  short unsigned int D.31151;
  int D.31152;
  int D.31153;
  int D.31157;
  unsigned int D.31160;
  int D.31161;
  unsigned int D.31162;
  unsigned int D.31163;
  unsigned int D.31164;
  int D.31165;
  unsigned int D.31166;
  int D.31167;
  unsigned int D.31168;
  unsigned int D.31169;
  unsigned int D.31170;
  unsigned int pos_leave.459;
  int D.31172;
  int D.31175;
  struct MonoClass * D.31178;
  int D.31179;
  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.31093 = method == 0B;
  D.31094 = (long int) D.31093;
  D.31095 = __builtin_expect (D.31094, 0);
  if (D.31095 != 0) goto <D.31096>; else goto <D.31097>;
  <D.31096>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12796, "method");
  <D.31097>:
  klass = method->klass;
  D.31098 = method->klass;
  image = D.31098->image;
  D.31099 = &image->thunk_invoke_cache;
  cache = get_cache (D.31099, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.31100>; else goto <D.31101>;
  <D.31100>:
  D.31102 = res;
  return D.31102;
  <D.31101>:
  sig = mono_method_signature (method);
  D.31103 = method->name;
  mb = mono_mb_new (klass, D.31103, 5);
  D.31104 = sig->param_count;
  D.31105 = (int) D.31104;
  D.31106 = sig->hasthis;
  D.31107 = (int) D.31106;
  D.31108 = D.31105 + D.31107;
  param_count = D.31108 + 1;
  param_count.456 = (unsigned int) param_count;
  csig = mono_metadata_signature_alloc (image, param_count.456);
  D.31104 = sig->param_count;
  D.31110 = (unsigned int) D.31104;
  D.31111 = D.31110 + 3;
  D.31112 = D.31111 * 4;
  sig_size = (int) D.31112;
  sig_size.457 = (unsigned int) sig_size;
  memcpy (csig, sig, sig_size.457);
  D.31114 = (short unsigned int) param_count;
  csig->param_count = D.31114;
  csig->hasthis = 0;
  csig->pinvoke = 1;
  csig->call_convention = 0;
  D.31115 = BIT_FIELD_REF <*sig, 8, 80>;
  D.31116 = D.31115 & 64;
  if (D.31116 != 0) goto <D.31117>; else goto <D.31118>;
  <D.31117>:
  D.31119 = &klass->byval_arg;
  csig->params[0] = D.31119;
  i = 0;
  goto <D.24081>;
  <D.24080>:
  D.31120 = i + 1;
  D.31121 = sig->params[i];
  csig->params[D.31120] = D.31121;
  i = i + 1;
  <D.24081>:
  D.31104 = sig->param_count;
  D.31105 = (int) D.31104;
  if (D.31105 > i) goto <D.24080>; else goto <D.24082>;
  <D.24082>:
  <D.31118>:
  D.31122 = param_count + -1;
  D.31123 = mono_defaults.exception_class;
  D.31124 = &D.31123->byval_arg;
  D.31125 = mono_metadata_type_dup (image, D.31124);
  csig->params[D.31122] = D.31125;
  D.31122 = param_count + -1;
  D.31126 = csig->params[D.31122];
  D.31126->byref = 1;
  D.31122 = param_count + -1;
  D.31126 = csig->params[D.31122];
  D.31126->attrs = 2;
  D.31127 = sig->ret;
  D.31128 = mono_type_is_struct (D.31127);
  if (D.31128 != 0) goto <D.31129>; else goto <D.31130>;
  <D.31129>:
  D.31131 = mono_defaults.object_class;
  D.31132 = &D.31131->byval_arg;
  csig->ret = D.31132;
  <D.31130>:
  D.31131 = mono_defaults.object_class;
  D.31132 = &D.31131->byval_arg;
  mono_mb_add_local (mb, D.31132);
  D.31127 = sig->ret;
  D.31133 = mono_type_is_void (D.31127);
  if (D.31133 == 0) goto <D.31134>; else goto <D.31135>;
  <D.31134>:
  D.31127 = sig->ret;
  mono_mb_add_local (mb, D.31127);
  <D.31135>:
  D.31122 = param_count + -1;
  D.31136 = (unsigned int) D.31122;
  mono_mb_emit_ldarg (mb, D.31136);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  clause = mono_image_alloc0 (image, 24);
  D.31137 = mono_mb_get_label (mb);
  D.31138 = (unsigned int) D.31137;
  clause->try_offset = D.31138;
  i = 0;
  goto <D.24086>;
  <D.24085>:
  {
    struct MonoType * type;
    struct MonoClass * klass;

    i.458 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.458);
    D.31140 = csig->params[i];
    klass = mono_class_from_mono_type (D.31140);
    type = &klass->byval_arg;
    D.31141 = mono_type_is_struct (type);
    if (D.31141 != 0) goto <D.31142>; else goto <D.31143>;
    <D.31142>:
    mono_mb_emit_op (mb, 121, klass);
    D.31140 = csig->params[i];
    D.31146 = BIT_FIELD_REF <*D.31140, 8, 56>;
    D.31147 = D.31146 & 64;
    if (D.31147 == 0) goto <D.31148>; else goto <D.31149>;
    <D.31148>:
    if (i != 0) goto <D.31144>; else goto <D.31150>;
    <D.31150>:
    D.31115 = BIT_FIELD_REF <*sig, 8, 80>;
    D.31116 = D.31115 & 64;
    if (D.31116 == 0) goto <D.31144>; else goto <D.31145>;
    <D.31144>:
    mono_mb_emit_op (mb, 113, klass);
    <D.31145>:
    <D.31149>:
    D.31131 = mono_defaults.object_class;
    D.31132 = &D.31131->byval_arg;
    csig->params[i] = D.31132;
    <D.31143>:
  }
  i = i + 1;
  <D.24086>:
  D.31122 = param_count + -1;
  if (D.31122 > i) goto <D.24085>; else goto <D.24087>;
  <D.24087>:
  D.31151 = method->flags;
  D.31152 = (int) D.31151;
  D.31153 = D.31152 & 64;
  if (D.31153 != 0) goto <D.31154>; else goto <D.31155>;
  <D.31154>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.31156>;
  <D.31155>:
  mono_mb_emit_op (mb, 40, method);
  <D.31156>:
  D.31127 = sig->ret;
  D.31157 = mono_type_is_void (D.31127);
  if (D.31157 == 0) goto <D.31158>; else goto <D.31159>;
  <D.31158>:
  mono_mb_emit_stloc (mb, 1);
  <D.31159>:
  D.31160 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.31160;
  clause->flags = 0;
  D.31161 = mono_mb_get_pos (mb);
  D.31162 = (unsigned int) D.31161;
  D.31163 = clause->try_offset;
  D.31164 = D.31162 - D.31163;
  clause->try_len = D.31164;
  D.31131 = mono_defaults.object_class;
  clause->data.catch_class = D.31131;
  D.31165 = mono_mb_get_label (mb);
  D.31166 = (unsigned int) D.31165;
  clause->handler_offset = D.31166;
  mono_mb_emit_stloc (mb, 0);
  D.31122 = param_count + -1;
  D.31136 = (unsigned int) D.31122;
  mono_mb_emit_ldarg (mb, D.31136);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.31167 = mono_mb_get_pos (mb);
  D.31168 = (unsigned int) D.31167;
  D.31169 = clause->handler_offset;
  D.31170 = D.31168 - D.31169;
  clause->handler_len = D.31170;
  mono_mb_set_clauses (mb, 1, clause);
  pos_leave.459 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.459);
  D.31127 = sig->ret;
  D.31172 = mono_type_is_void (D.31127);
  if (D.31172 == 0) goto <D.31173>; else goto <D.31174>;
  <D.31173>:
  mono_mb_emit_ldloc (mb, 1);
  D.31127 = sig->ret;
  D.31175 = mono_type_is_struct (D.31127);
  if (D.31175 != 0) goto <D.31176>; else goto <D.31177>;
  <D.31176>:
  D.31127 = sig->ret;
  D.31178 = mono_class_from_mono_type (D.31127);
  mono_mb_emit_op (mb, 140, D.31178);
  <D.31177>:
  <D.31174>:
  mono_mb_emit_byte (mb, 42);
  D.31179 = param_count + 16;
  res = mono_mb_create_and_cache (cache, method, mb, csig, D.31179);
  mono_mb_free (mb);
  D.31102 = res;
  return D.31102;
}


mono_marshal_free_dynamic_wrappers (struct MonoMethod * method)
{
  struct MonoClass * D.31181;
  unsigned char D.31182;
  unsigned char D.31183;
  _Bool D.31184;
  long int D.31185;
  long int D.31186;
  int marshal_mutex_initialized.460;
  _Bool D.31194;
  long int D.31195;
  long int D.31196;
  struct GHashTable * D.31199;
  struct GHashTable * D.31202;
  _Bool D.31209;
  long int D.31210;
  long int D.31211;
  struct MonoImage * image;

  D.31181 = method->klass;
  image = D.31181->image;
  D.31182 = BIT_FIELD_REF <*method, 8, 168>;
  D.31183 = D.31182 & 2;
  D.31184 = D.31183 == 0;
  D.31185 = (long int) D.31184;
  D.31186 = __builtin_expect (D.31185, 0);
  if (D.31186 != 0) goto <D.31187>; else goto <D.31188>;
  <D.31187>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12939, "method->dynamic");
  <D.31188>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.31190>; else goto <D.31191>;
  <D.31190>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.31192>; else goto <D.31193>;
    <D.31192>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.31193>:
    D.31194 = ret != 0;
    D.31195 = (long int) D.31194;
    D.31196 = __builtin_expect (D.31195, 0);
    if (D.31196 != 0) goto <D.31197>; else goto <D.31198>;
    <D.31197>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12943, "ret == 0");
    <D.31198>:
  }
  <D.31191>:
  D.31199 = image->runtime_invoke_direct_cache;
  if (D.31199 != 0B) goto <D.31200>; else goto <D.31201>;
  <D.31200>:
  D.31199 = image->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.31199, method);
  <D.31201>:
  D.31202 = image->delegate_abstract_invoke_cache;
  if (D.31202 != 0B) goto <D.31203>; else goto <D.31204>;
  <D.31203>:
  D.31202 = image->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.31202, signature_method_pair_matches_method, method);
  <D.31204>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.31205>; else goto <D.31206>;
  <D.31205>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.31207>; else goto <D.31208>;
    <D.31207>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.31208>:
    D.31209 = ret != 0;
    D.31210 = (long int) D.31209;
    D.31211 = __builtin_expect (D.31210, 0);
    if (D.31211 != 0) goto <D.31212>; else goto <D.31213>;
    <D.31212>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12954, "ret == 0");
    <D.31213>:
  }
  <D.31206>:
}


signature_method_pair_matches_method (void * key, void * value, void * user_data)
{
  gboolean D.31214;
  struct MonoMethod * D.31215;
  _Bool D.31216;
  struct SignatureMethodPair * pair;
  struct MonoMethod * method;

  pair = key;
  method = user_data;
  D.31215 = pair->method;
  D.31216 = D.31215 == method;
  D.31214 = (gboolean) D.31216;
  return D.31214;
}


mono_marshal_free_inflated_wrappers (struct MonoMethod * method)
{
  unsigned char D.31218;
  unsigned char D.31219;
  _Bool D.31220;
  long int D.31221;
  long int D.31222;
  int marshal_mutex_initialized.461;
  _Bool D.31230;
  long int D.31231;
  long int D.31232;
  struct MonoClass * D.31237;
  struct MonoImage * D.31238;
  struct GHashTable * D.31239;
  struct GHashTable * D.31244;
  struct GHashTable * D.31249;
  struct GHashTable * D.31254;
  struct GHashTable * D.31259;
  struct GHashTable * D.31264;
  struct GHashTable * D.31267;
  struct GHashTable * D.31270;
  struct GHashTable * D.31273;
  struct GHashTable * D.31276;
  struct GHashTable * D.31279;
  struct GHashTable * D.31282;
  struct GHashTable * D.31285;
  struct GHashTable * D.31288;
  struct GHashTable * D.31291;
  struct GHashTable * D.31294;
  _Bool D.31299;
  long int D.31300;
  long int D.31301;
  struct MonoMethodSignature * sig;

  sig = method->signature;
  D.31218 = BIT_FIELD_REF <*method, 8, 168>;
  D.31219 = D.31218 & 16;
  D.31220 = D.31219 == 0;
  D.31221 = (long int) D.31220;
  D.31222 = __builtin_expect (D.31221, 0);
  if (D.31222 != 0) goto <D.31223>; else goto <D.31224>;
  <D.31223>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12976, "method->is_inflated");
  <D.31224>:
  marshal_mutex_initialized.461 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.461 == 0) goto <D.31226>; else goto <D.31227>;
  <D.31226>:
  return;
  <D.31227>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.31228>; else goto <D.31229>;
    <D.31228>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.31229>:
    D.31230 = ret != 0;
    D.31231 = (long int) D.31230;
    D.31232 = __builtin_expect (D.31231, 0);
    if (D.31232 != 0) goto <D.31233>; else goto <D.31234>;
    <D.31233>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12982, "ret == 0");
    <D.31234>:
  }
  if (sig != 0B) goto <D.31235>; else goto <D.31236>;
  <D.31235>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31239 = D.31238->delegate_begin_invoke_cache;
  if (D.31239 != 0B) goto <D.31240>; else goto <D.31241>;
  <D.31240>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31239 = D.31238->delegate_begin_invoke_cache;
  monoeg_g_hash_table_remove (D.31239, sig);
  <D.31241>:
  <D.31236>:
  if (sig != 0B) goto <D.31242>; else goto <D.31243>;
  <D.31242>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31244 = D.31238->delegate_end_invoke_cache;
  if (D.31244 != 0B) goto <D.31245>; else goto <D.31246>;
  <D.31245>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31244 = D.31238->delegate_end_invoke_cache;
  monoeg_g_hash_table_remove (D.31244, sig);
  <D.31246>:
  <D.31243>:
  if (sig != 0B) goto <D.31247>; else goto <D.31248>;
  <D.31247>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31249 = D.31238->delegate_invoke_cache;
  if (D.31249 != 0B) goto <D.31250>; else goto <D.31251>;
  <D.31250>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31249 = D.31238->delegate_invoke_cache;
  monoeg_g_hash_table_remove (D.31249, sig);
  <D.31251>:
  <D.31248>:
  if (sig != 0B) goto <D.31252>; else goto <D.31253>;
  <D.31252>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31254 = D.31238->runtime_invoke_cache;
  if (D.31254 != 0B) goto <D.31255>; else goto <D.31256>;
  <D.31255>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31254 = D.31238->runtime_invoke_cache;
  monoeg_g_hash_table_remove (D.31254, sig);
  <D.31256>:
  <D.31253>:
  if (sig != 0B) goto <D.31257>; else goto <D.31258>;
  <D.31257>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31259 = D.31238->runtime_invoke_vtype_cache;
  if (D.31259 != 0B) goto <D.31260>; else goto <D.31261>;
  <D.31260>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31259 = D.31238->runtime_invoke_vtype_cache;
  monoeg_g_hash_table_remove (D.31259, sig);
  <D.31261>:
  <D.31258>:
  if (sig != 0B) goto <D.31262>; else goto <D.31263>;
  <D.31262>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31264 = D.31238->delegate_abstract_invoke_cache;
  if (D.31264 != 0B) goto <D.31265>; else goto <D.31266>;
  <D.31265>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31264 = D.31238->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.31264, signature_method_pair_matches_signature, sig);
  <D.31266>:
  <D.31263>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31267 = D.31238->runtime_invoke_direct_cache;
  if (D.31267 != 0B) goto <D.31268>; else goto <D.31269>;
  <D.31268>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31267 = D.31238->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.31267, method);
  <D.31269>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31270 = D.31238->managed_wrapper_cache;
  if (D.31270 != 0B) goto <D.31271>; else goto <D.31272>;
  <D.31271>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31270 = D.31238->managed_wrapper_cache;
  monoeg_g_hash_table_remove (D.31270, method);
  <D.31272>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31273 = D.31238->native_wrapper_cache;
  if (D.31273 != 0B) goto <D.31274>; else goto <D.31275>;
  <D.31274>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31273 = D.31238->native_wrapper_cache;
  monoeg_g_hash_table_remove (D.31273, method);
  <D.31275>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31276 = D.31238->remoting_invoke_cache;
  if (D.31276 != 0B) goto <D.31277>; else goto <D.31278>;
  <D.31277>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31276 = D.31238->remoting_invoke_cache;
  monoeg_g_hash_table_remove (D.31276, method);
  <D.31278>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31279 = D.31238->synchronized_cache;
  if (D.31279 != 0B) goto <D.31280>; else goto <D.31281>;
  <D.31280>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31279 = D.31238->synchronized_cache;
  monoeg_g_hash_table_remove (D.31279, method);
  <D.31281>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31282 = D.31238->unbox_wrapper_cache;
  if (D.31282 != 0B) goto <D.31283>; else goto <D.31284>;
  <D.31283>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31282 = D.31238->unbox_wrapper_cache;
  monoeg_g_hash_table_remove (D.31282, method);
  <D.31284>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31285 = D.31238->cominterop_invoke_cache;
  if (D.31285 != 0B) goto <D.31286>; else goto <D.31287>;
  <D.31286>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31285 = D.31238->cominterop_invoke_cache;
  monoeg_g_hash_table_remove (D.31285, method);
  <D.31287>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31288 = D.31238->cominterop_wrapper_cache;
  if (D.31288 != 0B) goto <D.31289>; else goto <D.31290>;
  <D.31289>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31288 = D.31238->cominterop_wrapper_cache;
  monoeg_g_hash_table_remove (D.31288, method);
  <D.31290>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31291 = D.31238->thunk_invoke_cache;
  if (D.31291 != 0B) goto <D.31292>; else goto <D.31293>;
  <D.31292>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31291 = D.31238->thunk_invoke_cache;
  monoeg_g_hash_table_remove (D.31291, method);
  <D.31293>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31294 = D.31238->native_func_wrapper_aot_cache;
  if (D.31294 != 0B) goto <D.31295>; else goto <D.31296>;
  <D.31295>:
  D.31237 = method->klass;
  D.31238 = D.31237->image;
  D.31294 = D.31238->native_func_wrapper_aot_cache;
  monoeg_g_hash_table_remove (D.31294, method);
  <D.31296>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.31297>; else goto <D.31298>;
    <D.31297>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.31298>:
    D.31299 = ret != 0;
    D.31300 = (long int) D.31299;
    D.31301 = __builtin_expect (D.31300, 0);
    if (D.31301 != 0) goto <D.31302>; else goto <D.31303>;
    <D.31302>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 13034, "ret == 0");
    <D.31303>:
  }
}


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

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


