mono_signature_no_pinvoke (struct MonoMethod * method)
{
  long unsigned int D.22439;
  long unsigned int D.22440;
  struct MonoClass * D.22443;
  struct MonoImage * D.22444;
  struct MonoMethodSignature * D.22445;
  struct MonoMethodSignature * sig;

  sig = mono_method_signature (method);
  D.22439 = BIT_FIELD_REF <*sig, 64, 64>;
  D.22440 = D.22439 & 72057594037927936;
  if (D.22440 != 0) goto <D.22441>; else goto <D.22442>;
  <D.22441>:
  D.22443 = method->klass;
  D.22444 = D.22443->image;
  sig = signature_dup (D.22444, sig);
  sig->pinvoke = 0;
  <D.22442>:
  D.22445 = sig;
  return D.22445;
}


signature_dup (struct MonoImage * image, struct MonoMethodSignature * sig)
{
  short unsigned int D.22447;
  unsigned int D.22448;
  long unsigned int D.22449;
  long unsigned int D.22450;
  unsigned int D.22451;
  unsigned int D.22452;
  long unsigned int D.22453;
  struct MonoMethodSignature * D.22454;
  struct MonoMethodSignature * res;
  int sigsize;

  D.22447 = sig->param_count;
  D.22448 = (unsigned int) D.22447;
  res = mono_metadata_signature_alloc (image, D.22448);
  D.22447 = sig->param_count;
  D.22449 = (long unsigned int) D.22447;
  D.22450 = D.22449 + 2;
  D.22451 = (unsigned int) D.22450;
  D.22452 = D.22451 * 8;
  sigsize = (int) D.22452;
  D.22453 = (long unsigned int) sigsize;
  memcpy (res, sig, D.22453);
  D.22454 = res;
  return D.22454;
}


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

  D.22457 = __builtin_object_size (__dest, 0);
  D.22456 = __builtin___memcpy_chk (__dest, __src, __len, D.22457);
  return D.22456;
}


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.22459;
  void (*<Tbf>) (void *) destructor.0;
  int D.22461;
  _Bool D.22462;

  destructor.0 = (void (*<Tbf>) (void *)) destructor;
  D.22461 = pthread_key_create (key, destructor.0);
  D.22462 = D.22461 == 0;
  D.22459 = (int) D.22462;
  return D.22459;
}


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

  module_initialized.1 = module_initialized;
  if (module_initialized.1 == 0) goto <D.22465>; else goto <D.22466>;
  <D.22465>:
  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.22466>:
}


mono_remoting_wrapper (struct MonoMethod * method, void * * params)
{
  void * D.22467;
  _Bool D.22468;
  long int D.22469;
  long int D.22470;
  struct MonoVTable * D.22473;
  struct MonoClass * D.22474;
  struct MonoClass * D.22475;
  _Bool D.22476;
  long int D.22477;
  long int D.22478;
  struct MonoRemoteClass * D.22481;
  struct MonoClass * D.22482;
  long unsigned int D.22483;
  long unsigned int D.22484;
  struct MonoRealProxy * D.22487;
  struct MonoObject * D.22488;
  struct MonoAppContext * D.22489;
  short unsigned int D.22492;
  long unsigned int D.22493;
  long unsigned int D.22494;
  struct MonoType * D.22495;
  long unsigned int D.22496;
  long unsigned int D.22497;
  long unsigned int D.22500;
  long unsigned int D.22501;
  long unsigned int D.22504;
  long unsigned int D.22505;
  void * * D.22506;
  void * * D.22507;
  void * D.22508;
  void * D.22509;
  struct MonoClass * D.22511;
  int D.22512;
  struct MonoObject * D.22515;
  void * * D.22518;
  struct MonoObject * D.22519;
  void * iftmp.2;
  struct MonoClass * D.22521;
  long unsigned int D.22522;
  long unsigned int D.22523;
  struct MonoObject * exc.3;
  struct MonoArray * out_args.4;
  struct MonoMethodMessage * msg;
  struct MonoTransparentProxy * this;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;

  try
    {
      D.22467 = *params;
      this = MEM[(struct MonoTransparentProxy * *)D.22467];
      D.22468 = this == 0B;
      D.22469 = (long int) D.22468;
      D.22470 = __builtin_expect (D.22469, 0);
      if (D.22470 != 0) goto <D.22471>; else goto <D.22472>;
      <D.22471>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3124, "this");
      <D.22472>:
      D.22473 = MEM[(struct MonoObject *)this].vtable;
      D.22474 = D.22473->klass;
      D.22475 = mono_defaults.transparent_proxy_class;
      D.22476 = D.22474 != D.22475;
      D.22477 = (long int) D.22476;
      D.22478 = __builtin_expect (D.22477, 0);
      if (D.22478 != 0) goto <D.22479>; else goto <D.22480>;
      <D.22479>:
      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.22480>:
      params = params + 8;
      D.22481 = this->remote_class;
      D.22482 = D.22481->proxy_class;
      D.22483 = BIT_FIELD_REF <*D.22482, 64, 256>;
      D.22484 = D.22483 & 8388608;
      if (D.22484 != 0) goto <D.22485>; else goto <D.22486>;
      <D.22485>:
      D.22487 = this->rp;
      D.22488 = D.22487->context;
      D.22489 = mono_context_get ();
      if (D.22488 == D.22489) goto <D.22490>; else goto <D.22491>;
      <D.22490>:
      {
        int i;
        struct MonoMethodSignature * sig;
        int count;
        void * * mparams;

        sig = mono_method_signature (method);
        D.22492 = sig->param_count;
        count = (int) D.22492;
        D.22493 = (long unsigned int) count;
        D.22494 = D.22493 * 8;
        mparams = __builtin_alloca (D.22494);
        i = 0;
        goto <D.20148>;
        <D.20147>:
        {
          struct MonoClass * class;

          D.22495 = sig->params[i];
          class = mono_class_from_mono_type (D.22495);
          D.22496 = BIT_FIELD_REF <*class, 64, 256>;
          D.22497 = D.22496 & 8;
          if (D.22497 != 0) goto <D.22498>; else goto <D.22499>;
          <D.22498>:
          D.22495 = sig->params[i];
          D.22500 = BIT_FIELD_REF <*D.22495, 64, 64>;
          D.22501 = D.22500 & 1073741824;
          if (D.22501 != 0) goto <D.22502>; else goto <D.22503>;
          <D.22502>:
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22506 = mparams + D.22505;
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22507 = params + D.22505;
          D.22508 = *D.22507;
          D.22509 = MEM[(void * *)D.22508];
          *D.22506 = D.22509;
          goto <D.22510>;
          <D.22503>:
          D.22495 = sig->params[i];
          D.22511 = mono_class_from_mono_type (D.22495);
          D.22512 = mono_class_is_nullable (D.22511);
          if (D.22512 != 0) goto <D.22513>; else goto <D.22514>;
          <D.22513>:
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22506 = mparams + D.22505;
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22507 = params + D.22505;
          D.22508 = *D.22507;
          D.22515 = mono_nullable_box (D.22508, class);
          *D.22506 = D.22515;
          goto <D.22516>;
          <D.22514>:
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22506 = mparams + D.22505;
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22507 = params + D.22505;
          D.22508 = *D.22507;
          *D.22506 = D.22508;
          <D.22516>:
          <D.22510>:
          goto <D.22517>;
          <D.22499>:
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22506 = mparams + D.22505;
          D.22504 = (long unsigned int) i;
          D.22505 = D.22504 * 8;
          D.22507 = params + D.22505;
          D.22508 = *D.22507;
          D.22518 = MEM[(void * * *)D.22508];
          *D.22506 = D.22518;
          <D.22517>:
        }
        i = i + 1;
        <D.20148>:
        if (i < count) goto <D.20147>; else goto <D.20149>;
        <D.20149>:
        D.22521 = method->klass;
        D.22522 = BIT_FIELD_REF <*D.22521, 64, 256>;
        D.22523 = D.22522 & 8;
        if (D.22523 != 0) goto <D.22524>; else goto <D.22525>;
        <D.22524>:
        iftmp.2 = mono_object_unbox (this);
        goto <D.22526>;
        <D.22525>:
        iftmp.2 = this;
        <D.22526>:
        D.22519 = mono_runtime_invoke (method, iftmp.2, mparams, 0B);
        return D.22519;
      }
      <D.22491>:
      <D.22486>:
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.22487 = this->rp;
      res = mono_remoting_invoke (D.22487, msg, &exc, &out_args);
      exc.3 = exc;
      if (exc.3 != 0B) goto <D.22528>; else goto <D.22529>;
      <D.22528>:
      exc.3 = exc;
      mono_raise_exception (exc.3);
      <D.22529>:
      out_args.4 = out_args;
      mono_method_return_message_restore (method, params, out_args.4);
      D.22519 = res;
      return D.22519;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


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

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


mono_marshal_check_domain_image (gint32 domain_id, struct MonoImage * image)
{
  gboolean D.22537;
  union mono_mutex_t * D.22538;
  _Bool D.22541;
  long int D.22542;
  long int D.22543;
  struct MonoImage * D.22546;
  _Bool D.22550;
  long int D.22551;
  long int D.22552;
  _Bool D.22555;
  struct MonoAssembly * ass;
  struct GSList * tmp;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.22535>; else goto <D.22536>;
  <D.22535>:
  D.22537 = 0;
  return D.22537;
  <D.22536>:
  {
    int ret;

    D.22538 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.22538);
    if (ret != 0) goto <D.22539>; else goto <D.22540>;
    <D.22539>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22540>:
    D.22541 = ret != 0;
    D.22542 = (long int) D.22541;
    D.22543 = __builtin_expect (D.22542, 0);
    if (D.22543 != 0) goto <D.22544>; else goto <D.22545>;
    <D.22544>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3452, "ret == 0");
    <D.22545>:
  }
  tmp = domain->domain_assemblies;
  goto <D.20270>;
  <D.20269>:
  ass = tmp->data;
  D.22546 = ass->image;
  if (D.22546 == image) goto <D.20268>; else goto <D.22547>;
  <D.22547>:
  tmp = tmp->next;
  <D.20270>:
  if (tmp != 0B) goto <D.20269>; else goto <D.20268>;
  <D.20268>:
  {
    int ret;

    D.22538 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.22538);
    if (ret != 0) goto <D.22548>; else goto <D.22549>;
    <D.22548>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22549>:
    D.22550 = ret != 0;
    D.22551 = (long int) D.22550;
    D.22552 = __builtin_expect (D.22551, 0);
    if (D.22552 != 0) goto <D.22553>; else goto <D.22554>;
    <D.22553>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3458, "ret == 0");
    <D.22554>:
  }
  D.22555 = tmp != 0B;
  D.22537 = (gboolean) D.22555;
  return D.22537;
}


mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push)
{
  int D.22560;
  struct MonoException * D.22561;
  gint32 D.22565;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (id);
  if (domain == 0B) goto <D.22557>; else goto <D.22559>;
  <D.22559>:
  D.22560 = mono_domain_set (domain, 0);
  if (D.22560 == 0) goto <D.22557>; else goto <D.22558>;
  <D.22557>:
  D.22561 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.22561);
  <D.22558>:
  if (push != 0) goto <D.22562>; else goto <D.22563>;
  <D.22562>:
  mono_thread_push_appdomain_ref (domain);
  goto <D.22564>;
  <D.22563>:
  mono_thread_pop_appdomain_ref ();
  <D.22564>:
  D.22565 = current_domain->domain_id;
  return D.22565;
}


mono_marshal_xdomain_copy_out_value (struct MonoObject * src, struct MonoObject * dst)
{
  struct MonoVTable * D.22570;
  struct MonoClass * D.22571;
  struct MonoVTable * D.22572;
  struct MonoClass * D.22573;
  _Bool D.22574;
  long int D.22575;
  long int D.22576;
  unsigned char D.22579;
  int D.22580;
  struct MonoClass * D.22581;
  struct MonoType * D.22582;
  <unnamed type> D.22583;
  long unsigned int D.22588;
  long unsigned int D.22589;
  char * D.22590;
  struct MonoObject * D.22591;
  struct MonoClass * D.22594;
  struct MonoString * * D.22597;
  struct MonoDomain * D.22598;
  struct MonoString * D.22599;
  mono_unichar2 * D.22600;
  int D.22601;
  struct MonoString * D.22602;
  int D.22603;

  if (src == 0B) goto <D.22567>; else goto <D.22569>;
  <D.22569>:
  if (dst == 0B) goto <D.22567>; else goto <D.22568>;
  <D.22567>:
  return;
  <D.22568>:
  D.22570 = src->vtable;
  D.22571 = D.22570->klass;
  D.22572 = dst->vtable;
  D.22573 = D.22572->klass;
  D.22574 = D.22571 != D.22573;
  D.22575 = (long int) D.22574;
  D.22576 = __builtin_expect (D.22575, 0);
  if (D.22576 != 0) goto <D.22577>; else goto <D.22578>;
  <D.22577>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3340, "mono_object_class (src) == mono_object_class (dst)");
  <D.22578>:
  D.22570 = src->vtable;
  D.22571 = D.22570->klass;
  D.22579 = D.22571->byval_arg.type;
  D.22580 = (int) D.22579;
  switch (D.22580) <default: <D.22593>, case 20: <D.20215>, case 29: <D.20216>>
  <D.20215>:
  <D.20216>:
  {
    int mt;

    D.22570 = src->vtable;
    D.22571 = D.22570->klass;
    D.22581 = D.22571->element_class;
    D.22582 = &D.22581->byval_arg;
    D.22583 = mono_get_xdomain_marshal_type (D.22582);
    mt = (int) D.22583;
    if (mt == 3) goto <D.22584>; else goto <D.22585>;
    <D.22584>:
    return;
    <D.22585>:
    if (mt == 1) goto <D.22586>; else goto <D.22587>;
    <D.22586>:
    {
      int i;
      int len;

      D.22588 = mono_array_length (dst);
      len = (int) D.22588;
      i = 0;
      goto <D.20223>;
      <D.20222>:
      {
        struct MonoObject * item;

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

          D.22589 = (long unsigned int) i;
          __p = mono_array_addr_with_size (dst, 8, D.22589);
          D.22591 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (dst, __p, D.22591);
        }
      }
      i = i + 1;
      <D.20223>:
      if (i < len) goto <D.20222>; else goto <D.20224>;
      <D.20224>:
    }
    goto <D.22592>;
    <D.22587>:
    mono_array_full_copy (src, dst);
    <D.22592>:
    return;
  }
  <D.22593>:
  D.22570 = src->vtable;
  D.22571 = D.22570->klass;
  D.22594 = mono_defaults.stringbuilder_class;
  if (D.22571 == D.22594) goto <D.22595>; else goto <D.22596>;
  <D.22595>:
  {
    struct MonoStringBuilder * src_sb;
    struct MonoStringBuilder * dst_sb;

    src_sb = src;
    dst_sb = dst;
    D.22597 = &dst_sb->str;
    D.22572 = dst->vtable;
    D.22598 = D.22572->domain;
    D.22599 = src_sb->str;
    D.22600 = mono_string_chars (D.22599);
    D.22599 = src_sb->str;
    D.22601 = mono_string_length (D.22599);
    D.22602 = mono_string_new_utf16 (D.22598, D.22600, D.22601);
    mono_gc_wbarrier_set_field (dst_sb, D.22597, D.22602);
    dst_sb->cached_str = 0B;
    D.22603 = src_sb->length;
    dst_sb->length = D.22603;
  }
  <D.22596>:
}


mono_get_xdomain_marshal_type (struct MonoType * t)
{
  unsigned char D.22605;
  int D.22606;
  MonoXDomainMarshalType D.22607;
  struct MonoClass * D.22608;
  struct MonoType * D.22609;
  <unnamed type> D.22610;

  D.22605 = t->type;
  D.22606 = (int) D.22605;
  switch (D.22606) <default: <D.22613>, case 1: <D.20161>, case 2: <D.20164>, case 3: <D.20167>, case 4: <D.20163>, case 5: <D.20162>, case 6: <D.20166>, case 7: <D.20165>, case 8: <D.20169>, case 9: <D.20168>, case 10: <D.20170>, case 11: <D.20171>, case 12: <D.20172>, case 13: <D.20173>, case 14: <D.20174>, case 20: <D.20175>, case 29: <D.20176>>
  <D.20161>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3240);
  <D.20162>:
  <D.20163>:
  <D.20164>:
  <D.20165>:
  <D.20166>:
  <D.20167>:
  <D.20168>:
  <D.20169>:
  <D.20170>:
  <D.20171>:
  <D.20172>:
  <D.20173>:
  D.22607 = 0;
  return D.22607;
  <D.20174>:
  D.22607 = 1;
  return D.22607;
  <D.20175>:
  <D.20176>:
  {
    struct MonoClass * elem_class;

    D.22608 = mono_class_from_mono_type (t);
    elem_class = D.22608->element_class;
    D.22609 = &elem_class->byval_arg;
    D.22610 = mono_get_xdomain_marshal_type (D.22609);
    if (D.22610 != 3) goto <D.22611>; else goto <D.22612>;
    <D.22611>:
    D.22607 = 1;
    return D.22607;
    <D.22612>:
    goto <D.20178>;
  }
  <D.22613>:
  <D.20178>:
  D.22607 = 3;
  return D.22607;
}


mono_delegate_end_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.22615;
  long int D.22616;
  long int D.22617;
  struct MonoReflectionMethod * D.22620;
  struct MonoMethod * D.22623;
  _Bool D.22624;
  long int D.22625;
  long int D.22626;
  struct MonoReflectionMethod * * D.22629;
  struct MonoReflectionMethod * D.22630;
  struct MonoMethod * D.22634;
  struct MonoVTable * D.22635;
  _Bool D.22636;
  long int D.22637;
  long int D.22638;
  struct MonoArray * D.22641;
  short unsigned int D.22642;
  int D.22643;
  int D.22644;
  long unsigned int D.22645;
  char * D.22646;
  struct MonoImage * D.22649;
  struct MonoException * D.22650;
  struct MonoObject * D.22651;
  struct MonoObject * D.22652;
  struct MonoException * D.22655;
  struct MonoObject * D.22658;
  struct MonoVTable * D.22660;
  struct MonoClass * D.22661;
  struct MonoClass * D.22662;
  struct MonoClass * D.22664;
  struct MonoAsyncResult * * D.22665;
  struct MonoRealProxy * D.22666;
  struct MonoObject * exc.5;
  struct MonoString * D.22670;
  struct MonoString * * D.22673;
  struct MonoString * D.22674;
  struct MonoArray * out_args.6;
  struct MonoDomain * domain;
  struct MonoAsyncResult * ares;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodMessage * msg;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;
  struct MonoClass * klass;

  try
    {
      domain = mono_domain_get ();
      method = 0B;
      D.22615 = delegate == 0B;
      D.22616 = (long int) D.22615;
      D.22617 = __builtin_expect (D.22616, 0);
      if (D.22617 != 0) goto <D.22618>; else goto <D.22619>;
      <D.22618>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2908, "delegate");
      <D.22619>:
      D.22620 = delegate->method_info;
      if (D.22620 == 0B) goto <D.22621>; else goto <D.22622>;
      <D.22621>:
      D.22623 = delegate->method;
      D.22624 = D.22623 == 0B;
      D.22625 = (long int) D.22624;
      D.22626 = __builtin_expect (D.22625, 0);
      if (D.22626 != 0) goto <D.22627>; else goto <D.22628>;
      <D.22627>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2911, "delegate->method");
      <D.22628>:
      D.22629 = &delegate->method_info;
      D.22623 = delegate->method;
      D.22630 = mono_method_get_object (domain, D.22623, 0B);
      mono_gc_wbarrier_set_field (delegate, D.22629, D.22630);
      <D.22622>:
      D.22620 = delegate->method_info;
      if (D.22620 == 0B) goto <D.22631>; else goto <D.22633>;
      <D.22633>:
      D.22620 = delegate->method_info;
      D.22634 = D.22620->method;
      if (D.22634 == 0B) goto <D.22631>; else goto <D.22632>;
      <D.22631>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2916);
      <D.22632>:
      D.22635 = delegate->object.vtable;
      klass = D.22635->klass;
      method = mono_class_get_method_from_name (klass, "EndInvoke", -1);
      D.22636 = method == 0B;
      D.22637 = (long int) D.22636;
      D.22638 = __builtin_expect (D.22637, 0);
      if (D.22638 != 0) goto <D.22639>; else goto <D.22640>;
      <D.22639>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2921, "method != NULL");
      <D.22640>:
      sig = mono_signature_no_pinvoke (method);
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.22641 = msg->args;
      D.22642 = sig->param_count;
      D.22643 = (int) D.22642;
      D.22644 = D.22643 + -1;
      D.22645 = (long unsigned int) D.22644;
      D.22646 = mono_array_addr_with_size (D.22641, 8, D.22645);
      ares = MEM[(void * *)D.22646];
      if (ares == 0B) goto <D.22647>; else goto <D.22648>;
      <D.22647>:
      D.22649 = mono_defaults.corlib;
      D.22650 = mono_exception_from_name_msg (D.22649, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.");
      mono_raise_exception (D.22650);
      D.22651 = 0B;
      return D.22651;
      <D.22648>:
      D.22652 = ares->async_delegate;
      if (D.22652 != delegate) goto <D.22653>; else goto <D.22654>;
      <D.22653>:
      D.22655 = mono_get_exception_invalid_operation ("The IAsyncResult object provided does not match this delegate.");
      mono_raise_exception (D.22655);
      D.22651 = 0B;
      return D.22651;
      <D.22654>:
      D.22658 = delegate->target;
      if (D.22658 != 0B) goto <D.22659>; else goto <D.22656>;
      <D.22659>:
      D.22658 = delegate->target;
      D.22660 = D.22658->vtable;
      D.22661 = D.22660->klass;
      D.22662 = mono_defaults.transparent_proxy_class;
      if (D.22661 == D.22662) goto <D.22663>; else goto <D.22656>;
      <D.22663>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.22664 = mono_defaults.mono_method_message_class;
        msg = mono_object_new (domain, D.22664);
        D.22620 = delegate->method_info;
        mono_message_init (domain, msg, D.22620, 0B);
        msg->call_type = 2;
        D.22665 = &msg->async_result;
        mono_gc_wbarrier_set_field (msg, D.22665, ares);
        D.22666 = tp->rp;
        res = mono_remoting_invoke (D.22666, msg, &exc, &out_args);
      }
      goto <D.22657>;
      <D.22656>:
      res = mono_thread_pool_finish (ares, &out_args, &exc);
      <D.22657>:
      exc.5 = exc;
      if (exc.5 != 0B) goto <D.22668>; else goto <D.22669>;
      <D.22668>:
      exc.5 = exc;
      D.22670 = MEM[(struct MonoException *)exc.5].stack_trace;
      if (D.22670 != 0B) goto <D.22671>; else goto <D.22672>;
      <D.22671>:
      {
        char * strace;
        char * tmp;

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


mono_delegate_begin_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.22678;
  long int D.22679;
  long int D.22680;
  struct MonoMulticastDelegate * D.22683;
  struct MonoException * D.22686;
  struct MonoObject * D.22687;
  struct MonoVTable * D.22690;
  struct MonoClass * D.22691;
  struct MonoClass * D.22692;
  struct MonoRemoteClass * D.22697;
  struct MonoClass * D.22698;
  long unsigned int D.22699;
  long unsigned int D.22700;
  struct MonoRealProxy * D.22702;
  struct MonoObject * D.22703;
  struct MonoAppContext * D.22704;
  struct MonoMethod * D.22705;
  struct MonoDomain * D.22706;
  struct MonoObject * state.7;
  struct MonoObject * * D.22708;
  struct MonoObject * * D.22709;
  struct MonoDelegate * async_callback.8;
  struct MonoAsyncResult * * D.22711;
  struct MonoObject * exc.9;
  struct MonoAsyncResult * D.22715;
  struct MonoVTable * D.22716;
  _Bool D.22719;
  long int D.22720;
  long int D.22721;
  struct MonoClass * D.22724;
  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.22678 = delegate == 0B;
      D.22679 = (long int) D.22678;
      D.22680 = __builtin_expect (D.22679, 0);
      if (D.22680 != 0) goto <D.22681>; else goto <D.22682>;
      <D.22681>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2147, "delegate");
      <D.22682>:
      mcast_delegate = delegate;
      D.22683 = mcast_delegate->prev;
      if (D.22683 != 0B) goto <D.22684>; else goto <D.22685>;
      <D.22684>:
      D.22686 = mono_get_exception_argument (0B, "The delegate must have only one target");
      mono_raise_exception (D.22686);
      <D.22685>:
      D.22687 = delegate->target;
      if (D.22687 != 0B) goto <D.22688>; else goto <D.22689>;
      <D.22688>:
      D.22687 = delegate->target;
      D.22690 = D.22687->vtable;
      D.22691 = D.22690->klass;
      D.22692 = mono_defaults.transparent_proxy_class;
      if (D.22691 == D.22692) goto <D.22693>; else goto <D.22694>;
      <D.22693>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.22697 = tp->remote_class;
        D.22698 = D.22697->proxy_class;
        D.22699 = BIT_FIELD_REF <*D.22698, 64, 256>;
        D.22700 = D.22699 & 8388608;
        if (D.22700 == 0) goto <D.22695>; else goto <D.22701>;
        <D.22701>:
        D.22702 = tp->rp;
        D.22703 = D.22702->context;
        D.22704 = mono_context_get ();
        if (D.22703 != D.22704) goto <D.22695>; else goto <D.22696>;
        <D.22695>:
        {
          struct MonoAsyncResult * ares;
          struct MonoObject * exc;
          struct MonoArray * out_args;

          try
            {
              method = delegate->method;
              D.22705 = mono_marshal_method_from_wrapper (method);
              msg = mono_method_call_message_new (D.22705, params, 0B, &async_callback, &state);
              D.22706 = mono_domain_get ();
              state.7 = state;
              ares = mono_async_result_new (D.22706, 0B, state.7, 0B, 0B);
              D.22708 = &ares->async_delegate;
              mono_gc_wbarrier_set_field (ares, D.22708, delegate);
              D.22709 = &ares->async_callback;
              async_callback.8 = async_callback;
              mono_gc_wbarrier_set_field (ares, D.22709, async_callback.8);
              D.22711 = &msg->async_result;
              mono_gc_wbarrier_set_field (msg, D.22711, ares);
              msg->call_type = 1;
              exc = 0B;
              D.22702 = tp->rp;
              mono_remoting_invoke (D.22702, msg, &exc, &out_args);
              exc.9 = exc;
              if (exc.9 != 0B) goto <D.22713>; else goto <D.22714>;
              <D.22713>:
              exc.9 = exc;
              mono_raise_exception (exc.9);
              <D.22714>:
              D.22715 = ares;
              return D.22715;
            }
          finally
            {
              exc = {CLOBBER};
              out_args = {CLOBBER};
            }
        }
        <D.22696>:
      }
      <D.22694>:
      <D.22689>:
      D.22716 = delegate->object.vtable;
      klass = D.22716->klass;
      method = mono_get_delegate_invoke (klass);
      method2 = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      if (method2 != 0B) goto <D.22717>; else goto <D.22718>;
      <D.22717>:
      method = method2;
      <D.22718>:
      D.22719 = method == 0B;
      D.22720 = (long int) D.22719;
      D.22721 = __builtin_expect (D.22720, 0);
      if (D.22721 != 0) goto <D.22722>; else goto <D.22723>;
      <D.22722>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2188, "method != NULL");
      <D.22723>:
      D.22724 = method->klass;
      im = mono_get_delegate_invoke (D.22724);
      msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
      async_callback.8 = async_callback;
      state.7 = state;
      D.22715 = mono_thread_pool_add (delegate, msg, async_callback.8, state.7);
      return D.22715;
    }
  finally
    {
      async_callback = {CLOBBER};
      state = {CLOBBER};
    }
}


mono_struct_delete_old (struct MonoClass * klass, char * ptr)
{
  struct MonoClassField * D.22728;
  short unsigned int D.22729;
  int D.22730;
  int D.22731;
  struct MonoMarshalSpec * D.22734;
  <unnamed-unsigned:1> D.22735;
  int D.22736;
  unsigned int D.22737;
  sizetype D.22738;
  <unnamed type> conv.10;
  int D.22740;
  struct MonoClass * D.22743;
  void * D.22744;
  unsigned int i.11;
  unsigned int D.22746;
  struct MonoMarshalType * info;
  int i;

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

    try
      {
        D.22728 = info->fields[i].field;
        ftype = D.22728->type;
        D.22729 = ftype->attrs;
        D.22730 = (int) D.22729;
        D.22731 = D.22730 & 16;
        if (D.22731 != 0) goto <D.22732>; else goto <D.22733>;
        <D.22732>:
        // predicted unlikely by continue predictor.
        goto <D.22088>;
        <D.22733>:
        D.22734 = info->fields[i].mspec;
        D.22735 = klass->unicode;
        D.22736 = (int) D.22735;
        ntype = mono_type_to_unmanaged (ftype, D.22734, 1, D.22736, &conv);
        D.22737 = info->fields[i].offset;
        D.22738 = (sizetype) D.22737;
        cpos = ptr + D.22738;
        conv.10 = conv;
        switch (conv.10) <default: <D.22097>, case 0: <D.22089>, case 3: <D.22094>, case 4: <D.22093>, case 7: <D.22091>, case 9: <D.22092>, case 10: <D.22095>, case 11: <D.22096>>
        <D.22089>:
        D.22740 = mono_type_is_struct (ftype);
        if (D.22740 != 0) goto <D.22741>; else goto <D.22742>;
        <D.22741>:
        D.22743 = ftype->data.klass;
        mono_struct_delete_old (D.22743, cpos);
        // predicted unlikely by continue predictor.
        goto <D.22088>;
        <D.22742>:
        goto <D.22090>;
        <D.22091>:
        goto <D.22090>;
        <D.22092>:
        <D.22093>:
        <D.22094>:
        <D.22095>:
        <D.22096>:
        D.22744 = MEM[(void * *)cpos];
        mono_marshal_free (D.22744);
        goto <D.22090>;
        <D.22097>:
        // predicted unlikely by continue predictor.
        goto <D.22088>;
        <D.22090>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.22088>:
  i = i + 1;
  <D.22099>:
  i.11 = (unsigned int) i;
  D.22746 = info->num_fields;
  if (i.11 < D.22746) goto <D.22098>; else goto <D.22100>;
  <D.22100>:
}


mono_string_utf16_to_builder2 (gunichar2 * text)
{
  struct MonoStringBuilder * D.22752;
  struct MonoClass * string_builder_class.12;
  struct MonoImage * D.22756;
  struct MonoClass * string_builder_class.13;
  _Bool D.22758;
  long int D.22759;
  long int D.22760;
  struct MonoMethod * sb_ctor.14;
  struct MonoMethod * sb_ctor.15;
  _Bool D.22765;
  long int D.22766;
  long int D.22767;
  int len.16;
  int len.17;
  long unsigned int D.22772;
  long unsigned int D.22773;
  gunichar2 * D.22774;
  short unsigned int D.22775;
  struct MonoDomain * D.22776;
  _Bool D.22777;
  long int D.22778;
  long int D.22779;
  struct MonoObject * exc.18;
  _Bool D.22783;
  long int D.22784;
  long int D.22785;
  struct MonoString * D.22788;
  mono_unichar2 * D.22789;
  int D.22790;
  long unsigned int D.22791;
  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.22750>; else goto <D.22751>;
      <D.22750>:
      D.22752 = 0B;
      return D.22752;
      <D.22751>:
      string_builder_class.12 = string_builder_class;
      if (string_builder_class.12 == 0B) goto <D.22754>; else goto <D.22755>;
      <D.22754>:
      {
        struct MonoMethodDesc * desc;

        D.22756 = mono_defaults.corlib;
        string_builder_class.13 = mono_class_from_name (D.22756, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.13;
        string_builder_class.12 = string_builder_class;
        D.22758 = string_builder_class.12 == 0B;
        D.22759 = (long int) D.22758;
        D.22760 = __builtin_expect (D.22759, 0);
        if (D.22760 != 0) goto <D.22761>; else goto <D.22762>;
        <D.22761>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 846, "string_builder_class");
        <D.22762>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.12 = string_builder_class;
        sb_ctor.14 = mono_method_desc_search_in_class (desc, string_builder_class.12);
        sb_ctor = sb_ctor.14;
        sb_ctor.15 = sb_ctor;
        D.22765 = sb_ctor.15 == 0B;
        D.22766 = (long int) D.22765;
        D.22767 = __builtin_expect (D.22766, 0);
        if (D.22767 != 0) goto <D.22768>; else goto <D.22769>;
        <D.22768>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 849, "sb_ctor");
        <D.22769>:
        mono_method_desc_free (desc);
      }
      <D.22755>:
      len = 0;
      goto <D.19479>;
      <D.19478>:
      len.16 = len;
      len.17 = len.16 + 1;
      len = len.17;
      <D.19479>:
      len.16 = len;
      D.22772 = (long unsigned int) len.16;
      D.22773 = D.22772 * 2;
      D.22774 = text + D.22773;
      D.22775 = *D.22774;
      if (D.22775 != 0) goto <D.19478>; else goto <D.19480>;
      <D.19480>:
      D.22776 = mono_domain_get ();
      string_builder_class.12 = string_builder_class;
      sb = mono_object_new (D.22776, string_builder_class.12);
      D.22777 = sb == 0B;
      D.22778 = (long int) D.22777;
      D.22779 = __builtin_expect (D.22778, 0);
      if (D.22779 != 0) goto <D.22780>; else goto <D.22781>;
      <D.22780>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 857, "sb");
      <D.22781>:
      args[0] = &len;
      sb_ctor.15 = sb_ctor;
      mono_runtime_invoke (sb_ctor.15, sb, &args, &exc);
      exc.18 = exc;
      D.22783 = exc.18 != 0B;
      D.22784 = (long int) D.22783;
      D.22785 = __builtin_expect (D.22784, 0);
      if (D.22785 != 0) goto <D.22786>; else goto <D.22787>;
      <D.22786>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 860, "!exc");
      <D.22787>:
      len.16 = len;
      sb->length = len.16;
      D.22788 = sb->str;
      D.22789 = mono_string_chars (D.22788);
      len.16 = len;
      D.22790 = len.16 * 2;
      D.22791 = (long unsigned int) D.22790;
      memcpy (D.22789, text, D.22791);
      D.22752 = sb;
      return D.22752;
    }
  finally
    {
      len = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_string_utf8_to_builder2 (char * text)
{
  struct MonoStringBuilder * D.22796;
  struct MonoClass * string_builder_class.19;
  struct MonoImage * D.22800;
  struct MonoClass * string_builder_class.20;
  _Bool D.22802;
  long int D.22803;
  long int D.22804;
  struct MonoMethod * sb_ctor.21;
  struct MonoMethod * sb_ctor.22;
  _Bool D.22809;
  long int D.22810;
  long int D.22811;
  long unsigned int D.22814;
  int l.23;
  struct MonoDomain * D.22816;
  _Bool D.22817;
  long int D.22818;
  long int D.22819;
  struct MonoObject * exc.24;
  _Bool D.22823;
  long int D.22824;
  long int D.22825;
  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.22794>; else goto <D.22795>;
      <D.22794>:
      D.22796 = 0B;
      return D.22796;
      <D.22795>:
      string_builder_class.19 = string_builder_class;
      if (string_builder_class.19 == 0B) goto <D.22798>; else goto <D.22799>;
      <D.22798>:
      {
        struct MonoMethodDesc * desc;

        D.22800 = mono_defaults.corlib;
        string_builder_class.20 = mono_class_from_name (D.22800, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.20;
        string_builder_class.19 = string_builder_class;
        D.22802 = string_builder_class.19 == 0B;
        D.22803 = (long int) D.22802;
        D.22804 = __builtin_expect (D.22803, 0);
        if (D.22804 != 0) goto <D.22805>; else goto <D.22806>;
        <D.22805>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 789, "string_builder_class");
        <D.22806>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.19 = string_builder_class;
        sb_ctor.21 = mono_method_desc_search_in_class (desc, string_builder_class.19);
        sb_ctor = sb_ctor.21;
        sb_ctor.22 = sb_ctor;
        D.22809 = sb_ctor.22 == 0B;
        D.22810 = (long int) D.22809;
        D.22811 = __builtin_expect (D.22810, 0);
        if (D.22811 != 0) goto <D.22812>; else goto <D.22813>;
        <D.22812>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 792, "sb_ctor");
        <D.22813>:
        mono_method_desc_free (desc);
      }
      <D.22799>:
      D.22814 = strlen (text);
      l.23 = (int) D.22814;
      l = l.23;
      D.22816 = mono_domain_get ();
      string_builder_class.19 = string_builder_class;
      sb = mono_object_new (D.22816, string_builder_class.19);
      D.22817 = sb == 0B;
      D.22818 = (long int) D.22817;
      D.22819 = __builtin_expect (D.22818, 0);
      if (D.22819 != 0) goto <D.22820>; else goto <D.22821>;
      <D.22820>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 799, "sb");
      <D.22821>:
      args[0] = &l;
      sb_ctor.22 = sb_ctor;
      mono_runtime_invoke (sb_ctor.22, sb, &args, &exc);
      exc.24 = exc;
      D.22823 = exc.24 != 0B;
      D.22824 = (long int) D.22823;
      D.22825 = __builtin_expect (D.22824, 0);
      if (D.22825 != 0) goto <D.22826>; else goto <D.22827>;
      <D.22826>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 802, "!exc");
      <D.22827>:
      mono_string_utf8_to_builder (sb, text);
      D.22796 = sb;
      return D.22796;
    }
  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.22830;

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


mono_array_to_byvalarray (void * native_arr, struct MonoArray * arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.22831;
  struct MonoClass * D.22832;
  struct MonoClass * D.22833;
  struct MonoClass * D.22834;
  _Bool D.22835;
  long int D.22836;
  long int D.22837;
  struct MonoClass * D.22840;
  char * D.22843;
  long unsigned int D.22844;
  long int D.22845;
  struct GError * error.25;
  gchar * D.22849;
  size_t iftmp.26;
  long unsigned int D.22851;
  long unsigned int D.22852;

  D.22831 = arr->obj.vtable;
  D.22832 = D.22831->klass;
  D.22833 = D.22832->element_class;
  D.22834 = mono_defaults.char_class;
  D.22835 = D.22833 != D.22834;
  D.22836 = (long int) D.22835;
  D.22837 = __builtin_expect (D.22836, 0);
  if (D.22837 != 0) goto <D.22838>; else goto <D.22839>;
  <D.22838>:
  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.22839>:
  D.22840 = mono_defaults.byte_class;
  if (D.22840 == elclass) goto <D.22841>; else goto <D.22842>;
  <D.22841>:
  {
    char * as;
    struct GError * error;

    try
      {
        error = 0B;
        D.22843 = mono_array_addr_with_size (arr, 2, 0);
        D.22844 = mono_array_length (arr);
        D.22845 = (long int) D.22844;
        as = monoeg_g_utf16_to_utf8 (D.22843, D.22845, 0B, 0B, &error);
        error.25 = error;
        if (error.25 != 0B) goto <D.22847>; else goto <D.22848>;
        <D.22847>:
        {
          struct MonoException * exc;

          error.25 = error;
          D.22849 = error.25->message;
          exc = mono_get_exception_argument ("string", D.22849);
          error.25 = error;
          monoeg_g_error_free (error.25);
          mono_raise_exception (exc);
        }
        <D.22848>:
        D.22851 = strlen (as);
        D.22852 = (long unsigned int) elnum;
        if (D.22851 < D.22852) goto <D.22853>; else goto <D.22854>;
        <D.22853>:
        iftmp.26 = strlen (as);
        goto <D.22855>;
        <D.22854>:
        iftmp.26 = (size_t) elnum;
        <D.22855>:
        memcpy (native_arr, as, iftmp.26);
        monoeg_g_free (as);
      }
    finally
      {
        error = {CLOBBER};
      }
  }
  goto <D.22856>;
  <D.22842>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 731);
  <D.22856>:
}


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

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


mono_byvalarray_to_array (struct MonoArray * arr, void * native_arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.22858;
  struct MonoClass * D.22859;
  struct MonoClass * D.22860;
  struct MonoClass * D.22861;
  _Bool D.22862;
  long int D.22863;
  long int D.22864;
  struct MonoClass * D.22867;
  long int D.22870;
  struct GError * error.27;
  char * D.22874;
  long int items_written.28;
  long unsigned int items_written.29;
  long unsigned int D.22877;

  D.22858 = arr->obj.vtable;
  D.22859 = D.22858->klass;
  D.22860 = D.22859->element_class;
  D.22861 = mono_defaults.char_class;
  D.22862 = D.22860 != D.22861;
  D.22863 = (long int) D.22862;
  D.22864 = __builtin_expect (D.22863, 0);
  if (D.22864 != 0) goto <D.22865>; else goto <D.22866>;
  <D.22865>:
  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.22866>:
  D.22867 = mono_defaults.byte_class;
  if (D.22867 == elclass) goto <D.22868>; else goto <D.22869>;
  <D.22868>:
  {
    struct GError * error;
    guint16 * ut;
    glong items_written;

    try
      {
        error = 0B;
        D.22870 = (long int) elnum;
        ut = monoeg_g_utf8_to_utf16 (native_arr, D.22870, 0B, &items_written, &error);
        error.27 = error;
        if (error.27 == 0B) goto <D.22872>; else goto <D.22873>;
        <D.22872>:
        D.22874 = mono_array_addr_with_size (arr, 2, 0);
        items_written.28 = items_written;
        items_written.29 = (long unsigned int) items_written.28;
        D.22877 = items_written.29 * 2;
        memcpy (D.22874, ut, D.22877);
        monoeg_g_free (ut);
        goto <D.22878>;
        <D.22873>:
        error.27 = error;
        monoeg_g_error_free (error.27);
        <D.22878>:
      }
    finally
      {
        error = {CLOBBER};
        items_written = {CLOBBER};
      }
  }
  goto <D.22879>;
  <D.22869>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 703);
  <D.22879>:
}


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

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


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

  D.22883 = mono_domain_get ();
  D.22882 = mono_string_new_len (D.22883, text, length);
  return D.22882;
}


mono_string_from_byvalwstr (gunichar2 * data, int max_len)
{
  struct MonoString * D.22887;
  long unsigned int D.22888;
  long unsigned int D.22889;
  gunichar2 * D.22890;
  short unsigned int D.22891;
  int D.22892;
  struct MonoDomain * domain;
  int len;

  domain = mono_domain_get ();
  len = 0;
  if (data == 0B) goto <D.22885>; else goto <D.22886>;
  <D.22885>:
  D.22887 = 0B;
  return D.22887;
  <D.22886>:
  goto <D.19363>;
  <D.19362>:
  len = len + 1;
  <D.19363>:
  D.22888 = (long unsigned int) len;
  D.22889 = D.22888 * 2;
  D.22890 = data + D.22889;
  D.22891 = *D.22890;
  if (D.22891 != 0) goto <D.19362>; else goto <D.19364>;
  <D.19364>:
  D.22892 = MIN_EXPR <max_len, len>;
  D.22887 = mono_string_new_utf16 (domain, data, D.22892);
  return D.22887;
}


mono_marshal_string_to_utf16_copy (struct MonoString * s)
{
  void * D.22896;
  int D.22897;
  int D.22898;
  int D.22899;
  long unsigned int D.22900;
  mono_unichar2 * D.22901;
  int D.22902;
  int D.22903;
  long unsigned int D.22904;
  int D.22905;
  long unsigned int D.22906;
  long unsigned int D.22907;
  gunichar2 * D.22908;

  if (s == 0B) goto <D.22894>; else goto <D.22895>;
  <D.22894>:
  D.22896 = 0B;
  return D.22896;
  <D.22895>:
  {
    gunichar2 * res;

    D.22897 = mono_string_length (s);
    D.22898 = D.22897 + 1;
    D.22899 = D.22898 * 2;
    D.22900 = (long unsigned int) D.22899;
    res = mono_marshal_alloc (D.22900);
    D.22901 = mono_string_chars (s);
    D.22902 = mono_string_length (s);
    D.22903 = D.22902 * 2;
    D.22904 = (long unsigned int) D.22903;
    memcpy (res, D.22901, D.22904);
    D.22905 = mono_string_length (s);
    D.22906 = (long unsigned int) D.22905;
    D.22907 = D.22906 * 2;
    D.22908 = res + D.22907;
    *D.22908 = 0;
    D.22896 = res;
    return D.22896;
  }
}


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

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


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

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


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


mono_delegate_to_ftnptr (struct MonoDelegate * delegate)
{
  void * D.22914;
  void * D.22915;
  struct MonoVTable * D.22918;
  long unsigned int D.22919;
  long unsigned int D.22920;
  _Bool D.22921;
  long int D.22922;
  long int D.22923;
  struct MonoMethodSignature * D.22926;
  long unsigned int D.22927;
  long unsigned int D.22928;
  const char * exc_class.32;
  _Bool D.22934;
  long int D.22935;
  long int D.22936;
  struct MonoImage * D.22939;
  const char * exc_arg.33;
  struct MonoException * D.22941;
  struct MonoObject * D.22942;
  void * D.22945;
  struct MonoMethod * method;
  struct MonoMethod * wrapper;
  struct MonoClass * klass;
  uint32_t target_handle;

  target_handle = 0;
  if (delegate == 0B) goto <D.22912>; else goto <D.22913>;
  <D.22912>:
  D.22914 = 0B;
  return D.22914;
  <D.22913>:
  D.22915 = delegate->delegate_trampoline;
  if (D.22915 != 0B) goto <D.22916>; else goto <D.22917>;
  <D.22916>:
  D.22914 = delegate->delegate_trampoline;
  return D.22914;
  <D.22917>:
  D.22918 = MEM[(struct MonoObject *)delegate].vtable;
  klass = D.22918->klass;
  D.22919 = BIT_FIELD_REF <*klass, 64, 256>;
  D.22920 = D.22919 & 16777216;
  D.22921 = D.22920 == 0;
  D.22922 = (long int) D.22921;
  D.22923 = __builtin_expect (D.22922, 0);
  if (D.22923 != 0) goto <D.22924>; else goto <D.22925>;
  <D.22924>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 352, "klass->delegate");
  <D.22925>:
  method = delegate->method;
  D.22926 = mono_method_signature (method);
  D.22927 = BIT_FIELD_REF <*D.22926, 64, 64>;
  D.22928 = D.22927 & 72057594037927936;
  if (D.22928 != 0) goto <D.22929>; else goto <D.22930>;
  <D.22929>:
  {
    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.22931>; else goto <D.22932>;
        <D.22931>:
        exc_class.32 = exc_class;
        D.22934 = exc_class.32 == 0B;
        D.22935 = (long int) D.22934;
        D.22936 = __builtin_expect (D.22935, 0);
        if (D.22936 != 0) goto <D.22937>; else goto <D.22938>;
        <D.22937>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 362, "exc_class");
        <D.22938>:
        D.22939 = mono_defaults.corlib;
        exc_class.32 = exc_class;
        exc_arg.33 = exc_arg;
        D.22941 = mono_exception_from_name_msg (D.22939, "System", exc_class.32, exc_arg.33);
        mono_raise_exception (D.22941);
        <D.22932>:
        D.22914 = ftnptr;
        return D.22914;
      }
    finally
      {
        exc_class = {CLOBBER};
        exc_arg = {CLOBBER};
      }
  }
  <D.22930>:
  D.22942 = delegate->target;
  if (D.22942 != 0B) goto <D.22943>; else goto <D.22944>;
  <D.22943>:
  D.22942 = delegate->target;
  target_handle = mono_gchandle_new_weakref (D.22942, 0);
  <D.22944>:
  wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
  D.22945 = mono_compile_method (wrapper);
  delegate->delegate_trampoline = D.22945;
  delegate_hash_table_add (delegate);
  mono_object_register_finalizer (delegate);
  D.22914 = delegate->delegate_trampoline;
  return D.22914;
}


delegate_hash_table_add (struct MonoDelegate * d)
{
  _Bool D.22950;
  long int D.22951;
  long int D.22952;
  struct GHashTable * delegate_hash_table.34;
  struct GHashTable * delegate_hash_table.35;
  int D.22959;
  void * D.22962;
  void * D.22963;
  long int D.22964;
  long unsigned int D.22965;
  void * D.22966;
  _Bool D.22972;
  long int D.22973;
  long int D.22974;
  guint32 gchandle;
  guint32 old_gchandle;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22948>; else goto <D.22949>;
    <D.22948>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22949>:
    D.22950 = ret != 0;
    D.22951 = (long int) D.22950;
    D.22952 = __builtin_expect (D.22951, 0);
    if (D.22952 != 0) goto <D.22953>; else goto <D.22954>;
    <D.22953>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 420, "ret == 0");
    <D.22954>:
  }
  delegate_hash_table.34 = delegate_hash_table;
  if (delegate_hash_table.34 == 0B) goto <D.22956>; else goto <D.22957>;
  <D.22956>:
  delegate_hash_table.35 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.35;
  <D.22957>:
  D.22959 = mono_gc_is_moving ();
  if (D.22959 != 0) goto <D.22960>; else goto <D.22961>;
  <D.22960>:
  gchandle = mono_gchandle_new_weakref (d, 0);
  delegate_hash_table.34 = delegate_hash_table;
  D.22962 = d->delegate_trampoline;
  D.22963 = monoeg_g_hash_table_lookup (delegate_hash_table.34, D.22962);
  D.22964 = (long int) D.22963;
  old_gchandle = (guint32) D.22964;
  delegate_hash_table.34 = delegate_hash_table;
  D.22962 = d->delegate_trampoline;
  D.22965 = (long unsigned int) gchandle;
  D.22966 = (void *) D.22965;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.34, D.22962, D.22966, 0);
  if (old_gchandle != 0) goto <D.22967>; else goto <D.22968>;
  <D.22967>:
  mono_gchandle_free (old_gchandle);
  <D.22968>:
  goto <D.22969>;
  <D.22961>:
  delegate_hash_table.34 = delegate_hash_table;
  D.22962 = d->delegate_trampoline;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.34, D.22962, d, 0);
  <D.22969>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22970>; else goto <D.22971>;
    <D.22970>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22971>:
    D.22972 = ret != 0;
    D.22973 = (long int) D.22972;
    D.22974 = __builtin_expect (D.22973, 0);
    if (D.22974 != 0) goto <D.22975>; else goto <D.22976>;
    <D.22975>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 432, "ret == 0");
    <D.22976>:
  }
}


delegate_hash_table_new ()
{
  struct GHashTable * D.22977;

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


mono_marshal_use_aot_wrappers (gboolean use)
{
  use_aot_wrappers = use;
}


mono_ftnptr_to_delegate (struct MonoClass * klass, void * ftn)
{
  void * ftn.36;
  struct MonoDelegate * D.22982;
  _Bool D.22985;
  long int D.22986;
  long int D.22987;
  struct GHashTable * delegate_hash_table.37;
  struct GHashTable * delegate_hash_table.38;
  int D.22994;
  void * D.22997;
  long int D.22998;
  _Bool D.23001;
  long int D.23002;
  long int D.23003;
  _Bool D.23012;
  long int D.23013;
  long int D.23014;
  int use_aot_wrappers.39;
  struct MonoDomain * D.23022;
  struct MonoClass * D.23023;
  struct MonoMethodSignature * D.23025;
  short unsigned int D.23026;
  int D.23027;
  int D.23028;
  long unsigned int D.23029;
  long unsigned int D.23030;
  struct MonoMethodSignature * D.23031;
  struct MonoImage * D.23032;
  struct MonoMethodSignature * D.23033;
  short unsigned int D.23034;
  long unsigned int D.23035;
  long unsigned int D.23036;
  struct MonoMarshalSpec * * D.23037;
  struct MonoMarshalSpec * D.23038;
  struct MonoDomain * D.23041;
  void * D.23042;
  struct MonoVTable * D.23043;
  struct MonoDomain * D.23044;
  struct MonoDomain * D.23045;
  struct MonoException * D.23048;
  guint32 gchandle;
  struct MonoDelegate * d;

  ftn.36 = ftn;
  if (ftn.36 == 0B) goto <D.22980>; else goto <D.22981>;
  <D.22980>:
  D.22982 = 0B;
  return D.22982;
  <D.22981>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22983>; else goto <D.22984>;
    <D.22983>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22984>:
    D.22985 = ret != 0;
    D.22986 = (long int) D.22985;
    D.22987 = __builtin_expect (D.22986, 0);
    if (D.22987 != 0) goto <D.22988>; else goto <D.22989>;
    <D.22988>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 483, "ret == 0");
    <D.22989>:
  }
  delegate_hash_table.37 = delegate_hash_table;
  if (delegate_hash_table.37 == 0B) goto <D.22991>; else goto <D.22992>;
  <D.22991>:
  delegate_hash_table.38 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.38;
  <D.22992>:
  D.22994 = mono_gc_is_moving ();
  if (D.22994 != 0) goto <D.22995>; else goto <D.22996>;
  <D.22995>:
  delegate_hash_table.37 = delegate_hash_table;
  ftn.36 = ftn;
  D.22997 = monoeg_g_hash_table_lookup (delegate_hash_table.37, ftn.36);
  D.22998 = (long int) D.22997;
  gchandle = (guint32) D.22998;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22999>; else goto <D.23000>;
    <D.22999>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23000>:
    D.23001 = ret != 0;
    D.23002 = (long int) D.23001;
    D.23003 = __builtin_expect (D.23002, 0);
    if (D.23003 != 0) goto <D.23004>; else goto <D.23005>;
    <D.23004>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 489, "ret == 0");
    <D.23005>:
  }
  if (gchandle != 0) goto <D.23006>; else goto <D.23007>;
  <D.23006>:
  d = mono_gchandle_get_target (gchandle);
  goto <D.23008>;
  <D.23007>:
  d = 0B;
  <D.23008>:
  goto <D.23009>;
  <D.22996>:
  delegate_hash_table.37 = delegate_hash_table;
  ftn.36 = ftn;
  d = monoeg_g_hash_table_lookup (delegate_hash_table.37, ftn.36);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23010>; else goto <D.23011>;
    <D.23010>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23011>:
    D.23012 = ret != 0;
    D.23013 = (long int) D.23012;
    D.23014 = __builtin_expect (D.23013, 0);
    if (D.23014 != 0) goto <D.23015>; else goto <D.23016>;
    <D.23015>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 496, "ret == 0");
    <D.23016>:
  }
  <D.23009>:
  if (d == 0B) goto <D.23017>; else goto <D.23018>;
  <D.23017>:
  {
    struct MonoMethodSignature * sig;
    struct MonoMethod * wrapper;
    struct MonoMarshalSpec * * mspecs;
    struct MonoMethod * invoke;
    struct MonoMethodPInvoke piinfo;
    struct MonoObject * this;
    int i;

    try
      {
        invoke = mono_get_delegate_invoke (klass);
        use_aot_wrappers.39 = use_aot_wrappers;
        if (use_aot_wrappers.39 != 0) goto <D.23020>; else goto <D.23021>;
        <D.23020>:
        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
        D.23022 = mono_domain_get ();
        D.23023 = mono_defaults.int_class;
        this = mono_value_box (D.23022, D.23023, &ftn);
        goto <D.23024>;
        <D.23021>:
        memset (&piinfo, 0, 56);
        parse_unmanaged_function_pointer_attr (klass, &piinfo);
        D.23025 = mono_method_signature (invoke);
        D.23026 = D.23025->param_count;
        D.23027 = (int) D.23026;
        D.23028 = D.23027 + 1;
        D.23029 = (long unsigned int) D.23028;
        D.23030 = D.23029 * 8;
        mspecs = monoeg_malloc0 (D.23030);
        mono_method_get_marshal_info (invoke, mspecs);
        D.23031 = mono_method_signature (invoke);
        sig = mono_metadata_signature_dup (D.23031);
        sig->hasthis = 0;
        D.23032 = klass->image;
        ftn.36 = ftn;
        wrapper = mono_marshal_get_native_func_wrapper (D.23032, sig, &piinfo, mspecs, ftn.36);
        this = 0B;
        D.23033 = mono_method_signature (invoke);
        D.23034 = D.23033->param_count;
        i = (int) D.23034;
        goto <D.19346>;
        <D.19345>:
        D.23035 = (long unsigned int) i;
        D.23036 = D.23035 * 8;
        D.23037 = mspecs + D.23036;
        D.23038 = *D.23037;
        if (D.23038 != 0B) goto <D.23039>; else goto <D.23040>;
        <D.23039>:
        D.23035 = (long unsigned int) i;
        D.23036 = D.23035 * 8;
        D.23037 = mspecs + D.23036;
        D.23038 = *D.23037;
        mono_metadata_free_marshal_spec (D.23038);
        <D.23040>:
        i = i + -1;
        <D.19346>:
        if (i >= 0) goto <D.19345>; else goto <D.19347>;
        <D.19347>:
        monoeg_g_free (mspecs);
        monoeg_g_free (sig);
        <D.23024>:
        D.23041 = mono_domain_get ();
        d = mono_object_new (D.23041, klass);
        D.23042 = mono_compile_method (wrapper);
        mono_delegate_ctor_with_method (d, this, D.23042, wrapper);
      }
    finally
      {
        piinfo = {CLOBBER};
      }
  }
  <D.23018>:
  D.23043 = d->object.vtable;
  D.23044 = D.23043->domain;
  D.23045 = mono_domain_get ();
  if (D.23044 != D.23045) goto <D.23046>; else goto <D.23047>;
  <D.23046>:
  D.23048 = mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain");
  mono_raise_exception (D.23048);
  <D.23047>:
  D.22982 = d;
  return D.22982;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.23052;
  int D.23057;
  void * D.23059;
  long unsigned int D.23060;

  D.23052 = __builtin_constant_p (__len);
  if (D.23052 != 0) goto <D.23053>; else goto <D.23054>;
  <D.23053>:
  if (__len == 0) goto <D.23055>; else goto <D.23056>;
  <D.23055>:
  D.23057 = __builtin_constant_p (__ch);
  if (D.23057 == 0) goto <D.23050>; else goto <D.23058>;
  <D.23058>:
  if (__ch != 0) goto <D.23050>; else goto <D.23051>;
  <D.23050>:
  __warn_memset_zero_len ();
  D.23059 = __dest;
  return D.23059;
  <D.23051>:
  <D.23056>:
  <D.23054>:
  D.23060 = __builtin_object_size (__dest, 0);
  D.23059 = __builtin___memset_chk (__dest, __ch, __len, D.23060);
  return D.23059;
}


parse_unmanaged_function_pointer_attr (struct MonoClass * klass, struct MonoMethodPInvoke * piinfo)
{
  struct MonoClass * UnmanagedFunctionPointerAttribute.40;
  struct MonoImage * D.23065;
  struct MonoClass * UnmanagedFunctionPointerAttribute.41;
  int D.23071;
  int D.23076;
  int D.23077;
  signed short D.23078;
  signed short iftmp.42;
  int D.23080;
  int D.23083;
  unsigned short D.23084;
  unsigned short D.23085;
  signed short D.23087;
  unsigned char D.23088;
  signed short D.23089;
  signed short D.23090;
  short unsigned int D.23091;
  int D.23092;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoCustomAttrInfo * cinfo;
  struct MonoReflectionUnmanagedFunctionPointerAttribute * attr;

  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.40 == 0B) goto <D.23063>; else goto <D.23064>;
  <D.23063>:
  D.23065 = mono_defaults.corlib;
  UnmanagedFunctionPointerAttribute.41 = mono_class_from_name (D.23065, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
  UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.41;
  <D.23064>:
  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.40 != 0B) goto <D.23067>; else goto <D.23068>;
  <D.23067>:
  cinfo = mono_custom_attrs_from_class (klass);
  if (cinfo != 0B) goto <D.23069>; else goto <D.23070>;
  <D.23069>:
  D.23071 = mono_runtime_get_no_exec ();
  if (D.23071 == 0) goto <D.23072>; else goto <D.23073>;
  <D.23072>:
  UnmanagedFunctionPointerAttribute.40 = UnmanagedFunctionPointerAttribute;
  attr = mono_custom_attrs_get_attr (cinfo, UnmanagedFunctionPointerAttribute.40);
  if (attr != 0B) goto <D.23074>; else goto <D.23075>;
  <D.23074>:
  D.23076 = attr->call_conv;
  D.23077 = D.23076 << 8;
  D.23078 = (signed short) D.23077;
  D.23080 = attr->charset;
  if (D.23080 != 0) goto <D.23081>; else goto <D.23082>;
  <D.23081>:
  D.23080 = attr->charset;
  D.23083 = D.23080 + -1;
  D.23084 = (unsigned short) D.23083;
  D.23085 = D.23084 * 2;
  iftmp.42 = (signed short) D.23085;
  goto <D.23086>;
  <D.23082>:
  iftmp.42 = 1;
  <D.23086>:
  D.23087 = D.23078 | iftmp.42;
  D.23088 = attr->set_last_error;
  D.23089 = (signed short) D.23088;
  D.23090 = D.23087 | D.23089;
  D.23091 = (short unsigned int) D.23090;
  piinfo->piflags = D.23091;
  <D.23075>:
  D.23092 = cinfo->cached;
  if (D.23092 == 0) goto <D.23093>; else goto <D.23094>;
  <D.23093>:
  mono_custom_attrs_free (cinfo);
  <D.23094>:
  <D.23073>:
  <D.23070>:
  <D.23068>:
}


mono_delegate_free_ftnptr (struct MonoDelegate * delegate)
{
  void * * D.23095;
  struct MonoObject * D.23096;
  struct MonoDomain * D.23101;
  void * D.23102;
  _Bool D.23103;
  long int D.23104;
  long int D.23105;
  void * * D.23108;
  void * D.23109;
  long int D.23110;
  struct MonoVTable * D.23113;
  struct MonoDomain * D.23114;
  struct MonoJitInfo * ji;
  void * ptr;

  delegate_hash_table_remove (delegate);
  D.23095 = &delegate->delegate_trampoline;
  ptr = InterlockedExchangePointer (D.23095, 0B);
  D.23096 = delegate->target;
  if (D.23096 == 0B) goto <D.23097>; else goto <D.23098>;
  <D.23097>:
  return;
  <D.23098>:
  if (ptr != 0B) goto <D.23099>; else goto <D.23100>;
  <D.23099>:
  {
    uint32_t gchandle;
    void * * method_data;
    struct MonoMethod * method;

    D.23101 = mono_domain_get ();
    D.23102 = mono_get_addr_from_ftnptr (ptr);
    ji = mono_jit_info_table_find (D.23101, D.23102);
    D.23103 = ji == 0B;
    D.23104 = (long int) D.23103;
    D.23105 = __builtin_expect (D.23104, 0);
    if (D.23105 != 0) goto <D.23106>; else goto <D.23107>;
    <D.23106>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 562, "ji");
    <D.23107>:
    method = mono_jit_info_get_method (ji);
    method_data = MEM[(struct MonoMethodWrapper *)method].method_data;
    D.23108 = method_data + 16;
    D.23109 = *D.23108;
    D.23110 = (long int) D.23109;
    gchandle = (uint32_t) D.23110;
    if (gchandle != 0) goto <D.23111>; else goto <D.23112>;
    <D.23111>:
    mono_gchandle_free (gchandle);
    <D.23112>:
    D.23113 = MEM[(struct MonoObject *)delegate].vtable;
    D.23114 = D.23113->domain;
    mono_runtime_free_method (D.23114, method);
  }
  <D.23100>:
}


delegate_hash_table_remove (struct MonoDelegate * d)
{
  _Bool D.23118;
  long int D.23119;
  long int D.23120;
  struct GHashTable * delegate_hash_table.43;
  struct GHashTable * delegate_hash_table.44;
  int D.23127;
  void * D.23130;
  void * D.23131;
  long int D.23132;
  _Bool D.23135;
  long int D.23136;
  long int D.23137;
  int D.23140;
  guint32 gchandle;

  gchandle = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23116>; else goto <D.23117>;
    <D.23116>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23117>:
    D.23118 = ret != 0;
    D.23119 = (long int) D.23118;
    D.23120 = __builtin_expect (D.23119, 0);
    if (D.23120 != 0) goto <D.23121>; else goto <D.23122>;
    <D.23121>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 403, "ret == 0");
    <D.23122>:
  }
  delegate_hash_table.43 = delegate_hash_table;
  if (delegate_hash_table.43 == 0B) goto <D.23124>; else goto <D.23125>;
  <D.23124>:
  delegate_hash_table.44 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.44;
  <D.23125>:
  D.23127 = mono_gc_is_moving ();
  if (D.23127 != 0) goto <D.23128>; else goto <D.23129>;
  <D.23128>:
  delegate_hash_table.43 = delegate_hash_table;
  D.23130 = d->delegate_trampoline;
  D.23131 = monoeg_g_hash_table_lookup (delegate_hash_table.43, D.23130);
  D.23132 = (long int) D.23131;
  gchandle = (guint32) D.23132;
  <D.23129>:
  delegate_hash_table.43 = delegate_hash_table;
  D.23130 = d->delegate_trampoline;
  monoeg_g_hash_table_remove (delegate_hash_table.43, D.23130);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23133>; else goto <D.23134>;
    <D.23133>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23134>:
    D.23135 = ret != 0;
    D.23136 = (long int) D.23135;
    D.23137 = __builtin_expect (D.23136, 0);
    if (D.23137 != 0) goto <D.23138>; else goto <D.23139>;
    <D.23138>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 409, "ret == 0");
    <D.23139>:
  }
  D.23140 = mono_gc_is_moving ();
  if (D.23140 != 0) goto <D.23141>; else goto <D.23142>;
  <D.23141>:
  mono_gchandle_free (gchandle);
  <D.23142>:
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  long unsigned int old_val.45;
  long unsigned int new_val.46;
  long unsigned int D.23145;
  void * D.23146;
  void * D.23147;
  void * old_val;

  <D.18760>:
  old_val = *val;
  old_val.45 = (long unsigned int) old_val;
  new_val.46 = (long unsigned int) new_val;
  D.23145 = __sync_val_compare_and_swap_8 (val, old_val.45, new_val.46);
  D.23146 = (void *) D.23145;
  if (D.23146 != old_val) goto <D.18760>; else goto <D.18761>;
  <D.18761>:
  D.23147 = old_val;
  return D.23147;
}


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

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


mono_array_to_lparray (struct MonoArray * array)
{
  void * D.23155;
  struct MonoVTable * D.23156;
  struct MonoClass * D.23157;
  unsigned char D.23158;
  int D.23159;
  unsigned int D.23160;
  long unsigned int D.23161;
  long unsigned int D.23162;
  long unsigned int D.23163;
  long unsigned int D.23164;
  void * * D.23165;
  sizetype D.23166;
  double * D.23167;
  void * D.23168;
  void * D.23169;
  void * * nativeArray;
  int nativeArraySize;
  int i;
  struct MonoClass * klass;

  nativeArray = 0B;
  nativeArraySize = 0;
  i = 0;
  if (array == 0B) goto <D.23153>; else goto <D.23154>;
  <D.23153>:
  D.23155 = 0B;
  return D.23155;
  <D.23154>:
  D.23156 = array->obj.vtable;
  klass = D.23156->klass;
  D.23157 = klass->element_class;
  D.23158 = D.23157->byval_arg.type;
  D.23159 = (int) D.23158;
  switch (D.23159) <default: <D.19402>, case 1: <D.19375>, case 2: <D.19381>, case 3: <D.19384>, case 4: <D.19382>, case 5: <D.19380>, case 6: <D.19385>, case 7: <D.19383>, case 8: <D.19388>, case 9: <D.19389>, case 10: <D.19391>, case 11: <D.19390>, case 12: <D.19392>, case 13: <D.19393>, case 14: <D.19401>, case 15: <D.19395>, case 17: <D.19394>, case 18: <D.19376>, case 20: <D.19399>, case 21: <D.19397>, case 24: <D.19386>, case 25: <D.19387>, case 28: <D.19398>, case 29: <D.19400>>
  <D.19375>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 620);
  <D.19376>:
  D.23160 = array->max_length;
  nativeArraySize = (int) D.23160;
  D.23161 = (long unsigned int) nativeArraySize;
  D.23162 = D.23161 * 8;
  nativeArray = malloc (D.23162);
  i = 0;
  goto <D.19378>;
  <D.19377>:
  D.23163 = (long unsigned int) i;
  D.23164 = D.23163 * 8;
  D.23165 = nativeArray + D.23164;
  D.23166 = (sizetype) i;
  D.23167 = &array->vector[D.23166];
  D.23168 = MEM[(void * *)D.23167];
  D.23169 = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (D.23168);
  *D.23165 = D.23169;
  i = i + 1;
  <D.19378>:
  if (i < nativeArraySize) goto <D.19377>; else goto <D.19379>;
  <D.19379>:
  D.23155 = nativeArray;
  return D.23155;
  <D.19380>:
  <D.19381>:
  <D.19382>:
  <D.19383>:
  <D.19384>:
  <D.19385>:
  <D.19386>:
  <D.19387>:
  <D.19388>:
  <D.19389>:
  <D.19390>:
  <D.19391>:
  <D.19392>:
  <D.19393>:
  <D.19394>:
  <D.19395>:
  goto <D.19396>;
  <D.19397>:
  <D.19398>:
  <D.19399>:
  <D.19400>:
  <D.19401>:
  <D.19402>:
  D.23157 = klass->element_class;
  D.23158 = D.23157->byval_arg.type;
  D.23159 = (int) D.23158;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.23159);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 653);
  <D.19396>:
  D.23155 = &array->vector;
  return D.23155;
}


mono_free_lparray (struct MonoArray * array, void * * nativeArray)
{
  struct MonoVTable * D.23176;
  struct MonoClass * D.23177;
  unsigned char D.23178;
  int D.23179;
  long unsigned int D.23180;
  long unsigned int D.23181;
  void * * D.23182;
  void * D.23183;
  unsigned int i.47;
  unsigned int D.23185;
  struct MonoClass * klass;
  int i;

  i = 0;
  if (array == 0B) goto <D.23172>; else goto <D.23173>;
  <D.23172>:
  return;
  <D.23173>:
  if (nativeArray == 0B) goto <D.23174>; else goto <D.23175>;
  <D.23174>:
  return;
  <D.23175>:
  D.23176 = array->obj.vtable;
  klass = D.23176->klass;
  D.23177 = klass->element_class;
  D.23178 = D.23177->byval_arg.type;
  D.23179 = (int) D.23178;
  switch (D.23179) <default: <D.23186>, case 18: <D.19409>>
  <D.19409>:
  i = 0;
  goto <D.19411>;
  <D.19410>:
  D.23180 = (long unsigned int) i;
  D.23181 = D.23180 * 8;
  D.23182 = nativeArray + D.23181;
  D.23183 = *D.23182;
  mono_marshal_free_ccw (D.23183);
  i = i + 1;
  <D.19411>:
  i.47 = (unsigned int) i;
  D.23185 = array->max_length;
  if (i.47 < D.23185) goto <D.19410>; else goto <D.19412>;
  <D.19412>:
  free (nativeArray);
  goto <D.19413>;
  <D.23186>:
  <D.19413>:
}


mono_string_utf8_to_builder (struct MonoStringBuilder * sb, char * text)
{
  long unsigned int D.23191;
  long int D.23192;
  glong iftmp.48;
  struct MonoString * D.23194;
  int D.23197;
  long int items_written.49;
  glong iftmp.50;
  struct GError * error.51;
  struct MonoString * D.23212;
  struct MonoString * * D.23213;
  struct MonoDomain * D.23214;
  int D.23215;
  struct MonoString * D.23216;
  mono_unichar2 * D.23217;
  long int D.23218;
  long unsigned int D.23219;
  int D.23220;
  struct GError * error;
  guint16 * ut;
  glong items_written;
  int l;

  try
    {
      error = 0B;
      if (sb == 0B) goto <D.23188>; else goto <D.23190>;
      <D.23190>:
      if (text == 0B) goto <D.23188>; else goto <D.23189>;
      <D.23188>:
      return;
      <D.23189>:
      D.23191 = strlen (text);
      l = (int) D.23191;
      D.23192 = (long int) l;
      ut = monoeg_g_utf8_to_utf16 (text, D.23192, 0B, &items_written, &error);
      D.23194 = sb->str;
      if (D.23194 != 0B) goto <D.23195>; else goto <D.23196>;
      <D.23195>:
      D.23194 = sb->str;
      D.23197 = D.23194->length;
      iftmp.48 = (glong) D.23197;
      goto <D.23198>;
      <D.23196>:
      iftmp.48 = 16;
      <D.23198>:
      items_written.49 = items_written;
      if (iftmp.48 < items_written.49) goto <D.23200>; else goto <D.23201>;
      <D.23200>:
      D.23194 = sb->str;
      if (D.23194 != 0B) goto <D.23203>; else goto <D.23204>;
      <D.23203>:
      D.23194 = sb->str;
      D.23197 = D.23194->length;
      iftmp.50 = (glong) D.23197;
      goto <D.23205>;
      <D.23204>:
      iftmp.50 = 16;
      <D.23205>:
      items_written = iftmp.50;
      <D.23201>:
      error.51 = error;
      if (error.51 == 0B) goto <D.23207>; else goto <D.23208>;
      <D.23207>:
      D.23194 = sb->str;
      if (D.23194 == 0B) goto <D.23209>; else goto <D.23211>;
      <D.23211>:
      D.23194 = sb->str;
      D.23212 = sb->cached_str;
      if (D.23194 == D.23212) goto <D.23209>; else goto <D.23210>;
      <D.23209>:
      D.23213 = &sb->str;
      D.23214 = mono_domain_get ();
      items_written.49 = items_written;
      D.23215 = (int) items_written.49;
      D.23216 = mono_string_new_size (D.23214, D.23215);
      mono_gc_wbarrier_set_field (sb, D.23213, D.23216);
      <D.23210>:
      D.23194 = sb->str;
      D.23217 = mono_string_chars (D.23194);
      items_written.49 = items_written;
      D.23218 = items_written.49 * 2;
      D.23219 = (long unsigned int) D.23218;
      memcpy (D.23217, ut, D.23219);
      items_written.49 = items_written;
      D.23220 = (int) items_written.49;
      sb->length = D.23220;
      sb->cached_str = 0B;
      goto <D.23221>;
      <D.23208>:
      error.51 = error;
      monoeg_g_error_free (error.51);
      <D.23221>:
      monoeg_g_free (ut);
    }
  finally
    {
      error = {CLOBBER};
      items_written = {CLOBBER};
    }
}


mono_string_utf16_to_builder (struct MonoStringBuilder * sb, gunichar2 * text)
{
  struct MonoString * D.23228;
  mono_unichar2 * D.23229;
  _Bool D.23230;
  long int D.23231;
  long int D.23232;
  long unsigned int D.23235;
  long unsigned int D.23236;
  gunichar2 * D.23237;
  short unsigned int D.23238;
  int len.52;
  guint32 len;

  if (sb == 0B) goto <D.23225>; else goto <D.23227>;
  <D.23227>:
  if (text == 0B) goto <D.23225>; else goto <D.23226>;
  <D.23225>:
  return;
  <D.23226>:
  D.23228 = sb->str;
  D.23229 = mono_string_chars (D.23228);
  D.23230 = D.23229 != text;
  D.23231 = (long int) D.23230;
  D.23232 = __builtin_expect (D.23231, 0);
  if (D.23232 != 0) goto <D.23233>; else goto <D.23234>;
  <D.23233>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 821, "mono_string_chars (sb->str) == text");
  <D.23234>:
  len = 0;
  goto <D.19466>;
  <D.19465>:
  len = len + 1;
  <D.19466>:
  D.23235 = (long unsigned int) len;
  D.23236 = D.23235 * 2;
  D.23237 = text + D.23236;
  D.23238 = *D.23237;
  if (D.23238 != 0) goto <D.19465>; else goto <D.19467>;
  <D.19467>:
  len.52 = (int) len;
  sb->length = len.52;
}


mono_string_builder_to_utf8 (struct MonoStringBuilder * sb)
{
  void * D.23243;
  struct MonoString * D.23244;
  struct MonoString * D.23245;
  int D.23248;
  struct MonoString * * D.23251;
  struct MonoDomain * D.23252;
  struct MonoString * D.23253;
  mono_unichar2 * D.23254;
  int D.23255;
  long int D.23256;
  struct GError * error.53;
  struct MonoException * D.23260;
  gulong iftmp.54;
  int D.23265;
  int D.23267;
  long unsigned int D.23268;
  struct GError * error;
  gchar * tmp;
  gchar * res;

  try
    {
      error = 0B;
      res = 0B;
      if (sb == 0B) goto <D.23241>; else goto <D.23242>;
      <D.23241>:
      D.23243 = 0B;
      return D.23243;
      <D.23242>:
      D.23244 = sb->str;
      D.23245 = sb->cached_str;
      if (D.23244 == D.23245) goto <D.23246>; else goto <D.23247>;
      <D.23246>:
      D.23244 = sb->str;
      D.23248 = D.23244->length;
      if (D.23248 == 0) goto <D.23249>; else goto <D.23250>;
      <D.23249>:
      D.23251 = &sb->str;
      D.23252 = mono_domain_get ();
      D.23253 = mono_string_new_size (D.23252, 16);
      mono_gc_wbarrier_set_field (sb, D.23251, D.23253);
      sb->cached_str = 0B;
      <D.23250>:
      <D.23247>:
      D.23244 = sb->str;
      D.23254 = mono_string_chars (D.23244);
      D.23255 = sb->length;
      D.23256 = (long int) D.23255;
      tmp = monoeg_g_utf16_to_utf8 (D.23254, D.23256, 0B, 0B, &error);
      error.53 = error;
      if (error.53 != 0B) goto <D.23258>; else goto <D.23259>;
      <D.23258>:
      error.53 = error;
      monoeg_g_error_free (error.53);
      D.23260 = mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8");
      mono_raise_exception (D.23260);
      goto <D.23261>;
      <D.23259>:
      D.23244 = sb->str;
      if (D.23244 != 0B) goto <D.23263>; else goto <D.23264>;
      <D.23263>:
      D.23244 = sb->str;
      D.23248 = D.23244->length;
      D.23265 = D.23248 + 1;
      iftmp.54 = (gulong) D.23265;
      goto <D.23266>;
      <D.23264>:
      iftmp.54 = 17;
      <D.23266>:
      res = mono_marshal_alloc (iftmp.54);
      D.23255 = sb->length;
      D.23267 = D.23255 + 1;
      D.23268 = (long unsigned int) D.23267;
      memcpy (res, tmp, D.23268);
      monoeg_g_free (tmp);
      <D.23261>:
      D.23243 = res;
      return D.23243;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_string_builder_to_utf16 (struct MonoStringBuilder * sb)
{
  void * D.23273;
  struct MonoString * D.23274;
  _Bool D.23275;
  long int D.23276;
  long int D.23277;
  struct MonoString * D.23280;
  int D.23283;
  struct MonoString * * D.23286;
  struct MonoDomain * D.23287;
  struct MonoString * D.23288;
  struct MonoDomain * D.23290;
  mono_unichar2 * D.23291;
  int iftmp.55;
  struct MonoString * D.23296;
  int D.23297;
  mono_unichar2 * D.23300;

  if (sb == 0B) goto <D.23271>; else goto <D.23272>;
  <D.23271>:
  D.23273 = 0B;
  return D.23273;
  <D.23272>:
  D.23274 = sb->str;
  D.23275 = D.23274 == 0B;
  D.23276 = (long int) D.23275;
  D.23277 = __builtin_expect (D.23276, 0);
  if (D.23277 != 0) goto <D.23278>; else goto <D.23279>;
  <D.23278>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 925, "sb->str");
  <D.23279>:
  D.23274 = sb->str;
  D.23280 = sb->cached_str;
  if (D.23274 == D.23280) goto <D.23281>; else goto <D.23282>;
  <D.23281>:
  D.23274 = sb->str;
  D.23283 = D.23274->length;
  if (D.23283 == 0) goto <D.23284>; else goto <D.23285>;
  <D.23284>:
  D.23286 = &sb->str;
  D.23287 = mono_domain_get ();
  D.23288 = mono_string_new_size (D.23287, 16);
  mono_gc_wbarrier_set_field (sb, D.23286, D.23288);
  goto <D.23289>;
  <D.23285>:
  D.23286 = &sb->str;
  D.23290 = mono_domain_get ();
  D.23274 = sb->str;
  D.23291 = mono_string_chars (D.23274);
  D.23274 = sb->str;
  if (D.23274 != 0B) goto <D.23293>; else goto <D.23294>;
  <D.23293>:
  D.23274 = sb->str;
  iftmp.55 = D.23274->length;
  goto <D.23295>;
  <D.23294>:
  iftmp.55 = 16;
  <D.23295>:
  D.23296 = mono_string_new_utf16 (D.23290, D.23291, iftmp.55);
  mono_gc_wbarrier_set_field (sb, D.23286, D.23296);
  <D.23289>:
  sb->cached_str = 0B;
  <D.23282>:
  D.23297 = sb->length;
  if (D.23297 == 0) goto <D.23298>; else goto <D.23299>;
  <D.23298>:
  D.23274 = sb->str;
  D.23300 = mono_string_chars (D.23274);
  *D.23300 = 0;
  <D.23299>:
  D.23274 = sb->str;
  D.23273 = mono_string_chars (D.23274);
  return D.23273;
}


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

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


mono_string_to_byvalstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.23304;
  long int D.23305;
  long int D.23306;
  _Bool D.23309;
  long int D.23310;
  long int D.23311;
  long unsigned int D.23314;
  int iftmp.56;
  long unsigned int D.23318;
  long unsigned int D.23321;
  long unsigned int D.23325;
  char * s;
  int len;

  D.23304 = dst == 0B;
  D.23305 = (long int) D.23304;
  D.23306 = __builtin_expect (D.23305, 0);
  if (D.23306 != 0) goto <D.23307>; else goto <D.23308>;
  <D.23307>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1006, "dst != NULL");
  <D.23308>:
  D.23309 = size <= 0;
  D.23310 = (long int) D.23309;
  D.23311 = __builtin_expect (D.23310, 0);
  if (D.23311 != 0) goto <D.23312>; else goto <D.23313>;
  <D.23312>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1007, "size > 0");
  <D.23313>:
  D.23314 = (long unsigned int) size;
  memset (dst, 0, D.23314);
  if (src == 0B) goto <D.23315>; else goto <D.23316>;
  <D.23315>:
  return;
  <D.23316>:
  s = mono_string_to_utf8 (src);
  D.23314 = (long unsigned int) size;
  D.23318 = strlen (s);
  if (D.23314 >= D.23318) goto <D.23319>; else goto <D.23320>;
  <D.23319>:
  D.23321 = strlen (s);
  iftmp.56 = (int) D.23321;
  goto <D.23322>;
  <D.23320>:
  iftmp.56 = size;
  <D.23322>:
  len = iftmp.56;
  if (len >= size) goto <D.23323>; else goto <D.23324>;
  <D.23323>:
  len = len + -1;
  <D.23324>:
  D.23325 = (long unsigned int) len;
  memcpy (dst, s, D.23325);
  monoeg_g_free (s);
}


mono_string_to_byvalwstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.23327;
  long int D.23328;
  long int D.23329;
  _Bool D.23332;
  long int D.23333;
  long int D.23334;
  int D.23339;
  long unsigned int D.23340;
  int iftmp.57;
  int D.23342;
  mono_unichar2 * D.23346;
  int D.23347;
  long unsigned int D.23350;
  long unsigned int D.23351;
  gunichar2 * D.23352;
  int len;

  D.23327 = dst == 0B;
  D.23328 = (long int) D.23327;
  D.23329 = __builtin_expect (D.23328, 0);
  if (D.23329 != 0) goto <D.23330>; else goto <D.23331>;
  <D.23330>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1036, "dst != NULL");
  <D.23331>:
  D.23332 = size <= 1;
  D.23333 = (long int) D.23332;
  D.23334 = __builtin_expect (D.23333, 0);
  if (D.23334 != 0) goto <D.23335>; else goto <D.23336>;
  <D.23335>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1037, "size > 1");
  <D.23336>:
  if (src == 0B) goto <D.23337>; else goto <D.23338>;
  <D.23337>:
  D.23339 = size * 2;
  D.23340 = (long unsigned int) D.23339;
  memset (dst, 0, D.23340);
  return;
  <D.23338>:
  D.23342 = mono_string_length (src);
  if (D.23342 <= size) goto <D.23343>; else goto <D.23344>;
  <D.23343>:
  iftmp.57 = mono_string_length (src);
  goto <D.23345>;
  <D.23344>:
  iftmp.57 = size;
  <D.23345>:
  len = iftmp.57;
  D.23346 = mono_string_chars (src);
  D.23339 = size * 2;
  D.23340 = (long unsigned int) D.23339;
  memcpy (dst, D.23346, D.23340);
  D.23347 = mono_string_length (src);
  if (D.23347 >= size) goto <D.23348>; else goto <D.23349>;
  <D.23348>:
  len = len + -1;
  <D.23349>:
  D.23350 = (long unsigned int) len;
  D.23351 = D.23350 * 2;
  D.23352 = dst + D.23351;
  *D.23352 = 0;
}


mono_type_to_ldind (struct MonoType * type)
{
  long unsigned int D.23354;
  long unsigned int D.23355;
  guint D.23358;
  unsigned char D.23359;
  int D.23360;
  struct MonoClass * D.23361;
  long unsigned int D.23362;
  long unsigned int D.23363;
  struct MonoGenericClass * D.23366;
  struct MonoClass * D.23367;
  void handle_enum = <<< error >>>;

  D.23354 = BIT_FIELD_REF <*type, 64, 64>;
  D.23355 = D.23354 & 1073741824;
  if (D.23355 != 0) goto <D.23356>; else goto <D.23357>;
  <D.23356>:
  D.23358 = 77;
  return D.23358;
  <D.23357>:
  handle_enum:
  D.23359 = type->type;
  D.23360 = (int) D.23359;
  switch (D.23360) <default: <D.19564>, case 2: <D.19542>, case 3: <D.19545>, case 4: <D.19540>, case 5: <D.19541>, case 6: <D.19543>, case 7: <D.19544>, case 8: <D.19546>, case 9: <D.19547>, case 10: <D.19557>, case 11: <D.19558>, case 12: <D.19559>, case 13: <D.19560>, case 14: <D.19553>, case 15: <D.19550>, case 17: <D.19561>, case 18: <D.19552>, case 20: <D.19556>, case 21: <D.19563>, case 22: <D.19562>, case 24: <D.19548>, case 25: <D.19549>, case 27: <D.19551>, case 28: <D.19554>, case 29: <D.19555>>
  <D.19540>:
  D.23358 = 70;
  return D.23358;
  <D.19541>:
  <D.19542>:
  D.23358 = 71;
  return D.23358;
  <D.19543>:
  D.23358 = 72;
  return D.23358;
  <D.19544>:
  <D.19545>:
  D.23358 = 73;
  return D.23358;
  <D.19546>:
  D.23358 = 74;
  return D.23358;
  <D.19547>:
  D.23358 = 75;
  return D.23358;
  <D.19548>:
  <D.19549>:
  <D.19550>:
  <D.19551>:
  D.23358 = 77;
  return D.23358;
  <D.19552>:
  <D.19553>:
  <D.19554>:
  <D.19555>:
  <D.19556>:
  D.23358 = 80;
  return D.23358;
  <D.19557>:
  <D.19558>:
  D.23358 = 76;
  return D.23358;
  <D.19559>:
  D.23358 = 78;
  return D.23358;
  <D.19560>:
  D.23358 = 79;
  return D.23358;
  <D.19561>:
  D.23361 = type->data.klass;
  D.23362 = BIT_FIELD_REF <*D.23361, 64, 256>;
  D.23363 = D.23362 & 16;
  if (D.23363 != 0) goto <D.23364>; else goto <D.23365>;
  <D.23364>:
  D.23361 = type->data.klass;
  type = mono_class_enum_basetype (D.23361);
  goto handle_enum;
  <D.23365>:
  D.23358 = 113;
  return D.23358;
  <D.19562>:
  D.23358 = 113;
  return D.23358;
  <D.19563>:
  D.23366 = type->data.generic_class;
  D.23367 = D.23366->container_class;
  type = &D.23367->byval_arg;
  goto handle_enum;
  <D.19564>:
  D.23359 = type->type;
  D.23360 = (int) D.23359;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_ldind", D.23360);
  <D.19565>:
  goto <D.19565>;
  D.23358 = 4294967295;
  return D.23358;
}


mono_type_to_stind (struct MonoType * type)
{
  long unsigned int D.23369;
  long unsigned int D.23370;
  guint D.23373;
  unsigned char D.23374;
  int D.23375;
  struct MonoClass * D.23376;
  long unsigned int D.23377;
  long unsigned int D.23378;
  struct MonoGenericClass * D.23381;
  struct MonoClass * D.23382;
  void handle_enum = <<< error >>>;

  D.23369 = BIT_FIELD_REF <*type, 64, 64>;
  D.23370 = D.23369 & 1073741824;
  if (D.23370 != 0) goto <D.23371>; else goto <D.23372>;
  <D.23371>:
  D.23373 = 223;
  return D.23373;
  <D.23372>:
  handle_enum:
  D.23374 = type->type;
  D.23375 = (int) D.23374;
  switch (D.23375) <default: <D.19594>, case 2: <D.19572>, case 3: <D.19575>, case 4: <D.19570>, case 5: <D.19571>, case 6: <D.19573>, case 7: <D.19574>, case 8: <D.19576>, case 9: <D.19577>, case 10: <D.19587>, case 11: <D.19588>, case 12: <D.19589>, case 13: <D.19590>, case 14: <D.19583>, case 15: <D.19580>, case 17: <D.19591>, case 18: <D.19582>, case 20: <D.19586>, case 21: <D.19593>, case 22: <D.19592>, case 24: <D.19578>, case 25: <D.19579>, case 27: <D.19581>, case 28: <D.19584>, case 29: <D.19585>>
  <D.19570>:
  <D.19571>:
  <D.19572>:
  D.23373 = 82;
  return D.23373;
  <D.19573>:
  <D.19574>:
  <D.19575>:
  D.23373 = 83;
  return D.23373;
  <D.19576>:
  <D.19577>:
  D.23373 = 84;
  return D.23373;
  <D.19578>:
  <D.19579>:
  <D.19580>:
  <D.19581>:
  D.23373 = 223;
  return D.23373;
  <D.19582>:
  <D.19583>:
  <D.19584>:
  <D.19585>:
  <D.19586>:
  D.23373 = 81;
  return D.23373;
  <D.19587>:
  <D.19588>:
  D.23373 = 85;
  return D.23373;
  <D.19589>:
  D.23373 = 86;
  return D.23373;
  <D.19590>:
  D.23373 = 87;
  return D.23373;
  <D.19591>:
  D.23376 = type->data.klass;
  D.23377 = BIT_FIELD_REF <*D.23376, 64, 256>;
  D.23378 = D.23377 & 16;
  if (D.23378 != 0) goto <D.23379>; else goto <D.23380>;
  <D.23379>:
  D.23376 = type->data.klass;
  type = mono_class_enum_basetype (D.23376);
  goto handle_enum;
  <D.23380>:
  D.23373 = 129;
  return D.23373;
  <D.19592>:
  D.23373 = 129;
  return D.23373;
  <D.19593>:
  D.23381 = type->data.generic_class;
  D.23382 = D.23381->container_class;
  type = &D.23382->byval_arg;
  goto handle_enum;
  <D.19594>:
  D.23374 = type->type;
  D.23375 = (int) D.23374;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_stind", D.23375);
  <D.19595>:
  goto <D.19595>;
  D.23373 = 4294967295;
  return D.23373;
}


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


emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  char * D.23384;
  char * D.23385;

  D.23384 = mb->name;
  D.23385 = strstr (D.23384, "mono_thread_interruption_checkpoint");
  if (D.23385 != 0B) goto <D.23386>; else goto <D.23387>;
  <D.23386>:
  return;
  <D.23387>:
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
}


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

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


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

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


get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.23394;
  _Bool D.23399;
  long int D.23400;
  long int D.23401;
  _Bool D.23408;
  long int D.23409;
  long int D.23410;
  struct GHashTable * D.23413;

  D.23394 = *var;
  if (D.23394 == 0B) goto <D.23395>; else goto <D.23396>;
  <D.23395>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23397>; else goto <D.23398>;
    <D.23397>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23398>:
    D.23399 = ret != 0;
    D.23400 = (long int) D.23399;
    D.23401 = __builtin_expect (D.23400, 0);
    if (D.23401 != 0) goto <D.23402>; else goto <D.23403>;
    <D.23402>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2432, "ret == 0");
    <D.23403>:
  }
  D.23394 = *var;
  if (D.23394 == 0B) goto <D.23404>; else goto <D.23405>;
  <D.23404>:
  {
    struct GHashTable * cache;

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

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


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_marshal_find_in_cache (struct GHashTable * cache, void * key)
{
  _Bool D.23417;
  long int D.23418;
  long int D.23419;
  _Bool D.23424;
  long int D.23425;
  long int D.23426;
  struct MonoMethod * D.23429;
  struct MonoMethod * res;

  {
    int ret;

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

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


mono_mb_create_and_cache (struct GHashTable * cache, void * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  _Bool D.23433;
  long int D.23434;
  long int D.23435;
  _Bool D.23440;
  long int D.23441;
  long int D.23442;
  _Bool D.23449;
  long int D.23450;
  long int D.23451;
  _Bool D.23458;
  long int D.23459;
  long int D.23460;
  _Bool D.23466;
  long int D.23467;
  long int D.23468;
  struct MonoMethod * D.23471;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23431>; else goto <D.23432>;
    <D.23431>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23432>:
    D.23433 = ret != 0;
    D.23434 = (long int) D.23433;
    D.23435 = __builtin_expect (D.23434, 0);
    if (D.23435 != 0) goto <D.23436>; else goto <D.23437>;
    <D.23436>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2485, "ret == 0");
    <D.23437>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23438>; else goto <D.23439>;
    <D.23438>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23439>:
    D.23440 = ret != 0;
    D.23441 = (long int) D.23440;
    D.23442 = __builtin_expect (D.23441, 0);
    if (D.23442 != 0) goto <D.23443>; else goto <D.23444>;
    <D.23443>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2487, "ret == 0");
    <D.23444>:
  }
  if (res == 0B) goto <D.23445>; else goto <D.23446>;
  <D.23445>:
  {
    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.23447>; else goto <D.23448>;
      <D.23447>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.23448>:
      D.23449 = ret != 0;
      D.23450 = (long int) D.23449;
      D.23451 = __builtin_expect (D.23450, 0);
      if (D.23451 != 0) goto <D.23452>; else goto <D.23453>;
      <D.23452>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2491, "ret == 0");
      <D.23453>:
    }
    res = monoeg_g_hash_table_lookup (cache, key);
    if (res == 0B) goto <D.23454>; else goto <D.23455>;
    <D.23454>:
    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.23456>; else goto <D.23457>;
      <D.23456>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23457>:
      D.23458 = ret != 0;
      D.23459 = (long int) D.23458;
      D.23460 = __builtin_expect (D.23459, 0);
      if (D.23460 != 0) goto <D.23461>; else goto <D.23462>;
      <D.23461>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2497, "ret == 0");
      <D.23462>:
    }
    goto <D.23463>;
    <D.23455>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23464>; else goto <D.23465>;
      <D.23464>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23465>:
      D.23466 = ret != 0;
      D.23467 = (long int) D.23466;
      D.23468 = __builtin_expect (D.23467, 0);
      if (D.23468 != 0) goto <D.23469>; else goto <D.23470>;
      <D.23469>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2499, "ret == 0");
      <D.23470>:
    }
    mono_free_method (newm);
    <D.23463>:
  }
  <D.23446>:
  D.23471 = res;
  return D.23471;
}


mono_marshal_method_from_wrapper (struct MonoMethod * wrapper)
{
  <unnamed-unsigned:5> D.23473;
  struct MonoMethod * D.23477;
  long unsigned int D.23480;
  long unsigned int D.23481;
  struct MonoGenericContext * D.23484;
  <unnamed type> D.23488;
  unsigned int D.23492;
  void * res;
  int wrapper_type;
  struct WrapperInfo * info;

  D.23473 = wrapper->wrapper_type;
  wrapper_type = (int) D.23473;
  if (wrapper_type == 0) goto <D.23474>; else goto <D.23476>;
  <D.23476>:
  if (wrapper_type == 17) goto <D.23474>; else goto <D.23475>;
  <D.23474>:
  D.23477 = wrapper;
  return D.23477;
  <D.23475>:
  switch (wrapper_type) <default: <D.19978>, case 4: <D.19977>, case 6: <D.19976>, case 8: <D.19971>, case 9: <D.19972>, case 10: <D.19973>, case 16: <D.19974>, case 22: <D.19975>>
  <D.19971>:
  <D.19972>:
  <D.19973>:
  <D.19974>:
  <D.19975>:
  res = mono_marshal_get_wrapper_info (wrapper);
  if (res == 0B) goto <D.23478>; else goto <D.23479>;
  <D.23478>:
  D.23477 = wrapper;
  return D.23477;
  <D.23479>:
  D.23480 = BIT_FIELD_REF <*wrapper, 64, 256>;
  D.23481 = D.23480 & 4096;
  if (D.23481 != 0) goto <D.23482>; else goto <D.23483>;
  <D.23482>:
  D.23484 = mono_method_get_context (wrapper);
  D.23477 = mono_class_inflate_generic_method (res, D.23484);
  return D.23477;
  <D.23483>:
  D.23477 = res;
  return D.23477;
  <D.19976>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.23487>; else goto <D.23485>;
  <D.23487>:
  D.23488 = info->subtype;
  if (D.23488 == 0) goto <D.23486>; else goto <D.23489>;
  <D.23489>:
  D.23488 = info->subtype;
  if (D.23488 == 16) goto <D.23486>; else goto <D.23485>;
  <D.23486>:
  D.23477 = info->d.managed_to_native.method;
  return D.23477;
  <D.23485>:
  D.23477 = 0B;
  return D.23477;
  <D.19977>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.23491>; else goto <D.23490>;
  <D.23491>:
  D.23488 = info->subtype;
  D.23492 = D.23488 + 4294967283;
  if (D.23492 <= 1) goto <D.23493>; else goto <D.23490>;
  <D.23493>:
  D.23477 = info->d.runtime_invoke.method;
  return D.23477;
  <D.23490>:
  D.23477 = 0B;
  return D.23477;
  <D.19978>:
  D.23477 = 0B;
  return D.23477;
}


mono_marshal_get_wrapper_info (struct MonoMethod * wrapper)
{
  long unsigned int D.23495;
  long unsigned int D.23496;
  _Bool D.23497;
  long int D.23498;
  long int D.23499;
  void * D.23502;

  D.23495 = BIT_FIELD_REF <*wrapper, 64, 256>;
  D.23496 = D.23495 & 124;
  D.23497 = D.23496 == 0;
  D.23498 = (long int) D.23497;
  D.23499 = __builtin_expect (D.23498, 0);
  if (D.23499 != 0) goto <D.23500>; else goto <D.23501>;
  <D.23500>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2634, "wrapper->wrapper_type");
  <D.23501>:
  D.23502 = mono_method_get_wrapper_data (wrapper, 1);
  return D.23502;
}


mono_marshal_set_wrapper_info (struct MonoMethod * method, void * data)
{
  long unsigned int D.23506;
  long unsigned int D.23507;
  void * * D.23509;
  void * * datav;

  D.23506 = BIT_FIELD_REF <*method, 64, 256>;
  D.23507 = D.23506 & 124;
  if (D.23507 == 0) goto <D.23504>; else goto <D.23508>;
  <D.23508>:
  D.23506 = BIT_FIELD_REF <*method, 64, 256>;
  D.23507 = D.23506 & 124;
  if (D.23507 == 68) goto <D.23504>; else goto <D.23505>;
  <D.23504>:
  return;
  <D.23505>:
  datav = MEM[(struct MonoMethodWrapper *)method].method_data;
  D.23509 = datav + 8;
  *D.23509 = data;
}


mono_marshal_get_delegate_begin_invoke (struct MonoMethod * method)
{
  int iftmp.59;
  struct MonoClass * D.23516;
  struct MonoClass * D.23517;
  struct MonoClass * D.23518;
  int D.20060;
  int iftmp.60;
  int D.20059;
  const char[12] * D.23523;
  unsigned char D.23524;
  int D.23525;
  unsigned char D.23526;
  int D.23527;
  const unsigned char * D.23532;
  unsigned char D.23533;
  int D.23534;
  const unsigned char * D.23535;
  unsigned char D.23536;
  int D.23537;
  const unsigned char * D.23542;
  unsigned char D.23543;
  int D.23544;
  const unsigned char * D.23545;
  unsigned char D.23546;
  int D.23547;
  const unsigned char * D.23552;
  unsigned char D.23553;
  int D.23554;
  const unsigned char * D.23555;
  unsigned char D.23556;
  int D.23557;
  const char * D.23559;
  _Bool D.23560;
  long int D.23561;
  long int D.23562;
  long unsigned int D.23565;
  long unsigned int D.23566;
  struct MonoImage * D.23571;
  struct GHashTable * * D.23572;
  struct MonoMethod * D.23575;
  struct GHashTable * * D.23577;
  long unsigned int D.23580;
  long unsigned int D.23581;
  _Bool D.23582;
  long int D.23583;
  long int D.23584;
  struct MonoClass * D.23590;
  unsigned int params_var.61;
  short unsigned int D.23594;
  int D.23595;
  int D.23596;
  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.23512>; else goto <D.23515>;
  <D.23515>:
  D.23516 = method->klass;
  D.23517 = D.23516->parent;
  D.23518 = mono_defaults.multicastdelegate_class;
  if (D.23517 != D.23518) goto <D.23512>; else goto <D.23519>;
  <D.23519>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23523 = "BeginInvoke";
      D.23524 = MEM[(const unsigned char *)D.23523];
      D.23525 = (int) D.23524;
      D.23526 = *__s2;
      D.23527 = (int) D.23526;
      __result = D.23525 - D.23527;
      {
        if (__s2_len != 0) goto <D.23528>; else goto <D.23529>;
        <D.23528>:
        if (__result == 0) goto <D.23530>; else goto <D.23531>;
        <D.23530>:
        D.23532 = &MEM[(void *)"BeginInvoke" + 1B];
        D.23533 = *D.23532;
        D.23534 = (int) D.23533;
        D.23535 = __s2 + 1;
        D.23536 = *D.23535;
        D.23537 = (int) D.23536;
        __result = D.23534 - D.23537;
        if (__s2_len > 1) goto <D.23538>; else goto <D.23539>;
        <D.23538>:
        if (__result == 0) goto <D.23540>; else goto <D.23541>;
        <D.23540>:
        D.23542 = &MEM[(void *)"BeginInvoke" + 2B];
        D.23543 = *D.23542;
        D.23544 = (int) D.23543;
        D.23545 = __s2 + 2;
        D.23546 = *D.23545;
        D.23547 = (int) D.23546;
        __result = D.23544 - D.23547;
        if (__s2_len > 2) goto <D.23548>; else goto <D.23549>;
        <D.23548>:
        if (__result == 0) goto <D.23550>; else goto <D.23551>;
        <D.23550>:
        D.23552 = &MEM[(void *)"BeginInvoke" + 3B];
        D.23553 = *D.23552;
        D.23554 = (int) D.23553;
        D.23555 = __s2 + 3;
        D.23556 = *D.23555;
        D.23557 = (int) D.23556;
        __result = D.23554 - D.23557;
        <D.23551>:
        <D.23549>:
        <D.23541>:
        <D.23539>:
        <D.23531>:
        <D.23529>:
      }
      D.20059 = __result;
    }
    iftmp.60 = -D.20059;
    goto <D.23558>;
    <D.23522>:
    D.23559 = method->name;
    iftmp.60 = __builtin_strcmp (D.23559, "BeginInvoke");
    <D.23558>:
    D.20060 = iftmp.60;
  }
  if (D.20060 != 0) goto <D.23512>; else goto <D.23513>;
  <D.23512>:
  iftmp.59 = 1;
  goto <D.23514>;
  <D.23513>:
  iftmp.59 = 0;
  <D.23514>:
  D.23560 = iftmp.59 != 0;
  D.23561 = (long int) D.23560;
  D.23562 = __builtin_expect (D.23561, 0);
  if (D.23562 != 0) goto <D.23563>; else goto <D.23564>;
  <D.23563>:
  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.23564>:
  D.23565 = BIT_FIELD_REF <*method, 64, 256>;
  D.23566 = D.23565 & 4096;
  if (D.23566 != 0) goto <D.23567>; else goto <D.23568>;
  <D.23567>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.23568>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.23569>; else goto <D.23570>;
  <D.23569>:
  D.23516 = method->klass;
  D.23571 = D.23516->image;
  D.23572 = &D.23571->delegate_begin_invoke_generic_cache;
  cache = get_cache (D.23572, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.23573>; else goto <D.23574>;
  <D.23573>:
  D.23575 = res;
  return D.23575;
  <D.23574>:
  goto <D.23576>;
  <D.23570>:
  D.23516 = method->klass;
  D.23571 = D.23516->image;
  D.23577 = &D.23571->delegate_begin_invoke_cache;
  cache = get_cache (D.23577, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.23578>; else goto <D.23579>;
  <D.23578>:
  D.23575 = res;
  return D.23575;
  <D.23579>:
  <D.23576>:
  D.23580 = BIT_FIELD_REF <*sig, 64, 64>;
  D.23581 = D.23580 & 18014398509481984;
  D.23582 = D.23581 == 0;
  D.23583 = (long int) D.23582;
  D.23584 = __builtin_expect (D.23583, 0);
  if (D.23584 != 0) goto <D.23585>; else goto <D.23586>;
  <D.23585>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2866, "sig->hasthis");
  <D.23586>:
  name = mono_signature_to_name (sig, "begin_invoke");
  if (ctx != 0B) goto <D.23587>; else goto <D.23588>;
  <D.23587>:
  D.23516 = method->klass;
  mb = mono_mb_new (D.23516, name, 2);
  goto <D.23589>;
  <D.23588>:
  D.23516 = method->klass;
  D.23571 = D.23516->image;
  D.23590 = get_wrapper_target_class (D.23571);
  mb = mono_mb_new (D.23590, name, 2);
  <D.23589>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.61 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.61);
  mono_mb_emit_icall (mb, mono_delegate_begin_invoke);
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.23592>; else goto <D.23593>;
  <D.23592>:
  {
    struct MonoMethod * def;

    D.23516 = method->klass;
    D.23594 = sig->param_count;
    D.23595 = (int) D.23594;
    D.23596 = D.23595 + 16;
    def = mono_mb_create_and_cache (cache, D.23516, mb, sig, D.23596);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.23597>;
  <D.23593>:
  D.23594 = sig->param_count;
  D.23595 = (int) D.23594;
  D.23596 = D.23595 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23596);
  <D.23597>:
  mono_mb_free (mb);
  D.23575 = res;
  return D.23575;
}


check_generic_delegate_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def_method, struct MonoGenericContext * ctx)
{
  struct MonoClass * D.23599;
  struct MonoMethod * D.23602;
  struct MonoClass * D.23603;
  _Bool D.23608;
  long int D.23609;
  long int D.23610;
  _Bool D.23617;
  long int D.23618;
  long int D.23619;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;

  D.23599 = orig_method->klass;
  res = mono_marshal_find_in_cache (cache, D.23599);
  if (res != 0B) goto <D.23600>; else goto <D.23601>;
  <D.23600>:
  D.23602 = res;
  return D.23602;
  <D.23601>:
  D.23603 = def_method->klass;
  def = mono_marshal_find_in_cache (cache, D.23603);
  if (def != 0B) goto <D.23604>; else goto <D.23605>;
  <D.23604>:
  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.23606>; else goto <D.23607>;
    <D.23606>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23607>:
    D.23608 = ret != 0;
    D.23609 = (long int) D.23608;
    D.23610 = __builtin_expect (D.23609, 0);
    if (D.23610 != 0) goto <D.23611>; else goto <D.23612>;
    <D.23611>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2792, "ret == 0");
    <D.23612>:
  }
  D.23599 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.23599);
  if (res == 0B) goto <D.23613>; else goto <D.23614>;
  <D.23613>:
  D.23599 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.23599, inst, 0);
  res = inst;
  <D.23614>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23615>; else goto <D.23616>;
    <D.23615>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23616>:
    D.23617 = ret != 0;
    D.23618 = (long int) D.23617;
    D.23619 = __builtin_expect (D.23618, 0);
    if (D.23619 != 0) goto <D.23620>; else goto <D.23621>;
    <D.23620>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2798, "ret == 0");
    <D.23621>:
  }
  D.23602 = res;
  return D.23602;
  <D.23605>:
  D.23602 = 0B;
  return D.23602;
}


mono_signature_to_name (struct MonoMethodSignature * sig, const char * prefix)
{
  struct MonoType * D.23625;
  long unsigned int D.23626;
  long unsigned int D.23627;
  struct MonoType * D.23630;
  short unsigned int D.23631;
  int D.23632;
  char * D.23633;
  int i;
  char * result;
  struct GString * res;

  res = monoeg_g_string_new ("");
  if (prefix != 0B) goto <D.23623>; else goto <D.23624>;
  <D.23623>:
  monoeg_g_string_append (res, prefix);
  monoeg_g_string_append_c (res, 95);
  <D.23624>:
  D.23625 = sig->ret;
  mono_type_get_desc (res, D.23625, 0);
  D.23626 = BIT_FIELD_REF <*sig, 64, 64>;
  D.23627 = D.23626 & 18014398509481984;
  if (D.23627 != 0) goto <D.23628>; else goto <D.23629>;
  <D.23628>:
  monoeg_g_string_append (res, "__this__");
  <D.23629>:
  i = 0;
  goto <D.19822>;
  <D.19821>:
  monoeg_g_string_append_c (res, 95);
  D.23630 = sig->params[i];
  mono_type_get_desc (res, D.23630, 0);
  i = i + 1;
  <D.19822>:
  D.23631 = sig->param_count;
  D.23632 = (int) D.23631;
  if (D.23632 > i) goto <D.19821>; else goto <D.19823>;
  <D.19823>:
  result = res->str;
  monoeg_g_string_free (res, 0);
  D.23633 = result;
  return D.23633;
}


get_wrapper_target_class (struct MonoImage * image)
{
  long unsigned int D.23635;
  long unsigned int D.23636;
  _Bool D.23640;
  long int D.23641;
  long int D.23642;
  struct MonoClass * D.23645;
  struct MonoClass * klass;

  D.23635 = BIT_FIELD_REF <*image, 64, 192>;
  D.23636 = D.23635 & 34359738368;
  if (D.23636 != 0) goto <D.23637>; else goto <D.23638>;
  <D.23637>:
  klass = MEM[(struct MonoDynamicImage *)image].wrappers_type;
  goto <D.23639>;
  <D.23638>:
  klass = mono_class_get (image, 33554433);
  <D.23639>:
  D.23640 = klass == 0B;
  D.23641 = (long int) D.23640;
  D.23642 = __builtin_expect (D.23641, 0);
  if (D.23642 != 0) goto <D.23643>; else goto <D.23644>;
  <D.23643>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2695, "klass");
  <D.23644>:
  D.23645 = klass;
  return D.23645;
}


mono_mb_emit_save_args (struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, gboolean save_this)
{
  struct MonoClass * D.23647;
  struct MonoType * D.23648;
  short unsigned int D.23649;
  int D.23650;
  int D.23651;
  unsigned int D.23652;
  unsigned int D.23653;
  int D.23654;
  unsigned int params_var.62;
  unsigned int tmp_var.63;
  long unsigned int D.23659;
  long unsigned int D.23660;
  short unsigned int D.23665;
  <unnamed-unsigned:1> D.23666;
  int D.23667;
  int D.23668;
  unsigned int D.23669;
  int D.23670;
  int D.23673;
  int i;
  int params_var;
  int tmp_var;

  D.23647 = mono_defaults.int_class;
  D.23648 = &D.23647->byval_arg;
  params_var = mono_mb_add_local (mb, D.23648);
  D.23647 = mono_defaults.int_class;
  D.23648 = &D.23647->byval_arg;
  tmp_var = mono_mb_add_local (mb, D.23648);
  D.23649 = sig->param_count;
  D.23650 = (int) D.23649;
  D.23651 = D.23650 + 1;
  D.23652 = (unsigned int) D.23651;
  D.23653 = D.23652 * 8;
  D.23654 = (int) D.23653;
  mono_mb_emit_icon (mb, D.23654);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  params_var.62 = (unsigned int) params_var;
  mono_mb_emit_stloc (mb, params_var.62);
  params_var.62 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.62);
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_stloc (mb, tmp_var.63);
  if (save_this != 0) goto <D.23657>; else goto <D.23658>;
  <D.23657>:
  D.23659 = BIT_FIELD_REF <*sig, 64, 64>;
  D.23660 = D.23659 & 18014398509481984;
  if (D.23660 != 0) goto <D.23661>; else goto <D.23662>;
  <D.23661>:
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.63);
  mono_mb_emit_ldarg_addr (mb, 0);
  mono_mb_emit_byte (mb, 223);
  D.23649 = sig->param_count;
  if (D.23649 != 0) goto <D.23663>; else goto <D.23664>;
  <D.23663>:
  D.23665 = (short unsigned int) tmp_var;
  mono_mb_emit_add_to_local (mb, D.23665, 8);
  <D.23664>:
  <D.23662>:
  <D.23658>:
  i = 0;
  goto <D.19812>;
  <D.19811>:
  tmp_var.63 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.63);
  D.23666 = sig->hasthis;
  D.23667 = (int) D.23666;
  D.23668 = D.23667 + i;
  D.23669 = (unsigned int) D.23668;
  mono_mb_emit_ldarg_addr (mb, D.23669);
  mono_mb_emit_byte (mb, 223);
  D.23649 = sig->param_count;
  D.23650 = (int) D.23649;
  D.23670 = D.23650 + -1;
  if (D.23670 > i) goto <D.23671>; else goto <D.23672>;
  <D.23671>:
  D.23665 = (short unsigned int) tmp_var;
  mono_mb_emit_add_to_local (mb, D.23665, 8);
  <D.23672>:
  i = i + 1;
  <D.19812>:
  D.23649 = sig->param_count;
  D.23650 = (int) D.23649;
  if (D.23650 > i) goto <D.19811>; else goto <D.19813>;
  <D.19813>:
  D.23673 = params_var;
  return D.23673;
}


cache_generic_delegate_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx)
{
  _Bool D.23677;
  long int D.23678;
  long int D.23679;
  struct MonoClass * D.23682;
  _Bool D.23687;
  long int D.23688;
  long int D.23689;
  struct MonoMethod * D.23692;
  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.23675>; else goto <D.23676>;
    <D.23675>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23676>:
    D.23677 = ret != 0;
    D.23678 = (long int) D.23677;
    D.23679 = __builtin_expect (D.23678, 0);
    if (D.23679 != 0) goto <D.23680>; else goto <D.23681>;
    <D.23680>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2814, "ret == 0");
    <D.23681>:
  }
  D.23682 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.23682);
  if (res == 0B) goto <D.23683>; else goto <D.23684>;
  <D.23683>:
  D.23682 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.23682, inst, 0);
  res = inst;
  <D.23684>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23685>; else goto <D.23686>;
    <D.23685>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23686>:
    D.23687 = ret != 0;
    D.23688 = (long int) D.23687;
    D.23689 = __builtin_expect (D.23688, 0);
    if (D.23689 != 0) goto <D.23690>; else goto <D.23691>;
    <D.23690>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2820, "ret == 0");
    <D.23691>:
  }
  D.23692 = res;
  return D.23692;
}


mono_marshal_get_delegate_end_invoke (struct MonoMethod * method)
{
  int iftmp.64;
  struct MonoClass * D.23699;
  struct MonoClass * D.23700;
  struct MonoClass * D.23701;
  int D.20131;
  int iftmp.65;
  int D.20130;
  const char[10] * D.23706;
  unsigned char D.23707;
  int D.23708;
  unsigned char D.23709;
  int D.23710;
  const unsigned char * D.23715;
  unsigned char D.23716;
  int D.23717;
  const unsigned char * D.23718;
  unsigned char D.23719;
  int D.23720;
  const unsigned char * D.23725;
  unsigned char D.23726;
  int D.23727;
  const unsigned char * D.23728;
  unsigned char D.23729;
  int D.23730;
  const unsigned char * D.23735;
  unsigned char D.23736;
  int D.23737;
  const unsigned char * D.23738;
  unsigned char D.23739;
  int D.23740;
  const char * D.23742;
  _Bool D.23743;
  long int D.23744;
  long int D.23745;
  long unsigned int D.23748;
  long unsigned int D.23749;
  struct MonoImage * D.23754;
  struct GHashTable * * D.23755;
  struct MonoMethod * D.23758;
  struct GHashTable * * D.23760;
  long unsigned int D.23763;
  long unsigned int D.23764;
  _Bool D.23765;
  long int D.23766;
  long int D.23767;
  struct MonoClass * D.23773;
  unsigned int params_var.66;
  struct MonoType * D.23775;
  unsigned char D.23776;
  short unsigned int D.23782;
  int D.23783;
  int D.23784;
  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.23695>; else goto <D.23698>;
  <D.23698>:
  D.23699 = method->klass;
  D.23700 = D.23699->parent;
  D.23701 = mono_defaults.multicastdelegate_class;
  if (D.23700 != D.23701) goto <D.23695>; else goto <D.23702>;
  <D.23702>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23706 = "EndInvoke";
      D.23707 = MEM[(const unsigned char *)D.23706];
      D.23708 = (int) D.23707;
      D.23709 = *__s2;
      D.23710 = (int) D.23709;
      __result = D.23708 - D.23710;
      {
        if (__s2_len != 0) goto <D.23711>; else goto <D.23712>;
        <D.23711>:
        if (__result == 0) goto <D.23713>; else goto <D.23714>;
        <D.23713>:
        D.23715 = &MEM[(void *)"EndInvoke" + 1B];
        D.23716 = *D.23715;
        D.23717 = (int) D.23716;
        D.23718 = __s2 + 1;
        D.23719 = *D.23718;
        D.23720 = (int) D.23719;
        __result = D.23717 - D.23720;
        if (__s2_len > 1) goto <D.23721>; else goto <D.23722>;
        <D.23721>:
        if (__result == 0) goto <D.23723>; else goto <D.23724>;
        <D.23723>:
        D.23725 = &MEM[(void *)"EndInvoke" + 2B];
        D.23726 = *D.23725;
        D.23727 = (int) D.23726;
        D.23728 = __s2 + 2;
        D.23729 = *D.23728;
        D.23730 = (int) D.23729;
        __result = D.23727 - D.23730;
        if (__s2_len > 2) goto <D.23731>; else goto <D.23732>;
        <D.23731>:
        if (__result == 0) goto <D.23733>; else goto <D.23734>;
        <D.23733>:
        D.23735 = &MEM[(void *)"EndInvoke" + 3B];
        D.23736 = *D.23735;
        D.23737 = (int) D.23736;
        D.23738 = __s2 + 3;
        D.23739 = *D.23738;
        D.23740 = (int) D.23739;
        __result = D.23737 - D.23740;
        <D.23734>:
        <D.23732>:
        <D.23724>:
        <D.23722>:
        <D.23714>:
        <D.23712>:
      }
      D.20130 = __result;
    }
    iftmp.65 = -D.20130;
    goto <D.23741>;
    <D.23705>:
    D.23742 = method->name;
    iftmp.65 = __builtin_strcmp (D.23742, "EndInvoke");
    <D.23741>:
    D.20131 = iftmp.65;
  }
  if (D.20131 != 0) goto <D.23695>; else goto <D.23696>;
  <D.23695>:
  iftmp.64 = 1;
  goto <D.23697>;
  <D.23696>:
  iftmp.64 = 0;
  <D.23697>:
  D.23743 = iftmp.64 != 0;
  D.23744 = (long int) D.23743;
  D.23745 = __builtin_expect (D.23744, 0);
  if (D.23745 != 0) goto <D.23746>; else goto <D.23747>;
  <D.23746>:
  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.23747>:
  D.23748 = BIT_FIELD_REF <*method, 64, 256>;
  D.23749 = D.23748 & 4096;
  if (D.23749 != 0) goto <D.23750>; else goto <D.23751>;
  <D.23750>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.23751>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.23752>; else goto <D.23753>;
  <D.23752>:
  D.23699 = method->klass;
  D.23754 = D.23699->image;
  D.23755 = &D.23754->delegate_end_invoke_generic_cache;
  cache = get_cache (D.23755, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.23756>; else goto <D.23757>;
  <D.23756>:
  D.23758 = res;
  return D.23758;
  <D.23757>:
  goto <D.23759>;
  <D.23753>:
  D.23699 = method->klass;
  D.23754 = D.23699->image;
  D.23760 = &D.23754->delegate_end_invoke_cache;
  cache = get_cache (D.23760, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.23761>; else goto <D.23762>;
  <D.23761>:
  D.23758 = res;
  return D.23758;
  <D.23762>:
  <D.23759>:
  D.23763 = BIT_FIELD_REF <*sig, 64, 64>;
  D.23764 = D.23763 & 18014398509481984;
  D.23765 = D.23764 == 0;
  D.23766 = (long int) D.23765;
  D.23767 = __builtin_expect (D.23766, 0);
  if (D.23767 != 0) goto <D.23768>; else goto <D.23769>;
  <D.23768>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3076, "sig->hasthis");
  <D.23769>:
  name = mono_signature_to_name (sig, "end_invoke");
  if (ctx != 0B) goto <D.23770>; else goto <D.23771>;
  <D.23770>:
  D.23699 = method->klass;
  mb = mono_mb_new (D.23699, name, 3);
  goto <D.23772>;
  <D.23771>:
  D.23699 = method->klass;
  D.23754 = D.23699->image;
  D.23773 = get_wrapper_target_class (D.23754);
  mb = mono_mb_new (D.23773, name, 3);
  <D.23772>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.66 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.66);
  mono_mb_emit_icall (mb, mono_delegate_end_invoke);
  D.23775 = sig->ret;
  D.23776 = D.23775->type;
  if (D.23776 == 1) goto <D.23777>; else goto <D.23778>;
  <D.23777>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.23779>;
  <D.23778>:
  D.23775 = sig->ret;
  mono_mb_emit_restore_result (mb, D.23775);
  <D.23779>:
  if (ctx != 0B) goto <D.23780>; else goto <D.23781>;
  <D.23780>:
  {
    struct MonoMethod * def;

    D.23699 = method->klass;
    D.23782 = sig->param_count;
    D.23783 = (int) D.23782;
    D.23784 = D.23783 + 16;
    def = mono_mb_create_and_cache (cache, D.23699, mb, sig, D.23784);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.23785>;
  <D.23781>:
  D.23782 = sig->param_count;
  D.23783 = (int) D.23782;
  D.23784 = D.23783 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23784);
  <D.23785>:
  mono_mb_free (mb);
  D.23758 = res;
  return D.23758;
}


mono_mb_emit_restore_result (struct MonoMethodBuilder * mb, struct MonoType * return_type)
{
  long unsigned int D.23787;
  long unsigned int D.23788;
  struct MonoClass * D.23791;
  unsigned char D.23792;
  int D.23793;
  struct MonoClass * D.23794;
  unsigned int D.23795;
  unsigned char D.23796;
  int D.23797;
  unsigned char D.23799;
  int D.23800;
  struct MonoType * t;

  t = mono_type_get_underlying_type (return_type);
  D.23787 = BIT_FIELD_REF <*return_type, 64, 64>;
  D.23788 = D.23787 & 1073741824;
  if (D.23788 != 0) goto <D.23789>; else goto <D.23790>;
  <D.23789>:
  D.23791 = mono_defaults.int_class;
  return_type = &D.23791->byval_arg;
  <D.23790>:
  D.23792 = t->type;
  D.23793 = (int) D.23792;
  switch (D.23793) <default: <D.20111>, case 1: <D.20083>, case 2: <D.20092>, case 3: <D.20095>, case 4: <D.20093>, case 5: <D.20091>, case 6: <D.20096>, case 7: <D.20094>, case 8: <D.20099>, case 9: <D.20100>, case 10: <D.20102>, case 11: <D.20101>, case 12: <D.20103>, case 13: <D.20104>, case 14: <D.20085>, case 15: <D.20084>, case 17: <D.20106>, case 18: <D.20086>, case 19: <D.20108>, case 20: <D.20088>, case 21: <D.20105>, case 24: <D.20097>, case 25: <D.20098>, case 28: <D.20087>, case 29: <D.20089>, case 30: <D.20109>>
  <D.20083>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2981);
  <D.20084>:
  <D.20085>:
  <D.20086>:
  <D.20087>:
  <D.20088>:
  <D.20089>:
  goto <D.20090>;
  <D.20091>:
  <D.20092>:
  <D.20093>:
  <D.20094>:
  <D.20095>:
  <D.20096>:
  <D.20097>:
  <D.20098>:
  <D.20099>:
  <D.20100>:
  <D.20101>:
  <D.20102>:
  <D.20103>:
  <D.20104>:
  D.23794 = mono_class_from_mono_type (return_type);
  mono_mb_emit_op (mb, 121, D.23794);
  D.23795 = mono_type_to_ldind (return_type);
  D.23796 = (unsigned char) D.23795;
  mono_mb_emit_byte (mb, D.23796);
  goto <D.20090>;
  <D.20105>:
  D.23797 = mono_type_generic_inst_is_valuetype (t);
  if (D.23797 == 0) goto <D.20090>; else goto <D.23798>;
  <D.23798>:
  <D.20106>:
  {
    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.20090>;
  }
  <D.20108>:
  <D.20109>:
  {
    struct MonoClass * klass;

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


mono_marshal_get_remoting_invoke (struct MonoMethod * method)
{
  _Bool D.23802;
  long int D.23803;
  long int D.23804;
  long unsigned int D.23809;
  long unsigned int D.23810;
  struct MonoMethod * D.23812;
  struct MonoClass * D.23815;
  long unsigned int D.23816;
  long unsigned int D.23817;
  struct MonoClass * D.23819;
  struct MonoDomain * D.23820;
  _Bool D.23821;
  long int D.23822;
  long int D.23823;
  long unsigned int D.23826;
  long unsigned int D.23827;
  long unsigned int D.23830;
  long unsigned int D.23831;
  const char * D.23836;
  struct MonoMethod * D.23837;
  unsigned int params_var.67;
  struct MonoType * D.23839;
  unsigned char D.23840;
  short unsigned int D.23844;
  int D.23845;
  int D.23846;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int params_var;

  D.23802 = method == 0B;
  D.23803 = (long int) D.23802;
  D.23804 = __builtin_expect (D.23803, 0);
  if (D.23804 != 0) goto <D.23805>; else goto <D.23806>;
  <D.23805>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3177, "method");
  <D.23806>:
  D.23809 = BIT_FIELD_REF <*method, 64, 256>;
  D.23810 = D.23809 & 124;
  if (D.23810 == 32) goto <D.23807>; else goto <D.23811>;
  <D.23811>:
  D.23809 = BIT_FIELD_REF <*method, 64, 256>;
  D.23810 = D.23809 & 124;
  if (D.23810 == 40) goto <D.23807>; else goto <D.23808>;
  <D.23807>:
  D.23812 = method;
  return D.23812;
  <D.23808>:
  D.23815 = method->klass;
  D.23816 = BIT_FIELD_REF <*D.23815, 64, 256>;
  D.23817 = D.23816 & 1073741824;
  if (D.23817 != 0) goto <D.23813>; else goto <D.23818>;
  <D.23818>:
  D.23815 = method->klass;
  D.23819 = mono_class_get_com_object_class ();
  if (D.23815 == D.23819) goto <D.23813>; else goto <D.23814>;
  <D.23813>:
  {
    struct MonoVTable * vtable;

    D.23820 = mono_domain_get ();
    D.23815 = method->klass;
    vtable = mono_class_vtable (D.23820, D.23815);
    D.23821 = vtable == 0B;
    D.23822 = (long int) D.23821;
    D.23823 = __builtin_expect (D.23822, 0);
    if (D.23823 != 0) goto <D.23824>; else goto <D.23825>;
    <D.23824>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3186, "vtable");
    <D.23825>:
    D.23826 = BIT_FIELD_REF <*vtable, 64, 320>;
    D.23827 = D.23826 & 16777216;
    if (D.23827 == 0) goto <D.23828>; else goto <D.23829>;
    <D.23828>:
    D.23812 = mono_cominterop_get_invoke (method);
    return D.23812;
    <D.23829>:
  }
  <D.23814>:
  sig = mono_signature_no_pinvoke (method);
  D.23830 = BIT_FIELD_REF <*sig, 64, 64>;
  D.23831 = D.23830 & 18014398509481984;
  if (D.23831 == 0) goto <D.23832>; else goto <D.23833>;
  <D.23832>:
  D.23812 = method;
  return D.23812;
  <D.23833>:
  res = mono_marshal_remoting_find_in_cache (method, 8);
  if (res != 0B) goto <D.23834>; else goto <D.23835>;
  <D.23834>:
  D.23812 = res;
  return D.23812;
  <D.23835>:
  D.23815 = method->klass;
  D.23836 = method->name;
  mb = mono_mb_new (D.23815, D.23836, 8);
  D.23837 = mb->method;
  D.23837->save_lmf = 1;
  params_var = mono_mb_emit_save_args (mb, sig, 1);
  mono_mb_emit_ptr (mb, method);
  params_var.67 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.67);
  mono_mb_emit_icall (mb, mono_remoting_wrapper);
  emit_thread_interrupt_checkpoint (mb);
  D.23839 = sig->ret;
  D.23840 = D.23839->type;
  if (D.23840 == 1) goto <D.23841>; else goto <D.23842>;
  <D.23841>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.23843>;
  <D.23842>:
  D.23839 = sig->ret;
  mono_mb_emit_restore_result (mb, D.23839);
  <D.23843>:
  D.23844 = sig->param_count;
  D.23845 = (int) D.23844;
  D.23846 = D.23845 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23846);
  mono_mb_free (mb);
  D.23812 = res;
  return D.23812;
}


mono_marshal_remoting_find_in_cache (struct MonoMethod * method, int wrapper_type)
{
  _Bool D.23850;
  long int D.23851;
  long int D.23852;
  struct MonoClass * D.23855;
  struct MonoImage * D.23856;
  struct GHashTable * D.23857;
  _Bool D.23866;
  long int D.23867;
  long int D.23868;
  struct MonoMethod * D.23871;
  struct MonoMethod * res;
  struct MonoRemotingMethods * wrps;

  res = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23848>; else goto <D.23849>;
    <D.23848>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23849>:
    D.23850 = ret != 0;
    D.23851 = (long int) D.23850;
    D.23852 = __builtin_expect (D.23851, 0);
    if (D.23852 != 0) goto <D.23853>; else goto <D.23854>;
    <D.23853>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2514, "ret == 0");
    <D.23854>:
  }
  D.23855 = method->klass;
  D.23856 = D.23855->image;
  D.23857 = D.23856->remoting_invoke_cache;
  if (D.23857 != 0B) goto <D.23858>; else goto <D.23859>;
  <D.23858>:
  D.23855 = method->klass;
  D.23856 = D.23855->image;
  D.23857 = D.23856->remoting_invoke_cache;
  wrps = monoeg_g_hash_table_lookup (D.23857, method);
  goto <D.23860>;
  <D.23859>:
  wrps = 0B;
  <D.23860>:
  if (wrps != 0B) goto <D.23861>; else goto <D.23862>;
  <D.23861>:
  switch (wrapper_type) <default: <D.23863>, case 8: <D.19938>, case 9: <D.19940>, case 10: <D.19941>, case 11: <D.19942>>
  <D.19938>:
  res = wrps->invoke;
  goto <D.19939>;
  <D.19940>:
  res = wrps->invoke_with_check;
  goto <D.19939>;
  <D.19941>:
  res = wrps->xdomain_invoke;
  goto <D.19939>;
  <D.19942>:
  res = wrps->xdomain_dispatch;
  goto <D.19939>;
  <D.23863>:
  <D.19939>:
  <D.23862>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23864>; else goto <D.23865>;
    <D.23864>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23865>:
    D.23866 = ret != 0;
    D.23867 = (long int) D.23866;
    D.23868 = __builtin_expect (D.23867, 0);
    if (D.23868 != 0) goto <D.23869>; else goto <D.23870>;
    <D.23869>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2533, "ret == 0");
    <D.23870>:
  }
  D.23871 = res;
  return D.23871;
}


mono_remoting_mb_create_and_cache (struct MonoMethod * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  struct MonoClass * D.23873;
  struct MonoImage * D.23874;
  struct GHashTable * * D.23875;
  _Bool D.23878;
  long int D.23879;
  long int D.23880;
  struct MonoMethod * D.23885;
  <unnamed-unsigned:5> D.23886;
  int D.23887;
  _Bool D.23890;
  long int D.23891;
  long int D.23892;
  struct MonoMethod * D.23895;
  _Bool D.23900;
  long int D.23901;
  long int D.23902;
  _Bool D.23909;
  long int D.23910;
  long int D.23911;
  _Bool D.23917;
  long int D.23918;
  long int D.23919;
  struct MonoMethod * D.23922;
  struct MonoMethod * * res;
  struct MonoRemotingMethods * wrps;
  struct GHashTable * cache;

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

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23876>; else goto <D.23877>;
    <D.23876>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23877>:
    D.23878 = ret != 0;
    D.23879 = (long int) D.23878;
    D.23880 = __builtin_expect (D.23879, 0);
    if (D.23880 != 0) goto <D.23881>; else goto <D.23882>;
    <D.23881>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2546, "ret == 0");
    <D.23882>:
  }
  wrps = monoeg_g_hash_table_lookup (cache, key);
  if (wrps == 0B) goto <D.23883>; else goto <D.23884>;
  <D.23883>:
  wrps = monoeg_malloc0 (32);
  monoeg_g_hash_table_insert_replace (cache, key, wrps, 0);
  <D.23884>:
  D.23885 = mb->method;
  D.23886 = D.23885->wrapper_type;
  D.23887 = (int) D.23886;
  switch (D.23887) <default: <D.19959>, case 8: <D.19954>, case 9: <D.19956>, case 10: <D.19957>, case 11: <D.19958>>
  <D.19954>:
  res = &wrps->invoke;
  goto <D.19955>;
  <D.19956>:
  res = &wrps->invoke_with_check;
  goto <D.19955>;
  <D.19957>:
  res = &wrps->xdomain_invoke;
  goto <D.19955>;
  <D.19958>:
  res = &wrps->xdomain_dispatch;
  goto <D.19955>;
  <D.19959>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2558);
  <D.19955>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23888>; else goto <D.23889>;
    <D.23888>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23889>:
    D.23890 = ret != 0;
    D.23891 = (long int) D.23890;
    D.23892 = __builtin_expect (D.23891, 0);
    if (D.23892 != 0) goto <D.23893>; else goto <D.23894>;
    <D.23893>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2560, "ret == 0");
    <D.23894>:
  }
  D.23895 = *res;
  if (D.23895 == 0B) goto <D.23896>; else goto <D.23897>;
  <D.23896>:
  {
    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.23898>; else goto <D.23899>;
      <D.23898>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.23899>:
      D.23900 = ret != 0;
      D.23901 = (long int) D.23900;
      D.23902 = __builtin_expect (D.23901, 0);
      if (D.23902 != 0) goto <D.23903>; else goto <D.23904>;
      <D.23903>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2566, "ret == 0");
      <D.23904>:
    }
    D.23895 = *res;
    if (D.23895 == 0B) goto <D.23905>; else goto <D.23906>;
    <D.23905>:
    *res = newm;
    D.23895 = *res;
    mono_marshal_set_wrapper_info (D.23895, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23907>; else goto <D.23908>;
      <D.23907>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23908>:
      D.23909 = ret != 0;
      D.23910 = (long int) D.23909;
      D.23911 = __builtin_expect (D.23910, 0);
      if (D.23911 != 0) goto <D.23912>; else goto <D.23913>;
      <D.23912>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2570, "ret == 0");
      <D.23913>:
    }
    goto <D.23914>;
    <D.23906>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23915>; else goto <D.23916>;
      <D.23915>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23916>:
      D.23917 = ret != 0;
      D.23918 = (long int) D.23917;
      D.23919 = __builtin_expect (D.23918, 0);
      if (D.23919 != 0) goto <D.23920>; else goto <D.23921>;
      <D.23920>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2572, "ret == 0");
      <D.23921>:
    }
    mono_free_method (newm);
    <D.23914>:
  }
  <D.23897>:
  D.23922 = *res;
  return D.23922;
}


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.23924;
  _Bool D.23929;
  long int D.23930;
  long int D.23931;
  _Bool D.23938;
  long int D.23939;
  long int D.23940;
  struct GHashTable * D.23943;

  D.23924 = *var;
  if (D.23924 == 0B) goto <D.23925>; else goto <D.23926>;
  <D.23925>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23927>; else goto <D.23928>;
    <D.23927>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23928>:
    D.23929 = ret != 0;
    D.23930 = (long int) D.23929;
    D.23931 = __builtin_expect (D.23930, 0);
    if (D.23931 != 0) goto <D.23932>; else goto <D.23933>;
    <D.23932>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2448, "ret == 0");
    <D.23933>:
  }
  D.23924 = *var;
  if (D.23924 == 0B) goto <D.23934>; else goto <D.23935>;
  <D.23934>:
  {
    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.23935>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23936>; else goto <D.23937>;
    <D.23936>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23937>:
    D.23938 = ret != 0;
    D.23939 = (long int) D.23938;
    D.23940 = __builtin_expect (D.23939, 0);
    if (D.23940 != 0) goto <D.23941>; else goto <D.23942>;
    <D.23941>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2455, "ret == 0");
    <D.23942>:
  }
  <D.23926>:
  D.23943 = *var;
  return D.23943;
}


mono_marshal_xdomain_copy_value (struct MonoObject * val)
{
  struct MonoObject * D.23947;
  struct MonoVTable * D.23948;
  struct MonoClass * D.23949;
  unsigned char D.23950;
  int D.23951;
  void * D.23952;
  mono_unichar2 * D.23953;
  int D.23954;
  struct MonoClass * D.23955;
  struct MonoType * D.23956;
  long unsigned int D.23961;
  long unsigned int D.23962;
  char * D.23963;
  struct MonoObject * D.23964;
  struct MonoClass * D.23966;
  struct MonoString * * D.23969;
  struct MonoString * D.23970;
  mono_unichar2 * D.23971;
  int D.23972;
  struct MonoString * D.23973;
  int D.23974;
  struct MonoDomain * domain;

  if (val == 0B) goto <D.23945>; else goto <D.23946>;
  <D.23945>:
  D.23947 = 0B;
  return D.23947;
  <D.23946>:
  domain = mono_domain_get ();
  D.23948 = val->vtable;
  D.23949 = D.23948->klass;
  D.23950 = D.23949->byval_arg.type;
  D.23951 = (int) D.23950;
  switch (D.23951) <default: <D.23965>, case 1: <D.20183>, case 2: <D.20186>, case 3: <D.20189>, case 4: <D.20185>, case 5: <D.20184>, case 6: <D.20188>, case 7: <D.20187>, case 8: <D.20191>, case 9: <D.20190>, case 10: <D.20192>, case 11: <D.20193>, case 12: <D.20194>, case 13: <D.20195>, case 14: <D.20196>, case 20: <D.20198>, case 29: <D.20199>>
  <D.20183>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3283);
  <D.20184>:
  <D.20185>:
  <D.20186>:
  <D.20187>:
  <D.20188>:
  <D.20189>:
  <D.20190>:
  <D.20191>:
  <D.20192>:
  <D.20193>:
  <D.20194>:
  <D.20195>:
  D.23948 = val->vtable;
  D.23949 = D.23948->klass;
  D.23952 = val + 16;
  D.23947 = mono_value_box (domain, D.23949, D.23952);
  return D.23947;
  <D.20196>:
  {
    struct MonoString * str;

    str = val;
    D.23953 = mono_string_chars (str);
    D.23954 = mono_string_length (str);
    D.23947 = mono_string_new_utf16 (domain, D.23953, D.23954);
    return D.23947;
  }
  <D.20198>:
  <D.20199>:
  {
    struct MonoArray * acopy;
    MonoXDomainMarshalType mt;

    D.23948 = val->vtable;
    D.23949 = D.23948->klass;
    D.23955 = D.23949->element_class;
    D.23956 = &D.23955->byval_arg;
    mt = mono_get_xdomain_marshal_type (D.23956);
    if (mt == 3) goto <D.23957>; else goto <D.23958>;
    <D.23957>:
    D.23947 = 0B;
    return D.23947;
    <D.23958>:
    acopy = mono_array_clone_in_domain (domain, val);
    if (mt == 1) goto <D.23959>; else goto <D.23960>;
    <D.23959>:
    {
      int i;
      int len;

      D.23961 = mono_array_length (acopy);
      len = (int) D.23961;
      i = 0;
      goto <D.20207>;
      <D.20206>:
      {
        struct MonoObject * item;

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

          D.23962 = (long unsigned int) i;
          __p = mono_array_addr_with_size (acopy, 8, D.23962);
          D.23964 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (acopy, __p, D.23964);
        }
      }
      i = i + 1;
      <D.20207>:
      if (i < len) goto <D.20206>; else goto <D.20208>;
      <D.20208>:
    }
    <D.23960>:
    D.23947 = acopy;
    return D.23947;
  }
  <D.23965>:
  D.23948 = val->vtable;
  D.23949 = D.23948->klass;
  D.23966 = mono_defaults.stringbuilder_class;
  if (D.23949 == D.23966) goto <D.23967>; else goto <D.23968>;
  <D.23967>:
  {
    struct MonoStringBuilder * oldsb;
    struct MonoStringBuilder * newsb;

    oldsb = val;
    D.23966 = mono_defaults.stringbuilder_class;
    newsb = mono_object_new (domain, D.23966);
    D.23969 = &newsb->str;
    D.23970 = oldsb->str;
    D.23971 = mono_string_chars (D.23970);
    D.23970 = oldsb->str;
    D.23972 = mono_string_length (D.23970);
    D.23973 = mono_string_new_utf16 (domain, D.23971, D.23972);
    mono_gc_wbarrier_set_field (newsb, D.23969, D.23973);
    D.23974 = oldsb->length;
    newsb->length = D.23974;
    newsb->max_capacity = 2147483647;
    D.23947 = newsb;
    return D.23947;
  }
  <D.23968>:
  D.23947 = 0B;
  return D.23947;
}


mono_marshal_get_xappdomain_invoke (struct MonoMethod * method)
{
  _Bool D.23976;
  long int D.23977;
  long int D.23978;
  long unsigned int D.23983;
  long unsigned int D.23984;
  struct MonoMethod * D.23986;
  struct MonoMethodSignature * D.23987;
  long unsigned int D.23988;
  long unsigned int D.23989;
  int D.23992;
  struct MonoClass * D.23997;
  const char * D.23998;
  struct MonoMethod * D.23999;
  short unsigned int D.24000;
  long unsigned int D.24001;
  long unsigned int D.24002;
  <unnamed type> D.24003;
  short unsigned int D.24006;
  int D.24007;
  int D.24008;
  long unsigned int D.24011;
  long unsigned int D.24012;
  long unsigned int D.24018;
  long unsigned int D.24019;
  int * D.24020;
  int D.24021;
  struct MonoType * D.24022;
  unsigned char D.24023;
  <unnamed type> D.24026;
  _Bool D.24027;
  struct MonoClass * D.24030;
  struct MonoType * D.24031;
  struct MonoClass * byte_array_class.68;
  struct MonoType * D.24033;
  struct MonoClass * D.24036;
  struct MonoType * D.24037;
  unsigned int loc_context.69;
  struct MonoMethod * method_needs_context_sink.70;
  unsigned int D.24040;
  unsigned int loc_real_proxy.71;
  unsigned int loc_domainid.72;
  struct MonoImage * D.24043;
  unsigned int D.24044;
  unsigned int pos.73;
  int D.24046;
  unsigned int D.24047;
  struct MonoMethod * D.24048;
  unsigned int pos_dispatch.74;
  int iftmp.75;
  int D.24057;
  struct MonoType * D.24060;
  long unsigned int D.24061;
  long unsigned int D.24062;
  long unsigned int D.24065;
  long unsigned int D.24066;
  unsigned int loc_array.76;
  struct MonoMethod * method_rs_serialize.77;
  unsigned int loc_serialized_data.78;
  unsigned int loc_old_domainid.79;
  unsigned int loc_serialized_exc.80;
  struct MonoType * D.24080;
  unsigned int copy_local.81;
  struct MonoMethodSignature * D.24083;
  unsigned int loc_return.82;
  unsigned int D.24087;
  struct MonoMethod * method_rs_deserialize.83;
  struct MonoClass * D.24089;
  struct MonoMethod * method_exc_fixexc.84;
  unsigned int pos_noex.85;
  int j.86;
  int D.24096;
  unsigned int D.24097;
  struct MonoClass * D.24098;
  long unsigned int D.24105;
  long unsigned int D.24106;
  long unsigned int D.24114;
  long unsigned int D.24115;
  unsigned int D.24127;
  int D.24132;
  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.23976 = method == 0B;
  D.23977 = (long int) D.23976;
  D.23978 = __builtin_expect (D.23977, 0);
  if (D.23978 != 0) goto <D.23979>; else goto <D.23980>;
  <D.23979>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3744, "method");
  <D.23980>:
  D.23983 = BIT_FIELD_REF <*method, 64, 256>;
  D.23984 = D.23983 & 124;
  if (D.23984 == 32) goto <D.23981>; else goto <D.23985>;
  <D.23985>:
  D.23983 = BIT_FIELD_REF <*method, 64, 256>;
  D.23984 = D.23983 & 124;
  if (D.23984 == 40) goto <D.23981>; else goto <D.23982>;
  <D.23981>:
  D.23986 = method;
  return D.23986;
  <D.23982>:
  D.23987 = mono_method_signature (method);
  D.23988 = BIT_FIELD_REF <*D.23987, 64, 64>;
  D.23989 = D.23988 & 18014398509481984;
  if (D.23989 == 0) goto <D.23990>; else goto <D.23991>;
  <D.23990>:
  D.23986 = method;
  return D.23986;
  <D.23991>:
  D.23992 = mono_marshal_supports_fast_xdomain (method);
  if (D.23992 == 0) goto <D.23993>; else goto <D.23994>;
  <D.23993>:
  D.23986 = mono_marshal_get_remoting_invoke (method);
  return D.23986;
  <D.23994>:
  mono_remoting_marshal_init ();
  res = mono_marshal_remoting_find_in_cache (method, 10);
  if (res != 0B) goto <D.23995>; else goto <D.23996>;
  <D.23995>:
  D.23986 = res;
  return D.23986;
  <D.23996>:
  sig = mono_signature_no_pinvoke (method);
  D.23997 = method->klass;
  D.23998 = method->name;
  mb = mono_mb_new (D.23997, D.23998, 10);
  D.23999 = mb->method;
  D.23999->save_lmf = 1;
  D.24000 = sig->param_count;
  D.24001 = (long unsigned int) D.24000;
  D.24002 = D.24001 * 4;
  marshal_types = __builtin_alloca (D.24002);
  complex_out_count = 0;
  complex_count = complex_out_count;
  i = 0;
  goto <D.20347>;
  <D.20346>:
  {
    struct MonoType * ptype;
    int mt;

    ptype = sig->params[i];
    D.24003 = mono_get_xdomain_marshal_type (ptype);
    mt = (int) D.24003;
    D.24006 = ptype->attrs;
    D.24007 = (int) D.24006;
    D.24008 = D.24007 & 2;
    if (D.24008 != 0) goto <D.24009>; else goto <D.24004>;
    <D.24009>:
    if (mt == 1) goto <D.24010>; else goto <D.24004>;
    <D.24010>:
    D.24011 = BIT_FIELD_REF <*ptype, 64, 64>;
    D.24012 = D.24011 & 1073741824;
    if (D.24012 == 0) goto <D.24013>; else goto <D.24004>;
    <D.24013>:
    mt = 2;
    goto <D.24005>;
    <D.24004>:
    if (mt == 3) goto <D.24014>; else goto <D.24015>;
    <D.24014>:
    complex_count = complex_count + 1;
    D.24011 = BIT_FIELD_REF <*ptype, 64, 64>;
    D.24012 = D.24011 & 1073741824;
    if (D.24012 != 0) goto <D.24016>; else goto <D.24017>;
    <D.24016>:
    complex_out_count = complex_out_count + 1;
    <D.24017>:
    <D.24015>:
    <D.24005>:
    D.24018 = (long unsigned int) i;
    D.24019 = D.24018 * 4;
    D.24020 = marshal_types + D.24019;
    *D.24020 = mt;
  }
  i = i + 1;
  <D.20347>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20346>; else goto <D.20348>;
  <D.20348>:
  D.24022 = sig->ret;
  D.24023 = D.24022->type;
  if (D.24023 != 1) goto <D.24024>; else goto <D.24025>;
  <D.24024>:
  D.24022 = sig->ret;
  D.24026 = mono_get_xdomain_marshal_type (D.24022);
  ret_marshal_type = (int) D.24026;
  D.24022 = sig->ret;
  ret_class = mono_class_from_mono_type (D.24022);
  D.24027 = ret_marshal_type != 3;
  copy_return = (gboolean) D.24027;
  <D.24025>:
  if (complex_count > 0) goto <D.24028>; else goto <D.24029>;
  <D.24028>:
  D.24030 = mono_defaults.object_class;
  D.24031 = &D.24030->byval_arg;
  loc_array = mono_mb_add_local (mb, D.24031);
  <D.24029>:
  byte_array_class.68 = byte_array_class;
  D.24033 = &byte_array_class.68->byval_arg;
  loc_serialized_data = mono_mb_add_local (mb, D.24033);
  D.24030 = mono_defaults.object_class;
  D.24031 = &D.24030->byval_arg;
  loc_real_proxy = mono_mb_add_local (mb, D.24031);
  if (copy_return != 0) goto <D.24034>; else goto <D.24035>;
  <D.24034>:
  D.24022 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.24022);
  <D.24035>:
  D.24036 = mono_defaults.int32_class;
  D.24037 = &D.24036->byval_arg;
  loc_old_domainid = mono_mb_add_local (mb, D.24037);
  D.24036 = mono_defaults.int32_class;
  D.24037 = &D.24036->byval_arg;
  loc_domainid = mono_mb_add_local (mb, D.24037);
  byte_array_class.68 = byte_array_class;
  D.24033 = &byte_array_class.68->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.24033);
  D.24030 = mono_defaults.object_class;
  D.24031 = &D.24030->byval_arg;
  loc_context = mono_mb_add_local (mb, D.24031);
  mono_mb_emit_icall (mb, mono_context_get);
  mono_mb_emit_byte (mb, 37);
  loc_context.69 = (unsigned int) loc_context;
  mono_mb_emit_stloc (mb, loc_context.69);
  method_needs_context_sink.70 = method_needs_context_sink;
  mono_mb_emit_managed_call (mb, method_needs_context_sink.70, 0B);
  D.24040 = mono_mb_emit_short_branch (mb, 45);
  pos = (int) D.24040;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  loc_real_proxy.71 = (unsigned int) loc_real_proxy;
  mono_mb_emit_stloc (mb, loc_real_proxy.71);
  mono_mb_emit_ldflda (mb, 40);
  mono_mb_emit_byte (mb, 74);
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_stloc (mb, loc_domainid.72);
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.72);
  D.23997 = method->klass;
  D.24043 = D.23997->image;
  mono_mb_emit_ptr (mb, D.24043);
  mono_mb_emit_icall (mb, mono_marshal_check_domain_image);
  D.24044 = mono_mb_emit_short_branch (mb, 45);
  pos_dispatch = (int) D.24044;
  pos.73 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.73);
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.20350>;
  <D.20349>:
  D.24046 = i + 1;
  D.24047 = (unsigned int) D.24046;
  mono_mb_emit_ldarg (mb, D.24047);
  i = i + 1;
  <D.20350>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20349>; else goto <D.20351>;
  <D.20351>:
  D.24048 = mono_marshal_get_remoting_invoke (method);
  mono_mb_emit_managed_call (mb, D.24048, 0B);
  mono_mb_emit_byte (mb, 42);
  pos_dispatch.74 = (unsigned int) pos_dispatch;
  mono_mb_patch_short_branch (mb, pos_dispatch.74);
  if (complex_count > 0) goto <D.24050>; else goto <D.24051>;
  <D.24050>:
  if (ret_marshal_type == 3) goto <D.24055>; else goto <D.24053>;
  <D.24055>:
  if (complex_out_count > 0) goto <D.24056>; else goto <D.24053>;
  <D.24056>:
  iftmp.75 = complex_count + 1;
  goto <D.24054>;
  <D.24053>:
  iftmp.75 = complex_count;
  <D.24054>:
  mono_mb_emit_icon (mb, iftmp.75);
  D.24030 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 141, D.24030);
  j = 0;
  i = 0;
  goto <D.20355>;
  <D.20354>:
  {
    struct MonoClass * pclass;

    D.24018 = (long unsigned int) i;
    D.24019 = D.24018 * 4;
    D.24020 = marshal_types + D.24019;
    D.24057 = *D.24020;
    if (D.24057 != 3) goto <D.24058>; else goto <D.24059>;
    <D.24058>:
    // predicted unlikely by continue predictor.
    goto <D.20353>;
    <D.24059>:
    D.24060 = sig->params[i];
    pclass = mono_class_from_mono_type (D.24060);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_icon (mb, j);
    D.24046 = i + 1;
    D.24047 = (unsigned int) D.24046;
    mono_mb_emit_ldarg (mb, D.24047);
    D.24060 = sig->params[i];
    D.24061 = BIT_FIELD_REF <*D.24060, 64, 64>;
    D.24062 = D.24061 & 1073741824;
    if (D.24062 != 0) goto <D.24063>; else goto <D.24064>;
    <D.24063>:
    D.24065 = BIT_FIELD_REF <*pclass, 64, 256>;
    D.24066 = D.24065 & 8;
    if (D.24066 != 0) goto <D.24067>; else goto <D.24068>;
    <D.24067>:
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.24069>;
    <D.24068>:
    mono_mb_emit_byte (mb, 80);
    <D.24069>:
    <D.24064>:
    D.24065 = BIT_FIELD_REF <*pclass, 64, 256>;
    D.24066 = D.24065 & 8;
    if (D.24066 != 0) goto <D.24070>; else goto <D.24071>;
    <D.24070>:
    mono_mb_emit_op (mb, 140, pclass);
    <D.24071>:
    mono_mb_emit_byte (mb, 162);
    j = j + 1;
  }
  <D.20353>:
  i = i + 1;
  <D.20355>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20354>; else goto <D.20356>;
  <D.20356>:
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.76);
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.76);
  method_rs_serialize.77 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.77, 0B);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.78);
  goto <D.24075>;
  <D.24051>:
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.77 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.77, 0B);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.78);
  <D.24075>:
  loc_domainid.72 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.72);
  mono_mb_emit_byte (mb, 23);
  mono_marshal_emit_switch_domain (mb);
  loc_old_domainid.79 = (unsigned int) loc_old_domainid;
  mono_mb_emit_stloc (mb, loc_old_domainid.79);
  loc_real_proxy.71 = (unsigned int) loc_real_proxy;
  mono_mb_emit_ldloc (mb, loc_real_proxy.71);
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_data.78);
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_exc.80);
  copy_locals_base = mb->locals;
  i = 0;
  goto <D.20366>;
  <D.20365>:
  D.24018 = (long unsigned int) i;
  D.24019 = D.24018 * 4;
  D.24020 = marshal_types + D.24019;
  D.24057 = *D.24020;
  switch (D.24057) <default: <D.24082>, case 0: <D.20364>, case 1: <D.20359>, case 2: <D.20363>, case 3: <D.20357>>
  <D.20357>:
  // predicted unlikely by continue predictor.
  goto <D.20358>;
  <D.20359>:
  D.24046 = i + 1;
  D.24047 = (unsigned int) D.24046;
  mono_mb_emit_ldarg (mb, D.24047);
  D.24060 = sig->params[i];
  D.24061 = BIT_FIELD_REF <*D.24060, 64, 64>;
  D.24062 = D.24061 & 1073741824;
  if (D.24062 != 0) goto <D.24078>; else goto <D.24079>;
  <D.24078>:
  {
    struct MonoClass * pclass;
    int copy_local;

    D.24060 = sig->params[i];
    pclass = mono_class_from_mono_type (D.24060);
    D.24080 = &pclass->byval_arg;
    copy_local = mono_mb_add_local (mb, D.24080);
    mono_mb_emit_byte (mb, 80);
    copy_local.81 = (unsigned int) copy_local;
    mono_mb_emit_stloc (mb, copy_local.81);
    copy_local.81 = (unsigned int) copy_local;
    mono_mb_emit_ldloc_addr (mb, copy_local.81);
  }
  <D.24079>:
  goto <D.20362>;
  <D.20363>:
  <D.20364>:
  D.24046 = i + 1;
  D.24047 = (unsigned int) D.24046;
  mono_mb_emit_ldarg (mb, D.24047);
  goto <D.20362>;
  <D.24082>:
  <D.20362>:
  <D.20358>:
  i = i + 1;
  <D.20366>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20365>; else goto <D.20367>;
  <D.20367>:
  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.24083 = mono_method_signature (xdomain_method);
  mono_mb_emit_calli (mb, D.24083);
  if (copy_return != 0) goto <D.24084>; else goto <D.24085>;
  <D.24084>:
  loc_return.82 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.82);
  <D.24085>:
  loc_old_domainid.79 = (unsigned int) loc_old_domainid;
  mono_mb_emit_ldloc (mb, loc_old_domainid.79);
  mono_mb_emit_byte (mb, 22);
  mono_marshal_emit_switch_domain (mb);
  mono_mb_emit_byte (mb, 38);
  loc_context.69 = (unsigned int) loc_context;
  mono_mb_emit_ldloc (mb, loc_context.69);
  mono_mb_emit_icall (mb, mono_context_set);
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.80);
  D.24087 = mono_mb_emit_short_branch (mb, 44);
  pos_noex = (int) D.24087;
  loc_serialized_exc.80 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.80);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  D.24089 = mono_defaults.exception_class;
  mono_mb_emit_op (mb, 116, D.24089);
  method_exc_fixexc.84 = method_exc_fixexc;
  mono_mb_emit_managed_call (mb, method_exc_fixexc.84, 0B);
  mono_mb_emit_byte (mb, 122);
  pos_noex.85 = (unsigned int) pos_noex;
  mono_mb_patch_short_branch (mb, pos_noex.85);
  j = 0;
  i = 0;
  goto <D.20370>;
  <D.20369>:
  D.24060 = sig->params[i];
  D.24061 = BIT_FIELD_REF <*D.24060, 64, 64>;
  D.24062 = D.24061 & 1073741824;
  if (D.24062 == 0) goto <D.24092>; else goto <D.24094>;
  <D.24094>:
  D.24018 = (long unsigned int) i;
  D.24019 = D.24018 * 4;
  D.24020 = marshal_types + D.24019;
  D.24057 = *D.24020;
  if (D.24057 != 1) goto <D.24092>; else goto <D.24093>;
  <D.24092>:
  // predicted unlikely by continue predictor.
  goto <D.20368>;
  <D.24093>:
  D.24046 = i + 1;
  D.24047 = (unsigned int) D.24046;
  mono_mb_emit_ldarg (mb, D.24047);
  j.86 = j;
  j = j.86 + 1;
  D.24096 = j.86 + copy_locals_base;
  D.24097 = (unsigned int) D.24096;
  mono_mb_emit_ldloc (mb, D.24097);
  D.24060 = sig->params[i];
  D.24098 = mono_class_from_mono_type (D.24060);
  mono_marshal_emit_xdomain_copy_value (mb, D.24098);
  mono_mb_emit_byte (mb, 81);
  <D.20368>:
  i = i + 1;
  <D.20370>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20369>; else goto <D.20371>;
  <D.20371>:
  if (complex_out_count > 0) goto <D.24099>; else goto <D.24100>;
  <D.24099>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.76);
  j = 0;
  i = 0;
  goto <D.20375>;
  <D.20374>:
  D.24018 = (long unsigned int) i;
  D.24019 = D.24018 * 4;
  D.24020 = marshal_types + D.24019;
  D.24057 = *D.24020;
  if (D.24057 != 3) goto <D.24101>; else goto <D.24102>;
  <D.24101>:
  // predicted unlikely by continue predictor.
  goto <D.20372>;
  <D.24102>:
  D.24060 = sig->params[i];
  D.24061 = BIT_FIELD_REF <*D.24060, 64, 64>;
  D.24062 = D.24061 & 1073741824;
  if (D.24062 != 0) goto <D.24103>; else goto <D.24104>;
  <D.24103>:
  {
    struct MonoClass * pclass;

    D.24060 = sig->params[i];
    pclass = mono_class_from_mono_type (D.24060);
    D.24046 = i + 1;
    D.24047 = (unsigned int) D.24046;
    mono_mb_emit_ldarg (mb, D.24047);
    loc_array.76 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.76);
    mono_mb_emit_icon (mb, j);
    mono_mb_emit_byte (mb, 154);
    D.24105 = BIT_FIELD_REF <*pclass, 64, 256>;
    D.24106 = D.24105 & 8;
    if (D.24106 != 0) goto <D.24107>; else goto <D.24108>;
    <D.24107>:
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    mono_mb_emit_op (mb, 129, pclass);
    goto <D.24109>;
    <D.24108>:
    D.24030 = mono_defaults.object_class;
    if (D.24030 != pclass) goto <D.24110>; else goto <D.24111>;
    <D.24110>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.24111>:
    mono_mb_emit_byte (mb, 81);
    <D.24109>:
  }
  <D.24104>:
  j = j + 1;
  <D.20372>:
  i = i + 1;
  <D.20375>:
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  if (D.24021 > i) goto <D.20374>; else goto <D.20376>;
  <D.20376>:
  if (ret_marshal_type == 3) goto <D.24112>; else goto <D.24113>;
  <D.24112>:
  loc_array.76 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.76);
  mono_mb_emit_icon (mb, complex_count);
  mono_mb_emit_byte (mb, 154);
  D.24114 = BIT_FIELD_REF <*ret_class, 64, 256>;
  D.24115 = D.24114 & 8;
  if (D.24115 != 0) goto <D.24116>; else goto <D.24117>;
  <D.24116>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  <D.24117>:
  <D.24113>:
  goto <D.24118>;
  <D.24100>:
  if (ret_marshal_type == 3) goto <D.24119>; else goto <D.24120>;
  <D.24119>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  D.24114 = BIT_FIELD_REF <*ret_class, 64, 256>;
  D.24115 = D.24114 & 8;
  if (D.24115 != 0) goto <D.24121>; else goto <D.24122>;
  <D.24121>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  goto <D.24123>;
  <D.24122>:
  D.24030 = mono_defaults.object_class;
  if (D.24030 != ret_class) goto <D.24124>; else goto <D.24125>;
  <D.24124>:
  mono_mb_emit_op (mb, 116, ret_class);
  <D.24125>:
  <D.24123>:
  goto <D.24126>;
  <D.24120>:
  loc_serialized_data.78 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.78);
  mono_mb_emit_byte (mb, 37);
  D.24127 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.24127;
  byte_array_class.68 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.68);
  pos.73 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.73);
  method_rs_deserialize.83 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.83, 0B);
  mono_mb_emit_byte (mb, 38);
  <D.24126>:
  <D.24118>:
  if (copy_return != 0) goto <D.24128>; else goto <D.24129>;
  <D.24128>:
  loc_return.82 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.82);
  if (ret_marshal_type == 1) goto <D.24130>; else goto <D.24131>;
  <D.24130>:
  mono_marshal_emit_xdomain_copy_value (mb, ret_class);
  <D.24131>:
  <D.24129>:
  mono_mb_emit_byte (mb, 42);
  D.24000 = sig->param_count;
  D.24021 = (int) D.24000;
  D.24132 = D.24021 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.24132);
  mono_mb_free (mb);
  D.23986 = res;
  return D.23986;
}


mono_marshal_supports_fast_xdomain (struct MonoMethod * method)
{
  gboolean D.24134;
  int iftmp.87;
  struct MonoClass * D.24139;
  long unsigned int D.24140;
  long unsigned int D.24141;
  short unsigned int D.24143;
  int D.24144;
  int D.24145;
  int D.20246;
  int iftmp.88;
  int D.20242;
  const char[6] * D.24150;
  unsigned char D.24151;
  int D.24152;
  unsigned char D.24153;
  int D.24154;
  const unsigned char * D.24159;
  unsigned char D.24160;
  int D.24161;
  const unsigned char * D.24162;
  unsigned char D.24163;
  int D.24164;
  const unsigned char * D.24169;
  unsigned char D.24170;
  int D.24171;
  const unsigned char * D.24172;
  unsigned char D.24173;
  int D.24174;
  const unsigned char * D.24179;
  unsigned char D.24180;
  int D.24181;
  const unsigned char * D.24182;
  unsigned char D.24183;
  int D.24184;
  const char * D.24186;

  D.24139 = method->klass;
  D.24140 = BIT_FIELD_REF <*D.24139, 64, 256>;
  D.24141 = D.24140 & 8388608;
  if (D.24141 == 0) goto <D.24142>; else goto <D.24136>;
  <D.24142>:
  D.24143 = method->flags;
  D.24144 = (int) D.24143;
  D.24145 = D.24144 & 2048;
  if (D.24145 == 0) goto <D.24137>; else goto <D.24146>;
  <D.24146>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.24150 = ".ctor";
      D.24151 = MEM[(const unsigned char *)D.24150];
      D.24152 = (int) D.24151;
      D.24153 = *__s2;
      D.24154 = (int) D.24153;
      __result = D.24152 - D.24154;
      {
        if (__s1_len != 0) goto <D.24155>; else goto <D.24156>;
        <D.24155>:
        if (__result == 0) goto <D.24157>; else goto <D.24158>;
        <D.24157>:
        D.24159 = &MEM[(void *)".ctor" + 1B];
        D.24160 = *D.24159;
        D.24161 = (int) D.24160;
        D.24162 = __s2 + 1;
        D.24163 = *D.24162;
        D.24164 = (int) D.24163;
        __result = D.24161 - D.24164;
        if (__s1_len > 1) goto <D.24165>; else goto <D.24166>;
        <D.24165>:
        if (__result == 0) goto <D.24167>; else goto <D.24168>;
        <D.24167>:
        D.24169 = &MEM[(void *)".ctor" + 2B];
        D.24170 = *D.24169;
        D.24171 = (int) D.24170;
        D.24172 = __s2 + 2;
        D.24173 = *D.24172;
        D.24174 = (int) D.24173;
        __result = D.24171 - D.24174;
        if (__s1_len > 2) goto <D.24175>; else goto <D.24176>;
        <D.24175>:
        if (__result == 0) goto <D.24177>; else goto <D.24178>;
        <D.24177>:
        D.24179 = &MEM[(void *)".ctor" + 3B];
        D.24180 = *D.24179;
        D.24181 = (int) D.24180;
        D.24182 = __s2 + 3;
        D.24183 = *D.24182;
        D.24184 = (int) D.24183;
        __result = D.24181 - D.24184;
        <D.24178>:
        <D.24176>:
        <D.24168>:
        <D.24166>:
        <D.24158>:
        <D.24156>:
      }
      D.20242 = __result;
    }
    iftmp.88 = D.20242;
    goto <D.24185>;
    <D.24149>:
    D.24186 = method->name;
    iftmp.88 = __builtin_strcmp (".ctor", D.24186);
    <D.24185>:
    D.20246 = iftmp.88;
  }
  if (D.20246 != 0) goto <D.24137>; else goto <D.24136>;
  <D.24137>:
  iftmp.87 = 1;
  goto <D.24138>;
  <D.24136>:
  iftmp.87 = 0;
  <D.24138>:
  D.24134 = iftmp.87;
  return D.24134;
}


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

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


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.24203;
  int iftmp.98;
  struct MonoType * D.24207;
  unsigned char D.24208;
  struct MonoImage * D.24211;
  short unsigned int D.24212;
  int D.24213;
  int D.24214;
  int D.24215;
  unsigned int D.24216;
  int j.99;
  struct MonoClass * D.24218;
  struct MonoType * D.24219;
  int j.100;
  struct MonoClass * byte_array_class.101;
  struct MonoType * D.24222;
  int j.102;
  long unsigned int D.24224;
  long unsigned int D.24225;
  int * D.24226;
  int D.24227;
  int j.103;
  struct MonoType * D.24231;
  struct MonoClass * D.24235;
  struct MonoType * D.24236;
  struct MonoClass * D.24237;
  const char * D.24238;
  struct MonoMethod * D.24239;
  struct MonoType * D.24240;
  struct MonoImage * D.24245;
  int D.24246;
  unsigned int D.24247;
  struct MonoMethod * method_set_call_context.104;
  unsigned int D.24249;
  struct MonoMethod * method_rs_deserialize.105;
  unsigned int loc_array.106;
  unsigned int pos.107;
  struct MonoMethod * method_rs_appdomain_target.108;
  int j.109;
  long unsigned int D.24258;
  long unsigned int D.24259;
  long unsigned int D.24262;
  long unsigned int D.24263;
  struct MonoType * D.24273;
  int param_index.110;
  unsigned int param_index.111;
  unsigned int copy_local.112;
  unsigned int param_index.113;
  int param_index.114;
  unsigned int param_index.115;
  unsigned int loc_return.116;
  int j.117;
  int D.24292;
  unsigned int D.24293;
  struct MonoClass * D.24294;
  long unsigned int D.24299;
  long unsigned int D.24300;
  _Bool D.24305;
  long int D.24306;
  long int D.24307;
  long unsigned int D.24310;
  long unsigned int D.24311;
  struct MonoMethod * method_rs_serialize.118;
  unsigned int D.24321;
  int D.24322;
  unsigned int D.24323;
  unsigned int D.24324;
  unsigned int D.24325;
  int D.24326;
  unsigned int D.24327;
  struct MonoMethod * method_rs_serialize_exc.119;
  unsigned int loc_serialized_exc.120;
  int D.24330;
  unsigned int D.24331;
  unsigned int D.24332;
  unsigned int D.24333;
  unsigned int pos_leave.121;
  short unsigned int D.24337;
  int D.24338;
  int D.24339;
  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.24201>; else goto <D.24202>;
  <D.24201>:
  D.24203 = res;
  return D.24203;
  <D.24202>:
  sig = mono_method_signature (method);
  D.24207 = sig->ret;
  D.24208 = D.24207->type;
  if (D.24208 != 1) goto <D.24209>; else goto <D.24205>;
  <D.24209>:
  if (ret_marshal_type != 3) goto <D.24210>; else goto <D.24205>;
  <D.24210>:
  iftmp.98 = 1;
  goto <D.24206>;
  <D.24205>:
  iftmp.98 = 0;
  <D.24206>:
  copy_return = iftmp.98;
  j = 0;
  D.24211 = mono_defaults.corlib;
  D.24212 = sig->param_count;
  D.24213 = (int) D.24212;
  D.24214 = D.24213 + 3;
  D.24215 = D.24214 - complex_count;
  D.24216 = (unsigned int) D.24215;
  csig = mono_metadata_signature_alloc (D.24211, D.24216);
  j.99 = j;
  j = j.99 + 1;
  D.24218 = mono_defaults.object_class;
  D.24219 = &D.24218->byval_arg;
  csig->params[j.99] = D.24219;
  j.100 = j;
  j = j.100 + 1;
  byte_array_class.101 = byte_array_class;
  D.24222 = &byte_array_class.101->this_arg;
  csig->params[j.100] = D.24222;
  j.102 = j;
  j = j.102 + 1;
  byte_array_class.101 = byte_array_class;
  D.24222 = &byte_array_class.101->this_arg;
  csig->params[j.102] = D.24222;
  i = 0;
  goto <D.20296>;
  <D.20295>:
  D.24224 = (long unsigned int) i;
  D.24225 = D.24224 * 4;
  D.24226 = marshal_types + D.24225;
  D.24227 = *D.24226;
  if (D.24227 != 3) goto <D.24228>; else goto <D.24229>;
  <D.24228>:
  j.103 = j;
  j = j.103 + 1;
  D.24231 = sig->params[i];
  csig->params[j.103] = D.24231;
  <D.24229>:
  i = i + 1;
  <D.20296>:
  D.24212 = sig->param_count;
  D.24213 = (int) D.24212;
  if (D.24213 > i) goto <D.20295>; else goto <D.20297>;
  <D.20297>:
  if (copy_return != 0) goto <D.24232>; else goto <D.24233>;
  <D.24232>:
  D.24207 = sig->ret;
  csig->ret = D.24207;
  goto <D.24234>;
  <D.24233>:
  D.24235 = mono_defaults.void_class;
  D.24236 = &D.24235->byval_arg;
  csig->ret = D.24236;
  <D.24234>:
  csig->pinvoke = 1;
  csig->hasthis = 0;
  D.24237 = method->klass;
  D.24238 = method->name;
  mb = mono_mb_new (D.24237, D.24238, 11);
  D.24239 = mb->method;
  D.24239->save_lmf = 1;
  byte_array_class.101 = byte_array_class;
  D.24240 = &byte_array_class.101->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.24240);
  if (complex_count > 0) goto <D.24241>; else goto <D.24242>;
  <D.24241>:
  D.24218 = mono_defaults.object_class;
  D.24219 = &D.24218->byval_arg;
  loc_array = mono_mb_add_local (mb, D.24219);
  <D.24242>:
  D.24207 = sig->ret;
  D.24208 = D.24207->type;
  if (D.24208 != 1) goto <D.24243>; else goto <D.24244>;
  <D.24243>:
  D.24207 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.24207);
  D.24207 = sig->ret;
  ret_class = mono_class_from_mono_type (D.24207);
  <D.24244>:
  D.24237 = method->klass;
  D.24245 = D.24237->image;
  main_clause = mono_image_alloc0 (D.24245, 32);
  D.24246 = mono_mb_get_label (mb);
  D.24247 = (unsigned int) D.24246;
  main_clause->try_offset = D.24247;
  mono_mb_emit_byte (mb, 20);
  method_set_call_context.104 = method_set_call_context;
  mono_mb_emit_managed_call (mb, method_set_call_context.104, 0B);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  D.24249 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.24249;
  byte_array_class.101 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.101);
  method_rs_deserialize.105 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.105, 0B);
  if (complex_count > 0) goto <D.24251>; else goto <D.24252>;
  <D.24251>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.106);
  goto <D.24254>;
  <D.24252>:
  mono_mb_emit_byte (mb, 38);
  <D.24254>:
  pos.107 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.107);
  mono_mb_emit_ldarg (mb, 0);
  method_rs_appdomain_target.108 = method_rs_appdomain_target;
  mono_mb_emit_managed_call (mb, method_rs_appdomain_target.108, 0B);
  copy_locals_base = mb->locals;
  param_index = 3;
  j = 0;
  i = 0;
  goto <D.20307>;
  <D.20306>:
  {
    struct MonoType * pt;
    struct MonoClass * pclass;

    pt = sig->params[i];
    pclass = mono_class_from_mono_type (pt);
    D.24224 = (long unsigned int) i;
    D.24225 = D.24224 * 4;
    D.24226 = marshal_types + D.24225;
    D.24227 = *D.24226;
    switch (D.24227) <default: <D.24283>, case 0: <D.20305>, case 1: <D.20304>, case 2: <D.20302>, case 3: <D.20300>>
    <D.20300>:
    loc_array.106 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.106);
    j.109 = j;
    j = j.109 + 1;
    mono_mb_emit_icon (mb, j.109);
    D.24258 = BIT_FIELD_REF <*pt, 64, 64>;
    D.24259 = D.24258 & 1073741824;
    if (D.24259 != 0) goto <D.24260>; else goto <D.24261>;
    <D.24260>:
    D.24262 = BIT_FIELD_REF <*pclass, 64, 256>;
    D.24263 = D.24262 & 8;
    if (D.24263 != 0) goto <D.24264>; else goto <D.24265>;
    <D.24264>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    goto <D.24266>;
    <D.24265>:
    mono_mb_emit_op (mb, 143, pclass);
    <D.24266>:
    goto <D.24267>;
    <D.24261>:
    D.24262 = BIT_FIELD_REF <*pclass, 64, 256>;
    D.24263 = D.24262 & 8;
    if (D.24263 != 0) goto <D.24268>; else goto <D.24269>;
    <D.24268>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.24270>;
    <D.24269>:
    mono_mb_emit_byte (mb, 154);
    D.24218 = mono_defaults.object_class;
    if (D.24218 != pclass) goto <D.24271>; else goto <D.24272>;
    <D.24271>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.24272>:
    <D.24270>:
    <D.24267>:
    goto <D.20301>;
    <D.20302>:
    {
      int copy_local;

      D.24273 = &pclass->byval_arg;
      copy_local = mono_mb_add_local (mb, D.24273);
      param_index.110 = param_index;
      param_index = param_index.110 + 1;
      param_index.111 = (unsigned int) param_index.110;
      mono_mb_emit_ldarg (mb, param_index.111);
      mono_marshal_emit_xdomain_copy_value (mb, pclass);
      mono_mb_emit_byte (mb, 37);
      copy_local.112 = (unsigned int) copy_local;
      mono_mb_emit_stloc (mb, copy_local.112);
      goto <D.20301>;
    }
    <D.20304>:
    param_index.113 = (unsigned int) param_index;
    mono_mb_emit_ldarg (mb, param_index.113);
    D.24258 = BIT_FIELD_REF <*pt, 64, 64>;
    D.24259 = D.24258 & 1073741824;
    if (D.24259 != 0) goto <D.24278>; else goto <D.24279>;
    <D.24278>:
    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.24280>;
    <D.24279>:
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    <D.24280>:
    param_index = param_index + 1;
    goto <D.20301>;
    <D.20305>:
    param_index.114 = param_index;
    param_index = param_index.114 + 1;
    param_index.115 = (unsigned int) param_index.114;
    mono_mb_emit_ldarg (mb, param_index.115);
    goto <D.20301>;
    <D.24283>:
    <D.20301>:
  }
  i = i + 1;
  <D.20307>:
  D.24212 = sig->param_count;
  D.24213 = (int) D.24212;
  if (D.24213 > i) goto <D.20306>; else goto <D.20308>;
  <D.20308>:
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_op (mb, 111, method);
  D.24207 = sig->ret;
  D.24208 = D.24207->type;
  if (D.24208 != 1) goto <D.24284>; else goto <D.24285>;
  <D.24284>:
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.116);
  <D.24285>:
  j = 0;
  param_index = 3;
  i = 0;
  goto <D.20311>;
  <D.20310>:
  D.24224 = (long unsigned int) i;
  D.24225 = D.24224 * 4;
  D.24226 = marshal_types + D.24225;
  D.24227 = *D.24226;
  if (D.24227 == 3) goto <D.24287>; else goto <D.24288>;
  <D.24287>:
  // predicted unlikely by continue predictor.
  goto <D.20309>;
  <D.24288>:
  D.24224 = (long unsigned int) i;
  D.24225 = D.24224 * 4;
  D.24226 = marshal_types + D.24225;
  D.24227 = *D.24226;
  if (D.24227 == 2) goto <D.24289>; else goto <D.24290>;
  <D.24289>:
  j.117 = j;
  j = j.117 + 1;
  D.24292 = j.117 + copy_locals_base;
  D.24293 = (unsigned int) D.24292;
  mono_mb_emit_ldloc (mb, D.24293);
  param_index.113 = (unsigned int) param_index;
  mono_mb_emit_ldarg (mb, param_index.113);
  D.24231 = sig->params[i];
  D.24294 = mono_class_from_mono_type (D.24231);
  mono_marshal_emit_xdomain_copy_out_value (mb, D.24294);
  <D.24290>:
  param_index = param_index + 1;
  <D.20309>:
  i = i + 1;
  <D.20311>:
  D.24212 = sig->param_count;
  D.24213 = (int) D.24212;
  if (D.24213 > i) goto <D.20310>; else goto <D.20312>;
  <D.20312>:
  if (complex_out_count > 0) goto <D.24295>; else goto <D.24296>;
  <D.24295>:
  j = 0;
  i = 0;
  goto <D.20315>;
  <D.20314>:
  D.24224 = (long unsigned int) i;
  D.24225 = D.24224 * 4;
  D.24226 = marshal_types + D.24225;
  D.24227 = *D.24226;
  if (D.24227 != 3) goto <D.24297>; else goto <D.24298>;
  <D.24297>:
  // predicted unlikely by continue predictor.
  goto <D.20313>;
  <D.24298>:
  D.24231 = sig->params[i];
  D.24299 = BIT_FIELD_REF <*D.24231, 64, 64>;
  D.24300 = D.24299 & 1073741824;
  if (D.24300 == 0) goto <D.24301>; else goto <D.24302>;
  <D.24301>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  mono_mb_emit_icon (mb, j);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 162);
  <D.24302>:
  j = j + 1;
  <D.20313>:
  i = i + 1;
  <D.20315>:
  D.24212 = sig->param_count;
  D.24213 = (int) D.24212;
  if (D.24213 > i) goto <D.20314>; else goto <D.20316>;
  <D.20316>:
  if (ret_marshal_type == 3) goto <D.24303>; else goto <D.24304>;
  <D.24303>:
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  mono_mb_emit_icon (mb, complex_count);
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  D.24305 = ret_class == 0B;
  D.24306 = (long int) D.24305;
  D.24307 = __builtin_expect (D.24306, 0);
  if (D.24307 != 0) goto <D.24308>; else goto <D.24309>;
  <D.24308>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3660, "ret_class");
  <D.24309>:
  D.24310 = BIT_FIELD_REF <*ret_class, 64, 256>;
  D.24311 = D.24310 & 8;
  if (D.24311 != 0) goto <D.24312>; else goto <D.24313>;
  <D.24312>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.24313>:
  mono_mb_emit_byte (mb, 162);
  <D.24304>:
  mono_mb_emit_ldarg (mb, 1);
  loc_array.106 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.106);
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.24315>;
  <D.24296>:
  if (ret_marshal_type == 3) goto <D.24316>; else goto <D.24317>;
  <D.24316>:
  mono_mb_emit_ldarg (mb, 1);
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  D.24310 = BIT_FIELD_REF <*ret_class, 64, 256>;
  D.24311 = D.24310 & 8;
  if (D.24311 != 0) goto <D.24318>; else goto <D.24319>;
  <D.24318>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.24319>:
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.24320>;
  <D.24317>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.118 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.118, 0B);
  mono_mb_emit_byte (mb, 81);
  <D.24320>:
  <D.24315>:
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  D.24321 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.24321;
  main_clause->flags = 0;
  D.24322 = mono_mb_get_pos (mb);
  D.24323 = (unsigned int) D.24322;
  D.24324 = main_clause->try_offset;
  D.24325 = D.24323 - D.24324;
  main_clause->try_len = D.24325;
  D.24218 = mono_defaults.object_class;
  main_clause->data.catch_class = D.24218;
  D.24326 = mono_mb_get_label (mb);
  D.24327 = (unsigned int) D.24326;
  main_clause->handler_offset = D.24327;
  method_rs_serialize_exc.119 = method_rs_serialize_exc;
  mono_mb_emit_managed_call (mb, method_rs_serialize_exc.119, 0B);
  loc_serialized_exc.120 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_stloc (mb, loc_serialized_exc.120);
  mono_mb_emit_ldarg (mb, 2);
  loc_serialized_exc.120 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.120);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.24330 = mono_mb_get_pos (mb);
  D.24331 = (unsigned int) D.24330;
  D.24332 = main_clause->handler_offset;
  D.24333 = D.24331 - D.24332;
  main_clause->handler_len = D.24333;
  pos_leave.121 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.121);
  if (copy_return != 0) goto <D.24335>; else goto <D.24336>;
  <D.24335>:
  loc_return.116 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.116);
  <D.24336>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, main_clause);
  D.24337 = csig->param_count;
  D.24338 = (int) D.24337;
  D.24339 = D.24338 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, csig, D.24339);
  mono_mb_free (mb);
  D.24203 = res;
  return D.24203;
}


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

  if (target_type == 1) goto <D.24341>; else goto <D.24342>;
  <D.24341>:
  D.24343 = mono_marshal_get_xappdomain_invoke (method);
  return D.24343;
  <D.24342>:
  if (target_type == 2) goto <D.24344>; else goto <D.24345>;
  <D.24344>:
  D.24343 = mono_cominterop_get_invoke (method);
  return D.24343;
  <D.24345>:
  D.24343 = mono_marshal_get_remoting_invoke (method);
  return D.24343;
  D.24343 = 0B;
  return D.24343;
}


mono_marshal_get_remoting_invoke_with_check (struct MonoMethod * method)
{
  _Bool D.24347;
  long int D.24348;
  long int D.24349;
  long unsigned int D.24352;
  long unsigned int D.24353;
  struct MonoMethod * D.24356;
  struct MonoMethodSignature * D.24357;
  long unsigned int D.24358;
  long unsigned int D.24359;
  _Bool D.24360;
  long int D.24361;
  long int D.24362;
  struct MonoClass * D.24367;
  const char * D.24368;
  unsigned int i.122;
  short unsigned int D.24370;
  int D.24371;
  int D.24372;
  struct MonoMethodSignature * D.24375;
  unsigned int pos_rem.123;
  struct MonoMethodSignature * D.24377;
  unsigned int pos.124;
  struct MonoMethodSignature * D.24379;
  int D.24380;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * native;
  int i;
  int pos;
  int pos_rem;

  D.24347 = method == 0B;
  D.24348 = (long int) D.24347;
  D.24349 = __builtin_expect (D.24348, 0);
  if (D.24349 != 0) goto <D.24350>; else goto <D.24351>;
  <D.24350>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4087, "method");
  <D.24351>:
  D.24352 = BIT_FIELD_REF <*method, 64, 256>;
  D.24353 = D.24352 & 124;
  if (D.24353 == 36) goto <D.24354>; else goto <D.24355>;
  <D.24354>:
  D.24356 = method;
  return D.24356;
  <D.24355>:
  D.24357 = mono_method_signature (method);
  D.24358 = BIT_FIELD_REF <*D.24357, 64, 64>;
  D.24359 = D.24358 & 18014398509481984;
  D.24360 = D.24359 == 0;
  D.24361 = (long int) D.24360;
  D.24362 = __builtin_expect (D.24361, 0);
  if (D.24362 != 0) goto <D.24363>; else goto <D.24364>;
  <D.24363>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4093, "mono_method_signature (method)->hasthis");
  <D.24364>:
  res = mono_marshal_remoting_find_in_cache (method, 9);
  if (res != 0B) goto <D.24365>; else goto <D.24366>;
  <D.24365>:
  D.24356 = res;
  return D.24356;
  <D.24366>:
  sig = mono_signature_no_pinvoke (method);
  D.24367 = method->klass;
  D.24368 = method->name;
  mb = mono_mb_new (D.24367, D.24368, 9);
  i = 0;
  goto <D.20396>;
  <D.20395>:
  i.122 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.122);
  i = i + 1;
  <D.20396>:
  D.24370 = sig->param_count;
  D.24371 = (int) D.24370;
  if (D.24371 >= i) goto <D.20395>; else goto <D.20397>;
  <D.20397>:
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  D.24372 = mono_marshal_supports_fast_xdomain (method);
  if (D.24372 != 0) goto <D.24373>; else goto <D.24374>;
  <D.24373>:
  mono_mb_emit_ldarg (mb, 0);
  pos_rem = mono_mb_emit_xdomain_check (mb, 59);
  native = mono_marshal_get_xappdomain_invoke (method);
  D.24375 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.24375);
  mono_mb_emit_byte (mb, 42);
  pos_rem.123 = (unsigned int) pos_rem;
  mono_mb_patch_branch (mb, pos_rem.123);
  <D.24374>:
  native = mono_marshal_get_remoting_invoke (method);
  D.24377 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.24377);
  mono_mb_emit_byte (mb, 42);
  pos.124 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.124);
  D.24379 = mono_method_signature (method);
  mono_mb_emit_managed_call (mb, method, D.24379);
  mono_mb_emit_byte (mb, 42);
  D.24370 = sig->param_count;
  D.24371 = (int) D.24370;
  D.24380 = D.24371 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.24380);
  mono_mb_free (mb);
  D.24356 = res;
  return D.24356;
}


mono_mb_emit_proxy_check (struct MonoMethodBuilder * mb, int branch_code)
{
  struct MonoClass * D.24382;
  unsigned int D.24383;
  int D.24384;
  unsigned char D.24385;
  unsigned int D.24386;
  int D.24387;
  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.24382 = mono_defaults.transparent_proxy_class;
  D.24383 = mono_mb_add_data (mb, D.24382);
  D.24384 = (int) D.24383;
  mono_mb_emit_i4 (mb, D.24384);
  D.24385 = (unsigned char) branch_code;
  D.24386 = mono_mb_emit_branch (mb, D.24385);
  pos = (int) D.24386;
  D.24387 = pos;
  return D.24387;
}


mono_mb_emit_xdomain_check (struct MonoMethodBuilder * mb, int branch_code)
{
  unsigned char D.24389;
  unsigned int D.24390;
  int D.24391;
  int pos;

  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 40);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_icon (mb, -1);
  D.24389 = (unsigned char) branch_code;
  D.24390 = mono_mb_emit_branch (mb, D.24389);
  pos = (int) D.24390;
  D.24391 = pos;
  return D.24391;
}


mono_marshal_get_delegate_invoke (struct MonoMethod * method, struct MonoDelegate * del)
{
  struct MonoObject * D.24395;
  struct MonoMethod * D.24398;
  struct MonoMethodSignature * D.24401;
  long unsigned int D.24402;
  long unsigned int D.24403;
  long unsigned int D.24406;
  long unsigned int D.24407;
  struct MonoMethodSignature * D.24410;
  long unsigned int D.24411;
  long unsigned int D.24412;
  _Bool D.24413;
  long int D.24414;
  long int D.24415;
  struct MonoType * D.24418;
  struct MonoGenericContext * D.24419;
  int iftmp.125;
  struct MonoClass * D.24426;
  struct MonoClass * D.24427;
  struct MonoClass * D.24428;
  int D.20456;
  int iftmp.126;
  int D.20455;
  const char[7] * D.24433;
  unsigned char D.24434;
  int D.24435;
  unsigned char D.24436;
  int D.24437;
  const unsigned char * D.24442;
  unsigned char D.24443;
  int D.24444;
  const unsigned char * D.24445;
  unsigned char D.24446;
  int D.24447;
  const unsigned char * D.24452;
  unsigned char D.24453;
  int D.24454;
  const unsigned char * D.24455;
  unsigned char D.24456;
  int D.24457;
  const unsigned char * D.24462;
  unsigned char D.24463;
  int D.24464;
  const unsigned char * D.24465;
  unsigned char D.24466;
  int D.24467;
  const char * D.24469;
  _Bool D.24470;
  long int D.24471;
  long int D.24472;
  short unsigned int D.24477;
  struct MonoMethodSignature * D.24478;
  short unsigned int D.24479;
  _Bool D.24480;
  struct MonoMethodSignature * D.24485;
  short unsigned int D.24486;
  int D.24487;
  int D.24488;
  int D.24489;
  short unsigned int D.24492;
  int D.24493;
  int D.24494;
  _Bool D.24497;
  long int D.24498;
  long int D.24499;
  long unsigned int D.24502;
  long unsigned int D.24503;
  int D.24506;
  _Bool D.24511;
  long int D.24512;
  long int D.24513;
  struct MonoImage * D.24518;
  struct GHashTable * * D.24519;
  struct MonoMethod * D.24522;
  struct GHashTable * * D.24526;
  _Bool D.24534;
  long int D.24535;
  long int D.24536;
  struct GHashTable * D.24539;
  struct GHashTable * D.24542;
  _Bool D.24545;
  long int D.24546;
  long int D.24547;
  struct GHashTable * * D.24553;
  struct MonoClass * D.24564;
  struct MonoClass * D.24565;
  struct MonoType * D.24566;
  long unsigned int D.24567;
  long unsigned int D.24568;
  _Bool D.24569;
  long int D.24570;
  long int D.24571;
  unsigned int local_prev.127;
  unsigned int D.24575;
  int D.24576;
  unsigned int D.24577;
  struct MonoGenericContext * D.24580;
  struct MonoMethod * D.24581;
  struct MonoType * D.24583;
  unsigned char D.24584;
  unsigned int pos0.128;
  unsigned int local_target.129;
  unsigned int D.24591;
  struct MonoType * D.24603;
  int D.24604;
  struct MonoClass * D.24607;
  int D.24610;
  _Bool D.24619;
  long int D.24620;
  long int D.24621;
  struct MonoClass * D.24628;
  struct MonoImage * D.24629;
  struct MonoMethodSignature * D.24630;
  struct MonoMethodSignature * D.24631;
  _Bool D.24634;
  long int D.24635;
  long int D.24636;
  _Bool D.24642;
  long int D.24643;
  long int D.24644;
  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.24393>; else goto <D.24394>;
      <D.24393>:
      D.24395 = del->target;
      if (D.24395 == 0B) goto <D.24396>; else goto <D.24397>;
      <D.24396>:
      D.24398 = del->method;
      if (D.24398 != 0B) goto <D.24399>; else goto <D.24400>;
      <D.24399>:
      D.24398 = del->method;
      D.24401 = mono_method_signature (D.24398);
      D.24402 = BIT_FIELD_REF <*D.24401, 64, 64>;
      D.24403 = D.24402 & 18014398509481984;
      if (D.24403 != 0) goto <D.24404>; else goto <D.24405>;
      <D.24404>:
      callvirt = 1;
      target_method = del->method;
      D.24406 = BIT_FIELD_REF <*target_method, 64, 256>;
      D.24407 = D.24406 & 4096;
      if (D.24407 != 0) goto <D.24408>; else goto <D.24409>;
      <D.24408>:
      {
        struct MonoType * target_type;

        D.24410 = method->signature;
        D.24411 = BIT_FIELD_REF <*D.24410, 64, 64>;
        D.24412 = D.24411 & 18014398509481984;
        D.24413 = D.24412 == 0;
        D.24414 = (long int) D.24413;
        D.24415 = __builtin_expect (D.24414, 0);
        if (D.24415 != 0) goto <D.24416>; else goto <D.24417>;
        <D.24416>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4211, "method->signature->hasthis");
        <D.24417>:
        D.24410 = method->signature;
        D.24418 = D.24410->params[0];
        D.24419 = mono_method_get_context (method);
        target_type = mono_class_inflate_generic_type (D.24418, D.24419);
        target_class = mono_class_from_mono_type (target_type);
      }
      goto <D.24420>;
      <D.24409>:
      D.24398 = del->method;
      target_class = D.24398->klass;
      <D.24420>:
      <D.24405>:
      <D.24400>:
      <D.24397>:
      <D.24394>:
      if (method == 0B) goto <D.24422>; else goto <D.24425>;
      <D.24425>:
      D.24426 = method->klass;
      D.24427 = D.24426->parent;
      D.24428 = mono_defaults.multicastdelegate_class;
      if (D.24427 != D.24428) goto <D.24422>; else goto <D.24429>;
      <D.24429>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = method->name;
          D.24433 = "Invoke";
          D.24434 = MEM[(const unsigned char *)D.24433];
          D.24435 = (int) D.24434;
          D.24436 = *__s2;
          D.24437 = (int) D.24436;
          __result = D.24435 - D.24437;
          {
            if (__s2_len != 0) goto <D.24438>; else goto <D.24439>;
            <D.24438>:
            if (__result == 0) goto <D.24440>; else goto <D.24441>;
            <D.24440>:
            D.24442 = &MEM[(void *)"Invoke" + 1B];
            D.24443 = *D.24442;
            D.24444 = (int) D.24443;
            D.24445 = __s2 + 1;
            D.24446 = *D.24445;
            D.24447 = (int) D.24446;
            __result = D.24444 - D.24447;
            if (__s2_len > 1) goto <D.24448>; else goto <D.24449>;
            <D.24448>:
            if (__result == 0) goto <D.24450>; else goto <D.24451>;
            <D.24450>:
            D.24452 = &MEM[(void *)"Invoke" + 2B];
            D.24453 = *D.24452;
            D.24454 = (int) D.24453;
            D.24455 = __s2 + 2;
            D.24456 = *D.24455;
            D.24457 = (int) D.24456;
            __result = D.24454 - D.24457;
            if (__s2_len > 2) goto <D.24458>; else goto <D.24459>;
            <D.24458>:
            if (__result == 0) goto <D.24460>; else goto <D.24461>;
            <D.24460>:
            D.24462 = &MEM[(void *)"Invoke" + 3B];
            D.24463 = *D.24462;
            D.24464 = (int) D.24463;
            D.24465 = __s2 + 3;
            D.24466 = *D.24465;
            D.24467 = (int) D.24466;
            __result = D.24464 - D.24467;
            <D.24461>:
            <D.24459>:
            <D.24451>:
            <D.24449>:
            <D.24441>:
            <D.24439>:
          }
          D.20455 = __result;
        }
        iftmp.126 = -D.20455;
        goto <D.24468>;
        <D.24432>:
        D.24469 = method->name;
        iftmp.126 = __builtin_strcmp (D.24469, "Invoke");
        <D.24468>:
        D.20456 = iftmp.126;
      }
      if (D.20456 != 0) goto <D.24422>; else goto <D.24423>;
      <D.24422>:
      iftmp.125 = 1;
      goto <D.24424>;
      <D.24423>:
      iftmp.125 = 0;
      <D.24424>:
      D.24470 = iftmp.125 != 0;
      D.24471 = (long int) D.24470;
      D.24472 = __builtin_expect (D.24471, 0);
      if (D.24472 != 0) goto <D.24473>; else goto <D.24474>;
      <D.24473>:
      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.24474>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      if (callvirt != 0) goto <D.24475>; else goto <D.24476>;
      <D.24475>:
      D.24477 = sig->param_count;
      D.24398 = del->method;
      D.24478 = mono_method_signature (D.24398);
      D.24479 = D.24478->param_count;
      D.24480 = D.24477 == D.24479;
      closed_over_null = (gboolean) D.24480;
      <D.24476>:
      if (del != 0B) goto <D.24481>; else goto <D.24482>;
      <D.24481>:
      D.24398 = del->method;
      if (D.24398 != 0B) goto <D.24483>; else goto <D.24484>;
      <D.24483>:
      D.24398 = del->method;
      D.24485 = mono_method_signature (D.24398);
      D.24486 = D.24485->param_count;
      D.24487 = (int) D.24486;
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      D.24489 = D.24488 + 1;
      if (D.24487 == D.24489) goto <D.24490>; else goto <D.24491>;
      <D.24490>:
      D.24398 = del->method;
      D.24492 = D.24398->flags;
      D.24493 = (int) D.24492;
      D.24494 = D.24493 & 16;
      if (D.24494 != 0) goto <D.24495>; else goto <D.24496>;
      <D.24495>:
      D.24497 = callvirt != 0;
      D.24498 = (long int) D.24497;
      D.24499 = __builtin_expect (D.24498, 0);
      if (D.24499 != 0) goto <D.24500>; else goto <D.24501>;
      <D.24500>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4229, "!callvirt");
      <D.24501>:
      D.24398 = del->method;
      invoke_sig = mono_method_signature (D.24398);
      target_method = 0B;
      static_method_with_first_arg_bound = 1;
      <D.24496>:
      <D.24491>:
      <D.24484>:
      <D.24482>:
      D.24502 = BIT_FIELD_REF <*method, 64, 256>;
      D.24503 = D.24502 & 4096;
      if (D.24503 != 0) goto <D.24504>; else goto <D.24505>;
      <D.24504>:
      D.24506 = callvirt | static_method_with_first_arg_bound;
      if (D.24506 == 0) goto <D.24507>; else goto <D.24508>;
      <D.24507>:
      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.24509>; else goto <D.24510>;
      <D.24509>:
      D.24426 = method->klass;
      container = D.24426->generic_container;
      <D.24510>:
      D.24511 = container == 0B;
      D.24512 = (long int) D.24511;
      D.24513 = __builtin_expect (D.24512, 0);
      if (D.24513 != 0) goto <D.24514>; else goto <D.24515>;
      <D.24514>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4246, "container");
      <D.24515>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      <D.24508>:
      <D.24505>:
      if (ctx != 0B) goto <D.24516>; else goto <D.24517>;
      <D.24516>:
      D.24426 = method->klass;
      D.24518 = D.24426->image;
      D.24519 = &D.24518->delegate_invoke_generic_cache;
      cache = get_cache (D.24519, mono_aligned_addr_hash, 0B);
      res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
      if (res != 0B) goto <D.24520>; else goto <D.24521>;
      <D.24520>:
      D.24522 = res;
      return D.24522;
      <D.24521>:
      goto <D.24523>;
      <D.24517>:
      if (static_method_with_first_arg_bound != 0) goto <D.24524>; else goto <D.24525>;
      <D.24524>:
      D.24426 = method->klass;
      D.24518 = D.24426->image;
      D.24526 = &D.24518->delegate_bound_static_invoke_cache;
      cache = get_cache (D.24526, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, invoke_sig);
      if (res != 0B) goto <D.24527>; else goto <D.24528>;
      <D.24527>:
      D.24522 = res;
      return D.24522;
      <D.24528>:
      goto <D.24529>;
      <D.24525>:
      if (callvirt != 0) goto <D.24530>; else goto <D.24531>;
      <D.24530>:
      {
        struct GHashTable * * cache_ptr;

        D.24426 = method->klass;
        D.24518 = D.24426->image;
        cache_ptr = &D.24518->delegate_abstract_invoke_cache;
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24532>; else goto <D.24533>;
          <D.24532>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24533>:
          D.24534 = ret != 0;
          D.24535 = (long int) D.24534;
          D.24536 = __builtin_expect (D.24535, 0);
          if (D.24536 != 0) goto <D.24537>; else goto <D.24538>;
          <D.24537>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4275, "ret == 0");
          <D.24538>:
        }
        D.24539 = *cache_ptr;
        if (D.24539 == 0B) goto <D.24540>; else goto <D.24541>;
        <D.24540>:
        D.24542 = monoeg_g_hash_table_new_full (signature_method_pair_hash, signature_method_pair_equal, free_signature_method_pair, 0B);
        *cache_ptr = D.24542;
        <D.24541>:
        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.24543>; else goto <D.24544>;
          <D.24543>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24544>:
          D.24545 = ret != 0;
          D.24546 = (long int) D.24545;
          D.24547 = __builtin_expect (D.24546, 0);
          if (D.24547 != 0) goto <D.24548>; else goto <D.24549>;
          <D.24548>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4282, "ret == 0");
          <D.24549>:
        }
        if (res != 0B) goto <D.24550>; else goto <D.24551>;
        <D.24550>:
        D.24522 = res;
        return D.24522;
        <D.24551>:
      }
      goto <D.24552>;
      <D.24531>:
      D.24426 = method->klass;
      D.24518 = D.24426->image;
      D.24553 = &D.24518->delegate_invoke_cache;
      cache = get_cache (D.24553, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, sig);
      if (res != 0B) goto <D.24554>; else goto <D.24555>;
      <D.24554>:
      D.24522 = res;
      return D.24522;
      <D.24555>:
      <D.24552>:
      <D.24529>:
      <D.24523>:
      D.24426 = method->klass;
      D.24518 = D.24426->image;
      static_sig = signature_dup (D.24518, sig);
      static_sig->hasthis = 0;
      if (static_method_with_first_arg_bound == 0) goto <D.24556>; else goto <D.24557>;
      <D.24556>:
      invoke_sig = static_sig;
      <D.24557>:
      if (static_method_with_first_arg_bound != 0) goto <D.24558>; else goto <D.24559>;
      <D.24558>:
      name = mono_signature_to_name (invoke_sig, "invoke_bound_");
      goto <D.24560>;
      <D.24559>:
      name = mono_signature_to_name (sig, "invoke");
      <D.24560>:
      if (ctx != 0B) goto <D.24561>; else goto <D.24562>;
      <D.24561>:
      D.24426 = method->klass;
      mb = mono_mb_new (D.24426, name, 1);
      goto <D.24563>;
      <D.24562>:
      D.24426 = method->klass;
      D.24518 = D.24426->image;
      D.24564 = get_wrapper_target_class (D.24518);
      mb = mono_mb_new (D.24564, name, 1);
      <D.24563>:
      monoeg_g_free (name);
      D.24565 = mono_defaults.object_class;
      D.24566 = &D.24565->byval_arg;
      local_target = mono_mb_add_local (mb, D.24566);
      D.24565 = mono_defaults.object_class;
      D.24566 = &D.24565->byval_arg;
      local_prev = mono_mb_add_local (mb, D.24566);
      D.24567 = BIT_FIELD_REF <*sig, 64, 64>;
      D.24568 = D.24567 & 18014398509481984;
      D.24569 = D.24568 == 0;
      D.24570 = (long int) D.24569;
      D.24571 = __builtin_expect (D.24570, 0);
      if (D.24571 != 0) goto <D.24572>; else goto <D.24573>;
      <D.24572>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4314, "sig->hasthis");
      <D.24573>:
      emit_thread_interrupt_checkpoint (mb);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 88);
      mono_mb_emit_byte (mb, 80);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_stloc (mb, local_prev.127);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.127);
      D.24575 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.24575;
      mono_mb_emit_byte (mb, 240);
      mono_mb_emit_byte (mb, 12);
      local_prev.127 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.127);
      i = 0;
      goto <D.20461>;
      <D.20460>:
      D.24576 = i + 1;
      D.24577 = (unsigned int) D.24576;
      mono_mb_emit_ldarg (mb, D.24577);
      i = i + 1;
      <D.20461>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      if (D.24488 > i) goto <D.20460>; else goto <D.20462>;
      <D.20462>:
      if (ctx != 0B) goto <D.24578>; else goto <D.24579>;
      <D.24578>:
      D.24580 = &container->context;
      D.24581 = mono_class_inflate_generic_method (method, D.24580);
      mono_mb_emit_op (mb, 111, D.24581);
      goto <D.24582>;
      <D.24579>:
      mono_mb_emit_op (mb, 111, method);
      <D.24582>:
      D.24583 = sig->ret;
      D.24584 = D.24583->type;
      if (D.24584 != 1) goto <D.24585>; else goto <D.24586>;
      <D.24585>:
      mono_mb_emit_byte (mb, 38);
      <D.24586>:
      pos0.128 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.128);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 32);
      mono_mb_emit_byte (mb, 80);
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_stloc (mb, local_target.129);
      if (static_method_with_first_arg_bound == 0) goto <D.24589>; else goto <D.24590>;
      <D.24589>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      D.24591 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.24591;
      if (callvirt != 0) goto <D.24592>; else goto <D.24593>;
      <D.24592>:
      mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
      goto <D.24594>;
      <D.24593>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      i = 0;
      goto <D.20464>;
      <D.20463>:
      D.24576 = i + 1;
      D.24577 = (unsigned int) D.24576;
      mono_mb_emit_ldarg (mb, D.24577);
      i = i + 1;
      <D.20464>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      if (D.24488 > i) goto <D.20463>; else goto <D.20465>;
      <D.20465>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, sig);
      mono_mb_emit_byte (mb, 42);
      <D.24594>:
      pos0.128 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.128);
      <D.24590>:
      if (callvirt != 0) goto <D.24595>; else goto <D.24596>;
      <D.24595>:
      if (closed_over_null == 0) goto <D.24597>; else goto <D.24598>;
      <D.24597>:
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_op (mb, 116, target_class);
      i = 1;
      goto <D.20467>;
      <D.20466>:
      D.24576 = i + 1;
      D.24577 = (unsigned int) D.24576;
      mono_mb_emit_ldarg (mb, D.24577);
      i = i + 1;
      <D.20467>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      if (D.24488 > i) goto <D.20466>; else goto <D.20468>;
      <D.20468>:
      mono_mb_emit_op (mb, 111, target_method);
      goto <D.24599>;
      <D.24598>:
      mono_mb_emit_byte (mb, 20);
      i = 0;
      goto <D.20470>;
      <D.20469>:
      D.24576 = i + 1;
      D.24577 = (unsigned int) D.24576;
      mono_mb_emit_ldarg (mb, D.24577);
      i = i + 1;
      <D.20470>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      if (D.24488 > i) goto <D.20469>; else goto <D.20471>;
      <D.20471>:
      mono_mb_emit_op (mb, 40, target_method);
      <D.24599>:
      goto <D.24600>;
      <D.24596>:
      if (static_method_with_first_arg_bound != 0) goto <D.24601>; else goto <D.24602>;
      <D.24601>:
      local_target.129 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.129);
      D.24603 = invoke_sig->params[0];
      D.24604 = mono_type_is_reference (D.24603);
      if (D.24604 == 0) goto <D.24605>; else goto <D.24606>;
      <D.24605>:
      D.24603 = invoke_sig->params[0];
      D.24607 = mono_class_from_mono_type (D.24603);
      mono_mb_emit_op (mb, 165, D.24607);
      <D.24606>:
      <D.24602>:
      i = 0;
      goto <D.20473>;
      <D.20472>:
      D.24576 = i + 1;
      D.24577 = (unsigned int) D.24576;
      mono_mb_emit_ldarg (mb, D.24577);
      i = i + 1;
      <D.20473>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      if (D.24488 > i) goto <D.20472>; else goto <D.20474>;
      <D.20474>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, invoke_sig);
      <D.24600>:
      mono_mb_emit_byte (mb, 42);
      mb->skip_visibility = 1;
      if (ctx != 0B) goto <D.24608>; else goto <D.24609>;
      <D.24608>:
      {
        struct MonoMethod * def;

        D.24426 = method->klass;
        D.24477 = sig->param_count;
        D.24488 = (int) D.24477;
        D.24610 = D.24488 + 16;
        def = mono_mb_create_and_cache (cache, D.24426, mb, sig, D.24610);
        res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
      }
      goto <D.24611>;
      <D.24609>:
      if (static_method_with_first_arg_bound != 0) goto <D.24612>; else goto <D.24613>;
      <D.24612>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      D.24610 = D.24488 + 16;
      res = mono_mb_create_and_cache (cache, invoke_sig, mb, sig, D.24610);
      info = mono_wrapper_info_create (res, 23);
      mono_marshal_set_wrapper_info (res, info);
      goto <D.24614>;
      <D.24613>:
      if (callvirt != 0) goto <D.24615>; else goto <D.24616>;
      <D.24615>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      D.24610 = D.24488 + 16;
      newm = mono_mb_create_method (mb, sig, D.24610);
      mono_memory_barrier ();
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24617>; else goto <D.24618>;
        <D.24617>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.24618>:
        D.24619 = ret != 0;
        D.24620 = (long int) D.24619;
        D.24621 = __builtin_expect (D.24620, 0);
        if (D.24621 != 0) goto <D.24622>; else goto <D.24623>;
        <D.24622>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4432, "ret == 0");
        <D.24623>:
      }
      res = monoeg_g_hash_table_lookup (cache, &key);
      if (res == 0B) goto <D.24624>; else goto <D.24625>;
      <D.24624>:
      res = newm;
      new_key = monoeg_malloc0 (16);
      *new_key = key;
      if (static_method_with_first_arg_bound != 0) goto <D.24626>; else goto <D.24627>;
      <D.24626>:
      D.24398 = del->method;
      D.24628 = D.24398->klass;
      D.24629 = D.24628->image;
      D.24630 = key.sig;
      D.24631 = signature_dup (D.24629, D.24630);
      new_key->sig = D.24631;
      <D.24627>:
      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.24632>; else goto <D.24633>;
        <D.24632>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24633>:
        D.24634 = ret != 0;
        D.24635 = (long int) D.24634;
        D.24636 = __builtin_expect (D.24635, 0);
        if (D.24636 != 0) goto <D.24637>; else goto <D.24638>;
        <D.24637>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4445, "ret == 0");
        <D.24638>:
      }
      goto <D.24639>;
      <D.24625>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24640>; else goto <D.24641>;
        <D.24640>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24641>:
        D.24642 = ret != 0;
        D.24643 = (long int) D.24642;
        D.24644 = __builtin_expect (D.24643, 0);
        if (D.24644 != 0) goto <D.24645>; else goto <D.24646>;
        <D.24645>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4447, "ret == 0");
        <D.24646>:
      }
      mono_free_method (newm);
      <D.24639>:
      goto <D.24647>;
      <D.24616>:
      D.24477 = sig->param_count;
      D.24488 = (int) D.24477;
      D.24610 = D.24488 + 16;
      res = mono_mb_create_and_cache (cache, sig, mb, sig, D.24610);
      info = mono_wrapper_info_create (res, 0);
      mono_marshal_set_wrapper_info (res, info);
      <D.24647>:
      <D.24614>:
      <D.24611>:
      mono_mb_free (mb);
      D.24522 = res;
      return D.24522;
    }
  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.24650;
  int iftmp.130;
  struct MonoMethodSignature * D.24654;
  struct MonoMethodSignature * D.24655;
  int D.24656;
  struct MonoMethod * D.24658;
  struct MonoMethod * D.24659;

  D.24654 = pair1->sig;
  D.24655 = pair2->sig;
  D.24656 = mono_metadata_signature_equal (D.24654, D.24655);
  if (D.24656 != 0) goto <D.24657>; else goto <D.24652>;
  <D.24657>:
  D.24658 = pair1->method;
  D.24659 = pair2->method;
  if (D.24658 == D.24659) goto <D.24660>; else goto <D.24652>;
  <D.24660>:
  iftmp.130 = 1;
  goto <D.24653>;
  <D.24652>:
  iftmp.130 = 0;
  <D.24653>:
  D.24650 = iftmp.130;
  return D.24650;
}


signature_method_pair_hash (const void * data)
{
  guint D.24662;
  struct MonoMethodSignature * D.24663;
  unsigned int D.24664;
  struct MonoMethod * D.24665;
  unsigned int D.24666;
  struct SignatureMethodPair * pair;

  pair = data;
  D.24663 = pair->sig;
  D.24664 = mono_signature_hash (D.24663);
  D.24665 = pair->method;
  D.24666 = mono_aligned_addr_hash (D.24665);
  D.24662 = D.24664 ^ D.24666;
  return D.24662;
}


mono_wrapper_info_create (struct MonoMethod * wrapper, WrapperSubtype subtype)
{
  struct MonoClass * D.24668;
  struct MonoImage * D.24669;
  struct WrapperInfo * D.24670;
  struct WrapperInfo * info;

  D.24668 = wrapper->klass;
  D.24669 = D.24668->image;
  info = mono_image_alloc0 (D.24669, 24);
  info->subtype = subtype;
  D.24670 = info;
  return D.24670;
}


mono_marshal_get_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.24672;
  struct MonoMethodSignature * D.24675;
  struct MonoMethodSignature * sig;

  D.24672 = mono_method_signature (method);
  sig = lookup_string_ctor_signature (D.24672);
  if (sig == 0B) goto <D.24673>; else goto <D.24674>;
  <D.24673>:
  sig = add_string_ctor_signature (method);
  <D.24674>:
  D.24675 = sig;
  return D.24675;
}


lookup_string_ctor_signature (struct MonoMethodSignature * sig)
{
  _Bool D.24679;
  long int D.24680;
  long int D.24681;
  struct MonoMethodSignature * D.24684;
  int D.24685;
  _Bool D.24690;
  long int D.24691;
  long int D.24692;
  struct MonoMethodSignature * D.24695;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;
  struct GSList * item;

  {
    int ret;

    ret = pthread_mutex_lock (&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_lock 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", 4498, "ret == 0");
    <D.24683>:
  }
  callsig = 0B;
  item = strsig_list;
  goto <D.20503>;
  <D.20502>:
  cs = item->data;
  D.24684 = cs->ctor_sig;
  D.24685 = mono_metadata_signature_equal (sig, D.24684);
  if (D.24685 != 0) goto <D.24686>; else goto <D.24687>;
  <D.24686>:
  callsig = cs->sig;
  goto <D.20501>;
  <D.24687>:
  item = item->next;
  <D.20503>:
  if (item != 0B) goto <D.20502>; else goto <D.20501>;
  <D.20501>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24688>; else goto <D.24689>;
    <D.24688>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24689>:
    D.24690 = ret != 0;
    D.24691 = (long int) D.24690;
    D.24692 = __builtin_expect (D.24691, 0);
    if (D.24692 != 0) goto <D.24693>; else goto <D.24694>;
    <D.24693>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4510, "ret == 0");
    <D.24694>:
  }
  D.24695 = callsig;
  return D.24695;
}


add_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoClass * D.24697;
  struct MonoImage * D.24698;
  struct MonoMethodSignature * D.24699;
  struct MonoClass * D.24700;
  struct MonoType * D.24701;
  struct MonoMethodSignature * D.24702;
  _Bool D.24705;
  long int D.24706;
  long int D.24707;
  struct GSList * strsig_list.131;
  struct GSList * strsig_list.132;
  _Bool D.24714;
  long int D.24715;
  long int D.24716;
  struct MonoMethodSignature * D.24719;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;

  D.24697 = method->klass;
  D.24698 = D.24697->image;
  D.24699 = mono_method_signature (method);
  callsig = signature_dup (D.24698, D.24699);
  D.24700 = mono_defaults.string_class;
  D.24701 = &D.24700->byval_arg;
  callsig->ret = D.24701;
  cs = monoeg_malloc (16);
  cs->sig = callsig;
  D.24702 = mono_method_signature (method);
  cs->ctor_sig = D.24702;
  {
    int ret;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24712>; else goto <D.24713>;
    <D.24712>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24713>:
    D.24714 = ret != 0;
    D.24715 = (long int) D.24714;
    D.24716 = __builtin_expect (D.24715, 0);
    if (D.24716 != 0) goto <D.24717>; else goto <D.24718>;
    <D.24717>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4528, "ret == 0");
    <D.24718>:
  }
  D.24719 = callsig;
  return D.24719;
}


mono_marshal_get_runtime_invoke (struct MonoMethod * method, gboolean virtual)
{
  _Bool D.24721;
  long int D.24722;
  long int D.24723;
  struct MonoMethodSignature * cctor_signature.133;
  struct MonoImage * D.24729;
  struct MonoMethodSignature * cctor_signature.134;
  struct MonoClass * D.24731;
  struct MonoType * D.24732;
  struct MonoMethodSignature * finalize_signature.135;
  struct MonoMethodSignature * finalize_signature.136;
  struct MonoClass * D.24741;
  struct MonoImage * D.24742;
  struct GHashTable * * D.24743;
  struct GHashTable * * D.24745;
  struct MonoMethod * D.24748;
  unsigned char D.24749;
  short unsigned int D.24752;
  unsigned int D.24753;
  unsigned int D.24754;
  long unsigned int D.24757;
  long unsigned int D.24758;
  struct MonoMethodSignature * D.24761;
  long unsigned int D.24765;
  struct MonoMethodSignature * D.24768;
  int D.24770;
  int D.24774;
  long unsigned int D.24782;
  long unsigned int D.24783;
  struct MonoMethodSignature * D.24785;
  long unsigned int D.24786;
  long unsigned int D.24787;
  struct MonoImage * D.24789;
  struct GHashTable * * D.24790;
  struct GHashTable * * D.24791;
  _Bool D.24794;
  long int D.24795;
  long int D.24796;
  _Bool D.24801;
  long int D.24802;
  long int D.24803;
  struct MonoClass * D.24808;
  struct MonoType * D.24809;
  struct MonoMethodSignature * D.24813;
  long unsigned int D.24814;
  long unsigned int D.24815;
  struct MonoType * D.24817;
  struct MonoType * D.24818;
  struct MonoClass * D.24819;
  struct MonoType * D.24820;
  const char * iftmp.137;
  short unsigned int D.24827;
  int D.24828;
  int D.24829;
  WrapperSubtype iftmp.138;
  _Bool D.24837;
  long int D.24838;
  long int D.24839;
  _Bool D.24844;
  long int D.24845;
  long int D.24846;
  _Bool D.24853;
  long int D.24854;
  long int D.24855;
  struct GHashTable * D.24860;
  _Bool D.24864;
  long int D.24865;
  long int D.24866;
  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.24721 = method == 0B;
      D.24722 = (long int) D.24721;
      D.24723 = __builtin_expect (D.24722, 0);
      if (D.24723 != 0) goto <D.24724>; else goto <D.24725>;
      <D.24724>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4932, "method");
      <D.24725>:
      cctor_signature.133 = cctor_signature;
      if (cctor_signature.133 == 0B) goto <D.24727>; else goto <D.24728>;
      <D.24727>:
      D.24729 = mono_defaults.corlib;
      cctor_signature.134 = mono_metadata_signature_alloc (D.24729, 0);
      cctor_signature = cctor_signature.134;
      cctor_signature.133 = cctor_signature;
      D.24731 = mono_defaults.void_class;
      D.24732 = &D.24731->byval_arg;
      cctor_signature.133->ret = D.24732;
      <D.24728>:
      finalize_signature.135 = finalize_signature;
      if (finalize_signature.135 == 0B) goto <D.24734>; else goto <D.24735>;
      <D.24734>:
      D.24729 = mono_defaults.corlib;
      finalize_signature.136 = mono_metadata_signature_alloc (D.24729, 0);
      finalize_signature = finalize_signature.136;
      finalize_signature.135 = finalize_signature;
      D.24731 = mono_defaults.void_class;
      D.24732 = &D.24731->byval_arg;
      finalize_signature.135->ret = D.24732;
      finalize_signature.135 = finalize_signature;
      finalize_signature.135->hasthis = 1;
      <D.24735>:
      if (virtual != 0) goto <D.24737>; else goto <D.24738>;
      <D.24737>:
      need_direct_wrapper = 1;
      <D.24738>:
      if (virtual != 0) goto <D.24739>; else goto <D.24740>;
      <D.24739>:
      D.24741 = method->klass;
      D.24742 = D.24741->image;
      D.24743 = &D.24742->runtime_invoke_vcall_cache;
      cache = get_cache (D.24743, mono_aligned_addr_hash, 0B);
      goto <D.24744>;
      <D.24740>:
      D.24741 = method->klass;
      D.24742 = D.24741->image;
      D.24745 = &D.24742->runtime_invoke_direct_cache;
      cache = get_cache (D.24745, mono_aligned_addr_hash, 0B);
      <D.24744>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.24746>; else goto <D.24747>;
      <D.24746>:
      D.24748 = res;
      return D.24748;
      <D.24747>:
      D.24741 = method->klass;
      D.24749 = D.24741->rank;
      if (D.24749 != 0) goto <D.24750>; else goto <D.24751>;
      <D.24750>:
      D.24752 = method->iflags;
      D.24753 = (unsigned int) D.24752;
      D.24754 = D.24753 & 4097;
      if (D.24754 == 4097) goto <D.24755>; else goto <D.24756>;
      <D.24755>:
      need_direct_wrapper = 1;
      <D.24756>:
      <D.24751>:
      D.24757 = BIT_FIELD_REF <*method, 64, 256>;
      D.24758 = D.24757 & 128;
      if (D.24758 != 0) goto <D.24759>; else goto <D.24760>;
      <D.24759>:
      D.24761 = mono_method_signature (method);
      callsig = lookup_string_ctor_signature (D.24761);
      if (callsig == 0B) goto <D.24762>; else goto <D.24763>;
      <D.24762>:
      callsig = add_string_ctor_signature (method);
      <D.24763>:
      need_direct_wrapper = 1;
      goto <D.24764>;
      <D.24760>:
      D.24757 = BIT_FIELD_REF <*method, 64, 256>;
      D.24765 = D.24757 & 512;
      if (D.24765 != 0) goto <D.24766>; else goto <D.24767>;
      <D.24766>:
      D.24741 = method->klass;
      D.24742 = D.24741->image;
      D.24768 = mono_method_signature (method);
      callsig = signature_dup (D.24742, D.24768);
      goto <D.24769>;
      <D.24767>:
      callsig = mono_method_signature (method);
      <D.24769>:
      <D.24764>:
      D.24741 = method->klass;
      D.24742 = D.24741->image;
      target_klass = get_wrapper_target_class (D.24742);
      cctor_signature.133 = cctor_signature;
      D.24770 = mono_metadata_signature_equal (callsig, cctor_signature.133);
      if (D.24770 != 0) goto <D.24771>; else goto <D.24772>;
      <D.24771>:
      callsig = cctor_signature;
      target_klass = mono_defaults.object_class;
      goto <D.24773>;
      <D.24772>:
      finalize_signature.135 = finalize_signature;
      D.24774 = mono_metadata_signature_equal (callsig, finalize_signature.135);
      if (D.24774 != 0) goto <D.24775>; else goto <D.24776>;
      <D.24775>:
      callsig = finalize_signature;
      target_klass = mono_defaults.object_class;
      <D.24776>:
      <D.24773>:
      if (need_direct_wrapper != 0) goto <D.24777>; else goto <D.24778>;
      <D.24777>:
      goto <D.24779>;
      <D.24778>:
      {
        struct MonoMethodSignature * tmp_sig;

        callsig = mono_marshal_get_runtime_invoke_sig (callsig);
        D.24741 = method->klass;
        D.24782 = BIT_FIELD_REF <*D.24741, 64, 256>;
        D.24783 = D.24782 & 8;
        if (D.24783 != 0) goto <D.24784>; else goto <D.24780>;
        <D.24784>:
        D.24785 = mono_method_signature (method);
        D.24786 = BIT_FIELD_REF <*D.24785, 64, 64>;
        D.24787 = D.24786 & 18014398509481984;
        if (D.24787 != 0) goto <D.24788>; else goto <D.24780>;
        <D.24788>:
        D.24789 = target_klass->image;
        D.24790 = &D.24789->runtime_invoke_vtype_cache;
        cache = get_cache (D.24790, mono_signature_hash, runtime_invoke_signature_equal);
        goto <D.24781>;
        <D.24780>:
        D.24789 = target_klass->image;
        D.24791 = &D.24789->runtime_invoke_cache;
        cache = get_cache (D.24791, mono_signature_hash, runtime_invoke_signature_equal);
        <D.24781>:
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24792>; else goto <D.24793>;
          <D.24792>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24793>:
          D.24794 = ret != 0;
          D.24795 = (long int) D.24794;
          D.24796 = __builtin_expect (D.24795, 0);
          if (D.24796 != 0) goto <D.24797>; else goto <D.24798>;
          <D.24797>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5010, "ret == 0");
          <D.24798>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24799>; else goto <D.24800>;
          <D.24799>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24800>:
          D.24801 = ret != 0;
          D.24802 = (long int) D.24801;
          D.24803 = __builtin_expect (D.24802, 0);
          if (D.24803 != 0) goto <D.24804>; else goto <D.24805>;
          <D.24804>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5012, "ret == 0");
          <D.24805>:
        }
        if (res != 0B) goto <D.24806>; else goto <D.24807>;
        <D.24806>:
        monoeg_g_free (callsig);
        D.24748 = res;
        return D.24748;
        <D.24807>:
        tmp_sig = callsig;
        D.24789 = target_klass->image;
        callsig = mono_metadata_signature_dup_full (D.24789, callsig);
        monoeg_g_free (tmp_sig);
      }
      <D.24779>:
      sig = mono_method_signature (method);
      D.24789 = target_klass->image;
      csig = mono_metadata_signature_alloc (D.24789, 4);
      D.24808 = mono_defaults.object_class;
      D.24809 = &D.24808->byval_arg;
      csig->ret = D.24809;
      D.24741 = method->klass;
      D.24782 = BIT_FIELD_REF <*D.24741, 64, 256>;
      D.24783 = D.24782 & 8;
      if (D.24783 != 0) goto <D.24812>; else goto <D.24810>;
      <D.24812>:
      D.24813 = mono_method_signature (method);
      D.24814 = BIT_FIELD_REF <*D.24813, 64, 64>;
      D.24815 = D.24814 & 18014398509481984;
      if (D.24815 != 0) goto <D.24816>; else goto <D.24810>;
      <D.24816>:
      D.24741 = method->klass;
      D.24817 = &D.24741->this_arg;
      D.24818 = get_runtime_invoke_type (D.24817, 0);
      csig->params[0] = D.24818;
      goto <D.24811>;
      <D.24810>:
      D.24808 = mono_defaults.object_class;
      D.24809 = &D.24808->byval_arg;
      csig->params[0] = D.24809;
      <D.24811>:
      D.24819 = mono_defaults.int_class;
      D.24820 = &D.24819->byval_arg;
      csig->params[1] = D.24820;
      D.24819 = mono_defaults.int_class;
      D.24820 = &D.24819->byval_arg;
      csig->params[2] = D.24820;
      D.24819 = mono_defaults.int_class;
      D.24820 = &D.24819->byval_arg;
      csig->params[3] = D.24820;
      csig->pinvoke = 1;
      if (virtual != 0) goto <D.24822>; else goto <D.24823>;
      <D.24822>:
      iftmp.137 = "runtime_invoke_virtual";
      goto <D.24824>;
      <D.24823>:
      iftmp.137 = "runtime_invoke";
      <D.24824>:
      name = mono_signature_to_name (callsig, iftmp.137);
      mb = mono_mb_new (target_klass, name, 4);
      monoeg_g_free (name);
      param_names[0] = "this";
      param_names[1] = "params";
      param_names[2] = "exc";
      param_names[3] = "method";
      mono_mb_set_param_names (mb, &param_names);
      emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper);
      if (need_direct_wrapper != 0) goto <D.24825>; else goto <D.24826>;
      <D.24825>:
      mb->skip_visibility = 1;
      D.24827 = sig->param_count;
      D.24828 = (int) D.24827;
      D.24829 = D.24828 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.24829);
      if (virtual != 0) goto <D.24831>; else goto <D.24832>;
      <D.24831>:
      iftmp.138 = 14;
      goto <D.24833>;
      <D.24832>:
      iftmp.138 = 13;
      <D.24833>:
      info = mono_wrapper_info_create (res, iftmp.138);
      info->d.runtime_invoke.method = method;
      mono_marshal_set_wrapper_info (res, info);
      goto <D.24834>;
      <D.24826>:
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24835>; else goto <D.24836>;
        <D.24835>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.24836>:
        D.24837 = ret != 0;
        D.24838 = (long int) D.24837;
        D.24839 = __builtin_expect (D.24838, 0);
        if (D.24839 != 0) goto <D.24840>; else goto <D.24841>;
        <D.24840>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5067, "ret == 0");
        <D.24841>:
      }
      res = monoeg_g_hash_table_lookup (cache, callsig);
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.24842>; else goto <D.24843>;
        <D.24842>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.24843>:
        D.24844 = ret != 0;
        D.24845 = (long int) D.24844;
        D.24846 = __builtin_expect (D.24845, 0);
        if (D.24846 != 0) goto <D.24847>; else goto <D.24848>;
        <D.24847>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5069, "ret == 0");
        <D.24848>:
      }
      if (res == 0B) goto <D.24849>; else goto <D.24850>;
      <D.24849>:
      {
        struct MonoMethod * newm;

        D.24827 = sig->param_count;
        D.24828 = (int) D.24827;
        D.24829 = D.24828 + 16;
        newm = mono_mb_create_method (mb, csig, D.24829);
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24851>; else goto <D.24852>;
          <D.24851>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.24852>:
          D.24853 = ret != 0;
          D.24854 = (long int) D.24853;
          D.24855 = __builtin_expect (D.24854, 0);
          if (D.24855 != 0) goto <D.24856>; else goto <D.24857>;
          <D.24856>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5076, "ret == 0");
          <D.24857>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        if (res == 0B) goto <D.24858>; else goto <D.24859>;
        <D.24858>:
        res = newm;
        monoeg_g_hash_table_insert_replace (cache, callsig, res, 0);
        D.24741 = method->klass;
        D.24742 = D.24741->image;
        D.24860 = D.24742->runtime_invoke_direct_cache;
        monoeg_g_hash_table_insert_replace (D.24860, 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.24861>;
        <D.24859>:
        mono_free_method (newm);
        <D.24861>:
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.24862>; else goto <D.24863>;
          <D.24862>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.24863>:
          D.24864 = ret != 0;
          D.24865 = (long int) D.24864;
          D.24866 = __builtin_expect (D.24865, 0);
          if (D.24866 != 0) goto <D.24867>; else goto <D.24868>;
          <D.24867>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5089, "ret == 0");
          <D.24868>:
        }
      }
      <D.24850>:
      <D.24834>:
      mono_mb_free (mb);
      D.24748 = res;
      return D.24748;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


runtime_invoke_signature_equal (struct MonoMethodSignature * sig1, struct MonoMethodSignature * sig2)
{
  struct MonoType * D.24873;
  struct MonoType * D.24874;
  int D.24876;
  int D.24878;
  int D.24879;
  gboolean D.24881;

  D.24873 = sig1->ret;
  D.24874 = sig2->ret;
  if (D.24873 != D.24874) goto <D.24875>; else goto <D.24871>;
  <D.24875>:
  D.24873 = sig1->ret;
  D.24876 = mono_type_is_reference (D.24873);
  if (D.24876 == 0) goto <D.24872>; else goto <D.24877>;
  <D.24877>:
  D.24874 = sig2->ret;
  D.24878 = mono_type_is_reference (D.24874);
  if (D.24878 == 0) goto <D.24872>; else goto <D.24871>;
  <D.24872>:
  D.24873 = sig1->ret;
  D.24874 = sig2->ret;
  D.24879 = mono_metadata_type_equal (D.24873, D.24874);
  if (D.24879 == 0) goto <D.24880>; else goto <D.24871>;
  <D.24880>:
  D.24881 = 0;
  return D.24881;
  <D.24871>:
  D.24881 = mono_metadata_signature_equal (sig1, sig2);
  return D.24881;
}


mono_marshal_get_runtime_invoke_sig (struct MonoMethodSignature * sig)
{
  struct MonoType * D.24883;
  struct MonoType * D.24884;
  struct MonoType * D.24885;
  struct MonoType * D.24886;
  short unsigned int D.24887;
  int D.24888;
  struct MonoMethodSignature * D.24889;
  struct MonoMethodSignature * res;
  int i;

  res = mono_metadata_signature_dup (sig);
  D.24883 = sig->ret;
  D.24884 = get_runtime_invoke_type (D.24883, 1);
  res->ret = D.24884;
  i = 0;
  goto <D.20534>;
  <D.20533>:
  D.24885 = sig->params[i];
  D.24886 = get_runtime_invoke_type (D.24885, 0);
  res->params[i] = D.24886;
  i = i + 1;
  <D.20534>:
  D.24887 = res->param_count;
  D.24888 = (int) D.24887;
  if (D.24888 > i) goto <D.20533>; else goto <D.20535>;
  <D.20535>:
  D.24889 = res;
  return D.24889;
}


get_runtime_invoke_type (struct MonoType * t, gboolean ret)
{
  long unsigned int D.24891;
  long unsigned int D.24892;
  unsigned char D.24895;
  struct MonoClass * D.24898;
  int D.24899;
  struct MonoType * D.24902;
  struct MonoClass * D.24903;
  int D.24904;
  struct MonoClass * D.24907;
  int D.24910;
  struct MonoClass * D.24911;
  struct MonoClass * D.24912;
  struct MonoClass * D.24913;
  struct MonoClass * D.24914;
  long unsigned int D.24915;
  long unsigned int D.24916;
  void handle_enum = <<< error >>>;

  D.24891 = BIT_FIELD_REF <*t, 64, 64>;
  D.24892 = D.24891 & 1073741824;
  if (D.24892 != 0) goto <D.24893>; else goto <D.24894>;
  <D.24893>:
  D.24895 = t->type;
  if (D.24895 == 21) goto <D.24896>; else goto <D.24897>;
  <D.24896>:
  D.24898 = mono_class_from_mono_type (t);
  D.24899 = mono_class_is_nullable (D.24898);
  if (D.24899 != 0) goto <D.24900>; else goto <D.24901>;
  <D.24900>:
  D.24902 = t;
  return D.24902;
  <D.24901>:
  <D.24897>:
  D.24903 = mono_defaults.int_class;
  D.24902 = &D.24903->this_arg;
  return D.24902;
  <D.24894>:
  D.24904 = mono_type_is_reference (t);
  if (D.24904 != 0) goto <D.24905>; else goto <D.24906>;
  <D.24905>:
  D.24907 = mono_defaults.object_class;
  D.24902 = &D.24907->byval_arg;
  return D.24902;
  <D.24906>:
  if (ret != 0) goto <D.24908>; else goto <D.24909>;
  <D.24908>:
  D.24902 = t;
  return D.24902;
  <D.24909>:
  handle_enum:
  D.24895 = t->type;
  D.24910 = (int) D.24895;
  switch (D.24910) <default: <D.20527>, case 2: <D.20522>, case 3: <D.20523>, case 11: <D.20521>, case 15: <D.20525>, case 17: <D.20526>, case 25: <D.20524>>
  <D.20521>:
  D.24911 = mono_defaults.int64_class;
  D.24902 = &D.24911->byval_arg;
  return D.24902;
  <D.20522>:
  D.24912 = mono_defaults.byte_class;
  D.24902 = &D.24912->byval_arg;
  return D.24902;
  <D.20523>:
  D.24913 = mono_defaults.uint16_class;
  D.24902 = &D.24913->byval_arg;
  return D.24902;
  <D.20524>:
  <D.20525>:
  D.24903 = mono_defaults.int_class;
  D.24902 = &D.24903->byval_arg;
  return D.24902;
  <D.20526>:
  D.24914 = t->data.klass;
  D.24915 = BIT_FIELD_REF <*D.24914, 64, 256>;
  D.24916 = D.24915 & 16;
  if (D.24916 != 0) goto <D.24917>; else goto <D.24918>;
  <D.24917>:
  D.24914 = t->data.klass;
  t = mono_class_enum_basetype (D.24914);
  goto handle_enum;
  <D.24918>:
  D.24902 = t;
  return D.24902;
  <D.20527>:
  D.24902 = t;
  return D.24902;
}


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.24920;
  struct MonoType * D.24921;
  unsigned int D.24922;
  int D.24923;
  int D.24924;
  unsigned int D.24925;
  int D.24926;
  struct MonoImage * D.24927;
  struct MonoClass * D.24928;
  int D.24929;
  unsigned int D.24930;
  int D.24931;
  int D.24932;
  unsigned int D.24933;
  int D.24934;
  unsigned int D.24935;
  unsigned int loc_exc.139;
  int D.24937;
  unsigned int D.24938;
  unsigned int D.24939;
  unsigned int D.24940;
  int D.24941;
  unsigned int D.24942;
  unsigned int loc_res.140;
  int D.24944;
  unsigned int D.24945;
  gint32 labels[16];
  struct MonoExceptionClause * clause;
  int loc_res;
  int loc_exc;

  try
    {
      D.24920 = mono_defaults.object_class;
      D.24921 = &D.24920->byval_arg;
      loc_res = mono_mb_add_local (mb, D.24921);
      D.24920 = mono_defaults.object_class;
      D.24921 = &D.24920->byval_arg;
      loc_exc = mono_mb_add_local (mb, D.24921);
      mono_mb_emit_byte (mb, 4);
      D.24922 = mono_mb_emit_branch (mb, 57);
      D.24923 = (int) D.24922;
      labels[0] = D.24923;
      D.24924 = mono_mb_get_label (mb);
      labels[1] = D.24924;
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      D.24925 = mono_mb_emit_branch (mb, 221);
      D.24926 = (int) D.24925;
      labels[2] = D.24926;
      D.24927 = target_klass->image;
      clause = mono_image_alloc0 (D.24927, 32);
      clause->flags = 0;
      D.24928 = mono_defaults.exception_class;
      clause->data.catch_class = D.24928;
      D.24929 = labels[1];
      D.24930 = (unsigned int) D.24929;
      clause->try_offset = D.24930;
      D.24931 = mono_mb_get_label (mb);
      D.24929 = labels[1];
      D.24932 = D.24931 - D.24929;
      D.24933 = (unsigned int) D.24932;
      clause->try_len = D.24933;
      D.24934 = mono_mb_get_label (mb);
      D.24935 = (unsigned int) D.24934;
      clause->handler_offset = D.24935;
      loc_exc.139 = (unsigned int) loc_exc;
      mono_mb_emit_stloc (mb, loc_exc.139);
      mono_mb_emit_byte (mb, 4);
      loc_exc.139 = (unsigned int) loc_exc;
      mono_mb_emit_ldloc (mb, loc_exc.139);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_branch (mb, 221);
      D.24937 = mono_mb_get_pos (mb);
      D.24938 = (unsigned int) D.24937;
      D.24939 = clause->handler_offset;
      D.24940 = D.24938 - D.24939;
      clause->handler_len = D.24940;
      mono_mb_set_clauses (mb, 1, clause);
      D.24941 = labels[2];
      D.24942 = (unsigned int) D.24941;
      mono_mb_patch_branch (mb, D.24942);
      loc_res.140 = (unsigned int) loc_res;
      mono_mb_emit_ldloc (mb, loc_res.140);
      mono_mb_emit_byte (mb, 42);
      D.24944 = labels[0];
      D.24945 = (unsigned int) D.24944;
      mono_mb_patch_branch (mb, D.24945);
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 42);
    }
  finally
    {
      labels = {CLOBBER};
    }
}


emit_invoke_call (struct MonoMethodBuilder * mb, struct MonoMethod * method, struct MonoMethodSignature * sig, struct MonoMethodSignature * callsig, int loc_res, gboolean virtual, gboolean need_direct_wrapper)
{
  struct MonoString * string_dummy.141;
  void * D.24951;
  struct MonoString * string_dummy.142;
  long unsigned int D.24955;
  long unsigned int D.24956;
  _Bool D.24957;
  long int D.24958;
  long int D.24959;
  short unsigned int D.24962;
  int D.24963;
  int D.24964;
  _Bool D.24965;
  long int D.24966;
  long int D.24967;
  long unsigned int D.24972;
  long unsigned int D.24973;
  int D.24976;
  short unsigned int D.24981;
  long unsigned int D.24982;
  long unsigned int D.24983;
  unsigned int i.143;
  unsigned int D.24987;
  int D.24988;
  long unsigned int D.24989;
  long unsigned int D.24990;
  unsigned char D.24993;
  struct MonoClass * D.24996;
  int D.24997;
  long unsigned int D.25000;
  long unsigned int D.25001;
  int * D.25002;
  struct MonoClass * D.25003;
  struct MonoType * D.25004;
  int D.25005;
  struct MonoClass * D.25006;
  int D.25007;
  unsigned int D.25008;
  struct MonoType * D.25009;
  unsigned char D.25010;
  unsigned int D.25011;
  unsigned char D.25012;
  unsigned int D.25013;
  unsigned char D.25014;
  int D.25015;
  unsigned int D.25018;
  unsigned char D.25019;
  struct MonoClass * D.25022;
  long unsigned int D.25023;
  long unsigned int D.25024;
  struct MonoType * D.25027;
  unsigned char D.25028;
  struct MonoClass * D.25029;
  int D.25030;
  struct MonoClass * D.25033;
  struct MonoClass * D.25034;
  struct MonoClass * D.25036;
  int D.25037;
  struct MonoType * D.25044;
  long unsigned int D.25045;
  long unsigned int D.25046;
  unsigned char D.25049;
  int D.25050;
  struct MonoClass * D.25053;
  struct MonoClass * D.25054;
  unsigned int loc_res.144;
  long unsigned int D.25058;
  long unsigned int D.25059;
  struct MonoClass * D.25062;
  int D.25063;
  struct MonoClass * D.25066;
  static struct MonoString * string_dummy = 0B;
  int i;
  int * tmp_nullable_locals;
  gboolean void_ret;
  void handle_enum = <<< error >>>;

  void_ret = 0;
  string_dummy.141 = string_dummy;
  if (string_dummy.141 == 0B) goto <D.24947>; else goto <D.24948>;
  <D.24947>:
  if (0 != 0) goto <D.24949>; else goto <D.24950>;
  <D.24949>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4644, "sizeof (string_dummy) == sizeof (MonoObject*)");
  <D.24950>:
  D.24951 = mono_gc_make_root_descr_all_refs (1);
  mono_gc_register_root (&string_dummy, 8, D.24951);
  string_dummy.142 = mono_string_new_wrapper ("dummy");
  string_dummy = string_dummy.142;
  <D.24948>:
  if (virtual != 0) goto <D.24953>; else goto <D.24954>;
  <D.24953>:
  D.24955 = BIT_FIELD_REF <*sig, 64, 64>;
  D.24956 = D.24955 & 18014398509481984;
  D.24957 = D.24956 == 0;
  D.24958 = (long int) D.24957;
  D.24959 = __builtin_expect (D.24958, 0);
  if (D.24959 != 0) goto <D.24960>; else goto <D.24961>;
  <D.24960>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4649, "sig->hasthis");
  <D.24961>:
  D.24962 = method->flags;
  D.24963 = (int) D.24962;
  D.24964 = D.24963 & 64;
  D.24965 = D.24964 == 0;
  D.24966 = (long int) D.24965;
  D.24967 = __builtin_expect (D.24966, 0);
  if (D.24967 != 0) goto <D.24968>; else goto <D.24969>;
  <D.24968>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4650, "method->flags & METHOD_ATTRIBUTE_VIRTUAL");
  <D.24969>:
  <D.24954>:
  D.24955 = BIT_FIELD_REF <*sig, 64, 64>;
  D.24956 = D.24955 & 18014398509481984;
  if (D.24956 != 0) goto <D.24970>; else goto <D.24971>;
  <D.24970>:
  D.24972 = BIT_FIELD_REF <*method, 64, 256>;
  D.24973 = D.24972 & 128;
  if (D.24973 != 0) goto <D.24974>; else goto <D.24975>;
  <D.24974>:
  D.24976 = mono_gc_is_moving ();
  if (D.24976 != 0) goto <D.24977>; else goto <D.24978>;
  <D.24977>:
  mono_mb_emit_ptr (mb, &string_dummy);
  mono_mb_emit_byte (mb, 80);
  goto <D.24979>;
  <D.24978>:
  string_dummy.141 = string_dummy;
  mono_mb_emit_ptr (mb, string_dummy.141);
  <D.24979>:
  goto <D.24980>;
  <D.24975>:
  mono_mb_emit_ldarg (mb, 0);
  <D.24980>:
  <D.24971>:
  D.24981 = sig->param_count;
  D.24982 = (long unsigned int) D.24981;
  D.24983 = D.24982 * 4;
  tmp_nullable_locals = monoeg_malloc0 (D.24983);
  i = 0;
  goto <D.20582>;
  <D.20581>:
  {
    struct MonoType * t;
    int type;

    t = sig->params[i];
    mono_mb_emit_ldarg (mb, 1);
    if (i != 0) goto <D.24984>; else goto <D.24985>;
    <D.24984>:
    i.143 = (unsigned int) i;
    D.24987 = i.143 * 8;
    D.24988 = (int) D.24987;
    mono_mb_emit_icon (mb, D.24988);
    mono_mb_emit_byte (mb, 88);
    <D.24985>:
    D.24989 = BIT_FIELD_REF <*t, 64, 64>;
    D.24990 = D.24989 & 1073741824;
    if (D.24990 != 0) goto <D.24991>; else goto <D.24992>;
    <D.24991>:
    mono_mb_emit_byte (mb, 77);
    D.24993 = t->type;
    if (D.24993 == 21) goto <D.24994>; else goto <D.24995>;
    <D.24994>:
    D.24996 = mono_class_from_mono_type (t);
    D.24997 = mono_class_is_nullable (D.24996);
    if (D.24997 != 0) goto <D.24998>; else goto <D.24999>;
    <D.24998>:
    D.25000 = (long unsigned int) i;
    D.25001 = D.25000 * 4;
    D.25002 = tmp_nullable_locals + D.25001;
    D.25003 = mono_class_from_mono_type (t);
    D.25004 = &D.25003->byval_arg;
    D.25005 = mono_mb_add_local (mb, D.25004);
    *D.25002 = D.25005;
    D.25006 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 165, D.25006);
    D.25000 = (long unsigned int) i;
    D.25001 = D.25000 * 4;
    D.25002 = tmp_nullable_locals + D.25001;
    D.25007 = *D.25002;
    D.25008 = (unsigned int) D.25007;
    mono_mb_emit_stloc (mb, D.25008);
    D.25000 = (long unsigned int) i;
    D.25001 = D.25000 * 4;
    D.25002 = tmp_nullable_locals + D.25001;
    D.25007 = *D.25002;
    D.25008 = (unsigned int) D.25007;
    mono_mb_emit_ldloc_addr (mb, D.25008);
    <D.24999>:
    <D.24995>:
    // predicted unlikely by continue predictor.
    goto <D.20555>;
    <D.24992>:
    D.25009 = sig->params[i];
    D.25010 = D.25009->type;
    type = (int) D.25010;
    handle_enum:
    switch (type) <default: <D.20580>, case 2: <D.20558>, case 3: <D.20562>, case 4: <D.20557>, case 5: <D.20559>, case 6: <D.20560>, case 7: <D.20561>, case 8: <D.20565>, case 9: <D.20566>, case 10: <D.20569>, case 11: <D.20570>, case 12: <D.20567>, case 13: <D.20568>, case 14: <D.20572>, case 15: <D.20575>, case 17: <D.20579>, case 18: <D.20573>, case 20: <D.20574>, case 21: <D.20578>, case 24: <D.20563>, case 25: <D.20564>, case 28: <D.20577>, case 29: <D.20576>>
    <D.20557>:
    <D.20558>:
    <D.20559>:
    <D.20560>:
    <D.20561>:
    <D.20562>:
    <D.20563>:
    <D.20564>:
    <D.20565>:
    <D.20566>:
    <D.20567>:
    <D.20568>:
    <D.20569>:
    <D.20570>:
    mono_mb_emit_byte (mb, 77);
    D.25009 = sig->params[i];
    D.25011 = mono_type_to_ldind (D.25009);
    D.25012 = (unsigned char) D.25011;
    mono_mb_emit_byte (mb, D.25012);
    goto <D.20571>;
    <D.20572>:
    <D.20573>:
    <D.20574>:
    <D.20575>:
    <D.20576>:
    <D.20577>:
    D.25009 = sig->params[i];
    D.25013 = mono_type_to_ldind (D.25009);
    D.25014 = (unsigned char) D.25013;
    mono_mb_emit_byte (mb, D.25014);
    goto <D.20571>;
    <D.20578>:
    D.25009 = sig->params[i];
    D.25015 = mono_type_generic_inst_is_valuetype (D.25009);
    if (D.25015 == 0) goto <D.25016>; else goto <D.25017>;
    <D.25016>:
    D.25009 = sig->params[i];
    D.25018 = mono_type_to_ldind (D.25009);
    D.25019 = (unsigned char) D.25018;
    mono_mb_emit_byte (mb, D.25019);
    goto <D.20571>;
    <D.25017>:
    <D.20579>:
    if (type == 17) goto <D.25020>; else goto <D.25021>;
    <D.25020>:
    D.25022 = t->data.klass;
    D.25023 = BIT_FIELD_REF <*D.25022, 64, 256>;
    D.25024 = D.25023 & 16;
    if (D.25024 != 0) goto <D.25025>; else goto <D.25026>;
    <D.25025>:
    D.25022 = t->data.klass;
    D.25027 = mono_class_enum_basetype (D.25022);
    D.25028 = D.25027->type;
    type = (int) D.25028;
    goto handle_enum;
    <D.25026>:
    <D.25021>:
    mono_mb_emit_byte (mb, 77);
    D.25009 = sig->params[i];
    D.25029 = mono_class_from_mono_type (D.25009);
    D.25030 = mono_class_is_nullable (D.25029);
    if (D.25030 != 0) goto <D.25031>; else goto <D.25032>;
    <D.25031>:
    D.25009 = sig->params[i];
    D.25033 = mono_class_from_mono_type (D.25009);
    mono_mb_emit_op (mb, 121, D.25033);
    D.25009 = sig->params[i];
    D.25034 = mono_class_from_mono_type (D.25009);
    mono_mb_emit_op (mb, 113, D.25034);
    goto <D.25035>;
    <D.25032>:
    D.25009 = sig->params[i];
    D.25036 = mono_class_from_mono_type (D.25009);
    mono_mb_emit_op (mb, 113, D.25036);
    <D.25035>:
    goto <D.20571>;
    <D.20580>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4744);
    <D.20571>:
  }
  <D.20555>:
  i = i + 1;
  <D.20582>:
  D.24981 = sig->param_count;
  D.25037 = (int) D.24981;
  if (D.25037 > i) goto <D.20581>; else goto <D.20583>;
  <D.20583>:
  if (virtual != 0) goto <D.25038>; else goto <D.25039>;
  <D.25038>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.25040>;
  <D.25039>:
  if (need_direct_wrapper != 0) goto <D.25041>; else goto <D.25042>;
  <D.25041>:
  mono_mb_emit_op (mb, 40, method);
  goto <D.25043>;
  <D.25042>:
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_calli (mb, callsig);
  <D.25043>:
  <D.25040>:
  D.25044 = sig->ret;
  D.25045 = BIT_FIELD_REF <*D.25044, 64, 64>;
  D.25046 = D.25045 & 1073741824;
  if (D.25046 != 0) goto <D.25047>; else goto <D.25048>;
  <D.25047>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4759);
  <D.25048>:
  D.25044 = sig->ret;
  D.25049 = D.25044->type;
  D.25050 = (int) D.25049;
  switch (D.25050) <default: <D.20609>, case 1: <D.20584>, case 2: <D.20586>, case 3: <D.20587>, case 4: <D.20588>, case 5: <D.20589>, case 6: <D.20590>, case 7: <D.20591>, case 8: <D.20592>, case 9: <D.20593>, case 10: <D.20598>, case 11: <D.20599>, case 12: <D.20596>, case 13: <D.20597>, case 14: <D.20603>, case 15: <D.20608>, case 17: <D.20600>, case 18: <D.20604>, case 20: <D.20605>, case 21: <D.20602>, case 22: <D.20601>, case 24: <D.20594>, case 25: <D.20595>, case 28: <D.20607>, case 29: <D.20606>>
  <D.20584>:
  D.24972 = BIT_FIELD_REF <*method, 64, 256>;
  D.24973 = D.24972 & 128;
  if (D.24973 == 0) goto <D.25051>; else goto <D.25052>;
  <D.25051>:
  void_ret = 1;
  <D.25052>:
  goto <D.20585>;
  <D.20586>:
  <D.20587>:
  <D.20588>:
  <D.20589>:
  <D.20590>:
  <D.20591>:
  <D.20592>:
  <D.20593>:
  <D.20594>:
  <D.20595>:
  <D.20596>:
  <D.20597>:
  <D.20598>:
  <D.20599>:
  <D.20600>:
  <D.20601>:
  <D.20602>:
  D.25044 = sig->ret;
  D.25053 = mono_class_from_mono_type (D.25044);
  mono_mb_emit_op (mb, 140, D.25053);
  goto <D.20585>;
  <D.20603>:
  <D.20604>:
  <D.20605>:
  <D.20606>:
  <D.20607>:
  goto <D.20585>;
  <D.20608>:
  D.25054 = mono_defaults.int_class;
  mono_mb_emit_op (mb, 140, D.25054);
  goto <D.20585>;
  <D.20609>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4799);
  <D.20585>:
  if (void_ret == 0) goto <D.25055>; else goto <D.25056>;
  <D.25055>:
  loc_res.144 = (unsigned int) loc_res;
  mono_mb_emit_stloc (mb, loc_res.144);
  <D.25056>:
  i = 0;
  goto <D.20612>;
  <D.20611>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.25058 = BIT_FIELD_REF <*t, 64, 64>;
    D.25059 = D.25058 & 1090453504;
    if (D.25059 == 1075118080) goto <D.25060>; else goto <D.25061>;
    <D.25060>:
    D.25062 = mono_class_from_mono_type (t);
    D.25063 = mono_class_is_nullable (D.25062);
    if (D.25063 != 0) goto <D.25064>; else goto <D.25065>;
    <D.25064>:
    mono_mb_emit_ldarg (mb, 1);
    i.143 = (unsigned int) i;
    D.24987 = i.143 * 8;
    D.24988 = (int) D.24987;
    mono_mb_emit_icon (mb, D.24988);
    mono_mb_emit_byte (mb, 88);
    D.25000 = (long unsigned int) i;
    D.25001 = D.25000 * 4;
    D.25002 = tmp_nullable_locals + D.25001;
    D.25007 = *D.25002;
    D.25008 = (unsigned int) D.25007;
    mono_mb_emit_ldloc (mb, D.25008);
    D.25066 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 140, D.25066);
    mono_mb_emit_byte (mb, 81);
    <D.25065>:
    <D.25061>:
  }
  i = i + 1;
  <D.20612>:
  D.24981 = sig->param_count;
  D.25037 = (int) D.24981;
  if (D.25037 > i) goto <D.20611>; else goto <D.20613>;
  <D.20613>:
  monoeg_g_free (tmp_nullable_locals);
}


mono_marshal_get_runtime_invoke_dynamic ()
{
  struct MonoMethod * method.145;
  struct MonoMethod * D.25071;
  struct MonoImage * D.25072;
  struct MonoClass * D.25073;
  struct MonoType * D.25074;
  struct MonoClass * D.25075;
  struct MonoType * D.25076;
  struct MonoClass * D.25077;
  struct MonoType * D.25078;
  unsigned int D.25079;
  int D.25080;
  unsigned int D.25081;
  int D.25082;
  unsigned int D.25083;
  int D.25084;
  unsigned int D.25085;
  struct MonoClass * D.25086;
  unsigned int D.25087;
  unsigned int posna.146;
  int D.25089;
  unsigned int D.25090;
  unsigned int D.25091;
  unsigned int D.25092;
  unsigned int pos.147;
  _Bool D.25096;
  long int D.25097;
  long int D.25098;
  struct MonoMethod * method.148;
  _Bool D.25106;
  long int D.25107;
  long int D.25108;
  static struct MonoMethod * method;
  struct MonoMethodSignature * csig;
  struct MonoExceptionClause * clause;
  struct MonoMethodBuilder * mb;
  int pos;
  int posna;
  char * name;
  struct WrapperInfo * info;

  method.145 = method;
  if (method.145 != 0B) goto <D.25069>; else goto <D.25070>;
  <D.25069>:
  D.25071 = method;
  return D.25071;
  <D.25070>:
  D.25072 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.25072, 4);
  D.25073 = mono_defaults.void_class;
  D.25074 = &D.25073->byval_arg;
  csig->ret = D.25074;
  D.25075 = mono_defaults.int_class;
  D.25076 = &D.25075->byval_arg;
  csig->params[0] = D.25076;
  D.25075 = mono_defaults.int_class;
  D.25076 = &D.25075->byval_arg;
  csig->params[1] = D.25076;
  D.25075 = mono_defaults.int_class;
  D.25076 = &D.25075->byval_arg;
  csig->params[2] = D.25076;
  D.25075 = mono_defaults.int_class;
  D.25076 = &D.25075->byval_arg;
  csig->params[3] = D.25076;
  name = monoeg_strdup ("runtime_invoke_dynamic");
  D.25077 = mono_defaults.object_class;
  mb = mono_mb_new (D.25077, name, 4);
  monoeg_g_free (name);
  D.25077 = mono_defaults.object_class;
  D.25078 = &D.25077->byval_arg;
  mono_mb_add_local (mb, D.25078);
  D.25077 = mono_defaults.object_class;
  D.25078 = &D.25077->byval_arg;
  mono_mb_add_local (mb, D.25078);
  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.25079 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.25079;
  D.25072 = mono_defaults.corlib;
  clause = mono_image_alloc0 (D.25072, 32);
  clause->flags = 1;
  D.25080 = mono_mb_get_label (mb);
  D.25081 = (unsigned int) D.25080;
  clause->try_len = D.25081;
  D.25082 = mono_mb_get_label (mb);
  D.25083 = (unsigned int) D.25082;
  clause->data.filter_offset = D.25083;
  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.25084 = mono_mb_get_label (mb);
  D.25085 = (unsigned int) D.25084;
  clause->handler_offset = D.25085;
  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.25086 = mono_defaults.threadabortexception_class;
  mono_mb_emit_op (mb, 117, D.25086);
  D.25087 = mono_mb_emit_short_branch (mb, 44);
  posna = (int) D.25087;
  mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort);
  posna.146 = (unsigned int) posna;
  mono_mb_patch_short_branch (mb, posna.146);
  mono_mb_emit_branch (mb, 221);
  D.25089 = mono_mb_get_pos (mb);
  D.25090 = (unsigned int) D.25089;
  D.25091 = clause->handler_offset;
  D.25092 = D.25090 - D.25091;
  clause->handler_len = D.25092;
  mono_mb_set_clauses (mb, 1, clause);
  pos.147 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.147);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.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", 5213, "ret == 0");
    <D.25100>:
  }
  method.145 = method;
  if (method.145 == 0B) goto <D.25101>; else goto <D.25102>;
  <D.25101>:
  method.148 = mono_mb_create_method (mb, csig, 16);
  method = method.148;
  method.145 = method;
  info = mono_wrapper_info_create (method.145, 12);
  method.145 = method;
  mono_marshal_set_wrapper_info (method.145, info);
  <D.25102>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25104>; else goto <D.25105>;
    <D.25104>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25105>:
    D.25106 = ret != 0;
    D.25107 = (long int) D.25106;
    D.25108 = __builtin_expect (D.25107, 0);
    if (D.25108 != 0) goto <D.25109>; else goto <D.25110>;
    <D.25109>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5220, "ret == 0");
    <D.25110>:
  }
  mono_mb_free (mb);
  D.25071 = method;
  return D.25071;
}


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

  if (str != 0B) goto <D.25112>; else goto <D.25113>;
  <D.25112>:
  D.25114 = __strdup (str);
  return D.25114;
  <D.25113>:
  D.25114 = 0B;
  return D.25114;
}


mono_marshal_get_ldfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.25118;
  long int D.25119;
  long int D.25120;
  struct MonoMethod * cached.149;
  _Bool D.25128;
  long int D.25129;
  long int D.25130;
  struct MonoMethod * D.25133;
  _Bool D.25136;
  long int D.25137;
  long int D.25138;
  struct MonoClass * D.25141;
  struct MonoMethod * D.25142;
  struct MonoImage * D.25143;
  struct MonoType * D.25144;
  struct MonoClass * D.25145;
  struct MonoType * D.25146;
  _Bool D.25149;
  long int D.25150;
  long int D.25151;
  _Bool D.25156;
  long int D.25157;
  long int D.25158;
  _Bool D.25165;
  long int D.25166;
  long int D.25167;
  _Bool D.25174;
  long int D.25175;
  long int D.25176;
  _Bool D.25182;
  long int D.25183;
  long int D.25184;
  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.25116>; else goto <D.25117>;
    <D.25116>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25117>:
    D.25118 = ret != 0;
    D.25119 = (long int) D.25118;
    D.25120 = __builtin_expect (D.25119, 0);
    if (D.25120 != 0) goto <D.25121>; else goto <D.25122>;
    <D.25121>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5256, "ret == 0");
    <D.25122>:
  }
  cached.149 = cached;
  if (cached.149 != 0B) goto <D.25124>; else goto <D.25125>;
  <D.25124>:
  {
    int ret;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25134>; else goto <D.25135>;
    <D.25134>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25135>:
    D.25136 = ret != 0;
    D.25137 = (long int) D.25136;
    D.25138 = __builtin_expect (D.25137, 0);
    if (D.25138 != 0) goto <D.25139>; else goto <D.25140>;
    <D.25139>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5261, "ret == 0");
    <D.25140>:
  }
  D.25141 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.25141, "__mono_load_remote_field_new_wrapper", 14);
  D.25142 = mb->method;
  D.25142->save_lmf = 1;
  D.25143 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.25143, 3);
  D.25141 = mono_defaults.object_class;
  D.25144 = &D.25141->byval_arg;
  sig->params[0] = D.25144;
  D.25145 = mono_defaults.int_class;
  D.25146 = &D.25145->byval_arg;
  sig->params[1] = D.25146;
  D.25145 = mono_defaults.int_class;
  D.25146 = &D.25145->byval_arg;
  sig->params[2] = D.25146;
  D.25141 = mono_defaults.object_class;
  D.25144 = &D.25141->byval_arg;
  sig->ret = D.25144;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.25143 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.25143, 3);
  D.25141 = mono_defaults.object_class;
  D.25144 = &D.25141->byval_arg;
  csig->params[0] = D.25144;
  D.25145 = mono_defaults.int_class;
  D.25146 = &D.25145->byval_arg;
  csig->params[1] = D.25146;
  D.25145 = mono_defaults.int_class;
  D.25146 = &D.25145->byval_arg;
  csig->params[2] = D.25146;
  D.25141 = mono_defaults.object_class;
  D.25144 = &D.25141->byval_arg;
  csig->ret = D.25144;
  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.25147>; else goto <D.25148>;
    <D.25147>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25148>:
    D.25149 = ret != 0;
    D.25150 = (long int) D.25149;
    D.25151 = __builtin_expect (D.25150, 0);
    if (D.25151 != 0) goto <D.25152>; else goto <D.25153>;
    <D.25152>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5291, "ret == 0");
    <D.25153>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25154>; else goto <D.25155>;
    <D.25154>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25155>:
    D.25156 = ret != 0;
    D.25157 = (long int) D.25156;
    D.25158 = __builtin_expect (D.25157, 0);
    if (D.25158 != 0) goto <D.25159>; else goto <D.25160>;
    <D.25159>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5293, "ret == 0");
    <D.25160>:
  }
  if (res == 0B) goto <D.25161>; else goto <D.25162>;
  <D.25161>:
  {
    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.25163>; else goto <D.25164>;
      <D.25163>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.25164>:
      D.25165 = ret != 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", 5297, "ret == 0");
      <D.25169>:
    }
    res = cached;
    if (res == 0B) goto <D.25170>; else goto <D.25171>;
    <D.25170>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25172>; else goto <D.25173>;
      <D.25172>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25173>:
      D.25174 = ret != 0;
      D.25175 = (long int) D.25174;
      D.25176 = __builtin_expect (D.25175, 0);
      if (D.25176 != 0) goto <D.25177>; else goto <D.25178>;
      <D.25177>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5302, "ret == 0");
      <D.25178>:
    }
    goto <D.25179>;
    <D.25171>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25180>; else goto <D.25181>;
      <D.25180>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25181>:
      D.25182 = ret != 0;
      D.25183 = (long int) D.25182;
      D.25184 = __builtin_expect (D.25183, 0);
      if (D.25184 != 0) goto <D.25185>; else goto <D.25186>;
      <D.25185>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5304, "ret == 0");
      <D.25186>:
    }
    mono_free_method (newm);
    <D.25179>:
  }
  <D.25162>:
  mono_mb_free (mb);
  D.25133 = res;
  return D.25133;
}


mono_marshal_get_ldfld_wrapper (struct MonoType * type)
{
  unsigned char D.25188;
  long unsigned int D.25189;
  long unsigned int D.25190;
  int D.25210;
  struct MonoImage * D.25216;
  struct GHashTable * * D.25217;
  struct MonoMethod * D.25220;
  const char * D.25221;
  const char * D.25222;
  struct MonoClass * D.25223;
  struct MonoImage * D.25224;
  struct MonoType * D.25225;
  struct MonoClass * D.25226;
  struct MonoType * D.25227;
  struct MonoType * D.25228;
  struct MonoMethod * D.25229;
  long unsigned int D.25230;
  long unsigned int D.25231;
  unsigned int D.25234;
  unsigned int pos0.150;
  unsigned int pos1.151;
  unsigned int D.25240;
  unsigned char D.25241;
  long unsigned int D.25242;
  _Bool D.25243;
  long int D.25244;
  long int D.25245;
  int D.25248;
  int D.25252;
  short unsigned int D.25253;
  int D.25254;
  int D.25255;
  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.25188 = type->type;
  t = (int) D.25188;
  D.25189 = BIT_FIELD_REF <*type, 64, 64>;
  D.25190 = D.25189 & 1073741824;
  if (D.25190 == 0) goto <D.25191>; else goto <D.25192>;
  <D.25191>:
  D.25188 = type->type;
  if (D.25188 == 29) goto <D.25193>; else goto <D.25194>;
  <D.25193>:
  klass = mono_defaults.array_class;
  goto <D.25195>;
  <D.25194>:
  D.25188 = type->type;
  if (D.25188 == 17) goto <D.25196>; else goto <D.25197>;
  <D.25196>:
  klass = type->data.klass;
  goto <D.25198>;
  <D.25197>:
  if (t == 28) goto <D.25199>; else goto <D.25202>;
  <D.25202>:
  if (t == 18) goto <D.25199>; else goto <D.25203>;
  <D.25203>:
  if (t == 14) goto <D.25199>; else goto <D.25200>;
  <D.25199>:
  klass = mono_defaults.object_class;
  goto <D.25201>;
  <D.25200>:
  if (t == 15) goto <D.25204>; else goto <D.25207>;
  <D.25207>:
  if (t == 27) goto <D.25204>; else goto <D.25205>;
  <D.25204>:
  klass = mono_defaults.int_class;
  goto <D.25206>;
  <D.25205>:
  if (t == 21) goto <D.25208>; else goto <D.25209>;
  <D.25208>:
  D.25210 = mono_type_generic_inst_is_valuetype (type);
  if (D.25210 != 0) goto <D.25211>; else goto <D.25212>;
  <D.25211>:
  klass = mono_class_from_mono_type (type);
  goto <D.25213>;
  <D.25212>:
  klass = mono_defaults.object_class;
  <D.25213>:
  goto <D.25214>;
  <D.25209>:
  klass = mono_class_from_mono_type (type);
  <D.25214>:
  <D.25206>:
  <D.25201>:
  <D.25198>:
  <D.25195>:
  goto <D.25215>;
  <D.25192>:
  klass = mono_defaults.int_class;
  <D.25215>:
  D.25216 = klass->image;
  D.25217 = &D.25216->ldfld_wrapper_cache;
  cache = get_cache (D.25217, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.25218>; else goto <D.25219>;
  <D.25218>:
  D.25220 = res;
  return D.25220;
  <D.25219>:
  D.25221 = klass->name_space;
  D.25222 = klass->name;
  name = monoeg_g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, D.25221, D.25222);
  D.25223 = mono_defaults.object_class;
  mb = mono_mb_new (D.25223, name, 12);
  monoeg_g_free (name);
  D.25224 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.25224, 4);
  D.25223 = mono_defaults.object_class;
  D.25225 = &D.25223->byval_arg;
  sig->params[0] = D.25225;
  D.25226 = mono_defaults.int_class;
  D.25227 = &D.25226->byval_arg;
  sig->params[1] = D.25227;
  D.25226 = mono_defaults.int_class;
  D.25227 = &D.25226->byval_arg;
  sig->params[2] = D.25227;
  D.25226 = mono_defaults.int_class;
  D.25227 = &D.25226->byval_arg;
  sig->params[3] = D.25227;
  D.25228 = &klass->byval_arg;
  sig->ret = D.25228;
  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.25229 = mono_marshal_get_ldfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.25229, 0B);
  D.25230 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25231 = D.25230 & 8;
  if (D.25231 != 0) goto <D.25232>; else goto <D.25233>;
  <D.25232>:
  mono_mb_emit_op (mb, 121, klass);
  D.25234 = mono_mb_emit_branch (mb, 56);
  pos1 = (int) D.25234;
  goto <D.25235>;
  <D.25233>:
  mono_mb_emit_byte (mb, 42);
  <D.25235>:
  pos0.150 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.150);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  D.25230 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25231 = D.25230 & 8;
  if (D.25231 != 0) goto <D.25237>; else goto <D.25238>;
  <D.25237>:
  pos1.151 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.151);
  <D.25238>:
  switch (t) <default: <D.20725>, case 2: <D.20701>, case 3: <D.20702>, case 4: <D.20699>, case 5: <D.20700>, case 6: <D.20703>, case 7: <D.20704>, case 8: <D.20705>, case 9: <D.20706>, case 10: <D.20707>, case 11: <D.20708>, case 12: <D.20709>, case 13: <D.20710>, case 14: <D.20715>, case 15: <D.20718>, case 17: <D.20721>, case 18: <D.20714>, case 19: <D.20723>, case 20: <D.20711>, case 21: <D.20722>, case 24: <D.20716>, case 25: <D.20717>, case 27: <D.20719>, case 28: <D.20713>, case 29: <D.20712>, case 30: <D.20724>>
  <D.20699>:
  <D.20700>:
  <D.20701>:
  <D.20702>:
  <D.20703>:
  <D.20704>:
  <D.20705>:
  <D.20706>:
  <D.20707>:
  <D.20708>:
  <D.20709>:
  <D.20710>:
  <D.20711>:
  <D.20712>:
  <D.20713>:
  <D.20714>:
  <D.20715>:
  <D.20716>:
  <D.20717>:
  <D.20718>:
  <D.20719>:
  D.25240 = mono_type_to_ldind (type);
  D.25241 = (unsigned char) D.25240;
  mono_mb_emit_byte (mb, D.25241);
  goto <D.20720>;
  <D.20721>:
  D.25230 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25242 = D.25230 & 16;
  D.25243 = D.25242 != 0;
  D.25244 = (long int) D.25243;
  D.25245 = __builtin_expect (D.25244, 0);
  if (D.25245 != 0) goto <D.25246>; else goto <D.25247>;
  <D.25246>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5439, "!klass->enumtype");
  <D.25247>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.20720>;
  <D.20722>:
  D.25248 = mono_type_generic_inst_is_valuetype (type);
  if (D.25248 != 0) goto <D.25249>; else goto <D.25250>;
  <D.25249>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.25251>;
  <D.25250>:
  mono_mb_emit_byte (mb, 80);
  <D.25251>:
  goto <D.20720>;
  <D.20723>:
  <D.20724>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.20720>;
  <D.20725>:
  D.25188 = type->type;
  D.25252 = (int) D.25188;
  monoeg_g_log (0B, 16, "type %x not implemented", D.25252);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5455);
  <D.20720>:
  mono_mb_emit_byte (mb, 42);
  D.25253 = sig->param_count;
  D.25254 = (int) D.25253;
  D.25255 = D.25254 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.25255);
  mono_mb_free (mb);
  D.25220 = res;
  return D.25220;
}


mono_marshal_get_ldflda_wrapper (struct MonoType * type)
{
  unsigned char D.25257;
  long unsigned int D.25258;
  long unsigned int D.25259;
  int D.25280;
  struct MonoImage * D.25286;
  struct GHashTable * * D.25287;
  struct MonoMethod * D.25290;
  const char * D.25291;
  const char * D.25292;
  struct MonoClass * D.25293;
  struct MonoImage * D.25294;
  struct MonoType * D.25295;
  struct MonoClass * D.25296;
  struct MonoType * D.25297;
  unsigned int pos1.152;
  unsigned int D.25299;
  unsigned int pos2.153;
  unsigned int pos3.154;
  unsigned int pos0.155;
  short unsigned int D.25303;
  int D.25304;
  int D.25305;
  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.25257 = type->type;
  t = (int) D.25257;
  D.25258 = BIT_FIELD_REF <*type, 64, 64>;
  D.25259 = D.25258 & 1073741824;
  if (D.25259 == 0) goto <D.25260>; else goto <D.25261>;
  <D.25260>:
  D.25257 = type->type;
  if (D.25257 == 29) goto <D.25262>; else goto <D.25263>;
  <D.25262>:
  klass = mono_defaults.array_class;
  goto <D.25264>;
  <D.25263>:
  D.25257 = type->type;
  if (D.25257 == 17) goto <D.25265>; else goto <D.25266>;
  <D.25265>:
  klass = type->data.klass;
  goto <D.25267>;
  <D.25266>:
  if (t == 28) goto <D.25268>; else goto <D.25271>;
  <D.25271>:
  if (t == 18) goto <D.25268>; else goto <D.25272>;
  <D.25272>:
  if (t == 14) goto <D.25268>; else goto <D.25273>;
  <D.25273>:
  if (t == 18) goto <D.25268>; else goto <D.25269>;
  <D.25268>:
  klass = mono_defaults.object_class;
  goto <D.25270>;
  <D.25269>:
  if (t == 15) goto <D.25274>; else goto <D.25277>;
  <D.25277>:
  if (t == 27) goto <D.25274>; else goto <D.25275>;
  <D.25274>:
  klass = mono_defaults.int_class;
  goto <D.25276>;
  <D.25275>:
  if (t == 21) goto <D.25278>; else goto <D.25279>;
  <D.25278>:
  D.25280 = mono_type_generic_inst_is_valuetype (type);
  if (D.25280 != 0) goto <D.25281>; else goto <D.25282>;
  <D.25281>:
  klass = mono_class_from_mono_type (type);
  goto <D.25283>;
  <D.25282>:
  klass = mono_defaults.object_class;
  <D.25283>:
  goto <D.25284>;
  <D.25279>:
  klass = mono_class_from_mono_type (type);
  <D.25284>:
  <D.25276>:
  <D.25270>:
  <D.25267>:
  <D.25264>:
  goto <D.25285>;
  <D.25261>:
  klass = mono_defaults.int_class;
  <D.25285>:
  D.25286 = klass->image;
  D.25287 = &D.25286->ldflda_wrapper_cache;
  cache = get_cache (D.25287, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.25288>; else goto <D.25289>;
  <D.25288>:
  D.25290 = res;
  return D.25290;
  <D.25289>:
  D.25291 = klass->name_space;
  D.25292 = klass->name;
  name = monoeg_g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, D.25291, D.25292);
  D.25293 = mono_defaults.object_class;
  mb = mono_mb_new (D.25293, name, 23);
  monoeg_g_free (name);
  D.25294 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.25294, 4);
  D.25293 = mono_defaults.object_class;
  D.25295 = &D.25293->byval_arg;
  sig->params[0] = D.25295;
  D.25296 = mono_defaults.int_class;
  D.25297 = &D.25296->byval_arg;
  sig->params[1] = D.25297;
  D.25296 = mono_defaults.int_class;
  D.25297 = &D.25296->byval_arg;
  sig->params[2] = D.25297;
  D.25296 = mono_defaults.int_class;
  D.25297 = &D.25296->byval_arg;
  sig->params[3] = D.25297;
  D.25296 = mono_defaults.int_class;
  D.25297 = &D.25296->byval_arg;
  sig->ret = D.25297;
  mono_mb_emit_ldarg (mb, 0);
  pos0 = mono_mb_emit_proxy_check (mb, 64);
  mono_mb_emit_ldarg (mb, 0);
  pos1 = mono_mb_emit_xdomain_check (mb, 59);
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another appdomain.");
  pos1.152 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.152);
  mono_mb_emit_ldarg (mb, 0);
  pos2 = mono_mb_emit_contextbound_check (mb, 59);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_icall (mb, mono_context_get);
  D.25299 = mono_mb_emit_branch (mb, 59);
  pos3 = (int) D.25299;
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context.");
  pos2.153 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.153);
  pos3.154 = (unsigned int) pos3;
  mono_mb_patch_branch (mb, pos3.154);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 32);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  pos0.155 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.155);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  D.25303 = sig->param_count;
  D.25304 = (int) D.25303;
  D.25305 = D.25304 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.25305);
  mono_mb_free (mb);
  D.25290 = res;
  return D.25290;
}


mono_mb_emit_contextbound_check (struct MonoMethodBuilder * mb, int branch_code)
{
  int offset.156;
  unsigned char mask.157;
  int D.25311;
  int D.25312;
  unsigned char D.25313;
  unsigned int D.25314;
  static int offset = -1;
  static guint8 mask;

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

    try
      {
        memset (&tmp, 0, 272);
        tmp.contextbound = 1;
        mono_marshal_find_nonzero_bit_offset (&tmp, 272, &offset, &mask);
      }
    finally
      {
        tmp = {CLOBBER};
      }
  }
  <D.25309>:
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  offset.156 = offset;
  mono_mb_emit_ldflda (mb, offset.156);
  mono_mb_emit_byte (mb, 71);
  mask.157 = mask;
  D.25311 = (int) mask.157;
  mono_mb_emit_icon (mb, D.25311);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_icon (mb, 0);
  D.25313 = (unsigned char) branch_code;
  D.25314 = mono_mb_emit_branch (mb, D.25313);
  D.25312 = (int) D.25314;
  return D.25312;
}


mono_marshal_get_stfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.25318;
  long int D.25319;
  long int D.25320;
  struct MonoMethod * cached.158;
  _Bool D.25328;
  long int D.25329;
  long int D.25330;
  struct MonoMethod * D.25333;
  _Bool D.25336;
  long int D.25337;
  long int D.25338;
  struct MonoClass * D.25341;
  struct MonoMethod * D.25342;
  struct MonoImage * D.25343;
  struct MonoType * D.25344;
  struct MonoClass * D.25345;
  struct MonoType * D.25346;
  struct MonoClass * D.25347;
  struct MonoType * D.25348;
  _Bool D.25351;
  long int D.25352;
  long int D.25353;
  _Bool D.25358;
  long int D.25359;
  long int D.25360;
  _Bool D.25367;
  long int D.25368;
  long int D.25369;
  _Bool D.25376;
  long int D.25377;
  long int D.25378;
  _Bool D.25384;
  long int D.25385;
  long int D.25386;
  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.25316>; else goto <D.25317>;
    <D.25316>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25317>:
    D.25318 = ret != 0;
    D.25319 = (long int) D.25318;
    D.25320 = __builtin_expect (D.25319, 0);
    if (D.25320 != 0) goto <D.25321>; else goto <D.25322>;
    <D.25321>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5608, "ret == 0");
    <D.25322>:
  }
  cached.158 = cached;
  if (cached.158 != 0B) goto <D.25324>; else goto <D.25325>;
  <D.25324>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25326>; else goto <D.25327>;
    <D.25326>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25327>:
    D.25328 = ret != 0;
    D.25329 = (long int) D.25328;
    D.25330 = __builtin_expect (D.25329, 0);
    if (D.25330 != 0) goto <D.25331>; else goto <D.25332>;
    <D.25331>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5610, "ret == 0");
    <D.25332>:
  }
  D.25333 = cached;
  return D.25333;
  <D.25325>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.25334>; else goto <D.25335>;
    <D.25334>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.25335>:
    D.25336 = ret != 0;
    D.25337 = (long int) D.25336;
    D.25338 = __builtin_expect (D.25337, 0);
    if (D.25338 != 0) goto <D.25339>; else goto <D.25340>;
    <D.25339>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5613, "ret == 0");
    <D.25340>:
  }
  D.25341 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.25341, "__mono_store_remote_field_new_wrapper", 15);
  D.25342 = mb->method;
  D.25342->save_lmf = 1;
  D.25343 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.25343, 4);
  D.25341 = mono_defaults.object_class;
  D.25344 = &D.25341->byval_arg;
  sig->params[0] = D.25344;
  D.25345 = mono_defaults.int_class;
  D.25346 = &D.25345->byval_arg;
  sig->params[1] = D.25346;
  D.25345 = mono_defaults.int_class;
  D.25346 = &D.25345->byval_arg;
  sig->params[2] = D.25346;
  D.25341 = mono_defaults.object_class;
  D.25344 = &D.25341->byval_arg;
  sig->params[3] = D.25344;
  D.25347 = mono_defaults.void_class;
  D.25348 = &D.25347->byval_arg;
  sig->ret = D.25348;
  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.25343 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.25343, 4);
  D.25341 = mono_defaults.object_class;
  D.25344 = &D.25341->byval_arg;
  csig->params[0] = D.25344;
  D.25345 = mono_defaults.int_class;
  D.25346 = &D.25345->byval_arg;
  csig->params[1] = D.25346;
  D.25345 = mono_defaults.int_class;
  D.25346 = &D.25345->byval_arg;
  csig->params[2] = D.25346;
  D.25341 = mono_defaults.object_class;
  D.25344 = &D.25341->byval_arg;
  csig->params[3] = D.25344;
  D.25347 = mono_defaults.void_class;
  D.25348 = &D.25347->byval_arg;
  csig->ret = D.25348;
  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.25349>; else goto <D.25350>;
    <D.25349>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.25350>:
    D.25351 = ret != 0;
    D.25352 = (long int) D.25351;
    D.25353 = __builtin_expect (D.25352, 0);
    if (D.25353 != 0) goto <D.25354>; else goto <D.25355>;
    <D.25354>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5646, "ret == 0");
    <D.25355>:
  }
  res = cached;
  {
    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", 5648, "ret == 0");
    <D.25362>:
  }
  if (res == 0B) goto <D.25363>; else goto <D.25364>;
  <D.25363>:
  {
    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.25365>; else goto <D.25366>;
      <D.25365>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.25366>:
      D.25367 = ret != 0;
      D.25368 = (long int) D.25367;
      D.25369 = __builtin_expect (D.25368, 0);
      if (D.25369 != 0) goto <D.25370>; else goto <D.25371>;
      <D.25370>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5652, "ret == 0");
      <D.25371>:
    }
    res = cached;
    if (res == 0B) goto <D.25372>; else goto <D.25373>;
    <D.25372>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25374>; else goto <D.25375>;
      <D.25374>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25375>:
      D.25376 = ret != 0;
      D.25377 = (long int) D.25376;
      D.25378 = __builtin_expect (D.25377, 0);
      if (D.25378 != 0) goto <D.25379>; else goto <D.25380>;
      <D.25379>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5657, "ret == 0");
      <D.25380>:
    }
    goto <D.25381>;
    <D.25373>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.25382>; else goto <D.25383>;
      <D.25382>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.25383>:
      D.25384 = ret != 0;
      D.25385 = (long int) D.25384;
      D.25386 = __builtin_expect (D.25385, 0);
      if (D.25386 != 0) goto <D.25387>; else goto <D.25388>;
      <D.25387>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5659, "ret == 0");
      <D.25388>:
    }
    mono_free_method (newm);
    <D.25381>:
  }
  <D.25364>:
  mono_mb_free (mb);
  D.25333 = res;
  return D.25333;
}


mono_marshal_get_stfld_wrapper (struct MonoType * type)
{
  unsigned char D.25390;
  long unsigned int D.25391;
  long unsigned int D.25392;
  int D.25412;
  struct MonoImage * D.25418;
  struct GHashTable * * D.25419;
  struct MonoMethod * D.25422;
  const char * D.25423;
  const char * D.25424;
  struct MonoClass * D.25425;
  struct MonoImage * D.25426;
  struct MonoType * D.25427;
  struct MonoClass * D.25428;
  struct MonoType * D.25429;
  struct MonoType * D.25430;
  struct MonoClass * D.25431;
  struct MonoType * D.25432;
  long unsigned int D.25433;
  long unsigned int D.25434;
  struct MonoMethod * D.25437;
  unsigned int pos.159;
  unsigned int D.25439;
  unsigned char D.25440;
  long unsigned int D.25441;
  _Bool D.25442;
  long int D.25443;
  long int D.25444;
  int D.25447;
  short unsigned int D.25448;
  int D.25449;
  int D.25450;
  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.25390 = type->type;
  t = (int) D.25390;
  D.25391 = BIT_FIELD_REF <*type, 64, 64>;
  D.25392 = D.25391 & 1073741824;
  if (D.25392 == 0) goto <D.25393>; else goto <D.25394>;
  <D.25393>:
  D.25390 = type->type;
  if (D.25390 == 29) goto <D.25395>; else goto <D.25396>;
  <D.25395>:
  klass = mono_defaults.array_class;
  goto <D.25397>;
  <D.25396>:
  D.25390 = type->type;
  if (D.25390 == 17) goto <D.25398>; else goto <D.25399>;
  <D.25398>:
  klass = type->data.klass;
  goto <D.25400>;
  <D.25399>:
  if (t == 28) goto <D.25401>; else goto <D.25404>;
  <D.25404>:
  if (t == 18) goto <D.25401>; else goto <D.25405>;
  <D.25405>:
  if (t == 14) goto <D.25401>; else goto <D.25402>;
  <D.25401>:
  klass = mono_defaults.object_class;
  goto <D.25403>;
  <D.25402>:
  if (t == 15) goto <D.25406>; else goto <D.25409>;
  <D.25409>:
  if (t == 27) goto <D.25406>; else goto <D.25407>;
  <D.25406>:
  klass = mono_defaults.int_class;
  goto <D.25408>;
  <D.25407>:
  if (t == 21) goto <D.25410>; else goto <D.25411>;
  <D.25410>:
  D.25412 = mono_type_generic_inst_is_valuetype (type);
  if (D.25412 != 0) goto <D.25413>; else goto <D.25414>;
  <D.25413>:
  klass = mono_class_from_mono_type (type);
  goto <D.25415>;
  <D.25414>:
  klass = mono_defaults.object_class;
  <D.25415>:
  goto <D.25416>;
  <D.25411>:
  klass = mono_class_from_mono_type (type);
  <D.25416>:
  <D.25408>:
  <D.25403>:
  <D.25400>:
  <D.25397>:
  goto <D.25417>;
  <D.25394>:
  klass = mono_defaults.int_class;
  <D.25417>:
  D.25418 = klass->image;
  D.25419 = &D.25418->stfld_wrapper_cache;
  cache = get_cache (D.25419, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.25420>; else goto <D.25421>;
  <D.25420>:
  D.25422 = res;
  return D.25422;
  <D.25421>:
  D.25423 = klass->name_space;
  D.25424 = klass->name;
  name = monoeg_g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, D.25423, D.25424);
  D.25425 = mono_defaults.object_class;
  mb = mono_mb_new (D.25425, name, 13);
  monoeg_g_free (name);
  D.25426 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.25426, 5);
  D.25425 = mono_defaults.object_class;
  D.25427 = &D.25425->byval_arg;
  sig->params[0] = D.25427;
  D.25428 = mono_defaults.int_class;
  D.25429 = &D.25428->byval_arg;
  sig->params[1] = D.25429;
  D.25428 = mono_defaults.int_class;
  D.25429 = &D.25428->byval_arg;
  sig->params[2] = D.25429;
  D.25428 = mono_defaults.int_class;
  D.25429 = &D.25428->byval_arg;
  sig->params[3] = D.25429;
  D.25430 = &klass->byval_arg;
  sig->params[4] = D.25430;
  D.25431 = mono_defaults.void_class;
  D.25432 = &D.25431->byval_arg;
  sig->ret = D.25432;
  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.25433 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25434 = D.25433 & 8;
  if (D.25434 != 0) goto <D.25435>; else goto <D.25436>;
  <D.25435>:
  mono_mb_emit_op (mb, 140, klass);
  <D.25436>:
  D.25437 = mono_marshal_get_stfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.25437, 0B);
  mono_mb_emit_byte (mb, 42);
  pos.159 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.159);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 4);
  switch (t) <default: <D.20794>, case 2: <D.20770>, case 3: <D.20771>, case 4: <D.20768>, case 5: <D.20769>, case 6: <D.20772>, case 7: <D.20773>, case 8: <D.20774>, case 9: <D.20775>, case 10: <D.20776>, case 11: <D.20777>, case 12: <D.20778>, case 13: <D.20779>, case 14: <D.20784>, case 15: <D.20787>, case 17: <D.20790>, case 18: <D.20783>, case 19: <D.20792>, case 20: <D.20780>, case 21: <D.20791>, case 24: <D.20785>, case 25: <D.20786>, case 27: <D.20788>, case 28: <D.20782>, case 29: <D.20781>, case 30: <D.20793>>
  <D.20768>:
  <D.20769>:
  <D.20770>:
  <D.20771>:
  <D.20772>:
  <D.20773>:
  <D.20774>:
  <D.20775>:
  <D.20776>:
  <D.20777>:
  <D.20778>:
  <D.20779>:
  <D.20780>:
  <D.20781>:
  <D.20782>:
  <D.20783>:
  <D.20784>:
  <D.20785>:
  <D.20786>:
  <D.20787>:
  <D.20788>:
  D.25439 = mono_type_to_stind (type);
  D.25440 = (unsigned char) D.25439;
  mono_mb_emit_byte (mb, D.25440);
  goto <D.20789>;
  <D.20790>:
  D.25433 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25441 = D.25433 & 16;
  D.25442 = D.25441 != 0;
  D.25443 = (long int) D.25442;
  D.25444 = __builtin_expect (D.25443, 0);
  if (D.25444 != 0) goto <D.25445>; else goto <D.25446>;
  <D.25445>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5777, "!klass->enumtype");
  <D.25446>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.20789>;
  <D.20791>:
  <D.20792>:
  <D.20793>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.20789>;
  <D.20794>:
  D.25390 = type->type;
  D.25447 = (int) D.25390;
  monoeg_g_log (0B, 16, "type %x not implemented", D.25447);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5787);
  <D.20789>:
  mono_mb_emit_byte (mb, 42);
  D.25448 = sig->param_count;
  D.25449 = (int) D.25448;
  D.25450 = D.25449 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.25450);
  mono_mb_free (mb);
  D.25422 = res;
  return D.25422;
}


mono_marshal_get_icall_wrapper (struct MonoMethodSignature * sig, const char * name, const void * func, gboolean check_exceptions)
{
  long unsigned int D.25452;
  long unsigned int D.25453;
  _Bool D.25454;
  long int D.25455;
  long int D.25456;
  struct MonoClass * D.25459;
  struct MonoMethod * D.25460;
  long unsigned int D.25461;
  struct MonoImage * D.25464;
  <unnamed-unsigned:1> D.25468;
  int D.25469;
  int D.25470;
  unsigned int D.25471;
  short unsigned int D.25472;
  int D.25473;
  long unsigned int D.25476;
  long unsigned int D.25477;
  short unsigned int D.25480;
  int D.25481;
  int D.25482;
  struct MonoMethod * D.25483;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * csig2;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  struct WrapperInfo * info;

  D.25452 = BIT_FIELD_REF <*sig, 64, 64>;
  D.25453 = D.25452 & 72057594037927936;
  D.25454 = D.25453 == 0;
  D.25455 = (long int) D.25454;
  D.25456 = __builtin_expect (D.25455, 0);
  if (D.25456 != 0) goto <D.25457>; else goto <D.25458>;
  <D.25457>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5815, "sig->pinvoke");
  <D.25458>:
  D.25459 = mono_defaults.object_class;
  mb = mono_mb_new (D.25459, name, 6);
  D.25460 = mb->method;
  D.25460->save_lmf = 1;
  D.25452 = BIT_FIELD_REF <*sig, 64, 64>;
  D.25461 = D.25452 & 18014398509481984;
  if (D.25461 != 0) goto <D.25462>; else goto <D.25463>;
  <D.25462>:
  D.25464 = mono_defaults.corlib;
  D.25459 = mono_defaults.object_class;
  csig2 = signature_dup_add_this (D.25464, sig, D.25459);
  goto <D.25465>;
  <D.25463>:
  D.25464 = mono_defaults.corlib;
  csig2 = signature_dup (D.25464, sig);
  <D.25465>:
  D.25452 = BIT_FIELD_REF <*sig, 64, 64>;
  D.25461 = D.25452 & 18014398509481984;
  if (D.25461 != 0) goto <D.25466>; else goto <D.25467>;
  <D.25466>:
  mono_mb_emit_byte (mb, 2);
  <D.25467>:
  i = 0;
  goto <D.20808>;
  <D.20807>:
  D.25468 = sig->hasthis;
  D.25469 = (int) D.25468;
  D.25470 = D.25469 + i;
  D.25471 = (unsigned int) D.25470;
  mono_mb_emit_ldarg (mb, D.25471);
  i = i + 1;
  <D.20808>:
  D.25472 = sig->param_count;
  D.25473 = (int) D.25472;
  if (D.25473 > i) goto <D.20807>; else goto <D.20809>;
  <D.20809>:
  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.25474>; else goto <D.25475>;
  <D.25474>:
  emit_thread_interrupt_checkpoint (mb);
  <D.25475>:
  mono_mb_emit_byte (mb, 42);
  D.25464 = mono_defaults.corlib;
  csig = signature_dup (D.25464, sig);
  csig->pinvoke = 0;
  D.25476 = BIT_FIELD_REF <*csig, 64, 64>;
  D.25477 = D.25476 & 17732923532771328;
  if (D.25477 == 1407374883553280) goto <D.25478>; else goto <D.25479>;
  <D.25478>:
  csig->call_convention = 0;
  <D.25479>:
  D.25480 = csig->param_count;
  D.25481 = (int) D.25480;
  D.25482 = D.25481 + 16;
  res = mono_mb_create_method (mb, csig, D.25482);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 15);
  info->d.icall.func = func;
  mono_marshal_set_wrapper_info (res, info);
  D.25483 = res;
  return D.25483;
}


signature_dup_add_this (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoClass * klass)
{
  short unsigned int D.25485;
  int D.25486;
  int D.25487;
  unsigned int D.25488;
  short unsigned int D.25489;
  int D.25490;
  struct MonoType * D.25491;
  struct MonoType * iftmp.160;
  long unsigned int D.25493;
  long unsigned int D.25494;
  struct MonoMethodSignature * D.25498;
  struct MonoMethodSignature * res;
  int i;

  D.25485 = sig->param_count;
  D.25486 = (int) D.25485;
  D.25487 = D.25486 + 1;
  D.25488 = (unsigned int) D.25487;
  res = mono_metadata_signature_alloc (image, D.25488);
  memcpy (res, sig, 16);
  D.25485 = sig->param_count;
  D.25489 = D.25485 + 1;
  res->param_count = D.25489;
  res->hasthis = 0;
  D.25485 = sig->param_count;
  D.25486 = (int) D.25485;
  i = D.25486 + -1;
  goto <D.20487>;
  <D.20486>:
  D.25490 = i + 1;
  D.25491 = sig->params[i];
  res->params[D.25490] = D.25491;
  i = i + -1;
  <D.20487>:
  if (i >= 0) goto <D.20486>; else goto <D.20488>;
  <D.20488>:
  D.25493 = BIT_FIELD_REF <*klass, 64, 256>;
  D.25494 = D.25493 & 8;
  if (D.25494 != 0) goto <D.25495>; else goto <D.25496>;
  <D.25495>:
  iftmp.160 = &klass->this_arg;
  goto <D.25497>;
  <D.25496>:
  iftmp.160 = &klass->byval_arg;
  <D.25497>:
  res->params[0] = iftmp.160;
  D.25498 = res;
  return D.25498;
}


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)
{
  long unsigned int D.25502;
  long unsigned int D.25503;
  _Bool D.25504;
  long int D.25505;
  long int D.25506;
  struct MonoMethod * D.25509;
  struct MonoClass * D.25510;
  struct MonoImage * D.25511;
  struct MonoClass * D.25514;
  struct MonoType * D.25515;
  struct MonoClass * D.25516;
  struct MonoType * D.25517;
  struct MonoType * D.25518;
  int D.25519;
  struct MonoMarshalSpec * D.25522;
  <unnamed type> D.25525;
  short unsigned int D.25528;
  long unsigned int D.25529;
  long unsigned int D.25530;
  int D.25531;
  int D.25532;
  long unsigned int D.25533;
  long unsigned int D.25534;
  void * D.25535;
  long unsigned int D.25536;
  long unsigned int D.25537;
  int * D.25538;
  int D.25539;
  struct MonoType * D.25540;
  sizetype D.25541;
  sizetype D.25542;
  sizetype D.25543;
  struct MonoMarshalSpec * * D.25544;
  struct MonoMarshalSpec * D.25545;
  struct MonoType * * D.25546;
  int D.25547;
  int D.25550;
  unsigned int D.25554;
  unsigned int D.25555;
  struct MonoMethod * D.25558;
  short unsigned int D.25563;
  int D.25564;
  int D.25565;
  struct MonoMethodSignature * get_last_error_sig.161;
  struct MonoImage * D.25571;
  struct MonoMethodSignature * get_last_error_sig.162;
  long unsigned int D.25573;
  long unsigned int D.25574;
  unsigned char D.25577;
  <unnamed type> D.25580;
  long unsigned int D.25582;
  long unsigned int D.25583;
  struct MonoClass * D.25586;
  struct MonoType * D.25587;
  unsigned char D.25588;
  int D.25589;
  <unnamed type> D.25597;
  unsigned char D.25599;
  int D.25600;
  int D.25602;
  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.25500>; else goto <D.25501>;
      <D.25500>:
      D.25502 = BIT_FIELD_REF <*sig, 64, 64>;
      D.25503 = D.25502 & 18014398509481984;
      D.25504 = D.25503 != 0;
      D.25505 = (long int) D.25504;
      D.25506 = __builtin_expect (D.25505, 0);
      if (D.25506 != 0) goto <D.25507>; else goto <D.25508>;
      <D.25507>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8635, "!sig->hasthis");
      <D.25508>:
      param_shift = param_shift + 1;
      <D.25501>:
      D.25509 = mb->method;
      D.25510 = D.25509->klass;
      D.25511 = D.25510->image;
      csig = signature_dup (D.25511, sig);
      csig->pinvoke = 1;
      m.csig = csig;
      m.image = image;
      D.25502 = BIT_FIELD_REF <*sig, 64, 64>;
      D.25503 = D.25502 & 18014398509481984;
      if (D.25503 != 0) goto <D.25512>; else goto <D.25513>;
      <D.25512>:
      param_shift = param_shift + 1;
      <D.25513>:
      D.25514 = mono_defaults.int_class;
      D.25515 = &D.25514->byval_arg;
      mono_mb_add_local (mb, D.25515);
      D.25514 = mono_defaults.int_class;
      D.25515 = &D.25514->byval_arg;
      mono_mb_add_local (mb, D.25515);
      D.25516 = mono_defaults.boolean_class;
      D.25517 = &D.25516->byval_arg;
      mono_mb_add_local (mb, D.25517);
      mono_mb_emit_icon (mb, 0);
      mono_mb_emit_stloc (mb, 2);
      D.25518 = sig->ret;
      D.25519 = mono_type_is_void (D.25518);
      if (D.25519 == 0) goto <D.25520>; else goto <D.25521>;
      <D.25520>:
      D.25518 = sig->ret;
      mono_mb_add_local (mb, D.25518);
      <D.25521>:
      D.25522 = *mspecs;
      if (D.25522 != 0B) goto <D.25523>; else goto <D.25524>;
      <D.25523>:
      D.25522 = *mspecs;
      D.25525 = D.25522->native;
      if (D.25525 == 44) goto <D.25526>; else goto <D.25527>;
      <D.25526>:
      D.25514 = mono_defaults.int_class;
      D.25515 = &D.25514->byval_arg;
      csig->ret = D.25515;
      <D.25527>:
      <D.25524>:
      D.25528 = sig->param_count;
      D.25529 = (long unsigned int) D.25528;
      D.25530 = D.25529 * 4;
      tmp_locals = __builtin_alloca (D.25530);
      D.25528 = sig->param_count;
      D.25531 = (int) D.25528;
      D.25532 = D.25531 + 1;
      D.25533 = (long unsigned int) D.25532;
      D.25534 = D.25533 * 4;
      D.25535 = __builtin_alloca (D.25534);
      m.orig_conv_args = D.25535;
      i = 0;
      goto <D.21297>;
      <D.21296>:
      D.25536 = (long unsigned int) i;
      D.25537 = D.25536 * 4;
      D.25538 = tmp_locals + D.25537;
      D.25539 = i + param_shift;
      D.25540 = sig->params[i];
      D.25541 = (sizetype) i;
      D.25542 = D.25541 + 1;
      D.25543 = D.25542 * 8;
      D.25544 = mspecs + D.25543;
      D.25545 = *D.25544;
      D.25546 = &csig->params[i];
      D.25547 = emit_marshal (&m, D.25539, D.25540, D.25545, 0, D.25546, 0);
      *D.25538 = D.25547;
      i = i + 1;
      <D.21297>:
      D.25528 = sig->param_count;
      D.25531 = (int) D.25528;
      if (D.25531 > i) goto <D.21296>; else goto <D.21298>;
      <D.21298>:
      D.25502 = BIT_FIELD_REF <*sig, 64, 64>;
      D.25503 = D.25502 & 18014398509481984;
      if (D.25503 != 0) goto <D.25548>; else goto <D.25549>;
      <D.25548>:
      mono_mb_emit_byte (mb, 2);
      <D.25549>:
      i = 0;
      goto <D.21300>;
      <D.21299>:
      D.25539 = i + param_shift;
      D.25540 = sig->params[i];
      D.25541 = (sizetype) i;
      D.25542 = D.25541 + 1;
      D.25543 = D.25542 * 8;
      D.25544 = mspecs + D.25543;
      D.25545 = *D.25544;
      D.25536 = (long unsigned int) i;
      D.25537 = D.25536 * 4;
      D.25538 = tmp_locals + D.25537;
      D.25550 = *D.25538;
      emit_marshal (&m, D.25539, D.25540, D.25545, D.25550, 0B, 1);
      i = i + 1;
      <D.21300>:
      D.25528 = sig->param_count;
      D.25531 = (int) D.25528;
      if (D.25531 > i) goto <D.21299>; else goto <D.21301>;
      <D.21301>:
      if (func_param != 0) goto <D.25551>; else goto <D.25552>;
      <D.25551>:
      mono_mb_emit_byte (mb, 2);
      D.25514 = mono_defaults.int_class;
      mono_mb_emit_op (mb, 121, D.25514);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_calli (mb, csig);
      goto <D.25553>;
      <D.25552>:
      D.25509 = mb->method;
      D.25510 = D.25509->klass;
      D.25554 = D.25510->flags;
      D.25555 = D.25554 & 4096;
      if (D.25555 != 0) goto <D.25556>; else goto <D.25557>;
      <D.25556>:
      D.25558 = &piinfo->method;
      mono_mb_emit_cominterop_call (mb, csig, D.25558);
      goto <D.25559>;
      <D.25557>:
      if (aot != 0) goto <D.25560>; else goto <D.25561>;
      <D.25560>:
      mono_mb_emit_byte (mb, 240);
      D.25558 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.25558);
      mono_mb_emit_calli (mb, csig);
      goto <D.25562>;
      <D.25561>:
      mono_mb_emit_native_call (mb, csig, func);
      <D.25562>:
      <D.25559>:
      <D.25553>:
      D.25563 = piinfo->piflags;
      D.25564 = (int) D.25563;
      D.25565 = D.25564 & 64;
      if (D.25565 != 0) goto <D.25566>; else goto <D.25567>;
      <D.25566>:
      get_last_error_sig.161 = get_last_error_sig;
      if (get_last_error_sig.161 == 0B) goto <D.25569>; else goto <D.25570>;
      <D.25569>:
      D.25571 = mono_defaults.corlib;
      get_last_error_sig.162 = mono_metadata_signature_alloc (D.25571, 0);
      get_last_error_sig = get_last_error_sig.162;
      get_last_error_sig.161 = get_last_error_sig;
      D.25514 = mono_defaults.int_class;
      D.25515 = &D.25514->byval_arg;
      get_last_error_sig.161->ret = D.25515;
      get_last_error_sig.161 = get_last_error_sig;
      get_last_error_sig.161->pinvoke = 1;
      <D.25570>:
      mono_mb_emit_icall (mb, mono_marshal_set_last_error);
      <D.25567>:
      D.25518 = sig->ret;
      D.25573 = BIT_FIELD_REF <*D.25518, 64, 64>;
      D.25574 = D.25573 & 1073741824;
      if (D.25574 == 0) goto <D.25575>; else goto <D.25576>;
      <D.25575>:
      {
        struct MonoMarshalSpec * spec;

        spec = *mspecs;
        D.25518 = sig->ret;
        D.25577 = D.25518->type;
        type = (int) D.25577;
        if (spec != 0B) goto <D.25579>; else goto <D.25578>;
        <D.25579>:
        D.25580 = spec->native;
        if (D.25580 == 44) goto <D.25581>; else goto <D.25578>;
        <D.25581>:
        D.25518 = sig->ret;
        emit_marshal (&m, 0, D.25518, spec, 0, 0B, 3);
        goto <D.21305>;
        <D.25578>:
        handle_enum:
        switch (type) <default: <D.21330>, case 1: <D.21304>, case 2: <D.21323>, case 3: <D.21326>, case 4: <D.21307>, case 5: <D.21308>, case 6: <D.21309>, case 7: <D.21310>, case 8: <D.21311>, case 9: <D.21312>, case 10: <D.21317>, case 11: <D.21318>, case 12: <D.21315>, case 13: <D.21316>, case 14: <D.21320>, case 15: <D.21327>, case 17: <D.21306>, case 18: <D.21321>, case 20: <D.21324>, case 21: <D.21328>, case 22: <D.21329>, case 24: <D.21313>, case 25: <D.21314>, case 27: <D.21319>, case 28: <D.21322>, case 29: <D.21325>>
        <D.21304>:
        goto <D.21305>;
        <D.21306>:
        D.25518 = sig->ret;
        klass = D.25518->data.klass;
        D.25582 = BIT_FIELD_REF <*klass, 64, 256>;
        D.25583 = D.25582 & 16;
        if (D.25583 != 0) goto <D.25584>; else goto <D.25585>;
        <D.25584>:
        D.25518 = sig->ret;
        D.25586 = D.25518->data.klass;
        D.25587 = mono_class_enum_basetype (D.25586);
        D.25588 = D.25587->type;
        type = (int) D.25588;
        goto handle_enum;
        <D.25585>:
        D.25518 = sig->ret;
        emit_marshal (&m, 0, D.25518, spec, 0, 0B, 3);
        goto <D.21305>;
        <D.21307>:
        <D.21308>:
        <D.21309>:
        <D.21310>:
        <D.21311>:
        <D.21312>:
        <D.21313>:
        <D.21314>:
        <D.21315>:
        <D.21316>:
        <D.21317>:
        <D.21318>:
        <D.21319>:
        <D.21320>:
        <D.21321>:
        <D.21322>:
        <D.21323>:
        <D.21324>:
        <D.21325>:
        <D.21326>:
        <D.21327>:
        <D.21328>:
        D.25518 = sig->ret;
        emit_marshal (&m, 0, D.25518, spec, 0, 0B, 3);
        goto <D.21305>;
        <D.21329>:
        <D.21330>:
        D.25518 = sig->ret;
        D.25577 = D.25518->type;
        D.25589 = (int) D.25577;
        monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.25589);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8782);
        <D.21305>:
      }
      goto <D.25590>;
      <D.25576>:
      mono_mb_emit_stloc (mb, 3);
      <D.25590>:
      if (check_exceptions != 0) goto <D.25591>; else goto <D.25592>;
      <D.25591>:
      emit_thread_interrupt_checkpoint (mb);
      <D.25592>:
      i = 0;
      goto <D.21342>;
      <D.21341>:
      {
        struct MonoType * t;
        struct MonoMarshalSpec * spec;

        t = sig->params[i];
        D.25541 = (sizetype) i;
        D.25542 = D.25541 + 1;
        D.25543 = D.25542 * 8;
        D.25544 = mspecs + D.25543;
        spec = *D.25544;
        argnum = i + param_shift;
        if (spec != 0B) goto <D.25595>; else goto <D.25596>;
        <D.25595>:
        D.25597 = spec->native;
        if (D.25597 == 44) goto <D.25593>; else goto <D.25598>;
        <D.25598>:
        D.25597 = spec->native;
        if (D.25597 == 40) goto <D.25593>; else goto <D.25594>;
        <D.25593>:
        D.25536 = (long unsigned int) i;
        D.25537 = D.25536 * 4;
        D.25538 = tmp_locals + D.25537;
        D.25550 = *D.25538;
        emit_marshal (&m, argnum, t, spec, D.25550, 0B, 2);
        // predicted unlikely by continue predictor.
        goto <D.21333>;
        <D.25594>:
        <D.25596>:
        D.25599 = t->type;
        D.25600 = (int) D.25599;
        switch (D.25600) <default: <D.25601>, case 2: <D.21339>, case 14: <D.21334>, case 17: <D.21335>, case 18: <D.21336>, case 28: <D.21337>, case 29: <D.21338>>
        <D.21334>:
        <D.21335>:
        <D.21336>:
        <D.21337>:
        <D.21338>:
        <D.21339>:
        D.25536 = (long unsigned int) i;
        D.25537 = D.25536 * 4;
        D.25538 = tmp_locals + D.25537;
        D.25550 = *D.25538;
        emit_marshal (&m, argnum, t, spec, D.25550, 0B, 2);
        goto <D.21340>;
        <D.25601>:
        <D.21340>:
      }
      <D.21333>:
      i = i + 1;
      <D.21342>:
      D.25528 = sig->param_count;
      D.25531 = (int) D.25528;
      if (D.25531 > i) goto <D.21341>; else goto <D.21343>;
      <D.21343>:
      D.25518 = sig->ret;
      D.25602 = mono_type_is_void (D.25518);
      if (D.25602 == 0) goto <D.25603>; else goto <D.25604>;
      <D.25603>:
      mono_mb_emit_ldloc (mb, 3);
      <D.25604>:
      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.25607;
  <unnamed type> D.25610;
  int D.25613;
  unsigned char D.25618;
  int D.25619;
  struct MonoClass * D.25620;
  struct MonoClass * D.25621;
  unsigned int D.25632;
  <unnamed type> D.25640;
  struct MonoClass * D.25645;
  int D.25650;
  int D.25653;

  D.25607 = mono_class_from_mono_type (t);
  mono_marshal_load_type_info (D.25607);
  if (spec != 0B) goto <D.25608>; else goto <D.25609>;
  <D.25608>:
  D.25610 = spec->native;
  if (D.25610 == 44) goto <D.25611>; else goto <D.25612>;
  <D.25611>:
  D.25613 = emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25612>:
  <D.25609>:
  if (spec != 0B) goto <D.25614>; else goto <D.25615>;
  <D.25614>:
  D.25610 = spec->native;
  if (D.25610 == 40) goto <D.25616>; else goto <D.25617>;
  <D.25616>:
  D.25613 = emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25617>:
  <D.25615>:
  D.25618 = t->type;
  D.25619 = (int) D.25618;
  switch (D.25619) <default: <D.25656>, case 2: <D.21259>, case 3: <D.21261>, case 4: <D.21262>, case 5: <D.21263>, case 6: <D.21264>, case 7: <D.21265>, case 8: <D.21266>, case 9: <D.21267>, case 10: <D.21272>, case 11: <D.21273>, case 12: <D.21270>, case 13: <D.21271>, case 14: <D.21254>, case 15: <D.21260>, case 17: <D.21253>, case 18: <D.21255>, case 20: <D.21257>, case 21: <D.21275>, case 24: <D.21268>, case 25: <D.21269>, case 27: <D.21274>, case 28: <D.21256>, case 29: <D.21258>>
  <D.21253>:
  D.25620 = t->data.klass;
  D.25621 = mono_defaults.handleref_class;
  if (D.25620 == D.25621) goto <D.25622>; else goto <D.25623>;
  <D.25622>:
  D.25613 = emit_marshal_handleref (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25623>:
  D.25613 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21254>:
  D.25613 = emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21255>:
  <D.21256>:
  if (spec != 0B) goto <D.25624>; else goto <D.25625>;
  <D.25624>:
  D.25610 = spec->native;
  if (D.25610 == 27) goto <D.25626>; else goto <D.25627>;
  <D.25626>:
  D.25613 = emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25627>:
  <D.25625>:
  if (spec != 0B) goto <D.25630>; else goto <D.25631>;
  <D.25630>:
  D.25610 = spec->native;
  D.25632 = D.25610 + 4294967271;
  if (D.25632 <= 1) goto <D.25628>; else goto <D.25633>;
  <D.25633>:
  D.25610 = spec->native;
  if (D.25610 == 28) goto <D.25628>; else goto <D.25629>;
  <D.25628>:
  D.25613 = mono_cominterop_emit_marshal_com_interface (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25629>:
  <D.25631>:
  if (spec != 0B) goto <D.25636>; else goto <D.25637>;
  <D.25636>:
  D.25610 = spec->native;
  if (D.25610 == 29) goto <D.25638>; else goto <D.25639>;
  <D.25638>:
  D.25640 = spec->data.safearray_data.elem_type;
  if (D.25640 == 12) goto <D.25641>; else goto <D.25642>;
  <D.25641>:
  if (action == 2) goto <D.25634>; else goto <D.25643>;
  <D.25643>:
  if (action == 0) goto <D.25634>; else goto <D.25644>;
  <D.25644>:
  if (action == 1) goto <D.25634>; else goto <D.25635>;
  <D.25634>:
  D.25613 = mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25635>:
  <D.25642>:
  <D.25639>:
  <D.25637>:
  D.25645 = mono_defaults.safehandle_class;
  if (D.25645 != 0B) goto <D.25646>; else goto <D.25647>;
  <D.25646>:
  D.25620 = t->data.klass;
  if (D.25620 != 0B) goto <D.25648>; else goto <D.25649>;
  <D.25648>:
  D.25620 = t->data.klass;
  D.25645 = mono_defaults.safehandle_class;
  D.25650 = mono_class_is_subclass_of (D.25620, D.25645, 0);
  if (D.25650 != 0) goto <D.25651>; else goto <D.25652>;
  <D.25651>:
  D.25613 = emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25652>:
  <D.25649>:
  <D.25647>:
  D.25613 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21257>:
  <D.21258>:
  D.25613 = emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21259>:
  D.25613 = emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21260>:
  D.25613 = emit_marshal_ptr (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21261>:
  D.25613 = emit_marshal_char (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21262>:
  <D.21263>:
  <D.21264>:
  <D.21265>:
  <D.21266>:
  <D.21267>:
  <D.21268>:
  <D.21269>:
  <D.21270>:
  <D.21271>:
  <D.21272>:
  <D.21273>:
  <D.21274>:
  D.25613 = emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.21275>:
  D.25653 = mono_type_generic_inst_is_valuetype (t);
  if (D.25653 != 0) goto <D.25654>; else goto <D.25655>;
  <D.25654>:
  D.25613 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25655>:
  D.25613 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.25613;
  <D.25656>:
  D.25613 = conv_arg;
  return D.25613;
}


emit_marshal_custom (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * ICustomMarshaler.163;
  struct MonoImage * D.25661;
  struct MonoClass * ICustomMarshaler.164;
  struct MonoMethod * cleanup_native.165;
  struct MonoMethod * cleanup_native.166;
  _Bool D.25667;
  long int D.25668;
  long int D.25669;
  struct MonoMethod * cleanup_managed.167;
  struct MonoMethod * cleanup_managed.168;
  _Bool D.25674;
  long int D.25675;
  long int D.25676;
  struct MonoMethod * marshal_managed_to_native.169;
  struct MonoMethod * marshal_managed_to_native.170;
  _Bool D.25681;
  long int D.25682;
  long int D.25683;
  struct MonoMethod * marshal_native_to_managed.171;
  struct MonoMethod * marshal_native_to_managed.172;
  _Bool D.25688;
  long int D.25689;
  long int D.25690;
  char * D.25693;
  struct MonoImage * D.25694;
  _Bool D.25695;
  long int D.25696;
  long int D.25697;
  _Bool D.25700;
  long int D.25701;
  long int D.25702;
  int D.25705;
  const char * D.25708;
  struct MonoType * D.25713;
  unsigned char D.25714;
  struct MonoClass * D.25716;
  struct MonoType * D.25718;
  unsigned char D.25719;
  int D.25727;
  unsigned char D.25728;
  int D.25729;
  struct MonoClass * D.25730;
  struct MonoType * D.25731;
  unsigned int conv_arg.173;
  long unsigned int D.25733;
  long unsigned int D.25734;
  short unsigned int D.25737;
  int D.25738;
  int D.25739;
  unsigned int D.25743;
  unsigned int D.25744;
  unsigned int argnum.174;
  unsigned int D.25749;
  char * D.25750;
  gchar * D.25751;
  struct MonoClass * D.25756;
  unsigned int pos2.175;
  unsigned int D.25758;
  gchar * D.25761;
  gchar * D.25765;
  gchar * D.25766;
  int D.25770;
  unsigned int D.25771;
  gchar * D.25772;
  struct MonoClass * D.25773;
  struct MonoType * D.25774;
  unsigned int D.25780;
  gchar * D.25781;
  _Bool D.25784;
  long int D.25785;
  long int D.25786;
  int D.25789;
  unsigned int D.25790;
  gchar * D.25791;
  unsigned int D.25792;
  gchar * D.25795;
  gchar * D.25796;
  struct MonoType * mtype;
  struct MonoClass * mklass;
  static struct MonoClass * ICustomMarshaler = 0B;
  static struct MonoMethod * cleanup_native;
  static struct MonoMethod * cleanup_managed;
  static struct MonoMethod * marshal_managed_to_native;
  static struct MonoMethod * marshal_native_to_managed;
  struct MonoMethod * get_instance;
  struct MonoMethodBuilder * mb;
  char * exception_msg;
  guint32 loc1;
  int pos2;
  void handle_exception = <<< error >>>;

  get_instance = 0B;
  mb = m->mb;
  exception_msg = 0B;
  ICustomMarshaler.163 = ICustomMarshaler;
  if (ICustomMarshaler.163 == 0B) goto <D.25659>; else goto <D.25660>;
  <D.25659>:
  D.25661 = mono_defaults.corlib;
  ICustomMarshaler.164 = mono_class_from_name (D.25661, "System.Runtime.InteropServices", "ICustomMarshaler");
  ICustomMarshaler = ICustomMarshaler.164;
  ICustomMarshaler.163 = ICustomMarshaler;
  if (ICustomMarshaler.163 == 0B) goto <D.25663>; else goto <D.25664>;
  <D.25663>:
  exception_msg = monoeg_strdup ("Current profile doesn\'t support ICustomMarshaler");
  goto handle_exception;
  <D.25664>:
  ICustomMarshaler.163 = ICustomMarshaler;
  cleanup_native.165 = mono_class_get_method_from_name (ICustomMarshaler.163, "CleanUpNativeData", 1);
  cleanup_native = cleanup_native.165;
  cleanup_native.166 = cleanup_native;
  D.25667 = cleanup_native.166 == 0B;
  D.25668 = (long int) D.25667;
  D.25669 = __builtin_expect (D.25668, 0);
  if (D.25669 != 0) goto <D.25670>; else goto <D.25671>;
  <D.25670>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5887, "cleanup_native");
  <D.25671>:
  ICustomMarshaler.163 = ICustomMarshaler;
  cleanup_managed.167 = mono_class_get_method_from_name (ICustomMarshaler.163, "CleanUpManagedData", 1);
  cleanup_managed = cleanup_managed.167;
  cleanup_managed.168 = cleanup_managed;
  D.25674 = cleanup_managed.168 == 0B;
  D.25675 = (long int) D.25674;
  D.25676 = __builtin_expect (D.25675, 0);
  if (D.25676 != 0) goto <D.25677>; else goto <D.25678>;
  <D.25677>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5889, "cleanup_managed");
  <D.25678>:
  ICustomMarshaler.163 = ICustomMarshaler;
  marshal_managed_to_native.169 = mono_class_get_method_from_name (ICustomMarshaler.163, "MarshalManagedToNative", 1);
  marshal_managed_to_native = marshal_managed_to_native.169;
  marshal_managed_to_native.170 = marshal_managed_to_native;
  D.25681 = marshal_managed_to_native.170 == 0B;
  D.25682 = (long int) D.25681;
  D.25683 = __builtin_expect (D.25682, 0);
  if (D.25683 != 0) goto <D.25684>; else goto <D.25685>;
  <D.25684>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5891, "marshal_managed_to_native");
  <D.25685>:
  ICustomMarshaler.163 = ICustomMarshaler;
  marshal_native_to_managed.171 = mono_class_get_method_from_name (ICustomMarshaler.163, "MarshalNativeToManaged", 1);
  marshal_native_to_managed = marshal_native_to_managed.171;
  marshal_native_to_managed.172 = marshal_native_to_managed;
  D.25688 = marshal_native_to_managed.172 == 0B;
  D.25689 = (long int) D.25688;
  D.25690 = __builtin_expect (D.25689, 0);
  if (D.25690 != 0) goto <D.25691>; else goto <D.25692>;
  <D.25691>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5893, "marshal_native_to_managed");
  <D.25692>:
  <D.25660>:
  D.25693 = spec->data.custom_data.custom_name;
  D.25694 = m->image;
  mtype = mono_reflection_type_from_name (D.25693, D.25694);
  D.25695 = mtype == 0B;
  D.25696 = (long int) D.25695;
  D.25697 = __builtin_expect (D.25696, 0);
  if (D.25697 != 0) goto <D.25698>; else goto <D.25699>;
  <D.25698>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5897, "mtype != NULL");
  <D.25699>:
  mklass = mono_class_from_mono_type (mtype);
  D.25700 = mklass == 0B;
  D.25701 = (long int) D.25700;
  D.25702 = __builtin_expect (D.25701, 0);
  if (D.25702 != 0) goto <D.25703>; else goto <D.25704>;
  <D.25703>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5899, "mklass != NULL");
  <D.25704>:
  ICustomMarshaler.163 = ICustomMarshaler;
  D.25705 = mono_class_is_assignable_from (ICustomMarshaler.163, mklass);
  if (D.25705 == 0) goto <D.25706>; else goto <D.25707>;
  <D.25706>:
  D.25708 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement the ICustomMarshaler interface.", D.25708);
  <D.25707>:
  get_instance = mono_class_get_method_from_name_flags (mklass, "GetInstance", 1, 16);
  if (get_instance != 0B) goto <D.25709>; else goto <D.25710>;
  <D.25709>:
  {
    struct MonoMethodSignature * get_sig;

    get_sig = mono_method_signature (get_instance);
    D.25713 = get_sig->ret;
    D.25714 = D.25713->type;
    if (D.25714 != 18) goto <D.25711>; else goto <D.25715>;
    <D.25715>:
    D.25713 = get_sig->ret;
    D.25716 = mono_class_from_mono_type (D.25713);
    ICustomMarshaler.163 = ICustomMarshaler;
    if (D.25716 != ICustomMarshaler.163) goto <D.25711>; else goto <D.25717>;
    <D.25717>:
    D.25718 = get_sig->params[0];
    D.25719 = D.25718->type;
    if (D.25719 != 14) goto <D.25711>; else goto <D.25712>;
    <D.25711>:
    get_instance = 0B;
    <D.25712>:
  }
  <D.25710>:
  if (get_instance == 0B) goto <D.25720>; else goto <D.25721>;
  <D.25720>:
  D.25708 = 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.25708);
  <D.25721>:
  handle_exception:
  if (exception_msg != 0B) goto <D.25722>; else goto <D.25723>;
  <D.25722>:
  switch (action) <default: <D.20838>, case 0: <D.20833>, case 1: <D.20837>, case 3: <D.20834>, case 6: <D.20835>>
  <D.20833>:
  <D.20834>:
  <D.20835>:
  if (action == 3) goto <D.25724>; else goto <D.25726>;
  <D.25726>:
  if (action == 6) goto <D.25724>; else goto <D.25725>;
  <D.25724>:
  mono_mb_emit_byte (mb, 38);
  <D.25725>:
  mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
  monoeg_g_free (exception_msg);
  goto <D.20836>;
  <D.20837>:
  mono_mb_emit_byte (mb, 20);
  goto <D.20836>;
  <D.20838>:
  goto <D.20836>;
  <D.20836>:
  D.25727 = 0;
  return D.25727;
  <D.25723>:
  switch (action) <default: <D.20855>, case 0: <D.20839>, case 1: <D.20850>, case 2: <D.20849>, case 3: <D.20851>, case 4: <D.20852>, case 5: <D.20854>, case 6: <D.20853>>
  <D.20839>:
  D.25728 = t->type;
  D.25729 = (int) D.25728;
  switch (D.25729) <default: <D.20847>, case 14: <D.20842>, case 17: <D.20845>, case 18: <D.20840>, case 20: <D.20843>, case 28: <D.20841>, case 29: <D.20844>>
  <D.20840>:
  <D.20841>:
  <D.20842>:
  <D.20843>:
  <D.20844>:
  <D.20845>:
  goto <D.20846>;
  <D.20847>:
  D.25728 = t->type;
  D.25729 = (int) D.25728;
  monoeg_g_log (0B, 16, "custom marshalling of type %x is currently not supported", D.25729);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5955);
  <D.20846>:
  D.25730 = mono_defaults.int_class;
  D.25731 = &D.25730->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25731);
  mono_mb_emit_byte (mb, 20);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25735>; else goto <D.25736>;
  <D.25735>:
  D.25737 = t->attrs;
  D.25738 = (int) D.25737;
  D.25739 = D.25738 & 2;
  if (D.25739 != 0) goto <D.20848>; else goto <D.25740>;
  <D.25740>:
  <D.25736>:
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 == 0) goto <D.25741>; else goto <D.25742>;
  <D.25741>:
  D.25737 = t->attrs;
  D.25743 = (unsigned int) D.25737;
  D.25744 = D.25743 & 3;
  if (D.25744 == 2) goto <D.20848>; else goto <D.25745>;
  <D.25745>:
  <D.25742>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25747>; else goto <D.25748>;
  <D.25747>:
  mono_mb_emit_byte (mb, 77);
  <D.25748>:
  D.25749 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25749;
  D.25750 = spec->data.custom_data.cookie;
  D.25751 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25751);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25752>; else goto <D.25753>;
  <D.25752>:
  mono_mb_emit_byte (mb, 80);
  <D.25753>:
  D.25728 = t->type;
  if (D.25728 == 17) goto <D.25754>; else goto <D.25755>;
  <D.25754>:
  D.25730 = mono_defaults.int_class;
  D.25731 = &D.25730->byval_arg;
  *conv_arg_type = D.25731;
  D.25756 = mono_class_from_mono_type (t);
  mono_mb_emit_op (mb, 140, D.25756);
  <D.25755>:
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20849>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  D.25758 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25758;
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25759>; else goto <D.25760>;
  <D.25759>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25750 = spec->data.custom_data.cookie;
  D.25761 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25761);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_byte (mb, 81);
  goto <D.25762>;
  <D.25760>:
  D.25737 = t->attrs;
  D.25738 = (int) D.25737;
  D.25739 = D.25738 & 2;
  if (D.25739 != 0) goto <D.25763>; else goto <D.25764>;
  <D.25763>:
  D.25750 = spec->data.custom_data.cookie;
  D.25765 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25765);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_byte (mb, 38);
  <D.25764>:
  <D.25762>:
  D.25750 = spec->data.custom_data.cookie;
  D.25766 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25766);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  cleanup_native.166 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.166);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20850>:
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25767>; else goto <D.25768>;
  <D.25767>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.173);
  goto <D.25769>;
  <D.25768>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  <D.25769>:
  goto <D.20848>;
  <D.20851>:
  D.25730 = mono_defaults.int_class;
  D.25731 = &D.25730->byval_arg;
  D.25770 = mono_mb_add_local (mb, D.25731);
  loc1 = (guint32) D.25770;
  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.25771 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25771;
  D.25750 = spec->data.custom_data.cookie;
  D.25772 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25772);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_native.166 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.166);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20852>:
  D.25773 = mono_defaults.object_class;
  D.25774 = &D.25773->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25774);
  mono_mb_emit_byte (mb, 20);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25775>; else goto <D.25776>;
  <D.25775>:
  D.25737 = t->attrs;
  D.25738 = (int) D.25737;
  D.25739 = D.25738 & 2;
  if (D.25739 != 0) goto <D.20848>; else goto <D.25777>;
  <D.25777>:
  <D.25776>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25778>; else goto <D.25779>;
  <D.25778>:
  mono_mb_emit_byte (mb, 77);
  <D.25779>:
  D.25780 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25780;
  D.25750 = spec->data.custom_data.cookie;
  D.25781 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25781);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25782>; else goto <D.25783>;
  <D.25782>:
  mono_mb_emit_byte (mb, 77);
  <D.25783>:
  marshal_native_to_managed.172 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.172);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.173);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20853>:
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  D.25784 = D.25734 != 0;
  D.25785 = (long int) D.25784;
  D.25786 = __builtin_expect (D.25785, 0);
  if (D.25786 != 0) goto <D.25787>; else goto <D.25788>;
  <D.25787>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6102, "!t->byref");
  <D.25788>:
  D.25773 = mono_defaults.object_class;
  D.25774 = &D.25773->byval_arg;
  D.25789 = mono_mb_add_local (mb, D.25774);
  loc1 = (guint32) D.25789;
  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.25790 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25790;
  D.25750 = spec->data.custom_data.cookie;
  D.25791 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25791);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_managed.168 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.168);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20854>:
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  D.25792 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25792;
  D.25733 = BIT_FIELD_REF <*t, 64, 64>;
  D.25734 = D.25733 & 1073741824;
  if (D.25734 != 0) goto <D.25793>; else goto <D.25794>;
  <D.25793>:
  argnum.174 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.174);
  D.25750 = spec->data.custom_data.cookie;
  D.25795 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25795);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  marshal_managed_to_native.170 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.170);
  mono_mb_emit_byte (mb, 223);
  <D.25794>:
  D.25750 = spec->data.custom_data.cookie;
  D.25796 = monoeg_strdup (D.25750);
  mono_mb_emit_ldstr (mb, D.25796);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.173 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.173);
  cleanup_managed.168 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.168);
  pos2.175 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.175);
  goto <D.20848>;
  <D.20855>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6159);
  <D.20848>:
  D.25727 = conv_arg;
  return D.25727;
}


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.25800;
  unsigned char D.25801;
  _Bool D.25802;
  long int D.25803;
  long int D.25804;
  long unsigned int D.25807;
  long unsigned int D.25808;
  _Bool D.25809;
  long int D.25810;
  long int D.25811;
  struct MonoClass * D.25814;
  struct MonoType * D.25815;
  unsigned int argnum.176;
  int encoding.177;
  short unsigned int D.25818;
  int D.25819;
  unsigned int conv_arg.178;
  int encoding.179;
  int D.25822;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20872>, case 0: <D.20866>, case 1: <D.20869>, case 2: <D.20870>>
  <D.20866>:
  {
    MonoMarshalNative encoding;

    D.25800 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.25800, 0B);
    D.25801 = t->type;
    D.25802 = D.25801 != 28;
    D.25803 = (long int) D.25802;
    D.25804 = __builtin_expect (D.25803, 0);
    if (D.25804 != 0) goto <D.25805>; else goto <D.25806>;
    <D.25805>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6179, "t->type == MONO_TYPE_OBJECT");
    <D.25806>:
    D.25807 = BIT_FIELD_REF <*t, 64, 64>;
    D.25808 = D.25807 & 1073741824;
    D.25809 = D.25808 != 0;
    D.25810 = (long int) D.25809;
    D.25811 = __builtin_expect (D.25810, 0);
    if (D.25811 != 0) goto <D.25812>; else goto <D.25813>;
    <D.25812>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6180, "!t->byref");
    <D.25813>:
    D.25814 = mono_defaults.int_class;
    D.25815 = &D.25814->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.25815);
    argnum.176 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.176);
    encoding.177 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.177);
    D.25818 = t->attrs;
    D.25819 = (int) D.25818;
    mono_mb_emit_icon (mb, D.25819);
    mono_mb_emit_icall (mb, mono_marshal_asany);
    conv_arg.178 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.178);
    goto <D.20868>;
  }
  <D.20869>:
  conv_arg.178 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.178);
  goto <D.20868>;
  <D.20870>:
  {
    MonoMarshalNative encoding;

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


mono_marshal_get_string_encoding (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  <unnamed type> D.25826;
  <unnamed type> D.25829;
  MonoMarshalNative D.25834;
  short unsigned int D.25838;
  int D.25839;
  int D.25840;

  if (spec != 0B) goto <D.25824>; else goto <D.25825>;
  <D.25824>:
  D.25826 = spec->native;
  if (D.25826 == 42) goto <D.25827>; else goto <D.25828>;
  <D.25827>:
  D.25829 = spec->data.array_data.elem_type;
  if (D.25829 != 0) goto <D.25830>; else goto <D.25831>;
  <D.25830>:
  D.25829 = spec->data.array_data.elem_type;
  if (D.25829 != 80) goto <D.25832>; else goto <D.25833>;
  <D.25832>:
  D.25834 = spec->data.array_data.elem_type;
  return D.25834;
  <D.25833>:
  <D.25831>:
  goto <D.25835>;
  <D.25828>:
  D.25834 = spec->native;
  return D.25834;
  <D.25835>:
  <D.25825>:
  if (piinfo == 0B) goto <D.25836>; else goto <D.25837>;
  <D.25836>:
  D.25834 = 20;
  return D.25834;
  <D.25837>:
  D.25838 = piinfo->piflags;
  D.25839 = (int) D.25838;
  D.25840 = D.25839 & 6;
  switch (D.25840) <default: <D.19831>, case 2: <D.19828>, case 4: <D.19829>, case 6: <D.19830>>
  <D.19828>:
  D.25834 = 20;
  return D.25834;
  <D.19829>:
  D.25834 = 21;
  return D.25834;
  <D.19830>:
  D.25834 = 20;
  return D.25834;
  <D.19831>:
  D.25834 = 20;
  return D.25834;
}


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.25842;
  long unsigned int D.25843;
  long unsigned int D.25844;
  unsigned int argnum.180;
  unsigned int conv_arg.181;
  struct _IO_FILE * stderr.182;
  int D.25850;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20976>, case 0: <D.20965>, case 1: <D.20969>, case 2: <D.20970>, case 3: <D.20971>, case 4: <D.20973>, case 5: <D.20974>, case 6: <D.20975>>
  <D.20965>:
  {
    struct MonoType * intptr_type;

    D.25842 = mono_defaults.int_class;
    intptr_type = &D.25842->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    D.25843 = BIT_FIELD_REF <*t, 64, 64>;
    D.25844 = D.25843 & 1073741824;
    if (D.25844 != 0) goto <D.25845>; else goto <D.25846>;
    <D.25845>:
    {
      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.20968>;
    }
    <D.25846>:
    argnum.180 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.180);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 77);
    conv_arg.181 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.181);
    goto <D.20968>;
  }
  <D.20969>:
  conv_arg.181 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.181);
  goto <D.20968>;
  <D.20970>:
  goto <D.20968>;
  <D.20971>:
  {
    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.20968>;
  }
  <D.20973>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20968>;
  <D.20974>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20968>;
  <D.20975>:
  stderr.182 = stderr;
  fprintf (stderr.182, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20968>;
  <D.20976>:
  stderr.182 = stderr;
  fprintf (stderr.182, "Unhandled case for MarshalAction: %d\n", action);
  <D.20968>:
  D.25850 = conv_arg;
  return D.25850;
}


mono_mb_emit_exception_marshal_directive (struct MonoMethodBuilder * mb, char * msg)
{
  int D.25853;
  struct MonoMethod * D.25856;
  struct MonoClass * D.25857;
  struct MonoImage * D.25858;
  char * s;

  D.25853 = mb->dynamic;
  if (D.25853 == 0) goto <D.25854>; else goto <D.25855>;
  <D.25854>:
  D.25856 = mb->method;
  D.25857 = D.25856->klass;
  D.25858 = D.25857->image;
  s = mono_image_strdup (D.25858, msg);
  monoeg_g_free (msg);
  goto <D.25859>;
  <D.25855>:
  s = monoeg_strdup (msg);
  <D.25859>:
  mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
}


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

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


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.25862;
  struct MonoClass * D.25863;
  struct MonoType * D.25864;
  long unsigned int D.25865;
  long unsigned int D.25866;
  short unsigned int D.25869;
  int D.25870;
  int D.25871;
  unsigned int argnum.183;
  void * D.25878;
  unsigned int conv_arg.184;
  struct MonoMethod * m.185;
  struct MonoClass * D.25887;
  struct MonoMethod * m.186;
  _Bool D.25889;
  long int D.25890;
  long int D.25891;
  _Bool D.25896;
  long int D.25897;
  long int D.25898;
  unsigned int D.25904;
  unsigned int D.25905;
  void * D.25908;
  int need_free.187;
  void * D.25921;
  struct MonoClass * D.25925;
  struct MonoType * D.25926;
  void * D.25934;
  void * D.25939;
  void * D.25940;
  void * D.25944;
  int D.25945;
  struct MonoMethodBuilder * mb;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;
  gboolean need_free;

  try
    {
      mb = m->mb;
      D.25862 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25862, spec);
      D.25862 = m->piinfo;
      conv = mono_marshal_get_string_to_ptr_conv (D.25862, spec);
      switch (action) <default: <D.20927>, case 0: <D.20913>, case 1: <D.20920>, case 2: <D.20916>, case 3: <D.20921>, case 4: <D.20923>, case 5: <D.20925>, case 6: <D.20926>>
      <D.20913>:
      D.25863 = mono_defaults.int_class;
      D.25864 = &D.25863->byval_arg;
      *conv_arg_type = D.25864;
      D.25863 = mono_defaults.int_class;
      D.25864 = &D.25863->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25864);
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25867>; else goto <D.25868>;
      <D.25867>:
      D.25869 = t->attrs;
      D.25870 = (int) D.25869;
      D.25871 = D.25870 & 2;
      if (D.25871 != 0) goto <D.20914>; else goto <D.25872>;
      <D.25872>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      mono_mb_emit_byte (mb, 77);
      goto <D.25874>;
      <D.25868>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      <D.25874>:
      if (conv == 4294967295) goto <D.25875>; else goto <D.25876>;
      <D.25875>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
      }
      goto <D.25877>;
      <D.25876>:
      D.25878 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25878);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.184);
      <D.25877>:
      goto <D.20914>;
      <D.20916>:
      D.25862 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25862, spec, &need_free);
      if (conv == 4294967295) goto <D.25880>; else goto <D.25881>;
      <D.25880>:
      {
        char * msg;

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

        m.185 = m;
        if (m.185 == 0B) goto <D.25885>; else goto <D.25886>;
        <D.25885>:
        D.25887 = mono_defaults.string_class;
        m.186 = mono_class_get_method_from_name_flags (D.25887, "get_Length", -1, 0);
        m = m.186;
        m.185 = m;
        D.25889 = m.185 == 0B;
        D.25890 = (long int) D.25889;
        D.25891 = __builtin_expect (D.25890, 0);
        if (D.25891 != 0) goto <D.25892>; else goto <D.25893>;
        <D.25892>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6559, "m");
        <D.25893>:
        <D.25886>:
        D.25865 = BIT_FIELD_REF <*t, 64, 64>;
        D.25866 = D.25865 & 1073741824;
        if (D.25866 == 0) goto <D.25894>; else goto <D.25895>;
        <D.25894>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("VBByRefStr marshalling requires a ref parameter.", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.20914>;
        }
        <D.25895>:
        D.25865 = BIT_FIELD_REF <*t, 64, 64>;
        D.25866 = D.25865 & 1073741824;
        D.25896 = D.25866 == 0;
        D.25897 = (long int) D.25896;
        D.25898 = __builtin_expect (D.25897, 0);
        if (D.25898 != 0) goto <D.25899>; else goto <D.25900>;
        <D.25899>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6572, "t->byref");
        <D.25900>:
        argnum.183 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.183);
        conv_arg.184 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.184);
        argnum.183 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.183);
        mono_mb_emit_byte (mb, 77);
        m.185 = m;
        mono_mb_emit_managed_call (mb, m.185, 0B);
        mono_mb_emit_icall (mb, mono_string_new_len_wrapper);
        mono_mb_emit_byte (mb, 81);
      }
      goto <D.25901>;
      <D.25883>:
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25902>; else goto <D.25903>;
      <D.25902>:
      D.25869 = t->attrs;
      D.25904 = (unsigned int) D.25869;
      D.25905 = D.25904 & 3;
      if (D.25905 != 1) goto <D.25906>; else goto <D.25907>;
      <D.25906>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      D.25908 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25908);
      mono_mb_emit_byte (mb, 81);
      need_free = 1;
      <D.25907>:
      <D.25903>:
      <D.25901>:
      need_free.187 = need_free;
      if (need_free.187 != 0) goto <D.25910>; else goto <D.25911>;
      <D.25910>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      if (conv == 32) goto <D.25912>; else goto <D.25913>;
      <D.25912>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25914>;
      <D.25913>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25914>:
      <D.25911>:
      goto <D.20914>;
      <D.20920>:
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25917>; else goto <D.25915>;
      <D.25917>:
      if (encoding != 34) goto <D.25918>; else goto <D.25915>;
      <D.25918>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.184);
      goto <D.25916>;
      <D.25915>:
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      <D.25916>:
      goto <D.20914>;
      <D.20921>:
      mono_mb_emit_stloc (mb, 0);
      D.25862 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25862, spec, &need_free);
      if (conv == 4294967295) goto <D.25919>; else goto <D.25920>;
      <D.25919>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20914>;
      }
      <D.25920>:
      mono_mb_emit_ldloc (mb, 0);
      D.25921 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25921);
      mono_mb_emit_stloc (mb, 3);
      mono_mb_emit_ldloc (mb, 0);
      if (conv == 32) goto <D.25922>; else goto <D.25923>;
      <D.25922>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25924>;
      <D.25923>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25924>:
      goto <D.20914>;
      <D.20923>:
      D.25925 = mono_defaults.object_class;
      D.25926 = &D.25925->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25926);
      D.25863 = mono_defaults.int_class;
      D.25864 = &D.25863->byval_arg;
      *conv_arg_type = D.25864;
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25927>; else goto <D.25928>;
      <D.25927>:
      D.25869 = t->attrs;
      D.25870 = (int) D.25869;
      D.25871 = D.25870 & 2;
      if (D.25871 != 0) goto <D.20914>; else goto <D.25929>;
      <D.25929>:
      <D.25928>:
      D.25862 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25862, spec, &need_free);
      if (conv == 4294967295) goto <D.25930>; else goto <D.25931>;
      <D.25930>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20914>;
      }
      <D.25931>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25932>; else goto <D.25933>;
      <D.25932>:
      mono_mb_emit_byte (mb, 77);
      <D.25933>:
      D.25934 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25934);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.184);
      goto <D.20914>;
      <D.20925>:
      D.25865 = BIT_FIELD_REF <*t, 64, 64>;
      D.25866 = D.25865 & 1073741824;
      if (D.25866 != 0) goto <D.25935>; else goto <D.25936>;
      <D.25935>:
      if (conv_arg != 0) goto <D.25937>; else goto <D.25938>;
      <D.25937>:
      argnum.183 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.183);
      conv_arg.184 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.184);
      D.25939 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25939);
      mono_mb_emit_byte (mb, 223);
      <D.25938>:
      <D.25936>:
      goto <D.20914>;
      <D.20926>:
      D.25940 = conv_to_icall (conv);
      if (D.25940 == mono_marshal_string_to_utf16) goto <D.25941>; else goto <D.25942>;
      <D.25941>:
      mono_mb_emit_icall (mb, mono_marshal_string_to_utf16_copy);
      goto <D.25943>;
      <D.25942>:
      D.25944 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25944);
      <D.25943>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20914>;
      <D.20927>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6671);
      <D.20914>:
      D.25945 = conv_arg;
      return D.25945;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.19842>, case 19: <D.19841>, case 20: <D.19838>, case 21: <D.19837>, case 22: <D.19840>, case 34: <D.19839>>
  <D.19837>:
  D.25948 = 7;
  return D.25948;
  <D.19838>:
  <D.19839>:
  D.25948 = 4;
  return D.25948;
  <D.19840>:
  D.25948 = 9;
  return D.25948;
  <D.19841>:
  D.25948 = 3;
  return D.25948;
  <D.19842>:
  D.25948 = 4294967295;
  return D.25948;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.19863>, case 19: <D.19862>, case 20: <D.19859>, case 21: <D.19858>, case 22: <D.19861>, case 34: <D.19860>>
  <D.19858>:
  *need_free = 0;
  D.25950 = 8;
  return D.25950;
  <D.19859>:
  <D.19860>:
  D.25950 = 5;
  return D.25950;
  <D.19861>:
  D.25950 = 6;
  return D.25950;
  <D.19862>:
  D.25950 = 32;
  return D.25950;
  <D.19863>:
  D.25950 = 4294967295;
  return D.25950;
}


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

  switch (conv) <default: <D.19667>, case 3: <D.19649>, case 4: <D.19648>, case 5: <D.19646>, case 6: <D.19645>, case 7: <D.19643>, case 8: <D.19644>, case 9: <D.19647>, case 10: <D.19652>, case 11: <D.19651>, case 12: <D.19665>, case 13: <D.19666>, case 14: <D.19653>, case 15: <D.19654>, case 16: <D.19655>, case 17: <D.19661>, case 18: <D.19662>, case 19: <D.19663>, case 22: <D.19656>, case 23: <D.19657>, case 24: <D.19658>, case 29: <D.19659>, case 30: <D.19660>, case 31: <D.19664>, case 32: <D.19650>>
  <D.19643>:
  D.25952 = mono_marshal_string_to_utf16;
  return D.25952;
  <D.19644>:
  D.25952 = mono_string_from_utf16;
  return D.25952;
  <D.19645>:
  D.25952 = mono_string_new_wrapper;
  return D.25952;
  <D.19646>:
  D.25952 = mono_string_new_wrapper;
  return D.25952;
  <D.19647>:
  D.25952 = mono_string_to_lpstr;
  return D.25952;
  <D.19648>:
  D.25952 = mono_string_to_lpstr;
  return D.25952;
  <D.19649>:
  D.25952 = mono_string_to_bstr;
  return D.25952;
  <D.19650>:
  D.25952 = mono_string_from_bstr;
  return D.25952;
  <D.19651>:
  <D.19652>:
  D.25952 = mono_string_to_ansibstr;
  return D.25952;
  <D.19653>:
  D.25952 = mono_string_builder_to_utf8;
  return D.25952;
  <D.19654>:
  D.25952 = mono_string_builder_to_utf8;
  return D.25952;
  <D.19655>:
  D.25952 = mono_string_builder_to_utf16;
  return D.25952;
  <D.19656>:
  D.25952 = mono_array_to_savearray;
  return D.25952;
  <D.19657>:
  D.25952 = mono_array_to_lparray;
  return D.25952;
  <D.19658>:
  D.25952 = mono_free_lparray;
  return D.25952;
  <D.19659>:
  D.25952 = mono_delegate_to_ftnptr;
  return D.25952;
  <D.19660>:
  D.25952 = mono_ftnptr_to_delegate;
  return D.25952;
  <D.19661>:
  D.25952 = mono_string_utf8_to_builder;
  return D.25952;
  <D.19662>:
  D.25952 = mono_string_utf8_to_builder;
  return D.25952;
  <D.19663>:
  D.25952 = mono_string_utf16_to_builder;
  return D.25952;
  <D.19664>:
  D.25952 = mono_marshal_free_array;
  return D.25952;
  <D.19665>:
  D.25952 = mono_string_to_byvalstr;
  return D.25952;
  <D.19666>:
  D.25952 = mono_string_to_byvalwstr;
  return D.25952;
  <D.19667>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1582);
  D.25952 = 0B;
  return D.25952;
}


emit_marshal_variant (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethod * get_object_for_native_variant.188;
  struct MonoClass * D.25957;
  struct MonoMethod * get_object_for_native_variant.189;
  _Bool D.25959;
  long int D.25960;
  long int D.25961;
  struct MonoMethod * get_native_variant_for_object.190;
  struct MonoMethod * get_native_variant_for_object.191;
  _Bool D.25968;
  long int D.25969;
  long int D.25970;
  struct MonoClass * D.25973;
  struct MonoType * D.25974;
  long unsigned int D.25975;
  long unsigned int D.25976;
  struct MonoClass * D.25979;
  struct MonoType * D.25980;
  struct MonoClass * D.25982;
  struct MonoType * D.25983;
  short unsigned int D.25986;
  unsigned int D.25987;
  unsigned int D.25988;
  unsigned int argnum.192;
  unsigned int conv_arg.193;
  struct MonoMethod * variant_clear.194;
  struct MonoClass * D.25997;
  struct MonoMethod * variant_clear.195;
  _Bool D.25999;
  long int D.26000;
  long int D.26001;
  struct MonoClass * D.26011;
  struct MonoType * D.26012;
  struct MonoClass * D.26015;
  struct MonoType * D.26016;
  struct MonoClass * D.26018;
  struct MonoType * D.26019;
  int D.26030;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * get_object_for_native_variant = 0B;
  static struct MonoMethod * get_native_variant_for_object = 0B;

  mb = m->mb;
  get_object_for_native_variant.188 = get_object_for_native_variant;
  if (get_object_for_native_variant.188 == 0B) goto <D.25955>; else goto <D.25956>;
  <D.25955>:
  D.25957 = mono_defaults.marshal_class;
  get_object_for_native_variant.189 = mono_class_get_method_from_name (D.25957, "GetObjectForNativeVariant", 1);
  get_object_for_native_variant = get_object_for_native_variant.189;
  <D.25956>:
  get_object_for_native_variant.188 = get_object_for_native_variant;
  D.25959 = get_object_for_native_variant.188 == 0B;
  D.25960 = (long int) D.25959;
  D.25961 = __builtin_expect (D.25960, 0);
  if (D.25961 != 0) goto <D.25962>; else goto <D.25963>;
  <D.25962>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7411, "get_object_for_native_variant");
  <D.25963>:
  get_native_variant_for_object.190 = get_native_variant_for_object;
  if (get_native_variant_for_object.190 == 0B) goto <D.25965>; else goto <D.25966>;
  <D.25965>:
  D.25957 = mono_defaults.marshal_class;
  get_native_variant_for_object.191 = mono_class_get_method_from_name (D.25957, "GetNativeVariantForObject", 2);
  get_native_variant_for_object = get_native_variant_for_object.191;
  <D.25966>:
  get_native_variant_for_object.190 = get_native_variant_for_object;
  D.25968 = get_native_variant_for_object.190 == 0B;
  D.25969 = (long int) D.25968;
  D.25970 = __builtin_expect (D.25969, 0);
  if (D.25970 != 0) goto <D.25971>; else goto <D.25972>;
  <D.25971>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7415, "get_native_variant_for_object");
  <D.25972>:
  switch (action) <default: <D.21037>, case 0: <D.21026>, case 1: <D.21030>, case 2: <D.21028>, case 3: <D.21031>, case 4: <D.21033>, case 5: <D.21034>, case 6: <D.21035>>
  <D.21026>:
  D.25973 = mono_class_get_variant_class ();
  D.25974 = &D.25973->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25974);
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.25977>; else goto <D.25978>;
  <D.25977>:
  D.25979 = mono_class_get_variant_class ();
  D.25980 = &D.25979->this_arg;
  *conv_arg_type = D.25980;
  goto <D.25981>;
  <D.25978>:
  D.25982 = mono_class_get_variant_class ();
  D.25983 = &D.25982->byval_arg;
  *conv_arg_type = D.25983;
  <D.25981>:
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.25984>; else goto <D.25985>;
  <D.25984>:
  D.25986 = t->attrs;
  D.25987 = (unsigned int) D.25986;
  D.25988 = D.25987 & 3;
  if (D.25988 == 2) goto <D.21027>; else goto <D.25989>;
  <D.25989>:
  <D.25985>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.25991>; else goto <D.25992>;
  <D.25991>:
  mono_mb_emit_byte (mb, 80);
  <D.25992>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  get_native_variant_for_object.190 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.190, 0B);
  goto <D.21027>;
  <D.21028>:
  {
    static struct MonoMethod * variant_clear = 0B;

    variant_clear.194 = variant_clear;
    if (variant_clear.194 == 0B) goto <D.25995>; else goto <D.25996>;
    <D.25995>:
    D.25997 = mono_class_get_variant_class ();
    variant_clear.195 = mono_class_get_method_from_name (D.25997, "Clear", 0);
    variant_clear = variant_clear.195;
    <D.25996>:
    variant_clear.194 = variant_clear;
    D.25999 = variant_clear.194 == 0B;
    D.26000 = (long int) D.25999;
    D.26001 = __builtin_expect (D.26000, 0);
    if (D.26001 != 0) goto <D.26002>; else goto <D.26003>;
    <D.26002>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7442, "variant_clear");
    <D.26003>:
    D.25975 = BIT_FIELD_REF <*t, 64, 64>;
    D.25976 = D.25975 & 1073741824;
    if (D.25976 != 0) goto <D.26004>; else goto <D.26005>;
    <D.26004>:
    D.25986 = t->attrs;
    D.25987 = (unsigned int) D.25986;
    D.25988 = D.25987 & 3;
    if (D.25988 != 1) goto <D.26006>; else goto <D.26007>;
    <D.26006>:
    argnum.192 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.192);
    conv_arg.193 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.193);
    get_object_for_native_variant.188 = get_object_for_native_variant;
    mono_mb_emit_managed_call (mb, get_object_for_native_variant.188, 0B);
    mono_mb_emit_byte (mb, 81);
    <D.26007>:
    <D.26005>:
    conv_arg.193 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.193);
    variant_clear.194 = variant_clear;
    mono_mb_emit_managed_call (mb, variant_clear.194, 0B);
    goto <D.21027>;
  }
  <D.21030>:
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.26008>; else goto <D.26009>;
  <D.26008>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  goto <D.26010>;
  <D.26009>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  <D.26010>:
  goto <D.21027>;
  <D.21031>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.21027>;
  }
  <D.21033>:
  D.26011 = mono_defaults.object_class;
  D.26012 = &D.26011->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26012);
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.26013>; else goto <D.26014>;
  <D.26013>:
  D.26015 = mono_class_get_variant_class ();
  D.26016 = &D.26015->this_arg;
  *conv_arg_type = D.26016;
  goto <D.26017>;
  <D.26014>:
  D.26018 = mono_class_get_variant_class ();
  D.26019 = &D.26018->byval_arg;
  *conv_arg_type = D.26019;
  <D.26017>:
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.26020>; else goto <D.26021>;
  <D.26020>:
  D.25986 = t->attrs;
  D.25987 = (unsigned int) D.25986;
  D.25988 = D.25987 & 3;
  if (D.25988 == 2) goto <D.21027>; else goto <D.26022>;
  <D.26022>:
  <D.26021>:
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.26023>; else goto <D.26024>;
  <D.26023>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  goto <D.26025>;
  <D.26024>:
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.192);
  <D.26025>:
  get_object_for_native_variant.188 = get_object_for_native_variant;
  mono_mb_emit_managed_call (mb, get_object_for_native_variant.188, 0B);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  goto <D.21027>;
  <D.21034>:
  D.25975 = BIT_FIELD_REF <*t, 64, 64>;
  D.25976 = D.25975 & 1073741824;
  if (D.25976 != 0) goto <D.26026>; else goto <D.26027>;
  <D.26026>:
  D.25986 = t->attrs;
  D.25987 = (unsigned int) D.25986;
  D.25988 = D.25987 & 3;
  if (D.25988 != 1) goto <D.26028>; else goto <D.26029>;
  <D.26028>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  argnum.192 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.192);
  get_native_variant_for_object.190 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.190, 0B);
  <D.26029>:
  <D.26027>:
  goto <D.21027>;
  <D.21035>:
  {
    char * msg;

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


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.26032;
  struct MonoMethod * sh_dangerous_add_ref.196;
  unsigned int argnum.197;
  unsigned int D.26037;
  unsigned int pos.198;
  long unsigned int D.26039;
  long unsigned int D.26040;
  unsigned int conv_arg.199;
  struct MonoClass * D.26044;
  struct MonoType * D.26045;
  unsigned int dar_release_slot.200;
  struct MonoMethod * sh_dangerous_release.201;
  struct MonoClass * D.26055;
  unsigned int dar_release_slot.202;
  unsigned int D.26060;
  unsigned int label_next.203;
  unsigned int D.26062;
  unsigned int D.26063;
  gchar * D.26066;
  struct MonoType * D.26069;
  unsigned int intptr_handle_slot.204;
  struct _IO_FILE * stderr.205;
  int D.26072;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20954>, case 0: <D.20938>, case 1: <D.20943>, case 2: <D.20944>, case 3: <D.20948>, case 4: <D.20951>, case 5: <D.20952>, case 6: <D.20953>>
  <D.20938>:
  {
    struct MonoType * intptr_type;
    int dar_release_slot;
    int pos;

    D.26032 = mono_defaults.int_class;
    intptr_type = &D.26032->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    sh_dangerous_add_ref.196 = sh_dangerous_add_ref;
    if (sh_dangerous_add_ref.196 == 0B) goto <D.26034>; else goto <D.26035>;
    <D.26034>:
    init_safe_handle ();
    <D.26035>:
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    D.26037 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.26037;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.198 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.198);
    D.26039 = BIT_FIELD_REF <*t, 64, 64>;
    D.26040 = D.26039 & 1073741824;
    if (D.26040 != 0) goto <D.26041>; else goto <D.26042>;
    <D.26041>:
    mono_mb_emit_icon (mb, 0);
    conv_arg.199 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.199);
    goto <D.20942>;
    <D.26042>:
    D.26044 = mono_defaults.boolean_class;
    D.26045 = &D.26044->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.26045);
    mono_mb_emit_icon (mb, 0);
    dar_release_slot.200 = (unsigned int) dar_release_slot;
    mono_mb_emit_stloc (mb, dar_release_slot.200);
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    dar_release_slot.200 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc_addr (mb, dar_release_slot.200);
    sh_dangerous_add_ref.196 = sh_dangerous_add_ref;
    mono_mb_emit_managed_call (mb, sh_dangerous_add_ref.196, 0B);
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    mono_mb_emit_ldflda (mb, 16);
    mono_mb_emit_byte (mb, 77);
    conv_arg.199 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.199);
    goto <D.20942>;
  }
  <D.20943>:
  D.26039 = BIT_FIELD_REF <*t, 64, 64>;
  D.26040 = D.26039 & 1073741824;
  if (D.26040 != 0) goto <D.26047>; else goto <D.26048>;
  <D.26047>:
  conv_arg.199 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.199);
  goto <D.26049>;
  <D.26048>:
  conv_arg.199 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.199);
  <D.26049>:
  goto <D.20942>;
  <D.20944>:
  {
    int dar_release_slot;
    int label_next;

    dar_release_slot = conv_arg + 1;
    sh_dangerous_release.201 = sh_dangerous_release;
    if (sh_dangerous_release.201 == 0B) goto <D.26051>; else goto <D.26052>;
    <D.26051>:
    init_safe_handle ();
    <D.26052>:
    D.26039 = BIT_FIELD_REF <*t, 64, 64>;
    D.26040 = D.26039 & 1073741824;
    if (D.26040 != 0) goto <D.26053>; else goto <D.26054>;
    <D.26053>:
    {
      struct MonoMethod * ctor;

      D.26055 = t->data.klass;
      ctor = mono_class_get_method_from_name (D.26055, ".ctor", 0);
      if (ctor == 0B) goto <D.26056>; else goto <D.26057>;
      <D.26056>:
      mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
      goto <D.20942>;
      <D.26057>:
      argnum.197 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.197);
      mono_mb_emit_op (mb, 115, ctor);
      mono_mb_emit_byte (mb, 81);
      argnum.197 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.197);
      mono_mb_emit_byte (mb, 80);
      mono_mb_emit_ldflda (mb, 16);
      conv_arg.199 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.199);
      mono_mb_emit_byte (mb, 223);
    }
    goto <D.26058>;
    <D.26054>:
    dar_release_slot.202 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc (mb, dar_release_slot.202);
    D.26060 = mono_mb_emit_branch (mb, 57);
    label_next = (int) D.26060;
    argnum.197 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.197);
    sh_dangerous_release.201 = sh_dangerous_release;
    mono_mb_emit_managed_call (mb, sh_dangerous_release.201, 0B);
    label_next.203 = (unsigned int) label_next;
    mono_mb_patch_branch (mb, label_next.203);
    <D.26058>:
    goto <D.20942>;
  }
  <D.20948>:
  {
    struct MonoMethod * ctor;
    int intptr_handle_slot;

    ctor = 0B;
    D.26055 = t->data.klass;
    D.26062 = D.26055->flags;
    D.26063 = D.26062 & 128;
    if (D.26063 != 0) goto <D.26064>; else goto <D.26065>;
    <D.26064>:
    mono_mb_emit_byte (mb, 38);
    D.26066 = monoeg_strdup ("Returned SafeHandles should not be abstract");
    mono_mb_emit_exception_marshal_directive (mb, D.26066);
    goto <D.20942>;
    <D.26065>:
    D.26055 = t->data.klass;
    ctor = mono_class_get_method_from_name (D.26055, ".ctor", 0);
    if (ctor == 0B) goto <D.26067>; else goto <D.26068>;
    <D.26067>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
    goto <D.20942>;
    <D.26068>:
    D.26032 = mono_defaults.int_class;
    D.26069 = &D.26032->byval_arg;
    intptr_handle_slot = mono_mb_add_local (mb, D.26069);
    intptr_handle_slot.204 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_stloc (mb, intptr_handle_slot.204);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_stloc (mb, 3);
    mono_mb_emit_ldloc (mb, 3);
    mono_mb_emit_ldflda (mb, 16);
    intptr_handle_slot.204 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_ldloc (mb, intptr_handle_slot.204);
    mono_mb_emit_byte (mb, 223);
    goto <D.20942>;
  }
  <D.20951>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20942>;
  <D.20952>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20942>;
  <D.20953>:
  stderr.205 = stderr;
  fprintf (stderr.205, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20942>;
  <D.20954>:
  printf ("Unhandled case for MarshalAction: %d\n", action);
  <D.20942>:
  D.26072 = conv_arg;
  return D.26072;
}


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

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


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

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


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.26079;
  struct MonoClass * D.26080;
  struct MonoType * D.26081;
  struct MonoClass * D.26082;
  long unsigned int D.26083;
  long unsigned int D.26084;
  unsigned int argnum.208;
  long unsigned int D.26088;
  long unsigned int D.26089;
  void * D.26092;
  unsigned int conv_arg.209;
  struct MonoClass * D.26095;
  struct MonoType * D.26096;
  struct MonoClass * D.26097;
  struct MonoClass * D.26101;
  unsigned int src_var.210;
  struct MonoClass * D.26115;
  int iftmp.211;
  int D.26119;
  unsigned int dest_ptr.212;
  unsigned int index_var.213;
  int D.26128;
  void * D.26131;
  MonoMarshalNative iftmp.214;
  short unsigned int D.26137;
  short unsigned int D.26138;
  int iftmp.215;
  short unsigned int D.26148;
  int D.26149;
  int D.26150;
  struct MonoType * D.26151;
  int need_free.216;
  int need_free.217;
  int D.26154;
  int iftmp.218;
  int D.26164;
  unsigned int src_ptr.219;
  unsigned int index_var.220;
  int D.26173;
  _Bool D.26178;
  long int D.26179;
  long int D.26180;
  void * D.26185;
  MonoMarshalNative iftmp.221;
  unsigned int loc.222;
  short unsigned int D.26205;
  short unsigned int D.26206;
  void * D.26209;
  int D.26215;
  <unnamed type> D.26218;
  short int D.26221;
  short int D.26222;
  struct MonoMethodSignature * D.26240;
  short unsigned int D.26241;
  int D.26242;
  struct MonoType * D.26245;
  unsigned char D.26246;
  int D.26247;
  unsigned int src_ptr.223;
  unsigned int param_num.224;
  long unsigned int D.26255;
  long unsigned int D.26256;
  unsigned int index_var.225;
  int D.26260;
  _Bool D.26263;
  long int D.26264;
  long int D.26265;
  void * D.26268;
  short unsigned int D.26270;
  short unsigned int D.26271;
  _Bool D.26273;
  long int D.26274;
  long int D.26275;
  _Bool D.26278;
  long int D.26279;
  long int D.26280;
  _Bool D.26283;
  long int D.26284;
  long int D.26285;
  unsigned int dest_ptr.226;
  long unsigned int D.26304;
  long unsigned int D.26305;
  unsigned int index_var.227;
  int D.26309;
  _Bool D.26312;
  long int D.26313;
  long int D.26314;
  void * D.26317;
  short unsigned int D.26319;
  short unsigned int D.26320;
  int iftmp.228;
  int D.26332;
  unsigned int src.229;
  unsigned int dest.230;
  unsigned int index_var.231;
  int D.26342;
  _Bool D.26345;
  long int D.26346;
  long int D.26347;
  void * D.26350;
  short unsigned int D.26352;
  short unsigned int D.26353;
  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.26079 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.26079, spec);
      switch (action) <default: <D.21143>, case 0: <D.21059>, case 1: <D.21083>, case 2: <D.21072>, case 3: <D.21084>, case 4: <D.21085>, case 5: <D.21117>, case 6: <D.21131>>
      <D.21059>:
      D.26080 = mono_defaults.object_class;
      D.26081 = &D.26080->byval_arg;
      *conv_arg_type = D.26081;
      D.26080 = mono_defaults.object_class;
      D.26081 = &D.26080->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.26081);
      D.26082 = klass->element_class;
      D.26083 = BIT_FIELD_REF <*D.26082, 64, 256>;
      D.26084 = D.26083 & 32;
      if (D.26084 != 0) goto <D.26085>; else goto <D.26086>;
      <D.26085>:
      argnum.208 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.208);
      D.26088 = BIT_FIELD_REF <*t, 64, 64>;
      D.26089 = D.26088 & 1073741824;
      if (D.26089 != 0) goto <D.26090>; else goto <D.26091>;
      <D.26090>:
      mono_mb_emit_byte (mb, 77);
      <D.26091>:
      D.26092 = conv_to_icall (23);
      mono_mb_emit_icall (mb, D.26092);
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.209);
      goto <D.26094>;
      <D.26086>:
      {
        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.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.26096);
        eklass = klass->element_class;
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26098>; else goto <D.26099>;
        <D.26098>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.26079, spec);
        goto <D.26100>;
        <D.26099>:
        D.26101 = mono_defaults.stringbuilder_class;
        if (D.26101 == eklass) goto <D.26102>; else goto <D.26103>;
        <D.26102>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.26079, spec);
        goto <D.26104>;
        <D.26103>:
        conv = 4294967295;
        <D.26104>:
        <D.26100>:
        if (is_string != 0) goto <D.26105>; else goto <D.26106>;
        <D.26105>:
        if (conv == 4294967295) goto <D.26107>; else goto <D.26108>;
        <D.26107>:
        {
          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.21071>;
        }
        <D.26108>:
        <D.26106>:
        D.26080 = mono_defaults.object_class;
        D.26081 = &D.26080->byval_arg;
        src_var = mono_mb_add_local (mb, D.26081);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        if (D.26089 != 0) goto <D.26109>; else goto <D.26110>;
        <D.26109>:
        mono_mb_emit_byte (mb, 77);
        <D.26110>:
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_stloc (mb, src_var.210);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        label1 = mono_mb_emit_branch (mb, 57);
        if (is_string != 0) goto <D.26112>; else goto <D.26113>;
        <D.26112>:
        esize = 8;
        goto <D.26114>;
        <D.26113>:
        D.26115 = mono_defaults.char_class;
        if (D.26115 == eklass) goto <D.26116>; else goto <D.26117>;
        <D.26116>:
        D.26079 = m->piinfo;
        D.26119 = mono_pinvoke_is_unicode (D.26079);
        if (D.26119 != 0) goto <D.26120>; else goto <D.26121>;
        <D.26120>:
        iftmp.211 = 2;
        goto <D.26122>;
        <D.26121>:
        iftmp.211 = 1;
        <D.26122>:
        esize = iftmp.211;
        goto <D.26123>;
        <D.26117>:
        esize = mono_class_native_size (eklass, 0B);
        <D.26123>:
        <D.26114>:
        mono_mb_emit_icon (mb, esize);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        mono_mb_emit_byte (mb, 142);
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26124>; else goto <D.26125>;
        <D.26124>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.26125>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 15);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.212);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        index_var = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 22);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.213);
        D.26128 = mono_mb_get_label (mb);
        label2 = (guint32) D.26128;
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.26129>; else goto <D.26130>;
        <D.26129>:
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        mono_mb_emit_byte (mb, 154);
        D.26131 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26131);
        mono_mb_emit_byte (mb, 223);
        goto <D.26132>;
        <D.26130>:
        src_var.210 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.210);
        index_var.213 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.213);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 0);
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        mono_mb_emit_stloc (mb, 1);
        D.26115 = mono_defaults.char_class;
        if (D.26115 == eklass) goto <D.26134>; else goto <D.26135>;
        <D.26134>:
        iftmp.214 = encoding;
        goto <D.26136>;
        <D.26135>:
        iftmp.214 = 4294967295;
        <D.26136>:
        emit_struct_conv_full (mb, eklass, 0, iftmp.214);
        <D.26132>:
        D.26137 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.26137, 1);
        D.26138 = (short unsigned int) dest_ptr;
        mono_mb_emit_add_to_local (mb, D.26138, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26139>; else goto <D.26140>;
        <D.26139>:
        dest_ptr.212 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.212);
        mono_mb_emit_byte (mb, 22);
        mono_mb_emit_byte (mb, 81);
        <D.26140>:
        mono_mb_patch_branch (mb, label1);
      }
      <D.26094>:
      goto <D.21071>;
      <D.21072>:
      D.26082 = klass->element_class;
      D.26115 = mono_defaults.char_class;
      if (D.26082 == D.26115) goto <D.26146>; else goto <D.26142>;
      <D.26146>:
      if (encoding == 21) goto <D.26143>; else goto <D.26142>;
      <D.26142>:
      D.26082 = klass->element_class;
      D.26101 = mono_defaults.stringbuilder_class;
      if (D.26082 == D.26101) goto <D.26143>; else goto <D.26147>;
      <D.26147>:
      D.26148 = t->attrs;
      D.26149 = (int) D.26148;
      D.26150 = D.26149 & 2;
      if (D.26150 != 0) goto <D.26143>; else goto <D.26144>;
      <D.26143>:
      iftmp.215 = 1;
      goto <D.26145>;
      <D.26144>:
      iftmp.215 = 0;
      <D.26145>:
      need_convert = iftmp.215;
      D.26082 = klass->element_class;
      D.26151 = &D.26082->byval_arg;
      D.26079 = m->piinfo;
      need_free.216 = mono_marshal_need_free (D.26151, D.26079, spec);
      need_free = need_free.216;
      need_free.217 = need_free;
      D.26154 = need_convert | need_free.217;
      if (D.26154 != 0) goto <D.26155>; else goto <D.26156>;
      <D.26155>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;

        eklass = klass->element_class;
        D.26101 = mono_defaults.stringbuilder_class;
        if (D.26101 == eklass) goto <D.26157>; else goto <D.26160>;
        <D.26160>:
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26157>; else goto <D.26158>;
        <D.26157>:
        esize = 8;
        goto <D.26159>;
        <D.26158>:
        D.26115 = mono_defaults.char_class;
        if (D.26115 == eklass) goto <D.26161>; else goto <D.26162>;
        <D.26161>:
        D.26079 = m->piinfo;
        D.26164 = mono_pinvoke_is_unicode (D.26079);
        if (D.26164 != 0) goto <D.26165>; else goto <D.26166>;
        <D.26165>:
        iftmp.218 = 2;
        goto <D.26167>;
        <D.26166>:
        iftmp.218 = 1;
        <D.26167>:
        esize = iftmp.218;
        goto <D.26168>;
        <D.26162>:
        esize = mono_class_native_size (eklass, 0B);
        <D.26168>:
        <D.26159>:
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.26096);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        loc = mono_mb_add_local (mb, D.26096);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        if (D.26089 != 0) goto <D.26169>; else goto <D.26170>;
        <D.26169>:
        mono_mb_emit_byte (mb, 77);
        <D.26170>:
        label1 = mono_mb_emit_branch (mb, 57);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.219);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        index_var = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 22);
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.220);
        D.26173 = mono_mb_get_label (mb);
        label2 = (guint32) D.26173;
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.220);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        if (D.26089 != 0) goto <D.26174>; else goto <D.26175>;
        <D.26174>:
        mono_mb_emit_byte (mb, 80);
        <D.26175>:
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        D.26101 = mono_defaults.stringbuilder_class;
        if (D.26101 == eklass) goto <D.26176>; else goto <D.26177>;
        <D.26176>:
        {
          gboolean need_free2;
          MonoMarshalConv conv;

          try
            {
              D.26079 = m->piinfo;
              conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.26079, spec, &need_free2);
              D.26178 = conv == 4294967295;
              D.26179 = (long int) D.26178;
              D.26180 = __builtin_expect (D.26179, 0);
              if (D.26180 != 0) goto <D.26181>; else goto <D.26182>;
              <D.26181>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7735, "conv != -1");
              <D.26182>:
              argnum.208 = (unsigned int) argnum;
              mono_mb_emit_ldarg (mb, argnum.208);
              D.26088 = BIT_FIELD_REF <*t, 64, 64>;
              D.26089 = D.26088 & 1073741824;
              if (D.26089 != 0) goto <D.26183>; else goto <D.26184>;
              <D.26183>:
              mono_mb_emit_byte (mb, 77);
              <D.26184>:
              index_var.220 = (unsigned int) index_var;
              mono_mb_emit_ldloc (mb, index_var.220);
              mono_mb_emit_byte (mb, 154);
              src_ptr.219 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.219);
              mono_mb_emit_byte (mb, 77);
              D.26185 = conv_to_icall (conv);
              mono_mb_emit_icall (mb, D.26185);
              need_free.217 = need_free;
              if (need_free.217 != 0) goto <D.26186>; else goto <D.26187>;
              <D.26186>:
              src_ptr.219 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.219);
              mono_mb_emit_byte (mb, 77);
              mono_mb_emit_icall (mb, mono_marshal_free);
              <D.26187>:
            }
          finally
            {
              need_free2 = {CLOBBER};
            }
        }
        goto <D.26188>;
        <D.26177>:
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26189>; else goto <D.26190>;
        <D.26189>:
        need_free.217 = need_free;
        if (need_free.217 != 0) goto <D.26191>; else goto <D.26192>;
        <D.26191>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        mono_mb_emit_byte (mb, 77);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.26192>:
        goto <D.26193>;
        <D.26190>:
        if (need_convert != 0) goto <D.26194>; else goto <D.26195>;
        <D.26194>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        mono_mb_emit_stloc (mb, 0);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        if (D.26089 != 0) goto <D.26196>; else goto <D.26197>;
        <D.26196>:
        mono_mb_emit_byte (mb, 80);
        <D.26197>:
        index_var.220 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.220);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 1);
        D.26115 = mono_defaults.char_class;
        if (D.26115 == eklass) goto <D.26199>; else goto <D.26200>;
        <D.26199>:
        iftmp.221 = encoding;
        goto <D.26201>;
        <D.26200>:
        iftmp.221 = 4294967295;
        <D.26201>:
        emit_struct_conv_full (mb, eklass, 1, iftmp.221);
        <D.26195>:
        need_free.217 = need_free;
        if (need_free.217 != 0) goto <D.26202>; else goto <D.26203>;
        <D.26202>:
        src_ptr.219 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.219);
        loc.222 = (unsigned int) loc;
        mono_mb_emit_stloc (mb, loc.222);
        loc.222 = (unsigned int) loc;
        mono_mb_emit_ldloc (mb, loc.222);
        emit_struct_free (mb, eklass, loc);
        <D.26203>:
        <D.26193>:
        <D.26188>:
        D.26205 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.26205, 1);
        D.26206 = (short unsigned int) src_ptr;
        mono_mb_emit_add_to_local (mb, D.26206, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
      }
      <D.26156>:
      D.26082 = klass->element_class;
      D.26083 = BIT_FIELD_REF <*D.26082, 64, 256>;
      D.26084 = D.26083 & 32;
      if (D.26084 != 0) goto <D.26207>; else goto <D.26208>;
      <D.26207>:
      argnum.208 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.208);
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.209);
      D.26209 = conv_to_icall (24);
      mono_mb_emit_icall (mb, D.26209);
      <D.26208>:
      goto <D.21071>;
      <D.21083>:
      D.26088 = BIT_FIELD_REF <*t, 64, 64>;
      D.26089 = D.26088 & 1073741824;
      if (D.26089 != 0) goto <D.26210>; else goto <D.26211>;
      <D.26210>:
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.209);
      goto <D.26212>;
      <D.26211>:
      conv_arg.209 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.209);
      <D.26212>:
      goto <D.21071>;
      <D.21084>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.21071>;
      <D.21085>:
      {
        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.26080 = mono_defaults.object_class;
        D.26081 = &D.26080->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.26081);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        *conv_arg_type = D.26096;
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        if (D.26089 != 0) goto <D.26213>; else goto <D.26214>;
        <D.26213>:
        {
          char * msg;

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

          msg = monoeg_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.26215 = conv_arg;
          return D.26215;
        }
        <D.26217>:
        D.26218 = spec->native;
        if (D.26218 != 42) goto <D.26219>; else goto <D.26220>;
        <D.26219>:
        {
          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.26215 = conv_arg;
          return D.26215;
        }
        <D.26220>:
        D.26221 = spec->data.array_data.param_num;
        param_num = (int) D.26221;
        num_elem = spec->data.array_data.num_elem;
        D.26222 = spec->data.array_data.elem_mult;
        if (D.26222 == 0) goto <D.26223>; else goto <D.26224>;
        <D.26223>:
        param_num = -1;
        <D.26224>:
        if (param_num == -1) goto <D.26225>; else goto <D.26226>;
        <D.26225>:
        if (num_elem <= 0) goto <D.26227>; else goto <D.26228>;
        <D.26227>:
        {
          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.26215 = conv_arg;
          return D.26215;
        }
        <D.26228>:
        <D.26226>:
        eklass = klass->element_class;
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26229>; else goto <D.26230>;
        <D.26229>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_ptr_to_string_conv (D.26079, spec, &need_free);
        goto <D.26231>;
        <D.26230>:
        D.26101 = mono_defaults.stringbuilder_class;
        if (D.26101 == eklass) goto <D.26232>; else goto <D.26233>;
        <D.26232>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.26079, spec, &need_free);
        goto <D.26234>;
        <D.26233>:
        conv = 4294967295;
        <D.26234>:
        <D.26231>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.26235>; else goto <D.26236>;
        <D.26235>:
        esize = 8;
        goto <D.26237>;
        <D.26236>:
        esize = mono_class_native_size (eklass, 0B);
        <D.26237>:
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.26096);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        loc = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 20);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        if (param_num != -1) goto <D.26238>; else goto <D.26239>;
        <D.26238>:
        D.26240 = m->sig;
        D.26241 = D.26240->param_count;
        D.26242 = (int) D.26241;
        if (D.26242 <= param_num) goto <D.26243>; else goto <D.26244>;
        <D.26243>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter index is out of range.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.26215 = conv_arg;
          return D.26215;
        }
        <D.26244>:
        D.26240 = m->sig;
        D.26245 = D.26240->params[param_num];
        D.26246 = D.26245->type;
        D.26247 = (int) D.26246;
        switch (D.26247) <default: <D.21114>, case 4: <D.21103>, case 5: <D.21104>, case 6: <D.21105>, case 7: <D.21106>, case 8: <D.21107>, case 9: <D.21108>, case 10: <D.21111>, case 11: <D.21112>, case 24: <D.21109>, case 25: <D.21110>>
        <D.21103>:
        <D.21104>:
        <D.21105>:
        <D.21106>:
        <D.21107>:
        <D.21108>:
        <D.21109>:
        <D.21110>:
        <D.21111>:
        <D.21112>:
        goto <D.21113>;
        <D.21114>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter must be an integral type.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.26215 = conv_arg;
          return D.26215;
        }
        <D.21113>:
        <D.26239>:
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        src_ptr.223 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.223);
        if (param_num == -1) goto <D.26249>; else goto <D.26250>;
        <D.26249>:
        mono_mb_emit_icon (mb, num_elem);
        goto <D.26251>;
        <D.26250>:
        param_num.224 = (unsigned int) param_num;
        mono_mb_emit_ldarg (mb, param_num.224);
        if (num_elem > 0) goto <D.26253>; else goto <D.26254>;
        <D.26253>:
        mono_mb_emit_icon (mb, num_elem);
        mono_mb_emit_byte (mb, 88);
        <D.26254>:
        mono_mb_emit_byte (mb, 212);
        <D.26251>:
        mono_mb_emit_op (mb, 141, eklass);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.209);
        D.26255 = BIT_FIELD_REF <*eklass, 64, 256>;
        D.26256 = D.26255 & 32;
        if (D.26256 != 0) goto <D.26257>; else goto <D.26258>;
        <D.26257>:
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 32);
        mono_mb_emit_byte (mb, 88);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.21071>;
        <D.26258>:
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        index_var = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 22);
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.225);
        D.26260 = mono_mb_get_label (mb);
        label2 = (guint32) D.26260;
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.225);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.26261>; else goto <D.26262>;
        <D.26261>:
        D.26263 = conv == 4294967295;
        D.26264 = (long int) D.26263;
        D.26265 = __builtin_expect (D.26264, 0);
        if (D.26265 != 0) goto <D.26266>; else goto <D.26267>;
        <D.26266>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7976, "conv != -1");
        <D.26267>:
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        index_var.225 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.225);
        src_ptr.223 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.223);
        mono_mb_emit_byte (mb, 77);
        D.26268 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26268);
        mono_mb_emit_byte (mb, 162);
        goto <D.26269>;
        <D.26262>:
        {
          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.26215 = conv_arg;
          return D.26215;
        }
        <D.26269>:
        D.26270 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.26270, 1);
        D.26271 = (short unsigned int) src_ptr;
        mono_mb_emit_add_to_local (mb, D.26271, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.21071>;
      }
      <D.21117>:
      {
        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.21071>; else goto <D.26272>;
        <D.26272>:
        D.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        D.26273 = D.26089 != 0;
        D.26274 = (long int) D.26273;
        D.26275 = __builtin_expect (D.26274, 0);
        if (D.26275 != 0) goto <D.26276>; else goto <D.26277>;
        <D.26276>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8015, "!t->byref");
        <D.26277>:
        D.26218 = spec->native;
        D.26278 = D.26218 != 42;
        D.26279 = (long int) D.26278;
        D.26280 = __builtin_expect (D.26279, 0);
        if (D.26280 != 0) goto <D.26281>; else goto <D.26282>;
        <D.26281>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8016, "spec->native == MONO_NATIVE_LPARRAY");
        <D.26282>:
        D.26148 = t->attrs;
        D.26149 = (int) D.26148;
        D.26150 = D.26149 & 2;
        D.26283 = D.26150 == 0;
        D.26284 = (long int) D.26283;
        D.26285 = __builtin_expect (D.26284, 0);
        if (D.26285 != 0) goto <D.26286>; else goto <D.26287>;
        <D.26286>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8017, "t->attrs & PARAM_ATTRIBUTE_OUT");
        <D.26287>:
        D.26221 = spec->data.array_data.param_num;
        param_num = (int) D.26221;
        num_elem = spec->data.array_data.num_elem;
        D.26222 = spec->data.array_data.elem_mult;
        if (D.26222 == 0) goto <D.26288>; else goto <D.26289>;
        <D.26288>:
        param_num = -1;
        <D.26289>:
        if (param_num == -1) goto <D.26290>; else goto <D.26291>;
        <D.26290>:
        if (num_elem <= 0) goto <D.26292>; else goto <D.26293>;
        <D.26292>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8028);
        <D.26293>:
        <D.26291>:
        eklass = klass->element_class;
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26294>; else goto <D.26295>;
        <D.26294>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.26079, spec);
        goto <D.26296>;
        <D.26295>:
        D.26101 = mono_defaults.stringbuilder_class;
        if (D.26101 == eklass) goto <D.26297>; else goto <D.26298>;
        <D.26297>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.26079, spec);
        goto <D.26299>;
        <D.26298>:
        conv = 4294967295;
        <D.26299>:
        <D.26296>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.26300>; else goto <D.26301>;
        <D.26300>:
        esize = 8;
        goto <D.26302>;
        <D.26301>:
        esize = mono_class_native_size (eklass, 0B);
        <D.26302>:
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.26096);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        loc = mono_mb_add_local (mb, D.26096);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        dest_ptr.226 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.226);
        D.26304 = BIT_FIELD_REF <*eklass, 64, 256>;
        D.26305 = D.26304 & 32;
        if (D.26305 != 0) goto <D.26306>; else goto <D.26307>;
        <D.26306>:
        argnum.208 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.208);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 32);
        mono_mb_emit_byte (mb, 88);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.21071>;
        <D.26307>:
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        index_var = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 22);
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.227);
        D.26309 = mono_mb_get_label (mb);
        label2 = (guint32) D.26309;
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.227);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.26310>; else goto <D.26311>;
        <D.26310>:
        D.26312 = conv == 4294967295;
        D.26313 = (long int) D.26312;
        D.26314 = __builtin_expect (D.26313, 0);
        if (D.26314 != 0) goto <D.26315>; else goto <D.26316>;
        <D.26315>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8093, "conv != -1");
        <D.26316>:
        dest_ptr.226 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.226);
        conv_arg.209 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.209);
        index_var.227 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.227);
        mono_mb_emit_byte (mb, 154);
        D.26317 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26317);
        mono_mb_emit_byte (mb, 223);
        goto <D.26318>;
        <D.26311>:
        {
          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.26215 = conv_arg;
          return D.26215;
        }
        <D.26318>:
        D.26319 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.26319, 1);
        D.26320 = (short unsigned int) dest_ptr;
        mono_mb_emit_add_to_local (mb, D.26320, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.21071>;
      }
      <D.21131>:
      {
        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.26088 = BIT_FIELD_REF <*t, 64, 64>;
        D.26089 = D.26088 & 1073741824;
        D.26273 = D.26089 != 0;
        D.26274 = (long int) D.26273;
        D.26275 = __builtin_expect (D.26274, 0);
        if (D.26275 != 0) goto <D.26321>; else goto <D.26322>;
        <D.26321>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8130, "!t->byref");
        <D.26322>:
        eklass = klass->element_class;
        mono_marshal_load_type_info (eklass);
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26323>; else goto <D.26324>;
        <D.26323>:
        is_string = 1;
        D.26079 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.26079, spec);
        goto <D.26325>;
        <D.26324>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8141);
        <D.26325>:
        if (is_string != 0) goto <D.26326>; else goto <D.26327>;
        <D.26326>:
        esize = 8;
        goto <D.26328>;
        <D.26327>:
        D.26115 = mono_defaults.char_class;
        if (D.26115 == eklass) goto <D.26329>; else goto <D.26330>;
        <D.26329>:
        D.26079 = m->piinfo;
        D.26332 = mono_pinvoke_is_unicode (D.26079);
        if (D.26332 != 0) goto <D.26333>; else goto <D.26334>;
        <D.26333>:
        iftmp.228 = 2;
        goto <D.26335>;
        <D.26334>:
        iftmp.228 = 1;
        <D.26335>:
        esize = iftmp.228;
        goto <D.26336>;
        <D.26330>:
        esize = mono_class_native_size (eklass, 0B);
        <D.26336>:
        <D.26328>:
        D.26080 = mono_defaults.object_class;
        D.26081 = &D.26080->byval_arg;
        src = mono_mb_add_local (mb, D.26081);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        dest = mono_mb_add_local (mb, D.26096);
        src.229 = (unsigned int) src;
        mono_mb_emit_stloc (mb, src.229);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_stloc (mb, 3);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        label1 = mono_mb_emit_branch (mb, 57);
        mono_mb_emit_icon (mb, esize);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_byte (mb, 142);
        D.26097 = mono_defaults.string_class;
        if (D.26097 == eklass) goto <D.26338>; else goto <D.26339>;
        <D.26338>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.26339>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_icall (mb, mono_marshal_alloc);
        dest.230 = (unsigned int) dest;
        mono_mb_emit_stloc (mb, dest.230);
        dest.230 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.230);
        mono_mb_emit_stloc (mb, 3);
        D.26095 = mono_defaults.int_class;
        D.26096 = &D.26095->byval_arg;
        index_var = mono_mb_add_local (mb, D.26096);
        mono_mb_emit_byte (mb, 22);
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.231);
        D.26342 = mono_mb_get_label (mb);
        label2 = (guint32) D.26342;
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.231);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.26343>; else goto <D.26344>;
        <D.26343>:
        D.26345 = conv == 4294967295;
        D.26346 = (long int) D.26345;
        D.26347 = __builtin_expect (D.26346, 0);
        if (D.26347 != 0) goto <D.26348>; else goto <D.26349>;
        <D.26348>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8190, "conv != -1");
        <D.26349>:
        dest.230 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.230);
        src.229 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.229);
        index_var.231 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.231);
        mono_mb_emit_byte (mb, 154);
        D.26350 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26350);
        mono_mb_emit_byte (mb, 223);
        goto <D.26351>;
        <D.26344>:
        {
          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.26215 = conv_arg;
          return D.26215;
        }
        <D.26351>:
        D.26352 = (short unsigned int) index_var;
        mono_mb_emit_add_to_local (mb, D.26352, 1);
        D.26353 = (short unsigned int) dest;
        mono_mb_emit_add_to_local (mb, D.26353, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        mono_mb_patch_branch (mb, label1);
        goto <D.21071>;
      }
      <D.21143>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8220);
      <D.21071>:
      D.26215 = conv_arg;
      return D.26215;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_need_free (struct MonoType * t, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  unsigned char D.26357;
  int D.26358;
  gboolean D.26359;
  struct MonoClass * D.26360;
  struct MonoClass * D.26361;
  _Bool D.26364;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;

  D.26357 = t->type;
  D.26358 = (int) D.26357;
  switch (D.26358) <default: <D.19886>, case 14: <D.19885>, case 17: <D.19881>, case 18: <D.19883>, case 28: <D.19882>>
  <D.19881>:
  D.26359 = 1;
  return D.26359;
  <D.19882>:
  <D.19883>:
  D.26360 = t->data.klass;
  D.26361 = mono_defaults.stringbuilder_class;
  if (D.26360 == D.26361) goto <D.26362>; else goto <D.26363>;
  <D.26362>:
  {
    gboolean need_free;

    try
      {
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
        D.26359 = need_free;
        return D.26359;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.26363>:
  D.26359 = 0;
  return D.26359;
  <D.19885>:
  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  D.26364 = encoding != 21;
  D.26359 = (gboolean) D.26364;
  return D.26359;
  <D.19886>:
  D.26359 = 0;
  return D.26359;
}


emit_struct_conv_full (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object, MonoMarshalNative string_encoding)
{
  struct MonoClass * D.26367;
  unsigned int D.26370;
  long unsigned int D.26373;
  long unsigned int D.26374;
  unsigned int msize.232;
  _Bool D.26378;
  long int D.26379;
  long int D.26380;
  struct MonoClass * D.26383;
  unsigned int D.26386;
  unsigned int D.26387;
  struct MonoType * D.26390;
  char * D.26391;
  struct MonoClassField * D.26392;
  unsigned int i.233;
  unsigned int D.26394;
  unsigned int D.26395;
  _Bool D.26396;
  short unsigned int D.26397;
  int D.26398;
  int D.26399;
  struct MonoMarshalSpec * D.26402;
  <unnamed-unsigned:1> D.26403;
  int D.26404;
  int D.26407;
  int D.26408;
  unsigned int D.26409;
  unsigned int D.26410;
  int D.26412;
  struct MonoClassField * D.26413;
  int D.26414;
  unsigned int D.26415;
  unsigned int D.26416;
  struct MonoType * D.26425;
  int D.26426;
  struct MonoType * D.26429;
  int D.26430;
  char * D.26431;
  <unnamed type> conv.234;
  long unsigned int D.26435;
  long unsigned int D.26436;
  unsigned char D.26438;
  unsigned int D.26448;
  unsigned char D.26449;
  unsigned int D.26450;
  unsigned char D.26451;
  struct MonoClass * D.26452;
  long unsigned int D.26453;
  long unsigned int D.26454;
  struct MonoClass * D.26457;
  struct MonoType * D.26458;
  unsigned int src_var.235;
  unsigned int dst_var.236;
  struct MonoMethod * variant_clear.237;
  struct MonoClass * D.26466;
  struct MonoMethod * variant_clear.238;
  struct MonoMethod * get_object_for_native_variant.239;
  struct MonoClass * D.26471;
  struct MonoMethod * get_object_for_native_variant.240;
  struct MonoMethod * get_native_variant_for_object.241;
  struct MonoMethod * get_native_variant_for_object.242;
  int D.26478;
  unsigned int src_var.243;
  unsigned int dst_var.244;
  struct MonoMarshalType * info;
  int i;
  void handle_enum = <<< error >>>;

  D.26367 = klass->parent;
  if (D.26367 != 0B) goto <D.26368>; else goto <D.26369>;
  <D.26368>:
  D.26367 = klass->parent;
  emit_struct_conv (mb, D.26367, to_object);
  <D.26369>:
  info = mono_marshal_load_type_info (klass);
  D.26370 = info->native_size;
  if (D.26370 == 0) goto <D.26371>; else goto <D.26372>;
  <D.26371>:
  return;
  <D.26372>:
  D.26373 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26374 = D.26373 & 32;
  if (D.26374 != 0) goto <D.26375>; else goto <D.26376>;
  <D.26375>:
  {
    int msize;

    msize = mono_class_value_size (klass, 0B);
    msize.232 = (unsigned int) msize;
    D.26370 = info->native_size;
    D.26378 = msize.232 != D.26370;
    D.26379 = (long int) D.26378;
    D.26380 = __builtin_expect (D.26379, 0);
    if (D.26380 != 0) goto <D.26381>; else goto <D.26382>;
    <D.26381>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1871, "msize == info->native_size");
    <D.26382>:
    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.26376>:
  D.26383 = mono_defaults.safehandle_class;
  if (D.26383 != klass) goto <D.26384>; else goto <D.26385>;
  <D.26384>:
  D.26386 = klass->flags;
  D.26387 = D.26386 & 24;
  if (D.26387 == 0) goto <D.26388>; else goto <D.26389>;
  <D.26388>:
  {
    char * msg;

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

    try
      {
        D.26392 = info->fields[i].field;
        ftype = D.26392->type;
        msize = 0;
        usize = 0;
        i.233 = (unsigned int) i;
        D.26394 = info->num_fields;
        D.26395 = D.26394 + 4294967295;
        D.26396 = i.233 >= D.26395;
        last_field = (gboolean) D.26396;
        D.26397 = ftype->attrs;
        D.26398 = (int) D.26397;
        D.26399 = D.26398 & 16;
        if (D.26399 != 0) goto <D.26400>; else goto <D.26401>;
        <D.26400>:
        // predicted unlikely by continue predictor.
        goto <D.19729>;
        <D.26401>:
        D.26402 = info->fields[i].mspec;
        D.26403 = klass->unicode;
        D.26404 = (int) D.26403;
        ntype = mono_type_to_unmanaged (ftype, D.26402, 1, D.26404, &conv);
        if (last_field != 0) goto <D.26405>; else goto <D.26406>;
        <D.26405>:
        D.26407 = klass->instance_size;
        D.26392 = info->fields[i].field;
        D.26408 = D.26392->offset;
        msize = D.26407 - D.26408;
        D.26370 = info->native_size;
        D.26409 = info->fields[i].offset;
        D.26410 = D.26370 - D.26409;
        usize = (int) D.26410;
        goto <D.26411>;
        <D.26406>:
        D.26412 = i + 1;
        D.26413 = info->fields[D.26412].field;
        D.26414 = D.26413->offset;
        D.26392 = info->fields[i].field;
        D.26408 = D.26392->offset;
        msize = D.26414 - D.26408;
        D.26412 = i + 1;
        D.26415 = info->fields[D.26412].offset;
        D.26409 = info->fields[i].offset;
        D.26416 = D.26415 - D.26409;
        usize = (int) D.26416;
        <D.26411>:
        D.26383 = mono_defaults.safehandle_class;
        if (D.26383 != klass) goto <D.26417>; else goto <D.26418>;
        <D.26417>:
        D.26386 = klass->flags;
        D.26387 = D.26386 & 24;
        if (D.26387 == 16) goto <D.26419>; else goto <D.26420>;
        <D.26419>:
        if (usize == 0) goto <D.26421>; else goto <D.26422>;
        <D.26421>:
        D.26392 = info->fields[i].field;
        D.26425 = D.26392->type;
        D.26426 = mono_type_is_reference (D.26425);
        if (D.26426 != 0) goto <D.26423>; else goto <D.26427>;
        <D.26427>:
        if (last_field == 0) goto <D.26428>; else goto <D.26424>;
        <D.26428>:
        D.26412 = i + 1;
        D.26413 = info->fields[D.26412].field;
        D.26429 = D.26413->type;
        D.26430 = mono_type_is_reference (D.26429);
        if (D.26430 != 0) goto <D.26423>; else goto <D.26424>;
        <D.26423>:
        D.26390 = &klass->byval_arg;
        D.26431 = mono_type_full_name (D.26390);
        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.26431);
        <D.19730>:
        goto <D.19730>;
        <D.26424>:
        <D.26422>:
        <D.26420>:
        <D.26418>:
        conv.234 = conv;
        switch (conv.234) <default: <D.19757>, case 0: <D.19731>>
        <D.19731>:
        {
          int t;

          D.26435 = BIT_FIELD_REF <*ftype, 64, 64>;
          D.26436 = D.26435 & 1073741824;
          if (D.26436 != 0) goto <D.26433>; else goto <D.26437>;
          <D.26437>:
          D.26438 = ftype->type;
          if (D.26438 == 24) goto <D.26433>; else goto <D.26439>;
          <D.26439>:
          D.26438 = ftype->type;
          if (D.26438 == 25) goto <D.26433>; else goto <D.26434>;
          <D.26433>:
          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.19733>;
          <D.26434>:
          handle_enum:
          D.26438 = ftype->type;
          t = (int) D.26438;
          switch (t) <default: <D.19756>, case 2: <D.19739>, case 3: <D.19742>, case 4: <D.19737>, case 5: <D.19738>, case 6: <D.19740>, case 7: <D.19741>, case 8: <D.19735>, case 9: <D.19736>, case 10: <D.19743>, case 11: <D.19744>, case 12: <D.19746>, case 13: <D.19747>, case 15: <D.19745>, case 17: <D.19749>, case 28: <D.19752>>
          <D.19735>:
          <D.19736>:
          <D.19737>:
          <D.19738>:
          <D.19739>:
          <D.19740>:
          <D.19741>:
          <D.19742>:
          <D.19743>:
          <D.19744>:
          <D.19745>:
          <D.19746>:
          <D.19747>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          if (t == 3) goto <D.26442>; else goto <D.26440>;
          <D.26442>:
          if (ntype == 4) goto <D.26443>; else goto <D.26440>;
          <D.26443>:
          if (string_encoding != 21) goto <D.26444>; else goto <D.26440>;
          <D.26444>:
          if (to_object != 0) goto <D.26445>; else goto <D.26446>;
          <D.26445>:
          mono_mb_emit_byte (mb, 71);
          mono_mb_emit_byte (mb, 83);
          goto <D.26447>;
          <D.26446>:
          mono_mb_emit_byte (mb, 73);
          mono_mb_emit_byte (mb, 82);
          <D.26447>:
          goto <D.26441>;
          <D.26440>:
          D.26448 = mono_type_to_ldind (ftype);
          D.26449 = (unsigned char) D.26448;
          mono_mb_emit_byte (mb, D.26449);
          D.26450 = mono_type_to_stind (ftype);
          D.26451 = (unsigned char) D.26450;
          mono_mb_emit_byte (mb, D.26451);
          <D.26441>:
          goto <D.19748>;
          <D.19749>:
          {
            int src_var;
            int dst_var;

            D.26452 = ftype->data.klass;
            D.26453 = BIT_FIELD_REF <*D.26452, 64, 256>;
            D.26454 = D.26453 & 16;
            if (D.26454 != 0) goto <D.26455>; else goto <D.26456>;
            <D.26455>:
            D.26452 = ftype->data.klass;
            ftype = mono_class_enum_basetype (D.26452);
            goto handle_enum;
            <D.26456>:
            D.26457 = mono_defaults.int_class;
            D.26458 = &D.26457->byval_arg;
            src_var = mono_mb_add_local (mb, D.26458);
            D.26457 = mono_defaults.int_class;
            D.26458 = &D.26457->byval_arg;
            dst_var = mono_mb_add_local (mb, D.26458);
            mono_mb_emit_ldloc (mb, 0);
            src_var.235 = (unsigned int) src_var;
            mono_mb_emit_stloc (mb, src_var.235);
            mono_mb_emit_ldloc (mb, 1);
            dst_var.236 = (unsigned int) dst_var;
            mono_mb_emit_stloc (mb, dst_var.236);
            D.26452 = ftype->data.klass;
            emit_struct_conv (mb, D.26452, to_object);
            src_var.235 = (unsigned int) src_var;
            mono_mb_emit_ldloc (mb, src_var.235);
            mono_mb_emit_stloc (mb, 0);
            dst_var.236 = (unsigned int) dst_var;
            mono_mb_emit_ldloc (mb, dst_var.236);
            mono_mb_emit_stloc (mb, 1);
            goto <D.19748>;
          }
          <D.19752>:
          if (to_object != 0) goto <D.26461>; else goto <D.26462>;
          <D.26461>:
          {
            static struct MonoMethod * variant_clear = 0B;
            static struct MonoMethod * get_object_for_native_variant = 0B;

            variant_clear.237 = variant_clear;
            if (variant_clear.237 == 0B) goto <D.26464>; else goto <D.26465>;
            <D.26464>:
            D.26466 = mono_class_get_variant_class ();
            variant_clear.238 = mono_class_get_method_from_name (D.26466, "Clear", 0);
            variant_clear = variant_clear.238;
            <D.26465>:
            get_object_for_native_variant.239 = get_object_for_native_variant;
            if (get_object_for_native_variant.239 == 0B) goto <D.26469>; else goto <D.26470>;
            <D.26469>:
            D.26471 = mono_defaults.marshal_class;
            get_object_for_native_variant.240 = mono_class_get_method_from_name (D.26471, "GetObjectForNativeVariant", 1);
            get_object_for_native_variant = get_object_for_native_variant.240;
            <D.26470>:
            mono_mb_emit_ldloc (mb, 1);
            mono_mb_emit_ldloc (mb, 0);
            get_object_for_native_variant.239 = get_object_for_native_variant;
            mono_mb_emit_managed_call (mb, get_object_for_native_variant.239, 0B);
            mono_mb_emit_byte (mb, 81);
            mono_mb_emit_ldloc (mb, 0);
            variant_clear.237 = variant_clear;
            mono_mb_emit_managed_call (mb, variant_clear.237, 0B);
          }
          goto <D.26473>;
          <D.26462>:
          {
            static struct MonoMethod * get_native_variant_for_object = 0B;

            get_native_variant_for_object.241 = get_native_variant_for_object;
            if (get_native_variant_for_object.241 == 0B) goto <D.26475>; else goto <D.26476>;
            <D.26475>:
            D.26471 = mono_defaults.marshal_class;
            get_native_variant_for_object.242 = mono_class_get_method_from_name (D.26471, "GetNativeVariantForObject", 2);
            get_native_variant_for_object = get_native_variant_for_object.242;
            <D.26476>:
            mono_mb_emit_ldloc (mb, 0);
            mono_mb_emit_byte (mb, 80);
            mono_mb_emit_ldloc (mb, 1);
            get_native_variant_for_object.241 = get_native_variant_for_object;
            mono_mb_emit_managed_call (mb, get_native_variant_for_object.241, 0B);
          }
          <D.26473>:
          goto <D.19748>;
          <D.19756>:
          D.26438 = ftype->type;
          D.26478 = (int) D.26438;
          monoeg_g_log (0B, 16, "marshaling type %02x not implemented", D.26478);
          monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2038);
          <D.19748>:
          goto <D.19733>;
        }
        <D.19757>:
        {
          int src_var;
          int dst_var;

          D.26457 = mono_defaults.int_class;
          D.26458 = &D.26457->byval_arg;
          src_var = mono_mb_add_local (mb, D.26458);
          D.26457 = mono_defaults.int_class;
          D.26458 = &D.26457->byval_arg;
          dst_var = mono_mb_add_local (mb, D.26458);
          mono_mb_emit_ldloc (mb, 0);
          src_var.243 = (unsigned int) src_var;
          mono_mb_emit_stloc (mb, src_var.243);
          mono_mb_emit_ldloc (mb, 1);
          dst_var.244 = (unsigned int) dst_var;
          mono_mb_emit_stloc (mb, dst_var.244);
          if (to_object != 0) goto <D.26481>; else goto <D.26482>;
          <D.26481>:
          conv.234 = conv;
          D.26402 = info->fields[i].mspec;
          emit_ptr_to_object_conv (mb, ftype, conv.234, D.26402);
          goto <D.26483>;
          <D.26482>:
          conv.234 = conv;
          D.26402 = info->fields[i].mspec;
          emit_object_to_ptr_conv (mb, ftype, conv.234, D.26402);
          <D.26483>:
          src_var.243 = (unsigned int) src_var;
          mono_mb_emit_ldloc (mb, src_var.243);
          mono_mb_emit_stloc (mb, 0);
          dst_var.244 = (unsigned int) dst_var;
          mono_mb_emit_ldloc (mb, dst_var.244);
          mono_mb_emit_stloc (mb, 1);
        }
        <D.19733>:
        if (to_object != 0) goto <D.26484>; else goto <D.26485>;
        <D.26484>:
        mono_mb_emit_add_to_local (mb, 0, usize);
        mono_mb_emit_add_to_local (mb, 1, msize);
        goto <D.26486>;
        <D.26485>:
        mono_mb_emit_add_to_local (mb, 0, msize);
        mono_mb_emit_add_to_local (mb, 1, usize);
        <D.26486>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.19729>:
  i = i + 1;
  <D.19761>:
  i.233 = (unsigned int) i;
  D.26394 = info->num_fields;
  if (i.233 < D.26394) goto <D.19760>; else goto <D.19762>;
  <D.19762>:
}


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.26490;
  int D.26494;
  long unsigned int D.26495;
  long unsigned int D.26496;
  int D.26499;
  struct MonoClass * D.26501;
  struct MonoType * D.26502;
  struct MonoClass * D.26503;
  struct MonoType * D.26504;
  unsigned int array_var.245;
  unsigned int src_var.246;
  unsigned int dst_var.247;
  unsigned int index_var.248;
  int D.26509;
  short unsigned int D.26510;
  <unnamed type> D.26514;
  unsigned int src_var.249;
  unsigned int dst_var.250;
  struct MonoClass * D.26519;
  const char * D.26520;

  switch (conv) <default: <D.19638>, case 1: <D.19604>, case 2: <D.19602>, case 3: <D.19634>, case 4: <D.19619>, case 7: <D.19620>, case 9: <D.19618>, case 10: <D.19635>, case 11: <D.19636>, case 12: <D.19616>, case 13: <D.19617>, case 20: <D.19605>, case 21: <D.19614>, case 22: <D.19637>, case 23: <D.19627>, case 25: <D.19629>, case 26: <D.19631>, case 27: <D.19630>, case 28: <D.19621>, case 29: <D.19625>, case 33: <D.19632>, case 34: <D.19633>>
  <D.19602>:
  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.19603>;
  <D.19604>:
  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.19603>;
  <D.19605>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.26490 = type->type;
    if (D.26490 == 29) goto <D.26491>; else goto <D.26492>;
    <D.26491>:
    eklass = type->data.klass;
    goto <D.26493>;
    <D.26492>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1279);
    <D.26493>:
    esize = mono_class_native_size (eklass, 0B);
    mono_mb_emit_ldloc (mb, 1);
    D.26494 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26494);
    mono_mb_emit_op (mb, 141, eklass);
    mono_mb_emit_byte (mb, 223);
    D.26495 = BIT_FIELD_REF <*eklass, 64, 256>;
    D.26496 = D.26495 & 32;
    if (D.26496 != 0) goto <D.26497>; else goto <D.26498>;
    <D.26497>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 32);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_ldloc (mb, 0);
    D.26494 = mspec->data.array_data.num_elem;
    D.26499 = D.26494 * esize;
    mono_mb_emit_icon (mb, D.26499);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.26500>;
    <D.26498>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.26501 = mono_defaults.object_class;
      D.26502 = &D.26501->byval_arg;
      array_var = mono_mb_add_local (mb, D.26502);
      D.26503 = mono_defaults.int_class;
      D.26504 = &D.26503->byval_arg;
      src_var = mono_mb_add_local (mb, D.26504);
      D.26503 = mono_defaults.int_class;
      D.26504 = &D.26503->byval_arg;
      dst_var = mono_mb_add_local (mb, D.26504);
      mono_mb_emit_ldloc (mb, 1);
      mono_mb_emit_byte (mb, 80);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.245);
      mono_mb_emit_ldloc (mb, 0);
      src_var.246 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.246);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.247 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.247);
      D.26503 = mono_defaults.int_class;
      D.26504 = &D.26503->byval_arg;
      index_var = mono_mb_add_local (mb, D.26504);
      mono_mb_emit_byte (mb, 22);
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.248);
      D.26509 = mono_mb_get_label (mb);
      label2 = (guint32) D.26509;
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.248);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.245);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.245 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.245);
      index_var.248 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.248);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 1);
      emit_struct_conv (mb, eklass, 1);
      D.26510 = (short unsigned int) index_var;
      mono_mb_emit_add_to_local (mb, D.26510, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.246 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.246);
      mono_mb_emit_stloc (mb, 0);
      dst_var.247 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.247);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.26500>:
    goto <D.19603>;
  }
  <D.19614>:
  {
    struct MonoClass * eclass;

    eclass = mono_defaults.char_class;
    mono_mb_emit_ldloc (mb, 1);
    D.26494 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26494);
    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.26494 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.26494);
    mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
    goto <D.19603>;
  }
  <D.19616>:
  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.19603>;
  <D.19617>:
  if (mspec != 0B) goto <D.26513>; else goto <D.26511>;
  <D.26513>:
  D.26514 = mspec->native;
  if (D.26514 == 23) goto <D.26515>; else goto <D.26511>;
  <D.26515>:
  D.26494 = mspec->data.array_data.num_elem;
  if (D.26494 != 0) goto <D.26516>; else goto <D.26511>;
  <D.26516>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  D.26494 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26494);
  mono_mb_emit_icall (mb, mono_string_from_byvalwstr);
  goto <D.26512>;
  <D.26511>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  <D.26512>:
  mono_mb_emit_byte (mb, 81);
  goto <D.19603>;
  <D.19618>:
  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.19603>;
  <D.19619>:
  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.19603>;
  <D.19620>:
  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.19603>;
  <D.19621>:
  {
    struct MonoClass * klass;
    int src_var;
    int dst_var;

    klass = mono_class_from_mono_type (type);
    D.26503 = mono_defaults.int_class;
    D.26504 = &D.26503->byval_arg;
    src_var = mono_mb_add_local (mb, D.26504);
    D.26503 = mono_defaults.int_class;
    D.26504 = &D.26503->byval_arg;
    dst_var = mono_mb_add_local (mb, D.26504);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 240);
    mono_mb_emit_op (mb, 4, klass);
    mono_mb_emit_byte (mb, 81);
    mono_mb_emit_ldloc (mb, 0);
    src_var.249 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.249);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.250 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.250);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 1);
    emit_struct_conv (mb, klass, 1);
    src_var.249 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.249);
    mono_mb_emit_stloc (mb, 0);
    dst_var.250 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.250);
    mono_mb_emit_stloc (mb, 1);
    goto <D.19603>;
  }
  <D.19625>:
  {
    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.19603>;
  }
  <D.19627>:
  D.26519 = mono_class_from_mono_type (type);
  D.26520 = D.26519->name;
  monoeg_g_log (0B, 4, "Structure field of type %s can\'t be marshalled as LPArray", D.26520);
  <D.19628>:
  goto <D.19628>;
  <D.19629>:
  <D.19630>:
  <D.19631>:
  mono_cominterop_emit_ptr_to_object_conv (mb, type, conv, mspec);
  goto <D.19603>;
  <D.19632>:
  goto <D.19603>;
  <D.19633>:
  goto <D.19603>;
  <D.19634>:
  <D.19635>:
  <D.19636>:
  <D.19637>:
  <D.19638>:
  {
    char * msg;

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


emit_object_to_ptr_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned int D.26522;
  unsigned int pos.251;
  void * D.26524;
  void * D.26525;
  _Bool D.26526;
  long int D.26527;
  long int D.26528;
  int D.26531;
  void * D.26532;
  unsigned char D.26533;
  long unsigned int D.26537;
  long unsigned int D.26538;
  unsigned int D.26542;
  long unsigned int D.26543;
  int D.26546;
  struct MonoClass * D.26548;
  struct MonoType * D.26549;
  struct MonoClass * D.26550;
  struct MonoType * D.26551;
  unsigned int array_var.252;
  unsigned int src_var.253;
  unsigned int dst_var.254;
  unsigned int index_var.255;
  int D.26556;
  short unsigned int D.26557;
  unsigned int pos.256;
  unsigned int D.26559;
  unsigned int D.26560;
  unsigned int src_var.257;
  unsigned int dst_var.258;
  struct MonoClass * D.26563;
  struct MonoClass * D.26564;
  struct MonoType * D.26565;
  unsigned int D.26566;
  unsigned int pos.259;
  int pos;

  switch (conv) <default: <D.19710>, case 1: <D.19677>, case 2: <D.19675>, case 3: <D.19681>, case 4: <D.19679>, case 7: <D.19678>, case 9: <D.19680>, case 10: <D.19682>, case 11: <D.19683>, case 12: <D.19688>, case 13: <D.19689>, case 20: <D.19690>, case 21: <D.19699>, case 22: <D.19685>, case 23: <D.19686>, case 25: <D.19703>, case 26: <D.19704>, case 27: <D.19705>, case 28: <D.19700>, case 29: <D.19687>, case 33: <D.19706>, case 34: <D.19709>>
  <D.19675>:
  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.19676>;
  <D.19677>:
  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.19676>;
  <D.19678>:
  <D.19679>:
  <D.19680>:
  <D.19681>:
  <D.19682>:
  <D.19683>:
  {
    int pos;

    mono_mb_emit_ldloc (mb, 2);
    D.26522 = mono_mb_emit_short_branch (mb, 44);
    pos = (int) D.26522;
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icall (mb, monoeg_g_free);
    pos.251 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.251);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.26524 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.26524);
    mono_mb_emit_byte (mb, 223);
    goto <D.19676>;
  }
  <D.19685>:
  <D.19686>:
  <D.19687>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26525 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.26525);
  mono_mb_emit_byte (mb, 223);
  goto <D.19676>;
  <D.19688>:
  <D.19689>:
  D.26526 = mspec == 0B;
  D.26527 = (long int) D.26526;
  D.26528 = __builtin_expect (D.26527, 0);
  if (D.26528 != 0) goto <D.26529>; else goto <D.26530>;
  <D.26529>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1641, "mspec");
  <D.26530>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26531 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26531);
  D.26532 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.26532);
  goto <D.19676>;
  <D.19690>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.26533 = type->type;
    if (D.26533 == 29) goto <D.26534>; else goto <D.26535>;
    <D.26534>:
    eklass = type->data.klass;
    goto <D.26536>;
    <D.26535>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1657);
    <D.26536>:
    D.26537 = BIT_FIELD_REF <*eklass, 64, 256>;
    D.26538 = D.26537 & 8;
    if (D.26538 != 0) goto <D.26539>; else goto <D.26540>;
    <D.26539>:
    esize = mono_class_native_size (eklass, 0B);
    goto <D.26541>;
    <D.26540>:
    esize = 8;
    <D.26541>:
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.26542 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26542;
    D.26537 = BIT_FIELD_REF <*eklass, 64, 256>;
    D.26543 = D.26537 & 32;
    if (D.26543 != 0) goto <D.26544>; else goto <D.26545>;
    <D.26544>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    mono_mb_emit_ldflda (mb, 32);
    D.26531 = mspec->data.array_data.num_elem;
    D.26546 = D.26531 * esize;
    mono_mb_emit_icon (mb, D.26546);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.26547>;
    <D.26545>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.26548 = mono_defaults.object_class;
      D.26549 = &D.26548->byval_arg;
      array_var = mono_mb_add_local (mb, D.26549);
      D.26550 = mono_defaults.int_class;
      D.26551 = &D.26550->byval_arg;
      src_var = mono_mb_add_local (mb, D.26551);
      D.26550 = mono_defaults.int_class;
      D.26551 = &D.26550->byval_arg;
      dst_var = mono_mb_add_local (mb, D.26551);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 80);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.252);
      mono_mb_emit_ldloc (mb, 0);
      src_var.253 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.253);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.254 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.254);
      D.26550 = mono_defaults.int_class;
      D.26551 = &D.26550->byval_arg;
      index_var = mono_mb_add_local (mb, D.26551);
      mono_mb_emit_byte (mb, 22);
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.255);
      D.26556 = mono_mb_get_label (mb);
      label2 = (guint32) D.26556;
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.255);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.252);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.252 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.252);
      index_var.255 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.255);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 0);
      emit_struct_conv (mb, eklass, 0);
      D.26557 = (short unsigned int) index_var;
      mono_mb_emit_add_to_local (mb, D.26557, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.253 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.253);
      mono_mb_emit_stloc (mb, 0);
      dst_var.254 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.254);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.26547>:
    pos.256 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.256);
    goto <D.19676>;
  }
  <D.19699>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26559 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.26559;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.26531 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.26531);
  mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
  pos.256 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.256);
  goto <D.19676>;
  <D.19700>:
  {
    int src_var;
    int dst_var;

    D.26550 = mono_defaults.int_class;
    D.26551 = &D.26550->byval_arg;
    src_var = mono_mb_add_local (mb, D.26551);
    D.26550 = mono_defaults.int_class;
    D.26551 = &D.26550->byval_arg;
    dst_var = mono_mb_add_local (mb, D.26551);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.26560 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26560;
    mono_mb_emit_ldloc (mb, 0);
    src_var.257 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.257);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.258 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.258);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 0);
    D.26563 = mono_class_from_mono_type (type);
    emit_struct_conv (mb, D.26563, 0);
    src_var.257 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.257);
    mono_mb_emit_stloc (mb, 0);
    dst_var.258 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.258);
    mono_mb_emit_stloc (mb, 1);
    pos.256 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.256);
    goto <D.19676>;
  }
  <D.19703>:
  <D.19704>:
  <D.19705>:
  mono_cominterop_emit_object_to_ptr_conv (mb, type, conv, mspec);
  goto <D.19676>;
  <D.19706>:
  {
    int dar_release_slot;
    int pos;

    D.26564 = mono_defaults.boolean_class;
    D.26565 = &D.26564->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.26565);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.26566 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.26566;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.259 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.259);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_ldflda (mb, 16);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_byte (mb, 223);
    goto <D.19676>;
  }
  <D.19709>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 223);
  goto <D.19676>;
  <D.19710>:
  {
    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.19676>:
}


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

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


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.19873>, case 20: <D.19871>, case 21: <D.19870>, case 22: <D.19872>>
  <D.19870>:
  *need_free = 0;
  D.26569 = 19;
  return D.26569;
  <D.19871>:
  D.26569 = 17;
  return D.26569;
  <D.19872>:
  D.26569 = 18;
  return D.26569;
  <D.19873>:
  D.26569 = 4294967295;
  return D.26569;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.19851>, case 20: <D.19849>, case 21: <D.19848>, case 22: <D.19850>>
  <D.19848>:
  D.26571 = 16;
  return D.26571;
  <D.19849>:
  D.26571 = 14;
  return D.26571;
  <D.19850>:
  D.26571 = 15;
  return D.26571;
  <D.19851>:
  D.26571 = 4294967295;
  return D.26571;
}


mono_pinvoke_is_unicode (struct MonoMethodPInvoke * piinfo)
{
  short unsigned int D.26573;
  int D.26574;
  int D.26575;
  gboolean D.26576;

  D.26573 = piinfo->piflags;
  D.26574 = (int) D.26573;
  D.26575 = D.26574 & 6;
  switch (D.26575) <default: <D.21044>, case 2: <D.21041>, case 4: <D.21042>, case 6: <D.21043>>
  <D.21041>:
  D.26576 = 0;
  return D.26576;
  <D.21042>:
  D.26576 = 1;
  return D.26576;
  <D.21043>:
  <D.21044>:
  D.26576 = 0;
  return D.26576;
}


emit_marshal_boolean (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  long unsigned int D.26578;
  long unsigned int D.26579;
  struct MonoClass * D.26582;
  struct MonoType * D.26583;
  unsigned int argnum.261;
  unsigned int D.26588;
  unsigned char ldc_op.262;
  unsigned int conv_arg.263;
  unsigned int label_false.264;
  unsigned int D.26593;
  unsigned int D.26594;
  unsigned int label_false.265;
  unsigned int label_end.266;
  struct MonoClass * D.26603;
  struct MonoType * D.26604;
  struct MonoType * D.26607;
  struct MonoType * D.26609;
  unsigned int D.26612;
  unsigned char ldop.267;
  unsigned int D.26615;
  unsigned int label_false.268;
  unsigned int label_null.269;
  <unnamed type> D.26623;
  unsigned int D.26624;
  unsigned int D.26625;
  unsigned int D.26626;
  unsigned int label_false.270;
  unsigned int label_end.271;
  unsigned int label_null.272;
  int D.26630;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.21200>, case 0: <D.21174>, case 1: <D.21182>, case 2: <D.21179>, case 3: <D.21183>, case 4: <D.21184>, case 5: <D.21189>>
  <D.21174>:
  {
    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.26578 = BIT_FIELD_REF <*t, 64, 64>;
        D.26579 = D.26578 & 1073741824;
        if (D.26579 != 0) goto <D.26580>; else goto <D.26581>;
        <D.26580>:
        D.26582 = mono_defaults.int_class;
        D.26583 = &D.26582->byval_arg;
        *conv_arg_type = D.26583;
        goto <D.26584>;
        <D.26581>:
        *conv_arg_type = local_type;
        <D.26584>:
        conv_arg = mono_mb_add_local (mb, local_type);
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        D.26578 = BIT_FIELD_REF <*t, 64, 64>;
        D.26579 = D.26578 & 1073741824;
        if (D.26579 != 0) goto <D.26586>; else goto <D.26587>;
        <D.26586>:
        mono_mb_emit_byte (mb, 70);
        <D.26587>:
        D.26588 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.26588;
        ldc_op.262 = ldc_op;
        mono_mb_emit_byte (mb, ldc_op.262);
        conv_arg.263 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.263);
        label_false.264 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.264);
        goto <D.21178>;
      }
    finally
      {
        ldc_op = {CLOBBER};
      }
  }
  <D.21179>:
  {
    int label_false;
    int label_end;

    D.26578 = BIT_FIELD_REF <*t, 64, 64>;
    D.26579 = D.26578 & 1073741824;
    if (D.26579 == 0) goto <D.21178>; else goto <D.26592>;
    <D.26592>:
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    conv_arg.263 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.263);
    D.26593 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.26593;
    mono_mb_emit_byte (mb, 23);
    D.26594 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.26594;
    label_false.265 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.265);
    mono_mb_emit_byte (mb, 22);
    label_end.266 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.266);
    mono_mb_emit_byte (mb, 82);
    goto <D.21178>;
  }
  <D.21182>:
  D.26578 = BIT_FIELD_REF <*t, 64, 64>;
  D.26579 = D.26578 & 1073741824;
  if (D.26579 != 0) goto <D.26597>; else goto <D.26598>;
  <D.26597>:
  conv_arg.263 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.263);
  goto <D.26599>;
  <D.26598>:
  if (conv_arg != 0) goto <D.26600>; else goto <D.26601>;
  <D.26600>:
  conv_arg.263 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.263);
  goto <D.26602>;
  <D.26601>:
  argnum.261 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.261);
  <D.26602>:
  <D.26599>:
  goto <D.21178>;
  <D.21183>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.21178>;
  <D.21184>:
  {
    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.26603 = mono_defaults.boolean_class;
        D.26604 = &D.26603->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.26604);
        D.26578 = BIT_FIELD_REF <*t, 64, 64>;
        D.26579 = D.26578 & 1073741824;
        if (D.26579 != 0) goto <D.26605>; else goto <D.26606>;
        <D.26605>:
        D.26607 = &conv_arg_class->this_arg;
        *conv_arg_type = D.26607;
        goto <D.26608>;
        <D.26606>:
        D.26609 = &conv_arg_class->byval_arg;
        *conv_arg_type = D.26609;
        <D.26608>:
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        D.26578 = BIT_FIELD_REF <*t, 64, 64>;
        D.26579 = D.26578 & 1073741824;
        if (D.26579 != 0) goto <D.26610>; else goto <D.26611>;
        <D.26610>:
        D.26612 = mono_mb_emit_branch (mb, 57);
        label_null = (int) D.26612;
        argnum.261 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.261);
        ldop.267 = ldop;
        mono_mb_emit_byte (mb, ldop.267);
        goto <D.26614>;
        <D.26611>:
        label_null = 0;
        <D.26614>:
        D.26615 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.26615;
        mono_mb_emit_byte (mb, 23);
        conv_arg.263 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.263);
        label_false.268 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.268);
        D.26578 = BIT_FIELD_REF <*t, 64, 64>;
        D.26579 = D.26578 & 1073741824;
        if (D.26579 != 0) goto <D.26617>; else goto <D.26618>;
        <D.26617>:
        label_null.269 = (unsigned int) label_null;
        mono_mb_patch_branch (mb, label_null.269);
        <D.26618>:
        goto <D.21178>;
      }
    finally
      {
        ldop = {CLOBBER};
      }
  }
  <D.21189>:
  {
    guint8 stop;
    guint8 ldc_op;
    int label_null;
    int label_false;
    int label_end;

    stop = 84;
    ldc_op = 23;
    D.26578 = BIT_FIELD_REF <*t, 64, 64>;
    D.26579 = D.26578 & 1073741824;
    if (D.26579 == 0) goto <D.21178>; else goto <D.26620>;
    <D.26620>:
    if (spec != 0B) goto <D.26621>; else goto <D.26622>;
    <D.26621>:
    D.26623 = spec->native;
    switch (D.26623) <default: <D.21199>, case 3: <D.21195>, case 4: <D.21196>, case 37: <D.21198>>
    <D.21195>:
    <D.21196>:
    stop = 82;
    goto <D.21197>;
    <D.21198>:
    stop = 83;
    ldc_op = 21;
    goto <D.21197>;
    <D.21199>:
    goto <D.21197>;
    <D.21197>:
    <D.26622>:
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    D.26624 = mono_mb_emit_branch (mb, 57);
    label_null = (int) D.26624;
    argnum.261 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.261);
    conv_arg.263 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.263);
    D.26625 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.26625;
    mono_mb_emit_byte (mb, ldc_op);
    D.26626 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.26626;
    label_false.270 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.270);
    mono_mb_emit_byte (mb, 22);
    label_end.271 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.271);
    mono_mb_emit_byte (mb, stop);
    label_null.272 = (unsigned int) label_null;
    mono_mb_patch_branch (mb, label_null.272);
    goto <D.21178>;
  }
  <D.21200>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8436);
  <D.21178>:
  D.26630 = conv_arg;
  return D.26630;
}


marshal_boolean_conv_in_get_local_type (struct MonoMarshalSpec * spec, guint8 * ldc_op)
{
  struct MonoType * D.26637;
  struct MonoClass * D.26638;
  <unnamed type> D.26639;
  struct MonoClass * D.26640;
  struct MonoClass * D.26643;

  if (spec == 0B) goto <D.26635>; else goto <D.26636>;
  <D.26635>:
  D.26638 = mono_defaults.int32_class;
  D.26637 = &D.26638->byval_arg;
  return D.26637;
  <D.26636>:
  D.26639 = spec->native;
  switch (D.26639) <default: <D.21152>, case 2: <D.21151>, case 3: <D.21148>, case 4: <D.21149>, case 37: <D.21150>>
  <D.21148>:
  <D.21149>:
  D.26640 = mono_defaults.byte_class;
  D.26637 = &D.26640->byval_arg;
  return D.26637;
  <D.21150>:
  if (ldc_op != 0B) goto <D.26641>; else goto <D.26642>;
  <D.26641>:
  *ldc_op = 21;
  <D.26642>:
  D.26643 = mono_defaults.int16_class;
  D.26637 = &D.26643->byval_arg;
  return D.26637;
  <D.21151>:
  D.26638 = mono_defaults.int32_class;
  D.26637 = &D.26638->byval_arg;
  return D.26637;
  <D.21152>:
  D.26639 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.26639);
  D.26638 = mono_defaults.int32_class;
  D.26637 = &D.26638->byval_arg;
  return D.26637;
}


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

  conv_arg_class = mono_defaults.int32_class;
  if (spec != 0B) goto <D.26645>; else goto <D.26646>;
  <D.26645>:
  D.26647 = spec->native;
  switch (D.26647) <default: <D.21163>, case 2: <D.21162>, case 3: <D.21158>, case 4: <D.21159>, case 37: <D.21161>>
  <D.21158>:
  <D.21159>:
  conv_arg_class = mono_defaults.byte_class;
  if (ldop != 0B) goto <D.26648>; else goto <D.26649>;
  <D.26648>:
  *ldop = 70;
  <D.26649>:
  goto <D.21160>;
  <D.21161>:
  conv_arg_class = mono_defaults.int16_class;
  if (ldop != 0B) goto <D.26650>; else goto <D.26651>;
  <D.26650>:
  *ldop = 72;
  <D.26651>:
  goto <D.21160>;
  <D.21162>:
  goto <D.21160>;
  <D.21163>:
  D.26647 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.26647);
  <D.21160>:
  <D.26646>:
  D.26652 = conv_arg_class;
  return D.26652;
}


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

  mb = m->mb;
  switch (action) <default: <D.21215>, case 0: <D.21211>, case 1: <D.21213>, case 3: <D.21214>>
  <D.21211>:
  goto <D.21212>;
  <D.21213>:
  argnum.273 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.273);
  goto <D.21212>;
  <D.21214>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.21212>;
  <D.21215>:
  goto <D.21212>;
  <D.21212>:
  D.26656 = conv_arg;
  return D.26656;
}


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

  mb = m->mb;
  switch (action) <default: <D.21229>, case 1: <D.21226>, case 3: <D.21228>>
  <D.21226>:
  argnum.274 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.274);
  goto <D.21227>;
  <D.21228>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.21227>;
  <D.21229>:
  goto <D.21227>;
  <D.21227>:
  D.26660 = conv_arg;
  return D.26660;
}


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

  mb = m->mb;
  switch (action) <default: <D.21243>, case 1: <D.21240>, case 3: <D.21242>>
  <D.21240>:
  argnum.275 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.275);
  goto <D.21241>;
  <D.21242>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.21241>;
  <D.21243>:
  goto <D.21241>;
  <D.21241>:
  D.26664 = conv_arg;
  return D.26664;
}


emit_marshal_vtype (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * date_time_class.278;
  struct MonoClass * tmp_klass.276;
  struct MonoImage * D.26672;
  struct MonoClass * tmp_klass.277;
  _Bool D.26674;
  long int D.26675;
  long int D.26676;
  struct MonoMethod * to_oadate.279;
  struct MonoMethod * to_oadate.280;
  _Bool D.26685;
  long int D.26686;
  long int D.26687;
  struct MonoClass * D.26690;
  struct MonoType * D.26691;
  long unsigned int D.26692;
  long unsigned int D.26693;
  unsigned int argnum.281;
  unsigned int D.26697;
  short unsigned int D.26701;
  unsigned int D.26702;
  unsigned int D.26703;
  struct MonoMethodSignature * D.26706;
  <unnamed-unsigned:1> D.26707;
  int D.26708;
  int D.26709;
  unsigned int conv_arg.282;
  unsigned int pos.283;
  unsigned int D.26714;
  unsigned int D.26715;
  long unsigned int D.26717;
  long unsigned int D.26718;
  struct MonoClass * D.26720;
  struct MonoType * D.26721;
  int D.26725;
  unsigned int D.26728;
  <unnamed type> D.26736;
  _Bool D.26739;
  long int D.26740;
  long int D.26741;
  struct MonoMethod * from_oadate.284;
  struct MonoMethod * from_oadate.285;
  _Bool D.26767;
  long int D.26768;
  long int D.26769;
  unsigned int D.26776;
  long unsigned int D.26784;
  struct MonoType * D.26788;
  int D.26789;
  int D.26790;
  unsigned int D.26797;
  unsigned int D.26805;
  unsigned int pos2.286;
  int D.26810;
  int D.26811;
  _Bool D.26812;
  long int D.26813;
  long int D.26814;
  int D.26817;
  unsigned int D.26818;
  int D.26819;
  struct MonoMethodBuilder * mb;
  struct MonoClass * klass;
  struct MonoClass * date_time_class;
  int pos;
  int pos2;

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

    {
      tmp_klass.276 = tmp_klass;
      if (tmp_klass.276 == 0B) goto <D.26668>; else goto <D.26669>;
      <D.26668>:
      if (0 != 0) goto <D.26670>; else goto <D.26671>;
      <D.26670>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "mono_defaults.corlib == mono_defaults.corlib");
      <D.26671>:
      D.26672 = mono_defaults.corlib;
      tmp_klass.277 = mono_class_from_name (D.26672, "System", "DateTime");
      tmp_klass = tmp_klass.277;
      tmp_klass.276 = tmp_klass;
      D.26674 = tmp_klass.276 == 0B;
      D.26675 = (long int) D.26674;
      D.26676 = __builtin_expect (D.26675, 0);
      if (D.26676 != 0) goto <D.26677>; else goto <D.26678>;
      <D.26677>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "tmp_klass");
      <D.26678>:
      <D.26669>:
    }
    date_time_class.278 = tmp_klass;
  }
  date_time_class = date_time_class.278;
  switch (action) <default: <D.20899>, case 0: <D.20889>, case 1: <D.20892>, case 2: <D.20893>, case 3: <D.20895>, case 4: <D.20896>, case 5: <D.20897>, case 6: <D.20898>>
  <D.20889>:
  if (klass == date_time_class) goto <D.26679>; else goto <D.26680>;
  <D.26679>:
  {
    static struct MonoMethod * to_oadate;

    to_oadate.279 = to_oadate;
    if (to_oadate.279 == 0B) goto <D.26682>; else goto <D.26683>;
    <D.26682>:
    to_oadate.280 = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
    to_oadate = to_oadate.280;
    <D.26683>:
    to_oadate.279 = to_oadate;
    D.26685 = to_oadate.279 == 0B;
    D.26686 = (long int) D.26685;
    D.26687 = __builtin_expect (D.26686, 0);
    if (D.26687 != 0) goto <D.26688>; else goto <D.26689>;
    <D.26688>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6236, "to_oadate");
    <D.26689>:
    D.26690 = mono_defaults.double_class;
    D.26691 = &D.26690->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.26691);
    D.26692 = BIT_FIELD_REF <*t, 64, 64>;
    D.26693 = D.26692 & 1073741824;
    if (D.26693 != 0) goto <D.26694>; else goto <D.26695>;
    <D.26694>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    D.26697 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.26697;
    <D.26695>:
    D.26692 = BIT_FIELD_REF <*t, 64, 64>;
    D.26693 = D.26692 & 1073741824;
    if (D.26693 == 0) goto <D.26698>; else goto <D.26700>;
    <D.26700>:
    D.26701 = t->attrs;
    D.26702 = (unsigned int) D.26701;
    D.26703 = D.26702 & 3;
    if (D.26703 != 2) goto <D.26698>; else goto <D.26699>;
    <D.26698>:
    D.26692 = BIT_FIELD_REF <*t, 64, 64>;
    D.26693 = D.26692 & 1073741824;
    if (D.26693 == 0) goto <D.26704>; else goto <D.26705>;
    <D.26704>:
    D.26706 = m->csig;
    D.26706 = m->csig;
    D.26707 = D.26706->hasthis;
    D.26708 = (int) D.26707;
    D.26709 = argnum - D.26708;
    D.26690 = mono_defaults.double_class;
    D.26691 = &D.26690->byval_arg;
    D.26706->params[D.26709] = D.26691;
    <D.26705>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.281);
    to_oadate.279 = to_oadate;
    mono_mb_emit_managed_call (mb, to_oadate.279, 0B);
    conv_arg.282 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.282);
    <D.26699>:
    D.26692 = BIT_FIELD_REF <*t, 64, 64>;
    D.26693 = D.26692 & 1073741824;
    if (D.26693 != 0) goto <D.26711>; else goto <D.26712>;
    <D.26711>:
    pos.283 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.283);
    <D.26712>:
    goto <D.20891>;
  }
  <D.26680>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.20891>; else goto <D.26716>;
  <D.26716>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.20891>; else goto <D.26719>;
  <D.26719>:
  D.26720 = mono_defaults.int_class;
  D.26721 = &D.26720->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26721);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26722>; else goto <D.26723>;
  <D.26722>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.26724>;
  <D.26723>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  <D.26724>:
  mono_mb_emit_stloc (mb, 0);
  D.26725 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26725);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.282);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26726>; else goto <D.26727>;
  <D.26726>:
  mono_mb_emit_ldloc (mb, 0);
  D.26728 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26728;
  <D.26727>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 == 0) goto <D.26729>; else goto <D.26731>;
  <D.26731>:
  D.26701 = t->attrs;
  D.26702 = (unsigned int) D.26701;
  D.26703 = D.26702 & 3;
  if (D.26703 != 2) goto <D.26729>; else goto <D.26730>;
  <D.26729>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.26730>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26732>; else goto <D.26733>;
  <D.26732>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26733>:
  goto <D.20891>;
  <D.20892>:
  if (spec != 0B) goto <D.26734>; else goto <D.26735>;
  <D.26734>:
  D.26736 = spec->native;
  if (D.26736 == 43) goto <D.26737>; else goto <D.26738>;
  <D.26737>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  D.26739 = D.26693 != 0;
  D.26740 = (long int) D.26739;
  D.26741 = __builtin_expect (D.26740, 0);
  if (D.26741 != 0) goto <D.26742>; else goto <D.26743>;
  <D.26742>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6301, "!t->byref");
  <D.26743>:
  D.26706 = m->csig;
  D.26706 = m->csig;
  D.26707 = D.26706->hasthis;
  D.26708 = (int) D.26707;
  D.26709 = argnum - D.26708;
  D.26720 = mono_defaults.int_class;
  D.26721 = &D.26720->byval_arg;
  D.26706->params[D.26709] = D.26721;
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.26744>; else goto <D.26747>;
  <D.26747>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.26744>; else goto <D.26745>;
  <D.26744>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  goto <D.26746>;
  <D.26745>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  <D.26746>:
  goto <D.20891>;
  <D.26738>:
  <D.26735>:
  if (klass == date_time_class) goto <D.26748>; else goto <D.26749>;
  <D.26748>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26750>; else goto <D.26751>;
  <D.26750>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  goto <D.26752>;
  <D.26751>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  <D.26752>:
  goto <D.20891>;
  <D.26749>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.26753>; else goto <D.26755>;
  <D.26755>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.26753>; else goto <D.26754>;
  <D.26753>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.20891>;
  <D.26754>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 == 0) goto <D.26756>; else goto <D.26757>;
  <D.26756>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 6, klass);
  <D.26757>:
  goto <D.20891>;
  <D.20893>:
  if (klass == date_time_class) goto <D.26758>; else goto <D.26759>;
  <D.26758>:
  {
    static struct MonoMethod * from_oadate;

    D.26692 = BIT_FIELD_REF <*t, 64, 64>;
    D.26693 = D.26692 & 1073741824;
    if (D.26693 == 0) goto <D.20891>; else goto <D.26760>;
    <D.26760>:
    D.26701 = t->attrs;
    D.26702 = (unsigned int) D.26701;
    D.26703 = D.26702 & 3;
    if (D.26703 != 1) goto <D.26761>; else goto <D.26762>;
    <D.26761>:
    from_oadate.284 = from_oadate;
    if (from_oadate.284 == 0B) goto <D.26764>; else goto <D.26765>;
    <D.26764>:
    from_oadate.285 = mono_class_get_method_from_name (date_time_class, "FromOADate", 1);
    from_oadate = from_oadate.285;
    <D.26765>:
    from_oadate.284 = from_oadate;
    D.26767 = from_oadate.284 == 0B;
    D.26768 = (long int) D.26767;
    D.26769 = __builtin_expect (D.26768, 0);
    if (D.26769 != 0) goto <D.26770>; else goto <D.26771>;
    <D.26770>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6345, "from_oadate");
    <D.26771>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.282 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.282);
    from_oadate.284 = from_oadate;
    mono_mb_emit_managed_call (mb, from_oadate.284, 0B);
    mono_mb_emit_op (mb, 129, date_time_class);
    <D.26762>:
    goto <D.20891>;
  }
  <D.26759>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.20891>; else goto <D.26772>;
  <D.26772>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.20891>; else goto <D.26773>;
  <D.26773>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26774>; else goto <D.26775>;
  <D.26774>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26776 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26776;
  D.26701 = t->attrs;
  D.26702 = (unsigned int) D.26701;
  D.26703 = D.26702 & 3;
  if (D.26703 != 1) goto <D.26777>; else goto <D.26778>;
  <D.26777>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  <D.26778>:
  <D.26775>:
  emit_struct_free (mb, klass, conv_arg);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26779>; else goto <D.26780>;
  <D.26779>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26780>:
  goto <D.20891>;
  <D.20895>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.26781>; else goto <D.26783>;
  <D.26783>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26784 = D.26717 & 32;
  if (D.26784 != 0) goto <D.26781>; else goto <D.26782>;
  <D.26781>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20891>;
  <D.26782>:
  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.20891>;
  <D.20896>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.26785>; else goto <D.26787>;
  <D.26787>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.26785>; else goto <D.26786>;
  <D.26785>:
  conv_arg = 0;
  goto <D.20891>;
  <D.26786>:
  D.26788 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26788);
  D.26701 = t->attrs;
  D.26789 = (int) D.26701;
  D.26790 = D.26789 & 2;
  if (D.26790 != 0) goto <D.20891>; else goto <D.26791>;
  <D.26791>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26792>; else goto <D.26793>;
  <D.26792>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  goto <D.26794>;
  <D.26793>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.281);
  <D.26794>:
  mono_mb_emit_stloc (mb, 0);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26795>; else goto <D.26796>;
  <D.26795>:
  mono_mb_emit_ldloc (mb, 0);
  D.26797 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26797;
  <D.26796>:
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26798>; else goto <D.26799>;
  <D.26798>:
  pos.283 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.283);
  <D.26799>:
  goto <D.20891>;
  <D.20897>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.20891>; else goto <D.26800>;
  <D.26800>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.20891>; else goto <D.26801>;
  <D.26801>:
  D.26692 = BIT_FIELD_REF <*t, 64, 64>;
  D.26693 = D.26692 & 1073741824;
  if (D.26693 != 0) goto <D.26802>; else goto <D.26803>;
  <D.26802>:
  D.26701 = t->attrs;
  D.26702 = (unsigned int) D.26701;
  D.26703 = D.26702 & 3;
  if (D.26703 == 1) goto <D.20891>; else goto <D.26804>;
  <D.26804>:
  <D.26803>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  D.26805 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.26805;
  conv_arg.282 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.282);
  mono_mb_emit_stloc (mb, 0);
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos2.286 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.286);
  goto <D.20891>;
  <D.20898>:
  D.26714 = klass->flags;
  D.26715 = D.26714 & 24;
  if (D.26715 == 16) goto <D.26807>; else goto <D.26809>;
  <D.26809>:
  D.26717 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26718 = D.26717 & 48;
  if (D.26718 != 0) goto <D.26807>; else goto <D.26808>;
  <D.26807>:
  mono_mb_emit_stloc (mb, 3);
  m->retobj_var = 0;
  goto <D.20891>;
  <D.26808>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  D.26720 = mono_defaults.int_class;
  D.26721 = &D.26720->byval_arg;
  D.26810 = mono_mb_add_local (mb, D.26721);
  m->retobj_var = D.26810;
  m->retobj_class = klass;
  D.26811 = m->retobj_var;
  D.26812 = D.26811 == 0;
  D.26813 = (long int) D.26812;
  D.26814 = __builtin_expect (D.26813, 0);
  if (D.26814 != 0) goto <D.26815>; else goto <D.26816>;
  <D.26815>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6481, "m->retobj_var");
  <D.26816>:
  D.26817 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26817);
  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.26811 = m->retobj_var;
  D.26818 = (unsigned int) D.26811;
  mono_mb_emit_stloc (mb, D.26818);
  emit_struct_conv (mb, klass, 0);
  goto <D.20891>;
  <D.20899>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6494);
  <D.20891>:
  D.26819 = conv_arg;
  return D.26819;
}


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.26821;
  struct MonoType * D.26822;
  int * D.26823;
  long unsigned int D.26824;
  long unsigned int D.26825;
  int * D.26826;
  struct MonoClass * D.26827;
  struct MonoClass * D.26828;
  long unsigned int D.26831;
  long unsigned int D.26832;
  long unsigned int D.26835;
  long unsigned int D.26836;
  short unsigned int D.26839;
  int D.26840;
  int D.26841;
  unsigned int conv_arg.287;
  unsigned int argnum.288;
  void * D.26847;
  struct MonoClass * D.26849;
  struct MonoMethodPInvoke * D.26852;
  unsigned int D.26855;
  unsigned int D.26856;
  void * D.26862;
  long unsigned int D.26864;
  unsigned int D.26867;
  unsigned int pos.289;
  unsigned int D.26873;
  int D.26874;
  int D.26877;
  int D.26878;
  unsigned int D.26879;
  _Bool D.26882;
  long int D.26883;
  long int D.26884;
  void * D.26890;
  int need_free.290;
  void * D.26898;
  unsigned int D.26905;
  unsigned int D.26912;
  _Bool D.26915;
  long int D.26916;
  long int D.26917;
  unsigned int pos2.291;
  _Bool D.26926;
  long int D.26927;
  long int D.26928;
  void * D.26931;
  unsigned int loc.292;
  unsigned int D.26934;
  struct MonoType * D.26935;
  void * D.26940;
  _Bool D.26943;
  long int D.26944;
  long int D.26945;
  _Bool D.26950;
  long int D.26951;
  long int D.26952;
  unsigned int D.26955;
  unsigned int D.26956;
  unsigned int D.26963;
  unsigned int pos2.293;
  unsigned int D.26965;
  unsigned int D.26968;
  unsigned int D.26969;
  int D.26970;
  void * D.26974;
  unsigned int D.26977;
  unsigned int D.26978;
  int D.26979;
  int D.26980;
  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.21013>, case 0: <D.20991>, case 1: <D.21006>, case 2: <D.20998>, case 3: <D.21007>, case 4: <D.21008>, case 5: <D.21011>, case 6: <D.21012>>
  <D.20991>:
  D.26821 = mono_defaults.int_class;
  D.26822 = &D.26821->byval_arg;
  *conv_arg_type = D.26822;
  D.26821 = mono_defaults.int_class;
  D.26822 = &D.26821->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26822);
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  *D.26826 = 0;
  D.26827 = mono_class_from_mono_type (t);
  D.26828 = mono_defaults.object_class;
  if (D.26827 == D.26828) goto <D.26829>; else goto <D.26830>;
  <D.26829>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Marshalling of type object is not implemented");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20993>;
  }
  <D.26830>:
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26832 = D.26831 & 16777216;
  if (D.26832 != 0) goto <D.26833>; else goto <D.26834>;
  <D.26833>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26837>; else goto <D.26838>;
  <D.26837>:
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 == 0) goto <D.26842>; else goto <D.26843>;
  <D.26842>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Byref marshalling of delegates is not implemented.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
  }
  <D.26843>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.26845>;
  <D.26838>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26847 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26847);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  <D.26845>:
  goto <D.26848>;
  <D.26834>:
  D.26849 = mono_defaults.stringbuilder_class;
  if (D.26849 == klass) goto <D.26850>; else goto <D.26851>;
  <D.26850>:
  {
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    D.26852 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26852, spec);
    D.26852 = m->piinfo;
    conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.26852, spec);
    D.26835 = BIT_FIELD_REF <*t, 64, 64>;
    D.26836 = D.26835 & 1073741824;
    if (D.26836 != 0) goto <D.26853>; else goto <D.26854>;
    <D.26853>:
    D.26839 = t->attrs;
    D.26855 = (unsigned int) D.26839;
    D.26856 = D.26855 & 3;
    if (D.26856 == 2) goto <D.20993>; else goto <D.26857>;
    <D.26857>:
    <D.26854>:
    if (conv == 4294967295) goto <D.26858>; else goto <D.26859>;
    <D.26858>:
    {
      char * msg;

      msg = monoeg_g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.20993>;
    }
    <D.26859>:
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    D.26835 = BIT_FIELD_REF <*t, 64, 64>;
    D.26836 = D.26835 & 1073741824;
    if (D.26836 != 0) goto <D.26860>; else goto <D.26861>;
    <D.26860>:
    mono_mb_emit_byte (mb, 77);
    <D.26861>:
    D.26862 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.26862);
    conv_arg.287 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.287);
  }
  goto <D.26863>;
  <D.26851>:
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26864 = D.26831 & 32;
  if (D.26864 != 0) goto <D.26865>; else goto <D.26866>;
  <D.26865>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26867 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26867;
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_ldflda (mb, 16);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20993>;
  <D.26866>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26869>; else goto <D.26870>;
  <D.26869>:
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 != 0) goto <D.20993>; else goto <D.26871>;
  <D.26871>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 77);
  goto <D.26872>;
  <D.26870>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  <D.26872>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26873 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26873;
  D.26874 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26874);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26875>; else goto <D.26876>;
  <D.26875>:
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26821 = mono_defaults.int_class;
  D.26822 = &D.26821->byval_arg;
  D.26877 = mono_mb_add_local (mb, D.26822);
  *D.26826 = D.26877;
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26878 = *D.26826;
  D.26879 = (unsigned int) D.26878;
  mono_mb_emit_stloc (mb, D.26879);
  <D.26876>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  <D.26863>:
  <D.26848>:
  goto <D.20993>;
  <D.20998>:
  D.26849 = mono_defaults.stringbuilder_class;
  if (D.26849 == klass) goto <D.26880>; else goto <D.26881>;
  <D.26880>:
  {
    gboolean need_free;
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    try
      {
        D.26852 = m->piinfo;
        encoding = mono_marshal_get_string_encoding (D.26852, spec);
        D.26852 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.26852, spec, &need_free);
        D.26882 = encoding == 4294967295;
        D.26883 = (long int) D.26882;
        D.26884 = __builtin_expect (D.26883, 0);
        if (D.26884 != 0) goto <D.26885>; else goto <D.26886>;
        <D.26885>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7051, "encoding != -1");
        <D.26886>:
        D.26835 = BIT_FIELD_REF <*t, 64, 64>;
        D.26836 = D.26835 & 1073741824;
        if (D.26836 != 0) goto <D.26887>; else goto <D.26888>;
        <D.26887>:
        need_free = 1;
        argnum.288 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.288);
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        switch (encoding) <default: <D.21005>, case 20: <D.21004>, case 21: <D.21002>>
        <D.21002>:
        mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
        goto <D.21003>;
        <D.21004>:
        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
        goto <D.21003>;
        <D.21005>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7069);
        <D.21003>:
        mono_mb_emit_byte (mb, 81);
        goto <D.26889>;
        <D.26888>:
        argnum.288 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.288);
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        D.26890 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26890);
        <D.26889>:
        need_free.290 = need_free;
        if (need_free.290 != 0) goto <D.26892>; else goto <D.26893>;
        <D.26892>:
        conv_arg.287 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.287);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.26893>:
        goto <D.20993>;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.26881>:
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26832 = D.26831 & 16777216;
  if (D.26832 != 0) goto <D.26894>; else goto <D.26895>;
  <D.26894>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26896>; else goto <D.26897>;
  <D.26896>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26898 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26898);
  mono_mb_emit_byte (mb, 81);
  <D.26897>:
  goto <D.20993>;
  <D.26895>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26899>; else goto <D.26900>;
  <D.26899>:
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 != 0) goto <D.26901>; else goto <D.26902>;
  <D.26901>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_byte (mb, 81);
  <D.26902>:
  <D.26900>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26903>; else goto <D.26904>;
  <D.26903>:
  mono_mb_emit_byte (mb, 77);
  <D.26904>:
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26905 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26905;
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26906>; else goto <D.26909>;
  <D.26909>:
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 != 0) goto <D.26906>; else goto <D.26907>;
  <D.26906>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_stloc (mb, 1);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, conv_arg);
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26878 = *D.26826;
  if (D.26878 != 0) goto <D.26910>; else goto <D.26911>;
  <D.26910>:
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26878 = *D.26826;
  D.26879 = (unsigned int) D.26878;
  mono_mb_emit_ldloc (mb, D.26879);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26912 = mono_mb_emit_branch (mb, 59);
  pos2 = (int) D.26912;
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 == 0) goto <D.26913>; else goto <D.26914>;
  <D.26913>:
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26878 = *D.26826;
  D.26915 = D.26878 == 0;
  D.26916 = (long int) D.26915;
  D.26917 = __builtin_expect (D.26916, 0);
  if (D.26917 != 0) goto <D.26918>; else goto <D.26919>;
  <D.26918>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7144, "m->orig_conv_args [argnum]");
  <D.26919>:
  D.26823 = m->orig_conv_args;
  D.26824 = (long unsigned int) argnum;
  D.26825 = D.26824 * 4;
  D.26826 = D.26823 + D.26825;
  D.26878 = *D.26826;
  emit_struct_free (mb, klass, D.26878);
  <D.26914>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  <D.26911>:
  goto <D.26908>;
  <D.26907>:
  emit_struct_free (mb, klass, conv_arg);
  <D.26908>:
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20993>;
  <D.21006>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26921>; else goto <D.26922>;
  <D.26921>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.287);
  goto <D.26923>;
  <D.26922>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  <D.26923>:
  goto <D.20993>;
  <D.21007>:
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26832 = D.26831 & 16777216;
  if (D.26832 != 0) goto <D.26924>; else goto <D.26925>;
  <D.26924>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  D.26926 = D.26836 != 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", 7171, "!t->byref");
  <D.26930>:
  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.26931 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26931);
  mono_mb_emit_stloc (mb, 3);
  goto <D.26932>;
  <D.26925>:
  mono_mb_emit_stloc (mb, 0);
  D.26821 = mono_defaults.int_class;
  D.26822 = &D.26821->byval_arg;
  loc = mono_mb_add_local (mb, D.26822);
  mono_mb_emit_ldloc (mb, 0);
  loc.292 = (unsigned int) loc;
  mono_mb_emit_stloc (mb, loc.292);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 0);
  D.26934 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26934;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 3);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, loc);
  loc.292 = (unsigned int) loc;
  mono_mb_emit_ldloc (mb, loc.292);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  <D.26932>:
  goto <D.20993>;
  <D.21008>:
  D.26935 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26935);
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26832 = D.26831 & 16777216;
  if (D.26832 != 0) goto <D.26936>; else goto <D.26937>;
  <D.26936>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  D.26926 = D.26836 != 0;
  D.26927 = (long int) D.26926;
  D.26928 = __builtin_expect (D.26927, 0);
  if (D.26928 != 0) goto <D.26938>; else goto <D.26939>;
  <D.26938>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7221, "!t->byref");
  <D.26939>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26940 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26940);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.20993>;
  <D.26937>:
  D.26849 = mono_defaults.stringbuilder_class;
  if (D.26849 == klass) goto <D.26941>; else goto <D.26942>;
  <D.26941>:
  {
    MonoMarshalNative encoding;

    D.26852 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26852, spec);
    D.26943 = encoding != 20;
    D.26944 = (long int) D.26943;
    D.26945 = __builtin_expect (D.26944, 0);
    if (D.26945 != 0) goto <D.26946>; else goto <D.26947>;
    <D.26946>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7236, "encoding == MONO_NATIVE_LPSTR");
    <D.26947>:
    D.26835 = BIT_FIELD_REF <*t, 64, 64>;
    D.26836 = D.26835 & 1073741824;
    D.26926 = D.26836 != 0;
    D.26927 = (long int) D.26926;
    D.26928 = __builtin_expect (D.26927, 0);
    if (D.26928 != 0) goto <D.26948>; else goto <D.26949>;
    <D.26948>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7238, "!t->byref");
    <D.26949>:
    D.26950 = encoding == 4294967295;
    D.26951 = (long int) D.26950;
    D.26952 = __builtin_expect (D.26951, 0);
    if (D.26952 != 0) goto <D.26953>; else goto <D.26954>;
    <D.26953>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7239, "encoding != -1");
    <D.26954>:
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
    conv_arg.287 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.287);
    goto <D.20993>;
  }
  <D.26942>:
  D.26955 = klass->flags;
  D.26956 = D.26955 & 24;
  if (D.26956 == 0) goto <D.26957>; else goto <D.26958>;
  <D.26957>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20993>;
  <D.26958>:
  D.26839 = t->attrs;
  D.26840 = (int) D.26839;
  D.26841 = D.26840 & 2;
  if (D.26841 != 0) goto <D.26959>; else goto <D.26960>;
  <D.26959>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  goto <D.20993>;
  <D.26960>:
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26961>; else goto <D.26962>;
  <D.26961>:
  {
    int pos2;

    D.26963 = mono_mb_emit_branch (mb, 58);
    pos2 = (int) D.26963;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos2.293 = (unsigned int) pos2;
    mono_mb_patch_branch (mb, pos2.293);
    argnum.288 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.288);
    mono_mb_emit_byte (mb, 77);
  }
  <D.26962>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 22);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  mono_mb_emit_ldloc (mb, 0);
  D.26965 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26965;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.287);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  goto <D.20993>;
  <D.21011>:
  D.26835 = BIT_FIELD_REF <*t, 64, 64>;
  D.26836 = D.26835 & 1073741824;
  if (D.26836 != 0) goto <D.26966>; else goto <D.26967>;
  <D.26966>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  D.26968 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26968;
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 81);
  D.26969 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26969;
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  D.26970 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26970);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_stloc (mb, 1);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 223);
  emit_struct_conv (mb, klass, 0);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  goto <D.26971>;
  <D.26967>:
  conv_arg.287 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.287);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  argnum.288 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.288);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.26971>:
  goto <D.20993>;
  <D.21012>:
  D.26831 = BIT_FIELD_REF <*klass, 64, 256>;
  D.26832 = D.26831 & 16777216;
  if (D.26832 != 0) goto <D.26972>; else goto <D.26973>;
  <D.26972>:
  D.26974 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26974);
  mono_mb_emit_stloc (mb, 3);
  goto <D.20993>;
  <D.26973>:
  D.26955 = klass->flags;
  D.26956 = D.26955 & 24;
  if (D.26956 == 0) goto <D.26975>; else goto <D.26976>;
  <D.26975>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20993>;
  <D.26976>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26977 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26977;
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  D.26978 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26978;
  pos.289 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.289);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  D.26979 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26979);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_stloc (mb, 3);
  emit_struct_conv (mb, klass, 0);
  pos2.291 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.291);
  goto <D.20993>;
  <D.21013>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7389);
  <D.20993>:
  D.26980 = conv_arg;
  return D.26980;
}


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

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


mono_marshal_get_native_wrapper (struct MonoMethod * method, gboolean check_exceptions, gboolean aot)
{
  _Bool D.26985;
  long int D.26986;
  long int D.26987;
  struct MonoMethodSignature * D.26990;
  long unsigned int D.26991;
  long unsigned int D.26992;
  _Bool D.26993;
  long int D.26994;
  long int D.26995;
  struct MonoClass * D.27000;
  struct MonoImage * D.27001;
  struct GHashTable * * D.27002;
  struct GHashTable * * D.27004;
  struct MonoMethod * D.27007;
  unsigned int D.27008;
  unsigned int D.27009;
  short unsigned int D.27012;
  int D.27013;
  int D.27014;
  short unsigned int D.27017;
  int D.27018;
  int D.27019;
  void * D.27022;
  int D.27027;
  void * D.27034;
  _Bool D.27037;
  long int D.27038;
  long int D.27039;
  long unsigned int D.27042;
  long unsigned int D.27043;
  _Bool D.27044;
  long int D.27045;
  long int D.27046;
  long unsigned int D.27049;
  long unsigned int D.27050;
  _Bool D.27051;
  long int D.27052;
  long int D.27053;
  struct MonoClass * D.27056;
  struct MonoType * D.27057;
  int D.21374;
  int iftmp.294;
  int D.21370;
  const char[13] * D.27061;
  unsigned char D.27062;
  int D.27063;
  unsigned char D.27064;
  int D.27065;
  const unsigned char * D.27070;
  unsigned char D.27071;
  int D.27072;
  const unsigned char * D.27073;
  unsigned char D.27074;
  int D.27075;
  const unsigned char * D.27080;
  unsigned char D.27081;
  int D.27082;
  const unsigned char * D.27083;
  unsigned char D.27084;
  int D.27085;
  const unsigned char * D.27090;
  unsigned char D.27091;
  int D.27092;
  const unsigned char * D.27093;
  unsigned char D.27094;
  int D.27095;
  const char * D.27097;
  struct MonoMethodSignature * D.27100;
  int D.27101;
  short unsigned int D.27104;
  int D.27105;
  int D.27106;
  _Bool D.27107;
  long int D.27108;
  long int D.27109;
  short unsigned int D.27112;
  int D.27113;
  int D.27114;
  _Bool D.27115;
  long int D.27116;
  long int D.27117;
  const char * D.27120;
  unsigned int i.295;
  short unsigned int D.27122;
  int D.27123;
  int D.27124;
  struct MonoMethod * D.27125;
  const char * exc_class.296;
  const char * exc_arg.297;
  int D.27132;
  int D.27133;
  unsigned int D.27143;
  unsigned int pos.298;
  <unnamed-unsigned:1> D.27145;
  int D.27146;
  int D.27147;
  unsigned int D.27148;
  short unsigned int D.27149;
  int D.27150;
  struct MonoMethod * D.27153;
  _Bool D.27155;
  long int D.27156;
  long int D.27157;
  _Bool D.27162;
  long int D.27163;
  long int D.27164;
  int D.27171;
  long unsigned int D.27172;
  long unsigned int D.27173;
  struct MonoClass * D.27174;
  struct MonoImage * D.27175;
  long unsigned int D.27176;
  long unsigned int D.27177;
  struct MonoMarshalSpec * * D.27178;
  struct MonoMarshalSpec * D.27179;
  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.26985 = method == 0B;
      D.26986 = (long int) D.26985;
      D.26987 = __builtin_expect (D.26986, 0);
      if (D.26987 != 0) goto <D.26988>; else goto <D.26989>;
      <D.26988>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8859, "method != NULL");
      <D.26989>:
      D.26990 = mono_method_signature (method);
      D.26991 = BIT_FIELD_REF <*D.26990, 64, 64>;
      D.26992 = D.26991 & 72057594037927936;
      D.26993 = D.26992 == 0;
      D.26994 = (long int) D.26993;
      D.26995 = __builtin_expect (D.26994, 0);
      if (D.26995 != 0) goto <D.26996>; else goto <D.26997>;
      <D.26996>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8860, "mono_method_signature (method)->pinvoke");
      <D.26997>:
      if (aot != 0) goto <D.26998>; else goto <D.26999>;
      <D.26998>:
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      D.27002 = &D.27001->native_wrapper_aot_cache;
      cache = get_cache (D.27002, mono_aligned_addr_hash, 0B);
      goto <D.27003>;
      <D.26999>:
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      D.27004 = &D.27001->native_wrapper_cache;
      cache = get_cache (D.27004, mono_aligned_addr_hash, 0B);
      <D.27003>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.27005>; else goto <D.27006>;
      <D.27005>:
      D.27007 = res;
      return D.27007;
      <D.27006>:
      D.27000 = method->klass;
      D.27008 = D.27000->flags;
      D.27009 = D.27008 & 4096;
      if (D.27009 != 0) goto <D.27010>; else goto <D.27011>;
      <D.27010>:
      D.27007 = mono_cominterop_get_native_wrapper (method);
      return D.27007;
      <D.27011>:
      sig = mono_method_signature (method);
      D.27012 = method->iflags;
      D.27013 = (int) D.27012;
      D.27014 = D.27013 & 4096;
      if (D.27014 == 0) goto <D.27015>; else goto <D.27016>;
      <D.27015>:
      D.27017 = method->flags;
      D.27018 = (int) D.27017;
      D.27019 = D.27018 & 8192;
      if (D.27019 != 0) goto <D.27020>; else goto <D.27021>;
      <D.27020>:
      pinvoke = 1;
      <D.27021>:
      <D.27016>:
      D.27022 = piinfo->addr;
      if (D.27022 == 0B) goto <D.27023>; else goto <D.27024>;
      <D.27023>:
      if (pinvoke != 0) goto <D.27025>; else goto <D.27026>;
      <D.27025>:
      D.27012 = method->iflags;
      D.27013 = (int) D.27012;
      D.27027 = D.27013 & 1;
      if (D.27027 != 0) goto <D.27028>; else goto <D.27029>;
      <D.27028>:
      exc_arg = "Method contains unsupported native code";
      goto <D.27030>;
      <D.27029>:
      if (aot == 0) goto <D.27031>; else goto <D.27032>;
      <D.27031>:
      mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
      <D.27032>:
      <D.27030>:
      goto <D.27033>;
      <D.27026>:
      D.27034 = mono_lookup_internal_call (method);
      piinfo->addr = D.27034;
      <D.27033>:
      <D.27024>:
      D.27022 = piinfo->addr;
      if (D.27022 == ves_icall_System_String_ctor_RedirectToCreateString) goto <D.27035>; else goto <D.27036>;
      <D.27035>:
      D.27037 = pinvoke != 0;
      D.27038 = (long int) D.27037;
      D.27039 = __builtin_expect (D.27038, 0);
      if (D.27039 != 0) goto <D.27040>; else goto <D.27041>;
      <D.27040>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8896, "!pinvoke");
      <D.27041>:
      D.27042 = BIT_FIELD_REF <*method, 64, 256>;
      D.27043 = D.27042 & 128;
      D.27044 = D.27043 == 0;
      D.27045 = (long int) D.27044;
      D.27046 = __builtin_expect (D.27045, 0);
      if (D.27046 != 0) goto <D.27047>; else goto <D.27048>;
      <D.27047>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8897, "method->string_ctor");
      <D.27048>:
      D.27049 = BIT_FIELD_REF <*sig, 64, 64>;
      D.27050 = D.27049 & 18014398509481984;
      D.27051 = D.27050 == 0;
      D.27052 = (long int) D.27051;
      D.27053 = __builtin_expect (D.27052, 0);
      if (D.27053 != 0) goto <D.27054>; else goto <D.27055>;
      <D.27054>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8898, "sig->hasthis");
      <D.27055>:
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      csig = signature_dup (D.27001, sig);
      D.27056 = mono_defaults.string_class;
      D.27057 = &D.27056->byval_arg;
      csig->ret = D.27057;
      csig->pinvoke = 0;
      iter = 0B;
      goto <D.21380>;
      <D.21379>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = res->name;
          D.27061 = "CreateString";
          D.27062 = MEM[(const unsigned char *)D.27061];
          D.27063 = (int) D.27062;
          D.27064 = *__s2;
          D.27065 = (int) D.27064;
          __result = D.27063 - D.27065;
          {
            if (__s1_len != 0) goto <D.27066>; else goto <D.27067>;
            <D.27066>:
            if (__result == 0) goto <D.27068>; else goto <D.27069>;
            <D.27068>:
            D.27070 = &MEM[(void *)"CreateString" + 1B];
            D.27071 = *D.27070;
            D.27072 = (int) D.27071;
            D.27073 = __s2 + 1;
            D.27074 = *D.27073;
            D.27075 = (int) D.27074;
            __result = D.27072 - D.27075;
            if (__s1_len > 1) goto <D.27076>; else goto <D.27077>;
            <D.27076>:
            if (__result == 0) goto <D.27078>; else goto <D.27079>;
            <D.27078>:
            D.27080 = &MEM[(void *)"CreateString" + 2B];
            D.27081 = *D.27080;
            D.27082 = (int) D.27081;
            D.27083 = __s2 + 2;
            D.27084 = *D.27083;
            D.27085 = (int) D.27084;
            __result = D.27082 - D.27085;
            if (__s1_len > 2) goto <D.27086>; else goto <D.27087>;
            <D.27086>:
            if (__result == 0) goto <D.27088>; else goto <D.27089>;
            <D.27088>:
            D.27090 = &MEM[(void *)"CreateString" + 3B];
            D.27091 = *D.27090;
            D.27092 = (int) D.27091;
            D.27093 = __s2 + 3;
            D.27094 = *D.27093;
            D.27095 = (int) D.27094;
            __result = D.27092 - D.27095;
            <D.27089>:
            <D.27087>:
            <D.27079>:
            <D.27077>:
            <D.27069>:
            <D.27067>:
          }
          D.21370 = __result;
        }
        iftmp.294 = D.21370;
        goto <D.27096>;
        <D.27060>:
        D.27097 = res->name;
        iftmp.294 = __builtin_strcmp ("CreateString", D.27097);
        <D.27096>:
        D.21374 = iftmp.294;
      }
      if (D.21374 == 0) goto <D.27098>; else goto <D.27099>;
      <D.27098>:
      D.27100 = mono_method_signature (res);
      D.27101 = mono_metadata_signature_equal (csig, D.27100);
      if (D.27101 != 0) goto <D.27102>; else goto <D.27103>;
      <D.27102>:
      {
        struct WrapperInfo * info;

        D.27104 = res->iflags;
        D.27105 = (int) D.27104;
        D.27106 = D.27105 & 4096;
        D.27107 = D.27106 != 0;
        D.27108 = (long int) D.27107;
        D.27109 = __builtin_expect (D.27108, 0);
        if (D.27109 != 0) goto <D.27110>; else goto <D.27111>;
        <D.27110>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8911, "!(res->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)");
        <D.27111>:
        D.27112 = res->flags;
        D.27113 = (int) D.27112;
        D.27114 = D.27113 & 8192;
        D.27115 = D.27114 != 0;
        D.27116 = (long int) D.27115;
        D.27117 = __builtin_expect (D.27116, 0);
        if (D.27117 != 0) goto <D.27118>; else goto <D.27119>;
        <D.27118>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8912, "!(res->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)");
        <D.27119>:
        D.27000 = method->klass;
        D.27120 = method->name;
        mb = mono_mb_new (D.27000, D.27120, 7);
        mono_mb_emit_byte (mb, 2);
        i = 1;
        goto <D.21377>;
        <D.21376>:
        i.295 = (unsigned int) i;
        mono_mb_emit_ldarg (mb, i.295);
        i = i + 1;
        <D.21377>:
        D.27122 = csig->param_count;
        D.27123 = (int) D.27122;
        if (D.27123 >= i) goto <D.21376>; else goto <D.21378>;
        <D.21378>:
        mono_mb_emit_managed_call (mb, res, 0B);
        mono_mb_emit_byte (mb, 42);
        D.27122 = csig->param_count;
        D.27123 = (int) D.27122;
        D.27124 = D.27123 + 1;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.27124);
        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.27007 = res;
        return D.27007;
      }
      <D.27103>:
      <D.27099>:
      <D.21380>:
      D.27056 = mono_defaults.string_class;
      res = mono_class_get_methods (D.27056, &iter);
      if (res != 0B) goto <D.21379>; else goto <D.21381>;
      <D.21381>:
      piinfo->addr = 0B;
      monoeg_g_log (0B, 16, "cannot find CreateString for .ctor");
      <D.27036>:
      D.27000 = method->klass;
      D.27120 = method->name;
      mb = mono_mb_new (D.27000, D.27120, 6);
      D.27125 = mb->method;
      D.27125->save_lmf = 1;
      D.27022 = piinfo->addr;
      if (D.27022 == 0B) goto <D.27126>; else goto <D.27127>;
      <D.27126>:
      if (aot == 0) goto <D.27128>; else goto <D.27129>;
      <D.27128>:
      exc_class.296 = exc_class;
      exc_arg.297 = exc_arg;
      mono_mb_emit_exception (mb, exc_class.296, exc_arg.297);
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      csig = signature_dup (D.27001, sig);
      csig->pinvoke = 0;
      D.27122 = csig->param_count;
      D.27123 = (int) D.27122;
      D.27132 = D.27123 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.27132);
      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.27007 = res;
      return D.27007;
      <D.27129>:
      <D.27127>:
      D.27012 = method->iflags;
      D.27013 = (int) D.27012;
      D.27133 = D.27013 & 4099;
      if (D.27133 != 0) goto <D.27134>; else goto <D.27135>;
      <D.27134>:
      D.27049 = BIT_FIELD_REF <*sig, 64, 64>;
      D.27050 = D.27049 & 18014398509481984;
      if (D.27050 != 0) goto <D.27136>; else goto <D.27137>;
      <D.27136>:
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      D.27000 = method->klass;
      csig = signature_dup_add_this (D.27001, sig, D.27000);
      goto <D.27138>;
      <D.27137>:
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      csig = signature_dup (D.27001, sig);
      <D.27138>:
      D.27042 = BIT_FIELD_REF <*method, 64, 256>;
      D.27043 = D.27042 & 128;
      if (D.27043 != 0) goto <D.27139>; else goto <D.27140>;
      <D.27139>:
      D.27056 = mono_defaults.string_class;
      D.27057 = &D.27056->byval_arg;
      csig->ret = D.27057;
      <D.27140>:
      D.27049 = BIT_FIELD_REF <*sig, 64, 64>;
      D.27050 = D.27049 & 18014398509481984;
      if (D.27050 != 0) goto <D.27141>; else goto <D.27142>;
      <D.27141>:
      {
        int pos;

        mono_mb_emit_byte (mb, 2);
        D.27143 = mono_mb_emit_branch (mb, 58);
        pos = (int) D.27143;
        mono_mb_emit_exception (mb, "NullReferenceException", 0B);
        pos.298 = (unsigned int) pos;
        mono_mb_patch_branch (mb, pos.298);
        mono_mb_emit_byte (mb, 2);
      }
      <D.27142>:
      i = 0;
      goto <D.21384>;
      <D.21383>:
      D.27145 = sig->hasthis;
      D.27146 = (int) D.27145;
      D.27147 = D.27146 + i;
      D.27148 = (unsigned int) D.27147;
      mono_mb_emit_ldarg (mb, D.27148);
      i = i + 1;
      <D.21384>:
      D.27149 = sig->param_count;
      D.27150 = (int) D.27149;
      if (D.27150 > i) goto <D.21383>; else goto <D.21385>;
      <D.21385>:
      if (aot != 0) goto <D.27151>; else goto <D.27152>;
      <D.27151>:
      mono_mb_emit_byte (mb, 240);
      D.27153 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.27153);
      mono_mb_emit_calli (mb, csig);
      goto <D.27154>;
      <D.27152>:
      D.27022 = piinfo->addr;
      D.27155 = D.27022 == 0B;
      D.27156 = (long int) D.27155;
      D.27157 = __builtin_expect (D.27156, 0);
      if (D.27157 != 0) goto <D.27158>; else goto <D.27159>;
      <D.27158>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9005, "piinfo->addr");
      <D.27159>:
      D.27022 = piinfo->addr;
      mono_mb_emit_native_call (mb, csig, D.27022);
      <D.27154>:
      if (check_exceptions != 0) goto <D.27160>; else goto <D.27161>;
      <D.27160>:
      emit_thread_interrupt_checkpoint (mb);
      <D.27161>:
      mono_mb_emit_byte (mb, 42);
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      csig = signature_dup (D.27001, csig);
      csig->pinvoke = 0;
      D.27122 = csig->param_count;
      D.27123 = (int) D.27122;
      D.27132 = D.27123 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.27132);
      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.27007 = res;
      return D.27007;
      <D.27135>:
      D.27162 = pinvoke == 0;
      D.27163 = (long int) D.27162;
      D.27164 = __builtin_expect (D.27163, 0);
      if (D.27164 != 0) goto <D.27165>; else goto <D.27166>;
      <D.27165>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9026, "pinvoke");
      <D.27166>:
      if (aot == 0) goto <D.27167>; else goto <D.27168>;
      <D.27167>:
      D.27022 = piinfo->addr;
      D.27155 = D.27022 == 0B;
      D.27156 = (long int) D.27155;
      D.27157 = __builtin_expect (D.27156, 0);
      if (D.27157 != 0) goto <D.27169>; else goto <D.27170>;
      <D.27169>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9028, "piinfo->addr");
      <D.27170>:
      <D.27168>:
      D.27149 = sig->param_count;
      D.27150 = (int) D.27149;
      D.27171 = D.27150 + 1;
      D.27172 = (long unsigned int) D.27171;
      D.27173 = D.27172 * 8;
      mspecs = monoeg_malloc (D.27173);
      mono_method_get_marshal_info (method, mspecs);
      D.27125 = mb->method;
      D.27174 = D.27125->klass;
      D.27175 = D.27174->image;
      D.27022 = piinfo->addr;
      mono_marshal_emit_native_wrapper (D.27175, mb, sig, piinfo, mspecs, D.27022, aot, check_exceptions, 0);
      D.27000 = method->klass;
      D.27001 = D.27000->image;
      csig = signature_dup (D.27001, sig);
      csig->pinvoke = 0;
      D.27122 = csig->param_count;
      D.27123 = (int) D.27122;
      D.27132 = D.27123 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.27132);
      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.27149 = sig->param_count;
      i = (int) D.27149;
      goto <D.21387>;
      <D.21386>:
      D.27176 = (long unsigned int) i;
      D.27177 = D.27176 * 8;
      D.27178 = mspecs + D.27177;
      D.27179 = *D.27178;
      if (D.27179 != 0B) goto <D.27180>; else goto <D.27181>;
      <D.27180>:
      D.27176 = (long unsigned int) i;
      D.27177 = D.27176 * 8;
      D.27178 = mspecs + D.27177;
      D.27179 = *D.27178;
      mono_metadata_free_marshal_spec (D.27179);
      <D.27181>:
      i = i + -1;
      <D.21387>:
      if (i >= 0) goto <D.21386>; else goto <D.21388>;
      <D.21388>:
      monoeg_g_free (mspecs);
      D.27007 = res;
      return D.27007;
    }
  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.27184;
  struct MonoMethod * D.27187;
  struct MonoClass * D.27188;
  struct MonoMethod * D.27189;
  short unsigned int D.27190;
  int D.27191;
  int D.27192;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;

  D.27184 = &image->native_wrapper_cache;
  cache = get_cache (D.27184, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, func);
  if (res != 0B) goto <D.27185>; else goto <D.27186>;
  <D.27185>:
  D.27187 = res;
  return D.27187;
  <D.27186>:
  name = monoeg_g_strdup_printf ("wrapper_native_%p", func);
  D.27188 = mono_defaults.object_class;
  mb = mono_mb_new (D.27188, name, 6);
  D.27189 = mb->method;
  D.27189->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.27190 = csig->param_count;
  D.27191 = (int) D.27190;
  D.27192 = D.27191 + 16;
  res = mono_mb_create_and_cache (cache, func, mb, csig, D.27192);
  mono_mb_free (mb);
  mono_marshal_set_wrapper_info (res, 0B);
  D.27187 = res;
  return D.27187;
}


mono_marshal_get_native_func_wrapper_aot (struct MonoClass * klass)
{
  struct MonoClass * D.27194;
  struct GHashTable * * D.27195;
  struct MonoMethod * D.27198;
  struct MonoMethodSignature * D.27199;
  short unsigned int D.27200;
  int D.27201;
  int D.27202;
  long unsigned int D.27203;
  long unsigned int D.27204;
  struct MonoMethodSignature * D.27205;
  struct MonoMethod * D.27206;
  long unsigned int D.27207;
  long unsigned int D.27208;
  _Bool D.27209;
  long int D.27210;
  long int D.27211;
  struct MonoClass * D.27214;
  short unsigned int D.27215;
  int D.27216;
  int D.27217;
  struct MonoMethodSignature * D.27218;
  short unsigned int D.27219;
  long unsigned int D.27220;
  long unsigned int D.27221;
  struct MonoMarshalSpec * * D.27222;
  struct MonoMarshalSpec * D.27223;
  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.27194 = invoke->klass;
      image = D.27194->image;
      D.27195 = &image->native_func_wrapper_aot_cache;
      cache = get_cache (D.27195, mono_aligned_addr_hash, 0B);
      res = mono_marshal_find_in_cache (cache, invoke);
      if (res != 0B) goto <D.27196>; else goto <D.27197>;
      <D.27196>:
      D.27198 = res;
      return D.27198;
      <D.27197>:
      memset (&mpiinfo, 0, 56);
      parse_unmanaged_function_pointer_attr (klass, &mpiinfo);
      D.27199 = mono_method_signature (invoke);
      D.27200 = D.27199->param_count;
      D.27201 = (int) D.27200;
      D.27202 = D.27201 + 1;
      D.27203 = (long unsigned int) D.27202;
      D.27204 = D.27203 * 8;
      mspecs = monoeg_malloc0 (D.27204);
      mono_method_get_marshal_info (invoke, mspecs);
      D.27205 = mono_method_signature (invoke);
      sig = mono_metadata_signature_dup (D.27205);
      sig->hasthis = 0;
      name = monoeg_g_strdup_printf ("wrapper_aot_native");
      D.27194 = invoke->klass;
      mb = mono_mb_new (D.27194, name, 6);
      D.27206 = mb->method;
      D.27206->save_lmf = 1;
      mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, 0B, 0, 1, 1);
      D.27207 = BIT_FIELD_REF <*sig, 64, 64>;
      D.27208 = D.27207 & 18014398509481984;
      D.27209 = D.27208 != 0;
      D.27210 = (long int) D.27209;
      D.27211 = __builtin_expect (D.27210, 0);
      if (D.27211 != 0) goto <D.27212>; else goto <D.27213>;
      <D.27212>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9148, "!sig->hasthis");
      <D.27213>:
      D.27214 = mono_defaults.int_class;
      csig = signature_dup_add_this (image, sig, D.27214);
      csig->pinvoke = 0;
      D.27215 = csig->param_count;
      D.27216 = (int) D.27215;
      D.27217 = D.27216 + 16;
      res = mono_mb_create_and_cache (cache, invoke, mb, csig, D.27217);
      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.27218 = mono_method_signature (invoke);
      D.27219 = D.27218->param_count;
      i = (int) D.27219;
      goto <D.21418>;
      <D.21417>:
      D.27220 = (long unsigned int) i;
      D.27221 = D.27220 * 8;
      D.27222 = mspecs + D.27221;
      D.27223 = *D.27222;
      if (D.27223 != 0B) goto <D.27224>; else goto <D.27225>;
      <D.27224>:
      D.27220 = (long unsigned int) i;
      D.27221 = D.27220 * 8;
      D.27222 = mspecs + D.27221;
      D.27223 = *D.27222;
      mono_metadata_free_marshal_spec (D.27223);
      <D.27225>:
      i = i + -1;
      <D.21418>:
      if (i >= 0) goto <D.21417>; else goto <D.21419>;
      <D.21419>:
      monoeg_g_free (mspecs);
      monoeg_g_free (sig);
      D.27198 = res;
      return D.27198;
    }
  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.27228;
  struct MonoType * D.27229;
  struct MonoClass * D.27230;
  struct MonoType * D.27231;
  long unsigned int D.27232;
  long unsigned int D.27233;
  short unsigned int D.27236;
  short unsigned int D.27237;
  int D.27240;
  int D.27241;
  int D.27242;
  _Bool D.27243;
  long int D.27244;
  long int D.27245;
  struct MonoType * * D.27248;
  struct MonoType * * D.27249;
  int D.27250;
  long unsigned int D.27251;
  long unsigned int D.27252;
  short unsigned int D.27253;
  short unsigned int D.27254;
  struct MonoType * D.27255;
  int D.27256;
  long unsigned int D.27259;
  long unsigned int D.27260;
  unsigned char D.27261;
  int D.27262;
  long unsigned int D.27263;
  long unsigned int D.27264;
  int * D.27265;
  struct MonoType * D.27266;
  sizetype D.27267;
  sizetype D.27268;
  sizetype D.27269;
  struct MonoMarshalSpec * * D.27270;
  struct MonoMarshalSpec * D.27271;
  struct MonoType * * D.27272;
  int D.27273;
  int target_handle.299;
  int D.27283;
  long unsigned int D.27286;
  long unsigned int D.27287;
  unsigned int D.27290;
  unsigned int i.300;
  struct MonoMarshalSpec * D.27296;
  <unnamed type> D.27298;
  long unsigned int D.27300;
  long unsigned int D.27301;
  unsigned char D.27304;
  int D.27305;
  <unnamed type> D.27310;
  long unsigned int D.27312;
  long unsigned int D.27313;
  unsigned char D.27316;
  int D.27317;
  struct MonoType * D.27320;
  short unsigned int D.27321;
  int D.27322;
  int D.27323;
  int D.27326;
  unsigned int D.27329;
  struct MonoClass * D.27330;
  int D.27332;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  int i;
  int * tmp_locals;
  gboolean closed;

  closed = 0;
  sig = m->sig;
  csig = m->csig;
  D.27228 = mono_defaults.int_class;
  D.27229 = &D.27228->byval_arg;
  mono_mb_add_local (mb, D.27229);
  D.27228 = mono_defaults.int_class;
  D.27229 = &D.27228->byval_arg;
  mono_mb_add_local (mb, D.27229);
  D.27230 = mono_defaults.boolean_class;
  D.27231 = &D.27230->byval_arg;
  mono_mb_add_local (mb, D.27231);
  D.27232 = BIT_FIELD_REF <*sig, 64, 64>;
  D.27233 = D.27232 & 18014398509481984;
  if (D.27233 == 0) goto <D.27234>; else goto <D.27235>;
  <D.27234>:
  D.27236 = sig->param_count;
  D.27237 = invoke_sig->param_count;
  if (D.27236 != D.27237) goto <D.27238>; else goto <D.27239>;
  <D.27238>:
  D.27236 = sig->param_count;
  D.27240 = (int) D.27236;
  D.27237 = invoke_sig->param_count;
  D.27241 = (int) D.27237;
  D.27242 = D.27241 + 1;
  D.27243 = D.27240 != D.27242;
  D.27244 = (long int) D.27243;
  D.27245 = __builtin_expect (D.27244, 0);
  if (D.27245 != 0) goto <D.27246>; else goto <D.27247>;
  <D.27246>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9229, "sig->param_count == invoke_sig->param_count + 1");
  <D.27247>:
  closed = 1;
  sig = mono_metadata_signature_dup (sig);
  D.27248 = &sig->params[0];
  D.27249 = &sig->params[1];
  D.27236 = sig->param_count;
  D.27240 = (int) D.27236;
  D.27250 = D.27240 + -1;
  D.27251 = (long unsigned int) D.27250;
  D.27252 = D.27251 * 8;
  memmove (D.27248, D.27249, D.27252);
  D.27236 = sig->param_count;
  D.27253 = D.27236;
  D.27254 = D.27253 + 65535;
  sig->param_count = D.27254;
  <D.27239>:
  <D.27235>:
  D.27255 = sig->ret;
  D.27256 = mono_type_is_void (D.27255);
  if (D.27256 == 0) goto <D.27257>; else goto <D.27258>;
  <D.27257>:
  D.27255 = sig->ret;
  mono_mb_add_local (mb, D.27255);
  <D.27258>:
  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.27236 = sig->param_count;
  D.27259 = (long unsigned int) D.27236;
  D.27260 = D.27259 * 4;
  tmp_locals = __builtin_alloca (D.27260);
  i = 0;
  goto <D.21444>;
  <D.21443>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.27261 = t->type;
    D.27262 = (int) D.27261;
    switch (D.27262) <default: <D.21442>, case 2: <D.21440>, case 14: <D.21439>, case 17: <D.21436>, case 18: <D.21435>, case 20: <D.21437>, case 28: <D.21434>, case 29: <D.21438>>
    <D.21434>:
    <D.21435>:
    <D.21436>:
    <D.21437>:
    <D.21438>:
    <D.21439>:
    <D.21440>:
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27266 = sig->params[i];
    D.27267 = (sizetype) i;
    D.27268 = D.27267 + 1;
    D.27269 = D.27268 * 8;
    D.27270 = mspecs + D.27269;
    D.27271 = *D.27270;
    D.27272 = &csig->params[i];
    D.27273 = emit_marshal (m, i, D.27266, D.27271, 0, D.27272, 4);
    *D.27265 = D.27273;
    goto <D.21441>;
    <D.21442>:
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    *D.27265 = 0;
    goto <D.21441>;
    <D.21441>:
  }
  i = i + 1;
  <D.21444>:
  D.27236 = sig->param_count;
  D.27240 = (int) D.27236;
  if (D.27240 > i) goto <D.21443>; else goto <D.21445>;
  <D.21445>:
  emit_thread_interrupt_checkpoint (mb);
  D.27232 = BIT_FIELD_REF <*sig, 64, 64>;
  D.27233 = D.27232 & 18014398509481984;
  if (D.27233 != 0) goto <D.27274>; else goto <D.27275>;
  <D.27274>:
  if (target_handle != 0) goto <D.27276>; else goto <D.27277>;
  <D.27276>:
  target_handle.299 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.299);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  goto <D.27279>;
  <D.27277>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9282);
  <D.27279>:
  goto <D.27280>;
  <D.27275>:
  if (closed != 0) goto <D.27281>; else goto <D.27282>;
  <D.27281>:
  target_handle.299 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.299);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  <D.27282>:
  <D.27280>:
  i = 0;
  goto <D.21448>;
  <D.21447>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    if (D.27283 != 0) goto <D.27284>; else goto <D.27285>;
    <D.27284>:
    D.27286 = BIT_FIELD_REF <*t, 64, 64>;
    D.27287 = D.27286 & 1073741824;
    if (D.27287 != 0) goto <D.27288>; else goto <D.27289>;
    <D.27288>:
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    D.27290 = (unsigned int) D.27283;
    mono_mb_emit_ldloc_addr (mb, D.27290);
    goto <D.27291>;
    <D.27289>:
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    D.27290 = (unsigned int) D.27283;
    mono_mb_emit_ldloc (mb, D.27290);
    <D.27291>:
    goto <D.27292>;
    <D.27285>:
    i.300 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.300);
    <D.27292>:
  }
  i = i + 1;
  <D.21448>:
  D.27236 = sig->param_count;
  D.27240 = (int) D.27236;
  if (D.27240 > i) goto <D.21447>; else goto <D.21449>;
  <D.21449>:
  mono_mb_emit_managed_call (mb, method, 0B);
  D.27296 = *mspecs;
  if (D.27296 != 0B) goto <D.27297>; else goto <D.27294>;
  <D.27297>:
  D.27296 = *mspecs;
  D.27298 = D.27296->native;
  if (D.27298 == 44) goto <D.27299>; else goto <D.27294>;
  <D.27299>:
  D.27255 = sig->ret;
  D.27296 = *mspecs;
  emit_marshal (m, 0, D.27255, D.27296, 0, 0B, 6);
  goto <D.27295>;
  <D.27294>:
  D.27255 = sig->ret;
  D.27300 = BIT_FIELD_REF <*D.27255, 64, 64>;
  D.27301 = D.27300 & 1073741824;
  if (D.27301 == 0) goto <D.27302>; else goto <D.27303>;
  <D.27302>:
  D.27255 = sig->ret;
  D.27304 = D.27255->type;
  D.27305 = (int) D.27304;
  switch (D.27305) <default: <D.21472>, case 1: <D.21450>, case 2: <D.21452>, case 3: <D.21455>, case 4: <D.21453>, case 5: <D.21454>, case 6: <D.21456>, case 7: <D.21457>, case 8: <D.21458>, case 9: <D.21459>, case 10: <D.21465>, case 11: <D.21466>, case 12: <D.21463>, case 13: <D.21464>, case 14: <D.21468>, case 15: <D.21462>, case 17: <D.21469>, case 18: <D.21470>, case 24: <D.21460>, case 25: <D.21461>, case 28: <D.21467>, case 29: <D.21471>>
  <D.21450>:
  goto <D.21451>;
  <D.21452>:
  <D.21453>:
  <D.21454>:
  <D.21455>:
  <D.21456>:
  <D.21457>:
  <D.21458>:
  <D.21459>:
  <D.21460>:
  <D.21461>:
  <D.21462>:
  <D.21463>:
  <D.21464>:
  <D.21465>:
  <D.21466>:
  <D.21467>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.21451>;
  <D.21468>:
  D.27228 = mono_defaults.int_class;
  D.27229 = &D.27228->byval_arg;
  csig->ret = D.27229;
  D.27255 = sig->ret;
  D.27296 = *mspecs;
  emit_marshal (m, 0, D.27255, D.27296, 0, 0B, 6);
  goto <D.21451>;
  <D.21469>:
  <D.21470>:
  <D.21471>:
  D.27255 = sig->ret;
  D.27296 = *mspecs;
  emit_marshal (m, 0, D.27255, D.27296, 0, 0B, 6);
  goto <D.21451>;
  <D.21472>:
  D.27255 = sig->ret;
  D.27304 = D.27255->type;
  D.27305 = (int) D.27304;
  monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.27305);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9339);
  <D.21451>:
  goto <D.27306>;
  <D.27303>:
  mono_mb_emit_stloc (mb, 3);
  <D.27306>:
  <D.27295>:
  i = 0;
  goto <D.21487>;
  <D.21486>:
  {
    struct MonoType * t;
    struct MonoMarshalSpec * spec;

    t = sig->params[i];
    D.27267 = (sizetype) i;
    D.27268 = D.27267 + 1;
    D.27269 = D.27268 * 8;
    D.27270 = mspecs + D.27269;
    spec = *D.27270;
    if (spec != 0B) goto <D.27309>; else goto <D.27307>;
    <D.27309>:
    D.27310 = spec->native;
    if (D.27310 == 44) goto <D.27311>; else goto <D.27307>;
    <D.27311>:
    D.27267 = (sizetype) i;
    D.27268 = D.27267 + 1;
    D.27269 = D.27268 * 8;
    D.27270 = mspecs + D.27269;
    D.27271 = *D.27270;
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    emit_marshal (m, i, t, D.27271, D.27283, 0B, 5);
    goto <D.27308>;
    <D.27307>:
    D.27312 = BIT_FIELD_REF <*t, 64, 64>;
    D.27313 = D.27312 & 1073741824;
    if (D.27313 != 0) goto <D.27314>; else goto <D.27315>;
    <D.27314>:
    D.27316 = t->type;
    D.27317 = (int) D.27316;
    switch (D.27317) <default: <D.27318>, case 2: <D.21479>, case 14: <D.21478>, case 17: <D.21476>, case 18: <D.21475>, case 28: <D.21477>>
    <D.21475>:
    <D.21476>:
    <D.21477>:
    <D.21478>:
    <D.21479>:
    D.27267 = (sizetype) i;
    D.27268 = D.27267 + 1;
    D.27269 = D.27268 * 8;
    D.27270 = mspecs + D.27269;
    D.27271 = *D.27270;
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    emit_marshal (m, i, t, D.27271, D.27283, 0B, 5);
    goto <D.21480>;
    <D.27318>:
    <D.21480>:
    goto <D.27319>;
    <D.27315>:
    D.27320 = invoke_sig->params[i];
    D.27321 = D.27320->attrs;
    D.27322 = (int) D.27321;
    D.27323 = D.27322 & 2;
    if (D.27323 != 0) goto <D.27324>; else goto <D.27325>;
    <D.27324>:
    D.27316 = t->type;
    D.27317 = (int) D.27316;
    switch (D.27317) <default: <D.21485>, case 17: <D.21483>, case 18: <D.21482>, case 29: <D.21481>>
    <D.21481>:
    <D.21482>:
    <D.21483>:
    D.27320 = invoke_sig->params[i];
    D.27267 = (sizetype) i;
    D.27268 = D.27267 + 1;
    D.27269 = D.27268 * 8;
    D.27270 = mspecs + D.27269;
    D.27271 = *D.27270;
    D.27263 = (long unsigned int) i;
    D.27264 = D.27263 * 4;
    D.27265 = tmp_locals + D.27264;
    D.27283 = *D.27265;
    emit_marshal (m, i, D.27320, D.27271, D.27283, 0B, 5);
    goto <D.21484>;
    <D.21485>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9373);
    <D.21484>:
    <D.27325>:
    <D.27319>:
    <D.27308>:
  }
  i = i + 1;
  <D.21487>:
  D.27236 = sig->param_count;
  D.27240 = (int) D.27236;
  if (D.27240 > i) goto <D.21486>; else goto <D.21488>;
  <D.21488>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 18);
  D.27326 = m->retobj_var;
  if (D.27326 != 0) goto <D.27327>; else goto <D.27328>;
  <D.27327>:
  D.27326 = m->retobj_var;
  D.27329 = (unsigned int) D.27326;
  mono_mb_emit_ldloc (mb, D.27329);
  mono_mb_emit_byte (mb, 240);
  D.27330 = m->retobj_class;
  mono_mb_emit_op (mb, 5, D.27330);
  goto <D.27331>;
  <D.27328>:
  D.27255 = sig->ret;
  D.27332 = mono_type_is_void (D.27255);
  if (D.27332 == 0) goto <D.27333>; else goto <D.27334>;
  <D.27333>:
  mono_mb_emit_ldloc (mb, 3);
  <D.27334>:
  mono_mb_emit_byte (mb, 42);
  <D.27331>:
  if (closed != 0) goto <D.27335>; else goto <D.27336>;
  <D.27335>:
  monoeg_g_free (sig);
  <D.27336>:
}


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

  D.27341 = __builtin_object_size (__dest, 0);
  D.27340 = __builtin___memmove_chk (__dest, __src, __len, D.27341);
  return D.27340;
}


mono_marshal_get_managed_wrapper (struct MonoMethod * method, struct MonoClass * delegate_klass, uint32_t target_handle)
{
  _Bool D.27343;
  long int D.27344;
  long int D.27345;
  struct MonoMethodSignature * D.27348;
  long unsigned int D.27349;
  long unsigned int D.27350;
  _Bool D.27351;
  long int D.27352;
  long int D.27353;
  struct MonoClass * D.27356;
  struct MonoImage * D.27357;
  struct GHashTable * * D.27358;
  struct MonoMethod * D.27363;
  struct MonoMethodSignature * D.27364;
  short unsigned int D.27365;
  int D.27366;
  int D.27367;
  long unsigned int D.27368;
  long unsigned int D.27369;
  const char * D.27370;
  long unsigned int D.27371;
  void * D.27372;
  struct MonoClass * UnmanagedFunctionPointerAttribute.301;
  struct MonoImage * D.27379;
  struct MonoClass * UnmanagedFunctionPointerAttribute.302;
  struct MonoMethod * D.27385;
  int D.27386;
  int D.27389;
  struct MonoMethod * D.27392;
  const mono_byte * D.27393;
  unsigned int D.27394;
  int D.27395;
  _Bool D.27396;
  long int D.27397;
  long int D.27398;
  struct MonoArray * typed_args.303;
  long unsigned int D.27402;
  _Bool D.27403;
  long int D.27404;
  long int D.27405;
  char * D.27408;
  void * D.27409;
  struct CattrNamedArg * arginfo.304;
  long unsigned int D.27411;
  long unsigned int D.27412;
  struct MonoArray * named_args.305;
  long unsigned int D.27414;
  char * D.27415;
  struct MonoClassField * D.27416;
  _Bool D.27417;
  long int D.27418;
  long int D.27419;
  int D.21586;
  int iftmp.306;
  int D.21585;
  const char[8] * D.27425;
  unsigned char D.27426;
  int D.27427;
  unsigned char D.27428;
  int D.27429;
  const unsigned char * D.27434;
  unsigned char D.27435;
  int D.27436;
  const unsigned char * D.27437;
  unsigned char D.27438;
  int D.27439;
  const unsigned char * D.27444;
  unsigned char D.27445;
  int D.27446;
  const unsigned char * D.27447;
  unsigned char D.27448;
  int D.27449;
  const unsigned char * D.27454;
  unsigned char D.27455;
  int D.27456;
  const unsigned char * D.27457;
  unsigned char D.27458;
  int D.27459;
  const char * D.27461;
  void * D.27464;
  int D.21595;
  int iftmp.307;
  int D.21594;
  const char[13] * D.27469;
  unsigned char D.27470;
  int D.27471;
  unsigned char D.27472;
  int D.27473;
  const unsigned char * D.27478;
  unsigned char D.27479;
  int D.27480;
  const unsigned char * D.27481;
  unsigned char D.27482;
  int D.27483;
  const unsigned char * D.27488;
  unsigned char D.27489;
  int D.27490;
  const unsigned char * D.27491;
  unsigned char D.27492;
  int D.27493;
  const unsigned char * D.27498;
  unsigned char D.27499;
  int D.27500;
  const unsigned char * D.27501;
  unsigned char D.27502;
  int D.27503;
  void * D.27507;
  int D.21604;
  int iftmp.308;
  int D.21603;
  const char[15] * D.27512;
  unsigned char D.27513;
  int D.27514;
  unsigned char D.27515;
  int D.27516;
  const unsigned char * D.27521;
  unsigned char D.27522;
  int D.27523;
  const unsigned char * D.27524;
  unsigned char D.27525;
  int D.27526;
  const unsigned char * D.27531;
  unsigned char D.27532;
  int D.27533;
  const unsigned char * D.27534;
  unsigned char D.27535;
  int D.27536;
  const unsigned char * D.27541;
  unsigned char D.27542;
  int D.27543;
  const unsigned char * D.27544;
  unsigned char D.27545;
  int D.27546;
  void * D.27550;
  int D.21613;
  int iftmp.309;
  int D.21612;
  const char[22] * D.27555;
  unsigned char D.27556;
  int D.27557;
  unsigned char D.27558;
  int D.27559;
  const unsigned char * D.27564;
  unsigned char D.27565;
  int D.27566;
  const unsigned char * D.27567;
  unsigned char D.27568;
  int D.27569;
  const unsigned char * D.27574;
  unsigned char D.27575;
  int D.27576;
  const unsigned char * D.27577;
  unsigned char D.27578;
  int D.27579;
  const unsigned char * D.27584;
  unsigned char D.27585;
  int D.27586;
  const unsigned char * D.27587;
  unsigned char D.27588;
  int D.27589;
  void * D.27593;
  long unsigned int D.27595;
  int D.27596;
  signed short D.27597;
  signed short iftmp.310;
  int D.27601;
  unsigned short D.27602;
  unsigned short D.27603;
  signed short D.27605;
  signed short D.27606;
  signed short D.27607;
  short unsigned int D.27608;
  unsigned char D.27609;
  unsigned char D.27610;
  <unnamed-unsigned:6> D.27611;
  int D.27614;
  short unsigned int D.27619;
  int D.27620;
  int D.27621;
  struct MonoMethodSignature * D.27623;
  short unsigned int D.27624;
  long unsigned int D.27625;
  struct MonoMarshalSpec * * D.27626;
  struct MonoMarshalSpec * D.27627;
  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.27343 = method == 0B;
      D.27344 = (long int) D.27343;
      D.27345 = __builtin_expect (D.27344, 0);
      if (D.27345 != 0) goto <D.27346>; else goto <D.27347>;
      <D.27346>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9450, "method != NULL");
      <D.27347>:
      D.27348 = mono_method_signature (method);
      D.27349 = BIT_FIELD_REF <*D.27348, 64, 64>;
      D.27350 = D.27349 & 72057594037927936;
      D.27351 = D.27350 != 0;
      D.27352 = (long int) D.27351;
      D.27353 = __builtin_expect (D.27352, 0);
      if (D.27353 != 0) goto <D.27354>; else goto <D.27355>;
      <D.27354>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9451, "!mono_method_signature (method)->pinvoke");
      <D.27355>:
      D.27356 = method->klass;
      D.27357 = D.27356->image;
      D.27358 = &D.27357->managed_wrapper_cache;
      cache = get_cache (D.27358, mono_aligned_addr_hash, 0B);
      if (target_handle == 0) goto <D.27359>; else goto <D.27360>;
      <D.27359>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.27361>; else goto <D.27362>;
      <D.27361>:
      D.27363 = res;
      return D.27363;
      <D.27362>:
      <D.27360>:
      invoke = mono_get_delegate_invoke (delegate_klass);
      invoke_sig = mono_method_signature (invoke);
      D.27364 = mono_method_signature (invoke);
      D.27365 = D.27364->param_count;
      D.27366 = (int) D.27365;
      D.27367 = D.27366 + 1;
      D.27368 = (long unsigned int) D.27367;
      D.27369 = D.27368 * 8;
      mspecs = monoeg_malloc0 (D.27369);
      mono_method_get_marshal_info (invoke, mspecs);
      sig = mono_method_signature (method);
      D.27356 = method->klass;
      D.27370 = method->name;
      mb = mono_mb_new (D.27356, D.27370, 5);
      D.27371 = (long unsigned int) target_handle;
      D.27372 = (void *) D.27371;
      mono_mb_add_data (mb, D.27372);
      if (target_handle != 0) goto <D.27373>; else goto <D.27374>;
      <D.27373>:
      csig = mono_metadata_signature_dup (invoke_sig);
      goto <D.27375>;
      <D.27374>:
      D.27356 = method->klass;
      D.27357 = D.27356->image;
      csig = signature_dup (D.27357, invoke_sig);
      <D.27375>:
      csig->hasthis = 0;
      csig->pinvoke = 1;
      m.mb = mb;
      m.sig = sig;
      m.piinfo = 0B;
      m.retobj_var = 0;
      m.csig = csig;
      D.27356 = method->klass;
      D.27357 = D.27356->image;
      m.image = D.27357;
      mono_marshal_set_callconv_from_modopt (invoke, csig);
      UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.301 == 0B) goto <D.27377>; else goto <D.27378>;
      <D.27377>:
      D.27379 = mono_defaults.corlib;
      UnmanagedFunctionPointerAttribute.302 = mono_class_from_name (D.27379, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
      UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.302;
      <D.27378>:
      UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.301 != 0B) goto <D.27381>; else goto <D.27382>;
      <D.27381>:
      {
        struct MonoCustomAttrInfo * cinfo;
        struct MonoCustomAttrEntry * attr;

        cinfo = mono_custom_attrs_from_class (delegate_klass);
        attr = 0B;
        if (cinfo != 0B) goto <D.27383>; else goto <D.27384>;
        <D.27383>:
        i = 0;
        goto <D.21566>;
        <D.21565>:
        {
          struct MonoClass * ctor_class;

          D.27385 = cinfo->attrs[i].ctor;
          ctor_class = D.27385->klass;
          UnmanagedFunctionPointerAttribute.301 = UnmanagedFunctionPointerAttribute;
          D.27386 = mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute.301);
          if (D.27386 != 0) goto <D.27387>; else goto <D.27388>;
          <D.27387>:
          attr = &cinfo->attrs[i];
          goto <D.21564>;
          <D.27388>:
        }
        i = i + 1;
        <D.21566>:
        D.27389 = cinfo->num_attrs;
        if (D.27389 > i) goto <D.21565>; else goto <D.21564>;
        <D.21564>:
        <D.27384>:
        if (attr != 0B) goto <D.27390>; else goto <D.27391>;
        <D.27390>:
        {
          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.27379 = mono_defaults.corlib;
              D.27392 = attr->ctor;
              D.27393 = attr->data;
              D.27394 = attr->data_size;
              mono_reflection_create_custom_attr_data_args (D.27379, D.27392, D.27393, D.27394, &typed_args, &named_args, &arginfo, &error);
              D.27395 = mono_error_ok (&error);
              D.27396 = D.27395 == 0;
              D.27397 = (long int) D.27396;
              D.27398 = __builtin_expect (D.27397, 0);
              if (D.27398 != 0) goto <D.27399>; else goto <D.27400>;
              <D.27399>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9530, "mono_error_ok (&error)");
              <D.27400>:
              typed_args.303 = typed_args;
              D.27402 = mono_array_length (typed_args.303);
              D.27403 = D.27402 != 1;
              D.27404 = (long int) D.27403;
              D.27405 = __builtin_expect (D.27404, 0);
              if (D.27405 != 0) goto <D.27406>; else goto <D.27407>;
              <D.27406>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9531, "mono_array_length (typed_args) == 1");
              <D.27407>:
              typed_args.303 = typed_args;
              D.27408 = mono_array_addr_with_size (typed_args.303, 8, 0);
              o = MEM[(struct MonoObject * *)D.27408];
              D.27409 = mono_object_unbox (o);
              call_conv = MEM[(gint32 *)D.27409];
              i = 0;
              goto <D.21615>;
              <D.21614>:
              {
                struct CattrNamedArg * narg;

                arginfo.304 = arginfo;
                D.27411 = (long unsigned int) i;
                D.27412 = D.27411 * 24;
                narg = arginfo.304 + D.27412;
                named_args.305 = named_args;
                D.27414 = (long unsigned int) i;
                D.27415 = mono_array_addr_with_size (named_args.305, 8, D.27414);
                o = MEM[(struct MonoObject * *)D.27415];
                D.27416 = narg->field;
                D.27417 = D.27416 == 0B;
                D.27418 = (long int) D.27417;
                D.27419 = __builtin_expect (D.27418, 0);
                if (D.27419 != 0) goto <D.27420>; else goto <D.27421>;
                <D.27420>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9543, "narg->field");
                <D.27421>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.27416 = narg->field;
                    __s2 = D.27416->name;
                    D.27425 = "CharSet";
                    D.27426 = MEM[(const unsigned char *)D.27425];
                    D.27427 = (int) D.27426;
                    D.27428 = *__s2;
                    D.27429 = (int) D.27428;
                    __result = D.27427 - D.27429;
                    {
                      if (__s2_len != 0) goto <D.27430>; else goto <D.27431>;
                      <D.27430>:
                      if (__result == 0) goto <D.27432>; else goto <D.27433>;
                      <D.27432>:
                      D.27434 = &MEM[(void *)"CharSet" + 1B];
                      D.27435 = *D.27434;
                      D.27436 = (int) D.27435;
                      D.27437 = __s2 + 1;
                      D.27438 = *D.27437;
                      D.27439 = (int) D.27438;
                      __result = D.27436 - D.27439;
                      if (__s2_len > 1) goto <D.27440>; else goto <D.27441>;
                      <D.27440>:
                      if (__result == 0) goto <D.27442>; else goto <D.27443>;
                      <D.27442>:
                      D.27444 = &MEM[(void *)"CharSet" + 2B];
                      D.27445 = *D.27444;
                      D.27446 = (int) D.27445;
                      D.27447 = __s2 + 2;
                      D.27448 = *D.27447;
                      D.27449 = (int) D.27448;
                      __result = D.27446 - D.27449;
                      if (__s2_len > 2) goto <D.27450>; else goto <D.27451>;
                      <D.27450>:
                      if (__result == 0) goto <D.27452>; else goto <D.27453>;
                      <D.27452>:
                      D.27454 = &MEM[(void *)"CharSet" + 3B];
                      D.27455 = *D.27454;
                      D.27456 = (int) D.27455;
                      D.27457 = __s2 + 3;
                      D.27458 = *D.27457;
                      D.27459 = (int) D.27458;
                      __result = D.27456 - D.27459;
                      <D.27453>:
                      <D.27451>:
                      <D.27443>:
                      <D.27441>:
                      <D.27433>:
                      <D.27431>:
                    }
                    D.21585 = __result;
                  }
                  iftmp.306 = -D.21585;
                  goto <D.27460>;
                  <D.27424>:
                  D.27416 = narg->field;
                  D.27461 = D.27416->name;
                  iftmp.306 = __builtin_strcmp (D.27461, "CharSet");
                  <D.27460>:
                  D.21586 = iftmp.306;
                }
                if (D.21586 == 0) goto <D.27462>; else goto <D.27463>;
                <D.27462>:
                D.27464 = mono_object_unbox (o);
                charset = MEM[(gint32 *)D.27464];
                goto <D.27465>;
                <D.27463>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.27416 = narg->field;
                    __s2 = D.27416->name;
                    D.27469 = "SetLastError";
                    D.27470 = MEM[(const unsigned char *)D.27469];
                    D.27471 = (int) D.27470;
                    D.27472 = *__s2;
                    D.27473 = (int) D.27472;
                    __result = D.27471 - D.27473;
                    {
                      if (__s2_len != 0) goto <D.27474>; else goto <D.27475>;
                      <D.27474>:
                      if (__result == 0) goto <D.27476>; else goto <D.27477>;
                      <D.27476>:
                      D.27478 = &MEM[(void *)"SetLastError" + 1B];
                      D.27479 = *D.27478;
                      D.27480 = (int) D.27479;
                      D.27481 = __s2 + 1;
                      D.27482 = *D.27481;
                      D.27483 = (int) D.27482;
                      __result = D.27480 - D.27483;
                      if (__s2_len > 1) goto <D.27484>; else goto <D.27485>;
                      <D.27484>:
                      if (__result == 0) goto <D.27486>; else goto <D.27487>;
                      <D.27486>:
                      D.27488 = &MEM[(void *)"SetLastError" + 2B];
                      D.27489 = *D.27488;
                      D.27490 = (int) D.27489;
                      D.27491 = __s2 + 2;
                      D.27492 = *D.27491;
                      D.27493 = (int) D.27492;
                      __result = D.27490 - D.27493;
                      if (__s2_len > 2) goto <D.27494>; else goto <D.27495>;
                      <D.27494>:
                      if (__result == 0) goto <D.27496>; else goto <D.27497>;
                      <D.27496>:
                      D.27498 = &MEM[(void *)"SetLastError" + 3B];
                      D.27499 = *D.27498;
                      D.27500 = (int) D.27499;
                      D.27501 = __s2 + 3;
                      D.27502 = *D.27501;
                      D.27503 = (int) D.27502;
                      __result = D.27500 - D.27503;
                      <D.27497>:
                      <D.27495>:
                      <D.27487>:
                      <D.27485>:
                      <D.27477>:
                      <D.27475>:
                    }
                    D.21594 = __result;
                  }
                  iftmp.307 = -D.21594;
                  goto <D.27504>;
                  <D.27468>:
                  D.27416 = narg->field;
                  D.27461 = D.27416->name;
                  iftmp.307 = __builtin_strcmp (D.27461, "SetLastError");
                  <D.27504>:
                  D.21595 = iftmp.307;
                }
                if (D.21595 == 0) goto <D.27505>; else goto <D.27506>;
                <D.27505>:
                D.27507 = mono_object_unbox (o);
                set_last_error = MEM[(MonoBoolean *)D.27507];
                goto <D.27508>;
                <D.27506>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.27416 = narg->field;
                    __s2 = D.27416->name;
                    D.27512 = "BestFitMapping";
                    D.27513 = MEM[(const unsigned char *)D.27512];
                    D.27514 = (int) D.27513;
                    D.27515 = *__s2;
                    D.27516 = (int) D.27515;
                    __result = D.27514 - D.27516;
                    {
                      if (__s2_len != 0) goto <D.27517>; else goto <D.27518>;
                      <D.27517>:
                      if (__result == 0) goto <D.27519>; else goto <D.27520>;
                      <D.27519>:
                      D.27521 = &MEM[(void *)"BestFitMapping" + 1B];
                      D.27522 = *D.27521;
                      D.27523 = (int) D.27522;
                      D.27524 = __s2 + 1;
                      D.27525 = *D.27524;
                      D.27526 = (int) D.27525;
                      __result = D.27523 - D.27526;
                      if (__s2_len > 1) goto <D.27527>; else goto <D.27528>;
                      <D.27527>:
                      if (__result == 0) goto <D.27529>; else goto <D.27530>;
                      <D.27529>:
                      D.27531 = &MEM[(void *)"BestFitMapping" + 2B];
                      D.27532 = *D.27531;
                      D.27533 = (int) D.27532;
                      D.27534 = __s2 + 2;
                      D.27535 = *D.27534;
                      D.27536 = (int) D.27535;
                      __result = D.27533 - D.27536;
                      if (__s2_len > 2) goto <D.27537>; else goto <D.27538>;
                      <D.27537>:
                      if (__result == 0) goto <D.27539>; else goto <D.27540>;
                      <D.27539>:
                      D.27541 = &MEM[(void *)"BestFitMapping" + 3B];
                      D.27542 = *D.27541;
                      D.27543 = (int) D.27542;
                      D.27544 = __s2 + 3;
                      D.27545 = *D.27544;
                      D.27546 = (int) D.27545;
                      __result = D.27543 - D.27546;
                      <D.27540>:
                      <D.27538>:
                      <D.27530>:
                      <D.27528>:
                      <D.27520>:
                      <D.27518>:
                    }
                    D.21603 = __result;
                  }
                  iftmp.308 = -D.21603;
                  goto <D.27547>;
                  <D.27511>:
                  D.27416 = narg->field;
                  D.27461 = D.27416->name;
                  iftmp.308 = __builtin_strcmp (D.27461, "BestFitMapping");
                  <D.27547>:
                  D.21604 = iftmp.308;
                }
                if (D.21604 == 0) goto <D.27548>; else goto <D.27549>;
                <D.27548>:
                D.27550 = mono_object_unbox (o);
                best_fit_mapping = MEM[(MonoBoolean *)D.27550];
                goto <D.27551>;
                <D.27549>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.27416 = narg->field;
                    __s2 = D.27416->name;
                    D.27555 = "ThrowOnUnmappableChar";
                    D.27556 = MEM[(const unsigned char *)D.27555];
                    D.27557 = (int) D.27556;
                    D.27558 = *__s2;
                    D.27559 = (int) D.27558;
                    __result = D.27557 - D.27559;
                    {
                      if (__s2_len != 0) goto <D.27560>; else goto <D.27561>;
                      <D.27560>:
                      if (__result == 0) goto <D.27562>; else goto <D.27563>;
                      <D.27562>:
                      D.27564 = &MEM[(void *)"ThrowOnUnmappableChar" + 1B];
                      D.27565 = *D.27564;
                      D.27566 = (int) D.27565;
                      D.27567 = __s2 + 1;
                      D.27568 = *D.27567;
                      D.27569 = (int) D.27568;
                      __result = D.27566 - D.27569;
                      if (__s2_len > 1) goto <D.27570>; else goto <D.27571>;
                      <D.27570>:
                      if (__result == 0) goto <D.27572>; else goto <D.27573>;
                      <D.27572>:
                      D.27574 = &MEM[(void *)"ThrowOnUnmappableChar" + 2B];
                      D.27575 = *D.27574;
                      D.27576 = (int) D.27575;
                      D.27577 = __s2 + 2;
                      D.27578 = *D.27577;
                      D.27579 = (int) D.27578;
                      __result = D.27576 - D.27579;
                      if (__s2_len > 2) goto <D.27580>; else goto <D.27581>;
                      <D.27580>:
                      if (__result == 0) goto <D.27582>; else goto <D.27583>;
                      <D.27582>:
                      D.27584 = &MEM[(void *)"ThrowOnUnmappableChar" + 3B];
                      D.27585 = *D.27584;
                      D.27586 = (int) D.27585;
                      D.27587 = __s2 + 3;
                      D.27588 = *D.27587;
                      D.27589 = (int) D.27588;
                      __result = D.27586 - D.27589;
                      <D.27583>:
                      <D.27581>:
                      <D.27573>:
                      <D.27571>:
                      <D.27563>:
                      <D.27561>:
                    }
                    D.21612 = __result;
                  }
                  iftmp.309 = -D.21612;
                  goto <D.27590>;
                  <D.27554>:
                  D.27416 = narg->field;
                  D.27461 = D.27416->name;
                  iftmp.309 = __builtin_strcmp (D.27461, "ThrowOnUnmappableChar");
                  <D.27590>:
                  D.21613 = iftmp.309;
                }
                if (D.21613 == 0) goto <D.27591>; else goto <D.27592>;
                <D.27591>:
                D.27593 = mono_object_unbox (o);
                throw_on_unmappable = MEM[(MonoBoolean *)D.27593];
                goto <D.27594>;
                <D.27592>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9553);
                <D.27594>:
                <D.27551>:
                <D.27508>:
                <D.27465>:
              }
              i = i + 1;
              <D.21615>:
              D.27414 = (long unsigned int) i;
              named_args.305 = named_args;
              D.27595 = mono_array_length (named_args.305);
              if (D.27414 < D.27595) goto <D.21614>; else goto <D.21616>;
              <D.21616>:
              arginfo.304 = arginfo;
              monoeg_g_free (arginfo.304);
              memset (&piinfo, 0, 56);
              m.piinfo = &piinfo;
              D.27596 = call_conv << 8;
              D.27597 = (signed short) D.27596;
              if (charset != 0) goto <D.27599>; else goto <D.27600>;
              <D.27599>:
              D.27601 = charset + -1;
              D.27602 = (unsigned short) D.27601;
              D.27603 = D.27602 * 2;
              iftmp.310 = (signed short) D.27603;
              goto <D.27604>;
              <D.27600>:
              iftmp.310 = 1;
              <D.27604>:
              D.27605 = D.27597 | iftmp.310;
              D.27606 = (signed short) set_last_error;
              D.27607 = D.27605 | D.27606;
              D.27608 = (short unsigned int) D.27607;
              piinfo.piflags = D.27608;
              D.27609 = (unsigned char) call_conv;
              D.27610 = D.27609 + 255;
              D.27611 = (<unnamed-unsigned:6>) D.27610;
              csig->call_convention = D.27611;
            }
          finally
            {
              typed_args = {CLOBBER};
              named_args = {CLOBBER};
              arginfo = {CLOBBER};
              error = {CLOBBER};
            }
        }
        <D.27391>:
        if (cinfo != 0B) goto <D.27612>; else goto <D.27613>;
        <D.27612>:
        D.27614 = cinfo->cached;
        if (D.27614 == 0) goto <D.27615>; else goto <D.27616>;
        <D.27615>:
        mono_custom_attrs_free (cinfo);
        <D.27616>:
        <D.27613>:
      }
      <D.27382>:
      mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
      if (target_handle == 0) goto <D.27617>; else goto <D.27618>;
      <D.27617>:
      {
        struct WrapperInfo * info;

        D.27619 = sig->param_count;
        D.27620 = (int) D.27619;
        D.27621 = D.27620 + 16;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.27621);
        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.27622>;
      <D.27618>:
      mb->dynamic = 1;
      D.27619 = sig->param_count;
      D.27620 = (int) D.27619;
      D.27621 = D.27620 + 16;
      res = mono_mb_create_method (mb, csig, D.27621);
      <D.27622>:
      mono_mb_free (mb);
      D.27623 = mono_method_signature (invoke);
      D.27624 = D.27623->param_count;
      i = (int) D.27624;
      goto <D.21619>;
      <D.21618>:
      D.27411 = (long unsigned int) i;
      D.27625 = D.27411 * 8;
      D.27626 = mspecs + D.27625;
      D.27627 = *D.27626;
      if (D.27627 != 0B) goto <D.27628>; else goto <D.27629>;
      <D.27628>:
      D.27411 = (long unsigned int) i;
      D.27625 = D.27411 * 8;
      D.27626 = mspecs + D.27625;
      D.27627 = *D.27626;
      mono_metadata_free_marshal_spec (D.27627);
      <D.27629>:
      i = i + -1;
      <D.21619>:
      if (i >= 0) goto <D.21618>; else goto <D.21620>;
      <D.21620>:
      monoeg_g_free (mspecs);
      D.27363 = res;
      return D.27363;
    }
  finally
    {
      piinfo = {CLOBBER};
      m = {CLOBBER};
    }
}


mono_marshal_set_callconv_from_modopt (struct MonoMethod * method, struct MonoMethodSignature * csig)
{
  struct MonoType * D.27632;
  long unsigned int D.27635;
  long unsigned int D.27636;
  struct MonoClass * D.27639;
  struct MonoImage * D.27640;
  <unnamed-unsigned:31> D.27641;
  unsigned int D.27642;
  _Bool D.27643;
  long int D.27644;
  long int D.27645;
  struct MonoImage * D.27648;
  struct MonoImage * D.27649;
  int D.21504;
  int iftmp.311;
  int D.21503;
  const char[32] * D.27655;
  unsigned char D.27656;
  int D.27657;
  unsigned char D.27658;
  int D.27659;
  const unsigned char * D.27664;
  unsigned char D.27665;
  int D.27666;
  const unsigned char * D.27667;
  unsigned char D.27668;
  int D.27669;
  const unsigned char * D.27674;
  unsigned char D.27675;
  int D.27676;
  const unsigned char * D.27677;
  unsigned char D.27678;
  int D.27679;
  const unsigned char * D.27684;
  unsigned char D.27685;
  int D.27686;
  const unsigned char * D.27687;
  unsigned char D.27688;
  int D.27689;
  const char * D.27691;
  int D.21513;
  int iftmp.312;
  int D.21512;
  const char[14] * D.27697;
  unsigned char D.27698;
  int D.27699;
  unsigned char D.27700;
  int D.27701;
  const unsigned char * D.27706;
  unsigned char D.27707;
  int D.27708;
  const unsigned char * D.27709;
  unsigned char D.27710;
  int D.27711;
  const unsigned char * D.27716;
  unsigned char D.27717;
  int D.27718;
  const unsigned char * D.27719;
  unsigned char D.27720;
  int D.27721;
  const unsigned char * D.27726;
  unsigned char D.27727;
  int D.27728;
  const unsigned char * D.27729;
  unsigned char D.27730;
  int D.27731;
  const char * D.27733;
  int D.21522;
  int iftmp.313;
  int D.21521;
  const char[16] * D.27740;
  unsigned char D.27741;
  int D.27742;
  unsigned char D.27743;
  int D.27744;
  const unsigned char * D.27749;
  unsigned char D.27750;
  int D.27751;
  const unsigned char * D.27752;
  unsigned char D.27753;
  int D.27754;
  const unsigned char * D.27759;
  unsigned char D.27760;
  int D.27761;
  const unsigned char * D.27762;
  unsigned char D.27763;
  int D.27764;
  const unsigned char * D.27769;
  unsigned char D.27770;
  int D.27771;
  const unsigned char * D.27772;
  unsigned char D.27773;
  int D.27774;
  int D.21531;
  int iftmp.314;
  int D.21530;
  const char[17] * D.27782;
  unsigned char D.27783;
  int D.27784;
  unsigned char D.27785;
  int D.27786;
  const unsigned char * D.27791;
  unsigned char D.27792;
  int D.27793;
  const unsigned char * D.27794;
  unsigned char D.27795;
  int D.27796;
  const unsigned char * D.27801;
  unsigned char D.27802;
  int D.27803;
  const unsigned char * D.27804;
  unsigned char D.27805;
  int D.27806;
  const unsigned char * D.27811;
  unsigned char D.27812;
  int D.27813;
  const unsigned char * D.27814;
  unsigned char D.27815;
  int D.27816;
  int D.21540;
  int iftmp.315;
  int D.21539;
  const char[17] * D.27824;
  unsigned char D.27825;
  int D.27826;
  unsigned char D.27827;
  int D.27828;
  const unsigned char * D.27833;
  unsigned char D.27834;
  int D.27835;
  const unsigned char * D.27836;
  unsigned char D.27837;
  int D.27838;
  const unsigned char * D.27843;
  unsigned char D.27844;
  int D.27845;
  const unsigned char * D.27846;
  unsigned char D.27847;
  int D.27848;
  const unsigned char * D.27853;
  unsigned char D.27854;
  int D.27855;
  const unsigned char * D.27856;
  unsigned char D.27857;
  int D.27858;
  <unnamed-unsigned:6> D.27862;
  int D.27863;
  struct MonoMethodSignature * sig;
  int i;

  sig = mono_method_signature (method);
  D.27632 = sig->ret;
  if (D.27632 != 0B) goto <D.27633>; else goto <D.27634>;
  <D.27633>:
  D.27632 = sig->ret;
  D.27635 = BIT_FIELD_REF <*D.27632, 64, 64>;
  D.27636 = D.27635 & 1056964608;
  if (D.27636 != 0) goto <D.27637>; else goto <D.27638>;
  <D.27637>:
  i = 0;
  goto <D.21542>;
  <D.21541>:
  {
    struct MonoClass * cmod_class;

    D.27639 = method->klass;
    D.27640 = D.27639->image;
    D.27632 = sig->ret;
    D.27641 = D.27632->modifiers[i].token;
    D.27642 = (unsigned int) D.27641;
    cmod_class = mono_class_get (D.27640, D.27642);
    D.27643 = cmod_class == 0B;
    D.27644 = (long int) D.27643;
    D.27645 = __builtin_expect (D.27644, 0);
    if (D.27645 != 0) goto <D.27646>; else goto <D.27647>;
    <D.27646>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9418, "cmod_class");
    <D.27647>:
    D.27648 = cmod_class->image;
    D.27649 = mono_defaults.corlib;
    if (D.27648 == D.27649) goto <D.27650>; else goto <D.27651>;
    <D.27650>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name_space;
        D.27655 = "System.Runtime.CompilerServices";
        D.27656 = MEM[(const unsigned char *)D.27655];
        D.27657 = (int) D.27656;
        D.27658 = *__s2;
        D.27659 = (int) D.27658;
        __result = D.27657 - D.27659;
        {
          if (__s2_len != 0) goto <D.27660>; else goto <D.27661>;
          <D.27660>:
          if (__result == 0) goto <D.27662>; else goto <D.27663>;
          <D.27662>:
          D.27664 = &MEM[(void *)"System.Runtime.CompilerServices" + 1B];
          D.27665 = *D.27664;
          D.27666 = (int) D.27665;
          D.27667 = __s2 + 1;
          D.27668 = *D.27667;
          D.27669 = (int) D.27668;
          __result = D.27666 - D.27669;
          if (__s2_len > 1) goto <D.27670>; else goto <D.27671>;
          <D.27670>:
          if (__result == 0) goto <D.27672>; else goto <D.27673>;
          <D.27672>:
          D.27674 = &MEM[(void *)"System.Runtime.CompilerServices" + 2B];
          D.27675 = *D.27674;
          D.27676 = (int) D.27675;
          D.27677 = __s2 + 2;
          D.27678 = *D.27677;
          D.27679 = (int) D.27678;
          __result = D.27676 - D.27679;
          if (__s2_len > 2) goto <D.27680>; else goto <D.27681>;
          <D.27680>:
          if (__result == 0) goto <D.27682>; else goto <D.27683>;
          <D.27682>:
          D.27684 = &MEM[(void *)"System.Runtime.CompilerServices" + 3B];
          D.27685 = *D.27684;
          D.27686 = (int) D.27685;
          D.27687 = __s2 + 3;
          D.27688 = *D.27687;
          D.27689 = (int) D.27688;
          __result = D.27686 - D.27689;
          <D.27683>:
          <D.27681>:
          <D.27673>:
          <D.27671>:
          <D.27663>:
          <D.27661>:
        }
        D.21503 = __result;
      }
      iftmp.311 = -D.21503;
      goto <D.27690>;
      <D.27654>:
      D.27691 = cmod_class->name_space;
      iftmp.311 = __builtin_strcmp (D.27691, "System.Runtime.CompilerServices");
      <D.27690>:
      D.21504 = iftmp.311;
    }
    if (D.21504 == 0) goto <D.27692>; else goto <D.27693>;
    <D.27692>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27697 = "CallConvCdecl";
        D.27698 = MEM[(const unsigned char *)D.27697];
        D.27699 = (int) D.27698;
        D.27700 = *__s2;
        D.27701 = (int) D.27700;
        __result = D.27699 - D.27701;
        {
          if (__s2_len != 0) goto <D.27702>; else goto <D.27703>;
          <D.27702>:
          if (__result == 0) goto <D.27704>; else goto <D.27705>;
          <D.27704>:
          D.27706 = &MEM[(void *)"CallConvCdecl" + 1B];
          D.27707 = *D.27706;
          D.27708 = (int) D.27707;
          D.27709 = __s2 + 1;
          D.27710 = *D.27709;
          D.27711 = (int) D.27710;
          __result = D.27708 - D.27711;
          if (__s2_len > 1) goto <D.27712>; else goto <D.27713>;
          <D.27712>:
          if (__result == 0) goto <D.27714>; else goto <D.27715>;
          <D.27714>:
          D.27716 = &MEM[(void *)"CallConvCdecl" + 2B];
          D.27717 = *D.27716;
          D.27718 = (int) D.27717;
          D.27719 = __s2 + 2;
          D.27720 = *D.27719;
          D.27721 = (int) D.27720;
          __result = D.27718 - D.27721;
          if (__s2_len > 2) goto <D.27722>; else goto <D.27723>;
          <D.27722>:
          if (__result == 0) goto <D.27724>; else goto <D.27725>;
          <D.27724>:
          D.27726 = &MEM[(void *)"CallConvCdecl" + 3B];
          D.27727 = *D.27726;
          D.27728 = (int) D.27727;
          D.27729 = __s2 + 3;
          D.27730 = *D.27729;
          D.27731 = (int) D.27730;
          __result = D.27728 - D.27731;
          <D.27725>:
          <D.27723>:
          <D.27715>:
          <D.27713>:
          <D.27705>:
          <D.27703>:
        }
        D.21512 = __result;
      }
      iftmp.312 = -D.21512;
      goto <D.27732>;
      <D.27696>:
      D.27733 = cmod_class->name;
      iftmp.312 = __builtin_strcmp (D.27733, "CallConvCdecl");
      <D.27732>:
      D.21513 = iftmp.312;
    }
    if (D.21513 == 0) goto <D.27734>; else goto <D.27735>;
    <D.27734>:
    csig->call_convention = 1;
    goto <D.27736>;
    <D.27735>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27740 = "CallConvStdcall";
        D.27741 = MEM[(const unsigned char *)D.27740];
        D.27742 = (int) D.27741;
        D.27743 = *__s2;
        D.27744 = (int) D.27743;
        __result = D.27742 - D.27744;
        {
          if (__s2_len != 0) goto <D.27745>; else goto <D.27746>;
          <D.27745>:
          if (__result == 0) goto <D.27747>; else goto <D.27748>;
          <D.27747>:
          D.27749 = &MEM[(void *)"CallConvStdcall" + 1B];
          D.27750 = *D.27749;
          D.27751 = (int) D.27750;
          D.27752 = __s2 + 1;
          D.27753 = *D.27752;
          D.27754 = (int) D.27753;
          __result = D.27751 - D.27754;
          if (__s2_len > 1) goto <D.27755>; else goto <D.27756>;
          <D.27755>:
          if (__result == 0) goto <D.27757>; else goto <D.27758>;
          <D.27757>:
          D.27759 = &MEM[(void *)"CallConvStdcall" + 2B];
          D.27760 = *D.27759;
          D.27761 = (int) D.27760;
          D.27762 = __s2 + 2;
          D.27763 = *D.27762;
          D.27764 = (int) D.27763;
          __result = D.27761 - D.27764;
          if (__s2_len > 2) goto <D.27765>; else goto <D.27766>;
          <D.27765>:
          if (__result == 0) goto <D.27767>; else goto <D.27768>;
          <D.27767>:
          D.27769 = &MEM[(void *)"CallConvStdcall" + 3B];
          D.27770 = *D.27769;
          D.27771 = (int) D.27770;
          D.27772 = __s2 + 3;
          D.27773 = *D.27772;
          D.27774 = (int) D.27773;
          __result = D.27771 - D.27774;
          <D.27768>:
          <D.27766>:
          <D.27758>:
          <D.27756>:
          <D.27748>:
          <D.27746>:
        }
        D.21521 = __result;
      }
      iftmp.313 = -D.21521;
      goto <D.27775>;
      <D.27739>:
      D.27733 = cmod_class->name;
      iftmp.313 = __builtin_strcmp (D.27733, "CallConvStdcall");
      <D.27775>:
      D.21522 = iftmp.313;
    }
    if (D.21522 == 0) goto <D.27776>; else goto <D.27777>;
    <D.27776>:
    csig->call_convention = 2;
    goto <D.27778>;
    <D.27777>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27782 = "CallConvFastcall";
        D.27783 = MEM[(const unsigned char *)D.27782];
        D.27784 = (int) D.27783;
        D.27785 = *__s2;
        D.27786 = (int) D.27785;
        __result = D.27784 - D.27786;
        {
          if (__s2_len != 0) goto <D.27787>; else goto <D.27788>;
          <D.27787>:
          if (__result == 0) goto <D.27789>; else goto <D.27790>;
          <D.27789>:
          D.27791 = &MEM[(void *)"CallConvFastcall" + 1B];
          D.27792 = *D.27791;
          D.27793 = (int) D.27792;
          D.27794 = __s2 + 1;
          D.27795 = *D.27794;
          D.27796 = (int) D.27795;
          __result = D.27793 - D.27796;
          if (__s2_len > 1) goto <D.27797>; else goto <D.27798>;
          <D.27797>:
          if (__result == 0) goto <D.27799>; else goto <D.27800>;
          <D.27799>:
          D.27801 = &MEM[(void *)"CallConvFastcall" + 2B];
          D.27802 = *D.27801;
          D.27803 = (int) D.27802;
          D.27804 = __s2 + 2;
          D.27805 = *D.27804;
          D.27806 = (int) D.27805;
          __result = D.27803 - D.27806;
          if (__s2_len > 2) goto <D.27807>; else goto <D.27808>;
          <D.27807>:
          if (__result == 0) goto <D.27809>; else goto <D.27810>;
          <D.27809>:
          D.27811 = &MEM[(void *)"CallConvFastcall" + 3B];
          D.27812 = *D.27811;
          D.27813 = (int) D.27812;
          D.27814 = __s2 + 3;
          D.27815 = *D.27814;
          D.27816 = (int) D.27815;
          __result = D.27813 - D.27816;
          <D.27810>:
          <D.27808>:
          <D.27800>:
          <D.27798>:
          <D.27790>:
          <D.27788>:
        }
        D.21530 = __result;
      }
      iftmp.314 = -D.21530;
      goto <D.27817>;
      <D.27781>:
      D.27733 = cmod_class->name;
      iftmp.314 = __builtin_strcmp (D.27733, "CallConvFastcall");
      <D.27817>:
      D.21531 = iftmp.314;
    }
    if (D.21531 == 0) goto <D.27818>; else goto <D.27819>;
    <D.27818>:
    csig->call_convention = 4;
    goto <D.27820>;
    <D.27819>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27824 = "CallConvThiscall";
        D.27825 = MEM[(const unsigned char *)D.27824];
        D.27826 = (int) D.27825;
        D.27827 = *__s2;
        D.27828 = (int) D.27827;
        __result = D.27826 - D.27828;
        {
          if (__s2_len != 0) goto <D.27829>; else goto <D.27830>;
          <D.27829>:
          if (__result == 0) goto <D.27831>; else goto <D.27832>;
          <D.27831>:
          D.27833 = &MEM[(void *)"CallConvThiscall" + 1B];
          D.27834 = *D.27833;
          D.27835 = (int) D.27834;
          D.27836 = __s2 + 1;
          D.27837 = *D.27836;
          D.27838 = (int) D.27837;
          __result = D.27835 - D.27838;
          if (__s2_len > 1) goto <D.27839>; else goto <D.27840>;
          <D.27839>:
          if (__result == 0) goto <D.27841>; else goto <D.27842>;
          <D.27841>:
          D.27843 = &MEM[(void *)"CallConvThiscall" + 2B];
          D.27844 = *D.27843;
          D.27845 = (int) D.27844;
          D.27846 = __s2 + 2;
          D.27847 = *D.27846;
          D.27848 = (int) D.27847;
          __result = D.27845 - D.27848;
          if (__s2_len > 2) goto <D.27849>; else goto <D.27850>;
          <D.27849>:
          if (__result == 0) goto <D.27851>; else goto <D.27852>;
          <D.27851>:
          D.27853 = &MEM[(void *)"CallConvThiscall" + 3B];
          D.27854 = *D.27853;
          D.27855 = (int) D.27854;
          D.27856 = __s2 + 3;
          D.27857 = *D.27856;
          D.27858 = (int) D.27857;
          __result = D.27855 - D.27858;
          <D.27852>:
          <D.27850>:
          <D.27842>:
          <D.27840>:
          <D.27832>:
          <D.27830>:
        }
        D.21539 = __result;
      }
      iftmp.315 = -D.21539;
      goto <D.27859>;
      <D.27823>:
      D.27733 = cmod_class->name;
      iftmp.315 = __builtin_strcmp (D.27733, "CallConvThiscall");
      <D.27859>:
      D.21540 = iftmp.315;
    }
    if (D.21540 == 0) goto <D.27860>; else goto <D.27861>;
    <D.27860>:
    csig->call_convention = 3;
    <D.27861>:
    <D.27820>:
    <D.27778>:
    <D.27736>:
    <D.27693>:
    <D.27651>:
  }
  i = i + 1;
  <D.21542>:
  D.27632 = sig->ret;
  D.27862 = D.27632->num_mods;
  D.27863 = (int) D.27862;
  if (D.27863 > i) goto <D.21541>; else goto <D.21543>;
  <D.21543>:
  <D.27638>:
  <D.27634>:
}


mono_class_has_parent (struct MonoClass * klass, struct MonoClass * parent)
{
  struct MonoClass * * D.27864;
  _Bool D.27865;
  long int D.27866;
  long int D.27867;
  struct MonoClass * * D.27870;
  _Bool D.27871;
  long int D.27872;
  long int D.27873;
  gboolean D.27876;

  D.27864 = klass->supertypes;
  D.27865 = D.27864 == 0B;
  D.27866 = (long int) D.27865;
  D.27867 = __builtin_expect (D.27866, 0);
  if (D.27867 != 0) goto <D.27868>; else goto <D.27869>;
  <D.27868>:
  mono_class_setup_supertypes (klass);
  <D.27869>:
  D.27870 = parent->supertypes;
  D.27871 = D.27870 == 0B;
  D.27872 = (long int) D.27871;
  D.27873 = __builtin_expect (D.27872, 0);
  if (D.27873 != 0) goto <D.27874>; else goto <D.27875>;
  <D.27874>:
  mono_class_setup_supertypes (parent);
  <D.27875>:
  D.27876 = mono_class_has_parent_fast (klass, parent);
  return D.27876;
}


mono_class_has_parent_fast (struct MonoClass * klass, struct MonoClass * parent)
{
  gboolean D.27878;
  int iftmp.316;
  short unsigned int D.27882;
  short unsigned int D.27883;
  struct MonoClass * * D.27885;
  long unsigned int D.27886;
  long unsigned int D.27887;
  sizetype D.27888;
  struct MonoClass * * D.27889;
  struct MonoClass * D.27890;

  D.27882 = klass->idepth;
  D.27883 = parent->idepth;
  if (D.27882 >= D.27883) goto <D.27884>; else goto <D.27880>;
  <D.27884>:
  D.27885 = klass->supertypes;
  D.27883 = parent->idepth;
  D.27886 = (long unsigned int) D.27883;
  D.27887 = D.27886 * 8;
  D.27888 = D.27887 + 18446744073709551608;
  D.27889 = D.27885 + D.27888;
  D.27890 = *D.27889;
  if (D.27890 == parent) goto <D.27891>; else goto <D.27880>;
  <D.27891>:
  iftmp.316 = 1;
  goto <D.27881>;
  <D.27880>:
  iftmp.316 = 0;
  <D.27881>:
  D.27878 = iftmp.316;
  return D.27878;
}


mono_marshal_get_vtfixup_ftnptr (struct MonoImage * image, guint32 token, guint16 type)
{
  _Bool D.27893;
  long int D.27894;
  long int D.27895;
  _Bool D.27898;
  long int D.27899;
  long int D.27900;
  int D.27903;
  int D.27904;
  long unsigned int D.27907;
  long unsigned int D.27908;
  _Bool D.27909;
  long int D.27910;
  long int D.27911;
  short unsigned int D.27914;
  int D.27915;
  int D.27916;
  long unsigned int D.27917;
  long unsigned int D.27918;
  struct MonoClass * D.27919;
  const char * D.27920;
  int D.27921;
  long unsigned int D.27922;
  long unsigned int D.27923;
  struct MonoMarshalSpec * * D.27924;
  struct MonoMarshalSpec * D.27925;
  void * D.27928;
  <unnamed-unsigned:1> D.27929;
  int D.27930;
  unsigned int i.317;
  int D.27932;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  int i;
  int param_count;

  D.27893 = token == 0;
  D.27894 = (long int) D.27893;
  D.27895 = __builtin_expect (D.27894, 0);
  if (D.27895 != 0) goto <D.27896>; else goto <D.27897>;
  <D.27896>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9608, "token");
  <D.27897>:
  method = mono_get_method (image, token, 0B);
  D.27898 = method == 0B;
  D.27899 = (long int) D.27898;
  D.27900 = __builtin_expect (D.27899, 0);
  if (D.27900 != 0) goto <D.27901>; else goto <D.27902>;
  <D.27901>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9611, "method");
  <D.27902>:
  D.27903 = (int) type;
  D.27904 = D.27903 & 12;
  if (D.27904 != 0) goto <D.27905>; else goto <D.27906>;
  <D.27905>:
  {
    struct MonoMethodSignature * csig;
    struct MonoMarshalSpec * * mspecs;
    struct EmitMarshalContext m;

    try
      {
        sig = mono_method_signature (method);
        D.27907 = BIT_FIELD_REF <*sig, 64, 64>;
        D.27908 = D.27907 & 18014398509481984;
        D.27909 = D.27908 != 0;
        D.27910 = (long int) D.27909;
        D.27911 = __builtin_expect (D.27910, 0);
        if (D.27911 != 0) goto <D.27912>; else goto <D.27913>;
        <D.27912>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9619, "!sig->hasthis");
        <D.27913>:
        D.27914 = sig->param_count;
        D.27915 = (int) D.27914;
        D.27916 = D.27915 + 1;
        D.27917 = (long unsigned int) D.27916;
        D.27918 = D.27917 * 8;
        mspecs = monoeg_malloc0 (D.27918);
        mono_method_get_marshal_info (method, mspecs);
        D.27919 = method->klass;
        D.27920 = method->name;
        mb = mono_mb_new (D.27919, D.27920, 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.27914 = sig->param_count;
        D.27915 = (int) D.27914;
        D.27921 = D.27915 + 16;
        method = mono_mb_create_method (mb, csig, D.27921);
        mono_mb_free (mb);
        D.27914 = sig->param_count;
        i = (int) D.27914;
        goto <D.21635>;
        <D.21634>:
        D.27922 = (long unsigned int) i;
        D.27923 = D.27922 * 8;
        D.27924 = mspecs + D.27923;
        D.27925 = *D.27924;
        if (D.27925 != 0B) goto <D.27926>; else goto <D.27927>;
        <D.27926>:
        D.27922 = (long unsigned int) i;
        D.27923 = D.27922 * 8;
        D.27924 = mspecs + D.27923;
        D.27925 = *D.27924;
        mono_metadata_free_marshal_spec (D.27925);
        <D.27927>:
        i = i + -1;
        <D.21635>:
        if (i >= 0) goto <D.21634>; else goto <D.21636>;
        <D.21636>:
        monoeg_g_free (mspecs);
        D.27928 = mono_compile_method (method);
        return D.27928;
      }
    finally
      {
        m = {CLOBBER};
      }
  }
  <D.27906>:
  sig = mono_method_signature (method);
  D.27919 = method->klass;
  D.27920 = method->name;
  mb = mono_mb_new (D.27919, D.27920, 7);
  D.27914 = sig->param_count;
  D.27915 = (int) D.27914;
  D.27929 = sig->hasthis;
  D.27930 = (int) D.27929;
  param_count = D.27915 + D.27930;
  i = 0;
  goto <D.21638>;
  <D.21637>:
  i.317 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.317);
  i = i + 1;
  <D.21638>:
  if (i < param_count) goto <D.21637>; else goto <D.21639>;
  <D.21639>:
  D.27903 = (int) type;
  D.27932 = D.27903 & 16;
  if (D.27932 != 0) goto <D.27933>; else goto <D.27934>;
  <D.27933>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.27935>;
  <D.27934>:
  mono_mb_emit_op (mb, 40, method);
  <D.27935>:
  mono_mb_emit_byte (mb, 42);
  mb->dynamic = 1;
  method = mono_mb_create_method (mb, sig, param_count);
  mono_mb_free (mb);
  D.27928 = mono_compile_method (method);
  return D.27928;
}


mono_marshal_get_castclass_with_cache ()
{
  struct MonoMethod * cached.318;
  struct MonoMethod * D.27941;
  struct MonoClass * D.27942;
  struct MonoImage * D.27943;
  struct MonoType * D.27944;
  struct MonoClass * D.27945;
  struct MonoType * D.27946;
  unsigned int D.27947;
  unsigned int D.27948;
  unsigned int cache_miss_pos.319;
  unsigned int D.27950;
  unsigned int invalid_cast_pos.320;
  unsigned int return_null_pos.321;
  void * D.27953;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int invalid_cast_pos;
  struct WrapperInfo * info;

  cached.318 = cached;
  if (cached.318 != 0B) goto <D.27939>; else goto <D.27940>;
  <D.27939>:
  D.27941 = cached;
  return D.27941;
  <D.27940>:
  D.27942 = mono_defaults.object_class;
  mb = mono_mb_new (D.27942, "__castclass_with_cache", 19);
  D.27943 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27943, 3);
  D.27942 = mono_defaults.object_class;
  D.27944 = &D.27942->byval_arg;
  sig->params[0] = D.27944;
  D.27945 = mono_defaults.int_class;
  D.27946 = &D.27945->byval_arg;
  sig->params[1] = D.27946;
  D.27945 = mono_defaults.int_class;
  D.27946 = &D.27945->byval_arg;
  sig->params[2] = D.27946;
  D.27942 = mono_defaults.object_class;
  D.27944 = &D.27942->byval_arg;
  sig->ret = D.27944;
  sig->pinvoke = 0;
  D.27945 = mono_defaults.int_class;
  D.27946 = &D.27945->byval_arg;
  mono_mb_add_local (mb, D.27946);
  mono_mb_emit_ldarg (mb, 0);
  D.27947 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27947;
  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.27948 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27948;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.319 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.319);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27950 = mono_mb_emit_branch (mb, 57);
  invalid_cast_pos = (int) D.27950;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  invalid_cast_pos.320 = (unsigned int) invalid_cast_pos;
  mono_mb_patch_branch (mb, invalid_cast_pos.320);
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  return_null_pos.321 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.321);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 9);
  mono_marshal_set_wrapper_info (res, info);
  mono_memory_write_barrier ();
  D.27953 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27953 != 0B) goto <D.27954>; else goto <D.27955>;
  <D.27954>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27955>:
  mono_mb_free (mb);
  D.27941 = cached;
  return D.27941;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


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

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


mono_marshal_get_isinst_with_cache ()
{
  struct MonoMethod * cached.324;
  struct MonoMethod * D.27965;
  struct MonoClass * D.27966;
  struct MonoImage * D.27967;
  struct MonoType * D.27968;
  struct MonoClass * D.27969;
  struct MonoType * D.27970;
  unsigned int D.27971;
  unsigned int D.27972;
  unsigned int D.27973;
  unsigned int D.27974;
  unsigned int negative_cache_hit_pos.325;
  unsigned int cache_hit_pos.326;
  unsigned int cache_miss_pos.327;
  unsigned int D.27978;
  unsigned int not_an_instance_pos.328;
  unsigned int return_null_pos.329;
  void * D.27981;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int cache_hit_pos;
  int not_an_instance_pos;
  int negative_cache_hit_pos;
  struct WrapperInfo * info;

  cached.324 = cached;
  if (cached.324 != 0B) goto <D.27963>; else goto <D.27964>;
  <D.27963>:
  D.27965 = cached;
  return D.27965;
  <D.27964>:
  D.27966 = mono_defaults.object_class;
  mb = mono_mb_new (D.27966, "__isinst_with_cache", 19);
  D.27967 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27967, 3);
  D.27966 = mono_defaults.object_class;
  D.27968 = &D.27966->byval_arg;
  sig->params[0] = D.27968;
  D.27969 = mono_defaults.int_class;
  D.27970 = &D.27969->byval_arg;
  sig->params[1] = D.27970;
  D.27969 = mono_defaults.int_class;
  D.27970 = &D.27969->byval_arg;
  sig->params[2] = D.27970;
  D.27966 = mono_defaults.object_class;
  D.27968 = &D.27966->byval_arg;
  sig->ret = D.27968;
  sig->pinvoke = 0;
  D.27969 = mono_defaults.int_class;
  D.27970 = &D.27969->byval_arg;
  mono_mb_add_local (mb, D.27970);
  D.27969 = mono_defaults.int_class;
  D.27970 = &D.27969->byval_arg;
  mono_mb_add_local (mb, D.27970);
  mono_mb_emit_ldarg (mb, 0);
  D.27971 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27971;
  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.27972 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27972;
  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.27973 = mono_mb_emit_branch (mb, 58);
  negative_cache_hit_pos = (int) D.27973;
  mono_mb_emit_ldarg (mb, 0);
  D.27974 = mono_mb_emit_branch (mb, 56);
  cache_hit_pos = (int) D.27974;
  negative_cache_hit_pos.325 = (unsigned int) negative_cache_hit_pos;
  mono_mb_patch_branch (mb, negative_cache_hit_pos.325);
  mono_mb_emit_byte (mb, 20);
  cache_hit_pos.326 = (unsigned int) cache_hit_pos;
  mono_mb_patch_branch (mb, cache_hit_pos.326);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.327 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.327);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27978 = mono_mb_emit_branch (mb, 57);
  not_an_instance_pos = (int) D.27978;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  not_an_instance_pos.328 = (unsigned int) not_an_instance_pos;
  mono_mb_patch_branch (mb, not_an_instance_pos.328);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 96);
  mono_mb_emit_byte (mb, 223);
  return_null_pos.329 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.329);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 10);
  mono_marshal_set_wrapper_info (res, info);
  mono_memory_write_barrier ();
  D.27981 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27981 != 0B) goto <D.27982>; else goto <D.27983>;
  <D.27982>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27983>:
  mono_mb_free (mb);
  D.27965 = cached;
  return D.27965;
}


mono_marshal_get_isinst (struct MonoClass * klass)
{
  struct MonoImage * D.27985;
  struct GHashTable * * D.27986;
  struct MonoMethod * D.27989;
  struct MonoMethodSignature * isint_sig.330;
  struct MonoImage * D.27993;
  struct MonoMethodSignature * isint_sig.331;
  struct MonoClass * D.27995;
  struct MonoType * D.27996;
  const char * D.27997;
  struct MonoMethod * D.27998;
  unsigned int D.27999;
  unsigned int D.28000;
  struct MonoMethod * D.28001;
  unsigned int D.28002;
  unsigned int pos_failed.332;
  unsigned int D.28004;
  unsigned int pos_was_ok.333;
  unsigned int pos_end.334;
  unsigned int pos_end2.335;
  short unsigned int D.28008;
  int D.28009;
  int D.28010;
  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.27985 = klass->image;
  D.27986 = &D.27985->isinst_cache;
  cache = get_cache (D.27986, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27987>; else goto <D.27988>;
  <D.27987>:
  D.27989 = res;
  return D.27989;
  <D.27988>:
  isint_sig.330 = isint_sig;
  if (isint_sig.330 == 0B) goto <D.27991>; else goto <D.27992>;
  <D.27991>:
  D.27993 = mono_defaults.corlib;
  isint_sig.331 = mono_metadata_signature_alloc (D.27993, 1);
  isint_sig = isint_sig.331;
  isint_sig.330 = isint_sig;
  D.27995 = mono_defaults.object_class;
  D.27996 = &D.27995->byval_arg;
  isint_sig.330->params[0] = D.27996;
  isint_sig.330 = isint_sig;
  D.27995 = mono_defaults.object_class;
  D.27996 = &D.27995->byval_arg;
  isint_sig.330->ret = D.27996;
  isint_sig.330 = isint_sig;
  isint_sig.330->pinvoke = 0;
  <D.27992>:
  D.27997 = klass->name;
  name = monoeg_g_strdup_printf ("__isinst_wrapper_%s", D.27997);
  D.27995 = mono_defaults.object_class;
  mb = mono_mb_new (D.27995, name, 18);
  monoeg_g_free (name);
  D.27998 = mb->method;
  D.27998->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.27999 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27999;
  mono_mb_emit_byte (mb, 24);
  D.28000 = mono_mb_emit_branch (mb, 64);
  pos_failed = (int) D.28000;
  mono_mb_emit_ldarg (mb, 0);
  D.28001 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.28001, 0B);
  D.28002 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.28002;
  pos_failed.332 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.332);
  mono_mb_emit_byte (mb, 20);
  D.28004 = mono_mb_emit_branch (mb, 56);
  pos_end2 = (int) D.28004;
  pos_was_ok.333 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.333);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 0);
  pos_end.334 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.334);
  pos_end2.335 = (unsigned int) pos_end2;
  mono_mb_patch_branch (mb, pos_end2.335);
  mono_mb_emit_byte (mb, 42);
  isint_sig.330 = isint_sig;
  isint_sig.330 = isint_sig;
  D.28008 = isint_sig.330->param_count;
  D.28009 = (int) D.28008;
  D.28010 = D.28009 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.330, D.28010);
  mono_mb_free (mb);
  D.27989 = res;
  return D.27989;
}


mono_marshal_get_castclass (struct MonoClass * klass)
{
  struct MonoImage * D.28012;
  struct GHashTable * * D.28013;
  struct MonoMethod * D.28016;
  struct MonoMethodSignature * castclass_sig.336;
  struct MonoImage * D.28020;
  struct MonoMethodSignature * castclass_sig.337;
  struct MonoClass * D.28022;
  struct MonoType * D.28023;
  const char * D.28024;
  struct MonoMethod * D.28025;
  unsigned int D.28026;
  struct MonoMethod * D.28027;
  unsigned int D.28028;
  unsigned int pos_was_ok.338;
  unsigned int pos_was_ok2.339;
  short unsigned int D.28031;
  int D.28032;
  int D.28033;
  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.28012 = klass->image;
  D.28013 = &D.28012->castclass_cache;
  cache = get_cache (D.28013, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.28014>; else goto <D.28015>;
  <D.28014>:
  D.28016 = res;
  return D.28016;
  <D.28015>:
  castclass_sig.336 = castclass_sig;
  if (castclass_sig.336 == 0B) goto <D.28018>; else goto <D.28019>;
  <D.28018>:
  D.28020 = mono_defaults.corlib;
  castclass_sig.337 = mono_metadata_signature_alloc (D.28020, 1);
  castclass_sig = castclass_sig.337;
  castclass_sig.336 = castclass_sig;
  D.28022 = mono_defaults.object_class;
  D.28023 = &D.28022->byval_arg;
  castclass_sig.336->params[0] = D.28023;
  castclass_sig.336 = castclass_sig;
  D.28022 = mono_defaults.object_class;
  D.28023 = &D.28022->byval_arg;
  castclass_sig.336->ret = D.28023;
  castclass_sig.336 = castclass_sig;
  castclass_sig.336->pinvoke = 0;
  <D.28019>:
  D.28024 = klass->name;
  name = monoeg_g_strdup_printf ("__castclass_wrapper_%s", D.28024);
  D.28022 = mono_defaults.object_class;
  mb = mono_mb_new (D.28022, name, 19);
  monoeg_g_free (name);
  D.28025 = mb->method;
  D.28025->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 8, klass);
  D.28026 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.28026;
  mono_mb_emit_ldarg (mb, 0);
  D.28027 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.28027, 0B);
  D.28028 = mono_mb_emit_branch (mb, 58);
  pos_was_ok2 = (int) D.28028;
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  pos_was_ok.338 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.338);
  pos_was_ok2.339 = (unsigned int) pos_was_ok2;
  mono_mb_patch_branch (mb, pos_was_ok2.339);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  castclass_sig.336 = castclass_sig;
  castclass_sig.336 = castclass_sig;
  D.28031 = castclass_sig.336->param_count;
  D.28032 = (int) D.28031;
  D.28033 = D.28032 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig.336, D.28033);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 0);
  mono_marshal_set_wrapper_info (res, info);
  D.28016 = res;
  return D.28016;
}


mono_marshal_get_proxy_cancast (struct MonoClass * klass)
{
  struct MonoImage * D.28035;
  struct GHashTable * * D.28036;
  struct MonoMethod * D.28039;
  struct MonoMethodSignature * isint_sig.340;
  struct MonoImage * D.28043;
  struct MonoMethodSignature * isint_sig.341;
  struct MonoClass * D.28045;
  struct MonoType * D.28046;
  struct MonoType * D.28047;
  struct MonoMethod * D.28048;
  struct MonoClass * D.28049;
  _Bool D.28050;
  long int D.28051;
  long int D.28052;
  unsigned int D.28055;
  unsigned int D.28056;
  unsigned int pos_failed.342;
  unsigned int pos_end.343;
  short unsigned int D.28059;
  int D.28060;
  int D.28061;
  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.28035 = klass->image;
  D.28036 = &D.28035->proxy_isinst_cache;
  cache = get_cache (D.28036, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.28037>; else goto <D.28038>;
  <D.28037>:
  D.28039 = res;
  return D.28039;
  <D.28038>:
  isint_sig.340 = isint_sig;
  if (isint_sig.340 == 0B) goto <D.28041>; else goto <D.28042>;
  <D.28041>:
  D.28043 = mono_defaults.corlib;
  isint_sig.341 = mono_metadata_signature_alloc (D.28043, 1);
  isint_sig = isint_sig.341;
  isint_sig.340 = isint_sig;
  D.28045 = mono_defaults.object_class;
  D.28046 = &D.28045->byval_arg;
  isint_sig.340->params[0] = D.28046;
  isint_sig.340 = isint_sig;
  D.28045 = mono_defaults.object_class;
  D.28046 = &D.28045->byval_arg;
  isint_sig.340->ret = D.28046;
  isint_sig.340 = isint_sig;
  isint_sig.340->pinvoke = 0;
  <D.28042>:
  D.28047 = &klass->byval_arg;
  klass_name = mono_type_full_name (D.28047);
  name = monoeg_g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name);
  D.28045 = mono_defaults.object_class;
  mb = mono_mb_new (D.28045, name, 20);
  monoeg_g_free (klass_name);
  monoeg_g_free (name);
  D.28048 = mb->method;
  D.28048->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  D.28047 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.28047);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", 0);
  D.28049 = mono_defaults.iremotingtypeinfo_class;
  can_cast_to = mono_method_desc_search_in_class (desc, D.28049);
  D.28050 = can_cast_to == 0B;
  D.28051 = (long int) D.28050;
  D.28052 = __builtin_expect (D.28051, 0);
  if (D.28052 != 0) goto <D.28053>; else goto <D.28054>;
  <D.28053>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10142, "can_cast_to");
  <D.28054>:
  mono_method_desc_free (desc);
  mono_mb_emit_op (mb, 111, can_cast_to);
  D.28055 = mono_mb_emit_branch (mb, 57);
  pos_failed = (int) D.28055;
  D.28047 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.28047);
  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.28056 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.28056;
  pos_failed.342 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.342);
  mono_mb_emit_byte (mb, 20);
  pos_end.343 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.343);
  mono_mb_emit_byte (mb, 42);
  isint_sig.340 = isint_sig;
  isint_sig.340 = isint_sig;
  D.28059 = isint_sig.340->param_count;
  D.28060 = (int) D.28059;
  D.28061 = D.28060 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.340, D.28061);
  mono_mb_free (mb);
  D.28039 = res;
  return D.28039;
}


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

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


mono_marshal_get_struct_to_ptr (struct MonoClass * klass)
{
  _Bool D.28065;
  long int D.28066;
  long int D.28067;
  struct MonoMarshalType * D.28070;
  struct MonoMethod * D.28071;
  struct MonoMethod * D.28074;
  struct MonoMethod * stoptr.344;
  struct MonoClass * D.28078;
  struct MonoMethod * stoptr.345;
  _Bool D.28080;
  long int D.28081;
  long int D.28082;
  const char * D.28085;
  long unsigned int D.28086;
  long unsigned int D.28087;
  int D.28090;
  struct MonoClass * D.28092;
  struct MonoType * D.28093;
  struct MonoClass * D.28094;
  struct MonoType * D.28095;
  struct MonoMethodSignature * D.28096;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * stoptr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.28065 = klass == 0B;
  D.28066 = (long int) D.28065;
  D.28067 = __builtin_expect (D.28066, 0);
  if (D.28067 != 0) goto <D.28068>; else goto <D.28069>;
  <D.28068>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10201, "klass != NULL");
  <D.28069>:
  mono_marshal_load_type_info (klass);
  D.28070 = klass->marshal_info;
  D.28071 = D.28070->str_to_ptr;
  if (D.28071 != 0B) goto <D.28072>; else goto <D.28073>;
  <D.28072>:
  D.28070 = klass->marshal_info;
  D.28074 = D.28070->str_to_ptr;
  return D.28074;
  <D.28073>:
  stoptr.344 = stoptr;
  if (stoptr.344 == 0B) goto <D.28076>; else goto <D.28077>;
  <D.28076>:
  D.28078 = mono_defaults.marshal_class;
  stoptr.345 = mono_class_get_method_from_name (D.28078, "StructureToPtr", 3);
  stoptr = stoptr.345;
  <D.28077>:
  stoptr.344 = stoptr;
  D.28080 = stoptr.344 == 0B;
  D.28081 = (long int) D.28080;
  D.28082 = __builtin_expect (D.28081, 0);
  if (D.28082 != 0) goto <D.28083>; else goto <D.28084>;
  <D.28083>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10210, "stoptr");
  <D.28084>:
  stoptr.344 = stoptr;
  D.28085 = stoptr.344->name;
  mb = mono_mb_new (klass, D.28085, 25);
  D.28086 = BIT_FIELD_REF <*klass, 64, 256>;
  D.28087 = D.28086 & 32;
  if (D.28087 != 0) goto <D.28088>; else goto <D.28089>;
  <D.28088>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 16);
  D.28090 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28090);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.28091>;
  <D.28089>:
  D.28092 = mono_defaults.int_class;
  D.28093 = &D.28092->byval_arg;
  mono_mb_add_local (mb, D.28093);
  D.28092 = mono_defaults.int_class;
  D.28093 = &D.28092->byval_arg;
  mono_mb_add_local (mb, D.28093);
  D.28094 = mono_defaults.boolean_class;
  D.28095 = &D.28094->byval_arg;
  mono_mb_add_local (mb, D.28095);
  mono_mb_emit_byte (mb, 4);
  mono_mb_emit_stloc (mb, 2);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.28091>:
  mono_mb_emit_byte (mb, 42);
  stoptr.344 = stoptr;
  D.28096 = mono_signature_no_pinvoke (stoptr.344);
  res = mono_mb_create_method (mb, D.28096, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 8);
  mono_marshal_set_wrapper_info (res, info);
  D.28070 = klass->marshal_info;
  D.28070->str_to_ptr = res;
  D.28074 = res;
  return D.28074;
}


mono_marshal_get_ptr_to_struct (struct MonoClass * klass)
{
  _Bool D.28098;
  long int D.28099;
  long int D.28100;
  struct MonoMarshalType * D.28103;
  struct MonoMethod * D.28104;
  struct MonoMethod * D.28107;
  struct MonoMethodSignature * ptostr.346;
  struct MonoImage * D.28111;
  long unsigned int D.28112;
  long unsigned int D.28113;
  int D.28116;
  struct MonoClass * D.28118;
  struct MonoType * D.28119;
  struct MonoType * D.28120;
  struct MonoMethodBuilder * mb;
  static struct MonoMethodSignature * ptostr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.28098 = klass == 0B;
  D.28099 = (long int) D.28098;
  D.28100 = __builtin_expect (D.28099, 0);
  if (D.28100 != 0) goto <D.28101>; else goto <D.28102>;
  <D.28101>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10273, "klass != NULL");
  <D.28102>:
  mono_marshal_load_type_info (klass);
  D.28103 = klass->marshal_info;
  D.28104 = D.28103->ptr_to_str;
  if (D.28104 != 0B) goto <D.28105>; else goto <D.28106>;
  <D.28105>:
  D.28103 = klass->marshal_info;
  D.28107 = D.28103->ptr_to_str;
  return D.28107;
  <D.28106>:
  ptostr.346 = ptostr;
  if (ptostr.346 == 0B) goto <D.28109>; else goto <D.28110>;
  <D.28109>:
  {
    struct MonoMethodSignature * sig;

    sig = mono_create_icall_signature ("void ptr object");
    D.28111 = mono_defaults.corlib;
    sig = signature_dup (D.28111, sig);
    sig->pinvoke = 0;
    mono_memory_barrier ();
    ptostr = sig;
  }
  <D.28110>:
  mb = mono_mb_new (klass, "PtrToStructure", 25);
  D.28112 = BIT_FIELD_REF <*klass, 64, 256>;
  D.28113 = D.28112 & 32;
  if (D.28113 != 0) goto <D.28114>; else goto <D.28115>;
  <D.28114>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 2);
  D.28116 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.28116);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.28117>;
  <D.28115>:
  D.28118 = mono_defaults.int_class;
  D.28119 = &D.28118->byval_arg;
  mono_mb_add_local (mb, D.28119);
  D.28120 = &klass->this_arg;
  mono_mb_add_local (mb, D.28120);
  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.28117>:
  mono_mb_emit_byte (mb, 42);
  ptostr.346 = ptostr;
  res = mono_mb_create_method (mb, ptostr.346, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 7);
  mono_marshal_set_wrapper_info (res, info);
  D.28103 = klass->marshal_info;
  D.28103->ptr_to_str = res;
  D.28107 = res;
  return D.28107;
}


mono_marshal_get_synchronized_inner_wrapper (struct MonoMethod * method)
{
  long unsigned int D.28122;
  long unsigned int D.28123;
  struct MonoGenericContext * D.28126;
  struct MonoGenericInst * D.28127;
  struct MonoClass * D.28132;
  _Bool D.28133;
  long int D.28134;
  long int D.28135;
  const char * D.28138;
  struct MonoImage * D.28139;
  struct MonoMethodSignature * D.28140;
  struct MonoMethod * D.28143;
  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.28122 = BIT_FIELD_REF <*method, 64, 256>;
  D.28123 = D.28122 & 4096;
  if (D.28123 != 0) goto <D.28124>; else goto <D.28125>;
  <D.28124>:
  D.28126 = mono_method_get_context (method);
  D.28127 = D.28126->method_inst;
  if (D.28127 == 0B) goto <D.28128>; else goto <D.28129>;
  <D.28128>:
  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.28130>; else goto <D.28131>;
  <D.28130>:
  D.28132 = method->klass;
  container = D.28132->generic_container;
  <D.28131>:
  D.28133 = container == 0B;
  D.28134 = (long int) D.28133;
  D.28135 = __builtin_expect (D.28134, 0);
  if (D.28135 != 0) goto <D.28136>; else goto <D.28137>;
  <D.28136>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10360, "container");
  <D.28137>:
  <D.28129>:
  <D.28125>:
  D.28132 = method->klass;
  D.28138 = method->name;
  mb = mono_mb_new (D.28132, D.28138, 25);
  mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn\'t be called.");
  mono_mb_emit_byte (mb, 42);
  D.28132 = method->klass;
  D.28139 = D.28132->image;
  D.28140 = mono_method_signature (method);
  sig = signature_dup (D.28139, D.28140);
  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.28141>; else goto <D.28142>;
  <D.28141>:
  res = mono_class_inflate_generic_method (res, ctx);
  <D.28142>:
  D.28143 = res;
  return D.28143;
}


mono_marshal_get_synchronized_wrapper (struct MonoMethod * method)
{
  _Bool D.28145;
  long int D.28146;
  long int D.28147;
  long unsigned int D.28150;
  long unsigned int D.28151;
  struct MonoMethod * D.28154;
  long unsigned int D.28155;
  struct MonoGenericContext * D.28158;
  struct MonoGenericInst * D.28159;
  struct MonoClass * D.28164;
  _Bool D.28165;
  long int D.28166;
  long int D.28167;
  struct MonoImage * D.28172;
  struct GHashTable * * D.28173;
  struct GHashTable * * D.28177;
  struct MonoMethodSignature * D.28180;
  const char * D.28181;
  struct MonoType * D.28182;
  int D.28183;
  long unsigned int D.28186;
  long unsigned int D.28187;
  short unsigned int D.28190;
  int D.28191;
  int D.28192;
  int D.28195;
  unsigned int ret_local.347;
  short unsigned int D.28199;
  int D.28200;
  int D.28201;
  struct MonoClass * D.28202;
  struct MonoType * D.28203;
  _Bool D.28206;
  long int D.28207;
  long int D.28208;
  struct MonoMethod * enter_method.348;
  struct MonoClass * D.28214;
  struct MonoMethod * enter_method.349;
  _Bool D.28216;
  long int D.28217;
  long int D.28218;
  struct MonoMethod * exit_method.350;
  struct MonoMethod * exit_method.351;
  _Bool D.28223;
  long int D.28224;
  long int D.28225;
  struct MonoClass * D.28228;
  struct MonoMethod * gettypefromhandle_method.352;
  struct MonoMethod * gettypefromhandle_method.353;
  _Bool D.28231;
  long int D.28232;
  long int D.28233;
  _Bool D.28238;
  long int D.28239;
  long int D.28240;
  unsigned int D.28245;
  struct MonoClass * D.28246;
  unsigned int this_local.354;
  int D.28249;
  unsigned int D.28250;
  long unsigned int D.28251;
  long unsigned int D.28252;
  _Bool D.28255;
  int D.28256;
  int D.28257;
  unsigned int D.28258;
  struct MonoGenericContext * D.28261;
  struct MonoMethod * D.28262;
  int D.28264;
  unsigned int D.28267;
  int D.28268;
  unsigned int D.28269;
  unsigned int D.28270;
  unsigned int D.28271;
  int D.28272;
  unsigned int D.28273;
  int D.28274;
  unsigned int D.28275;
  unsigned int D.28276;
  unsigned int D.28277;
  unsigned int pos.355;
  int D.28279;
  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.28145 = method == 0B;
  D.28146 = (long int) D.28145;
  D.28147 = __builtin_expect (D.28146, 0);
  if (D.28147 != 0) goto <D.28148>; else goto <D.28149>;
  <D.28148>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10397, "method");
  <D.28149>:
  D.28150 = BIT_FIELD_REF <*method, 64, 256>;
  D.28151 = D.28150 & 124;
  if (D.28151 == 64) goto <D.28152>; else goto <D.28153>;
  <D.28152>:
  D.28154 = method;
  return D.28154;
  <D.28153>:
  D.28150 = BIT_FIELD_REF <*method, 64, 256>;
  D.28155 = D.28150 & 4096;
  if (D.28155 != 0) goto <D.28156>; else goto <D.28157>;
  <D.28156>:
  D.28158 = mono_method_get_context (method);
  D.28159 = D.28158->method_inst;
  if (D.28159 == 0B) goto <D.28160>; else goto <D.28161>;
  <D.28160>:
  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.28162>; else goto <D.28163>;
  <D.28162>:
  D.28164 = method->klass;
  container = D.28164->generic_container;
  <D.28163>:
  D.28165 = container == 0B;
  D.28166 = (long int) D.28165;
  D.28167 = __builtin_expect (D.28166, 0);
  if (D.28167 != 0) goto <D.28168>; else goto <D.28169>;
  <D.28168>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10410, "container");
  <D.28169>:
  <D.28161>:
  <D.28157>:
  if (ctx != 0B) goto <D.28170>; else goto <D.28171>;
  <D.28170>:
  D.28164 = method->klass;
  D.28172 = D.28164->image;
  D.28173 = &D.28172->synchronized_generic_cache;
  cache = get_cache (D.28173, mono_aligned_addr_hash, 0B);
  res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
  if (res != 0B) goto <D.28174>; else goto <D.28175>;
  <D.28174>:
  D.28154 = res;
  return D.28154;
  <D.28175>:
  goto <D.28176>;
  <D.28171>:
  D.28164 = method->klass;
  D.28172 = D.28164->image;
  D.28177 = &D.28172->synchronized_cache;
  cache = get_cache (D.28177, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28178>; else goto <D.28179>;
  <D.28178>:
  D.28154 = res;
  return D.28154;
  <D.28179>:
  <D.28176>:
  D.28164 = method->klass;
  D.28172 = D.28164->image;
  D.28180 = mono_method_signature (method);
  sig = signature_dup (D.28172, D.28180);
  sig->pinvoke = 0;
  D.28164 = method->klass;
  D.28181 = method->name;
  mb = mono_mb_new (D.28164, D.28181, 16);
  D.28182 = sig->ret;
  D.28183 = mono_type_is_void (D.28182);
  if (D.28183 == 0) goto <D.28184>; else goto <D.28185>;
  <D.28184>:
  D.28182 = sig->ret;
  ret_local = mono_mb_add_local (mb, D.28182);
  <D.28185>:
  D.28164 = method->klass;
  D.28186 = BIT_FIELD_REF <*D.28164, 64, 256>;
  D.28187 = D.28186 & 8;
  if (D.28187 != 0) goto <D.28188>; else goto <D.28189>;
  <D.28188>:
  D.28190 = method->flags;
  D.28191 = (int) D.28190;
  D.28192 = D.28191 & 16;
  if (D.28192 == 0) goto <D.28193>; else goto <D.28194>;
  <D.28193>:
  D.28164 = method->klass;
  mono_class_set_failure (D.28164, 7, 0B);
  mono_mb_emit_byte (mb, 20);
  D.28164 = method->klass;
  mono_mb_emit_op (mb, 117, D.28164);
  mono_mb_emit_byte (mb, 38);
  D.28182 = sig->ret;
  D.28195 = mono_type_is_void (D.28182);
  if (D.28195 == 0) goto <D.28196>; else goto <D.28197>;
  <D.28196>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.347);
  <D.28197>:
  mono_mb_emit_byte (mb, 42);
  D.28199 = sig->param_count;
  D.28200 = (int) D.28199;
  D.28201 = D.28200 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.28201);
  mono_mb_free (mb);
  D.28154 = res;
  return D.28154;
  <D.28194>:
  <D.28189>:
  D.28202 = mono_defaults.object_class;
  D.28203 = &D.28202->byval_arg;
  this_local = mono_mb_add_local (mb, D.28203);
  D.28164 = method->klass;
  D.28172 = D.28164->image;
  clause = mono_image_alloc0 (D.28172, 32);
  clause->flags = 2;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28204>; else goto <D.28205>;
    <D.28204>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28205>:
    D.28206 = ret != 0;
    D.28207 = (long int) D.28206;
    D.28208 = __builtin_expect (D.28207, 0);
    if (D.28208 != 0) goto <D.28209>; else goto <D.28210>;
    <D.28209>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10466, "ret == 0");
    <D.28210>:
  }
  enter_method.348 = enter_method;
  if (enter_method.348 == 0B) goto <D.28212>; else goto <D.28213>;
  <D.28212>:
  {
    struct MonoMethodDesc * desc;

    desc = mono_method_desc_new ("Monitor:Enter", 0);
    D.28214 = mono_defaults.monitor_class;
    enter_method.349 = mono_method_desc_search_in_class (desc, D.28214);
    enter_method = enter_method.349;
    enter_method.348 = enter_method;
    D.28216 = enter_method.348 == 0B;
    D.28217 = (long int) D.28216;
    D.28218 = __builtin_expect (D.28217, 0);
    if (D.28218 != 0) goto <D.28219>; else goto <D.28220>;
    <D.28219>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10473, "enter_method");
    <D.28220>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Monitor:Exit", 0);
    D.28214 = mono_defaults.monitor_class;
    exit_method.350 = mono_method_desc_search_in_class (desc, D.28214);
    exit_method = exit_method.350;
    exit_method.351 = exit_method;
    D.28223 = exit_method.351 == 0B;
    D.28224 = (long int) D.28223;
    D.28225 = __builtin_expect (D.28224, 0);
    if (D.28225 != 0) goto <D.28226>; else goto <D.28227>;
    <D.28226>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10478, "exit_method");
    <D.28227>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Type:GetTypeFromHandle", 0);
    D.28228 = mono_defaults.systemtype_class;
    gettypefromhandle_method.352 = mono_method_desc_search_in_class (desc, D.28228);
    gettypefromhandle_method = gettypefromhandle_method.352;
    gettypefromhandle_method.353 = gettypefromhandle_method;
    D.28231 = gettypefromhandle_method.353 == 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", 10483, "gettypefromhandle_method");
    <D.28235>:
    mono_method_desc_free (desc);
  }
  <D.28213>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28236>; else goto <D.28237>;
    <D.28236>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28237>:
    D.28238 = ret != 0;
    D.28239 = (long int) D.28238;
    D.28240 = __builtin_expect (D.28239, 0);
    if (D.28240 != 0) goto <D.28241>; else goto <D.28242>;
    <D.28241>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10487, "ret == 0");
    <D.28242>:
  }
  D.28190 = method->flags;
  D.28191 = (int) D.28190;
  D.28192 = D.28191 & 16;
  if (D.28192 != 0) goto <D.28243>; else goto <D.28244>;
  <D.28243>:
  {
    int index;

    D.28164 = method->klass;
    D.28245 = mono_mb_add_data (mb, D.28164);
    index = (int) D.28245;
    D.28246 = mono_defaults.typehandle_class;
    mono_mb_add_data (mb, D.28246);
    mono_mb_emit_byte (mb, 208);
    mono_mb_emit_i4 (mb, index);
    gettypefromhandle_method.353 = gettypefromhandle_method;
    mono_mb_emit_managed_call (mb, gettypefromhandle_method.353, 0B);
  }
  goto <D.28247>;
  <D.28244>:
  mono_mb_emit_ldarg (mb, 0);
  <D.28247>:
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_stloc (mb, this_local.354);
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.354);
  enter_method.348 = enter_method;
  mono_mb_emit_managed_call (mb, enter_method.348, 0B);
  D.28249 = mono_mb_get_label (mb);
  D.28250 = (unsigned int) D.28249;
  clause->try_offset = D.28250;
  D.28251 = BIT_FIELD_REF <*sig, 64, 64>;
  D.28252 = D.28251 & 18014398509481984;
  if (D.28252 != 0) goto <D.28253>; else goto <D.28254>;
  <D.28253>:
  mono_mb_emit_ldarg (mb, 0);
  <D.28254>:
  i = 0;
  goto <D.21759>;
  <D.21758>:
  D.28251 = BIT_FIELD_REF <*sig, 64, 64>;
  D.28252 = D.28251 & 18014398509481984;
  D.28255 = D.28252 != 0;
  D.28256 = (int) D.28255;
  D.28257 = D.28256 + i;
  D.28258 = (unsigned int) D.28257;
  mono_mb_emit_ldarg (mb, D.28258);
  i = i + 1;
  <D.21759>:
  D.28199 = sig->param_count;
  D.28200 = (int) D.28199;
  if (D.28200 > i) goto <D.21758>; else goto <D.21760>;
  <D.21760>:
  if (ctx != 0B) goto <D.28259>; else goto <D.28260>;
  <D.28259>:
  D.28261 = &container->context;
  D.28262 = mono_class_inflate_generic_method (method, D.28261);
  mono_mb_emit_managed_call (mb, D.28262, 0B);
  goto <D.28263>;
  <D.28260>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.28263>:
  D.28182 = sig->ret;
  D.28264 = mono_type_is_void (D.28182);
  if (D.28264 == 0) goto <D.28265>; else goto <D.28266>;
  <D.28265>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_stloc (mb, ret_local.347);
  <D.28266>:
  D.28267 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.28267;
  D.28268 = mono_mb_get_pos (mb);
  D.28269 = (unsigned int) D.28268;
  D.28270 = clause->try_offset;
  D.28271 = D.28269 - D.28270;
  clause->try_len = D.28271;
  D.28272 = mono_mb_get_label (mb);
  D.28273 = (unsigned int) D.28272;
  clause->handler_offset = D.28273;
  this_local.354 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.354);
  exit_method.351 = exit_method;
  mono_mb_emit_managed_call (mb, exit_method.351, 0B);
  mono_mb_emit_byte (mb, 220);
  D.28274 = mono_mb_get_pos (mb);
  D.28275 = (unsigned int) D.28274;
  D.28276 = clause->handler_offset;
  D.28277 = D.28275 - D.28276;
  clause->handler_len = D.28277;
  pos.355 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.355);
  D.28182 = sig->ret;
  D.28279 = mono_type_is_void (D.28182);
  if (D.28279 == 0) goto <D.28280>; else goto <D.28281>;
  <D.28280>:
  ret_local.347 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.347);
  <D.28281>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, clause);
  if (ctx != 0B) goto <D.28282>; else goto <D.28283>;
  <D.28282>:
  {
    struct MonoMethod * def;

    D.28199 = sig->param_count;
    D.28200 = (int) D.28199;
    D.28201 = D.28200 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.28201);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.28284>;
  <D.28283>:
  D.28199 = sig->param_count;
  D.28200 = (int) D.28199;
  D.28201 = D.28200 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.28201);
  <D.28284>:
  mono_mb_free (mb);
  D.28154 = res;
  return D.28154;
}


check_generic_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, void * key, void * def_key)
{
  long unsigned int D.28286;
  long unsigned int D.28287;
  _Bool D.28288;
  long int D.28289;
  long int D.28290;
  struct MonoMethod * D.28295;
  _Bool D.28300;
  long int D.28301;
  long int D.28302;
  _Bool D.28309;
  long int D.28310;
  long int D.28311;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;
  struct MonoGenericContext * ctx;
  struct MonoMethod * def_method;

  D.28286 = BIT_FIELD_REF <*orig_method, 64, 256>;
  D.28287 = D.28286 & 4096;
  D.28288 = D.28287 == 0;
  D.28289 = (long int) D.28288;
  D.28290 = __builtin_expect (D.28289, 0);
  if (D.28290 != 0) goto <D.28291>; else goto <D.28292>;
  <D.28291>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2720, "orig_method->is_inflated");
  <D.28292>:
  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.28293>; else goto <D.28294>;
  <D.28293>:
  D.28295 = res;
  return D.28295;
  <D.28294>:
  def = mono_marshal_find_in_cache (cache, def_key);
  if (def != 0B) goto <D.28296>; else goto <D.28297>;
  <D.28296>:
  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.28298>; else goto <D.28299>;
    <D.28298>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28299>:
    D.28300 = ret != 0;
    D.28301 = (long int) D.28300;
    D.28302 = __builtin_expect (D.28301, 0);
    if (D.28302 != 0) goto <D.28303>; else goto <D.28304>;
    <D.28303>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2739, "ret == 0");
    <D.28304>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.28305>; else goto <D.28306>;
  <D.28305>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.28306>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28307>; else goto <D.28308>;
    <D.28307>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28308>:
    D.28309 = ret != 0;
    D.28310 = (long int) D.28309;
    D.28311 = __builtin_expect (D.28310, 0);
    if (D.28311 != 0) goto <D.28312>; else goto <D.28313>;
    <D.28312>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2745, "ret == 0");
    <D.28313>:
  }
  D.28295 = res;
  return D.28295;
  <D.28297>:
  D.28295 = 0B;
  return D.28295;
}


cache_generic_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx, void * key)
{
  _Bool D.28317;
  long int D.28318;
  long int D.28319;
  _Bool D.28326;
  long int D.28327;
  long int D.28328;
  struct MonoMethod * D.28331;
  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.28315>; else goto <D.28316>;
    <D.28315>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28316>:
    D.28317 = ret != 0;
    D.28318 = (long int) D.28317;
    D.28319 = __builtin_expect (D.28318, 0);
    if (D.28319 != 0) goto <D.28320>; else goto <D.28321>;
    <D.28320>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2761, "ret == 0");
    <D.28321>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.28322>; else goto <D.28323>;
  <D.28322>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.28323>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28324>; else goto <D.28325>;
    <D.28324>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28325>:
    D.28326 = ret != 0;
    D.28327 = (long int) D.28326;
    D.28328 = __builtin_expect (D.28327, 0);
    if (D.28328 != 0) goto <D.28329>; else goto <D.28330>;
    <D.28329>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2767, "ret == 0");
    <D.28330>:
  }
  D.28331 = res;
  return D.28331;
}


mono_marshal_get_unbox_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.28333;
  struct MonoImage * D.28334;
  struct GHashTable * * D.28335;
  struct MonoMethod * D.28338;
  const char * D.28339;
  long unsigned int D.28340;
  long unsigned int D.28341;
  _Bool D.28342;
  long int D.28343;
  long int D.28344;
  int D.28347;
  unsigned int D.28348;
  short unsigned int D.28349;
  int D.28350;
  int D.28351;
  struct MonoMethodSignature * sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;

  sig = mono_method_signature (method);
  D.28333 = method->klass;
  D.28334 = D.28333->image;
  D.28335 = &D.28334->unbox_wrapper_cache;
  cache = get_cache (D.28335, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28336>; else goto <D.28337>;
  <D.28336>:
  D.28338 = res;
  return D.28338;
  <D.28337>:
  D.28333 = method->klass;
  D.28339 = method->name;
  mb = mono_mb_new (D.28333, D.28339, 22);
  D.28340 = BIT_FIELD_REF <*sig, 64, 64>;
  D.28341 = D.28340 & 18014398509481984;
  D.28342 = D.28341 == 0;
  D.28343 = (long int) D.28342;
  D.28344 = __builtin_expect (D.28343, 0);
  if (D.28344 != 0) goto <D.28345>; else goto <D.28346>;
  <D.28345>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10576, "sig->hasthis");
  <D.28346>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  i = 0;
  goto <D.21771>;
  <D.21770>:
  D.28347 = i + 1;
  D.28348 = (unsigned int) D.28347;
  mono_mb_emit_ldarg (mb, D.28348);
  i = i + 1;
  <D.21771>:
  D.28349 = sig->param_count;
  D.28350 = (int) D.28349;
  if (D.28350 > i) goto <D.21770>; else goto <D.21772>;
  <D.21772>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  D.28349 = sig->param_count;
  D.28350 = (int) D.28349;
  D.28351 = D.28350 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.28351);
  mono_mb_free (mb);
  D.28338 = res;
  return D.28338;
}


mono_marshal_get_virtual_stelemref (struct MonoClass * array_class)
{
  unsigned char D.28353;
  _Bool D.28354;
  long int D.28355;
  long int D.28356;
  struct MonoClass * D.28359;
  struct MonoMethod * D.28360;
  int kind;

  D.28353 = array_class->rank;
  D.28354 = D.28353 != 1;
  D.28355 = (long int) D.28354;
  D.28356 = __builtin_expect (D.28355, 0);
  if (D.28356 != 0) goto <D.28357>; else goto <D.28358>;
  <D.28357>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11083, "array_class->rank == 1");
  <D.28358>:
  D.28359 = array_class->element_class;
  kind = get_virtual_stelemref_kind (D.28359);
  D.28360 = get_virtual_stelemref_wrapper (kind);
  return D.28360;
}


get_virtual_stelemref_kind (struct MonoClass * element_class)
{
  struct MonoClass * D.28362;
  int D.28365;
  int D.28366;
  unsigned int D.28371;
  unsigned int D.28372;
  unsigned char D.28374;
  int D.28376;
  long unsigned int D.28381;
  long unsigned int D.28382;
  unsigned char D.28384;
  int D.28386;
  unsigned int D.28387;

  D.28362 = mono_defaults.object_class;
  if (D.28362 == element_class) goto <D.28363>; else goto <D.28364>;
  <D.28363>:
  D.28365 = 0;
  return D.28365;
  <D.28364>:
  D.28366 = is_monomorphic_array (element_class);
  if (D.28366 != 0) goto <D.28367>; else goto <D.28368>;
  <D.28367>:
  D.28365 = 1;
  return D.28365;
  <D.28368>:
  D.28371 = element_class->flags;
  D.28372 = D.28371 & 32;
  if (D.28372 != 0) goto <D.28369>; else goto <D.28373>;
  <D.28373>:
  D.28374 = element_class->byval_arg.type;
  if (D.28374 == 19) goto <D.28369>; else goto <D.28375>;
  <D.28375>:
  D.28374 = element_class->byval_arg.type;
  if (D.28374 == 30) goto <D.28369>; else goto <D.28370>;
  <D.28369>:
  D.28376 = mono_class_has_variant_generic_params (element_class);
  if (D.28376 == 0) goto <D.28377>; else goto <D.28378>;
  <D.28377>:
  D.28365 = 3;
  return D.28365;
  <D.28378>:
  <D.28370>:
  D.28381 = BIT_FIELD_REF <*element_class, 64, 256>;
  D.28382 = D.28381 & 4194304;
  if (D.28382 != 0) goto <D.28379>; else goto <D.28383>;
  <D.28383>:
  D.28384 = element_class->rank;
  if (D.28384 != 0) goto <D.28379>; else goto <D.28385>;
  <D.28385>:
  D.28386 = mono_class_has_variant_generic_params (element_class);
  if (D.28386 != 0) goto <D.28379>; else goto <D.28380>;
  <D.28379>:
  D.28365 = 4;
  return D.28365;
  <D.28380>:
  D.28371 = element_class->flags;
  D.28387 = D.28371 & 256;
  if (D.28387 != 0) goto <D.28388>; else goto <D.28389>;
  <D.28388>:
  D.28365 = 1;
  return D.28365;
  <D.28389>:
  D.28365 = 2;
  return D.28365;
}


is_monomorphic_array (struct MonoClass * klass)
{
  unsigned char D.28391;
  gboolean D.28394;
  int iftmp.356;
  unsigned int D.28399;
  unsigned int D.28400;
  long unsigned int D.28402;
  long unsigned int D.28403;
  struct MonoClass * element_class;

  D.28391 = klass->rank;
  if (D.28391 != 1) goto <D.28392>; else goto <D.28393>;
  <D.28392>:
  D.28394 = 0;
  return D.28394;
  <D.28393>:
  element_class = klass->element_class;
  D.28399 = element_class->flags;
  D.28400 = D.28399 & 256;
  if (D.28400 != 0) goto <D.28396>; else goto <D.28401>;
  <D.28401>:
  D.28402 = BIT_FIELD_REF <*element_class, 64, 256>;
  D.28403 = D.28402 & 8;
  if (D.28403 != 0) goto <D.28396>; else goto <D.28397>;
  <D.28396>:
  iftmp.356 = 1;
  goto <D.28398>;
  <D.28397>:
  iftmp.356 = 0;
  <D.28398>:
  D.28394 = iftmp.356;
  return D.28394;
}


get_virtual_stelemref_wrapper (int kind)
{
  struct MonoMethod * D.28405;
  struct MonoMethod * D.28408;
  const char * D.28409;
  struct MonoClass * D.28410;
  struct MonoMethodSignature * signature.357;
  struct MonoImage * D.28414;
  struct MonoClass * D.28415;
  struct MonoType * D.28416;
  struct MonoClass * D.28417;
  struct MonoType * D.28418;
  struct MonoType * D.28419;
  struct MonoType * D.28420;
  unsigned int array_slot_addr.358;
  unsigned int aklass.359;
  unsigned int vklass.360;
  struct MonoClass * D.28424;
  struct MonoType * D.28425;
  unsigned int vtable.361;
  unsigned int uiid.362;
  struct MonoMethod * D.28428;
  short unsigned int D.28431;
  short unsigned int D.28432;
  _Bool D.28435;
  long int D.28436;
  long int D.28437;
  _Bool D.28444;
  long int D.28445;
  long int D.28446;
  _Bool D.28452;
  long int D.28453;
  long int D.28454;
  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.28405 = cached_methods[kind];
      if (D.28405 != 0B) goto <D.28406>; else goto <D.28407>;
      <D.28406>:
      D.28408 = cached_methods[kind];
      return D.28408;
      <D.28407>:
      D.28409 = strelemref_wrapper_name[kind];
      name = monoeg_g_strdup_printf ("virt_stelemref_%s", D.28409);
      D.28410 = mono_defaults.object_class;
      mb = mono_mb_new (D.28410, name, 21);
      monoeg_g_free (name);
      signature.357 = signature;
      if (signature.357 == 0B) goto <D.28412>; else goto <D.28413>;
      <D.28412>:
      {
        struct MonoMethodSignature * sig;

        D.28414 = mono_defaults.corlib;
        sig = mono_metadata_signature_alloc (D.28414, 2);
        D.28415 = mono_defaults.void_class;
        D.28416 = &D.28415->byval_arg;
        sig->ret = D.28416;
        sig->hasthis = 1;
        D.28417 = mono_defaults.int_class;
        D.28418 = &D.28417->byval_arg;
        sig->params[0] = D.28418;
        D.28410 = mono_defaults.object_class;
        D.28419 = &D.28410->byval_arg;
        sig->params[1] = D.28419;
        signature = sig;
      }
      <D.28413>:
      param_names[0] = "index";
      param_names[1] = "value";
      mono_mb_set_param_names (mb, &param_names);
      switch (kind) <default: <D.21824>, case 0: <D.21818>, case 1: <D.21821>, case 2: <D.21822>, case 3: <D.21823>, case 4: <D.21820>>
      <D.21818>:
      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.21819>;
      <D.21820>:
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      aklass = mono_mb_add_local (mb, D.28418);
      D.28410 = mono_defaults.object_class;
      D.28420 = &D.28410->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.28420);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21819>;
      <D.21821>:
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      aklass = mono_mb_add_local (mb, D.28418);
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      vklass = mono_mb_add_local (mb, D.28418);
      D.28410 = mono_defaults.object_class;
      D.28420 = &D.28410->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.28420);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      b2 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21819>;
      <D.21822>:
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      aklass = mono_mb_add_local (mb, D.28418);
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      vklass = mono_mb_add_local (mb, D.28418);
      D.28410 = mono_defaults.object_class;
      D.28420 = &D.28410->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.28420);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 68);
      vklass.360 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.360);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 24);
      mono_mb_emit_byte (mb, 73);
      mono_mb_emit_icon (mb, 1);
      mono_mb_emit_byte (mb, 89);
      mono_mb_emit_icon (mb, 8);
      mono_mb_emit_byte (mb, 90);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 77);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      b3 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21819>;
      <D.21823>:
      D.28410 = mono_defaults.object_class;
      D.28420 = &D.28410->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.28420);
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      aklass = mono_mb_add_local (mb, D.28418);
      D.28417 = mono_defaults.int_class;
      D.28418 = &D.28417->byval_arg;
      vtable = mono_mb_add_local (mb, D.28418);
      D.28424 = mono_defaults.int32_class;
      D.28425 = &D.28424->byval_arg;
      uiid = mono_mb_add_local (mb, D.28425);
      load_array_element_address (mb);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_ldflda (mb, 0);
      mono_mb_emit_byte (mb, 77);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_stloc (mb, vtable.361);
      aklass.359 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.359);
      mono_mb_emit_ldflda (mb, 90);
      mono_mb_emit_byte (mb, 73);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_stloc (mb, uiid.362);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.361);
      mono_mb_emit_ldflda (mb, 40);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 66);
      vtable.361 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.361);
      mono_mb_emit_ldflda (mb, 32);
      mono_mb_emit_byte (mb, 77);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      mono_mb_emit_icon (mb, 3);
      mono_mb_emit_byte (mb, 100);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 71);
      mono_mb_emit_icon (mb, 1);
      uiid.362 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.362);
      mono_mb_emit_icon (mb, 7);
      mono_mb_emit_byte (mb, 95);
      mono_mb_emit_byte (mb, 98);
      mono_mb_emit_byte (mb, 95);
      b3 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.358 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.358);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.21819>;
      <D.21824>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_ldarg (mb, 2);
      D.28428 = mono_marshal_get_stelemref ();
      mono_mb_emit_managed_call (mb, D.28428, 0B);
      mono_mb_emit_byte (mb, 42);
      if (1 != 0) goto <D.28429>; else goto <D.28430>;
      <D.28429>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11054, "0");
      <D.28430>:
      <D.21819>:
      signature.357 = signature;
      res = mono_mb_create_method (mb, signature.357, 4);
      D.28431 = res->flags;
      D.28432 = D.28431 | 64;
      res->flags = D.28432;
      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.28433>; else goto <D.28434>;
        <D.28433>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.28434>:
        D.28435 = ret != 0;
        D.28436 = (long int) D.28435;
        D.28437 = __builtin_expect (D.28436, 0);
        if (D.28437 != 0) goto <D.28438>; else goto <D.28439>;
        <D.28438>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11065, "ret == 0");
        <D.28439>:
      }
      D.28405 = cached_methods[kind];
      if (D.28405 == 0B) goto <D.28440>; else goto <D.28441>;
      <D.28440>:
      cached_methods[kind] = res;
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28442>; else goto <D.28443>;
        <D.28442>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28443>:
        D.28444 = ret != 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", 11068, "ret == 0");
        <D.28448>:
      }
      goto <D.28449>;
      <D.28441>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28450>; else goto <D.28451>;
        <D.28450>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28451>:
        D.28452 = ret != 0;
        D.28453 = (long int) D.28452;
        D.28454 = __builtin_expect (D.28453, 0);
        if (D.28454 != 0) goto <D.28455>; else goto <D.28456>;
        <D.28455>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11070, "ret == 0");
        <D.28456>:
      }
      mono_free_method (res);
      <D.28449>:
      mono_mb_free (mb);
      D.28408 = cached_methods[kind];
      return D.28408;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


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

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


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

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


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

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


mono_marshal_get_virtual_stelemref_wrappers (int * nwrappers)
{
  long unsigned int D.28462;
  long unsigned int D.28463;
  struct MonoMethod * * D.28464;
  struct MonoMethod * D.28465;
  struct MonoMethod * * D.28466;
  struct MonoMethod * * res;
  int i;

  *nwrappers = 5;
  res = monoeg_malloc0 (40);
  i = 0;
  goto <D.21838>;
  <D.21837>:
  D.28462 = (long unsigned int) i;
  D.28463 = D.28462 * 8;
  D.28464 = res + D.28463;
  D.28465 = get_virtual_stelemref_wrapper (i);
  *D.28464 = D.28465;
  i = i + 1;
  <D.21838>:
  if (i <= 4) goto <D.21837>; else goto <D.21839>;
  <D.21839>:
  D.28466 = res;
  return D.28466;
}


mono_marshal_get_stelemref ()
{
  struct MonoMethod * ret.365;
  struct MonoMethod * D.28471;
  struct MonoClass * D.28472;
  struct MonoImage * D.28473;
  struct MonoClass * D.28474;
  struct MonoType * D.28475;
  struct MonoType * D.28476;
  struct MonoClass * D.28477;
  struct MonoType * D.28478;
  struct MonoType * D.28479;
  unsigned int array_slot_addr.366;
  unsigned int aklass.367;
  unsigned int vklass.368;
  int D.28483;
  int b4.369;
  unsigned int D.28485;
  unsigned int D.28486;
  int D.28487;
  struct MonoMethod * ret.370;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;
  guint32 b1;
  guint32 b2;
  guint32 b3;
  guint32 b4;
  guint32 copy_pos;
  int aklass;
  int vklass;
  int array_slot_addr;

  ret.365 = ret;
  if (ret.365 != 0B) goto <D.28469>; else goto <D.28470>;
  <D.28469>:
  D.28471 = ret;
  return D.28471;
  <D.28470>:
  D.28472 = mono_defaults.object_class;
  mb = mono_mb_new (D.28472, "stelemref", 21);
  D.28473 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28473, 3);
  D.28474 = mono_defaults.void_class;
  D.28475 = &D.28474->byval_arg;
  sig->ret = D.28475;
  D.28472 = mono_defaults.object_class;
  D.28476 = &D.28472->byval_arg;
  sig->params[0] = D.28476;
  D.28477 = mono_defaults.int_class;
  D.28478 = &D.28477->byval_arg;
  sig->params[1] = D.28478;
  D.28472 = mono_defaults.object_class;
  D.28476 = &D.28472->byval_arg;
  sig->params[2] = D.28476;
  D.28477 = mono_defaults.int_class;
  D.28478 = &D.28477->byval_arg;
  aklass = mono_mb_add_local (mb, D.28478);
  D.28477 = mono_defaults.int_class;
  D.28478 = &D.28477->byval_arg;
  vklass = mono_mb_add_local (mb, D.28478);
  D.28472 = mono_defaults.object_class;
  D.28479 = &D.28472->this_arg;
  array_slot_addr = mono_mb_add_local (mb, D.28479);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.28472 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.28472);
  array_slot_addr.366 = (unsigned int) array_slot_addr;
  mono_mb_emit_stloc (mb, array_slot_addr.366);
  mono_mb_emit_ldarg (mb, 2);
  b1 = mono_mb_emit_branch (mb, 57);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.367);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.368);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.368);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  b2 = mono_mb_emit_branch (mb, 68);
  vklass.368 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.368);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_byte (mb, 73);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  b3 = mono_mb_emit_branch (mb, 64);
  D.28483 = mono_mb_get_label (mb);
  copy_pos = (guint32) D.28483;
  mono_mb_patch_branch (mb, b1);
  array_slot_addr.366 = (unsigned int) array_slot_addr;
  mono_mb_emit_ldloc (mb, array_slot_addr.366);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_branch (mb, b2);
  mono_mb_patch_branch (mb, b3);
  mono_mb_emit_ldarg (mb, 2);
  aklass.367 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.367);
  mono_mb_emit_icall (mb, mono_object_isinst);
  b4 = mono_mb_emit_branch (mb, 58);
  b4.369 = (int) b4;
  D.28485 = copy_pos - b4;
  D.28486 = D.28485 + 4294967292;
  D.28487 = (int) D.28486;
  mono_mb_patch_addr (mb, b4.369, D.28487);
  mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
  mono_mb_emit_byte (mb, 42);
  ret.370 = mono_mb_create_method (mb, sig, 4);
  ret = ret.370;
  mono_mb_free (mb);
  ret.365 = ret;
  info = mono_wrapper_info_create (ret.365, 0);
  ret.365 = ret;
  mono_marshal_set_wrapper_info (ret.365, info);
  D.28471 = ret;
  return D.28471;
}


mono_marshal_get_gsharedvt_in_wrapper ()
{
  struct MonoMethod * ret.371;
  struct MonoMethod * D.28493;
  struct MonoClass * D.28494;
  struct MonoImage * D.28495;
  struct MonoClass * D.28496;
  struct MonoType * D.28497;
  struct MonoMethod * ret.372;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.371 = ret;
  if (ret.371 != 0B) goto <D.28491>; else goto <D.28492>;
  <D.28491>:
  D.28493 = ret;
  return D.28493;
  <D.28492>:
  D.28494 = mono_defaults.object_class;
  mb = mono_mb_new (D.28494, "gsharedvt_in", 25);
  D.28495 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28495, 0);
  D.28496 = mono_defaults.void_class;
  D.28497 = &D.28496->byval_arg;
  sig->ret = D.28497;
  mono_mb_emit_byte (mb, 42);
  ret.372 = mono_mb_create_method (mb, sig, 4);
  ret = ret.372;
  mono_mb_free (mb);
  ret.371 = ret;
  info = mono_wrapper_info_create (ret.371, 18);
  ret.371 = ret;
  mono_marshal_set_wrapper_info (ret.371, info);
  D.28493 = ret;
  return D.28493;
}


mono_marshal_get_gsharedvt_out_wrapper ()
{
  struct MonoMethod * ret.373;
  struct MonoMethod * D.28503;
  struct MonoClass * D.28504;
  struct MonoImage * D.28505;
  struct MonoClass * D.28506;
  struct MonoType * D.28507;
  struct MonoMethod * ret.374;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.373 = ret;
  if (ret.373 != 0B) goto <D.28501>; else goto <D.28502>;
  <D.28501>:
  D.28503 = ret;
  return D.28503;
  <D.28502>:
  D.28504 = mono_defaults.object_class;
  mb = mono_mb_new (D.28504, "gsharedvt_out", 25);
  D.28505 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.28505, 0);
  D.28506 = mono_defaults.void_class;
  D.28507 = &D.28506->byval_arg;
  sig->ret = D.28507;
  mono_mb_emit_byte (mb, 42);
  ret.374 = mono_mb_create_method (mb, sig, 4);
  ret = ret.374;
  mono_mb_free (mb);
  ret.373 = ret;
  info = mono_wrapper_info_create (ret.373, 19);
  ret.373 = ret;
  mono_marshal_set_wrapper_info (ret.373, info);
  D.28503 = ret;
  return D.28503;
}


mono_marshal_get_array_address (int rank, int elem_size)
{
  _Bool D.28512;
  long int D.28513;
  long int D.28514;
  struct ArrayElemAddr * elem_addr_cache.375;
  long unsigned int D.28518;
  long unsigned int D.28519;
  struct ArrayElemAddr * D.28520;
  int D.28521;
  int D.28524;
  int elem_addr_cache_next.376;
  _Bool D.28530;
  long int D.28531;
  long int D.28532;
  struct MonoMethod * D.28537;
  long unsigned int D.28538;
  long unsigned int D.28539;
  struct MonoImage * D.28540;
  int D.28541;
  unsigned int D.28542;
  struct MonoClass * D.28543;
  struct MonoType * D.28544;
  struct MonoClass * D.28545;
  struct MonoType * D.28546;
  int D.28547;
  struct MonoClass * D.28548;
  struct MonoType * D.28549;
  unsigned int bounds.377;
  unsigned int ind.378;
  unsigned int D.28552;
  unsigned int D.28553;
  unsigned int D.28554;
  unsigned int D.28555;
  unsigned int D.28556;
  int D.28557;
  unsigned int realidx.379;
  unsigned int i.380;
  unsigned int D.28560;
  int D.28561;
  long unsigned int D.28562;
  int * D.28563;
  unsigned int D.28564;
  int D.28565;
  int D.28566;
  unsigned int D.28567;
  unsigned int branch_pos.381;
  _Bool D.28571;
  long int D.28572;
  long int D.28573;
  int elem_addr_cache_size.382;
  long unsigned int D.28585;
  long unsigned int D.28586;
  long unsigned int D.28587;
  long unsigned int D.28588;
  long unsigned int D.28589;
  long unsigned int D.28590;
  struct ArrayElemAddr * D.28591;
  int elem_addr_cache_next.383;
  unsigned int rank.384;
  unsigned int elem_size.385;
  _Bool D.28597;
  long int D.28598;
  long int D.28599;
  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.28510>; else goto <D.28511>;
    <D.28510>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28511>:
    D.28512 = ret != 0;
    D.28513 = (long int) D.28512;
    D.28514 = __builtin_expect (D.28513, 0);
    if (D.28514 != 0) goto <D.28515>; else goto <D.28516>;
    <D.28515>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11364, "ret == 0");
    <D.28516>:
  }
  i = 0;
  goto <D.21893>;
  <D.21892>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  D.28521 = D.28520->rank;
  if (D.28521 == rank) goto <D.28522>; else goto <D.28523>;
  <D.28522>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  D.28524 = D.28520->elem_size;
  if (D.28524 == elem_size) goto <D.28525>; else goto <D.28526>;
  <D.28525>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  ret = D.28520->method;
  goto <D.21891>;
  <D.28526>:
  <D.28523>:
  i = i + 1;
  <D.21893>:
  elem_addr_cache_next.376 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.376) goto <D.21892>; else goto <D.21891>;
  <D.21891>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28528>; else goto <D.28529>;
    <D.28528>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28529>:
    D.28530 = ret != 0;
    D.28531 = (long int) D.28530;
    D.28532 = __builtin_expect (D.28531, 0);
    if (D.28532 != 0) goto <D.28533>; else goto <D.28534>;
    <D.28533>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11371, "ret == 0");
    <D.28534>:
  }
  if (ret != 0B) goto <D.28535>; else goto <D.28536>;
  <D.28535>:
  D.28537 = ret;
  return D.28537;
  <D.28536>:
  D.28538 = (long unsigned int) rank;
  D.28539 = D.28538 * 4;
  branch_positions = monoeg_malloc0 (D.28539);
  D.28540 = mono_defaults.corlib;
  D.28541 = rank + 1;
  D.28542 = (unsigned int) D.28541;
  sig = mono_metadata_signature_alloc (D.28540, D.28542);
  D.28543 = mono_defaults.int_class;
  D.28544 = &D.28543->byval_arg;
  sig->ret = D.28544;
  D.28545 = mono_defaults.object_class;
  D.28546 = &D.28545->byval_arg;
  sig->params[0] = D.28546;
  i = 0;
  goto <D.21896>;
  <D.21895>:
  D.28547 = i + 1;
  D.28548 = mono_defaults.int32_class;
  D.28549 = &D.28548->byval_arg;
  sig->params[D.28547] = D.28549;
  i = i + 1;
  <D.21896>:
  if (i < rank) goto <D.21895>; else goto <D.21897>;
  <D.21897>:
  D.28545 = mono_defaults.object_class;
  mb = mono_mb_new (D.28545, "ElementAddr", 7);
  D.28543 = mono_defaults.int_class;
  D.28544 = &D.28543->byval_arg;
  bounds = mono_mb_add_local (mb, D.28544);
  D.28548 = mono_defaults.int32_class;
  D.28549 = &D.28548->byval_arg;
  ind = mono_mb_add_local (mb, D.28549);
  D.28548 = mono_defaults.int32_class;
  D.28549 = &D.28548->byval_arg;
  realidx = mono_mb_add_local (mb, D.28549);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 77);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_stloc (mb, bounds.377);
  mono_mb_emit_ldarg (mb, 1);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.378);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.28552 = mono_mb_emit_branch (mb, 65);
  branch_pos = (int) D.28552;
  i = 1;
  goto <D.21899>;
  <D.21898>:
  D.28547 = i + 1;
  D.28553 = (unsigned int) D.28547;
  mono_mb_emit_ldarg (mb, D.28553);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  D.28518 = (long unsigned int) i;
  D.28554 = (unsigned int) D.28518;
  D.28555 = D.28554 * 8;
  D.28556 = D.28555 + 4;
  D.28557 = (int) D.28556;
  mono_mb_emit_icon (mb, D.28557);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_stloc (mb, realidx.379);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.379);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  i.380 = (unsigned int) i;
  D.28560 = i.380 * 8;
  D.28561 = (int) D.28560;
  mono_mb_emit_icon (mb, D.28561);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.28518 = (long unsigned int) i;
  D.28562 = D.28518 * 4;
  D.28563 = branch_positions + D.28562;
  D.28564 = mono_mb_emit_branch (mb, 65);
  D.28565 = (int) D.28564;
  *D.28563 = D.28565;
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  bounds.377 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.377);
  i.380 = (unsigned int) i;
  D.28560 = i.380 * 8;
  D.28561 = (int) D.28560;
  mono_mb_emit_icon (mb, D.28561);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 90);
  realidx.379 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.379);
  mono_mb_emit_byte (mb, 88);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.378);
  i = i + 1;
  <D.21899>:
  if (i < rank) goto <D.21898>; else goto <D.21900>;
  <D.21900>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 32);
  ind.378 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.378);
  mono_mb_emit_icon (mb, elem_size);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  i = 1;
  goto <D.21902>;
  <D.21901>:
  D.28518 = (long unsigned int) i;
  D.28562 = D.28518 * 4;
  D.28563 = branch_positions + D.28562;
  D.28566 = *D.28563;
  D.28567 = (unsigned int) D.28566;
  mono_mb_patch_branch (mb, D.28567);
  i = i + 1;
  <D.21902>:
  if (i < rank) goto <D.21901>; else goto <D.21903>;
  <D.21903>:
  branch_pos.381 = (unsigned int) branch_pos;
  mono_mb_patch_branch (mb, branch_pos.381);
  mono_mb_emit_exception (mb, "IndexOutOfRangeException", 0B);
  monoeg_g_free (branch_positions);
  ret = mono_mb_create_method (mb, sig, 4);
  mono_mb_free (mb);
  cached = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28569>; else goto <D.28570>;
    <D.28569>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28570>:
    D.28571 = ret != 0;
    D.28572 = (long int) D.28571;
    D.28573 = __builtin_expect (D.28572, 0);
    if (D.28573 != 0) goto <D.28574>; else goto <D.28575>;
    <D.28574>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11475, "ret == 0");
    <D.28575>:
  }
  i = 0;
  goto <D.21907>;
  <D.21906>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  D.28521 = D.28520->rank;
  if (D.28521 == rank) goto <D.28576>; else goto <D.28577>;
  <D.28576>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  D.28524 = D.28520->elem_size;
  if (D.28524 == elem_size) goto <D.28578>; else goto <D.28579>;
  <D.28578>:
  elem_addr_cache.375 = elem_addr_cache;
  D.28518 = (long unsigned int) i;
  D.28519 = D.28518 * 16;
  D.28520 = elem_addr_cache.375 + D.28519;
  ret = D.28520->method;
  cached = 1;
  goto <D.21905>;
  <D.28579>:
  <D.28577>:
  i = i + 1;
  <D.21907>:
  elem_addr_cache_next.376 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.376) goto <D.21906>; else goto <D.21905>;
  <D.21905>:
  if (cached == 0) goto <D.28580>; else goto <D.28581>;
  <D.28580>:
  {
    struct WrapperInfo * info;

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

      elem_addr_cache_size.382 = elem_addr_cache_size;
      new_size = elem_addr_cache_size.382 + 4;
      D.28585 = (long unsigned int) new_size;
      D.28586 = D.28585 * 16;
      new_array = monoeg_malloc0 (D.28586);
      elem_addr_cache.375 = elem_addr_cache;
      elem_addr_cache_size.382 = elem_addr_cache_size;
      D.28587 = (long unsigned int) elem_addr_cache_size.382;
      D.28588 = D.28587 * 16;
      memcpy (new_array, elem_addr_cache.375, D.28588);
      elem_addr_cache.375 = elem_addr_cache;
      monoeg_g_free (elem_addr_cache.375);
      elem_addr_cache = new_array;
      elem_addr_cache_size = new_size;
    }
    <D.28584>:
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28589 = (long unsigned int) elem_addr_cache_next.376;
    D.28590 = D.28589 * 16;
    D.28591 = elem_addr_cache.375 + D.28590;
    D.28591->rank = rank;
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28589 = (long unsigned int) elem_addr_cache_next.376;
    D.28590 = D.28589 * 16;
    D.28591 = elem_addr_cache.375 + D.28590;
    D.28591->elem_size = elem_size;
    elem_addr_cache.375 = elem_addr_cache;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    D.28589 = (long unsigned int) elem_addr_cache_next.376;
    D.28590 = D.28589 * 16;
    D.28591 = elem_addr_cache.375 + D.28590;
    D.28591->method = ret;
    elem_addr_cache_next.376 = elem_addr_cache_next;
    elem_addr_cache_next.383 = elem_addr_cache_next.376 + 1;
    elem_addr_cache_next = elem_addr_cache_next.383;
    info = mono_wrapper_info_create (ret, 1);
    rank.384 = (unsigned int) rank;
    info->d.element_addr.rank = rank.384;
    elem_size.385 = (unsigned int) elem_size;
    info->d.element_addr.elem_size = elem_size.385;
    mono_marshal_set_wrapper_info (ret, info);
  }
  <D.28581>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28595>; else goto <D.28596>;
    <D.28595>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28596>:
    D.28597 = ret != 0;
    D.28598 = (long int) D.28597;
    D.28599 = __builtin_expect (D.28598, 0);
    if (D.28599 != 0) goto <D.28600>; else goto <D.28601>;
    <D.28600>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11505, "ret == 0");
    <D.28601>:
  }
  D.28537 = ret;
  return D.28537;
}


mono_marshal_get_array_accessor_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.28605;
  struct MonoImage * D.28606;
  struct GHashTable * * D.28607;
  struct MonoMethod * D.28610;
  struct MonoMethodSignature * D.28611;
  const char * D.28612;
  long unsigned int D.28613;
  long unsigned int D.28614;
  _Bool D.28617;
  int D.28618;
  int D.28619;
  unsigned int D.28620;
  short unsigned int D.28621;
  int D.28622;
  struct MonoGenericContext * D.28625;
  struct MonoMethod * D.28626;
  int D.28630;
  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.28603>; else goto <D.28604>;
  <D.28603>:
  cache = 0B;
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11537);
  <D.28604>:
  D.28605 = method->klass;
  D.28606 = D.28605->image;
  D.28607 = &D.28606->array_accessor_cache;
  cache = get_cache (D.28607, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28608>; else goto <D.28609>;
  <D.28608>:
  D.28610 = res;
  return D.28610;
  <D.28609>:
  D.28605 = method->klass;
  D.28606 = D.28605->image;
  D.28611 = mono_method_signature (method);
  sig = signature_dup (D.28606, D.28611);
  sig->pinvoke = 0;
  D.28605 = method->klass;
  D.28612 = method->name;
  mb = mono_mb_new (D.28605, D.28612, 25);
  D.28613 = BIT_FIELD_REF <*sig, 64, 64>;
  D.28614 = D.28613 & 18014398509481984;
  if (D.28614 != 0) goto <D.28615>; else goto <D.28616>;
  <D.28615>:
  mono_mb_emit_ldarg (mb, 0);
  <D.28616>:
  i = 0;
  goto <D.21925>;
  <D.21924>:
  D.28613 = BIT_FIELD_REF <*sig, 64, 64>;
  D.28614 = D.28613 & 18014398509481984;
  D.28617 = D.28614 != 0;
  D.28618 = (int) D.28617;
  D.28619 = D.28618 + i;
  D.28620 = (unsigned int) D.28619;
  mono_mb_emit_ldarg (mb, D.28620);
  i = i + 1;
  <D.21925>:
  D.28621 = sig->param_count;
  D.28622 = (int) D.28621;
  if (D.28622 > i) goto <D.21924>; else goto <D.21926>;
  <D.21926>:
  if (ctx != 0B) goto <D.28623>; else goto <D.28624>;
  <D.28623>:
  D.28625 = &container->context;
  D.28626 = mono_class_inflate_generic_method (method, D.28625);
  mono_mb_emit_managed_call (mb, D.28626, 0B);
  goto <D.28627>;
  <D.28624>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.28627>:
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.28628>; else goto <D.28629>;
  <D.28628>:
  {
    struct MonoMethod * def;

    D.28621 = sig->param_count;
    D.28622 = (int) D.28621;
    D.28630 = D.28622 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.28630);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.28631>;
  <D.28629>:
  D.28621 = sig->param_count;
  D.28622 = (int) D.28621;
  D.28630 = D.28622 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.28630);
  info = mono_wrapper_info_create (res, 20);
  info->d.array_accessor.method = method;
  mono_marshal_set_wrapper_info (res, info);
  <D.28631>:
  mono_mb_free (mb);
  D.28610 = res;
  return D.28610;
}


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

  res = monoeg_try_malloc (size);
  if (res == 0B) goto <D.28633>; else goto <D.28634>;
  <D.28633>:
  mono_gc_out_of_memory (size);
  <D.28634>:
  D.28635 = res;
  return D.28635;
}


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


mono_marshal_free_array (void * * ptr, int size)
{
  long unsigned int D.28639;
  long unsigned int D.28640;
  void * * D.28641;
  void * D.28642;
  int i;

  if (ptr == 0B) goto <D.28637>; else goto <D.28638>;
  <D.28637>:
  return;
  <D.28638>:
  i = 0;
  goto <D.21941>;
  <D.21940>:
  D.28639 = (long unsigned int) i;
  D.28640 = D.28639 * 8;
  D.28641 = ptr + D.28640;
  D.28642 = *D.28641;
  if (D.28642 != 0B) goto <D.28643>; else goto <D.28644>;
  <D.28643>:
  D.28639 = (long unsigned int) i;
  D.28640 = D.28639 * 8;
  D.28641 = ptr + D.28640;
  D.28642 = *D.28641;
  monoeg_g_free (D.28642);
  <D.28644>:
  i = i + 1;
  <D.21941>:
  if (i < size) goto <D.21940>; else goto <D.21942>;
  <D.21942>:
}


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

  if (s != 0B) goto <D.28648>; else goto <D.28649>;
  <D.28648>:
  iftmp.386 = mono_string_chars (s);
  goto <D.28650>;
  <D.28649>:
  iftmp.386 = 0B;
  <D.28650>:
  D.28646 = iftmp.386;
  return D.28646;
}


mono_marshal_set_last_error ()
{
  unsigned int last_error_tls_id.387;
  int * D.28653;
  int D.28654;
  long int D.28655;
  void * D.28656;

  last_error_tls_id.387 = last_error_tls_id;
  D.28653 = __errno_location ();
  D.28654 = *D.28653;
  D.28655 = (long int) D.28654;
  D.28656 = (void *) D.28655;
  mono_native_tls_set_value (last_error_tls_id.387, D.28656);
}


mono_native_tls_set_value (pthread_key_t key, void * value)
{
  int D.28657;
  int D.28658;
  _Bool D.28659;

  D.28658 = pthread_setspecific (key, value);
  D.28659 = D.28658 == 0;
  D.28657 = (int) D.28659;
  return D.28657;
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (struct MonoArray * src, gint32 start_index, void * dest, gint32 length)
{
  _Bool D.28661;
  long int D.28662;
  long int D.28663;
  _Bool D.28668;
  long int D.28669;
  long int D.28670;
  struct MonoVTable * D.28675;
  struct MonoClass * D.28676;
  unsigned char D.28677;
  struct MonoException * D.28680;
  struct MonoException * D.28683;
  struct MonoException * D.28686;
  int D.28687;
  long unsigned int D.28688;
  long unsigned int D.28689;
  struct MonoException * D.28692;
  double[0:] * D.28693;
  int D.28694;
  sizetype D.28695;
  int D.28696;
  long unsigned int D.28697;
  int element_size;
  void * source_addr;

  D.28661 = src == 0B;
  D.28662 = (long int) D.28661;
  D.28663 = __builtin_expect (D.28662, 0);
  if (D.28663 != 0) goto <D.28664>; else goto <D.28665>;
  <D.28664>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28666>; else goto <D.28667>;
    <D.28666>:
    <D.28667>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28665>:
  D.28668 = dest == 0B;
  D.28669 = (long int) D.28668;
  D.28670 = __builtin_expect (D.28669, 0);
  if (D.28670 != 0) goto <D.28671>; else goto <D.28672>;
  <D.28671>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.28673>; else goto <D.28674>;
    <D.28673>:
    <D.28674>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.28672>:
  D.28675 = src->obj.vtable;
  D.28676 = D.28675->klass;
  D.28677 = D.28676->rank;
  if (D.28677 != 1) goto <D.28678>; else goto <D.28679>;
  <D.28678>:
  D.28680 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.28680);
  <D.28679>:
  if (start_index < 0) goto <D.28681>; else goto <D.28682>;
  <D.28681>:
  D.28683 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.28683);
  <D.28682>:
  if (length < 0) goto <D.28684>; else goto <D.28685>;
  <D.28684>:
  D.28686 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.28686);
  <D.28685>:
  D.28687 = start_index + length;
  D.28688 = (long unsigned int) D.28687;
  D.28689 = mono_array_length (src);
  if (D.28688 > D.28689) goto <D.28690>; else goto <D.28691>;
  <D.28690>:
  D.28692 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.28692);
  <D.28691>:
  D.28675 = src->obj.vtable;
  D.28676 = D.28675->klass;
  element_size = mono_array_element_size (D.28676);
  D.28693 = &src->vector;
  D.28694 = element_size * start_index;
  D.28695 = (sizetype) D.28694;
  source_addr = D.28693 + D.28695;
  D.28696 = length * element_size;
  D.28697 = (long unsigned int) D.28696;
  memcpy (dest, source_addr, D.28697);
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (void * src, gint32 start_index, struct MonoArray * dest, gint32 length)
{
  _Bool D.28698;
  long int D.28699;
  long int D.28700;
  _Bool D.28705;
  long int D.28706;
  long int D.28707;
  struct MonoVTable * D.28712;
  struct MonoClass * D.28713;
  unsigned char D.28714;
  struct MonoException * D.28717;
  struct MonoException * D.28720;
  struct MonoException * D.28723;
  int D.28724;
  long unsigned int D.28725;
  long unsigned int D.28726;
  struct MonoException * D.28729;
  double[0:] * D.28730;
  int D.28731;
  sizetype D.28732;
  int D.28733;
  long unsigned int D.28734;
  int element_size;
  void * dest_addr;

  D.28698 = src == 0B;
  D.28699 = (long int) D.28698;
  D.28700 = __builtin_expect (D.28699, 0);
  if (D.28700 != 0) goto <D.28701>; else goto <D.28702>;
  <D.28701>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28703>; else goto <D.28704>;
    <D.28703>:
    <D.28704>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28702>:
  D.28705 = dest == 0B;
  D.28706 = (long int) D.28705;
  D.28707 = __builtin_expect (D.28706, 0);
  if (D.28707 != 0) goto <D.28708>; else goto <D.28709>;
  <D.28708>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.28710>; else goto <D.28711>;
    <D.28710>:
    <D.28711>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.28709>:
  D.28712 = dest->obj.vtable;
  D.28713 = D.28712->klass;
  D.28714 = D.28713->rank;
  if (D.28714 != 1) goto <D.28715>; else goto <D.28716>;
  <D.28715>:
  D.28717 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.28717);
  <D.28716>:
  if (start_index < 0) goto <D.28718>; else goto <D.28719>;
  <D.28718>:
  D.28720 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.28720);
  <D.28719>:
  if (length < 0) goto <D.28721>; else goto <D.28722>;
  <D.28721>:
  D.28723 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.28723);
  <D.28722>:
  D.28724 = start_index + length;
  D.28725 = (long unsigned int) D.28724;
  D.28726 = mono_array_length (dest);
  if (D.28725 > D.28726) goto <D.28727>; else goto <D.28728>;
  <D.28727>:
  D.28729 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.28729);
  <D.28728>:
  D.28712 = dest->obj.vtable;
  D.28713 = D.28712->klass;
  element_size = mono_array_element_size (D.28713);
  D.28730 = &dest->vector;
  D.28731 = element_size * start_index;
  D.28732 = (sizetype) D.28731;
  dest_addr = D.28730 + D.28732;
  D.28733 = length * element_size;
  D.28734 = (long unsigned int) D.28733;
  memcpy (dest_addr, src, D.28734);
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char * ptr)
{
  struct MonoString * D.28737;
  struct MonoDomain * D.28738;

  if (ptr == 0B) goto <D.28735>; else goto <D.28736>;
  <D.28735>:
  D.28737 = 0B;
  return D.28737;
  <D.28736>:
  D.28738 = mono_domain_get ();
  D.28737 = mono_string_new (D.28738, ptr);
  return D.28737;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char * ptr, gint32 len)
{
  struct MonoException * D.28742;
  struct MonoString * D.28743;
  struct MonoDomain * D.28744;
  unsigned int len.388;

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


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

  domain = mono_domain_get ();
  len = 0;
  t = ptr;
  if (ptr == 0B) goto <D.28747>; else goto <D.28748>;
  <D.28747>:
  D.28749 = 0B;
  return D.28749;
  <D.28748>:
  goto <D.21990>;
  <D.21989>:
  len = len + 1;
  <D.21990>:
  t.389 = t;
  t = t.389 + 2;
  D.28751 = *t.389;
  if (D.28751 != 0) goto <D.21989>; else goto <D.21991>;
  <D.21991>:
  D.28749 = mono_string_new_utf16 (domain, ptr, len);
  return D.28749;
}


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

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


ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error ()
{
  guint32 D.28758;
  unsigned int last_error_tls_id.390;
  void * D.28760;
  long int D.28761;

  last_error_tls_id.390 = last_error_tls_id;
  D.28760 = pthread_getspecific (last_error_tls_id.390);
  D.28761 = (long int) D.28760;
  D.28758 = (guint32) D.28761;
  return D.28758;
}


ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (struct MonoReflectionType * rtype)
{
  _Bool D.28763;
  long int D.28764;
  long int D.28765;
  int D.28770;
  struct MonoException * D.28773;
  unsigned int D.28774;
  const char * D.28777;
  guint32 D.28778;
  int D.28779;
  struct MonoClass * klass;
  struct MonoType * type;
  guint32 layout;

  D.28763 = rtype == 0B;
  D.28764 = (long int) D.28763;
  D.28765 = __builtin_expect (D.28764, 0);
  if (D.28765 != 0) goto <D.28766>; else goto <D.28767>;
  <D.28766>:
  {
    struct MonoException * ex;

    if (rtype != 0B) goto <D.28768>; else goto <D.28769>;
    <D.28768>:
    <D.28769>:
    ex = mono_get_exception_argument_null ("rtype");
    mono_raise_exception (ex);
  }
  <D.28767>:
  type = rtype->type;
  klass = mono_class_from_mono_type (type);
  D.28770 = mono_class_init (klass);
  if (D.28770 == 0) goto <D.28771>; else goto <D.28772>;
  <D.28771>:
  D.28773 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28773);
  <D.28772>:
  D.28774 = klass->flags;
  layout = D.28774 & 24;
  if (layout == 0) goto <D.28775>; else goto <D.28776>;
  <D.28775>:
  {
    gchar * msg;
    struct MonoException * exc;

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


ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (struct MonoObject * obj, void * dst, MonoBoolean delete_old)
{
  _Bool D.28781;
  long int D.28782;
  long int D.28783;
  void * dst.391;
  _Bool D.28789;
  long int D.28790;
  long int D.28791;
  struct MonoVTable * D.28796;
  struct MonoClass * D.28797;
  struct MonoMethod * method;
  void * pa[3];

  try
    {
      D.28781 = obj == 0B;
      D.28782 = (long int) D.28781;
      D.28783 = __builtin_expect (D.28782, 0);
      if (D.28783 != 0) goto <D.28784>; else goto <D.28785>;
      <D.28784>:
      {
        struct MonoException * ex;

        if (obj != 0B) goto <D.28786>; else goto <D.28787>;
        <D.28786>:
        <D.28787>:
        ex = mono_get_exception_argument_null ("obj");
        mono_raise_exception (ex);
      }
      <D.28785>:
      dst.391 = dst;
      D.28789 = dst.391 == 0B;
      D.28790 = (long int) D.28789;
      D.28791 = __builtin_expect (D.28790, 0);
      if (D.28791 != 0) goto <D.28792>; else goto <D.28793>;
      <D.28792>:
      {
        struct MonoException * ex;

        dst.391 = dst;
        if (dst.391 != 0B) goto <D.28794>; else goto <D.28795>;
        <D.28794>:
        <D.28795>:
        ex = mono_get_exception_argument_null ("dst");
        mono_raise_exception (ex);
      }
      <D.28793>:
      D.28796 = obj->vtable;
      D.28797 = D.28796->klass;
      method = mono_marshal_get_struct_to_ptr (D.28797);
      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.28798;
  long int D.28799;
  long int D.28800;
  _Bool D.28805;
  long int D.28806;
  long int D.28807;
  struct MonoVTable * D.28812;
  struct MonoClass * D.28813;
  struct MonoType * D.28814;
  unsigned char D.28815;
  struct MonoType * t;

  D.28798 = src == 0B;
  D.28799 = (long int) D.28798;
  D.28800 = __builtin_expect (D.28799, 0);
  if (D.28800 != 0) goto <D.28801>; else goto <D.28802>;
  <D.28801>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28803>; else goto <D.28804>;
    <D.28803>:
    <D.28804>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28802>:
  D.28805 = dst == 0B;
  D.28806 = (long int) D.28805;
  D.28807 = __builtin_expect (D.28806, 0);
  if (D.28807 != 0) goto <D.28808>; else goto <D.28809>;
  <D.28808>:
  {
    struct MonoException * ex;

    if (dst != 0B) goto <D.28810>; else goto <D.28811>;
    <D.28810>:
    <D.28811>:
    ex = mono_get_exception_argument_null ("dst");
    mono_raise_exception (ex);
  }
  <D.28809>:
  D.28812 = dst->vtable;
  D.28813 = D.28812->klass;
  D.28814 = mono_class_get_type (D.28813);
  t = mono_type_get_underlying_type (D.28814);
  D.28815 = t->type;
  if (D.28815 == 17) goto <D.28816>; else goto <D.28817>;
  <D.28816>:
  {
    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.28817>:
  ptr_to_structure (src, dst);
}


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

  try
    {
      D.28819 = dst->vtable;
      D.28820 = D.28819->klass;
      method = mono_marshal_get_ptr_to_struct (D.28820);
      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.28823;
  _Bool D.28824;
  long int D.28825;
  long int D.28826;
  struct MonoType * D.28831;
  int D.28832;
  struct MonoException * D.28835;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoObject * res;

  domain = mono_domain_get ();
  if (src == 0B) goto <D.28821>; else goto <D.28822>;
  <D.28821>:
  D.28823 = 0B;
  return D.28823;
  <D.28822>:
  D.28824 = type == 0B;
  D.28825 = (long int) D.28824;
  D.28826 = __builtin_expect (D.28825, 0);
  if (D.28826 != 0) goto <D.28827>; else goto <D.28828>;
  <D.28827>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28829>; else goto <D.28830>;
    <D.28829>:
    <D.28830>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28828>:
  D.28831 = type->type;
  klass = mono_class_from_mono_type (D.28831);
  D.28832 = mono_class_init (klass);
  if (D.28832 == 0) goto <D.28833>; else goto <D.28834>;
  <D.28833>:
  D.28835 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28835);
  <D.28834>:
  res = mono_object_new (domain, klass);
  ptr_to_structure (src, res);
  D.28823 = res;
  return D.28823;
}


ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (struct MonoReflectionType * type, struct MonoString * field_name)
{
  _Bool D.28837;
  long int D.28838;
  long int D.28839;
  _Bool D.28844;
  long int D.28845;
  long int D.28846;
  struct MonoType * D.28851;
  int D.28852;
  struct MonoException * D.28855;
  struct MonoType * D.28856;
  short unsigned int D.28857;
  int D.28858;
  int D.28859;
  int D.22063;
  const char * D.28862;
  const char * D.28870;
  int D.28871;
  unsigned int D.28872;
  struct MonoMarshalType * info;
  struct MonoClass * klass;
  char * fname;
  int match_index;

  match_index = -1;
  D.28837 = type == 0B;
  D.28838 = (long int) D.28837;
  D.28839 = __builtin_expect (D.28838, 0);
  if (D.28839 != 0) goto <D.28840>; else goto <D.28841>;
  <D.28840>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28842>; else goto <D.28843>;
    <D.28842>:
    <D.28843>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28841>:
  D.28844 = field_name == 0B;
  D.28845 = (long int) D.28844;
  D.28846 = __builtin_expect (D.28845, 0);
  if (D.28846 != 0) goto <D.28847>; else goto <D.28848>;
  <D.28847>:
  {
    struct MonoException * ex;

    if (field_name != 0B) goto <D.28849>; else goto <D.28850>;
    <D.28849>:
    <D.28850>:
    ex = mono_get_exception_argument_null ("field_name");
    mono_raise_exception (ex);
  }
  <D.28848>:
  fname = mono_string_to_utf8 (field_name);
  D.28851 = type->type;
  klass = mono_class_from_mono_type (D.28851);
  D.28852 = mono_class_init (klass);
  if (D.28852 == 0) goto <D.28853>; else goto <D.28854>;
  <D.28853>:
  D.28855 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28855);
  <D.28854>:
  goto <D.22067>;
  <D.22066>:
  {
    struct MonoClassField * field;
    int i;
    void * iter;

    try
      {
        i = 0;
        iter = 0B;
        goto <D.22054>;
        <D.22065>:
        D.28856 = field->type;
        D.28857 = D.28856->attrs;
        D.28858 = (int) D.28857;
        D.28859 = D.28858 & 16;
        if (D.28859 != 0) goto <D.28860>; else goto <D.28861>;
        <D.28860>:
        // predicted unlikely by continue predictor.
        goto <D.22054>;
        <D.28861>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.28862 = mono_field_get_name (field);
          D.22063 = __builtin_strcmp (fname, D.28862);
        }
        if (D.22063 == 0) goto <D.28863>; else goto <D.28864>;
        <D.28863>:
        match_index = i;
        goto <D.22064>;
        <D.28864>:
        i = i + 1;
        <D.22054>:
        field = mono_class_get_fields (klass, &iter);
        if (field != 0B) goto <D.22065>; else goto <D.22064>;
        <D.22064>:
        if (match_index == -1) goto <D.28865>; else goto <D.28866>;
        <D.28865>:
        klass = klass->parent;
        <D.28866>:
      }
    finally
      {
        iter = {CLOBBER};
      }
  }
  <D.22067>:
  if (klass != 0B) goto <D.28867>; else goto <D.22068>;
  <D.28867>:
  if (match_index == -1) goto <D.22066>; else goto <D.22068>;
  <D.22068>:
  monoeg_g_free (fname);
  if (match_index == -1) goto <D.28868>; else goto <D.28869>;
  <D.28868>:
  {
    struct MonoException * exc;
    gchar * tmp;

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (struct MonoString * string)
{
  void * D.28878;
  int D.28879;
  int D.28880;
  int D.28881;
  long unsigned int D.28882;
  mono_unichar2 * D.28883;
  int D.28884;
  int D.28885;
  long unsigned int D.28886;
  int D.28887;
  long unsigned int D.28888;
  long unsigned int D.28889;
  gunichar2 * D.28890;

  if (string == 0B) goto <D.28876>; else goto <D.28877>;
  <D.28876>:
  D.28878 = 0B;
  return D.28878;
  <D.28877>:
  {
    gunichar2 * res;

    D.28879 = mono_string_length (string);
    D.28880 = D.28879 + 1;
    D.28881 = D.28880 * 2;
    D.28882 = (long unsigned int) D.28881;
    res = monoeg_malloc (D.28882);
    D.28883 = mono_string_chars (string);
    D.28884 = mono_string_length (string);
    D.28885 = D.28884 * 2;
    D.28886 = (long unsigned int) D.28885;
    memcpy (res, D.28883, D.28886);
    D.28887 = mono_string_length (string);
    D.28888 = (long unsigned int) D.28887;
    D.28889 = D.28888 * 2;
    D.28890 = res + D.28889;
    *D.28890 = 0;
    D.28878 = res;
    return D.28878;
  }
}


ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (void * src, struct MonoReflectionType * type)
{
  _Bool D.28892;
  long int D.28893;
  long int D.28894;
  _Bool D.28899;
  long int D.28900;
  long int D.28901;
  struct MonoType * D.28906;
  int D.28907;
  struct MonoException * D.28910;
  struct MonoClass * klass;

  D.28892 = src == 0B;
  D.28893 = (long int) D.28892;
  D.28894 = __builtin_expect (D.28893, 0);
  if (D.28894 != 0) goto <D.28895>; else goto <D.28896>;
  <D.28895>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28897>; else goto <D.28898>;
    <D.28897>:
    <D.28898>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28896>:
  D.28899 = type == 0B;
  D.28900 = (long int) D.28899;
  D.28901 = __builtin_expect (D.28900, 0);
  if (D.28901 != 0) goto <D.28902>; else goto <D.28903>;
  <D.28902>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28904>; else goto <D.28905>;
    <D.28904>:
    <D.28905>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28903>:
  D.28906 = type->type;
  klass = mono_class_from_mono_type (D.28906);
  D.28907 = mono_class_init (klass);
  if (D.28907 == 0) goto <D.28908>; else goto <D.28909>;
  <D.28908>:
  D.28910 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28910);
  <D.28909>:
  mono_struct_delete_old (klass, src);
}


ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (int size)
{
  long unsigned int D.28913;
  void * D.28916;
  void * res;

  if (size == 0) goto <D.28911>; else goto <D.28912>;
  <D.28911>:
  size = 4;
  <D.28912>:
  D.28913 = (long unsigned int) size;
  res = monoeg_try_malloc (D.28913);
  if (res == 0B) goto <D.28914>; else goto <D.28915>;
  <D.28914>:
  D.28913 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28913);
  <D.28915>:
  D.28916 = res;
  return D.28916;
}


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

  if (ptr == 0B) goto <D.28918>; else goto <D.28919>;
  <D.28918>:
  D.28920 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28920);
  D.28921 = 0B;
  return D.28921;
  <D.28919>:
  D.28920 = (long unsigned int) size;
  res = monoeg_try_realloc (ptr, D.28920);
  if (res == 0B) goto <D.28922>; else goto <D.28923>;
  <D.28922>:
  D.28920 = (long unsigned int) size;
  mono_gc_out_of_memory (D.28920);
  <D.28923>:
  D.28921 = res;
  return D.28921;
}


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


ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
{
  void * D.28925;
  long unsigned int D.28926;

  D.28926 = (long unsigned int) size;
  D.28925 = monoeg_try_malloc (D.28926);
  return D.28925;
}


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.28928;
  long unsigned int D.28929;

  D.28929 = (long unsigned int) size;
  D.28928 = monoeg_try_realloc (ptr, D.28929);
  return D.28928;
}


ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (struct MonoArray * arrayobj, int index)
{
  void * D.28931;
  double[0:] * D.28932;
  struct MonoVTable * D.28933;
  struct MonoClass * D.28934;
  int D.28935;
  int D.28936;
  sizetype D.28937;

  D.28932 = &arrayobj->vector;
  D.28933 = arrayobj->obj.vtable;
  D.28934 = D.28933->klass;
  D.28935 = mono_array_element_size (D.28934);
  D.28936 = D.28935 * index;
  D.28937 = (sizetype) D.28936;
  D.28931 = D.28932 + D.28937;
  return D.28931;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void * ftn, struct MonoReflectionType * type)
{
  struct MonoType * D.28939;
  int D.28940;
  struct MonoException * D.28943;
  struct MonoDelegate * D.28944;
  struct MonoClass * klass;

  D.28939 = type->type;
  klass = mono_type_get_class (D.28939);
  D.28940 = mono_class_init (klass);
  if (D.28940 == 0) goto <D.28941>; else goto <D.28942>;
  <D.28941>:
  D.28943 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28943);
  <D.28942>:
  D.28944 = mono_ftnptr_to_delegate (klass, ftn);
  return D.28944;
}


mono_marshal_load_type_info (struct MonoClass * klass)
{
  _Bool D.28946;
  long int D.28947;
  long int D.28948;
  struct MonoMarshalType * D.28951;
  struct MonoMarshalType * D.28954;
  long unsigned int D.28955;
  long unsigned int D.28956;
  int D.28961;
  _Bool D.28962;
  long int D.28963;
  long int D.28964;
  unsigned int load_type_info_tls_id.392;
  struct MonoType * D.28968;
  short unsigned int D.28969;
  int D.28970;
  int D.28971;
  int D.28974;
  int D.22165;
  int iftmp.393;
  int D.22164;
  const char[9] * D.28980;
  unsigned char D.28981;
  int D.28982;
  unsigned char D.28983;
  int D.28984;
  const unsigned char * D.28989;
  unsigned char D.28990;
  int D.28991;
  const unsigned char * D.28992;
  unsigned char D.28993;
  int D.28994;
  const unsigned char * D.28999;
  unsigned char D.29000;
  int D.29001;
  const unsigned char * D.29002;
  unsigned char D.29003;
  int D.29004;
  const unsigned char * D.29009;
  unsigned char D.29010;
  int D.29011;
  const unsigned char * D.29012;
  unsigned char D.29013;
  int D.29014;
  const char * D.29016;
  unsigned int D.29019;
  struct MonoImage * D.29020;
  long unsigned int D.29021;
  unsigned int D.29022;
  unsigned int D.29023;
  unsigned int D.29024;
  unsigned int count.394;
  unsigned int D.29026;
  struct MonoClass * D.29027;
  unsigned int native_size.395;
  unsigned int parent_size.396;
  unsigned int native_size.397;
  guint32 iftmp.398;
  long unsigned int D.29034;
  <unnamed-unsigned:4> D.29037;
  int D.22180;
  int iftmp.399;
  int D.22179;
  unsigned char D.29046;
  int D.29047;
  const unsigned char * D.29052;
  unsigned char D.29053;
  int D.29054;
  const unsigned char * D.29059;
  unsigned char D.29060;
  int D.29061;
  const unsigned char * D.29066;
  unsigned char D.29067;
  int D.29068;
  const char * D.29070;
  int D.29073;
  unsigned int D.29076;
  unsigned int D.29077;
  unsigned int D.29078;
  struct MonoMarshalSpec * * D.29079;
  int D.29080;
  int D.29083;
  int D.22189;
  int iftmp.400;
  int D.22188;
  const char[10] * D.29089;
  unsigned char D.29090;
  int D.29091;
  unsigned char D.29092;
  int D.29093;
  const unsigned char * D.29098;
  unsigned char D.29099;
  int D.29100;
  const unsigned char * D.29101;
  unsigned char D.29102;
  int D.29103;
  const unsigned char * D.29108;
  unsigned char D.29109;
  int D.29110;
  const unsigned char * D.29111;
  unsigned char D.29112;
  int D.29113;
  const unsigned char * D.29118;
  unsigned char D.29119;
  int D.29120;
  const unsigned char * D.29121;
  unsigned char D.29122;
  int D.29123;
  const char * D.29125;
  struct MonoMarshalSpec * D.29128;
  <unnamed-unsigned:1> D.29129;
  int D.29130;
  guint32 iftmp.401;
  unsigned int D.29134;
  unsigned int align.402;
  unsigned int D.29137;
  unsigned int D.29138;
  unsigned int D.29139;
  unsigned int D.29140;
  unsigned int D.29141;
  unsigned int D.29142;
  unsigned int size.403;
  unsigned int D.29144;
  int D.29145;
  unsigned int D.29146;
  unsigned int D.29147;
  unsigned int D.29148;
  unsigned int D.29152;
  unsigned int D.29160;
  unsigned int D.29161;
  unsigned int D.29164;
  unsigned int D.29165;
  unsigned int D.29166;
  unsigned int D.29167;
  int D.29168;
  unsigned int D.29169;
  unsigned char D.29172;
  struct MonoClass * D.29175;
  int D.29176;
  _Bool D.29181;
  long int D.29182;
  long int D.29183;
  _Bool D.29190;
  long int D.29191;
  long int D.29192;
  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.28946 = klass == 0B;
      D.28947 = (long int) D.28946;
      D.28948 = __builtin_expect (D.28947, 0);
      if (D.28948 != 0) goto <D.28949>; else goto <D.28950>;
      <D.28949>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12208, "klass != NULL");
      <D.28950>:
      D.28951 = klass->marshal_info;
      if (D.28951 != 0B) goto <D.28952>; else goto <D.28953>;
      <D.28952>:
      D.28954 = klass->marshal_info;
      return D.28954;
      <D.28953>:
      D.28955 = BIT_FIELD_REF <*klass, 64, 256>;
      D.28956 = D.28955 & 1;
      if (D.28956 == 0) goto <D.28957>; else goto <D.28958>;
      <D.28957>:
      mono_class_init (klass);
      <D.28958>:
      D.28951 = klass->marshal_info;
      if (D.28951 != 0B) goto <D.28959>; else goto <D.28960>;
      <D.28959>:
      D.28954 = klass->marshal_info;
      return D.28954;
      <D.28960>:
      D.28961 = mono_marshal_is_loading_type_info (klass);
      D.28962 = D.28961 != 0;
      D.28963 = (long int) D.28962;
      D.28964 = __builtin_expect (D.28963, 0);
      if (D.28964 != 0) goto <D.28965>; else goto <D.28966>;
      <D.28965>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12223, "!mono_marshal_is_loading_type_info (klass)");
      <D.28966>:
      load_type_info_tls_id.392 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.392);
      loads_list = monoeg_g_slist_prepend (loads_list, klass);
      load_type_info_tls_id.392 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.392, loads_list);
      iter = 0B;
      goto <D.22156>;
      <D.22166>:
      D.28968 = field->type;
      D.28969 = D.28968->attrs;
      D.28970 = (int) D.28969;
      D.28971 = D.28970 & 16;
      if (D.28971 != 0) goto <D.28972>; else goto <D.28973>;
      <D.28972>:
      // predicted unlikely by continue predictor.
      goto <D.22156>;
      <D.28973>:
      D.28968 = field->type;
      D.28969 = D.28968->attrs;
      D.28970 = (int) D.28969;
      D.28974 = D.28970 & 1536;
      if (D.28974 != 0) goto <D.28975>; else goto <D.28976>;
      <D.28975>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_field_get_name (field);
          D.28980 = "_Deleted";
          D.28981 = MEM[(const unsigned char *)D.28980];
          D.28982 = (int) D.28981;
          D.28983 = *__s2;
          D.28984 = (int) D.28983;
          __result = D.28982 - D.28984;
          {
            if (__s2_len != 0) goto <D.28985>; else goto <D.28986>;
            <D.28985>:
            if (__result == 0) goto <D.28987>; else goto <D.28988>;
            <D.28987>:
            D.28989 = &MEM[(void *)"_Deleted" + 1B];
            D.28990 = *D.28989;
            D.28991 = (int) D.28990;
            D.28992 = __s2 + 1;
            D.28993 = *D.28992;
            D.28994 = (int) D.28993;
            __result = D.28991 - D.28994;
            if (__s2_len > 1) goto <D.28995>; else goto <D.28996>;
            <D.28995>:
            if (__result == 0) goto <D.28997>; else goto <D.28998>;
            <D.28997>:
            D.28999 = &MEM[(void *)"_Deleted" + 2B];
            D.29000 = *D.28999;
            D.29001 = (int) D.29000;
            D.29002 = __s2 + 2;
            D.29003 = *D.29002;
            D.29004 = (int) D.29003;
            __result = D.29001 - D.29004;
            if (__s2_len > 2) goto <D.29005>; else goto <D.29006>;
            <D.29005>:
            if (__result == 0) goto <D.29007>; else goto <D.29008>;
            <D.29007>:
            D.29009 = &MEM[(void *)"_Deleted" + 3B];
            D.29010 = *D.29009;
            D.29011 = (int) D.29010;
            D.29012 = __s2 + 3;
            D.29013 = *D.29012;
            D.29014 = (int) D.29013;
            __result = D.29011 - D.29014;
            <D.29008>:
            <D.29006>:
            <D.28998>:
            <D.28996>:
            <D.28988>:
            <D.28986>:
          }
          D.22164 = __result;
        }
        iftmp.393 = -D.22164;
        goto <D.29015>;
        <D.28979>:
        D.29016 = mono_field_get_name (field);
        iftmp.393 = __builtin_strcmp (D.29016, "_Deleted");
        <D.29015>:
        D.22165 = iftmp.393;
      }
      if (D.22165 == 0) goto <D.29017>; else goto <D.29018>;
      <D.29017>:
      // predicted unlikely by continue predictor.
      goto <D.22156>;
      <D.29018>:
      <D.28976>:
      count = count + 1;
      <D.22156>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.22166>; else goto <D.22167>;
      <D.22167>:
      D.29019 = klass->flags;
      layout = D.29019 & 24;
      D.29020 = klass->image;
      D.29021 = (long unsigned int) count;
      D.29022 = (unsigned int) D.29021;
      D.29023 = D.29022 * 24;
      D.29024 = D.29023 + 32;
      info = mono_image_alloc0 (D.29020, D.29024);
      count.394 = (unsigned int) count;
      info->num_fields = count.394;
      D.29020 = klass->image;
      D.29026 = klass->type_token;
      mono_metadata_packing_from_typedef (D.29020, D.29026, 0B, &native_size);
      D.29027 = klass->parent;
      if (D.29027 != 0B) goto <D.29028>; else goto <D.29029>;
      <D.29028>:
      {
        int parent_size;

        D.29027 = klass->parent;
        parent_size = mono_class_native_size (D.29027, 0B);
        native_size.395 = native_size;
        parent_size.396 = (unsigned int) parent_size;
        native_size.397 = native_size.395 + parent_size.396;
        native_size = native_size.397;
        parent_size.396 = (unsigned int) parent_size;
        info->native_size = parent_size.396;
      }
      <D.29029>:
      D.28955 = BIT_FIELD_REF <*klass, 64, 256>;
      D.29034 = D.28955 & 983040;
      if (D.29034 != 0) goto <D.29035>; else goto <D.29036>;
      <D.29035>:
      D.29037 = klass->packing_size;
      iftmp.398 = (guint32) D.29037;
      goto <D.29038>;
      <D.29036>:
      iftmp.398 = 8;
      <D.29038>:
      packing = iftmp.398;
      iter = 0B;
      j = 0;
      goto <D.22171>;
      <D.22194>:
      {
        int size;
        guint32 align;

        try
          {
            D.28968 = field->type;
            D.28969 = D.28968->attrs;
            D.28970 = (int) D.28969;
            D.28971 = D.28970 & 16;
            if (D.28971 != 0) goto <D.29039>; else goto <D.29040>;
            <D.29039>:
            // predicted unlikely by continue predictor.
            goto <D.22171>;
            <D.29040>:
            D.28968 = field->type;
            D.28969 = D.28968->attrs;
            D.28970 = (int) D.28969;
            D.28974 = D.28970 & 1536;
            if (D.28974 != 0) goto <D.29041>; else goto <D.29042>;
            <D.29041>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28980 = "_Deleted";
                D.28981 = MEM[(const unsigned char *)D.28980];
                D.28982 = (int) D.28981;
                D.29046 = *__s2;
                D.29047 = (int) D.29046;
                __result = D.28982 - D.29047;
                {
                  if (__s2_len != 0) goto <D.29048>; else goto <D.29049>;
                  <D.29048>:
                  if (__result == 0) goto <D.29050>; else goto <D.29051>;
                  <D.29050>:
                  D.28989 = &MEM[(void *)"_Deleted" + 1B];
                  D.28990 = *D.28989;
                  D.28991 = (int) D.28990;
                  D.29052 = __s2 + 1;
                  D.29053 = *D.29052;
                  D.29054 = (int) D.29053;
                  __result = D.28991 - D.29054;
                  if (__s2_len > 1) goto <D.29055>; else goto <D.29056>;
                  <D.29055>:
                  if (__result == 0) goto <D.29057>; else goto <D.29058>;
                  <D.29057>:
                  D.28999 = &MEM[(void *)"_Deleted" + 2B];
                  D.29000 = *D.28999;
                  D.29001 = (int) D.29000;
                  D.29059 = __s2 + 2;
                  D.29060 = *D.29059;
                  D.29061 = (int) D.29060;
                  __result = D.29001 - D.29061;
                  if (__s2_len > 2) goto <D.29062>; else goto <D.29063>;
                  <D.29062>:
                  if (__result == 0) goto <D.29064>; else goto <D.29065>;
                  <D.29064>:
                  D.29009 = &MEM[(void *)"_Deleted" + 3B];
                  D.29010 = *D.29009;
                  D.29011 = (int) D.29010;
                  D.29066 = __s2 + 3;
                  D.29067 = *D.29066;
                  D.29068 = (int) D.29067;
                  __result = D.29011 - D.29068;
                  <D.29065>:
                  <D.29063>:
                  <D.29058>:
                  <D.29056>:
                  <D.29051>:
                  <D.29049>:
                }
                D.22179 = __result;
              }
              iftmp.399 = -D.22179;
              goto <D.29069>;
              <D.29045>:
              D.29070 = mono_field_get_name (field);
              iftmp.399 = __builtin_strcmp (D.29070, "_Deleted");
              <D.29069>:
              D.22180 = iftmp.399;
            }
            if (D.22180 == 0) goto <D.29071>; else goto <D.29072>;
            <D.29071>:
            // predicted unlikely by continue predictor.
            goto <D.22171>;
            <D.29072>:
            <D.29042>:
            D.28968 = field->type;
            D.28969 = D.28968->attrs;
            D.28970 = (int) D.28969;
            D.29073 = D.28970 & 4096;
            if (D.29073 != 0) goto <D.29074>; else goto <D.29075>;
            <D.29074>:
            D.29020 = klass->image;
            D.29076 = mono_class_get_field_token (field);
            D.29077 = D.29076 & 16777215;
            D.29078 = D.29077 + 4294967295;
            D.29079 = &info->fields[j].mspec;
            mono_metadata_field_info_with_mempool (D.29020, D.29078, 0B, 0B, D.29079);
            <D.29075>:
            info->fields[j].field = field;
            D.29080 = mono_class_num_fields (klass);
            if (D.29080 == 1) goto <D.29081>; else goto <D.29082>;
            <D.29081>:
            D.29083 = klass->instance_size;
            if (D.29083 == 16) goto <D.29084>; else goto <D.29085>;
            <D.29084>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.29089 = "$PRIVATE$";
                D.29090 = MEM[(const unsigned char *)D.29089];
                D.29091 = (int) D.29090;
                D.29092 = *__s2;
                D.29093 = (int) D.29092;
                __result = D.29091 - D.29093;
                {
                  if (__s2_len != 0) goto <D.29094>; else goto <D.29095>;
                  <D.29094>:
                  if (__result == 0) goto <D.29096>; else goto <D.29097>;
                  <D.29096>:
                  D.29098 = &MEM[(void *)"$PRIVATE$" + 1B];
                  D.29099 = *D.29098;
                  D.29100 = (int) D.29099;
                  D.29101 = __s2 + 1;
                  D.29102 = *D.29101;
                  D.29103 = (int) D.29102;
                  __result = D.29100 - D.29103;
                  if (__s2_len > 1) goto <D.29104>; else goto <D.29105>;
                  <D.29104>:
                  if (__result == 0) goto <D.29106>; else goto <D.29107>;
                  <D.29106>:
                  D.29108 = &MEM[(void *)"$PRIVATE$" + 2B];
                  D.29109 = *D.29108;
                  D.29110 = (int) D.29109;
                  D.29111 = __s2 + 2;
                  D.29112 = *D.29111;
                  D.29113 = (int) D.29112;
                  __result = D.29110 - D.29113;
                  if (__s2_len > 2) goto <D.29114>; else goto <D.29115>;
                  <D.29114>:
                  if (__result == 0) goto <D.29116>; else goto <D.29117>;
                  <D.29116>:
                  D.29118 = &MEM[(void *)"$PRIVATE$" + 3B];
                  D.29119 = *D.29118;
                  D.29120 = (int) D.29119;
                  D.29121 = __s2 + 3;
                  D.29122 = *D.29121;
                  D.29123 = (int) D.29122;
                  __result = D.29120 - D.29123;
                  <D.29117>:
                  <D.29115>:
                  <D.29107>:
                  <D.29105>:
                  <D.29097>:
                  <D.29095>:
                }
                D.22188 = __result;
              }
              iftmp.400 = -D.22188;
              goto <D.29124>;
              <D.29088>:
              D.29125 = mono_field_get_name (field);
              iftmp.400 = __builtin_strcmp (D.29125, "$PRIVATE$");
              <D.29124>:
              D.22189 = iftmp.400;
            }
            if (D.22189 == 0) goto <D.29126>; else goto <D.29127>;
            <D.29126>:
            // predicted unlikely by continue predictor.
            goto <D.22171>;
            <D.29127>:
            <D.29085>:
            <D.29082>:
            switch (layout) <default: <D.29149>, case 0: <D.22190>, case 8: <D.22191>, case 16: <D.22193>>
            <D.22190>:
            <D.22191>:
            D.28968 = field->type;
            D.29128 = info->fields[j].mspec;
            D.29129 = klass->unicode;
            D.29130 = (int) D.29129;
            size = mono_marshal_type_size (D.28968, D.29128, &align, 1, D.29130);
            D.28955 = BIT_FIELD_REF <*klass, 64, 256>;
            D.29034 = D.28955 & 983040;
            if (D.29034 != 0) goto <D.29132>; else goto <D.29133>;
            <D.29132>:
            D.29037 = klass->packing_size;
            D.29134 = (unsigned int) D.29037;
            align.402 = align;
            iftmp.401 = MIN_EXPR <D.29134, align.402>;
            goto <D.29136>;
            <D.29133>:
            iftmp.401 = align;
            <D.29136>:
            align = iftmp.401;
            align.402 = align;
            min_align = MAX_EXPR <min_align, align.402>;
            D.29137 = info->native_size;
            info->fields[j].offset = D.29137;
            D.29138 = info->fields[j].offset;
            align.402 = align;
            D.29139 = D.29138 + align.402;
            D.29140 = D.29139 + 4294967295;
            info->fields[j].offset = D.29140;
            D.29138 = info->fields[j].offset;
            align.402 = align;
            D.29141 = -align.402;
            D.29142 = D.29138 & D.29141;
            info->fields[j].offset = D.29142;
            D.29138 = info->fields[j].offset;
            size.403 = (unsigned int) size;
            D.29144 = D.29138 + size.403;
            info->native_size = D.29144;
            goto <D.22192>;
            <D.22193>:
            D.28968 = field->type;
            D.29128 = info->fields[j].mspec;
            D.29129 = klass->unicode;
            D.29130 = (int) D.29129;
            size = mono_marshal_type_size (D.28968, D.29128, &align, 1, D.29130);
            align.402 = align;
            min_align = MAX_EXPR <min_align, align.402>;
            D.29145 = field->offset;
            D.29146 = (unsigned int) D.29145;
            D.29147 = D.29146 + 4294967280;
            info->fields[j].offset = D.29147;
            D.29138 = info->fields[j].offset;
            size.403 = (unsigned int) size;
            D.29144 = D.29138 + size.403;
            D.29137 = info->native_size;
            D.29148 = MAX_EXPR <D.29144, D.29137>;
            info->native_size = D.29148;
            goto <D.22192>;
            <D.29149>:
            <D.22192>:
            j = j + 1;
          }
        finally
          {
            align = {CLOBBER};
          }
      }
      <D.22171>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.22194>; else goto <D.22195>;
      <D.22195>:
      if (layout != 0) goto <D.29150>; else goto <D.29151>;
      <D.29150>:
      D.29137 = info->native_size;
      native_size.395 = native_size;
      D.29152 = MAX_EXPR <D.29137, native_size.395>;
      info->native_size = D.29152;
      if (layout == 16) goto <D.29153>; else goto <D.29154>;
      <D.29153>:
      native_size.395 = native_size;
      if (native_size.395 != 0) goto <D.29157>; else goto <D.29155>;
      <D.29157>:
      D.29137 = info->native_size;
      native_size.395 = native_size;
      if (D.29137 == native_size.395) goto <D.29158>; else goto <D.29155>;
      <D.29158>:
      D.28955 = BIT_FIELD_REF <*klass, 64, 256>;
      D.29034 = D.28955 & 983040;
      if (D.29034 == 0) goto <D.29159>; else goto <D.29155>;
      <D.29159>:
      min_align = 1;
      goto <D.29156>;
      <D.29155>:
      min_align = MIN_EXPR <packing, min_align>;
      <D.29156>:
      <D.29154>:
      <D.29151>:
      D.29137 = info->native_size;
      D.29160 = min_align + 4294967295;
      D.29161 = D.29137 & D.29160;
      if (D.29161 != 0) goto <D.29162>; else goto <D.29163>;
      <D.29162>:
      D.29137 = info->native_size;
      D.29164 = D.29137 + min_align;
      D.29165 = D.29164 + 4294967295;
      info->native_size = D.29165;
      D.29137 = info->native_size;
      D.29166 = -min_align;
      D.29167 = D.29137 & D.29166;
      info->native_size = D.29167;
      <D.29163>:
      info->min_align = min_align;
      D.29137 = info->native_size;
      D.29168 = mono_class_value_size (klass, 0B);
      D.29169 = (unsigned int) D.29168;
      if (D.29137 != D.29169) goto <D.29170>; else goto <D.29171>;
      <D.29170>:
      klass->blittable = 0;
      <D.29171>:
      D.29172 = klass->rank;
      if (D.29172 != 0) goto <D.29173>; else goto <D.29174>;
      <D.29173>:
      D.29175 = klass->element_class;
      D.29176 = mono_marshal_is_loading_type_info (D.29175);
      if (D.29176 == 0) goto <D.29177>; else goto <D.29178>;
      <D.29177>:
      D.29175 = klass->element_class;
      mono_marshal_load_type_info (D.29175);
      <D.29178>:
      <D.29174>:
      load_type_info_tls_id.392 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.392);
      loads_list = monoeg_g_slist_remove (loads_list, klass);
      load_type_info_tls_id.392 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.392, loads_list);
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.29179>; else goto <D.29180>;
        <D.29179>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.29180>:
        D.29181 = ret != 0;
        D.29182 = (long int) D.29181;
        D.29183 = __builtin_expect (D.29182, 0);
        if (D.29183 != 0) goto <D.29184>; else goto <D.29185>;
        <D.29184>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12335, "ret == 0");
        <D.29185>:
      }
      D.28951 = klass->marshal_info;
      if (D.28951 == 0B) goto <D.29186>; else goto <D.29187>;
      <D.29186>:
      mono_memory_barrier ();
      klass->marshal_info = info;
      <D.29187>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.29188>; else goto <D.29189>;
        <D.29188>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.29189>:
        D.29190 = ret != 0;
        D.29191 = (long int) D.29190;
        D.29192 = __builtin_expect (D.29191, 0);
        if (D.29192 != 0) goto <D.29193>; else goto <D.29194>;
        <D.29193>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12341, "ret == 0");
        <D.29194>:
      }
      D.28954 = klass->marshal_info;
      return D.28954;
    }
  finally
    {
      native_size = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_marshal_is_loading_type_info (struct MonoClass * klass)
{
  unsigned int load_type_info_tls_id.404;
  gboolean D.29200;
  struct GSList * D.29201;
  _Bool D.29202;
  struct GSList * loads_list;

  load_type_info_tls_id.404 = load_type_info_tls_id;
  loads_list = pthread_getspecific (load_type_info_tls_id.404);
  D.29201 = monoeg_g_slist_find (loads_list, klass);
  D.29202 = D.29201 != 0B;
  D.29200 = (gboolean) D.29202;
  return D.29200;
}


mono_class_native_size (struct MonoClass * klass, guint32 * align)
{
  struct MonoMarshalType * D.29204;
  int D.29207;
  gint32 D.29212;
  unsigned int D.29215;
  unsigned int D.29216;

  D.29204 = klass->marshal_info;
  if (D.29204 == 0B) goto <D.29205>; else goto <D.29206>;
  <D.29205>:
  D.29207 = mono_marshal_is_loading_type_info (klass);
  if (D.29207 != 0) goto <D.29208>; else goto <D.29209>;
  <D.29208>:
  if (align != 0B) goto <D.29210>; else goto <D.29211>;
  <D.29210>:
  *align = 0;
  <D.29211>:
  D.29212 = 0;
  return D.29212;
  <D.29209>:
  mono_marshal_load_type_info (klass);
  <D.29206>:
  if (align != 0B) goto <D.29213>; else goto <D.29214>;
  <D.29213>:
  D.29204 = klass->marshal_info;
  D.29215 = D.29204->min_align;
  *align = D.29215;
  <D.29214>:
  D.29204 = klass->marshal_info;
  D.29216 = D.29204->native_size;
  D.29212 = (gint32) D.29216;
  return D.29212;
}


mono_type_native_stack_size (struct MonoType * t, guint32 * align)
{
  _Bool D.29218;
  long int D.29219;
  long int D.29220;
  long unsigned int D.29225;
  long unsigned int D.29226;
  int D.29229;
  unsigned char D.29230;
  int D.29231;
  int D.29232;
  long unsigned int D.29235;
  long unsigned int D.29236;
  struct MonoType * D.29239;
  int D.29240;
  unsigned int D.29241;
  unsigned int D.29242;
  unsigned int D.29243;
  guint32 tmp;

  try
    {
      D.29218 = t == 0B;
      D.29219 = (long int) D.29218;
      D.29220 = __builtin_expect (D.29219, 0);
      if (D.29220 != 0) goto <D.29221>; else goto <D.29222>;
      <D.29221>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12389, "t != NULL");
      <D.29222>:
      if (align == 0B) goto <D.29223>; else goto <D.29224>;
      <D.29223>:
      align = &tmp;
      <D.29224>:
      D.29225 = BIT_FIELD_REF <*t, 64, 64>;
      D.29226 = D.29225 & 1073741824;
      if (D.29226 != 0) goto <D.29227>; else goto <D.29228>;
      <D.29227>:
      *align = 8;
      D.29229 = 8;
      return D.29229;
      <D.29228>:
      D.29230 = t->type;
      D.29231 = (int) D.29230;
      switch (D.29231) <default: <D.22239>, case 2: <D.22207>, case 3: <D.22208>, case 4: <D.22209>, case 5: <D.22210>, case 6: <D.22211>, case 7: <D.22212>, case 8: <D.22213>, case 9: <D.22214>, case 10: <D.22229>, case 11: <D.22230>, case 12: <D.22224>, case 13: <D.22225>, case 14: <D.22217>, case 15: <D.22221>, case 17: <D.22236>, case 18: <D.22219>, case 20: <D.22223>, case 21: <D.22234>, case 22: <D.22235>, case 24: <D.22215>, case 25: <D.22216>, case 27: <D.22222>, case 28: <D.22218>, case 29: <D.22220>>
      {
        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.22207>:
        <D.22208>:
        <D.22209>:
        <D.22210>:
        <D.22211>:
        <D.22212>:
        <D.22213>:
        <D.22214>:
        *align = 4;
        D.29229 = 4;
        return D.29229;
        <D.22215>:
        <D.22216>:
        <D.22217>:
        <D.22218>:
        <D.22219>:
        <D.22220>:
        <D.22221>:
        <D.22222>:
        <D.22223>:
        *align = 8;
        D.29229 = 8;
        return D.29229;
        <D.22224>:
        *align = 4;
        D.29229 = 4;
        return D.29229;
        <D.22225>:
        *align = 8;
        D.29229 = 8;
        return D.29229;
        <D.22229>:
        <D.22230>:
        *align = 8;
        D.29229 = 8;
        return D.29229;
        <D.22234>:
        D.29232 = mono_type_generic_inst_is_valuetype (t);
        if (D.29232 == 0) goto <D.29233>; else goto <D.29234>;
        <D.29233>:
        *align = 8;
        D.29229 = 8;
        return D.29229;
        <D.29234>:
        <D.22235>:
        <D.22236>:
        {
          guint32 size;
          struct MonoClass * klass;

          klass = mono_class_from_mono_type (t);
          D.29235 = BIT_FIELD_REF <*klass, 64, 256>;
          D.29236 = D.29235 & 16;
          if (D.29236 != 0) goto <D.29237>; else goto <D.29238>;
          <D.29237>:
          D.29239 = mono_class_enum_basetype (klass);
          D.29229 = mono_type_native_stack_size (D.29239, align);
          return D.29229;
          <D.29238>:
          D.29240 = mono_class_native_size (klass, align);
          size = (guint32) D.29240;
          D.29241 = *align;
          D.29242 = D.29241 + 3;
          *align = D.29242;
          D.29241 = *align;
          D.29243 = D.29241 & 4294967292;
          *align = D.29243;
          size = size + 3;
          size = size & 4294967292;
          D.29229 = (int) size;
          return D.29229;
        }
        <D.22239>:
        D.29230 = t->type;
        D.29231 = (int) D.29230;
        monoeg_g_log (0B, 4, "type 0x%02x unknown", D.29231);
        <D.22240>:
        goto <D.22240>;
      }
      D.29229 = 0;
      return D.29229;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


mono_marshal_type_size (struct MonoType * type, struct MonoMarshalSpec * mspec, guint32 * align, gboolean as_field, gboolean unicode)
{
  gint32 D.29246;
  struct MonoClass * D.29247;
  <unnamed type> D.29252;
  int iftmp.405;
  _Bool D.29259;
  long int D.29260;
  long int D.29261;
  unsigned int esize.406;
  int D.29265;
  struct MonoClass * D.29266;
  struct MonoClass * D.29267;
  int iftmp.407;
  unsigned int esize.408;
  MonoMarshalNative native_type;
  struct MonoClass * klass;

  native_type = mono_type_to_unmanaged (type, mspec, as_field, unicode, 0B);
  switch (native_type) <default: <D.22296>, case 2: <D.22250>, case 3: <D.22251>, case 4: <D.22252>, case 5: <D.22253>, case 6: <D.22254>, case 7: <D.22256>, case 8: <D.22257>, case 9: <D.22259>, case 10: <D.22260>, case 11: <D.22264>, case 12: <D.22265>, case 15: <D.22294>, case 19: <D.22274>, case 20: <D.22271>, case 21: <D.22272>, case 22: <D.22273>, case 23: <D.22289>, case 25: <D.22279>, case 26: <D.22280>, case 27: <D.22288>, case 28: <D.22281>, case 29: <D.22278>, case 30: <D.22291>, case 31: <D.22269>, case 32: <D.22270>, case 34: <D.22295>, case 35: <D.22275>, case 36: <D.22276>, case 37: <D.22255>, case 38: <D.22283>, case 40: <D.22282>, case 42: <D.22277>, case 43: <D.22284>, case 44: <D.22293>, case 45: <D.22258>>
  {
    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.22250>:
    *align = 4;
    D.29246 = 4;
    return D.29246;
    <D.22251>:
    <D.22252>:
    *align = 1;
    D.29246 = 1;
    return D.29246;
    <D.22253>:
    <D.22254>:
    <D.22255>:
    *align = 2;
    D.29246 = 2;
    return D.29246;
    <D.22256>:
    <D.22257>:
    <D.22258>:
    *align = 4;
    D.29246 = 4;
    return D.29246;
    <D.22259>:
    <D.22260>:
    *align = 8;
    D.29246 = 8;
    return D.29246;
    <D.22264>:
    *align = 4;
    D.29246 = 4;
    return D.29246;
    <D.22265>:
    *align = 8;
    D.29246 = 8;
    return D.29246;
    <D.22269>:
    <D.22270>:
    <D.22271>:
    <D.22272>:
    <D.22273>:
    <D.22274>:
    <D.22275>:
    <D.22276>:
    <D.22277>:
    <D.22278>:
    <D.22279>:
    <D.22280>:
    <D.22281>:
    <D.22282>:
    <D.22283>:
    <D.22284>:
    *align = 8;
    D.29246 = 8;
    return D.29246;
    <D.22288>:
    klass = mono_class_from_mono_type (type);
    D.29247 = mono_defaults.object_class;
    if (D.29247 == klass) goto <D.29248>; else goto <D.29249>;
    <D.29248>:
    if (mspec != 0B) goto <D.29250>; else goto <D.29251>;
    <D.29250>:
    D.29252 = mspec->native;
    if (D.29252 == 27) goto <D.29253>; else goto <D.29254>;
    <D.29253>:
    *align = 16;
    D.29246 = 16;
    return D.29246;
    <D.29254>:
    <D.29251>:
    <D.29249>:
    D.29246 = mono_class_native_size (klass, align);
    return D.29246;
    <D.22289>:
    {
      int esize;

      if (unicode != 0) goto <D.29256>; else goto <D.29257>;
      <D.29256>:
      iftmp.405 = 2;
      goto <D.29258>;
      <D.29257>:
      iftmp.405 = 1;
      <D.29258>:
      esize = iftmp.405;
      D.29259 = mspec == 0B;
      D.29260 = (long int) D.29259;
      D.29261 = __builtin_expect (D.29260, 0);
      if (D.29261 != 0) goto <D.29262>; else goto <D.29263>;
      <D.29262>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12524, "mspec");
      <D.29263>:
      esize.406 = (unsigned int) esize;
      *align = esize.406;
      D.29265 = mspec->data.array_data.num_elem;
      D.29246 = D.29265 * esize;
      return D.29246;
    }
    <D.22291>:
    {
      int esize;

      klass = mono_class_from_mono_type (type);
      D.29266 = klass->element_class;
      D.29267 = mono_defaults.char_class;
      if (D.29266 == D.29267) goto <D.29268>; else goto <D.29269>;
      <D.29268>:
      if (unicode != 0) goto <D.29271>; else goto <D.29272>;
      <D.29271>:
      iftmp.407 = 2;
      goto <D.29273>;
      <D.29272>:
      iftmp.407 = 1;
      <D.29273>:
      esize = iftmp.407;
      esize.408 = (unsigned int) esize;
      *align = esize.408;
      goto <D.29275>;
      <D.29269>:
      D.29266 = klass->element_class;
      esize = mono_class_native_size (D.29266, align);
      <D.29275>:
      D.29259 = mspec == 0B;
      D.29260 = (long int) D.29259;
      D.29261 = __builtin_expect (D.29260, 0);
      if (D.29261 != 0) goto <D.29276>; else goto <D.29277>;
      <D.29276>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12538, "mspec");
      <D.29277>:
      D.29265 = mspec->data.array_data.num_elem;
      D.29246 = D.29265 * esize;
      return D.29246;
    }
    <D.22293>:
    *align = 8;
    D.29246 = 8;
    return D.29246;
    <D.22294>:
    <D.22295>:
    <D.22296>:
    monoeg_g_log (0B, 4, "native type %02x not implemented", native_type);
    <D.22297>:
    goto <D.22297>;
  }
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12551);
  D.29246 = 0;
  return D.29246;
}


mono_marshal_asany (struct MonoObject * o, MonoMarshalNative string_encoding, int param_attrs)
{
  void * D.29281;
  struct MonoVTable * D.29282;
  struct MonoClass * D.29283;
  unsigned char D.29284;
  int D.29285;
  unsigned int D.29286;
  unsigned int D.29287;
  long unsigned int D.29291;
  long unsigned int D.29292;
  long unsigned int D.29296;
  int D.29297;
  long unsigned int D.29298;
  void * res.409;
  unsigned int param_attrs.410;
  unsigned int D.29301;
  struct MonoException * D.29305;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.29279>; else goto <D.29280>;
  <D.29279>:
  D.29281 = 0B;
  return D.29281;
  <D.29280>:
  D.29282 = o->vtable;
  D.29283 = D.29282->klass;
  t = &D.29283->byval_arg;
  D.29284 = t->type;
  D.29285 = (int) D.29284;
  switch (D.29285) <default: <D.29304>, case 2: <D.22310>, case 3: <D.22313>, case 4: <D.22308>, case 5: <D.22309>, case 6: <D.22311>, case 7: <D.22312>, case 8: <D.22305>, case 9: <D.22306>, case 10: <D.22314>, case 11: <D.22315>, case 12: <D.22316>, case 13: <D.22317>, case 14: <D.22318>, case 15: <D.22307>, case 17: <D.22324>, case 18: <D.22323>>
  <D.22305>:
  <D.22306>:
  <D.22307>:
  <D.22308>:
  <D.22309>:
  <D.22310>:
  <D.22311>:
  <D.22312>:
  <D.22313>:
  <D.22314>:
  <D.22315>:
  <D.22316>:
  <D.22317>:
  D.29281 = mono_object_unbox (o);
  return D.29281;
  <D.22318>:
  switch (string_encoding) <default: <D.22321>, case 20: <D.22320>, case 21: <D.22319>>
  <D.22319>:
  D.29281 = mono_marshal_string_to_utf16_copy (o);
  return D.29281;
  <D.22320>:
  D.29281 = mono_string_to_lpstr (o);
  return D.29281;
  <D.22321>:
  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.22322>;
  <D.22323>:
  <D.22324>:
  {
    struct MonoMethod * method;
    void * pa[3];
    void * res;
    MonoBoolean delete_old;

    try
      {
        delete_old = 0;
        klass = t->data.klass;
        D.29286 = klass->flags;
        D.29287 = D.29286 & 24;
        if (D.29287 == 0) goto <D.22322>; else goto <D.29288>;
        <D.29288>:
        D.29291 = BIT_FIELD_REF <*klass, 64, 256>;
        D.29292 = D.29291 & 8;
        if (D.29292 != 0) goto <D.29293>; else goto <D.29294>;
        <D.29293>:
        D.29286 = klass->flags;
        D.29287 = D.29286 & 24;
        if (D.29287 == 16) goto <D.29289>; else goto <D.29295>;
        <D.29295>:
        D.29291 = BIT_FIELD_REF <*klass, 64, 256>;
        D.29296 = D.29291 & 48;
        if (D.29296 != 0) goto <D.29289>; else goto <D.29290>;
        <D.29289>:
        D.29281 = mono_object_unbox (o);
        return D.29281;
        <D.29290>:
        <D.29294>:
        D.29297 = mono_class_native_size (klass, 0B);
        D.29298 = (long unsigned int) D.29297;
        res.409 = mono_marshal_alloc (D.29298);
        res = res.409;
        param_attrs.410 = (unsigned int) param_attrs;
        D.29301 = param_attrs.410 & 3;
        if (D.29301 != 2) goto <D.29302>; else goto <D.29303>;
        <D.29302>:
        D.29282 = o->vtable;
        D.29283 = D.29282->klass;
        method = mono_marshal_get_struct_to_ptr (D.29283);
        pa[0] = o;
        pa[1] = &res;
        pa[2] = &delete_old;
        mono_runtime_invoke (method, 0B, &pa, 0B);
        <D.29303>:
        D.29281 = res;
        return D.29281;
      }
    finally
      {
        pa = {CLOBBER};
        res = {CLOBBER};
        delete_old = {CLOBBER};
      }
  }
  <D.29304>:
  <D.22322>:
  D.29305 = mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter.");
  mono_raise_exception (D.29305);
  D.29281 = 0B;
  return D.29281;
}


mono_marshal_free_asany (struct MonoObject * o, void * ptr, MonoMarshalNative string_encoding, int param_attrs)
{
  struct MonoVTable * D.29311;
  struct MonoClass * D.29312;
  unsigned char D.29313;
  int D.29314;
  void * ptr.411;
  long unsigned int D.29316;
  long unsigned int D.29317;
  unsigned int D.29320;
  unsigned int D.29321;
  long unsigned int D.29323;
  int D.29325;
  unsigned int param_attrs.412;
  unsigned int D.29329;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.29309>; else goto <D.29310>;
  <D.29309>:
  return;
  <D.29310>:
  D.29311 = o->vtable;
  D.29312 = D.29311->klass;
  t = &D.29312->byval_arg;
  D.29313 = t->type;
  D.29314 = (int) D.29313;
  switch (D.29314) <default: <D.22347>, case 14: <D.22337>, case 17: <D.22344>, case 18: <D.22343>>
  <D.22337>:
  switch (string_encoding) <default: <D.22341>, case 20: <D.22339>, case 21: <D.22338>>
  <D.22338>:
  <D.22339>:
  ptr.411 = ptr;
  mono_marshal_free (ptr.411);
  goto <D.22340>;
  <D.22341>:
  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.22340>:
  goto <D.22342>;
  <D.22343>:
  <D.22344>:
  klass = t->data.klass;
  D.29316 = BIT_FIELD_REF <*klass, 64, 256>;
  D.29317 = D.29316 & 8;
  if (D.29317 != 0) goto <D.29318>; else goto <D.29319>;
  <D.29318>:
  D.29320 = klass->flags;
  D.29321 = D.29320 & 24;
  if (D.29321 == 16) goto <D.22342>; else goto <D.29322>;
  <D.29322>:
  D.29316 = BIT_FIELD_REF <*klass, 64, 256>;
  D.29323 = D.29316 & 48;
  if (D.29323 != 0) goto <D.22342>; else goto <D.29324>;
  <D.29324>:
  <D.29319>:
  D.29325 = param_attrs & 2;
  if (D.29325 != 0) goto <D.29326>; else goto <D.29327>;
  <D.29326>:
  {
    struct MonoMethod * method;
    void * pa[2];

    try
      {
        D.29311 = o->vtable;
        D.29312 = D.29311->klass;
        method = mono_marshal_get_ptr_to_struct (D.29312);
        pa[0] = &ptr;
        pa[1] = o;
        mono_runtime_invoke (method, 0B, &pa, 0B);
      }
    finally
      {
        pa = {CLOBBER};
      }
  }
  <D.29327>:
  param_attrs.412 = (unsigned int) param_attrs;
  D.29329 = param_attrs.412 & 3;
  if (D.29329 != 2) goto <D.29330>; else goto <D.29331>;
  <D.29330>:
  ptr.411 = ptr;
  mono_struct_delete_old (klass, ptr.411);
  <D.29331>:
  ptr.411 = ptr;
  mono_marshal_free (ptr.411);
  goto <D.22342>;
  <D.22347>:
  goto <D.22342>;
  <D.22342>:
}


mono_marshal_get_generic_array_helper (struct MonoClass * class, struct MonoClass * iface, gchar * name, struct MonoMethod * method)
{
  struct MonoMethod * D.29334;
  struct MonoClass * D.29335;
  struct MonoImage * D.29336;
  int D.29337;
  unsigned int D.29338;
  short unsigned int D.29339;
  int D.29340;
  int D.29341;
  struct MonoMethod * D.29342;
  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.29334 = mb->method;
  D.29334->slot = -1;
  D.29334 = mb->method;
  D.29334->flags = 481;
  sig = mono_method_signature (method);
  D.29335 = method->klass;
  D.29336 = D.29335->image;
  csig = signature_dup (D.29336, sig);
  csig->generic_param_count = 0;
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.22361>;
  <D.22360>:
  D.29337 = i + 1;
  D.29338 = (unsigned int) D.29337;
  mono_mb_emit_ldarg (mb, D.29338);
  i = i + 1;
  <D.22361>:
  D.29339 = csig->param_count;
  D.29340 = (int) D.29339;
  if (D.29340 > i) goto <D.22360>; else goto <D.22362>;
  <D.22362>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  mb->skip_visibility = 1;
  D.29339 = csig->param_count;
  D.29340 = (int) D.29339;
  D.29341 = D.29340 + 16;
  res = mono_mb_create_method (mb, csig, D.29341);
  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.29342 = res;
  return D.29342;
}


mono_win32_compat_CopyMemory (void * dest, const void * source, gsize length)
{
  if (dest == 0B) goto <D.29344>; else goto <D.29346>;
  <D.29346>:
  if (source == 0B) goto <D.29344>; else goto <D.29345>;
  <D.29344>:
  return;
  <D.29345>:
  memcpy (dest, source, length);
}


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

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


mono_win32_compat_MoveMemory (void * dest, const void * source, gsize length)
{
  if (dest == 0B) goto <D.29349>; else goto <D.29351>;
  <D.29351>:
  if (source == 0B) goto <D.29349>; else goto <D.29350>;
  <D.29349>:
  return;
  <D.29350>:
  memmove (dest, source, length);
}


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


mono_marshal_find_nonzero_bit_offset (guint8 * buf, int len, int * byte_offset, guint8 * bitmask)
{
  sizetype D.29353;
  guint8 * D.29354;
  unsigned char D.29355;
  _Bool D.29357;
  long int D.29358;
  long int D.29359;
  int D.29363;
  int D.29364;
  _Bool D.29365;
  long int D.29366;
  long int D.29367;
  int i;
  guint8 byte;

  i = 0;
  goto <D.22392>;
  <D.22391>:
  D.29353 = (sizetype) i;
  D.29354 = buf + D.29353;
  D.29355 = *D.29354;
  if (D.29355 != 0) goto <D.22390>; else goto <D.29356>;
  <D.29356>:
  i = i + 1;
  <D.22392>:
  if (i < len) goto <D.22391>; else goto <D.22390>;
  <D.22390>:
  D.29357 = i >= len;
  D.29358 = (long int) D.29357;
  D.29359 = __builtin_expect (D.29358, 0);
  if (D.29359 != 0) goto <D.29360>; else goto <D.29361>;
  <D.29360>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12773, "i < len");
  <D.29361>:
  D.29353 = (sizetype) i;
  D.29354 = buf + D.29353;
  byte = *D.29354;
  goto <D.22394>;
  <D.22393>:
  byte = byte >> 1;
  <D.22394>:
  if (byte != 0) goto <D.29362>; else goto <D.22395>;
  <D.29362>:
  D.29363 = (int) byte;
  D.29364 = D.29363 & 1;
  if (D.29364 == 0) goto <D.22393>; else goto <D.22395>;
  <D.22395>:
  D.29365 = byte != 1;
  D.29366 = (long int) D.29365;
  D.29367 = __builtin_expect (D.29366, 0);
  if (D.29367 != 0) goto <D.29368>; else goto <D.29369>;
  <D.29368>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12778, "byte == 1");
  <D.29369>:
  *byte_offset = i;
  D.29353 = (sizetype) i;
  D.29354 = buf + D.29353;
  D.29355 = *D.29354;
  *bitmask = D.29355;
}


mono_marshal_get_thunk_invoke_wrapper (struct MonoMethod * method)
{
  _Bool D.29370;
  long int D.29371;
  long int D.29372;
  struct MonoClass * D.29375;
  struct GHashTable * * D.29376;
  struct MonoMethod * D.29379;
  const char * D.29380;
  short unsigned int D.29381;
  int D.29382;
  <unnamed-unsigned:1> D.29383;
  int D.29384;
  int D.29385;
  unsigned int param_count.413;
  long unsigned int D.29387;
  long unsigned int D.29388;
  unsigned int D.29389;
  unsigned int D.29390;
  long unsigned int D.29391;
  short unsigned int D.29392;
  long unsigned int D.29393;
  long unsigned int D.29394;
  struct MonoType * D.29397;
  int D.29398;
  struct MonoType * D.29399;
  int D.29400;
  struct MonoClass * D.29401;
  struct MonoType * D.29402;
  struct MonoType * D.29403;
  struct MonoType * D.29404;
  struct MonoType * D.29405;
  int D.29406;
  struct MonoClass * D.29409;
  struct MonoType * D.29410;
  int D.29411;
  unsigned int D.29414;
  int D.29415;
  unsigned int D.29416;
  unsigned int i.414;
  struct MonoType * D.29418;
  int D.29419;
  long unsigned int D.29424;
  long unsigned int D.29425;
  short unsigned int D.29429;
  int D.29430;
  int D.29431;
  int D.29435;
  unsigned int D.29438;
  int D.29439;
  unsigned int D.29440;
  unsigned int D.29441;
  unsigned int D.29442;
  int D.29443;
  unsigned int D.29444;
  int D.29445;
  unsigned int D.29446;
  unsigned int D.29447;
  unsigned int D.29448;
  unsigned int pos_leave.415;
  int D.29450;
  int D.29453;
  struct MonoClass * D.29456;
  int D.29457;
  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.29370 = method == 0B;
  D.29371 = (long int) D.29370;
  D.29372 = __builtin_expect (D.29371, 0);
  if (D.29372 != 0) goto <D.29373>; else goto <D.29374>;
  <D.29373>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12796, "method");
  <D.29374>:
  klass = method->klass;
  D.29375 = method->klass;
  image = D.29375->image;
  D.29376 = &image->thunk_invoke_cache;
  cache = get_cache (D.29376, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.29377>; else goto <D.29378>;
  <D.29377>:
  D.29379 = res;
  return D.29379;
  <D.29378>:
  sig = mono_method_signature (method);
  D.29380 = method->name;
  mb = mono_mb_new (klass, D.29380, 5);
  D.29381 = sig->param_count;
  D.29382 = (int) D.29381;
  D.29383 = sig->hasthis;
  D.29384 = (int) D.29383;
  D.29385 = D.29382 + D.29384;
  param_count = D.29385 + 1;
  param_count.413 = (unsigned int) param_count;
  csig = mono_metadata_signature_alloc (image, param_count.413);
  D.29381 = sig->param_count;
  D.29387 = (long unsigned int) D.29381;
  D.29388 = D.29387 + 2;
  D.29389 = (unsigned int) D.29388;
  D.29390 = D.29389 * 8;
  sig_size = (int) D.29390;
  D.29391 = (long unsigned int) sig_size;
  memcpy (csig, sig, D.29391);
  D.29392 = (short unsigned int) param_count;
  csig->param_count = D.29392;
  csig->hasthis = 0;
  csig->pinvoke = 1;
  csig->call_convention = 0;
  D.29393 = BIT_FIELD_REF <*sig, 64, 64>;
  D.29394 = D.29393 & 18014398509481984;
  if (D.29394 != 0) goto <D.29395>; else goto <D.29396>;
  <D.29395>:
  D.29397 = &klass->byval_arg;
  csig->params[0] = D.29397;
  i = 0;
  goto <D.22412>;
  <D.22411>:
  D.29398 = i + 1;
  D.29399 = sig->params[i];
  csig->params[D.29398] = D.29399;
  i = i + 1;
  <D.22412>:
  D.29381 = sig->param_count;
  D.29382 = (int) D.29381;
  if (D.29382 > i) goto <D.22411>; else goto <D.22413>;
  <D.22413>:
  <D.29396>:
  D.29400 = param_count + -1;
  D.29401 = mono_defaults.exception_class;
  D.29402 = &D.29401->byval_arg;
  D.29403 = mono_metadata_type_dup (image, D.29402);
  csig->params[D.29400] = D.29403;
  D.29400 = param_count + -1;
  D.29404 = csig->params[D.29400];
  D.29404->byref = 1;
  D.29400 = param_count + -1;
  D.29404 = csig->params[D.29400];
  D.29404->attrs = 2;
  D.29405 = sig->ret;
  D.29406 = mono_type_is_struct (D.29405);
  if (D.29406 != 0) goto <D.29407>; else goto <D.29408>;
  <D.29407>:
  D.29409 = mono_defaults.object_class;
  D.29410 = &D.29409->byval_arg;
  csig->ret = D.29410;
  <D.29408>:
  D.29409 = mono_defaults.object_class;
  D.29410 = &D.29409->byval_arg;
  mono_mb_add_local (mb, D.29410);
  D.29405 = sig->ret;
  D.29411 = mono_type_is_void (D.29405);
  if (D.29411 == 0) goto <D.29412>; else goto <D.29413>;
  <D.29412>:
  D.29405 = sig->ret;
  mono_mb_add_local (mb, D.29405);
  <D.29413>:
  D.29400 = param_count + -1;
  D.29414 = (unsigned int) D.29400;
  mono_mb_emit_ldarg (mb, D.29414);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  clause = mono_image_alloc0 (image, 32);
  D.29415 = mono_mb_get_label (mb);
  D.29416 = (unsigned int) D.29415;
  clause->try_offset = D.29416;
  i = 0;
  goto <D.22417>;
  <D.22416>:
  {
    struct MonoType * type;
    struct MonoClass * klass;

    i.414 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.414);
    D.29418 = csig->params[i];
    klass = mono_class_from_mono_type (D.29418);
    type = &klass->byval_arg;
    D.29419 = mono_type_is_struct (type);
    if (D.29419 != 0) goto <D.29420>; else goto <D.29421>;
    <D.29420>:
    mono_mb_emit_op (mb, 121, klass);
    D.29418 = csig->params[i];
    D.29424 = BIT_FIELD_REF <*D.29418, 64, 64>;
    D.29425 = D.29424 & 1073741824;
    if (D.29425 == 0) goto <D.29426>; else goto <D.29427>;
    <D.29426>:
    if (i != 0) goto <D.29422>; else goto <D.29428>;
    <D.29428>:
    D.29393 = BIT_FIELD_REF <*sig, 64, 64>;
    D.29394 = D.29393 & 18014398509481984;
    if (D.29394 == 0) goto <D.29422>; else goto <D.29423>;
    <D.29422>:
    mono_mb_emit_op (mb, 113, klass);
    <D.29423>:
    <D.29427>:
    D.29409 = mono_defaults.object_class;
    D.29410 = &D.29409->byval_arg;
    csig->params[i] = D.29410;
    <D.29421>:
  }
  i = i + 1;
  <D.22417>:
  D.29400 = param_count + -1;
  if (D.29400 > i) goto <D.22416>; else goto <D.22418>;
  <D.22418>:
  D.29429 = method->flags;
  D.29430 = (int) D.29429;
  D.29431 = D.29430 & 64;
  if (D.29431 != 0) goto <D.29432>; else goto <D.29433>;
  <D.29432>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.29434>;
  <D.29433>:
  mono_mb_emit_op (mb, 40, method);
  <D.29434>:
  D.29405 = sig->ret;
  D.29435 = mono_type_is_void (D.29405);
  if (D.29435 == 0) goto <D.29436>; else goto <D.29437>;
  <D.29436>:
  mono_mb_emit_stloc (mb, 1);
  <D.29437>:
  D.29438 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.29438;
  clause->flags = 0;
  D.29439 = mono_mb_get_pos (mb);
  D.29440 = (unsigned int) D.29439;
  D.29441 = clause->try_offset;
  D.29442 = D.29440 - D.29441;
  clause->try_len = D.29442;
  D.29409 = mono_defaults.object_class;
  clause->data.catch_class = D.29409;
  D.29443 = mono_mb_get_label (mb);
  D.29444 = (unsigned int) D.29443;
  clause->handler_offset = D.29444;
  mono_mb_emit_stloc (mb, 0);
  D.29400 = param_count + -1;
  D.29414 = (unsigned int) D.29400;
  mono_mb_emit_ldarg (mb, D.29414);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.29445 = mono_mb_get_pos (mb);
  D.29446 = (unsigned int) D.29445;
  D.29447 = clause->handler_offset;
  D.29448 = D.29446 - D.29447;
  clause->handler_len = D.29448;
  mono_mb_set_clauses (mb, 1, clause);
  pos_leave.415 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.415);
  D.29405 = sig->ret;
  D.29450 = mono_type_is_void (D.29405);
  if (D.29450 == 0) goto <D.29451>; else goto <D.29452>;
  <D.29451>:
  mono_mb_emit_ldloc (mb, 1);
  D.29405 = sig->ret;
  D.29453 = mono_type_is_struct (D.29405);
  if (D.29453 != 0) goto <D.29454>; else goto <D.29455>;
  <D.29454>:
  D.29405 = sig->ret;
  D.29456 = mono_class_from_mono_type (D.29405);
  mono_mb_emit_op (mb, 140, D.29456);
  <D.29455>:
  <D.29452>:
  mono_mb_emit_byte (mb, 42);
  D.29457 = param_count + 16;
  res = mono_mb_create_and_cache (cache, method, mb, csig, D.29457);
  mono_mb_free (mb);
  D.29379 = res;
  return D.29379;
}


mono_marshal_free_dynamic_wrappers (struct MonoMethod * method)
{
  struct MonoClass * D.29459;
  long unsigned int D.29460;
  long unsigned int D.29461;
  _Bool D.29462;
  long int D.29463;
  long int D.29464;
  int marshal_mutex_initialized.416;
  _Bool D.29472;
  long int D.29473;
  long int D.29474;
  struct GHashTable * D.29477;
  struct GHashTable * D.29480;
  _Bool D.29487;
  long int D.29488;
  long int D.29489;
  struct MonoImage * image;

  D.29459 = method->klass;
  image = D.29459->image;
  D.29460 = BIT_FIELD_REF <*method, 64, 256>;
  D.29461 = D.29460 & 512;
  D.29462 = D.29461 == 0;
  D.29463 = (long int) D.29462;
  D.29464 = __builtin_expect (D.29463, 0);
  if (D.29464 != 0) goto <D.29465>; else goto <D.29466>;
  <D.29465>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12939, "method->dynamic");
  <D.29466>:
  marshal_mutex_initialized.416 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.416 != 0) goto <D.29468>; else goto <D.29469>;
  <D.29468>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29470>; else goto <D.29471>;
    <D.29470>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.29471>:
    D.29472 = ret != 0;
    D.29473 = (long int) D.29472;
    D.29474 = __builtin_expect (D.29473, 0);
    if (D.29474 != 0) goto <D.29475>; else goto <D.29476>;
    <D.29475>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12943, "ret == 0");
    <D.29476>:
  }
  <D.29469>:
  D.29477 = image->runtime_invoke_direct_cache;
  if (D.29477 != 0B) goto <D.29478>; else goto <D.29479>;
  <D.29478>:
  D.29477 = image->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.29477, method);
  <D.29479>:
  D.29480 = image->delegate_abstract_invoke_cache;
  if (D.29480 != 0B) goto <D.29481>; else goto <D.29482>;
  <D.29481>:
  D.29480 = image->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.29480, signature_method_pair_matches_method, method);
  <D.29482>:
  marshal_mutex_initialized.416 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.416 != 0) goto <D.29483>; else goto <D.29484>;
  <D.29483>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29485>; else goto <D.29486>;
    <D.29485>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.29486>:
    D.29487 = ret != 0;
    D.29488 = (long int) D.29487;
    D.29489 = __builtin_expect (D.29488, 0);
    if (D.29489 != 0) goto <D.29490>; else goto <D.29491>;
    <D.29490>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12954, "ret == 0");
    <D.29491>:
  }
  <D.29484>:
}


signature_method_pair_matches_method (void * key, void * value, void * user_data)
{
  gboolean D.29492;
  struct MonoMethod * D.29493;
  _Bool D.29494;
  struct SignatureMethodPair * pair;
  struct MonoMethod * method;

  pair = key;
  method = user_data;
  D.29493 = pair->method;
  D.29494 = D.29493 == method;
  D.29492 = (gboolean) D.29494;
  return D.29492;
}


mono_marshal_free_inflated_wrappers (struct MonoMethod * method)
{
  long unsigned int D.29496;
  long unsigned int D.29497;
  _Bool D.29498;
  long int D.29499;
  long int D.29500;
  int marshal_mutex_initialized.417;
  _Bool D.29508;
  long int D.29509;
  long int D.29510;
  struct MonoClass * D.29515;
  struct MonoImage * D.29516;
  struct GHashTable * D.29517;
  struct GHashTable * D.29522;
  struct GHashTable * D.29527;
  struct GHashTable * D.29532;
  struct GHashTable * D.29537;
  struct GHashTable * D.29542;
  struct GHashTable * D.29545;
  struct GHashTable * D.29548;
  struct GHashTable * D.29551;
  struct GHashTable * D.29554;
  struct GHashTable * D.29557;
  struct GHashTable * D.29560;
  struct GHashTable * D.29563;
  struct GHashTable * D.29566;
  struct GHashTable * D.29569;
  struct GHashTable * D.29572;
  _Bool D.29577;
  long int D.29578;
  long int D.29579;
  struct MonoMethodSignature * sig;

  sig = method->signature;
  D.29496 = BIT_FIELD_REF <*method, 64, 256>;
  D.29497 = D.29496 & 4096;
  D.29498 = D.29497 == 0;
  D.29499 = (long int) D.29498;
  D.29500 = __builtin_expect (D.29499, 0);
  if (D.29500 != 0) goto <D.29501>; else goto <D.29502>;
  <D.29501>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12976, "method->is_inflated");
  <D.29502>:
  marshal_mutex_initialized.417 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.417 == 0) goto <D.29504>; else goto <D.29505>;
  <D.29504>:
  return;
  <D.29505>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29506>; else goto <D.29507>;
    <D.29506>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.29507>:
    D.29508 = ret != 0;
    D.29509 = (long int) D.29508;
    D.29510 = __builtin_expect (D.29509, 0);
    if (D.29510 != 0) goto <D.29511>; else goto <D.29512>;
    <D.29511>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12982, "ret == 0");
    <D.29512>:
  }
  if (sig != 0B) goto <D.29513>; else goto <D.29514>;
  <D.29513>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29517 = D.29516->delegate_begin_invoke_cache;
  if (D.29517 != 0B) goto <D.29518>; else goto <D.29519>;
  <D.29518>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29517 = D.29516->delegate_begin_invoke_cache;
  monoeg_g_hash_table_remove (D.29517, sig);
  <D.29519>:
  <D.29514>:
  if (sig != 0B) goto <D.29520>; else goto <D.29521>;
  <D.29520>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29522 = D.29516->delegate_end_invoke_cache;
  if (D.29522 != 0B) goto <D.29523>; else goto <D.29524>;
  <D.29523>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29522 = D.29516->delegate_end_invoke_cache;
  monoeg_g_hash_table_remove (D.29522, sig);
  <D.29524>:
  <D.29521>:
  if (sig != 0B) goto <D.29525>; else goto <D.29526>;
  <D.29525>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29527 = D.29516->delegate_invoke_cache;
  if (D.29527 != 0B) goto <D.29528>; else goto <D.29529>;
  <D.29528>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29527 = D.29516->delegate_invoke_cache;
  monoeg_g_hash_table_remove (D.29527, sig);
  <D.29529>:
  <D.29526>:
  if (sig != 0B) goto <D.29530>; else goto <D.29531>;
  <D.29530>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29532 = D.29516->runtime_invoke_cache;
  if (D.29532 != 0B) goto <D.29533>; else goto <D.29534>;
  <D.29533>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29532 = D.29516->runtime_invoke_cache;
  monoeg_g_hash_table_remove (D.29532, sig);
  <D.29534>:
  <D.29531>:
  if (sig != 0B) goto <D.29535>; else goto <D.29536>;
  <D.29535>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29537 = D.29516->runtime_invoke_vtype_cache;
  if (D.29537 != 0B) goto <D.29538>; else goto <D.29539>;
  <D.29538>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29537 = D.29516->runtime_invoke_vtype_cache;
  monoeg_g_hash_table_remove (D.29537, sig);
  <D.29539>:
  <D.29536>:
  if (sig != 0B) goto <D.29540>; else goto <D.29541>;
  <D.29540>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29542 = D.29516->delegate_abstract_invoke_cache;
  if (D.29542 != 0B) goto <D.29543>; else goto <D.29544>;
  <D.29543>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29542 = D.29516->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.29542, signature_method_pair_matches_signature, sig);
  <D.29544>:
  <D.29541>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29545 = D.29516->runtime_invoke_direct_cache;
  if (D.29545 != 0B) goto <D.29546>; else goto <D.29547>;
  <D.29546>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29545 = D.29516->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.29545, method);
  <D.29547>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29548 = D.29516->managed_wrapper_cache;
  if (D.29548 != 0B) goto <D.29549>; else goto <D.29550>;
  <D.29549>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29548 = D.29516->managed_wrapper_cache;
  monoeg_g_hash_table_remove (D.29548, method);
  <D.29550>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29551 = D.29516->native_wrapper_cache;
  if (D.29551 != 0B) goto <D.29552>; else goto <D.29553>;
  <D.29552>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29551 = D.29516->native_wrapper_cache;
  monoeg_g_hash_table_remove (D.29551, method);
  <D.29553>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29554 = D.29516->remoting_invoke_cache;
  if (D.29554 != 0B) goto <D.29555>; else goto <D.29556>;
  <D.29555>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29554 = D.29516->remoting_invoke_cache;
  monoeg_g_hash_table_remove (D.29554, method);
  <D.29556>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29557 = D.29516->synchronized_cache;
  if (D.29557 != 0B) goto <D.29558>; else goto <D.29559>;
  <D.29558>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29557 = D.29516->synchronized_cache;
  monoeg_g_hash_table_remove (D.29557, method);
  <D.29559>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29560 = D.29516->unbox_wrapper_cache;
  if (D.29560 != 0B) goto <D.29561>; else goto <D.29562>;
  <D.29561>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29560 = D.29516->unbox_wrapper_cache;
  monoeg_g_hash_table_remove (D.29560, method);
  <D.29562>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29563 = D.29516->cominterop_invoke_cache;
  if (D.29563 != 0B) goto <D.29564>; else goto <D.29565>;
  <D.29564>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29563 = D.29516->cominterop_invoke_cache;
  monoeg_g_hash_table_remove (D.29563, method);
  <D.29565>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29566 = D.29516->cominterop_wrapper_cache;
  if (D.29566 != 0B) goto <D.29567>; else goto <D.29568>;
  <D.29567>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29566 = D.29516->cominterop_wrapper_cache;
  monoeg_g_hash_table_remove (D.29566, method);
  <D.29568>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29569 = D.29516->thunk_invoke_cache;
  if (D.29569 != 0B) goto <D.29570>; else goto <D.29571>;
  <D.29570>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29569 = D.29516->thunk_invoke_cache;
  monoeg_g_hash_table_remove (D.29569, method);
  <D.29571>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29572 = D.29516->native_func_wrapper_aot_cache;
  if (D.29572 != 0B) goto <D.29573>; else goto <D.29574>;
  <D.29573>:
  D.29515 = method->klass;
  D.29516 = D.29515->image;
  D.29572 = D.29516->native_func_wrapper_aot_cache;
  monoeg_g_hash_table_remove (D.29572, method);
  <D.29574>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.29575>; else goto <D.29576>;
    <D.29575>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.29576>:
    D.29577 = ret != 0;
    D.29578 = (long int) D.29577;
    D.29579 = __builtin_expect (D.29578, 0);
    if (D.29579 != 0) goto <D.29580>; else goto <D.29581>;
    <D.29580>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 13034, "ret == 0");
    <D.29581>:
  }
}


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

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


