mono_signature_no_pinvoke (struct MonoMethod * method)
{
  unsigned char D.21545;
  unsigned char D.21546;
  struct MonoClass * D.21549;
  struct MonoImage * D.21550;
  struct MonoMethodSignature * D.21551;
  struct MonoMethodSignature * sig;

  sig = mono_method_signature (method);
  D.21545 = BIT_FIELD_REF <*sig, 8, 88>;
  D.21546 = D.21545 & 1;
  if (D.21546 != 0) goto <D.21547>; else goto <D.21548>;
  <D.21547>:
  D.21549 = method->klass;
  D.21550 = D.21549->image;
  sig = signature_dup (D.21550, sig);
  sig->pinvoke = 0;
  <D.21548>:
  D.21551 = sig;
  return D.21551;
}


signature_dup (struct MonoImage * image, struct MonoMethodSignature * sig)
{
  short unsigned int D.21553;
  unsigned int D.21554;
  unsigned int D.21555;
  unsigned int D.21556;
  unsigned int D.21557;
  unsigned int sigsize.0;
  struct MonoMethodSignature * D.21559;
  struct MonoMethodSignature * res;
  int sigsize;

  D.21553 = sig->param_count;
  D.21554 = (unsigned int) D.21553;
  res = mono_metadata_signature_alloc (image, D.21554);
  D.21553 = sig->param_count;
  D.21555 = (unsigned int) D.21553;
  D.21556 = D.21555 + 3;
  D.21557 = D.21556 * 4;
  sigsize = (int) D.21557;
  sigsize.0 = (unsigned int) sigsize;
  memcpy (res, sig, sigsize.0);
  D.21559 = res;
  return D.21559;
}


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

  D.21562 = __builtin_object_size (__dest, 0);
  D.21561 = __builtin___memcpy_chk (__dest, __src, __len, D.21562);
  return D.21561;
}


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.21564;
  void (*<Tbf>) (void *) destructor.1;
  int D.21566;
  _Bool D.21567;

  destructor.1 = (void (*<Tbf>) (void *)) destructor;
  D.21566 = pthread_key_create (key, destructor.1);
  D.21567 = D.21566 == 0;
  D.21564 = (int) D.21567;
  return D.21564;
}


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

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


mono_remoting_wrapper (struct MonoMethod * method, void * * params)
{
  void * D.21572;
  _Bool D.21573;
  long int D.21574;
  long int D.21575;
  struct MonoVTable * D.21578;
  struct MonoClass * D.21579;
  struct MonoClass * D.21580;
  _Bool D.21581;
  long int D.21582;
  long int D.21583;
  struct MonoRemoteClass * D.21586;
  struct MonoClass * D.21587;
  unsigned char D.21588;
  unsigned char D.21589;
  struct MonoRealProxy * D.21592;
  struct MonoObject * D.21593;
  struct MonoAppContext * D.21594;
  short unsigned int D.21597;
  unsigned int count.3;
  unsigned int D.21599;
  struct MonoType * D.21600;
  unsigned char D.21601;
  unsigned char D.21602;
  unsigned char D.21605;
  unsigned char D.21606;
  unsigned int i.4;
  unsigned int D.21610;
  void * * D.21611;
  void * * D.21612;
  void * D.21613;
  void * D.21614;
  struct MonoClass * D.21616;
  int D.21617;
  struct MonoObject * D.21620;
  void * * D.21623;
  struct MonoObject * D.21624;
  void * iftmp.5;
  struct MonoClass * D.21626;
  unsigned char D.21627;
  unsigned char D.21628;
  struct MonoObject * exc.6;
  struct MonoArray * out_args.7;
  struct MonoMethodMessage * msg;
  struct MonoTransparentProxy * this;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;

  try
    {
      D.21572 = *params;
      this = MEM[(struct MonoTransparentProxy * *)D.21572];
      D.21573 = this == 0B;
      D.21574 = (long int) D.21573;
      D.21575 = __builtin_expect (D.21574, 0);
      if (D.21575 != 0) goto <D.21576>; else goto <D.21577>;
      <D.21576>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3124, "this");
      <D.21577>:
      D.21578 = MEM[(struct MonoObject *)this].vtable;
      D.21579 = D.21578->klass;
      D.21580 = mono_defaults.transparent_proxy_class;
      D.21581 = D.21579 != D.21580;
      D.21582 = (long int) D.21581;
      D.21583 = __builtin_expect (D.21582, 0);
      if (D.21583 != 0) goto <D.21584>; else goto <D.21585>;
      <D.21584>:
      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.21585>:
      params = params + 4;
      D.21586 = this->remote_class;
      D.21587 = D.21586->proxy_class;
      D.21588 = BIT_FIELD_REF <*D.21587, 8, 176>;
      D.21589 = D.21588 & 128;
      if (D.21589 != 0) goto <D.21590>; else goto <D.21591>;
      <D.21590>:
      D.21592 = this->rp;
      D.21593 = D.21592->context;
      D.21594 = mono_context_get ();
      if (D.21593 == D.21594) goto <D.21595>; else goto <D.21596>;
      <D.21595>:
      {
        int i;
        struct MonoMethodSignature * sig;
        int count;
        void * * mparams;

        sig = mono_method_signature (method);
        D.21597 = sig->param_count;
        count = (int) D.21597;
        count.3 = (unsigned int) count;
        D.21599 = count.3 * 4;
        mparams = __builtin_alloca (D.21599);
        i = 0;
        goto <D.19254>;
        <D.19253>:
        {
          struct MonoClass * class;

          D.21600 = sig->params[i];
          class = mono_class_from_mono_type (D.21600);
          D.21601 = BIT_FIELD_REF <*class, 8, 160>;
          D.21602 = D.21601 & 8;
          if (D.21602 != 0) goto <D.21603>; else goto <D.21604>;
          <D.21603>:
          D.21600 = sig->params[i];
          D.21605 = BIT_FIELD_REF <*D.21600, 8, 56>;
          D.21606 = D.21605 & 64;
          if (D.21606 != 0) goto <D.21607>; else goto <D.21608>;
          <D.21607>:
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21611 = mparams + D.21610;
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21612 = params + D.21610;
          D.21613 = *D.21612;
          D.21614 = MEM[(void * *)D.21613];
          *D.21611 = D.21614;
          goto <D.21615>;
          <D.21608>:
          D.21600 = sig->params[i];
          D.21616 = mono_class_from_mono_type (D.21600);
          D.21617 = mono_class_is_nullable (D.21616);
          if (D.21617 != 0) goto <D.21618>; else goto <D.21619>;
          <D.21618>:
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21611 = mparams + D.21610;
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21612 = params + D.21610;
          D.21613 = *D.21612;
          D.21620 = mono_nullable_box (D.21613, class);
          *D.21611 = D.21620;
          goto <D.21621>;
          <D.21619>:
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21611 = mparams + D.21610;
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21612 = params + D.21610;
          D.21613 = *D.21612;
          *D.21611 = D.21613;
          <D.21621>:
          <D.21615>:
          goto <D.21622>;
          <D.21604>:
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21611 = mparams + D.21610;
          i.4 = (unsigned int) i;
          D.21610 = i.4 * 4;
          D.21612 = params + D.21610;
          D.21613 = *D.21612;
          D.21623 = MEM[(void * * *)D.21613];
          *D.21611 = D.21623;
          <D.21622>:
        }
        i = i + 1;
        <D.19254>:
        if (i < count) goto <D.19253>; else goto <D.19255>;
        <D.19255>:
        D.21626 = method->klass;
        D.21627 = BIT_FIELD_REF <*D.21626, 8, 160>;
        D.21628 = D.21627 & 8;
        if (D.21628 != 0) goto <D.21629>; else goto <D.21630>;
        <D.21629>:
        iftmp.5 = mono_object_unbox (this);
        goto <D.21631>;
        <D.21630>:
        iftmp.5 = this;
        <D.21631>:
        D.21624 = mono_runtime_invoke (method, iftmp.5, mparams, 0B);
        return D.21624;
      }
      <D.21596>:
      <D.21591>:
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.21592 = this->rp;
      res = mono_remoting_invoke (D.21592, msg, &exc, &out_args);
      exc.6 = exc;
      if (exc.6 != 0B) goto <D.21633>; else goto <D.21634>;
      <D.21633>:
      exc.6 = exc;
      mono_raise_exception (exc.6);
      <D.21634>:
      out_args.7 = out_args;
      mono_method_return_message_restore (method, params, out_args.7);
      D.21624 = res;
      return D.21624;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


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

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


mono_marshal_check_domain_image (gint32 domain_id, struct MonoImage * image)
{
  gboolean D.21642;
  union mono_mutex_t * D.21643;
  _Bool D.21646;
  long int D.21647;
  long int D.21648;
  struct MonoImage * D.21651;
  _Bool D.21655;
  long int D.21656;
  long int D.21657;
  _Bool D.21660;
  struct MonoAssembly * ass;
  struct GSList * tmp;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21640>; else goto <D.21641>;
  <D.21640>:
  D.21642 = 0;
  return D.21642;
  <D.21641>:
  {
    int ret;

    D.21643 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21643);
    if (ret != 0) goto <D.21644>; else goto <D.21645>;
    <D.21644>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21645>:
    D.21646 = ret != 0;
    D.21647 = (long int) D.21646;
    D.21648 = __builtin_expect (D.21647, 0);
    if (D.21648 != 0) goto <D.21649>; else goto <D.21650>;
    <D.21649>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3452, "ret == 0");
    <D.21650>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19376>;
  <D.19375>:
  ass = tmp->data;
  D.21651 = ass->image;
  if (D.21651 == image) goto <D.19374>; else goto <D.21652>;
  <D.21652>:
  tmp = tmp->next;
  <D.19376>:
  if (tmp != 0B) goto <D.19375>; else goto <D.19374>;
  <D.19374>:
  {
    int ret;

    D.21643 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21643);
    if (ret != 0) goto <D.21653>; else goto <D.21654>;
    <D.21653>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21654>:
    D.21655 = ret != 0;
    D.21656 = (long int) D.21655;
    D.21657 = __builtin_expect (D.21656, 0);
    if (D.21657 != 0) goto <D.21658>; else goto <D.21659>;
    <D.21658>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3458, "ret == 0");
    <D.21659>:
  }
  D.21660 = tmp != 0B;
  D.21642 = (gboolean) D.21660;
  return D.21642;
}


mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push)
{
  int D.21665;
  struct MonoException * D.21666;
  gint32 D.21670;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (id);
  if (domain == 0B) goto <D.21662>; else goto <D.21664>;
  <D.21664>:
  D.21665 = mono_domain_set (domain, 0);
  if (D.21665 == 0) goto <D.21662>; else goto <D.21663>;
  <D.21662>:
  D.21666 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21666);
  <D.21663>:
  if (push != 0) goto <D.21667>; else goto <D.21668>;
  <D.21667>:
  mono_thread_push_appdomain_ref (domain);
  goto <D.21669>;
  <D.21668>:
  mono_thread_pop_appdomain_ref ();
  <D.21669>:
  D.21670 = current_domain->domain_id;
  return D.21670;
}


mono_marshal_xdomain_copy_out_value (struct MonoObject * src, struct MonoObject * dst)
{
  _Bool D.21672;
  _Bool D.21673;
  _Bool D.21674;
  struct MonoVTable * D.21677;
  struct MonoClass * D.21678;
  struct MonoVTable * D.21679;
  struct MonoClass * D.21680;
  _Bool D.21681;
  long int D.21682;
  long int D.21683;
  unsigned char D.21686;
  int D.21687;
  struct MonoClass * D.21688;
  struct MonoType * D.21689;
  <unnamed type> D.21690;
  unsigned int D.21695;
  unsigned int i.8;
  char * D.21697;
  struct MonoObject * D.21698;
  struct MonoClass * D.21701;
  struct MonoString * D.21704;
  int D.21705;
  mono_unichar2 * D.21706;
  struct MonoDomain * D.21707;
  struct MonoString * D.21708;
  struct MonoString * * D.21709;
  int D.21710;

  D.21672 = src == 0B;
  D.21673 = dst == 0B;
  D.21674 = D.21672 | D.21673;
  if (D.21674 != 0) goto <D.21675>; else goto <D.21676>;
  <D.21675>:
  return;
  <D.21676>:
  D.21677 = src->vtable;
  D.21678 = D.21677->klass;
  D.21679 = dst->vtable;
  D.21680 = D.21679->klass;
  D.21681 = D.21678 != D.21680;
  D.21682 = (long int) D.21681;
  D.21683 = __builtin_expect (D.21682, 0);
  if (D.21683 != 0) goto <D.21684>; else goto <D.21685>;
  <D.21684>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3340, "mono_object_class (src) == mono_object_class (dst)");
  <D.21685>:
  D.21677 = src->vtable;
  D.21678 = D.21677->klass;
  D.21686 = D.21678->byval_arg.type;
  D.21687 = (int) D.21686;
  switch (D.21687) <default: <D.21700>, case 20: <D.19321>, case 29: <D.19322>>
  <D.19321>:
  <D.19322>:
  {
    int mt;

    D.21677 = src->vtable;
    D.21678 = D.21677->klass;
    D.21688 = D.21678->element_class;
    D.21689 = &D.21688->byval_arg;
    D.21690 = mono_get_xdomain_marshal_type (D.21689);
    mt = (int) D.21690;
    if (mt == 3) goto <D.21691>; else goto <D.21692>;
    <D.21691>:
    return;
    <D.21692>:
    if (mt == 1) goto <D.21693>; else goto <D.21694>;
    <D.21693>:
    {
      int i;
      int len;

      D.21695 = mono_array_length (dst);
      len = (int) D.21695;
      i = 0;
      goto <D.19329>;
      <D.19328>:
      {
        struct MonoObject * item;

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

          i.8 = (unsigned int) i;
          __p = mono_array_addr_with_size (dst, 4, i.8);
          D.21698 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (dst, __p, D.21698);
        }
      }
      i = i + 1;
      <D.19329>:
      if (i < len) goto <D.19328>; else goto <D.19330>;
      <D.19330>:
    }
    goto <D.21699>;
    <D.21694>:
    mono_array_full_copy (src, dst);
    <D.21699>:
    return;
  }
  <D.21700>:
  D.21677 = src->vtable;
  D.21678 = D.21677->klass;
  D.21701 = mono_defaults.stringbuilder_class;
  if (D.21678 == D.21701) goto <D.21702>; else goto <D.21703>;
  <D.21702>:
  {
    struct MonoStringBuilder * src_sb;
    struct MonoStringBuilder * dst_sb;

    src_sb = src;
    dst_sb = dst;
    D.21704 = src_sb->str;
    D.21705 = mono_string_length (D.21704);
    D.21704 = src_sb->str;
    D.21706 = mono_string_chars (D.21704);
    D.21679 = dst->vtable;
    D.21707 = D.21679->domain;
    D.21708 = mono_string_new_utf16 (D.21707, D.21706, D.21705);
    D.21709 = &dst_sb->str;
    mono_gc_wbarrier_set_field (dst_sb, D.21709, D.21708);
    dst_sb->cached_str = 0B;
    D.21710 = src_sb->length;
    dst_sb->length = D.21710;
  }
  <D.21703>:
}


mono_get_xdomain_marshal_type (struct MonoType * t)
{
  unsigned char D.21712;
  int D.21713;
  MonoXDomainMarshalType D.21714;
  struct MonoClass * D.21715;
  struct MonoType * D.21716;
  <unnamed type> D.21717;

  D.21712 = t->type;
  D.21713 = (int) D.21712;
  switch (D.21713) <default: <D.21720>, case 1: <D.19267>, case 2: <D.19270>, case 3: <D.19273>, case 4: <D.19269>, case 5: <D.19268>, case 6: <D.19272>, case 7: <D.19271>, case 8: <D.19275>, case 9: <D.19274>, case 10: <D.19276>, case 11: <D.19277>, case 12: <D.19278>, case 13: <D.19279>, case 14: <D.19280>, case 20: <D.19281>, case 29: <D.19282>>
  <D.19267>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3240);
  <D.19268>:
  <D.19269>:
  <D.19270>:
  <D.19271>:
  <D.19272>:
  <D.19273>:
  <D.19274>:
  <D.19275>:
  <D.19276>:
  <D.19277>:
  <D.19278>:
  <D.19279>:
  D.21714 = 0;
  return D.21714;
  <D.19280>:
  D.21714 = 1;
  return D.21714;
  <D.19281>:
  <D.19282>:
  {
    struct MonoClass * elem_class;

    D.21715 = mono_class_from_mono_type (t);
    elem_class = D.21715->element_class;
    D.21716 = &elem_class->byval_arg;
    D.21717 = mono_get_xdomain_marshal_type (D.21716);
    if (D.21717 != 3) goto <D.21718>; else goto <D.21719>;
    <D.21718>:
    D.21714 = 1;
    return D.21714;
    <D.21719>:
    goto <D.19284>;
  }
  <D.21720>:
  <D.19284>:
  D.21714 = 3;
  return D.21714;
}


mono_delegate_end_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.21722;
  long int D.21723;
  long int D.21724;
  struct MonoReflectionMethod * D.21727;
  struct MonoMethod * D.21730;
  _Bool D.21731;
  long int D.21732;
  long int D.21733;
  struct MonoReflectionMethod * D.21736;
  struct MonoReflectionMethod * * D.21737;
  struct MonoMethod * D.21741;
  struct MonoVTable * D.21742;
  _Bool D.21743;
  long int D.21744;
  long int D.21745;
  short unsigned int D.21748;
  int D.21749;
  int D.21750;
  unsigned int D.21751;
  struct MonoArray * D.21752;
  char * D.21753;
  struct MonoImage * D.21756;
  struct MonoException * D.21757;
  struct MonoObject * D.21758;
  struct MonoObject * D.21759;
  struct MonoException * D.21762;
  struct MonoObject * D.21765;
  struct MonoVTable * D.21767;
  struct MonoClass * D.21768;
  struct MonoClass * D.21769;
  struct MonoClass * D.21771;
  struct MonoAsyncResult * * D.21772;
  struct MonoRealProxy * D.21773;
  struct MonoObject * exc.9;
  struct MonoString * D.21777;
  struct MonoString * D.21780;
  struct MonoString * * D.21781;
  struct MonoArray * out_args.10;
  struct MonoDomain * domain;
  struct MonoAsyncResult * ares;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodMessage * msg;
  struct MonoObject * res;
  struct MonoObject * exc;
  struct MonoArray * out_args;
  struct MonoClass * klass;

  try
    {
      domain = mono_domain_get ();
      method = 0B;
      D.21722 = delegate == 0B;
      D.21723 = (long int) D.21722;
      D.21724 = __builtin_expect (D.21723, 0);
      if (D.21724 != 0) goto <D.21725>; else goto <D.21726>;
      <D.21725>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2908, "delegate");
      <D.21726>:
      D.21727 = delegate->method_info;
      if (D.21727 == 0B) goto <D.21728>; else goto <D.21729>;
      <D.21728>:
      D.21730 = delegate->method;
      D.21731 = D.21730 == 0B;
      D.21732 = (long int) D.21731;
      D.21733 = __builtin_expect (D.21732, 0);
      if (D.21733 != 0) goto <D.21734>; else goto <D.21735>;
      <D.21734>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2911, "delegate->method");
      <D.21735>:
      D.21730 = delegate->method;
      D.21736 = mono_method_get_object (domain, D.21730, 0B);
      D.21737 = &delegate->method_info;
      mono_gc_wbarrier_set_field (delegate, D.21737, D.21736);
      <D.21729>:
      D.21727 = delegate->method_info;
      if (D.21727 == 0B) goto <D.21738>; else goto <D.21740>;
      <D.21740>:
      D.21727 = delegate->method_info;
      D.21741 = D.21727->method;
      if (D.21741 == 0B) goto <D.21738>; else goto <D.21739>;
      <D.21738>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2916);
      <D.21739>:
      D.21742 = delegate->object.vtable;
      klass = D.21742->klass;
      method = mono_class_get_method_from_name (klass, "EndInvoke", -1);
      D.21743 = method == 0B;
      D.21744 = (long int) D.21743;
      D.21745 = __builtin_expect (D.21744, 0);
      if (D.21745 != 0) goto <D.21746>; else goto <D.21747>;
      <D.21746>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2921, "method != NULL");
      <D.21747>:
      sig = mono_signature_no_pinvoke (method);
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.21748 = sig->param_count;
      D.21749 = (int) D.21748;
      D.21750 = D.21749 + -1;
      D.21751 = (unsigned int) D.21750;
      D.21752 = msg->args;
      D.21753 = mono_array_addr_with_size (D.21752, 4, D.21751);
      ares = MEM[(void * *)D.21753];
      if (ares == 0B) goto <D.21754>; else goto <D.21755>;
      <D.21754>:
      D.21756 = mono_defaults.corlib;
      D.21757 = mono_exception_from_name_msg (D.21756, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.");
      mono_raise_exception (D.21757);
      D.21758 = 0B;
      return D.21758;
      <D.21755>:
      D.21759 = ares->async_delegate;
      if (D.21759 != delegate) goto <D.21760>; else goto <D.21761>;
      <D.21760>:
      D.21762 = mono_get_exception_invalid_operation ("The IAsyncResult object provided does not match this delegate.");
      mono_raise_exception (D.21762);
      D.21758 = 0B;
      return D.21758;
      <D.21761>:
      D.21765 = delegate->target;
      if (D.21765 != 0B) goto <D.21766>; else goto <D.21763>;
      <D.21766>:
      D.21765 = delegate->target;
      D.21767 = D.21765->vtable;
      D.21768 = D.21767->klass;
      D.21769 = mono_defaults.transparent_proxy_class;
      if (D.21768 == D.21769) goto <D.21770>; else goto <D.21763>;
      <D.21770>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.21771 = mono_defaults.mono_method_message_class;
        msg = mono_object_new (domain, D.21771);
        D.21727 = delegate->method_info;
        mono_message_init (domain, msg, D.21727, 0B);
        msg->call_type = 2;
        D.21772 = &msg->async_result;
        mono_gc_wbarrier_set_field (msg, D.21772, ares);
        D.21773 = tp->rp;
        res = mono_remoting_invoke (D.21773, msg, &exc, &out_args);
      }
      goto <D.21764>;
      <D.21763>:
      res = mono_thread_pool_finish (ares, &out_args, &exc);
      <D.21764>:
      exc.9 = exc;
      if (exc.9 != 0B) goto <D.21775>; else goto <D.21776>;
      <D.21775>:
      exc.9 = exc;
      D.21777 = MEM[(struct MonoException *)exc.9].stack_trace;
      if (D.21777 != 0B) goto <D.21778>; else goto <D.21779>;
      <D.21778>:
      {
        char * strace;
        char * tmp;

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


mono_delegate_begin_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.21785;
  long int D.21786;
  long int D.21787;
  struct MonoMulticastDelegate * D.21790;
  struct MonoException * D.21793;
  struct MonoObject * D.21794;
  struct MonoVTable * D.21797;
  struct MonoClass * D.21798;
  struct MonoClass * D.21799;
  struct MonoRemoteClass * D.21804;
  struct MonoClass * D.21805;
  unsigned char D.21806;
  unsigned char D.21807;
  struct MonoRealProxy * D.21809;
  struct MonoObject * D.21810;
  struct MonoAppContext * D.21811;
  struct MonoMethod * D.21812;
  struct MonoObject * state.11;
  struct MonoDomain * D.21814;
  struct MonoObject * * D.21815;
  struct MonoDelegate * async_callback.12;
  struct MonoObject * * D.21817;
  struct MonoAsyncResult * * D.21818;
  struct MonoObject * exc.13;
  struct MonoAsyncResult * D.21822;
  struct MonoVTable * D.21823;
  _Bool D.21826;
  long int D.21827;
  long int D.21828;
  struct MonoClass * D.21831;
  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.21785 = delegate == 0B;
      D.21786 = (long int) D.21785;
      D.21787 = __builtin_expect (D.21786, 0);
      if (D.21787 != 0) goto <D.21788>; else goto <D.21789>;
      <D.21788>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2147, "delegate");
      <D.21789>:
      mcast_delegate = delegate;
      D.21790 = mcast_delegate->prev;
      if (D.21790 != 0B) goto <D.21791>; else goto <D.21792>;
      <D.21791>:
      D.21793 = mono_get_exception_argument (0B, "The delegate must have only one target");
      mono_raise_exception (D.21793);
      <D.21792>:
      D.21794 = delegate->target;
      if (D.21794 != 0B) goto <D.21795>; else goto <D.21796>;
      <D.21795>:
      D.21794 = delegate->target;
      D.21797 = D.21794->vtable;
      D.21798 = D.21797->klass;
      D.21799 = mono_defaults.transparent_proxy_class;
      if (D.21798 == D.21799) goto <D.21800>; else goto <D.21801>;
      <D.21800>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.21804 = tp->remote_class;
        D.21805 = D.21804->proxy_class;
        D.21806 = BIT_FIELD_REF <*D.21805, 8, 176>;
        D.21807 = D.21806 & 128;
        if (D.21807 == 0) goto <D.21802>; else goto <D.21808>;
        <D.21808>:
        D.21809 = tp->rp;
        D.21810 = D.21809->context;
        D.21811 = mono_context_get ();
        if (D.21810 != D.21811) goto <D.21802>; else goto <D.21803>;
        <D.21802>:
        {
          struct MonoAsyncResult * ares;
          struct MonoObject * exc;
          struct MonoArray * out_args;

          try
            {
              method = delegate->method;
              D.21812 = mono_marshal_method_from_wrapper (method);
              msg = mono_method_call_message_new (D.21812, params, 0B, &async_callback, &state);
              state.11 = state;
              D.21814 = mono_domain_get ();
              ares = mono_async_result_new (D.21814, 0B, state.11, 0B, 0B);
              D.21815 = &ares->async_delegate;
              mono_gc_wbarrier_set_field (ares, D.21815, delegate);
              async_callback.12 = async_callback;
              D.21817 = &ares->async_callback;
              mono_gc_wbarrier_set_field (ares, D.21817, async_callback.12);
              D.21818 = &msg->async_result;
              mono_gc_wbarrier_set_field (msg, D.21818, ares);
              msg->call_type = 1;
              exc = 0B;
              D.21809 = tp->rp;
              mono_remoting_invoke (D.21809, msg, &exc, &out_args);
              exc.13 = exc;
              if (exc.13 != 0B) goto <D.21820>; else goto <D.21821>;
              <D.21820>:
              exc.13 = exc;
              mono_raise_exception (exc.13);
              <D.21821>:
              D.21822 = ares;
              return D.21822;
            }
          finally
            {
              exc = {CLOBBER};
              out_args = {CLOBBER};
            }
        }
        <D.21803>:
      }
      <D.21801>:
      <D.21796>:
      D.21823 = delegate->object.vtable;
      klass = D.21823->klass;
      method = mono_get_delegate_invoke (klass);
      method2 = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      if (method2 != 0B) goto <D.21824>; else goto <D.21825>;
      <D.21824>:
      method = method2;
      <D.21825>:
      D.21826 = method == 0B;
      D.21827 = (long int) D.21826;
      D.21828 = __builtin_expect (D.21827, 0);
      if (D.21828 != 0) goto <D.21829>; else goto <D.21830>;
      <D.21829>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2188, "method != NULL");
      <D.21830>:
      D.21831 = method->klass;
      im = mono_get_delegate_invoke (D.21831);
      msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
      state.11 = state;
      async_callback.12 = async_callback;
      D.21822 = mono_thread_pool_add (delegate, msg, async_callback.12, state.11);
      return D.21822;
    }
  finally
    {
      async_callback = {CLOBBER};
      state = {CLOBBER};
    }
}


mono_struct_delete_old (struct MonoClass * klass, char * ptr)
{
  struct MonoClassField * D.21835;
  short unsigned int D.21836;
  int D.21837;
  int D.21838;
  <unnamed-unsigned:1> D.21841;
  int D.21842;
  struct MonoMarshalSpec * D.21843;
  unsigned int D.21844;
  <unnamed type> conv.14;
  int D.21846;
  struct MonoClass * D.21849;
  void * D.21850;
  unsigned int i.15;
  unsigned int D.21852;
  struct MonoMarshalType * info;
  int i;

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

    try
      {
        D.21835 = info->fields[i].field;
        ftype = D.21835->type;
        D.21836 = ftype->attrs;
        D.21837 = (int) D.21836;
        D.21838 = D.21837 & 16;
        if (D.21838 != 0) goto <D.21839>; else goto <D.21840>;
        <D.21839>:
        // predicted unlikely by continue predictor.
        goto <D.21194>;
        <D.21840>:
        D.21841 = klass->unicode;
        D.21842 = (int) D.21841;
        D.21843 = info->fields[i].mspec;
        ntype = mono_type_to_unmanaged (ftype, D.21843, 1, D.21842, &conv);
        D.21844 = info->fields[i].offset;
        cpos = ptr + D.21844;
        conv.14 = conv;
        switch (conv.14) <default: <D.21203>, case 0: <D.21195>, case 3: <D.21200>, case 4: <D.21199>, case 7: <D.21197>, case 9: <D.21198>, case 10: <D.21201>, case 11: <D.21202>>
        <D.21195>:
        D.21846 = mono_type_is_struct (ftype);
        if (D.21846 != 0) goto <D.21847>; else goto <D.21848>;
        <D.21847>:
        D.21849 = ftype->data.klass;
        mono_struct_delete_old (D.21849, cpos);
        // predicted unlikely by continue predictor.
        goto <D.21194>;
        <D.21848>:
        goto <D.21196>;
        <D.21197>:
        goto <D.21196>;
        <D.21198>:
        <D.21199>:
        <D.21200>:
        <D.21201>:
        <D.21202>:
        D.21850 = MEM[(void * *)cpos];
        mono_marshal_free (D.21850);
        goto <D.21196>;
        <D.21203>:
        // predicted unlikely by continue predictor.
        goto <D.21194>;
        <D.21196>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.21194>:
  i = i + 1;
  <D.21205>:
  i.15 = (unsigned int) i;
  D.21852 = info->num_fields;
  if (i.15 < D.21852) goto <D.21204>; else goto <D.21206>;
  <D.21206>:
}


mono_string_utf16_to_builder2 (gunichar2 * text)
{
  struct MonoStringBuilder * D.21858;
  struct MonoClass * string_builder_class.16;
  struct MonoImage * D.21862;
  struct MonoClass * string_builder_class.17;
  _Bool D.21864;
  long int D.21865;
  long int D.21866;
  struct MonoMethod * sb_ctor.18;
  struct MonoMethod * sb_ctor.19;
  _Bool D.21871;
  long int D.21872;
  long int D.21873;
  int len.20;
  int len.21;
  unsigned int len.22;
  unsigned int D.21879;
  gunichar2 * D.21880;
  short unsigned int D.21881;
  struct MonoDomain * D.21882;
  _Bool D.21883;
  long int D.21884;
  long int D.21885;
  struct MonoObject * exc.23;
  _Bool D.21889;
  long int D.21890;
  long int D.21891;
  int D.21894;
  unsigned int D.21895;
  struct MonoString * D.21896;
  mono_unichar2 * D.21897;
  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.21856>; else goto <D.21857>;
      <D.21856>:
      D.21858 = 0B;
      return D.21858;
      <D.21857>:
      string_builder_class.16 = string_builder_class;
      if (string_builder_class.16 == 0B) goto <D.21860>; else goto <D.21861>;
      <D.21860>:
      {
        struct MonoMethodDesc * desc;

        D.21862 = mono_defaults.corlib;
        string_builder_class.17 = mono_class_from_name (D.21862, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.17;
        string_builder_class.16 = string_builder_class;
        D.21864 = string_builder_class.16 == 0B;
        D.21865 = (long int) D.21864;
        D.21866 = __builtin_expect (D.21865, 0);
        if (D.21866 != 0) goto <D.21867>; else goto <D.21868>;
        <D.21867>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 846, "string_builder_class");
        <D.21868>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.16 = string_builder_class;
        sb_ctor.18 = mono_method_desc_search_in_class (desc, string_builder_class.16);
        sb_ctor = sb_ctor.18;
        sb_ctor.19 = sb_ctor;
        D.21871 = sb_ctor.19 == 0B;
        D.21872 = (long int) D.21871;
        D.21873 = __builtin_expect (D.21872, 0);
        if (D.21873 != 0) goto <D.21874>; else goto <D.21875>;
        <D.21874>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 849, "sb_ctor");
        <D.21875>:
        mono_method_desc_free (desc);
      }
      <D.21861>:
      len = 0;
      goto <D.18585>;
      <D.18584>:
      len.20 = len;
      len.21 = len.20 + 1;
      len = len.21;
      <D.18585>:
      len.20 = len;
      len.22 = (unsigned int) len.20;
      D.21879 = len.22 * 2;
      D.21880 = text + D.21879;
      D.21881 = *D.21880;
      if (D.21881 != 0) goto <D.18584>; else goto <D.18586>;
      <D.18586>:
      string_builder_class.16 = string_builder_class;
      D.21882 = mono_domain_get ();
      sb = mono_object_new (D.21882, string_builder_class.16);
      D.21883 = sb == 0B;
      D.21884 = (long int) D.21883;
      D.21885 = __builtin_expect (D.21884, 0);
      if (D.21885 != 0) goto <D.21886>; else goto <D.21887>;
      <D.21886>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 857, "sb");
      <D.21887>:
      args[0] = &len;
      sb_ctor.19 = sb_ctor;
      mono_runtime_invoke (sb_ctor.19, sb, &args, &exc);
      exc.23 = exc;
      D.21889 = exc.23 != 0B;
      D.21890 = (long int) D.21889;
      D.21891 = __builtin_expect (D.21890, 0);
      if (D.21891 != 0) goto <D.21892>; else goto <D.21893>;
      <D.21892>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 860, "!exc");
      <D.21893>:
      len.20 = len;
      sb->length = len.20;
      len.20 = len;
      D.21894 = len.20 * 2;
      D.21895 = (unsigned int) D.21894;
      D.21896 = sb->str;
      D.21897 = mono_string_chars (D.21896);
      memcpy (D.21897, text, D.21895);
      D.21858 = sb;
      return D.21858;
    }
  finally
    {
      len = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_string_utf8_to_builder2 (char * text)
{
  struct MonoStringBuilder * D.21902;
  struct MonoClass * string_builder_class.24;
  struct MonoImage * D.21906;
  struct MonoClass * string_builder_class.25;
  _Bool D.21908;
  long int D.21909;
  long int D.21910;
  struct MonoMethod * sb_ctor.26;
  struct MonoMethod * sb_ctor.27;
  _Bool D.21915;
  long int D.21916;
  long int D.21917;
  unsigned int D.21920;
  int l.28;
  struct MonoDomain * D.21922;
  _Bool D.21923;
  long int D.21924;
  long int D.21925;
  struct MonoObject * exc.29;
  _Bool D.21929;
  long int D.21930;
  long int D.21931;
  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.21900>; else goto <D.21901>;
      <D.21900>:
      D.21902 = 0B;
      return D.21902;
      <D.21901>:
      string_builder_class.24 = string_builder_class;
      if (string_builder_class.24 == 0B) goto <D.21904>; else goto <D.21905>;
      <D.21904>:
      {
        struct MonoMethodDesc * desc;

        D.21906 = mono_defaults.corlib;
        string_builder_class.25 = mono_class_from_name (D.21906, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.25;
        string_builder_class.24 = string_builder_class;
        D.21908 = string_builder_class.24 == 0B;
        D.21909 = (long int) D.21908;
        D.21910 = __builtin_expect (D.21909, 0);
        if (D.21910 != 0) goto <D.21911>; else goto <D.21912>;
        <D.21911>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 789, "string_builder_class");
        <D.21912>:
        desc = mono_method_desc_new (":.ctor(int)", 0);
        string_builder_class.24 = string_builder_class;
        sb_ctor.26 = mono_method_desc_search_in_class (desc, string_builder_class.24);
        sb_ctor = sb_ctor.26;
        sb_ctor.27 = sb_ctor;
        D.21915 = sb_ctor.27 == 0B;
        D.21916 = (long int) D.21915;
        D.21917 = __builtin_expect (D.21916, 0);
        if (D.21917 != 0) goto <D.21918>; else goto <D.21919>;
        <D.21918>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 792, "sb_ctor");
        <D.21919>:
        mono_method_desc_free (desc);
      }
      <D.21905>:
      D.21920 = strlen (text);
      l.28 = (int) D.21920;
      l = l.28;
      string_builder_class.24 = string_builder_class;
      D.21922 = mono_domain_get ();
      sb = mono_object_new (D.21922, string_builder_class.24);
      D.21923 = sb == 0B;
      D.21924 = (long int) D.21923;
      D.21925 = __builtin_expect (D.21924, 0);
      if (D.21925 != 0) goto <D.21926>; else goto <D.21927>;
      <D.21926>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 799, "sb");
      <D.21927>:
      args[0] = &l;
      sb_ctor.27 = sb_ctor;
      mono_runtime_invoke (sb_ctor.27, sb, &args, &exc);
      exc.29 = exc;
      D.21929 = exc.29 != 0B;
      D.21930 = (long int) D.21929;
      D.21931 = __builtin_expect (D.21930, 0);
      if (D.21931 != 0) goto <D.21932>; else goto <D.21933>;
      <D.21932>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 802, "!exc");
      <D.21933>:
      mono_string_utf8_to_builder (sb, text);
      D.21902 = sb;
      return D.21902;
    }
  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.21936;

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


mono_array_to_byvalarray (void * native_arr, struct MonoArray * arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.21937;
  struct MonoClass * D.21938;
  struct MonoClass * D.21939;
  struct MonoClass * D.21940;
  _Bool D.21941;
  long int D.21942;
  long int D.21943;
  struct MonoClass * D.21946;
  unsigned int D.21949;
  long int D.21950;
  char * D.21951;
  struct GError * error.30;
  gchar * D.21955;
  unsigned int iftmp.31;
  unsigned int D.21957;

  D.21937 = arr->obj.vtable;
  D.21938 = D.21937->klass;
  D.21939 = D.21938->element_class;
  D.21940 = mono_defaults.char_class;
  D.21941 = D.21939 != D.21940;
  D.21942 = (long int) D.21941;
  D.21943 = __builtin_expect (D.21942, 0);
  if (D.21943 != 0) goto <D.21944>; else goto <D.21945>;
  <D.21944>:
  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.21945>:
  D.21946 = mono_defaults.byte_class;
  if (D.21946 == elclass) goto <D.21947>; else goto <D.21948>;
  <D.21947>:
  {
    char * as;
    struct GError * error;

    try
      {
        error = 0B;
        D.21949 = mono_array_length (arr);
        D.21950 = (long int) D.21949;
        D.21951 = mono_array_addr_with_size (arr, 2, 0);
        as = monoeg_g_utf16_to_utf8 (D.21951, D.21950, 0B, 0B, &error);
        error.30 = error;
        if (error.30 != 0B) goto <D.21953>; else goto <D.21954>;
        <D.21953>:
        {
          struct MonoException * exc;

          error.30 = error;
          D.21955 = error.30->message;
          exc = mono_get_exception_argument ("string", D.21955);
          error.30 = error;
          monoeg_g_error_free (error.30);
          mono_raise_exception (exc);
        }
        <D.21954>:
        D.21957 = strlen (as);
        if (D.21957 < elnum) goto <D.21958>; else goto <D.21959>;
        <D.21958>:
        iftmp.31 = strlen (as);
        goto <D.21960>;
        <D.21959>:
        iftmp.31 = elnum;
        <D.21960>:
        memcpy (native_arr, as, iftmp.31);
        monoeg_g_free (as);
      }
    finally
      {
        error = {CLOBBER};
      }
  }
  goto <D.21961>;
  <D.21948>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 731);
  <D.21961>:
}


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

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


mono_byvalarray_to_array (struct MonoArray * arr, void * native_arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.21963;
  struct MonoClass * D.21964;
  struct MonoClass * D.21965;
  struct MonoClass * D.21966;
  _Bool D.21967;
  long int D.21968;
  long int D.21969;
  struct MonoClass * D.21972;
  long int elnum.32;
  struct GError * error.33;
  long int items_written.34;
  long unsigned int items_written.35;
  long unsigned int D.21981;
  char * D.21982;

  D.21963 = arr->obj.vtable;
  D.21964 = D.21963->klass;
  D.21965 = D.21964->element_class;
  D.21966 = mono_defaults.char_class;
  D.21967 = D.21965 != D.21966;
  D.21968 = (long int) D.21967;
  D.21969 = __builtin_expect (D.21968, 0);
  if (D.21969 != 0) goto <D.21970>; else goto <D.21971>;
  <D.21970>:
  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.21971>:
  D.21972 = mono_defaults.byte_class;
  if (D.21972 == elclass) goto <D.21973>; else goto <D.21974>;
  <D.21973>:
  {
    struct GError * error;
    guint16 * ut;
    glong items_written;

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


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

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


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

  D.21988 = mono_domain_get ();
  D.21987 = mono_string_new_len (D.21988, text, length);
  return D.21987;
}


mono_string_from_byvalwstr (gunichar2 * data, int max_len)
{
  struct MonoString * D.21992;
  unsigned int len.36;
  unsigned int D.21994;
  gunichar2 * D.21995;
  short unsigned int D.21996;
  int D.21997;
  struct MonoDomain * domain;
  int len;

  domain = mono_domain_get ();
  len = 0;
  if (data == 0B) goto <D.21990>; else goto <D.21991>;
  <D.21990>:
  D.21992 = 0B;
  return D.21992;
  <D.21991>:
  goto <D.18469>;
  <D.18468>:
  len = len + 1;
  <D.18469>:
  len.36 = (unsigned int) len;
  D.21994 = len.36 * 2;
  D.21995 = data + D.21994;
  D.21996 = *D.21995;
  if (D.21996 != 0) goto <D.18468>; else goto <D.18470>;
  <D.18470>:
  D.21997 = MIN_EXPR <max_len, len>;
  D.21992 = mono_string_new_utf16 (domain, data, D.21997);
  return D.21992;
}


mono_marshal_string_to_utf16_copy (struct MonoString * s)
{
  void * D.22001;
  int D.22002;
  int D.22003;
  int D.22004;
  long unsigned int D.22005;
  int D.22006;
  int D.22007;
  unsigned int D.22008;
  mono_unichar2 * D.22009;
  int D.22010;
  unsigned int D.22011;
  unsigned int D.22012;
  gunichar2 * D.22013;

  if (s == 0B) goto <D.21999>; else goto <D.22000>;
  <D.21999>:
  D.22001 = 0B;
  return D.22001;
  <D.22000>:
  {
    gunichar2 * res;

    D.22002 = mono_string_length (s);
    D.22003 = D.22002 + 1;
    D.22004 = D.22003 * 2;
    D.22005 = (long unsigned int) D.22004;
    res = mono_marshal_alloc (D.22005);
    D.22006 = mono_string_length (s);
    D.22007 = D.22006 * 2;
    D.22008 = (unsigned int) D.22007;
    D.22009 = mono_string_chars (s);
    memcpy (res, D.22009, D.22008);
    D.22010 = mono_string_length (s);
    D.22011 = (unsigned int) D.22010;
    D.22012 = D.22011 * 2;
    D.22013 = res + D.22012;
    *D.22013 = 0;
    D.22001 = res;
    return D.22001;
  }
}


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

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


mono_marshal_cleanup ()
{
  unsigned int load_type_info_tls_id.37;
  unsigned int last_error_tls_id.38;

  mono_cominterop_cleanup ();
  load_type_info_tls_id.37 = load_type_info_tls_id;
  mono_native_tls_free (load_type_info_tls_id.37);
  last_error_tls_id.38 = last_error_tls_id;
  mono_native_tls_free (last_error_tls_id.38);
  DeleteCriticalSection (&marshal_mutex);
  marshal_mutex_initialized = 0;
}


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


mono_delegate_to_ftnptr (struct MonoDelegate * delegate)
{
  void * D.22019;
  void * D.22020;
  struct MonoVTable * D.22023;
  unsigned char D.22024;
  unsigned char D.22025;
  _Bool D.22026;
  long int D.22027;
  long int D.22028;
  struct MonoMethodSignature * D.22031;
  unsigned char D.22032;
  unsigned char D.22033;
  const char * exc_class.39;
  _Bool D.22039;
  long int D.22040;
  long int D.22041;
  const char * exc_arg.40;
  struct MonoImage * D.22045;
  struct MonoException * D.22046;
  struct MonoObject * D.22047;
  void * D.22050;
  struct MonoMethod * method;
  struct MonoMethod * wrapper;
  struct MonoClass * klass;
  uint32_t target_handle;

  target_handle = 0;
  if (delegate == 0B) goto <D.22017>; else goto <D.22018>;
  <D.22017>:
  D.22019 = 0B;
  return D.22019;
  <D.22018>:
  D.22020 = delegate->delegate_trampoline;
  if (D.22020 != 0B) goto <D.22021>; else goto <D.22022>;
  <D.22021>:
  D.22019 = delegate->delegate_trampoline;
  return D.22019;
  <D.22022>:
  D.22023 = MEM[(struct MonoObject *)delegate].vtable;
  klass = D.22023->klass;
  D.22024 = BIT_FIELD_REF <*klass, 8, 184>;
  D.22025 = D.22024 & 1;
  D.22026 = D.22025 == 0;
  D.22027 = (long int) D.22026;
  D.22028 = __builtin_expect (D.22027, 0);
  if (D.22028 != 0) goto <D.22029>; else goto <D.22030>;
  <D.22029>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 352, "klass->delegate");
  <D.22030>:
  method = delegate->method;
  D.22031 = mono_method_signature (method);
  D.22032 = BIT_FIELD_REF <*D.22031, 8, 88>;
  D.22033 = D.22032 & 1;
  if (D.22033 != 0) goto <D.22034>; else goto <D.22035>;
  <D.22034>:
  {
    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.22036>; else goto <D.22037>;
        <D.22036>:
        exc_class.39 = exc_class;
        D.22039 = exc_class.39 == 0B;
        D.22040 = (long int) D.22039;
        D.22041 = __builtin_expect (D.22040, 0);
        if (D.22041 != 0) goto <D.22042>; else goto <D.22043>;
        <D.22042>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 362, "exc_class");
        <D.22043>:
        exc_arg.40 = exc_arg;
        exc_class.39 = exc_class;
        D.22045 = mono_defaults.corlib;
        D.22046 = mono_exception_from_name_msg (D.22045, "System", exc_class.39, exc_arg.40);
        mono_raise_exception (D.22046);
        <D.22037>:
        D.22019 = ftnptr;
        return D.22019;
      }
    finally
      {
        exc_class = {CLOBBER};
        exc_arg = {CLOBBER};
      }
  }
  <D.22035>:
  D.22047 = delegate->target;
  if (D.22047 != 0B) goto <D.22048>; else goto <D.22049>;
  <D.22048>:
  D.22047 = delegate->target;
  target_handle = mono_gchandle_new_weakref (D.22047, 0);
  <D.22049>:
  wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
  D.22050 = mono_compile_method (wrapper);
  delegate->delegate_trampoline = D.22050;
  delegate_hash_table_add (delegate);
  mono_object_register_finalizer (delegate);
  D.22019 = delegate->delegate_trampoline;
  return D.22019;
}


delegate_hash_table_add (struct MonoDelegate * d)
{
  _Bool D.22055;
  long int D.22056;
  long int D.22057;
  struct GHashTable * delegate_hash_table.41;
  struct GHashTable * delegate_hash_table.42;
  int D.22064;
  void * D.22067;
  void * D.22068;
  void * gchandle.43;
  _Bool D.22075;
  long int D.22076;
  long int D.22077;
  guint32 gchandle;
  guint32 old_gchandle;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22053>; else goto <D.22054>;
    <D.22053>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22054>:
    D.22055 = ret != 0;
    D.22056 = (long int) D.22055;
    D.22057 = __builtin_expect (D.22056, 0);
    if (D.22057 != 0) goto <D.22058>; else goto <D.22059>;
    <D.22058>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 420, "ret == 0");
    <D.22059>:
  }
  delegate_hash_table.41 = delegate_hash_table;
  if (delegate_hash_table.41 == 0B) goto <D.22061>; else goto <D.22062>;
  <D.22061>:
  delegate_hash_table.42 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.42;
  <D.22062>:
  D.22064 = mono_gc_is_moving ();
  if (D.22064 != 0) goto <D.22065>; else goto <D.22066>;
  <D.22065>:
  gchandle = mono_gchandle_new_weakref (d, 0);
  D.22067 = d->delegate_trampoline;
  delegate_hash_table.41 = delegate_hash_table;
  D.22068 = monoeg_g_hash_table_lookup (delegate_hash_table.41, D.22067);
  old_gchandle = (guint32) D.22068;
  gchandle.43 = (void *) gchandle;
  D.22067 = d->delegate_trampoline;
  delegate_hash_table.41 = delegate_hash_table;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.22067, gchandle.43, 0);
  if (old_gchandle != 0) goto <D.22070>; else goto <D.22071>;
  <D.22070>:
  mono_gchandle_free (old_gchandle);
  <D.22071>:
  goto <D.22072>;
  <D.22066>:
  D.22067 = d->delegate_trampoline;
  delegate_hash_table.41 = delegate_hash_table;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.22067, d, 0);
  <D.22072>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22073>; else goto <D.22074>;
    <D.22073>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22074>:
    D.22075 = ret != 0;
    D.22076 = (long int) D.22075;
    D.22077 = __builtin_expect (D.22076, 0);
    if (D.22077 != 0) goto <D.22078>; else goto <D.22079>;
    <D.22078>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 432, "ret == 0");
    <D.22079>:
  }
}


delegate_hash_table_new ()
{
  struct GHashTable * D.22080;

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


mono_marshal_use_aot_wrappers (gboolean use)
{
  use_aot_wrappers = use;
}


mono_ftnptr_to_delegate (struct MonoClass * klass, void * ftn)
{
  void * ftn.44;
  struct MonoDelegate * D.22085;
  _Bool D.22088;
  long int D.22089;
  long int D.22090;
  struct GHashTable * delegate_hash_table.45;
  struct GHashTable * delegate_hash_table.46;
  int D.22097;
  void * D.22100;
  _Bool D.22103;
  long int D.22104;
  long int D.22105;
  _Bool D.22114;
  long int D.22115;
  long int D.22116;
  int use_aot_wrappers.47;
  struct MonoClass * D.22124;
  struct MonoDomain * D.22125;
  struct MonoMethodSignature * D.22127;
  short unsigned int D.22128;
  int D.22129;
  int D.22130;
  unsigned int D.22131;
  unsigned int D.22132;
  struct MonoMethodSignature * D.22133;
  struct MonoImage * D.22134;
  struct MonoMethodSignature * D.22135;
  short unsigned int D.22136;
  unsigned int i.48;
  unsigned int D.22138;
  struct MonoMarshalSpec * * D.22139;
  struct MonoMarshalSpec * D.22140;
  struct MonoDomain * D.22143;
  void * D.22144;
  struct MonoVTable * D.22145;
  struct MonoDomain * D.22146;
  struct MonoDomain * D.22147;
  struct MonoException * D.22150;
  guint32 gchandle;
  struct MonoDelegate * d;

  ftn.44 = ftn;
  if (ftn.44 == 0B) goto <D.22083>; else goto <D.22084>;
  <D.22083>:
  D.22085 = 0B;
  return D.22085;
  <D.22084>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22086>; else goto <D.22087>;
    <D.22086>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22087>:
    D.22088 = ret != 0;
    D.22089 = (long int) D.22088;
    D.22090 = __builtin_expect (D.22089, 0);
    if (D.22090 != 0) goto <D.22091>; else goto <D.22092>;
    <D.22091>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 483, "ret == 0");
    <D.22092>:
  }
  delegate_hash_table.45 = delegate_hash_table;
  if (delegate_hash_table.45 == 0B) goto <D.22094>; else goto <D.22095>;
  <D.22094>:
  delegate_hash_table.46 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.46;
  <D.22095>:
  D.22097 = mono_gc_is_moving ();
  if (D.22097 != 0) goto <D.22098>; else goto <D.22099>;
  <D.22098>:
  ftn.44 = ftn;
  delegate_hash_table.45 = delegate_hash_table;
  D.22100 = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  gchandle = (guint32) D.22100;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22101>; else goto <D.22102>;
    <D.22101>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22102>:
    D.22103 = ret != 0;
    D.22104 = (long int) D.22103;
    D.22105 = __builtin_expect (D.22104, 0);
    if (D.22105 != 0) goto <D.22106>; else goto <D.22107>;
    <D.22106>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 489, "ret == 0");
    <D.22107>:
  }
  if (gchandle != 0) goto <D.22108>; else goto <D.22109>;
  <D.22108>:
  d = mono_gchandle_get_target (gchandle);
  goto <D.22110>;
  <D.22109>:
  d = 0B;
  <D.22110>:
  goto <D.22111>;
  <D.22099>:
  ftn.44 = ftn;
  delegate_hash_table.45 = delegate_hash_table;
  d = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22112>; else goto <D.22113>;
    <D.22112>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22113>:
    D.22114 = ret != 0;
    D.22115 = (long int) D.22114;
    D.22116 = __builtin_expect (D.22115, 0);
    if (D.22116 != 0) goto <D.22117>; else goto <D.22118>;
    <D.22117>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 496, "ret == 0");
    <D.22118>:
  }
  <D.22111>:
  if (d == 0B) goto <D.22119>; else goto <D.22120>;
  <D.22119>:
  {
    struct MonoMethodSignature * sig;
    struct MonoMethod * wrapper;
    struct MonoMarshalSpec * * mspecs;
    struct MonoMethod * invoke;
    struct MonoMethodPInvoke piinfo;
    struct MonoObject * this;
    int i;

    try
      {
        invoke = mono_get_delegate_invoke (klass);
        use_aot_wrappers.47 = use_aot_wrappers;
        if (use_aot_wrappers.47 != 0) goto <D.22122>; else goto <D.22123>;
        <D.22122>:
        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
        D.22124 = mono_defaults.int_class;
        D.22125 = mono_domain_get ();
        this = mono_value_box (D.22125, D.22124, &ftn);
        goto <D.22126>;
        <D.22123>:
        memset (&piinfo, 0, 32);
        parse_unmanaged_function_pointer_attr (klass, &piinfo);
        D.22127 = mono_method_signature (invoke);
        D.22128 = D.22127->param_count;
        D.22129 = (int) D.22128;
        D.22130 = D.22129 + 1;
        D.22131 = (unsigned int) D.22130;
        D.22132 = D.22131 * 4;
        mspecs = monoeg_malloc0 (D.22132);
        mono_method_get_marshal_info (invoke, mspecs);
        D.22133 = mono_method_signature (invoke);
        sig = mono_metadata_signature_dup (D.22133);
        sig->hasthis = 0;
        ftn.44 = ftn;
        D.22134 = klass->image;
        wrapper = mono_marshal_get_native_func_wrapper (D.22134, sig, &piinfo, mspecs, ftn.44);
        this = 0B;
        D.22135 = mono_method_signature (invoke);
        D.22136 = D.22135->param_count;
        i = (int) D.22136;
        goto <D.18452>;
        <D.18451>:
        i.48 = (unsigned int) i;
        D.22138 = i.48 * 4;
        D.22139 = mspecs + D.22138;
        D.22140 = *D.22139;
        if (D.22140 != 0B) goto <D.22141>; else goto <D.22142>;
        <D.22141>:
        i.48 = (unsigned int) i;
        D.22138 = i.48 * 4;
        D.22139 = mspecs + D.22138;
        D.22140 = *D.22139;
        mono_metadata_free_marshal_spec (D.22140);
        <D.22142>:
        i = i + -1;
        <D.18452>:
        if (i >= 0) goto <D.18451>; else goto <D.18453>;
        <D.18453>:
        monoeg_g_free (mspecs);
        monoeg_g_free (sig);
        <D.22126>:
        D.22143 = mono_domain_get ();
        d = mono_object_new (D.22143, klass);
        D.22144 = mono_compile_method (wrapper);
        mono_delegate_ctor_with_method (d, this, D.22144, wrapper);
      }
    finally
      {
        piinfo = {CLOBBER};
      }
  }
  <D.22120>:
  D.22145 = d->object.vtable;
  D.22146 = D.22145->domain;
  D.22147 = mono_domain_get ();
  if (D.22146 != D.22147) goto <D.22148>; else goto <D.22149>;
  <D.22148>:
  D.22150 = mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain");
  mono_raise_exception (D.22150);
  <D.22149>:
  D.22085 = d;
  return D.22085;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.22154;
  int D.22159;
  void * D.22161;
  unsigned int D.22162;

  D.22154 = __builtin_constant_p (__len);
  if (D.22154 != 0) goto <D.22155>; else goto <D.22156>;
  <D.22155>:
  if (__len == 0) goto <D.22157>; else goto <D.22158>;
  <D.22157>:
  D.22159 = __builtin_constant_p (__ch);
  if (D.22159 == 0) goto <D.22152>; else goto <D.22160>;
  <D.22160>:
  if (__ch != 0) goto <D.22152>; else goto <D.22153>;
  <D.22152>:
  __warn_memset_zero_len ();
  D.22161 = __dest;
  return D.22161;
  <D.22153>:
  <D.22158>:
  <D.22156>:
  D.22162 = __builtin_object_size (__dest, 0);
  D.22161 = __builtin___memset_chk (__dest, __ch, __len, D.22162);
  return D.22161;
}


parse_unmanaged_function_pointer_attr (struct MonoClass * klass, struct MonoMethodPInvoke * piinfo)
{
  struct MonoClass * UnmanagedFunctionPointerAttribute.49;
  struct MonoImage * D.22167;
  struct MonoClass * UnmanagedFunctionPointerAttribute.50;
  int D.22173;
  int D.22178;
  int D.22179;
  signed short D.22180;
  signed short iftmp.51;
  int D.22182;
  int D.22185;
  unsigned short D.22186;
  unsigned short D.22187;
  signed short D.22189;
  unsigned char D.22190;
  signed short D.22191;
  signed short D.22192;
  short unsigned int D.22193;
  int D.22194;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoCustomAttrInfo * cinfo;
  struct MonoReflectionUnmanagedFunctionPointerAttribute * attr;

  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 == 0B) goto <D.22165>; else goto <D.22166>;
  <D.22165>:
  D.22167 = mono_defaults.corlib;
  UnmanagedFunctionPointerAttribute.50 = mono_class_from_name (D.22167, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
  UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.50;
  <D.22166>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 != 0B) goto <D.22169>; else goto <D.22170>;
  <D.22169>:
  cinfo = mono_custom_attrs_from_class (klass);
  if (cinfo != 0B) goto <D.22171>; else goto <D.22172>;
  <D.22171>:
  D.22173 = mono_runtime_get_no_exec ();
  if (D.22173 == 0) goto <D.22174>; else goto <D.22175>;
  <D.22174>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  attr = mono_custom_attrs_get_attr (cinfo, UnmanagedFunctionPointerAttribute.49);
  if (attr != 0B) goto <D.22176>; else goto <D.22177>;
  <D.22176>:
  D.22178 = attr->call_conv;
  D.22179 = D.22178 << 8;
  D.22180 = (signed short) D.22179;
  D.22182 = attr->charset;
  if (D.22182 != 0) goto <D.22183>; else goto <D.22184>;
  <D.22183>:
  D.22182 = attr->charset;
  D.22185 = D.22182 + -1;
  D.22186 = (unsigned short) D.22185;
  D.22187 = D.22186 * 2;
  iftmp.51 = (signed short) D.22187;
  goto <D.22188>;
  <D.22184>:
  iftmp.51 = 1;
  <D.22188>:
  D.22189 = D.22180 | iftmp.51;
  D.22190 = attr->set_last_error;
  D.22191 = (signed short) D.22190;
  D.22192 = D.22189 | D.22191;
  D.22193 = (short unsigned int) D.22192;
  piinfo->piflags = D.22193;
  <D.22177>:
  D.22194 = cinfo->cached;
  if (D.22194 == 0) goto <D.22195>; else goto <D.22196>;
  <D.22195>:
  mono_custom_attrs_free (cinfo);
  <D.22196>:
  <D.22175>:
  <D.22172>:
  <D.22170>:
}


mono_delegate_free_ftnptr (struct MonoDelegate * delegate)
{
  void * * D.22197;
  struct MonoObject * D.22198;
  void * D.22203;
  struct MonoDomain * D.22204;
  _Bool D.22205;
  long int D.22206;
  long int D.22207;
  void * * D.22210;
  void * D.22211;
  struct MonoVTable * D.22214;
  struct MonoDomain * D.22215;
  struct MonoJitInfo * ji;
  void * ptr;

  delegate_hash_table_remove (delegate);
  D.22197 = &delegate->delegate_trampoline;
  ptr = InterlockedExchangePointer (D.22197, 0B);
  D.22198 = delegate->target;
  if (D.22198 == 0B) goto <D.22199>; else goto <D.22200>;
  <D.22199>:
  return;
  <D.22200>:
  if (ptr != 0B) goto <D.22201>; else goto <D.22202>;
  <D.22201>:
  {
    uint32_t gchandle;
    void * * method_data;
    struct MonoMethod * method;

    D.22203 = mono_get_addr_from_ftnptr (ptr);
    D.22204 = mono_domain_get ();
    ji = mono_jit_info_table_find (D.22204, D.22203);
    D.22205 = ji == 0B;
    D.22206 = (long int) D.22205;
    D.22207 = __builtin_expect (D.22206, 0);
    if (D.22207 != 0) goto <D.22208>; else goto <D.22209>;
    <D.22208>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 562, "ji");
    <D.22209>:
    method = mono_jit_info_get_method (ji);
    method_data = MEM[(struct MonoMethodWrapper *)method].method_data;
    D.22210 = method_data + 8;
    D.22211 = *D.22210;
    gchandle = (uint32_t) D.22211;
    if (gchandle != 0) goto <D.22212>; else goto <D.22213>;
    <D.22212>:
    mono_gchandle_free (gchandle);
    <D.22213>:
    D.22214 = MEM[(struct MonoObject *)delegate].vtable;
    D.22215 = D.22214->domain;
    mono_runtime_free_method (D.22215, method);
  }
  <D.22202>:
}


delegate_hash_table_remove (struct MonoDelegate * d)
{
  _Bool D.22219;
  long int D.22220;
  long int D.22221;
  struct GHashTable * delegate_hash_table.52;
  struct GHashTable * delegate_hash_table.53;
  int D.22228;
  void * D.22231;
  void * D.22232;
  _Bool D.22235;
  long int D.22236;
  long int D.22237;
  int D.22240;
  guint32 gchandle;

  gchandle = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22217>; else goto <D.22218>;
    <D.22217>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22218>:
    D.22219 = ret != 0;
    D.22220 = (long int) D.22219;
    D.22221 = __builtin_expect (D.22220, 0);
    if (D.22221 != 0) goto <D.22222>; else goto <D.22223>;
    <D.22222>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 403, "ret == 0");
    <D.22223>:
  }
  delegate_hash_table.52 = delegate_hash_table;
  if (delegate_hash_table.52 == 0B) goto <D.22225>; else goto <D.22226>;
  <D.22225>:
  delegate_hash_table.53 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.53;
  <D.22226>:
  D.22228 = mono_gc_is_moving ();
  if (D.22228 != 0) goto <D.22229>; else goto <D.22230>;
  <D.22229>:
  D.22231 = d->delegate_trampoline;
  delegate_hash_table.52 = delegate_hash_table;
  D.22232 = monoeg_g_hash_table_lookup (delegate_hash_table.52, D.22231);
  gchandle = (guint32) D.22232;
  <D.22230>:
  D.22231 = d->delegate_trampoline;
  delegate_hash_table.52 = delegate_hash_table;
  monoeg_g_hash_table_remove (delegate_hash_table.52, D.22231);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22233>; else goto <D.22234>;
    <D.22233>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22234>:
    D.22235 = ret != 0;
    D.22236 = (long int) D.22235;
    D.22237 = __builtin_expect (D.22236, 0);
    if (D.22237 != 0) goto <D.22238>; else goto <D.22239>;
    <D.22238>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 409, "ret == 0");
    <D.22239>:
  }
  D.22240 = mono_gc_is_moving ();
  if (D.22240 != 0) goto <D.22241>; else goto <D.22242>;
  <D.22241>:
  mono_gchandle_free (gchandle);
  <D.22242>:
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  unsigned int new_val.54;
  unsigned int old_val.55;
  unsigned int D.22245;
  void * D.22246;
  void * D.22247;
  void * old_val;

  <D.17866>:
  old_val = *val;
  new_val.54 = (unsigned int) new_val;
  old_val.55 = (unsigned int) old_val;
  D.22245 = __sync_val_compare_and_swap_4 (val, old_val.55, new_val.54);
  D.22246 = (void *) D.22245;
  if (D.22246 != old_val) goto <D.17866>; else goto <D.17867>;
  <D.17867>:
  D.22247 = old_val;
  return D.22247;
}


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

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


mono_array_to_lparray (struct MonoArray * array)
{
  void * D.22255;
  struct MonoVTable * D.22256;
  struct MonoClass * D.22257;
  unsigned char D.22258;
  int D.22259;
  unsigned int D.22260;
  unsigned int nativeArraySize.56;
  unsigned int D.22262;
  unsigned int i.57;
  unsigned int D.22264;
  void * * D.22265;
  double[0:] * D.22266;
  void * * D.22267;
  void * D.22268;
  void * D.22269;
  void * * nativeArray;
  int nativeArraySize;
  int i;
  struct MonoClass * klass;

  nativeArray = 0B;
  nativeArraySize = 0;
  i = 0;
  if (array == 0B) goto <D.22253>; else goto <D.22254>;
  <D.22253>:
  D.22255 = 0B;
  return D.22255;
  <D.22254>:
  D.22256 = array->obj.vtable;
  klass = D.22256->klass;
  D.22257 = klass->element_class;
  D.22258 = D.22257->byval_arg.type;
  D.22259 = (int) D.22258;
  switch (D.22259) <default: <D.18508>, case 1: <D.18481>, case 2: <D.18487>, case 3: <D.18490>, case 4: <D.18488>, case 5: <D.18486>, case 6: <D.18491>, case 7: <D.18489>, case 8: <D.18494>, case 9: <D.18495>, case 10: <D.18497>, case 11: <D.18496>, case 12: <D.18498>, case 13: <D.18499>, case 14: <D.18507>, case 15: <D.18501>, case 17: <D.18500>, case 18: <D.18482>, case 20: <D.18505>, case 21: <D.18503>, case 24: <D.18492>, case 25: <D.18493>, case 28: <D.18504>, case 29: <D.18506>>
  <D.18481>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 620);
  <D.18482>:
  D.22260 = array->max_length;
  nativeArraySize = (int) D.22260;
  nativeArraySize.56 = (unsigned int) nativeArraySize;
  D.22262 = nativeArraySize.56 * 4;
  nativeArray = malloc (D.22262);
  i = 0;
  goto <D.18484>;
  <D.18483>:
  i.57 = (unsigned int) i;
  D.22264 = i.57 * 4;
  D.22265 = nativeArray + D.22264;
  D.22266 = &array->vector;
  i.57 = (unsigned int) i;
  D.22264 = i.57 * 4;
  D.22267 = D.22266 + D.22264;
  D.22268 = *D.22267;
  D.22269 = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (D.22268);
  *D.22265 = D.22269;
  i = i + 1;
  <D.18484>:
  if (i < nativeArraySize) goto <D.18483>; else goto <D.18485>;
  <D.18485>:
  D.22255 = nativeArray;
  return D.22255;
  <D.18486>:
  <D.18487>:
  <D.18488>:
  <D.18489>:
  <D.18490>:
  <D.18491>:
  <D.18492>:
  <D.18493>:
  <D.18494>:
  <D.18495>:
  <D.18496>:
  <D.18497>:
  <D.18498>:
  <D.18499>:
  <D.18500>:
  <D.18501>:
  goto <D.18502>;
  <D.18503>:
  <D.18504>:
  <D.18505>:
  <D.18506>:
  <D.18507>:
  <D.18508>:
  D.22257 = klass->element_class;
  D.22258 = D.22257->byval_arg.type;
  D.22259 = (int) D.22258;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.22259);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 653);
  <D.18502>:
  D.22255 = &array->vector;
  return D.22255;
}


mono_free_lparray (struct MonoArray * array, void * * nativeArray)
{
  struct MonoVTable * D.22276;
  struct MonoClass * D.22277;
  unsigned char D.22278;
  int D.22279;
  unsigned int i.58;
  unsigned int D.22281;
  void * * D.22282;
  void * D.22283;
  unsigned int i.59;
  unsigned int D.22285;
  struct MonoClass * klass;
  int i;

  i = 0;
  if (array == 0B) goto <D.22272>; else goto <D.22273>;
  <D.22272>:
  return;
  <D.22273>:
  if (nativeArray == 0B) goto <D.22274>; else goto <D.22275>;
  <D.22274>:
  return;
  <D.22275>:
  D.22276 = array->obj.vtable;
  klass = D.22276->klass;
  D.22277 = klass->element_class;
  D.22278 = D.22277->byval_arg.type;
  D.22279 = (int) D.22278;
  switch (D.22279) <default: <D.22286>, case 18: <D.18515>>
  <D.18515>:
  i = 0;
  goto <D.18517>;
  <D.18516>:
  i.58 = (unsigned int) i;
  D.22281 = i.58 * 4;
  D.22282 = nativeArray + D.22281;
  D.22283 = *D.22282;
  mono_marshal_free_ccw (D.22283);
  i = i + 1;
  <D.18517>:
  i.59 = (unsigned int) i;
  D.22285 = array->max_length;
  if (i.59 < D.22285) goto <D.18516>; else goto <D.18518>;
  <D.18518>:
  free (nativeArray);
  goto <D.18519>;
  <D.22286>:
  <D.18519>:
}


mono_string_utf8_to_builder (struct MonoStringBuilder * sb, char * text)
{
  _Bool D.22288;
  _Bool D.22289;
  _Bool D.22290;
  unsigned int D.22293;
  long int iftmp.60;
  struct MonoString * D.22295;
  long int items_written.61;
  glong iftmp.62;
  struct GError * error.63;
  struct MonoString * D.22312;
  struct MonoDomain * D.22313;
  struct MonoString * D.22314;
  struct MonoString * * D.22315;
  long int D.22316;
  unsigned int D.22317;
  mono_unichar2 * D.22318;
  struct GError * error;
  guint16 * ut;
  glong items_written;
  int l;

  try
    {
      error = 0B;
      D.22288 = sb == 0B;
      D.22289 = text == 0B;
      D.22290 = D.22288 | D.22289;
      if (D.22290 != 0) goto <D.22291>; else goto <D.22292>;
      <D.22291>:
      return;
      <D.22292>:
      D.22293 = strlen (text);
      l = (int) D.22293;
      ut = monoeg_g_utf8_to_utf16 (text, l, 0B, &items_written, &error);
      D.22295 = sb->str;
      if (D.22295 != 0B) goto <D.22296>; else goto <D.22297>;
      <D.22296>:
      D.22295 = sb->str;
      iftmp.60 = D.22295->length;
      goto <D.22298>;
      <D.22297>:
      iftmp.60 = 16;
      <D.22298>:
      items_written.61 = items_written;
      if (iftmp.60 < items_written.61) goto <D.22300>; else goto <D.22301>;
      <D.22300>:
      D.22295 = sb->str;
      if (D.22295 != 0B) goto <D.22303>; else goto <D.22304>;
      <D.22303>:
      D.22295 = sb->str;
      iftmp.62 = D.22295->length;
      goto <D.22305>;
      <D.22304>:
      iftmp.62 = 16;
      <D.22305>:
      items_written = iftmp.62;
      <D.22301>:
      error.63 = error;
      if (error.63 == 0B) goto <D.22307>; else goto <D.22308>;
      <D.22307>:
      D.22295 = sb->str;
      if (D.22295 == 0B) goto <D.22309>; else goto <D.22311>;
      <D.22311>:
      D.22295 = sb->str;
      D.22312 = sb->cached_str;
      if (D.22295 == D.22312) goto <D.22309>; else goto <D.22310>;
      <D.22309>:
      items_written.61 = items_written;
      D.22313 = mono_domain_get ();
      D.22314 = mono_string_new_size (D.22313, items_written.61);
      D.22315 = &sb->str;
      mono_gc_wbarrier_set_field (sb, D.22315, D.22314);
      <D.22310>:
      items_written.61 = items_written;
      D.22316 = items_written.61 * 2;
      D.22317 = (unsigned int) D.22316;
      D.22295 = sb->str;
      D.22318 = mono_string_chars (D.22295);
      memcpy (D.22318, ut, D.22317);
      items_written.61 = items_written;
      sb->length = items_written.61;
      sb->cached_str = 0B;
      goto <D.22319>;
      <D.22308>:
      error.63 = error;
      monoeg_g_error_free (error.63);
      <D.22319>:
      monoeg_g_free (ut);
    }
  finally
    {
      error = {CLOBBER};
      items_written = {CLOBBER};
    }
}


mono_string_utf16_to_builder (struct MonoStringBuilder * sb, gunichar2 * text)
{
  _Bool D.22323;
  _Bool D.22324;
  _Bool D.22325;
  struct MonoString * D.22328;
  mono_unichar2 * D.22329;
  _Bool D.22330;
  long int D.22331;
  long int D.22332;
  unsigned int D.22335;
  gunichar2 * D.22336;
  short unsigned int D.22337;
  int len.64;
  guint32 len;

  D.22323 = sb == 0B;
  D.22324 = text == 0B;
  D.22325 = D.22323 | D.22324;
  if (D.22325 != 0) goto <D.22326>; else goto <D.22327>;
  <D.22326>:
  return;
  <D.22327>:
  D.22328 = sb->str;
  D.22329 = mono_string_chars (D.22328);
  D.22330 = D.22329 != text;
  D.22331 = (long int) D.22330;
  D.22332 = __builtin_expect (D.22331, 0);
  if (D.22332 != 0) goto <D.22333>; else goto <D.22334>;
  <D.22333>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 821, "mono_string_chars (sb->str) == text");
  <D.22334>:
  len = 0;
  goto <D.18572>;
  <D.18571>:
  len = len + 1;
  <D.18572>:
  D.22335 = len * 2;
  D.22336 = text + D.22335;
  D.22337 = *D.22336;
  if (D.22337 != 0) goto <D.18571>; else goto <D.18573>;
  <D.18573>:
  len.64 = (int) len;
  sb->length = len.64;
}


mono_string_builder_to_utf8 (struct MonoStringBuilder * sb)
{
  void * D.22342;
  struct MonoString * D.22343;
  struct MonoString * D.22344;
  int D.22347;
  struct MonoDomain * D.22350;
  struct MonoString * D.22351;
  struct MonoString * * D.22352;
  int D.22353;
  mono_unichar2 * D.22354;
  struct GError * error.65;
  struct MonoException * D.22358;
  gulong iftmp.66;
  int D.22363;
  int D.22365;
  unsigned int D.22366;
  struct GError * error;
  gchar * tmp;
  gchar * res;

  try
    {
      error = 0B;
      res = 0B;
      if (sb == 0B) goto <D.22340>; else goto <D.22341>;
      <D.22340>:
      D.22342 = 0B;
      return D.22342;
      <D.22341>:
      D.22343 = sb->str;
      D.22344 = sb->cached_str;
      if (D.22343 == D.22344) goto <D.22345>; else goto <D.22346>;
      <D.22345>:
      D.22343 = sb->str;
      D.22347 = D.22343->length;
      if (D.22347 == 0) goto <D.22348>; else goto <D.22349>;
      <D.22348>:
      D.22350 = mono_domain_get ();
      D.22351 = mono_string_new_size (D.22350, 16);
      D.22352 = &sb->str;
      mono_gc_wbarrier_set_field (sb, D.22352, D.22351);
      sb->cached_str = 0B;
      <D.22349>:
      <D.22346>:
      D.22353 = sb->length;
      D.22343 = sb->str;
      D.22354 = mono_string_chars (D.22343);
      tmp = monoeg_g_utf16_to_utf8 (D.22354, D.22353, 0B, 0B, &error);
      error.65 = error;
      if (error.65 != 0B) goto <D.22356>; else goto <D.22357>;
      <D.22356>:
      error.65 = error;
      monoeg_g_error_free (error.65);
      D.22358 = mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8");
      mono_raise_exception (D.22358);
      goto <D.22359>;
      <D.22357>:
      D.22343 = sb->str;
      if (D.22343 != 0B) goto <D.22361>; else goto <D.22362>;
      <D.22361>:
      D.22343 = sb->str;
      D.22347 = D.22343->length;
      D.22363 = D.22347 + 1;
      iftmp.66 = (gulong) D.22363;
      goto <D.22364>;
      <D.22362>:
      iftmp.66 = 17;
      <D.22364>:
      res = mono_marshal_alloc (iftmp.66);
      D.22353 = sb->length;
      D.22365 = D.22353 + 1;
      D.22366 = (unsigned int) D.22365;
      memcpy (res, tmp, D.22366);
      monoeg_g_free (tmp);
      <D.22359>:
      D.22342 = res;
      return D.22342;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_string_builder_to_utf16 (struct MonoStringBuilder * sb)
{
  void * D.22371;
  struct MonoString * D.22372;
  _Bool D.22373;
  long int D.22374;
  long int D.22375;
  struct MonoString * D.22378;
  int D.22381;
  struct MonoDomain * D.22384;
  struct MonoString * D.22385;
  struct MonoString * * D.22386;
  int iftmp.67;
  mono_unichar2 * D.22392;
  struct MonoDomain * D.22393;
  struct MonoString * D.22394;
  int D.22395;
  mono_unichar2 * D.22398;

  if (sb == 0B) goto <D.22369>; else goto <D.22370>;
  <D.22369>:
  D.22371 = 0B;
  return D.22371;
  <D.22370>:
  D.22372 = sb->str;
  D.22373 = D.22372 == 0B;
  D.22374 = (long int) D.22373;
  D.22375 = __builtin_expect (D.22374, 0);
  if (D.22375 != 0) goto <D.22376>; else goto <D.22377>;
  <D.22376>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 925, "sb->str");
  <D.22377>:
  D.22372 = sb->str;
  D.22378 = sb->cached_str;
  if (D.22372 == D.22378) goto <D.22379>; else goto <D.22380>;
  <D.22379>:
  D.22372 = sb->str;
  D.22381 = D.22372->length;
  if (D.22381 == 0) goto <D.22382>; else goto <D.22383>;
  <D.22382>:
  D.22384 = mono_domain_get ();
  D.22385 = mono_string_new_size (D.22384, 16);
  D.22386 = &sb->str;
  mono_gc_wbarrier_set_field (sb, D.22386, D.22385);
  goto <D.22387>;
  <D.22383>:
  D.22372 = sb->str;
  if (D.22372 != 0B) goto <D.22389>; else goto <D.22390>;
  <D.22389>:
  D.22372 = sb->str;
  iftmp.67 = D.22372->length;
  goto <D.22391>;
  <D.22390>:
  iftmp.67 = 16;
  <D.22391>:
  D.22372 = sb->str;
  D.22392 = mono_string_chars (D.22372);
  D.22393 = mono_domain_get ();
  D.22394 = mono_string_new_utf16 (D.22393, D.22392, iftmp.67);
  D.22386 = &sb->str;
  mono_gc_wbarrier_set_field (sb, D.22386, D.22394);
  <D.22387>:
  sb->cached_str = 0B;
  <D.22380>:
  D.22395 = sb->length;
  if (D.22395 == 0) goto <D.22396>; else goto <D.22397>;
  <D.22396>:
  D.22372 = sb->str;
  D.22398 = mono_string_chars (D.22372);
  *D.22398 = 0;
  <D.22397>:
  D.22372 = sb->str;
  D.22371 = mono_string_chars (D.22372);
  return D.22371;
}


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

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


mono_string_to_byvalstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.22402;
  long int D.22403;
  long int D.22404;
  _Bool D.22407;
  long int D.22408;
  long int D.22409;
  unsigned int size.68;
  int iftmp.69;
  unsigned int D.22416;
  unsigned int D.22419;
  unsigned int len.70;
  char * s;
  int len;

  D.22402 = dst == 0B;
  D.22403 = (long int) D.22402;
  D.22404 = __builtin_expect (D.22403, 0);
  if (D.22404 != 0) goto <D.22405>; else goto <D.22406>;
  <D.22405>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1006, "dst != NULL");
  <D.22406>:
  D.22407 = size <= 0;
  D.22408 = (long int) D.22407;
  D.22409 = __builtin_expect (D.22408, 0);
  if (D.22409 != 0) goto <D.22410>; else goto <D.22411>;
  <D.22410>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1007, "size > 0");
  <D.22411>:
  size.68 = (unsigned int) size;
  memset (dst, 0, size.68);
  if (src == 0B) goto <D.22413>; else goto <D.22414>;
  <D.22413>:
  return;
  <D.22414>:
  s = mono_string_to_utf8 (src);
  size.68 = (unsigned int) size;
  D.22416 = strlen (s);
  if (size.68 >= D.22416) goto <D.22417>; else goto <D.22418>;
  <D.22417>:
  D.22419 = strlen (s);
  iftmp.69 = (int) D.22419;
  goto <D.22420>;
  <D.22418>:
  iftmp.69 = size;
  <D.22420>:
  len = iftmp.69;
  if (len >= size) goto <D.22421>; else goto <D.22422>;
  <D.22421>:
  len = len + -1;
  <D.22422>:
  len.70 = (unsigned int) len;
  memcpy (dst, s, len.70);
  monoeg_g_free (s);
}


mono_string_to_byvalwstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.22425;
  long int D.22426;
  long int D.22427;
  _Bool D.22430;
  long int D.22431;
  long int D.22432;
  int D.22437;
  unsigned int D.22438;
  int iftmp.71;
  int D.22440;
  mono_unichar2 * D.22444;
  int D.22445;
  unsigned int len.72;
  unsigned int D.22449;
  gunichar2 * D.22450;
  int len;

  D.22425 = dst == 0B;
  D.22426 = (long int) D.22425;
  D.22427 = __builtin_expect (D.22426, 0);
  if (D.22427 != 0) goto <D.22428>; else goto <D.22429>;
  <D.22428>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1036, "dst != NULL");
  <D.22429>:
  D.22430 = size <= 1;
  D.22431 = (long int) D.22430;
  D.22432 = __builtin_expect (D.22431, 0);
  if (D.22432 != 0) goto <D.22433>; else goto <D.22434>;
  <D.22433>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1037, "size > 1");
  <D.22434>:
  if (src == 0B) goto <D.22435>; else goto <D.22436>;
  <D.22435>:
  D.22437 = size * 2;
  D.22438 = (unsigned int) D.22437;
  memset (dst, 0, D.22438);
  return;
  <D.22436>:
  D.22440 = mono_string_length (src);
  if (D.22440 <= size) goto <D.22441>; else goto <D.22442>;
  <D.22441>:
  iftmp.71 = mono_string_length (src);
  goto <D.22443>;
  <D.22442>:
  iftmp.71 = size;
  <D.22443>:
  len = iftmp.71;
  D.22437 = size * 2;
  D.22438 = (unsigned int) D.22437;
  D.22444 = mono_string_chars (src);
  memcpy (dst, D.22444, D.22438);
  D.22445 = mono_string_length (src);
  if (D.22445 >= size) goto <D.22446>; else goto <D.22447>;
  <D.22446>:
  len = len + -1;
  <D.22447>:
  len.72 = (unsigned int) len;
  D.22449 = len.72 * 2;
  D.22450 = dst + D.22449;
  *D.22450 = 0;
}


mono_type_to_ldind (struct MonoType * type)
{
  unsigned char D.22452;
  unsigned char D.22453;
  guint D.22456;
  unsigned char D.22457;
  int D.22458;
  struct MonoClass * D.22459;
  unsigned char D.22460;
  unsigned char D.22461;
  struct MonoGenericClass * D.22464;
  struct MonoClass * D.22465;
  void handle_enum = <<< error >>>;

  D.22452 = BIT_FIELD_REF <*type, 8, 56>;
  D.22453 = D.22452 & 64;
  if (D.22453 != 0) goto <D.22454>; else goto <D.22455>;
  <D.22454>:
  D.22456 = 77;
  return D.22456;
  <D.22455>:
  handle_enum:
  D.22457 = type->type;
  D.22458 = (int) D.22457;
  switch (D.22458) <default: <D.18670>, case 2: <D.18648>, case 3: <D.18651>, case 4: <D.18646>, case 5: <D.18647>, case 6: <D.18649>, case 7: <D.18650>, case 8: <D.18652>, case 9: <D.18653>, case 10: <D.18663>, case 11: <D.18664>, case 12: <D.18665>, case 13: <D.18666>, case 14: <D.18659>, case 15: <D.18656>, case 17: <D.18667>, case 18: <D.18658>, case 20: <D.18662>, case 21: <D.18669>, case 22: <D.18668>, case 24: <D.18654>, case 25: <D.18655>, case 27: <D.18657>, case 28: <D.18660>, case 29: <D.18661>>
  <D.18646>:
  D.22456 = 70;
  return D.22456;
  <D.18647>:
  <D.18648>:
  D.22456 = 71;
  return D.22456;
  <D.18649>:
  D.22456 = 72;
  return D.22456;
  <D.18650>:
  <D.18651>:
  D.22456 = 73;
  return D.22456;
  <D.18652>:
  D.22456 = 74;
  return D.22456;
  <D.18653>:
  D.22456 = 75;
  return D.22456;
  <D.18654>:
  <D.18655>:
  <D.18656>:
  <D.18657>:
  D.22456 = 77;
  return D.22456;
  <D.18658>:
  <D.18659>:
  <D.18660>:
  <D.18661>:
  <D.18662>:
  D.22456 = 80;
  return D.22456;
  <D.18663>:
  <D.18664>:
  D.22456 = 76;
  return D.22456;
  <D.18665>:
  D.22456 = 78;
  return D.22456;
  <D.18666>:
  D.22456 = 79;
  return D.22456;
  <D.18667>:
  D.22459 = type->data.klass;
  D.22460 = BIT_FIELD_REF <*D.22459, 8, 160>;
  D.22461 = D.22460 & 16;
  if (D.22461 != 0) goto <D.22462>; else goto <D.22463>;
  <D.22462>:
  D.22459 = type->data.klass;
  type = mono_class_enum_basetype (D.22459);
  goto handle_enum;
  <D.22463>:
  D.22456 = 113;
  return D.22456;
  <D.18668>:
  D.22456 = 113;
  return D.22456;
  <D.18669>:
  D.22464 = type->data.generic_class;
  D.22465 = D.22464->container_class;
  type = &D.22465->byval_arg;
  goto handle_enum;
  <D.18670>:
  D.22457 = type->type;
  D.22458 = (int) D.22457;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_ldind", D.22458);
  <D.18671>:
  goto <D.18671>;
  D.22456 = 4294967295;
  return D.22456;
}


mono_type_to_stind (struct MonoType * type)
{
  unsigned char D.22467;
  unsigned char D.22468;
  guint D.22471;
  unsigned char D.22472;
  int D.22473;
  struct MonoClass * D.22474;
  unsigned char D.22475;
  unsigned char D.22476;
  struct MonoGenericClass * D.22479;
  struct MonoClass * D.22480;
  void handle_enum = <<< error >>>;

  D.22467 = BIT_FIELD_REF <*type, 8, 56>;
  D.22468 = D.22467 & 64;
  if (D.22468 != 0) goto <D.22469>; else goto <D.22470>;
  <D.22469>:
  D.22471 = 223;
  return D.22471;
  <D.22470>:
  handle_enum:
  D.22472 = type->type;
  D.22473 = (int) D.22472;
  switch (D.22473) <default: <D.18700>, case 2: <D.18678>, case 3: <D.18681>, case 4: <D.18676>, case 5: <D.18677>, case 6: <D.18679>, case 7: <D.18680>, case 8: <D.18682>, case 9: <D.18683>, case 10: <D.18693>, case 11: <D.18694>, case 12: <D.18695>, case 13: <D.18696>, case 14: <D.18689>, case 15: <D.18686>, case 17: <D.18697>, case 18: <D.18688>, case 20: <D.18692>, case 21: <D.18699>, case 22: <D.18698>, case 24: <D.18684>, case 25: <D.18685>, case 27: <D.18687>, case 28: <D.18690>, case 29: <D.18691>>
  <D.18676>:
  <D.18677>:
  <D.18678>:
  D.22471 = 82;
  return D.22471;
  <D.18679>:
  <D.18680>:
  <D.18681>:
  D.22471 = 83;
  return D.22471;
  <D.18682>:
  <D.18683>:
  D.22471 = 84;
  return D.22471;
  <D.18684>:
  <D.18685>:
  <D.18686>:
  <D.18687>:
  D.22471 = 223;
  return D.22471;
  <D.18688>:
  <D.18689>:
  <D.18690>:
  <D.18691>:
  <D.18692>:
  D.22471 = 81;
  return D.22471;
  <D.18693>:
  <D.18694>:
  D.22471 = 85;
  return D.22471;
  <D.18695>:
  D.22471 = 86;
  return D.22471;
  <D.18696>:
  D.22471 = 87;
  return D.22471;
  <D.18697>:
  D.22474 = type->data.klass;
  D.22475 = BIT_FIELD_REF <*D.22474, 8, 160>;
  D.22476 = D.22475 & 16;
  if (D.22476 != 0) goto <D.22477>; else goto <D.22478>;
  <D.22477>:
  D.22474 = type->data.klass;
  type = mono_class_enum_basetype (D.22474);
  goto handle_enum;
  <D.22478>:
  D.22471 = 129;
  return D.22471;
  <D.18698>:
  D.22471 = 129;
  return D.22471;
  <D.18699>:
  D.22479 = type->data.generic_class;
  D.22480 = D.22479->container_class;
  type = &D.22480->byval_arg;
  goto handle_enum;
  <D.18700>:
  D.22472 = type->type;
  D.22473 = (int) D.22472;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_stind", D.22473);
  <D.18701>:
  goto <D.18701>;
  D.22471 = 4294967295;
  return D.22471;
}


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


emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  char * D.22482;
  char * D.22483;

  D.22482 = mb->name;
  D.22483 = strstr (D.22482, "mono_thread_interruption_checkpoint");
  if (D.22483 != 0B) goto <D.22484>; else goto <D.22485>;
  <D.22484>:
  return;
  <D.22485>:
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
}


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

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


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

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


get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.22492;
  _Bool D.22497;
  long int D.22498;
  long int D.22499;
  _Bool D.22506;
  long int D.22507;
  long int D.22508;
  struct GHashTable * D.22511;

  D.22492 = *var;
  if (D.22492 == 0B) goto <D.22493>; else goto <D.22494>;
  <D.22493>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22495>; else goto <D.22496>;
    <D.22495>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22496>:
    D.22497 = ret != 0;
    D.22498 = (long int) D.22497;
    D.22499 = __builtin_expect (D.22498, 0);
    if (D.22499 != 0) goto <D.22500>; else goto <D.22501>;
    <D.22500>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2432, "ret == 0");
    <D.22501>:
  }
  D.22492 = *var;
  if (D.22492 == 0B) goto <D.22502>; else goto <D.22503>;
  <D.22502>:
  {
    struct GHashTable * cache;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22504>; else goto <D.22505>;
    <D.22504>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22505>:
    D.22506 = ret != 0;
    D.22507 = (long int) D.22506;
    D.22508 = __builtin_expect (D.22507, 0);
    if (D.22508 != 0) goto <D.22509>; else goto <D.22510>;
    <D.22509>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2439, "ret == 0");
    <D.22510>:
  }
  <D.22494>:
  D.22511 = *var;
  return D.22511;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_marshal_find_in_cache (struct GHashTable * cache, void * key)
{
  _Bool D.22515;
  long int D.22516;
  long int D.22517;
  _Bool D.22522;
  long int D.22523;
  long int D.22524;
  struct MonoMethod * D.22527;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22513>; else goto <D.22514>;
    <D.22513>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22514>:
    D.22515 = ret != 0;
    D.22516 = (long int) D.22515;
    D.22517 = __builtin_expect (D.22516, 0);
    if (D.22517 != 0) goto <D.22518>; else goto <D.22519>;
    <D.22518>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2471, "ret == 0");
    <D.22519>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22520>; else goto <D.22521>;
    <D.22520>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22521>:
    D.22522 = ret != 0;
    D.22523 = (long int) D.22522;
    D.22524 = __builtin_expect (D.22523, 0);
    if (D.22524 != 0) goto <D.22525>; else goto <D.22526>;
    <D.22525>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2473, "ret == 0");
    <D.22526>:
  }
  D.22527 = res;
  return D.22527;
}


mono_mb_create_and_cache (struct GHashTable * cache, void * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  _Bool D.22531;
  long int D.22532;
  long int D.22533;
  _Bool D.22538;
  long int D.22539;
  long int D.22540;
  _Bool D.22547;
  long int D.22548;
  long int D.22549;
  _Bool D.22556;
  long int D.22557;
  long int D.22558;
  _Bool D.22564;
  long int D.22565;
  long int D.22566;
  struct MonoMethod * D.22569;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22529>; else goto <D.22530>;
    <D.22529>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22530>:
    D.22531 = ret != 0;
    D.22532 = (long int) D.22531;
    D.22533 = __builtin_expect (D.22532, 0);
    if (D.22533 != 0) goto <D.22534>; else goto <D.22535>;
    <D.22534>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2485, "ret == 0");
    <D.22535>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22536>; else goto <D.22537>;
    <D.22536>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22537>:
    D.22538 = ret != 0;
    D.22539 = (long int) D.22538;
    D.22540 = __builtin_expect (D.22539, 0);
    if (D.22540 != 0) goto <D.22541>; else goto <D.22542>;
    <D.22541>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2487, "ret == 0");
    <D.22542>:
  }
  if (res == 0B) goto <D.22543>; else goto <D.22544>;
  <D.22543>:
  {
    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.22545>; else goto <D.22546>;
      <D.22545>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.22546>:
      D.22547 = ret != 0;
      D.22548 = (long int) D.22547;
      D.22549 = __builtin_expect (D.22548, 0);
      if (D.22549 != 0) goto <D.22550>; else goto <D.22551>;
      <D.22550>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2491, "ret == 0");
      <D.22551>:
    }
    res = monoeg_g_hash_table_lookup (cache, key);
    if (res == 0B) goto <D.22552>; else goto <D.22553>;
    <D.22552>:
    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.22554>; else goto <D.22555>;
      <D.22554>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22555>:
      D.22556 = ret != 0;
      D.22557 = (long int) D.22556;
      D.22558 = __builtin_expect (D.22557, 0);
      if (D.22558 != 0) goto <D.22559>; else goto <D.22560>;
      <D.22559>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2497, "ret == 0");
      <D.22560>:
    }
    goto <D.22561>;
    <D.22553>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22562>; else goto <D.22563>;
      <D.22562>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22563>:
      D.22564 = ret != 0;
      D.22565 = (long int) D.22564;
      D.22566 = __builtin_expect (D.22565, 0);
      if (D.22566 != 0) goto <D.22567>; else goto <D.22568>;
      <D.22567>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2499, "ret == 0");
      <D.22568>:
    }
    mono_free_method (newm);
    <D.22561>:
  }
  <D.22544>:
  D.22569 = res;
  return D.22569;
}


mono_marshal_method_from_wrapper (struct MonoMethod * wrapper)
{
  <unnamed-unsigned:5> D.22571;
  _Bool D.22572;
  _Bool D.22573;
  _Bool D.22574;
  struct MonoMethod * D.22577;
  unsigned char D.22580;
  unsigned char D.22581;
  struct MonoGenericContext * D.22584;
  <unnamed type> D.22587;
  _Bool D.22588;
  _Bool D.22589;
  _Bool D.22590;
  <unnamed type> D.22594;
  unsigned int D.22595;
  void * res;
  int wrapper_type;
  struct WrapperInfo * info;

  D.22571 = wrapper->wrapper_type;
  wrapper_type = (int) D.22571;
  D.22572 = wrapper_type == 0;
  D.22573 = wrapper_type == 17;
  D.22574 = D.22572 | D.22573;
  if (D.22574 != 0) goto <D.22575>; else goto <D.22576>;
  <D.22575>:
  D.22577 = wrapper;
  return D.22577;
  <D.22576>:
  switch (wrapper_type) <default: <D.19084>, case 4: <D.19083>, case 6: <D.19082>, case 8: <D.19077>, case 9: <D.19078>, case 10: <D.19079>, case 16: <D.19080>, case 22: <D.19081>>
  <D.19077>:
  <D.19078>:
  <D.19079>:
  <D.19080>:
  <D.19081>:
  res = mono_marshal_get_wrapper_info (wrapper);
  if (res == 0B) goto <D.22578>; else goto <D.22579>;
  <D.22578>:
  D.22577 = wrapper;
  return D.22577;
  <D.22579>:
  D.22580 = BIT_FIELD_REF <*wrapper, 8, 168>;
  D.22581 = D.22580 & 16;
  if (D.22581 != 0) goto <D.22582>; else goto <D.22583>;
  <D.22582>:
  D.22584 = mono_method_get_context (wrapper);
  D.22577 = mono_class_inflate_generic_method (res, D.22584);
  return D.22577;
  <D.22583>:
  D.22577 = res;
  return D.22577;
  <D.19082>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22586>; else goto <D.22585>;
  <D.22586>:
  D.22587 = info->subtype;
  D.22588 = D.22587 == 0;
  D.22589 = D.22587 == 16;
  D.22590 = D.22588 | D.22589;
  if (D.22590 != 0) goto <D.22591>; else goto <D.22585>;
  <D.22591>:
  D.22577 = info->d.managed_to_native.method;
  return D.22577;
  <D.22585>:
  D.22577 = 0B;
  return D.22577;
  <D.19083>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22593>; else goto <D.22592>;
  <D.22593>:
  D.22594 = info->subtype;
  D.22595 = D.22594 + 4294967283;
  if (D.22595 <= 1) goto <D.22596>; else goto <D.22592>;
  <D.22596>:
  D.22577 = info->d.runtime_invoke.method;
  return D.22577;
  <D.22592>:
  D.22577 = 0B;
  return D.22577;
  <D.19084>:
  D.22577 = 0B;
  return D.22577;
}


mono_marshal_get_wrapper_info (struct MonoMethod * wrapper)
{
  unsigned char D.22598;
  unsigned char D.22599;
  _Bool D.22600;
  long int D.22601;
  long int D.22602;
  void * D.22605;

  D.22598 = BIT_FIELD_REF <*wrapper, 8, 160>;
  D.22599 = D.22598 & 124;
  D.22600 = D.22599 == 0;
  D.22601 = (long int) D.22600;
  D.22602 = __builtin_expect (D.22601, 0);
  if (D.22602 != 0) goto <D.22603>; else goto <D.22604>;
  <D.22603>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2634, "wrapper->wrapper_type");
  <D.22604>:
  D.22605 = mono_method_get_wrapper_data (wrapper, 1);
  return D.22605;
}


mono_marshal_set_wrapper_info (struct MonoMethod * method, void * data)
{
  unsigned char D.22607;
  unsigned char D.22608;
  _Bool D.22609;
  _Bool D.22610;
  _Bool D.22611;
  void * * D.22614;
  void * * datav;

  D.22607 = BIT_FIELD_REF <*method, 8, 160>;
  D.22608 = D.22607 & 124;
  D.22609 = D.22608 == 0;
  D.22610 = D.22608 == 68;
  D.22611 = D.22609 | D.22610;
  if (D.22611 != 0) goto <D.22612>; else goto <D.22613>;
  <D.22612>:
  return;
  <D.22613>:
  datav = MEM[(struct MonoMethodWrapper *)method].method_data;
  D.22614 = datav + 4;
  *D.22614 = data;
}


mono_marshal_get_delegate_begin_invoke (struct MonoMethod * method)
{
  int iftmp.74;
  struct MonoClass * D.22621;
  struct MonoClass * D.22622;
  struct MonoClass * D.22623;
  int D.19166;
  int iftmp.75;
  int D.19165;
  const char[12] * D.22628;
  unsigned char D.22629;
  int D.22630;
  unsigned char D.22631;
  int D.22632;
  _Bool D.22633;
  _Bool D.22634;
  _Bool D.22635;
  const unsigned char * D.22638;
  unsigned char D.22639;
  int D.22640;
  const unsigned char * D.22641;
  unsigned char D.22642;
  int D.22643;
  _Bool D.22644;
  _Bool D.22645;
  const unsigned char * D.22648;
  unsigned char D.22649;
  int D.22650;
  const unsigned char * D.22651;
  unsigned char D.22652;
  int D.22653;
  _Bool D.22654;
  _Bool D.22655;
  const unsigned char * D.22658;
  unsigned char D.22659;
  int D.22660;
  const unsigned char * D.22661;
  unsigned char D.22662;
  int D.22663;
  const char * D.22665;
  _Bool D.22666;
  long int D.22667;
  long int D.22668;
  unsigned char D.22671;
  unsigned char D.22672;
  struct MonoImage * D.22677;
  struct GHashTable * * D.22678;
  struct MonoMethod * D.22681;
  struct GHashTable * * D.22683;
  unsigned char D.22686;
  unsigned char D.22687;
  _Bool D.22688;
  long int D.22689;
  long int D.22690;
  struct MonoClass * D.22696;
  unsigned int params_var.76;
  short unsigned int D.22700;
  int D.22701;
  int D.22702;
  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.22617>; else goto <D.22620>;
  <D.22620>:
  D.22621 = method->klass;
  D.22622 = D.22621->parent;
  D.22623 = mono_defaults.multicastdelegate_class;
  if (D.22622 != D.22623) goto <D.22617>; else goto <D.22624>;
  <D.22624>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.22628 = "BeginInvoke";
      D.22629 = MEM[(const unsigned char *)D.22628];
      D.22630 = (int) D.22629;
      D.22631 = *__s2;
      D.22632 = (int) D.22631;
      __result = D.22630 - D.22632;
      {
        D.22633 = __s2_len != 0;
        D.22634 = __result == 0;
        D.22635 = D.22633 & D.22634;
        if (D.22635 != 0) goto <D.22636>; else goto <D.22637>;
        <D.22636>:
        D.22638 = &MEM[(void *)"BeginInvoke" + 1B];
        D.22639 = *D.22638;
        D.22640 = (int) D.22639;
        D.22641 = __s2 + 1;
        D.22642 = *D.22641;
        D.22643 = (int) D.22642;
        __result = D.22640 - D.22643;
        D.22644 = __s2_len > 1;
        D.22634 = __result == 0;
        D.22645 = D.22644 & D.22634;
        if (D.22645 != 0) goto <D.22646>; else goto <D.22647>;
        <D.22646>:
        D.22648 = &MEM[(void *)"BeginInvoke" + 2B];
        D.22649 = *D.22648;
        D.22650 = (int) D.22649;
        D.22651 = __s2 + 2;
        D.22652 = *D.22651;
        D.22653 = (int) D.22652;
        __result = D.22650 - D.22653;
        D.22654 = __s2_len > 2;
        D.22634 = __result == 0;
        D.22655 = D.22654 & D.22634;
        if (D.22655 != 0) goto <D.22656>; else goto <D.22657>;
        <D.22656>:
        D.22658 = &MEM[(void *)"BeginInvoke" + 3B];
        D.22659 = *D.22658;
        D.22660 = (int) D.22659;
        D.22661 = __s2 + 3;
        D.22662 = *D.22661;
        D.22663 = (int) D.22662;
        __result = D.22660 - D.22663;
        <D.22657>:
        <D.22647>:
        <D.22637>:
      }
      D.19165 = __result;
    }
    iftmp.75 = -D.19165;
    goto <D.22664>;
    <D.22627>:
    D.22665 = method->name;
    iftmp.75 = __builtin_strcmp (D.22665, "BeginInvoke");
    <D.22664>:
    D.19166 = iftmp.75;
  }
  if (D.19166 != 0) goto <D.22617>; else goto <D.22618>;
  <D.22617>:
  iftmp.74 = 1;
  goto <D.22619>;
  <D.22618>:
  iftmp.74 = 0;
  <D.22619>:
  D.22666 = iftmp.74 != 0;
  D.22667 = (long int) D.22666;
  D.22668 = __builtin_expect (D.22667, 0);
  if (D.22668 != 0) goto <D.22669>; else goto <D.22670>;
  <D.22669>:
  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.22670>:
  D.22671 = BIT_FIELD_REF <*method, 8, 168>;
  D.22672 = D.22671 & 16;
  if (D.22672 != 0) goto <D.22673>; else goto <D.22674>;
  <D.22673>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.22674>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.22675>; else goto <D.22676>;
  <D.22675>:
  D.22621 = method->klass;
  D.22677 = D.22621->image;
  D.22678 = &D.22677->delegate_begin_invoke_generic_cache;
  cache = get_cache (D.22678, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.22679>; else goto <D.22680>;
  <D.22679>:
  D.22681 = res;
  return D.22681;
  <D.22680>:
  goto <D.22682>;
  <D.22676>:
  D.22621 = method->klass;
  D.22677 = D.22621->image;
  D.22683 = &D.22677->delegate_begin_invoke_cache;
  cache = get_cache (D.22683, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.22684>; else goto <D.22685>;
  <D.22684>:
  D.22681 = res;
  return D.22681;
  <D.22685>:
  <D.22682>:
  D.22686 = BIT_FIELD_REF <*sig, 8, 80>;
  D.22687 = D.22686 & 64;
  D.22688 = D.22687 == 0;
  D.22689 = (long int) D.22688;
  D.22690 = __builtin_expect (D.22689, 0);
  if (D.22690 != 0) goto <D.22691>; else goto <D.22692>;
  <D.22691>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2866, "sig->hasthis");
  <D.22692>:
  name = mono_signature_to_name (sig, "begin_invoke");
  if (ctx != 0B) goto <D.22693>; else goto <D.22694>;
  <D.22693>:
  D.22621 = method->klass;
  mb = mono_mb_new (D.22621, name, 2);
  goto <D.22695>;
  <D.22694>:
  D.22621 = method->klass;
  D.22677 = D.22621->image;
  D.22696 = get_wrapper_target_class (D.22677);
  mb = mono_mb_new (D.22696, name, 2);
  <D.22695>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.76 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.76);
  mono_mb_emit_icall (mb, mono_delegate_begin_invoke);
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.22698>; else goto <D.22699>;
  <D.22698>:
  {
    struct MonoMethod * def;

    D.22700 = sig->param_count;
    D.22701 = (int) D.22700;
    D.22702 = D.22701 + 16;
    D.22621 = method->klass;
    def = mono_mb_create_and_cache (cache, D.22621, mb, sig, D.22702);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.22703>;
  <D.22699>:
  D.22700 = sig->param_count;
  D.22701 = (int) D.22700;
  D.22702 = D.22701 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.22702);
  <D.22703>:
  mono_mb_free (mb);
  D.22681 = res;
  return D.22681;
}


check_generic_delegate_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def_method, struct MonoGenericContext * ctx)
{
  struct MonoClass * D.22705;
  struct MonoMethod * D.22708;
  struct MonoClass * D.22709;
  _Bool D.22714;
  long int D.22715;
  long int D.22716;
  _Bool D.22723;
  long int D.22724;
  long int D.22725;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;

  D.22705 = orig_method->klass;
  res = mono_marshal_find_in_cache (cache, D.22705);
  if (res != 0B) goto <D.22706>; else goto <D.22707>;
  <D.22706>:
  D.22708 = res;
  return D.22708;
  <D.22707>:
  D.22709 = def_method->klass;
  def = mono_marshal_find_in_cache (cache, D.22709);
  if (def != 0B) goto <D.22710>; else goto <D.22711>;
  <D.22710>:
  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.22712>; else goto <D.22713>;
    <D.22712>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22713>:
    D.22714 = ret != 0;
    D.22715 = (long int) D.22714;
    D.22716 = __builtin_expect (D.22715, 0);
    if (D.22716 != 0) goto <D.22717>; else goto <D.22718>;
    <D.22717>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2792, "ret == 0");
    <D.22718>:
  }
  D.22705 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.22705);
  if (res == 0B) goto <D.22719>; else goto <D.22720>;
  <D.22719>:
  D.22705 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.22705, inst, 0);
  res = inst;
  <D.22720>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22721>; else goto <D.22722>;
    <D.22721>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22722>:
    D.22723 = ret != 0;
    D.22724 = (long int) D.22723;
    D.22725 = __builtin_expect (D.22724, 0);
    if (D.22725 != 0) goto <D.22726>; else goto <D.22727>;
    <D.22726>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2798, "ret == 0");
    <D.22727>:
  }
  D.22708 = res;
  return D.22708;
  <D.22711>:
  D.22708 = 0B;
  return D.22708;
}


mono_signature_to_name (struct MonoMethodSignature * sig, const char * prefix)
{
  struct MonoType * D.22731;
  unsigned char D.22732;
  unsigned char D.22733;
  struct MonoType * D.22736;
  short unsigned int D.22737;
  int D.22738;
  char * D.22739;
  int i;
  char * result;
  struct GString * res;

  res = monoeg_g_string_new ("");
  if (prefix != 0B) goto <D.22729>; else goto <D.22730>;
  <D.22729>:
  monoeg_g_string_append (res, prefix);
  monoeg_g_string_append_c (res, 95);
  <D.22730>:
  D.22731 = sig->ret;
  mono_type_get_desc (res, D.22731, 0);
  D.22732 = BIT_FIELD_REF <*sig, 8, 80>;
  D.22733 = D.22732 & 64;
  if (D.22733 != 0) goto <D.22734>; else goto <D.22735>;
  <D.22734>:
  monoeg_g_string_append (res, "__this__");
  <D.22735>:
  i = 0;
  goto <D.18928>;
  <D.18927>:
  monoeg_g_string_append_c (res, 95);
  D.22736 = sig->params[i];
  mono_type_get_desc (res, D.22736, 0);
  i = i + 1;
  <D.18928>:
  D.22737 = sig->param_count;
  D.22738 = (int) D.22737;
  if (D.22738 > i) goto <D.18927>; else goto <D.18929>;
  <D.18929>:
  result = res->str;
  monoeg_g_string_free (res, 0);
  D.22739 = result;
  return D.22739;
}


get_wrapper_target_class (struct MonoImage * image)
{
  unsigned char D.22741;
  unsigned char D.22742;
  _Bool D.22746;
  long int D.22747;
  long int D.22748;
  struct MonoClass * D.22751;
  struct MonoClass * klass;

  D.22741 = BIT_FIELD_REF <*image, 8, 128>;
  D.22742 = D.22741 & 8;
  if (D.22742 != 0) goto <D.22743>; else goto <D.22744>;
  <D.22743>:
  klass = MEM[(struct MonoDynamicImage *)image].wrappers_type;
  goto <D.22745>;
  <D.22744>:
  klass = mono_class_get (image, 33554433);
  <D.22745>:
  D.22746 = klass == 0B;
  D.22747 = (long int) D.22746;
  D.22748 = __builtin_expect (D.22747, 0);
  if (D.22748 != 0) goto <D.22749>; else goto <D.22750>;
  <D.22749>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2695, "klass");
  <D.22750>:
  D.22751 = klass;
  return D.22751;
}


mono_mb_emit_save_args (struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, gboolean save_this)
{
  struct MonoClass * D.22753;
  struct MonoType * D.22754;
  short unsigned int D.22755;
  int D.22756;
  int D.22757;
  unsigned int D.22758;
  unsigned int D.22759;
  int D.22760;
  unsigned int params_var.77;
  unsigned int tmp_var.78;
  unsigned char D.22765;
  unsigned char D.22766;
  short unsigned int D.22771;
  int D.22772;
  <unnamed-unsigned:1> D.22773;
  int D.22774;
  int D.22775;
  unsigned int D.22776;
  int D.22777;
  int D.22780;
  int i;
  int params_var;
  int tmp_var;

  D.22753 = mono_defaults.int_class;
  D.22754 = &D.22753->byval_arg;
  params_var = mono_mb_add_local (mb, D.22754);
  D.22753 = mono_defaults.int_class;
  D.22754 = &D.22753->byval_arg;
  tmp_var = mono_mb_add_local (mb, D.22754);
  D.22755 = sig->param_count;
  D.22756 = (int) D.22755;
  D.22757 = D.22756 + 1;
  D.22758 = (unsigned int) D.22757;
  D.22759 = D.22758 * 4;
  D.22760 = (int) D.22759;
  mono_mb_emit_icon (mb, D.22760);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  params_var.77 = (unsigned int) params_var;
  mono_mb_emit_stloc (mb, params_var.77);
  params_var.77 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.77);
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_stloc (mb, tmp_var.78);
  if (save_this != 0) goto <D.22763>; else goto <D.22764>;
  <D.22763>:
  D.22765 = BIT_FIELD_REF <*sig, 8, 80>;
  D.22766 = D.22765 & 64;
  if (D.22766 != 0) goto <D.22767>; else goto <D.22768>;
  <D.22767>:
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.78);
  mono_mb_emit_ldarg_addr (mb, 0);
  mono_mb_emit_byte (mb, 223);
  D.22755 = sig->param_count;
  if (D.22755 != 0) goto <D.22769>; else goto <D.22770>;
  <D.22769>:
  D.22771 = (short unsigned int) tmp_var;
  D.22772 = (int) D.22771;
  mono_mb_emit_add_to_local (mb, D.22772, 4);
  <D.22770>:
  <D.22768>:
  <D.22764>:
  i = 0;
  goto <D.18918>;
  <D.18917>:
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.78);
  D.22773 = sig->hasthis;
  D.22774 = (int) D.22773;
  D.22775 = D.22774 + i;
  D.22776 = (unsigned int) D.22775;
  mono_mb_emit_ldarg_addr (mb, D.22776);
  mono_mb_emit_byte (mb, 223);
  D.22755 = sig->param_count;
  D.22756 = (int) D.22755;
  D.22777 = D.22756 + -1;
  if (D.22777 > i) goto <D.22778>; else goto <D.22779>;
  <D.22778>:
  D.22771 = (short unsigned int) tmp_var;
  D.22772 = (int) D.22771;
  mono_mb_emit_add_to_local (mb, D.22772, 4);
  <D.22779>:
  i = i + 1;
  <D.18918>:
  D.22755 = sig->param_count;
  D.22756 = (int) D.22755;
  if (D.22756 > i) goto <D.18917>; else goto <D.18919>;
  <D.18919>:
  D.22780 = params_var;
  return D.22780;
}


cache_generic_delegate_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx)
{
  _Bool D.22784;
  long int D.22785;
  long int D.22786;
  struct MonoClass * D.22789;
  _Bool D.22794;
  long int D.22795;
  long int D.22796;
  struct MonoMethod * D.22799;
  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.22782>; else goto <D.22783>;
    <D.22782>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22783>:
    D.22784 = ret != 0;
    D.22785 = (long int) D.22784;
    D.22786 = __builtin_expect (D.22785, 0);
    if (D.22786 != 0) goto <D.22787>; else goto <D.22788>;
    <D.22787>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2814, "ret == 0");
    <D.22788>:
  }
  D.22789 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.22789);
  if (res == 0B) goto <D.22790>; else goto <D.22791>;
  <D.22790>:
  D.22789 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.22789, inst, 0);
  res = inst;
  <D.22791>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22792>; else goto <D.22793>;
    <D.22792>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22793>:
    D.22794 = ret != 0;
    D.22795 = (long int) D.22794;
    D.22796 = __builtin_expect (D.22795, 0);
    if (D.22796 != 0) goto <D.22797>; else goto <D.22798>;
    <D.22797>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2820, "ret == 0");
    <D.22798>:
  }
  D.22799 = res;
  return D.22799;
}


mono_marshal_get_delegate_end_invoke (struct MonoMethod * method)
{
  int iftmp.79;
  struct MonoClass * D.22806;
  struct MonoClass * D.22807;
  struct MonoClass * D.22808;
  int D.19237;
  int iftmp.80;
  int D.19236;
  const char[10] * D.22813;
  unsigned char D.22814;
  int D.22815;
  unsigned char D.22816;
  int D.22817;
  _Bool D.22818;
  _Bool D.22819;
  _Bool D.22820;
  const unsigned char * D.22823;
  unsigned char D.22824;
  int D.22825;
  const unsigned char * D.22826;
  unsigned char D.22827;
  int D.22828;
  _Bool D.22829;
  _Bool D.22830;
  const unsigned char * D.22833;
  unsigned char D.22834;
  int D.22835;
  const unsigned char * D.22836;
  unsigned char D.22837;
  int D.22838;
  _Bool D.22839;
  _Bool D.22840;
  const unsigned char * D.22843;
  unsigned char D.22844;
  int D.22845;
  const unsigned char * D.22846;
  unsigned char D.22847;
  int D.22848;
  const char * D.22850;
  _Bool D.22851;
  long int D.22852;
  long int D.22853;
  unsigned char D.22856;
  unsigned char D.22857;
  struct MonoImage * D.22862;
  struct GHashTable * * D.22863;
  struct MonoMethod * D.22866;
  struct GHashTable * * D.22868;
  unsigned char D.22871;
  unsigned char D.22872;
  _Bool D.22873;
  long int D.22874;
  long int D.22875;
  struct MonoClass * D.22881;
  unsigned int params_var.81;
  struct MonoType * D.22883;
  unsigned char D.22884;
  short unsigned int D.22890;
  int D.22891;
  int D.22892;
  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.22802>; else goto <D.22805>;
  <D.22805>:
  D.22806 = method->klass;
  D.22807 = D.22806->parent;
  D.22808 = mono_defaults.multicastdelegate_class;
  if (D.22807 != D.22808) goto <D.22802>; else goto <D.22809>;
  <D.22809>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.22813 = "EndInvoke";
      D.22814 = MEM[(const unsigned char *)D.22813];
      D.22815 = (int) D.22814;
      D.22816 = *__s2;
      D.22817 = (int) D.22816;
      __result = D.22815 - D.22817;
      {
        D.22818 = __s2_len != 0;
        D.22819 = __result == 0;
        D.22820 = D.22818 & D.22819;
        if (D.22820 != 0) goto <D.22821>; else goto <D.22822>;
        <D.22821>:
        D.22823 = &MEM[(void *)"EndInvoke" + 1B];
        D.22824 = *D.22823;
        D.22825 = (int) D.22824;
        D.22826 = __s2 + 1;
        D.22827 = *D.22826;
        D.22828 = (int) D.22827;
        __result = D.22825 - D.22828;
        D.22829 = __s2_len > 1;
        D.22819 = __result == 0;
        D.22830 = D.22829 & D.22819;
        if (D.22830 != 0) goto <D.22831>; else goto <D.22832>;
        <D.22831>:
        D.22833 = &MEM[(void *)"EndInvoke" + 2B];
        D.22834 = *D.22833;
        D.22835 = (int) D.22834;
        D.22836 = __s2 + 2;
        D.22837 = *D.22836;
        D.22838 = (int) D.22837;
        __result = D.22835 - D.22838;
        D.22839 = __s2_len > 2;
        D.22819 = __result == 0;
        D.22840 = D.22839 & D.22819;
        if (D.22840 != 0) goto <D.22841>; else goto <D.22842>;
        <D.22841>:
        D.22843 = &MEM[(void *)"EndInvoke" + 3B];
        D.22844 = *D.22843;
        D.22845 = (int) D.22844;
        D.22846 = __s2 + 3;
        D.22847 = *D.22846;
        D.22848 = (int) D.22847;
        __result = D.22845 - D.22848;
        <D.22842>:
        <D.22832>:
        <D.22822>:
      }
      D.19236 = __result;
    }
    iftmp.80 = -D.19236;
    goto <D.22849>;
    <D.22812>:
    D.22850 = method->name;
    iftmp.80 = __builtin_strcmp (D.22850, "EndInvoke");
    <D.22849>:
    D.19237 = iftmp.80;
  }
  if (D.19237 != 0) goto <D.22802>; else goto <D.22803>;
  <D.22802>:
  iftmp.79 = 1;
  goto <D.22804>;
  <D.22803>:
  iftmp.79 = 0;
  <D.22804>:
  D.22851 = iftmp.79 != 0;
  D.22852 = (long int) D.22851;
  D.22853 = __builtin_expect (D.22852, 0);
  if (D.22853 != 0) goto <D.22854>; else goto <D.22855>;
  <D.22854>:
  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.22855>:
  D.22856 = BIT_FIELD_REF <*method, 8, 168>;
  D.22857 = D.22856 & 16;
  if (D.22857 != 0) goto <D.22858>; else goto <D.22859>;
  <D.22858>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.22859>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.22860>; else goto <D.22861>;
  <D.22860>:
  D.22806 = method->klass;
  D.22862 = D.22806->image;
  D.22863 = &D.22862->delegate_end_invoke_generic_cache;
  cache = get_cache (D.22863, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.22864>; else goto <D.22865>;
  <D.22864>:
  D.22866 = res;
  return D.22866;
  <D.22865>:
  goto <D.22867>;
  <D.22861>:
  D.22806 = method->klass;
  D.22862 = D.22806->image;
  D.22868 = &D.22862->delegate_end_invoke_cache;
  cache = get_cache (D.22868, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.22869>; else goto <D.22870>;
  <D.22869>:
  D.22866 = res;
  return D.22866;
  <D.22870>:
  <D.22867>:
  D.22871 = BIT_FIELD_REF <*sig, 8, 80>;
  D.22872 = D.22871 & 64;
  D.22873 = D.22872 == 0;
  D.22874 = (long int) D.22873;
  D.22875 = __builtin_expect (D.22874, 0);
  if (D.22875 != 0) goto <D.22876>; else goto <D.22877>;
  <D.22876>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3076, "sig->hasthis");
  <D.22877>:
  name = mono_signature_to_name (sig, "end_invoke");
  if (ctx != 0B) goto <D.22878>; else goto <D.22879>;
  <D.22878>:
  D.22806 = method->klass;
  mb = mono_mb_new (D.22806, name, 3);
  goto <D.22880>;
  <D.22879>:
  D.22806 = method->klass;
  D.22862 = D.22806->image;
  D.22881 = get_wrapper_target_class (D.22862);
  mb = mono_mb_new (D.22881, name, 3);
  <D.22880>:
  monoeg_g_free (name);
  params_var = mono_mb_emit_save_args (mb, sig, 0);
  mono_mb_emit_ldarg (mb, 0);
  params_var.81 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.81);
  mono_mb_emit_icall (mb, mono_delegate_end_invoke);
  D.22883 = sig->ret;
  D.22884 = D.22883->type;
  if (D.22884 == 1) goto <D.22885>; else goto <D.22886>;
  <D.22885>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.22887>;
  <D.22886>:
  D.22883 = sig->ret;
  mono_mb_emit_restore_result (mb, D.22883);
  <D.22887>:
  if (ctx != 0B) goto <D.22888>; else goto <D.22889>;
  <D.22888>:
  {
    struct MonoMethod * def;

    D.22890 = sig->param_count;
    D.22891 = (int) D.22890;
    D.22892 = D.22891 + 16;
    D.22806 = method->klass;
    def = mono_mb_create_and_cache (cache, D.22806, mb, sig, D.22892);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.22893>;
  <D.22889>:
  D.22890 = sig->param_count;
  D.22891 = (int) D.22890;
  D.22892 = D.22891 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.22892);
  <D.22893>:
  mono_mb_free (mb);
  D.22866 = res;
  return D.22866;
}


mono_mb_emit_restore_result (struct MonoMethodBuilder * mb, struct MonoType * return_type)
{
  unsigned char D.22895;
  unsigned char D.22896;
  struct MonoClass * D.22899;
  unsigned char D.22900;
  int D.22901;
  struct MonoClass * D.22902;
  unsigned int D.22903;
  unsigned char D.22904;
  int D.22905;
  int D.22906;
  unsigned char D.22908;
  int D.22909;
  struct MonoType * t;

  t = mono_type_get_underlying_type (return_type);
  D.22895 = BIT_FIELD_REF <*return_type, 8, 56>;
  D.22896 = D.22895 & 64;
  if (D.22896 != 0) goto <D.22897>; else goto <D.22898>;
  <D.22897>:
  D.22899 = mono_defaults.int_class;
  return_type = &D.22899->byval_arg;
  <D.22898>:
  D.22900 = t->type;
  D.22901 = (int) D.22900;
  switch (D.22901) <default: <D.19217>, case 1: <D.19189>, case 2: <D.19198>, case 3: <D.19201>, case 4: <D.19199>, case 5: <D.19197>, case 6: <D.19202>, case 7: <D.19200>, case 8: <D.19205>, case 9: <D.19206>, case 10: <D.19208>, case 11: <D.19207>, case 12: <D.19209>, case 13: <D.19210>, case 14: <D.19191>, case 15: <D.19190>, case 17: <D.19212>, case 18: <D.19192>, case 19: <D.19214>, case 20: <D.19194>, case 21: <D.19211>, case 24: <D.19203>, case 25: <D.19204>, case 28: <D.19193>, case 29: <D.19195>, case 30: <D.19215>>
  <D.19189>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2981);
  <D.19190>:
  <D.19191>:
  <D.19192>:
  <D.19193>:
  <D.19194>:
  <D.19195>:
  goto <D.19196>;
  <D.19197>:
  <D.19198>:
  <D.19199>:
  <D.19200>:
  <D.19201>:
  <D.19202>:
  <D.19203>:
  <D.19204>:
  <D.19205>:
  <D.19206>:
  <D.19207>:
  <D.19208>:
  <D.19209>:
  <D.19210>:
  D.22902 = mono_class_from_mono_type (return_type);
  mono_mb_emit_op (mb, 121, D.22902);
  D.22903 = mono_type_to_ldind (return_type);
  D.22904 = (unsigned char) D.22903;
  D.22905 = (int) D.22904;
  mono_mb_emit_byte (mb, D.22905);
  goto <D.19196>;
  <D.19211>:
  D.22906 = mono_type_generic_inst_is_valuetype (t);
  if (D.22906 == 0) goto <D.19196>; else goto <D.22907>;
  <D.22907>:
  <D.19212>:
  {
    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.19196>;
  }
  <D.19214>:
  <D.19215>:
  {
    struct MonoClass * klass;

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


mono_marshal_get_remoting_invoke (struct MonoMethod * method)
{
  _Bool D.22911;
  long int D.22912;
  long int D.22913;
  unsigned char D.22916;
  unsigned char D.22917;
  _Bool D.22918;
  _Bool D.22919;
  _Bool D.22920;
  struct MonoMethod * D.22923;
  struct MonoClass * D.22926;
  unsigned char D.22927;
  unsigned char D.22928;
  struct MonoClass * D.22930;
  struct MonoDomain * D.22931;
  _Bool D.22932;
  long int D.22933;
  long int D.22934;
  unsigned char D.22937;
  unsigned char D.22938;
  unsigned char D.22941;
  unsigned char D.22942;
  const char * D.22947;
  struct MonoMethod * D.22948;
  unsigned int params_var.82;
  struct MonoType * D.22950;
  unsigned char D.22951;
  short unsigned int D.22955;
  int D.22956;
  int D.22957;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int params_var;

  D.22911 = method == 0B;
  D.22912 = (long int) D.22911;
  D.22913 = __builtin_expect (D.22912, 0);
  if (D.22913 != 0) goto <D.22914>; else goto <D.22915>;
  <D.22914>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3177, "method");
  <D.22915>:
  D.22916 = BIT_FIELD_REF <*method, 8, 160>;
  D.22917 = D.22916 & 124;
  D.22918 = D.22917 == 32;
  D.22919 = D.22917 == 40;
  D.22920 = D.22918 | D.22919;
  if (D.22920 != 0) goto <D.22921>; else goto <D.22922>;
  <D.22921>:
  D.22923 = method;
  return D.22923;
  <D.22922>:
  D.22926 = method->klass;
  D.22927 = BIT_FIELD_REF <*D.22926, 8, 184>;
  D.22928 = D.22927 & 64;
  if (D.22928 != 0) goto <D.22924>; else goto <D.22929>;
  <D.22929>:
  D.22926 = method->klass;
  D.22930 = mono_class_get_com_object_class ();
  if (D.22926 == D.22930) goto <D.22924>; else goto <D.22925>;
  <D.22924>:
  {
    struct MonoVTable * vtable;

    D.22926 = method->klass;
    D.22931 = mono_domain_get ();
    vtable = mono_class_vtable (D.22931, D.22926);
    D.22932 = vtable == 0B;
    D.22933 = (long int) D.22932;
    D.22934 = __builtin_expect (D.22933, 0);
    if (D.22934 != 0) goto <D.22935>; else goto <D.22936>;
    <D.22935>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3186, "vtable");
    <D.22936>:
    D.22937 = BIT_FIELD_REF <*vtable, 8, 184>;
    D.22938 = D.22937 & 1;
    if (D.22938 == 0) goto <D.22939>; else goto <D.22940>;
    <D.22939>:
    D.22923 = mono_cominterop_get_invoke (method);
    return D.22923;
    <D.22940>:
  }
  <D.22925>:
  sig = mono_signature_no_pinvoke (method);
  D.22941 = BIT_FIELD_REF <*sig, 8, 80>;
  D.22942 = D.22941 & 64;
  if (D.22942 == 0) goto <D.22943>; else goto <D.22944>;
  <D.22943>:
  D.22923 = method;
  return D.22923;
  <D.22944>:
  res = mono_marshal_remoting_find_in_cache (method, 8);
  if (res != 0B) goto <D.22945>; else goto <D.22946>;
  <D.22945>:
  D.22923 = res;
  return D.22923;
  <D.22946>:
  D.22947 = method->name;
  D.22926 = method->klass;
  mb = mono_mb_new (D.22926, D.22947, 8);
  D.22948 = mb->method;
  D.22948->save_lmf = 1;
  params_var = mono_mb_emit_save_args (mb, sig, 1);
  mono_mb_emit_ptr (mb, method);
  params_var.82 = (unsigned int) params_var;
  mono_mb_emit_ldloc (mb, params_var.82);
  mono_mb_emit_icall (mb, mono_remoting_wrapper);
  emit_thread_interrupt_checkpoint (mb);
  D.22950 = sig->ret;
  D.22951 = D.22950->type;
  if (D.22951 == 1) goto <D.22952>; else goto <D.22953>;
  <D.22952>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.22954>;
  <D.22953>:
  D.22950 = sig->ret;
  mono_mb_emit_restore_result (mb, D.22950);
  <D.22954>:
  D.22955 = sig->param_count;
  D.22956 = (int) D.22955;
  D.22957 = D.22956 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.22957);
  mono_mb_free (mb);
  D.22923 = res;
  return D.22923;
}


mono_marshal_remoting_find_in_cache (struct MonoMethod * method, int wrapper_type)
{
  _Bool D.22961;
  long int D.22962;
  long int D.22963;
  struct MonoClass * D.22966;
  struct MonoImage * D.22967;
  struct GHashTable * D.22968;
  _Bool D.22977;
  long int D.22978;
  long int D.22979;
  struct MonoMethod * D.22982;
  struct MonoMethod * res;
  struct MonoRemotingMethods * wrps;

  res = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22959>; else goto <D.22960>;
    <D.22959>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22960>:
    D.22961 = ret != 0;
    D.22962 = (long int) D.22961;
    D.22963 = __builtin_expect (D.22962, 0);
    if (D.22963 != 0) goto <D.22964>; else goto <D.22965>;
    <D.22964>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2514, "ret == 0");
    <D.22965>:
  }
  D.22966 = method->klass;
  D.22967 = D.22966->image;
  D.22968 = D.22967->remoting_invoke_cache;
  if (D.22968 != 0B) goto <D.22969>; else goto <D.22970>;
  <D.22969>:
  D.22966 = method->klass;
  D.22967 = D.22966->image;
  D.22968 = D.22967->remoting_invoke_cache;
  wrps = monoeg_g_hash_table_lookup (D.22968, method);
  goto <D.22971>;
  <D.22970>:
  wrps = 0B;
  <D.22971>:
  if (wrps != 0B) goto <D.22972>; else goto <D.22973>;
  <D.22972>:
  switch (wrapper_type) <default: <D.22974>, case 8: <D.19044>, case 9: <D.19046>, case 10: <D.19047>, case 11: <D.19048>>
  <D.19044>:
  res = wrps->invoke;
  goto <D.19045>;
  <D.19046>:
  res = wrps->invoke_with_check;
  goto <D.19045>;
  <D.19047>:
  res = wrps->xdomain_invoke;
  goto <D.19045>;
  <D.19048>:
  res = wrps->xdomain_dispatch;
  goto <D.19045>;
  <D.22974>:
  <D.19045>:
  <D.22973>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22975>; else goto <D.22976>;
    <D.22975>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22976>:
    D.22977 = ret != 0;
    D.22978 = (long int) D.22977;
    D.22979 = __builtin_expect (D.22978, 0);
    if (D.22979 != 0) goto <D.22980>; else goto <D.22981>;
    <D.22980>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2533, "ret == 0");
    <D.22981>:
  }
  D.22982 = res;
  return D.22982;
}


mono_remoting_mb_create_and_cache (struct MonoMethod * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  struct MonoClass * D.22984;
  struct MonoImage * D.22985;
  struct GHashTable * * D.22986;
  _Bool D.22989;
  long int D.22990;
  long int D.22991;
  struct MonoMethod * D.22996;
  <unnamed-unsigned:5> D.22997;
  int D.22998;
  _Bool D.23001;
  long int D.23002;
  long int D.23003;
  struct MonoMethod * D.23006;
  _Bool D.23011;
  long int D.23012;
  long int D.23013;
  _Bool D.23020;
  long int D.23021;
  long int D.23022;
  _Bool D.23028;
  long int D.23029;
  long int D.23030;
  struct MonoMethod * D.23033;
  struct MonoMethod * * res;
  struct MonoRemotingMethods * wrps;
  struct GHashTable * cache;

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

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22987>; else goto <D.22988>;
    <D.22987>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22988>:
    D.22989 = ret != 0;
    D.22990 = (long int) D.22989;
    D.22991 = __builtin_expect (D.22990, 0);
    if (D.22991 != 0) goto <D.22992>; else goto <D.22993>;
    <D.22992>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2546, "ret == 0");
    <D.22993>:
  }
  wrps = monoeg_g_hash_table_lookup (cache, key);
  if (wrps == 0B) goto <D.22994>; else goto <D.22995>;
  <D.22994>:
  wrps = monoeg_malloc0 (16);
  monoeg_g_hash_table_insert_replace (cache, key, wrps, 0);
  <D.22995>:
  D.22996 = mb->method;
  D.22997 = D.22996->wrapper_type;
  D.22998 = (int) D.22997;
  switch (D.22998) <default: <D.19065>, case 8: <D.19060>, case 9: <D.19062>, case 10: <D.19063>, case 11: <D.19064>>
  <D.19060>:
  res = &wrps->invoke;
  goto <D.19061>;
  <D.19062>:
  res = &wrps->invoke_with_check;
  goto <D.19061>;
  <D.19063>:
  res = &wrps->xdomain_invoke;
  goto <D.19061>;
  <D.19064>:
  res = &wrps->xdomain_dispatch;
  goto <D.19061>;
  <D.19065>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2558);
  <D.19061>:
  {
    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", 2560, "ret == 0");
    <D.23005>:
  }
  D.23006 = *res;
  if (D.23006 == 0B) goto <D.23007>; else goto <D.23008>;
  <D.23007>:
  {
    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.23009>; else goto <D.23010>;
      <D.23009>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.23010>:
      D.23011 = ret != 0;
      D.23012 = (long int) D.23011;
      D.23013 = __builtin_expect (D.23012, 0);
      if (D.23013 != 0) goto <D.23014>; else goto <D.23015>;
      <D.23014>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2566, "ret == 0");
      <D.23015>:
    }
    D.23006 = *res;
    if (D.23006 == 0B) goto <D.23016>; else goto <D.23017>;
    <D.23016>:
    *res = newm;
    D.23006 = *res;
    mono_marshal_set_wrapper_info (D.23006, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23018>; else goto <D.23019>;
      <D.23018>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23019>:
      D.23020 = ret != 0;
      D.23021 = (long int) D.23020;
      D.23022 = __builtin_expect (D.23021, 0);
      if (D.23022 != 0) goto <D.23023>; else goto <D.23024>;
      <D.23023>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2570, "ret == 0");
      <D.23024>:
    }
    goto <D.23025>;
    <D.23017>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.23026>; else goto <D.23027>;
      <D.23026>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.23027>:
      D.23028 = ret != 0;
      D.23029 = (long int) D.23028;
      D.23030 = __builtin_expect (D.23029, 0);
      if (D.23030 != 0) goto <D.23031>; else goto <D.23032>;
      <D.23031>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2572, "ret == 0");
      <D.23032>:
    }
    mono_free_method (newm);
    <D.23025>:
  }
  <D.23008>:
  D.23033 = *res;
  return D.23033;
}


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.23035;
  _Bool D.23040;
  long int D.23041;
  long int D.23042;
  _Bool D.23049;
  long int D.23050;
  long int D.23051;
  struct GHashTable * D.23054;

  D.23035 = *var;
  if (D.23035 == 0B) goto <D.23036>; else goto <D.23037>;
  <D.23036>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23038>; else goto <D.23039>;
    <D.23038>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23039>:
    D.23040 = ret != 0;
    D.23041 = (long int) D.23040;
    D.23042 = __builtin_expect (D.23041, 0);
    if (D.23042 != 0) goto <D.23043>; else goto <D.23044>;
    <D.23043>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2448, "ret == 0");
    <D.23044>:
  }
  D.23035 = *var;
  if (D.23035 == 0B) goto <D.23045>; else goto <D.23046>;
  <D.23045>:
  {
    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.23046>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23047>; else goto <D.23048>;
    <D.23047>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23048>:
    D.23049 = ret != 0;
    D.23050 = (long int) D.23049;
    D.23051 = __builtin_expect (D.23050, 0);
    if (D.23051 != 0) goto <D.23052>; else goto <D.23053>;
    <D.23052>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2455, "ret == 0");
    <D.23053>:
  }
  <D.23037>:
  D.23054 = *var;
  return D.23054;
}


mono_marshal_xdomain_copy_value (struct MonoObject * val)
{
  struct MonoObject * D.23058;
  struct MonoVTable * D.23059;
  struct MonoClass * D.23060;
  unsigned char D.23061;
  int D.23062;
  void * D.23063;
  int D.23064;
  mono_unichar2 * D.23065;
  struct MonoClass * D.23066;
  struct MonoType * D.23067;
  unsigned int D.23072;
  unsigned int i.83;
  char * D.23074;
  struct MonoObject * D.23075;
  struct MonoClass * D.23077;
  struct MonoString * D.23080;
  int D.23081;
  mono_unichar2 * D.23082;
  struct MonoString * D.23083;
  struct MonoString * * D.23084;
  int D.23085;
  struct MonoDomain * domain;

  if (val == 0B) goto <D.23056>; else goto <D.23057>;
  <D.23056>:
  D.23058 = 0B;
  return D.23058;
  <D.23057>:
  domain = mono_domain_get ();
  D.23059 = val->vtable;
  D.23060 = D.23059->klass;
  D.23061 = D.23060->byval_arg.type;
  D.23062 = (int) D.23061;
  switch (D.23062) <default: <D.23076>, case 1: <D.19289>, case 2: <D.19292>, case 3: <D.19295>, case 4: <D.19291>, case 5: <D.19290>, case 6: <D.19294>, case 7: <D.19293>, case 8: <D.19297>, case 9: <D.19296>, case 10: <D.19298>, case 11: <D.19299>, case 12: <D.19300>, case 13: <D.19301>, case 14: <D.19302>, case 20: <D.19304>, case 29: <D.19305>>
  <D.19289>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3283);
  <D.19290>:
  <D.19291>:
  <D.19292>:
  <D.19293>:
  <D.19294>:
  <D.19295>:
  <D.19296>:
  <D.19297>:
  <D.19298>:
  <D.19299>:
  <D.19300>:
  <D.19301>:
  D.23063 = val + 8;
  D.23059 = val->vtable;
  D.23060 = D.23059->klass;
  D.23058 = mono_value_box (domain, D.23060, D.23063);
  return D.23058;
  <D.19302>:
  {
    struct MonoString * str;

    str = val;
    D.23064 = mono_string_length (str);
    D.23065 = mono_string_chars (str);
    D.23058 = mono_string_new_utf16 (domain, D.23065, D.23064);
    return D.23058;
  }
  <D.19304>:
  <D.19305>:
  {
    struct MonoArray * acopy;
    MonoXDomainMarshalType mt;

    D.23059 = val->vtable;
    D.23060 = D.23059->klass;
    D.23066 = D.23060->element_class;
    D.23067 = &D.23066->byval_arg;
    mt = mono_get_xdomain_marshal_type (D.23067);
    if (mt == 3) goto <D.23068>; else goto <D.23069>;
    <D.23068>:
    D.23058 = 0B;
    return D.23058;
    <D.23069>:
    acopy = mono_array_clone_in_domain (domain, val);
    if (mt == 1) goto <D.23070>; else goto <D.23071>;
    <D.23070>:
    {
      int i;
      int len;

      D.23072 = mono_array_length (acopy);
      len = (int) D.23072;
      i = 0;
      goto <D.19313>;
      <D.19312>:
      {
        struct MonoObject * item;

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

          i.83 = (unsigned int) i;
          __p = mono_array_addr_with_size (acopy, 4, i.83);
          D.23075 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (acopy, __p, D.23075);
        }
      }
      i = i + 1;
      <D.19313>:
      if (i < len) goto <D.19312>; else goto <D.19314>;
      <D.19314>:
    }
    <D.23071>:
    D.23058 = acopy;
    return D.23058;
  }
  <D.23076>:
  D.23059 = val->vtable;
  D.23060 = D.23059->klass;
  D.23077 = mono_defaults.stringbuilder_class;
  if (D.23060 == D.23077) goto <D.23078>; else goto <D.23079>;
  <D.23078>:
  {
    struct MonoStringBuilder * oldsb;
    struct MonoStringBuilder * newsb;

    oldsb = val;
    D.23077 = mono_defaults.stringbuilder_class;
    newsb = mono_object_new (domain, D.23077);
    D.23080 = oldsb->str;
    D.23081 = mono_string_length (D.23080);
    D.23080 = oldsb->str;
    D.23082 = mono_string_chars (D.23080);
    D.23083 = mono_string_new_utf16 (domain, D.23082, D.23081);
    D.23084 = &newsb->str;
    mono_gc_wbarrier_set_field (newsb, D.23084, D.23083);
    D.23085 = oldsb->length;
    newsb->length = D.23085;
    newsb->max_capacity = 2147483647;
    D.23058 = newsb;
    return D.23058;
  }
  <D.23079>:
  D.23058 = 0B;
  return D.23058;
}


mono_marshal_get_xappdomain_invoke (struct MonoMethod * method)
{
  _Bool D.23087;
  long int D.23088;
  long int D.23089;
  unsigned char D.23092;
  unsigned char D.23093;
  _Bool D.23094;
  _Bool D.23095;
  _Bool D.23096;
  struct MonoMethod * D.23099;
  struct MonoMethodSignature * D.23100;
  unsigned char D.23101;
  unsigned char D.23102;
  int D.23105;
  const char * D.23110;
  struct MonoClass * D.23111;
  struct MonoMethod * D.23112;
  short unsigned int D.23113;
  unsigned int D.23114;
  unsigned int D.23115;
  <unnamed type> D.23116;
  short unsigned int D.23119;
  int D.23120;
  int D.23121;
  unsigned char D.23124;
  unsigned char D.23125;
  unsigned int i.84;
  unsigned int D.23132;
  int * D.23133;
  int D.23134;
  struct MonoType * D.23135;
  unsigned char D.23136;
  <unnamed type> D.23139;
  _Bool D.23140;
  struct MonoClass * D.23143;
  struct MonoType * D.23144;
  struct MonoClass * byte_array_class.85;
  struct MonoType * D.23146;
  struct MonoClass * D.23149;
  struct MonoType * D.23150;
  unsigned int loc_context.86;
  struct MonoMethod * method_needs_context_sink.87;
  unsigned int D.23153;
  unsigned int loc_real_proxy.88;
  unsigned int loc_domainid.89;
  struct MonoImage * D.23156;
  unsigned int D.23157;
  unsigned int pos.90;
  int D.23159;
  unsigned int D.23160;
  struct MonoMethod * D.23161;
  unsigned int pos_dispatch.91;
  int iftmp.92;
  _Bool D.23166;
  _Bool D.23167;
  _Bool D.23168;
  int D.23172;
  struct MonoType * D.23175;
  unsigned char D.23176;
  unsigned char D.23177;
  unsigned char D.23180;
  unsigned char D.23181;
  unsigned int loc_array.93;
  struct MonoMethod * method_rs_serialize.94;
  unsigned int loc_serialized_data.95;
  unsigned int loc_old_domainid.96;
  unsigned int loc_serialized_exc.97;
  struct MonoType * D.23195;
  unsigned int copy_local.98;
  struct MonoMethodSignature * D.23198;
  unsigned int loc_return.99;
  unsigned int D.23202;
  struct MonoMethod * method_rs_deserialize.100;
  struct MonoClass * D.23204;
  struct MonoMethod * method_exc_fixexc.101;
  unsigned int pos_noex.102;
  int j.103;
  int D.23211;
  unsigned int D.23212;
  struct MonoClass * D.23213;
  unsigned char D.23220;
  unsigned char D.23221;
  unsigned char D.23229;
  unsigned char D.23230;
  unsigned int D.23242;
  int D.23247;
  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.23087 = method == 0B;
  D.23088 = (long int) D.23087;
  D.23089 = __builtin_expect (D.23088, 0);
  if (D.23089 != 0) goto <D.23090>; else goto <D.23091>;
  <D.23090>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3744, "method");
  <D.23091>:
  D.23092 = BIT_FIELD_REF <*method, 8, 160>;
  D.23093 = D.23092 & 124;
  D.23094 = D.23093 == 32;
  D.23095 = D.23093 == 40;
  D.23096 = D.23094 | D.23095;
  if (D.23096 != 0) goto <D.23097>; else goto <D.23098>;
  <D.23097>:
  D.23099 = method;
  return D.23099;
  <D.23098>:
  D.23100 = mono_method_signature (method);
  D.23101 = BIT_FIELD_REF <*D.23100, 8, 80>;
  D.23102 = D.23101 & 64;
  if (D.23102 == 0) goto <D.23103>; else goto <D.23104>;
  <D.23103>:
  D.23099 = method;
  return D.23099;
  <D.23104>:
  D.23105 = mono_marshal_supports_fast_xdomain (method);
  if (D.23105 == 0) goto <D.23106>; else goto <D.23107>;
  <D.23106>:
  D.23099 = mono_marshal_get_remoting_invoke (method);
  return D.23099;
  <D.23107>:
  mono_remoting_marshal_init ();
  res = mono_marshal_remoting_find_in_cache (method, 10);
  if (res != 0B) goto <D.23108>; else goto <D.23109>;
  <D.23108>:
  D.23099 = res;
  return D.23099;
  <D.23109>:
  sig = mono_signature_no_pinvoke (method);
  D.23110 = method->name;
  D.23111 = method->klass;
  mb = mono_mb_new (D.23111, D.23110, 10);
  D.23112 = mb->method;
  D.23112->save_lmf = 1;
  D.23113 = sig->param_count;
  D.23114 = (unsigned int) D.23113;
  D.23115 = D.23114 * 4;
  marshal_types = __builtin_alloca (D.23115);
  complex_out_count = 0;
  complex_count = complex_out_count;
  i = 0;
  goto <D.19453>;
  <D.19452>:
  {
    struct MonoType * ptype;
    int mt;

    ptype = sig->params[i];
    D.23116 = mono_get_xdomain_marshal_type (ptype);
    mt = (int) D.23116;
    D.23119 = ptype->attrs;
    D.23120 = (int) D.23119;
    D.23121 = D.23120 & 2;
    if (D.23121 != 0) goto <D.23122>; else goto <D.23117>;
    <D.23122>:
    if (mt == 1) goto <D.23123>; else goto <D.23117>;
    <D.23123>:
    D.23124 = BIT_FIELD_REF <*ptype, 8, 56>;
    D.23125 = D.23124 & 64;
    if (D.23125 == 0) goto <D.23126>; else goto <D.23117>;
    <D.23126>:
    mt = 2;
    goto <D.23118>;
    <D.23117>:
    if (mt == 3) goto <D.23127>; else goto <D.23128>;
    <D.23127>:
    complex_count = complex_count + 1;
    D.23124 = BIT_FIELD_REF <*ptype, 8, 56>;
    D.23125 = D.23124 & 64;
    if (D.23125 != 0) goto <D.23129>; else goto <D.23130>;
    <D.23129>:
    complex_out_count = complex_out_count + 1;
    <D.23130>:
    <D.23128>:
    <D.23118>:
    i.84 = (unsigned int) i;
    D.23132 = i.84 * 4;
    D.23133 = marshal_types + D.23132;
    *D.23133 = mt;
  }
  i = i + 1;
  <D.19453>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19452>; else goto <D.19454>;
  <D.19454>:
  D.23135 = sig->ret;
  D.23136 = D.23135->type;
  if (D.23136 != 1) goto <D.23137>; else goto <D.23138>;
  <D.23137>:
  D.23135 = sig->ret;
  D.23139 = mono_get_xdomain_marshal_type (D.23135);
  ret_marshal_type = (int) D.23139;
  D.23135 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23135);
  D.23140 = ret_marshal_type != 3;
  copy_return = (gboolean) D.23140;
  <D.23138>:
  if (complex_count > 0) goto <D.23141>; else goto <D.23142>;
  <D.23141>:
  D.23143 = mono_defaults.object_class;
  D.23144 = &D.23143->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23144);
  <D.23142>:
  byte_array_class.85 = byte_array_class;
  D.23146 = &byte_array_class.85->byval_arg;
  loc_serialized_data = mono_mb_add_local (mb, D.23146);
  D.23143 = mono_defaults.object_class;
  D.23144 = &D.23143->byval_arg;
  loc_real_proxy = mono_mb_add_local (mb, D.23144);
  if (copy_return != 0) goto <D.23147>; else goto <D.23148>;
  <D.23147>:
  D.23135 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23135);
  <D.23148>:
  D.23149 = mono_defaults.int32_class;
  D.23150 = &D.23149->byval_arg;
  loc_old_domainid = mono_mb_add_local (mb, D.23150);
  D.23149 = mono_defaults.int32_class;
  D.23150 = &D.23149->byval_arg;
  loc_domainid = mono_mb_add_local (mb, D.23150);
  byte_array_class.85 = byte_array_class;
  D.23146 = &byte_array_class.85->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23146);
  D.23143 = mono_defaults.object_class;
  D.23144 = &D.23143->byval_arg;
  loc_context = mono_mb_add_local (mb, D.23144);
  mono_mb_emit_icall (mb, mono_context_get);
  mono_mb_emit_byte (mb, 37);
  loc_context.86 = (unsigned int) loc_context;
  mono_mb_emit_stloc (mb, loc_context.86);
  method_needs_context_sink.87 = method_needs_context_sink;
  mono_mb_emit_managed_call (mb, method_needs_context_sink.87, 0B);
  D.23153 = mono_mb_emit_short_branch (mb, 45);
  pos = (int) D.23153;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  loc_real_proxy.88 = (unsigned int) loc_real_proxy;
  mono_mb_emit_stloc (mb, loc_real_proxy.88);
  mono_mb_emit_ldflda (mb, 20);
  mono_mb_emit_byte (mb, 74);
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_stloc (mb, loc_domainid.89);
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.89);
  D.23111 = method->klass;
  D.23156 = D.23111->image;
  mono_mb_emit_ptr (mb, D.23156);
  mono_mb_emit_icall (mb, mono_marshal_check_domain_image);
  D.23157 = mono_mb_emit_short_branch (mb, 45);
  pos_dispatch = (int) D.23157;
  pos.90 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.90);
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.19456>;
  <D.19455>:
  D.23159 = i + 1;
  D.23160 = (unsigned int) D.23159;
  mono_mb_emit_ldarg (mb, D.23160);
  i = i + 1;
  <D.19456>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19455>; else goto <D.19457>;
  <D.19457>:
  D.23161 = mono_marshal_get_remoting_invoke (method);
  mono_mb_emit_managed_call (mb, D.23161, 0B);
  mono_mb_emit_byte (mb, 42);
  pos_dispatch.91 = (unsigned int) pos_dispatch;
  mono_mb_patch_short_branch (mb, pos_dispatch.91);
  if (complex_count > 0) goto <D.23163>; else goto <D.23164>;
  <D.23163>:
  D.23166 = ret_marshal_type == 3;
  D.23167 = complex_out_count > 0;
  D.23168 = D.23166 & D.23167;
  if (D.23168 != 0) goto <D.23169>; else goto <D.23170>;
  <D.23169>:
  iftmp.92 = complex_count + 1;
  goto <D.23171>;
  <D.23170>:
  iftmp.92 = complex_count;
  <D.23171>:
  mono_mb_emit_icon (mb, iftmp.92);
  D.23143 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 141, D.23143);
  j = 0;
  i = 0;
  goto <D.19461>;
  <D.19460>:
  {
    struct MonoClass * pclass;

    i.84 = (unsigned int) i;
    D.23132 = i.84 * 4;
    D.23133 = marshal_types + D.23132;
    D.23172 = *D.23133;
    if (D.23172 != 3) goto <D.23173>; else goto <D.23174>;
    <D.23173>:
    // predicted unlikely by continue predictor.
    goto <D.19459>;
    <D.23174>:
    D.23175 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23175);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_icon (mb, j);
    D.23159 = i + 1;
    D.23160 = (unsigned int) D.23159;
    mono_mb_emit_ldarg (mb, D.23160);
    D.23175 = sig->params[i];
    D.23176 = BIT_FIELD_REF <*D.23175, 8, 56>;
    D.23177 = D.23176 & 64;
    if (D.23177 != 0) goto <D.23178>; else goto <D.23179>;
    <D.23178>:
    D.23180 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.23181 = D.23180 & 8;
    if (D.23181 != 0) goto <D.23182>; else goto <D.23183>;
    <D.23182>:
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23184>;
    <D.23183>:
    mono_mb_emit_byte (mb, 80);
    <D.23184>:
    <D.23179>:
    D.23180 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.23181 = D.23180 & 8;
    if (D.23181 != 0) goto <D.23185>; else goto <D.23186>;
    <D.23185>:
    mono_mb_emit_op (mb, 140, pclass);
    <D.23186>:
    mono_mb_emit_byte (mb, 162);
    j = j + 1;
  }
  <D.19459>:
  i = i + 1;
  <D.19461>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19460>; else goto <D.19462>;
  <D.19462>:
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.93);
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.93);
  method_rs_serialize.94 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.94, 0B);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.95);
  goto <D.23190>;
  <D.23164>:
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.94 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.94, 0B);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_stloc (mb, loc_serialized_data.95);
  <D.23190>:
  loc_domainid.89 = (unsigned int) loc_domainid;
  mono_mb_emit_ldloc (mb, loc_domainid.89);
  mono_mb_emit_byte (mb, 23);
  mono_marshal_emit_switch_domain (mb);
  loc_old_domainid.96 = (unsigned int) loc_old_domainid;
  mono_mb_emit_stloc (mb, loc_old_domainid.96);
  loc_real_proxy.88 = (unsigned int) loc_real_proxy;
  mono_mb_emit_ldloc (mb, loc_real_proxy.88);
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_data.95);
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc_addr (mb, loc_serialized_exc.97);
  copy_locals_base = mb->locals;
  i = 0;
  goto <D.19472>;
  <D.19471>:
  i.84 = (unsigned int) i;
  D.23132 = i.84 * 4;
  D.23133 = marshal_types + D.23132;
  D.23172 = *D.23133;
  switch (D.23172) <default: <D.23197>, case 0: <D.19470>, case 1: <D.19465>, case 2: <D.19469>, case 3: <D.19463>>
  <D.19463>:
  // predicted unlikely by continue predictor.
  goto <D.19464>;
  <D.19465>:
  D.23159 = i + 1;
  D.23160 = (unsigned int) D.23159;
  mono_mb_emit_ldarg (mb, D.23160);
  D.23175 = sig->params[i];
  D.23176 = BIT_FIELD_REF <*D.23175, 8, 56>;
  D.23177 = D.23176 & 64;
  if (D.23177 != 0) goto <D.23193>; else goto <D.23194>;
  <D.23193>:
  {
    struct MonoClass * pclass;
    int copy_local;

    D.23175 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23175);
    D.23195 = &pclass->byval_arg;
    copy_local = mono_mb_add_local (mb, D.23195);
    mono_mb_emit_byte (mb, 80);
    copy_local.98 = (unsigned int) copy_local;
    mono_mb_emit_stloc (mb, copy_local.98);
    copy_local.98 = (unsigned int) copy_local;
    mono_mb_emit_ldloc_addr (mb, copy_local.98);
  }
  <D.23194>:
  goto <D.19468>;
  <D.19469>:
  <D.19470>:
  D.23159 = i + 1;
  D.23160 = (unsigned int) D.23159;
  mono_mb_emit_ldarg (mb, D.23160);
  goto <D.19468>;
  <D.23197>:
  <D.19468>:
  <D.19464>:
  i = i + 1;
  <D.19472>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19471>; else goto <D.19473>;
  <D.19473>:
  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.23198 = mono_method_signature (xdomain_method);
  mono_mb_emit_calli (mb, D.23198);
  if (copy_return != 0) goto <D.23199>; else goto <D.23200>;
  <D.23199>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.99);
  <D.23200>:
  loc_old_domainid.96 = (unsigned int) loc_old_domainid;
  mono_mb_emit_ldloc (mb, loc_old_domainid.96);
  mono_mb_emit_byte (mb, 22);
  mono_marshal_emit_switch_domain (mb);
  mono_mb_emit_byte (mb, 38);
  loc_context.86 = (unsigned int) loc_context;
  mono_mb_emit_ldloc (mb, loc_context.86);
  mono_mb_emit_icall (mb, mono_context_set);
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.97);
  D.23202 = mono_mb_emit_short_branch (mb, 44);
  pos_noex = (int) D.23202;
  loc_serialized_exc.97 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.97);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  D.23204 = mono_defaults.exception_class;
  mono_mb_emit_op (mb, 116, D.23204);
  method_exc_fixexc.101 = method_exc_fixexc;
  mono_mb_emit_managed_call (mb, method_exc_fixexc.101, 0B);
  mono_mb_emit_byte (mb, 122);
  pos_noex.102 = (unsigned int) pos_noex;
  mono_mb_patch_short_branch (mb, pos_noex.102);
  j = 0;
  i = 0;
  goto <D.19476>;
  <D.19475>:
  D.23175 = sig->params[i];
  D.23176 = BIT_FIELD_REF <*D.23175, 8, 56>;
  D.23177 = D.23176 & 64;
  if (D.23177 == 0) goto <D.23207>; else goto <D.23209>;
  <D.23209>:
  i.84 = (unsigned int) i;
  D.23132 = i.84 * 4;
  D.23133 = marshal_types + D.23132;
  D.23172 = *D.23133;
  if (D.23172 != 1) goto <D.23207>; else goto <D.23208>;
  <D.23207>:
  // predicted unlikely by continue predictor.
  goto <D.19474>;
  <D.23208>:
  D.23159 = i + 1;
  D.23160 = (unsigned int) D.23159;
  mono_mb_emit_ldarg (mb, D.23160);
  j.103 = j;
  j = j.103 + 1;
  D.23211 = j.103 + copy_locals_base;
  D.23212 = (unsigned int) D.23211;
  mono_mb_emit_ldloc (mb, D.23212);
  D.23175 = sig->params[i];
  D.23213 = mono_class_from_mono_type (D.23175);
  mono_marshal_emit_xdomain_copy_value (mb, D.23213);
  mono_mb_emit_byte (mb, 81);
  <D.19474>:
  i = i + 1;
  <D.19476>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19475>; else goto <D.19477>;
  <D.19477>:
  if (complex_out_count > 0) goto <D.23214>; else goto <D.23215>;
  <D.23214>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.93);
  j = 0;
  i = 0;
  goto <D.19481>;
  <D.19480>:
  i.84 = (unsigned int) i;
  D.23132 = i.84 * 4;
  D.23133 = marshal_types + D.23132;
  D.23172 = *D.23133;
  if (D.23172 != 3) goto <D.23216>; else goto <D.23217>;
  <D.23216>:
  // predicted unlikely by continue predictor.
  goto <D.19478>;
  <D.23217>:
  D.23175 = sig->params[i];
  D.23176 = BIT_FIELD_REF <*D.23175, 8, 56>;
  D.23177 = D.23176 & 64;
  if (D.23177 != 0) goto <D.23218>; else goto <D.23219>;
  <D.23218>:
  {
    struct MonoClass * pclass;

    D.23175 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23175);
    D.23159 = i + 1;
    D.23160 = (unsigned int) D.23159;
    mono_mb_emit_ldarg (mb, D.23160);
    loc_array.93 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.93);
    mono_mb_emit_icon (mb, j);
    mono_mb_emit_byte (mb, 154);
    D.23220 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.23221 = D.23220 & 8;
    if (D.23221 != 0) goto <D.23222>; else goto <D.23223>;
    <D.23222>:
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    mono_mb_emit_op (mb, 129, pclass);
    goto <D.23224>;
    <D.23223>:
    D.23143 = mono_defaults.object_class;
    if (D.23143 != pclass) goto <D.23225>; else goto <D.23226>;
    <D.23225>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23226>:
    mono_mb_emit_byte (mb, 81);
    <D.23224>:
  }
  <D.23219>:
  j = j + 1;
  <D.19478>:
  i = i + 1;
  <D.19481>:
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  if (D.23134 > i) goto <D.19480>; else goto <D.19482>;
  <D.19482>:
  if (ret_marshal_type == 3) goto <D.23227>; else goto <D.23228>;
  <D.23227>:
  loc_array.93 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.93);
  mono_mb_emit_icon (mb, complex_count);
  mono_mb_emit_byte (mb, 154);
  D.23229 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.23230 = D.23229 & 8;
  if (D.23230 != 0) goto <D.23231>; else goto <D.23232>;
  <D.23231>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  <D.23232>:
  <D.23228>:
  goto <D.23233>;
  <D.23215>:
  if (ret_marshal_type == 3) goto <D.23234>; else goto <D.23235>;
  <D.23234>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  D.23229 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.23230 = D.23229 & 8;
  if (D.23230 != 0) goto <D.23236>; else goto <D.23237>;
  <D.23236>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  goto <D.23238>;
  <D.23237>:
  D.23143 = mono_defaults.object_class;
  if (D.23143 != ret_class) goto <D.23239>; else goto <D.23240>;
  <D.23239>:
  mono_mb_emit_op (mb, 116, ret_class);
  <D.23240>:
  <D.23238>:
  goto <D.23241>;
  <D.23235>:
  loc_serialized_data.95 = (unsigned int) loc_serialized_data;
  mono_mb_emit_ldloc (mb, loc_serialized_data.95);
  mono_mb_emit_byte (mb, 37);
  D.23242 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23242;
  byte_array_class.85 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.85);
  pos.90 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.90);
  method_rs_deserialize.100 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.100, 0B);
  mono_mb_emit_byte (mb, 38);
  <D.23241>:
  <D.23233>:
  if (copy_return != 0) goto <D.23243>; else goto <D.23244>;
  <D.23243>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.99);
  if (ret_marshal_type == 1) goto <D.23245>; else goto <D.23246>;
  <D.23245>:
  mono_marshal_emit_xdomain_copy_value (mb, ret_class);
  <D.23246>:
  <D.23244>:
  mono_mb_emit_byte (mb, 42);
  D.23113 = sig->param_count;
  D.23134 = (int) D.23113;
  D.23247 = D.23134 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23247);
  mono_mb_free (mb);
  D.23099 = res;
  return D.23099;
}


mono_marshal_supports_fast_xdomain (struct MonoMethod * method)
{
  gboolean D.23249;
  int iftmp.104;
  struct MonoClass * D.23254;
  unsigned char D.23255;
  unsigned char D.23256;
  short unsigned int D.23258;
  int D.23259;
  int D.23260;
  int D.19352;
  int iftmp.105;
  int D.19348;
  const char[6] * D.23265;
  unsigned char D.23266;
  int D.23267;
  unsigned char D.23268;
  int D.23269;
  _Bool D.23270;
  _Bool D.23271;
  _Bool D.23272;
  const unsigned char * D.23275;
  unsigned char D.23276;
  int D.23277;
  const unsigned char * D.23278;
  unsigned char D.23279;
  int D.23280;
  _Bool D.23281;
  _Bool D.23282;
  const unsigned char * D.23285;
  unsigned char D.23286;
  int D.23287;
  const unsigned char * D.23288;
  unsigned char D.23289;
  int D.23290;
  _Bool D.23291;
  _Bool D.23292;
  const unsigned char * D.23295;
  unsigned char D.23296;
  int D.23297;
  const unsigned char * D.23298;
  unsigned char D.23299;
  int D.23300;
  const char * D.23302;

  D.23254 = method->klass;
  D.23255 = BIT_FIELD_REF <*D.23254, 8, 176>;
  D.23256 = D.23255 & 128;
  if (D.23256 == 0) goto <D.23257>; else goto <D.23251>;
  <D.23257>:
  D.23258 = method->flags;
  D.23259 = (int) D.23258;
  D.23260 = D.23259 & 2048;
  if (D.23260 == 0) goto <D.23252>; else goto <D.23261>;
  <D.23261>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23265 = ".ctor";
      D.23266 = MEM[(const unsigned char *)D.23265];
      D.23267 = (int) D.23266;
      D.23268 = *__s2;
      D.23269 = (int) D.23268;
      __result = D.23267 - D.23269;
      {
        D.23270 = __s1_len != 0;
        D.23271 = __result == 0;
        D.23272 = D.23270 & D.23271;
        if (D.23272 != 0) goto <D.23273>; else goto <D.23274>;
        <D.23273>:
        D.23275 = &MEM[(void *)".ctor" + 1B];
        D.23276 = *D.23275;
        D.23277 = (int) D.23276;
        D.23278 = __s2 + 1;
        D.23279 = *D.23278;
        D.23280 = (int) D.23279;
        __result = D.23277 - D.23280;
        D.23281 = __s1_len > 1;
        D.23271 = __result == 0;
        D.23282 = D.23281 & D.23271;
        if (D.23282 != 0) goto <D.23283>; else goto <D.23284>;
        <D.23283>:
        D.23285 = &MEM[(void *)".ctor" + 2B];
        D.23286 = *D.23285;
        D.23287 = (int) D.23286;
        D.23288 = __s2 + 2;
        D.23289 = *D.23288;
        D.23290 = (int) D.23289;
        __result = D.23287 - D.23290;
        D.23291 = __s1_len > 2;
        D.23271 = __result == 0;
        D.23292 = D.23291 & D.23271;
        if (D.23292 != 0) goto <D.23293>; else goto <D.23294>;
        <D.23293>:
        D.23295 = &MEM[(void *)".ctor" + 3B];
        D.23296 = *D.23295;
        D.23297 = (int) D.23296;
        D.23298 = __s2 + 3;
        D.23299 = *D.23298;
        D.23300 = (int) D.23299;
        __result = D.23297 - D.23300;
        <D.23294>:
        <D.23284>:
        <D.23274>:
      }
      D.19348 = __result;
    }
    iftmp.105 = D.19348;
    goto <D.23301>;
    <D.23264>:
    D.23302 = method->name;
    iftmp.105 = __builtin_strcmp (".ctor", D.23302);
    <D.23301>:
    D.19352 = iftmp.105;
  }
  if (D.19352 != 0) goto <D.23252>; else goto <D.23251>;
  <D.23252>:
  iftmp.104 = 1;
  goto <D.23253>;
  <D.23251>:
  iftmp.104 = 0;
  <D.23253>:
  D.23249 = iftmp.104;
  return D.23249;
}


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

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


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.23319;
  int iftmp.115;
  struct MonoType * D.23323;
  unsigned char D.23324;
  short unsigned int D.23327;
  int D.23328;
  int D.23329;
  int D.23330;
  unsigned int D.23331;
  struct MonoImage * D.23332;
  int j.116;
  struct MonoClass * D.23334;
  struct MonoType * D.23335;
  int j.117;
  struct MonoClass * byte_array_class.118;
  struct MonoType * D.23338;
  int j.119;
  unsigned int i.120;
  unsigned int D.23341;
  int * D.23342;
  int D.23343;
  int j.121;
  struct MonoType * D.23347;
  struct MonoClass * D.23351;
  struct MonoType * D.23352;
  const char * D.23353;
  struct MonoClass * D.23354;
  struct MonoMethod * D.23355;
  struct MonoType * D.23356;
  struct MonoImage * D.23361;
  int D.23362;
  unsigned int D.23363;
  struct MonoMethod * method_set_call_context.122;
  unsigned int D.23365;
  struct MonoMethod * method_rs_deserialize.123;
  unsigned int loc_array.124;
  unsigned int pos.125;
  struct MonoMethod * method_rs_appdomain_target.126;
  int j.127;
  unsigned char D.23374;
  unsigned char D.23375;
  unsigned char D.23378;
  unsigned char D.23379;
  struct MonoType * D.23389;
  int param_index.128;
  unsigned int param_index.129;
  unsigned int copy_local.130;
  unsigned int param_index.131;
  int param_index.132;
  unsigned int param_index.133;
  unsigned int loc_return.134;
  int j.135;
  int D.23408;
  unsigned int D.23409;
  struct MonoClass * D.23410;
  unsigned char D.23415;
  unsigned char D.23416;
  _Bool D.23421;
  long int D.23422;
  long int D.23423;
  unsigned char D.23426;
  unsigned char D.23427;
  struct MonoMethod * method_rs_serialize.136;
  unsigned int D.23437;
  int D.23438;
  unsigned int D.23439;
  unsigned int D.23440;
  unsigned int D.23441;
  int D.23442;
  unsigned int D.23443;
  struct MonoMethod * method_rs_serialize_exc.137;
  unsigned int loc_serialized_exc.138;
  int D.23446;
  unsigned int D.23447;
  unsigned int D.23448;
  unsigned int D.23449;
  unsigned int pos_leave.139;
  short unsigned int D.23453;
  int D.23454;
  int D.23455;
  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.23317>; else goto <D.23318>;
  <D.23317>:
  D.23319 = res;
  return D.23319;
  <D.23318>:
  sig = mono_method_signature (method);
  D.23323 = sig->ret;
  D.23324 = D.23323->type;
  if (D.23324 != 1) goto <D.23325>; else goto <D.23321>;
  <D.23325>:
  if (ret_marshal_type != 3) goto <D.23326>; else goto <D.23321>;
  <D.23326>:
  iftmp.115 = 1;
  goto <D.23322>;
  <D.23321>:
  iftmp.115 = 0;
  <D.23322>:
  copy_return = iftmp.115;
  j = 0;
  D.23327 = sig->param_count;
  D.23328 = (int) D.23327;
  D.23329 = D.23328 + 3;
  D.23330 = D.23329 - complex_count;
  D.23331 = (unsigned int) D.23330;
  D.23332 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.23332, D.23331);
  j.116 = j;
  j = j.116 + 1;
  D.23334 = mono_defaults.object_class;
  D.23335 = &D.23334->byval_arg;
  csig->params[j.116] = D.23335;
  j.117 = j;
  j = j.117 + 1;
  byte_array_class.118 = byte_array_class;
  D.23338 = &byte_array_class.118->this_arg;
  csig->params[j.117] = D.23338;
  j.119 = j;
  j = j.119 + 1;
  byte_array_class.118 = byte_array_class;
  D.23338 = &byte_array_class.118->this_arg;
  csig->params[j.119] = D.23338;
  i = 0;
  goto <D.19402>;
  <D.19401>:
  i.120 = (unsigned int) i;
  D.23341 = i.120 * 4;
  D.23342 = marshal_types + D.23341;
  D.23343 = *D.23342;
  if (D.23343 != 3) goto <D.23344>; else goto <D.23345>;
  <D.23344>:
  j.121 = j;
  j = j.121 + 1;
  D.23347 = sig->params[i];
  csig->params[j.121] = D.23347;
  <D.23345>:
  i = i + 1;
  <D.19402>:
  D.23327 = sig->param_count;
  D.23328 = (int) D.23327;
  if (D.23328 > i) goto <D.19401>; else goto <D.19403>;
  <D.19403>:
  if (copy_return != 0) goto <D.23348>; else goto <D.23349>;
  <D.23348>:
  D.23323 = sig->ret;
  csig->ret = D.23323;
  goto <D.23350>;
  <D.23349>:
  D.23351 = mono_defaults.void_class;
  D.23352 = &D.23351->byval_arg;
  csig->ret = D.23352;
  <D.23350>:
  csig->pinvoke = 1;
  csig->hasthis = 0;
  D.23353 = method->name;
  D.23354 = method->klass;
  mb = mono_mb_new (D.23354, D.23353, 11);
  D.23355 = mb->method;
  D.23355->save_lmf = 1;
  byte_array_class.118 = byte_array_class;
  D.23356 = &byte_array_class.118->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23356);
  if (complex_count > 0) goto <D.23357>; else goto <D.23358>;
  <D.23357>:
  D.23334 = mono_defaults.object_class;
  D.23335 = &D.23334->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23335);
  <D.23358>:
  D.23323 = sig->ret;
  D.23324 = D.23323->type;
  if (D.23324 != 1) goto <D.23359>; else goto <D.23360>;
  <D.23359>:
  D.23323 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23323);
  D.23323 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23323);
  <D.23360>:
  D.23354 = method->klass;
  D.23361 = D.23354->image;
  main_clause = mono_image_alloc0 (D.23361, 24);
  D.23362 = mono_mb_get_label (mb);
  D.23363 = (unsigned int) D.23362;
  main_clause->try_offset = D.23363;
  mono_mb_emit_byte (mb, 20);
  method_set_call_context.122 = method_set_call_context;
  mono_mb_emit_managed_call (mb, method_set_call_context.122, 0B);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 37);
  D.23365 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23365;
  byte_array_class.118 = byte_array_class;
  mono_marshal_emit_xdomain_copy_value (mb, byte_array_class.118);
  method_rs_deserialize.123 = method_rs_deserialize;
  mono_mb_emit_managed_call (mb, method_rs_deserialize.123, 0B);
  if (complex_count > 0) goto <D.23367>; else goto <D.23368>;
  <D.23367>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.124);
  goto <D.23370>;
  <D.23368>:
  mono_mb_emit_byte (mb, 38);
  <D.23370>:
  pos.125 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.125);
  mono_mb_emit_ldarg (mb, 0);
  method_rs_appdomain_target.126 = method_rs_appdomain_target;
  mono_mb_emit_managed_call (mb, method_rs_appdomain_target.126, 0B);
  copy_locals_base = mb->locals;
  param_index = 3;
  j = 0;
  i = 0;
  goto <D.19413>;
  <D.19412>:
  {
    struct MonoType * pt;
    struct MonoClass * pclass;

    pt = sig->params[i];
    pclass = mono_class_from_mono_type (pt);
    i.120 = (unsigned int) i;
    D.23341 = i.120 * 4;
    D.23342 = marshal_types + D.23341;
    D.23343 = *D.23342;
    switch (D.23343) <default: <D.23399>, case 0: <D.19411>, case 1: <D.19410>, case 2: <D.19408>, case 3: <D.19406>>
    <D.19406>:
    loc_array.124 = (unsigned int) loc_array;
    mono_mb_emit_ldloc (mb, loc_array.124);
    j.127 = j;
    j = j.127 + 1;
    mono_mb_emit_icon (mb, j.127);
    D.23374 = BIT_FIELD_REF <*pt, 8, 56>;
    D.23375 = D.23374 & 64;
    if (D.23375 != 0) goto <D.23376>; else goto <D.23377>;
    <D.23376>:
    D.23378 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.23379 = D.23378 & 8;
    if (D.23379 != 0) goto <D.23380>; else goto <D.23381>;
    <D.23380>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    goto <D.23382>;
    <D.23381>:
    mono_mb_emit_op (mb, 143, pclass);
    <D.23382>:
    goto <D.23383>;
    <D.23377>:
    D.23378 = BIT_FIELD_REF <*pclass, 8, 160>;
    D.23379 = D.23378 & 8;
    if (D.23379 != 0) goto <D.23384>; else goto <D.23385>;
    <D.23384>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23386>;
    <D.23385>:
    mono_mb_emit_byte (mb, 154);
    D.23334 = mono_defaults.object_class;
    if (D.23334 != pclass) goto <D.23387>; else goto <D.23388>;
    <D.23387>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23388>:
    <D.23386>:
    <D.23383>:
    goto <D.19407>;
    <D.19408>:
    {
      int copy_local;

      D.23389 = &pclass->byval_arg;
      copy_local = mono_mb_add_local (mb, D.23389);
      param_index.128 = param_index;
      param_index = param_index.128 + 1;
      param_index.129 = (unsigned int) param_index.128;
      mono_mb_emit_ldarg (mb, param_index.129);
      mono_marshal_emit_xdomain_copy_value (mb, pclass);
      mono_mb_emit_byte (mb, 37);
      copy_local.130 = (unsigned int) copy_local;
      mono_mb_emit_stloc (mb, copy_local.130);
      goto <D.19407>;
    }
    <D.19410>:
    param_index.131 = (unsigned int) param_index;
    mono_mb_emit_ldarg (mb, param_index.131);
    D.23374 = BIT_FIELD_REF <*pt, 8, 56>;
    D.23375 = D.23374 & 64;
    if (D.23375 != 0) goto <D.23394>; else goto <D.23395>;
    <D.23394>:
    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.23396>;
    <D.23395>:
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    <D.23396>:
    param_index = param_index + 1;
    goto <D.19407>;
    <D.19411>:
    param_index.132 = param_index;
    param_index = param_index.132 + 1;
    param_index.133 = (unsigned int) param_index.132;
    mono_mb_emit_ldarg (mb, param_index.133);
    goto <D.19407>;
    <D.23399>:
    <D.19407>:
  }
  i = i + 1;
  <D.19413>:
  D.23327 = sig->param_count;
  D.23328 = (int) D.23327;
  if (D.23328 > i) goto <D.19412>; else goto <D.19414>;
  <D.19414>:
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_op (mb, 111, method);
  D.23323 = sig->ret;
  D.23324 = D.23323->type;
  if (D.23324 != 1) goto <D.23400>; else goto <D.23401>;
  <D.23400>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.134);
  <D.23401>:
  j = 0;
  param_index = 3;
  i = 0;
  goto <D.19417>;
  <D.19416>:
  i.120 = (unsigned int) i;
  D.23341 = i.120 * 4;
  D.23342 = marshal_types + D.23341;
  D.23343 = *D.23342;
  if (D.23343 == 3) goto <D.23403>; else goto <D.23404>;
  <D.23403>:
  // predicted unlikely by continue predictor.
  goto <D.19415>;
  <D.23404>:
  i.120 = (unsigned int) i;
  D.23341 = i.120 * 4;
  D.23342 = marshal_types + D.23341;
  D.23343 = *D.23342;
  if (D.23343 == 2) goto <D.23405>; else goto <D.23406>;
  <D.23405>:
  j.135 = j;
  j = j.135 + 1;
  D.23408 = j.135 + copy_locals_base;
  D.23409 = (unsigned int) D.23408;
  mono_mb_emit_ldloc (mb, D.23409);
  param_index.131 = (unsigned int) param_index;
  mono_mb_emit_ldarg (mb, param_index.131);
  D.23347 = sig->params[i];
  D.23410 = mono_class_from_mono_type (D.23347);
  mono_marshal_emit_xdomain_copy_out_value (mb, D.23410);
  <D.23406>:
  param_index = param_index + 1;
  <D.19415>:
  i = i + 1;
  <D.19417>:
  D.23327 = sig->param_count;
  D.23328 = (int) D.23327;
  if (D.23328 > i) goto <D.19416>; else goto <D.19418>;
  <D.19418>:
  if (complex_out_count > 0) goto <D.23411>; else goto <D.23412>;
  <D.23411>:
  j = 0;
  i = 0;
  goto <D.19421>;
  <D.19420>:
  i.120 = (unsigned int) i;
  D.23341 = i.120 * 4;
  D.23342 = marshal_types + D.23341;
  D.23343 = *D.23342;
  if (D.23343 != 3) goto <D.23413>; else goto <D.23414>;
  <D.23413>:
  // predicted unlikely by continue predictor.
  goto <D.19419>;
  <D.23414>:
  D.23347 = sig->params[i];
  D.23415 = BIT_FIELD_REF <*D.23347, 8, 56>;
  D.23416 = D.23415 & 64;
  if (D.23416 == 0) goto <D.23417>; else goto <D.23418>;
  <D.23417>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  mono_mb_emit_icon (mb, j);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 162);
  <D.23418>:
  j = j + 1;
  <D.19419>:
  i = i + 1;
  <D.19421>:
  D.23327 = sig->param_count;
  D.23328 = (int) D.23327;
  if (D.23328 > i) goto <D.19420>; else goto <D.19422>;
  <D.19422>:
  if (ret_marshal_type == 3) goto <D.23419>; else goto <D.23420>;
  <D.23419>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  mono_mb_emit_icon (mb, complex_count);
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  D.23421 = ret_class == 0B;
  D.23422 = (long int) D.23421;
  D.23423 = __builtin_expect (D.23422, 0);
  if (D.23423 != 0) goto <D.23424>; else goto <D.23425>;
  <D.23424>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3660, "ret_class");
  <D.23425>:
  D.23426 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.23427 = D.23426 & 8;
  if (D.23427 != 0) goto <D.23428>; else goto <D.23429>;
  <D.23428>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23429>:
  mono_mb_emit_byte (mb, 162);
  <D.23420>:
  mono_mb_emit_ldarg (mb, 1);
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_ldloc (mb, loc_array.124);
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.23431>;
  <D.23412>:
  if (ret_marshal_type == 3) goto <D.23432>; else goto <D.23433>;
  <D.23432>:
  mono_mb_emit_ldarg (mb, 1);
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  D.23426 = BIT_FIELD_REF <*ret_class, 8, 160>;
  D.23427 = D.23426 & 8;
  if (D.23427 != 0) goto <D.23434>; else goto <D.23435>;
  <D.23434>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23435>:
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  goto <D.23436>;
  <D.23433>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 20);
  method_rs_serialize.136 = method_rs_serialize;
  mono_mb_emit_managed_call (mb, method_rs_serialize.136, 0B);
  mono_mb_emit_byte (mb, 81);
  <D.23436>:
  <D.23431>:
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  D.23437 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.23437;
  main_clause->flags = 0;
  D.23438 = mono_mb_get_pos (mb);
  D.23439 = (unsigned int) D.23438;
  D.23440 = main_clause->try_offset;
  D.23441 = D.23439 - D.23440;
  main_clause->try_len = D.23441;
  D.23334 = mono_defaults.object_class;
  main_clause->data.catch_class = D.23334;
  D.23442 = mono_mb_get_label (mb);
  D.23443 = (unsigned int) D.23442;
  main_clause->handler_offset = D.23443;
  method_rs_serialize_exc.137 = method_rs_serialize_exc;
  mono_mb_emit_managed_call (mb, method_rs_serialize_exc.137, 0B);
  loc_serialized_exc.138 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_stloc (mb, loc_serialized_exc.138);
  mono_mb_emit_ldarg (mb, 2);
  loc_serialized_exc.138 = (unsigned int) loc_serialized_exc;
  mono_mb_emit_ldloc (mb, loc_serialized_exc.138);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.23446 = mono_mb_get_pos (mb);
  D.23447 = (unsigned int) D.23446;
  D.23448 = main_clause->handler_offset;
  D.23449 = D.23447 - D.23448;
  main_clause->handler_len = D.23449;
  pos_leave.139 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.139);
  if (copy_return != 0) goto <D.23451>; else goto <D.23452>;
  <D.23451>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  <D.23452>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, main_clause);
  D.23453 = csig->param_count;
  D.23454 = (int) D.23453;
  D.23455 = D.23454 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, csig, D.23455);
  mono_mb_free (mb);
  D.23319 = res;
  return D.23319;
}


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

  if (target_type == 1) goto <D.23457>; else goto <D.23458>;
  <D.23457>:
  D.23459 = mono_marshal_get_xappdomain_invoke (method);
  return D.23459;
  <D.23458>:
  if (target_type == 2) goto <D.23460>; else goto <D.23461>;
  <D.23460>:
  D.23459 = mono_cominterop_get_invoke (method);
  return D.23459;
  <D.23461>:
  D.23459 = mono_marshal_get_remoting_invoke (method);
  return D.23459;
  D.23459 = 0B;
  return D.23459;
}


mono_marshal_get_remoting_invoke_with_check (struct MonoMethod * method)
{
  _Bool D.23463;
  long int D.23464;
  long int D.23465;
  unsigned char D.23468;
  unsigned char D.23469;
  struct MonoMethod * D.23472;
  struct MonoMethodSignature * D.23473;
  unsigned char D.23474;
  unsigned char D.23475;
  _Bool D.23476;
  long int D.23477;
  long int D.23478;
  const char * D.23483;
  struct MonoClass * D.23484;
  unsigned int i.140;
  short unsigned int D.23486;
  int D.23487;
  int D.23488;
  struct MonoMethodSignature * D.23491;
  unsigned int pos_rem.141;
  struct MonoMethodSignature * D.23493;
  unsigned int pos.142;
  struct MonoMethodSignature * D.23495;
  int D.23496;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * native;
  int i;
  int pos;
  int pos_rem;

  D.23463 = method == 0B;
  D.23464 = (long int) D.23463;
  D.23465 = __builtin_expect (D.23464, 0);
  if (D.23465 != 0) goto <D.23466>; else goto <D.23467>;
  <D.23466>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4087, "method");
  <D.23467>:
  D.23468 = BIT_FIELD_REF <*method, 8, 160>;
  D.23469 = D.23468 & 124;
  if (D.23469 == 36) goto <D.23470>; else goto <D.23471>;
  <D.23470>:
  D.23472 = method;
  return D.23472;
  <D.23471>:
  D.23473 = mono_method_signature (method);
  D.23474 = BIT_FIELD_REF <*D.23473, 8, 80>;
  D.23475 = D.23474 & 64;
  D.23476 = D.23475 == 0;
  D.23477 = (long int) D.23476;
  D.23478 = __builtin_expect (D.23477, 0);
  if (D.23478 != 0) goto <D.23479>; else goto <D.23480>;
  <D.23479>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4093, "mono_method_signature (method)->hasthis");
  <D.23480>:
  res = mono_marshal_remoting_find_in_cache (method, 9);
  if (res != 0B) goto <D.23481>; else goto <D.23482>;
  <D.23481>:
  D.23472 = res;
  return D.23472;
  <D.23482>:
  sig = mono_signature_no_pinvoke (method);
  D.23483 = method->name;
  D.23484 = method->klass;
  mb = mono_mb_new (D.23484, D.23483, 9);
  i = 0;
  goto <D.19502>;
  <D.19501>:
  i.140 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.140);
  i = i + 1;
  <D.19502>:
  D.23486 = sig->param_count;
  D.23487 = (int) D.23486;
  if (D.23487 >= i) goto <D.19501>; else goto <D.19503>;
  <D.19503>:
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  D.23488 = mono_marshal_supports_fast_xdomain (method);
  if (D.23488 != 0) goto <D.23489>; else goto <D.23490>;
  <D.23489>:
  mono_mb_emit_ldarg (mb, 0);
  pos_rem = mono_mb_emit_xdomain_check (mb, 59);
  native = mono_marshal_get_xappdomain_invoke (method);
  D.23491 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23491);
  mono_mb_emit_byte (mb, 42);
  pos_rem.141 = (unsigned int) pos_rem;
  mono_mb_patch_branch (mb, pos_rem.141);
  <D.23490>:
  native = mono_marshal_get_remoting_invoke (method);
  D.23493 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23493);
  mono_mb_emit_byte (mb, 42);
  pos.142 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.142);
  D.23495 = mono_method_signature (method);
  mono_mb_emit_managed_call (mb, method, D.23495);
  mono_mb_emit_byte (mb, 42);
  D.23486 = sig->param_count;
  D.23487 = (int) D.23486;
  D.23496 = D.23487 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23496);
  mono_mb_free (mb);
  D.23472 = res;
  return D.23472;
}


mono_mb_emit_proxy_check (struct MonoMethodBuilder * mb, int branch_code)
{
  struct MonoClass * D.23498;
  unsigned int D.23499;
  int D.23500;
  unsigned char D.23501;
  int D.23502;
  unsigned int D.23503;
  int D.23504;
  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.23498 = mono_defaults.transparent_proxy_class;
  D.23499 = mono_mb_add_data (mb, D.23498);
  D.23500 = (int) D.23499;
  mono_mb_emit_i4 (mb, D.23500);
  D.23501 = (unsigned char) branch_code;
  D.23502 = (int) D.23501;
  D.23503 = mono_mb_emit_branch (mb, D.23502);
  pos = (int) D.23503;
  D.23504 = pos;
  return D.23504;
}


mono_mb_emit_xdomain_check (struct MonoMethodBuilder * mb, int branch_code)
{
  unsigned char D.23506;
  int D.23507;
  unsigned int D.23508;
  int D.23509;
  int pos;

  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 20);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_icon (mb, -1);
  D.23506 = (unsigned char) branch_code;
  D.23507 = (int) D.23506;
  D.23508 = mono_mb_emit_branch (mb, D.23507);
  pos = (int) D.23508;
  D.23509 = pos;
  return D.23509;
}


mono_marshal_get_delegate_invoke (struct MonoMethod * method, struct MonoDelegate * del)
{
  struct MonoObject * D.23513;
  struct MonoMethod * D.23516;
  struct MonoMethodSignature * D.23519;
  unsigned char D.23520;
  unsigned char D.23521;
  unsigned char D.23524;
  unsigned char D.23525;
  struct MonoMethodSignature * D.23528;
  unsigned char D.23529;
  unsigned char D.23530;
  _Bool D.23531;
  long int D.23532;
  long int D.23533;
  struct MonoGenericContext * D.23536;
  struct MonoType * D.23537;
  int iftmp.143;
  struct MonoClass * D.23544;
  struct MonoClass * D.23545;
  struct MonoClass * D.23546;
  int D.19562;
  int iftmp.144;
  int D.19561;
  const char[7] * D.23551;
  unsigned char D.23552;
  int D.23553;
  unsigned char D.23554;
  int D.23555;
  _Bool D.23556;
  _Bool D.23557;
  _Bool D.23558;
  const unsigned char * D.23561;
  unsigned char D.23562;
  int D.23563;
  const unsigned char * D.23564;
  unsigned char D.23565;
  int D.23566;
  _Bool D.23567;
  _Bool D.23568;
  const unsigned char * D.23571;
  unsigned char D.23572;
  int D.23573;
  const unsigned char * D.23574;
  unsigned char D.23575;
  int D.23576;
  _Bool D.23577;
  _Bool D.23578;
  const unsigned char * D.23581;
  unsigned char D.23582;
  int D.23583;
  const unsigned char * D.23584;
  unsigned char D.23585;
  int D.23586;
  const char * D.23588;
  _Bool D.23589;
  long int D.23590;
  long int D.23591;
  short unsigned int D.23596;
  struct MonoMethodSignature * D.23597;
  short unsigned int D.23598;
  _Bool D.23599;
  struct MonoMethodSignature * D.23604;
  short unsigned int D.23605;
  int D.23606;
  int D.23607;
  int D.23608;
  short unsigned int D.23611;
  int D.23612;
  int D.23613;
  _Bool D.23616;
  long int D.23617;
  long int D.23618;
  unsigned char D.23621;
  unsigned char D.23622;
  int D.23625;
  _Bool D.23630;
  long int D.23631;
  long int D.23632;
  struct MonoImage * D.23637;
  struct GHashTable * * D.23638;
  struct MonoMethod * D.23641;
  struct GHashTable * * D.23645;
  _Bool D.23653;
  long int D.23654;
  long int D.23655;
  struct GHashTable * D.23658;
  struct GHashTable * D.23661;
  _Bool D.23664;
  long int D.23665;
  long int D.23666;
  struct GHashTable * * D.23672;
  struct MonoClass * D.23683;
  struct MonoClass * D.23684;
  struct MonoType * D.23685;
  unsigned char D.23686;
  unsigned char D.23687;
  _Bool D.23688;
  long int D.23689;
  long int D.23690;
  unsigned int local_prev.145;
  unsigned int D.23694;
  int D.23695;
  unsigned int D.23696;
  struct MonoGenericContext * D.23699;
  struct MonoMethod * D.23700;
  struct MonoType * D.23702;
  unsigned char D.23703;
  unsigned int pos0.146;
  unsigned int local_target.147;
  unsigned int D.23710;
  struct MonoType * D.23722;
  int D.23723;
  struct MonoClass * D.23726;
  int D.23729;
  _Bool D.23738;
  long int D.23739;
  long int D.23740;
  struct MonoMethodSignature * D.23747;
  struct MonoClass * D.23748;
  struct MonoImage * D.23749;
  struct MonoMethodSignature * D.23750;
  _Bool D.23753;
  long int D.23754;
  long int D.23755;
  _Bool D.23761;
  long int D.23762;
  long int D.23763;
  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.23511>; else goto <D.23512>;
      <D.23511>:
      D.23513 = del->target;
      if (D.23513 == 0B) goto <D.23514>; else goto <D.23515>;
      <D.23514>:
      D.23516 = del->method;
      if (D.23516 != 0B) goto <D.23517>; else goto <D.23518>;
      <D.23517>:
      D.23516 = del->method;
      D.23519 = mono_method_signature (D.23516);
      D.23520 = BIT_FIELD_REF <*D.23519, 8, 80>;
      D.23521 = D.23520 & 64;
      if (D.23521 != 0) goto <D.23522>; else goto <D.23523>;
      <D.23522>:
      callvirt = 1;
      target_method = del->method;
      D.23524 = BIT_FIELD_REF <*target_method, 8, 168>;
      D.23525 = D.23524 & 16;
      if (D.23525 != 0) goto <D.23526>; else goto <D.23527>;
      <D.23526>:
      {
        struct MonoType * target_type;

        D.23528 = method->signature;
        D.23529 = BIT_FIELD_REF <*D.23528, 8, 80>;
        D.23530 = D.23529 & 64;
        D.23531 = D.23530 == 0;
        D.23532 = (long int) D.23531;
        D.23533 = __builtin_expect (D.23532, 0);
        if (D.23533 != 0) goto <D.23534>; else goto <D.23535>;
        <D.23534>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4211, "method->signature->hasthis");
        <D.23535>:
        D.23536 = mono_method_get_context (method);
        D.23528 = method->signature;
        D.23537 = D.23528->params[0];
        target_type = mono_class_inflate_generic_type (D.23537, D.23536);
        target_class = mono_class_from_mono_type (target_type);
      }
      goto <D.23538>;
      <D.23527>:
      D.23516 = del->method;
      target_class = D.23516->klass;
      <D.23538>:
      <D.23523>:
      <D.23518>:
      <D.23515>:
      <D.23512>:
      if (method == 0B) goto <D.23540>; else goto <D.23543>;
      <D.23543>:
      D.23544 = method->klass;
      D.23545 = D.23544->parent;
      D.23546 = mono_defaults.multicastdelegate_class;
      if (D.23545 != D.23546) goto <D.23540>; else goto <D.23547>;
      <D.23547>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = method->name;
          D.23551 = "Invoke";
          D.23552 = MEM[(const unsigned char *)D.23551];
          D.23553 = (int) D.23552;
          D.23554 = *__s2;
          D.23555 = (int) D.23554;
          __result = D.23553 - D.23555;
          {
            D.23556 = __s2_len != 0;
            D.23557 = __result == 0;
            D.23558 = D.23556 & D.23557;
            if (D.23558 != 0) goto <D.23559>; else goto <D.23560>;
            <D.23559>:
            D.23561 = &MEM[(void *)"Invoke" + 1B];
            D.23562 = *D.23561;
            D.23563 = (int) D.23562;
            D.23564 = __s2 + 1;
            D.23565 = *D.23564;
            D.23566 = (int) D.23565;
            __result = D.23563 - D.23566;
            D.23567 = __s2_len > 1;
            D.23557 = __result == 0;
            D.23568 = D.23567 & D.23557;
            if (D.23568 != 0) goto <D.23569>; else goto <D.23570>;
            <D.23569>:
            D.23571 = &MEM[(void *)"Invoke" + 2B];
            D.23572 = *D.23571;
            D.23573 = (int) D.23572;
            D.23574 = __s2 + 2;
            D.23575 = *D.23574;
            D.23576 = (int) D.23575;
            __result = D.23573 - D.23576;
            D.23577 = __s2_len > 2;
            D.23557 = __result == 0;
            D.23578 = D.23577 & D.23557;
            if (D.23578 != 0) goto <D.23579>; else goto <D.23580>;
            <D.23579>:
            D.23581 = &MEM[(void *)"Invoke" + 3B];
            D.23582 = *D.23581;
            D.23583 = (int) D.23582;
            D.23584 = __s2 + 3;
            D.23585 = *D.23584;
            D.23586 = (int) D.23585;
            __result = D.23583 - D.23586;
            <D.23580>:
            <D.23570>:
            <D.23560>:
          }
          D.19561 = __result;
        }
        iftmp.144 = -D.19561;
        goto <D.23587>;
        <D.23550>:
        D.23588 = method->name;
        iftmp.144 = __builtin_strcmp (D.23588, "Invoke");
        <D.23587>:
        D.19562 = iftmp.144;
      }
      if (D.19562 != 0) goto <D.23540>; else goto <D.23541>;
      <D.23540>:
      iftmp.143 = 1;
      goto <D.23542>;
      <D.23541>:
      iftmp.143 = 0;
      <D.23542>:
      D.23589 = iftmp.143 != 0;
      D.23590 = (long int) D.23589;
      D.23591 = __builtin_expect (D.23590, 0);
      if (D.23591 != 0) goto <D.23592>; else goto <D.23593>;
      <D.23592>:
      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.23593>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      if (callvirt != 0) goto <D.23594>; else goto <D.23595>;
      <D.23594>:
      D.23596 = sig->param_count;
      D.23516 = del->method;
      D.23597 = mono_method_signature (D.23516);
      D.23598 = D.23597->param_count;
      D.23599 = D.23596 == D.23598;
      closed_over_null = (gboolean) D.23599;
      <D.23595>:
      if (del != 0B) goto <D.23600>; else goto <D.23601>;
      <D.23600>:
      D.23516 = del->method;
      if (D.23516 != 0B) goto <D.23602>; else goto <D.23603>;
      <D.23602>:
      D.23516 = del->method;
      D.23604 = mono_method_signature (D.23516);
      D.23605 = D.23604->param_count;
      D.23606 = (int) D.23605;
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      D.23608 = D.23607 + 1;
      if (D.23606 == D.23608) goto <D.23609>; else goto <D.23610>;
      <D.23609>:
      D.23516 = del->method;
      D.23611 = D.23516->flags;
      D.23612 = (int) D.23611;
      D.23613 = D.23612 & 16;
      if (D.23613 != 0) goto <D.23614>; else goto <D.23615>;
      <D.23614>:
      D.23616 = callvirt != 0;
      D.23617 = (long int) D.23616;
      D.23618 = __builtin_expect (D.23617, 0);
      if (D.23618 != 0) goto <D.23619>; else goto <D.23620>;
      <D.23619>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4229, "!callvirt");
      <D.23620>:
      D.23516 = del->method;
      invoke_sig = mono_method_signature (D.23516);
      target_method = 0B;
      static_method_with_first_arg_bound = 1;
      <D.23615>:
      <D.23610>:
      <D.23603>:
      <D.23601>:
      D.23621 = BIT_FIELD_REF <*method, 8, 168>;
      D.23622 = D.23621 & 16;
      if (D.23622 != 0) goto <D.23623>; else goto <D.23624>;
      <D.23623>:
      D.23625 = callvirt | static_method_with_first_arg_bound;
      if (D.23625 == 0) goto <D.23626>; else goto <D.23627>;
      <D.23626>:
      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.23628>; else goto <D.23629>;
      <D.23628>:
      D.23544 = method->klass;
      container = D.23544->generic_container;
      <D.23629>:
      D.23630 = container == 0B;
      D.23631 = (long int) D.23630;
      D.23632 = __builtin_expect (D.23631, 0);
      if (D.23632 != 0) goto <D.23633>; else goto <D.23634>;
      <D.23633>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4246, "container");
      <D.23634>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      <D.23627>:
      <D.23624>:
      if (ctx != 0B) goto <D.23635>; else goto <D.23636>;
      <D.23635>:
      D.23544 = method->klass;
      D.23637 = D.23544->image;
      D.23638 = &D.23637->delegate_invoke_generic_cache;
      cache = get_cache (D.23638, mono_aligned_addr_hash, 0B);
      res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
      if (res != 0B) goto <D.23639>; else goto <D.23640>;
      <D.23639>:
      D.23641 = res;
      return D.23641;
      <D.23640>:
      goto <D.23642>;
      <D.23636>:
      if (static_method_with_first_arg_bound != 0) goto <D.23643>; else goto <D.23644>;
      <D.23643>:
      D.23544 = method->klass;
      D.23637 = D.23544->image;
      D.23645 = &D.23637->delegate_bound_static_invoke_cache;
      cache = get_cache (D.23645, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, invoke_sig);
      if (res != 0B) goto <D.23646>; else goto <D.23647>;
      <D.23646>:
      D.23641 = res;
      return D.23641;
      <D.23647>:
      goto <D.23648>;
      <D.23644>:
      if (callvirt != 0) goto <D.23649>; else goto <D.23650>;
      <D.23649>:
      {
        struct GHashTable * * cache_ptr;

        D.23544 = method->klass;
        D.23637 = D.23544->image;
        cache_ptr = &D.23637->delegate_abstract_invoke_cache;
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23651>; else goto <D.23652>;
          <D.23651>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23652>:
          D.23653 = ret != 0;
          D.23654 = (long int) D.23653;
          D.23655 = __builtin_expect (D.23654, 0);
          if (D.23655 != 0) goto <D.23656>; else goto <D.23657>;
          <D.23656>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4275, "ret == 0");
          <D.23657>:
        }
        D.23658 = *cache_ptr;
        if (D.23658 == 0B) goto <D.23659>; else goto <D.23660>;
        <D.23659>:
        D.23661 = monoeg_g_hash_table_new_full (signature_method_pair_hash, signature_method_pair_equal, free_signature_method_pair, 0B);
        *cache_ptr = D.23661;
        <D.23660>:
        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.23662>; else goto <D.23663>;
          <D.23662>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23663>:
          D.23664 = ret != 0;
          D.23665 = (long int) D.23664;
          D.23666 = __builtin_expect (D.23665, 0);
          if (D.23666 != 0) goto <D.23667>; else goto <D.23668>;
          <D.23667>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4282, "ret == 0");
          <D.23668>:
        }
        if (res != 0B) goto <D.23669>; else goto <D.23670>;
        <D.23669>:
        D.23641 = res;
        return D.23641;
        <D.23670>:
      }
      goto <D.23671>;
      <D.23650>:
      D.23544 = method->klass;
      D.23637 = D.23544->image;
      D.23672 = &D.23637->delegate_invoke_cache;
      cache = get_cache (D.23672, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, sig);
      if (res != 0B) goto <D.23673>; else goto <D.23674>;
      <D.23673>:
      D.23641 = res;
      return D.23641;
      <D.23674>:
      <D.23671>:
      <D.23648>:
      <D.23642>:
      D.23544 = method->klass;
      D.23637 = D.23544->image;
      static_sig = signature_dup (D.23637, sig);
      static_sig->hasthis = 0;
      if (static_method_with_first_arg_bound == 0) goto <D.23675>; else goto <D.23676>;
      <D.23675>:
      invoke_sig = static_sig;
      <D.23676>:
      if (static_method_with_first_arg_bound != 0) goto <D.23677>; else goto <D.23678>;
      <D.23677>:
      name = mono_signature_to_name (invoke_sig, "invoke_bound_");
      goto <D.23679>;
      <D.23678>:
      name = mono_signature_to_name (sig, "invoke");
      <D.23679>:
      if (ctx != 0B) goto <D.23680>; else goto <D.23681>;
      <D.23680>:
      D.23544 = method->klass;
      mb = mono_mb_new (D.23544, name, 1);
      goto <D.23682>;
      <D.23681>:
      D.23544 = method->klass;
      D.23637 = D.23544->image;
      D.23683 = get_wrapper_target_class (D.23637);
      mb = mono_mb_new (D.23683, name, 1);
      <D.23682>:
      monoeg_g_free (name);
      D.23684 = mono_defaults.object_class;
      D.23685 = &D.23684->byval_arg;
      local_target = mono_mb_add_local (mb, D.23685);
      D.23684 = mono_defaults.object_class;
      D.23685 = &D.23684->byval_arg;
      local_prev = mono_mb_add_local (mb, D.23685);
      D.23686 = BIT_FIELD_REF <*sig, 8, 80>;
      D.23687 = D.23686 & 64;
      D.23688 = D.23687 == 0;
      D.23689 = (long int) D.23688;
      D.23690 = __builtin_expect (D.23689, 0);
      if (D.23690 != 0) goto <D.23691>; else goto <D.23692>;
      <D.23691>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4314, "sig->hasthis");
      <D.23692>:
      emit_thread_interrupt_checkpoint (mb);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 44);
      mono_mb_emit_byte (mb, 80);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_stloc (mb, local_prev.145);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.145);
      D.23694 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.23694;
      mono_mb_emit_byte (mb, 240);
      mono_mb_emit_byte (mb, 12);
      local_prev.145 = (unsigned int) local_prev;
      mono_mb_emit_ldloc (mb, local_prev.145);
      i = 0;
      goto <D.19567>;
      <D.19566>:
      D.23695 = i + 1;
      D.23696 = (unsigned int) D.23695;
      mono_mb_emit_ldarg (mb, D.23696);
      i = i + 1;
      <D.19567>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      if (D.23607 > i) goto <D.19566>; else goto <D.19568>;
      <D.19568>:
      if (ctx != 0B) goto <D.23697>; else goto <D.23698>;
      <D.23697>:
      D.23699 = &container->context;
      D.23700 = mono_class_inflate_generic_method (method, D.23699);
      mono_mb_emit_op (mb, 111, D.23700);
      goto <D.23701>;
      <D.23698>:
      mono_mb_emit_op (mb, 111, method);
      <D.23701>:
      D.23702 = sig->ret;
      D.23703 = D.23702->type;
      if (D.23703 != 1) goto <D.23704>; else goto <D.23705>;
      <D.23704>:
      mono_mb_emit_byte (mb, 38);
      <D.23705>:
      pos0.146 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.146);
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 80);
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_stloc (mb, local_target.147);
      if (static_method_with_first_arg_bound == 0) goto <D.23708>; else goto <D.23709>;
      <D.23708>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.23710 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.23710;
      if (callvirt != 0) goto <D.23711>; else goto <D.23712>;
      <D.23711>:
      mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
      goto <D.23713>;
      <D.23712>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      i = 0;
      goto <D.19570>;
      <D.19569>:
      D.23695 = i + 1;
      D.23696 = (unsigned int) D.23695;
      mono_mb_emit_ldarg (mb, D.23696);
      i = i + 1;
      <D.19570>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      if (D.23607 > i) goto <D.19569>; else goto <D.19571>;
      <D.19571>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, sig);
      mono_mb_emit_byte (mb, 42);
      <D.23713>:
      pos0.146 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.146);
      <D.23709>:
      if (callvirt != 0) goto <D.23714>; else goto <D.23715>;
      <D.23714>:
      if (closed_over_null == 0) goto <D.23716>; else goto <D.23717>;
      <D.23716>:
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_op (mb, 116, target_class);
      i = 1;
      goto <D.19573>;
      <D.19572>:
      D.23695 = i + 1;
      D.23696 = (unsigned int) D.23695;
      mono_mb_emit_ldarg (mb, D.23696);
      i = i + 1;
      <D.19573>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      if (D.23607 > i) goto <D.19572>; else goto <D.19574>;
      <D.19574>:
      mono_mb_emit_op (mb, 111, target_method);
      goto <D.23718>;
      <D.23717>:
      mono_mb_emit_byte (mb, 20);
      i = 0;
      goto <D.19576>;
      <D.19575>:
      D.23695 = i + 1;
      D.23696 = (unsigned int) D.23695;
      mono_mb_emit_ldarg (mb, D.23696);
      i = i + 1;
      <D.19576>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      if (D.23607 > i) goto <D.19575>; else goto <D.19577>;
      <D.19577>:
      mono_mb_emit_op (mb, 40, target_method);
      <D.23718>:
      goto <D.23719>;
      <D.23715>:
      if (static_method_with_first_arg_bound != 0) goto <D.23720>; else goto <D.23721>;
      <D.23720>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.23722 = invoke_sig->params[0];
      D.23723 = mono_type_is_reference (D.23722);
      if (D.23723 == 0) goto <D.23724>; else goto <D.23725>;
      <D.23724>:
      D.23722 = invoke_sig->params[0];
      D.23726 = mono_class_from_mono_type (D.23722);
      mono_mb_emit_op (mb, 165, D.23726);
      <D.23725>:
      <D.23721>:
      i = 0;
      goto <D.19579>;
      <D.19578>:
      D.23695 = i + 1;
      D.23696 = (unsigned int) D.23695;
      mono_mb_emit_ldarg (mb, D.23696);
      i = i + 1;
      <D.19579>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      if (D.23607 > i) goto <D.19578>; else goto <D.19580>;
      <D.19580>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_op (mb, 41, invoke_sig);
      <D.23719>:
      mono_mb_emit_byte (mb, 42);
      mb->skip_visibility = 1;
      if (ctx != 0B) goto <D.23727>; else goto <D.23728>;
      <D.23727>:
      {
        struct MonoMethod * def;

        D.23596 = sig->param_count;
        D.23607 = (int) D.23596;
        D.23729 = D.23607 + 16;
        D.23544 = method->klass;
        def = mono_mb_create_and_cache (cache, D.23544, mb, sig, D.23729);
        res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
      }
      goto <D.23730>;
      <D.23728>:
      if (static_method_with_first_arg_bound != 0) goto <D.23731>; else goto <D.23732>;
      <D.23731>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      D.23729 = D.23607 + 16;
      res = mono_mb_create_and_cache (cache, invoke_sig, mb, sig, D.23729);
      info = mono_wrapper_info_create (res, 23);
      mono_marshal_set_wrapper_info (res, info);
      goto <D.23733>;
      <D.23732>:
      if (callvirt != 0) goto <D.23734>; else goto <D.23735>;
      <D.23734>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      D.23729 = D.23607 + 16;
      newm = mono_mb_create_method (mb, sig, D.23729);
      mono_memory_barrier ();
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23736>; else goto <D.23737>;
        <D.23736>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.23737>:
        D.23738 = ret != 0;
        D.23739 = (long int) D.23738;
        D.23740 = __builtin_expect (D.23739, 0);
        if (D.23740 != 0) goto <D.23741>; else goto <D.23742>;
        <D.23741>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4432, "ret == 0");
        <D.23742>:
      }
      res = monoeg_g_hash_table_lookup (cache, &key);
      if (res == 0B) goto <D.23743>; else goto <D.23744>;
      <D.23743>:
      res = newm;
      new_key = monoeg_malloc0 (8);
      *new_key = key;
      if (static_method_with_first_arg_bound != 0) goto <D.23745>; else goto <D.23746>;
      <D.23745>:
      D.23747 = key.sig;
      D.23516 = del->method;
      D.23748 = D.23516->klass;
      D.23749 = D.23748->image;
      D.23750 = signature_dup (D.23749, D.23747);
      new_key->sig = D.23750;
      <D.23746>:
      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.23751>; else goto <D.23752>;
        <D.23751>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.23752>:
        D.23753 = ret != 0;
        D.23754 = (long int) D.23753;
        D.23755 = __builtin_expect (D.23754, 0);
        if (D.23755 != 0) goto <D.23756>; else goto <D.23757>;
        <D.23756>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4445, "ret == 0");
        <D.23757>:
      }
      goto <D.23758>;
      <D.23744>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23759>; else goto <D.23760>;
        <D.23759>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.23760>:
        D.23761 = ret != 0;
        D.23762 = (long int) D.23761;
        D.23763 = __builtin_expect (D.23762, 0);
        if (D.23763 != 0) goto <D.23764>; else goto <D.23765>;
        <D.23764>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4447, "ret == 0");
        <D.23765>:
      }
      mono_free_method (newm);
      <D.23758>:
      goto <D.23766>;
      <D.23735>:
      D.23596 = sig->param_count;
      D.23607 = (int) D.23596;
      D.23729 = D.23607 + 16;
      res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23729);
      info = mono_wrapper_info_create (res, 0);
      mono_marshal_set_wrapper_info (res, info);
      <D.23766>:
      <D.23733>:
      <D.23730>:
      mono_mb_free (mb);
      D.23641 = res;
      return D.23641;
    }
  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.23769;
  int iftmp.148;
  struct MonoMethodSignature * D.23773;
  struct MonoMethodSignature * D.23774;
  int D.23775;
  struct MonoMethod * D.23777;
  struct MonoMethod * D.23778;

  D.23773 = pair2->sig;
  D.23774 = pair1->sig;
  D.23775 = mono_metadata_signature_equal (D.23774, D.23773);
  if (D.23775 != 0) goto <D.23776>; else goto <D.23771>;
  <D.23776>:
  D.23777 = pair1->method;
  D.23778 = pair2->method;
  if (D.23777 == D.23778) goto <D.23779>; else goto <D.23771>;
  <D.23779>:
  iftmp.148 = 1;
  goto <D.23772>;
  <D.23771>:
  iftmp.148 = 0;
  <D.23772>:
  D.23769 = iftmp.148;
  return D.23769;
}


signature_method_pair_hash (const void * data)
{
  guint D.23781;
  struct MonoMethodSignature * D.23782;
  unsigned int D.23783;
  struct MonoMethod * D.23784;
  unsigned int D.23785;
  struct SignatureMethodPair * pair;

  pair = data;
  D.23782 = pair->sig;
  D.23783 = mono_signature_hash (D.23782);
  D.23784 = pair->method;
  D.23785 = mono_aligned_addr_hash (D.23784);
  D.23781 = D.23783 ^ D.23785;
  return D.23781;
}


mono_wrapper_info_create (struct MonoMethod * wrapper, WrapperSubtype subtype)
{
  struct MonoClass * D.23787;
  struct MonoImage * D.23788;
  struct WrapperInfo * D.23789;
  struct WrapperInfo * info;

  D.23787 = wrapper->klass;
  D.23788 = D.23787->image;
  info = mono_image_alloc0 (D.23788, 12);
  info->subtype = subtype;
  D.23789 = info;
  return D.23789;
}


mono_marshal_get_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.23791;
  struct MonoMethodSignature * D.23794;
  struct MonoMethodSignature * sig;

  D.23791 = mono_method_signature (method);
  sig = lookup_string_ctor_signature (D.23791);
  if (sig == 0B) goto <D.23792>; else goto <D.23793>;
  <D.23792>:
  sig = add_string_ctor_signature (method);
  <D.23793>:
  D.23794 = sig;
  return D.23794;
}


lookup_string_ctor_signature (struct MonoMethodSignature * sig)
{
  _Bool D.23798;
  long int D.23799;
  long int D.23800;
  struct MonoMethodSignature * D.23803;
  int D.23804;
  _Bool D.23809;
  long int D.23810;
  long int D.23811;
  struct MonoMethodSignature * D.23814;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;
  struct GSList * item;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23796>; else goto <D.23797>;
    <D.23796>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23797>:
    D.23798 = ret != 0;
    D.23799 = (long int) D.23798;
    D.23800 = __builtin_expect (D.23799, 0);
    if (D.23800 != 0) goto <D.23801>; else goto <D.23802>;
    <D.23801>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4498, "ret == 0");
    <D.23802>:
  }
  callsig = 0B;
  item = strsig_list;
  goto <D.19609>;
  <D.19608>:
  cs = item->data;
  D.23803 = cs->ctor_sig;
  D.23804 = mono_metadata_signature_equal (sig, D.23803);
  if (D.23804 != 0) goto <D.23805>; else goto <D.23806>;
  <D.23805>:
  callsig = cs->sig;
  goto <D.19607>;
  <D.23806>:
  item = item->next;
  <D.19609>:
  if (item != 0B) goto <D.19608>; else goto <D.19607>;
  <D.19607>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23807>; else goto <D.23808>;
    <D.23807>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23808>:
    D.23809 = ret != 0;
    D.23810 = (long int) D.23809;
    D.23811 = __builtin_expect (D.23810, 0);
    if (D.23811 != 0) goto <D.23812>; else goto <D.23813>;
    <D.23812>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4510, "ret == 0");
    <D.23813>:
  }
  D.23814 = callsig;
  return D.23814;
}


add_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.23816;
  struct MonoClass * D.23817;
  struct MonoImage * D.23818;
  struct MonoClass * D.23819;
  struct MonoType * D.23820;
  struct MonoMethodSignature * D.23821;
  _Bool D.23824;
  long int D.23825;
  long int D.23826;
  struct GSList * strsig_list.149;
  struct GSList * strsig_list.150;
  _Bool D.23833;
  long int D.23834;
  long int D.23835;
  struct MonoMethodSignature * D.23838;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;

  D.23816 = mono_method_signature (method);
  D.23817 = method->klass;
  D.23818 = D.23817->image;
  callsig = signature_dup (D.23818, D.23816);
  D.23819 = mono_defaults.string_class;
  D.23820 = &D.23819->byval_arg;
  callsig->ret = D.23820;
  cs = monoeg_malloc (8);
  cs->sig = callsig;
  D.23821 = mono_method_signature (method);
  cs->ctor_sig = D.23821;
  {
    int ret;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23831>; else goto <D.23832>;
    <D.23831>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23832>:
    D.23833 = ret != 0;
    D.23834 = (long int) D.23833;
    D.23835 = __builtin_expect (D.23834, 0);
    if (D.23835 != 0) goto <D.23836>; else goto <D.23837>;
    <D.23836>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4528, "ret == 0");
    <D.23837>:
  }
  D.23838 = callsig;
  return D.23838;
}


mono_marshal_get_runtime_invoke (struct MonoMethod * method, gboolean virtual)
{
  _Bool D.23840;
  long int D.23841;
  long int D.23842;
  struct MonoMethodSignature * cctor_signature.151;
  struct MonoImage * D.23848;
  struct MonoMethodSignature * cctor_signature.152;
  struct MonoClass * D.23850;
  struct MonoType * D.23851;
  struct MonoMethodSignature * finalize_signature.153;
  struct MonoMethodSignature * finalize_signature.154;
  struct MonoClass * D.23860;
  struct MonoImage * D.23861;
  struct GHashTable * * D.23862;
  struct GHashTable * * D.23864;
  struct MonoMethod * D.23867;
  unsigned char D.23868;
  short unsigned int D.23871;
  unsigned int D.23872;
  unsigned int D.23873;
  unsigned char D.23876;
  unsigned char D.23877;
  struct MonoMethodSignature * D.23880;
  unsigned char D.23884;
  unsigned char D.23885;
  struct MonoMethodSignature * D.23888;
  int D.23890;
  int D.23894;
  unsigned char D.23902;
  unsigned char D.23903;
  struct MonoMethodSignature * D.23905;
  unsigned char D.23906;
  unsigned char D.23907;
  struct MonoImage * D.23909;
  struct GHashTable * * D.23910;
  struct GHashTable * * D.23911;
  _Bool D.23914;
  long int D.23915;
  long int D.23916;
  _Bool D.23921;
  long int D.23922;
  long int D.23923;
  struct MonoClass * D.23928;
  struct MonoType * D.23929;
  struct MonoMethodSignature * D.23933;
  unsigned char D.23934;
  unsigned char D.23935;
  struct MonoType * D.23937;
  struct MonoType * D.23938;
  struct MonoClass * D.23939;
  struct MonoType * D.23940;
  const char * iftmp.155;
  short unsigned int D.23947;
  int D.23948;
  int D.23949;
  WrapperSubtype iftmp.156;
  _Bool D.23957;
  long int D.23958;
  long int D.23959;
  _Bool D.23964;
  long int D.23965;
  long int D.23966;
  _Bool D.23973;
  long int D.23974;
  long int D.23975;
  struct GHashTable * D.23980;
  _Bool D.23984;
  long int D.23985;
  long int D.23986;
  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.23840 = method == 0B;
      D.23841 = (long int) D.23840;
      D.23842 = __builtin_expect (D.23841, 0);
      if (D.23842 != 0) goto <D.23843>; else goto <D.23844>;
      <D.23843>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4932, "method");
      <D.23844>:
      cctor_signature.151 = cctor_signature;
      if (cctor_signature.151 == 0B) goto <D.23846>; else goto <D.23847>;
      <D.23846>:
      D.23848 = mono_defaults.corlib;
      cctor_signature.152 = mono_metadata_signature_alloc (D.23848, 0);
      cctor_signature = cctor_signature.152;
      cctor_signature.151 = cctor_signature;
      D.23850 = mono_defaults.void_class;
      D.23851 = &D.23850->byval_arg;
      cctor_signature.151->ret = D.23851;
      <D.23847>:
      finalize_signature.153 = finalize_signature;
      if (finalize_signature.153 == 0B) goto <D.23853>; else goto <D.23854>;
      <D.23853>:
      D.23848 = mono_defaults.corlib;
      finalize_signature.154 = mono_metadata_signature_alloc (D.23848, 0);
      finalize_signature = finalize_signature.154;
      finalize_signature.153 = finalize_signature;
      D.23850 = mono_defaults.void_class;
      D.23851 = &D.23850->byval_arg;
      finalize_signature.153->ret = D.23851;
      finalize_signature.153 = finalize_signature;
      finalize_signature.153->hasthis = 1;
      <D.23854>:
      if (virtual != 0) goto <D.23856>; else goto <D.23857>;
      <D.23856>:
      need_direct_wrapper = 1;
      <D.23857>:
      if (virtual != 0) goto <D.23858>; else goto <D.23859>;
      <D.23858>:
      D.23860 = method->klass;
      D.23861 = D.23860->image;
      D.23862 = &D.23861->runtime_invoke_vcall_cache;
      cache = get_cache (D.23862, mono_aligned_addr_hash, 0B);
      goto <D.23863>;
      <D.23859>:
      D.23860 = method->klass;
      D.23861 = D.23860->image;
      D.23864 = &D.23861->runtime_invoke_direct_cache;
      cache = get_cache (D.23864, mono_aligned_addr_hash, 0B);
      <D.23863>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.23865>; else goto <D.23866>;
      <D.23865>:
      D.23867 = res;
      return D.23867;
      <D.23866>:
      D.23860 = method->klass;
      D.23868 = D.23860->rank;
      if (D.23868 != 0) goto <D.23869>; else goto <D.23870>;
      <D.23869>:
      D.23871 = method->iflags;
      D.23872 = (unsigned int) D.23871;
      D.23873 = D.23872 & 4097;
      if (D.23873 == 4097) goto <D.23874>; else goto <D.23875>;
      <D.23874>:
      need_direct_wrapper = 1;
      <D.23875>:
      <D.23870>:
      D.23876 = BIT_FIELD_REF <*method, 8, 160>;
      D.23877 = D.23876 & 128;
      if (D.23877 != 0) goto <D.23878>; else goto <D.23879>;
      <D.23878>:
      D.23880 = mono_method_signature (method);
      callsig = lookup_string_ctor_signature (D.23880);
      if (callsig == 0B) goto <D.23881>; else goto <D.23882>;
      <D.23881>:
      callsig = add_string_ctor_signature (method);
      <D.23882>:
      need_direct_wrapper = 1;
      goto <D.23883>;
      <D.23879>:
      D.23884 = BIT_FIELD_REF <*method, 8, 168>;
      D.23885 = D.23884 & 2;
      if (D.23885 != 0) goto <D.23886>; else goto <D.23887>;
      <D.23886>:
      D.23888 = mono_method_signature (method);
      D.23860 = method->klass;
      D.23861 = D.23860->image;
      callsig = signature_dup (D.23861, D.23888);
      goto <D.23889>;
      <D.23887>:
      callsig = mono_method_signature (method);
      <D.23889>:
      <D.23883>:
      D.23860 = method->klass;
      D.23861 = D.23860->image;
      target_klass = get_wrapper_target_class (D.23861);
      cctor_signature.151 = cctor_signature;
      D.23890 = mono_metadata_signature_equal (callsig, cctor_signature.151);
      if (D.23890 != 0) goto <D.23891>; else goto <D.23892>;
      <D.23891>:
      callsig = cctor_signature;
      target_klass = mono_defaults.object_class;
      goto <D.23893>;
      <D.23892>:
      finalize_signature.153 = finalize_signature;
      D.23894 = mono_metadata_signature_equal (callsig, finalize_signature.153);
      if (D.23894 != 0) goto <D.23895>; else goto <D.23896>;
      <D.23895>:
      callsig = finalize_signature;
      target_klass = mono_defaults.object_class;
      <D.23896>:
      <D.23893>:
      if (need_direct_wrapper != 0) goto <D.23897>; else goto <D.23898>;
      <D.23897>:
      goto <D.23899>;
      <D.23898>:
      {
        struct MonoMethodSignature * tmp_sig;

        callsig = mono_marshal_get_runtime_invoke_sig (callsig);
        D.23860 = method->klass;
        D.23902 = BIT_FIELD_REF <*D.23860, 8, 160>;
        D.23903 = D.23902 & 8;
        if (D.23903 != 0) goto <D.23904>; else goto <D.23900>;
        <D.23904>:
        D.23905 = mono_method_signature (method);
        D.23906 = BIT_FIELD_REF <*D.23905, 8, 80>;
        D.23907 = D.23906 & 64;
        if (D.23907 != 0) goto <D.23908>; else goto <D.23900>;
        <D.23908>:
        D.23909 = target_klass->image;
        D.23910 = &D.23909->runtime_invoke_vtype_cache;
        cache = get_cache (D.23910, mono_signature_hash, runtime_invoke_signature_equal);
        goto <D.23901>;
        <D.23900>:
        D.23909 = target_klass->image;
        D.23911 = &D.23909->runtime_invoke_cache;
        cache = get_cache (D.23911, mono_signature_hash, runtime_invoke_signature_equal);
        <D.23901>:
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23912>; else goto <D.23913>;
          <D.23912>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23913>:
          D.23914 = ret != 0;
          D.23915 = (long int) D.23914;
          D.23916 = __builtin_expect (D.23915, 0);
          if (D.23916 != 0) goto <D.23917>; else goto <D.23918>;
          <D.23917>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5010, "ret == 0");
          <D.23918>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23919>; else goto <D.23920>;
          <D.23919>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23920>:
          D.23921 = ret != 0;
          D.23922 = (long int) D.23921;
          D.23923 = __builtin_expect (D.23922, 0);
          if (D.23923 != 0) goto <D.23924>; else goto <D.23925>;
          <D.23924>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5012, "ret == 0");
          <D.23925>:
        }
        if (res != 0B) goto <D.23926>; else goto <D.23927>;
        <D.23926>:
        monoeg_g_free (callsig);
        D.23867 = res;
        return D.23867;
        <D.23927>:
        tmp_sig = callsig;
        D.23909 = target_klass->image;
        callsig = mono_metadata_signature_dup_full (D.23909, callsig);
        monoeg_g_free (tmp_sig);
      }
      <D.23899>:
      sig = mono_method_signature (method);
      D.23909 = target_klass->image;
      csig = mono_metadata_signature_alloc (D.23909, 4);
      D.23928 = mono_defaults.object_class;
      D.23929 = &D.23928->byval_arg;
      csig->ret = D.23929;
      D.23860 = method->klass;
      D.23902 = BIT_FIELD_REF <*D.23860, 8, 160>;
      D.23903 = D.23902 & 8;
      if (D.23903 != 0) goto <D.23932>; else goto <D.23930>;
      <D.23932>:
      D.23933 = mono_method_signature (method);
      D.23934 = BIT_FIELD_REF <*D.23933, 8, 80>;
      D.23935 = D.23934 & 64;
      if (D.23935 != 0) goto <D.23936>; else goto <D.23930>;
      <D.23936>:
      D.23860 = method->klass;
      D.23937 = &D.23860->this_arg;
      D.23938 = get_runtime_invoke_type (D.23937, 0);
      csig->params[0] = D.23938;
      goto <D.23931>;
      <D.23930>:
      D.23928 = mono_defaults.object_class;
      D.23929 = &D.23928->byval_arg;
      csig->params[0] = D.23929;
      <D.23931>:
      D.23939 = mono_defaults.int_class;
      D.23940 = &D.23939->byval_arg;
      csig->params[1] = D.23940;
      D.23939 = mono_defaults.int_class;
      D.23940 = &D.23939->byval_arg;
      csig->params[2] = D.23940;
      D.23939 = mono_defaults.int_class;
      D.23940 = &D.23939->byval_arg;
      csig->params[3] = D.23940;
      csig->pinvoke = 1;
      if (virtual != 0) goto <D.23942>; else goto <D.23943>;
      <D.23942>:
      iftmp.155 = "runtime_invoke_virtual";
      goto <D.23944>;
      <D.23943>:
      iftmp.155 = "runtime_invoke";
      <D.23944>:
      name = mono_signature_to_name (callsig, iftmp.155);
      mb = mono_mb_new (target_klass, name, 4);
      monoeg_g_free (name);
      param_names[0] = "this";
      param_names[1] = "params";
      param_names[2] = "exc";
      param_names[3] = "method";
      mono_mb_set_param_names (mb, &param_names);
      emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper);
      if (need_direct_wrapper != 0) goto <D.23945>; else goto <D.23946>;
      <D.23945>:
      mb->skip_visibility = 1;
      D.23947 = sig->param_count;
      D.23948 = (int) D.23947;
      D.23949 = D.23948 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.23949);
      if (virtual != 0) goto <D.23951>; else goto <D.23952>;
      <D.23951>:
      iftmp.156 = 14;
      goto <D.23953>;
      <D.23952>:
      iftmp.156 = 13;
      <D.23953>:
      info = mono_wrapper_info_create (res, iftmp.156);
      info->d.runtime_invoke.method = method;
      mono_marshal_set_wrapper_info (res, info);
      goto <D.23954>;
      <D.23946>:
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23955>; else goto <D.23956>;
        <D.23955>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.23956>:
        D.23957 = ret != 0;
        D.23958 = (long int) D.23957;
        D.23959 = __builtin_expect (D.23958, 0);
        if (D.23959 != 0) goto <D.23960>; else goto <D.23961>;
        <D.23960>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5067, "ret == 0");
        <D.23961>:
      }
      res = monoeg_g_hash_table_lookup (cache, callsig);
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23962>; else goto <D.23963>;
        <D.23962>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.23963>:
        D.23964 = ret != 0;
        D.23965 = (long int) D.23964;
        D.23966 = __builtin_expect (D.23965, 0);
        if (D.23966 != 0) goto <D.23967>; else goto <D.23968>;
        <D.23967>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5069, "ret == 0");
        <D.23968>:
      }
      if (res == 0B) goto <D.23969>; else goto <D.23970>;
      <D.23969>:
      {
        struct MonoMethod * newm;

        D.23947 = sig->param_count;
        D.23948 = (int) D.23947;
        D.23949 = D.23948 + 16;
        newm = mono_mb_create_method (mb, csig, D.23949);
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23971>; else goto <D.23972>;
          <D.23971>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23972>:
          D.23973 = ret != 0;
          D.23974 = (long int) D.23973;
          D.23975 = __builtin_expect (D.23974, 0);
          if (D.23975 != 0) goto <D.23976>; else goto <D.23977>;
          <D.23976>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5076, "ret == 0");
          <D.23977>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        if (res == 0B) goto <D.23978>; else goto <D.23979>;
        <D.23978>:
        res = newm;
        monoeg_g_hash_table_insert_replace (cache, callsig, res, 0);
        D.23860 = method->klass;
        D.23861 = D.23860->image;
        D.23980 = D.23861->runtime_invoke_direct_cache;
        monoeg_g_hash_table_insert_replace (D.23980, 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.23981>;
        <D.23979>:
        mono_free_method (newm);
        <D.23981>:
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23982>; else goto <D.23983>;
          <D.23982>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23983>:
          D.23984 = ret != 0;
          D.23985 = (long int) D.23984;
          D.23986 = __builtin_expect (D.23985, 0);
          if (D.23986 != 0) goto <D.23987>; else goto <D.23988>;
          <D.23987>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5089, "ret == 0");
          <D.23988>:
        }
      }
      <D.23970>:
      <D.23954>:
      mono_mb_free (mb);
      D.23867 = res;
      return D.23867;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


runtime_invoke_signature_equal (struct MonoMethodSignature * sig1, struct MonoMethodSignature * sig2)
{
  struct MonoType * D.23993;
  struct MonoType * D.23994;
  int D.23996;
  int D.23998;
  int D.23999;
  gboolean D.24001;

  D.23993 = sig1->ret;
  D.23994 = sig2->ret;
  if (D.23993 != D.23994) goto <D.23995>; else goto <D.23991>;
  <D.23995>:
  D.23993 = sig1->ret;
  D.23996 = mono_type_is_reference (D.23993);
  if (D.23996 == 0) goto <D.23992>; else goto <D.23997>;
  <D.23997>:
  D.23994 = sig2->ret;
  D.23998 = mono_type_is_reference (D.23994);
  if (D.23998 == 0) goto <D.23992>; else goto <D.23991>;
  <D.23992>:
  D.23994 = sig2->ret;
  D.23993 = sig1->ret;
  D.23999 = mono_metadata_type_equal (D.23993, D.23994);
  if (D.23999 == 0) goto <D.24000>; else goto <D.23991>;
  <D.24000>:
  D.24001 = 0;
  return D.24001;
  <D.23991>:
  D.24001 = mono_metadata_signature_equal (sig1, sig2);
  return D.24001;
}


mono_marshal_get_runtime_invoke_sig (struct MonoMethodSignature * sig)
{
  struct MonoType * D.24003;
  struct MonoType * D.24004;
  struct MonoType * D.24005;
  struct MonoType * D.24006;
  short unsigned int D.24007;
  int D.24008;
  struct MonoMethodSignature * D.24009;
  struct MonoMethodSignature * res;
  int i;

  res = mono_metadata_signature_dup (sig);
  D.24003 = sig->ret;
  D.24004 = get_runtime_invoke_type (D.24003, 1);
  res->ret = D.24004;
  i = 0;
  goto <D.19640>;
  <D.19639>:
  D.24005 = sig->params[i];
  D.24006 = get_runtime_invoke_type (D.24005, 0);
  res->params[i] = D.24006;
  i = i + 1;
  <D.19640>:
  D.24007 = res->param_count;
  D.24008 = (int) D.24007;
  if (D.24008 > i) goto <D.19639>; else goto <D.19641>;
  <D.19641>:
  D.24009 = res;
  return D.24009;
}


get_runtime_invoke_type (struct MonoType * t, gboolean ret)
{
  unsigned char D.24011;
  unsigned char D.24012;
  unsigned char D.24015;
  struct MonoClass * D.24018;
  int D.24019;
  struct MonoType * D.24022;
  struct MonoClass * D.24023;
  int D.24024;
  struct MonoClass * D.24027;
  int D.24030;
  struct MonoClass * D.24031;
  struct MonoClass * D.24032;
  struct MonoClass * D.24033;
  struct MonoClass * D.24034;
  unsigned char D.24035;
  unsigned char D.24036;
  void handle_enum = <<< error >>>;

  D.24011 = BIT_FIELD_REF <*t, 8, 56>;
  D.24012 = D.24011 & 64;
  if (D.24012 != 0) goto <D.24013>; else goto <D.24014>;
  <D.24013>:
  D.24015 = t->type;
  if (D.24015 == 21) goto <D.24016>; else goto <D.24017>;
  <D.24016>:
  D.24018 = mono_class_from_mono_type (t);
  D.24019 = mono_class_is_nullable (D.24018);
  if (D.24019 != 0) goto <D.24020>; else goto <D.24021>;
  <D.24020>:
  D.24022 = t;
  return D.24022;
  <D.24021>:
  <D.24017>:
  D.24023 = mono_defaults.int_class;
  D.24022 = &D.24023->this_arg;
  return D.24022;
  <D.24014>:
  D.24024 = mono_type_is_reference (t);
  if (D.24024 != 0) goto <D.24025>; else goto <D.24026>;
  <D.24025>:
  D.24027 = mono_defaults.object_class;
  D.24022 = &D.24027->byval_arg;
  return D.24022;
  <D.24026>:
  if (ret != 0) goto <D.24028>; else goto <D.24029>;
  <D.24028>:
  D.24022 = t;
  return D.24022;
  <D.24029>:
  handle_enum:
  D.24015 = t->type;
  D.24030 = (int) D.24015;
  switch (D.24030) <default: <D.19633>, case 2: <D.19628>, case 3: <D.19629>, case 11: <D.19627>, case 15: <D.19631>, case 17: <D.19632>, case 25: <D.19630>>
  <D.19627>:
  D.24031 = mono_defaults.int64_class;
  D.24022 = &D.24031->byval_arg;
  return D.24022;
  <D.19628>:
  D.24032 = mono_defaults.byte_class;
  D.24022 = &D.24032->byval_arg;
  return D.24022;
  <D.19629>:
  D.24033 = mono_defaults.uint16_class;
  D.24022 = &D.24033->byval_arg;
  return D.24022;
  <D.19630>:
  <D.19631>:
  D.24023 = mono_defaults.int_class;
  D.24022 = &D.24023->byval_arg;
  return D.24022;
  <D.19632>:
  D.24034 = t->data.klass;
  D.24035 = BIT_FIELD_REF <*D.24034, 8, 160>;
  D.24036 = D.24035 & 16;
  if (D.24036 != 0) goto <D.24037>; else goto <D.24038>;
  <D.24037>:
  D.24034 = t->data.klass;
  t = mono_class_enum_basetype (D.24034);
  goto handle_enum;
  <D.24038>:
  D.24022 = t;
  return D.24022;
  <D.19633>:
  D.24022 = t;
  return D.24022;
}


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.24040;
  struct MonoType * D.24041;
  unsigned int D.24042;
  int D.24043;
  int D.24044;
  unsigned int D.24045;
  int D.24046;
  struct MonoImage * D.24047;
  struct MonoClass * D.24048;
  int D.24049;
  unsigned int D.24050;
  int D.24051;
  int D.24052;
  unsigned int D.24053;
  int D.24054;
  unsigned int D.24055;
  unsigned int loc_exc.157;
  int D.24057;
  unsigned int D.24058;
  unsigned int D.24059;
  unsigned int D.24060;
  int D.24061;
  unsigned int D.24062;
  unsigned int loc_res.158;
  int D.24064;
  unsigned int D.24065;
  gint32 labels[16];
  struct MonoExceptionClause * clause;
  int loc_res;
  int loc_exc;

  try
    {
      D.24040 = mono_defaults.object_class;
      D.24041 = &D.24040->byval_arg;
      loc_res = mono_mb_add_local (mb, D.24041);
      D.24040 = mono_defaults.object_class;
      D.24041 = &D.24040->byval_arg;
      loc_exc = mono_mb_add_local (mb, D.24041);
      mono_mb_emit_byte (mb, 4);
      D.24042 = mono_mb_emit_branch (mb, 57);
      D.24043 = (int) D.24042;
      labels[0] = D.24043;
      D.24044 = mono_mb_get_label (mb);
      labels[1] = D.24044;
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      D.24045 = mono_mb_emit_branch (mb, 221);
      D.24046 = (int) D.24045;
      labels[2] = D.24046;
      D.24047 = target_klass->image;
      clause = mono_image_alloc0 (D.24047, 24);
      clause->flags = 0;
      D.24048 = mono_defaults.exception_class;
      clause->data.catch_class = D.24048;
      D.24049 = labels[1];
      D.24050 = (unsigned int) D.24049;
      clause->try_offset = D.24050;
      D.24051 = mono_mb_get_label (mb);
      D.24049 = labels[1];
      D.24052 = D.24051 - D.24049;
      D.24053 = (unsigned int) D.24052;
      clause->try_len = D.24053;
      D.24054 = mono_mb_get_label (mb);
      D.24055 = (unsigned int) D.24054;
      clause->handler_offset = D.24055;
      loc_exc.157 = (unsigned int) loc_exc;
      mono_mb_emit_stloc (mb, loc_exc.157);
      mono_mb_emit_byte (mb, 4);
      loc_exc.157 = (unsigned int) loc_exc;
      mono_mb_emit_ldloc (mb, loc_exc.157);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_branch (mb, 221);
      D.24057 = mono_mb_get_pos (mb);
      D.24058 = (unsigned int) D.24057;
      D.24059 = clause->handler_offset;
      D.24060 = D.24058 - D.24059;
      clause->handler_len = D.24060;
      mono_mb_set_clauses (mb, 1, clause);
      D.24061 = labels[2];
      D.24062 = (unsigned int) D.24061;
      mono_mb_patch_branch (mb, D.24062);
      loc_res.158 = (unsigned int) loc_res;
      mono_mb_emit_ldloc (mb, loc_res.158);
      mono_mb_emit_byte (mb, 42);
      D.24064 = labels[0];
      D.24065 = (unsigned int) D.24064;
      mono_mb_patch_branch (mb, D.24065);
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 42);
    }
  finally
    {
      labels = {CLOBBER};
    }
}


emit_invoke_call (struct MonoMethodBuilder * mb, struct MonoMethod * method, struct MonoMethodSignature * sig, struct MonoMethodSignature * callsig, int loc_res, gboolean virtual, gboolean need_direct_wrapper)
{
  struct MonoString * string_dummy.159;
  void * D.24071;
  struct MonoString * string_dummy.160;
  unsigned char D.24075;
  unsigned char D.24076;
  _Bool D.24077;
  long int D.24078;
  long int D.24079;
  short unsigned int D.24082;
  int D.24083;
  int D.24084;
  _Bool D.24085;
  long int D.24086;
  long int D.24087;
  unsigned char D.24092;
  unsigned char D.24093;
  int D.24096;
  short unsigned int D.24101;
  unsigned int D.24102;
  unsigned int D.24103;
  unsigned int i.161;
  unsigned int D.24107;
  int D.24108;
  unsigned char D.24109;
  unsigned char D.24110;
  unsigned char D.24113;
  struct MonoClass * D.24116;
  int D.24117;
  int * D.24120;
  struct MonoClass * D.24121;
  struct MonoType * D.24122;
  int D.24123;
  struct MonoClass * D.24124;
  int D.24125;
  unsigned int D.24126;
  struct MonoType * D.24127;
  unsigned char D.24128;
  unsigned int D.24129;
  unsigned char D.24130;
  int D.24131;
  unsigned int D.24132;
  unsigned char D.24133;
  int D.24134;
  int D.24135;
  unsigned int D.24138;
  unsigned char D.24139;
  int D.24140;
  struct MonoClass * D.24143;
  unsigned char D.24144;
  unsigned char D.24145;
  struct MonoType * D.24148;
  unsigned char D.24149;
  struct MonoClass * D.24150;
  int D.24151;
  struct MonoClass * D.24154;
  struct MonoClass * D.24155;
  struct MonoClass * D.24157;
  int D.24158;
  struct MonoType * D.24165;
  unsigned char D.24166;
  unsigned char D.24167;
  unsigned char D.24170;
  int D.24171;
  struct MonoClass * D.24174;
  struct MonoClass * D.24175;
  unsigned int loc_res.162;
  short unsigned int D.24179;
  short unsigned int D.24180;
  struct MonoClass * D.24183;
  int D.24184;
  struct MonoClass * D.24187;
  static struct MonoString * string_dummy = 0B;
  int i;
  int * tmp_nullable_locals;
  gboolean void_ret;
  void handle_enum = <<< error >>>;

  void_ret = 0;
  string_dummy.159 = string_dummy;
  if (string_dummy.159 == 0B) goto <D.24067>; else goto <D.24068>;
  <D.24067>:
  if (0 != 0) goto <D.24069>; else goto <D.24070>;
  <D.24069>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4644, "sizeof (string_dummy) == sizeof (MonoObject*)");
  <D.24070>:
  D.24071 = mono_gc_make_root_descr_all_refs (1);
  mono_gc_register_root (&string_dummy, 4, D.24071);
  string_dummy.160 = mono_string_new_wrapper ("dummy");
  string_dummy = string_dummy.160;
  <D.24068>:
  if (virtual != 0) goto <D.24073>; else goto <D.24074>;
  <D.24073>:
  D.24075 = BIT_FIELD_REF <*sig, 8, 80>;
  D.24076 = D.24075 & 64;
  D.24077 = D.24076 == 0;
  D.24078 = (long int) D.24077;
  D.24079 = __builtin_expect (D.24078, 0);
  if (D.24079 != 0) goto <D.24080>; else goto <D.24081>;
  <D.24080>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4649, "sig->hasthis");
  <D.24081>:
  D.24082 = method->flags;
  D.24083 = (int) D.24082;
  D.24084 = D.24083 & 64;
  D.24085 = D.24084 == 0;
  D.24086 = (long int) D.24085;
  D.24087 = __builtin_expect (D.24086, 0);
  if (D.24087 != 0) goto <D.24088>; else goto <D.24089>;
  <D.24088>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4650, "method->flags & METHOD_ATTRIBUTE_VIRTUAL");
  <D.24089>:
  <D.24074>:
  D.24075 = BIT_FIELD_REF <*sig, 8, 80>;
  D.24076 = D.24075 & 64;
  if (D.24076 != 0) goto <D.24090>; else goto <D.24091>;
  <D.24090>:
  D.24092 = BIT_FIELD_REF <*method, 8, 160>;
  D.24093 = D.24092 & 128;
  if (D.24093 != 0) goto <D.24094>; else goto <D.24095>;
  <D.24094>:
  D.24096 = mono_gc_is_moving ();
  if (D.24096 != 0) goto <D.24097>; else goto <D.24098>;
  <D.24097>:
  mono_mb_emit_ptr (mb, &string_dummy);
  mono_mb_emit_byte (mb, 80);
  goto <D.24099>;
  <D.24098>:
  string_dummy.159 = string_dummy;
  mono_mb_emit_ptr (mb, string_dummy.159);
  <D.24099>:
  goto <D.24100>;
  <D.24095>:
  mono_mb_emit_ldarg (mb, 0);
  <D.24100>:
  <D.24091>:
  D.24101 = sig->param_count;
  D.24102 = (unsigned int) D.24101;
  D.24103 = D.24102 * 4;
  tmp_nullable_locals = monoeg_malloc0 (D.24103);
  i = 0;
  goto <D.19688>;
  <D.19687>:
  {
    struct MonoType * t;
    int type;

    t = sig->params[i];
    mono_mb_emit_ldarg (mb, 1);
    if (i != 0) goto <D.24104>; else goto <D.24105>;
    <D.24104>:
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24108 = (int) D.24107;
    mono_mb_emit_icon (mb, D.24108);
    mono_mb_emit_byte (mb, 88);
    <D.24105>:
    D.24109 = BIT_FIELD_REF <*t, 8, 56>;
    D.24110 = D.24109 & 64;
    if (D.24110 != 0) goto <D.24111>; else goto <D.24112>;
    <D.24111>:
    mono_mb_emit_byte (mb, 77);
    D.24113 = t->type;
    if (D.24113 == 21) goto <D.24114>; else goto <D.24115>;
    <D.24114>:
    D.24116 = mono_class_from_mono_type (t);
    D.24117 = mono_class_is_nullable (D.24116);
    if (D.24117 != 0) goto <D.24118>; else goto <D.24119>;
    <D.24118>:
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24120 = tmp_nullable_locals + D.24107;
    D.24121 = mono_class_from_mono_type (t);
    D.24122 = &D.24121->byval_arg;
    D.24123 = mono_mb_add_local (mb, D.24122);
    *D.24120 = D.24123;
    D.24124 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 165, D.24124);
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24120 = tmp_nullable_locals + D.24107;
    D.24125 = *D.24120;
    D.24126 = (unsigned int) D.24125;
    mono_mb_emit_stloc (mb, D.24126);
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24120 = tmp_nullable_locals + D.24107;
    D.24125 = *D.24120;
    D.24126 = (unsigned int) D.24125;
    mono_mb_emit_ldloc_addr (mb, D.24126);
    <D.24119>:
    <D.24115>:
    // predicted unlikely by continue predictor.
    goto <D.19661>;
    <D.24112>:
    D.24127 = sig->params[i];
    D.24128 = D.24127->type;
    type = (int) D.24128;
    handle_enum:
    switch (type) <default: <D.19686>, case 2: <D.19664>, case 3: <D.19668>, case 4: <D.19663>, case 5: <D.19665>, case 6: <D.19666>, case 7: <D.19667>, case 8: <D.19671>, case 9: <D.19672>, case 10: <D.19675>, case 11: <D.19676>, case 12: <D.19673>, case 13: <D.19674>, case 14: <D.19678>, case 15: <D.19681>, case 17: <D.19685>, case 18: <D.19679>, case 20: <D.19680>, case 21: <D.19684>, case 24: <D.19669>, case 25: <D.19670>, case 28: <D.19683>, case 29: <D.19682>>
    <D.19663>:
    <D.19664>:
    <D.19665>:
    <D.19666>:
    <D.19667>:
    <D.19668>:
    <D.19669>:
    <D.19670>:
    <D.19671>:
    <D.19672>:
    <D.19673>:
    <D.19674>:
    <D.19675>:
    <D.19676>:
    mono_mb_emit_byte (mb, 77);
    D.24127 = sig->params[i];
    D.24129 = mono_type_to_ldind (D.24127);
    D.24130 = (unsigned char) D.24129;
    D.24131 = (int) D.24130;
    mono_mb_emit_byte (mb, D.24131);
    goto <D.19677>;
    <D.19678>:
    <D.19679>:
    <D.19680>:
    <D.19681>:
    <D.19682>:
    <D.19683>:
    D.24127 = sig->params[i];
    D.24132 = mono_type_to_ldind (D.24127);
    D.24133 = (unsigned char) D.24132;
    D.24134 = (int) D.24133;
    mono_mb_emit_byte (mb, D.24134);
    goto <D.19677>;
    <D.19684>:
    D.24127 = sig->params[i];
    D.24135 = mono_type_generic_inst_is_valuetype (D.24127);
    if (D.24135 == 0) goto <D.24136>; else goto <D.24137>;
    <D.24136>:
    D.24127 = sig->params[i];
    D.24138 = mono_type_to_ldind (D.24127);
    D.24139 = (unsigned char) D.24138;
    D.24140 = (int) D.24139;
    mono_mb_emit_byte (mb, D.24140);
    goto <D.19677>;
    <D.24137>:
    <D.19685>:
    if (type == 17) goto <D.24141>; else goto <D.24142>;
    <D.24141>:
    D.24143 = t->data.klass;
    D.24144 = BIT_FIELD_REF <*D.24143, 8, 160>;
    D.24145 = D.24144 & 16;
    if (D.24145 != 0) goto <D.24146>; else goto <D.24147>;
    <D.24146>:
    D.24143 = t->data.klass;
    D.24148 = mono_class_enum_basetype (D.24143);
    D.24149 = D.24148->type;
    type = (int) D.24149;
    goto handle_enum;
    <D.24147>:
    <D.24142>:
    mono_mb_emit_byte (mb, 77);
    D.24127 = sig->params[i];
    D.24150 = mono_class_from_mono_type (D.24127);
    D.24151 = mono_class_is_nullable (D.24150);
    if (D.24151 != 0) goto <D.24152>; else goto <D.24153>;
    <D.24152>:
    D.24127 = sig->params[i];
    D.24154 = mono_class_from_mono_type (D.24127);
    mono_mb_emit_op (mb, 121, D.24154);
    D.24127 = sig->params[i];
    D.24155 = mono_class_from_mono_type (D.24127);
    mono_mb_emit_op (mb, 113, D.24155);
    goto <D.24156>;
    <D.24153>:
    D.24127 = sig->params[i];
    D.24157 = mono_class_from_mono_type (D.24127);
    mono_mb_emit_op (mb, 113, D.24157);
    <D.24156>:
    goto <D.19677>;
    <D.19686>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4744);
    <D.19677>:
  }
  <D.19661>:
  i = i + 1;
  <D.19688>:
  D.24101 = sig->param_count;
  D.24158 = (int) D.24101;
  if (D.24158 > i) goto <D.19687>; else goto <D.19689>;
  <D.19689>:
  if (virtual != 0) goto <D.24159>; else goto <D.24160>;
  <D.24159>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.24161>;
  <D.24160>:
  if (need_direct_wrapper != 0) goto <D.24162>; else goto <D.24163>;
  <D.24162>:
  mono_mb_emit_op (mb, 40, method);
  goto <D.24164>;
  <D.24163>:
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_calli (mb, callsig);
  <D.24164>:
  <D.24161>:
  D.24165 = sig->ret;
  D.24166 = BIT_FIELD_REF <*D.24165, 8, 56>;
  D.24167 = D.24166 & 64;
  if (D.24167 != 0) goto <D.24168>; else goto <D.24169>;
  <D.24168>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4759);
  <D.24169>:
  D.24165 = sig->ret;
  D.24170 = D.24165->type;
  D.24171 = (int) D.24170;
  switch (D.24171) <default: <D.19715>, case 1: <D.19690>, case 2: <D.19692>, case 3: <D.19693>, case 4: <D.19694>, case 5: <D.19695>, case 6: <D.19696>, case 7: <D.19697>, case 8: <D.19698>, case 9: <D.19699>, case 10: <D.19704>, case 11: <D.19705>, case 12: <D.19702>, case 13: <D.19703>, case 14: <D.19709>, case 15: <D.19714>, case 17: <D.19706>, case 18: <D.19710>, case 20: <D.19711>, case 21: <D.19708>, case 22: <D.19707>, case 24: <D.19700>, case 25: <D.19701>, case 28: <D.19713>, case 29: <D.19712>>
  <D.19690>:
  D.24092 = BIT_FIELD_REF <*method, 8, 160>;
  D.24093 = D.24092 & 128;
  if (D.24093 == 0) goto <D.24172>; else goto <D.24173>;
  <D.24172>:
  void_ret = 1;
  <D.24173>:
  goto <D.19691>;
  <D.19692>:
  <D.19693>:
  <D.19694>:
  <D.19695>:
  <D.19696>:
  <D.19697>:
  <D.19698>:
  <D.19699>:
  <D.19700>:
  <D.19701>:
  <D.19702>:
  <D.19703>:
  <D.19704>:
  <D.19705>:
  <D.19706>:
  <D.19707>:
  <D.19708>:
  D.24165 = sig->ret;
  D.24174 = mono_class_from_mono_type (D.24165);
  mono_mb_emit_op (mb, 140, D.24174);
  goto <D.19691>;
  <D.19709>:
  <D.19710>:
  <D.19711>:
  <D.19712>:
  <D.19713>:
  goto <D.19691>;
  <D.19714>:
  D.24175 = mono_defaults.int_class;
  mono_mb_emit_op (mb, 140, D.24175);
  goto <D.19691>;
  <D.19715>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4799);
  <D.19691>:
  if (void_ret == 0) goto <D.24176>; else goto <D.24177>;
  <D.24176>:
  loc_res.162 = (unsigned int) loc_res;
  mono_mb_emit_stloc (mb, loc_res.162);
  <D.24177>:
  i = 0;
  goto <D.19718>;
  <D.19717>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.24179 = BIT_FIELD_REF <*t, 16, 48>;
    D.24180 = D.24179 & 16639;
    if (D.24180 == 16405) goto <D.24181>; else goto <D.24182>;
    <D.24181>:
    D.24183 = mono_class_from_mono_type (t);
    D.24184 = mono_class_is_nullable (D.24183);
    if (D.24184 != 0) goto <D.24185>; else goto <D.24186>;
    <D.24185>:
    mono_mb_emit_ldarg (mb, 1);
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24108 = (int) D.24107;
    mono_mb_emit_icon (mb, D.24108);
    mono_mb_emit_byte (mb, 88);
    i.161 = (unsigned int) i;
    D.24107 = i.161 * 4;
    D.24120 = tmp_nullable_locals + D.24107;
    D.24125 = *D.24120;
    D.24126 = (unsigned int) D.24125;
    mono_mb_emit_ldloc (mb, D.24126);
    D.24187 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 140, D.24187);
    mono_mb_emit_byte (mb, 81);
    <D.24186>:
    <D.24182>:
  }
  i = i + 1;
  <D.19718>:
  D.24101 = sig->param_count;
  D.24158 = (int) D.24101;
  if (D.24158 > i) goto <D.19717>; else goto <D.19719>;
  <D.19719>:
  monoeg_g_free (tmp_nullable_locals);
}


mono_marshal_get_runtime_invoke_dynamic ()
{
  struct MonoMethod * method.163;
  struct MonoMethod * D.24192;
  struct MonoImage * D.24193;
  struct MonoClass * D.24194;
  struct MonoType * D.24195;
  struct MonoClass * D.24196;
  struct MonoType * D.24197;
  struct MonoClass * D.24198;
  struct MonoType * D.24199;
  unsigned int D.24200;
  int D.24201;
  unsigned int D.24202;
  int D.24203;
  unsigned int D.24204;
  int D.24205;
  unsigned int D.24206;
  struct MonoClass * D.24207;
  unsigned int D.24208;
  unsigned int posna.164;
  int D.24210;
  unsigned int D.24211;
  unsigned int D.24212;
  unsigned int D.24213;
  unsigned int pos.165;
  _Bool D.24217;
  long int D.24218;
  long int D.24219;
  struct MonoMethod * method.166;
  _Bool D.24227;
  long int D.24228;
  long int D.24229;
  static struct MonoMethod * method;
  struct MonoMethodSignature * csig;
  struct MonoExceptionClause * clause;
  struct MonoMethodBuilder * mb;
  int pos;
  int posna;
  char * name;
  struct WrapperInfo * info;

  method.163 = method;
  if (method.163 != 0B) goto <D.24190>; else goto <D.24191>;
  <D.24190>:
  D.24192 = method;
  return D.24192;
  <D.24191>:
  D.24193 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24193, 4);
  D.24194 = mono_defaults.void_class;
  D.24195 = &D.24194->byval_arg;
  csig->ret = D.24195;
  D.24196 = mono_defaults.int_class;
  D.24197 = &D.24196->byval_arg;
  csig->params[0] = D.24197;
  D.24196 = mono_defaults.int_class;
  D.24197 = &D.24196->byval_arg;
  csig->params[1] = D.24197;
  D.24196 = mono_defaults.int_class;
  D.24197 = &D.24196->byval_arg;
  csig->params[2] = D.24197;
  D.24196 = mono_defaults.int_class;
  D.24197 = &D.24196->byval_arg;
  csig->params[3] = D.24197;
  name = monoeg_strdup ("runtime_invoke_dynamic");
  D.24198 = mono_defaults.object_class;
  mb = mono_mb_new (D.24198, name, 4);
  monoeg_g_free (name);
  D.24198 = mono_defaults.object_class;
  D.24199 = &D.24198->byval_arg;
  mono_mb_add_local (mb, D.24199);
  D.24198 = mono_defaults.object_class;
  D.24199 = &D.24198->byval_arg;
  mono_mb_add_local (mb, D.24199);
  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.24200 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.24200;
  D.24193 = mono_defaults.corlib;
  clause = mono_image_alloc0 (D.24193, 24);
  clause->flags = 1;
  D.24201 = mono_mb_get_label (mb);
  D.24202 = (unsigned int) D.24201;
  clause->try_len = D.24202;
  D.24203 = mono_mb_get_label (mb);
  D.24204 = (unsigned int) D.24203;
  clause->data.filter_offset = D.24204;
  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.24205 = mono_mb_get_label (mb);
  D.24206 = (unsigned int) D.24205;
  clause->handler_offset = D.24206;
  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.24207 = mono_defaults.threadabortexception_class;
  mono_mb_emit_op (mb, 117, D.24207);
  D.24208 = mono_mb_emit_short_branch (mb, 44);
  posna = (int) D.24208;
  mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort);
  posna.164 = (unsigned int) posna;
  mono_mb_patch_short_branch (mb, posna.164);
  mono_mb_emit_branch (mb, 221);
  D.24210 = mono_mb_get_pos (mb);
  D.24211 = (unsigned int) D.24210;
  D.24212 = clause->handler_offset;
  D.24213 = D.24211 - D.24212;
  clause->handler_len = D.24213;
  mono_mb_set_clauses (mb, 1, clause);
  pos.165 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.165);
  mono_mb_emit_byte (mb, 42);
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24215>; else goto <D.24216>;
    <D.24215>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24216>:
    D.24217 = ret != 0;
    D.24218 = (long int) D.24217;
    D.24219 = __builtin_expect (D.24218, 0);
    if (D.24219 != 0) goto <D.24220>; else goto <D.24221>;
    <D.24220>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5213, "ret == 0");
    <D.24221>:
  }
  method.163 = method;
  if (method.163 == 0B) goto <D.24222>; else goto <D.24223>;
  <D.24222>:
  method.166 = mono_mb_create_method (mb, csig, 16);
  method = method.166;
  method.163 = method;
  info = mono_wrapper_info_create (method.163, 12);
  method.163 = method;
  mono_marshal_set_wrapper_info (method.163, info);
  <D.24223>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24225>; else goto <D.24226>;
    <D.24225>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24226>:
    D.24227 = ret != 0;
    D.24228 = (long int) D.24227;
    D.24229 = __builtin_expect (D.24228, 0);
    if (D.24229 != 0) goto <D.24230>; else goto <D.24231>;
    <D.24230>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5220, "ret == 0");
    <D.24231>:
  }
  mono_mb_free (mb);
  D.24192 = method;
  return D.24192;
}


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

  if (str != 0B) goto <D.24233>; else goto <D.24234>;
  <D.24233>:
  D.24235 = __strdup (str);
  return D.24235;
  <D.24234>:
  D.24235 = 0B;
  return D.24235;
}


mono_marshal_get_ldfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24239;
  long int D.24240;
  long int D.24241;
  struct MonoMethod * cached.167;
  _Bool D.24249;
  long int D.24250;
  long int D.24251;
  struct MonoMethod * D.24254;
  _Bool D.24257;
  long int D.24258;
  long int D.24259;
  struct MonoClass * D.24262;
  struct MonoMethod * D.24263;
  struct MonoImage * D.24264;
  struct MonoType * D.24265;
  struct MonoClass * D.24266;
  struct MonoType * D.24267;
  _Bool D.24270;
  long int D.24271;
  long int D.24272;
  _Bool D.24277;
  long int D.24278;
  long int D.24279;
  _Bool D.24286;
  long int D.24287;
  long int D.24288;
  _Bool D.24295;
  long int D.24296;
  long int D.24297;
  _Bool D.24303;
  long int D.24304;
  long int D.24305;
  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.24237>; else goto <D.24238>;
    <D.24237>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24238>:
    D.24239 = ret != 0;
    D.24240 = (long int) D.24239;
    D.24241 = __builtin_expect (D.24240, 0);
    if (D.24241 != 0) goto <D.24242>; else goto <D.24243>;
    <D.24242>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5256, "ret == 0");
    <D.24243>:
  }
  cached.167 = cached;
  if (cached.167 != 0B) goto <D.24245>; else goto <D.24246>;
  <D.24245>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24247>; else goto <D.24248>;
    <D.24247>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24248>:
    D.24249 = ret != 0;
    D.24250 = (long int) D.24249;
    D.24251 = __builtin_expect (D.24250, 0);
    if (D.24251 != 0) goto <D.24252>; else goto <D.24253>;
    <D.24252>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5258, "ret == 0");
    <D.24253>:
  }
  D.24254 = cached;
  return D.24254;
  <D.24246>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24255>; else goto <D.24256>;
    <D.24255>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24256>:
    D.24257 = ret != 0;
    D.24258 = (long int) D.24257;
    D.24259 = __builtin_expect (D.24258, 0);
    if (D.24259 != 0) goto <D.24260>; else goto <D.24261>;
    <D.24260>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5261, "ret == 0");
    <D.24261>:
  }
  D.24262 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24262, "__mono_load_remote_field_new_wrapper", 14);
  D.24263 = mb->method;
  D.24263->save_lmf = 1;
  D.24264 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24264, 3);
  D.24262 = mono_defaults.object_class;
  D.24265 = &D.24262->byval_arg;
  sig->params[0] = D.24265;
  D.24266 = mono_defaults.int_class;
  D.24267 = &D.24266->byval_arg;
  sig->params[1] = D.24267;
  D.24266 = mono_defaults.int_class;
  D.24267 = &D.24266->byval_arg;
  sig->params[2] = D.24267;
  D.24262 = mono_defaults.object_class;
  D.24265 = &D.24262->byval_arg;
  sig->ret = D.24265;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.24264 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24264, 3);
  D.24262 = mono_defaults.object_class;
  D.24265 = &D.24262->byval_arg;
  csig->params[0] = D.24265;
  D.24266 = mono_defaults.int_class;
  D.24267 = &D.24266->byval_arg;
  csig->params[1] = D.24267;
  D.24266 = mono_defaults.int_class;
  D.24267 = &D.24266->byval_arg;
  csig->params[2] = D.24267;
  D.24262 = mono_defaults.object_class;
  D.24265 = &D.24262->byval_arg;
  csig->ret = D.24265;
  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.24268>; else goto <D.24269>;
    <D.24268>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24269>:
    D.24270 = ret != 0;
    D.24271 = (long int) D.24270;
    D.24272 = __builtin_expect (D.24271, 0);
    if (D.24272 != 0) goto <D.24273>; else goto <D.24274>;
    <D.24273>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5291, "ret == 0");
    <D.24274>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24275>; else goto <D.24276>;
    <D.24275>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24276>:
    D.24277 = ret != 0;
    D.24278 = (long int) D.24277;
    D.24279 = __builtin_expect (D.24278, 0);
    if (D.24279 != 0) goto <D.24280>; else goto <D.24281>;
    <D.24280>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5293, "ret == 0");
    <D.24281>:
  }
  if (res == 0B) goto <D.24282>; else goto <D.24283>;
  <D.24282>:
  {
    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.24284>; else goto <D.24285>;
      <D.24284>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24285>:
      D.24286 = ret != 0;
      D.24287 = (long int) D.24286;
      D.24288 = __builtin_expect (D.24287, 0);
      if (D.24288 != 0) goto <D.24289>; else goto <D.24290>;
      <D.24289>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5297, "ret == 0");
      <D.24290>:
    }
    res = cached;
    if (res == 0B) goto <D.24291>; else goto <D.24292>;
    <D.24291>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24293>; else goto <D.24294>;
      <D.24293>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24294>:
      D.24295 = ret != 0;
      D.24296 = (long int) D.24295;
      D.24297 = __builtin_expect (D.24296, 0);
      if (D.24297 != 0) goto <D.24298>; else goto <D.24299>;
      <D.24298>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5302, "ret == 0");
      <D.24299>:
    }
    goto <D.24300>;
    <D.24292>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24301>; else goto <D.24302>;
      <D.24301>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24302>:
      D.24303 = ret != 0;
      D.24304 = (long int) D.24303;
      D.24305 = __builtin_expect (D.24304, 0);
      if (D.24305 != 0) goto <D.24306>; else goto <D.24307>;
      <D.24306>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5304, "ret == 0");
      <D.24307>:
    }
    mono_free_method (newm);
    <D.24300>:
  }
  <D.24283>:
  mono_mb_free (mb);
  D.24254 = res;
  return D.24254;
}


mono_marshal_get_ldfld_wrapper (struct MonoType * type)
{
  unsigned char D.24309;
  unsigned char D.24310;
  unsigned char D.24311;
  _Bool D.24323;
  _Bool D.24324;
  _Bool D.24325;
  _Bool D.24327;
  _Bool D.24328;
  _Bool D.24329;
  int D.24335;
  struct MonoImage * D.24341;
  struct GHashTable * * D.24342;
  struct MonoMethod * D.24345;
  const char * D.24346;
  const char * D.24347;
  struct MonoClass * D.24348;
  struct MonoImage * D.24349;
  struct MonoType * D.24350;
  struct MonoClass * D.24351;
  struct MonoType * D.24352;
  struct MonoType * D.24353;
  struct MonoMethod * D.24354;
  unsigned char D.24355;
  unsigned char D.24356;
  unsigned int D.24359;
  unsigned int pos0.168;
  unsigned int pos1.169;
  unsigned int D.24365;
  unsigned char D.24366;
  int D.24367;
  unsigned char D.24368;
  _Bool D.24369;
  long int D.24370;
  long int D.24371;
  int D.24374;
  int D.24378;
  short unsigned int D.24379;
  int D.24380;
  int D.24381;
  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.24309 = type->type;
  t = (int) D.24309;
  D.24310 = BIT_FIELD_REF <*type, 8, 56>;
  D.24311 = D.24310 & 64;
  if (D.24311 == 0) goto <D.24312>; else goto <D.24313>;
  <D.24312>:
  D.24309 = type->type;
  if (D.24309 == 29) goto <D.24314>; else goto <D.24315>;
  <D.24314>:
  klass = mono_defaults.array_class;
  goto <D.24316>;
  <D.24315>:
  D.24309 = type->type;
  if (D.24309 == 17) goto <D.24317>; else goto <D.24318>;
  <D.24317>:
  klass = type->data.klass;
  goto <D.24319>;
  <D.24318>:
  D.24323 = t == 28;
  D.24324 = t == 18;
  D.24325 = D.24323 | D.24324;
  if (D.24325 != 0) goto <D.24320>; else goto <D.24326>;
  <D.24326>:
  if (t == 14) goto <D.24320>; else goto <D.24321>;
  <D.24320>:
  klass = mono_defaults.object_class;
  goto <D.24322>;
  <D.24321>:
  D.24327 = t == 15;
  D.24328 = t == 27;
  D.24329 = D.24327 | D.24328;
  if (D.24329 != 0) goto <D.24330>; else goto <D.24331>;
  <D.24330>:
  klass = mono_defaults.int_class;
  goto <D.24332>;
  <D.24331>:
  if (t == 21) goto <D.24333>; else goto <D.24334>;
  <D.24333>:
  D.24335 = mono_type_generic_inst_is_valuetype (type);
  if (D.24335 != 0) goto <D.24336>; else goto <D.24337>;
  <D.24336>:
  klass = mono_class_from_mono_type (type);
  goto <D.24338>;
  <D.24337>:
  klass = mono_defaults.object_class;
  <D.24338>:
  goto <D.24339>;
  <D.24334>:
  klass = mono_class_from_mono_type (type);
  <D.24339>:
  <D.24332>:
  <D.24322>:
  <D.24319>:
  <D.24316>:
  goto <D.24340>;
  <D.24313>:
  klass = mono_defaults.int_class;
  <D.24340>:
  D.24341 = klass->image;
  D.24342 = &D.24341->ldfld_wrapper_cache;
  cache = get_cache (D.24342, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24343>; else goto <D.24344>;
  <D.24343>:
  D.24345 = res;
  return D.24345;
  <D.24344>:
  D.24346 = klass->name;
  D.24347 = klass->name_space;
  name = monoeg_g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, D.24347, D.24346);
  D.24348 = mono_defaults.object_class;
  mb = mono_mb_new (D.24348, name, 12);
  monoeg_g_free (name);
  D.24349 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24349, 4);
  D.24348 = mono_defaults.object_class;
  D.24350 = &D.24348->byval_arg;
  sig->params[0] = D.24350;
  D.24351 = mono_defaults.int_class;
  D.24352 = &D.24351->byval_arg;
  sig->params[1] = D.24352;
  D.24351 = mono_defaults.int_class;
  D.24352 = &D.24351->byval_arg;
  sig->params[2] = D.24352;
  D.24351 = mono_defaults.int_class;
  D.24352 = &D.24351->byval_arg;
  sig->params[3] = D.24352;
  D.24353 = &klass->byval_arg;
  sig->ret = D.24353;
  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.24354 = mono_marshal_get_ldfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24354, 0B);
  D.24355 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24356 = D.24355 & 8;
  if (D.24356 != 0) goto <D.24357>; else goto <D.24358>;
  <D.24357>:
  mono_mb_emit_op (mb, 121, klass);
  D.24359 = mono_mb_emit_branch (mb, 56);
  pos1 = (int) D.24359;
  goto <D.24360>;
  <D.24358>:
  mono_mb_emit_byte (mb, 42);
  <D.24360>:
  pos0.168 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.168);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  D.24355 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24356 = D.24355 & 8;
  if (D.24356 != 0) goto <D.24362>; else goto <D.24363>;
  <D.24362>:
  pos1.169 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.169);
  <D.24363>:
  switch (t) <default: <D.19831>, case 2: <D.19807>, case 3: <D.19808>, case 4: <D.19805>, case 5: <D.19806>, case 6: <D.19809>, case 7: <D.19810>, case 8: <D.19811>, case 9: <D.19812>, case 10: <D.19813>, case 11: <D.19814>, case 12: <D.19815>, case 13: <D.19816>, case 14: <D.19821>, case 15: <D.19824>, case 17: <D.19827>, case 18: <D.19820>, case 19: <D.19829>, case 20: <D.19817>, case 21: <D.19828>, case 24: <D.19822>, case 25: <D.19823>, case 27: <D.19825>, case 28: <D.19819>, case 29: <D.19818>, case 30: <D.19830>>
  <D.19805>:
  <D.19806>:
  <D.19807>:
  <D.19808>:
  <D.19809>:
  <D.19810>:
  <D.19811>:
  <D.19812>:
  <D.19813>:
  <D.19814>:
  <D.19815>:
  <D.19816>:
  <D.19817>:
  <D.19818>:
  <D.19819>:
  <D.19820>:
  <D.19821>:
  <D.19822>:
  <D.19823>:
  <D.19824>:
  <D.19825>:
  D.24365 = mono_type_to_ldind (type);
  D.24366 = (unsigned char) D.24365;
  D.24367 = (int) D.24366;
  mono_mb_emit_byte (mb, D.24367);
  goto <D.19826>;
  <D.19827>:
  D.24355 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24368 = D.24355 & 16;
  D.24369 = D.24368 != 0;
  D.24370 = (long int) D.24369;
  D.24371 = __builtin_expect (D.24370, 0);
  if (D.24371 != 0) goto <D.24372>; else goto <D.24373>;
  <D.24372>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5439, "!klass->enumtype");
  <D.24373>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.19826>;
  <D.19828>:
  D.24374 = mono_type_generic_inst_is_valuetype (type);
  if (D.24374 != 0) goto <D.24375>; else goto <D.24376>;
  <D.24375>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.24377>;
  <D.24376>:
  mono_mb_emit_byte (mb, 80);
  <D.24377>:
  goto <D.19826>;
  <D.19829>:
  <D.19830>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.19826>;
  <D.19831>:
  D.24309 = type->type;
  D.24378 = (int) D.24309;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24378);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5455);
  <D.19826>:
  mono_mb_emit_byte (mb, 42);
  D.24379 = sig->param_count;
  D.24380 = (int) D.24379;
  D.24381 = D.24380 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24381);
  mono_mb_free (mb);
  D.24345 = res;
  return D.24345;
}


mono_marshal_get_ldflda_wrapper (struct MonoType * type)
{
  unsigned char D.24383;
  unsigned char D.24384;
  unsigned char D.24385;
  _Bool D.24394;
  _Bool D.24395;
  _Bool D.24396;
  _Bool D.24397;
  _Bool D.24398;
  _Bool D.24402;
  _Bool D.24403;
  _Bool D.24404;
  int D.24410;
  struct MonoImage * D.24416;
  struct GHashTable * * D.24417;
  struct MonoMethod * D.24420;
  const char * D.24421;
  const char * D.24422;
  struct MonoClass * D.24423;
  struct MonoImage * D.24424;
  struct MonoType * D.24425;
  struct MonoClass * D.24426;
  struct MonoType * D.24427;
  unsigned int pos1.170;
  unsigned int D.24429;
  unsigned int pos2.171;
  unsigned int pos3.172;
  unsigned int pos0.173;
  short unsigned int D.24433;
  int D.24434;
  int D.24435;
  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.24383 = type->type;
  t = (int) D.24383;
  D.24384 = BIT_FIELD_REF <*type, 8, 56>;
  D.24385 = D.24384 & 64;
  if (D.24385 == 0) goto <D.24386>; else goto <D.24387>;
  <D.24386>:
  D.24383 = type->type;
  if (D.24383 == 29) goto <D.24388>; else goto <D.24389>;
  <D.24388>:
  klass = mono_defaults.array_class;
  goto <D.24390>;
  <D.24389>:
  D.24383 = type->type;
  if (D.24383 == 17) goto <D.24391>; else goto <D.24392>;
  <D.24391>:
  klass = type->data.klass;
  goto <D.24393>;
  <D.24392>:
  D.24394 = t == 28;
  D.24395 = t == 14;
  D.24396 = D.24394 | D.24395;
  D.24397 = t == 18;
  D.24398 = D.24396 | D.24397;
  if (D.24398 != 0) goto <D.24399>; else goto <D.24400>;
  <D.24399>:
  klass = mono_defaults.object_class;
  goto <D.24401>;
  <D.24400>:
  D.24402 = t == 15;
  D.24403 = t == 27;
  D.24404 = D.24402 | D.24403;
  if (D.24404 != 0) goto <D.24405>; else goto <D.24406>;
  <D.24405>:
  klass = mono_defaults.int_class;
  goto <D.24407>;
  <D.24406>:
  if (t == 21) goto <D.24408>; else goto <D.24409>;
  <D.24408>:
  D.24410 = mono_type_generic_inst_is_valuetype (type);
  if (D.24410 != 0) goto <D.24411>; else goto <D.24412>;
  <D.24411>:
  klass = mono_class_from_mono_type (type);
  goto <D.24413>;
  <D.24412>:
  klass = mono_defaults.object_class;
  <D.24413>:
  goto <D.24414>;
  <D.24409>:
  klass = mono_class_from_mono_type (type);
  <D.24414>:
  <D.24407>:
  <D.24401>:
  <D.24393>:
  <D.24390>:
  goto <D.24415>;
  <D.24387>:
  klass = mono_defaults.int_class;
  <D.24415>:
  D.24416 = klass->image;
  D.24417 = &D.24416->ldflda_wrapper_cache;
  cache = get_cache (D.24417, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24418>; else goto <D.24419>;
  <D.24418>:
  D.24420 = res;
  return D.24420;
  <D.24419>:
  D.24421 = klass->name;
  D.24422 = klass->name_space;
  name = monoeg_g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, D.24422, D.24421);
  D.24423 = mono_defaults.object_class;
  mb = mono_mb_new (D.24423, name, 23);
  monoeg_g_free (name);
  D.24424 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24424, 4);
  D.24423 = mono_defaults.object_class;
  D.24425 = &D.24423->byval_arg;
  sig->params[0] = D.24425;
  D.24426 = mono_defaults.int_class;
  D.24427 = &D.24426->byval_arg;
  sig->params[1] = D.24427;
  D.24426 = mono_defaults.int_class;
  D.24427 = &D.24426->byval_arg;
  sig->params[2] = D.24427;
  D.24426 = mono_defaults.int_class;
  D.24427 = &D.24426->byval_arg;
  sig->params[3] = D.24427;
  D.24426 = mono_defaults.int_class;
  D.24427 = &D.24426->byval_arg;
  sig->ret = D.24427;
  mono_mb_emit_ldarg (mb, 0);
  pos0 = mono_mb_emit_proxy_check (mb, 64);
  mono_mb_emit_ldarg (mb, 0);
  pos1 = mono_mb_emit_xdomain_check (mb, 59);
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another appdomain.");
  pos1.170 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.170);
  mono_mb_emit_ldarg (mb, 0);
  pos2 = mono_mb_emit_contextbound_check (mb, 59);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_icall (mb, mono_context_get);
  D.24429 = mono_mb_emit_branch (mb, 59);
  pos3 = (int) D.24429;
  mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context.");
  pos2.171 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.171);
  pos3.172 = (unsigned int) pos3;
  mono_mb_patch_branch (mb, pos3.172);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 16);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  pos0.173 = (unsigned int) pos0;
  mono_mb_patch_branch (mb, pos0.173);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  D.24433 = sig->param_count;
  D.24434 = (int) D.24433;
  D.24435 = D.24434 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24435);
  mono_mb_free (mb);
  D.24420 = res;
  return D.24420;
}


mono_mb_emit_contextbound_check (struct MonoMethodBuilder * mb, int branch_code)
{
  int offset.174;
  unsigned char mask.175;
  int D.24441;
  int D.24442;
  unsigned char D.24443;
  int D.24444;
  unsigned int D.24445;
  static int offset = -1;
  static guint8 mask;

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

    try
      {
        memset (&tmp, 0, 164);
        tmp.contextbound = 1;
        mono_marshal_find_nonzero_bit_offset (&tmp, 164, &offset, &mask);
      }
    finally
      {
        tmp = {CLOBBER};
      }
  }
  <D.24439>:
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 80);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  offset.174 = offset;
  mono_mb_emit_ldflda (mb, offset.174);
  mono_mb_emit_byte (mb, 71);
  mask.175 = mask;
  D.24441 = (int) mask.175;
  mono_mb_emit_icon (mb, D.24441);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_icon (mb, 0);
  D.24443 = (unsigned char) branch_code;
  D.24444 = (int) D.24443;
  D.24445 = mono_mb_emit_branch (mb, D.24444);
  D.24442 = (int) D.24445;
  return D.24442;
}


mono_marshal_get_stfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24449;
  long int D.24450;
  long int D.24451;
  struct MonoMethod * cached.176;
  _Bool D.24459;
  long int D.24460;
  long int D.24461;
  struct MonoMethod * D.24464;
  _Bool D.24467;
  long int D.24468;
  long int D.24469;
  struct MonoClass * D.24472;
  struct MonoMethod * D.24473;
  struct MonoImage * D.24474;
  struct MonoType * D.24475;
  struct MonoClass * D.24476;
  struct MonoType * D.24477;
  struct MonoClass * D.24478;
  struct MonoType * D.24479;
  _Bool D.24482;
  long int D.24483;
  long int D.24484;
  _Bool D.24489;
  long int D.24490;
  long int D.24491;
  _Bool D.24498;
  long int D.24499;
  long int D.24500;
  _Bool D.24507;
  long int D.24508;
  long int D.24509;
  _Bool D.24515;
  long int D.24516;
  long int D.24517;
  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.24447>; else goto <D.24448>;
    <D.24447>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24448>:
    D.24449 = ret != 0;
    D.24450 = (long int) D.24449;
    D.24451 = __builtin_expect (D.24450, 0);
    if (D.24451 != 0) goto <D.24452>; else goto <D.24453>;
    <D.24452>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5608, "ret == 0");
    <D.24453>:
  }
  cached.176 = cached;
  if (cached.176 != 0B) goto <D.24455>; else goto <D.24456>;
  <D.24455>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24457>; else goto <D.24458>;
    <D.24457>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24458>:
    D.24459 = ret != 0;
    D.24460 = (long int) D.24459;
    D.24461 = __builtin_expect (D.24460, 0);
    if (D.24461 != 0) goto <D.24462>; else goto <D.24463>;
    <D.24462>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5610, "ret == 0");
    <D.24463>:
  }
  D.24464 = cached;
  return D.24464;
  <D.24456>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24465>; else goto <D.24466>;
    <D.24465>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24466>:
    D.24467 = ret != 0;
    D.24468 = (long int) D.24467;
    D.24469 = __builtin_expect (D.24468, 0);
    if (D.24469 != 0) goto <D.24470>; else goto <D.24471>;
    <D.24470>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5613, "ret == 0");
    <D.24471>:
  }
  D.24472 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24472, "__mono_store_remote_field_new_wrapper", 15);
  D.24473 = mb->method;
  D.24473->save_lmf = 1;
  D.24474 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24474, 4);
  D.24472 = mono_defaults.object_class;
  D.24475 = &D.24472->byval_arg;
  sig->params[0] = D.24475;
  D.24476 = mono_defaults.int_class;
  D.24477 = &D.24476->byval_arg;
  sig->params[1] = D.24477;
  D.24476 = mono_defaults.int_class;
  D.24477 = &D.24476->byval_arg;
  sig->params[2] = D.24477;
  D.24472 = mono_defaults.object_class;
  D.24475 = &D.24472->byval_arg;
  sig->params[3] = D.24475;
  D.24478 = mono_defaults.void_class;
  D.24479 = &D.24478->byval_arg;
  sig->ret = D.24479;
  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.24474 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24474, 4);
  D.24472 = mono_defaults.object_class;
  D.24475 = &D.24472->byval_arg;
  csig->params[0] = D.24475;
  D.24476 = mono_defaults.int_class;
  D.24477 = &D.24476->byval_arg;
  csig->params[1] = D.24477;
  D.24476 = mono_defaults.int_class;
  D.24477 = &D.24476->byval_arg;
  csig->params[2] = D.24477;
  D.24472 = mono_defaults.object_class;
  D.24475 = &D.24472->byval_arg;
  csig->params[3] = D.24475;
  D.24478 = mono_defaults.void_class;
  D.24479 = &D.24478->byval_arg;
  csig->ret = D.24479;
  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.24480>; else goto <D.24481>;
    <D.24480>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24481>:
    D.24482 = ret != 0;
    D.24483 = (long int) D.24482;
    D.24484 = __builtin_expect (D.24483, 0);
    if (D.24484 != 0) goto <D.24485>; else goto <D.24486>;
    <D.24485>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5646, "ret == 0");
    <D.24486>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24487>; else goto <D.24488>;
    <D.24487>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24488>:
    D.24489 = ret != 0;
    D.24490 = (long int) D.24489;
    D.24491 = __builtin_expect (D.24490, 0);
    if (D.24491 != 0) goto <D.24492>; else goto <D.24493>;
    <D.24492>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5648, "ret == 0");
    <D.24493>:
  }
  if (res == 0B) goto <D.24494>; else goto <D.24495>;
  <D.24494>:
  {
    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.24496>; else goto <D.24497>;
      <D.24496>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24497>:
      D.24498 = ret != 0;
      D.24499 = (long int) D.24498;
      D.24500 = __builtin_expect (D.24499, 0);
      if (D.24500 != 0) goto <D.24501>; else goto <D.24502>;
      <D.24501>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5652, "ret == 0");
      <D.24502>:
    }
    res = cached;
    if (res == 0B) goto <D.24503>; else goto <D.24504>;
    <D.24503>:
    res = newm;
    cached = res;
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24505>; else goto <D.24506>;
      <D.24505>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24506>:
      D.24507 = ret != 0;
      D.24508 = (long int) D.24507;
      D.24509 = __builtin_expect (D.24508, 0);
      if (D.24509 != 0) goto <D.24510>; else goto <D.24511>;
      <D.24510>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5657, "ret == 0");
      <D.24511>:
    }
    goto <D.24512>;
    <D.24504>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24513>; else goto <D.24514>;
      <D.24513>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24514>:
      D.24515 = ret != 0;
      D.24516 = (long int) D.24515;
      D.24517 = __builtin_expect (D.24516, 0);
      if (D.24517 != 0) goto <D.24518>; else goto <D.24519>;
      <D.24518>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5659, "ret == 0");
      <D.24519>:
    }
    mono_free_method (newm);
    <D.24512>:
  }
  <D.24495>:
  mono_mb_free (mb);
  D.24464 = res;
  return D.24464;
}


mono_marshal_get_stfld_wrapper (struct MonoType * type)
{
  unsigned char D.24521;
  unsigned char D.24522;
  unsigned char D.24523;
  _Bool D.24535;
  _Bool D.24536;
  _Bool D.24537;
  _Bool D.24539;
  _Bool D.24540;
  _Bool D.24541;
  int D.24547;
  struct MonoImage * D.24553;
  struct GHashTable * * D.24554;
  struct MonoMethod * D.24557;
  const char * D.24558;
  const char * D.24559;
  struct MonoClass * D.24560;
  struct MonoImage * D.24561;
  struct MonoType * D.24562;
  struct MonoClass * D.24563;
  struct MonoType * D.24564;
  struct MonoType * D.24565;
  struct MonoClass * D.24566;
  struct MonoType * D.24567;
  unsigned char D.24568;
  unsigned char D.24569;
  struct MonoMethod * D.24572;
  unsigned int pos.177;
  unsigned int D.24574;
  unsigned char D.24575;
  int D.24576;
  unsigned char D.24577;
  _Bool D.24578;
  long int D.24579;
  long int D.24580;
  int D.24583;
  short unsigned int D.24584;
  int D.24585;
  int D.24586;
  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.24521 = type->type;
  t = (int) D.24521;
  D.24522 = BIT_FIELD_REF <*type, 8, 56>;
  D.24523 = D.24522 & 64;
  if (D.24523 == 0) goto <D.24524>; else goto <D.24525>;
  <D.24524>:
  D.24521 = type->type;
  if (D.24521 == 29) goto <D.24526>; else goto <D.24527>;
  <D.24526>:
  klass = mono_defaults.array_class;
  goto <D.24528>;
  <D.24527>:
  D.24521 = type->type;
  if (D.24521 == 17) goto <D.24529>; else goto <D.24530>;
  <D.24529>:
  klass = type->data.klass;
  goto <D.24531>;
  <D.24530>:
  D.24535 = t == 28;
  D.24536 = t == 18;
  D.24537 = D.24535 | D.24536;
  if (D.24537 != 0) goto <D.24532>; else goto <D.24538>;
  <D.24538>:
  if (t == 14) goto <D.24532>; else goto <D.24533>;
  <D.24532>:
  klass = mono_defaults.object_class;
  goto <D.24534>;
  <D.24533>:
  D.24539 = t == 15;
  D.24540 = t == 27;
  D.24541 = D.24539 | D.24540;
  if (D.24541 != 0) goto <D.24542>; else goto <D.24543>;
  <D.24542>:
  klass = mono_defaults.int_class;
  goto <D.24544>;
  <D.24543>:
  if (t == 21) goto <D.24545>; else goto <D.24546>;
  <D.24545>:
  D.24547 = mono_type_generic_inst_is_valuetype (type);
  if (D.24547 != 0) goto <D.24548>; else goto <D.24549>;
  <D.24548>:
  klass = mono_class_from_mono_type (type);
  goto <D.24550>;
  <D.24549>:
  klass = mono_defaults.object_class;
  <D.24550>:
  goto <D.24551>;
  <D.24546>:
  klass = mono_class_from_mono_type (type);
  <D.24551>:
  <D.24544>:
  <D.24534>:
  <D.24531>:
  <D.24528>:
  goto <D.24552>;
  <D.24525>:
  klass = mono_defaults.int_class;
  <D.24552>:
  D.24553 = klass->image;
  D.24554 = &D.24553->stfld_wrapper_cache;
  cache = get_cache (D.24554, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24555>; else goto <D.24556>;
  <D.24555>:
  D.24557 = res;
  return D.24557;
  <D.24556>:
  D.24558 = klass->name;
  D.24559 = klass->name_space;
  name = monoeg_g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, D.24559, D.24558);
  D.24560 = mono_defaults.object_class;
  mb = mono_mb_new (D.24560, name, 13);
  monoeg_g_free (name);
  D.24561 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24561, 5);
  D.24560 = mono_defaults.object_class;
  D.24562 = &D.24560->byval_arg;
  sig->params[0] = D.24562;
  D.24563 = mono_defaults.int_class;
  D.24564 = &D.24563->byval_arg;
  sig->params[1] = D.24564;
  D.24563 = mono_defaults.int_class;
  D.24564 = &D.24563->byval_arg;
  sig->params[2] = D.24564;
  D.24563 = mono_defaults.int_class;
  D.24564 = &D.24563->byval_arg;
  sig->params[3] = D.24564;
  D.24565 = &klass->byval_arg;
  sig->params[4] = D.24565;
  D.24566 = mono_defaults.void_class;
  D.24567 = &D.24566->byval_arg;
  sig->ret = D.24567;
  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.24568 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24569 = D.24568 & 8;
  if (D.24569 != 0) goto <D.24570>; else goto <D.24571>;
  <D.24570>:
  mono_mb_emit_op (mb, 140, klass);
  <D.24571>:
  D.24572 = mono_marshal_get_stfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24572, 0B);
  mono_mb_emit_byte (mb, 42);
  pos.177 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.177);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 4);
  switch (t) <default: <D.19900>, case 2: <D.19876>, case 3: <D.19877>, case 4: <D.19874>, case 5: <D.19875>, case 6: <D.19878>, case 7: <D.19879>, case 8: <D.19880>, case 9: <D.19881>, case 10: <D.19882>, case 11: <D.19883>, case 12: <D.19884>, case 13: <D.19885>, case 14: <D.19890>, case 15: <D.19893>, case 17: <D.19896>, case 18: <D.19889>, case 19: <D.19898>, case 20: <D.19886>, case 21: <D.19897>, case 24: <D.19891>, case 25: <D.19892>, case 27: <D.19894>, case 28: <D.19888>, case 29: <D.19887>, case 30: <D.19899>>
  <D.19874>:
  <D.19875>:
  <D.19876>:
  <D.19877>:
  <D.19878>:
  <D.19879>:
  <D.19880>:
  <D.19881>:
  <D.19882>:
  <D.19883>:
  <D.19884>:
  <D.19885>:
  <D.19886>:
  <D.19887>:
  <D.19888>:
  <D.19889>:
  <D.19890>:
  <D.19891>:
  <D.19892>:
  <D.19893>:
  <D.19894>:
  D.24574 = mono_type_to_stind (type);
  D.24575 = (unsigned char) D.24574;
  D.24576 = (int) D.24575;
  mono_mb_emit_byte (mb, D.24576);
  goto <D.19895>;
  <D.19896>:
  D.24568 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24577 = D.24568 & 16;
  D.24578 = D.24577 != 0;
  D.24579 = (long int) D.24578;
  D.24580 = __builtin_expect (D.24579, 0);
  if (D.24580 != 0) goto <D.24581>; else goto <D.24582>;
  <D.24581>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5777, "!klass->enumtype");
  <D.24582>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.19895>;
  <D.19897>:
  <D.19898>:
  <D.19899>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.19895>;
  <D.19900>:
  D.24521 = type->type;
  D.24583 = (int) D.24521;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24583);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5787);
  <D.19895>:
  mono_mb_emit_byte (mb, 42);
  D.24584 = sig->param_count;
  D.24585 = (int) D.24584;
  D.24586 = D.24585 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24586);
  mono_mb_free (mb);
  D.24557 = res;
  return D.24557;
}


mono_marshal_get_icall_wrapper (struct MonoMethodSignature * sig, const char * name, const void * func, gboolean check_exceptions)
{
  unsigned char D.24588;
  unsigned char D.24589;
  _Bool D.24590;
  long int D.24591;
  long int D.24592;
  struct MonoClass * D.24595;
  struct MonoMethod * D.24596;
  unsigned char D.24597;
  unsigned char D.24598;
  struct MonoImage * D.24601;
  <unnamed-unsigned:1> D.24605;
  int D.24606;
  int D.24607;
  unsigned int D.24608;
  short unsigned int D.24609;
  int D.24610;
  unsigned char D.24613;
  unsigned char D.24614;
  short unsigned int D.24617;
  int D.24618;
  int D.24619;
  struct MonoMethod * D.24620;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * csig2;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  struct WrapperInfo * info;

  D.24588 = BIT_FIELD_REF <*sig, 8, 88>;
  D.24589 = D.24588 & 1;
  D.24590 = D.24589 == 0;
  D.24591 = (long int) D.24590;
  D.24592 = __builtin_expect (D.24591, 0);
  if (D.24592 != 0) goto <D.24593>; else goto <D.24594>;
  <D.24593>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5815, "sig->pinvoke");
  <D.24594>:
  D.24595 = mono_defaults.object_class;
  mb = mono_mb_new (D.24595, name, 6);
  D.24596 = mb->method;
  D.24596->save_lmf = 1;
  D.24597 = BIT_FIELD_REF <*sig, 8, 80>;
  D.24598 = D.24597 & 64;
  if (D.24598 != 0) goto <D.24599>; else goto <D.24600>;
  <D.24599>:
  D.24595 = mono_defaults.object_class;
  D.24601 = mono_defaults.corlib;
  csig2 = signature_dup_add_this (D.24601, sig, D.24595);
  goto <D.24602>;
  <D.24600>:
  D.24601 = mono_defaults.corlib;
  csig2 = signature_dup (D.24601, sig);
  <D.24602>:
  D.24597 = BIT_FIELD_REF <*sig, 8, 80>;
  D.24598 = D.24597 & 64;
  if (D.24598 != 0) goto <D.24603>; else goto <D.24604>;
  <D.24603>:
  mono_mb_emit_byte (mb, 2);
  <D.24604>:
  i = 0;
  goto <D.19914>;
  <D.19913>:
  D.24605 = sig->hasthis;
  D.24606 = (int) D.24605;
  D.24607 = D.24606 + i;
  D.24608 = (unsigned int) D.24607;
  mono_mb_emit_ldarg (mb, D.24608);
  i = i + 1;
  <D.19914>:
  D.24609 = sig->param_count;
  D.24610 = (int) D.24609;
  if (D.24610 > i) goto <D.19913>; else goto <D.19915>;
  <D.19915>:
  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.24611>; else goto <D.24612>;
  <D.24611>:
  emit_thread_interrupt_checkpoint (mb);
  <D.24612>:
  mono_mb_emit_byte (mb, 42);
  D.24601 = mono_defaults.corlib;
  csig = signature_dup (D.24601, sig);
  csig->pinvoke = 0;
  D.24613 = BIT_FIELD_REF <*csig, 8, 80>;
  D.24614 = D.24613 & 63;
  if (D.24614 == 5) goto <D.24615>; else goto <D.24616>;
  <D.24615>:
  csig->call_convention = 0;
  <D.24616>:
  D.24617 = csig->param_count;
  D.24618 = (int) D.24617;
  D.24619 = D.24618 + 16;
  res = mono_mb_create_method (mb, csig, D.24619);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 15);
  info->d.icall.func = func;
  mono_marshal_set_wrapper_info (res, info);
  D.24620 = res;
  return D.24620;
}


signature_dup_add_this (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoClass * klass)
{
  short unsigned int D.24622;
  int D.24623;
  int D.24624;
  unsigned int D.24625;
  short unsigned int D.24626;
  int D.24627;
  struct MonoType * D.24628;
  struct MonoType * iftmp.178;
  unsigned char D.24630;
  unsigned char D.24631;
  struct MonoMethodSignature * D.24635;
  struct MonoMethodSignature * res;
  int i;

  D.24622 = sig->param_count;
  D.24623 = (int) D.24622;
  D.24624 = D.24623 + 1;
  D.24625 = (unsigned int) D.24624;
  res = mono_metadata_signature_alloc (image, D.24625);
  memcpy (res, sig, 12);
  D.24622 = sig->param_count;
  D.24626 = D.24622 + 1;
  res->param_count = D.24626;
  res->hasthis = 0;
  D.24622 = sig->param_count;
  D.24623 = (int) D.24622;
  i = D.24623 + -1;
  goto <D.19593>;
  <D.19592>:
  D.24627 = i + 1;
  D.24628 = sig->params[i];
  res->params[D.24627] = D.24628;
  i = i + -1;
  <D.19593>:
  if (i >= 0) goto <D.19592>; else goto <D.19594>;
  <D.19594>:
  D.24630 = BIT_FIELD_REF <*klass, 8, 160>;
  D.24631 = D.24630 & 8;
  if (D.24631 != 0) goto <D.24632>; else goto <D.24633>;
  <D.24632>:
  iftmp.178 = &klass->this_arg;
  goto <D.24634>;
  <D.24633>:
  iftmp.178 = &klass->byval_arg;
  <D.24634>:
  res->params[0] = iftmp.178;
  D.24635 = res;
  return D.24635;
}


mono_marshal_emit_native_wrapper (struct MonoImage * image, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * * mspecs, void * func, gboolean aot, gboolean check_exceptions, gboolean func_param)
{
  unsigned char D.24639;
  unsigned char D.24640;
  _Bool D.24641;
  long int D.24642;
  long int D.24643;
  struct MonoMethod * D.24646;
  struct MonoClass * D.24647;
  struct MonoImage * D.24648;
  struct MonoClass * D.24651;
  struct MonoType * D.24652;
  struct MonoClass * D.24653;
  struct MonoType * D.24654;
  struct MonoType * D.24655;
  int D.24656;
  struct MonoMarshalSpec * D.24659;
  <unnamed type> D.24662;
  short unsigned int D.24665;
  unsigned int D.24666;
  unsigned int D.24667;
  int D.24668;
  int D.24669;
  unsigned int D.24670;
  unsigned int D.24671;
  void * D.24672;
  unsigned int i.179;
  unsigned int D.24674;
  int * D.24675;
  struct MonoType * * D.24676;
  sizetype i.180;
  sizetype D.24678;
  sizetype D.24679;
  struct MonoMarshalSpec * * D.24680;
  struct MonoMarshalSpec * D.24681;
  struct MonoType * D.24682;
  int D.24683;
  int D.24684;
  int D.24687;
  unsigned int D.24691;
  unsigned int D.24692;
  struct MonoMethod * D.24695;
  short unsigned int D.24700;
  int D.24701;
  int D.24702;
  struct MonoMethodSignature * get_last_error_sig.181;
  struct MonoImage * D.24708;
  struct MonoMethodSignature * get_last_error_sig.182;
  unsigned char D.24710;
  unsigned char D.24711;
  unsigned char D.24714;
  <unnamed type> D.24717;
  unsigned char D.24719;
  unsigned char D.24720;
  struct MonoClass * D.24723;
  struct MonoType * D.24724;
  unsigned char D.24725;
  int D.24726;
  <unnamed type> D.24732;
  _Bool D.24733;
  _Bool D.24734;
  _Bool D.24735;
  unsigned char D.24738;
  int D.24739;
  int D.24741;
  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.24637>; else goto <D.24638>;
      <D.24637>:
      D.24639 = BIT_FIELD_REF <*sig, 8, 80>;
      D.24640 = D.24639 & 64;
      D.24641 = D.24640 != 0;
      D.24642 = (long int) D.24641;
      D.24643 = __builtin_expect (D.24642, 0);
      if (D.24643 != 0) goto <D.24644>; else goto <D.24645>;
      <D.24644>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8635, "!sig->hasthis");
      <D.24645>:
      param_shift = param_shift + 1;
      <D.24638>:
      D.24646 = mb->method;
      D.24647 = D.24646->klass;
      D.24648 = D.24647->image;
      csig = signature_dup (D.24648, sig);
      csig->pinvoke = 1;
      m.csig = csig;
      m.image = image;
      D.24639 = BIT_FIELD_REF <*sig, 8, 80>;
      D.24640 = D.24639 & 64;
      if (D.24640 != 0) goto <D.24649>; else goto <D.24650>;
      <D.24649>:
      param_shift = param_shift + 1;
      <D.24650>:
      D.24651 = mono_defaults.int_class;
      D.24652 = &D.24651->byval_arg;
      mono_mb_add_local (mb, D.24652);
      D.24651 = mono_defaults.int_class;
      D.24652 = &D.24651->byval_arg;
      mono_mb_add_local (mb, D.24652);
      D.24653 = mono_defaults.boolean_class;
      D.24654 = &D.24653->byval_arg;
      mono_mb_add_local (mb, D.24654);
      mono_mb_emit_icon (mb, 0);
      mono_mb_emit_stloc (mb, 2);
      D.24655 = sig->ret;
      D.24656 = mono_type_is_void (D.24655);
      if (D.24656 == 0) goto <D.24657>; else goto <D.24658>;
      <D.24657>:
      D.24655 = sig->ret;
      mono_mb_add_local (mb, D.24655);
      <D.24658>:
      D.24659 = *mspecs;
      if (D.24659 != 0B) goto <D.24660>; else goto <D.24661>;
      <D.24660>:
      D.24659 = *mspecs;
      D.24662 = D.24659->native;
      if (D.24662 == 44) goto <D.24663>; else goto <D.24664>;
      <D.24663>:
      D.24651 = mono_defaults.int_class;
      D.24652 = &D.24651->byval_arg;
      csig->ret = D.24652;
      <D.24664>:
      <D.24661>:
      D.24665 = sig->param_count;
      D.24666 = (unsigned int) D.24665;
      D.24667 = D.24666 * 4;
      tmp_locals = __builtin_alloca (D.24667);
      D.24665 = sig->param_count;
      D.24668 = (int) D.24665;
      D.24669 = D.24668 + 1;
      D.24670 = (unsigned int) D.24669;
      D.24671 = D.24670 * 4;
      D.24672 = __builtin_alloca (D.24671);
      m.orig_conv_args = D.24672;
      i = 0;
      goto <D.20403>;
      <D.20402>:
      i.179 = (unsigned int) i;
      D.24674 = i.179 * 4;
      D.24675 = tmp_locals + D.24674;
      D.24676 = &csig->params[i];
      i.180 = (sizetype) i;
      D.24678 = i.180 + 1;
      D.24679 = D.24678 * 4;
      D.24680 = mspecs + D.24679;
      D.24681 = *D.24680;
      D.24682 = sig->params[i];
      D.24683 = i + param_shift;
      D.24684 = emit_marshal (&m, D.24683, D.24682, D.24681, 0, D.24676, 0);
      *D.24675 = D.24684;
      i = i + 1;
      <D.20403>:
      D.24665 = sig->param_count;
      D.24668 = (int) D.24665;
      if (D.24668 > i) goto <D.20402>; else goto <D.20404>;
      <D.20404>:
      D.24639 = BIT_FIELD_REF <*sig, 8, 80>;
      D.24640 = D.24639 & 64;
      if (D.24640 != 0) goto <D.24685>; else goto <D.24686>;
      <D.24685>:
      mono_mb_emit_byte (mb, 2);
      <D.24686>:
      i = 0;
      goto <D.20406>;
      <D.20405>:
      i.179 = (unsigned int) i;
      D.24674 = i.179 * 4;
      D.24675 = tmp_locals + D.24674;
      D.24687 = *D.24675;
      i.180 = (sizetype) i;
      D.24678 = i.180 + 1;
      D.24679 = D.24678 * 4;
      D.24680 = mspecs + D.24679;
      D.24681 = *D.24680;
      D.24682 = sig->params[i];
      D.24683 = i + param_shift;
      emit_marshal (&m, D.24683, D.24682, D.24681, D.24687, 0B, 1);
      i = i + 1;
      <D.20406>:
      D.24665 = sig->param_count;
      D.24668 = (int) D.24665;
      if (D.24668 > i) goto <D.20405>; else goto <D.20407>;
      <D.20407>:
      if (func_param != 0) goto <D.24688>; else goto <D.24689>;
      <D.24688>:
      mono_mb_emit_byte (mb, 2);
      D.24651 = mono_defaults.int_class;
      mono_mb_emit_op (mb, 121, D.24651);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_calli (mb, csig);
      goto <D.24690>;
      <D.24689>:
      D.24646 = mb->method;
      D.24647 = D.24646->klass;
      D.24691 = D.24647->flags;
      D.24692 = D.24691 & 4096;
      if (D.24692 != 0) goto <D.24693>; else goto <D.24694>;
      <D.24693>:
      D.24695 = &piinfo->method;
      mono_mb_emit_cominterop_call (mb, csig, D.24695);
      goto <D.24696>;
      <D.24694>:
      if (aot != 0) goto <D.24697>; else goto <D.24698>;
      <D.24697>:
      mono_mb_emit_byte (mb, 240);
      D.24695 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.24695);
      mono_mb_emit_calli (mb, csig);
      goto <D.24699>;
      <D.24698>:
      mono_mb_emit_native_call (mb, csig, func);
      <D.24699>:
      <D.24696>:
      <D.24690>:
      D.24700 = piinfo->piflags;
      D.24701 = (int) D.24700;
      D.24702 = D.24701 & 64;
      if (D.24702 != 0) goto <D.24703>; else goto <D.24704>;
      <D.24703>:
      get_last_error_sig.181 = get_last_error_sig;
      if (get_last_error_sig.181 == 0B) goto <D.24706>; else goto <D.24707>;
      <D.24706>:
      D.24708 = mono_defaults.corlib;
      get_last_error_sig.182 = mono_metadata_signature_alloc (D.24708, 0);
      get_last_error_sig = get_last_error_sig.182;
      get_last_error_sig.181 = get_last_error_sig;
      D.24651 = mono_defaults.int_class;
      D.24652 = &D.24651->byval_arg;
      get_last_error_sig.181->ret = D.24652;
      get_last_error_sig.181 = get_last_error_sig;
      get_last_error_sig.181->pinvoke = 1;
      <D.24707>:
      mono_mb_emit_icall (mb, mono_marshal_set_last_error);
      <D.24704>:
      D.24655 = sig->ret;
      D.24710 = BIT_FIELD_REF <*D.24655, 8, 56>;
      D.24711 = D.24710 & 64;
      if (D.24711 == 0) goto <D.24712>; else goto <D.24713>;
      <D.24712>:
      {
        struct MonoMarshalSpec * spec;

        spec = *mspecs;
        D.24655 = sig->ret;
        D.24714 = D.24655->type;
        type = (int) D.24714;
        if (spec != 0B) goto <D.24716>; else goto <D.24715>;
        <D.24716>:
        D.24717 = spec->native;
        if (D.24717 == 44) goto <D.24718>; else goto <D.24715>;
        <D.24718>:
        D.24655 = sig->ret;
        emit_marshal (&m, 0, D.24655, spec, 0, 0B, 3);
        goto <D.20411>;
        <D.24715>:
        handle_enum:
        switch (type) <default: <D.20436>, case 1: <D.20410>, case 2: <D.20429>, case 3: <D.20432>, case 4: <D.20413>, case 5: <D.20414>, case 6: <D.20415>, case 7: <D.20416>, case 8: <D.20417>, case 9: <D.20418>, case 10: <D.20423>, case 11: <D.20424>, case 12: <D.20421>, case 13: <D.20422>, case 14: <D.20426>, case 15: <D.20433>, case 17: <D.20412>, case 18: <D.20427>, case 20: <D.20430>, case 21: <D.20434>, case 22: <D.20435>, case 24: <D.20419>, case 25: <D.20420>, case 27: <D.20425>, case 28: <D.20428>, case 29: <D.20431>>
        <D.20410>:
        goto <D.20411>;
        <D.20412>:
        D.24655 = sig->ret;
        klass = D.24655->data.klass;
        D.24719 = BIT_FIELD_REF <*klass, 8, 160>;
        D.24720 = D.24719 & 16;
        if (D.24720 != 0) goto <D.24721>; else goto <D.24722>;
        <D.24721>:
        D.24655 = sig->ret;
        D.24723 = D.24655->data.klass;
        D.24724 = mono_class_enum_basetype (D.24723);
        D.24725 = D.24724->type;
        type = (int) D.24725;
        goto handle_enum;
        <D.24722>:
        D.24655 = sig->ret;
        emit_marshal (&m, 0, D.24655, spec, 0, 0B, 3);
        goto <D.20411>;
        <D.20413>:
        <D.20414>:
        <D.20415>:
        <D.20416>:
        <D.20417>:
        <D.20418>:
        <D.20419>:
        <D.20420>:
        <D.20421>:
        <D.20422>:
        <D.20423>:
        <D.20424>:
        <D.20425>:
        <D.20426>:
        <D.20427>:
        <D.20428>:
        <D.20429>:
        <D.20430>:
        <D.20431>:
        <D.20432>:
        <D.20433>:
        <D.20434>:
        D.24655 = sig->ret;
        emit_marshal (&m, 0, D.24655, spec, 0, 0B, 3);
        goto <D.20411>;
        <D.20435>:
        <D.20436>:
        D.24655 = sig->ret;
        D.24714 = D.24655->type;
        D.24726 = (int) D.24714;
        monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.24726);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8782);
        <D.20411>:
      }
      goto <D.24727>;
      <D.24713>:
      mono_mb_emit_stloc (mb, 3);
      <D.24727>:
      if (check_exceptions != 0) goto <D.24728>; else goto <D.24729>;
      <D.24728>:
      emit_thread_interrupt_checkpoint (mb);
      <D.24729>:
      i = 0;
      goto <D.20448>;
      <D.20447>:
      {
        struct MonoType * t;
        struct MonoMarshalSpec * spec;

        t = sig->params[i];
        i.180 = (sizetype) i;
        D.24678 = i.180 + 1;
        D.24679 = D.24678 * 4;
        D.24680 = mspecs + D.24679;
        spec = *D.24680;
        argnum = i + param_shift;
        if (spec != 0B) goto <D.24730>; else goto <D.24731>;
        <D.24730>:
        D.24732 = spec->native;
        D.24733 = D.24732 == 44;
        D.24734 = D.24732 == 40;
        D.24735 = D.24733 | D.24734;
        if (D.24735 != 0) goto <D.24736>; else goto <D.24737>;
        <D.24736>:
        i.179 = (unsigned int) i;
        D.24674 = i.179 * 4;
        D.24675 = tmp_locals + D.24674;
        D.24687 = *D.24675;
        emit_marshal (&m, argnum, t, spec, D.24687, 0B, 2);
        // predicted unlikely by continue predictor.
        goto <D.20439>;
        <D.24737>:
        <D.24731>:
        D.24738 = t->type;
        D.24739 = (int) D.24738;
        switch (D.24739) <default: <D.24740>, case 2: <D.20445>, case 14: <D.20440>, case 17: <D.20441>, case 18: <D.20442>, case 28: <D.20443>, case 29: <D.20444>>
        <D.20440>:
        <D.20441>:
        <D.20442>:
        <D.20443>:
        <D.20444>:
        <D.20445>:
        i.179 = (unsigned int) i;
        D.24674 = i.179 * 4;
        D.24675 = tmp_locals + D.24674;
        D.24687 = *D.24675;
        emit_marshal (&m, argnum, t, spec, D.24687, 0B, 2);
        goto <D.20446>;
        <D.24740>:
        <D.20446>:
      }
      <D.20439>:
      i = i + 1;
      <D.20448>:
      D.24665 = sig->param_count;
      D.24668 = (int) D.24665;
      if (D.24668 > i) goto <D.20447>; else goto <D.20449>;
      <D.20449>:
      D.24655 = sig->ret;
      D.24741 = mono_type_is_void (D.24655);
      if (D.24741 == 0) goto <D.24742>; else goto <D.24743>;
      <D.24742>:
      mono_mb_emit_ldloc (mb, 3);
      <D.24743>:
      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.24746;
  <unnamed type> D.24749;
  int D.24752;
  unsigned char D.24757;
  int D.24758;
  struct MonoClass * D.24759;
  struct MonoClass * D.24760;
  <unnamed type> D.24769;
  unsigned int D.24770;
  _Bool D.24771;
  _Bool D.24772;
  _Bool D.24773;
  <unnamed type> D.24782;
  _Bool D.24785;
  _Bool D.24786;
  _Bool D.24787;
  struct MonoClass * D.24789;
  int D.24794;
  int D.24797;

  D.24746 = mono_class_from_mono_type (t);
  mono_marshal_load_type_info (D.24746);
  if (spec != 0B) goto <D.24747>; else goto <D.24748>;
  <D.24747>:
  D.24749 = spec->native;
  if (D.24749 == 44) goto <D.24750>; else goto <D.24751>;
  <D.24750>:
  D.24752 = emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24751>:
  <D.24748>:
  if (spec != 0B) goto <D.24753>; else goto <D.24754>;
  <D.24753>:
  D.24749 = spec->native;
  if (D.24749 == 40) goto <D.24755>; else goto <D.24756>;
  <D.24755>:
  D.24752 = emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24756>:
  <D.24754>:
  D.24757 = t->type;
  D.24758 = (int) D.24757;
  switch (D.24758) <default: <D.24800>, case 2: <D.20365>, case 3: <D.20367>, case 4: <D.20368>, case 5: <D.20369>, case 6: <D.20370>, case 7: <D.20371>, case 8: <D.20372>, case 9: <D.20373>, case 10: <D.20378>, case 11: <D.20379>, case 12: <D.20376>, case 13: <D.20377>, case 14: <D.20360>, case 15: <D.20366>, case 17: <D.20359>, case 18: <D.20361>, case 20: <D.20363>, case 21: <D.20381>, case 24: <D.20374>, case 25: <D.20375>, case 27: <D.20380>, case 28: <D.20362>, case 29: <D.20364>>
  <D.20359>:
  D.24759 = t->data.klass;
  D.24760 = mono_defaults.handleref_class;
  if (D.24759 == D.24760) goto <D.24761>; else goto <D.24762>;
  <D.24761>:
  D.24752 = emit_marshal_handleref (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24762>:
  D.24752 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20360>:
  D.24752 = emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20361>:
  <D.20362>:
  if (spec != 0B) goto <D.24763>; else goto <D.24764>;
  <D.24763>:
  D.24749 = spec->native;
  if (D.24749 == 27) goto <D.24765>; else goto <D.24766>;
  <D.24765>:
  D.24752 = emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24766>:
  <D.24764>:
  if (spec != 0B) goto <D.24767>; else goto <D.24768>;
  <D.24767>:
  D.24769 = spec->native;
  D.24770 = D.24769 + 4294967271;
  D.24771 = D.24770 <= 1;
  D.24772 = D.24769 == 28;
  D.24773 = D.24771 | D.24772;
  if (D.24773 != 0) goto <D.24774>; else goto <D.24775>;
  <D.24774>:
  D.24752 = mono_cominterop_emit_marshal_com_interface (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24775>:
  <D.24768>:
  if (spec != 0B) goto <D.24778>; else goto <D.24779>;
  <D.24778>:
  D.24749 = spec->native;
  if (D.24749 == 29) goto <D.24780>; else goto <D.24781>;
  <D.24780>:
  D.24782 = spec->data.safearray_data.elem_type;
  if (D.24782 == 12) goto <D.24783>; else goto <D.24784>;
  <D.24783>:
  D.24785 = action == 2;
  D.24786 = action == 0;
  D.24787 = D.24785 | D.24786;
  if (D.24787 != 0) goto <D.24776>; else goto <D.24788>;
  <D.24788>:
  if (action == 1) goto <D.24776>; else goto <D.24777>;
  <D.24776>:
  D.24752 = mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24777>:
  <D.24784>:
  <D.24781>:
  <D.24779>:
  D.24789 = mono_defaults.safehandle_class;
  if (D.24789 != 0B) goto <D.24790>; else goto <D.24791>;
  <D.24790>:
  D.24759 = t->data.klass;
  if (D.24759 != 0B) goto <D.24792>; else goto <D.24793>;
  <D.24792>:
  D.24789 = mono_defaults.safehandle_class;
  D.24759 = t->data.klass;
  D.24794 = mono_class_is_subclass_of (D.24759, D.24789, 0);
  if (D.24794 != 0) goto <D.24795>; else goto <D.24796>;
  <D.24795>:
  D.24752 = emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24796>:
  <D.24793>:
  <D.24791>:
  D.24752 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20363>:
  <D.20364>:
  D.24752 = emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20365>:
  D.24752 = emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20366>:
  D.24752 = emit_marshal_ptr (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20367>:
  D.24752 = emit_marshal_char (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20368>:
  <D.20369>:
  <D.20370>:
  <D.20371>:
  <D.20372>:
  <D.20373>:
  <D.20374>:
  <D.20375>:
  <D.20376>:
  <D.20377>:
  <D.20378>:
  <D.20379>:
  <D.20380>:
  D.24752 = emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.20381>:
  D.24797 = mono_type_generic_inst_is_valuetype (t);
  if (D.24797 != 0) goto <D.24798>; else goto <D.24799>;
  <D.24798>:
  D.24752 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24799>:
  D.24752 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24752;
  <D.24800>:
  D.24752 = conv_arg;
  return D.24752;
}


emit_marshal_custom (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * ICustomMarshaler.183;
  struct MonoImage * D.24805;
  struct MonoClass * ICustomMarshaler.184;
  struct MonoMethod * cleanup_native.185;
  struct MonoMethod * cleanup_native.186;
  _Bool D.24811;
  long int D.24812;
  long int D.24813;
  struct MonoMethod * cleanup_managed.187;
  struct MonoMethod * cleanup_managed.188;
  _Bool D.24818;
  long int D.24819;
  long int D.24820;
  struct MonoMethod * marshal_managed_to_native.189;
  struct MonoMethod * marshal_managed_to_native.190;
  _Bool D.24825;
  long int D.24826;
  long int D.24827;
  struct MonoMethod * marshal_native_to_managed.191;
  struct MonoMethod * marshal_native_to_managed.192;
  _Bool D.24832;
  long int D.24833;
  long int D.24834;
  struct MonoImage * D.24837;
  char * D.24838;
  _Bool D.24839;
  long int D.24840;
  long int D.24841;
  _Bool D.24844;
  long int D.24845;
  long int D.24846;
  int D.24849;
  const char * D.24852;
  struct MonoType * D.24857;
  unsigned char D.24858;
  struct MonoClass * D.24860;
  struct MonoType * D.24862;
  unsigned char D.24863;
  _Bool D.24868;
  _Bool D.24869;
  _Bool D.24870;
  int D.24873;
  unsigned char D.24874;
  int D.24875;
  struct MonoClass * D.24876;
  struct MonoType * D.24877;
  unsigned int conv_arg.193;
  unsigned char D.24879;
  unsigned char D.24880;
  short unsigned int D.24883;
  int D.24884;
  int D.24885;
  unsigned int D.24889;
  unsigned int D.24890;
  unsigned int argnum.194;
  unsigned int D.24895;
  char * D.24896;
  gchar * D.24897;
  struct MonoClass * D.24902;
  unsigned int pos2.195;
  unsigned int D.24904;
  gchar * D.24907;
  gchar * D.24911;
  gchar * D.24912;
  int D.24916;
  unsigned int D.24917;
  gchar * D.24918;
  struct MonoClass * D.24919;
  struct MonoType * D.24920;
  unsigned int D.24926;
  gchar * D.24927;
  _Bool D.24930;
  long int D.24931;
  long int D.24932;
  int D.24935;
  unsigned int D.24936;
  gchar * D.24937;
  unsigned int D.24938;
  gchar * D.24941;
  gchar * D.24942;
  struct MonoType * mtype;
  struct MonoClass * mklass;
  static struct MonoClass * ICustomMarshaler = 0B;
  static struct MonoMethod * cleanup_native;
  static struct MonoMethod * cleanup_managed;
  static struct MonoMethod * marshal_managed_to_native;
  static struct MonoMethod * marshal_native_to_managed;
  struct MonoMethod * get_instance;
  struct MonoMethodBuilder * mb;
  char * exception_msg;
  guint32 loc1;
  int pos2;
  void handle_exception = <<< error >>>;

  get_instance = 0B;
  mb = m->mb;
  exception_msg = 0B;
  ICustomMarshaler.183 = ICustomMarshaler;
  if (ICustomMarshaler.183 == 0B) goto <D.24803>; else goto <D.24804>;
  <D.24803>:
  D.24805 = mono_defaults.corlib;
  ICustomMarshaler.184 = mono_class_from_name (D.24805, "System.Runtime.InteropServices", "ICustomMarshaler");
  ICustomMarshaler = ICustomMarshaler.184;
  ICustomMarshaler.183 = ICustomMarshaler;
  if (ICustomMarshaler.183 == 0B) goto <D.24807>; else goto <D.24808>;
  <D.24807>:
  exception_msg = monoeg_strdup ("Current profile doesn\'t support ICustomMarshaler");
  goto handle_exception;
  <D.24808>:
  ICustomMarshaler.183 = ICustomMarshaler;
  cleanup_native.185 = mono_class_get_method_from_name (ICustomMarshaler.183, "CleanUpNativeData", 1);
  cleanup_native = cleanup_native.185;
  cleanup_native.186 = cleanup_native;
  D.24811 = cleanup_native.186 == 0B;
  D.24812 = (long int) D.24811;
  D.24813 = __builtin_expect (D.24812, 0);
  if (D.24813 != 0) goto <D.24814>; else goto <D.24815>;
  <D.24814>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5887, "cleanup_native");
  <D.24815>:
  ICustomMarshaler.183 = ICustomMarshaler;
  cleanup_managed.187 = mono_class_get_method_from_name (ICustomMarshaler.183, "CleanUpManagedData", 1);
  cleanup_managed = cleanup_managed.187;
  cleanup_managed.188 = cleanup_managed;
  D.24818 = cleanup_managed.188 == 0B;
  D.24819 = (long int) D.24818;
  D.24820 = __builtin_expect (D.24819, 0);
  if (D.24820 != 0) goto <D.24821>; else goto <D.24822>;
  <D.24821>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5889, "cleanup_managed");
  <D.24822>:
  ICustomMarshaler.183 = ICustomMarshaler;
  marshal_managed_to_native.189 = mono_class_get_method_from_name (ICustomMarshaler.183, "MarshalManagedToNative", 1);
  marshal_managed_to_native = marshal_managed_to_native.189;
  marshal_managed_to_native.190 = marshal_managed_to_native;
  D.24825 = marshal_managed_to_native.190 == 0B;
  D.24826 = (long int) D.24825;
  D.24827 = __builtin_expect (D.24826, 0);
  if (D.24827 != 0) goto <D.24828>; else goto <D.24829>;
  <D.24828>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5891, "marshal_managed_to_native");
  <D.24829>:
  ICustomMarshaler.183 = ICustomMarshaler;
  marshal_native_to_managed.191 = mono_class_get_method_from_name (ICustomMarshaler.183, "MarshalNativeToManaged", 1);
  marshal_native_to_managed = marshal_native_to_managed.191;
  marshal_native_to_managed.192 = marshal_native_to_managed;
  D.24832 = marshal_native_to_managed.192 == 0B;
  D.24833 = (long int) D.24832;
  D.24834 = __builtin_expect (D.24833, 0);
  if (D.24834 != 0) goto <D.24835>; else goto <D.24836>;
  <D.24835>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5893, "marshal_native_to_managed");
  <D.24836>:
  <D.24804>:
  D.24837 = m->image;
  D.24838 = spec->data.custom_data.custom_name;
  mtype = mono_reflection_type_from_name (D.24838, D.24837);
  D.24839 = mtype == 0B;
  D.24840 = (long int) D.24839;
  D.24841 = __builtin_expect (D.24840, 0);
  if (D.24841 != 0) goto <D.24842>; else goto <D.24843>;
  <D.24842>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5897, "mtype != NULL");
  <D.24843>:
  mklass = mono_class_from_mono_type (mtype);
  D.24844 = mklass == 0B;
  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", 5899, "mklass != NULL");
  <D.24848>:
  ICustomMarshaler.183 = ICustomMarshaler;
  D.24849 = mono_class_is_assignable_from (ICustomMarshaler.183, mklass);
  if (D.24849 == 0) goto <D.24850>; else goto <D.24851>;
  <D.24850>:
  D.24852 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement the ICustomMarshaler interface.", D.24852);
  <D.24851>:
  get_instance = mono_class_get_method_from_name_flags (mklass, "GetInstance", 1, 16);
  if (get_instance != 0B) goto <D.24853>; else goto <D.24854>;
  <D.24853>:
  {
    struct MonoMethodSignature * get_sig;

    get_sig = mono_method_signature (get_instance);
    D.24857 = get_sig->ret;
    D.24858 = D.24857->type;
    if (D.24858 != 18) goto <D.24855>; else goto <D.24859>;
    <D.24859>:
    D.24857 = get_sig->ret;
    D.24860 = mono_class_from_mono_type (D.24857);
    ICustomMarshaler.183 = ICustomMarshaler;
    if (D.24860 != ICustomMarshaler.183) goto <D.24855>; else goto <D.24861>;
    <D.24861>:
    D.24862 = get_sig->params[0];
    D.24863 = D.24862->type;
    if (D.24863 != 14) goto <D.24855>; else goto <D.24856>;
    <D.24855>:
    get_instance = 0B;
    <D.24856>:
  }
  <D.24854>:
  if (get_instance == 0B) goto <D.24864>; else goto <D.24865>;
  <D.24864>:
  D.24852 = 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.24852);
  <D.24865>:
  handle_exception:
  if (exception_msg != 0B) goto <D.24866>; else goto <D.24867>;
  <D.24866>:
  switch (action) <default: <D.19944>, case 0: <D.19939>, case 1: <D.19943>, case 3: <D.19940>, case 6: <D.19941>>
  <D.19939>:
  <D.19940>:
  <D.19941>:
  D.24868 = action == 3;
  D.24869 = action == 6;
  D.24870 = D.24868 | D.24869;
  if (D.24870 != 0) goto <D.24871>; else goto <D.24872>;
  <D.24871>:
  mono_mb_emit_byte (mb, 38);
  <D.24872>:
  mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
  monoeg_g_free (exception_msg);
  goto <D.19942>;
  <D.19943>:
  mono_mb_emit_byte (mb, 20);
  goto <D.19942>;
  <D.19944>:
  goto <D.19942>;
  <D.19942>:
  D.24873 = 0;
  return D.24873;
  <D.24867>:
  switch (action) <default: <D.19961>, case 0: <D.19945>, case 1: <D.19956>, case 2: <D.19955>, case 3: <D.19957>, case 4: <D.19958>, case 5: <D.19960>, case 6: <D.19959>>
  <D.19945>:
  D.24874 = t->type;
  D.24875 = (int) D.24874;
  switch (D.24875) <default: <D.19953>, case 14: <D.19948>, case 17: <D.19951>, case 18: <D.19946>, case 20: <D.19949>, case 28: <D.19947>, case 29: <D.19950>>
  <D.19946>:
  <D.19947>:
  <D.19948>:
  <D.19949>:
  <D.19950>:
  <D.19951>:
  goto <D.19952>;
  <D.19953>:
  D.24874 = t->type;
  D.24875 = (int) D.24874;
  monoeg_g_log (0B, 16, "custom marshalling of type %x is currently not supported", D.24875);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5955);
  <D.19952>:
  D.24876 = mono_defaults.int_class;
  D.24877 = &D.24876->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.24877);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24881>; else goto <D.24882>;
  <D.24881>:
  D.24883 = t->attrs;
  D.24884 = (int) D.24883;
  D.24885 = D.24884 & 2;
  if (D.24885 != 0) goto <D.19954>; else goto <D.24886>;
  <D.24886>:
  <D.24882>:
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 == 0) goto <D.24887>; else goto <D.24888>;
  <D.24887>:
  D.24883 = t->attrs;
  D.24889 = (unsigned int) D.24883;
  D.24890 = D.24889 & 3;
  if (D.24890 == 2) goto <D.19954>; else goto <D.24891>;
  <D.24891>:
  <D.24888>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24893>; else goto <D.24894>;
  <D.24893>:
  mono_mb_emit_byte (mb, 77);
  <D.24894>:
  D.24895 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24895;
  D.24896 = spec->data.custom_data.cookie;
  D.24897 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24897);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24898>; else goto <D.24899>;
  <D.24898>:
  mono_mb_emit_byte (mb, 80);
  <D.24899>:
  D.24874 = t->type;
  if (D.24874 == 17) goto <D.24900>; else goto <D.24901>;
  <D.24900>:
  D.24876 = mono_defaults.int_class;
  D.24877 = &D.24876->byval_arg;
  *conv_arg_type = D.24877;
  D.24902 = mono_class_from_mono_type (t);
  mono_mb_emit_op (mb, 140, D.24902);
  <D.24901>:
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19955>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.24904 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24904;
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24905>; else goto <D.24906>;
  <D.24905>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24896 = spec->data.custom_data.cookie;
  D.24907 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24907);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_byte (mb, 81);
  goto <D.24908>;
  <D.24906>:
  D.24883 = t->attrs;
  D.24884 = (int) D.24883;
  D.24885 = D.24884 & 2;
  if (D.24885 != 0) goto <D.24909>; else goto <D.24910>;
  <D.24909>:
  D.24896 = spec->data.custom_data.cookie;
  D.24911 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24911);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_byte (mb, 38);
  <D.24910>:
  <D.24908>:
  D.24896 = spec->data.custom_data.cookie;
  D.24912 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24912);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  cleanup_native.186 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.186);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19956>:
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24913>; else goto <D.24914>;
  <D.24913>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  goto <D.24915>;
  <D.24914>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  <D.24915>:
  goto <D.19954>;
  <D.19957>:
  D.24876 = mono_defaults.int_class;
  D.24877 = &D.24876->byval_arg;
  D.24916 = mono_mb_add_local (mb, D.24877);
  loc1 = (guint32) D.24916;
  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.24917 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24917;
  D.24896 = spec->data.custom_data.cookie;
  D.24918 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24918);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_native.186 = cleanup_native;
  mono_mb_emit_op (mb, 111, cleanup_native.186);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19958>:
  D.24919 = mono_defaults.object_class;
  D.24920 = &D.24919->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.24920);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24921>; else goto <D.24922>;
  <D.24921>:
  D.24883 = t->attrs;
  D.24884 = (int) D.24883;
  D.24885 = D.24884 & 2;
  if (D.24885 != 0) goto <D.19954>; else goto <D.24923>;
  <D.24923>:
  <D.24922>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24924>; else goto <D.24925>;
  <D.24924>:
  mono_mb_emit_byte (mb, 77);
  <D.24925>:
  D.24926 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24926;
  D.24896 = spec->data.custom_data.cookie;
  D.24927 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24927);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24928>; else goto <D.24929>;
  <D.24928>:
  mono_mb_emit_byte (mb, 77);
  <D.24929>:
  marshal_native_to_managed.192 = marshal_native_to_managed;
  mono_mb_emit_op (mb, 111, marshal_native_to_managed.192);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19959>:
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  D.24930 = D.24880 != 0;
  D.24931 = (long int) D.24930;
  D.24932 = __builtin_expect (D.24931, 0);
  if (D.24932 != 0) goto <D.24933>; else goto <D.24934>;
  <D.24933>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6102, "!t->byref");
  <D.24934>:
  D.24919 = mono_defaults.object_class;
  D.24920 = &D.24919->byval_arg;
  D.24935 = mono_mb_add_local (mb, D.24920);
  loc1 = (guint32) D.24935;
  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.24936 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24936;
  D.24896 = spec->data.custom_data.cookie;
  D.24937 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24937);
  mono_mb_emit_op (mb, 40, get_instance);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_ldloc (mb, 3);
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, loc1);
  cleanup_managed.188 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.188);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19960>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.24938 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24938;
  D.24879 = BIT_FIELD_REF <*t, 8, 56>;
  D.24880 = D.24879 & 64;
  if (D.24880 != 0) goto <D.24939>; else goto <D.24940>;
  <D.24939>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24896 = spec->data.custom_data.cookie;
  D.24941 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24941);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  marshal_managed_to_native.190 = marshal_managed_to_native;
  mono_mb_emit_op (mb, 111, marshal_managed_to_native.190);
  mono_mb_emit_byte (mb, 223);
  <D.24940>:
  D.24896 = spec->data.custom_data.cookie;
  D.24942 = monoeg_strdup (D.24896);
  mono_mb_emit_ldstr (mb, D.24942);
  mono_mb_emit_op (mb, 40, get_instance);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  cleanup_managed.188 = cleanup_managed;
  mono_mb_emit_op (mb, 111, cleanup_managed.188);
  pos2.195 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.195);
  goto <D.19954>;
  <D.19961>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6159);
  <D.19954>:
  D.24873 = conv_arg;
  return D.24873;
}


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.24946;
  unsigned char D.24947;
  _Bool D.24948;
  long int D.24949;
  long int D.24950;
  unsigned char D.24953;
  unsigned char D.24954;
  _Bool D.24955;
  long int D.24956;
  long int D.24957;
  struct MonoClass * D.24960;
  struct MonoType * D.24961;
  unsigned int argnum.196;
  int encoding.197;
  short unsigned int D.24964;
  int D.24965;
  unsigned int conv_arg.198;
  int encoding.199;
  int D.24968;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.19978>, case 0: <D.19972>, case 1: <D.19975>, case 2: <D.19976>>
  <D.19972>:
  {
    MonoMarshalNative encoding;

    D.24946 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.24946, 0B);
    D.24947 = t->type;
    D.24948 = D.24947 != 28;
    D.24949 = (long int) D.24948;
    D.24950 = __builtin_expect (D.24949, 0);
    if (D.24950 != 0) goto <D.24951>; else goto <D.24952>;
    <D.24951>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6179, "t->type == MONO_TYPE_OBJECT");
    <D.24952>:
    D.24953 = BIT_FIELD_REF <*t, 8, 56>;
    D.24954 = D.24953 & 64;
    D.24955 = D.24954 != 0;
    D.24956 = (long int) D.24955;
    D.24957 = __builtin_expect (D.24956, 0);
    if (D.24957 != 0) goto <D.24958>; else goto <D.24959>;
    <D.24958>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6180, "!t->byref");
    <D.24959>:
    D.24960 = mono_defaults.int_class;
    D.24961 = &D.24960->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.24961);
    argnum.196 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.196);
    encoding.197 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.197);
    D.24964 = t->attrs;
    D.24965 = (int) D.24964;
    mono_mb_emit_icon (mb, D.24965);
    mono_mb_emit_icall (mb, mono_marshal_asany);
    conv_arg.198 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.198);
    goto <D.19974>;
  }
  <D.19975>:
  conv_arg.198 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.198);
  goto <D.19974>;
  <D.19976>:
  {
    MonoMarshalNative encoding;

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


mono_marshal_get_string_encoding (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  <unnamed type> D.24972;
  <unnamed type> D.24975;
  _Bool D.24976;
  _Bool D.24977;
  _Bool D.24978;
  MonoMarshalNative D.24981;
  short unsigned int D.24985;
  int D.24986;
  int D.24987;

  if (spec != 0B) goto <D.24970>; else goto <D.24971>;
  <D.24970>:
  D.24972 = spec->native;
  if (D.24972 == 42) goto <D.24973>; else goto <D.24974>;
  <D.24973>:
  D.24975 = spec->data.array_data.elem_type;
  D.24976 = D.24975 != 0;
  D.24977 = D.24975 != 80;
  D.24978 = D.24976 & D.24977;
  if (D.24978 != 0) goto <D.24979>; else goto <D.24980>;
  <D.24979>:
  D.24981 = spec->data.array_data.elem_type;
  return D.24981;
  <D.24980>:
  goto <D.24982>;
  <D.24974>:
  D.24981 = spec->native;
  return D.24981;
  <D.24982>:
  <D.24971>:
  if (piinfo == 0B) goto <D.24983>; else goto <D.24984>;
  <D.24983>:
  D.24981 = 20;
  return D.24981;
  <D.24984>:
  D.24985 = piinfo->piflags;
  D.24986 = (int) D.24985;
  D.24987 = D.24986 & 6;
  switch (D.24987) <default: <D.18937>, case 2: <D.18934>, case 4: <D.18935>, case 6: <D.18936>>
  <D.18934>:
  D.24981 = 20;
  return D.24981;
  <D.18935>:
  D.24981 = 21;
  return D.24981;
  <D.18936>:
  D.24981 = 20;
  return D.24981;
  <D.18937>:
  D.24981 = 20;
  return D.24981;
}


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.24989;
  unsigned char D.24990;
  unsigned char D.24991;
  unsigned int argnum.200;
  unsigned int conv_arg.201;
  struct _IO_FILE * stderr.202;
  int D.24997;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20082>, case 0: <D.20071>, case 1: <D.20075>, case 2: <D.20076>, case 3: <D.20077>, case 4: <D.20079>, case 5: <D.20080>, case 6: <D.20081>>
  <D.20071>:
  {
    struct MonoType * intptr_type;

    D.24989 = mono_defaults.int_class;
    intptr_type = &D.24989->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    D.24990 = BIT_FIELD_REF <*t, 8, 56>;
    D.24991 = D.24990 & 64;
    if (D.24991 != 0) goto <D.24992>; else goto <D.24993>;
    <D.24992>:
    {
      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.20074>;
    }
    <D.24993>:
    argnum.200 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.200);
    mono_mb_emit_icon (mb, 4);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 77);
    conv_arg.201 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.201);
    goto <D.20074>;
  }
  <D.20075>:
  conv_arg.201 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.201);
  goto <D.20074>;
  <D.20076>:
  goto <D.20074>;
  <D.20077>:
  {
    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.20074>;
  }
  <D.20079>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20074>;
  <D.20080>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20074>;
  <D.20081>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20074>;
  <D.20082>:
  stderr.202 = stderr;
  fprintf (stderr.202, "Unhandled case for MarshalAction: %d\n", action);
  <D.20074>:
  D.24997 = conv_arg;
  return D.24997;
}


mono_mb_emit_exception_marshal_directive (struct MonoMethodBuilder * mb, char * msg)
{
  int D.25000;
  struct MonoMethod * D.25003;
  struct MonoClass * D.25004;
  struct MonoImage * D.25005;
  char * s;

  D.25000 = mb->dynamic;
  if (D.25000 == 0) goto <D.25001>; else goto <D.25002>;
  <D.25001>:
  D.25003 = mb->method;
  D.25004 = D.25003->klass;
  D.25005 = D.25004->image;
  s = mono_image_strdup (D.25005, msg);
  monoeg_g_free (msg);
  goto <D.25006>;
  <D.25002>:
  s = monoeg_strdup (msg);
  <D.25006>:
  mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
}


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

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


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.25009;
  struct MonoClass * D.25010;
  struct MonoType * D.25011;
  unsigned char D.25012;
  unsigned char D.25013;
  short unsigned int D.25016;
  int D.25017;
  int D.25018;
  unsigned int argnum.203;
  void * D.25025;
  unsigned int conv_arg.204;
  struct MonoMethod * m.205;
  struct MonoClass * D.25034;
  struct MonoMethod * m.206;
  _Bool D.25036;
  long int D.25037;
  long int D.25038;
  _Bool D.25043;
  long int D.25044;
  long int D.25045;
  unsigned int D.25051;
  unsigned int D.25052;
  void * D.25055;
  int need_free.207;
  void * D.25068;
  struct MonoClass * D.25072;
  struct MonoType * D.25073;
  void * D.25081;
  void * D.25086;
  void * D.25087;
  void * D.25091;
  int D.25092;
  struct MonoMethodBuilder * mb;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;
  gboolean need_free;

  try
    {
      mb = m->mb;
      D.25009 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25009, spec);
      D.25009 = m->piinfo;
      conv = mono_marshal_get_string_to_ptr_conv (D.25009, spec);
      switch (action) <default: <D.20033>, case 0: <D.20019>, case 1: <D.20026>, case 2: <D.20022>, case 3: <D.20027>, case 4: <D.20029>, case 5: <D.20031>, case 6: <D.20032>>
      <D.20019>:
      D.25010 = mono_defaults.int_class;
      D.25011 = &D.25010->byval_arg;
      *conv_arg_type = D.25011;
      D.25010 = mono_defaults.int_class;
      D.25011 = &D.25010->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25011);
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25014>; else goto <D.25015>;
      <D.25014>:
      D.25016 = t->attrs;
      D.25017 = (int) D.25016;
      D.25018 = D.25017 & 2;
      if (D.25018 != 0) goto <D.20020>; else goto <D.25019>;
      <D.25019>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      mono_mb_emit_byte (mb, 77);
      goto <D.25021>;
      <D.25015>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      <D.25021>:
      if (conv == 4294967295) goto <D.25022>; else goto <D.25023>;
      <D.25022>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
      }
      goto <D.25024>;
      <D.25023>:
      D.25025 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25025);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      <D.25024>:
      goto <D.20020>;
      <D.20022>:
      D.25009 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25009, spec, &need_free);
      if (conv == 4294967295) goto <D.25027>; else goto <D.25028>;
      <D.25027>:
      {
        char * msg;

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

        m.205 = m;
        if (m.205 == 0B) goto <D.25032>; else goto <D.25033>;
        <D.25032>:
        D.25034 = mono_defaults.string_class;
        m.206 = mono_class_get_method_from_name_flags (D.25034, "get_Length", -1, 0);
        m = m.206;
        m.205 = m;
        D.25036 = m.205 == 0B;
        D.25037 = (long int) D.25036;
        D.25038 = __builtin_expect (D.25037, 0);
        if (D.25038 != 0) goto <D.25039>; else goto <D.25040>;
        <D.25039>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6559, "m");
        <D.25040>:
        <D.25033>:
        D.25012 = BIT_FIELD_REF <*t, 8, 56>;
        D.25013 = D.25012 & 64;
        if (D.25013 == 0) goto <D.25041>; else goto <D.25042>;
        <D.25041>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("VBByRefStr marshalling requires a ref parameter.", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.20020>;
        }
        <D.25042>:
        D.25012 = BIT_FIELD_REF <*t, 8, 56>;
        D.25013 = D.25012 & 64;
        D.25043 = D.25013 == 0;
        D.25044 = (long int) D.25043;
        D.25045 = __builtin_expect (D.25044, 0);
        if (D.25045 != 0) goto <D.25046>; else goto <D.25047>;
        <D.25046>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6572, "t->byref");
        <D.25047>:
        argnum.203 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.203);
        conv_arg.204 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.204);
        argnum.203 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.203);
        mono_mb_emit_byte (mb, 77);
        m.205 = m;
        mono_mb_emit_managed_call (mb, m.205, 0B);
        mono_mb_emit_icall (mb, mono_string_new_len_wrapper);
        mono_mb_emit_byte (mb, 81);
      }
      goto <D.25048>;
      <D.25030>:
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25049>; else goto <D.25050>;
      <D.25049>:
      D.25016 = t->attrs;
      D.25051 = (unsigned int) D.25016;
      D.25052 = D.25051 & 3;
      if (D.25052 != 1) goto <D.25053>; else goto <D.25054>;
      <D.25053>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      D.25055 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25055);
      mono_mb_emit_byte (mb, 81);
      need_free = 1;
      <D.25054>:
      <D.25050>:
      <D.25048>:
      need_free.207 = need_free;
      if (need_free.207 != 0) goto <D.25057>; else goto <D.25058>;
      <D.25057>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      if (conv == 32) goto <D.25059>; else goto <D.25060>;
      <D.25059>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25061>;
      <D.25060>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25061>:
      <D.25058>:
      goto <D.20020>;
      <D.20026>:
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25064>; else goto <D.25062>;
      <D.25064>:
      if (encoding != 34) goto <D.25065>; else goto <D.25062>;
      <D.25065>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.204);
      goto <D.25063>;
      <D.25062>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      <D.25063>:
      goto <D.20020>;
      <D.20027>:
      mono_mb_emit_stloc (mb, 0);
      D.25009 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25009, spec, &need_free);
      if (conv == 4294967295) goto <D.25066>; else goto <D.25067>;
      <D.25066>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20020>;
      }
      <D.25067>:
      mono_mb_emit_ldloc (mb, 0);
      D.25068 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25068);
      mono_mb_emit_stloc (mb, 3);
      mono_mb_emit_ldloc (mb, 0);
      if (conv == 32) goto <D.25069>; else goto <D.25070>;
      <D.25069>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25071>;
      <D.25070>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25071>:
      goto <D.20020>;
      <D.20029>:
      D.25072 = mono_defaults.object_class;
      D.25073 = &D.25072->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25073);
      D.25010 = mono_defaults.int_class;
      D.25011 = &D.25010->byval_arg;
      *conv_arg_type = D.25011;
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25074>; else goto <D.25075>;
      <D.25074>:
      D.25016 = t->attrs;
      D.25017 = (int) D.25016;
      D.25018 = D.25017 & 2;
      if (D.25018 != 0) goto <D.20020>; else goto <D.25076>;
      <D.25076>:
      <D.25075>:
      D.25009 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.25009, spec, &need_free);
      if (conv == 4294967295) goto <D.25077>; else goto <D.25078>;
      <D.25077>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20020>;
      }
      <D.25078>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25079>; else goto <D.25080>;
      <D.25079>:
      mono_mb_emit_byte (mb, 77);
      <D.25080>:
      D.25081 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25081);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      goto <D.20020>;
      <D.20031>:
      D.25012 = BIT_FIELD_REF <*t, 8, 56>;
      D.25013 = D.25012 & 64;
      if (D.25013 != 0) goto <D.25082>; else goto <D.25083>;
      <D.25082>:
      if (conv_arg != 0) goto <D.25084>; else goto <D.25085>;
      <D.25084>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      D.25086 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25086);
      mono_mb_emit_byte (mb, 223);
      <D.25085>:
      <D.25083>:
      goto <D.20020>;
      <D.20032>:
      D.25087 = conv_to_icall (conv);
      if (D.25087 == mono_marshal_string_to_utf16) goto <D.25088>; else goto <D.25089>;
      <D.25088>:
      mono_mb_emit_icall (mb, mono_marshal_string_to_utf16_copy);
      goto <D.25090>;
      <D.25089>:
      D.25091 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25091);
      <D.25090>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20020>;
      <D.20033>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6671);
      <D.20020>:
      D.25092 = conv_arg;
      return D.25092;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.18948>, case 19: <D.18947>, case 20: <D.18944>, case 21: <D.18943>, case 22: <D.18946>, case 34: <D.18945>>
  <D.18943>:
  D.25095 = 7;
  return D.25095;
  <D.18944>:
  <D.18945>:
  D.25095 = 4;
  return D.25095;
  <D.18946>:
  D.25095 = 9;
  return D.25095;
  <D.18947>:
  D.25095 = 3;
  return D.25095;
  <D.18948>:
  D.25095 = 4294967295;
  return D.25095;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.18969>, case 19: <D.18968>, case 20: <D.18965>, case 21: <D.18964>, case 22: <D.18967>, case 34: <D.18966>>
  <D.18964>:
  *need_free = 0;
  D.25097 = 8;
  return D.25097;
  <D.18965>:
  <D.18966>:
  D.25097 = 5;
  return D.25097;
  <D.18967>:
  D.25097 = 6;
  return D.25097;
  <D.18968>:
  D.25097 = 32;
  return D.25097;
  <D.18969>:
  D.25097 = 4294967295;
  return D.25097;
}


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

  switch (conv) <default: <D.18773>, case 3: <D.18755>, case 4: <D.18754>, case 5: <D.18752>, case 6: <D.18751>, case 7: <D.18749>, case 8: <D.18750>, case 9: <D.18753>, case 10: <D.18758>, case 11: <D.18757>, case 12: <D.18771>, case 13: <D.18772>, case 14: <D.18759>, case 15: <D.18760>, case 16: <D.18761>, case 17: <D.18767>, case 18: <D.18768>, case 19: <D.18769>, case 22: <D.18762>, case 23: <D.18763>, case 24: <D.18764>, case 29: <D.18765>, case 30: <D.18766>, case 31: <D.18770>, case 32: <D.18756>>
  <D.18749>:
  D.25099 = mono_marshal_string_to_utf16;
  return D.25099;
  <D.18750>:
  D.25099 = mono_string_from_utf16;
  return D.25099;
  <D.18751>:
  D.25099 = mono_string_new_wrapper;
  return D.25099;
  <D.18752>:
  D.25099 = mono_string_new_wrapper;
  return D.25099;
  <D.18753>:
  D.25099 = mono_string_to_lpstr;
  return D.25099;
  <D.18754>:
  D.25099 = mono_string_to_lpstr;
  return D.25099;
  <D.18755>:
  D.25099 = mono_string_to_bstr;
  return D.25099;
  <D.18756>:
  D.25099 = mono_string_from_bstr;
  return D.25099;
  <D.18757>:
  <D.18758>:
  D.25099 = mono_string_to_ansibstr;
  return D.25099;
  <D.18759>:
  D.25099 = mono_string_builder_to_utf8;
  return D.25099;
  <D.18760>:
  D.25099 = mono_string_builder_to_utf8;
  return D.25099;
  <D.18761>:
  D.25099 = mono_string_builder_to_utf16;
  return D.25099;
  <D.18762>:
  D.25099 = mono_array_to_savearray;
  return D.25099;
  <D.18763>:
  D.25099 = mono_array_to_lparray;
  return D.25099;
  <D.18764>:
  D.25099 = mono_free_lparray;
  return D.25099;
  <D.18765>:
  D.25099 = mono_delegate_to_ftnptr;
  return D.25099;
  <D.18766>:
  D.25099 = mono_ftnptr_to_delegate;
  return D.25099;
  <D.18767>:
  D.25099 = mono_string_utf8_to_builder;
  return D.25099;
  <D.18768>:
  D.25099 = mono_string_utf8_to_builder;
  return D.25099;
  <D.18769>:
  D.25099 = mono_string_utf16_to_builder;
  return D.25099;
  <D.18770>:
  D.25099 = mono_marshal_free_array;
  return D.25099;
  <D.18771>:
  D.25099 = mono_string_to_byvalstr;
  return D.25099;
  <D.18772>:
  D.25099 = mono_string_to_byvalwstr;
  return D.25099;
  <D.18773>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1582);
  D.25099 = 0B;
  return D.25099;
}


emit_marshal_variant (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoMethod * get_object_for_native_variant.208;
  struct MonoClass * D.25104;
  struct MonoMethod * get_object_for_native_variant.209;
  _Bool D.25106;
  long int D.25107;
  long int D.25108;
  struct MonoMethod * get_native_variant_for_object.210;
  struct MonoMethod * get_native_variant_for_object.211;
  _Bool D.25115;
  long int D.25116;
  long int D.25117;
  struct MonoClass * D.25120;
  struct MonoType * D.25121;
  unsigned char D.25122;
  unsigned char D.25123;
  struct MonoClass * D.25126;
  struct MonoType * D.25127;
  struct MonoClass * D.25129;
  struct MonoType * D.25130;
  short unsigned int D.25133;
  unsigned int D.25134;
  unsigned int D.25135;
  unsigned int argnum.212;
  unsigned int conv_arg.213;
  struct MonoMethod * variant_clear.214;
  struct MonoClass * D.25144;
  struct MonoMethod * variant_clear.215;
  _Bool D.25146;
  long int D.25147;
  long int D.25148;
  struct MonoClass * D.25158;
  struct MonoType * D.25159;
  struct MonoClass * D.25162;
  struct MonoType * D.25163;
  struct MonoClass * D.25165;
  struct MonoType * D.25166;
  int D.25177;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * get_object_for_native_variant = 0B;
  static struct MonoMethod * get_native_variant_for_object = 0B;

  mb = m->mb;
  get_object_for_native_variant.208 = get_object_for_native_variant;
  if (get_object_for_native_variant.208 == 0B) goto <D.25102>; else goto <D.25103>;
  <D.25102>:
  D.25104 = mono_defaults.marshal_class;
  get_object_for_native_variant.209 = mono_class_get_method_from_name (D.25104, "GetObjectForNativeVariant", 1);
  get_object_for_native_variant = get_object_for_native_variant.209;
  <D.25103>:
  get_object_for_native_variant.208 = get_object_for_native_variant;
  D.25106 = get_object_for_native_variant.208 == 0B;
  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", 7411, "get_object_for_native_variant");
  <D.25110>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  if (get_native_variant_for_object.210 == 0B) goto <D.25112>; else goto <D.25113>;
  <D.25112>:
  D.25104 = mono_defaults.marshal_class;
  get_native_variant_for_object.211 = mono_class_get_method_from_name (D.25104, "GetNativeVariantForObject", 2);
  get_native_variant_for_object = get_native_variant_for_object.211;
  <D.25113>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  D.25115 = get_native_variant_for_object.210 == 0B;
  D.25116 = (long int) D.25115;
  D.25117 = __builtin_expect (D.25116, 0);
  if (D.25117 != 0) goto <D.25118>; else goto <D.25119>;
  <D.25118>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7415, "get_native_variant_for_object");
  <D.25119>:
  switch (action) <default: <D.20143>, case 0: <D.20132>, case 1: <D.20136>, case 2: <D.20134>, case 3: <D.20137>, case 4: <D.20139>, case 5: <D.20140>, case 6: <D.20141>>
  <D.20132>:
  D.25120 = mono_class_get_variant_class ();
  D.25121 = &D.25120->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25121);
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25124>; else goto <D.25125>;
  <D.25124>:
  D.25126 = mono_class_get_variant_class ();
  D.25127 = &D.25126->this_arg;
  *conv_arg_type = D.25127;
  goto <D.25128>;
  <D.25125>:
  D.25129 = mono_class_get_variant_class ();
  D.25130 = &D.25129->byval_arg;
  *conv_arg_type = D.25130;
  <D.25128>:
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25131>; else goto <D.25132>;
  <D.25131>:
  D.25133 = t->attrs;
  D.25134 = (unsigned int) D.25133;
  D.25135 = D.25134 & 3;
  if (D.25135 == 2) goto <D.20133>; else goto <D.25136>;
  <D.25136>:
  <D.25132>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25138>; else goto <D.25139>;
  <D.25138>:
  mono_mb_emit_byte (mb, 80);
  <D.25139>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.213);
  get_native_variant_for_object.210 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.210, 0B);
  goto <D.20133>;
  <D.20134>:
  {
    static struct MonoMethod * variant_clear = 0B;

    variant_clear.214 = variant_clear;
    if (variant_clear.214 == 0B) goto <D.25142>; else goto <D.25143>;
    <D.25142>:
    D.25144 = mono_class_get_variant_class ();
    variant_clear.215 = mono_class_get_method_from_name (D.25144, "Clear", 0);
    variant_clear = variant_clear.215;
    <D.25143>:
    variant_clear.214 = variant_clear;
    D.25146 = variant_clear.214 == 0B;
    D.25147 = (long int) D.25146;
    D.25148 = __builtin_expect (D.25147, 0);
    if (D.25148 != 0) goto <D.25149>; else goto <D.25150>;
    <D.25149>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7442, "variant_clear");
    <D.25150>:
    D.25122 = BIT_FIELD_REF <*t, 8, 56>;
    D.25123 = D.25122 & 64;
    if (D.25123 != 0) goto <D.25151>; else goto <D.25152>;
    <D.25151>:
    D.25133 = t->attrs;
    D.25134 = (unsigned int) D.25133;
    D.25135 = D.25134 & 3;
    if (D.25135 != 1) goto <D.25153>; else goto <D.25154>;
    <D.25153>:
    argnum.212 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.212);
    conv_arg.213 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.213);
    get_object_for_native_variant.208 = get_object_for_native_variant;
    mono_mb_emit_managed_call (mb, get_object_for_native_variant.208, 0B);
    mono_mb_emit_byte (mb, 81);
    <D.25154>:
    <D.25152>:
    conv_arg.213 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc_addr (mb, conv_arg.213);
    variant_clear.214 = variant_clear;
    mono_mb_emit_managed_call (mb, variant_clear.214, 0B);
    goto <D.20133>;
  }
  <D.20136>:
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25155>; else goto <D.25156>;
  <D.25155>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.213);
  goto <D.25157>;
  <D.25156>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.213);
  <D.25157>:
  goto <D.20133>;
  <D.20137>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20133>;
  }
  <D.20139>:
  D.25158 = mono_defaults.object_class;
  D.25159 = &D.25158->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25159);
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25160>; else goto <D.25161>;
  <D.25160>:
  D.25162 = mono_class_get_variant_class ();
  D.25163 = &D.25162->this_arg;
  *conv_arg_type = D.25163;
  goto <D.25164>;
  <D.25161>:
  D.25165 = mono_class_get_variant_class ();
  D.25166 = &D.25165->byval_arg;
  *conv_arg_type = D.25166;
  <D.25164>:
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25167>; else goto <D.25168>;
  <D.25167>:
  D.25133 = t->attrs;
  D.25134 = (unsigned int) D.25133;
  D.25135 = D.25134 & 3;
  if (D.25135 == 2) goto <D.20133>; else goto <D.25169>;
  <D.25169>:
  <D.25168>:
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25170>; else goto <D.25171>;
  <D.25170>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  goto <D.25172>;
  <D.25171>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.212);
  <D.25172>:
  get_object_for_native_variant.208 = get_object_for_native_variant;
  mono_mb_emit_managed_call (mb, get_object_for_native_variant.208, 0B);
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.213);
  goto <D.20133>;
  <D.20140>:
  D.25122 = BIT_FIELD_REF <*t, 8, 56>;
  D.25123 = D.25122 & 64;
  if (D.25123 != 0) goto <D.25173>; else goto <D.25174>;
  <D.25173>:
  D.25133 = t->attrs;
  D.25134 = (unsigned int) D.25133;
  D.25135 = D.25134 & 3;
  if (D.25135 != 1) goto <D.25175>; else goto <D.25176>;
  <D.25175>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.213);
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  get_native_variant_for_object.210 = get_native_variant_for_object;
  mono_mb_emit_managed_call (mb, get_native_variant_for_object.210, 0B);
  <D.25176>:
  <D.25174>:
  goto <D.20133>;
  <D.20141>:
  {
    char * msg;

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


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.25179;
  struct MonoMethod * sh_dangerous_add_ref.216;
  unsigned int argnum.217;
  unsigned int D.25184;
  unsigned int pos.218;
  unsigned char D.25186;
  unsigned char D.25187;
  unsigned int conv_arg.219;
  struct MonoClass * D.25191;
  struct MonoType * D.25192;
  unsigned int dar_release_slot.220;
  struct MonoMethod * sh_dangerous_release.221;
  struct MonoClass * D.25202;
  unsigned int dar_release_slot.222;
  unsigned int D.25207;
  unsigned int label_next.223;
  unsigned int D.25209;
  unsigned int D.25210;
  gchar * D.25213;
  struct MonoType * D.25216;
  unsigned int intptr_handle_slot.224;
  struct _IO_FILE * stderr.225;
  int D.25219;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20060>, case 0: <D.20044>, case 1: <D.20049>, case 2: <D.20050>, case 3: <D.20054>, case 4: <D.20057>, case 5: <D.20058>, case 6: <D.20059>>
  <D.20044>:
  {
    struct MonoType * intptr_type;
    int dar_release_slot;
    int pos;

    D.25179 = mono_defaults.int_class;
    intptr_type = &D.25179->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    sh_dangerous_add_ref.216 = sh_dangerous_add_ref;
    if (sh_dangerous_add_ref.216 == 0B) goto <D.25181>; else goto <D.25182>;
    <D.25181>:
    init_safe_handle ();
    <D.25182>:
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    D.25184 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.25184;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.218 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.218);
    D.25186 = BIT_FIELD_REF <*t, 8, 56>;
    D.25187 = D.25186 & 64;
    if (D.25187 != 0) goto <D.25188>; else goto <D.25189>;
    <D.25188>:
    mono_mb_emit_icon (mb, 0);
    conv_arg.219 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.219);
    goto <D.20048>;
    <D.25189>:
    D.25191 = mono_defaults.boolean_class;
    D.25192 = &D.25191->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.25192);
    mono_mb_emit_icon (mb, 0);
    dar_release_slot.220 = (unsigned int) dar_release_slot;
    mono_mb_emit_stloc (mb, dar_release_slot.220);
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    dar_release_slot.220 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc_addr (mb, dar_release_slot.220);
    sh_dangerous_add_ref.216 = sh_dangerous_add_ref;
    mono_mb_emit_managed_call (mb, sh_dangerous_add_ref.216, 0B);
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    mono_mb_emit_ldflda (mb, 8);
    mono_mb_emit_byte (mb, 77);
    conv_arg.219 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.219);
    goto <D.20048>;
  }
  <D.20049>:
  D.25186 = BIT_FIELD_REF <*t, 8, 56>;
  D.25187 = D.25186 & 64;
  if (D.25187 != 0) goto <D.25194>; else goto <D.25195>;
  <D.25194>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.219);
  goto <D.25196>;
  <D.25195>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.219);
  <D.25196>:
  goto <D.20048>;
  <D.20050>:
  {
    int dar_release_slot;
    int label_next;

    dar_release_slot = conv_arg + 1;
    sh_dangerous_release.221 = sh_dangerous_release;
    if (sh_dangerous_release.221 == 0B) goto <D.25198>; else goto <D.25199>;
    <D.25198>:
    init_safe_handle ();
    <D.25199>:
    D.25186 = BIT_FIELD_REF <*t, 8, 56>;
    D.25187 = D.25186 & 64;
    if (D.25187 != 0) goto <D.25200>; else goto <D.25201>;
    <D.25200>:
    {
      struct MonoMethod * ctor;

      D.25202 = t->data.klass;
      ctor = mono_class_get_method_from_name (D.25202, ".ctor", 0);
      if (ctor == 0B) goto <D.25203>; else goto <D.25204>;
      <D.25203>:
      mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
      goto <D.20048>;
      <D.25204>:
      argnum.217 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.217);
      mono_mb_emit_op (mb, 115, ctor);
      mono_mb_emit_byte (mb, 81);
      argnum.217 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.217);
      mono_mb_emit_byte (mb, 80);
      mono_mb_emit_ldflda (mb, 8);
      conv_arg.219 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.219);
      mono_mb_emit_byte (mb, 223);
    }
    goto <D.25205>;
    <D.25201>:
    dar_release_slot.222 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc (mb, dar_release_slot.222);
    D.25207 = mono_mb_emit_branch (mb, 57);
    label_next = (int) D.25207;
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    sh_dangerous_release.221 = sh_dangerous_release;
    mono_mb_emit_managed_call (mb, sh_dangerous_release.221, 0B);
    label_next.223 = (unsigned int) label_next;
    mono_mb_patch_branch (mb, label_next.223);
    <D.25205>:
    goto <D.20048>;
  }
  <D.20054>:
  {
    struct MonoMethod * ctor;
    int intptr_handle_slot;

    ctor = 0B;
    D.25202 = t->data.klass;
    D.25209 = D.25202->flags;
    D.25210 = D.25209 & 128;
    if (D.25210 != 0) goto <D.25211>; else goto <D.25212>;
    <D.25211>:
    mono_mb_emit_byte (mb, 38);
    D.25213 = monoeg_strdup ("Returned SafeHandles should not be abstract");
    mono_mb_emit_exception_marshal_directive (mb, D.25213);
    goto <D.20048>;
    <D.25212>:
    D.25202 = t->data.klass;
    ctor = mono_class_get_method_from_name (D.25202, ".ctor", 0);
    if (ctor == 0B) goto <D.25214>; else goto <D.25215>;
    <D.25214>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
    goto <D.20048>;
    <D.25215>:
    D.25179 = mono_defaults.int_class;
    D.25216 = &D.25179->byval_arg;
    intptr_handle_slot = mono_mb_add_local (mb, D.25216);
    intptr_handle_slot.224 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_stloc (mb, intptr_handle_slot.224);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_stloc (mb, 3);
    mono_mb_emit_ldloc (mb, 3);
    mono_mb_emit_ldflda (mb, 8);
    intptr_handle_slot.224 = (unsigned int) intptr_handle_slot;
    mono_mb_emit_ldloc (mb, intptr_handle_slot.224);
    mono_mb_emit_byte (mb, 223);
    goto <D.20048>;
  }
  <D.20057>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20048>;
  <D.20058>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20048>;
  <D.20059>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20048>;
  <D.20060>:
  printf ("Unhandled case for MarshalAction: %d\n", action);
  <D.20048>:
  D.25219 = conv_arg;
  return D.25219;
}


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

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


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

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


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.25226;
  struct MonoClass * D.25227;
  struct MonoType * D.25228;
  struct MonoClass * D.25229;
  unsigned char D.25230;
  unsigned char D.25231;
  unsigned int argnum.228;
  unsigned char D.25235;
  unsigned char D.25236;
  void * D.25239;
  unsigned int conv_arg.229;
  struct MonoClass * D.25242;
  struct MonoType * D.25243;
  struct MonoClass * D.25244;
  struct MonoClass * D.25248;
  _Bool D.25252;
  _Bool D.25253;
  _Bool D.25254;
  unsigned int src_var.230;
  struct MonoClass * D.25263;
  int iftmp.231;
  int D.25267;
  unsigned int dest_ptr.232;
  unsigned int index_var.233;
  int D.25276;
  void * D.25279;
  MonoMarshalNative iftmp.234;
  short unsigned int D.25285;
  int D.25286;
  short unsigned int D.25287;
  int D.25288;
  int iftmp.235;
  short unsigned int D.25298;
  int D.25299;
  int D.25300;
  struct MonoType * D.25301;
  int need_free.236;
  int need_free.237;
  int D.25304;
  int iftmp.238;
  int D.25314;
  unsigned int src_ptr.239;
  unsigned int index_var.240;
  int D.25323;
  _Bool D.25328;
  long int D.25329;
  long int D.25330;
  void * D.25335;
  MonoMarshalNative iftmp.241;
  unsigned int loc.242;
  short unsigned int D.25355;
  int D.25356;
  short unsigned int D.25357;
  int D.25358;
  void * D.25361;
  int D.25367;
  <unnamed type> D.25370;
  short int D.25373;
  short int D.25374;
  struct MonoMethodSignature * D.25392;
  short unsigned int D.25393;
  int D.25394;
  struct MonoType * D.25397;
  unsigned char D.25398;
  int D.25399;
  unsigned int src_ptr.243;
  unsigned int param_num.244;
  unsigned char D.25407;
  unsigned char D.25408;
  unsigned int index_var.245;
  int D.25412;
  _Bool D.25415;
  long int D.25416;
  long int D.25417;
  void * D.25420;
  short unsigned int D.25422;
  int D.25423;
  short unsigned int D.25424;
  int D.25425;
  _Bool D.25427;
  long int D.25428;
  long int D.25429;
  _Bool D.25432;
  long int D.25433;
  long int D.25434;
  _Bool D.25437;
  long int D.25438;
  long int D.25439;
  unsigned int dest_ptr.246;
  unsigned char D.25458;
  unsigned char D.25459;
  unsigned int index_var.247;
  int D.25463;
  _Bool D.25466;
  long int D.25467;
  long int D.25468;
  void * D.25471;
  short unsigned int D.25473;
  int D.25474;
  short unsigned int D.25475;
  int D.25476;
  int iftmp.248;
  int D.25488;
  unsigned int src.249;
  unsigned int dest.250;
  unsigned int index_var.251;
  int D.25498;
  _Bool D.25501;
  long int D.25502;
  long int D.25503;
  void * D.25506;
  short unsigned int D.25508;
  int D.25509;
  short unsigned int D.25510;
  int D.25511;
  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.25226 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25226, spec);
      switch (action) <default: <D.20249>, case 0: <D.20165>, case 1: <D.20189>, case 2: <D.20178>, case 3: <D.20190>, case 4: <D.20191>, case 5: <D.20223>, case 6: <D.20237>>
      <D.20165>:
      D.25227 = mono_defaults.object_class;
      D.25228 = &D.25227->byval_arg;
      *conv_arg_type = D.25228;
      D.25227 = mono_defaults.object_class;
      D.25228 = &D.25227->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25228);
      D.25229 = klass->element_class;
      D.25230 = BIT_FIELD_REF <*D.25229, 8, 160>;
      D.25231 = D.25230 & 32;
      if (D.25231 != 0) goto <D.25232>; else goto <D.25233>;
      <D.25232>:
      argnum.228 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.228);
      D.25235 = BIT_FIELD_REF <*t, 8, 56>;
      D.25236 = D.25235 & 64;
      if (D.25236 != 0) goto <D.25237>; else goto <D.25238>;
      <D.25237>:
      mono_mb_emit_byte (mb, 77);
      <D.25238>:
      D.25239 = conv_to_icall (23);
      mono_mb_emit_icall (mb, D.25239);
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.229);
      goto <D.25241>;
      <D.25233>:
      {
        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.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25243);
        eklass = klass->element_class;
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25245>; else goto <D.25246>;
        <D.25245>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25226, spec);
        goto <D.25247>;
        <D.25246>:
        D.25248 = mono_defaults.stringbuilder_class;
        if (D.25248 == eklass) goto <D.25249>; else goto <D.25250>;
        <D.25249>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25226, spec);
        goto <D.25251>;
        <D.25250>:
        conv = 4294967295;
        <D.25251>:
        <D.25247>:
        D.25252 = is_string != 0;
        D.25253 = conv == 4294967295;
        D.25254 = D.25252 & D.25253;
        if (D.25254 != 0) goto <D.25255>; else goto <D.25256>;
        <D.25255>:
        {
          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.20177>;
        }
        <D.25256>:
        D.25227 = mono_defaults.object_class;
        D.25228 = &D.25227->byval_arg;
        src_var = mono_mb_add_local (mb, D.25228);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        if (D.25236 != 0) goto <D.25257>; else goto <D.25258>;
        <D.25257>:
        mono_mb_emit_byte (mb, 77);
        <D.25258>:
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_stloc (mb, src_var.230);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        label1 = mono_mb_emit_branch (mb, 57);
        if (is_string != 0) goto <D.25260>; else goto <D.25261>;
        <D.25260>:
        esize = 4;
        goto <D.25262>;
        <D.25261>:
        D.25263 = mono_defaults.char_class;
        if (D.25263 == eklass) goto <D.25264>; else goto <D.25265>;
        <D.25264>:
        D.25226 = m->piinfo;
        D.25267 = mono_pinvoke_is_unicode (D.25226);
        if (D.25267 != 0) goto <D.25268>; else goto <D.25269>;
        <D.25268>:
        iftmp.231 = 2;
        goto <D.25270>;
        <D.25269>:
        iftmp.231 = 1;
        <D.25270>:
        esize = iftmp.231;
        goto <D.25271>;
        <D.25265>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25271>:
        <D.25262>:
        mono_mb_emit_icon (mb, esize);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        mono_mb_emit_byte (mb, 142);
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25272>; else goto <D.25273>;
        <D.25272>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25273>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 15);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.232);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        index_var = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 22);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.233);
        D.25276 = mono_mb_get_label (mb);
        label2 = (guint32) D.25276;
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25277>; else goto <D.25278>;
        <D.25277>:
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        mono_mb_emit_byte (mb, 154);
        D.25279 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25279);
        mono_mb_emit_byte (mb, 223);
        goto <D.25280>;
        <D.25278>:
        src_var.230 = (unsigned int) src_var;
        mono_mb_emit_ldloc (mb, src_var.230);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.233);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 0);
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        mono_mb_emit_stloc (mb, 1);
        D.25263 = mono_defaults.char_class;
        if (D.25263 == eklass) goto <D.25282>; else goto <D.25283>;
        <D.25282>:
        iftmp.234 = encoding;
        goto <D.25284>;
        <D.25283>:
        iftmp.234 = 4294967295;
        <D.25284>:
        emit_struct_conv_full (mb, eklass, 0, iftmp.234);
        <D.25280>:
        D.25285 = (short unsigned int) index_var;
        D.25286 = (int) D.25285;
        mono_mb_emit_add_to_local (mb, D.25286, 1);
        D.25287 = (short unsigned int) dest_ptr;
        D.25288 = (int) D.25287;
        mono_mb_emit_add_to_local (mb, D.25288, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25289>; else goto <D.25290>;
        <D.25289>:
        dest_ptr.232 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.232);
        mono_mb_emit_byte (mb, 22);
        mono_mb_emit_byte (mb, 81);
        <D.25290>:
        mono_mb_patch_branch (mb, label1);
      }
      <D.25241>:
      goto <D.20177>;
      <D.20178>:
      D.25229 = klass->element_class;
      D.25263 = mono_defaults.char_class;
      if (D.25229 == D.25263) goto <D.25296>; else goto <D.25292>;
      <D.25296>:
      if (encoding == 21) goto <D.25293>; else goto <D.25292>;
      <D.25292>:
      D.25229 = klass->element_class;
      D.25248 = mono_defaults.stringbuilder_class;
      if (D.25229 == D.25248) goto <D.25293>; else goto <D.25297>;
      <D.25297>:
      D.25298 = t->attrs;
      D.25299 = (int) D.25298;
      D.25300 = D.25299 & 2;
      if (D.25300 != 0) goto <D.25293>; else goto <D.25294>;
      <D.25293>:
      iftmp.235 = 1;
      goto <D.25295>;
      <D.25294>:
      iftmp.235 = 0;
      <D.25295>:
      need_convert = iftmp.235;
      D.25226 = m->piinfo;
      D.25229 = klass->element_class;
      D.25301 = &D.25229->byval_arg;
      need_free.236 = mono_marshal_need_free (D.25301, D.25226, spec);
      need_free = need_free.236;
      need_free.237 = need_free;
      D.25304 = need_convert | need_free.237;
      if (D.25304 != 0) goto <D.25305>; else goto <D.25306>;
      <D.25305>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;

        eklass = klass->element_class;
        D.25248 = mono_defaults.stringbuilder_class;
        if (D.25248 == eklass) goto <D.25307>; else goto <D.25310>;
        <D.25310>:
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25307>; else goto <D.25308>;
        <D.25307>:
        esize = 4;
        goto <D.25309>;
        <D.25308>:
        D.25263 = mono_defaults.char_class;
        if (D.25263 == eklass) goto <D.25311>; else goto <D.25312>;
        <D.25311>:
        D.25226 = m->piinfo;
        D.25314 = mono_pinvoke_is_unicode (D.25226);
        if (D.25314 != 0) goto <D.25315>; else goto <D.25316>;
        <D.25315>:
        iftmp.238 = 2;
        goto <D.25317>;
        <D.25316>:
        iftmp.238 = 1;
        <D.25317>:
        esize = iftmp.238;
        goto <D.25318>;
        <D.25312>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25318>:
        <D.25309>:
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25243);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        loc = mono_mb_add_local (mb, D.25243);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        if (D.25236 != 0) goto <D.25319>; else goto <D.25320>;
        <D.25319>:
        mono_mb_emit_byte (mb, 77);
        <D.25320>:
        label1 = mono_mb_emit_branch (mb, 57);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.239);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        index_var = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 22);
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.240);
        D.25323 = mono_mb_get_label (mb);
        label2 = (guint32) D.25323;
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.240);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        if (D.25236 != 0) goto <D.25324>; else goto <D.25325>;
        <D.25324>:
        mono_mb_emit_byte (mb, 80);
        <D.25325>:
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        D.25248 = mono_defaults.stringbuilder_class;
        if (D.25248 == eklass) goto <D.25326>; else goto <D.25327>;
        <D.25326>:
        {
          gboolean need_free2;
          MonoMarshalConv conv;

          try
            {
              D.25226 = m->piinfo;
              conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25226, spec, &need_free2);
              D.25328 = conv == 4294967295;
              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", 7735, "conv != -1");
              <D.25332>:
              argnum.228 = (unsigned int) argnum;
              mono_mb_emit_ldarg (mb, argnum.228);
              D.25235 = BIT_FIELD_REF <*t, 8, 56>;
              D.25236 = D.25235 & 64;
              if (D.25236 != 0) goto <D.25333>; else goto <D.25334>;
              <D.25333>:
              mono_mb_emit_byte (mb, 77);
              <D.25334>:
              index_var.240 = (unsigned int) index_var;
              mono_mb_emit_ldloc (mb, index_var.240);
              mono_mb_emit_byte (mb, 154);
              src_ptr.239 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.239);
              mono_mb_emit_byte (mb, 77);
              D.25335 = conv_to_icall (conv);
              mono_mb_emit_icall (mb, D.25335);
              need_free.237 = need_free;
              if (need_free.237 != 0) goto <D.25336>; else goto <D.25337>;
              <D.25336>:
              src_ptr.239 = (unsigned int) src_ptr;
              mono_mb_emit_ldloc (mb, src_ptr.239);
              mono_mb_emit_byte (mb, 77);
              mono_mb_emit_icall (mb, mono_marshal_free);
              <D.25337>:
            }
          finally
            {
              need_free2 = {CLOBBER};
            }
        }
        goto <D.25338>;
        <D.25327>:
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25339>; else goto <D.25340>;
        <D.25339>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.25341>; else goto <D.25342>;
        <D.25341>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        mono_mb_emit_byte (mb, 77);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.25342>:
        goto <D.25343>;
        <D.25340>:
        if (need_convert != 0) goto <D.25344>; else goto <D.25345>;
        <D.25344>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        mono_mb_emit_stloc (mb, 0);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        if (D.25236 != 0) goto <D.25346>; else goto <D.25347>;
        <D.25346>:
        mono_mb_emit_byte (mb, 80);
        <D.25347>:
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.240);
        mono_mb_emit_op (mb, 143, eklass);
        mono_mb_emit_stloc (mb, 1);
        D.25263 = mono_defaults.char_class;
        if (D.25263 == eklass) goto <D.25349>; else goto <D.25350>;
        <D.25349>:
        iftmp.241 = encoding;
        goto <D.25351>;
        <D.25350>:
        iftmp.241 = 4294967295;
        <D.25351>:
        emit_struct_conv_full (mb, eklass, 1, iftmp.241);
        <D.25345>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.25352>; else goto <D.25353>;
        <D.25352>:
        src_ptr.239 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.239);
        loc.242 = (unsigned int) loc;
        mono_mb_emit_stloc (mb, loc.242);
        loc.242 = (unsigned int) loc;
        mono_mb_emit_ldloc (mb, loc.242);
        emit_struct_free (mb, eklass, loc);
        <D.25353>:
        <D.25343>:
        <D.25338>:
        D.25355 = (short unsigned int) index_var;
        D.25356 = (int) D.25355;
        mono_mb_emit_add_to_local (mb, D.25356, 1);
        D.25357 = (short unsigned int) src_ptr;
        D.25358 = (int) D.25357;
        mono_mb_emit_add_to_local (mb, D.25358, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
      }
      <D.25306>:
      D.25229 = klass->element_class;
      D.25230 = BIT_FIELD_REF <*D.25229, 8, 160>;
      D.25231 = D.25230 & 32;
      if (D.25231 != 0) goto <D.25359>; else goto <D.25360>;
      <D.25359>:
      argnum.228 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.228);
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.229);
      D.25361 = conv_to_icall (24);
      mono_mb_emit_icall (mb, D.25361);
      <D.25360>:
      goto <D.20177>;
      <D.20189>:
      D.25235 = BIT_FIELD_REF <*t, 8, 56>;
      D.25236 = D.25235 & 64;
      if (D.25236 != 0) goto <D.25362>; else goto <D.25363>;
      <D.25362>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.229);
      goto <D.25364>;
      <D.25363>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.229);
      <D.25364>:
      goto <D.20177>;
      <D.20190>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20177>;
      <D.20191>:
      {
        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.25227 = mono_defaults.object_class;
        D.25228 = &D.25227->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.25228);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        *conv_arg_type = D.25243;
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        if (D.25236 != 0) goto <D.25365>; else goto <D.25366>;
        <D.25365>:
        {
          char * msg;

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

          msg = monoeg_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25367 = conv_arg;
          return D.25367;
        }
        <D.25369>:
        D.25370 = spec->native;
        if (D.25370 != 42) goto <D.25371>; else goto <D.25372>;
        <D.25371>:
        {
          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.25367 = conv_arg;
          return D.25367;
        }
        <D.25372>:
        D.25373 = spec->data.array_data.param_num;
        param_num = (int) D.25373;
        num_elem = spec->data.array_data.num_elem;
        D.25374 = spec->data.array_data.elem_mult;
        if (D.25374 == 0) goto <D.25375>; else goto <D.25376>;
        <D.25375>:
        param_num = -1;
        <D.25376>:
        if (param_num == -1) goto <D.25377>; else goto <D.25378>;
        <D.25377>:
        if (num_elem <= 0) goto <D.25379>; else goto <D.25380>;
        <D.25379>:
        {
          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.25367 = conv_arg;
          return D.25367;
        }
        <D.25380>:
        <D.25378>:
        eklass = klass->element_class;
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25381>; else goto <D.25382>;
        <D.25381>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_ptr_to_string_conv (D.25226, spec, &need_free);
        goto <D.25383>;
        <D.25382>:
        D.25248 = mono_defaults.stringbuilder_class;
        if (D.25248 == eklass) goto <D.25384>; else goto <D.25385>;
        <D.25384>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25226, spec, &need_free);
        goto <D.25386>;
        <D.25385>:
        conv = 4294967295;
        <D.25386>:
        <D.25383>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.25387>; else goto <D.25388>;
        <D.25387>:
        esize = 4;
        goto <D.25389>;
        <D.25388>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25389>:
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25243);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        loc = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 20);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        if (param_num != -1) goto <D.25390>; else goto <D.25391>;
        <D.25390>:
        D.25392 = m->sig;
        D.25393 = D.25392->param_count;
        D.25394 = (int) D.25393;
        if (D.25394 <= param_num) goto <D.25395>; else goto <D.25396>;
        <D.25395>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter index is out of range.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25367 = conv_arg;
          return D.25367;
        }
        <D.25396>:
        D.25392 = m->sig;
        D.25397 = D.25392->params[param_num];
        D.25398 = D.25397->type;
        D.25399 = (int) D.25398;
        switch (D.25399) <default: <D.20220>, case 4: <D.20209>, case 5: <D.20210>, case 6: <D.20211>, case 7: <D.20212>, case 8: <D.20213>, case 9: <D.20214>, case 10: <D.20217>, case 11: <D.20218>, case 24: <D.20215>, case 25: <D.20216>>
        <D.20209>:
        <D.20210>:
        <D.20211>:
        <D.20212>:
        <D.20213>:
        <D.20214>:
        <D.20215>:
        <D.20216>:
        <D.20217>:
        <D.20218>:
        goto <D.20219>;
        <D.20220>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter must be an integral type.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25367 = conv_arg;
          return D.25367;
        }
        <D.20219>:
        <D.25391>:
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        src_ptr.243 = (unsigned int) src_ptr;
        mono_mb_emit_stloc (mb, src_ptr.243);
        if (param_num == -1) goto <D.25401>; else goto <D.25402>;
        <D.25401>:
        mono_mb_emit_icon (mb, num_elem);
        goto <D.25403>;
        <D.25402>:
        param_num.244 = (unsigned int) param_num;
        mono_mb_emit_ldarg (mb, param_num.244);
        if (num_elem > 0) goto <D.25405>; else goto <D.25406>;
        <D.25405>:
        mono_mb_emit_icon (mb, num_elem);
        mono_mb_emit_byte (mb, 88);
        <D.25406>:
        mono_mb_emit_byte (mb, 212);
        <D.25403>:
        mono_mb_emit_op (mb, 141, eklass);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        D.25407 = BIT_FIELD_REF <*eklass, 8, 160>;
        D.25408 = D.25407 & 32;
        if (D.25408 != 0) goto <D.25409>; else goto <D.25410>;
        <D.25409>:
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 16);
        mono_mb_emit_byte (mb, 88);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.20177>;
        <D.25410>:
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        index_var = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 22);
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.245);
        D.25412 = mono_mb_get_label (mb);
        label2 = (guint32) D.25412;
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.245);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25413>; else goto <D.25414>;
        <D.25413>:
        D.25415 = conv == 4294967295;
        D.25416 = (long int) D.25415;
        D.25417 = __builtin_expect (D.25416, 0);
        if (D.25417 != 0) goto <D.25418>; else goto <D.25419>;
        <D.25418>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7976, "conv != -1");
        <D.25419>:
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.245);
        src_ptr.243 = (unsigned int) src_ptr;
        mono_mb_emit_ldloc (mb, src_ptr.243);
        mono_mb_emit_byte (mb, 77);
        D.25420 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25420);
        mono_mb_emit_byte (mb, 162);
        goto <D.25421>;
        <D.25414>:
        {
          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.25367 = conv_arg;
          return D.25367;
        }
        <D.25421>:
        D.25422 = (short unsigned int) index_var;
        D.25423 = (int) D.25422;
        mono_mb_emit_add_to_local (mb, D.25423, 1);
        D.25424 = (short unsigned int) src_ptr;
        D.25425 = (int) D.25424;
        mono_mb_emit_add_to_local (mb, D.25425, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.20177>;
      }
      <D.20223>:
      {
        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.20177>; else goto <D.25426>;
        <D.25426>:
        D.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        D.25427 = D.25236 != 0;
        D.25428 = (long int) D.25427;
        D.25429 = __builtin_expect (D.25428, 0);
        if (D.25429 != 0) goto <D.25430>; else goto <D.25431>;
        <D.25430>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8015, "!t->byref");
        <D.25431>:
        D.25370 = spec->native;
        D.25432 = D.25370 != 42;
        D.25433 = (long int) D.25432;
        D.25434 = __builtin_expect (D.25433, 0);
        if (D.25434 != 0) goto <D.25435>; else goto <D.25436>;
        <D.25435>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8016, "spec->native == MONO_NATIVE_LPARRAY");
        <D.25436>:
        D.25298 = t->attrs;
        D.25299 = (int) D.25298;
        D.25300 = D.25299 & 2;
        D.25437 = D.25300 == 0;
        D.25438 = (long int) D.25437;
        D.25439 = __builtin_expect (D.25438, 0);
        if (D.25439 != 0) goto <D.25440>; else goto <D.25441>;
        <D.25440>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8017, "t->attrs & PARAM_ATTRIBUTE_OUT");
        <D.25441>:
        D.25373 = spec->data.array_data.param_num;
        param_num = (int) D.25373;
        num_elem = spec->data.array_data.num_elem;
        D.25374 = spec->data.array_data.elem_mult;
        if (D.25374 == 0) goto <D.25442>; else goto <D.25443>;
        <D.25442>:
        param_num = -1;
        <D.25443>:
        if (param_num == -1) goto <D.25444>; else goto <D.25445>;
        <D.25444>:
        if (num_elem <= 0) goto <D.25446>; else goto <D.25447>;
        <D.25446>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8028);
        <D.25447>:
        <D.25445>:
        eklass = klass->element_class;
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25448>; else goto <D.25449>;
        <D.25448>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25226, spec);
        goto <D.25450>;
        <D.25449>:
        D.25248 = mono_defaults.stringbuilder_class;
        if (D.25248 == eklass) goto <D.25451>; else goto <D.25452>;
        <D.25451>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25226, spec);
        goto <D.25453>;
        <D.25452>:
        conv = 4294967295;
        <D.25453>:
        <D.25450>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.25454>; else goto <D.25455>;
        <D.25454>:
        esize = 4;
        goto <D.25456>;
        <D.25455>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25456>:
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25243);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        loc = mono_mb_add_local (mb, D.25243);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        label1 = mono_mb_emit_branch (mb, 57);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        dest_ptr.246 = (unsigned int) dest_ptr;
        mono_mb_emit_stloc (mb, dest_ptr.246);
        D.25458 = BIT_FIELD_REF <*eklass, 8, 160>;
        D.25459 = D.25458 & 32;
        if (D.25459 != 0) goto <D.25460>; else goto <D.25461>;
        <D.25460>:
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 211);
        mono_mb_emit_icon (mb, 16);
        mono_mb_emit_byte (mb, 88);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        mono_mb_emit_icon (mb, esize);
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_byte (mb, 254);
        mono_mb_emit_byte (mb, 23);
        goto <D.20177>;
        <D.25461>:
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        index_var = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 22);
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.247);
        D.25463 = mono_mb_get_label (mb);
        label2 = (guint32) D.25463;
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.247);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25464>; else goto <D.25465>;
        <D.25464>:
        D.25466 = conv == 4294967295;
        D.25467 = (long int) D.25466;
        D.25468 = __builtin_expect (D.25467, 0);
        if (D.25468 != 0) goto <D.25469>; else goto <D.25470>;
        <D.25469>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8093, "conv != -1");
        <D.25470>:
        dest_ptr.246 = (unsigned int) dest_ptr;
        mono_mb_emit_ldloc (mb, dest_ptr.246);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.229);
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.247);
        mono_mb_emit_byte (mb, 154);
        D.25471 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25471);
        mono_mb_emit_byte (mb, 223);
        goto <D.25472>;
        <D.25465>:
        {
          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.25367 = conv_arg;
          return D.25367;
        }
        <D.25472>:
        D.25473 = (short unsigned int) index_var;
        D.25474 = (int) D.25473;
        mono_mb_emit_add_to_local (mb, D.25474, 1);
        D.25475 = (short unsigned int) dest_ptr;
        D.25476 = (int) D.25475;
        mono_mb_emit_add_to_local (mb, D.25476, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.20177>;
      }
      <D.20237>:
      {
        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.25235 = BIT_FIELD_REF <*t, 8, 56>;
        D.25236 = D.25235 & 64;
        D.25427 = D.25236 != 0;
        D.25428 = (long int) D.25427;
        D.25429 = __builtin_expect (D.25428, 0);
        if (D.25429 != 0) goto <D.25477>; else goto <D.25478>;
        <D.25477>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8130, "!t->byref");
        <D.25478>:
        eklass = klass->element_class;
        mono_marshal_load_type_info (eklass);
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25479>; else goto <D.25480>;
        <D.25479>:
        is_string = 1;
        D.25226 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25226, spec);
        goto <D.25481>;
        <D.25480>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8141);
        <D.25481>:
        if (is_string != 0) goto <D.25482>; else goto <D.25483>;
        <D.25482>:
        esize = 4;
        goto <D.25484>;
        <D.25483>:
        D.25263 = mono_defaults.char_class;
        if (D.25263 == eklass) goto <D.25485>; else goto <D.25486>;
        <D.25485>:
        D.25226 = m->piinfo;
        D.25488 = mono_pinvoke_is_unicode (D.25226);
        if (D.25488 != 0) goto <D.25489>; else goto <D.25490>;
        <D.25489>:
        iftmp.248 = 2;
        goto <D.25491>;
        <D.25490>:
        iftmp.248 = 1;
        <D.25491>:
        esize = iftmp.248;
        goto <D.25492>;
        <D.25486>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25492>:
        <D.25484>:
        D.25227 = mono_defaults.object_class;
        D.25228 = &D.25227->byval_arg;
        src = mono_mb_add_local (mb, D.25228);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        dest = mono_mb_add_local (mb, D.25243);
        src.249 = (unsigned int) src;
        mono_mb_emit_stloc (mb, src.249);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_stloc (mb, 3);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        label1 = mono_mb_emit_branch (mb, 57);
        mono_mb_emit_icon (mb, esize);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_byte (mb, 142);
        D.25244 = mono_defaults.string_class;
        if (D.25244 == eklass) goto <D.25494>; else goto <D.25495>;
        <D.25494>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25495>:
        mono_mb_emit_byte (mb, 90);
        mono_mb_emit_icall (mb, mono_marshal_alloc);
        dest.250 = (unsigned int) dest;
        mono_mb_emit_stloc (mb, dest.250);
        dest.250 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.250);
        mono_mb_emit_stloc (mb, 3);
        D.25242 = mono_defaults.int_class;
        D.25243 = &D.25242->byval_arg;
        index_var = mono_mb_add_local (mb, D.25243);
        mono_mb_emit_byte (mb, 22);
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.251);
        D.25498 = mono_mb_get_label (mb);
        label2 = (guint32) D.25498;
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.251);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        if (is_string != 0) goto <D.25499>; else goto <D.25500>;
        <D.25499>:
        D.25501 = conv == 4294967295;
        D.25502 = (long int) D.25501;
        D.25503 = __builtin_expect (D.25502, 0);
        if (D.25503 != 0) goto <D.25504>; else goto <D.25505>;
        <D.25504>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8190, "conv != -1");
        <D.25505>:
        dest.250 = (unsigned int) dest;
        mono_mb_emit_ldloc (mb, dest.250);
        src.249 = (unsigned int) src;
        mono_mb_emit_ldloc (mb, src.249);
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_ldloc (mb, index_var.251);
        mono_mb_emit_byte (mb, 154);
        D.25506 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25506);
        mono_mb_emit_byte (mb, 223);
        goto <D.25507>;
        <D.25500>:
        {
          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.25367 = conv_arg;
          return D.25367;
        }
        <D.25507>:
        D.25508 = (short unsigned int) index_var;
        D.25509 = (int) D.25508;
        mono_mb_emit_add_to_local (mb, D.25509, 1);
        D.25510 = (short unsigned int) dest;
        D.25511 = (int) D.25510;
        mono_mb_emit_add_to_local (mb, D.25511, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        mono_mb_patch_branch (mb, label1);
        goto <D.20177>;
      }
      <D.20249>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8220);
      <D.20177>:
      D.25367 = conv_arg;
      return D.25367;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_need_free (struct MonoType * t, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  unsigned char D.25515;
  int D.25516;
  gboolean D.25517;
  struct MonoClass * D.25518;
  struct MonoClass * D.25519;
  _Bool D.25522;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;

  D.25515 = t->type;
  D.25516 = (int) D.25515;
  switch (D.25516) <default: <D.18992>, case 14: <D.18991>, case 17: <D.18987>, case 18: <D.18989>, case 28: <D.18988>>
  <D.18987>:
  D.25517 = 1;
  return D.25517;
  <D.18988>:
  <D.18989>:
  D.25518 = t->data.klass;
  D.25519 = mono_defaults.stringbuilder_class;
  if (D.25518 == D.25519) goto <D.25520>; else goto <D.25521>;
  <D.25520>:
  {
    gboolean need_free;

    try
      {
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
        D.25517 = need_free;
        return D.25517;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.25521>:
  D.25517 = 0;
  return D.25517;
  <D.18991>:
  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  D.25522 = encoding != 21;
  D.25517 = (gboolean) D.25522;
  return D.25517;
  <D.18992>:
  D.25517 = 0;
  return D.25517;
}


emit_struct_conv_full (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object, MonoMarshalNative string_encoding)
{
  struct MonoClass * D.25525;
  unsigned int D.25528;
  unsigned char D.25531;
  unsigned char D.25532;
  unsigned int msize.252;
  _Bool D.25536;
  long int D.25537;
  long int D.25538;
  struct MonoClass * D.25541;
  unsigned int D.25544;
  unsigned int D.25545;
  struct MonoType * D.25548;
  char * D.25549;
  struct MonoClassField * D.25550;
  unsigned int i.253;
  unsigned int D.25552;
  unsigned int D.25553;
  _Bool D.25554;
  short unsigned int D.25555;
  int D.25556;
  int D.25557;
  <unnamed-unsigned:1> D.25560;
  int D.25561;
  struct MonoMarshalSpec * D.25562;
  int D.25565;
  int D.25566;
  unsigned int D.25567;
  unsigned int D.25568;
  int D.25570;
  struct MonoClassField * D.25571;
  int D.25572;
  unsigned int D.25573;
  unsigned int D.25574;
  struct MonoType * D.25583;
  int D.25584;
  struct MonoType * D.25587;
  int D.25588;
  char * D.25589;
  <unnamed type> conv.254;
  unsigned char D.25593;
  unsigned char D.25594;
  unsigned char D.25596;
  _Bool D.25600;
  _Bool D.25601;
  _Bool D.25602;
  unsigned int D.25608;
  unsigned char D.25609;
  int D.25610;
  unsigned int D.25611;
  unsigned char D.25612;
  int D.25613;
  struct MonoClass * D.25614;
  unsigned char D.25615;
  unsigned char D.25616;
  struct MonoClass * D.25619;
  struct MonoType * D.25620;
  unsigned int src_var.255;
  unsigned int dst_var.256;
  struct MonoMethod * variant_clear.257;
  struct MonoClass * D.25628;
  struct MonoMethod * variant_clear.258;
  struct MonoMethod * get_object_for_native_variant.259;
  struct MonoClass * D.25633;
  struct MonoMethod * get_object_for_native_variant.260;
  struct MonoMethod * get_native_variant_for_object.261;
  struct MonoMethod * get_native_variant_for_object.262;
  int D.25640;
  unsigned int src_var.263;
  unsigned int dst_var.264;
  struct MonoMarshalType * info;
  int i;
  void handle_enum = <<< error >>>;

  D.25525 = klass->parent;
  if (D.25525 != 0B) goto <D.25526>; else goto <D.25527>;
  <D.25526>:
  D.25525 = klass->parent;
  emit_struct_conv (mb, D.25525, to_object);
  <D.25527>:
  info = mono_marshal_load_type_info (klass);
  D.25528 = info->native_size;
  if (D.25528 == 0) goto <D.25529>; else goto <D.25530>;
  <D.25529>:
  return;
  <D.25530>:
  D.25531 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25532 = D.25531 & 32;
  if (D.25532 != 0) goto <D.25533>; else goto <D.25534>;
  <D.25533>:
  {
    int msize;

    msize = mono_class_value_size (klass, 0B);
    msize.252 = (unsigned int) msize;
    D.25528 = info->native_size;
    D.25536 = msize.252 != D.25528;
    D.25537 = (long int) D.25536;
    D.25538 = __builtin_expect (D.25537, 0);
    if (D.25538 != 0) goto <D.25539>; else goto <D.25540>;
    <D.25539>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1871, "msize == info->native_size");
    <D.25540>:
    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.25534>:
  D.25541 = mono_defaults.safehandle_class;
  if (D.25541 != klass) goto <D.25542>; else goto <D.25543>;
  <D.25542>:
  D.25544 = klass->flags;
  D.25545 = D.25544 & 24;
  if (D.25545 == 0) goto <D.25546>; else goto <D.25547>;
  <D.25546>:
  {
    char * msg;

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

    try
      {
        D.25550 = info->fields[i].field;
        ftype = D.25550->type;
        msize = 0;
        usize = 0;
        i.253 = (unsigned int) i;
        D.25552 = info->num_fields;
        D.25553 = D.25552 + 4294967295;
        D.25554 = i.253 >= D.25553;
        last_field = (gboolean) D.25554;
        D.25555 = ftype->attrs;
        D.25556 = (int) D.25555;
        D.25557 = D.25556 & 16;
        if (D.25557 != 0) goto <D.25558>; else goto <D.25559>;
        <D.25558>:
        // predicted unlikely by continue predictor.
        goto <D.18835>;
        <D.25559>:
        D.25560 = klass->unicode;
        D.25561 = (int) D.25560;
        D.25562 = info->fields[i].mspec;
        ntype = mono_type_to_unmanaged (ftype, D.25562, 1, D.25561, &conv);
        if (last_field != 0) goto <D.25563>; else goto <D.25564>;
        <D.25563>:
        D.25565 = klass->instance_size;
        D.25550 = info->fields[i].field;
        D.25566 = D.25550->offset;
        msize = D.25565 - D.25566;
        D.25528 = info->native_size;
        D.25567 = info->fields[i].offset;
        D.25568 = D.25528 - D.25567;
        usize = (int) D.25568;
        goto <D.25569>;
        <D.25564>:
        D.25570 = i + 1;
        D.25571 = info->fields[D.25570].field;
        D.25572 = D.25571->offset;
        D.25550 = info->fields[i].field;
        D.25566 = D.25550->offset;
        msize = D.25572 - D.25566;
        D.25570 = i + 1;
        D.25573 = info->fields[D.25570].offset;
        D.25567 = info->fields[i].offset;
        D.25574 = D.25573 - D.25567;
        usize = (int) D.25574;
        <D.25569>:
        D.25541 = mono_defaults.safehandle_class;
        if (D.25541 != klass) goto <D.25575>; else goto <D.25576>;
        <D.25575>:
        D.25544 = klass->flags;
        D.25545 = D.25544 & 24;
        if (D.25545 == 16) goto <D.25577>; else goto <D.25578>;
        <D.25577>:
        if (usize == 0) goto <D.25579>; else goto <D.25580>;
        <D.25579>:
        D.25550 = info->fields[i].field;
        D.25583 = D.25550->type;
        D.25584 = mono_type_is_reference (D.25583);
        if (D.25584 != 0) goto <D.25581>; else goto <D.25585>;
        <D.25585>:
        if (last_field == 0) goto <D.25586>; else goto <D.25582>;
        <D.25586>:
        D.25570 = i + 1;
        D.25571 = info->fields[D.25570].field;
        D.25587 = D.25571->type;
        D.25588 = mono_type_is_reference (D.25587);
        if (D.25588 != 0) goto <D.25581>; else goto <D.25582>;
        <D.25581>:
        D.25548 = &klass->byval_arg;
        D.25589 = mono_type_full_name (D.25548);
        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.25589);
        <D.18836>:
        goto <D.18836>;
        <D.25582>:
        <D.25580>:
        <D.25578>:
        <D.25576>:
        conv.254 = conv;
        switch (conv.254) <default: <D.18863>, case 0: <D.18837>>
        <D.18837>:
        {
          int t;

          D.25593 = BIT_FIELD_REF <*ftype, 8, 56>;
          D.25594 = D.25593 & 64;
          if (D.25594 != 0) goto <D.25591>; else goto <D.25595>;
          <D.25595>:
          D.25596 = ftype->type;
          if (D.25596 == 24) goto <D.25591>; else goto <D.25597>;
          <D.25597>:
          D.25596 = ftype->type;
          if (D.25596 == 25) goto <D.25591>; else goto <D.25592>;
          <D.25591>:
          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.18839>;
          <D.25592>:
          handle_enum:
          D.25596 = ftype->type;
          t = (int) D.25596;
          switch (t) <default: <D.18862>, case 2: <D.18845>, case 3: <D.18848>, case 4: <D.18843>, case 5: <D.18844>, case 6: <D.18846>, case 7: <D.18847>, case 8: <D.18841>, case 9: <D.18842>, case 10: <D.18849>, case 11: <D.18850>, case 12: <D.18852>, case 13: <D.18853>, case 15: <D.18851>, case 17: <D.18855>, case 28: <D.18858>>
          <D.18841>:
          <D.18842>:
          <D.18843>:
          <D.18844>:
          <D.18845>:
          <D.18846>:
          <D.18847>:
          <D.18848>:
          <D.18849>:
          <D.18850>:
          <D.18851>:
          <D.18852>:
          <D.18853>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          D.25600 = t == 3;
          D.25601 = ntype == 4;
          D.25602 = D.25600 & D.25601;
          if (D.25602 != 0) goto <D.25603>; else goto <D.25598>;
          <D.25603>:
          if (string_encoding != 21) goto <D.25604>; else goto <D.25598>;
          <D.25604>:
          if (to_object != 0) goto <D.25605>; else goto <D.25606>;
          <D.25605>:
          mono_mb_emit_byte (mb, 71);
          mono_mb_emit_byte (mb, 83);
          goto <D.25607>;
          <D.25606>:
          mono_mb_emit_byte (mb, 73);
          mono_mb_emit_byte (mb, 82);
          <D.25607>:
          goto <D.25599>;
          <D.25598>:
          D.25608 = mono_type_to_ldind (ftype);
          D.25609 = (unsigned char) D.25608;
          D.25610 = (int) D.25609;
          mono_mb_emit_byte (mb, D.25610);
          D.25611 = mono_type_to_stind (ftype);
          D.25612 = (unsigned char) D.25611;
          D.25613 = (int) D.25612;
          mono_mb_emit_byte (mb, D.25613);
          <D.25599>:
          goto <D.18854>;
          <D.18855>:
          {
            int src_var;
            int dst_var;

            D.25614 = ftype->data.klass;
            D.25615 = BIT_FIELD_REF <*D.25614, 8, 160>;
            D.25616 = D.25615 & 16;
            if (D.25616 != 0) goto <D.25617>; else goto <D.25618>;
            <D.25617>:
            D.25614 = ftype->data.klass;
            ftype = mono_class_enum_basetype (D.25614);
            goto handle_enum;
            <D.25618>:
            D.25619 = mono_defaults.int_class;
            D.25620 = &D.25619->byval_arg;
            src_var = mono_mb_add_local (mb, D.25620);
            D.25619 = mono_defaults.int_class;
            D.25620 = &D.25619->byval_arg;
            dst_var = mono_mb_add_local (mb, D.25620);
            mono_mb_emit_ldloc (mb, 0);
            src_var.255 = (unsigned int) src_var;
            mono_mb_emit_stloc (mb, src_var.255);
            mono_mb_emit_ldloc (mb, 1);
            dst_var.256 = (unsigned int) dst_var;
            mono_mb_emit_stloc (mb, dst_var.256);
            D.25614 = ftype->data.klass;
            emit_struct_conv (mb, D.25614, to_object);
            src_var.255 = (unsigned int) src_var;
            mono_mb_emit_ldloc (mb, src_var.255);
            mono_mb_emit_stloc (mb, 0);
            dst_var.256 = (unsigned int) dst_var;
            mono_mb_emit_ldloc (mb, dst_var.256);
            mono_mb_emit_stloc (mb, 1);
            goto <D.18854>;
          }
          <D.18858>:
          if (to_object != 0) goto <D.25623>; else goto <D.25624>;
          <D.25623>:
          {
            static struct MonoMethod * variant_clear = 0B;
            static struct MonoMethod * get_object_for_native_variant = 0B;

            variant_clear.257 = variant_clear;
            if (variant_clear.257 == 0B) goto <D.25626>; else goto <D.25627>;
            <D.25626>:
            D.25628 = mono_class_get_variant_class ();
            variant_clear.258 = mono_class_get_method_from_name (D.25628, "Clear", 0);
            variant_clear = variant_clear.258;
            <D.25627>:
            get_object_for_native_variant.259 = get_object_for_native_variant;
            if (get_object_for_native_variant.259 == 0B) goto <D.25631>; else goto <D.25632>;
            <D.25631>:
            D.25633 = mono_defaults.marshal_class;
            get_object_for_native_variant.260 = mono_class_get_method_from_name (D.25633, "GetObjectForNativeVariant", 1);
            get_object_for_native_variant = get_object_for_native_variant.260;
            <D.25632>:
            mono_mb_emit_ldloc (mb, 1);
            mono_mb_emit_ldloc (mb, 0);
            get_object_for_native_variant.259 = get_object_for_native_variant;
            mono_mb_emit_managed_call (mb, get_object_for_native_variant.259, 0B);
            mono_mb_emit_byte (mb, 81);
            mono_mb_emit_ldloc (mb, 0);
            variant_clear.257 = variant_clear;
            mono_mb_emit_managed_call (mb, variant_clear.257, 0B);
          }
          goto <D.25635>;
          <D.25624>:
          {
            static struct MonoMethod * get_native_variant_for_object = 0B;

            get_native_variant_for_object.261 = get_native_variant_for_object;
            if (get_native_variant_for_object.261 == 0B) goto <D.25637>; else goto <D.25638>;
            <D.25637>:
            D.25633 = mono_defaults.marshal_class;
            get_native_variant_for_object.262 = mono_class_get_method_from_name (D.25633, "GetNativeVariantForObject", 2);
            get_native_variant_for_object = get_native_variant_for_object.262;
            <D.25638>:
            mono_mb_emit_ldloc (mb, 0);
            mono_mb_emit_byte (mb, 80);
            mono_mb_emit_ldloc (mb, 1);
            get_native_variant_for_object.261 = get_native_variant_for_object;
            mono_mb_emit_managed_call (mb, get_native_variant_for_object.261, 0B);
          }
          <D.25635>:
          goto <D.18854>;
          <D.18862>:
          D.25596 = ftype->type;
          D.25640 = (int) D.25596;
          monoeg_g_log (0B, 16, "marshaling type %02x not implemented", D.25640);
          monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2038);
          <D.18854>:
          goto <D.18839>;
        }
        <D.18863>:
        {
          int src_var;
          int dst_var;

          D.25619 = mono_defaults.int_class;
          D.25620 = &D.25619->byval_arg;
          src_var = mono_mb_add_local (mb, D.25620);
          D.25619 = mono_defaults.int_class;
          D.25620 = &D.25619->byval_arg;
          dst_var = mono_mb_add_local (mb, D.25620);
          mono_mb_emit_ldloc (mb, 0);
          src_var.263 = (unsigned int) src_var;
          mono_mb_emit_stloc (mb, src_var.263);
          mono_mb_emit_ldloc (mb, 1);
          dst_var.264 = (unsigned int) dst_var;
          mono_mb_emit_stloc (mb, dst_var.264);
          if (to_object != 0) goto <D.25643>; else goto <D.25644>;
          <D.25643>:
          D.25562 = info->fields[i].mspec;
          conv.254 = conv;
          emit_ptr_to_object_conv (mb, ftype, conv.254, D.25562);
          goto <D.25645>;
          <D.25644>:
          D.25562 = info->fields[i].mspec;
          conv.254 = conv;
          emit_object_to_ptr_conv (mb, ftype, conv.254, D.25562);
          <D.25645>:
          src_var.263 = (unsigned int) src_var;
          mono_mb_emit_ldloc (mb, src_var.263);
          mono_mb_emit_stloc (mb, 0);
          dst_var.264 = (unsigned int) dst_var;
          mono_mb_emit_ldloc (mb, dst_var.264);
          mono_mb_emit_stloc (mb, 1);
        }
        <D.18839>:
        if (to_object != 0) goto <D.25646>; else goto <D.25647>;
        <D.25646>:
        mono_mb_emit_add_to_local (mb, 0, usize);
        mono_mb_emit_add_to_local (mb, 1, msize);
        goto <D.25648>;
        <D.25647>:
        mono_mb_emit_add_to_local (mb, 0, msize);
        mono_mb_emit_add_to_local (mb, 1, usize);
        <D.25648>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.18835>:
  i = i + 1;
  <D.18867>:
  i.253 = (unsigned int) i;
  D.25552 = info->num_fields;
  if (i.253 < D.25552) goto <D.18866>; else goto <D.18868>;
  <D.18868>:
}


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.25652;
  int D.25656;
  unsigned char D.25657;
  unsigned char D.25658;
  int D.25661;
  struct MonoClass * D.25663;
  struct MonoType * D.25664;
  struct MonoClass * D.25665;
  struct MonoType * D.25666;
  unsigned int array_var.265;
  unsigned int src_var.266;
  unsigned int dst_var.267;
  unsigned int index_var.268;
  int D.25671;
  short unsigned int D.25672;
  int D.25673;
  <unnamed type> D.25677;
  unsigned int src_var.269;
  unsigned int dst_var.270;
  struct MonoClass * D.25682;
  const char * D.25683;

  switch (conv) <default: <D.18744>, case 1: <D.18710>, case 2: <D.18708>, case 3: <D.18740>, case 4: <D.18725>, case 7: <D.18726>, case 9: <D.18724>, case 10: <D.18741>, case 11: <D.18742>, case 12: <D.18722>, case 13: <D.18723>, case 20: <D.18711>, case 21: <D.18720>, case 22: <D.18743>, case 23: <D.18733>, case 25: <D.18735>, case 26: <D.18737>, case 27: <D.18736>, case 28: <D.18727>, case 29: <D.18731>, case 33: <D.18738>, case 34: <D.18739>>
  <D.18708>:
  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.18709>;
  <D.18710>:
  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.18709>;
  <D.18711>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.25652 = type->type;
    if (D.25652 == 29) goto <D.25653>; else goto <D.25654>;
    <D.25653>:
    eklass = type->data.klass;
    goto <D.25655>;
    <D.25654>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1279);
    <D.25655>:
    esize = mono_class_native_size (eklass, 0B);
    mono_mb_emit_ldloc (mb, 1);
    D.25656 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25656);
    mono_mb_emit_op (mb, 141, eklass);
    mono_mb_emit_byte (mb, 223);
    D.25657 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.25658 = D.25657 & 32;
    if (D.25658 != 0) goto <D.25659>; else goto <D.25660>;
    <D.25659>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_ldloc (mb, 0);
    D.25656 = mspec->data.array_data.num_elem;
    D.25661 = D.25656 * esize;
    mono_mb_emit_icon (mb, D.25661);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.25662>;
    <D.25660>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.25663 = mono_defaults.object_class;
      D.25664 = &D.25663->byval_arg;
      array_var = mono_mb_add_local (mb, D.25664);
      D.25665 = mono_defaults.int_class;
      D.25666 = &D.25665->byval_arg;
      src_var = mono_mb_add_local (mb, D.25666);
      D.25665 = mono_defaults.int_class;
      D.25666 = &D.25665->byval_arg;
      dst_var = mono_mb_add_local (mb, D.25666);
      mono_mb_emit_ldloc (mb, 1);
      mono_mb_emit_byte (mb, 80);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.265);
      mono_mb_emit_ldloc (mb, 0);
      src_var.266 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.266);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.267 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.267);
      D.25665 = mono_defaults.int_class;
      D.25666 = &D.25665->byval_arg;
      index_var = mono_mb_add_local (mb, D.25666);
      mono_mb_emit_byte (mb, 22);
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.268);
      D.25671 = mono_mb_get_label (mb);
      label2 = (guint32) D.25671;
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.268);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.265);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.265 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.265);
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.268);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 1);
      emit_struct_conv (mb, eklass, 1);
      D.25672 = (short unsigned int) index_var;
      D.25673 = (int) D.25672;
      mono_mb_emit_add_to_local (mb, D.25673, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.266 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.266);
      mono_mb_emit_stloc (mb, 0);
      dst_var.267 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.267);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.25662>:
    goto <D.18709>;
  }
  <D.18720>:
  {
    struct MonoClass * eclass;

    eclass = mono_defaults.char_class;
    mono_mb_emit_ldloc (mb, 1);
    D.25656 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25656);
    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.25656 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25656);
    mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
    goto <D.18709>;
  }
  <D.18722>:
  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.18709>;
  <D.18723>:
  if (mspec != 0B) goto <D.25676>; else goto <D.25674>;
  <D.25676>:
  D.25677 = mspec->native;
  if (D.25677 == 23) goto <D.25678>; else goto <D.25674>;
  <D.25678>:
  D.25656 = mspec->data.array_data.num_elem;
  if (D.25656 != 0) goto <D.25679>; else goto <D.25674>;
  <D.25679>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  D.25656 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25656);
  mono_mb_emit_icall (mb, mono_string_from_byvalwstr);
  goto <D.25675>;
  <D.25674>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  <D.25675>:
  mono_mb_emit_byte (mb, 81);
  goto <D.18709>;
  <D.18724>:
  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.18709>;
  <D.18725>:
  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.18709>;
  <D.18726>:
  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.18709>;
  <D.18727>:
  {
    struct MonoClass * klass;
    int src_var;
    int dst_var;

    klass = mono_class_from_mono_type (type);
    D.25665 = mono_defaults.int_class;
    D.25666 = &D.25665->byval_arg;
    src_var = mono_mb_add_local (mb, D.25666);
    D.25665 = mono_defaults.int_class;
    D.25666 = &D.25665->byval_arg;
    dst_var = mono_mb_add_local (mb, D.25666);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 240);
    mono_mb_emit_op (mb, 4, klass);
    mono_mb_emit_byte (mb, 81);
    mono_mb_emit_ldloc (mb, 0);
    src_var.269 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.269);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.270 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.270);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 1);
    emit_struct_conv (mb, klass, 1);
    src_var.269 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.269);
    mono_mb_emit_stloc (mb, 0);
    dst_var.270 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.270);
    mono_mb_emit_stloc (mb, 1);
    goto <D.18709>;
  }
  <D.18731>:
  {
    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.18709>;
  }
  <D.18733>:
  D.25682 = mono_class_from_mono_type (type);
  D.25683 = D.25682->name;
  monoeg_g_log (0B, 4, "Structure field of type %s can\'t be marshalled as LPArray", D.25683);
  <D.18734>:
  goto <D.18734>;
  <D.18735>:
  <D.18736>:
  <D.18737>:
  mono_cominterop_emit_ptr_to_object_conv (mb, type, conv, mspec);
  goto <D.18709>;
  <D.18738>:
  goto <D.18709>;
  <D.18739>:
  goto <D.18709>;
  <D.18740>:
  <D.18741>:
  <D.18742>:
  <D.18743>:
  <D.18744>:
  {
    char * msg;

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


emit_object_to_ptr_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned int D.25685;
  unsigned int pos.271;
  void * D.25687;
  void * D.25688;
  _Bool D.25689;
  long int D.25690;
  long int D.25691;
  int D.25694;
  void * D.25695;
  unsigned char D.25696;
  unsigned char D.25700;
  unsigned char D.25701;
  unsigned int D.25705;
  unsigned char D.25706;
  int D.25709;
  struct MonoClass * D.25711;
  struct MonoType * D.25712;
  struct MonoClass * D.25713;
  struct MonoType * D.25714;
  unsigned int array_var.272;
  unsigned int src_var.273;
  unsigned int dst_var.274;
  unsigned int index_var.275;
  int D.25719;
  short unsigned int D.25720;
  int D.25721;
  unsigned int pos.276;
  unsigned int D.25723;
  unsigned int D.25724;
  unsigned int src_var.277;
  unsigned int dst_var.278;
  struct MonoClass * D.25727;
  struct MonoClass * D.25728;
  struct MonoType * D.25729;
  unsigned int D.25730;
  unsigned int pos.279;
  int pos;

  switch (conv) <default: <D.18816>, case 1: <D.18783>, case 2: <D.18781>, case 3: <D.18787>, case 4: <D.18785>, case 7: <D.18784>, case 9: <D.18786>, case 10: <D.18788>, case 11: <D.18789>, case 12: <D.18794>, case 13: <D.18795>, case 20: <D.18796>, case 21: <D.18805>, case 22: <D.18791>, case 23: <D.18792>, case 25: <D.18809>, case 26: <D.18810>, case 27: <D.18811>, case 28: <D.18806>, case 29: <D.18793>, case 33: <D.18812>, case 34: <D.18815>>
  <D.18781>:
  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.18782>;
  <D.18783>:
  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.18782>;
  <D.18784>:
  <D.18785>:
  <D.18786>:
  <D.18787>:
  <D.18788>:
  <D.18789>:
  {
    int pos;

    mono_mb_emit_ldloc (mb, 2);
    D.25685 = mono_mb_emit_short_branch (mb, 44);
    pos = (int) D.25685;
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icall (mb, monoeg_g_free);
    pos.271 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.271);
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.25687 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.25687);
    mono_mb_emit_byte (mb, 223);
    goto <D.18782>;
  }
  <D.18791>:
  <D.18792>:
  <D.18793>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25688 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.25688);
  mono_mb_emit_byte (mb, 223);
  goto <D.18782>;
  <D.18794>:
  <D.18795>:
  D.25689 = mspec == 0B;
  D.25690 = (long int) D.25689;
  D.25691 = __builtin_expect (D.25690, 0);
  if (D.25691 != 0) goto <D.25692>; else goto <D.25693>;
  <D.25692>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1641, "mspec");
  <D.25693>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25694 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25694);
  D.25695 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.25695);
  goto <D.18782>;
  <D.18796>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.25696 = type->type;
    if (D.25696 == 29) goto <D.25697>; else goto <D.25698>;
    <D.25697>:
    eklass = type->data.klass;
    goto <D.25699>;
    <D.25698>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1657);
    <D.25699>:
    D.25700 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.25701 = D.25700 & 8;
    if (D.25701 != 0) goto <D.25702>; else goto <D.25703>;
    <D.25702>:
    esize = mono_class_native_size (eklass, 0B);
    goto <D.25704>;
    <D.25703>:
    esize = 4;
    <D.25704>:
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.25705 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25705;
    D.25700 = BIT_FIELD_REF <*eklass, 8, 160>;
    D.25706 = D.25700 & 32;
    if (D.25706 != 0) goto <D.25707>; else goto <D.25708>;
    <D.25707>:
    mono_mb_emit_ldloc (mb, 1);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    mono_mb_emit_ldflda (mb, 16);
    D.25694 = mspec->data.array_data.num_elem;
    D.25709 = D.25694 * esize;
    mono_mb_emit_icon (mb, D.25709);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.25710>;
    <D.25708>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.25711 = mono_defaults.object_class;
      D.25712 = &D.25711->byval_arg;
      array_var = mono_mb_add_local (mb, D.25712);
      D.25713 = mono_defaults.int_class;
      D.25714 = &D.25713->byval_arg;
      src_var = mono_mb_add_local (mb, D.25714);
      D.25713 = mono_defaults.int_class;
      D.25714 = &D.25713->byval_arg;
      dst_var = mono_mb_add_local (mb, D.25714);
      mono_mb_emit_ldloc (mb, 0);
      mono_mb_emit_byte (mb, 80);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_stloc (mb, array_var.272);
      mono_mb_emit_ldloc (mb, 0);
      src_var.273 = (unsigned int) src_var;
      mono_mb_emit_stloc (mb, src_var.273);
      mono_mb_emit_ldloc (mb, 1);
      dst_var.274 = (unsigned int) dst_var;
      mono_mb_emit_stloc (mb, dst_var.274);
      D.25713 = mono_defaults.int_class;
      D.25714 = &D.25713->byval_arg;
      index_var = mono_mb_add_local (mb, D.25714);
      mono_mb_emit_byte (mb, 22);
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.275);
      D.25719 = mono_mb_get_label (mb);
      label2 = (guint32) D.25719;
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.275);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.272);
      mono_mb_emit_byte (mb, 142);
      label3 = mono_mb_emit_branch (mb, 60);
      array_var.272 = (unsigned int) array_var;
      mono_mb_emit_ldloc (mb, array_var.272);
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_ldloc (mb, index_var.275);
      mono_mb_emit_op (mb, 143, eklass);
      mono_mb_emit_stloc (mb, 0);
      emit_struct_conv (mb, eklass, 0);
      D.25720 = (short unsigned int) index_var;
      D.25721 = (int) D.25720;
      mono_mb_emit_add_to_local (mb, D.25721, 1);
      mono_mb_emit_branch_label (mb, 56, label2);
      mono_mb_patch_branch (mb, label3);
      src_var.273 = (unsigned int) src_var;
      mono_mb_emit_ldloc (mb, src_var.273);
      mono_mb_emit_stloc (mb, 0);
      dst_var.274 = (unsigned int) dst_var;
      mono_mb_emit_ldloc (mb, dst_var.274);
      mono_mb_emit_stloc (mb, 1);
    }
    <D.25710>:
    pos.276 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.276);
    goto <D.18782>;
  }
  <D.18805>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25723 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.25723;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25694 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25694);
  mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
  pos.276 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.276);
  goto <D.18782>;
  <D.18806>:
  {
    int src_var;
    int dst_var;

    D.25713 = mono_defaults.int_class;
    D.25714 = &D.25713->byval_arg;
    src_var = mono_mb_add_local (mb, D.25714);
    D.25713 = mono_defaults.int_class;
    D.25714 = &D.25713->byval_arg;
    dst_var = mono_mb_add_local (mb, D.25714);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.25724 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25724;
    mono_mb_emit_ldloc (mb, 0);
    src_var.277 = (unsigned int) src_var;
    mono_mb_emit_stloc (mb, src_var.277);
    mono_mb_emit_ldloc (mb, 1);
    dst_var.278 = (unsigned int) dst_var;
    mono_mb_emit_stloc (mb, dst_var.278);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_stloc (mb, 0);
    D.25727 = mono_class_from_mono_type (type);
    emit_struct_conv (mb, D.25727, 0);
    src_var.277 = (unsigned int) src_var;
    mono_mb_emit_ldloc (mb, src_var.277);
    mono_mb_emit_stloc (mb, 0);
    dst_var.278 = (unsigned int) dst_var;
    mono_mb_emit_ldloc (mb, dst_var.278);
    mono_mb_emit_stloc (mb, 1);
    pos.276 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.276);
    goto <D.18782>;
  }
  <D.18809>:
  <D.18810>:
  <D.18811>:
  mono_cominterop_emit_object_to_ptr_conv (mb, type, conv, mspec);
  goto <D.18782>;
  <D.18812>:
  {
    int dar_release_slot;
    int pos;

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


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

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


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.18979>, case 20: <D.18977>, case 21: <D.18976>, case 22: <D.18978>>
  <D.18976>:
  *need_free = 0;
  D.25733 = 19;
  return D.25733;
  <D.18977>:
  D.25733 = 17;
  return D.25733;
  <D.18978>:
  D.25733 = 18;
  return D.25733;
  <D.18979>:
  D.25733 = 4294967295;
  return D.25733;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.18957>, case 20: <D.18955>, case 21: <D.18954>, case 22: <D.18956>>
  <D.18954>:
  D.25735 = 16;
  return D.25735;
  <D.18955>:
  D.25735 = 14;
  return D.25735;
  <D.18956>:
  D.25735 = 15;
  return D.25735;
  <D.18957>:
  D.25735 = 4294967295;
  return D.25735;
}


mono_pinvoke_is_unicode (struct MonoMethodPInvoke * piinfo)
{
  short unsigned int D.25737;
  int D.25738;
  int D.25739;
  gboolean D.25740;

  D.25737 = piinfo->piflags;
  D.25738 = (int) D.25737;
  D.25739 = D.25738 & 6;
  switch (D.25739) <default: <D.20150>, case 2: <D.20147>, case 4: <D.20148>, case 6: <D.20149>>
  <D.20147>:
  D.25740 = 0;
  return D.25740;
  <D.20148>:
  D.25740 = 1;
  return D.25740;
  <D.20149>:
  <D.20150>:
  D.25740 = 0;
  return D.25740;
}


emit_marshal_boolean (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  unsigned char D.25742;
  unsigned char D.25743;
  struct MonoClass * D.25746;
  struct MonoType * D.25747;
  unsigned int argnum.281;
  unsigned int D.25752;
  unsigned char ldc_op.282;
  int D.25754;
  unsigned int conv_arg.283;
  unsigned int label_false.284;
  unsigned int D.25758;
  unsigned int D.25759;
  unsigned int label_false.285;
  unsigned int label_end.286;
  struct MonoClass * D.25768;
  struct MonoType * D.25769;
  struct MonoType * D.25772;
  struct MonoType * D.25774;
  unsigned int D.25777;
  unsigned char ldop.287;
  int D.25779;
  unsigned int D.25781;
  unsigned int label_false.288;
  unsigned int label_null.289;
  <unnamed type> D.25789;
  unsigned int D.25790;
  unsigned int D.25791;
  int D.25792;
  unsigned int D.25793;
  unsigned int label_false.290;
  unsigned int label_end.291;
  int D.25796;
  unsigned int label_null.292;
  int D.25798;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20306>, case 0: <D.20280>, case 1: <D.20288>, case 2: <D.20285>, case 3: <D.20289>, case 4: <D.20290>, case 5: <D.20295>>
  <D.20280>:
  {
    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.25742 = BIT_FIELD_REF <*t, 8, 56>;
        D.25743 = D.25742 & 64;
        if (D.25743 != 0) goto <D.25744>; else goto <D.25745>;
        <D.25744>:
        D.25746 = mono_defaults.int_class;
        D.25747 = &D.25746->byval_arg;
        *conv_arg_type = D.25747;
        goto <D.25748>;
        <D.25745>:
        *conv_arg_type = local_type;
        <D.25748>:
        conv_arg = mono_mb_add_local (mb, local_type);
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.25742 = BIT_FIELD_REF <*t, 8, 56>;
        D.25743 = D.25742 & 64;
        if (D.25743 != 0) goto <D.25750>; else goto <D.25751>;
        <D.25750>:
        mono_mb_emit_byte (mb, 70);
        <D.25751>:
        D.25752 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.25752;
        ldc_op.282 = ldc_op;
        D.25754 = (int) ldc_op.282;
        mono_mb_emit_byte (mb, D.25754);
        conv_arg.283 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.283);
        label_false.284 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.284);
        goto <D.20284>;
      }
    finally
      {
        ldc_op = {CLOBBER};
      }
  }
  <D.20285>:
  {
    int label_false;
    int label_end;

    D.25742 = BIT_FIELD_REF <*t, 8, 56>;
    D.25743 = D.25742 & 64;
    if (D.25743 == 0) goto <D.20284>; else goto <D.25757>;
    <D.25757>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.283 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.283);
    D.25758 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.25758;
    mono_mb_emit_byte (mb, 23);
    D.25759 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.25759;
    label_false.285 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.285);
    mono_mb_emit_byte (mb, 22);
    label_end.286 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.286);
    mono_mb_emit_byte (mb, 82);
    goto <D.20284>;
  }
  <D.20288>:
  D.25742 = BIT_FIELD_REF <*t, 8, 56>;
  D.25743 = D.25742 & 64;
  if (D.25743 != 0) goto <D.25762>; else goto <D.25763>;
  <D.25762>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.283);
  goto <D.25764>;
  <D.25763>:
  if (conv_arg != 0) goto <D.25765>; else goto <D.25766>;
  <D.25765>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.283);
  goto <D.25767>;
  <D.25766>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  <D.25767>:
  <D.25764>:
  goto <D.20284>;
  <D.20289>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20284>;
  <D.20290>:
  {
    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.25768 = mono_defaults.boolean_class;
        D.25769 = &D.25768->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.25769);
        D.25742 = BIT_FIELD_REF <*t, 8, 56>;
        D.25743 = D.25742 & 64;
        if (D.25743 != 0) goto <D.25770>; else goto <D.25771>;
        <D.25770>:
        D.25772 = &conv_arg_class->this_arg;
        *conv_arg_type = D.25772;
        goto <D.25773>;
        <D.25771>:
        D.25774 = &conv_arg_class->byval_arg;
        *conv_arg_type = D.25774;
        <D.25773>:
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.25742 = BIT_FIELD_REF <*t, 8, 56>;
        D.25743 = D.25742 & 64;
        if (D.25743 != 0) goto <D.25775>; else goto <D.25776>;
        <D.25775>:
        D.25777 = mono_mb_emit_branch (mb, 57);
        label_null = (int) D.25777;
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        ldop.287 = ldop;
        D.25779 = (int) ldop.287;
        mono_mb_emit_byte (mb, D.25779);
        goto <D.25780>;
        <D.25776>:
        label_null = 0;
        <D.25780>:
        D.25781 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.25781;
        mono_mb_emit_byte (mb, 23);
        conv_arg.283 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.283);
        label_false.288 = (unsigned int) label_false;
        mono_mb_patch_branch (mb, label_false.288);
        D.25742 = BIT_FIELD_REF <*t, 8, 56>;
        D.25743 = D.25742 & 64;
        if (D.25743 != 0) goto <D.25783>; else goto <D.25784>;
        <D.25783>:
        label_null.289 = (unsigned int) label_null;
        mono_mb_patch_branch (mb, label_null.289);
        <D.25784>:
        goto <D.20284>;
      }
    finally
      {
        ldop = {CLOBBER};
      }
  }
  <D.20295>:
  {
    guint8 stop;
    guint8 ldc_op;
    int label_null;
    int label_false;
    int label_end;

    stop = 84;
    ldc_op = 23;
    D.25742 = BIT_FIELD_REF <*t, 8, 56>;
    D.25743 = D.25742 & 64;
    if (D.25743 == 0) goto <D.20284>; else goto <D.25786>;
    <D.25786>:
    if (spec != 0B) goto <D.25787>; else goto <D.25788>;
    <D.25787>:
    D.25789 = spec->native;
    switch (D.25789) <default: <D.20305>, case 3: <D.20301>, case 4: <D.20302>, case 37: <D.20304>>
    <D.20301>:
    <D.20302>:
    stop = 82;
    goto <D.20303>;
    <D.20304>:
    stop = 83;
    ldc_op = 21;
    goto <D.20303>;
    <D.20305>:
    goto <D.20303>;
    <D.20303>:
    <D.25788>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    D.25790 = mono_mb_emit_branch (mb, 57);
    label_null = (int) D.25790;
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    conv_arg.283 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.283);
    D.25791 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.25791;
    D.25792 = (int) ldc_op;
    mono_mb_emit_byte (mb, D.25792);
    D.25793 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.25793;
    label_false.290 = (unsigned int) label_false;
    mono_mb_patch_branch (mb, label_false.290);
    mono_mb_emit_byte (mb, 22);
    label_end.291 = (unsigned int) label_end;
    mono_mb_patch_branch (mb, label_end.291);
    D.25796 = (int) stop;
    mono_mb_emit_byte (mb, D.25796);
    label_null.292 = (unsigned int) label_null;
    mono_mb_patch_branch (mb, label_null.292);
    goto <D.20284>;
  }
  <D.20306>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8436);
  <D.20284>:
  D.25798 = conv_arg;
  return D.25798;
}


marshal_boolean_conv_in_get_local_type (struct MonoMarshalSpec * spec, guint8 * ldc_op)
{
  struct MonoType * D.25805;
  struct MonoClass * D.25806;
  <unnamed type> D.25807;
  struct MonoClass * D.25808;
  struct MonoClass * D.25811;

  if (spec == 0B) goto <D.25803>; else goto <D.25804>;
  <D.25803>:
  D.25806 = mono_defaults.int32_class;
  D.25805 = &D.25806->byval_arg;
  return D.25805;
  <D.25804>:
  D.25807 = spec->native;
  switch (D.25807) <default: <D.20258>, case 2: <D.20257>, case 3: <D.20254>, case 4: <D.20255>, case 37: <D.20256>>
  <D.20254>:
  <D.20255>:
  D.25808 = mono_defaults.byte_class;
  D.25805 = &D.25808->byval_arg;
  return D.25805;
  <D.20256>:
  if (ldc_op != 0B) goto <D.25809>; else goto <D.25810>;
  <D.25809>:
  *ldc_op = 21;
  <D.25810>:
  D.25811 = mono_defaults.int16_class;
  D.25805 = &D.25811->byval_arg;
  return D.25805;
  <D.20257>:
  D.25806 = mono_defaults.int32_class;
  D.25805 = &D.25806->byval_arg;
  return D.25805;
  <D.20258>:
  D.25807 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.25807);
  D.25806 = mono_defaults.int32_class;
  D.25805 = &D.25806->byval_arg;
  return D.25805;
}


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

  conv_arg_class = mono_defaults.int32_class;
  if (spec != 0B) goto <D.25813>; else goto <D.25814>;
  <D.25813>:
  D.25815 = spec->native;
  switch (D.25815) <default: <D.20269>, case 2: <D.20268>, case 3: <D.20264>, case 4: <D.20265>, case 37: <D.20267>>
  <D.20264>:
  <D.20265>:
  conv_arg_class = mono_defaults.byte_class;
  if (ldop != 0B) goto <D.25816>; else goto <D.25817>;
  <D.25816>:
  *ldop = 70;
  <D.25817>:
  goto <D.20266>;
  <D.20267>:
  conv_arg_class = mono_defaults.int16_class;
  if (ldop != 0B) goto <D.25818>; else goto <D.25819>;
  <D.25818>:
  *ldop = 72;
  <D.25819>:
  goto <D.20266>;
  <D.20268>:
  goto <D.20266>;
  <D.20269>:
  D.25815 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.25815);
  <D.20266>:
  <D.25814>:
  D.25820 = conv_arg_class;
  return D.25820;
}


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

  mb = m->mb;
  switch (action) <default: <D.20321>, case 0: <D.20317>, case 1: <D.20319>, case 3: <D.20320>>
  <D.20317>:
  goto <D.20318>;
  <D.20319>:
  argnum.293 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.293);
  goto <D.20318>;
  <D.20320>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20318>;
  <D.20321>:
  goto <D.20318>;
  <D.20318>:
  D.25824 = conv_arg;
  return D.25824;
}


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

  mb = m->mb;
  switch (action) <default: <D.20335>, case 1: <D.20332>, case 3: <D.20334>>
  <D.20332>:
  argnum.294 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.294);
  goto <D.20333>;
  <D.20334>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20333>;
  <D.20335>:
  goto <D.20333>;
  <D.20333>:
  D.25828 = conv_arg;
  return D.25828;
}


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

  mb = m->mb;
  switch (action) <default: <D.20349>, case 1: <D.20346>, case 3: <D.20348>>
  <D.20346>:
  argnum.295 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.295);
  goto <D.20347>;
  <D.20348>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20347>;
  <D.20349>:
  goto <D.20347>;
  <D.20347>:
  D.25832 = conv_arg;
  return D.25832;
}


emit_marshal_vtype (struct EmitMarshalContext * m, int argnum, struct MonoType * t, struct MonoMarshalSpec * spec, int conv_arg, struct MonoType * * conv_arg_type, MarshalAction action)
{
  struct MonoClass * date_time_class.298;
  struct MonoClass * tmp_klass.296;
  struct MonoImage * D.25840;
  struct MonoClass * tmp_klass.297;
  _Bool D.25842;
  long int D.25843;
  long int D.25844;
  struct MonoMethod * to_oadate.299;
  struct MonoMethod * to_oadate.300;
  _Bool D.25853;
  long int D.25854;
  long int D.25855;
  struct MonoClass * D.25858;
  struct MonoType * D.25859;
  unsigned char D.25860;
  unsigned char D.25861;
  unsigned int argnum.301;
  unsigned int D.25865;
  short unsigned int D.25869;
  unsigned int D.25870;
  unsigned int D.25871;
  struct MonoMethodSignature * D.25874;
  <unnamed-unsigned:1> D.25875;
  int D.25876;
  int D.25877;
  unsigned int conv_arg.302;
  unsigned int pos.303;
  unsigned int D.25882;
  unsigned int D.25883;
  unsigned char D.25885;
  unsigned char D.25886;
  struct MonoClass * D.25888;
  struct MonoType * D.25889;
  int D.25893;
  unsigned int D.25896;
  <unnamed type> D.25904;
  _Bool D.25907;
  long int D.25908;
  long int D.25909;
  struct MonoMethod * from_oadate.304;
  struct MonoMethod * from_oadate.305;
  _Bool D.25935;
  long int D.25936;
  long int D.25937;
  unsigned int D.25944;
  unsigned char D.25952;
  struct MonoType * D.25956;
  int D.25957;
  int D.25958;
  unsigned int D.25965;
  unsigned int D.25973;
  unsigned int pos2.306;
  int D.25978;
  int D.25979;
  _Bool D.25980;
  long int D.25981;
  long int D.25982;
  int D.25985;
  unsigned int D.25986;
  int D.25987;
  struct MonoMethodBuilder * mb;
  struct MonoClass * klass;
  struct MonoClass * date_time_class;
  int pos;
  int pos2;

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

    {
      tmp_klass.296 = tmp_klass;
      if (tmp_klass.296 == 0B) goto <D.25836>; else goto <D.25837>;
      <D.25836>:
      if (0 != 0) goto <D.25838>; else goto <D.25839>;
      <D.25838>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "mono_defaults.corlib == mono_defaults.corlib");
      <D.25839>:
      D.25840 = mono_defaults.corlib;
      tmp_klass.297 = mono_class_from_name (D.25840, "System", "DateTime");
      tmp_klass = tmp_klass.297;
      tmp_klass.296 = tmp_klass;
      D.25842 = tmp_klass.296 == 0B;
      D.25843 = (long int) D.25842;
      D.25844 = __builtin_expect (D.25843, 0);
      if (D.25844 != 0) goto <D.25845>; else goto <D.25846>;
      <D.25845>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "tmp_klass");
      <D.25846>:
      <D.25837>:
    }
    date_time_class.298 = tmp_klass;
  }
  date_time_class = date_time_class.298;
  switch (action) <default: <D.20005>, case 0: <D.19995>, case 1: <D.19998>, case 2: <D.19999>, case 3: <D.20001>, case 4: <D.20002>, case 5: <D.20003>, case 6: <D.20004>>
  <D.19995>:
  if (klass == date_time_class) goto <D.25847>; else goto <D.25848>;
  <D.25847>:
  {
    static struct MonoMethod * to_oadate;

    to_oadate.299 = to_oadate;
    if (to_oadate.299 == 0B) goto <D.25850>; else goto <D.25851>;
    <D.25850>:
    to_oadate.300 = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
    to_oadate = to_oadate.300;
    <D.25851>:
    to_oadate.299 = to_oadate;
    D.25853 = to_oadate.299 == 0B;
    D.25854 = (long int) D.25853;
    D.25855 = __builtin_expect (D.25854, 0);
    if (D.25855 != 0) goto <D.25856>; else goto <D.25857>;
    <D.25856>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6236, "to_oadate");
    <D.25857>:
    D.25858 = mono_defaults.double_class;
    D.25859 = &D.25858->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.25859);
    D.25860 = BIT_FIELD_REF <*t, 8, 56>;
    D.25861 = D.25860 & 64;
    if (D.25861 != 0) goto <D.25862>; else goto <D.25863>;
    <D.25862>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.301);
    D.25865 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25865;
    <D.25863>:
    D.25860 = BIT_FIELD_REF <*t, 8, 56>;
    D.25861 = D.25860 & 64;
    if (D.25861 == 0) goto <D.25866>; else goto <D.25868>;
    <D.25868>:
    D.25869 = t->attrs;
    D.25870 = (unsigned int) D.25869;
    D.25871 = D.25870 & 3;
    if (D.25871 != 2) goto <D.25866>; else goto <D.25867>;
    <D.25866>:
    D.25860 = BIT_FIELD_REF <*t, 8, 56>;
    D.25861 = D.25860 & 64;
    if (D.25861 == 0) goto <D.25872>; else goto <D.25873>;
    <D.25872>:
    D.25874 = m->csig;
    D.25874 = m->csig;
    D.25875 = D.25874->hasthis;
    D.25876 = (int) D.25875;
    D.25877 = argnum - D.25876;
    D.25858 = mono_defaults.double_class;
    D.25859 = &D.25858->byval_arg;
    D.25874->params[D.25877] = D.25859;
    <D.25873>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg_addr (mb, argnum.301);
    to_oadate.299 = to_oadate;
    mono_mb_emit_managed_call (mb, to_oadate.299, 0B);
    conv_arg.302 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.302);
    <D.25867>:
    D.25860 = BIT_FIELD_REF <*t, 8, 56>;
    D.25861 = D.25860 & 64;
    if (D.25861 != 0) goto <D.25879>; else goto <D.25880>;
    <D.25879>:
    pos.303 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.303);
    <D.25880>:
    goto <D.19997>;
  }
  <D.25848>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.19997>; else goto <D.25884>;
  <D.25884>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.19997>; else goto <D.25887>;
  <D.25887>:
  D.25888 = mono_defaults.int_class;
  D.25889 = &D.25888->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25889);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25890>; else goto <D.25891>;
  <D.25890>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.25892>;
  <D.25891>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.25892>:
  mono_mb_emit_stloc (mb, 0);
  D.25893 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.25893);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.302);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25894>; else goto <D.25895>;
  <D.25894>:
  mono_mb_emit_ldloc (mb, 0);
  D.25896 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25896;
  <D.25895>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 == 0) goto <D.25897>; else goto <D.25899>;
  <D.25899>:
  D.25869 = t->attrs;
  D.25870 = (unsigned int) D.25869;
  D.25871 = D.25870 & 3;
  if (D.25871 != 2) goto <D.25897>; else goto <D.25898>;
  <D.25897>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.25898>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25900>; else goto <D.25901>;
  <D.25900>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25901>:
  goto <D.19997>;
  <D.19998>:
  if (spec != 0B) goto <D.25902>; else goto <D.25903>;
  <D.25902>:
  D.25904 = spec->native;
  if (D.25904 == 43) goto <D.25905>; else goto <D.25906>;
  <D.25905>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  D.25907 = D.25861 != 0;
  D.25908 = (long int) D.25907;
  D.25909 = __builtin_expect (D.25908, 0);
  if (D.25909 != 0) goto <D.25910>; else goto <D.25911>;
  <D.25910>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6301, "!t->byref");
  <D.25911>:
  D.25874 = m->csig;
  D.25874 = m->csig;
  D.25875 = D.25874->hasthis;
  D.25876 = (int) D.25875;
  D.25877 = argnum - D.25876;
  D.25888 = mono_defaults.int_class;
  D.25889 = &D.25888->byval_arg;
  D.25874->params[D.25877] = D.25889;
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.25912>; else goto <D.25915>;
  <D.25915>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.25912>; else goto <D.25913>;
  <D.25912>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  goto <D.25914>;
  <D.25913>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.25914>:
  goto <D.19997>;
  <D.25906>:
  <D.25903>:
  if (klass == date_time_class) goto <D.25916>; else goto <D.25917>;
  <D.25916>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25918>; else goto <D.25919>;
  <D.25918>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  goto <D.25920>;
  <D.25919>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.25920>:
  goto <D.19997>;
  <D.25917>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.25921>; else goto <D.25923>;
  <D.25923>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.25921>; else goto <D.25922>;
  <D.25921>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.19997>;
  <D.25922>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 == 0) goto <D.25924>; else goto <D.25925>;
  <D.25924>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 6, klass);
  <D.25925>:
  goto <D.19997>;
  <D.19999>:
  if (klass == date_time_class) goto <D.25926>; else goto <D.25927>;
  <D.25926>:
  {
    static struct MonoMethod * from_oadate;

    D.25860 = BIT_FIELD_REF <*t, 8, 56>;
    D.25861 = D.25860 & 64;
    if (D.25861 == 0) goto <D.19997>; else goto <D.25928>;
    <D.25928>:
    D.25869 = t->attrs;
    D.25870 = (unsigned int) D.25869;
    D.25871 = D.25870 & 3;
    if (D.25871 != 1) goto <D.25929>; else goto <D.25930>;
    <D.25929>:
    from_oadate.304 = from_oadate;
    if (from_oadate.304 == 0B) goto <D.25932>; else goto <D.25933>;
    <D.25932>:
    from_oadate.305 = mono_class_get_method_from_name (date_time_class, "FromOADate", 1);
    from_oadate = from_oadate.305;
    <D.25933>:
    from_oadate.304 = from_oadate;
    D.25935 = from_oadate.304 == 0B;
    D.25936 = (long int) D.25935;
    D.25937 = __builtin_expect (D.25936, 0);
    if (D.25937 != 0) goto <D.25938>; else goto <D.25939>;
    <D.25938>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6345, "from_oadate");
    <D.25939>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.301);
    conv_arg.302 = (unsigned int) conv_arg;
    mono_mb_emit_ldloc (mb, conv_arg.302);
    from_oadate.304 = from_oadate;
    mono_mb_emit_managed_call (mb, from_oadate.304, 0B);
    mono_mb_emit_op (mb, 129, date_time_class);
    <D.25930>:
    goto <D.19997>;
  }
  <D.25927>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.19997>; else goto <D.25940>;
  <D.25940>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.19997>; else goto <D.25941>;
  <D.25941>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25942>; else goto <D.25943>;
  <D.25942>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.25944 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25944;
  D.25869 = t->attrs;
  D.25870 = (unsigned int) D.25869;
  D.25871 = D.25870 & 3;
  if (D.25871 != 1) goto <D.25945>; else goto <D.25946>;
  <D.25945>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  <D.25946>:
  <D.25943>:
  emit_struct_free (mb, klass, conv_arg);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25947>; else goto <D.25948>;
  <D.25947>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25948>:
  goto <D.19997>;
  <D.20001>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.25949>; else goto <D.25951>;
  <D.25951>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25952 = D.25885 & 32;
  if (D.25952 != 0) goto <D.25949>; else goto <D.25950>;
  <D.25949>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.19997>;
  <D.25950>:
  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.19997>;
  <D.20002>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.25953>; else goto <D.25955>;
  <D.25955>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.25953>; else goto <D.25954>;
  <D.25953>:
  conv_arg = 0;
  goto <D.19997>;
  <D.25954>:
  D.25956 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25956);
  D.25869 = t->attrs;
  D.25957 = (int) D.25869;
  D.25958 = D.25957 & 2;
  if (D.25958 != 0) goto <D.19997>; else goto <D.25959>;
  <D.25959>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25960>; else goto <D.25961>;
  <D.25960>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.25962>;
  <D.25961>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.25962>:
  mono_mb_emit_stloc (mb, 0);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25963>; else goto <D.25964>;
  <D.25963>:
  mono_mb_emit_ldloc (mb, 0);
  D.25965 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25965;
  <D.25964>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25966>; else goto <D.25967>;
  <D.25966>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25967>:
  goto <D.19997>;
  <D.20003>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.19997>; else goto <D.25968>;
  <D.25968>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.19997>; else goto <D.25969>;
  <D.25969>:
  D.25860 = BIT_FIELD_REF <*t, 8, 56>;
  D.25861 = D.25860 & 64;
  if (D.25861 != 0) goto <D.25970>; else goto <D.25971>;
  <D.25970>:
  D.25869 = t->attrs;
  D.25870 = (unsigned int) D.25869;
  D.25871 = D.25870 & 3;
  if (D.25871 == 1) goto <D.19997>; else goto <D.25972>;
  <D.25972>:
  <D.25971>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  D.25973 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25973;
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  mono_mb_emit_stloc (mb, 0);
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos2.306 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.306);
  goto <D.19997>;
  <D.20004>:
  D.25882 = klass->flags;
  D.25883 = D.25882 & 24;
  if (D.25883 == 16) goto <D.25975>; else goto <D.25977>;
  <D.25977>:
  D.25885 = BIT_FIELD_REF <*klass, 8, 160>;
  D.25886 = D.25885 & 48;
  if (D.25886 != 0) goto <D.25975>; else goto <D.25976>;
  <D.25975>:
  mono_mb_emit_stloc (mb, 3);
  m->retobj_var = 0;
  goto <D.19997>;
  <D.25976>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  D.25888 = mono_defaults.int_class;
  D.25889 = &D.25888->byval_arg;
  D.25978 = mono_mb_add_local (mb, D.25889);
  m->retobj_var = D.25978;
  m->retobj_class = klass;
  D.25979 = m->retobj_var;
  D.25980 = D.25979 == 0;
  D.25981 = (long int) D.25980;
  D.25982 = __builtin_expect (D.25981, 0);
  if (D.25982 != 0) goto <D.25983>; else goto <D.25984>;
  <D.25983>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6481, "m->retobj_var");
  <D.25984>:
  D.25985 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.25985);
  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.25979 = m->retobj_var;
  D.25986 = (unsigned int) D.25979;
  mono_mb_emit_stloc (mb, D.25986);
  emit_struct_conv (mb, klass, 0);
  goto <D.19997>;
  <D.20005>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6494);
  <D.19997>:
  D.25987 = conv_arg;
  return D.25987;
}


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.25989;
  struct MonoType * D.25990;
  int * D.25991;
  unsigned int argnum.307;
  unsigned int D.25993;
  int * D.25994;
  struct MonoClass * D.25995;
  struct MonoClass * D.25996;
  unsigned char D.25999;
  unsigned char D.26000;
  unsigned char D.26003;
  unsigned char D.26004;
  short unsigned int D.26007;
  int D.26008;
  int D.26009;
  unsigned int conv_arg.308;
  unsigned int argnum.309;
  void * D.26015;
  struct MonoClass * D.26017;
  struct MonoMethodPInvoke * D.26020;
  unsigned int D.26023;
  unsigned int D.26024;
  void * D.26030;
  unsigned char D.26032;
  unsigned char D.26033;
  unsigned int D.26036;
  unsigned int pos.310;
  unsigned int D.26042;
  int D.26043;
  int D.26046;
  int D.26047;
  unsigned int D.26048;
  _Bool D.26051;
  long int D.26052;
  long int D.26053;
  void * D.26059;
  int need_free.311;
  void * D.26067;
  unsigned int D.26074;
  unsigned int D.26081;
  _Bool D.26084;
  long int D.26085;
  long int D.26086;
  unsigned int pos2.312;
  _Bool D.26095;
  long int D.26096;
  long int D.26097;
  void * D.26100;
  unsigned int loc.313;
  unsigned int D.26103;
  struct MonoType * D.26104;
  void * D.26109;
  _Bool D.26112;
  long int D.26113;
  long int D.26114;
  _Bool D.26119;
  long int D.26120;
  long int D.26121;
  unsigned int D.26124;
  unsigned int D.26125;
  unsigned int D.26132;
  unsigned int pos2.314;
  unsigned int D.26134;
  unsigned int D.26137;
  unsigned int D.26138;
  int D.26139;
  void * D.26143;
  unsigned int D.26146;
  unsigned int D.26147;
  int D.26148;
  int D.26149;
  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.20119>, case 0: <D.20097>, case 1: <D.20112>, case 2: <D.20104>, case 3: <D.20113>, case 4: <D.20114>, case 5: <D.20117>, case 6: <D.20118>>
  <D.20097>:
  D.25989 = mono_defaults.int_class;
  D.25990 = &D.25989->byval_arg;
  *conv_arg_type = D.25990;
  D.25989 = mono_defaults.int_class;
  D.25990 = &D.25989->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25990);
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  *D.25994 = 0;
  D.25995 = mono_class_from_mono_type (t);
  D.25996 = mono_defaults.object_class;
  if (D.25995 == D.25996) goto <D.25997>; else goto <D.25998>;
  <D.25997>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Marshalling of type object is not implemented");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20099>;
  }
  <D.25998>:
  D.25999 = BIT_FIELD_REF <*klass, 8, 184>;
  D.26000 = D.25999 & 1;
  if (D.26000 != 0) goto <D.26001>; else goto <D.26002>;
  <D.26001>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26005>; else goto <D.26006>;
  <D.26005>:
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 == 0) goto <D.26010>; else goto <D.26011>;
  <D.26010>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Byref marshalling of delegates is not implemented.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
  }
  <D.26011>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.26013>;
  <D.26006>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.26015 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26015);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  <D.26013>:
  goto <D.26016>;
  <D.26002>:
  D.26017 = mono_defaults.stringbuilder_class;
  if (D.26017 == klass) goto <D.26018>; else goto <D.26019>;
  <D.26018>:
  {
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    D.26020 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26020, spec);
    D.26020 = m->piinfo;
    conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.26020, spec);
    D.26003 = BIT_FIELD_REF <*t, 8, 56>;
    D.26004 = D.26003 & 64;
    if (D.26004 != 0) goto <D.26021>; else goto <D.26022>;
    <D.26021>:
    D.26007 = t->attrs;
    D.26023 = (unsigned int) D.26007;
    D.26024 = D.26023 & 3;
    if (D.26024 == 2) goto <D.20099>; else goto <D.26025>;
    <D.26025>:
    <D.26022>:
    if (conv == 4294967295) goto <D.26026>; else goto <D.26027>;
    <D.26026>:
    {
      char * msg;

      msg = monoeg_g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.20099>;
    }
    <D.26027>:
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    D.26003 = BIT_FIELD_REF <*t, 8, 56>;
    D.26004 = D.26003 & 64;
    if (D.26004 != 0) goto <D.26028>; else goto <D.26029>;
    <D.26028>:
    mono_mb_emit_byte (mb, 77);
    <D.26029>:
    D.26030 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.26030);
    conv_arg.308 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.308);
  }
  goto <D.26031>;
  <D.26019>:
  D.26032 = BIT_FIELD_REF <*klass, 8, 160>;
  D.26033 = D.26032 & 32;
  if (D.26033 != 0) goto <D.26034>; else goto <D.26035>;
  <D.26034>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.26036 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26036;
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_ldflda (mb, 8);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.20099>;
  <D.26035>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26038>; else goto <D.26039>;
  <D.26038>:
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 != 0) goto <D.20099>; else goto <D.26040>;
  <D.26040>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 77);
  goto <D.26041>;
  <D.26039>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 1);
  <D.26041>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26042 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26042;
  D.26043 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26043);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 15);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26044>; else goto <D.26045>;
  <D.26044>:
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.25989 = mono_defaults.int_class;
  D.25990 = &D.25989->byval_arg;
  D.26046 = mono_mb_add_local (mb, D.25990);
  *D.25994 = D.26046;
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.26047 = *D.25994;
  D.26048 = (unsigned int) D.26047;
  mono_mb_emit_stloc (mb, D.26048);
  <D.26045>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  <D.26031>:
  <D.26016>:
  goto <D.20099>;
  <D.20104>:
  D.26017 = mono_defaults.stringbuilder_class;
  if (D.26017 == klass) goto <D.26049>; else goto <D.26050>;
  <D.26049>:
  {
    gboolean need_free;
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    try
      {
        D.26020 = m->piinfo;
        encoding = mono_marshal_get_string_encoding (D.26020, spec);
        D.26020 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.26020, spec, &need_free);
        D.26051 = encoding == 4294967295;
        D.26052 = (long int) D.26051;
        D.26053 = __builtin_expect (D.26052, 0);
        if (D.26053 != 0) goto <D.26054>; else goto <D.26055>;
        <D.26054>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7051, "encoding != -1");
        <D.26055>:
        D.26003 = BIT_FIELD_REF <*t, 8, 56>;
        D.26004 = D.26003 & 64;
        if (D.26004 != 0) goto <D.26056>; else goto <D.26057>;
        <D.26056>:
        need_free = 1;
        argnum.309 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.309);
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        switch (encoding) <default: <D.20111>, case 20: <D.20110>, case 21: <D.20108>>
        <D.20108>:
        mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
        goto <D.20109>;
        <D.20110>:
        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
        goto <D.20109>;
        <D.20111>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7069);
        <D.20109>:
        mono_mb_emit_byte (mb, 81);
        goto <D.26058>;
        <D.26057>:
        argnum.309 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.309);
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        D.26059 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.26059);
        <D.26058>:
        need_free.311 = need_free;
        if (need_free.311 != 0) goto <D.26061>; else goto <D.26062>;
        <D.26061>:
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.26062>:
        goto <D.20099>;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.26050>:
  D.25999 = BIT_FIELD_REF <*klass, 8, 184>;
  D.26000 = D.25999 & 1;
  if (D.26000 != 0) goto <D.26063>; else goto <D.26064>;
  <D.26063>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26065>; else goto <D.26066>;
  <D.26065>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.26067 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26067);
  mono_mb_emit_byte (mb, 81);
  <D.26066>:
  goto <D.20099>;
  <D.26064>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26068>; else goto <D.26069>;
  <D.26068>:
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 != 0) goto <D.26070>; else goto <D.26071>;
  <D.26070>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_byte (mb, 81);
  <D.26071>:
  <D.26069>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26072>; else goto <D.26073>;
  <D.26072>:
  mono_mb_emit_byte (mb, 77);
  <D.26073>:
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26074 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26074;
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26075>; else goto <D.26078>;
  <D.26078>:
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 != 0) goto <D.26075>; else goto <D.26076>;
  <D.26075>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_stloc (mb, 1);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_stloc (mb, 0);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, conv_arg);
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.26047 = *D.25994;
  if (D.26047 != 0) goto <D.26079>; else goto <D.26080>;
  <D.26079>:
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.26047 = *D.25994;
  D.26048 = (unsigned int) D.26047;
  mono_mb_emit_ldloc (mb, D.26048);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.26081 = mono_mb_emit_branch (mb, 59);
  pos2 = (int) D.26081;
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 == 0) goto <D.26082>; else goto <D.26083>;
  <D.26082>:
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.26047 = *D.25994;
  D.26084 = D.26047 == 0;
  D.26085 = (long int) D.26084;
  D.26086 = __builtin_expect (D.26085, 0);
  if (D.26086 != 0) goto <D.26087>; else goto <D.26088>;
  <D.26087>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7144, "m->orig_conv_args [argnum]");
  <D.26088>:
  D.25991 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25993 = argnum.307 * 4;
  D.25994 = D.25991 + D.25993;
  D.26047 = *D.25994;
  emit_struct_free (mb, klass, D.26047);
  <D.26083>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos2.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  <D.26080>:
  goto <D.26077>;
  <D.26076>:
  emit_struct_free (mb, klass, conv_arg);
  <D.26077>:
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.20099>;
  <D.20112>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26090>; else goto <D.26091>;
  <D.26090>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.308);
  goto <D.26092>;
  <D.26091>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  <D.26092>:
  goto <D.20099>;
  <D.20113>:
  D.25999 = BIT_FIELD_REF <*klass, 8, 184>;
  D.26000 = D.25999 & 1;
  if (D.26000 != 0) goto <D.26093>; else goto <D.26094>;
  <D.26093>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  D.26095 = D.26004 != 0;
  D.26096 = (long int) D.26095;
  D.26097 = __builtin_expect (D.26096, 0);
  if (D.26097 != 0) goto <D.26098>; else goto <D.26099>;
  <D.26098>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7171, "!t->byref");
  <D.26099>:
  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.26100 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26100);
  mono_mb_emit_stloc (mb, 3);
  goto <D.26101>;
  <D.26094>:
  mono_mb_emit_stloc (mb, 0);
  D.25989 = mono_defaults.int_class;
  D.25990 = &D.25989->byval_arg;
  loc = mono_mb_add_local (mb, D.25990);
  mono_mb_emit_ldloc (mb, 0);
  loc.313 = (unsigned int) loc;
  mono_mb_emit_stloc (mb, loc.313);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 0);
  D.26103 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26103;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  mono_mb_emit_stloc (mb, 3);
  mono_mb_emit_ldloc (mb, 3);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  emit_struct_free (mb, klass, loc);
  loc.313 = (unsigned int) loc;
  mono_mb_emit_ldloc (mb, loc.313);
  mono_mb_emit_icall (mb, mono_marshal_free);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  <D.26101>:
  goto <D.20099>;
  <D.20114>:
  D.26104 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26104);
  D.25999 = BIT_FIELD_REF <*klass, 8, 184>;
  D.26000 = D.25999 & 1;
  if (D.26000 != 0) goto <D.26105>; else goto <D.26106>;
  <D.26105>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  D.26095 = D.26004 != 0;
  D.26096 = (long int) D.26095;
  D.26097 = __builtin_expect (D.26096, 0);
  if (D.26097 != 0) goto <D.26107>; else goto <D.26108>;
  <D.26107>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7221, "!t->byref");
  <D.26108>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 11, klass);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.26109 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26109);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.20099>;
  <D.26106>:
  D.26017 = mono_defaults.stringbuilder_class;
  if (D.26017 == klass) goto <D.26110>; else goto <D.26111>;
  <D.26110>:
  {
    MonoMarshalNative encoding;

    D.26020 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.26020, spec);
    D.26112 = encoding != 20;
    D.26113 = (long int) D.26112;
    D.26114 = __builtin_expect (D.26113, 0);
    if (D.26114 != 0) goto <D.26115>; else goto <D.26116>;
    <D.26115>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7236, "encoding == MONO_NATIVE_LPSTR");
    <D.26116>:
    D.26003 = BIT_FIELD_REF <*t, 8, 56>;
    D.26004 = D.26003 & 64;
    D.26095 = D.26004 != 0;
    D.26096 = (long int) D.26095;
    D.26097 = __builtin_expect (D.26096, 0);
    if (D.26097 != 0) goto <D.26117>; else goto <D.26118>;
    <D.26117>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7238, "!t->byref");
    <D.26118>:
    D.26119 = encoding == 4294967295;
    D.26120 = (long int) D.26119;
    D.26121 = __builtin_expect (D.26120, 0);
    if (D.26121 != 0) goto <D.26122>; else goto <D.26123>;
    <D.26122>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7239, "encoding != -1");
    <D.26123>:
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
    conv_arg.308 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.308);
    goto <D.20099>;
  }
  <D.26111>:
  D.26124 = klass->flags;
  D.26125 = D.26124 & 24;
  if (D.26125 == 0) goto <D.26126>; else goto <D.26127>;
  <D.26126>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20099>;
  <D.26127>:
  D.26007 = t->attrs;
  D.26008 = (int) D.26007;
  D.26009 = D.26008 & 2;
  if (D.26009 != 0) goto <D.26128>; else goto <D.26129>;
  <D.26128>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.20099>;
  <D.26129>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26130>; else goto <D.26131>;
  <D.26130>:
  {
    int pos2;

    D.26132 = mono_mb_emit_branch (mb, 58);
    pos2 = (int) D.26132;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos2.314 = (unsigned int) pos2;
    mono_mb_patch_branch (mb, pos2.314);
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    mono_mb_emit_byte (mb, 77);
  }
  <D.26131>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 22);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  mono_mb_emit_ldloc (mb, 0);
  D.26134 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26134;
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 4, klass);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 1);
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.20099>;
  <D.20117>:
  D.26003 = BIT_FIELD_REF <*t, 8, 56>;
  D.26004 = D.26003 & 64;
  if (D.26004 != 0) goto <D.26135>; else goto <D.26136>;
  <D.26135>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.26137 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26137;
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 22);
  mono_mb_emit_byte (mb, 81);
  D.26138 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26138;
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  D.26139 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26139);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_stloc (mb, 1);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_byte (mb, 223);
  emit_struct_conv (mb, klass, 0);
  pos2.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  goto <D.26140>;
  <D.26136>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.26140>:
  goto <D.20099>;
  <D.20118>:
  D.25999 = BIT_FIELD_REF <*klass, 8, 184>;
  D.26000 = D.25999 & 1;
  if (D.26000 != 0) goto <D.26141>; else goto <D.26142>;
  <D.26141>:
  D.26143 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26143);
  mono_mb_emit_stloc (mb, 3);
  goto <D.20099>;
  <D.26142>:
  D.26124 = klass->flags;
  D.26125 = D.26124 & 24;
  if (D.26125 == 0) goto <D.26144>; else goto <D.26145>;
  <D.26144>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20099>;
  <D.26145>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26146 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26146;
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  D.26147 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26147;
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  D.26148 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26148);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_icall (mb, mono_marshal_alloc);
  mono_mb_emit_byte (mb, 37);
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_stloc (mb, 3);
  emit_struct_conv (mb, klass, 0);
  pos2.312 = (unsigned int) pos2;
  mono_mb_patch_branch (mb, pos2.312);
  goto <D.20099>;
  <D.20119>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7389);
  <D.20099>:
  D.26149 = conv_arg;
  return D.26149;
}


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

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


mono_marshal_get_native_wrapper (struct MonoMethod * method, gboolean check_exceptions, gboolean aot)
{
  _Bool D.26154;
  long int D.26155;
  long int D.26156;
  struct MonoMethodSignature * D.26159;
  unsigned char D.26160;
  unsigned char D.26161;
  _Bool D.26162;
  long int D.26163;
  long int D.26164;
  struct MonoClass * D.26169;
  struct MonoImage * D.26170;
  struct GHashTable * * D.26171;
  struct GHashTable * * D.26173;
  struct MonoMethod * D.26176;
  unsigned int D.26177;
  unsigned int D.26178;
  short unsigned int D.26181;
  int D.26182;
  int D.26183;
  short unsigned int D.26186;
  int D.26187;
  int D.26188;
  void * D.26191;
  int D.26196;
  void * D.26203;
  _Bool D.26206;
  long int D.26207;
  long int D.26208;
  unsigned char D.26211;
  signed char D.26212;
  _Bool D.26213;
  long int D.26214;
  long int D.26215;
  unsigned char D.26218;
  unsigned char D.26219;
  _Bool D.26220;
  long int D.26221;
  long int D.26222;
  struct MonoClass * D.26225;
  struct MonoType * D.26226;
  int D.20480;
  int iftmp.315;
  int D.20476;
  const char[13] * D.26230;
  unsigned char D.26231;
  int D.26232;
  unsigned char D.26233;
  int D.26234;
  _Bool D.26235;
  _Bool D.26236;
  _Bool D.26237;
  const unsigned char * D.26240;
  unsigned char D.26241;
  int D.26242;
  const unsigned char * D.26243;
  unsigned char D.26244;
  int D.26245;
  _Bool D.26246;
  _Bool D.26247;
  const unsigned char * D.26250;
  unsigned char D.26251;
  int D.26252;
  const unsigned char * D.26253;
  unsigned char D.26254;
  int D.26255;
  _Bool D.26256;
  _Bool D.26257;
  const unsigned char * D.26260;
  unsigned char D.26261;
  int D.26262;
  const unsigned char * D.26263;
  unsigned char D.26264;
  int D.26265;
  const char * D.26267;
  struct MonoMethodSignature * D.26270;
  int D.26271;
  short unsigned int D.26274;
  int D.26275;
  int D.26276;
  _Bool D.26277;
  long int D.26278;
  long int D.26279;
  short unsigned int D.26282;
  int D.26283;
  int D.26284;
  _Bool D.26285;
  long int D.26286;
  long int D.26287;
  const char * D.26290;
  unsigned int i.316;
  short unsigned int D.26292;
  int D.26293;
  int D.26294;
  struct MonoMethod * D.26295;
  const char * exc_arg.317;
  const char * exc_class.318;
  int D.26302;
  int D.26303;
  unsigned char D.26309;
  unsigned int D.26314;
  unsigned int pos.319;
  <unnamed-unsigned:1> D.26316;
  int D.26317;
  int D.26318;
  unsigned int D.26319;
  short unsigned int D.26320;
  int D.26321;
  struct MonoMethod * D.26324;
  _Bool D.26326;
  long int D.26327;
  long int D.26328;
  _Bool D.26333;
  long int D.26334;
  long int D.26335;
  int D.26342;
  unsigned int D.26343;
  unsigned int D.26344;
  struct MonoClass * D.26345;
  struct MonoImage * D.26346;
  unsigned int i.320;
  unsigned int D.26348;
  struct MonoMarshalSpec * * D.26349;
  struct MonoMarshalSpec * D.26350;
  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.26154 = method == 0B;
      D.26155 = (long int) D.26154;
      D.26156 = __builtin_expect (D.26155, 0);
      if (D.26156 != 0) goto <D.26157>; else goto <D.26158>;
      <D.26157>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8859, "method != NULL");
      <D.26158>:
      D.26159 = mono_method_signature (method);
      D.26160 = BIT_FIELD_REF <*D.26159, 8, 88>;
      D.26161 = D.26160 & 1;
      D.26162 = D.26161 == 0;
      D.26163 = (long int) D.26162;
      D.26164 = __builtin_expect (D.26163, 0);
      if (D.26164 != 0) goto <D.26165>; else goto <D.26166>;
      <D.26165>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8860, "mono_method_signature (method)->pinvoke");
      <D.26166>:
      if (aot != 0) goto <D.26167>; else goto <D.26168>;
      <D.26167>:
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      D.26171 = &D.26170->native_wrapper_aot_cache;
      cache = get_cache (D.26171, mono_aligned_addr_hash, 0B);
      goto <D.26172>;
      <D.26168>:
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      D.26173 = &D.26170->native_wrapper_cache;
      cache = get_cache (D.26173, mono_aligned_addr_hash, 0B);
      <D.26172>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26174>; else goto <D.26175>;
      <D.26174>:
      D.26176 = res;
      return D.26176;
      <D.26175>:
      D.26169 = method->klass;
      D.26177 = D.26169->flags;
      D.26178 = D.26177 & 4096;
      if (D.26178 != 0) goto <D.26179>; else goto <D.26180>;
      <D.26179>:
      D.26176 = mono_cominterop_get_native_wrapper (method);
      return D.26176;
      <D.26180>:
      sig = mono_method_signature (method);
      D.26181 = method->iflags;
      D.26182 = (int) D.26181;
      D.26183 = D.26182 & 4096;
      if (D.26183 == 0) goto <D.26184>; else goto <D.26185>;
      <D.26184>:
      D.26186 = method->flags;
      D.26187 = (int) D.26186;
      D.26188 = D.26187 & 8192;
      if (D.26188 != 0) goto <D.26189>; else goto <D.26190>;
      <D.26189>:
      pinvoke = 1;
      <D.26190>:
      <D.26185>:
      D.26191 = piinfo->addr;
      if (D.26191 == 0B) goto <D.26192>; else goto <D.26193>;
      <D.26192>:
      if (pinvoke != 0) goto <D.26194>; else goto <D.26195>;
      <D.26194>:
      D.26181 = method->iflags;
      D.26182 = (int) D.26181;
      D.26196 = D.26182 & 1;
      if (D.26196 != 0) goto <D.26197>; else goto <D.26198>;
      <D.26197>:
      exc_arg = "Method contains unsupported native code";
      goto <D.26199>;
      <D.26198>:
      if (aot == 0) goto <D.26200>; else goto <D.26201>;
      <D.26200>:
      mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
      <D.26201>:
      <D.26199>:
      goto <D.26202>;
      <D.26195>:
      D.26203 = mono_lookup_internal_call (method);
      piinfo->addr = D.26203;
      <D.26202>:
      <D.26193>:
      D.26191 = piinfo->addr;
      if (D.26191 == ves_icall_System_String_ctor_RedirectToCreateString) goto <D.26204>; else goto <D.26205>;
      <D.26204>:
      D.26206 = pinvoke != 0;
      D.26207 = (long int) D.26206;
      D.26208 = __builtin_expect (D.26207, 0);
      if (D.26208 != 0) goto <D.26209>; else goto <D.26210>;
      <D.26209>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8896, "!pinvoke");
      <D.26210>:
      D.26211 = BIT_FIELD_REF <*method, 8, 160>;
      D.26212 = (signed char) D.26211;
      D.26213 = D.26212 >= 0;
      D.26214 = (long int) D.26213;
      D.26215 = __builtin_expect (D.26214, 0);
      if (D.26215 != 0) goto <D.26216>; else goto <D.26217>;
      <D.26216>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8897, "method->string_ctor");
      <D.26217>:
      D.26218 = BIT_FIELD_REF <*sig, 8, 80>;
      D.26219 = D.26218 & 64;
      D.26220 = D.26219 == 0;
      D.26221 = (long int) D.26220;
      D.26222 = __builtin_expect (D.26221, 0);
      if (D.26222 != 0) goto <D.26223>; else goto <D.26224>;
      <D.26223>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8898, "sig->hasthis");
      <D.26224>:
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup (D.26170, sig);
      D.26225 = mono_defaults.string_class;
      D.26226 = &D.26225->byval_arg;
      csig->ret = D.26226;
      csig->pinvoke = 0;
      iter = 0B;
      goto <D.20486>;
      <D.20485>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = res->name;
          D.26230 = "CreateString";
          D.26231 = MEM[(const unsigned char *)D.26230];
          D.26232 = (int) D.26231;
          D.26233 = *__s2;
          D.26234 = (int) D.26233;
          __result = D.26232 - D.26234;
          {
            D.26235 = __s1_len != 0;
            D.26236 = __result == 0;
            D.26237 = D.26235 & D.26236;
            if (D.26237 != 0) goto <D.26238>; else goto <D.26239>;
            <D.26238>:
            D.26240 = &MEM[(void *)"CreateString" + 1B];
            D.26241 = *D.26240;
            D.26242 = (int) D.26241;
            D.26243 = __s2 + 1;
            D.26244 = *D.26243;
            D.26245 = (int) D.26244;
            __result = D.26242 - D.26245;
            D.26246 = __s1_len > 1;
            D.26236 = __result == 0;
            D.26247 = D.26246 & D.26236;
            if (D.26247 != 0) goto <D.26248>; else goto <D.26249>;
            <D.26248>:
            D.26250 = &MEM[(void *)"CreateString" + 2B];
            D.26251 = *D.26250;
            D.26252 = (int) D.26251;
            D.26253 = __s2 + 2;
            D.26254 = *D.26253;
            D.26255 = (int) D.26254;
            __result = D.26252 - D.26255;
            D.26256 = __s1_len > 2;
            D.26236 = __result == 0;
            D.26257 = D.26256 & D.26236;
            if (D.26257 != 0) goto <D.26258>; else goto <D.26259>;
            <D.26258>:
            D.26260 = &MEM[(void *)"CreateString" + 3B];
            D.26261 = *D.26260;
            D.26262 = (int) D.26261;
            D.26263 = __s2 + 3;
            D.26264 = *D.26263;
            D.26265 = (int) D.26264;
            __result = D.26262 - D.26265;
            <D.26259>:
            <D.26249>:
            <D.26239>:
          }
          D.20476 = __result;
        }
        iftmp.315 = D.20476;
        goto <D.26266>;
        <D.26229>:
        D.26267 = res->name;
        iftmp.315 = __builtin_strcmp ("CreateString", D.26267);
        <D.26266>:
        D.20480 = iftmp.315;
      }
      if (D.20480 == 0) goto <D.26268>; else goto <D.26269>;
      <D.26268>:
      D.26270 = mono_method_signature (res);
      D.26271 = mono_metadata_signature_equal (csig, D.26270);
      if (D.26271 != 0) goto <D.26272>; else goto <D.26273>;
      <D.26272>:
      {
        struct WrapperInfo * info;

        D.26274 = res->iflags;
        D.26275 = (int) D.26274;
        D.26276 = D.26275 & 4096;
        D.26277 = D.26276 != 0;
        D.26278 = (long int) D.26277;
        D.26279 = __builtin_expect (D.26278, 0);
        if (D.26279 != 0) goto <D.26280>; else goto <D.26281>;
        <D.26280>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8911, "!(res->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)");
        <D.26281>:
        D.26282 = res->flags;
        D.26283 = (int) D.26282;
        D.26284 = D.26283 & 8192;
        D.26285 = D.26284 != 0;
        D.26286 = (long int) D.26285;
        D.26287 = __builtin_expect (D.26286, 0);
        if (D.26287 != 0) goto <D.26288>; else goto <D.26289>;
        <D.26288>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8912, "!(res->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)");
        <D.26289>:
        D.26290 = method->name;
        D.26169 = method->klass;
        mb = mono_mb_new (D.26169, D.26290, 7);
        mono_mb_emit_byte (mb, 2);
        i = 1;
        goto <D.20483>;
        <D.20482>:
        i.316 = (unsigned int) i;
        mono_mb_emit_ldarg (mb, i.316);
        i = i + 1;
        <D.20483>:
        D.26292 = csig->param_count;
        D.26293 = (int) D.26292;
        if (D.26293 >= i) goto <D.20482>; else goto <D.20484>;
        <D.20484>:
        mono_mb_emit_managed_call (mb, res, 0B);
        mono_mb_emit_byte (mb, 42);
        D.26292 = csig->param_count;
        D.26293 = (int) D.26292;
        D.26294 = D.26293 + 1;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.26294);
        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.26176 = res;
        return D.26176;
      }
      <D.26273>:
      <D.26269>:
      <D.20486>:
      D.26225 = mono_defaults.string_class;
      res = mono_class_get_methods (D.26225, &iter);
      if (res != 0B) goto <D.20485>; else goto <D.20487>;
      <D.20487>:
      piinfo->addr = 0B;
      monoeg_g_log (0B, 16, "cannot find CreateString for .ctor");
      <D.26205>:
      D.26290 = method->name;
      D.26169 = method->klass;
      mb = mono_mb_new (D.26169, D.26290, 6);
      D.26295 = mb->method;
      D.26295->save_lmf = 1;
      D.26191 = piinfo->addr;
      if (D.26191 == 0B) goto <D.26296>; else goto <D.26297>;
      <D.26296>:
      if (aot == 0) goto <D.26298>; else goto <D.26299>;
      <D.26298>:
      exc_arg.317 = exc_arg;
      exc_class.318 = exc_class;
      mono_mb_emit_exception (mb, exc_class.318, exc_arg.317);
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup (D.26170, sig);
      csig->pinvoke = 0;
      D.26292 = csig->param_count;
      D.26293 = (int) D.26292;
      D.26302 = D.26293 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26302);
      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.26176 = res;
      return D.26176;
      <D.26299>:
      <D.26297>:
      D.26181 = method->iflags;
      D.26182 = (int) D.26181;
      D.26303 = D.26182 & 4099;
      if (D.26303 != 0) goto <D.26304>; else goto <D.26305>;
      <D.26304>:
      D.26218 = BIT_FIELD_REF <*sig, 8, 80>;
      D.26219 = D.26218 & 64;
      if (D.26219 != 0) goto <D.26306>; else goto <D.26307>;
      <D.26306>:
      D.26169 = method->klass;
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup_add_this (D.26170, sig, D.26169);
      goto <D.26308>;
      <D.26307>:
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup (D.26170, sig);
      <D.26308>:
      D.26211 = BIT_FIELD_REF <*method, 8, 160>;
      D.26309 = D.26211 & 128;
      if (D.26309 != 0) goto <D.26310>; else goto <D.26311>;
      <D.26310>:
      D.26225 = mono_defaults.string_class;
      D.26226 = &D.26225->byval_arg;
      csig->ret = D.26226;
      <D.26311>:
      D.26218 = BIT_FIELD_REF <*sig, 8, 80>;
      D.26219 = D.26218 & 64;
      if (D.26219 != 0) goto <D.26312>; else goto <D.26313>;
      <D.26312>:
      {
        int pos;

        mono_mb_emit_byte (mb, 2);
        D.26314 = mono_mb_emit_branch (mb, 58);
        pos = (int) D.26314;
        mono_mb_emit_exception (mb, "NullReferenceException", 0B);
        pos.319 = (unsigned int) pos;
        mono_mb_patch_branch (mb, pos.319);
        mono_mb_emit_byte (mb, 2);
      }
      <D.26313>:
      i = 0;
      goto <D.20490>;
      <D.20489>:
      D.26316 = sig->hasthis;
      D.26317 = (int) D.26316;
      D.26318 = D.26317 + i;
      D.26319 = (unsigned int) D.26318;
      mono_mb_emit_ldarg (mb, D.26319);
      i = i + 1;
      <D.20490>:
      D.26320 = sig->param_count;
      D.26321 = (int) D.26320;
      if (D.26321 > i) goto <D.20489>; else goto <D.20491>;
      <D.20491>:
      if (aot != 0) goto <D.26322>; else goto <D.26323>;
      <D.26322>:
      mono_mb_emit_byte (mb, 240);
      D.26324 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.26324);
      mono_mb_emit_calli (mb, csig);
      goto <D.26325>;
      <D.26323>:
      D.26191 = piinfo->addr;
      D.26326 = D.26191 == 0B;
      D.26327 = (long int) D.26326;
      D.26328 = __builtin_expect (D.26327, 0);
      if (D.26328 != 0) goto <D.26329>; else goto <D.26330>;
      <D.26329>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9005, "piinfo->addr");
      <D.26330>:
      D.26191 = piinfo->addr;
      mono_mb_emit_native_call (mb, csig, D.26191);
      <D.26325>:
      if (check_exceptions != 0) goto <D.26331>; else goto <D.26332>;
      <D.26331>:
      emit_thread_interrupt_checkpoint (mb);
      <D.26332>:
      mono_mb_emit_byte (mb, 42);
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup (D.26170, csig);
      csig->pinvoke = 0;
      D.26292 = csig->param_count;
      D.26293 = (int) D.26292;
      D.26302 = D.26293 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26302);
      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.26176 = res;
      return D.26176;
      <D.26305>:
      D.26333 = pinvoke == 0;
      D.26334 = (long int) D.26333;
      D.26335 = __builtin_expect (D.26334, 0);
      if (D.26335 != 0) goto <D.26336>; else goto <D.26337>;
      <D.26336>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9026, "pinvoke");
      <D.26337>:
      if (aot == 0) goto <D.26338>; else goto <D.26339>;
      <D.26338>:
      D.26191 = piinfo->addr;
      D.26326 = D.26191 == 0B;
      D.26327 = (long int) D.26326;
      D.26328 = __builtin_expect (D.26327, 0);
      if (D.26328 != 0) goto <D.26340>; else goto <D.26341>;
      <D.26340>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9028, "piinfo->addr");
      <D.26341>:
      <D.26339>:
      D.26320 = sig->param_count;
      D.26321 = (int) D.26320;
      D.26342 = D.26321 + 1;
      D.26343 = (unsigned int) D.26342;
      D.26344 = D.26343 * 4;
      mspecs = monoeg_malloc (D.26344);
      mono_method_get_marshal_info (method, mspecs);
      D.26191 = piinfo->addr;
      D.26295 = mb->method;
      D.26345 = D.26295->klass;
      D.26346 = D.26345->image;
      mono_marshal_emit_native_wrapper (D.26346, mb, sig, piinfo, mspecs, D.26191, aot, check_exceptions, 0);
      D.26169 = method->klass;
      D.26170 = D.26169->image;
      csig = signature_dup (D.26170, sig);
      csig->pinvoke = 0;
      D.26292 = csig->param_count;
      D.26293 = (int) D.26292;
      D.26302 = D.26293 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26302);
      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.26320 = sig->param_count;
      i = (int) D.26320;
      goto <D.20493>;
      <D.20492>:
      i.320 = (unsigned int) i;
      D.26348 = i.320 * 4;
      D.26349 = mspecs + D.26348;
      D.26350 = *D.26349;
      if (D.26350 != 0B) goto <D.26351>; else goto <D.26352>;
      <D.26351>:
      i.320 = (unsigned int) i;
      D.26348 = i.320 * 4;
      D.26349 = mspecs + D.26348;
      D.26350 = *D.26349;
      mono_metadata_free_marshal_spec (D.26350);
      <D.26352>:
      i = i + -1;
      <D.20493>:
      if (i >= 0) goto <D.20492>; else goto <D.20494>;
      <D.20494>:
      monoeg_g_free (mspecs);
      D.26176 = res;
      return D.26176;
    }
  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.26355;
  struct MonoMethod * D.26358;
  struct MonoClass * D.26359;
  struct MonoMethod * D.26360;
  short unsigned int D.26361;
  int D.26362;
  int D.26363;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;

  D.26355 = &image->native_wrapper_cache;
  cache = get_cache (D.26355, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, func);
  if (res != 0B) goto <D.26356>; else goto <D.26357>;
  <D.26356>:
  D.26358 = res;
  return D.26358;
  <D.26357>:
  name = monoeg_g_strdup_printf ("wrapper_native_%p", func);
  D.26359 = mono_defaults.object_class;
  mb = mono_mb_new (D.26359, name, 6);
  D.26360 = mb->method;
  D.26360->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.26361 = csig->param_count;
  D.26362 = (int) D.26361;
  D.26363 = D.26362 + 16;
  res = mono_mb_create_and_cache (cache, func, mb, csig, D.26363);
  mono_mb_free (mb);
  mono_marshal_set_wrapper_info (res, 0B);
  D.26358 = res;
  return D.26358;
}


mono_marshal_get_native_func_wrapper_aot (struct MonoClass * klass)
{
  struct MonoClass * D.26365;
  struct GHashTable * * D.26366;
  struct MonoMethod * D.26369;
  struct MonoMethodSignature * D.26370;
  short unsigned int D.26371;
  int D.26372;
  int D.26373;
  unsigned int D.26374;
  unsigned int D.26375;
  struct MonoMethodSignature * D.26376;
  struct MonoMethod * D.26377;
  unsigned char D.26378;
  unsigned char D.26379;
  _Bool D.26380;
  long int D.26381;
  long int D.26382;
  struct MonoClass * D.26385;
  short unsigned int D.26386;
  int D.26387;
  int D.26388;
  struct MonoMethodSignature * D.26389;
  short unsigned int D.26390;
  unsigned int i.321;
  unsigned int D.26392;
  struct MonoMarshalSpec * * D.26393;
  struct MonoMarshalSpec * D.26394;
  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.26365 = invoke->klass;
      image = D.26365->image;
      D.26366 = &image->native_func_wrapper_aot_cache;
      cache = get_cache (D.26366, mono_aligned_addr_hash, 0B);
      res = mono_marshal_find_in_cache (cache, invoke);
      if (res != 0B) goto <D.26367>; else goto <D.26368>;
      <D.26367>:
      D.26369 = res;
      return D.26369;
      <D.26368>:
      memset (&mpiinfo, 0, 32);
      parse_unmanaged_function_pointer_attr (klass, &mpiinfo);
      D.26370 = mono_method_signature (invoke);
      D.26371 = D.26370->param_count;
      D.26372 = (int) D.26371;
      D.26373 = D.26372 + 1;
      D.26374 = (unsigned int) D.26373;
      D.26375 = D.26374 * 4;
      mspecs = monoeg_malloc0 (D.26375);
      mono_method_get_marshal_info (invoke, mspecs);
      D.26376 = mono_method_signature (invoke);
      sig = mono_metadata_signature_dup (D.26376);
      sig->hasthis = 0;
      name = monoeg_g_strdup_printf ("wrapper_aot_native");
      D.26365 = invoke->klass;
      mb = mono_mb_new (D.26365, name, 6);
      D.26377 = mb->method;
      D.26377->save_lmf = 1;
      mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, 0B, 0, 1, 1);
      D.26378 = BIT_FIELD_REF <*sig, 8, 80>;
      D.26379 = D.26378 & 64;
      D.26380 = D.26379 != 0;
      D.26381 = (long int) D.26380;
      D.26382 = __builtin_expect (D.26381, 0);
      if (D.26382 != 0) goto <D.26383>; else goto <D.26384>;
      <D.26383>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9148, "!sig->hasthis");
      <D.26384>:
      D.26385 = mono_defaults.int_class;
      csig = signature_dup_add_this (image, sig, D.26385);
      csig->pinvoke = 0;
      D.26386 = csig->param_count;
      D.26387 = (int) D.26386;
      D.26388 = D.26387 + 16;
      res = mono_mb_create_and_cache (cache, invoke, mb, csig, D.26388);
      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.26389 = mono_method_signature (invoke);
      D.26390 = D.26389->param_count;
      i = (int) D.26390;
      goto <D.20524>;
      <D.20523>:
      i.321 = (unsigned int) i;
      D.26392 = i.321 * 4;
      D.26393 = mspecs + D.26392;
      D.26394 = *D.26393;
      if (D.26394 != 0B) goto <D.26395>; else goto <D.26396>;
      <D.26395>:
      i.321 = (unsigned int) i;
      D.26392 = i.321 * 4;
      D.26393 = mspecs + D.26392;
      D.26394 = *D.26393;
      mono_metadata_free_marshal_spec (D.26394);
      <D.26396>:
      i = i + -1;
      <D.20524>:
      if (i >= 0) goto <D.20523>; else goto <D.20525>;
      <D.20525>:
      monoeg_g_free (mspecs);
      monoeg_g_free (sig);
      D.26369 = res;
      return D.26369;
    }
  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.26399;
  struct MonoType * D.26400;
  struct MonoClass * D.26401;
  struct MonoType * D.26402;
  unsigned char D.26403;
  unsigned char D.26404;
  short unsigned int D.26407;
  short unsigned int D.26408;
  int D.26411;
  int D.26412;
  int D.26413;
  _Bool D.26414;
  long int D.26415;
  long int D.26416;
  int D.26419;
  unsigned int D.26420;
  unsigned int D.26421;
  struct MonoType * * D.26422;
  struct MonoType * * D.26423;
  short unsigned int D.26424;
  short unsigned int D.26425;
  struct MonoType * D.26426;
  int D.26427;
  unsigned int D.26430;
  unsigned int D.26431;
  unsigned char D.26432;
  int D.26433;
  unsigned int i.322;
  unsigned int D.26435;
  int * D.26436;
  struct MonoType * * D.26437;
  sizetype i.323;
  sizetype D.26439;
  sizetype D.26440;
  struct MonoMarshalSpec * * D.26441;
  struct MonoMarshalSpec * D.26442;
  struct MonoType * D.26443;
  int D.26444;
  int target_handle.324;
  int D.26454;
  unsigned char D.26457;
  unsigned char D.26458;
  unsigned int D.26461;
  unsigned int i.325;
  struct MonoMarshalSpec * D.26467;
  <unnamed type> D.26469;
  unsigned char D.26471;
  unsigned char D.26472;
  unsigned char D.26475;
  int D.26476;
  <unnamed type> D.26481;
  unsigned char D.26483;
  unsigned char D.26484;
  unsigned char D.26487;
  int D.26488;
  struct MonoType * D.26491;
  short unsigned int D.26492;
  int D.26493;
  int D.26494;
  int D.26497;
  unsigned int D.26500;
  struct MonoClass * D.26501;
  int D.26503;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  int i;
  int * tmp_locals;
  gboolean closed;

  closed = 0;
  sig = m->sig;
  csig = m->csig;
  D.26399 = mono_defaults.int_class;
  D.26400 = &D.26399->byval_arg;
  mono_mb_add_local (mb, D.26400);
  D.26399 = mono_defaults.int_class;
  D.26400 = &D.26399->byval_arg;
  mono_mb_add_local (mb, D.26400);
  D.26401 = mono_defaults.boolean_class;
  D.26402 = &D.26401->byval_arg;
  mono_mb_add_local (mb, D.26402);
  D.26403 = BIT_FIELD_REF <*sig, 8, 80>;
  D.26404 = D.26403 & 64;
  if (D.26404 == 0) goto <D.26405>; else goto <D.26406>;
  <D.26405>:
  D.26407 = sig->param_count;
  D.26408 = invoke_sig->param_count;
  if (D.26407 != D.26408) goto <D.26409>; else goto <D.26410>;
  <D.26409>:
  D.26407 = sig->param_count;
  D.26411 = (int) D.26407;
  D.26408 = invoke_sig->param_count;
  D.26412 = (int) D.26408;
  D.26413 = D.26412 + 1;
  D.26414 = D.26411 != D.26413;
  D.26415 = (long int) D.26414;
  D.26416 = __builtin_expect (D.26415, 0);
  if (D.26416 != 0) goto <D.26417>; else goto <D.26418>;
  <D.26417>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9229, "sig->param_count == invoke_sig->param_count + 1");
  <D.26418>:
  closed = 1;
  sig = mono_metadata_signature_dup (sig);
  D.26407 = sig->param_count;
  D.26411 = (int) D.26407;
  D.26419 = D.26411 + -1;
  D.26420 = (unsigned int) D.26419;
  D.26421 = D.26420 * 4;
  D.26422 = &sig->params[1];
  D.26423 = &sig->params[0];
  memmove (D.26423, D.26422, D.26421);
  D.26407 = sig->param_count;
  D.26424 = D.26407;
  D.26425 = D.26424 + 65535;
  sig->param_count = D.26425;
  <D.26410>:
  <D.26406>:
  D.26426 = sig->ret;
  D.26427 = mono_type_is_void (D.26426);
  if (D.26427 == 0) goto <D.26428>; else goto <D.26429>;
  <D.26428>:
  D.26426 = sig->ret;
  mono_mb_add_local (mb, D.26426);
  <D.26429>:
  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.26407 = sig->param_count;
  D.26430 = (unsigned int) D.26407;
  D.26431 = D.26430 * 4;
  tmp_locals = __builtin_alloca (D.26431);
  i = 0;
  goto <D.20550>;
  <D.20549>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.26432 = t->type;
    D.26433 = (int) D.26432;
    switch (D.26433) <default: <D.20548>, case 2: <D.20546>, case 14: <D.20545>, case 17: <D.20542>, case 18: <D.20541>, case 20: <D.20543>, case 28: <D.20540>, case 29: <D.20544>>
    <D.20540>:
    <D.20541>:
    <D.20542>:
    <D.20543>:
    <D.20544>:
    <D.20545>:
    <D.20546>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26437 = &csig->params[i];
    i.323 = (sizetype) i;
    D.26439 = i.323 + 1;
    D.26440 = D.26439 * 4;
    D.26441 = mspecs + D.26440;
    D.26442 = *D.26441;
    D.26443 = sig->params[i];
    D.26444 = emit_marshal (m, i, D.26443, D.26442, 0, D.26437, 4);
    *D.26436 = D.26444;
    goto <D.20547>;
    <D.20548>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    *D.26436 = 0;
    goto <D.20547>;
    <D.20547>:
  }
  i = i + 1;
  <D.20550>:
  D.26407 = sig->param_count;
  D.26411 = (int) D.26407;
  if (D.26411 > i) goto <D.20549>; else goto <D.20551>;
  <D.20551>:
  emit_thread_interrupt_checkpoint (mb);
  D.26403 = BIT_FIELD_REF <*sig, 8, 80>;
  D.26404 = D.26403 & 64;
  if (D.26404 != 0) goto <D.26445>; else goto <D.26446>;
  <D.26445>:
  if (target_handle != 0) goto <D.26447>; else goto <D.26448>;
  <D.26447>:
  target_handle.324 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.324);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  goto <D.26450>;
  <D.26448>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9282);
  <D.26450>:
  goto <D.26451>;
  <D.26446>:
  if (closed != 0) goto <D.26452>; else goto <D.26453>;
  <D.26452>:
  target_handle.324 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.324);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  <D.26453>:
  <D.26451>:
  i = 0;
  goto <D.20554>;
  <D.20553>:
  {
    struct MonoType * t;

    t = sig->params[i];
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    if (D.26454 != 0) goto <D.26455>; else goto <D.26456>;
    <D.26455>:
    D.26457 = BIT_FIELD_REF <*t, 8, 56>;
    D.26458 = D.26457 & 64;
    if (D.26458 != 0) goto <D.26459>; else goto <D.26460>;
    <D.26459>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    D.26461 = (unsigned int) D.26454;
    mono_mb_emit_ldloc_addr (mb, D.26461);
    goto <D.26462>;
    <D.26460>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    D.26461 = (unsigned int) D.26454;
    mono_mb_emit_ldloc (mb, D.26461);
    <D.26462>:
    goto <D.26463>;
    <D.26456>:
    i.325 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.325);
    <D.26463>:
  }
  i = i + 1;
  <D.20554>:
  D.26407 = sig->param_count;
  D.26411 = (int) D.26407;
  if (D.26411 > i) goto <D.20553>; else goto <D.20555>;
  <D.20555>:
  mono_mb_emit_managed_call (mb, method, 0B);
  D.26467 = *mspecs;
  if (D.26467 != 0B) goto <D.26468>; else goto <D.26465>;
  <D.26468>:
  D.26467 = *mspecs;
  D.26469 = D.26467->native;
  if (D.26469 == 44) goto <D.26470>; else goto <D.26465>;
  <D.26470>:
  D.26467 = *mspecs;
  D.26426 = sig->ret;
  emit_marshal (m, 0, D.26426, D.26467, 0, 0B, 6);
  goto <D.26466>;
  <D.26465>:
  D.26426 = sig->ret;
  D.26471 = BIT_FIELD_REF <*D.26426, 8, 56>;
  D.26472 = D.26471 & 64;
  if (D.26472 == 0) goto <D.26473>; else goto <D.26474>;
  <D.26473>:
  D.26426 = sig->ret;
  D.26475 = D.26426->type;
  D.26476 = (int) D.26475;
  switch (D.26476) <default: <D.20578>, case 1: <D.20556>, case 2: <D.20558>, case 3: <D.20561>, case 4: <D.20559>, case 5: <D.20560>, case 6: <D.20562>, case 7: <D.20563>, case 8: <D.20564>, case 9: <D.20565>, case 10: <D.20571>, case 11: <D.20572>, case 12: <D.20569>, case 13: <D.20570>, case 14: <D.20574>, case 15: <D.20568>, case 17: <D.20575>, case 18: <D.20576>, case 24: <D.20566>, case 25: <D.20567>, case 28: <D.20573>, case 29: <D.20577>>
  <D.20556>:
  goto <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>:
  <D.20571>:
  <D.20572>:
  <D.20573>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20557>;
  <D.20574>:
  D.26399 = mono_defaults.int_class;
  D.26400 = &D.26399->byval_arg;
  csig->ret = D.26400;
  D.26467 = *mspecs;
  D.26426 = sig->ret;
  emit_marshal (m, 0, D.26426, D.26467, 0, 0B, 6);
  goto <D.20557>;
  <D.20575>:
  <D.20576>:
  <D.20577>:
  D.26467 = *mspecs;
  D.26426 = sig->ret;
  emit_marshal (m, 0, D.26426, D.26467, 0, 0B, 6);
  goto <D.20557>;
  <D.20578>:
  D.26426 = sig->ret;
  D.26475 = D.26426->type;
  D.26476 = (int) D.26475;
  monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.26476);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9339);
  <D.20557>:
  goto <D.26477>;
  <D.26474>:
  mono_mb_emit_stloc (mb, 3);
  <D.26477>:
  <D.26466>:
  i = 0;
  goto <D.20593>;
  <D.20592>:
  {
    struct MonoType * t;
    struct MonoMarshalSpec * spec;

    t = sig->params[i];
    i.323 = (sizetype) i;
    D.26439 = i.323 + 1;
    D.26440 = D.26439 * 4;
    D.26441 = mspecs + D.26440;
    spec = *D.26441;
    if (spec != 0B) goto <D.26480>; else goto <D.26478>;
    <D.26480>:
    D.26481 = spec->native;
    if (D.26481 == 44) goto <D.26482>; else goto <D.26478>;
    <D.26482>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    i.323 = (sizetype) i;
    D.26439 = i.323 + 1;
    D.26440 = D.26439 * 4;
    D.26441 = mspecs + D.26440;
    D.26442 = *D.26441;
    emit_marshal (m, i, t, D.26442, D.26454, 0B, 5);
    goto <D.26479>;
    <D.26478>:
    D.26483 = BIT_FIELD_REF <*t, 8, 56>;
    D.26484 = D.26483 & 64;
    if (D.26484 != 0) goto <D.26485>; else goto <D.26486>;
    <D.26485>:
    D.26487 = t->type;
    D.26488 = (int) D.26487;
    switch (D.26488) <default: <D.26489>, case 2: <D.20585>, case 14: <D.20584>, case 17: <D.20582>, case 18: <D.20581>, case 28: <D.20583>>
    <D.20581>:
    <D.20582>:
    <D.20583>:
    <D.20584>:
    <D.20585>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    i.323 = (sizetype) i;
    D.26439 = i.323 + 1;
    D.26440 = D.26439 * 4;
    D.26441 = mspecs + D.26440;
    D.26442 = *D.26441;
    emit_marshal (m, i, t, D.26442, D.26454, 0B, 5);
    goto <D.20586>;
    <D.26489>:
    <D.20586>:
    goto <D.26490>;
    <D.26486>:
    D.26491 = invoke_sig->params[i];
    D.26492 = D.26491->attrs;
    D.26493 = (int) D.26492;
    D.26494 = D.26493 & 2;
    if (D.26494 != 0) goto <D.26495>; else goto <D.26496>;
    <D.26495>:
    D.26487 = t->type;
    D.26488 = (int) D.26487;
    switch (D.26488) <default: <D.20591>, case 17: <D.20589>, case 18: <D.20588>, case 29: <D.20587>>
    <D.20587>:
    <D.20588>:
    <D.20589>:
    i.322 = (unsigned int) i;
    D.26435 = i.322 * 4;
    D.26436 = tmp_locals + D.26435;
    D.26454 = *D.26436;
    i.323 = (sizetype) i;
    D.26439 = i.323 + 1;
    D.26440 = D.26439 * 4;
    D.26441 = mspecs + D.26440;
    D.26442 = *D.26441;
    D.26491 = invoke_sig->params[i];
    emit_marshal (m, i, D.26491, D.26442, D.26454, 0B, 5);
    goto <D.20590>;
    <D.20591>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9373);
    <D.20590>:
    <D.26496>:
    <D.26490>:
    <D.26479>:
  }
  i = i + 1;
  <D.20593>:
  D.26407 = sig->param_count;
  D.26411 = (int) D.26407;
  if (D.26411 > i) goto <D.20592>; else goto <D.20594>;
  <D.20594>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 18);
  D.26497 = m->retobj_var;
  if (D.26497 != 0) goto <D.26498>; else goto <D.26499>;
  <D.26498>:
  D.26497 = m->retobj_var;
  D.26500 = (unsigned int) D.26497;
  mono_mb_emit_ldloc (mb, D.26500);
  mono_mb_emit_byte (mb, 240);
  D.26501 = m->retobj_class;
  mono_mb_emit_op (mb, 5, D.26501);
  goto <D.26502>;
  <D.26499>:
  D.26426 = sig->ret;
  D.26503 = mono_type_is_void (D.26426);
  if (D.26503 == 0) goto <D.26504>; else goto <D.26505>;
  <D.26504>:
  mono_mb_emit_ldloc (mb, 3);
  <D.26505>:
  mono_mb_emit_byte (mb, 42);
  <D.26502>:
  if (closed != 0) goto <D.26506>; else goto <D.26507>;
  <D.26506>:
  monoeg_g_free (sig);
  <D.26507>:
}


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

  D.26512 = __builtin_object_size (__dest, 0);
  D.26511 = __builtin___memmove_chk (__dest, __src, __len, D.26512);
  return D.26511;
}


mono_marshal_get_managed_wrapper (struct MonoMethod * method, struct MonoClass * delegate_klass, uint32_t target_handle)
{
  _Bool D.26514;
  long int D.26515;
  long int D.26516;
  struct MonoMethodSignature * D.26519;
  unsigned char D.26520;
  unsigned char D.26521;
  _Bool D.26522;
  long int D.26523;
  long int D.26524;
  struct MonoClass * D.26527;
  struct MonoImage * D.26528;
  struct GHashTable * * D.26529;
  struct MonoMethod * D.26534;
  struct MonoMethodSignature * D.26535;
  short unsigned int D.26536;
  int D.26537;
  int D.26538;
  unsigned int D.26539;
  unsigned int D.26540;
  const char * D.26541;
  void * target_handle.326;
  struct MonoClass * UnmanagedFunctionPointerAttribute.327;
  struct MonoImage * D.26549;
  struct MonoClass * UnmanagedFunctionPointerAttribute.328;
  struct MonoMethod * D.26555;
  int D.26556;
  int D.26559;
  unsigned int D.26562;
  const mono_byte * D.26563;
  struct MonoMethod * D.26564;
  int D.26565;
  _Bool D.26566;
  long int D.26567;
  long int D.26568;
  struct MonoArray * typed_args.329;
  unsigned int D.26572;
  _Bool D.26573;
  long int D.26574;
  long int D.26575;
  char * D.26578;
  void * D.26579;
  struct CattrNamedArg * arginfo.330;
  unsigned int i.331;
  unsigned int D.26582;
  unsigned int i.332;
  struct MonoArray * named_args.333;
  char * D.26585;
  struct MonoClassField * D.26586;
  _Bool D.26587;
  long int D.26588;
  long int D.26589;
  int D.20692;
  int iftmp.334;
  int D.20691;
  const char[8] * D.26595;
  unsigned char D.26596;
  int D.26597;
  unsigned char D.26598;
  int D.26599;
  _Bool D.26600;
  _Bool D.26601;
  _Bool D.26602;
  const unsigned char * D.26605;
  unsigned char D.26606;
  int D.26607;
  const unsigned char * D.26608;
  unsigned char D.26609;
  int D.26610;
  _Bool D.26611;
  _Bool D.26612;
  const unsigned char * D.26615;
  unsigned char D.26616;
  int D.26617;
  const unsigned char * D.26618;
  unsigned char D.26619;
  int D.26620;
  _Bool D.26621;
  _Bool D.26622;
  const unsigned char * D.26625;
  unsigned char D.26626;
  int D.26627;
  const unsigned char * D.26628;
  unsigned char D.26629;
  int D.26630;
  const char * D.26632;
  void * D.26635;
  int D.20701;
  int iftmp.335;
  int D.20700;
  const char[13] * D.26640;
  unsigned char D.26641;
  int D.26642;
  unsigned char D.26643;
  int D.26644;
  _Bool D.26645;
  _Bool D.26646;
  _Bool D.26647;
  const unsigned char * D.26650;
  unsigned char D.26651;
  int D.26652;
  const unsigned char * D.26653;
  unsigned char D.26654;
  int D.26655;
  _Bool D.26656;
  _Bool D.26657;
  const unsigned char * D.26660;
  unsigned char D.26661;
  int D.26662;
  const unsigned char * D.26663;
  unsigned char D.26664;
  int D.26665;
  _Bool D.26666;
  _Bool D.26667;
  const unsigned char * D.26670;
  unsigned char D.26671;
  int D.26672;
  const unsigned char * D.26673;
  unsigned char D.26674;
  int D.26675;
  void * D.26679;
  int D.20710;
  int iftmp.336;
  int D.20709;
  const char[15] * D.26684;
  unsigned char D.26685;
  int D.26686;
  unsigned char D.26687;
  int D.26688;
  _Bool D.26689;
  _Bool D.26690;
  _Bool D.26691;
  const unsigned char * D.26694;
  unsigned char D.26695;
  int D.26696;
  const unsigned char * D.26697;
  unsigned char D.26698;
  int D.26699;
  _Bool D.26700;
  _Bool D.26701;
  const unsigned char * D.26704;
  unsigned char D.26705;
  int D.26706;
  const unsigned char * D.26707;
  unsigned char D.26708;
  int D.26709;
  _Bool D.26710;
  _Bool D.26711;
  const unsigned char * D.26714;
  unsigned char D.26715;
  int D.26716;
  const unsigned char * D.26717;
  unsigned char D.26718;
  int D.26719;
  void * D.26723;
  int D.20719;
  int iftmp.337;
  int D.20718;
  const char[22] * D.26728;
  unsigned char D.26729;
  int D.26730;
  unsigned char D.26731;
  int D.26732;
  _Bool D.26733;
  _Bool D.26734;
  _Bool D.26735;
  const unsigned char * D.26738;
  unsigned char D.26739;
  int D.26740;
  const unsigned char * D.26741;
  unsigned char D.26742;
  int D.26743;
  _Bool D.26744;
  _Bool D.26745;
  const unsigned char * D.26748;
  unsigned char D.26749;
  int D.26750;
  const unsigned char * D.26751;
  unsigned char D.26752;
  int D.26753;
  _Bool D.26754;
  _Bool D.26755;
  const unsigned char * D.26758;
  unsigned char D.26759;
  int D.26760;
  const unsigned char * D.26761;
  unsigned char D.26762;
  int D.26763;
  void * D.26767;
  unsigned int D.26769;
  int D.26770;
  signed short D.26771;
  signed short iftmp.338;
  int D.26775;
  unsigned short D.26776;
  unsigned short D.26777;
  signed short D.26779;
  signed short D.26780;
  signed short D.26781;
  short unsigned int D.26782;
  unsigned char D.26783;
  unsigned char D.26784;
  <unnamed-unsigned:6> D.26785;
  int D.26788;
  short unsigned int D.26793;
  int D.26794;
  int D.26795;
  struct MonoMethodSignature * D.26797;
  short unsigned int D.26798;
  unsigned int D.26799;
  struct MonoMarshalSpec * * D.26800;
  struct MonoMarshalSpec * D.26801;
  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.26514 = method == 0B;
      D.26515 = (long int) D.26514;
      D.26516 = __builtin_expect (D.26515, 0);
      if (D.26516 != 0) goto <D.26517>; else goto <D.26518>;
      <D.26517>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9450, "method != NULL");
      <D.26518>:
      D.26519 = mono_method_signature (method);
      D.26520 = BIT_FIELD_REF <*D.26519, 8, 88>;
      D.26521 = D.26520 & 1;
      D.26522 = D.26521 != 0;
      D.26523 = (long int) D.26522;
      D.26524 = __builtin_expect (D.26523, 0);
      if (D.26524 != 0) goto <D.26525>; else goto <D.26526>;
      <D.26525>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9451, "!mono_method_signature (method)->pinvoke");
      <D.26526>:
      D.26527 = method->klass;
      D.26528 = D.26527->image;
      D.26529 = &D.26528->managed_wrapper_cache;
      cache = get_cache (D.26529, mono_aligned_addr_hash, 0B);
      if (target_handle == 0) goto <D.26530>; else goto <D.26531>;
      <D.26530>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26532>; else goto <D.26533>;
      <D.26532>:
      D.26534 = res;
      return D.26534;
      <D.26533>:
      <D.26531>:
      invoke = mono_get_delegate_invoke (delegate_klass);
      invoke_sig = mono_method_signature (invoke);
      D.26535 = mono_method_signature (invoke);
      D.26536 = D.26535->param_count;
      D.26537 = (int) D.26536;
      D.26538 = D.26537 + 1;
      D.26539 = (unsigned int) D.26538;
      D.26540 = D.26539 * 4;
      mspecs = monoeg_malloc0 (D.26540);
      mono_method_get_marshal_info (invoke, mspecs);
      sig = mono_method_signature (method);
      D.26541 = method->name;
      D.26527 = method->klass;
      mb = mono_mb_new (D.26527, D.26541, 5);
      target_handle.326 = (void *) target_handle;
      mono_mb_add_data (mb, target_handle.326);
      if (target_handle != 0) goto <D.26543>; else goto <D.26544>;
      <D.26543>:
      csig = mono_metadata_signature_dup (invoke_sig);
      goto <D.26545>;
      <D.26544>:
      D.26527 = method->klass;
      D.26528 = D.26527->image;
      csig = signature_dup (D.26528, invoke_sig);
      <D.26545>:
      csig->hasthis = 0;
      csig->pinvoke = 1;
      m.mb = mb;
      m.sig = sig;
      m.piinfo = 0B;
      m.retobj_var = 0;
      m.csig = csig;
      D.26527 = method->klass;
      D.26528 = D.26527->image;
      m.image = D.26528;
      mono_marshal_set_callconv_from_modopt (invoke, csig);
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 == 0B) goto <D.26547>; else goto <D.26548>;
      <D.26547>:
      D.26549 = mono_defaults.corlib;
      UnmanagedFunctionPointerAttribute.328 = mono_class_from_name (D.26549, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
      UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.328;
      <D.26548>:
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 != 0B) goto <D.26551>; else goto <D.26552>;
      <D.26551>:
      {
        struct MonoCustomAttrInfo * cinfo;
        struct MonoCustomAttrEntry * attr;

        cinfo = mono_custom_attrs_from_class (delegate_klass);
        attr = 0B;
        if (cinfo != 0B) goto <D.26553>; else goto <D.26554>;
        <D.26553>:
        i = 0;
        goto <D.20672>;
        <D.20671>:
        {
          struct MonoClass * ctor_class;

          D.26555 = cinfo->attrs[i].ctor;
          ctor_class = D.26555->klass;
          UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
          D.26556 = mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute.327);
          if (D.26556 != 0) goto <D.26557>; else goto <D.26558>;
          <D.26557>:
          attr = &cinfo->attrs[i];
          goto <D.20670>;
          <D.26558>:
        }
        i = i + 1;
        <D.20672>:
        D.26559 = cinfo->num_attrs;
        if (D.26559 > i) goto <D.20671>; else goto <D.20670>;
        <D.20670>:
        <D.26554>:
        if (attr != 0B) goto <D.26560>; else goto <D.26561>;
        <D.26560>:
        {
          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.26562 = attr->data_size;
              D.26563 = attr->data;
              D.26564 = attr->ctor;
              D.26549 = mono_defaults.corlib;
              mono_reflection_create_custom_attr_data_args (D.26549, D.26564, D.26563, D.26562, &typed_args, &named_args, &arginfo, &error);
              D.26565 = mono_error_ok (&error);
              D.26566 = D.26565 == 0;
              D.26567 = (long int) D.26566;
              D.26568 = __builtin_expect (D.26567, 0);
              if (D.26568 != 0) goto <D.26569>; else goto <D.26570>;
              <D.26569>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9530, "mono_error_ok (&error)");
              <D.26570>:
              typed_args.329 = typed_args;
              D.26572 = mono_array_length (typed_args.329);
              D.26573 = D.26572 != 1;
              D.26574 = (long int) D.26573;
              D.26575 = __builtin_expect (D.26574, 0);
              if (D.26575 != 0) goto <D.26576>; else goto <D.26577>;
              <D.26576>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9531, "mono_array_length (typed_args) == 1");
              <D.26577>:
              typed_args.329 = typed_args;
              D.26578 = mono_array_addr_with_size (typed_args.329, 4, 0);
              o = MEM[(struct MonoObject * *)D.26578];
              D.26579 = mono_object_unbox (o);
              call_conv = MEM[(gint32 *)D.26579];
              i = 0;
              goto <D.20721>;
              <D.20720>:
              {
                struct CattrNamedArg * narg;

                arginfo.330 = arginfo;
                i.331 = (unsigned int) i;
                D.26582 = i.331 * 12;
                narg = arginfo.330 + D.26582;
                i.332 = (unsigned int) i;
                named_args.333 = named_args;
                D.26585 = mono_array_addr_with_size (named_args.333, 4, i.332);
                o = MEM[(struct MonoObject * *)D.26585];
                D.26586 = narg->field;
                D.26587 = D.26586 == 0B;
                D.26588 = (long int) D.26587;
                D.26589 = __builtin_expect (D.26588, 0);
                if (D.26589 != 0) goto <D.26590>; else goto <D.26591>;
                <D.26590>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9543, "narg->field");
                <D.26591>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26586 = narg->field;
                    __s2 = D.26586->name;
                    D.26595 = "CharSet";
                    D.26596 = MEM[(const unsigned char *)D.26595];
                    D.26597 = (int) D.26596;
                    D.26598 = *__s2;
                    D.26599 = (int) D.26598;
                    __result = D.26597 - D.26599;
                    {
                      D.26600 = __s2_len != 0;
                      D.26601 = __result == 0;
                      D.26602 = D.26600 & D.26601;
                      if (D.26602 != 0) goto <D.26603>; else goto <D.26604>;
                      <D.26603>:
                      D.26605 = &MEM[(void *)"CharSet" + 1B];
                      D.26606 = *D.26605;
                      D.26607 = (int) D.26606;
                      D.26608 = __s2 + 1;
                      D.26609 = *D.26608;
                      D.26610 = (int) D.26609;
                      __result = D.26607 - D.26610;
                      D.26611 = __s2_len > 1;
                      D.26601 = __result == 0;
                      D.26612 = D.26611 & D.26601;
                      if (D.26612 != 0) goto <D.26613>; else goto <D.26614>;
                      <D.26613>:
                      D.26615 = &MEM[(void *)"CharSet" + 2B];
                      D.26616 = *D.26615;
                      D.26617 = (int) D.26616;
                      D.26618 = __s2 + 2;
                      D.26619 = *D.26618;
                      D.26620 = (int) D.26619;
                      __result = D.26617 - D.26620;
                      D.26621 = __s2_len > 2;
                      D.26601 = __result == 0;
                      D.26622 = D.26621 & D.26601;
                      if (D.26622 != 0) goto <D.26623>; else goto <D.26624>;
                      <D.26623>:
                      D.26625 = &MEM[(void *)"CharSet" + 3B];
                      D.26626 = *D.26625;
                      D.26627 = (int) D.26626;
                      D.26628 = __s2 + 3;
                      D.26629 = *D.26628;
                      D.26630 = (int) D.26629;
                      __result = D.26627 - D.26630;
                      <D.26624>:
                      <D.26614>:
                      <D.26604>:
                    }
                    D.20691 = __result;
                  }
                  iftmp.334 = -D.20691;
                  goto <D.26631>;
                  <D.26594>:
                  D.26586 = narg->field;
                  D.26632 = D.26586->name;
                  iftmp.334 = __builtin_strcmp (D.26632, "CharSet");
                  <D.26631>:
                  D.20692 = iftmp.334;
                }
                if (D.20692 == 0) goto <D.26633>; else goto <D.26634>;
                <D.26633>:
                D.26635 = mono_object_unbox (o);
                charset = MEM[(gint32 *)D.26635];
                goto <D.26636>;
                <D.26634>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26586 = narg->field;
                    __s2 = D.26586->name;
                    D.26640 = "SetLastError";
                    D.26641 = MEM[(const unsigned char *)D.26640];
                    D.26642 = (int) D.26641;
                    D.26643 = *__s2;
                    D.26644 = (int) D.26643;
                    __result = D.26642 - D.26644;
                    {
                      D.26645 = __s2_len != 0;
                      D.26646 = __result == 0;
                      D.26647 = D.26645 & D.26646;
                      if (D.26647 != 0) goto <D.26648>; else goto <D.26649>;
                      <D.26648>:
                      D.26650 = &MEM[(void *)"SetLastError" + 1B];
                      D.26651 = *D.26650;
                      D.26652 = (int) D.26651;
                      D.26653 = __s2 + 1;
                      D.26654 = *D.26653;
                      D.26655 = (int) D.26654;
                      __result = D.26652 - D.26655;
                      D.26656 = __s2_len > 1;
                      D.26646 = __result == 0;
                      D.26657 = D.26656 & D.26646;
                      if (D.26657 != 0) goto <D.26658>; else goto <D.26659>;
                      <D.26658>:
                      D.26660 = &MEM[(void *)"SetLastError" + 2B];
                      D.26661 = *D.26660;
                      D.26662 = (int) D.26661;
                      D.26663 = __s2 + 2;
                      D.26664 = *D.26663;
                      D.26665 = (int) D.26664;
                      __result = D.26662 - D.26665;
                      D.26666 = __s2_len > 2;
                      D.26646 = __result == 0;
                      D.26667 = D.26666 & D.26646;
                      if (D.26667 != 0) goto <D.26668>; else goto <D.26669>;
                      <D.26668>:
                      D.26670 = &MEM[(void *)"SetLastError" + 3B];
                      D.26671 = *D.26670;
                      D.26672 = (int) D.26671;
                      D.26673 = __s2 + 3;
                      D.26674 = *D.26673;
                      D.26675 = (int) D.26674;
                      __result = D.26672 - D.26675;
                      <D.26669>:
                      <D.26659>:
                      <D.26649>:
                    }
                    D.20700 = __result;
                  }
                  iftmp.335 = -D.20700;
                  goto <D.26676>;
                  <D.26639>:
                  D.26586 = narg->field;
                  D.26632 = D.26586->name;
                  iftmp.335 = __builtin_strcmp (D.26632, "SetLastError");
                  <D.26676>:
                  D.20701 = iftmp.335;
                }
                if (D.20701 == 0) goto <D.26677>; else goto <D.26678>;
                <D.26677>:
                D.26679 = mono_object_unbox (o);
                set_last_error = MEM[(MonoBoolean *)D.26679];
                goto <D.26680>;
                <D.26678>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26586 = narg->field;
                    __s2 = D.26586->name;
                    D.26684 = "BestFitMapping";
                    D.26685 = MEM[(const unsigned char *)D.26684];
                    D.26686 = (int) D.26685;
                    D.26687 = *__s2;
                    D.26688 = (int) D.26687;
                    __result = D.26686 - D.26688;
                    {
                      D.26689 = __s2_len != 0;
                      D.26690 = __result == 0;
                      D.26691 = D.26689 & D.26690;
                      if (D.26691 != 0) goto <D.26692>; else goto <D.26693>;
                      <D.26692>:
                      D.26694 = &MEM[(void *)"BestFitMapping" + 1B];
                      D.26695 = *D.26694;
                      D.26696 = (int) D.26695;
                      D.26697 = __s2 + 1;
                      D.26698 = *D.26697;
                      D.26699 = (int) D.26698;
                      __result = D.26696 - D.26699;
                      D.26700 = __s2_len > 1;
                      D.26690 = __result == 0;
                      D.26701 = D.26700 & D.26690;
                      if (D.26701 != 0) goto <D.26702>; else goto <D.26703>;
                      <D.26702>:
                      D.26704 = &MEM[(void *)"BestFitMapping" + 2B];
                      D.26705 = *D.26704;
                      D.26706 = (int) D.26705;
                      D.26707 = __s2 + 2;
                      D.26708 = *D.26707;
                      D.26709 = (int) D.26708;
                      __result = D.26706 - D.26709;
                      D.26710 = __s2_len > 2;
                      D.26690 = __result == 0;
                      D.26711 = D.26710 & D.26690;
                      if (D.26711 != 0) goto <D.26712>; else goto <D.26713>;
                      <D.26712>:
                      D.26714 = &MEM[(void *)"BestFitMapping" + 3B];
                      D.26715 = *D.26714;
                      D.26716 = (int) D.26715;
                      D.26717 = __s2 + 3;
                      D.26718 = *D.26717;
                      D.26719 = (int) D.26718;
                      __result = D.26716 - D.26719;
                      <D.26713>:
                      <D.26703>:
                      <D.26693>:
                    }
                    D.20709 = __result;
                  }
                  iftmp.336 = -D.20709;
                  goto <D.26720>;
                  <D.26683>:
                  D.26586 = narg->field;
                  D.26632 = D.26586->name;
                  iftmp.336 = __builtin_strcmp (D.26632, "BestFitMapping");
                  <D.26720>:
                  D.20710 = iftmp.336;
                }
                if (D.20710 == 0) goto <D.26721>; else goto <D.26722>;
                <D.26721>:
                D.26723 = mono_object_unbox (o);
                best_fit_mapping = MEM[(MonoBoolean *)D.26723];
                goto <D.26724>;
                <D.26722>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26586 = narg->field;
                    __s2 = D.26586->name;
                    D.26728 = "ThrowOnUnmappableChar";
                    D.26729 = MEM[(const unsigned char *)D.26728];
                    D.26730 = (int) D.26729;
                    D.26731 = *__s2;
                    D.26732 = (int) D.26731;
                    __result = D.26730 - D.26732;
                    {
                      D.26733 = __s2_len != 0;
                      D.26734 = __result == 0;
                      D.26735 = D.26733 & D.26734;
                      if (D.26735 != 0) goto <D.26736>; else goto <D.26737>;
                      <D.26736>:
                      D.26738 = &MEM[(void *)"ThrowOnUnmappableChar" + 1B];
                      D.26739 = *D.26738;
                      D.26740 = (int) D.26739;
                      D.26741 = __s2 + 1;
                      D.26742 = *D.26741;
                      D.26743 = (int) D.26742;
                      __result = D.26740 - D.26743;
                      D.26744 = __s2_len > 1;
                      D.26734 = __result == 0;
                      D.26745 = D.26744 & D.26734;
                      if (D.26745 != 0) goto <D.26746>; else goto <D.26747>;
                      <D.26746>:
                      D.26748 = &MEM[(void *)"ThrowOnUnmappableChar" + 2B];
                      D.26749 = *D.26748;
                      D.26750 = (int) D.26749;
                      D.26751 = __s2 + 2;
                      D.26752 = *D.26751;
                      D.26753 = (int) D.26752;
                      __result = D.26750 - D.26753;
                      D.26754 = __s2_len > 2;
                      D.26734 = __result == 0;
                      D.26755 = D.26754 & D.26734;
                      if (D.26755 != 0) goto <D.26756>; else goto <D.26757>;
                      <D.26756>:
                      D.26758 = &MEM[(void *)"ThrowOnUnmappableChar" + 3B];
                      D.26759 = *D.26758;
                      D.26760 = (int) D.26759;
                      D.26761 = __s2 + 3;
                      D.26762 = *D.26761;
                      D.26763 = (int) D.26762;
                      __result = D.26760 - D.26763;
                      <D.26757>:
                      <D.26747>:
                      <D.26737>:
                    }
                    D.20718 = __result;
                  }
                  iftmp.337 = -D.20718;
                  goto <D.26764>;
                  <D.26727>:
                  D.26586 = narg->field;
                  D.26632 = D.26586->name;
                  iftmp.337 = __builtin_strcmp (D.26632, "ThrowOnUnmappableChar");
                  <D.26764>:
                  D.20719 = iftmp.337;
                }
                if (D.20719 == 0) goto <D.26765>; else goto <D.26766>;
                <D.26765>:
                D.26767 = mono_object_unbox (o);
                throw_on_unmappable = MEM[(MonoBoolean *)D.26767];
                goto <D.26768>;
                <D.26766>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9553);
                <D.26768>:
                <D.26724>:
                <D.26680>:
                <D.26636>:
              }
              i = i + 1;
              <D.20721>:
              i.332 = (unsigned int) i;
              named_args.333 = named_args;
              D.26769 = mono_array_length (named_args.333);
              if (i.332 < D.26769) goto <D.20720>; else goto <D.20722>;
              <D.20722>:
              arginfo.330 = arginfo;
              monoeg_g_free (arginfo.330);
              memset (&piinfo, 0, 32);
              m.piinfo = &piinfo;
              D.26770 = call_conv << 8;
              D.26771 = (signed short) D.26770;
              if (charset != 0) goto <D.26773>; else goto <D.26774>;
              <D.26773>:
              D.26775 = charset + -1;
              D.26776 = (unsigned short) D.26775;
              D.26777 = D.26776 * 2;
              iftmp.338 = (signed short) D.26777;
              goto <D.26778>;
              <D.26774>:
              iftmp.338 = 1;
              <D.26778>:
              D.26779 = D.26771 | iftmp.338;
              D.26780 = (signed short) set_last_error;
              D.26781 = D.26779 | D.26780;
              D.26782 = (short unsigned int) D.26781;
              piinfo.piflags = D.26782;
              D.26783 = (unsigned char) call_conv;
              D.26784 = D.26783 + 255;
              D.26785 = (<unnamed-unsigned:6>) D.26784;
              csig->call_convention = D.26785;
            }
          finally
            {
              typed_args = {CLOBBER};
              named_args = {CLOBBER};
              arginfo = {CLOBBER};
              error = {CLOBBER};
            }
        }
        <D.26561>:
        if (cinfo != 0B) goto <D.26786>; else goto <D.26787>;
        <D.26786>:
        D.26788 = cinfo->cached;
        if (D.26788 == 0) goto <D.26789>; else goto <D.26790>;
        <D.26789>:
        mono_custom_attrs_free (cinfo);
        <D.26790>:
        <D.26787>:
      }
      <D.26552>:
      mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
      if (target_handle == 0) goto <D.26791>; else goto <D.26792>;
      <D.26791>:
      {
        struct WrapperInfo * info;

        D.26793 = sig->param_count;
        D.26794 = (int) D.26793;
        D.26795 = D.26794 + 16;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.26795);
        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.26796>;
      <D.26792>:
      mb->dynamic = 1;
      D.26793 = sig->param_count;
      D.26794 = (int) D.26793;
      D.26795 = D.26794 + 16;
      res = mono_mb_create_method (mb, csig, D.26795);
      <D.26796>:
      mono_mb_free (mb);
      D.26797 = mono_method_signature (invoke);
      D.26798 = D.26797->param_count;
      i = (int) D.26798;
      goto <D.20725>;
      <D.20724>:
      i.331 = (unsigned int) i;
      D.26799 = i.331 * 4;
      D.26800 = mspecs + D.26799;
      D.26801 = *D.26800;
      if (D.26801 != 0B) goto <D.26802>; else goto <D.26803>;
      <D.26802>:
      i.331 = (unsigned int) i;
      D.26799 = i.331 * 4;
      D.26800 = mspecs + D.26799;
      D.26801 = *D.26800;
      mono_metadata_free_marshal_spec (D.26801);
      <D.26803>:
      i = i + -1;
      <D.20725>:
      if (i >= 0) goto <D.20724>; else goto <D.20726>;
      <D.20726>:
      monoeg_g_free (mspecs);
      D.26534 = res;
      return D.26534;
    }
  finally
    {
      piinfo = {CLOBBER};
      m = {CLOBBER};
    }
}


mono_marshal_set_callconv_from_modopt (struct MonoMethod * method, struct MonoMethodSignature * csig)
{
  struct MonoType * D.26806;
  unsigned char D.26809;
  unsigned char D.26810;
  <unnamed-unsigned:31> D.26813;
  unsigned int D.26814;
  struct MonoClass * D.26815;
  struct MonoImage * D.26816;
  _Bool D.26817;
  long int D.26818;
  long int D.26819;
  struct MonoImage * D.26822;
  struct MonoImage * D.26823;
  int D.20610;
  int iftmp.339;
  int D.20609;
  const char[32] * D.26829;
  unsigned char D.26830;
  int D.26831;
  unsigned char D.26832;
  int D.26833;
  _Bool D.26834;
  _Bool D.26835;
  _Bool D.26836;
  const unsigned char * D.26839;
  unsigned char D.26840;
  int D.26841;
  const unsigned char * D.26842;
  unsigned char D.26843;
  int D.26844;
  _Bool D.26845;
  _Bool D.26846;
  const unsigned char * D.26849;
  unsigned char D.26850;
  int D.26851;
  const unsigned char * D.26852;
  unsigned char D.26853;
  int D.26854;
  _Bool D.26855;
  _Bool D.26856;
  const unsigned char * D.26859;
  unsigned char D.26860;
  int D.26861;
  const unsigned char * D.26862;
  unsigned char D.26863;
  int D.26864;
  const char * D.26866;
  int D.20619;
  int iftmp.340;
  int D.20618;
  const char[14] * D.26872;
  unsigned char D.26873;
  int D.26874;
  unsigned char D.26875;
  int D.26876;
  _Bool D.26877;
  _Bool D.26878;
  _Bool D.26879;
  const unsigned char * D.26882;
  unsigned char D.26883;
  int D.26884;
  const unsigned char * D.26885;
  unsigned char D.26886;
  int D.26887;
  _Bool D.26888;
  _Bool D.26889;
  const unsigned char * D.26892;
  unsigned char D.26893;
  int D.26894;
  const unsigned char * D.26895;
  unsigned char D.26896;
  int D.26897;
  _Bool D.26898;
  _Bool D.26899;
  const unsigned char * D.26902;
  unsigned char D.26903;
  int D.26904;
  const unsigned char * D.26905;
  unsigned char D.26906;
  int D.26907;
  const char * D.26909;
  int D.20628;
  int iftmp.341;
  int D.20627;
  const char[16] * D.26916;
  unsigned char D.26917;
  int D.26918;
  unsigned char D.26919;
  int D.26920;
  _Bool D.26921;
  _Bool D.26922;
  _Bool D.26923;
  const unsigned char * D.26926;
  unsigned char D.26927;
  int D.26928;
  const unsigned char * D.26929;
  unsigned char D.26930;
  int D.26931;
  _Bool D.26932;
  _Bool D.26933;
  const unsigned char * D.26936;
  unsigned char D.26937;
  int D.26938;
  const unsigned char * D.26939;
  unsigned char D.26940;
  int D.26941;
  _Bool D.26942;
  _Bool D.26943;
  const unsigned char * D.26946;
  unsigned char D.26947;
  int D.26948;
  const unsigned char * D.26949;
  unsigned char D.26950;
  int D.26951;
  int D.20637;
  int iftmp.342;
  int D.20636;
  const char[17] * D.26959;
  unsigned char D.26960;
  int D.26961;
  unsigned char D.26962;
  int D.26963;
  _Bool D.26964;
  _Bool D.26965;
  _Bool D.26966;
  const unsigned char * D.26969;
  unsigned char D.26970;
  int D.26971;
  const unsigned char * D.26972;
  unsigned char D.26973;
  int D.26974;
  _Bool D.26975;
  _Bool D.26976;
  const unsigned char * D.26979;
  unsigned char D.26980;
  int D.26981;
  const unsigned char * D.26982;
  unsigned char D.26983;
  int D.26984;
  _Bool D.26985;
  _Bool D.26986;
  const unsigned char * D.26989;
  unsigned char D.26990;
  int D.26991;
  const unsigned char * D.26992;
  unsigned char D.26993;
  int D.26994;
  int D.20646;
  int iftmp.343;
  int D.20645;
  const char[17] * D.27002;
  unsigned char D.27003;
  int D.27004;
  unsigned char D.27005;
  int D.27006;
  _Bool D.27007;
  _Bool D.27008;
  _Bool D.27009;
  const unsigned char * D.27012;
  unsigned char D.27013;
  int D.27014;
  const unsigned char * D.27015;
  unsigned char D.27016;
  int D.27017;
  _Bool D.27018;
  _Bool D.27019;
  const unsigned char * D.27022;
  unsigned char D.27023;
  int D.27024;
  const unsigned char * D.27025;
  unsigned char D.27026;
  int D.27027;
  _Bool D.27028;
  _Bool D.27029;
  const unsigned char * D.27032;
  unsigned char D.27033;
  int D.27034;
  const unsigned char * D.27035;
  unsigned char D.27036;
  int D.27037;
  <unnamed-unsigned:6> D.27041;
  int D.27042;
  struct MonoMethodSignature * sig;
  int i;

  sig = mono_method_signature (method);
  D.26806 = sig->ret;
  if (D.26806 != 0B) goto <D.26807>; else goto <D.26808>;
  <D.26807>:
  D.26806 = sig->ret;
  D.26809 = BIT_FIELD_REF <*D.26806, 8, 56>;
  D.26810 = D.26809 & 63;
  if (D.26810 != 0) goto <D.26811>; else goto <D.26812>;
  <D.26811>:
  i = 0;
  goto <D.20648>;
  <D.20647>:
  {
    struct MonoClass * cmod_class;

    D.26806 = sig->ret;
    D.26813 = D.26806->modifiers[i].token;
    D.26814 = (unsigned int) D.26813;
    D.26815 = method->klass;
    D.26816 = D.26815->image;
    cmod_class = mono_class_get (D.26816, D.26814);
    D.26817 = cmod_class == 0B;
    D.26818 = (long int) D.26817;
    D.26819 = __builtin_expect (D.26818, 0);
    if (D.26819 != 0) goto <D.26820>; else goto <D.26821>;
    <D.26820>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9418, "cmod_class");
    <D.26821>:
    D.26822 = cmod_class->image;
    D.26823 = mono_defaults.corlib;
    if (D.26822 == D.26823) goto <D.26824>; else goto <D.26825>;
    <D.26824>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name_space;
        D.26829 = "System.Runtime.CompilerServices";
        D.26830 = MEM[(const unsigned char *)D.26829];
        D.26831 = (int) D.26830;
        D.26832 = *__s2;
        D.26833 = (int) D.26832;
        __result = D.26831 - D.26833;
        {
          D.26834 = __s2_len != 0;
          D.26835 = __result == 0;
          D.26836 = D.26834 & D.26835;
          if (D.26836 != 0) goto <D.26837>; else goto <D.26838>;
          <D.26837>:
          D.26839 = &MEM[(void *)"System.Runtime.CompilerServices" + 1B];
          D.26840 = *D.26839;
          D.26841 = (int) D.26840;
          D.26842 = __s2 + 1;
          D.26843 = *D.26842;
          D.26844 = (int) D.26843;
          __result = D.26841 - D.26844;
          D.26845 = __s2_len > 1;
          D.26835 = __result == 0;
          D.26846 = D.26845 & D.26835;
          if (D.26846 != 0) goto <D.26847>; else goto <D.26848>;
          <D.26847>:
          D.26849 = &MEM[(void *)"System.Runtime.CompilerServices" + 2B];
          D.26850 = *D.26849;
          D.26851 = (int) D.26850;
          D.26852 = __s2 + 2;
          D.26853 = *D.26852;
          D.26854 = (int) D.26853;
          __result = D.26851 - D.26854;
          D.26855 = __s2_len > 2;
          D.26835 = __result == 0;
          D.26856 = D.26855 & D.26835;
          if (D.26856 != 0) goto <D.26857>; else goto <D.26858>;
          <D.26857>:
          D.26859 = &MEM[(void *)"System.Runtime.CompilerServices" + 3B];
          D.26860 = *D.26859;
          D.26861 = (int) D.26860;
          D.26862 = __s2 + 3;
          D.26863 = *D.26862;
          D.26864 = (int) D.26863;
          __result = D.26861 - D.26864;
          <D.26858>:
          <D.26848>:
          <D.26838>:
        }
        D.20609 = __result;
      }
      iftmp.339 = -D.20609;
      goto <D.26865>;
      <D.26828>:
      D.26866 = cmod_class->name_space;
      iftmp.339 = __builtin_strcmp (D.26866, "System.Runtime.CompilerServices");
      <D.26865>:
      D.20610 = iftmp.339;
    }
    if (D.20610 == 0) goto <D.26867>; else goto <D.26868>;
    <D.26867>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26872 = "CallConvCdecl";
        D.26873 = MEM[(const unsigned char *)D.26872];
        D.26874 = (int) D.26873;
        D.26875 = *__s2;
        D.26876 = (int) D.26875;
        __result = D.26874 - D.26876;
        {
          D.26877 = __s2_len != 0;
          D.26878 = __result == 0;
          D.26879 = D.26877 & D.26878;
          if (D.26879 != 0) goto <D.26880>; else goto <D.26881>;
          <D.26880>:
          D.26882 = &MEM[(void *)"CallConvCdecl" + 1B];
          D.26883 = *D.26882;
          D.26884 = (int) D.26883;
          D.26885 = __s2 + 1;
          D.26886 = *D.26885;
          D.26887 = (int) D.26886;
          __result = D.26884 - D.26887;
          D.26888 = __s2_len > 1;
          D.26878 = __result == 0;
          D.26889 = D.26888 & D.26878;
          if (D.26889 != 0) goto <D.26890>; else goto <D.26891>;
          <D.26890>:
          D.26892 = &MEM[(void *)"CallConvCdecl" + 2B];
          D.26893 = *D.26892;
          D.26894 = (int) D.26893;
          D.26895 = __s2 + 2;
          D.26896 = *D.26895;
          D.26897 = (int) D.26896;
          __result = D.26894 - D.26897;
          D.26898 = __s2_len > 2;
          D.26878 = __result == 0;
          D.26899 = D.26898 & D.26878;
          if (D.26899 != 0) goto <D.26900>; else goto <D.26901>;
          <D.26900>:
          D.26902 = &MEM[(void *)"CallConvCdecl" + 3B];
          D.26903 = *D.26902;
          D.26904 = (int) D.26903;
          D.26905 = __s2 + 3;
          D.26906 = *D.26905;
          D.26907 = (int) D.26906;
          __result = D.26904 - D.26907;
          <D.26901>:
          <D.26891>:
          <D.26881>:
        }
        D.20618 = __result;
      }
      iftmp.340 = -D.20618;
      goto <D.26908>;
      <D.26871>:
      D.26909 = cmod_class->name;
      iftmp.340 = __builtin_strcmp (D.26909, "CallConvCdecl");
      <D.26908>:
      D.20619 = iftmp.340;
    }
    if (D.20619 == 0) goto <D.26910>; else goto <D.26911>;
    <D.26910>:
    csig->call_convention = 1;
    goto <D.26912>;
    <D.26911>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26916 = "CallConvStdcall";
        D.26917 = MEM[(const unsigned char *)D.26916];
        D.26918 = (int) D.26917;
        D.26919 = *__s2;
        D.26920 = (int) D.26919;
        __result = D.26918 - D.26920;
        {
          D.26921 = __s2_len != 0;
          D.26922 = __result == 0;
          D.26923 = D.26921 & D.26922;
          if (D.26923 != 0) goto <D.26924>; else goto <D.26925>;
          <D.26924>:
          D.26926 = &MEM[(void *)"CallConvStdcall" + 1B];
          D.26927 = *D.26926;
          D.26928 = (int) D.26927;
          D.26929 = __s2 + 1;
          D.26930 = *D.26929;
          D.26931 = (int) D.26930;
          __result = D.26928 - D.26931;
          D.26932 = __s2_len > 1;
          D.26922 = __result == 0;
          D.26933 = D.26932 & D.26922;
          if (D.26933 != 0) goto <D.26934>; else goto <D.26935>;
          <D.26934>:
          D.26936 = &MEM[(void *)"CallConvStdcall" + 2B];
          D.26937 = *D.26936;
          D.26938 = (int) D.26937;
          D.26939 = __s2 + 2;
          D.26940 = *D.26939;
          D.26941 = (int) D.26940;
          __result = D.26938 - D.26941;
          D.26942 = __s2_len > 2;
          D.26922 = __result == 0;
          D.26943 = D.26942 & D.26922;
          if (D.26943 != 0) goto <D.26944>; else goto <D.26945>;
          <D.26944>:
          D.26946 = &MEM[(void *)"CallConvStdcall" + 3B];
          D.26947 = *D.26946;
          D.26948 = (int) D.26947;
          D.26949 = __s2 + 3;
          D.26950 = *D.26949;
          D.26951 = (int) D.26950;
          __result = D.26948 - D.26951;
          <D.26945>:
          <D.26935>:
          <D.26925>:
        }
        D.20627 = __result;
      }
      iftmp.341 = -D.20627;
      goto <D.26952>;
      <D.26915>:
      D.26909 = cmod_class->name;
      iftmp.341 = __builtin_strcmp (D.26909, "CallConvStdcall");
      <D.26952>:
      D.20628 = iftmp.341;
    }
    if (D.20628 == 0) goto <D.26953>; else goto <D.26954>;
    <D.26953>:
    csig->call_convention = 2;
    goto <D.26955>;
    <D.26954>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26959 = "CallConvFastcall";
        D.26960 = MEM[(const unsigned char *)D.26959];
        D.26961 = (int) D.26960;
        D.26962 = *__s2;
        D.26963 = (int) D.26962;
        __result = D.26961 - D.26963;
        {
          D.26964 = __s2_len != 0;
          D.26965 = __result == 0;
          D.26966 = D.26964 & D.26965;
          if (D.26966 != 0) goto <D.26967>; else goto <D.26968>;
          <D.26967>:
          D.26969 = &MEM[(void *)"CallConvFastcall" + 1B];
          D.26970 = *D.26969;
          D.26971 = (int) D.26970;
          D.26972 = __s2 + 1;
          D.26973 = *D.26972;
          D.26974 = (int) D.26973;
          __result = D.26971 - D.26974;
          D.26975 = __s2_len > 1;
          D.26965 = __result == 0;
          D.26976 = D.26975 & D.26965;
          if (D.26976 != 0) goto <D.26977>; else goto <D.26978>;
          <D.26977>:
          D.26979 = &MEM[(void *)"CallConvFastcall" + 2B];
          D.26980 = *D.26979;
          D.26981 = (int) D.26980;
          D.26982 = __s2 + 2;
          D.26983 = *D.26982;
          D.26984 = (int) D.26983;
          __result = D.26981 - D.26984;
          D.26985 = __s2_len > 2;
          D.26965 = __result == 0;
          D.26986 = D.26985 & D.26965;
          if (D.26986 != 0) goto <D.26987>; else goto <D.26988>;
          <D.26987>:
          D.26989 = &MEM[(void *)"CallConvFastcall" + 3B];
          D.26990 = *D.26989;
          D.26991 = (int) D.26990;
          D.26992 = __s2 + 3;
          D.26993 = *D.26992;
          D.26994 = (int) D.26993;
          __result = D.26991 - D.26994;
          <D.26988>:
          <D.26978>:
          <D.26968>:
        }
        D.20636 = __result;
      }
      iftmp.342 = -D.20636;
      goto <D.26995>;
      <D.26958>:
      D.26909 = cmod_class->name;
      iftmp.342 = __builtin_strcmp (D.26909, "CallConvFastcall");
      <D.26995>:
      D.20637 = iftmp.342;
    }
    if (D.20637 == 0) goto <D.26996>; else goto <D.26997>;
    <D.26996>:
    csig->call_convention = 4;
    goto <D.26998>;
    <D.26997>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.27002 = "CallConvThiscall";
        D.27003 = MEM[(const unsigned char *)D.27002];
        D.27004 = (int) D.27003;
        D.27005 = *__s2;
        D.27006 = (int) D.27005;
        __result = D.27004 - D.27006;
        {
          D.27007 = __s2_len != 0;
          D.27008 = __result == 0;
          D.27009 = D.27007 & D.27008;
          if (D.27009 != 0) goto <D.27010>; else goto <D.27011>;
          <D.27010>:
          D.27012 = &MEM[(void *)"CallConvThiscall" + 1B];
          D.27013 = *D.27012;
          D.27014 = (int) D.27013;
          D.27015 = __s2 + 1;
          D.27016 = *D.27015;
          D.27017 = (int) D.27016;
          __result = D.27014 - D.27017;
          D.27018 = __s2_len > 1;
          D.27008 = __result == 0;
          D.27019 = D.27018 & D.27008;
          if (D.27019 != 0) goto <D.27020>; else goto <D.27021>;
          <D.27020>:
          D.27022 = &MEM[(void *)"CallConvThiscall" + 2B];
          D.27023 = *D.27022;
          D.27024 = (int) D.27023;
          D.27025 = __s2 + 2;
          D.27026 = *D.27025;
          D.27027 = (int) D.27026;
          __result = D.27024 - D.27027;
          D.27028 = __s2_len > 2;
          D.27008 = __result == 0;
          D.27029 = D.27028 & D.27008;
          if (D.27029 != 0) goto <D.27030>; else goto <D.27031>;
          <D.27030>:
          D.27032 = &MEM[(void *)"CallConvThiscall" + 3B];
          D.27033 = *D.27032;
          D.27034 = (int) D.27033;
          D.27035 = __s2 + 3;
          D.27036 = *D.27035;
          D.27037 = (int) D.27036;
          __result = D.27034 - D.27037;
          <D.27031>:
          <D.27021>:
          <D.27011>:
        }
        D.20645 = __result;
      }
      iftmp.343 = -D.20645;
      goto <D.27038>;
      <D.27001>:
      D.26909 = cmod_class->name;
      iftmp.343 = __builtin_strcmp (D.26909, "CallConvThiscall");
      <D.27038>:
      D.20646 = iftmp.343;
    }
    if (D.20646 == 0) goto <D.27039>; else goto <D.27040>;
    <D.27039>:
    csig->call_convention = 3;
    <D.27040>:
    <D.26998>:
    <D.26955>:
    <D.26912>:
    <D.26868>:
    <D.26825>:
  }
  i = i + 1;
  <D.20648>:
  D.26806 = sig->ret;
  D.27041 = D.26806->num_mods;
  D.27042 = (int) D.27041;
  if (D.27042 > i) goto <D.20647>; else goto <D.20649>;
  <D.20649>:
  <D.26812>:
  <D.26808>:
}


mono_class_has_parent (struct MonoClass * klass, struct MonoClass * parent)
{
  struct MonoClass * * D.27043;
  _Bool D.27044;
  long int D.27045;
  long int D.27046;
  struct MonoClass * * D.27049;
  _Bool D.27050;
  long int D.27051;
  long int D.27052;
  gboolean D.27055;

  D.27043 = klass->supertypes;
  D.27044 = D.27043 == 0B;
  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>:
  mono_class_setup_supertypes (klass);
  <D.27048>:
  D.27049 = parent->supertypes;
  D.27050 = D.27049 == 0B;
  D.27051 = (long int) D.27050;
  D.27052 = __builtin_expect (D.27051, 0);
  if (D.27052 != 0) goto <D.27053>; else goto <D.27054>;
  <D.27053>:
  mono_class_setup_supertypes (parent);
  <D.27054>:
  D.27055 = mono_class_has_parent_fast (klass, parent);
  return D.27055;
}


mono_class_has_parent_fast (struct MonoClass * klass, struct MonoClass * parent)
{
  gboolean D.27057;
  int iftmp.344;
  short unsigned int D.27061;
  short unsigned int D.27062;
  struct MonoClass * * D.27064;
  sizetype D.27065;
  sizetype D.27066;
  sizetype D.27067;
  struct MonoClass * * D.27068;
  struct MonoClass * D.27069;

  D.27061 = klass->idepth;
  D.27062 = parent->idepth;
  if (D.27061 >= D.27062) goto <D.27063>; else goto <D.27059>;
  <D.27063>:
  D.27064 = klass->supertypes;
  D.27062 = parent->idepth;
  D.27065 = (sizetype) D.27062;
  D.27066 = D.27065 + 1073741823;
  D.27067 = D.27066 * 4;
  D.27068 = D.27064 + D.27067;
  D.27069 = *D.27068;
  if (D.27069 == parent) goto <D.27070>; else goto <D.27059>;
  <D.27070>:
  iftmp.344 = 1;
  goto <D.27060>;
  <D.27059>:
  iftmp.344 = 0;
  <D.27060>:
  D.27057 = iftmp.344;
  return D.27057;
}


mono_marshal_get_vtfixup_ftnptr (struct MonoImage * image, guint32 token, guint16 type)
{
  _Bool D.27072;
  long int D.27073;
  long int D.27074;
  _Bool D.27077;
  long int D.27078;
  long int D.27079;
  int D.27082;
  int D.27083;
  unsigned char D.27086;
  unsigned char D.27087;
  _Bool D.27088;
  long int D.27089;
  long int D.27090;
  short unsigned int D.27093;
  int D.27094;
  int D.27095;
  unsigned int D.27096;
  unsigned int D.27097;
  const char * D.27098;
  struct MonoClass * D.27099;
  int D.27100;
  unsigned int i.345;
  unsigned int D.27102;
  struct MonoMarshalSpec * * D.27103;
  struct MonoMarshalSpec * D.27104;
  void * D.27107;
  <unnamed-unsigned:1> D.27108;
  int D.27109;
  unsigned int i.346;
  int D.27111;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  int i;
  int param_count;

  D.27072 = token == 0;
  D.27073 = (long int) D.27072;
  D.27074 = __builtin_expect (D.27073, 0);
  if (D.27074 != 0) goto <D.27075>; else goto <D.27076>;
  <D.27075>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9608, "token");
  <D.27076>:
  method = mono_get_method (image, token, 0B);
  D.27077 = method == 0B;
  D.27078 = (long int) D.27077;
  D.27079 = __builtin_expect (D.27078, 0);
  if (D.27079 != 0) goto <D.27080>; else goto <D.27081>;
  <D.27080>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9611, "method");
  <D.27081>:
  D.27082 = (int) type;
  D.27083 = D.27082 & 12;
  if (D.27083 != 0) goto <D.27084>; else goto <D.27085>;
  <D.27084>:
  {
    struct MonoMethodSignature * csig;
    struct MonoMarshalSpec * * mspecs;
    struct EmitMarshalContext m;

    try
      {
        sig = mono_method_signature (method);
        D.27086 = BIT_FIELD_REF <*sig, 8, 80>;
        D.27087 = D.27086 & 64;
        D.27088 = D.27087 != 0;
        D.27089 = (long int) D.27088;
        D.27090 = __builtin_expect (D.27089, 0);
        if (D.27090 != 0) goto <D.27091>; else goto <D.27092>;
        <D.27091>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9619, "!sig->hasthis");
        <D.27092>:
        D.27093 = sig->param_count;
        D.27094 = (int) D.27093;
        D.27095 = D.27094 + 1;
        D.27096 = (unsigned int) D.27095;
        D.27097 = D.27096 * 4;
        mspecs = monoeg_malloc0 (D.27097);
        mono_method_get_marshal_info (method, mspecs);
        D.27098 = method->name;
        D.27099 = method->klass;
        mb = mono_mb_new (D.27099, D.27098, 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.27093 = sig->param_count;
        D.27094 = (int) D.27093;
        D.27100 = D.27094 + 16;
        method = mono_mb_create_method (mb, csig, D.27100);
        mono_mb_free (mb);
        D.27093 = sig->param_count;
        i = (int) D.27093;
        goto <D.20741>;
        <D.20740>:
        i.345 = (unsigned int) i;
        D.27102 = i.345 * 4;
        D.27103 = mspecs + D.27102;
        D.27104 = *D.27103;
        if (D.27104 != 0B) goto <D.27105>; else goto <D.27106>;
        <D.27105>:
        i.345 = (unsigned int) i;
        D.27102 = i.345 * 4;
        D.27103 = mspecs + D.27102;
        D.27104 = *D.27103;
        mono_metadata_free_marshal_spec (D.27104);
        <D.27106>:
        i = i + -1;
        <D.20741>:
        if (i >= 0) goto <D.20740>; else goto <D.20742>;
        <D.20742>:
        monoeg_g_free (mspecs);
        D.27107 = mono_compile_method (method);
        return D.27107;
      }
    finally
      {
        m = {CLOBBER};
      }
  }
  <D.27085>:
  sig = mono_method_signature (method);
  D.27098 = method->name;
  D.27099 = method->klass;
  mb = mono_mb_new (D.27099, D.27098, 7);
  D.27093 = sig->param_count;
  D.27094 = (int) D.27093;
  D.27108 = sig->hasthis;
  D.27109 = (int) D.27108;
  param_count = D.27094 + D.27109;
  i = 0;
  goto <D.20744>;
  <D.20743>:
  i.346 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.346);
  i = i + 1;
  <D.20744>:
  if (i < param_count) goto <D.20743>; else goto <D.20745>;
  <D.20745>:
  D.27082 = (int) type;
  D.27111 = D.27082 & 16;
  if (D.27111 != 0) goto <D.27112>; else goto <D.27113>;
  <D.27112>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.27114>;
  <D.27113>:
  mono_mb_emit_op (mb, 40, method);
  <D.27114>:
  mono_mb_emit_byte (mb, 42);
  mb->dynamic = 1;
  method = mono_mb_create_method (mb, sig, param_count);
  mono_mb_free (mb);
  D.27107 = mono_compile_method (method);
  return D.27107;
}


mono_marshal_get_castclass_with_cache ()
{
  struct MonoMethod * cached.347;
  struct MonoMethod * D.27120;
  struct MonoClass * D.27121;
  struct MonoImage * D.27122;
  struct MonoType * D.27123;
  struct MonoClass * D.27124;
  struct MonoType * D.27125;
  unsigned int D.27126;
  unsigned int D.27127;
  unsigned int cache_miss_pos.348;
  unsigned int D.27129;
  unsigned int invalid_cast_pos.349;
  unsigned int return_null_pos.350;
  void * D.27132;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int invalid_cast_pos;
  struct WrapperInfo * info;

  cached.347 = cached;
  if (cached.347 != 0B) goto <D.27118>; else goto <D.27119>;
  <D.27118>:
  D.27120 = cached;
  return D.27120;
  <D.27119>:
  D.27121 = mono_defaults.object_class;
  mb = mono_mb_new (D.27121, "__castclass_with_cache", 19);
  D.27122 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27122, 3);
  D.27121 = mono_defaults.object_class;
  D.27123 = &D.27121->byval_arg;
  sig->params[0] = D.27123;
  D.27124 = mono_defaults.int_class;
  D.27125 = &D.27124->byval_arg;
  sig->params[1] = D.27125;
  D.27124 = mono_defaults.int_class;
  D.27125 = &D.27124->byval_arg;
  sig->params[2] = D.27125;
  D.27121 = mono_defaults.object_class;
  D.27123 = &D.27121->byval_arg;
  sig->ret = D.27123;
  sig->pinvoke = 0;
  D.27124 = mono_defaults.int_class;
  D.27125 = &D.27124->byval_arg;
  mono_mb_add_local (mb, D.27125);
  mono_mb_emit_ldarg (mb, 0);
  D.27126 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27126;
  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.27127 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27127;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.348 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.348);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27129 = mono_mb_emit_branch (mb, 57);
  invalid_cast_pos = (int) D.27129;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  invalid_cast_pos.349 = (unsigned int) invalid_cast_pos;
  mono_mb_patch_branch (mb, invalid_cast_pos.349);
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  return_null_pos.350 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.350);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 9);
  mono_marshal_set_wrapper_info (res, info);
  D.27132 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27132 != 0B) goto <D.27133>; else goto <D.27134>;
  <D.27133>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27134>:
  mono_mb_free (mb);
  D.27120 = cached;
  return D.27120;
}


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

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


mono_marshal_get_isinst_with_cache ()
{
  struct MonoMethod * cached.353;
  struct MonoMethod * D.27144;
  struct MonoClass * D.27145;
  struct MonoImage * D.27146;
  struct MonoType * D.27147;
  struct MonoClass * D.27148;
  struct MonoType * D.27149;
  unsigned int D.27150;
  unsigned int D.27151;
  unsigned int D.27152;
  unsigned int D.27153;
  unsigned int negative_cache_hit_pos.354;
  unsigned int cache_hit_pos.355;
  unsigned int cache_miss_pos.356;
  unsigned int D.27157;
  unsigned int not_an_instance_pos.357;
  unsigned int return_null_pos.358;
  void * D.27160;
  static struct MonoMethod * cached;
  struct MonoMethod * res;
  struct MonoMethodBuilder * mb;
  struct MonoMethodSignature * sig;
  int return_null_pos;
  int cache_miss_pos;
  int cache_hit_pos;
  int not_an_instance_pos;
  int negative_cache_hit_pos;
  struct WrapperInfo * info;

  cached.353 = cached;
  if (cached.353 != 0B) goto <D.27142>; else goto <D.27143>;
  <D.27142>:
  D.27144 = cached;
  return D.27144;
  <D.27143>:
  D.27145 = mono_defaults.object_class;
  mb = mono_mb_new (D.27145, "__isinst_with_cache", 19);
  D.27146 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27146, 3);
  D.27145 = mono_defaults.object_class;
  D.27147 = &D.27145->byval_arg;
  sig->params[0] = D.27147;
  D.27148 = mono_defaults.int_class;
  D.27149 = &D.27148->byval_arg;
  sig->params[1] = D.27149;
  D.27148 = mono_defaults.int_class;
  D.27149 = &D.27148->byval_arg;
  sig->params[2] = D.27149;
  D.27145 = mono_defaults.object_class;
  D.27147 = &D.27145->byval_arg;
  sig->ret = D.27147;
  sig->pinvoke = 0;
  D.27148 = mono_defaults.int_class;
  D.27149 = &D.27148->byval_arg;
  mono_mb_add_local (mb, D.27149);
  D.27148 = mono_defaults.int_class;
  D.27149 = &D.27148->byval_arg;
  mono_mb_add_local (mb, D.27149);
  mono_mb_emit_ldarg (mb, 0);
  D.27150 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27150;
  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.27151 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27151;
  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.27152 = mono_mb_emit_branch (mb, 58);
  negative_cache_hit_pos = (int) D.27152;
  mono_mb_emit_ldarg (mb, 0);
  D.27153 = mono_mb_emit_branch (mb, 56);
  cache_hit_pos = (int) D.27153;
  negative_cache_hit_pos.354 = (unsigned int) negative_cache_hit_pos;
  mono_mb_patch_branch (mb, negative_cache_hit_pos.354);
  mono_mb_emit_byte (mb, 20);
  cache_hit_pos.355 = (unsigned int) cache_hit_pos;
  mono_mb_patch_branch (mb, cache_hit_pos.355);
  mono_mb_emit_byte (mb, 42);
  cache_miss_pos.356 = (unsigned int) cache_miss_pos;
  mono_mb_patch_branch (mb, cache_miss_pos.356);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_object_isinst);
  D.27157 = mono_mb_emit_branch (mb, 57);
  not_an_instance_pos = (int) D.27157;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  not_an_instance_pos.357 = (unsigned int) not_an_instance_pos;
  mono_mb_patch_branch (mb, not_an_instance_pos.357);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 96);
  mono_mb_emit_byte (mb, 223);
  return_null_pos.358 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.358);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 10);
  mono_marshal_set_wrapper_info (res, info);
  D.27160 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27160 != 0B) goto <D.27161>; else goto <D.27162>;
  <D.27161>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27162>:
  mono_mb_free (mb);
  D.27144 = cached;
  return D.27144;
}


mono_marshal_get_isinst (struct MonoClass * klass)
{
  struct MonoImage * D.27164;
  struct GHashTable * * D.27165;
  struct MonoMethod * D.27168;
  struct MonoMethodSignature * isint_sig.359;
  struct MonoImage * D.27172;
  struct MonoMethodSignature * isint_sig.360;
  struct MonoClass * D.27174;
  struct MonoType * D.27175;
  const char * D.27176;
  struct MonoMethod * D.27177;
  unsigned int D.27178;
  unsigned int D.27179;
  struct MonoMethod * D.27180;
  unsigned int D.27181;
  unsigned int pos_failed.361;
  unsigned int D.27183;
  unsigned int pos_was_ok.362;
  unsigned int pos_end.363;
  unsigned int pos_end2.364;
  short unsigned int D.27187;
  int D.27188;
  int D.27189;
  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.27164 = klass->image;
  D.27165 = &D.27164->isinst_cache;
  cache = get_cache (D.27165, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27166>; else goto <D.27167>;
  <D.27166>:
  D.27168 = res;
  return D.27168;
  <D.27167>:
  isint_sig.359 = isint_sig;
  if (isint_sig.359 == 0B) goto <D.27170>; else goto <D.27171>;
  <D.27170>:
  D.27172 = mono_defaults.corlib;
  isint_sig.360 = mono_metadata_signature_alloc (D.27172, 1);
  isint_sig = isint_sig.360;
  isint_sig.359 = isint_sig;
  D.27174 = mono_defaults.object_class;
  D.27175 = &D.27174->byval_arg;
  isint_sig.359->params[0] = D.27175;
  isint_sig.359 = isint_sig;
  D.27174 = mono_defaults.object_class;
  D.27175 = &D.27174->byval_arg;
  isint_sig.359->ret = D.27175;
  isint_sig.359 = isint_sig;
  isint_sig.359->pinvoke = 0;
  <D.27171>:
  D.27176 = klass->name;
  name = monoeg_g_strdup_printf ("__isinst_wrapper_%s", D.27176);
  D.27174 = mono_defaults.object_class;
  mb = mono_mb_new (D.27174, name, 18);
  monoeg_g_free (name);
  D.27177 = mb->method;
  D.27177->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.27178 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27178;
  mono_mb_emit_byte (mb, 24);
  D.27179 = mono_mb_emit_branch (mb, 64);
  pos_failed = (int) D.27179;
  mono_mb_emit_ldarg (mb, 0);
  D.27180 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27180, 0B);
  D.27181 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27181;
  pos_failed.361 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.361);
  mono_mb_emit_byte (mb, 20);
  D.27183 = mono_mb_emit_branch (mb, 56);
  pos_end2 = (int) D.27183;
  pos_was_ok.362 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.362);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 0);
  pos_end.363 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.363);
  pos_end2.364 = (unsigned int) pos_end2;
  mono_mb_patch_branch (mb, pos_end2.364);
  mono_mb_emit_byte (mb, 42);
  isint_sig.359 = isint_sig;
  D.27187 = isint_sig.359->param_count;
  D.27188 = (int) D.27187;
  D.27189 = D.27188 + 16;
  isint_sig.359 = isint_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.359, D.27189);
  mono_mb_free (mb);
  D.27168 = res;
  return D.27168;
}


mono_marshal_get_castclass (struct MonoClass * klass)
{
  struct MonoImage * D.27191;
  struct GHashTable * * D.27192;
  struct MonoMethod * D.27195;
  struct MonoMethodSignature * castclass_sig.365;
  struct MonoImage * D.27199;
  struct MonoMethodSignature * castclass_sig.366;
  struct MonoClass * D.27201;
  struct MonoType * D.27202;
  const char * D.27203;
  struct MonoMethod * D.27204;
  unsigned int D.27205;
  struct MonoMethod * D.27206;
  unsigned int D.27207;
  unsigned int pos_was_ok.367;
  unsigned int pos_was_ok2.368;
  short unsigned int D.27210;
  int D.27211;
  int D.27212;
  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.27191 = klass->image;
  D.27192 = &D.27191->castclass_cache;
  cache = get_cache (D.27192, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27193>; else goto <D.27194>;
  <D.27193>:
  D.27195 = res;
  return D.27195;
  <D.27194>:
  castclass_sig.365 = castclass_sig;
  if (castclass_sig.365 == 0B) goto <D.27197>; else goto <D.27198>;
  <D.27197>:
  D.27199 = mono_defaults.corlib;
  castclass_sig.366 = mono_metadata_signature_alloc (D.27199, 1);
  castclass_sig = castclass_sig.366;
  castclass_sig.365 = castclass_sig;
  D.27201 = mono_defaults.object_class;
  D.27202 = &D.27201->byval_arg;
  castclass_sig.365->params[0] = D.27202;
  castclass_sig.365 = castclass_sig;
  D.27201 = mono_defaults.object_class;
  D.27202 = &D.27201->byval_arg;
  castclass_sig.365->ret = D.27202;
  castclass_sig.365 = castclass_sig;
  castclass_sig.365->pinvoke = 0;
  <D.27198>:
  D.27203 = klass->name;
  name = monoeg_g_strdup_printf ("__castclass_wrapper_%s", D.27203);
  D.27201 = mono_defaults.object_class;
  mb = mono_mb_new (D.27201, name, 19);
  monoeg_g_free (name);
  D.27204 = mb->method;
  D.27204->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 8, klass);
  D.27205 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27205;
  mono_mb_emit_ldarg (mb, 0);
  D.27206 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27206, 0B);
  D.27207 = mono_mb_emit_branch (mb, 58);
  pos_was_ok2 = (int) D.27207;
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  pos_was_ok.367 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.367);
  pos_was_ok2.368 = (unsigned int) pos_was_ok2;
  mono_mb_patch_branch (mb, pos_was_ok2.368);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  castclass_sig.365 = castclass_sig;
  D.27210 = castclass_sig.365->param_count;
  D.27211 = (int) D.27210;
  D.27212 = D.27211 + 16;
  castclass_sig.365 = castclass_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig.365, D.27212);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 0);
  mono_marshal_set_wrapper_info (res, info);
  D.27195 = res;
  return D.27195;
}


mono_marshal_get_proxy_cancast (struct MonoClass * klass)
{
  struct MonoImage * D.27214;
  struct GHashTable * * D.27215;
  struct MonoMethod * D.27218;
  struct MonoMethodSignature * isint_sig.369;
  struct MonoImage * D.27222;
  struct MonoMethodSignature * isint_sig.370;
  struct MonoClass * D.27224;
  struct MonoType * D.27225;
  struct MonoType * D.27226;
  struct MonoMethod * D.27227;
  struct MonoClass * D.27228;
  _Bool D.27229;
  long int D.27230;
  long int D.27231;
  unsigned int D.27234;
  unsigned int D.27235;
  unsigned int pos_failed.371;
  unsigned int pos_end.372;
  short unsigned int D.27238;
  int D.27239;
  int D.27240;
  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.27214 = klass->image;
  D.27215 = &D.27214->proxy_isinst_cache;
  cache = get_cache (D.27215, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27216>; else goto <D.27217>;
  <D.27216>:
  D.27218 = res;
  return D.27218;
  <D.27217>:
  isint_sig.369 = isint_sig;
  if (isint_sig.369 == 0B) goto <D.27220>; else goto <D.27221>;
  <D.27220>:
  D.27222 = mono_defaults.corlib;
  isint_sig.370 = mono_metadata_signature_alloc (D.27222, 1);
  isint_sig = isint_sig.370;
  isint_sig.369 = isint_sig;
  D.27224 = mono_defaults.object_class;
  D.27225 = &D.27224->byval_arg;
  isint_sig.369->params[0] = D.27225;
  isint_sig.369 = isint_sig;
  D.27224 = mono_defaults.object_class;
  D.27225 = &D.27224->byval_arg;
  isint_sig.369->ret = D.27225;
  isint_sig.369 = isint_sig;
  isint_sig.369->pinvoke = 0;
  <D.27221>:
  D.27226 = &klass->byval_arg;
  klass_name = mono_type_full_name (D.27226);
  name = monoeg_g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name);
  D.27224 = mono_defaults.object_class;
  mb = mono_mb_new (D.27224, name, 20);
  monoeg_g_free (klass_name);
  monoeg_g_free (name);
  D.27227 = mb->method;
  D.27227->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  D.27226 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27226);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", 0);
  D.27228 = mono_defaults.iremotingtypeinfo_class;
  can_cast_to = mono_method_desc_search_in_class (desc, D.27228);
  D.27229 = can_cast_to == 0B;
  D.27230 = (long int) D.27229;
  D.27231 = __builtin_expect (D.27230, 0);
  if (D.27231 != 0) goto <D.27232>; else goto <D.27233>;
  <D.27232>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10142, "can_cast_to");
  <D.27233>:
  mono_method_desc_free (desc);
  mono_mb_emit_op (mb, 111, can_cast_to);
  D.27234 = mono_mb_emit_branch (mb, 57);
  pos_failed = (int) D.27234;
  D.27226 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27226);
  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.27235 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27235;
  pos_failed.371 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.371);
  mono_mb_emit_byte (mb, 20);
  pos_end.372 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.372);
  mono_mb_emit_byte (mb, 42);
  isint_sig.369 = isint_sig;
  D.27238 = isint_sig.369->param_count;
  D.27239 = (int) D.27238;
  D.27240 = D.27239 + 16;
  isint_sig.369 = isint_sig;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.369, D.27240);
  mono_mb_free (mb);
  D.27218 = res;
  return D.27218;
}


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

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


mono_marshal_get_struct_to_ptr (struct MonoClass * klass)
{
  _Bool D.27244;
  long int D.27245;
  long int D.27246;
  struct MonoMarshalType * D.27249;
  struct MonoMethod * D.27250;
  struct MonoMethod * D.27253;
  struct MonoMethod * stoptr.373;
  struct MonoClass * D.27257;
  struct MonoMethod * stoptr.374;
  _Bool D.27259;
  long int D.27260;
  long int D.27261;
  const char * D.27264;
  unsigned char D.27265;
  unsigned char D.27266;
  int D.27269;
  struct MonoClass * D.27271;
  struct MonoType * D.27272;
  struct MonoClass * D.27273;
  struct MonoType * D.27274;
  struct MonoMethodSignature * D.27275;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * stoptr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27244 = klass == 0B;
  D.27245 = (long int) D.27244;
  D.27246 = __builtin_expect (D.27245, 0);
  if (D.27246 != 0) goto <D.27247>; else goto <D.27248>;
  <D.27247>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10201, "klass != NULL");
  <D.27248>:
  mono_marshal_load_type_info (klass);
  D.27249 = klass->marshal_info;
  D.27250 = D.27249->str_to_ptr;
  if (D.27250 != 0B) goto <D.27251>; else goto <D.27252>;
  <D.27251>:
  D.27249 = klass->marshal_info;
  D.27253 = D.27249->str_to_ptr;
  return D.27253;
  <D.27252>:
  stoptr.373 = stoptr;
  if (stoptr.373 == 0B) goto <D.27255>; else goto <D.27256>;
  <D.27255>:
  D.27257 = mono_defaults.marshal_class;
  stoptr.374 = mono_class_get_method_from_name (D.27257, "StructureToPtr", 3);
  stoptr = stoptr.374;
  <D.27256>:
  stoptr.373 = stoptr;
  D.27259 = stoptr.373 == 0B;
  D.27260 = (long int) D.27259;
  D.27261 = __builtin_expect (D.27260, 0);
  if (D.27261 != 0) goto <D.27262>; else goto <D.27263>;
  <D.27262>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10210, "stoptr");
  <D.27263>:
  stoptr.373 = stoptr;
  D.27264 = stoptr.373->name;
  mb = mono_mb_new (klass, D.27264, 25);
  D.27265 = BIT_FIELD_REF <*klass, 8, 160>;
  D.27266 = D.27265 & 32;
  if (D.27266 != 0) goto <D.27267>; else goto <D.27268>;
  <D.27267>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 8);
  D.27269 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27269);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27270>;
  <D.27268>:
  D.27271 = mono_defaults.int_class;
  D.27272 = &D.27271->byval_arg;
  mono_mb_add_local (mb, D.27272);
  D.27271 = mono_defaults.int_class;
  D.27272 = &D.27271->byval_arg;
  mono_mb_add_local (mb, D.27272);
  D.27273 = mono_defaults.boolean_class;
  D.27274 = &D.27273->byval_arg;
  mono_mb_add_local (mb, D.27274);
  mono_mb_emit_byte (mb, 4);
  mono_mb_emit_stloc (mb, 2);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 1);
  emit_struct_conv (mb, klass, 0);
  <D.27270>:
  mono_mb_emit_byte (mb, 42);
  stoptr.373 = stoptr;
  D.27275 = mono_signature_no_pinvoke (stoptr.373);
  res = mono_mb_create_method (mb, D.27275, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 8);
  mono_marshal_set_wrapper_info (res, info);
  D.27249 = klass->marshal_info;
  D.27249->str_to_ptr = res;
  D.27253 = res;
  return D.27253;
}


mono_marshal_get_ptr_to_struct (struct MonoClass * klass)
{
  _Bool D.27277;
  long int D.27278;
  long int D.27279;
  struct MonoMarshalType * D.27282;
  struct MonoMethod * D.27283;
  struct MonoMethod * D.27286;
  struct MonoMethodSignature * ptostr.375;
  struct MonoImage * D.27290;
  unsigned char D.27291;
  unsigned char D.27292;
  int D.27295;
  struct MonoClass * D.27297;
  struct MonoType * D.27298;
  struct MonoType * D.27299;
  struct MonoMethodBuilder * mb;
  static struct MonoMethodSignature * ptostr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27277 = klass == 0B;
  D.27278 = (long int) D.27277;
  D.27279 = __builtin_expect (D.27278, 0);
  if (D.27279 != 0) goto <D.27280>; else goto <D.27281>;
  <D.27280>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10273, "klass != NULL");
  <D.27281>:
  mono_marshal_load_type_info (klass);
  D.27282 = klass->marshal_info;
  D.27283 = D.27282->ptr_to_str;
  if (D.27283 != 0B) goto <D.27284>; else goto <D.27285>;
  <D.27284>:
  D.27282 = klass->marshal_info;
  D.27286 = D.27282->ptr_to_str;
  return D.27286;
  <D.27285>:
  ptostr.375 = ptostr;
  if (ptostr.375 == 0B) goto <D.27288>; else goto <D.27289>;
  <D.27288>:
  {
    struct MonoMethodSignature * sig;

    sig = mono_create_icall_signature ("void ptr object");
    D.27290 = mono_defaults.corlib;
    sig = signature_dup (D.27290, sig);
    sig->pinvoke = 0;
    mono_memory_barrier ();
    ptostr = sig;
  }
  <D.27289>:
  mb = mono_mb_new (klass, "PtrToStructure", 25);
  D.27291 = BIT_FIELD_REF <*klass, 8, 160>;
  D.27292 = D.27291 & 32;
  if (D.27292 != 0) goto <D.27293>; else goto <D.27294>;
  <D.27293>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 2);
  D.27295 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27295);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27296>;
  <D.27294>:
  D.27297 = mono_defaults.int_class;
  D.27298 = &D.27297->byval_arg;
  mono_mb_add_local (mb, D.27298);
  D.27299 = &klass->this_arg;
  mono_mb_add_local (mb, D.27299);
  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.27296>:
  mono_mb_emit_byte (mb, 42);
  ptostr.375 = ptostr;
  res = mono_mb_create_method (mb, ptostr.375, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 7);
  mono_marshal_set_wrapper_info (res, info);
  D.27282 = klass->marshal_info;
  D.27282->ptr_to_str = res;
  D.27286 = res;
  return D.27286;
}


mono_marshal_get_synchronized_inner_wrapper (struct MonoMethod * method)
{
  unsigned char D.27301;
  unsigned char D.27302;
  struct MonoGenericContext * D.27305;
  struct MonoGenericInst * D.27306;
  struct MonoClass * D.27311;
  _Bool D.27312;
  long int D.27313;
  long int D.27314;
  const char * D.27317;
  struct MonoMethodSignature * D.27318;
  struct MonoImage * D.27319;
  struct MonoMethod * D.27322;
  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.27301 = BIT_FIELD_REF <*method, 8, 168>;
  D.27302 = D.27301 & 16;
  if (D.27302 != 0) goto <D.27303>; else goto <D.27304>;
  <D.27303>:
  D.27305 = mono_method_get_context (method);
  D.27306 = D.27305->method_inst;
  if (D.27306 == 0B) goto <D.27307>; else goto <D.27308>;
  <D.27307>:
  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.27309>; else goto <D.27310>;
  <D.27309>:
  D.27311 = method->klass;
  container = D.27311->generic_container;
  <D.27310>:
  D.27312 = container == 0B;
  D.27313 = (long int) D.27312;
  D.27314 = __builtin_expect (D.27313, 0);
  if (D.27314 != 0) goto <D.27315>; else goto <D.27316>;
  <D.27315>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10360, "container");
  <D.27316>:
  <D.27308>:
  <D.27304>:
  D.27317 = method->name;
  D.27311 = method->klass;
  mb = mono_mb_new (D.27311, D.27317, 25);
  mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn\'t be called.");
  mono_mb_emit_byte (mb, 42);
  D.27318 = mono_method_signature (method);
  D.27311 = method->klass;
  D.27319 = D.27311->image;
  sig = signature_dup (D.27319, D.27318);
  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.27320>; else goto <D.27321>;
  <D.27320>:
  res = mono_class_inflate_generic_method (res, ctx);
  <D.27321>:
  D.27322 = res;
  return D.27322;
}


mono_marshal_get_synchronized_wrapper (struct MonoMethod * method)
{
  _Bool D.27324;
  long int D.27325;
  long int D.27326;
  unsigned char D.27329;
  unsigned char D.27330;
  struct MonoMethod * D.27333;
  unsigned char D.27334;
  unsigned char D.27335;
  struct MonoGenericContext * D.27338;
  struct MonoGenericInst * D.27339;
  struct MonoClass * D.27344;
  _Bool D.27345;
  long int D.27346;
  long int D.27347;
  struct MonoImage * D.27352;
  struct GHashTable * * D.27353;
  struct GHashTable * * D.27357;
  struct MonoMethodSignature * D.27360;
  const char * D.27361;
  struct MonoType * D.27362;
  int D.27363;
  unsigned char D.27366;
  unsigned char D.27367;
  short unsigned int D.27370;
  int D.27371;
  int D.27372;
  int D.27375;
  unsigned int ret_local.376;
  short unsigned int D.27379;
  int D.27380;
  int D.27381;
  struct MonoClass * D.27382;
  struct MonoType * D.27383;
  _Bool D.27386;
  long int D.27387;
  long int D.27388;
  struct MonoMethod * enter_method.377;
  struct MonoClass * D.27394;
  struct MonoMethod * enter_method.378;
  _Bool D.27396;
  long int D.27397;
  long int D.27398;
  struct MonoMethod * exit_method.379;
  struct MonoMethod * exit_method.380;
  _Bool D.27403;
  long int D.27404;
  long int D.27405;
  struct MonoClass * D.27408;
  struct MonoMethod * gettypefromhandle_method.381;
  struct MonoMethod * gettypefromhandle_method.382;
  _Bool D.27411;
  long int D.27412;
  long int D.27413;
  _Bool D.27418;
  long int D.27419;
  long int D.27420;
  unsigned int D.27425;
  struct MonoClass * D.27426;
  unsigned int this_local.383;
  int D.27429;
  unsigned int D.27430;
  unsigned char D.27431;
  unsigned char D.27432;
  _Bool D.27435;
  int D.27436;
  int D.27437;
  unsigned int D.27438;
  struct MonoGenericContext * D.27441;
  struct MonoMethod * D.27442;
  int D.27444;
  unsigned int D.27447;
  int D.27448;
  unsigned int D.27449;
  unsigned int D.27450;
  unsigned int D.27451;
  int D.27452;
  unsigned int D.27453;
  int D.27454;
  unsigned int D.27455;
  unsigned int D.27456;
  unsigned int D.27457;
  unsigned int pos.384;
  int D.27459;
  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.27324 = method == 0B;
  D.27325 = (long int) D.27324;
  D.27326 = __builtin_expect (D.27325, 0);
  if (D.27326 != 0) goto <D.27327>; else goto <D.27328>;
  <D.27327>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10397, "method");
  <D.27328>:
  D.27329 = BIT_FIELD_REF <*method, 8, 160>;
  D.27330 = D.27329 & 124;
  if (D.27330 == 64) goto <D.27331>; else goto <D.27332>;
  <D.27331>:
  D.27333 = method;
  return D.27333;
  <D.27332>:
  D.27334 = BIT_FIELD_REF <*method, 8, 168>;
  D.27335 = D.27334 & 16;
  if (D.27335 != 0) goto <D.27336>; else goto <D.27337>;
  <D.27336>:
  D.27338 = mono_method_get_context (method);
  D.27339 = D.27338->method_inst;
  if (D.27339 == 0B) goto <D.27340>; else goto <D.27341>;
  <D.27340>:
  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.27342>; else goto <D.27343>;
  <D.27342>:
  D.27344 = method->klass;
  container = D.27344->generic_container;
  <D.27343>:
  D.27345 = container == 0B;
  D.27346 = (long int) D.27345;
  D.27347 = __builtin_expect (D.27346, 0);
  if (D.27347 != 0) goto <D.27348>; else goto <D.27349>;
  <D.27348>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10410, "container");
  <D.27349>:
  <D.27341>:
  <D.27337>:
  if (ctx != 0B) goto <D.27350>; else goto <D.27351>;
  <D.27350>:
  D.27344 = method->klass;
  D.27352 = D.27344->image;
  D.27353 = &D.27352->synchronized_generic_cache;
  cache = get_cache (D.27353, mono_aligned_addr_hash, 0B);
  res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
  if (res != 0B) goto <D.27354>; else goto <D.27355>;
  <D.27354>:
  D.27333 = res;
  return D.27333;
  <D.27355>:
  goto <D.27356>;
  <D.27351>:
  D.27344 = method->klass;
  D.27352 = D.27344->image;
  D.27357 = &D.27352->synchronized_cache;
  cache = get_cache (D.27357, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27358>; else goto <D.27359>;
  <D.27358>:
  D.27333 = res;
  return D.27333;
  <D.27359>:
  <D.27356>:
  D.27360 = mono_method_signature (method);
  D.27344 = method->klass;
  D.27352 = D.27344->image;
  sig = signature_dup (D.27352, D.27360);
  sig->pinvoke = 0;
  D.27361 = method->name;
  D.27344 = method->klass;
  mb = mono_mb_new (D.27344, D.27361, 16);
  D.27362 = sig->ret;
  D.27363 = mono_type_is_void (D.27362);
  if (D.27363 == 0) goto <D.27364>; else goto <D.27365>;
  <D.27364>:
  D.27362 = sig->ret;
  ret_local = mono_mb_add_local (mb, D.27362);
  <D.27365>:
  D.27344 = method->klass;
  D.27366 = BIT_FIELD_REF <*D.27344, 8, 160>;
  D.27367 = D.27366 & 8;
  if (D.27367 != 0) goto <D.27368>; else goto <D.27369>;
  <D.27368>:
  D.27370 = method->flags;
  D.27371 = (int) D.27370;
  D.27372 = D.27371 & 16;
  if (D.27372 == 0) goto <D.27373>; else goto <D.27374>;
  <D.27373>:
  D.27344 = method->klass;
  mono_class_set_failure (D.27344, 7, 0B);
  mono_mb_emit_byte (mb, 20);
  D.27344 = method->klass;
  mono_mb_emit_op (mb, 117, D.27344);
  mono_mb_emit_byte (mb, 38);
  D.27362 = sig->ret;
  D.27375 = mono_type_is_void (D.27362);
  if (D.27375 == 0) goto <D.27376>; else goto <D.27377>;
  <D.27376>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.27377>:
  mono_mb_emit_byte (mb, 42);
  D.27379 = sig->param_count;
  D.27380 = (int) D.27379;
  D.27381 = D.27380 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27381);
  mono_mb_free (mb);
  D.27333 = res;
  return D.27333;
  <D.27374>:
  <D.27369>:
  D.27382 = mono_defaults.object_class;
  D.27383 = &D.27382->byval_arg;
  this_local = mono_mb_add_local (mb, D.27383);
  D.27344 = method->klass;
  D.27352 = D.27344->image;
  clause = mono_image_alloc0 (D.27352, 24);
  clause->flags = 2;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27384>; else goto <D.27385>;
    <D.27384>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27385>:
    D.27386 = ret != 0;
    D.27387 = (long int) D.27386;
    D.27388 = __builtin_expect (D.27387, 0);
    if (D.27388 != 0) goto <D.27389>; else goto <D.27390>;
    <D.27389>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10466, "ret == 0");
    <D.27390>:
  }
  enter_method.377 = enter_method;
  if (enter_method.377 == 0B) goto <D.27392>; else goto <D.27393>;
  <D.27392>:
  {
    struct MonoMethodDesc * desc;

    desc = mono_method_desc_new ("Monitor:Enter", 0);
    D.27394 = mono_defaults.monitor_class;
    enter_method.378 = mono_method_desc_search_in_class (desc, D.27394);
    enter_method = enter_method.378;
    enter_method.377 = enter_method;
    D.27396 = enter_method.377 == 0B;
    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", 10473, "enter_method");
    <D.27400>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Monitor:Exit", 0);
    D.27394 = mono_defaults.monitor_class;
    exit_method.379 = mono_method_desc_search_in_class (desc, D.27394);
    exit_method = exit_method.379;
    exit_method.380 = exit_method;
    D.27403 = exit_method.380 == 0B;
    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", 10478, "exit_method");
    <D.27407>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Type:GetTypeFromHandle", 0);
    D.27408 = mono_defaults.systemtype_class;
    gettypefromhandle_method.381 = mono_method_desc_search_in_class (desc, D.27408);
    gettypefromhandle_method = gettypefromhandle_method.381;
    gettypefromhandle_method.382 = gettypefromhandle_method;
    D.27411 = gettypefromhandle_method.382 == 0B;
    D.27412 = (long int) D.27411;
    D.27413 = __builtin_expect (D.27412, 0);
    if (D.27413 != 0) goto <D.27414>; else goto <D.27415>;
    <D.27414>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10483, "gettypefromhandle_method");
    <D.27415>:
    mono_method_desc_free (desc);
  }
  <D.27393>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27416>; else goto <D.27417>;
    <D.27416>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27417>:
    D.27418 = ret != 0;
    D.27419 = (long int) D.27418;
    D.27420 = __builtin_expect (D.27419, 0);
    if (D.27420 != 0) goto <D.27421>; else goto <D.27422>;
    <D.27421>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10487, "ret == 0");
    <D.27422>:
  }
  D.27370 = method->flags;
  D.27371 = (int) D.27370;
  D.27372 = D.27371 & 16;
  if (D.27372 != 0) goto <D.27423>; else goto <D.27424>;
  <D.27423>:
  {
    int index;

    D.27344 = method->klass;
    D.27425 = mono_mb_add_data (mb, D.27344);
    index = (int) D.27425;
    D.27426 = mono_defaults.typehandle_class;
    mono_mb_add_data (mb, D.27426);
    mono_mb_emit_byte (mb, 208);
    mono_mb_emit_i4 (mb, index);
    gettypefromhandle_method.382 = gettypefromhandle_method;
    mono_mb_emit_managed_call (mb, gettypefromhandle_method.382, 0B);
  }
  goto <D.27427>;
  <D.27424>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27427>:
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_stloc (mb, this_local.383);
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.383);
  enter_method.377 = enter_method;
  mono_mb_emit_managed_call (mb, enter_method.377, 0B);
  D.27429 = mono_mb_get_label (mb);
  D.27430 = (unsigned int) D.27429;
  clause->try_offset = D.27430;
  D.27431 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27432 = D.27431 & 64;
  if (D.27432 != 0) goto <D.27433>; else goto <D.27434>;
  <D.27433>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27434>:
  i = 0;
  goto <D.20865>;
  <D.20864>:
  D.27431 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27432 = D.27431 & 64;
  D.27435 = D.27432 != 0;
  D.27436 = (int) D.27435;
  D.27437 = D.27436 + i;
  D.27438 = (unsigned int) D.27437;
  mono_mb_emit_ldarg (mb, D.27438);
  i = i + 1;
  <D.20865>:
  D.27379 = sig->param_count;
  D.27380 = (int) D.27379;
  if (D.27380 > i) goto <D.20864>; else goto <D.20866>;
  <D.20866>:
  if (ctx != 0B) goto <D.27439>; else goto <D.27440>;
  <D.27439>:
  D.27441 = &container->context;
  D.27442 = mono_class_inflate_generic_method (method, D.27441);
  mono_mb_emit_managed_call (mb, D.27442, 0B);
  goto <D.27443>;
  <D.27440>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.27443>:
  D.27362 = sig->ret;
  D.27444 = mono_type_is_void (D.27362);
  if (D.27444 == 0) goto <D.27445>; else goto <D.27446>;
  <D.27445>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_stloc (mb, ret_local.376);
  <D.27446>:
  D.27447 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.27447;
  D.27448 = mono_mb_get_pos (mb);
  D.27449 = (unsigned int) D.27448;
  D.27450 = clause->try_offset;
  D.27451 = D.27449 - D.27450;
  clause->try_len = D.27451;
  D.27452 = mono_mb_get_label (mb);
  D.27453 = (unsigned int) D.27452;
  clause->handler_offset = D.27453;
  this_local.383 = (unsigned int) this_local;
  mono_mb_emit_ldloc (mb, this_local.383);
  exit_method.380 = exit_method;
  mono_mb_emit_managed_call (mb, exit_method.380, 0B);
  mono_mb_emit_byte (mb, 220);
  D.27454 = mono_mb_get_pos (mb);
  D.27455 = (unsigned int) D.27454;
  D.27456 = clause->handler_offset;
  D.27457 = D.27455 - D.27456;
  clause->handler_len = D.27457;
  pos.384 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.384);
  D.27362 = sig->ret;
  D.27459 = mono_type_is_void (D.27362);
  if (D.27459 == 0) goto <D.27460>; else goto <D.27461>;
  <D.27460>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.27461>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, clause);
  if (ctx != 0B) goto <D.27462>; else goto <D.27463>;
  <D.27462>:
  {
    struct MonoMethod * def;

    D.27379 = sig->param_count;
    D.27380 = (int) D.27379;
    D.27381 = D.27380 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.27381);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.27464>;
  <D.27463>:
  D.27379 = sig->param_count;
  D.27380 = (int) D.27379;
  D.27381 = D.27380 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27381);
  <D.27464>:
  mono_mb_free (mb);
  D.27333 = res;
  return D.27333;
}


check_generic_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, void * key, void * def_key)
{
  unsigned char D.27466;
  unsigned char D.27467;
  _Bool D.27468;
  long int D.27469;
  long int D.27470;
  struct MonoMethod * D.27475;
  _Bool D.27480;
  long int D.27481;
  long int D.27482;
  _Bool D.27489;
  long int D.27490;
  long int D.27491;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;
  struct MonoGenericContext * ctx;
  struct MonoMethod * def_method;

  D.27466 = BIT_FIELD_REF <*orig_method, 8, 168>;
  D.27467 = D.27466 & 16;
  D.27468 = D.27467 == 0;
  D.27469 = (long int) D.27468;
  D.27470 = __builtin_expect (D.27469, 0);
  if (D.27470 != 0) goto <D.27471>; else goto <D.27472>;
  <D.27471>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2720, "orig_method->is_inflated");
  <D.27472>:
  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.27473>; else goto <D.27474>;
  <D.27473>:
  D.27475 = res;
  return D.27475;
  <D.27474>:
  def = mono_marshal_find_in_cache (cache, def_key);
  if (def != 0B) goto <D.27476>; else goto <D.27477>;
  <D.27476>:
  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.27478>; else goto <D.27479>;
    <D.27478>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27479>:
    D.27480 = ret != 0;
    D.27481 = (long int) D.27480;
    D.27482 = __builtin_expect (D.27481, 0);
    if (D.27482 != 0) goto <D.27483>; else goto <D.27484>;
    <D.27483>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2739, "ret == 0");
    <D.27484>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27485>; else goto <D.27486>;
  <D.27485>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27486>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27487>; else goto <D.27488>;
    <D.27487>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27488>:
    D.27489 = ret != 0;
    D.27490 = (long int) D.27489;
    D.27491 = __builtin_expect (D.27490, 0);
    if (D.27491 != 0) goto <D.27492>; else goto <D.27493>;
    <D.27492>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2745, "ret == 0");
    <D.27493>:
  }
  D.27475 = res;
  return D.27475;
  <D.27477>:
  D.27475 = 0B;
  return D.27475;
}


cache_generic_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx, void * key)
{
  _Bool D.27497;
  long int D.27498;
  long int D.27499;
  _Bool D.27506;
  long int D.27507;
  long int D.27508;
  struct MonoMethod * D.27511;
  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.27495>; else goto <D.27496>;
    <D.27495>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27496>:
    D.27497 = ret != 0;
    D.27498 = (long int) D.27497;
    D.27499 = __builtin_expect (D.27498, 0);
    if (D.27499 != 0) goto <D.27500>; else goto <D.27501>;
    <D.27500>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2761, "ret == 0");
    <D.27501>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27502>; else goto <D.27503>;
  <D.27502>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27503>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27504>; else goto <D.27505>;
    <D.27504>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27505>:
    D.27506 = ret != 0;
    D.27507 = (long int) D.27506;
    D.27508 = __builtin_expect (D.27507, 0);
    if (D.27508 != 0) goto <D.27509>; else goto <D.27510>;
    <D.27509>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2767, "ret == 0");
    <D.27510>:
  }
  D.27511 = res;
  return D.27511;
}


mono_marshal_get_unbox_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.27513;
  struct MonoImage * D.27514;
  struct GHashTable * * D.27515;
  struct MonoMethod * D.27518;
  const char * D.27519;
  unsigned char D.27520;
  unsigned char D.27521;
  _Bool D.27522;
  long int D.27523;
  long int D.27524;
  int D.27527;
  unsigned int D.27528;
  short unsigned int D.27529;
  int D.27530;
  int D.27531;
  struct MonoMethodSignature * sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;

  sig = mono_method_signature (method);
  D.27513 = method->klass;
  D.27514 = D.27513->image;
  D.27515 = &D.27514->unbox_wrapper_cache;
  cache = get_cache (D.27515, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27516>; else goto <D.27517>;
  <D.27516>:
  D.27518 = res;
  return D.27518;
  <D.27517>:
  D.27519 = method->name;
  D.27513 = method->klass;
  mb = mono_mb_new (D.27513, D.27519, 22);
  D.27520 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27521 = D.27520 & 64;
  D.27522 = D.27521 == 0;
  D.27523 = (long int) D.27522;
  D.27524 = __builtin_expect (D.27523, 0);
  if (D.27524 != 0) goto <D.27525>; else goto <D.27526>;
  <D.27525>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10576, "sig->hasthis");
  <D.27526>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  i = 0;
  goto <D.20877>;
  <D.20876>:
  D.27527 = i + 1;
  D.27528 = (unsigned int) D.27527;
  mono_mb_emit_ldarg (mb, D.27528);
  i = i + 1;
  <D.20877>:
  D.27529 = sig->param_count;
  D.27530 = (int) D.27529;
  if (D.27530 > i) goto <D.20876>; else goto <D.20878>;
  <D.20878>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  D.27529 = sig->param_count;
  D.27530 = (int) D.27529;
  D.27531 = D.27530 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27531);
  mono_mb_free (mb);
  D.27518 = res;
  return D.27518;
}


mono_marshal_get_virtual_stelemref (struct MonoClass * array_class)
{
  unsigned char D.27533;
  _Bool D.27534;
  long int D.27535;
  long int D.27536;
  struct MonoClass * D.27539;
  struct MonoMethod * D.27540;
  int kind;

  D.27533 = array_class->rank;
  D.27534 = D.27533 != 1;
  D.27535 = (long int) D.27534;
  D.27536 = __builtin_expect (D.27535, 0);
  if (D.27536 != 0) goto <D.27537>; else goto <D.27538>;
  <D.27537>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11083, "array_class->rank == 1");
  <D.27538>:
  D.27539 = array_class->element_class;
  kind = get_virtual_stelemref_kind (D.27539);
  D.27540 = get_virtual_stelemref_wrapper (kind);
  return D.27540;
}


get_virtual_stelemref_kind (struct MonoClass * element_class)
{
  struct MonoClass * D.27542;
  int D.27545;
  int D.27546;
  unsigned int D.27551;
  unsigned int D.27552;
  unsigned char D.27554;
  int D.27556;
  unsigned char D.27561;
  unsigned char D.27562;
  unsigned char D.27564;
  int D.27566;
  unsigned int D.27567;

  D.27542 = mono_defaults.object_class;
  if (D.27542 == element_class) goto <D.27543>; else goto <D.27544>;
  <D.27543>:
  D.27545 = 0;
  return D.27545;
  <D.27544>:
  D.27546 = is_monomorphic_array (element_class);
  if (D.27546 != 0) goto <D.27547>; else goto <D.27548>;
  <D.27547>:
  D.27545 = 1;
  return D.27545;
  <D.27548>:
  D.27551 = element_class->flags;
  D.27552 = D.27551 & 32;
  if (D.27552 != 0) goto <D.27549>; else goto <D.27553>;
  <D.27553>:
  D.27554 = element_class->byval_arg.type;
  if (D.27554 == 19) goto <D.27549>; else goto <D.27555>;
  <D.27555>:
  D.27554 = element_class->byval_arg.type;
  if (D.27554 == 30) goto <D.27549>; else goto <D.27550>;
  <D.27549>:
  D.27556 = mono_class_has_variant_generic_params (element_class);
  if (D.27556 == 0) goto <D.27557>; else goto <D.27558>;
  <D.27557>:
  D.27545 = 3;
  return D.27545;
  <D.27558>:
  <D.27550>:
  D.27561 = BIT_FIELD_REF <*element_class, 8, 176>;
  D.27562 = D.27561 & 64;
  if (D.27562 != 0) goto <D.27559>; else goto <D.27563>;
  <D.27563>:
  D.27564 = element_class->rank;
  if (D.27564 != 0) goto <D.27559>; else goto <D.27565>;
  <D.27565>:
  D.27566 = mono_class_has_variant_generic_params (element_class);
  if (D.27566 != 0) goto <D.27559>; else goto <D.27560>;
  <D.27559>:
  D.27545 = 4;
  return D.27545;
  <D.27560>:
  D.27551 = element_class->flags;
  D.27567 = D.27551 & 256;
  if (D.27567 != 0) goto <D.27568>; else goto <D.27569>;
  <D.27568>:
  D.27545 = 1;
  return D.27545;
  <D.27569>:
  D.27545 = 2;
  return D.27545;
}


is_monomorphic_array (struct MonoClass * klass)
{
  unsigned char D.27571;
  gboolean D.27574;
  int iftmp.385;
  unsigned int D.27579;
  unsigned int D.27580;
  unsigned char D.27582;
  unsigned char D.27583;
  struct MonoClass * element_class;

  D.27571 = klass->rank;
  if (D.27571 != 1) goto <D.27572>; else goto <D.27573>;
  <D.27572>:
  D.27574 = 0;
  return D.27574;
  <D.27573>:
  element_class = klass->element_class;
  D.27579 = element_class->flags;
  D.27580 = D.27579 & 256;
  if (D.27580 != 0) goto <D.27576>; else goto <D.27581>;
  <D.27581>:
  D.27582 = BIT_FIELD_REF <*element_class, 8, 160>;
  D.27583 = D.27582 & 8;
  if (D.27583 != 0) goto <D.27576>; else goto <D.27577>;
  <D.27576>:
  iftmp.385 = 1;
  goto <D.27578>;
  <D.27577>:
  iftmp.385 = 0;
  <D.27578>:
  D.27574 = iftmp.385;
  return D.27574;
}


get_virtual_stelemref_wrapper (int kind)
{
  struct MonoMethod * D.27585;
  struct MonoMethod * D.27588;
  const char * D.27589;
  struct MonoClass * D.27590;
  struct MonoMethodSignature * signature.386;
  struct MonoImage * D.27594;
  struct MonoClass * D.27595;
  struct MonoType * D.27596;
  struct MonoClass * D.27597;
  struct MonoType * D.27598;
  struct MonoType * D.27599;
  struct MonoType * D.27600;
  unsigned int array_slot_addr.387;
  unsigned int aklass.388;
  unsigned int vklass.389;
  struct MonoClass * D.27604;
  struct MonoType * D.27605;
  unsigned int vtable.390;
  unsigned int uiid.391;
  struct MonoMethod * D.27608;
  short unsigned int D.27611;
  short unsigned int D.27612;
  _Bool D.27615;
  long int D.27616;
  long int D.27617;
  _Bool D.27624;
  long int D.27625;
  long int D.27626;
  _Bool D.27632;
  long int D.27633;
  long int D.27634;
  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.27585 = cached_methods[kind];
      if (D.27585 != 0B) goto <D.27586>; else goto <D.27587>;
      <D.27586>:
      D.27588 = cached_methods[kind];
      return D.27588;
      <D.27587>:
      D.27589 = strelemref_wrapper_name[kind];
      name = monoeg_g_strdup_printf ("virt_stelemref_%s", D.27589);
      D.27590 = mono_defaults.object_class;
      mb = mono_mb_new (D.27590, name, 21);
      monoeg_g_free (name);
      signature.386 = signature;
      if (signature.386 == 0B) goto <D.27592>; else goto <D.27593>;
      <D.27592>:
      {
        struct MonoMethodSignature * sig;

        D.27594 = mono_defaults.corlib;
        sig = mono_metadata_signature_alloc (D.27594, 2);
        D.27595 = mono_defaults.void_class;
        D.27596 = &D.27595->byval_arg;
        sig->ret = D.27596;
        sig->hasthis = 1;
        D.27597 = mono_defaults.int_class;
        D.27598 = &D.27597->byval_arg;
        sig->params[0] = D.27598;
        D.27590 = mono_defaults.object_class;
        D.27599 = &D.27590->byval_arg;
        sig->params[1] = D.27599;
        signature = sig;
      }
      <D.27593>:
      param_names[0] = "index";
      param_names[1] = "value";
      mono_mb_set_param_names (mb, &param_names);
      switch (kind) <default: <D.20930>, case 0: <D.20924>, case 1: <D.20927>, case 2: <D.20928>, case 3: <D.20929>, case 4: <D.20926>>
      <D.20924>:
      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.20925>;
      <D.20926>:
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      aklass = mono_mb_add_local (mb, D.27598);
      D.27590 = mono_defaults.object_class;
      D.27600 = &D.27590->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27600);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.20925>;
      <D.20927>:
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      aklass = mono_mb_add_local (mb, D.27598);
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      vklass = mono_mb_add_local (mb, D.27598);
      D.27590 = mono_defaults.object_class;
      D.27600 = &D.27590->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27600);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      b2 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.20925>;
      <D.20928>:
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      aklass = mono_mb_add_local (mb, D.27598);
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      vklass = mono_mb_add_local (mb, D.27598);
      D.27590 = mono_defaults.object_class;
      D.27600 = &D.27590->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27600);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      load_value_class (mb, vklass);
      mono_mb_emit_ldarg (mb, 2);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_icall (mb, mono_object_isinst);
      b2 = mono_mb_emit_branch (mb, 57);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 68);
      vklass.389 = (unsigned int) vklass;
      mono_mb_emit_ldloc (mb, vklass.389);
      mono_mb_emit_ldflda (mb, 8);
      mono_mb_emit_byte (mb, 77);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 12);
      mono_mb_emit_byte (mb, 73);
      mono_mb_emit_icon (mb, 1);
      mono_mb_emit_byte (mb, 89);
      mono_mb_emit_icon (mb, 4);
      mono_mb_emit_byte (mb, 90);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 77);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      b3 = mono_mb_emit_branch (mb, 64);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.20925>;
      <D.20929>:
      D.27590 = mono_defaults.object_class;
      D.27600 = &D.27590->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27600);
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      aklass = mono_mb_add_local (mb, D.27598);
      D.27597 = mono_defaults.int_class;
      D.27598 = &D.27597->byval_arg;
      vtable = mono_mb_add_local (mb, D.27598);
      D.27604 = mono_defaults.int32_class;
      D.27605 = &D.27604->byval_arg;
      uiid = mono_mb_add_local (mb, D.27605);
      load_array_element_address (mb);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_stloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      b1 = mono_mb_emit_branch (mb, 57);
      load_array_class (mb, aklass);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_ldflda (mb, 0);
      mono_mb_emit_byte (mb, 77);
      vtable.390 = (unsigned int) vtable;
      mono_mb_emit_stloc (mb, vtable.390);
      aklass.388 = (unsigned int) aklass;
      mono_mb_emit_ldloc (mb, aklass.388);
      mono_mb_emit_ldflda (mb, 58);
      mono_mb_emit_byte (mb, 73);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_stloc (mb, uiid.391);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      vtable.390 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.390);
      mono_mb_emit_ldflda (mb, 20);
      mono_mb_emit_byte (mb, 73);
      b2 = mono_mb_emit_branch (mb, 66);
      vtable.390 = (unsigned int) vtable;
      mono_mb_emit_ldloc (mb, vtable.390);
      mono_mb_emit_ldflda (mb, 16);
      mono_mb_emit_byte (mb, 77);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      mono_mb_emit_icon (mb, 3);
      mono_mb_emit_byte (mb, 100);
      mono_mb_emit_byte (mb, 88);
      mono_mb_emit_byte (mb, 71);
      mono_mb_emit_icon (mb, 1);
      uiid.391 = (unsigned int) uiid;
      mono_mb_emit_ldloc (mb, uiid.391);
      mono_mb_emit_icon (mb, 7);
      mono_mb_emit_byte (mb, 95);
      mono_mb_emit_byte (mb, 98);
      mono_mb_emit_byte (mb, 95);
      b3 = mono_mb_emit_branch (mb, 57);
      mono_mb_patch_branch (mb, b1);
      array_slot_addr.387 = (unsigned int) array_slot_addr;
      mono_mb_emit_ldloc (mb, array_slot_addr.387);
      mono_mb_emit_ldarg (mb, 2);
      mono_mb_emit_byte (mb, 81);
      mono_mb_emit_byte (mb, 42);
      mono_mb_patch_branch (mb, b2);
      mono_mb_patch_branch (mb, b3);
      mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
      goto <D.20925>;
      <D.20930>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_ldarg (mb, 2);
      D.27608 = mono_marshal_get_stelemref ();
      mono_mb_emit_managed_call (mb, D.27608, 0B);
      mono_mb_emit_byte (mb, 42);
      if (1 != 0) goto <D.27609>; else goto <D.27610>;
      <D.27609>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11054, "0");
      <D.27610>:
      <D.20925>:
      signature.386 = signature;
      res = mono_mb_create_method (mb, signature.386, 4);
      D.27611 = res->flags;
      D.27612 = D.27611 | 64;
      res->flags = D.27612;
      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.27613>; else goto <D.27614>;
        <D.27613>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.27614>:
        D.27615 = ret != 0;
        D.27616 = (long int) D.27615;
        D.27617 = __builtin_expect (D.27616, 0);
        if (D.27617 != 0) goto <D.27618>; else goto <D.27619>;
        <D.27618>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11065, "ret == 0");
        <D.27619>:
      }
      D.27585 = cached_methods[kind];
      if (D.27585 == 0B) goto <D.27620>; else goto <D.27621>;
      <D.27620>:
      cached_methods[kind] = res;
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.27622>; else goto <D.27623>;
        <D.27622>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.27623>:
        D.27624 = ret != 0;
        D.27625 = (long int) D.27624;
        D.27626 = __builtin_expect (D.27625, 0);
        if (D.27626 != 0) goto <D.27627>; else goto <D.27628>;
        <D.27627>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11068, "ret == 0");
        <D.27628>:
      }
      goto <D.27629>;
      <D.27621>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.27630>; else goto <D.27631>;
        <D.27630>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.27631>:
        D.27632 = ret != 0;
        D.27633 = (long int) D.27632;
        D.27634 = __builtin_expect (D.27633, 0);
        if (D.27634 != 0) goto <D.27635>; else goto <D.27636>;
        <D.27635>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11070, "ret == 0");
        <D.27636>:
      }
      mono_free_method (res);
      <D.27629>:
      mono_mb_free (mb);
      D.27588 = cached_methods[kind];
      return D.27588;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


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

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


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

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


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

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


mono_marshal_get_virtual_stelemref_wrappers (int * nwrappers)
{
  unsigned int i.394;
  unsigned int D.27643;
  struct MonoMethod * * D.27644;
  struct MonoMethod * D.27645;
  struct MonoMethod * * D.27646;
  struct MonoMethod * * res;
  int i;

  *nwrappers = 5;
  res = monoeg_malloc0 (20);
  i = 0;
  goto <D.20944>;
  <D.20943>:
  i.394 = (unsigned int) i;
  D.27643 = i.394 * 4;
  D.27644 = res + D.27643;
  D.27645 = get_virtual_stelemref_wrapper (i);
  *D.27644 = D.27645;
  i = i + 1;
  <D.20944>:
  if (i <= 4) goto <D.20943>; else goto <D.20945>;
  <D.20945>:
  D.27646 = res;
  return D.27646;
}


mono_marshal_get_stelemref ()
{
  struct MonoMethod * ret.395;
  struct MonoMethod * D.27651;
  struct MonoClass * D.27652;
  struct MonoImage * D.27653;
  struct MonoClass * D.27654;
  struct MonoType * D.27655;
  struct MonoType * D.27656;
  struct MonoClass * D.27657;
  struct MonoType * D.27658;
  struct MonoType * D.27659;
  unsigned int array_slot_addr.396;
  unsigned int aklass.397;
  unsigned int vklass.398;
  int D.27663;
  unsigned int D.27664;
  unsigned int D.27665;
  int D.27666;
  int b4.399;
  struct MonoMethod * ret.400;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;
  guint32 b1;
  guint32 b2;
  guint32 b3;
  guint32 b4;
  guint32 copy_pos;
  int aklass;
  int vklass;
  int array_slot_addr;

  ret.395 = ret;
  if (ret.395 != 0B) goto <D.27649>; else goto <D.27650>;
  <D.27649>:
  D.27651 = ret;
  return D.27651;
  <D.27650>:
  D.27652 = mono_defaults.object_class;
  mb = mono_mb_new (D.27652, "stelemref", 21);
  D.27653 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27653, 3);
  D.27654 = mono_defaults.void_class;
  D.27655 = &D.27654->byval_arg;
  sig->ret = D.27655;
  D.27652 = mono_defaults.object_class;
  D.27656 = &D.27652->byval_arg;
  sig->params[0] = D.27656;
  D.27657 = mono_defaults.int_class;
  D.27658 = &D.27657->byval_arg;
  sig->params[1] = D.27658;
  D.27652 = mono_defaults.object_class;
  D.27656 = &D.27652->byval_arg;
  sig->params[2] = D.27656;
  D.27657 = mono_defaults.int_class;
  D.27658 = &D.27657->byval_arg;
  aklass = mono_mb_add_local (mb, D.27658);
  D.27657 = mono_defaults.int_class;
  D.27658 = &D.27657->byval_arg;
  vklass = mono_mb_add_local (mb, D.27658);
  D.27652 = mono_defaults.object_class;
  D.27659 = &D.27652->this_arg;
  array_slot_addr = mono_mb_add_local (mb, D.27659);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.27652 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.27652);
  array_slot_addr.396 = (unsigned int) array_slot_addr;
  mono_mb_emit_stloc (mb, array_slot_addr.396);
  mono_mb_emit_ldarg (mb, 2);
  b1 = mono_mb_emit_branch (mb, 57);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_stloc (mb, aklass.397);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_ldflda (mb, 0);
  mono_mb_emit_byte (mb, 77);
  vklass.398 = (unsigned int) vklass;
  mono_mb_emit_stloc (mb, vklass.398);
  vklass.398 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.398);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  b2 = mono_mb_emit_branch (mb, 68);
  vklass.398 = (unsigned int) vklass;
  mono_mb_emit_ldloc (mb, vklass.398);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 77);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_byte (mb, 73);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  b3 = mono_mb_emit_branch (mb, 64);
  D.27663 = mono_mb_get_label (mb);
  copy_pos = (guint32) D.27663;
  mono_mb_patch_branch (mb, b1);
  array_slot_addr.396 = (unsigned int) array_slot_addr;
  mono_mb_emit_ldloc (mb, array_slot_addr.396);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_branch (mb, b2);
  mono_mb_patch_branch (mb, b3);
  mono_mb_emit_ldarg (mb, 2);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_icall (mb, mono_object_isinst);
  b4 = mono_mb_emit_branch (mb, 58);
  D.27664 = copy_pos - b4;
  D.27665 = D.27664 + 4294967292;
  D.27666 = (int) D.27665;
  b4.399 = (int) b4;
  mono_mb_patch_addr (mb, b4.399, D.27666);
  mono_mb_emit_exception (mb, "ArrayTypeMismatchException", 0B);
  mono_mb_emit_byte (mb, 42);
  ret.400 = mono_mb_create_method (mb, sig, 4);
  ret = ret.400;
  mono_mb_free (mb);
  ret.395 = ret;
  info = mono_wrapper_info_create (ret.395, 0);
  ret.395 = ret;
  mono_marshal_set_wrapper_info (ret.395, info);
  D.27651 = ret;
  return D.27651;
}


mono_marshal_get_gsharedvt_in_wrapper ()
{
  struct MonoMethod * ret.401;
  struct MonoMethod * D.27673;
  struct MonoClass * D.27674;
  struct MonoImage * D.27675;
  struct MonoClass * D.27676;
  struct MonoType * D.27677;
  struct MonoMethod * ret.402;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.401 = ret;
  if (ret.401 != 0B) goto <D.27671>; else goto <D.27672>;
  <D.27671>:
  D.27673 = ret;
  return D.27673;
  <D.27672>:
  D.27674 = mono_defaults.object_class;
  mb = mono_mb_new (D.27674, "gsharedvt_in", 25);
  D.27675 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27675, 0);
  D.27676 = mono_defaults.void_class;
  D.27677 = &D.27676->byval_arg;
  sig->ret = D.27677;
  mono_mb_emit_byte (mb, 42);
  ret.402 = mono_mb_create_method (mb, sig, 4);
  ret = ret.402;
  mono_mb_free (mb);
  ret.401 = ret;
  info = mono_wrapper_info_create (ret.401, 18);
  ret.401 = ret;
  mono_marshal_set_wrapper_info (ret.401, info);
  D.27673 = ret;
  return D.27673;
}


mono_marshal_get_gsharedvt_out_wrapper ()
{
  struct MonoMethod * ret.403;
  struct MonoMethod * D.27683;
  struct MonoClass * D.27684;
  struct MonoImage * D.27685;
  struct MonoClass * D.27686;
  struct MonoType * D.27687;
  struct MonoMethod * ret.404;
  static struct MonoMethod * ret = 0B;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct WrapperInfo * info;

  ret.403 = ret;
  if (ret.403 != 0B) goto <D.27681>; else goto <D.27682>;
  <D.27681>:
  D.27683 = ret;
  return D.27683;
  <D.27682>:
  D.27684 = mono_defaults.object_class;
  mb = mono_mb_new (D.27684, "gsharedvt_out", 25);
  D.27685 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27685, 0);
  D.27686 = mono_defaults.void_class;
  D.27687 = &D.27686->byval_arg;
  sig->ret = D.27687;
  mono_mb_emit_byte (mb, 42);
  ret.404 = mono_mb_create_method (mb, sig, 4);
  ret = ret.404;
  mono_mb_free (mb);
  ret.403 = ret;
  info = mono_wrapper_info_create (ret.403, 19);
  ret.403 = ret;
  mono_marshal_set_wrapper_info (ret.403, info);
  D.27683 = ret;
  return D.27683;
}


mono_marshal_get_array_address (int rank, int elem_size)
{
  _Bool D.27692;
  long int D.27693;
  long int D.27694;
  struct ArrayElemAddr * elem_addr_cache.405;
  unsigned int i.406;
  unsigned int D.27699;
  struct ArrayElemAddr * D.27700;
  int D.27701;
  int D.27704;
  int elem_addr_cache_next.407;
  _Bool D.27710;
  long int D.27711;
  long int D.27712;
  struct MonoMethod * D.27717;
  unsigned int rank.408;
  unsigned int D.27719;
  int D.27720;
  unsigned int D.27721;
  struct MonoImage * D.27722;
  struct MonoClass * D.27723;
  struct MonoType * D.27724;
  struct MonoClass * D.27725;
  struct MonoType * D.27726;
  int D.27727;
  struct MonoClass * D.27728;
  struct MonoType * D.27729;
  unsigned int bounds.409;
  unsigned int ind.410;
  unsigned int D.27732;
  unsigned int D.27733;
  unsigned int D.27734;
  unsigned int D.27735;
  int D.27736;
  unsigned int realidx.411;
  int D.27738;
  unsigned int D.27739;
  int * D.27740;
  unsigned int D.27741;
  int D.27742;
  int D.27743;
  unsigned int D.27744;
  unsigned int branch_pos.412;
  _Bool D.27748;
  long int D.27749;
  long int D.27750;
  int elem_addr_cache_size.413;
  unsigned int new_size.414;
  unsigned int D.27763;
  unsigned int elem_addr_cache_size.415;
  unsigned int D.27765;
  unsigned int elem_addr_cache_next.416;
  unsigned int D.27767;
  struct ArrayElemAddr * D.27768;
  int elem_addr_cache_next.417;
  unsigned int rank.418;
  unsigned int elem_size.419;
  _Bool D.27774;
  long int D.27775;
  long int D.27776;
  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.27690>; else goto <D.27691>;
    <D.27690>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27691>:
    D.27692 = ret != 0;
    D.27693 = (long int) D.27692;
    D.27694 = __builtin_expect (D.27693, 0);
    if (D.27694 != 0) goto <D.27695>; else goto <D.27696>;
    <D.27695>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11364, "ret == 0");
    <D.27696>:
  }
  i = 0;
  goto <D.20999>;
  <D.20998>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  D.27701 = D.27700->rank;
  if (D.27701 == rank) goto <D.27702>; else goto <D.27703>;
  <D.27702>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  D.27704 = D.27700->elem_size;
  if (D.27704 == elem_size) goto <D.27705>; else goto <D.27706>;
  <D.27705>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  ret = D.27700->method;
  goto <D.20997>;
  <D.27706>:
  <D.27703>:
  i = i + 1;
  <D.20999>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.20998>; else goto <D.20997>;
  <D.20997>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27708>; else goto <D.27709>;
    <D.27708>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27709>:
    D.27710 = ret != 0;
    D.27711 = (long int) D.27710;
    D.27712 = __builtin_expect (D.27711, 0);
    if (D.27712 != 0) goto <D.27713>; else goto <D.27714>;
    <D.27713>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11371, "ret == 0");
    <D.27714>:
  }
  if (ret != 0B) goto <D.27715>; else goto <D.27716>;
  <D.27715>:
  D.27717 = ret;
  return D.27717;
  <D.27716>:
  rank.408 = (unsigned int) rank;
  D.27719 = rank.408 * 4;
  branch_positions = monoeg_malloc0 (D.27719);
  D.27720 = rank + 1;
  D.27721 = (unsigned int) D.27720;
  D.27722 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27722, D.27721);
  D.27723 = mono_defaults.int_class;
  D.27724 = &D.27723->byval_arg;
  sig->ret = D.27724;
  D.27725 = mono_defaults.object_class;
  D.27726 = &D.27725->byval_arg;
  sig->params[0] = D.27726;
  i = 0;
  goto <D.21002>;
  <D.21001>:
  D.27727 = i + 1;
  D.27728 = mono_defaults.int32_class;
  D.27729 = &D.27728->byval_arg;
  sig->params[D.27727] = D.27729;
  i = i + 1;
  <D.21002>:
  if (i < rank) goto <D.21001>; else goto <D.21003>;
  <D.21003>:
  D.27725 = mono_defaults.object_class;
  mb = mono_mb_new (D.27725, "ElementAddr", 7);
  D.27723 = mono_defaults.int_class;
  D.27724 = &D.27723->byval_arg;
  bounds = mono_mb_add_local (mb, D.27724);
  D.27728 = mono_defaults.int32_class;
  D.27729 = &D.27728->byval_arg;
  ind = mono_mb_add_local (mb, D.27729);
  D.27728 = mono_defaults.int32_class;
  D.27729 = &D.27728->byval_arg;
  realidx = mono_mb_add_local (mb, D.27729);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 77);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_stloc (mb, bounds.409);
  mono_mb_emit_ldarg (mb, 1);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.410);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  D.27732 = mono_mb_emit_branch (mb, 65);
  branch_pos = (int) D.27732;
  i = 1;
  goto <D.21005>;
  <D.21004>:
  D.27727 = i + 1;
  D.27733 = (unsigned int) D.27727;
  mono_mb_emit_ldarg (mb, D.27733);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.27734 = i.406 * 8;
  D.27735 = D.27734 + 4;
  D.27736 = (int) D.27735;
  mono_mb_emit_icon (mb, D.27736);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 89);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_stloc (mb, realidx.411);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.411);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.27734 = i.406 * 8;
  D.27738 = (int) D.27734;
  mono_mb_emit_icon (mb, D.27738);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  i.406 = (unsigned int) i;
  D.27739 = i.406 * 4;
  D.27740 = branch_positions + D.27739;
  D.27741 = mono_mb_emit_branch (mb, 65);
  D.27742 = (int) D.27741;
  *D.27740 = D.27742;
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.27734 = i.406 * 8;
  D.27738 = (int) D.27734;
  mono_mb_emit_icon (mb, D.27738);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  mono_mb_emit_byte (mb, 90);
  realidx.411 = (unsigned int) realidx;
  mono_mb_emit_ldloc (mb, realidx.411);
  mono_mb_emit_byte (mb, 88);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_stloc (mb, ind.410);
  i = i + 1;
  <D.21005>:
  if (i < rank) goto <D.21004>; else goto <D.21006>;
  <D.21006>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 16);
  ind.410 = (unsigned int) ind;
  mono_mb_emit_ldloc (mb, ind.410);
  mono_mb_emit_icon (mb, elem_size);
  mono_mb_emit_byte (mb, 90);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 42);
  i = 1;
  goto <D.21008>;
  <D.21007>:
  i.406 = (unsigned int) i;
  D.27739 = i.406 * 4;
  D.27740 = branch_positions + D.27739;
  D.27743 = *D.27740;
  D.27744 = (unsigned int) D.27743;
  mono_mb_patch_branch (mb, D.27744);
  i = i + 1;
  <D.21008>:
  if (i < rank) goto <D.21007>; else goto <D.21009>;
  <D.21009>:
  branch_pos.412 = (unsigned int) branch_pos;
  mono_mb_patch_branch (mb, branch_pos.412);
  mono_mb_emit_exception (mb, "IndexOutOfRangeException", 0B);
  monoeg_g_free (branch_positions);
  ret = mono_mb_create_method (mb, sig, 4);
  mono_mb_free (mb);
  cached = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27746>; else goto <D.27747>;
    <D.27746>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27747>:
    D.27748 = ret != 0;
    D.27749 = (long int) D.27748;
    D.27750 = __builtin_expect (D.27749, 0);
    if (D.27750 != 0) goto <D.27751>; else goto <D.27752>;
    <D.27751>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11475, "ret == 0");
    <D.27752>:
  }
  i = 0;
  goto <D.21013>;
  <D.21012>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  D.27701 = D.27700->rank;
  if (D.27701 == rank) goto <D.27753>; else goto <D.27754>;
  <D.27753>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  D.27704 = D.27700->elem_size;
  if (D.27704 == elem_size) goto <D.27755>; else goto <D.27756>;
  <D.27755>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27699 = i.406 * 12;
  D.27700 = elem_addr_cache.405 + D.27699;
  ret = D.27700->method;
  cached = 1;
  goto <D.21011>;
  <D.27756>:
  <D.27754>:
  i = i + 1;
  <D.21013>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.21012>; else goto <D.21011>;
  <D.21011>:
  if (cached == 0) goto <D.27757>; else goto <D.27758>;
  <D.27757>:
  {
    struct WrapperInfo * info;

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

      elem_addr_cache_size.413 = elem_addr_cache_size;
      new_size = elem_addr_cache_size.413 + 4;
      new_size.414 = (unsigned int) new_size;
      D.27763 = new_size.414 * 12;
      new_array = monoeg_malloc0 (D.27763);
      elem_addr_cache_size.413 = elem_addr_cache_size;
      elem_addr_cache_size.415 = (unsigned int) elem_addr_cache_size.413;
      D.27765 = elem_addr_cache_size.415 * 12;
      elem_addr_cache.405 = elem_addr_cache;
      memcpy (new_array, elem_addr_cache.405, D.27765);
      elem_addr_cache.405 = elem_addr_cache;
      monoeg_g_free (elem_addr_cache.405);
      elem_addr_cache = new_array;
      elem_addr_cache_size = new_size;
    }
    <D.27761>:
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.27767 = elem_addr_cache_next.416 * 12;
    D.27768 = elem_addr_cache.405 + D.27767;
    D.27768->rank = rank;
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.27767 = elem_addr_cache_next.416 * 12;
    D.27768 = elem_addr_cache.405 + D.27767;
    D.27768->elem_size = elem_size;
    elem_addr_cache.405 = elem_addr_cache;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.416 = (unsigned int) elem_addr_cache_next.407;
    D.27767 = elem_addr_cache_next.416 * 12;
    D.27768 = elem_addr_cache.405 + D.27767;
    D.27768->method = ret;
    elem_addr_cache_next.407 = elem_addr_cache_next;
    elem_addr_cache_next.417 = elem_addr_cache_next.407 + 1;
    elem_addr_cache_next = elem_addr_cache_next.417;
    info = mono_wrapper_info_create (ret, 1);
    rank.418 = (unsigned int) rank;
    info->d.element_addr.rank = rank.418;
    elem_size.419 = (unsigned int) elem_size;
    info->d.element_addr.elem_size = elem_size.419;
    mono_marshal_set_wrapper_info (ret, info);
  }
  <D.27758>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27772>; else goto <D.27773>;
    <D.27772>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27773>:
    D.27774 = ret != 0;
    D.27775 = (long int) D.27774;
    D.27776 = __builtin_expect (D.27775, 0);
    if (D.27776 != 0) goto <D.27777>; else goto <D.27778>;
    <D.27777>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11505, "ret == 0");
    <D.27778>:
  }
  D.27717 = ret;
  return D.27717;
}


mono_marshal_get_array_accessor_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.27782;
  struct MonoImage * D.27783;
  struct GHashTable * * D.27784;
  struct MonoMethod * D.27787;
  struct MonoMethodSignature * D.27788;
  const char * D.27789;
  unsigned char D.27790;
  unsigned char D.27791;
  _Bool D.27794;
  int D.27795;
  int D.27796;
  unsigned int D.27797;
  short unsigned int D.27798;
  int D.27799;
  struct MonoGenericContext * D.27802;
  struct MonoMethod * D.27803;
  int D.27807;
  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.27780>; else goto <D.27781>;
  <D.27780>:
  cache = 0B;
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11537);
  <D.27781>:
  D.27782 = method->klass;
  D.27783 = D.27782->image;
  D.27784 = &D.27783->array_accessor_cache;
  cache = get_cache (D.27784, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27785>; else goto <D.27786>;
  <D.27785>:
  D.27787 = res;
  return D.27787;
  <D.27786>:
  D.27788 = mono_method_signature (method);
  D.27782 = method->klass;
  D.27783 = D.27782->image;
  sig = signature_dup (D.27783, D.27788);
  sig->pinvoke = 0;
  D.27789 = method->name;
  D.27782 = method->klass;
  mb = mono_mb_new (D.27782, D.27789, 25);
  D.27790 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27791 = D.27790 & 64;
  if (D.27791 != 0) goto <D.27792>; else goto <D.27793>;
  <D.27792>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27793>:
  i = 0;
  goto <D.21031>;
  <D.21030>:
  D.27790 = BIT_FIELD_REF <*sig, 8, 80>;
  D.27791 = D.27790 & 64;
  D.27794 = D.27791 != 0;
  D.27795 = (int) D.27794;
  D.27796 = D.27795 + i;
  D.27797 = (unsigned int) D.27796;
  mono_mb_emit_ldarg (mb, D.27797);
  i = i + 1;
  <D.21031>:
  D.27798 = sig->param_count;
  D.27799 = (int) D.27798;
  if (D.27799 > i) goto <D.21030>; else goto <D.21032>;
  <D.21032>:
  if (ctx != 0B) goto <D.27800>; else goto <D.27801>;
  <D.27800>:
  D.27802 = &container->context;
  D.27803 = mono_class_inflate_generic_method (method, D.27802);
  mono_mb_emit_managed_call (mb, D.27803, 0B);
  goto <D.27804>;
  <D.27801>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.27804>:
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.27805>; else goto <D.27806>;
  <D.27805>:
  {
    struct MonoMethod * def;

    D.27798 = sig->param_count;
    D.27799 = (int) D.27798;
    D.27807 = D.27799 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.27807);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.27808>;
  <D.27806>:
  D.27798 = sig->param_count;
  D.27799 = (int) D.27798;
  D.27807 = D.27799 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27807);
  info = mono_wrapper_info_create (res, 20);
  info->d.array_accessor.method = method;
  mono_marshal_set_wrapper_info (res, info);
  <D.27808>:
  mono_mb_free (mb);
  D.27787 = res;
  return D.27787;
}


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

  res = monoeg_try_malloc (size);
  if (res == 0B) goto <D.27810>; else goto <D.27811>;
  <D.27810>:
  mono_gc_out_of_memory (size);
  <D.27811>:
  D.27812 = res;
  return D.27812;
}


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


mono_marshal_free_array (void * * ptr, int size)
{
  unsigned int i.420;
  unsigned int D.27817;
  void * * D.27818;
  void * D.27819;
  int i;

  if (ptr == 0B) goto <D.27814>; else goto <D.27815>;
  <D.27814>:
  return;
  <D.27815>:
  i = 0;
  goto <D.21047>;
  <D.21046>:
  i.420 = (unsigned int) i;
  D.27817 = i.420 * 4;
  D.27818 = ptr + D.27817;
  D.27819 = *D.27818;
  if (D.27819 != 0B) goto <D.27820>; else goto <D.27821>;
  <D.27820>:
  i.420 = (unsigned int) i;
  D.27817 = i.420 * 4;
  D.27818 = ptr + D.27817;
  D.27819 = *D.27818;
  monoeg_g_free (D.27819);
  <D.27821>:
  i = i + 1;
  <D.21047>:
  if (i < size) goto <D.21046>; else goto <D.21048>;
  <D.21048>:
}


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

  if (s != 0B) goto <D.27825>; else goto <D.27826>;
  <D.27825>:
  iftmp.421 = mono_string_chars (s);
  goto <D.27827>;
  <D.27826>:
  iftmp.421 = 0B;
  <D.27827>:
  D.27823 = iftmp.421;
  return D.27823;
}


mono_marshal_set_last_error ()
{
  int * D.27829;
  int D.27830;
  void * D.27831;
  unsigned int last_error_tls_id.422;

  D.27829 = __errno_location ();
  D.27830 = *D.27829;
  D.27831 = (void *) D.27830;
  last_error_tls_id.422 = last_error_tls_id;
  mono_native_tls_set_value (last_error_tls_id.422, D.27831);
}


mono_native_tls_set_value (pthread_key_t key, void * value)
{
  int D.27833;
  int D.27834;
  _Bool D.27835;

  D.27834 = pthread_setspecific (key, value);
  D.27835 = D.27834 == 0;
  D.27833 = (int) D.27835;
  return D.27833;
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (struct MonoArray * src, gint32 start_index, void * dest, gint32 length)
{
  _Bool D.27837;
  long int D.27838;
  long int D.27839;
  _Bool D.27844;
  long int D.27845;
  long int D.27846;
  struct MonoVTable * D.27851;
  struct MonoClass * D.27852;
  unsigned char D.27853;
  struct MonoException * D.27856;
  struct MonoException * D.27859;
  struct MonoException * D.27862;
  int D.27863;
  unsigned int D.27864;
  unsigned int D.27865;
  struct MonoException * D.27868;
  double[0:] * D.27869;
  int D.27870;
  sizetype D.27871;
  int D.27872;
  unsigned int D.27873;
  int element_size;
  void * source_addr;

  D.27837 = src == 0B;
  D.27838 = (long int) D.27837;
  D.27839 = __builtin_expect (D.27838, 0);
  if (D.27839 != 0) goto <D.27840>; else goto <D.27841>;
  <D.27840>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27842>; else goto <D.27843>;
    <D.27842>:
    <D.27843>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27841>:
  D.27844 = dest == 0B;
  D.27845 = (long int) D.27844;
  D.27846 = __builtin_expect (D.27845, 0);
  if (D.27846 != 0) goto <D.27847>; else goto <D.27848>;
  <D.27847>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.27849>; else goto <D.27850>;
    <D.27849>:
    <D.27850>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.27848>:
  D.27851 = src->obj.vtable;
  D.27852 = D.27851->klass;
  D.27853 = D.27852->rank;
  if (D.27853 != 1) goto <D.27854>; else goto <D.27855>;
  <D.27854>:
  D.27856 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.27856);
  <D.27855>:
  if (start_index < 0) goto <D.27857>; else goto <D.27858>;
  <D.27857>:
  D.27859 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.27859);
  <D.27858>:
  if (length < 0) goto <D.27860>; else goto <D.27861>;
  <D.27860>:
  D.27862 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.27862);
  <D.27861>:
  D.27863 = start_index + length;
  D.27864 = (unsigned int) D.27863;
  D.27865 = mono_array_length (src);
  if (D.27864 > D.27865) goto <D.27866>; else goto <D.27867>;
  <D.27866>:
  D.27868 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.27868);
  <D.27867>:
  D.27851 = src->obj.vtable;
  D.27852 = D.27851->klass;
  element_size = mono_array_element_size (D.27852);
  D.27869 = &src->vector;
  D.27870 = element_size * start_index;
  D.27871 = (sizetype) D.27870;
  source_addr = D.27869 + D.27871;
  D.27872 = length * element_size;
  D.27873 = (unsigned int) D.27872;
  memcpy (dest, source_addr, D.27873);
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (void * src, gint32 start_index, struct MonoArray * dest, gint32 length)
{
  _Bool D.27874;
  long int D.27875;
  long int D.27876;
  _Bool D.27881;
  long int D.27882;
  long int D.27883;
  struct MonoVTable * D.27888;
  struct MonoClass * D.27889;
  unsigned char D.27890;
  struct MonoException * D.27893;
  struct MonoException * D.27896;
  struct MonoException * D.27899;
  int D.27900;
  unsigned int D.27901;
  unsigned int D.27902;
  struct MonoException * D.27905;
  double[0:] * D.27906;
  int D.27907;
  sizetype D.27908;
  int D.27909;
  unsigned int D.27910;
  int element_size;
  void * dest_addr;

  D.27874 = src == 0B;
  D.27875 = (long int) D.27874;
  D.27876 = __builtin_expect (D.27875, 0);
  if (D.27876 != 0) goto <D.27877>; else goto <D.27878>;
  <D.27877>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27879>; else goto <D.27880>;
    <D.27879>:
    <D.27880>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27878>:
  D.27881 = dest == 0B;
  D.27882 = (long int) D.27881;
  D.27883 = __builtin_expect (D.27882, 0);
  if (D.27883 != 0) goto <D.27884>; else goto <D.27885>;
  <D.27884>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.27886>; else goto <D.27887>;
    <D.27886>:
    <D.27887>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.27885>:
  D.27888 = dest->obj.vtable;
  D.27889 = D.27888->klass;
  D.27890 = D.27889->rank;
  if (D.27890 != 1) goto <D.27891>; else goto <D.27892>;
  <D.27891>:
  D.27893 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.27893);
  <D.27892>:
  if (start_index < 0) goto <D.27894>; else goto <D.27895>;
  <D.27894>:
  D.27896 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.27896);
  <D.27895>:
  if (length < 0) goto <D.27897>; else goto <D.27898>;
  <D.27897>:
  D.27899 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.27899);
  <D.27898>:
  D.27900 = start_index + length;
  D.27901 = (unsigned int) D.27900;
  D.27902 = mono_array_length (dest);
  if (D.27901 > D.27902) goto <D.27903>; else goto <D.27904>;
  <D.27903>:
  D.27905 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.27905);
  <D.27904>:
  D.27888 = dest->obj.vtable;
  D.27889 = D.27888->klass;
  element_size = mono_array_element_size (D.27889);
  D.27906 = &dest->vector;
  D.27907 = element_size * start_index;
  D.27908 = (sizetype) D.27907;
  dest_addr = D.27906 + D.27908;
  D.27909 = length * element_size;
  D.27910 = (unsigned int) D.27909;
  memcpy (dest_addr, src, D.27910);
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char * ptr)
{
  struct MonoString * D.27913;
  struct MonoDomain * D.27914;

  if (ptr == 0B) goto <D.27911>; else goto <D.27912>;
  <D.27911>:
  D.27913 = 0B;
  return D.27913;
  <D.27912>:
  D.27914 = mono_domain_get ();
  D.27913 = mono_string_new (D.27914, ptr);
  return D.27913;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char * ptr, gint32 len)
{
  struct MonoException * D.27918;
  struct MonoString * D.27919;
  unsigned int len.423;
  struct MonoDomain * D.27921;

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


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

  domain = mono_domain_get ();
  len = 0;
  t = ptr;
  if (ptr == 0B) goto <D.27923>; else goto <D.27924>;
  <D.27923>:
  D.27925 = 0B;
  return D.27925;
  <D.27924>:
  goto <D.21096>;
  <D.21095>:
  len = len + 1;
  <D.21096>:
  t.424 = t;
  t = t.424 + 2;
  D.27927 = *t.424;
  if (D.27927 != 0) goto <D.21095>; else goto <D.21097>;
  <D.21097>:
  D.27925 = mono_string_new_utf16 (domain, ptr, len);
  return D.27925;
}


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

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


ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error ()
{
  guint32 D.27934;
  unsigned int last_error_tls_id.425;
  void * D.27936;

  last_error_tls_id.425 = last_error_tls_id;
  D.27936 = pthread_getspecific (last_error_tls_id.425);
  D.27934 = (guint32) D.27936;
  return D.27934;
}


ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (struct MonoReflectionType * rtype)
{
  _Bool D.27938;
  long int D.27939;
  long int D.27940;
  int D.27945;
  struct MonoException * D.27948;
  unsigned int D.27949;
  const char * D.27952;
  guint32 D.27953;
  int D.27954;
  struct MonoClass * klass;
  struct MonoType * type;
  guint32 layout;

  D.27938 = rtype == 0B;
  D.27939 = (long int) D.27938;
  D.27940 = __builtin_expect (D.27939, 0);
  if (D.27940 != 0) goto <D.27941>; else goto <D.27942>;
  <D.27941>:
  {
    struct MonoException * ex;

    if (rtype != 0B) goto <D.27943>; else goto <D.27944>;
    <D.27943>:
    <D.27944>:
    ex = mono_get_exception_argument_null ("rtype");
    mono_raise_exception (ex);
  }
  <D.27942>:
  type = rtype->type;
  klass = mono_class_from_mono_type (type);
  D.27945 = mono_class_init (klass);
  if (D.27945 == 0) goto <D.27946>; else goto <D.27947>;
  <D.27946>:
  D.27948 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.27948);
  <D.27947>:
  D.27949 = klass->flags;
  layout = D.27949 & 24;
  if (layout == 0) goto <D.27950>; else goto <D.27951>;
  <D.27950>:
  {
    gchar * msg;
    struct MonoException * exc;

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


ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (struct MonoObject * obj, void * dst, MonoBoolean delete_old)
{
  _Bool D.27956;
  long int D.27957;
  long int D.27958;
  void * dst.426;
  _Bool D.27964;
  long int D.27965;
  long int D.27966;
  struct MonoVTable * D.27971;
  struct MonoClass * D.27972;
  struct MonoMethod * method;
  void * pa[3];

  try
    {
      D.27956 = obj == 0B;
      D.27957 = (long int) D.27956;
      D.27958 = __builtin_expect (D.27957, 0);
      if (D.27958 != 0) goto <D.27959>; else goto <D.27960>;
      <D.27959>:
      {
        struct MonoException * ex;

        if (obj != 0B) goto <D.27961>; else goto <D.27962>;
        <D.27961>:
        <D.27962>:
        ex = mono_get_exception_argument_null ("obj");
        mono_raise_exception (ex);
      }
      <D.27960>:
      dst.426 = dst;
      D.27964 = dst.426 == 0B;
      D.27965 = (long int) D.27964;
      D.27966 = __builtin_expect (D.27965, 0);
      if (D.27966 != 0) goto <D.27967>; else goto <D.27968>;
      <D.27967>:
      {
        struct MonoException * ex;

        dst.426 = dst;
        if (dst.426 != 0B) goto <D.27969>; else goto <D.27970>;
        <D.27969>:
        <D.27970>:
        ex = mono_get_exception_argument_null ("dst");
        mono_raise_exception (ex);
      }
      <D.27968>:
      D.27971 = obj->vtable;
      D.27972 = D.27971->klass;
      method = mono_marshal_get_struct_to_ptr (D.27972);
      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.27973;
  long int D.27974;
  long int D.27975;
  _Bool D.27980;
  long int D.27981;
  long int D.27982;
  struct MonoVTable * D.27987;
  struct MonoClass * D.27988;
  struct MonoType * D.27989;
  unsigned char D.27990;
  struct MonoType * t;

  D.27973 = src == 0B;
  D.27974 = (long int) D.27973;
  D.27975 = __builtin_expect (D.27974, 0);
  if (D.27975 != 0) goto <D.27976>; else goto <D.27977>;
  <D.27976>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27978>; else goto <D.27979>;
    <D.27978>:
    <D.27979>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27977>:
  D.27980 = dst == 0B;
  D.27981 = (long int) D.27980;
  D.27982 = __builtin_expect (D.27981, 0);
  if (D.27982 != 0) goto <D.27983>; else goto <D.27984>;
  <D.27983>:
  {
    struct MonoException * ex;

    if (dst != 0B) goto <D.27985>; else goto <D.27986>;
    <D.27985>:
    <D.27986>:
    ex = mono_get_exception_argument_null ("dst");
    mono_raise_exception (ex);
  }
  <D.27984>:
  D.27987 = dst->vtable;
  D.27988 = D.27987->klass;
  D.27989 = mono_class_get_type (D.27988);
  t = mono_type_get_underlying_type (D.27989);
  D.27990 = t->type;
  if (D.27990 == 17) goto <D.27991>; else goto <D.27992>;
  <D.27991>:
  {
    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.27992>:
  ptr_to_structure (src, dst);
}


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

  try
    {
      D.27994 = dst->vtable;
      D.27995 = D.27994->klass;
      method = mono_marshal_get_ptr_to_struct (D.27995);
      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.27998;
  _Bool D.27999;
  long int D.28000;
  long int D.28001;
  struct MonoType * D.28006;
  int D.28007;
  struct MonoException * D.28010;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoObject * res;

  domain = mono_domain_get ();
  if (src == 0B) goto <D.27996>; else goto <D.27997>;
  <D.27996>:
  D.27998 = 0B;
  return D.27998;
  <D.27997>:
  D.27999 = type == 0B;
  D.28000 = (long int) D.27999;
  D.28001 = __builtin_expect (D.28000, 0);
  if (D.28001 != 0) goto <D.28002>; else goto <D.28003>;
  <D.28002>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28004>; else goto <D.28005>;
    <D.28004>:
    <D.28005>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28003>:
  D.28006 = type->type;
  klass = mono_class_from_mono_type (D.28006);
  D.28007 = mono_class_init (klass);
  if (D.28007 == 0) goto <D.28008>; else goto <D.28009>;
  <D.28008>:
  D.28010 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28010);
  <D.28009>:
  res = mono_object_new (domain, klass);
  ptr_to_structure (src, res);
  D.27998 = res;
  return D.27998;
}


ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (struct MonoReflectionType * type, struct MonoString * field_name)
{
  _Bool D.28012;
  long int D.28013;
  long int D.28014;
  _Bool D.28019;
  long int D.28020;
  long int D.28021;
  struct MonoType * D.28026;
  int D.28027;
  struct MonoException * D.28030;
  struct MonoType * D.28031;
  short unsigned int D.28032;
  int D.28033;
  int D.28034;
  int D.21169;
  const char * D.28037;
  _Bool D.28042;
  _Bool D.28043;
  _Bool D.28044;
  const char * D.28047;
  int D.28048;
  unsigned int D.28049;
  struct MonoMarshalType * info;
  struct MonoClass * klass;
  char * fname;
  int match_index;

  match_index = -1;
  D.28012 = type == 0B;
  D.28013 = (long int) D.28012;
  D.28014 = __builtin_expect (D.28013, 0);
  if (D.28014 != 0) goto <D.28015>; else goto <D.28016>;
  <D.28015>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28017>; else goto <D.28018>;
    <D.28017>:
    <D.28018>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28016>:
  D.28019 = field_name == 0B;
  D.28020 = (long int) D.28019;
  D.28021 = __builtin_expect (D.28020, 0);
  if (D.28021 != 0) goto <D.28022>; else goto <D.28023>;
  <D.28022>:
  {
    struct MonoException * ex;

    if (field_name != 0B) goto <D.28024>; else goto <D.28025>;
    <D.28024>:
    <D.28025>:
    ex = mono_get_exception_argument_null ("field_name");
    mono_raise_exception (ex);
  }
  <D.28023>:
  fname = mono_string_to_utf8 (field_name);
  D.28026 = type->type;
  klass = mono_class_from_mono_type (D.28026);
  D.28027 = mono_class_init (klass);
  if (D.28027 == 0) goto <D.28028>; else goto <D.28029>;
  <D.28028>:
  D.28030 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28030);
  <D.28029>:
  goto <D.21173>;
  <D.21172>:
  {
    struct MonoClassField * field;
    int i;
    void * iter;

    try
      {
        i = 0;
        iter = 0B;
        goto <D.21160>;
        <D.21171>:
        D.28031 = field->type;
        D.28032 = D.28031->attrs;
        D.28033 = (int) D.28032;
        D.28034 = D.28033 & 16;
        if (D.28034 != 0) goto <D.28035>; else goto <D.28036>;
        <D.28035>:
        // predicted unlikely by continue predictor.
        goto <D.21160>;
        <D.28036>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.28037 = mono_field_get_name (field);
          D.21169 = __builtin_strcmp (fname, D.28037);
        }
        if (D.21169 == 0) goto <D.28038>; else goto <D.28039>;
        <D.28038>:
        match_index = i;
        goto <D.21170>;
        <D.28039>:
        i = i + 1;
        <D.21160>:
        field = mono_class_get_fields (klass, &iter);
        if (field != 0B) goto <D.21171>; else goto <D.21170>;
        <D.21170>:
        if (match_index == -1) goto <D.28040>; else goto <D.28041>;
        <D.28040>:
        klass = klass->parent;
        <D.28041>:
      }
    finally
      {
        iter = {CLOBBER};
      }
  }
  <D.21173>:
  D.28042 = klass != 0B;
  D.28043 = match_index == -1;
  D.28044 = D.28042 & D.28043;
  if (D.28044 != 0) goto <D.21172>; else goto <D.21174>;
  <D.21174>:
  monoeg_g_free (fname);
  if (match_index == -1) goto <D.28045>; else goto <D.28046>;
  <D.28045>:
  {
    struct MonoException * exc;
    gchar * tmp;

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (struct MonoString * string)
{
  void * D.28055;
  int D.28056;
  int D.28057;
  int D.28058;
  unsigned int D.28059;
  int D.28060;
  int D.28061;
  unsigned int D.28062;
  mono_unichar2 * D.28063;
  int D.28064;
  unsigned int D.28065;
  unsigned int D.28066;
  gunichar2 * D.28067;

  if (string == 0B) goto <D.28053>; else goto <D.28054>;
  <D.28053>:
  D.28055 = 0B;
  return D.28055;
  <D.28054>:
  {
    gunichar2 * res;

    D.28056 = mono_string_length (string);
    D.28057 = D.28056 + 1;
    D.28058 = D.28057 * 2;
    D.28059 = (unsigned int) D.28058;
    res = monoeg_malloc (D.28059);
    D.28060 = mono_string_length (string);
    D.28061 = D.28060 * 2;
    D.28062 = (unsigned int) D.28061;
    D.28063 = mono_string_chars (string);
    memcpy (res, D.28063, D.28062);
    D.28064 = mono_string_length (string);
    D.28065 = (unsigned int) D.28064;
    D.28066 = D.28065 * 2;
    D.28067 = res + D.28066;
    *D.28067 = 0;
    D.28055 = res;
    return D.28055;
  }
}


ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (void * src, struct MonoReflectionType * type)
{
  _Bool D.28069;
  long int D.28070;
  long int D.28071;
  _Bool D.28076;
  long int D.28077;
  long int D.28078;
  struct MonoType * D.28083;
  int D.28084;
  struct MonoException * D.28087;
  struct MonoClass * klass;

  D.28069 = src == 0B;
  D.28070 = (long int) D.28069;
  D.28071 = __builtin_expect (D.28070, 0);
  if (D.28071 != 0) goto <D.28072>; else goto <D.28073>;
  <D.28072>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.28074>; else goto <D.28075>;
    <D.28074>:
    <D.28075>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.28073>:
  D.28076 = type == 0B;
  D.28077 = (long int) D.28076;
  D.28078 = __builtin_expect (D.28077, 0);
  if (D.28078 != 0) goto <D.28079>; else goto <D.28080>;
  <D.28079>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.28081>; else goto <D.28082>;
    <D.28081>:
    <D.28082>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.28080>:
  D.28083 = type->type;
  klass = mono_class_from_mono_type (D.28083);
  D.28084 = mono_class_init (klass);
  if (D.28084 == 0) goto <D.28085>; else goto <D.28086>;
  <D.28085>:
  D.28087 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28087);
  <D.28086>:
  mono_struct_delete_old (klass, src);
}


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

  if (size == 0) goto <D.28088>; else goto <D.28089>;
  <D.28088>:
  size = 4;
  <D.28089>:
  size.427 = (unsigned int) size;
  res = monoeg_try_malloc (size.427);
  if (res == 0B) goto <D.28091>; else goto <D.28092>;
  <D.28091>:
  size.428 = (unsigned int) size;
  mono_gc_out_of_memory (size.428);
  <D.28092>:
  D.28094 = res;
  return D.28094;
}


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

  if (ptr == 0B) goto <D.28096>; else goto <D.28097>;
  <D.28096>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  D.28099 = 0B;
  return D.28099;
  <D.28097>:
  size.430 = (unsigned int) size;
  res = monoeg_try_realloc (ptr, size.430);
  if (res == 0B) goto <D.28101>; else goto <D.28102>;
  <D.28101>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  <D.28102>:
  D.28099 = res;
  return D.28099;
}


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


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

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (struct MonoArray * arrayobj, int index)
{
  void * D.28110;
  double[0:] * D.28111;
  struct MonoVTable * D.28112;
  struct MonoClass * D.28113;
  int D.28114;
  int D.28115;
  sizetype D.28116;

  D.28111 = &arrayobj->vector;
  D.28112 = arrayobj->obj.vtable;
  D.28113 = D.28112->klass;
  D.28114 = mono_array_element_size (D.28113);
  D.28115 = D.28114 * index;
  D.28116 = (sizetype) D.28115;
  D.28110 = D.28111 + D.28116;
  return D.28110;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void * ftn, struct MonoReflectionType * type)
{
  struct MonoType * D.28118;
  int D.28119;
  struct MonoException * D.28122;
  struct MonoDelegate * D.28123;
  struct MonoClass * klass;

  D.28118 = type->type;
  klass = mono_type_get_class (D.28118);
  D.28119 = mono_class_init (klass);
  if (D.28119 == 0) goto <D.28120>; else goto <D.28121>;
  <D.28120>:
  D.28122 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28122);
  <D.28121>:
  D.28123 = mono_ftnptr_to_delegate (klass, ftn);
  return D.28123;
}


mono_marshal_load_type_info (struct MonoClass * klass)
{
  _Bool D.28125;
  long int D.28126;
  long int D.28127;
  struct MonoMarshalType * D.28130;
  struct MonoMarshalType * D.28133;
  unsigned char D.28134;
  unsigned char D.28135;
  int D.28140;
  _Bool D.28141;
  long int D.28142;
  long int D.28143;
  unsigned int load_type_info_tls_id.433;
  struct MonoType * D.28147;
  short unsigned int D.28148;
  int D.28149;
  int D.28150;
  int D.28153;
  int D.21271;
  int iftmp.434;
  int D.21270;
  const char[9] * D.28159;
  unsigned char D.28160;
  int D.28161;
  unsigned char D.28162;
  int D.28163;
  _Bool D.28164;
  _Bool D.28165;
  _Bool D.28166;
  const unsigned char * D.28169;
  unsigned char D.28170;
  int D.28171;
  const unsigned char * D.28172;
  unsigned char D.28173;
  int D.28174;
  _Bool D.28175;
  _Bool D.28176;
  const unsigned char * D.28179;
  unsigned char D.28180;
  int D.28181;
  const unsigned char * D.28182;
  unsigned char D.28183;
  int D.28184;
  _Bool D.28185;
  _Bool D.28186;
  const unsigned char * D.28189;
  unsigned char D.28190;
  int D.28191;
  const unsigned char * D.28192;
  unsigned char D.28193;
  int D.28194;
  const char * D.28196;
  unsigned int D.28199;
  unsigned int count.435;
  unsigned int D.28201;
  unsigned int D.28202;
  struct MonoImage * D.28203;
  unsigned int count.436;
  unsigned int D.28205;
  struct MonoClass * D.28206;
  unsigned int native_size.437;
  unsigned int parent_size.438;
  unsigned int native_size.439;
  guint32 iftmp.440;
  unsigned char D.28213;
  unsigned char D.28214;
  <unnamed-unsigned:4> D.28217;
  int D.21286;
  int iftmp.441;
  int D.21285;
  unsigned char D.28226;
  int D.28227;
  _Bool D.28228;
  _Bool D.28229;
  _Bool D.28230;
  const unsigned char * D.28233;
  unsigned char D.28234;
  int D.28235;
  _Bool D.28236;
  _Bool D.28237;
  const unsigned char * D.28240;
  unsigned char D.28241;
  int D.28242;
  _Bool D.28243;
  _Bool D.28244;
  const unsigned char * D.28247;
  unsigned char D.28248;
  int D.28249;
  const char * D.28251;
  int D.28254;
  struct MonoMarshalSpec * * D.28257;
  unsigned int D.28258;
  unsigned int D.28259;
  unsigned int D.28260;
  int D.28261;
  int D.28264;
  int D.21295;
  int iftmp.442;
  int D.21294;
  const char[10] * D.28270;
  unsigned char D.28271;
  int D.28272;
  unsigned char D.28273;
  int D.28274;
  _Bool D.28275;
  _Bool D.28276;
  _Bool D.28277;
  const unsigned char * D.28280;
  unsigned char D.28281;
  int D.28282;
  const unsigned char * D.28283;
  unsigned char D.28284;
  int D.28285;
  _Bool D.28286;
  _Bool D.28287;
  const unsigned char * D.28290;
  unsigned char D.28291;
  int D.28292;
  const unsigned char * D.28293;
  unsigned char D.28294;
  int D.28295;
  _Bool D.28296;
  _Bool D.28297;
  const unsigned char * D.28300;
  unsigned char D.28301;
  int D.28302;
  const unsigned char * D.28303;
  unsigned char D.28304;
  int D.28305;
  const char * D.28307;
  <unnamed-unsigned:1> D.28310;
  int D.28311;
  struct MonoMarshalSpec * D.28312;
  guint32 iftmp.443;
  unsigned int D.28316;
  unsigned int align.444;
  unsigned int D.28319;
  unsigned int D.28320;
  unsigned int D.28321;
  unsigned int D.28322;
  unsigned int D.28323;
  unsigned int D.28324;
  unsigned int size.445;
  unsigned int D.28326;
  int D.28327;
  unsigned int D.28328;
  unsigned int D.28329;
  unsigned int D.28330;
  unsigned int D.28334;
  unsigned int D.28342;
  unsigned int D.28343;
  unsigned int D.28346;
  unsigned int D.28347;
  unsigned int D.28348;
  unsigned int D.28349;
  int D.28350;
  unsigned int D.28351;
  unsigned char D.28354;
  struct MonoClass * D.28357;
  int D.28358;
  _Bool D.28363;
  long int D.28364;
  long int D.28365;
  _Bool D.28372;
  long int D.28373;
  long int D.28374;
  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.28125 = klass == 0B;
      D.28126 = (long int) D.28125;
      D.28127 = __builtin_expect (D.28126, 0);
      if (D.28127 != 0) goto <D.28128>; else goto <D.28129>;
      <D.28128>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12208, "klass != NULL");
      <D.28129>:
      D.28130 = klass->marshal_info;
      if (D.28130 != 0B) goto <D.28131>; else goto <D.28132>;
      <D.28131>:
      D.28133 = klass->marshal_info;
      return D.28133;
      <D.28132>:
      D.28134 = BIT_FIELD_REF <*klass, 8, 160>;
      D.28135 = D.28134 & 1;
      if (D.28135 == 0) goto <D.28136>; else goto <D.28137>;
      <D.28136>:
      mono_class_init (klass);
      <D.28137>:
      D.28130 = klass->marshal_info;
      if (D.28130 != 0B) goto <D.28138>; else goto <D.28139>;
      <D.28138>:
      D.28133 = klass->marshal_info;
      return D.28133;
      <D.28139>:
      D.28140 = mono_marshal_is_loading_type_info (klass);
      D.28141 = D.28140 != 0;
      D.28142 = (long int) D.28141;
      D.28143 = __builtin_expect (D.28142, 0);
      if (D.28143 != 0) goto <D.28144>; else goto <D.28145>;
      <D.28144>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12223, "!mono_marshal_is_loading_type_info (klass)");
      <D.28145>:
      load_type_info_tls_id.433 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.433);
      loads_list = monoeg_g_slist_prepend (loads_list, klass);
      load_type_info_tls_id.433 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.433, loads_list);
      iter = 0B;
      goto <D.21262>;
      <D.21272>:
      D.28147 = field->type;
      D.28148 = D.28147->attrs;
      D.28149 = (int) D.28148;
      D.28150 = D.28149 & 16;
      if (D.28150 != 0) goto <D.28151>; else goto <D.28152>;
      <D.28151>:
      // predicted unlikely by continue predictor.
      goto <D.21262>;
      <D.28152>:
      D.28147 = field->type;
      D.28148 = D.28147->attrs;
      D.28149 = (int) D.28148;
      D.28153 = D.28149 & 1536;
      if (D.28153 != 0) goto <D.28154>; else goto <D.28155>;
      <D.28154>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_field_get_name (field);
          D.28159 = "_Deleted";
          D.28160 = MEM[(const unsigned char *)D.28159];
          D.28161 = (int) D.28160;
          D.28162 = *__s2;
          D.28163 = (int) D.28162;
          __result = D.28161 - D.28163;
          {
            D.28164 = __s2_len != 0;
            D.28165 = __result == 0;
            D.28166 = D.28164 & D.28165;
            if (D.28166 != 0) goto <D.28167>; else goto <D.28168>;
            <D.28167>:
            D.28169 = &MEM[(void *)"_Deleted" + 1B];
            D.28170 = *D.28169;
            D.28171 = (int) D.28170;
            D.28172 = __s2 + 1;
            D.28173 = *D.28172;
            D.28174 = (int) D.28173;
            __result = D.28171 - D.28174;
            D.28175 = __s2_len > 1;
            D.28165 = __result == 0;
            D.28176 = D.28175 & D.28165;
            if (D.28176 != 0) goto <D.28177>; else goto <D.28178>;
            <D.28177>:
            D.28179 = &MEM[(void *)"_Deleted" + 2B];
            D.28180 = *D.28179;
            D.28181 = (int) D.28180;
            D.28182 = __s2 + 2;
            D.28183 = *D.28182;
            D.28184 = (int) D.28183;
            __result = D.28181 - D.28184;
            D.28185 = __s2_len > 2;
            D.28165 = __result == 0;
            D.28186 = D.28185 & D.28165;
            if (D.28186 != 0) goto <D.28187>; else goto <D.28188>;
            <D.28187>:
            D.28189 = &MEM[(void *)"_Deleted" + 3B];
            D.28190 = *D.28189;
            D.28191 = (int) D.28190;
            D.28192 = __s2 + 3;
            D.28193 = *D.28192;
            D.28194 = (int) D.28193;
            __result = D.28191 - D.28194;
            <D.28188>:
            <D.28178>:
            <D.28168>:
          }
          D.21270 = __result;
        }
        iftmp.434 = -D.21270;
        goto <D.28195>;
        <D.28158>:
        D.28196 = mono_field_get_name (field);
        iftmp.434 = __builtin_strcmp (D.28196, "_Deleted");
        <D.28195>:
        D.21271 = iftmp.434;
      }
      if (D.21271 == 0) goto <D.28197>; else goto <D.28198>;
      <D.28197>:
      // predicted unlikely by continue predictor.
      goto <D.21262>;
      <D.28198>:
      <D.28155>:
      count = count + 1;
      <D.21262>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21272>; else goto <D.21273>;
      <D.21273>:
      D.28199 = klass->flags;
      layout = D.28199 & 24;
      count.435 = (unsigned int) count;
      D.28201 = count.435 * 12;
      D.28202 = D.28201 + 20;
      D.28203 = klass->image;
      info = mono_image_alloc0 (D.28203, D.28202);
      count.436 = (unsigned int) count;
      info->num_fields = count.436;
      D.28205 = klass->type_token;
      D.28203 = klass->image;
      mono_metadata_packing_from_typedef (D.28203, D.28205, 0B, &native_size);
      D.28206 = klass->parent;
      if (D.28206 != 0B) goto <D.28207>; else goto <D.28208>;
      <D.28207>:
      {
        int parent_size;

        D.28206 = klass->parent;
        parent_size = mono_class_native_size (D.28206, 0B);
        native_size.437 = native_size;
        parent_size.438 = (unsigned int) parent_size;
        native_size.439 = native_size.437 + parent_size.438;
        native_size = native_size.439;
        parent_size.438 = (unsigned int) parent_size;
        info->native_size = parent_size.438;
      }
      <D.28208>:
      D.28213 = BIT_FIELD_REF <*klass, 8, 176>;
      D.28214 = D.28213 & 15;
      if (D.28214 != 0) goto <D.28215>; else goto <D.28216>;
      <D.28215>:
      D.28217 = klass->packing_size;
      iftmp.440 = (guint32) D.28217;
      goto <D.28218>;
      <D.28216>:
      iftmp.440 = 8;
      <D.28218>:
      packing = iftmp.440;
      iter = 0B;
      j = 0;
      goto <D.21277>;
      <D.21300>:
      {
        int size;
        guint32 align;

        try
          {
            D.28147 = field->type;
            D.28148 = D.28147->attrs;
            D.28149 = (int) D.28148;
            D.28150 = D.28149 & 16;
            if (D.28150 != 0) goto <D.28219>; else goto <D.28220>;
            <D.28219>:
            // predicted unlikely by continue predictor.
            goto <D.21277>;
            <D.28220>:
            D.28147 = field->type;
            D.28148 = D.28147->attrs;
            D.28149 = (int) D.28148;
            D.28153 = D.28149 & 1536;
            if (D.28153 != 0) goto <D.28221>; else goto <D.28222>;
            <D.28221>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28159 = "_Deleted";
                D.28160 = MEM[(const unsigned char *)D.28159];
                D.28161 = (int) D.28160;
                D.28226 = *__s2;
                D.28227 = (int) D.28226;
                __result = D.28161 - D.28227;
                {
                  D.28228 = __s2_len != 0;
                  D.28229 = __result == 0;
                  D.28230 = D.28228 & D.28229;
                  if (D.28230 != 0) goto <D.28231>; else goto <D.28232>;
                  <D.28231>:
                  D.28169 = &MEM[(void *)"_Deleted" + 1B];
                  D.28170 = *D.28169;
                  D.28171 = (int) D.28170;
                  D.28233 = __s2 + 1;
                  D.28234 = *D.28233;
                  D.28235 = (int) D.28234;
                  __result = D.28171 - D.28235;
                  D.28236 = __s2_len > 1;
                  D.28229 = __result == 0;
                  D.28237 = D.28236 & D.28229;
                  if (D.28237 != 0) goto <D.28238>; else goto <D.28239>;
                  <D.28238>:
                  D.28179 = &MEM[(void *)"_Deleted" + 2B];
                  D.28180 = *D.28179;
                  D.28181 = (int) D.28180;
                  D.28240 = __s2 + 2;
                  D.28241 = *D.28240;
                  D.28242 = (int) D.28241;
                  __result = D.28181 - D.28242;
                  D.28243 = __s2_len > 2;
                  D.28229 = __result == 0;
                  D.28244 = D.28243 & D.28229;
                  if (D.28244 != 0) goto <D.28245>; else goto <D.28246>;
                  <D.28245>:
                  D.28189 = &MEM[(void *)"_Deleted" + 3B];
                  D.28190 = *D.28189;
                  D.28191 = (int) D.28190;
                  D.28247 = __s2 + 3;
                  D.28248 = *D.28247;
                  D.28249 = (int) D.28248;
                  __result = D.28191 - D.28249;
                  <D.28246>:
                  <D.28239>:
                  <D.28232>:
                }
                D.21285 = __result;
              }
              iftmp.441 = -D.21285;
              goto <D.28250>;
              <D.28225>:
              D.28251 = mono_field_get_name (field);
              iftmp.441 = __builtin_strcmp (D.28251, "_Deleted");
              <D.28250>:
              D.21286 = iftmp.441;
            }
            if (D.21286 == 0) goto <D.28252>; else goto <D.28253>;
            <D.28252>:
            // predicted unlikely by continue predictor.
            goto <D.21277>;
            <D.28253>:
            <D.28222>:
            D.28147 = field->type;
            D.28148 = D.28147->attrs;
            D.28149 = (int) D.28148;
            D.28254 = D.28149 & 4096;
            if (D.28254 != 0) goto <D.28255>; else goto <D.28256>;
            <D.28255>:
            D.28257 = &info->fields[j].mspec;
            D.28258 = mono_class_get_field_token (field);
            D.28259 = D.28258 & 16777215;
            D.28260 = D.28259 + 4294967295;
            D.28203 = klass->image;
            mono_metadata_field_info_with_mempool (D.28203, D.28260, 0B, 0B, D.28257);
            <D.28256>:
            info->fields[j].field = field;
            D.28261 = mono_class_num_fields (klass);
            if (D.28261 == 1) goto <D.28262>; else goto <D.28263>;
            <D.28262>:
            D.28264 = klass->instance_size;
            if (D.28264 == 8) goto <D.28265>; else goto <D.28266>;
            <D.28265>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28270 = "$PRIVATE$";
                D.28271 = MEM[(const unsigned char *)D.28270];
                D.28272 = (int) D.28271;
                D.28273 = *__s2;
                D.28274 = (int) D.28273;
                __result = D.28272 - D.28274;
                {
                  D.28275 = __s2_len != 0;
                  D.28276 = __result == 0;
                  D.28277 = D.28275 & D.28276;
                  if (D.28277 != 0) goto <D.28278>; else goto <D.28279>;
                  <D.28278>:
                  D.28280 = &MEM[(void *)"$PRIVATE$" + 1B];
                  D.28281 = *D.28280;
                  D.28282 = (int) D.28281;
                  D.28283 = __s2 + 1;
                  D.28284 = *D.28283;
                  D.28285 = (int) D.28284;
                  __result = D.28282 - D.28285;
                  D.28286 = __s2_len > 1;
                  D.28276 = __result == 0;
                  D.28287 = D.28286 & D.28276;
                  if (D.28287 != 0) goto <D.28288>; else goto <D.28289>;
                  <D.28288>:
                  D.28290 = &MEM[(void *)"$PRIVATE$" + 2B];
                  D.28291 = *D.28290;
                  D.28292 = (int) D.28291;
                  D.28293 = __s2 + 2;
                  D.28294 = *D.28293;
                  D.28295 = (int) D.28294;
                  __result = D.28292 - D.28295;
                  D.28296 = __s2_len > 2;
                  D.28276 = __result == 0;
                  D.28297 = D.28296 & D.28276;
                  if (D.28297 != 0) goto <D.28298>; else goto <D.28299>;
                  <D.28298>:
                  D.28300 = &MEM[(void *)"$PRIVATE$" + 3B];
                  D.28301 = *D.28300;
                  D.28302 = (int) D.28301;
                  D.28303 = __s2 + 3;
                  D.28304 = *D.28303;
                  D.28305 = (int) D.28304;
                  __result = D.28302 - D.28305;
                  <D.28299>:
                  <D.28289>:
                  <D.28279>:
                }
                D.21294 = __result;
              }
              iftmp.442 = -D.21294;
              goto <D.28306>;
              <D.28269>:
              D.28307 = mono_field_get_name (field);
              iftmp.442 = __builtin_strcmp (D.28307, "$PRIVATE$");
              <D.28306>:
              D.21295 = iftmp.442;
            }
            if (D.21295 == 0) goto <D.28308>; else goto <D.28309>;
            <D.28308>:
            // predicted unlikely by continue predictor.
            goto <D.21277>;
            <D.28309>:
            <D.28266>:
            <D.28263>:
            switch (layout) <default: <D.28331>, case 0: <D.21296>, case 8: <D.21297>, case 16: <D.21299>>
            <D.21296>:
            <D.21297>:
            D.28310 = klass->unicode;
            D.28311 = (int) D.28310;
            D.28312 = info->fields[j].mspec;
            D.28147 = field->type;
            size = mono_marshal_type_size (D.28147, D.28312, &align, 1, D.28311);
            D.28213 = BIT_FIELD_REF <*klass, 8, 176>;
            D.28214 = D.28213 & 15;
            if (D.28214 != 0) goto <D.28314>; else goto <D.28315>;
            <D.28314>:
            D.28217 = klass->packing_size;
            D.28316 = (unsigned int) D.28217;
            align.444 = align;
            iftmp.443 = MIN_EXPR <D.28316, align.444>;
            goto <D.28318>;
            <D.28315>:
            iftmp.443 = align;
            <D.28318>:
            align = iftmp.443;
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.28319 = info->native_size;
            info->fields[j].offset = D.28319;
            D.28320 = info->fields[j].offset;
            align.444 = align;
            D.28321 = D.28320 + align.444;
            D.28322 = D.28321 + 4294967295;
            info->fields[j].offset = D.28322;
            D.28320 = info->fields[j].offset;
            align.444 = align;
            D.28323 = -align.444;
            D.28324 = D.28320 & D.28323;
            info->fields[j].offset = D.28324;
            D.28320 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.28326 = D.28320 + size.445;
            info->native_size = D.28326;
            goto <D.21298>;
            <D.21299>:
            D.28310 = klass->unicode;
            D.28311 = (int) D.28310;
            D.28312 = info->fields[j].mspec;
            D.28147 = field->type;
            size = mono_marshal_type_size (D.28147, D.28312, &align, 1, D.28311);
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.28327 = field->offset;
            D.28328 = (unsigned int) D.28327;
            D.28329 = D.28328 + 4294967288;
            info->fields[j].offset = D.28329;
            D.28320 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.28326 = D.28320 + size.445;
            D.28319 = info->native_size;
            D.28330 = MAX_EXPR <D.28326, D.28319>;
            info->native_size = D.28330;
            goto <D.21298>;
            <D.28331>:
            <D.21298>:
            j = j + 1;
          }
        finally
          {
            align = {CLOBBER};
          }
      }
      <D.21277>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21300>; else goto <D.21301>;
      <D.21301>:
      if (layout != 0) goto <D.28332>; else goto <D.28333>;
      <D.28332>:
      D.28319 = info->native_size;
      native_size.437 = native_size;
      D.28334 = MAX_EXPR <D.28319, native_size.437>;
      info->native_size = D.28334;
      if (layout == 16) goto <D.28335>; else goto <D.28336>;
      <D.28335>:
      native_size.437 = native_size;
      if (native_size.437 != 0) goto <D.28339>; else goto <D.28337>;
      <D.28339>:
      D.28319 = info->native_size;
      native_size.437 = native_size;
      if (D.28319 == native_size.437) goto <D.28340>; else goto <D.28337>;
      <D.28340>:
      D.28213 = BIT_FIELD_REF <*klass, 8, 176>;
      D.28214 = D.28213 & 15;
      if (D.28214 == 0) goto <D.28341>; else goto <D.28337>;
      <D.28341>:
      min_align = 1;
      goto <D.28338>;
      <D.28337>:
      min_align = MIN_EXPR <packing, min_align>;
      <D.28338>:
      <D.28336>:
      <D.28333>:
      D.28319 = info->native_size;
      D.28342 = min_align + 4294967295;
      D.28343 = D.28319 & D.28342;
      if (D.28343 != 0) goto <D.28344>; else goto <D.28345>;
      <D.28344>:
      D.28319 = info->native_size;
      D.28346 = D.28319 + min_align;
      D.28347 = D.28346 + 4294967295;
      info->native_size = D.28347;
      D.28319 = info->native_size;
      D.28348 = -min_align;
      D.28349 = D.28319 & D.28348;
      info->native_size = D.28349;
      <D.28345>:
      info->min_align = min_align;
      D.28319 = info->native_size;
      D.28350 = mono_class_value_size (klass, 0B);
      D.28351 = (unsigned int) D.28350;
      if (D.28319 != D.28351) goto <D.28352>; else goto <D.28353>;
      <D.28352>:
      klass->blittable = 0;
      <D.28353>:
      D.28354 = klass->rank;
      if (D.28354 != 0) goto <D.28355>; else goto <D.28356>;
      <D.28355>:
      D.28357 = klass->element_class;
      D.28358 = mono_marshal_is_loading_type_info (D.28357);
      if (D.28358 == 0) goto <D.28359>; else goto <D.28360>;
      <D.28359>:
      D.28357 = klass->element_class;
      mono_marshal_load_type_info (D.28357);
      <D.28360>:
      <D.28356>:
      load_type_info_tls_id.433 = load_type_info_tls_id;
      loads_list = pthread_getspecific (load_type_info_tls_id.433);
      loads_list = monoeg_g_slist_remove (loads_list, klass);
      load_type_info_tls_id.433 = load_type_info_tls_id;
      mono_native_tls_set_value (load_type_info_tls_id.433, loads_list);
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28361>; else goto <D.28362>;
        <D.28361>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.28362>:
        D.28363 = ret != 0;
        D.28364 = (long int) D.28363;
        D.28365 = __builtin_expect (D.28364, 0);
        if (D.28365 != 0) goto <D.28366>; else goto <D.28367>;
        <D.28366>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12335, "ret == 0");
        <D.28367>:
      }
      D.28130 = klass->marshal_info;
      if (D.28130 == 0B) goto <D.28368>; else goto <D.28369>;
      <D.28368>:
      mono_memory_barrier ();
      klass->marshal_info = info;
      <D.28369>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28370>; else goto <D.28371>;
        <D.28370>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28371>:
        D.28372 = ret != 0;
        D.28373 = (long int) D.28372;
        D.28374 = __builtin_expect (D.28373, 0);
        if (D.28374 != 0) goto <D.28375>; else goto <D.28376>;
        <D.28375>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12341, "ret == 0");
        <D.28376>:
      }
      D.28133 = klass->marshal_info;
      return D.28133;
    }
  finally
    {
      native_size = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_marshal_is_loading_type_info (struct MonoClass * klass)
{
  unsigned int load_type_info_tls_id.446;
  gboolean D.28382;
  struct GSList * D.28383;
  _Bool D.28384;
  struct GSList * loads_list;

  load_type_info_tls_id.446 = load_type_info_tls_id;
  loads_list = pthread_getspecific (load_type_info_tls_id.446);
  D.28383 = monoeg_g_slist_find (loads_list, klass);
  D.28384 = D.28383 != 0B;
  D.28382 = (gboolean) D.28384;
  return D.28382;
}


mono_class_native_size (struct MonoClass * klass, guint32 * align)
{
  struct MonoMarshalType * D.28386;
  int D.28389;
  gint32 D.28394;
  unsigned int D.28397;
  unsigned int D.28398;

  D.28386 = klass->marshal_info;
  if (D.28386 == 0B) goto <D.28387>; else goto <D.28388>;
  <D.28387>:
  D.28389 = mono_marshal_is_loading_type_info (klass);
  if (D.28389 != 0) goto <D.28390>; else goto <D.28391>;
  <D.28390>:
  if (align != 0B) goto <D.28392>; else goto <D.28393>;
  <D.28392>:
  *align = 0;
  <D.28393>:
  D.28394 = 0;
  return D.28394;
  <D.28391>:
  mono_marshal_load_type_info (klass);
  <D.28388>:
  if (align != 0B) goto <D.28395>; else goto <D.28396>;
  <D.28395>:
  D.28386 = klass->marshal_info;
  D.28397 = D.28386->min_align;
  *align = D.28397;
  <D.28396>:
  D.28386 = klass->marshal_info;
  D.28398 = D.28386->native_size;
  D.28394 = (gint32) D.28398;
  return D.28394;
}


mono_type_native_stack_size (struct MonoType * t, guint32 * align)
{
  _Bool D.28400;
  long int D.28401;
  long int D.28402;
  unsigned char D.28407;
  unsigned char D.28408;
  int D.28411;
  unsigned char D.28412;
  int D.28413;
  int D.28414;
  unsigned char D.28417;
  unsigned char D.28418;
  struct MonoType * D.28421;
  int D.28422;
  unsigned int D.28423;
  unsigned int D.28424;
  unsigned int D.28425;
  guint32 tmp;

  try
    {
      D.28400 = t == 0B;
      D.28401 = (long int) D.28400;
      D.28402 = __builtin_expect (D.28401, 0);
      if (D.28402 != 0) goto <D.28403>; else goto <D.28404>;
      <D.28403>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12389, "t != NULL");
      <D.28404>:
      if (align == 0B) goto <D.28405>; else goto <D.28406>;
      <D.28405>:
      align = &tmp;
      <D.28406>:
      D.28407 = BIT_FIELD_REF <*t, 8, 56>;
      D.28408 = D.28407 & 64;
      if (D.28408 != 0) goto <D.28409>; else goto <D.28410>;
      <D.28409>:
      *align = 4;
      D.28411 = 4;
      return D.28411;
      <D.28410>:
      D.28412 = t->type;
      D.28413 = (int) D.28412;
      switch (D.28413) <default: <D.21345>, case 2: <D.21313>, case 3: <D.21314>, case 4: <D.21315>, case 5: <D.21316>, case 6: <D.21317>, case 7: <D.21318>, case 8: <D.21319>, case 9: <D.21320>, case 10: <D.21335>, case 11: <D.21336>, case 12: <D.21330>, case 13: <D.21331>, case 14: <D.21323>, case 15: <D.21327>, case 17: <D.21342>, case 18: <D.21325>, case 20: <D.21329>, case 21: <D.21340>, case 22: <D.21341>, case 24: <D.21321>, case 25: <D.21322>, case 27: <D.21328>, case 28: <D.21324>, case 29: <D.21326>>
      {
        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.21313>:
        <D.21314>:
        <D.21315>:
        <D.21316>:
        <D.21317>:
        <D.21318>:
        <D.21319>:
        <D.21320>:
        *align = 4;
        D.28411 = 4;
        return D.28411;
        <D.21321>:
        <D.21322>:
        <D.21323>:
        <D.21324>:
        <D.21325>:
        <D.21326>:
        <D.21327>:
        <D.21328>:
        <D.21329>:
        *align = 4;
        D.28411 = 4;
        return D.28411;
        <D.21330>:
        *align = 4;
        D.28411 = 4;
        return D.28411;
        <D.21331>:
        *align = 4;
        D.28411 = 8;
        return D.28411;
        <D.21335>:
        <D.21336>:
        *align = 4;
        D.28411 = 8;
        return D.28411;
        <D.21340>:
        D.28414 = mono_type_generic_inst_is_valuetype (t);
        if (D.28414 == 0) goto <D.28415>; else goto <D.28416>;
        <D.28415>:
        *align = 4;
        D.28411 = 4;
        return D.28411;
        <D.28416>:
        <D.21341>:
        <D.21342>:
        {
          guint32 size;
          struct MonoClass * klass;

          klass = mono_class_from_mono_type (t);
          D.28417 = BIT_FIELD_REF <*klass, 8, 160>;
          D.28418 = D.28417 & 16;
          if (D.28418 != 0) goto <D.28419>; else goto <D.28420>;
          <D.28419>:
          D.28421 = mono_class_enum_basetype (klass);
          D.28411 = mono_type_native_stack_size (D.28421, align);
          return D.28411;
          <D.28420>:
          D.28422 = mono_class_native_size (klass, align);
          size = (guint32) D.28422;
          D.28423 = *align;
          D.28424 = D.28423 + 3;
          *align = D.28424;
          D.28423 = *align;
          D.28425 = D.28423 & 4294967292;
          *align = D.28425;
          size = size + 3;
          size = size & 4294967292;
          D.28411 = (int) size;
          return D.28411;
        }
        <D.21345>:
        D.28412 = t->type;
        D.28413 = (int) D.28412;
        monoeg_g_log (0B, 4, "type 0x%02x unknown", D.28413);
        <D.21346>:
        goto <D.21346>;
      }
      D.28411 = 0;
      return D.28411;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


mono_marshal_type_size (struct MonoType * type, struct MonoMarshalSpec * mspec, guint32 * align, gboolean as_field, gboolean unicode)
{
  gint32 D.28428;
  struct MonoClass * D.28429;
  <unnamed type> D.28434;
  int iftmp.447;
  _Bool D.28441;
  long int D.28442;
  long int D.28443;
  unsigned int esize.448;
  int D.28447;
  struct MonoClass * D.28448;
  struct MonoClass * D.28449;
  int iftmp.449;
  unsigned int esize.450;
  MonoMarshalNative native_type;
  struct MonoClass * klass;

  native_type = mono_type_to_unmanaged (type, mspec, as_field, unicode, 0B);
  switch (native_type) <default: <D.21402>, case 2: <D.21356>, case 3: <D.21357>, case 4: <D.21358>, case 5: <D.21359>, case 6: <D.21360>, case 7: <D.21362>, case 8: <D.21363>, case 9: <D.21365>, case 10: <D.21366>, case 11: <D.21370>, case 12: <D.21371>, case 15: <D.21400>, case 19: <D.21380>, case 20: <D.21377>, case 21: <D.21378>, case 22: <D.21379>, case 23: <D.21395>, case 25: <D.21385>, case 26: <D.21386>, case 27: <D.21394>, case 28: <D.21387>, case 29: <D.21384>, case 30: <D.21397>, case 31: <D.21375>, case 32: <D.21376>, case 34: <D.21401>, case 35: <D.21381>, case 36: <D.21382>, case 37: <D.21361>, case 38: <D.21389>, case 40: <D.21388>, case 42: <D.21383>, case 43: <D.21390>, case 44: <D.21399>, case 45: <D.21364>>
  {
    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.21356>:
    *align = 4;
    D.28428 = 4;
    return D.28428;
    <D.21357>:
    <D.21358>:
    *align = 1;
    D.28428 = 1;
    return D.28428;
    <D.21359>:
    <D.21360>:
    <D.21361>:
    *align = 2;
    D.28428 = 2;
    return D.28428;
    <D.21362>:
    <D.21363>:
    <D.21364>:
    *align = 4;
    D.28428 = 4;
    return D.28428;
    <D.21365>:
    <D.21366>:
    *align = 4;
    D.28428 = 8;
    return D.28428;
    <D.21370>:
    *align = 4;
    D.28428 = 4;
    return D.28428;
    <D.21371>:
    *align = 4;
    D.28428 = 8;
    return D.28428;
    <D.21375>:
    <D.21376>:
    <D.21377>:
    <D.21378>:
    <D.21379>:
    <D.21380>:
    <D.21381>:
    <D.21382>:
    <D.21383>:
    <D.21384>:
    <D.21385>:
    <D.21386>:
    <D.21387>:
    <D.21388>:
    <D.21389>:
    <D.21390>:
    *align = 4;
    D.28428 = 4;
    return D.28428;
    <D.21394>:
    klass = mono_class_from_mono_type (type);
    D.28429 = mono_defaults.object_class;
    if (D.28429 == klass) goto <D.28430>; else goto <D.28431>;
    <D.28430>:
    if (mspec != 0B) goto <D.28432>; else goto <D.28433>;
    <D.28432>:
    D.28434 = mspec->native;
    if (D.28434 == 27) goto <D.28435>; else goto <D.28436>;
    <D.28435>:
    *align = 16;
    D.28428 = 16;
    return D.28428;
    <D.28436>:
    <D.28433>:
    <D.28431>:
    D.28428 = mono_class_native_size (klass, align);
    return D.28428;
    <D.21395>:
    {
      int esize;

      if (unicode != 0) goto <D.28438>; else goto <D.28439>;
      <D.28438>:
      iftmp.447 = 2;
      goto <D.28440>;
      <D.28439>:
      iftmp.447 = 1;
      <D.28440>:
      esize = iftmp.447;
      D.28441 = mspec == 0B;
      D.28442 = (long int) D.28441;
      D.28443 = __builtin_expect (D.28442, 0);
      if (D.28443 != 0) goto <D.28444>; else goto <D.28445>;
      <D.28444>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12524, "mspec");
      <D.28445>:
      esize.448 = (unsigned int) esize;
      *align = esize.448;
      D.28447 = mspec->data.array_data.num_elem;
      D.28428 = D.28447 * esize;
      return D.28428;
    }
    <D.21397>:
    {
      int esize;

      klass = mono_class_from_mono_type (type);
      D.28448 = klass->element_class;
      D.28449 = mono_defaults.char_class;
      if (D.28448 == D.28449) goto <D.28450>; else goto <D.28451>;
      <D.28450>:
      if (unicode != 0) goto <D.28453>; else goto <D.28454>;
      <D.28453>:
      iftmp.449 = 2;
      goto <D.28455>;
      <D.28454>:
      iftmp.449 = 1;
      <D.28455>:
      esize = iftmp.449;
      esize.450 = (unsigned int) esize;
      *align = esize.450;
      goto <D.28457>;
      <D.28451>:
      D.28448 = klass->element_class;
      esize = mono_class_native_size (D.28448, align);
      <D.28457>:
      D.28441 = mspec == 0B;
      D.28442 = (long int) D.28441;
      D.28443 = __builtin_expect (D.28442, 0);
      if (D.28443 != 0) goto <D.28458>; else goto <D.28459>;
      <D.28458>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12538, "mspec");
      <D.28459>:
      D.28447 = mspec->data.array_data.num_elem;
      D.28428 = D.28447 * esize;
      return D.28428;
    }
    <D.21399>:
    *align = 4;
    D.28428 = 4;
    return D.28428;
    <D.21400>:
    <D.21401>:
    <D.21402>:
    monoeg_g_log (0B, 4, "native type %02x not implemented", native_type);
    <D.21403>:
    goto <D.21403>;
  }
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12551);
  D.28428 = 0;
  return D.28428;
}


mono_marshal_asany (struct MonoObject * o, MonoMarshalNative string_encoding, int param_attrs)
{
  void * D.28463;
  struct MonoVTable * D.28464;
  struct MonoClass * D.28465;
  unsigned char D.28466;
  int D.28467;
  unsigned int D.28468;
  unsigned int D.28469;
  unsigned char D.28473;
  unsigned char D.28474;
  unsigned char D.28478;
  int D.28479;
  long unsigned int D.28480;
  void * res.451;
  unsigned int param_attrs.452;
  unsigned int D.28483;
  struct MonoException * D.28487;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28461>; else goto <D.28462>;
  <D.28461>:
  D.28463 = 0B;
  return D.28463;
  <D.28462>:
  D.28464 = o->vtable;
  D.28465 = D.28464->klass;
  t = &D.28465->byval_arg;
  D.28466 = t->type;
  D.28467 = (int) D.28466;
  switch (D.28467) <default: <D.28486>, case 2: <D.21416>, case 3: <D.21419>, case 4: <D.21414>, case 5: <D.21415>, case 6: <D.21417>, case 7: <D.21418>, case 8: <D.21411>, case 9: <D.21412>, case 10: <D.21420>, case 11: <D.21421>, case 12: <D.21422>, case 13: <D.21423>, case 14: <D.21424>, case 15: <D.21413>, case 17: <D.21430>, case 18: <D.21429>>
  <D.21411>:
  <D.21412>:
  <D.21413>:
  <D.21414>:
  <D.21415>:
  <D.21416>:
  <D.21417>:
  <D.21418>:
  <D.21419>:
  <D.21420>:
  <D.21421>:
  <D.21422>:
  <D.21423>:
  D.28463 = mono_object_unbox (o);
  return D.28463;
  <D.21424>:
  switch (string_encoding) <default: <D.21427>, case 20: <D.21426>, case 21: <D.21425>>
  <D.21425>:
  D.28463 = mono_marshal_string_to_utf16_copy (o);
  return D.28463;
  <D.21426>:
  D.28463 = mono_string_to_lpstr (o);
  return D.28463;
  <D.21427>:
  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.21428>;
  <D.21429>:
  <D.21430>:
  {
    struct MonoMethod * method;
    void * pa[3];
    void * res;
    MonoBoolean delete_old;

    try
      {
        delete_old = 0;
        klass = t->data.klass;
        D.28468 = klass->flags;
        D.28469 = D.28468 & 24;
        if (D.28469 == 0) goto <D.21428>; else goto <D.28470>;
        <D.28470>:
        D.28473 = BIT_FIELD_REF <*klass, 8, 160>;
        D.28474 = D.28473 & 8;
        if (D.28474 != 0) goto <D.28475>; else goto <D.28476>;
        <D.28475>:
        D.28468 = klass->flags;
        D.28469 = D.28468 & 24;
        if (D.28469 == 16) goto <D.28471>; else goto <D.28477>;
        <D.28477>:
        D.28473 = BIT_FIELD_REF <*klass, 8, 160>;
        D.28478 = D.28473 & 48;
        if (D.28478 != 0) goto <D.28471>; else goto <D.28472>;
        <D.28471>:
        D.28463 = mono_object_unbox (o);
        return D.28463;
        <D.28472>:
        <D.28476>:
        D.28479 = mono_class_native_size (klass, 0B);
        D.28480 = (long unsigned int) D.28479;
        res.451 = mono_marshal_alloc (D.28480);
        res = res.451;
        param_attrs.452 = (unsigned int) param_attrs;
        D.28483 = param_attrs.452 & 3;
        if (D.28483 != 2) goto <D.28484>; else goto <D.28485>;
        <D.28484>:
        D.28464 = o->vtable;
        D.28465 = D.28464->klass;
        method = mono_marshal_get_struct_to_ptr (D.28465);
        pa[0] = o;
        pa[1] = &res;
        pa[2] = &delete_old;
        mono_runtime_invoke (method, 0B, &pa, 0B);
        <D.28485>:
        D.28463 = res;
        return D.28463;
      }
    finally
      {
        pa = {CLOBBER};
        res = {CLOBBER};
        delete_old = {CLOBBER};
      }
  }
  <D.28486>:
  <D.21428>:
  D.28487 = mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter.");
  mono_raise_exception (D.28487);
  D.28463 = 0B;
  return D.28463;
}


mono_marshal_free_asany (struct MonoObject * o, void * ptr, MonoMarshalNative string_encoding, int param_attrs)
{
  struct MonoVTable * D.28493;
  struct MonoClass * D.28494;
  unsigned char D.28495;
  int D.28496;
  void * ptr.453;
  unsigned char D.28498;
  unsigned char D.28499;
  unsigned int D.28502;
  unsigned int D.28503;
  unsigned char D.28505;
  int D.28507;
  unsigned int param_attrs.454;
  unsigned int D.28511;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28491>; else goto <D.28492>;
  <D.28491>:
  return;
  <D.28492>:
  D.28493 = o->vtable;
  D.28494 = D.28493->klass;
  t = &D.28494->byval_arg;
  D.28495 = t->type;
  D.28496 = (int) D.28495;
  switch (D.28496) <default: <D.21453>, case 14: <D.21443>, case 17: <D.21450>, case 18: <D.21449>>
  <D.21443>:
  switch (string_encoding) <default: <D.21447>, case 20: <D.21445>, case 21: <D.21444>>
  <D.21444>:
  <D.21445>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.21446>;
  <D.21447>:
  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.21446>:
  goto <D.21448>;
  <D.21449>:
  <D.21450>:
  klass = t->data.klass;
  D.28498 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28499 = D.28498 & 8;
  if (D.28499 != 0) goto <D.28500>; else goto <D.28501>;
  <D.28500>:
  D.28502 = klass->flags;
  D.28503 = D.28502 & 24;
  if (D.28503 == 16) goto <D.21448>; else goto <D.28504>;
  <D.28504>:
  D.28498 = BIT_FIELD_REF <*klass, 8, 160>;
  D.28505 = D.28498 & 48;
  if (D.28505 != 0) goto <D.21448>; else goto <D.28506>;
  <D.28506>:
  <D.28501>:
  D.28507 = param_attrs & 2;
  if (D.28507 != 0) goto <D.28508>; else goto <D.28509>;
  <D.28508>:
  {
    struct MonoMethod * method;
    void * pa[2];

    try
      {
        D.28493 = o->vtable;
        D.28494 = D.28493->klass;
        method = mono_marshal_get_ptr_to_struct (D.28494);
        pa[0] = &ptr;
        pa[1] = o;
        mono_runtime_invoke (method, 0B, &pa, 0B);
      }
    finally
      {
        pa = {CLOBBER};
      }
  }
  <D.28509>:
  param_attrs.454 = (unsigned int) param_attrs;
  D.28511 = param_attrs.454 & 3;
  if (D.28511 != 2) goto <D.28512>; else goto <D.28513>;
  <D.28512>:
  ptr.453 = ptr;
  mono_struct_delete_old (klass, ptr.453);
  <D.28513>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.21448>;
  <D.21453>:
  goto <D.21448>;
  <D.21448>:
}


mono_marshal_get_generic_array_helper (struct MonoClass * class, struct MonoClass * iface, gchar * name, struct MonoMethod * method)
{
  struct MonoMethod * D.28516;
  struct MonoClass * D.28517;
  struct MonoImage * D.28518;
  int D.28519;
  unsigned int D.28520;
  short unsigned int D.28521;
  int D.28522;
  int D.28523;
  struct MonoMethod * D.28524;
  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.28516 = mb->method;
  D.28516->slot = -1;
  D.28516 = mb->method;
  D.28516->flags = 481;
  sig = mono_method_signature (method);
  D.28517 = method->klass;
  D.28518 = D.28517->image;
  csig = signature_dup (D.28518, sig);
  csig->generic_param_count = 0;
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.21467>;
  <D.21466>:
  D.28519 = i + 1;
  D.28520 = (unsigned int) D.28519;
  mono_mb_emit_ldarg (mb, D.28520);
  i = i + 1;
  <D.21467>:
  D.28521 = csig->param_count;
  D.28522 = (int) D.28521;
  if (D.28522 > i) goto <D.21466>; else goto <D.21468>;
  <D.21468>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  mb->skip_visibility = 1;
  D.28521 = csig->param_count;
  D.28522 = (int) D.28521;
  D.28523 = D.28522 + 16;
  res = mono_mb_create_method (mb, csig, D.28523);
  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.28524 = res;
  return D.28524;
}


mono_win32_compat_CopyMemory (void * dest, const void * source, gsize length)
{
  _Bool D.28526;
  _Bool D.28527;
  _Bool D.28528;

  D.28526 = dest == 0B;
  D.28527 = source == 0B;
  D.28528 = D.28526 | D.28527;
  if (D.28528 != 0) goto <D.28529>; else goto <D.28530>;
  <D.28529>:
  return;
  <D.28530>:
  memcpy (dest, source, length);
}


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

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


mono_win32_compat_MoveMemory (void * dest, const void * source, gsize length)
{
  _Bool D.28533;
  _Bool D.28534;
  _Bool D.28535;

  D.28533 = dest == 0B;
  D.28534 = source == 0B;
  D.28535 = D.28533 | D.28534;
  if (D.28535 != 0) goto <D.28536>; else goto <D.28537>;
  <D.28536>:
  return;
  <D.28537>:
  memmove (dest, source, length);
}


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


mono_marshal_find_nonzero_bit_offset (guint8 * buf, int len, int * byte_offset, guint8 * bitmask)
{
  sizetype i.455;
  guint8 * D.28540;
  unsigned char D.28541;
  _Bool D.28543;
  long int D.28544;
  long int D.28545;
  int D.28549;
  int D.28550;
  _Bool D.28551;
  long int D.28552;
  long int D.28553;
  int i;
  guint8 byte;

  i = 0;
  goto <D.21498>;
  <D.21497>:
  i.455 = (sizetype) i;
  D.28540 = buf + i.455;
  D.28541 = *D.28540;
  if (D.28541 != 0) goto <D.21496>; else goto <D.28542>;
  <D.28542>:
  i = i + 1;
  <D.21498>:
  if (i < len) goto <D.21497>; else goto <D.21496>;
  <D.21496>:
  D.28543 = i >= len;
  D.28544 = (long int) D.28543;
  D.28545 = __builtin_expect (D.28544, 0);
  if (D.28545 != 0) goto <D.28546>; else goto <D.28547>;
  <D.28546>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12773, "i < len");
  <D.28547>:
  i.455 = (sizetype) i;
  D.28540 = buf + i.455;
  byte = *D.28540;
  goto <D.21500>;
  <D.21499>:
  byte = byte >> 1;
  <D.21500>:
  if (byte != 0) goto <D.28548>; else goto <D.21501>;
  <D.28548>:
  D.28549 = (int) byte;
  D.28550 = D.28549 & 1;
  if (D.28550 == 0) goto <D.21499>; else goto <D.21501>;
  <D.21501>:
  D.28551 = byte != 1;
  D.28552 = (long int) D.28551;
  D.28553 = __builtin_expect (D.28552, 0);
  if (D.28553 != 0) goto <D.28554>; else goto <D.28555>;
  <D.28554>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12778, "byte == 1");
  <D.28555>:
  *byte_offset = i;
  i.455 = (sizetype) i;
  D.28540 = buf + i.455;
  D.28541 = *D.28540;
  *bitmask = D.28541;
}


mono_marshal_get_thunk_invoke_wrapper (struct MonoMethod * method)
{
  _Bool D.28556;
  long int D.28557;
  long int D.28558;
  struct MonoClass * D.28561;
  struct GHashTable * * D.28562;
  struct MonoMethod * D.28565;
  const char * D.28566;
  short unsigned int D.28567;
  int D.28568;
  <unnamed-unsigned:1> D.28569;
  int D.28570;
  int D.28571;
  unsigned int param_count.456;
  unsigned int D.28573;
  unsigned int D.28574;
  unsigned int D.28575;
  unsigned int sig_size.457;
  short unsigned int D.28577;
  unsigned char D.28578;
  unsigned char D.28579;
  struct MonoType * D.28582;
  int D.28583;
  struct MonoType * D.28584;
  int D.28585;
  struct MonoClass * D.28586;
  struct MonoType * D.28587;
  struct MonoType * D.28588;
  struct MonoType * D.28589;
  struct MonoType * D.28590;
  int D.28591;
  struct MonoClass * D.28594;
  struct MonoType * D.28595;
  int D.28596;
  unsigned int D.28599;
  int D.28600;
  unsigned int D.28601;
  unsigned int i.458;
  struct MonoType * D.28603;
  int D.28604;
  unsigned char D.28609;
  unsigned char D.28610;
  short unsigned int D.28614;
  int D.28615;
  int D.28616;
  int D.28620;
  unsigned int D.28623;
  int D.28624;
  unsigned int D.28625;
  unsigned int D.28626;
  unsigned int D.28627;
  int D.28628;
  unsigned int D.28629;
  int D.28630;
  unsigned int D.28631;
  unsigned int D.28632;
  unsigned int D.28633;
  unsigned int pos_leave.459;
  int D.28635;
  int D.28638;
  struct MonoClass * D.28641;
  int D.28642;
  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.28556 = method == 0B;
  D.28557 = (long int) D.28556;
  D.28558 = __builtin_expect (D.28557, 0);
  if (D.28558 != 0) goto <D.28559>; else goto <D.28560>;
  <D.28559>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12796, "method");
  <D.28560>:
  klass = method->klass;
  D.28561 = method->klass;
  image = D.28561->image;
  D.28562 = &image->thunk_invoke_cache;
  cache = get_cache (D.28562, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28563>; else goto <D.28564>;
  <D.28563>:
  D.28565 = res;
  return D.28565;
  <D.28564>:
  sig = mono_method_signature (method);
  D.28566 = method->name;
  mb = mono_mb_new (klass, D.28566, 5);
  D.28567 = sig->param_count;
  D.28568 = (int) D.28567;
  D.28569 = sig->hasthis;
  D.28570 = (int) D.28569;
  D.28571 = D.28568 + D.28570;
  param_count = D.28571 + 1;
  param_count.456 = (unsigned int) param_count;
  csig = mono_metadata_signature_alloc (image, param_count.456);
  D.28567 = sig->param_count;
  D.28573 = (unsigned int) D.28567;
  D.28574 = D.28573 + 3;
  D.28575 = D.28574 * 4;
  sig_size = (int) D.28575;
  sig_size.457 = (unsigned int) sig_size;
  memcpy (csig, sig, sig_size.457);
  D.28577 = (short unsigned int) param_count;
  csig->param_count = D.28577;
  csig->hasthis = 0;
  csig->pinvoke = 1;
  csig->call_convention = 0;
  D.28578 = BIT_FIELD_REF <*sig, 8, 80>;
  D.28579 = D.28578 & 64;
  if (D.28579 != 0) goto <D.28580>; else goto <D.28581>;
  <D.28580>:
  D.28582 = &klass->byval_arg;
  csig->params[0] = D.28582;
  i = 0;
  goto <D.21518>;
  <D.21517>:
  D.28583 = i + 1;
  D.28584 = sig->params[i];
  csig->params[D.28583] = D.28584;
  i = i + 1;
  <D.21518>:
  D.28567 = sig->param_count;
  D.28568 = (int) D.28567;
  if (D.28568 > i) goto <D.21517>; else goto <D.21519>;
  <D.21519>:
  <D.28581>:
  D.28585 = param_count + -1;
  D.28586 = mono_defaults.exception_class;
  D.28587 = &D.28586->byval_arg;
  D.28588 = mono_metadata_type_dup (image, D.28587);
  csig->params[D.28585] = D.28588;
  D.28585 = param_count + -1;
  D.28589 = csig->params[D.28585];
  D.28589->byref = 1;
  D.28585 = param_count + -1;
  D.28589 = csig->params[D.28585];
  D.28589->attrs = 2;
  D.28590 = sig->ret;
  D.28591 = mono_type_is_struct (D.28590);
  if (D.28591 != 0) goto <D.28592>; else goto <D.28593>;
  <D.28592>:
  D.28594 = mono_defaults.object_class;
  D.28595 = &D.28594->byval_arg;
  csig->ret = D.28595;
  <D.28593>:
  D.28594 = mono_defaults.object_class;
  D.28595 = &D.28594->byval_arg;
  mono_mb_add_local (mb, D.28595);
  D.28590 = sig->ret;
  D.28596 = mono_type_is_void (D.28590);
  if (D.28596 == 0) goto <D.28597>; else goto <D.28598>;
  <D.28597>:
  D.28590 = sig->ret;
  mono_mb_add_local (mb, D.28590);
  <D.28598>:
  D.28585 = param_count + -1;
  D.28599 = (unsigned int) D.28585;
  mono_mb_emit_ldarg (mb, D.28599);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  clause = mono_image_alloc0 (image, 24);
  D.28600 = mono_mb_get_label (mb);
  D.28601 = (unsigned int) D.28600;
  clause->try_offset = D.28601;
  i = 0;
  goto <D.21523>;
  <D.21522>:
  {
    struct MonoType * type;
    struct MonoClass * klass;

    i.458 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.458);
    D.28603 = csig->params[i];
    klass = mono_class_from_mono_type (D.28603);
    type = &klass->byval_arg;
    D.28604 = mono_type_is_struct (type);
    if (D.28604 != 0) goto <D.28605>; else goto <D.28606>;
    <D.28605>:
    mono_mb_emit_op (mb, 121, klass);
    D.28603 = csig->params[i];
    D.28609 = BIT_FIELD_REF <*D.28603, 8, 56>;
    D.28610 = D.28609 & 64;
    if (D.28610 == 0) goto <D.28611>; else goto <D.28612>;
    <D.28611>:
    if (i != 0) goto <D.28607>; else goto <D.28613>;
    <D.28613>:
    D.28578 = BIT_FIELD_REF <*sig, 8, 80>;
    D.28579 = D.28578 & 64;
    if (D.28579 == 0) goto <D.28607>; else goto <D.28608>;
    <D.28607>:
    mono_mb_emit_op (mb, 113, klass);
    <D.28608>:
    <D.28612>:
    D.28594 = mono_defaults.object_class;
    D.28595 = &D.28594->byval_arg;
    csig->params[i] = D.28595;
    <D.28606>:
  }
  i = i + 1;
  <D.21523>:
  D.28585 = param_count + -1;
  if (D.28585 > i) goto <D.21522>; else goto <D.21524>;
  <D.21524>:
  D.28614 = method->flags;
  D.28615 = (int) D.28614;
  D.28616 = D.28615 & 64;
  if (D.28616 != 0) goto <D.28617>; else goto <D.28618>;
  <D.28617>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.28619>;
  <D.28618>:
  mono_mb_emit_op (mb, 40, method);
  <D.28619>:
  D.28590 = sig->ret;
  D.28620 = mono_type_is_void (D.28590);
  if (D.28620 == 0) goto <D.28621>; else goto <D.28622>;
  <D.28621>:
  mono_mb_emit_stloc (mb, 1);
  <D.28622>:
  D.28623 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.28623;
  clause->flags = 0;
  D.28624 = mono_mb_get_pos (mb);
  D.28625 = (unsigned int) D.28624;
  D.28626 = clause->try_offset;
  D.28627 = D.28625 - D.28626;
  clause->try_len = D.28627;
  D.28594 = mono_defaults.object_class;
  clause->data.catch_class = D.28594;
  D.28628 = mono_mb_get_label (mb);
  D.28629 = (unsigned int) D.28628;
  clause->handler_offset = D.28629;
  mono_mb_emit_stloc (mb, 0);
  D.28585 = param_count + -1;
  D.28599 = (unsigned int) D.28585;
  mono_mb_emit_ldarg (mb, D.28599);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.28630 = mono_mb_get_pos (mb);
  D.28631 = (unsigned int) D.28630;
  D.28632 = clause->handler_offset;
  D.28633 = D.28631 - D.28632;
  clause->handler_len = D.28633;
  mono_mb_set_clauses (mb, 1, clause);
  pos_leave.459 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.459);
  D.28590 = sig->ret;
  D.28635 = mono_type_is_void (D.28590);
  if (D.28635 == 0) goto <D.28636>; else goto <D.28637>;
  <D.28636>:
  mono_mb_emit_ldloc (mb, 1);
  D.28590 = sig->ret;
  D.28638 = mono_type_is_struct (D.28590);
  if (D.28638 != 0) goto <D.28639>; else goto <D.28640>;
  <D.28639>:
  D.28590 = sig->ret;
  D.28641 = mono_class_from_mono_type (D.28590);
  mono_mb_emit_op (mb, 140, D.28641);
  <D.28640>:
  <D.28637>:
  mono_mb_emit_byte (mb, 42);
  D.28642 = param_count + 16;
  res = mono_mb_create_and_cache (cache, method, mb, csig, D.28642);
  mono_mb_free (mb);
  D.28565 = res;
  return D.28565;
}


mono_marshal_free_dynamic_wrappers (struct MonoMethod * method)
{
  struct MonoClass * D.28644;
  unsigned char D.28645;
  unsigned char D.28646;
  _Bool D.28647;
  long int D.28648;
  long int D.28649;
  int marshal_mutex_initialized.460;
  _Bool D.28657;
  long int D.28658;
  long int D.28659;
  struct GHashTable * D.28662;
  struct GHashTable * D.28665;
  _Bool D.28672;
  long int D.28673;
  long int D.28674;
  struct MonoImage * image;

  D.28644 = method->klass;
  image = D.28644->image;
  D.28645 = BIT_FIELD_REF <*method, 8, 168>;
  D.28646 = D.28645 & 2;
  D.28647 = D.28646 == 0;
  D.28648 = (long int) D.28647;
  D.28649 = __builtin_expect (D.28648, 0);
  if (D.28649 != 0) goto <D.28650>; else goto <D.28651>;
  <D.28650>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12939, "method->dynamic");
  <D.28651>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.28653>; else goto <D.28654>;
  <D.28653>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28655>; else goto <D.28656>;
    <D.28655>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28656>:
    D.28657 = ret != 0;
    D.28658 = (long int) D.28657;
    D.28659 = __builtin_expect (D.28658, 0);
    if (D.28659 != 0) goto <D.28660>; else goto <D.28661>;
    <D.28660>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12943, "ret == 0");
    <D.28661>:
  }
  <D.28654>:
  D.28662 = image->runtime_invoke_direct_cache;
  if (D.28662 != 0B) goto <D.28663>; else goto <D.28664>;
  <D.28663>:
  D.28662 = image->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.28662, method);
  <D.28664>:
  D.28665 = image->delegate_abstract_invoke_cache;
  if (D.28665 != 0B) goto <D.28666>; else goto <D.28667>;
  <D.28666>:
  D.28665 = image->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.28665, signature_method_pair_matches_method, method);
  <D.28667>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.28668>; else goto <D.28669>;
  <D.28668>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28670>; else goto <D.28671>;
    <D.28670>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28671>:
    D.28672 = ret != 0;
    D.28673 = (long int) D.28672;
    D.28674 = __builtin_expect (D.28673, 0);
    if (D.28674 != 0) goto <D.28675>; else goto <D.28676>;
    <D.28675>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12954, "ret == 0");
    <D.28676>:
  }
  <D.28669>:
}


signature_method_pair_matches_method (void * key, void * value, void * user_data)
{
  gboolean D.28677;
  struct MonoMethod * D.28678;
  _Bool D.28679;
  struct SignatureMethodPair * pair;
  struct MonoMethod * method;

  pair = key;
  method = user_data;
  D.28678 = pair->method;
  D.28679 = D.28678 == method;
  D.28677 = (gboolean) D.28679;
  return D.28677;
}


mono_marshal_free_inflated_wrappers (struct MonoMethod * method)
{
  unsigned char D.28681;
  unsigned char D.28682;
  _Bool D.28683;
  long int D.28684;
  long int D.28685;
  int marshal_mutex_initialized.461;
  _Bool D.28693;
  long int D.28694;
  long int D.28695;
  struct MonoClass * D.28700;
  struct MonoImage * D.28701;
  struct GHashTable * D.28702;
  struct GHashTable * D.28707;
  struct GHashTable * D.28712;
  struct GHashTable * D.28717;
  struct GHashTable * D.28722;
  struct GHashTable * D.28727;
  struct GHashTable * D.28730;
  struct GHashTable * D.28733;
  struct GHashTable * D.28736;
  struct GHashTable * D.28739;
  struct GHashTable * D.28742;
  struct GHashTable * D.28745;
  struct GHashTable * D.28748;
  struct GHashTable * D.28751;
  struct GHashTable * D.28754;
  struct GHashTable * D.28757;
  _Bool D.28762;
  long int D.28763;
  long int D.28764;
  struct MonoMethodSignature * sig;

  sig = method->signature;
  D.28681 = BIT_FIELD_REF <*method, 8, 168>;
  D.28682 = D.28681 & 16;
  D.28683 = D.28682 == 0;
  D.28684 = (long int) D.28683;
  D.28685 = __builtin_expect (D.28684, 0);
  if (D.28685 != 0) goto <D.28686>; else goto <D.28687>;
  <D.28686>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12976, "method->is_inflated");
  <D.28687>:
  marshal_mutex_initialized.461 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.461 == 0) goto <D.28689>; else goto <D.28690>;
  <D.28689>:
  return;
  <D.28690>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28691>; else goto <D.28692>;
    <D.28691>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28692>:
    D.28693 = ret != 0;
    D.28694 = (long int) D.28693;
    D.28695 = __builtin_expect (D.28694, 0);
    if (D.28695 != 0) goto <D.28696>; else goto <D.28697>;
    <D.28696>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12982, "ret == 0");
    <D.28697>:
  }
  if (sig != 0B) goto <D.28698>; else goto <D.28699>;
  <D.28698>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28702 = D.28701->delegate_begin_invoke_cache;
  if (D.28702 != 0B) goto <D.28703>; else goto <D.28704>;
  <D.28703>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28702 = D.28701->delegate_begin_invoke_cache;
  monoeg_g_hash_table_remove (D.28702, sig);
  <D.28704>:
  <D.28699>:
  if (sig != 0B) goto <D.28705>; else goto <D.28706>;
  <D.28705>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28707 = D.28701->delegate_end_invoke_cache;
  if (D.28707 != 0B) goto <D.28708>; else goto <D.28709>;
  <D.28708>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28707 = D.28701->delegate_end_invoke_cache;
  monoeg_g_hash_table_remove (D.28707, sig);
  <D.28709>:
  <D.28706>:
  if (sig != 0B) goto <D.28710>; else goto <D.28711>;
  <D.28710>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28712 = D.28701->delegate_invoke_cache;
  if (D.28712 != 0B) goto <D.28713>; else goto <D.28714>;
  <D.28713>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28712 = D.28701->delegate_invoke_cache;
  monoeg_g_hash_table_remove (D.28712, sig);
  <D.28714>:
  <D.28711>:
  if (sig != 0B) goto <D.28715>; else goto <D.28716>;
  <D.28715>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28717 = D.28701->runtime_invoke_cache;
  if (D.28717 != 0B) goto <D.28718>; else goto <D.28719>;
  <D.28718>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28717 = D.28701->runtime_invoke_cache;
  monoeg_g_hash_table_remove (D.28717, sig);
  <D.28719>:
  <D.28716>:
  if (sig != 0B) goto <D.28720>; else goto <D.28721>;
  <D.28720>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28722 = D.28701->runtime_invoke_vtype_cache;
  if (D.28722 != 0B) goto <D.28723>; else goto <D.28724>;
  <D.28723>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28722 = D.28701->runtime_invoke_vtype_cache;
  monoeg_g_hash_table_remove (D.28722, sig);
  <D.28724>:
  <D.28721>:
  if (sig != 0B) goto <D.28725>; else goto <D.28726>;
  <D.28725>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28727 = D.28701->delegate_abstract_invoke_cache;
  if (D.28727 != 0B) goto <D.28728>; else goto <D.28729>;
  <D.28728>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28727 = D.28701->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.28727, signature_method_pair_matches_signature, sig);
  <D.28729>:
  <D.28726>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28730 = D.28701->runtime_invoke_direct_cache;
  if (D.28730 != 0B) goto <D.28731>; else goto <D.28732>;
  <D.28731>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28730 = D.28701->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.28730, method);
  <D.28732>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28733 = D.28701->managed_wrapper_cache;
  if (D.28733 != 0B) goto <D.28734>; else goto <D.28735>;
  <D.28734>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28733 = D.28701->managed_wrapper_cache;
  monoeg_g_hash_table_remove (D.28733, method);
  <D.28735>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28736 = D.28701->native_wrapper_cache;
  if (D.28736 != 0B) goto <D.28737>; else goto <D.28738>;
  <D.28737>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28736 = D.28701->native_wrapper_cache;
  monoeg_g_hash_table_remove (D.28736, method);
  <D.28738>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28739 = D.28701->remoting_invoke_cache;
  if (D.28739 != 0B) goto <D.28740>; else goto <D.28741>;
  <D.28740>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28739 = D.28701->remoting_invoke_cache;
  monoeg_g_hash_table_remove (D.28739, method);
  <D.28741>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28742 = D.28701->synchronized_cache;
  if (D.28742 != 0B) goto <D.28743>; else goto <D.28744>;
  <D.28743>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28742 = D.28701->synchronized_cache;
  monoeg_g_hash_table_remove (D.28742, method);
  <D.28744>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28745 = D.28701->unbox_wrapper_cache;
  if (D.28745 != 0B) goto <D.28746>; else goto <D.28747>;
  <D.28746>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28745 = D.28701->unbox_wrapper_cache;
  monoeg_g_hash_table_remove (D.28745, method);
  <D.28747>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28748 = D.28701->cominterop_invoke_cache;
  if (D.28748 != 0B) goto <D.28749>; else goto <D.28750>;
  <D.28749>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28748 = D.28701->cominterop_invoke_cache;
  monoeg_g_hash_table_remove (D.28748, method);
  <D.28750>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28751 = D.28701->cominterop_wrapper_cache;
  if (D.28751 != 0B) goto <D.28752>; else goto <D.28753>;
  <D.28752>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28751 = D.28701->cominterop_wrapper_cache;
  monoeg_g_hash_table_remove (D.28751, method);
  <D.28753>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28754 = D.28701->thunk_invoke_cache;
  if (D.28754 != 0B) goto <D.28755>; else goto <D.28756>;
  <D.28755>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28754 = D.28701->thunk_invoke_cache;
  monoeg_g_hash_table_remove (D.28754, method);
  <D.28756>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28757 = D.28701->native_func_wrapper_aot_cache;
  if (D.28757 != 0B) goto <D.28758>; else goto <D.28759>;
  <D.28758>:
  D.28700 = method->klass;
  D.28701 = D.28700->image;
  D.28757 = D.28701->native_func_wrapper_aot_cache;
  monoeg_g_hash_table_remove (D.28757, method);
  <D.28759>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28760>; else goto <D.28761>;
    <D.28760>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28761>:
    D.28762 = ret != 0;
    D.28763 = (long int) D.28762;
    D.28764 = __builtin_expect (D.28763, 0);
    if (D.28764 != 0) goto <D.28765>; else goto <D.28766>;
    <D.28765>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 13034, "ret == 0");
    <D.28766>:
  }
}


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

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


