mono_signature_no_pinvoke (struct MonoMethod * method)
{
  unsigned int D.21525;
  unsigned int D.21526;
  struct MonoClass * D.21529;
  struct MonoImage * D.21530;
  struct MonoMethodSignature * D.21531;
  struct MonoMethodSignature * sig;

  sig = mono_method_signature (method);
  D.21525 = BIT_FIELD_REF <*sig, 32, 64>;
  D.21526 = D.21525 & 16777216;
  if (D.21526 != 0) goto <D.21527>; else goto <D.21528>;
  <D.21527>:
  D.21529 = method->klass;
  D.21530 = D.21529->image;
  sig = signature_dup (D.21530, sig);
  sig->pinvoke = 0;
  <D.21528>:
  D.21531 = sig;
  return D.21531;
}


signature_dup (struct MonoImage * image, struct MonoMethodSignature * sig)
{
  short unsigned int D.21533;
  unsigned int D.21534;
  unsigned int D.21535;
  unsigned int D.21536;
  unsigned int D.21537;
  unsigned int sigsize.0;
  struct MonoMethodSignature * D.21539;
  struct MonoMethodSignature * res;
  int sigsize;

  D.21533 = sig->param_count;
  D.21534 = (unsigned int) D.21533;
  res = mono_metadata_signature_alloc (image, D.21534);
  D.21533 = sig->param_count;
  D.21535 = (unsigned int) D.21533;
  D.21536 = D.21535 + 3;
  D.21537 = D.21536 * 4;
  sigsize = (int) D.21537;
  sigsize.0 = (unsigned int) sigsize;
  memcpy (res, sig, sigsize.0);
  D.21539 = res;
  return D.21539;
}


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

  D.21542 = __builtin_object_size (__dest, 0);
  D.21541 = __builtin___memcpy_chk (__dest, __src, __len, D.21542);
  return D.21541;
}


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.21544;
  void (*<Tc3>) (void *) destructor.1;
  int D.21546;
  _Bool D.21547;

  destructor.1 = (void (*<Tc3>) (void *)) destructor;
  D.21546 = pthread_key_create (key, destructor.1);
  D.21547 = D.21546 == 0;
  D.21544 = (int) D.21547;
  return D.21544;
}


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

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


mono_remoting_wrapper (struct MonoMethod * method, void * * params)
{
  void * D.21552;
  _Bool D.21553;
  long int D.21554;
  long int D.21555;
  struct MonoVTable * D.21558;
  struct MonoClass * D.21559;
  struct MonoClass * D.21560;
  _Bool D.21561;
  long int D.21562;
  long int D.21563;
  struct MonoRemoteClass * D.21566;
  struct MonoClass * D.21567;
  unsigned int D.21568;
  unsigned int D.21569;
  struct MonoRealProxy * D.21572;
  struct MonoObject * D.21573;
  struct MonoAppContext * D.21574;
  short unsigned int D.21577;
  unsigned int count.3;
  unsigned int D.21579;
  struct MonoType * D.21580;
  unsigned int D.21581;
  unsigned int D.21582;
  unsigned int D.21585;
  unsigned int D.21586;
  unsigned int i.4;
  unsigned int D.21590;
  void * * D.21591;
  void * * D.21592;
  void * D.21593;
  void * D.21594;
  struct MonoClass * D.21596;
  int D.21597;
  struct MonoObject * D.21600;
  void * * D.21603;
  struct MonoObject * D.21604;
  void * iftmp.5;
  struct MonoClass * D.21606;
  unsigned int D.21607;
  unsigned int D.21608;
  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.21552 = *params;
      this = MEM[(struct MonoTransparentProxy * *)D.21552];
      D.21553 = this == 0B;
      D.21554 = (long int) D.21553;
      D.21555 = __builtin_expect (D.21554, 0);
      if (D.21555 != 0) goto <D.21556>; else goto <D.21557>;
      <D.21556>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3124, "this");
      <D.21557>:
      D.21558 = MEM[(struct MonoObject *)this].vtable;
      D.21559 = D.21558->klass;
      D.21560 = mono_defaults.transparent_proxy_class;
      D.21561 = D.21559 != D.21560;
      D.21562 = (long int) D.21561;
      D.21563 = __builtin_expect (D.21562, 0);
      if (D.21563 != 0) goto <D.21564>; else goto <D.21565>;
      <D.21564>:
      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.21565>:
      params = params + 4;
      D.21566 = this->remote_class;
      D.21567 = D.21566->proxy_class;
      D.21568 = BIT_FIELD_REF <*D.21567, 32, 160>;
      D.21569 = D.21568 & 8388608;
      if (D.21569 != 0) goto <D.21570>; else goto <D.21571>;
      <D.21570>:
      D.21572 = this->rp;
      D.21573 = D.21572->context;
      D.21574 = mono_context_get ();
      if (D.21573 == D.21574) goto <D.21575>; else goto <D.21576>;
      <D.21575>:
      {
        int i;
        struct MonoMethodSignature * sig;
        int count;
        void * * mparams;

        sig = mono_method_signature (method);
        D.21577 = sig->param_count;
        count = (int) D.21577;
        count.3 = (unsigned int) count;
        D.21579 = count.3 * 4;
        mparams = __builtin_alloca (D.21579);
        i = 0;
        goto <D.19234>;
        <D.19233>:
        {
          struct MonoClass * class;

          D.21580 = sig->params[i];
          class = mono_class_from_mono_type (D.21580);
          D.21581 = BIT_FIELD_REF <*class, 32, 160>;
          D.21582 = D.21581 & 8;
          if (D.21582 != 0) goto <D.21583>; else goto <D.21584>;
          <D.21583>:
          D.21580 = sig->params[i];
          D.21585 = BIT_FIELD_REF <*D.21580, 32, 32>;
          D.21586 = D.21585 & 1073741824;
          if (D.21586 != 0) goto <D.21587>; else goto <D.21588>;
          <D.21587>:
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21591 = mparams + D.21590;
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21592 = params + D.21590;
          D.21593 = *D.21592;
          D.21594 = MEM[(void * *)D.21593];
          *D.21591 = D.21594;
          goto <D.21595>;
          <D.21588>:
          D.21580 = sig->params[i];
          D.21596 = mono_class_from_mono_type (D.21580);
          D.21597 = mono_class_is_nullable (D.21596);
          if (D.21597 != 0) goto <D.21598>; else goto <D.21599>;
          <D.21598>:
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21591 = mparams + D.21590;
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21592 = params + D.21590;
          D.21593 = *D.21592;
          D.21600 = mono_nullable_box (D.21593, class);
          *D.21591 = D.21600;
          goto <D.21601>;
          <D.21599>:
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21591 = mparams + D.21590;
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21592 = params + D.21590;
          D.21593 = *D.21592;
          *D.21591 = D.21593;
          <D.21601>:
          <D.21595>:
          goto <D.21602>;
          <D.21584>:
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21591 = mparams + D.21590;
          i.4 = (unsigned int) i;
          D.21590 = i.4 * 4;
          D.21592 = params + D.21590;
          D.21593 = *D.21592;
          D.21603 = MEM[(void * * *)D.21593];
          *D.21591 = D.21603;
          <D.21602>:
        }
        i = i + 1;
        <D.19234>:
        if (i < count) goto <D.19233>; else goto <D.19235>;
        <D.19235>:
        D.21606 = method->klass;
        D.21607 = BIT_FIELD_REF <*D.21606, 32, 160>;
        D.21608 = D.21607 & 8;
        if (D.21608 != 0) goto <D.21609>; else goto <D.21610>;
        <D.21609>:
        iftmp.5 = mono_object_unbox (this);
        goto <D.21611>;
        <D.21610>:
        iftmp.5 = this;
        <D.21611>:
        D.21604 = mono_runtime_invoke (method, iftmp.5, mparams, 0B);
        return D.21604;
      }
      <D.21576>:
      <D.21571>:
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.21572 = this->rp;
      res = mono_remoting_invoke (D.21572, msg, &exc, &out_args);
      exc.6 = exc;
      if (exc.6 != 0B) goto <D.21613>; else goto <D.21614>;
      <D.21613>:
      exc.6 = exc;
      mono_raise_exception (exc.6);
      <D.21614>:
      out_args.7 = out_args;
      mono_method_return_message_restore (method, params, out_args.7);
      D.21604 = res;
      return D.21604;
    }
  finally
    {
      exc = {CLOBBER};
      out_args = {CLOBBER};
    }
}


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

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


mono_marshal_check_domain_image (gint32 domain_id, struct MonoImage * image)
{
  gboolean D.21622;
  union mono_mutex_t * D.21623;
  _Bool D.21626;
  long int D.21627;
  long int D.21628;
  struct MonoImage * D.21631;
  _Bool D.21635;
  long int D.21636;
  long int D.21637;
  _Bool D.21640;
  struct MonoAssembly * ass;
  struct GSList * tmp;
  struct MonoDomain * domain;

  domain = mono_domain_get_by_id (domain_id);
  if (domain == 0B) goto <D.21620>; else goto <D.21621>;
  <D.21620>:
  D.21622 = 0;
  return D.21622;
  <D.21621>:
  {
    int ret;

    D.21623 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_lock (D.21623);
    if (ret != 0) goto <D.21624>; else goto <D.21625>;
    <D.21624>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.21625>:
    D.21626 = ret != 0;
    D.21627 = (long int) D.21626;
    D.21628 = __builtin_expect (D.21627, 0);
    if (D.21628 != 0) goto <D.21629>; else goto <D.21630>;
    <D.21629>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3452, "ret == 0");
    <D.21630>:
  }
  tmp = domain->domain_assemblies;
  goto <D.19356>;
  <D.19355>:
  ass = tmp->data;
  D.21631 = ass->image;
  if (D.21631 == image) goto <D.19354>; else goto <D.21632>;
  <D.21632>:
  tmp = tmp->next;
  <D.19356>:
  if (tmp != 0B) goto <D.19355>; else goto <D.19354>;
  <D.19354>:
  {
    int ret;

    D.21623 = &domain->assemblies_lock.mutex;
    ret = pthread_mutex_unlock (D.21623);
    if (ret != 0) goto <D.21633>; else goto <D.21634>;
    <D.21633>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.21634>:
    D.21635 = ret != 0;
    D.21636 = (long int) D.21635;
    D.21637 = __builtin_expect (D.21636, 0);
    if (D.21637 != 0) goto <D.21638>; else goto <D.21639>;
    <D.21638>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3458, "ret == 0");
    <D.21639>:
  }
  D.21640 = tmp != 0B;
  D.21622 = (gboolean) D.21640;
  return D.21622;
}


mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push)
{
  int D.21645;
  struct MonoException * D.21646;
  gint32 D.21650;
  struct MonoDomain * current_domain;
  struct MonoDomain * domain;

  current_domain = mono_domain_get ();
  domain = mono_domain_get_by_id (id);
  if (domain == 0B) goto <D.21642>; else goto <D.21644>;
  <D.21644>:
  D.21645 = mono_domain_set (domain, 0);
  if (D.21645 == 0) goto <D.21642>; else goto <D.21643>;
  <D.21642>:
  D.21646 = mono_get_exception_appdomain_unloaded ();
  mono_raise_exception (D.21646);
  <D.21643>:
  if (push != 0) goto <D.21647>; else goto <D.21648>;
  <D.21647>:
  mono_thread_push_appdomain_ref (domain);
  goto <D.21649>;
  <D.21648>:
  mono_thread_pop_appdomain_ref ();
  <D.21649>:
  D.21650 = current_domain->domain_id;
  return D.21650;
}


mono_marshal_xdomain_copy_out_value (struct MonoObject * src, struct MonoObject * dst)
{
  struct MonoVTable * D.21655;
  struct MonoClass * D.21656;
  struct MonoVTable * D.21657;
  struct MonoClass * D.21658;
  _Bool D.21659;
  long int D.21660;
  long int D.21661;
  unsigned char D.21664;
  int D.21665;
  struct MonoClass * D.21666;
  struct MonoType * D.21667;
  <unnamed type> D.21668;
  unsigned int D.21673;
  unsigned int i.8;
  char * D.21675;
  struct MonoObject * D.21676;
  struct MonoClass * D.21679;
  struct MonoString * * D.21682;
  struct MonoDomain * D.21683;
  struct MonoString * D.21684;
  mono_unichar2 * D.21685;
  int D.21686;
  struct MonoString * D.21687;
  int D.21688;

  if (src == 0B) goto <D.21652>; else goto <D.21654>;
  <D.21654>:
  if (dst == 0B) goto <D.21652>; else goto <D.21653>;
  <D.21652>:
  return;
  <D.21653>:
  D.21655 = src->vtable;
  D.21656 = D.21655->klass;
  D.21657 = dst->vtable;
  D.21658 = D.21657->klass;
  D.21659 = D.21656 != D.21658;
  D.21660 = (long int) D.21659;
  D.21661 = __builtin_expect (D.21660, 0);
  if (D.21661 != 0) goto <D.21662>; else goto <D.21663>;
  <D.21662>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3340, "mono_object_class (src) == mono_object_class (dst)");
  <D.21663>:
  D.21655 = src->vtable;
  D.21656 = D.21655->klass;
  D.21664 = D.21656->byval_arg.type;
  D.21665 = (int) D.21664;
  switch (D.21665) <default: <D.21678>, case 20: <D.19301>, case 29: <D.19302>>
  <D.19301>:
  <D.19302>:
  {
    int mt;

    D.21655 = src->vtable;
    D.21656 = D.21655->klass;
    D.21666 = D.21656->element_class;
    D.21667 = &D.21666->byval_arg;
    D.21668 = mono_get_xdomain_marshal_type (D.21667);
    mt = (int) D.21668;
    if (mt == 3) goto <D.21669>; else goto <D.21670>;
    <D.21669>:
    return;
    <D.21670>:
    if (mt == 1) goto <D.21671>; else goto <D.21672>;
    <D.21671>:
    {
      int i;
      int len;

      D.21673 = mono_array_length (dst);
      len = (int) D.21673;
      i = 0;
      goto <D.19309>;
      <D.19308>:
      {
        struct MonoObject * item;

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

          i.8 = (unsigned int) i;
          __p = mono_array_addr_with_size (dst, 4, i.8);
          D.21676 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (dst, __p, D.21676);
        }
      }
      i = i + 1;
      <D.19309>:
      if (i < len) goto <D.19308>; else goto <D.19310>;
      <D.19310>:
    }
    goto <D.21677>;
    <D.21672>:
    mono_array_full_copy (src, dst);
    <D.21677>:
    return;
  }
  <D.21678>:
  D.21655 = src->vtable;
  D.21656 = D.21655->klass;
  D.21679 = mono_defaults.stringbuilder_class;
  if (D.21656 == D.21679) goto <D.21680>; else goto <D.21681>;
  <D.21680>:
  {
    struct MonoStringBuilder * src_sb;
    struct MonoStringBuilder * dst_sb;

    src_sb = src;
    dst_sb = dst;
    D.21682 = &dst_sb->str;
    D.21657 = dst->vtable;
    D.21683 = D.21657->domain;
    D.21684 = src_sb->str;
    D.21685 = mono_string_chars (D.21684);
    D.21684 = src_sb->str;
    D.21686 = mono_string_length (D.21684);
    D.21687 = mono_string_new_utf16 (D.21683, D.21685, D.21686);
    mono_gc_wbarrier_set_field (dst_sb, D.21682, D.21687);
    dst_sb->cached_str = 0B;
    D.21688 = src_sb->length;
    dst_sb->length = D.21688;
  }
  <D.21681>:
}


mono_get_xdomain_marshal_type (struct MonoType * t)
{
  unsigned char D.21690;
  int D.21691;
  MonoXDomainMarshalType D.21692;
  struct MonoClass * D.21693;
  struct MonoType * D.21694;
  <unnamed type> D.21695;

  D.21690 = t->type;
  D.21691 = (int) D.21690;
  switch (D.21691) <default: <D.21698>, case 1: <D.19247>, case 2: <D.19250>, case 3: <D.19253>, case 4: <D.19249>, case 5: <D.19248>, case 6: <D.19252>, case 7: <D.19251>, case 8: <D.19255>, case 9: <D.19254>, case 10: <D.19256>, case 11: <D.19257>, case 12: <D.19258>, case 13: <D.19259>, case 14: <D.19260>, case 20: <D.19261>, case 29: <D.19262>>
  <D.19247>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3240);
  <D.19248>:
  <D.19249>:
  <D.19250>:
  <D.19251>:
  <D.19252>:
  <D.19253>:
  <D.19254>:
  <D.19255>:
  <D.19256>:
  <D.19257>:
  <D.19258>:
  <D.19259>:
  D.21692 = 0;
  return D.21692;
  <D.19260>:
  D.21692 = 1;
  return D.21692;
  <D.19261>:
  <D.19262>:
  {
    struct MonoClass * elem_class;

    D.21693 = mono_class_from_mono_type (t);
    elem_class = D.21693->element_class;
    D.21694 = &elem_class->byval_arg;
    D.21695 = mono_get_xdomain_marshal_type (D.21694);
    if (D.21695 != 3) goto <D.21696>; else goto <D.21697>;
    <D.21696>:
    D.21692 = 1;
    return D.21692;
    <D.21697>:
    goto <D.19264>;
  }
  <D.21698>:
  <D.19264>:
  D.21692 = 3;
  return D.21692;
}


mono_delegate_end_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.21700;
  long int D.21701;
  long int D.21702;
  struct MonoReflectionMethod * D.21705;
  struct MonoMethod * D.21708;
  _Bool D.21709;
  long int D.21710;
  long int D.21711;
  struct MonoReflectionMethod * * D.21714;
  struct MonoReflectionMethod * D.21715;
  struct MonoMethod * D.21719;
  struct MonoVTable * D.21720;
  _Bool D.21721;
  long int D.21722;
  long int D.21723;
  struct MonoArray * D.21726;
  short unsigned int D.21727;
  int D.21728;
  int D.21729;
  unsigned int D.21730;
  char * D.21731;
  struct MonoImage * D.21734;
  struct MonoException * D.21735;
  struct MonoObject * D.21736;
  struct MonoObject * D.21737;
  struct MonoException * D.21740;
  struct MonoObject * D.21743;
  struct MonoVTable * D.21745;
  struct MonoClass * D.21746;
  struct MonoClass * D.21747;
  struct MonoClass * D.21749;
  struct MonoAsyncResult * * D.21750;
  struct MonoRealProxy * D.21751;
  struct MonoObject * exc.9;
  struct MonoString * D.21755;
  struct MonoString * * D.21758;
  struct MonoString * D.21759;
  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.21700 = delegate == 0B;
      D.21701 = (long int) D.21700;
      D.21702 = __builtin_expect (D.21701, 0);
      if (D.21702 != 0) goto <D.21703>; else goto <D.21704>;
      <D.21703>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2908, "delegate");
      <D.21704>:
      D.21705 = delegate->method_info;
      if (D.21705 == 0B) goto <D.21706>; else goto <D.21707>;
      <D.21706>:
      D.21708 = delegate->method;
      D.21709 = D.21708 == 0B;
      D.21710 = (long int) D.21709;
      D.21711 = __builtin_expect (D.21710, 0);
      if (D.21711 != 0) goto <D.21712>; else goto <D.21713>;
      <D.21712>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2911, "delegate->method");
      <D.21713>:
      D.21714 = &delegate->method_info;
      D.21708 = delegate->method;
      D.21715 = mono_method_get_object (domain, D.21708, 0B);
      mono_gc_wbarrier_set_field (delegate, D.21714, D.21715);
      <D.21707>:
      D.21705 = delegate->method_info;
      if (D.21705 == 0B) goto <D.21716>; else goto <D.21718>;
      <D.21718>:
      D.21705 = delegate->method_info;
      D.21719 = D.21705->method;
      if (D.21719 == 0B) goto <D.21716>; else goto <D.21717>;
      <D.21716>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2916);
      <D.21717>:
      D.21720 = delegate->object.vtable;
      klass = D.21720->klass;
      method = mono_class_get_method_from_name (klass, "EndInvoke", -1);
      D.21721 = method == 0B;
      D.21722 = (long int) D.21721;
      D.21723 = __builtin_expect (D.21722, 0);
      if (D.21723 != 0) goto <D.21724>; else goto <D.21725>;
      <D.21724>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2921, "method != NULL");
      <D.21725>:
      sig = mono_signature_no_pinvoke (method);
      msg = mono_method_call_message_new (method, params, 0B, 0B, 0B);
      D.21726 = msg->args;
      D.21727 = sig->param_count;
      D.21728 = (int) D.21727;
      D.21729 = D.21728 + -1;
      D.21730 = (unsigned int) D.21729;
      D.21731 = mono_array_addr_with_size (D.21726, 4, D.21730);
      ares = MEM[(void * *)D.21731];
      if (ares == 0B) goto <D.21732>; else goto <D.21733>;
      <D.21732>:
      D.21734 = mono_defaults.corlib;
      D.21735 = mono_exception_from_name_msg (D.21734, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.");
      mono_raise_exception (D.21735);
      D.21736 = 0B;
      return D.21736;
      <D.21733>:
      D.21737 = ares->async_delegate;
      if (D.21737 != delegate) goto <D.21738>; else goto <D.21739>;
      <D.21738>:
      D.21740 = mono_get_exception_invalid_operation ("The IAsyncResult object provided does not match this delegate.");
      mono_raise_exception (D.21740);
      D.21736 = 0B;
      return D.21736;
      <D.21739>:
      D.21743 = delegate->target;
      if (D.21743 != 0B) goto <D.21744>; else goto <D.21741>;
      <D.21744>:
      D.21743 = delegate->target;
      D.21745 = D.21743->vtable;
      D.21746 = D.21745->klass;
      D.21747 = mono_defaults.transparent_proxy_class;
      if (D.21746 == D.21747) goto <D.21748>; else goto <D.21741>;
      <D.21748>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.21749 = mono_defaults.mono_method_message_class;
        msg = mono_object_new (domain, D.21749);
        D.21705 = delegate->method_info;
        mono_message_init (domain, msg, D.21705, 0B);
        msg->call_type = 2;
        D.21750 = &msg->async_result;
        mono_gc_wbarrier_set_field (msg, D.21750, ares);
        D.21751 = tp->rp;
        res = mono_remoting_invoke (D.21751, msg, &exc, &out_args);
      }
      goto <D.21742>;
      <D.21741>:
      res = mono_thread_pool_finish (ares, &out_args, &exc);
      <D.21742>:
      exc.9 = exc;
      if (exc.9 != 0B) goto <D.21753>; else goto <D.21754>;
      <D.21753>:
      exc.9 = exc;
      D.21755 = MEM[(struct MonoException *)exc.9].stack_trace;
      if (D.21755 != 0B) goto <D.21756>; else goto <D.21757>;
      <D.21756>:
      {
        char * strace;
        char * tmp;

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


mono_delegate_begin_invoke (struct MonoDelegate * delegate, void * * params)
{
  _Bool D.21763;
  long int D.21764;
  long int D.21765;
  struct MonoMulticastDelegate * D.21768;
  struct MonoException * D.21771;
  struct MonoObject * D.21772;
  struct MonoVTable * D.21775;
  struct MonoClass * D.21776;
  struct MonoClass * D.21777;
  struct MonoRemoteClass * D.21782;
  struct MonoClass * D.21783;
  unsigned int D.21784;
  unsigned int D.21785;
  struct MonoRealProxy * D.21787;
  struct MonoObject * D.21788;
  struct MonoAppContext * D.21789;
  struct MonoMethod * D.21790;
  struct MonoDomain * D.21791;
  struct MonoObject * state.11;
  struct MonoObject * * D.21793;
  struct MonoObject * * D.21794;
  struct MonoDelegate * async_callback.12;
  struct MonoAsyncResult * * D.21796;
  struct MonoObject * exc.13;
  struct MonoAsyncResult * D.21800;
  struct MonoVTable * D.21801;
  _Bool D.21804;
  long int D.21805;
  long int D.21806;
  struct MonoClass * D.21809;
  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.21763 = delegate == 0B;
      D.21764 = (long int) D.21763;
      D.21765 = __builtin_expect (D.21764, 0);
      if (D.21765 != 0) goto <D.21766>; else goto <D.21767>;
      <D.21766>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2147, "delegate");
      <D.21767>:
      mcast_delegate = delegate;
      D.21768 = mcast_delegate->prev;
      if (D.21768 != 0B) goto <D.21769>; else goto <D.21770>;
      <D.21769>:
      D.21771 = mono_get_exception_argument (0B, "The delegate must have only one target");
      mono_raise_exception (D.21771);
      <D.21770>:
      D.21772 = delegate->target;
      if (D.21772 != 0B) goto <D.21773>; else goto <D.21774>;
      <D.21773>:
      D.21772 = delegate->target;
      D.21775 = D.21772->vtable;
      D.21776 = D.21775->klass;
      D.21777 = mono_defaults.transparent_proxy_class;
      if (D.21776 == D.21777) goto <D.21778>; else goto <D.21779>;
      <D.21778>:
      {
        struct MonoTransparentProxy * tp;

        tp = delegate->target;
        D.21782 = tp->remote_class;
        D.21783 = D.21782->proxy_class;
        D.21784 = BIT_FIELD_REF <*D.21783, 32, 160>;
        D.21785 = D.21784 & 8388608;
        if (D.21785 == 0) goto <D.21780>; else goto <D.21786>;
        <D.21786>:
        D.21787 = tp->rp;
        D.21788 = D.21787->context;
        D.21789 = mono_context_get ();
        if (D.21788 != D.21789) goto <D.21780>; else goto <D.21781>;
        <D.21780>:
        {
          struct MonoAsyncResult * ares;
          struct MonoObject * exc;
          struct MonoArray * out_args;

          try
            {
              method = delegate->method;
              D.21790 = mono_marshal_method_from_wrapper (method);
              msg = mono_method_call_message_new (D.21790, params, 0B, &async_callback, &state);
              D.21791 = mono_domain_get ();
              state.11 = state;
              ares = mono_async_result_new (D.21791, 0B, state.11, 0B, 0B);
              D.21793 = &ares->async_delegate;
              mono_gc_wbarrier_set_field (ares, D.21793, delegate);
              D.21794 = &ares->async_callback;
              async_callback.12 = async_callback;
              mono_gc_wbarrier_set_field (ares, D.21794, async_callback.12);
              D.21796 = &msg->async_result;
              mono_gc_wbarrier_set_field (msg, D.21796, ares);
              msg->call_type = 1;
              exc = 0B;
              D.21787 = tp->rp;
              mono_remoting_invoke (D.21787, msg, &exc, &out_args);
              exc.13 = exc;
              if (exc.13 != 0B) goto <D.21798>; else goto <D.21799>;
              <D.21798>:
              exc.13 = exc;
              mono_raise_exception (exc.13);
              <D.21799>:
              D.21800 = ares;
              return D.21800;
            }
          finally
            {
              exc = {CLOBBER};
              out_args = {CLOBBER};
            }
        }
        <D.21781>:
      }
      <D.21779>:
      <D.21774>:
      D.21801 = delegate->object.vtable;
      klass = D.21801->klass;
      method = mono_get_delegate_invoke (klass);
      method2 = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      if (method2 != 0B) goto <D.21802>; else goto <D.21803>;
      <D.21802>:
      method = method2;
      <D.21803>:
      D.21804 = method == 0B;
      D.21805 = (long int) D.21804;
      D.21806 = __builtin_expect (D.21805, 0);
      if (D.21806 != 0) goto <D.21807>; else goto <D.21808>;
      <D.21807>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2188, "method != NULL");
      <D.21808>:
      D.21809 = method->klass;
      im = mono_get_delegate_invoke (D.21809);
      msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
      async_callback.12 = async_callback;
      state.11 = state;
      D.21800 = mono_thread_pool_add (delegate, msg, async_callback.12, state.11);
      return D.21800;
    }
  finally
    {
      async_callback = {CLOBBER};
      state = {CLOBBER};
    }
}


mono_struct_delete_old (struct MonoClass * klass, char * ptr)
{
  struct MonoClassField * D.21813;
  short unsigned int D.21814;
  int D.21815;
  int D.21816;
  struct MonoMarshalSpec * D.21819;
  <unnamed-unsigned:1> D.21820;
  int D.21821;
  unsigned int D.21822;
  <unnamed type> conv.14;
  int D.21824;
  struct MonoClass * D.21827;
  void * D.21828;
  unsigned int i.15;
  unsigned int D.21830;
  struct MonoMarshalType * info;
  int i;

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

    try
      {
        D.21813 = info->fields[i].field;
        ftype = D.21813->type;
        D.21814 = ftype->attrs;
        D.21815 = (int) D.21814;
        D.21816 = D.21815 & 16;
        if (D.21816 != 0) goto <D.21817>; else goto <D.21818>;
        <D.21817>:
        // predicted unlikely by continue predictor.
        goto <D.21174>;
        <D.21818>:
        D.21819 = info->fields[i].mspec;
        D.21820 = klass->unicode;
        D.21821 = (int) D.21820;
        ntype = mono_type_to_unmanaged (ftype, D.21819, 1, D.21821, &conv);
        D.21822 = info->fields[i].offset;
        cpos = ptr + D.21822;
        conv.14 = conv;
        switch (conv.14) <default: <D.21183>, case 0: <D.21175>, case 3: <D.21180>, case 4: <D.21179>, case 7: <D.21177>, case 9: <D.21178>, case 10: <D.21181>, case 11: <D.21182>>
        <D.21175>:
        D.21824 = mono_type_is_struct (ftype);
        if (D.21824 != 0) goto <D.21825>; else goto <D.21826>;
        <D.21825>:
        D.21827 = ftype->data.klass;
        mono_struct_delete_old (D.21827, cpos);
        // predicted unlikely by continue predictor.
        goto <D.21174>;
        <D.21826>:
        goto <D.21176>;
        <D.21177>:
        goto <D.21176>;
        <D.21178>:
        <D.21179>:
        <D.21180>:
        <D.21181>:
        <D.21182>:
        D.21828 = MEM[(void * *)cpos];
        mono_marshal_free (D.21828);
        goto <D.21176>;
        <D.21183>:
        // predicted unlikely by continue predictor.
        goto <D.21174>;
        <D.21176>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.21174>:
  i = i + 1;
  <D.21185>:
  i.15 = (unsigned int) i;
  D.21830 = info->num_fields;
  if (i.15 < D.21830) goto <D.21184>; else goto <D.21186>;
  <D.21186>:
}


mono_string_utf16_to_builder2 (gunichar2 * text)
{
  struct MonoStringBuilder * D.21836;
  struct MonoClass * string_builder_class.16;
  struct MonoImage * D.21840;
  struct MonoClass * string_builder_class.17;
  _Bool D.21842;
  long int D.21843;
  long int D.21844;
  struct MonoMethod * sb_ctor.18;
  struct MonoMethod * sb_ctor.19;
  _Bool D.21849;
  long int D.21850;
  long int D.21851;
  int len.20;
  int len.21;
  unsigned int len.22;
  unsigned int D.21857;
  gunichar2 * D.21858;
  short unsigned int D.21859;
  struct MonoDomain * D.21860;
  _Bool D.21861;
  long int D.21862;
  long int D.21863;
  struct MonoObject * exc.23;
  _Bool D.21867;
  long int D.21868;
  long int D.21869;
  struct MonoString * D.21872;
  mono_unichar2 * D.21873;
  int D.21874;
  unsigned int D.21875;
  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.21834>; else goto <D.21835>;
      <D.21834>:
      D.21836 = 0B;
      return D.21836;
      <D.21835>:
      string_builder_class.16 = string_builder_class;
      if (string_builder_class.16 == 0B) goto <D.21838>; else goto <D.21839>;
      <D.21838>:
      {
        struct MonoMethodDesc * desc;

        D.21840 = mono_defaults.corlib;
        string_builder_class.17 = mono_class_from_name (D.21840, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.17;
        string_builder_class.16 = string_builder_class;
        D.21842 = string_builder_class.16 == 0B;
        D.21843 = (long int) D.21842;
        D.21844 = __builtin_expect (D.21843, 0);
        if (D.21844 != 0) goto <D.21845>; else goto <D.21846>;
        <D.21845>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 846, "string_builder_class");
        <D.21846>:
        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.21849 = sb_ctor.19 == 0B;
        D.21850 = (long int) D.21849;
        D.21851 = __builtin_expect (D.21850, 0);
        if (D.21851 != 0) goto <D.21852>; else goto <D.21853>;
        <D.21852>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 849, "sb_ctor");
        <D.21853>:
        mono_method_desc_free (desc);
      }
      <D.21839>:
      len = 0;
      goto <D.18565>;
      <D.18564>:
      len.20 = len;
      len.21 = len.20 + 1;
      len = len.21;
      <D.18565>:
      len.20 = len;
      len.22 = (unsigned int) len.20;
      D.21857 = len.22 * 2;
      D.21858 = text + D.21857;
      D.21859 = *D.21858;
      if (D.21859 != 0) goto <D.18564>; else goto <D.18566>;
      <D.18566>:
      D.21860 = mono_domain_get ();
      string_builder_class.16 = string_builder_class;
      sb = mono_object_new (D.21860, string_builder_class.16);
      D.21861 = sb == 0B;
      D.21862 = (long int) D.21861;
      D.21863 = __builtin_expect (D.21862, 0);
      if (D.21863 != 0) goto <D.21864>; else goto <D.21865>;
      <D.21864>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 857, "sb");
      <D.21865>:
      args[0] = &len;
      sb_ctor.19 = sb_ctor;
      mono_runtime_invoke (sb_ctor.19, sb, &args, &exc);
      exc.23 = exc;
      D.21867 = exc.23 != 0B;
      D.21868 = (long int) D.21867;
      D.21869 = __builtin_expect (D.21868, 0);
      if (D.21869 != 0) goto <D.21870>; else goto <D.21871>;
      <D.21870>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 860, "!exc");
      <D.21871>:
      len.20 = len;
      sb->length = len.20;
      D.21872 = sb->str;
      D.21873 = mono_string_chars (D.21872);
      len.20 = len;
      D.21874 = len.20 * 2;
      D.21875 = (unsigned int) D.21874;
      memcpy (D.21873, text, D.21875);
      D.21836 = sb;
      return D.21836;
    }
  finally
    {
      len = {CLOBBER};
      args = {CLOBBER};
      exc = {CLOBBER};
    }
}


mono_string_utf8_to_builder2 (char * text)
{
  struct MonoStringBuilder * D.21880;
  struct MonoClass * string_builder_class.24;
  struct MonoImage * D.21884;
  struct MonoClass * string_builder_class.25;
  _Bool D.21886;
  long int D.21887;
  long int D.21888;
  struct MonoMethod * sb_ctor.26;
  struct MonoMethod * sb_ctor.27;
  _Bool D.21893;
  long int D.21894;
  long int D.21895;
  unsigned int D.21898;
  int l.28;
  struct MonoDomain * D.21900;
  _Bool D.21901;
  long int D.21902;
  long int D.21903;
  struct MonoObject * exc.29;
  _Bool D.21907;
  long int D.21908;
  long int D.21909;
  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.21878>; else goto <D.21879>;
      <D.21878>:
      D.21880 = 0B;
      return D.21880;
      <D.21879>:
      string_builder_class.24 = string_builder_class;
      if (string_builder_class.24 == 0B) goto <D.21882>; else goto <D.21883>;
      <D.21882>:
      {
        struct MonoMethodDesc * desc;

        D.21884 = mono_defaults.corlib;
        string_builder_class.25 = mono_class_from_name (D.21884, "System.Text", "StringBuilder");
        string_builder_class = string_builder_class.25;
        string_builder_class.24 = string_builder_class;
        D.21886 = string_builder_class.24 == 0B;
        D.21887 = (long int) D.21886;
        D.21888 = __builtin_expect (D.21887, 0);
        if (D.21888 != 0) goto <D.21889>; else goto <D.21890>;
        <D.21889>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 789, "string_builder_class");
        <D.21890>:
        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.21893 = sb_ctor.27 == 0B;
        D.21894 = (long int) D.21893;
        D.21895 = __builtin_expect (D.21894, 0);
        if (D.21895 != 0) goto <D.21896>; else goto <D.21897>;
        <D.21896>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 792, "sb_ctor");
        <D.21897>:
        mono_method_desc_free (desc);
      }
      <D.21883>:
      D.21898 = strlen (text);
      l.28 = (int) D.21898;
      l = l.28;
      D.21900 = mono_domain_get ();
      string_builder_class.24 = string_builder_class;
      sb = mono_object_new (D.21900, string_builder_class.24);
      D.21901 = sb == 0B;
      D.21902 = (long int) D.21901;
      D.21903 = __builtin_expect (D.21902, 0);
      if (D.21903 != 0) goto <D.21904>; else goto <D.21905>;
      <D.21904>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 799, "sb");
      <D.21905>:
      args[0] = &l;
      sb_ctor.27 = sb_ctor;
      mono_runtime_invoke (sb_ctor.27, sb, &args, &exc);
      exc.29 = exc;
      D.21907 = exc.29 != 0B;
      D.21908 = (long int) D.21907;
      D.21909 = __builtin_expect (D.21908, 0);
      if (D.21909 != 0) goto <D.21910>; else goto <D.21911>;
      <D.21910>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 802, "!exc");
      <D.21911>:
      mono_string_utf8_to_builder (sb, text);
      D.21880 = sb;
      return D.21880;
    }
  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.21914;

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


mono_array_to_byvalarray (void * native_arr, struct MonoArray * arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.21915;
  struct MonoClass * D.21916;
  struct MonoClass * D.21917;
  struct MonoClass * D.21918;
  _Bool D.21919;
  long int D.21920;
  long int D.21921;
  struct MonoClass * D.21924;
  char * D.21927;
  unsigned int D.21928;
  long int D.21929;
  struct GError * error.30;
  gchar * D.21933;
  unsigned int iftmp.31;
  unsigned int D.21935;

  D.21915 = arr->obj.vtable;
  D.21916 = D.21915->klass;
  D.21917 = D.21916->element_class;
  D.21918 = mono_defaults.char_class;
  D.21919 = D.21917 != D.21918;
  D.21920 = (long int) D.21919;
  D.21921 = __builtin_expect (D.21920, 0);
  if (D.21921 != 0) goto <D.21922>; else goto <D.21923>;
  <D.21922>:
  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.21923>:
  D.21924 = mono_defaults.byte_class;
  if (D.21924 == elclass) goto <D.21925>; else goto <D.21926>;
  <D.21925>:
  {
    char * as;
    struct GError * error;

    try
      {
        error = 0B;
        D.21927 = mono_array_addr_with_size (arr, 2, 0);
        D.21928 = mono_array_length (arr);
        D.21929 = (long int) D.21928;
        as = monoeg_g_utf16_to_utf8 (D.21927, D.21929, 0B, 0B, &error);
        error.30 = error;
        if (error.30 != 0B) goto <D.21931>; else goto <D.21932>;
        <D.21931>:
        {
          struct MonoException * exc;

          error.30 = error;
          D.21933 = error.30->message;
          exc = mono_get_exception_argument ("string", D.21933);
          error.30 = error;
          monoeg_g_error_free (error.30);
          mono_raise_exception (exc);
        }
        <D.21932>:
        D.21935 = strlen (as);
        if (D.21935 < elnum) goto <D.21936>; else goto <D.21937>;
        <D.21936>:
        iftmp.31 = strlen (as);
        goto <D.21938>;
        <D.21937>:
        iftmp.31 = elnum;
        <D.21938>:
        memcpy (native_arr, as, iftmp.31);
        monoeg_g_free (as);
      }
    finally
      {
        error = {CLOBBER};
      }
  }
  goto <D.21939>;
  <D.21926>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 731);
  <D.21939>:
}


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

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


mono_byvalarray_to_array (struct MonoArray * arr, void * native_arr, struct MonoClass * elclass, guint32 elnum)
{
  struct MonoVTable * D.21941;
  struct MonoClass * D.21942;
  struct MonoClass * D.21943;
  struct MonoClass * D.21944;
  _Bool D.21945;
  long int D.21946;
  long int D.21947;
  struct MonoClass * D.21950;
  long int elnum.32;
  struct GError * error.33;
  char * D.21957;
  long int items_written.34;
  long unsigned int items_written.35;
  long unsigned int D.21960;

  D.21941 = arr->obj.vtable;
  D.21942 = D.21941->klass;
  D.21943 = D.21942->element_class;
  D.21944 = mono_defaults.char_class;
  D.21945 = D.21943 != D.21944;
  D.21946 = (long int) D.21945;
  D.21947 = __builtin_expect (D.21946, 0);
  if (D.21947 != 0) goto <D.21948>; else goto <D.21949>;
  <D.21948>:
  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.21949>:
  D.21950 = mono_defaults.byte_class;
  if (D.21950 == elclass) goto <D.21951>; else goto <D.21952>;
  <D.21951>:
  {
    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.21955>; else goto <D.21956>;
        <D.21955>:
        D.21957 = mono_array_addr_with_size (arr, 2, 0);
        items_written.34 = items_written;
        items_written.35 = (long unsigned int) items_written.34;
        D.21960 = items_written.35 * 2;
        memcpy (D.21957, ut, D.21960);
        monoeg_g_free (ut);
        goto <D.21961>;
        <D.21956>:
        error.33 = error;
        monoeg_g_error_free (error.33);
        <D.21961>:
      }
    finally
      {
        error = {CLOBBER};
        items_written = {CLOBBER};
      }
  }
  goto <D.21962>;
  <D.21952>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 703);
  <D.21962>:
}


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

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


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

  D.21966 = mono_domain_get ();
  D.21965 = mono_string_new_len (D.21966, text, length);
  return D.21965;
}


mono_string_from_byvalwstr (gunichar2 * data, int max_len)
{
  struct MonoString * D.21970;
  unsigned int len.36;
  unsigned int D.21972;
  gunichar2 * D.21973;
  short unsigned int D.21974;
  int D.21975;
  struct MonoDomain * domain;
  int len;

  domain = mono_domain_get ();
  len = 0;
  if (data == 0B) goto <D.21968>; else goto <D.21969>;
  <D.21968>:
  D.21970 = 0B;
  return D.21970;
  <D.21969>:
  goto <D.18449>;
  <D.18448>:
  len = len + 1;
  <D.18449>:
  len.36 = (unsigned int) len;
  D.21972 = len.36 * 2;
  D.21973 = data + D.21972;
  D.21974 = *D.21973;
  if (D.21974 != 0) goto <D.18448>; else goto <D.18450>;
  <D.18450>:
  D.21975 = MIN_EXPR <max_len, len>;
  D.21970 = mono_string_new_utf16 (domain, data, D.21975);
  return D.21970;
}


mono_marshal_string_to_utf16_copy (struct MonoString * s)
{
  void * D.21979;
  int D.21980;
  int D.21981;
  int D.21982;
  long unsigned int D.21983;
  mono_unichar2 * D.21984;
  int D.21985;
  int D.21986;
  unsigned int D.21987;
  int D.21988;
  unsigned int D.21989;
  unsigned int D.21990;
  gunichar2 * D.21991;

  if (s == 0B) goto <D.21977>; else goto <D.21978>;
  <D.21977>:
  D.21979 = 0B;
  return D.21979;
  <D.21978>:
  {
    gunichar2 * res;

    D.21980 = mono_string_length (s);
    D.21981 = D.21980 + 1;
    D.21982 = D.21981 * 2;
    D.21983 = (long unsigned int) D.21982;
    res = mono_marshal_alloc (D.21983);
    D.21984 = mono_string_chars (s);
    D.21985 = mono_string_length (s);
    D.21986 = D.21985 * 2;
    D.21987 = (unsigned int) D.21986;
    memcpy (res, D.21984, D.21987);
    D.21988 = mono_string_length (s);
    D.21989 = (unsigned int) D.21988;
    D.21990 = D.21989 * 2;
    D.21991 = res + D.21990;
    *D.21991 = 0;
    D.21979 = res;
    return D.21979;
  }
}


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.21997;
  void * D.21998;
  struct MonoVTable * D.22001;
  unsigned int D.22002;
  unsigned int D.22003;
  _Bool D.22004;
  long int D.22005;
  long int D.22006;
  struct MonoMethodSignature * D.22009;
  unsigned int D.22010;
  unsigned int D.22011;
  const char * exc_class.39;
  _Bool D.22017;
  long int D.22018;
  long int D.22019;
  struct MonoImage * D.22022;
  const char * exc_arg.40;
  struct MonoException * D.22024;
  struct MonoObject * D.22025;
  void * D.22028;
  struct MonoMethod * method;
  struct MonoMethod * wrapper;
  struct MonoClass * klass;
  uint32_t target_handle;

  target_handle = 0;
  if (delegate == 0B) goto <D.21995>; else goto <D.21996>;
  <D.21995>:
  D.21997 = 0B;
  return D.21997;
  <D.21996>:
  D.21998 = delegate->delegate_trampoline;
  if (D.21998 != 0B) goto <D.21999>; else goto <D.22000>;
  <D.21999>:
  D.21997 = delegate->delegate_trampoline;
  return D.21997;
  <D.22000>:
  D.22001 = MEM[(struct MonoObject *)delegate].vtable;
  klass = D.22001->klass;
  D.22002 = BIT_FIELD_REF <*klass, 32, 160>;
  D.22003 = D.22002 & 16777216;
  D.22004 = D.22003 == 0;
  D.22005 = (long int) D.22004;
  D.22006 = __builtin_expect (D.22005, 0);
  if (D.22006 != 0) goto <D.22007>; else goto <D.22008>;
  <D.22007>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 352, "klass->delegate");
  <D.22008>:
  method = delegate->method;
  D.22009 = mono_method_signature (method);
  D.22010 = BIT_FIELD_REF <*D.22009, 32, 64>;
  D.22011 = D.22010 & 16777216;
  if (D.22011 != 0) goto <D.22012>; else goto <D.22013>;
  <D.22012>:
  {
    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.22014>; else goto <D.22015>;
        <D.22014>:
        exc_class.39 = exc_class;
        D.22017 = exc_class.39 == 0B;
        D.22018 = (long int) D.22017;
        D.22019 = __builtin_expect (D.22018, 0);
        if (D.22019 != 0) goto <D.22020>; else goto <D.22021>;
        <D.22020>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 362, "exc_class");
        <D.22021>:
        D.22022 = mono_defaults.corlib;
        exc_class.39 = exc_class;
        exc_arg.40 = exc_arg;
        D.22024 = mono_exception_from_name_msg (D.22022, "System", exc_class.39, exc_arg.40);
        mono_raise_exception (D.22024);
        <D.22015>:
        D.21997 = ftnptr;
        return D.21997;
      }
    finally
      {
        exc_class = {CLOBBER};
        exc_arg = {CLOBBER};
      }
  }
  <D.22013>:
  D.22025 = delegate->target;
  if (D.22025 != 0B) goto <D.22026>; else goto <D.22027>;
  <D.22026>:
  D.22025 = delegate->target;
  target_handle = mono_gchandle_new_weakref (D.22025, 0);
  <D.22027>:
  wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
  D.22028 = mono_compile_method (wrapper);
  delegate->delegate_trampoline = D.22028;
  delegate_hash_table_add (delegate);
  mono_object_register_finalizer (delegate);
  D.21997 = delegate->delegate_trampoline;
  return D.21997;
}


delegate_hash_table_add (struct MonoDelegate * d)
{
  _Bool D.22033;
  long int D.22034;
  long int D.22035;
  struct GHashTable * delegate_hash_table.41;
  struct GHashTable * delegate_hash_table.42;
  int D.22042;
  void * D.22045;
  void * D.22046;
  void * gchandle.43;
  _Bool D.22053;
  long int D.22054;
  long int D.22055;
  guint32 gchandle;
  guint32 old_gchandle;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22031>; else goto <D.22032>;
    <D.22031>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22032>:
    D.22033 = ret != 0;
    D.22034 = (long int) D.22033;
    D.22035 = __builtin_expect (D.22034, 0);
    if (D.22035 != 0) goto <D.22036>; else goto <D.22037>;
    <D.22036>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 420, "ret == 0");
    <D.22037>:
  }
  delegate_hash_table.41 = delegate_hash_table;
  if (delegate_hash_table.41 == 0B) goto <D.22039>; else goto <D.22040>;
  <D.22039>:
  delegate_hash_table.42 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.42;
  <D.22040>:
  D.22042 = mono_gc_is_moving ();
  if (D.22042 != 0) goto <D.22043>; else goto <D.22044>;
  <D.22043>:
  gchandle = mono_gchandle_new_weakref (d, 0);
  delegate_hash_table.41 = delegate_hash_table;
  D.22045 = d->delegate_trampoline;
  D.22046 = monoeg_g_hash_table_lookup (delegate_hash_table.41, D.22045);
  old_gchandle = (guint32) D.22046;
  delegate_hash_table.41 = delegate_hash_table;
  D.22045 = d->delegate_trampoline;
  gchandle.43 = (void *) gchandle;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.22045, gchandle.43, 0);
  if (old_gchandle != 0) goto <D.22048>; else goto <D.22049>;
  <D.22048>:
  mono_gchandle_free (old_gchandle);
  <D.22049>:
  goto <D.22050>;
  <D.22044>:
  delegate_hash_table.41 = delegate_hash_table;
  D.22045 = d->delegate_trampoline;
  monoeg_g_hash_table_insert_replace (delegate_hash_table.41, D.22045, d, 0);
  <D.22050>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22051>; else goto <D.22052>;
    <D.22051>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22052>:
    D.22053 = ret != 0;
    D.22054 = (long int) D.22053;
    D.22055 = __builtin_expect (D.22054, 0);
    if (D.22055 != 0) goto <D.22056>; else goto <D.22057>;
    <D.22056>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 432, "ret == 0");
    <D.22057>:
  }
}


delegate_hash_table_new ()
{
  struct GHashTable * D.22058;

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


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.22063;
  _Bool D.22066;
  long int D.22067;
  long int D.22068;
  struct GHashTable * delegate_hash_table.45;
  struct GHashTable * delegate_hash_table.46;
  int D.22075;
  void * D.22078;
  _Bool D.22081;
  long int D.22082;
  long int D.22083;
  _Bool D.22092;
  long int D.22093;
  long int D.22094;
  int use_aot_wrappers.47;
  struct MonoDomain * D.22102;
  struct MonoClass * D.22103;
  struct MonoMethodSignature * D.22105;
  short unsigned int D.22106;
  int D.22107;
  int D.22108;
  unsigned int D.22109;
  unsigned int D.22110;
  struct MonoMethodSignature * D.22111;
  struct MonoImage * D.22112;
  struct MonoMethodSignature * D.22113;
  short unsigned int D.22114;
  unsigned int i.48;
  unsigned int D.22116;
  struct MonoMarshalSpec * * D.22117;
  struct MonoMarshalSpec * D.22118;
  struct MonoDomain * D.22121;
  void * D.22122;
  struct MonoVTable * D.22123;
  struct MonoDomain * D.22124;
  struct MonoDomain * D.22125;
  struct MonoException * D.22128;
  guint32 gchandle;
  struct MonoDelegate * d;

  ftn.44 = ftn;
  if (ftn.44 == 0B) goto <D.22061>; else goto <D.22062>;
  <D.22061>:
  D.22063 = 0B;
  return D.22063;
  <D.22062>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22064>; else goto <D.22065>;
    <D.22064>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22065>:
    D.22066 = ret != 0;
    D.22067 = (long int) D.22066;
    D.22068 = __builtin_expect (D.22067, 0);
    if (D.22068 != 0) goto <D.22069>; else goto <D.22070>;
    <D.22069>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 483, "ret == 0");
    <D.22070>:
  }
  delegate_hash_table.45 = delegate_hash_table;
  if (delegate_hash_table.45 == 0B) goto <D.22072>; else goto <D.22073>;
  <D.22072>:
  delegate_hash_table.46 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.46;
  <D.22073>:
  D.22075 = mono_gc_is_moving ();
  if (D.22075 != 0) goto <D.22076>; else goto <D.22077>;
  <D.22076>:
  delegate_hash_table.45 = delegate_hash_table;
  ftn.44 = ftn;
  D.22078 = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  gchandle = (guint32) D.22078;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22079>; else goto <D.22080>;
    <D.22079>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22080>:
    D.22081 = ret != 0;
    D.22082 = (long int) D.22081;
    D.22083 = __builtin_expect (D.22082, 0);
    if (D.22083 != 0) goto <D.22084>; else goto <D.22085>;
    <D.22084>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 489, "ret == 0");
    <D.22085>:
  }
  if (gchandle != 0) goto <D.22086>; else goto <D.22087>;
  <D.22086>:
  d = mono_gchandle_get_target (gchandle);
  goto <D.22088>;
  <D.22087>:
  d = 0B;
  <D.22088>:
  goto <D.22089>;
  <D.22077>:
  delegate_hash_table.45 = delegate_hash_table;
  ftn.44 = ftn;
  d = monoeg_g_hash_table_lookup (delegate_hash_table.45, ftn.44);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22090>; else goto <D.22091>;
    <D.22090>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22091>:
    D.22092 = ret != 0;
    D.22093 = (long int) D.22092;
    D.22094 = __builtin_expect (D.22093, 0);
    if (D.22094 != 0) goto <D.22095>; else goto <D.22096>;
    <D.22095>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 496, "ret == 0");
    <D.22096>:
  }
  <D.22089>:
  if (d == 0B) goto <D.22097>; else goto <D.22098>;
  <D.22097>:
  {
    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.22100>; else goto <D.22101>;
        <D.22100>:
        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
        D.22102 = mono_domain_get ();
        D.22103 = mono_defaults.int_class;
        this = mono_value_box (D.22102, D.22103, &ftn);
        goto <D.22104>;
        <D.22101>:
        memset (&piinfo, 0, 32);
        parse_unmanaged_function_pointer_attr (klass, &piinfo);
        D.22105 = mono_method_signature (invoke);
        D.22106 = D.22105->param_count;
        D.22107 = (int) D.22106;
        D.22108 = D.22107 + 1;
        D.22109 = (unsigned int) D.22108;
        D.22110 = D.22109 * 4;
        mspecs = monoeg_malloc0 (D.22110);
        mono_method_get_marshal_info (invoke, mspecs);
        D.22111 = mono_method_signature (invoke);
        sig = mono_metadata_signature_dup (D.22111);
        sig->hasthis = 0;
        D.22112 = klass->image;
        ftn.44 = ftn;
        wrapper = mono_marshal_get_native_func_wrapper (D.22112, sig, &piinfo, mspecs, ftn.44);
        this = 0B;
        D.22113 = mono_method_signature (invoke);
        D.22114 = D.22113->param_count;
        i = (int) D.22114;
        goto <D.18432>;
        <D.18431>:
        i.48 = (unsigned int) i;
        D.22116 = i.48 * 4;
        D.22117 = mspecs + D.22116;
        D.22118 = *D.22117;
        if (D.22118 != 0B) goto <D.22119>; else goto <D.22120>;
        <D.22119>:
        i.48 = (unsigned int) i;
        D.22116 = i.48 * 4;
        D.22117 = mspecs + D.22116;
        D.22118 = *D.22117;
        mono_metadata_free_marshal_spec (D.22118);
        <D.22120>:
        i = i + -1;
        <D.18432>:
        if (i >= 0) goto <D.18431>; else goto <D.18433>;
        <D.18433>:
        monoeg_g_free (mspecs);
        monoeg_g_free (sig);
        <D.22104>:
        D.22121 = mono_domain_get ();
        d = mono_object_new (D.22121, klass);
        D.22122 = mono_compile_method (wrapper);
        mono_delegate_ctor_with_method (d, this, D.22122, wrapper);
      }
    finally
      {
        piinfo = {CLOBBER};
      }
  }
  <D.22098>:
  D.22123 = d->object.vtable;
  D.22124 = D.22123->domain;
  D.22125 = mono_domain_get ();
  if (D.22124 != D.22125) goto <D.22126>; else goto <D.22127>;
  <D.22126>:
  D.22128 = mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain");
  mono_raise_exception (D.22128);
  <D.22127>:
  D.22063 = d;
  return D.22063;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.22132;
  int D.22137;
  void * D.22139;
  unsigned int D.22140;

  D.22132 = __builtin_constant_p (__len);
  if (D.22132 != 0) goto <D.22133>; else goto <D.22134>;
  <D.22133>:
  if (__len == 0) goto <D.22135>; else goto <D.22136>;
  <D.22135>:
  D.22137 = __builtin_constant_p (__ch);
  if (D.22137 == 0) goto <D.22130>; else goto <D.22138>;
  <D.22138>:
  if (__ch != 0) goto <D.22130>; else goto <D.22131>;
  <D.22130>:
  __warn_memset_zero_len ();
  D.22139 = __dest;
  return D.22139;
  <D.22131>:
  <D.22136>:
  <D.22134>:
  D.22140 = __builtin_object_size (__dest, 0);
  D.22139 = __builtin___memset_chk (__dest, __ch, __len, D.22140);
  return D.22139;
}


parse_unmanaged_function_pointer_attr (struct MonoClass * klass, struct MonoMethodPInvoke * piinfo)
{
  struct MonoClass * UnmanagedFunctionPointerAttribute.49;
  struct MonoImage * D.22145;
  struct MonoClass * UnmanagedFunctionPointerAttribute.50;
  int D.22151;
  int D.22156;
  int D.22157;
  signed short D.22158;
  signed short iftmp.51;
  int D.22160;
  int D.22163;
  unsigned short D.22164;
  unsigned short D.22165;
  signed short D.22167;
  unsigned char D.22168;
  signed short D.22169;
  signed short D.22170;
  short unsigned int D.22171;
  int D.22172;
  static struct MonoClass * UnmanagedFunctionPointerAttribute;
  struct MonoCustomAttrInfo * cinfo;
  struct MonoReflectionUnmanagedFunctionPointerAttribute * attr;

  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 == 0B) goto <D.22143>; else goto <D.22144>;
  <D.22143>:
  D.22145 = mono_defaults.corlib;
  UnmanagedFunctionPointerAttribute.50 = mono_class_from_name (D.22145, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
  UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.50;
  <D.22144>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  if (UnmanagedFunctionPointerAttribute.49 != 0B) goto <D.22147>; else goto <D.22148>;
  <D.22147>:
  cinfo = mono_custom_attrs_from_class (klass);
  if (cinfo != 0B) goto <D.22149>; else goto <D.22150>;
  <D.22149>:
  D.22151 = mono_runtime_get_no_exec ();
  if (D.22151 == 0) goto <D.22152>; else goto <D.22153>;
  <D.22152>:
  UnmanagedFunctionPointerAttribute.49 = UnmanagedFunctionPointerAttribute;
  attr = mono_custom_attrs_get_attr (cinfo, UnmanagedFunctionPointerAttribute.49);
  if (attr != 0B) goto <D.22154>; else goto <D.22155>;
  <D.22154>:
  D.22156 = attr->call_conv;
  D.22157 = D.22156 << 8;
  D.22158 = (signed short) D.22157;
  D.22160 = attr->charset;
  if (D.22160 != 0) goto <D.22161>; else goto <D.22162>;
  <D.22161>:
  D.22160 = attr->charset;
  D.22163 = D.22160 + -1;
  D.22164 = (unsigned short) D.22163;
  D.22165 = D.22164 * 2;
  iftmp.51 = (signed short) D.22165;
  goto <D.22166>;
  <D.22162>:
  iftmp.51 = 1;
  <D.22166>:
  D.22167 = D.22158 | iftmp.51;
  D.22168 = attr->set_last_error;
  D.22169 = (signed short) D.22168;
  D.22170 = D.22167 | D.22169;
  D.22171 = (short unsigned int) D.22170;
  piinfo->piflags = D.22171;
  <D.22155>:
  D.22172 = cinfo->cached;
  if (D.22172 == 0) goto <D.22173>; else goto <D.22174>;
  <D.22173>:
  mono_custom_attrs_free (cinfo);
  <D.22174>:
  <D.22153>:
  <D.22150>:
  <D.22148>:
}


mono_delegate_free_ftnptr (struct MonoDelegate * delegate)
{
  void * * D.22175;
  struct MonoObject * D.22176;
  struct MonoDomain * D.22181;
  void * D.22182;
  _Bool D.22183;
  long int D.22184;
  long int D.22185;
  void * * D.22188;
  void * D.22189;
  struct MonoVTable * D.22192;
  struct MonoDomain * D.22193;
  struct MonoJitInfo * ji;
  void * ptr;

  delegate_hash_table_remove (delegate);
  D.22175 = &delegate->delegate_trampoline;
  ptr = InterlockedExchangePointer (D.22175, 0B);
  D.22176 = delegate->target;
  if (D.22176 == 0B) goto <D.22177>; else goto <D.22178>;
  <D.22177>:
  return;
  <D.22178>:
  if (ptr != 0B) goto <D.22179>; else goto <D.22180>;
  <D.22179>:
  {
    uint32_t gchandle;
    void * * method_data;
    struct MonoMethod * method;

    D.22181 = mono_domain_get ();
    D.22182 = mono_get_addr_from_ftnptr (ptr);
    ji = mono_jit_info_table_find (D.22181, D.22182);
    D.22183 = ji == 0B;
    D.22184 = (long int) D.22183;
    D.22185 = __builtin_expect (D.22184, 0);
    if (D.22185 != 0) goto <D.22186>; else goto <D.22187>;
    <D.22186>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 562, "ji");
    <D.22187>:
    method = mono_jit_info_get_method (ji);
    method_data = MEM[(struct MonoMethodWrapper *)method].method_data;
    D.22188 = method_data + 8;
    D.22189 = *D.22188;
    gchandle = (uint32_t) D.22189;
    if (gchandle != 0) goto <D.22190>; else goto <D.22191>;
    <D.22190>:
    mono_gchandle_free (gchandle);
    <D.22191>:
    D.22192 = MEM[(struct MonoObject *)delegate].vtable;
    D.22193 = D.22192->domain;
    mono_runtime_free_method (D.22193, method);
  }
  <D.22180>:
}


delegate_hash_table_remove (struct MonoDelegate * d)
{
  _Bool D.22197;
  long int D.22198;
  long int D.22199;
  struct GHashTable * delegate_hash_table.52;
  struct GHashTable * delegate_hash_table.53;
  int D.22206;
  void * D.22209;
  void * D.22210;
  _Bool D.22213;
  long int D.22214;
  long int D.22215;
  int D.22218;
  guint32 gchandle;

  gchandle = 0;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22195>; else goto <D.22196>;
    <D.22195>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22196>:
    D.22197 = ret != 0;
    D.22198 = (long int) D.22197;
    D.22199 = __builtin_expect (D.22198, 0);
    if (D.22199 != 0) goto <D.22200>; else goto <D.22201>;
    <D.22200>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 403, "ret == 0");
    <D.22201>:
  }
  delegate_hash_table.52 = delegate_hash_table;
  if (delegate_hash_table.52 == 0B) goto <D.22203>; else goto <D.22204>;
  <D.22203>:
  delegate_hash_table.53 = delegate_hash_table_new ();
  delegate_hash_table = delegate_hash_table.53;
  <D.22204>:
  D.22206 = mono_gc_is_moving ();
  if (D.22206 != 0) goto <D.22207>; else goto <D.22208>;
  <D.22207>:
  delegate_hash_table.52 = delegate_hash_table;
  D.22209 = d->delegate_trampoline;
  D.22210 = monoeg_g_hash_table_lookup (delegate_hash_table.52, D.22209);
  gchandle = (guint32) D.22210;
  <D.22208>:
  delegate_hash_table.52 = delegate_hash_table;
  D.22209 = d->delegate_trampoline;
  monoeg_g_hash_table_remove (delegate_hash_table.52, D.22209);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22211>; else goto <D.22212>;
    <D.22211>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22212>:
    D.22213 = ret != 0;
    D.22214 = (long int) D.22213;
    D.22215 = __builtin_expect (D.22214, 0);
    if (D.22215 != 0) goto <D.22216>; else goto <D.22217>;
    <D.22216>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 409, "ret == 0");
    <D.22217>:
  }
  D.22218 = mono_gc_is_moving ();
  if (D.22218 != 0) goto <D.22219>; else goto <D.22220>;
  <D.22219>:
  mono_gchandle_free (gchandle);
  <D.22220>:
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  unsigned int old_val.54;
  unsigned int new_val.55;
  unsigned int D.22223;
  void * D.22224;
  void * D.22225;
  void * old_val;

  <D.17832>:
  old_val = *val;
  old_val.54 = (unsigned int) old_val;
  new_val.55 = (unsigned int) new_val;
  D.22223 = __sync_val_compare_and_swap_4 (val, old_val.54, new_val.55);
  D.22224 = (void *) D.22223;
  if (D.22224 != old_val) goto <D.17832>; else goto <D.17833>;
  <D.17833>:
  D.22225 = old_val;
  return D.22225;
}


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

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


mono_array_to_lparray (struct MonoArray * array)
{
  void * D.22233;
  struct MonoVTable * D.22234;
  struct MonoClass * D.22235;
  unsigned char D.22236;
  int D.22237;
  unsigned int D.22238;
  unsigned int nativeArraySize.56;
  unsigned int D.22240;
  unsigned int i.57;
  unsigned int D.22242;
  void * * D.22243;
  double[0:] * D.22244;
  void * * D.22245;
  void * D.22246;
  void * D.22247;
  void * * nativeArray;
  int nativeArraySize;
  int i;
  struct MonoClass * klass;

  nativeArray = 0B;
  nativeArraySize = 0;
  i = 0;
  if (array == 0B) goto <D.22231>; else goto <D.22232>;
  <D.22231>:
  D.22233 = 0B;
  return D.22233;
  <D.22232>:
  D.22234 = array->obj.vtable;
  klass = D.22234->klass;
  D.22235 = klass->element_class;
  D.22236 = D.22235->byval_arg.type;
  D.22237 = (int) D.22236;
  switch (D.22237) <default: <D.18488>, case 1: <D.18461>, case 2: <D.18467>, case 3: <D.18470>, case 4: <D.18468>, case 5: <D.18466>, case 6: <D.18471>, case 7: <D.18469>, case 8: <D.18474>, case 9: <D.18475>, case 10: <D.18477>, case 11: <D.18476>, case 12: <D.18478>, case 13: <D.18479>, case 14: <D.18487>, case 15: <D.18481>, case 17: <D.18480>, case 18: <D.18462>, case 20: <D.18485>, case 21: <D.18483>, case 24: <D.18472>, case 25: <D.18473>, case 28: <D.18484>, case 29: <D.18486>>
  <D.18461>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 620);
  <D.18462>:
  D.22238 = array->max_length;
  nativeArraySize = (int) D.22238;
  nativeArraySize.56 = (unsigned int) nativeArraySize;
  D.22240 = nativeArraySize.56 * 4;
  nativeArray = malloc (D.22240);
  i = 0;
  goto <D.18464>;
  <D.18463>:
  i.57 = (unsigned int) i;
  D.22242 = i.57 * 4;
  D.22243 = nativeArray + D.22242;
  D.22244 = &array->vector;
  i.57 = (unsigned int) i;
  D.22242 = i.57 * 4;
  D.22245 = D.22244 + D.22242;
  D.22246 = *D.22245;
  D.22247 = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (D.22246);
  *D.22243 = D.22247;
  i = i + 1;
  <D.18464>:
  if (i < nativeArraySize) goto <D.18463>; else goto <D.18465>;
  <D.18465>:
  D.22233 = nativeArray;
  return D.22233;
  <D.18466>:
  <D.18467>:
  <D.18468>:
  <D.18469>:
  <D.18470>:
  <D.18471>:
  <D.18472>:
  <D.18473>:
  <D.18474>:
  <D.18475>:
  <D.18476>:
  <D.18477>:
  <D.18478>:
  <D.18479>:
  <D.18480>:
  <D.18481>:
  goto <D.18482>;
  <D.18483>:
  <D.18484>:
  <D.18485>:
  <D.18486>:
  <D.18487>:
  <D.18488>:
  D.22235 = klass->element_class;
  D.22236 = D.22235->byval_arg.type;
  D.22237 = (int) D.22236;
  monoeg_g_log (0B, 16, "type 0x%x not handled", D.22237);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 653);
  <D.18482>:
  D.22233 = &array->vector;
  return D.22233;
}


mono_free_lparray (struct MonoArray * array, void * * nativeArray)
{
  struct MonoVTable * D.22254;
  struct MonoClass * D.22255;
  unsigned char D.22256;
  int D.22257;
  unsigned int i.58;
  unsigned int D.22259;
  void * * D.22260;
  void * D.22261;
  unsigned int i.59;
  unsigned int D.22263;
  struct MonoClass * klass;
  int i;

  i = 0;
  if (array == 0B) goto <D.22250>; else goto <D.22251>;
  <D.22250>:
  return;
  <D.22251>:
  if (nativeArray == 0B) goto <D.22252>; else goto <D.22253>;
  <D.22252>:
  return;
  <D.22253>:
  D.22254 = array->obj.vtable;
  klass = D.22254->klass;
  D.22255 = klass->element_class;
  D.22256 = D.22255->byval_arg.type;
  D.22257 = (int) D.22256;
  switch (D.22257) <default: <D.22264>, case 18: <D.18495>>
  <D.18495>:
  i = 0;
  goto <D.18497>;
  <D.18496>:
  i.58 = (unsigned int) i;
  D.22259 = i.58 * 4;
  D.22260 = nativeArray + D.22259;
  D.22261 = *D.22260;
  mono_marshal_free_ccw (D.22261);
  i = i + 1;
  <D.18497>:
  i.59 = (unsigned int) i;
  D.22263 = array->max_length;
  if (i.59 < D.22263) goto <D.18496>; else goto <D.18498>;
  <D.18498>:
  free (nativeArray);
  goto <D.18499>;
  <D.22264>:
  <D.18499>:
}


mono_string_utf8_to_builder (struct MonoStringBuilder * sb, char * text)
{
  unsigned int D.22269;
  long int iftmp.60;
  struct MonoString * D.22271;
  long int items_written.61;
  glong iftmp.62;
  struct GError * error.63;
  struct MonoString * D.22288;
  struct MonoString * * D.22289;
  struct MonoDomain * D.22290;
  struct MonoString * D.22291;
  mono_unichar2 * D.22292;
  long int D.22293;
  unsigned int D.22294;
  struct GError * error;
  guint16 * ut;
  glong items_written;
  int l;

  try
    {
      error = 0B;
      if (sb == 0B) goto <D.22266>; else goto <D.22268>;
      <D.22268>:
      if (text == 0B) goto <D.22266>; else goto <D.22267>;
      <D.22266>:
      return;
      <D.22267>:
      D.22269 = strlen (text);
      l = (int) D.22269;
      ut = monoeg_g_utf8_to_utf16 (text, l, 0B, &items_written, &error);
      D.22271 = sb->str;
      if (D.22271 != 0B) goto <D.22272>; else goto <D.22273>;
      <D.22272>:
      D.22271 = sb->str;
      iftmp.60 = D.22271->length;
      goto <D.22274>;
      <D.22273>:
      iftmp.60 = 16;
      <D.22274>:
      items_written.61 = items_written;
      if (iftmp.60 < items_written.61) goto <D.22276>; else goto <D.22277>;
      <D.22276>:
      D.22271 = sb->str;
      if (D.22271 != 0B) goto <D.22279>; else goto <D.22280>;
      <D.22279>:
      D.22271 = sb->str;
      iftmp.62 = D.22271->length;
      goto <D.22281>;
      <D.22280>:
      iftmp.62 = 16;
      <D.22281>:
      items_written = iftmp.62;
      <D.22277>:
      error.63 = error;
      if (error.63 == 0B) goto <D.22283>; else goto <D.22284>;
      <D.22283>:
      D.22271 = sb->str;
      if (D.22271 == 0B) goto <D.22285>; else goto <D.22287>;
      <D.22287>:
      D.22271 = sb->str;
      D.22288 = sb->cached_str;
      if (D.22271 == D.22288) goto <D.22285>; else goto <D.22286>;
      <D.22285>:
      D.22289 = &sb->str;
      D.22290 = mono_domain_get ();
      items_written.61 = items_written;
      D.22291 = mono_string_new_size (D.22290, items_written.61);
      mono_gc_wbarrier_set_field (sb, D.22289, D.22291);
      <D.22286>:
      D.22271 = sb->str;
      D.22292 = mono_string_chars (D.22271);
      items_written.61 = items_written;
      D.22293 = items_written.61 * 2;
      D.22294 = (unsigned int) D.22293;
      memcpy (D.22292, ut, D.22294);
      items_written.61 = items_written;
      sb->length = items_written.61;
      sb->cached_str = 0B;
      goto <D.22295>;
      <D.22284>:
      error.63 = error;
      monoeg_g_error_free (error.63);
      <D.22295>:
      monoeg_g_free (ut);
    }
  finally
    {
      error = {CLOBBER};
      items_written = {CLOBBER};
    }
}


mono_string_utf16_to_builder (struct MonoStringBuilder * sb, gunichar2 * text)
{
  struct MonoString * D.22302;
  mono_unichar2 * D.22303;
  _Bool D.22304;
  long int D.22305;
  long int D.22306;
  unsigned int D.22309;
  gunichar2 * D.22310;
  short unsigned int D.22311;
  int len.64;
  guint32 len;

  if (sb == 0B) goto <D.22299>; else goto <D.22301>;
  <D.22301>:
  if (text == 0B) goto <D.22299>; else goto <D.22300>;
  <D.22299>:
  return;
  <D.22300>:
  D.22302 = sb->str;
  D.22303 = mono_string_chars (D.22302);
  D.22304 = D.22303 != text;
  D.22305 = (long int) D.22304;
  D.22306 = __builtin_expect (D.22305, 0);
  if (D.22306 != 0) goto <D.22307>; else goto <D.22308>;
  <D.22307>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 821, "mono_string_chars (sb->str) == text");
  <D.22308>:
  len = 0;
  goto <D.18552>;
  <D.18551>:
  len = len + 1;
  <D.18552>:
  D.22309 = len * 2;
  D.22310 = text + D.22309;
  D.22311 = *D.22310;
  if (D.22311 != 0) goto <D.18551>; else goto <D.18553>;
  <D.18553>:
  len.64 = (int) len;
  sb->length = len.64;
}


mono_string_builder_to_utf8 (struct MonoStringBuilder * sb)
{
  void * D.22316;
  struct MonoString * D.22317;
  struct MonoString * D.22318;
  int D.22321;
  struct MonoString * * D.22324;
  struct MonoDomain * D.22325;
  struct MonoString * D.22326;
  mono_unichar2 * D.22327;
  int D.22328;
  struct GError * error.65;
  struct MonoException * D.22332;
  gulong iftmp.66;
  int D.22337;
  int D.22339;
  unsigned int D.22340;
  struct GError * error;
  gchar * tmp;
  gchar * res;

  try
    {
      error = 0B;
      res = 0B;
      if (sb == 0B) goto <D.22314>; else goto <D.22315>;
      <D.22314>:
      D.22316 = 0B;
      return D.22316;
      <D.22315>:
      D.22317 = sb->str;
      D.22318 = sb->cached_str;
      if (D.22317 == D.22318) goto <D.22319>; else goto <D.22320>;
      <D.22319>:
      D.22317 = sb->str;
      D.22321 = D.22317->length;
      if (D.22321 == 0) goto <D.22322>; else goto <D.22323>;
      <D.22322>:
      D.22324 = &sb->str;
      D.22325 = mono_domain_get ();
      D.22326 = mono_string_new_size (D.22325, 16);
      mono_gc_wbarrier_set_field (sb, D.22324, D.22326);
      sb->cached_str = 0B;
      <D.22323>:
      <D.22320>:
      D.22317 = sb->str;
      D.22327 = mono_string_chars (D.22317);
      D.22328 = sb->length;
      tmp = monoeg_g_utf16_to_utf8 (D.22327, D.22328, 0B, 0B, &error);
      error.65 = error;
      if (error.65 != 0B) goto <D.22330>; else goto <D.22331>;
      <D.22330>:
      error.65 = error;
      monoeg_g_error_free (error.65);
      D.22332 = mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8");
      mono_raise_exception (D.22332);
      goto <D.22333>;
      <D.22331>:
      D.22317 = sb->str;
      if (D.22317 != 0B) goto <D.22335>; else goto <D.22336>;
      <D.22335>:
      D.22317 = sb->str;
      D.22321 = D.22317->length;
      D.22337 = D.22321 + 1;
      iftmp.66 = (gulong) D.22337;
      goto <D.22338>;
      <D.22336>:
      iftmp.66 = 17;
      <D.22338>:
      res = mono_marshal_alloc (iftmp.66);
      D.22328 = sb->length;
      D.22339 = D.22328 + 1;
      D.22340 = (unsigned int) D.22339;
      memcpy (res, tmp, D.22340);
      monoeg_g_free (tmp);
      <D.22333>:
      D.22316 = res;
      return D.22316;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_string_builder_to_utf16 (struct MonoStringBuilder * sb)
{
  void * D.22345;
  struct MonoString * D.22346;
  _Bool D.22347;
  long int D.22348;
  long int D.22349;
  struct MonoString * D.22352;
  int D.22355;
  struct MonoString * * D.22358;
  struct MonoDomain * D.22359;
  struct MonoString * D.22360;
  struct MonoDomain * D.22362;
  mono_unichar2 * D.22363;
  int iftmp.67;
  struct MonoString * D.22368;
  int D.22369;
  mono_unichar2 * D.22372;

  if (sb == 0B) goto <D.22343>; else goto <D.22344>;
  <D.22343>:
  D.22345 = 0B;
  return D.22345;
  <D.22344>:
  D.22346 = sb->str;
  D.22347 = D.22346 == 0B;
  D.22348 = (long int) D.22347;
  D.22349 = __builtin_expect (D.22348, 0);
  if (D.22349 != 0) goto <D.22350>; else goto <D.22351>;
  <D.22350>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 925, "sb->str");
  <D.22351>:
  D.22346 = sb->str;
  D.22352 = sb->cached_str;
  if (D.22346 == D.22352) goto <D.22353>; else goto <D.22354>;
  <D.22353>:
  D.22346 = sb->str;
  D.22355 = D.22346->length;
  if (D.22355 == 0) goto <D.22356>; else goto <D.22357>;
  <D.22356>:
  D.22358 = &sb->str;
  D.22359 = mono_domain_get ();
  D.22360 = mono_string_new_size (D.22359, 16);
  mono_gc_wbarrier_set_field (sb, D.22358, D.22360);
  goto <D.22361>;
  <D.22357>:
  D.22358 = &sb->str;
  D.22362 = mono_domain_get ();
  D.22346 = sb->str;
  D.22363 = mono_string_chars (D.22346);
  D.22346 = sb->str;
  if (D.22346 != 0B) goto <D.22365>; else goto <D.22366>;
  <D.22365>:
  D.22346 = sb->str;
  iftmp.67 = D.22346->length;
  goto <D.22367>;
  <D.22366>:
  iftmp.67 = 16;
  <D.22367>:
  D.22368 = mono_string_new_utf16 (D.22362, D.22363, iftmp.67);
  mono_gc_wbarrier_set_field (sb, D.22358, D.22368);
  <D.22361>:
  sb->cached_str = 0B;
  <D.22354>:
  D.22369 = sb->length;
  if (D.22369 == 0) goto <D.22370>; else goto <D.22371>;
  <D.22370>:
  D.22346 = sb->str;
  D.22372 = mono_string_chars (D.22346);
  *D.22372 = 0;
  <D.22371>:
  D.22346 = sb->str;
  D.22345 = mono_string_chars (D.22346);
  return D.22345;
}


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

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


mono_string_to_byvalstr (void * dst, struct MonoString * src, int size)
{
  _Bool D.22376;
  long int D.22377;
  long int D.22378;
  _Bool D.22381;
  long int D.22382;
  long int D.22383;
  unsigned int size.68;
  int iftmp.69;
  unsigned int D.22390;
  unsigned int D.22393;
  unsigned int len.70;
  char * s;
  int len;

  D.22376 = dst == 0B;
  D.22377 = (long int) D.22376;
  D.22378 = __builtin_expect (D.22377, 0);
  if (D.22378 != 0) goto <D.22379>; else goto <D.22380>;
  <D.22379>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1006, "dst != NULL");
  <D.22380>:
  D.22381 = size <= 0;
  D.22382 = (long int) D.22381;
  D.22383 = __builtin_expect (D.22382, 0);
  if (D.22383 != 0) goto <D.22384>; else goto <D.22385>;
  <D.22384>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1007, "size > 0");
  <D.22385>:
  size.68 = (unsigned int) size;
  memset (dst, 0, size.68);
  if (src == 0B) goto <D.22387>; else goto <D.22388>;
  <D.22387>:
  return;
  <D.22388>:
  s = mono_string_to_utf8 (src);
  size.68 = (unsigned int) size;
  D.22390 = strlen (s);
  if (size.68 >= D.22390) goto <D.22391>; else goto <D.22392>;
  <D.22391>:
  D.22393 = strlen (s);
  iftmp.69 = (int) D.22393;
  goto <D.22394>;
  <D.22392>:
  iftmp.69 = size;
  <D.22394>:
  len = iftmp.69;
  if (len >= size) goto <D.22395>; else goto <D.22396>;
  <D.22395>:
  len = len + -1;
  <D.22396>:
  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.22399;
  long int D.22400;
  long int D.22401;
  _Bool D.22404;
  long int D.22405;
  long int D.22406;
  int D.22411;
  unsigned int D.22412;
  int iftmp.71;
  int D.22414;
  mono_unichar2 * D.22418;
  int D.22419;
  unsigned int len.72;
  unsigned int D.22423;
  gunichar2 * D.22424;
  int len;

  D.22399 = dst == 0B;
  D.22400 = (long int) D.22399;
  D.22401 = __builtin_expect (D.22400, 0);
  if (D.22401 != 0) goto <D.22402>; else goto <D.22403>;
  <D.22402>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1036, "dst != NULL");
  <D.22403>:
  D.22404 = size <= 1;
  D.22405 = (long int) D.22404;
  D.22406 = __builtin_expect (D.22405, 0);
  if (D.22406 != 0) goto <D.22407>; else goto <D.22408>;
  <D.22407>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1037, "size > 1");
  <D.22408>:
  if (src == 0B) goto <D.22409>; else goto <D.22410>;
  <D.22409>:
  D.22411 = size * 2;
  D.22412 = (unsigned int) D.22411;
  memset (dst, 0, D.22412);
  return;
  <D.22410>:
  D.22414 = mono_string_length (src);
  if (D.22414 <= size) goto <D.22415>; else goto <D.22416>;
  <D.22415>:
  iftmp.71 = mono_string_length (src);
  goto <D.22417>;
  <D.22416>:
  iftmp.71 = size;
  <D.22417>:
  len = iftmp.71;
  D.22418 = mono_string_chars (src);
  D.22411 = size * 2;
  D.22412 = (unsigned int) D.22411;
  memcpy (dst, D.22418, D.22412);
  D.22419 = mono_string_length (src);
  if (D.22419 >= size) goto <D.22420>; else goto <D.22421>;
  <D.22420>:
  len = len + -1;
  <D.22421>:
  len.72 = (unsigned int) len;
  D.22423 = len.72 * 2;
  D.22424 = dst + D.22423;
  *D.22424 = 0;
}


mono_type_to_ldind (struct MonoType * type)
{
  unsigned int D.22426;
  unsigned int D.22427;
  guint D.22430;
  unsigned char D.22431;
  int D.22432;
  struct MonoClass * D.22433;
  unsigned int D.22434;
  unsigned int D.22435;
  struct MonoGenericClass * D.22438;
  struct MonoClass * D.22439;
  void handle_enum = <<< error >>>;

  D.22426 = BIT_FIELD_REF <*type, 32, 32>;
  D.22427 = D.22426 & 1073741824;
  if (D.22427 != 0) goto <D.22428>; else goto <D.22429>;
  <D.22428>:
  D.22430 = 77;
  return D.22430;
  <D.22429>:
  handle_enum:
  D.22431 = type->type;
  D.22432 = (int) D.22431;
  switch (D.22432) <default: <D.18650>, case 2: <D.18628>, case 3: <D.18631>, case 4: <D.18626>, case 5: <D.18627>, case 6: <D.18629>, case 7: <D.18630>, case 8: <D.18632>, case 9: <D.18633>, case 10: <D.18643>, case 11: <D.18644>, case 12: <D.18645>, case 13: <D.18646>, case 14: <D.18639>, case 15: <D.18636>, case 17: <D.18647>, case 18: <D.18638>, case 20: <D.18642>, case 21: <D.18649>, case 22: <D.18648>, case 24: <D.18634>, case 25: <D.18635>, case 27: <D.18637>, case 28: <D.18640>, case 29: <D.18641>>
  <D.18626>:
  D.22430 = 70;
  return D.22430;
  <D.18627>:
  <D.18628>:
  D.22430 = 71;
  return D.22430;
  <D.18629>:
  D.22430 = 72;
  return D.22430;
  <D.18630>:
  <D.18631>:
  D.22430 = 73;
  return D.22430;
  <D.18632>:
  D.22430 = 74;
  return D.22430;
  <D.18633>:
  D.22430 = 75;
  return D.22430;
  <D.18634>:
  <D.18635>:
  <D.18636>:
  <D.18637>:
  D.22430 = 77;
  return D.22430;
  <D.18638>:
  <D.18639>:
  <D.18640>:
  <D.18641>:
  <D.18642>:
  D.22430 = 80;
  return D.22430;
  <D.18643>:
  <D.18644>:
  D.22430 = 76;
  return D.22430;
  <D.18645>:
  D.22430 = 78;
  return D.22430;
  <D.18646>:
  D.22430 = 79;
  return D.22430;
  <D.18647>:
  D.22433 = type->data.klass;
  D.22434 = BIT_FIELD_REF <*D.22433, 32, 160>;
  D.22435 = D.22434 & 16;
  if (D.22435 != 0) goto <D.22436>; else goto <D.22437>;
  <D.22436>:
  D.22433 = type->data.klass;
  type = mono_class_enum_basetype (D.22433);
  goto handle_enum;
  <D.22437>:
  D.22430 = 113;
  return D.22430;
  <D.18648>:
  D.22430 = 113;
  return D.22430;
  <D.18649>:
  D.22438 = type->data.generic_class;
  D.22439 = D.22438->container_class;
  type = &D.22439->byval_arg;
  goto handle_enum;
  <D.18650>:
  D.22431 = type->type;
  D.22432 = (int) D.22431;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_ldind", D.22432);
  <D.18651>:
  goto <D.18651>;
  D.22430 = 4294967295;
  return D.22430;
}


mono_type_to_stind (struct MonoType * type)
{
  unsigned int D.22441;
  unsigned int D.22442;
  guint D.22445;
  unsigned char D.22446;
  int D.22447;
  struct MonoClass * D.22448;
  unsigned int D.22449;
  unsigned int D.22450;
  struct MonoGenericClass * D.22453;
  struct MonoClass * D.22454;
  void handle_enum = <<< error >>>;

  D.22441 = BIT_FIELD_REF <*type, 32, 32>;
  D.22442 = D.22441 & 1073741824;
  if (D.22442 != 0) goto <D.22443>; else goto <D.22444>;
  <D.22443>:
  D.22445 = 223;
  return D.22445;
  <D.22444>:
  handle_enum:
  D.22446 = type->type;
  D.22447 = (int) D.22446;
  switch (D.22447) <default: <D.18680>, case 2: <D.18658>, case 3: <D.18661>, case 4: <D.18656>, case 5: <D.18657>, case 6: <D.18659>, case 7: <D.18660>, case 8: <D.18662>, case 9: <D.18663>, case 10: <D.18673>, case 11: <D.18674>, case 12: <D.18675>, case 13: <D.18676>, case 14: <D.18669>, case 15: <D.18666>, case 17: <D.18677>, case 18: <D.18668>, case 20: <D.18672>, case 21: <D.18679>, case 22: <D.18678>, case 24: <D.18664>, case 25: <D.18665>, case 27: <D.18667>, case 28: <D.18670>, case 29: <D.18671>>
  <D.18656>:
  <D.18657>:
  <D.18658>:
  D.22445 = 82;
  return D.22445;
  <D.18659>:
  <D.18660>:
  <D.18661>:
  D.22445 = 83;
  return D.22445;
  <D.18662>:
  <D.18663>:
  D.22445 = 84;
  return D.22445;
  <D.18664>:
  <D.18665>:
  <D.18666>:
  <D.18667>:
  D.22445 = 223;
  return D.22445;
  <D.18668>:
  <D.18669>:
  <D.18670>:
  <D.18671>:
  <D.18672>:
  D.22445 = 81;
  return D.22445;
  <D.18673>:
  <D.18674>:
  D.22445 = 85;
  return D.22445;
  <D.18675>:
  D.22445 = 86;
  return D.22445;
  <D.18676>:
  D.22445 = 87;
  return D.22445;
  <D.18677>:
  D.22448 = type->data.klass;
  D.22449 = BIT_FIELD_REF <*D.22448, 32, 160>;
  D.22450 = D.22449 & 16;
  if (D.22450 != 0) goto <D.22451>; else goto <D.22452>;
  <D.22451>:
  D.22448 = type->data.klass;
  type = mono_class_enum_basetype (D.22448);
  goto handle_enum;
  <D.22452>:
  D.22445 = 129;
  return D.22445;
  <D.18678>:
  D.22445 = 129;
  return D.22445;
  <D.18679>:
  D.22453 = type->data.generic_class;
  D.22454 = D.22453->container_class;
  type = &D.22454->byval_arg;
  goto handle_enum;
  <D.18680>:
  D.22446 = type->type;
  D.22447 = (int) D.22446;
  monoeg_g_log (0B, 4, "unknown type 0x%02x in type_to_stind", D.22447);
  <D.18681>:
  goto <D.18681>;
  D.22445 = 4294967295;
  return D.22445;
}


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


emit_thread_interrupt_checkpoint (struct MonoMethodBuilder * mb)
{
  char * D.22456;
  char * D.22457;

  D.22456 = mb->name;
  D.22457 = strstr (D.22456, "mono_thread_interruption_checkpoint");
  if (D.22457 != 0B) goto <D.22458>; else goto <D.22459>;
  <D.22458>:
  return;
  <D.22459>:
  emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
}


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

  D.22461 = mono_thread_interruption_request_flag ();
  mono_mb_emit_ptr (mb, D.22461);
  mono_mb_emit_byte (mb, 75);
  D.22462 = mono_mb_emit_branch (mb, 57);
  pos_noabort = (int) D.22462;
  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.22464;

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


get_cache (struct GHashTable * * var, guint (*GHashFunc) (const void *) hash_func, gint (*GCompareFunc) (const void *, const void *) equal_func)
{
  struct GHashTable * D.22466;
  _Bool D.22471;
  long int D.22472;
  long int D.22473;
  _Bool D.22480;
  long int D.22481;
  long int D.22482;
  struct GHashTable * D.22485;

  D.22466 = *var;
  if (D.22466 == 0B) goto <D.22467>; else goto <D.22468>;
  <D.22467>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22469>; else goto <D.22470>;
    <D.22469>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22470>:
    D.22471 = ret != 0;
    D.22472 = (long int) D.22471;
    D.22473 = __builtin_expect (D.22472, 0);
    if (D.22473 != 0) goto <D.22474>; else goto <D.22475>;
    <D.22474>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2432, "ret == 0");
    <D.22475>:
  }
  D.22466 = *var;
  if (D.22466 == 0B) goto <D.22476>; else goto <D.22477>;
  <D.22476>:
  {
    struct GHashTable * cache;

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

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22478>; else goto <D.22479>;
    <D.22478>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22479>:
    D.22480 = ret != 0;
    D.22481 = (long int) D.22480;
    D.22482 = __builtin_expect (D.22481, 0);
    if (D.22482 != 0) goto <D.22483>; else goto <D.22484>;
    <D.22483>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2439, "ret == 0");
    <D.22484>:
  }
  <D.22468>:
  D.22485 = *var;
  return D.22485;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_marshal_find_in_cache (struct GHashTable * cache, void * key)
{
  _Bool D.22489;
  long int D.22490;
  long int D.22491;
  _Bool D.22496;
  long int D.22497;
  long int D.22498;
  struct MonoMethod * D.22501;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22487>; else goto <D.22488>;
    <D.22487>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22488>:
    D.22489 = ret != 0;
    D.22490 = (long int) D.22489;
    D.22491 = __builtin_expect (D.22490, 0);
    if (D.22491 != 0) goto <D.22492>; else goto <D.22493>;
    <D.22492>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2471, "ret == 0");
    <D.22493>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22494>; else goto <D.22495>;
    <D.22494>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22495>:
    D.22496 = ret != 0;
    D.22497 = (long int) D.22496;
    D.22498 = __builtin_expect (D.22497, 0);
    if (D.22498 != 0) goto <D.22499>; else goto <D.22500>;
    <D.22499>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2473, "ret == 0");
    <D.22500>:
  }
  D.22501 = res;
  return D.22501;
}


mono_mb_create_and_cache (struct GHashTable * cache, void * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  _Bool D.22505;
  long int D.22506;
  long int D.22507;
  _Bool D.22512;
  long int D.22513;
  long int D.22514;
  _Bool D.22521;
  long int D.22522;
  long int D.22523;
  _Bool D.22530;
  long int D.22531;
  long int D.22532;
  _Bool D.22538;
  long int D.22539;
  long int D.22540;
  struct MonoMethod * D.22543;
  struct MonoMethod * res;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22503>; else goto <D.22504>;
    <D.22503>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22504>:
    D.22505 = ret != 0;
    D.22506 = (long int) D.22505;
    D.22507 = __builtin_expect (D.22506, 0);
    if (D.22507 != 0) goto <D.22508>; else goto <D.22509>;
    <D.22508>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2485, "ret == 0");
    <D.22509>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22510>; else goto <D.22511>;
    <D.22510>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22511>:
    D.22512 = ret != 0;
    D.22513 = (long int) D.22512;
    D.22514 = __builtin_expect (D.22513, 0);
    if (D.22514 != 0) goto <D.22515>; else goto <D.22516>;
    <D.22515>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2487, "ret == 0");
    <D.22516>:
  }
  if (res == 0B) goto <D.22517>; else goto <D.22518>;
  <D.22517>:
  {
    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.22519>; else goto <D.22520>;
      <D.22519>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.22520>:
      D.22521 = ret != 0;
      D.22522 = (long int) D.22521;
      D.22523 = __builtin_expect (D.22522, 0);
      if (D.22523 != 0) goto <D.22524>; else goto <D.22525>;
      <D.22524>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2491, "ret == 0");
      <D.22525>:
    }
    res = monoeg_g_hash_table_lookup (cache, key);
    if (res == 0B) goto <D.22526>; else goto <D.22527>;
    <D.22526>:
    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.22528>; else goto <D.22529>;
      <D.22528>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22529>:
      D.22530 = ret != 0;
      D.22531 = (long int) D.22530;
      D.22532 = __builtin_expect (D.22531, 0);
      if (D.22532 != 0) goto <D.22533>; else goto <D.22534>;
      <D.22533>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2497, "ret == 0");
      <D.22534>:
    }
    goto <D.22535>;
    <D.22527>:
    {
      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", 2499, "ret == 0");
      <D.22542>:
    }
    mono_free_method (newm);
    <D.22535>:
  }
  <D.22518>:
  D.22543 = res;
  return D.22543;
}


mono_marshal_method_from_wrapper (struct MonoMethod * wrapper)
{
  <unnamed-unsigned:5> D.22545;
  struct MonoMethod * D.22549;
  unsigned int D.22552;
  unsigned int D.22553;
  struct MonoGenericContext * D.22556;
  <unnamed type> D.22560;
  unsigned int D.22564;
  void * res;
  int wrapper_type;
  struct WrapperInfo * info;

  D.22545 = wrapper->wrapper_type;
  wrapper_type = (int) D.22545;
  if (wrapper_type == 0) goto <D.22546>; else goto <D.22548>;
  <D.22548>:
  if (wrapper_type == 17) goto <D.22546>; else goto <D.22547>;
  <D.22546>:
  D.22549 = wrapper;
  return D.22549;
  <D.22547>:
  switch (wrapper_type) <default: <D.19064>, case 4: <D.19063>, case 6: <D.19062>, case 8: <D.19057>, case 9: <D.19058>, case 10: <D.19059>, case 16: <D.19060>, case 22: <D.19061>>
  <D.19057>:
  <D.19058>:
  <D.19059>:
  <D.19060>:
  <D.19061>:
  res = mono_marshal_get_wrapper_info (wrapper);
  if (res == 0B) goto <D.22550>; else goto <D.22551>;
  <D.22550>:
  D.22549 = wrapper;
  return D.22549;
  <D.22551>:
  D.22552 = BIT_FIELD_REF <*wrapper, 32, 160>;
  D.22553 = D.22552 & 4096;
  if (D.22553 != 0) goto <D.22554>; else goto <D.22555>;
  <D.22554>:
  D.22556 = mono_method_get_context (wrapper);
  D.22549 = mono_class_inflate_generic_method (res, D.22556);
  return D.22549;
  <D.22555>:
  D.22549 = res;
  return D.22549;
  <D.19062>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22559>; else goto <D.22557>;
  <D.22559>:
  D.22560 = info->subtype;
  if (D.22560 == 0) goto <D.22558>; else goto <D.22561>;
  <D.22561>:
  D.22560 = info->subtype;
  if (D.22560 == 16) goto <D.22558>; else goto <D.22557>;
  <D.22558>:
  D.22549 = info->d.managed_to_native.method;
  return D.22549;
  <D.22557>:
  D.22549 = 0B;
  return D.22549;
  <D.19063>:
  info = mono_marshal_get_wrapper_info (wrapper);
  if (info != 0B) goto <D.22563>; else goto <D.22562>;
  <D.22563>:
  D.22560 = info->subtype;
  D.22564 = D.22560 + 4294967283;
  if (D.22564 <= 1) goto <D.22565>; else goto <D.22562>;
  <D.22565>:
  D.22549 = info->d.runtime_invoke.method;
  return D.22549;
  <D.22562>:
  D.22549 = 0B;
  return D.22549;
  <D.19064>:
  D.22549 = 0B;
  return D.22549;
}


mono_marshal_get_wrapper_info (struct MonoMethod * wrapper)
{
  unsigned int D.22567;
  unsigned int D.22568;
  _Bool D.22569;
  long int D.22570;
  long int D.22571;
  void * D.22574;

  D.22567 = BIT_FIELD_REF <*wrapper, 32, 160>;
  D.22568 = D.22567 & 124;
  D.22569 = D.22568 == 0;
  D.22570 = (long int) D.22569;
  D.22571 = __builtin_expect (D.22570, 0);
  if (D.22571 != 0) goto <D.22572>; else goto <D.22573>;
  <D.22572>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2634, "wrapper->wrapper_type");
  <D.22573>:
  D.22574 = mono_method_get_wrapper_data (wrapper, 1);
  return D.22574;
}


mono_marshal_set_wrapper_info (struct MonoMethod * method, void * data)
{
  unsigned int D.22578;
  unsigned int D.22579;
  void * * D.22581;
  void * * datav;

  D.22578 = BIT_FIELD_REF <*method, 32, 160>;
  D.22579 = D.22578 & 124;
  if (D.22579 == 0) goto <D.22576>; else goto <D.22580>;
  <D.22580>:
  D.22578 = BIT_FIELD_REF <*method, 32, 160>;
  D.22579 = D.22578 & 124;
  if (D.22579 == 68) goto <D.22576>; else goto <D.22577>;
  <D.22576>:
  return;
  <D.22577>:
  datav = MEM[(struct MonoMethodWrapper *)method].method_data;
  D.22581 = datav + 4;
  *D.22581 = data;
}


mono_marshal_get_delegate_begin_invoke (struct MonoMethod * method)
{
  int iftmp.74;
  struct MonoClass * D.22588;
  struct MonoClass * D.22589;
  struct MonoClass * D.22590;
  int D.19146;
  int iftmp.75;
  int D.19145;
  const char[12] * D.22595;
  unsigned char D.22596;
  int D.22597;
  unsigned char D.22598;
  int D.22599;
  const unsigned char * D.22604;
  unsigned char D.22605;
  int D.22606;
  const unsigned char * D.22607;
  unsigned char D.22608;
  int D.22609;
  const unsigned char * D.22614;
  unsigned char D.22615;
  int D.22616;
  const unsigned char * D.22617;
  unsigned char D.22618;
  int D.22619;
  const unsigned char * D.22624;
  unsigned char D.22625;
  int D.22626;
  const unsigned char * D.22627;
  unsigned char D.22628;
  int D.22629;
  const char * D.22631;
  _Bool D.22632;
  long int D.22633;
  long int D.22634;
  unsigned int D.22637;
  unsigned int D.22638;
  struct MonoImage * D.22643;
  struct GHashTable * * D.22644;
  struct MonoMethod * D.22647;
  struct GHashTable * * D.22649;
  unsigned int D.22652;
  unsigned int D.22653;
  _Bool D.22654;
  long int D.22655;
  long int D.22656;
  struct MonoClass * D.22662;
  unsigned int params_var.76;
  short unsigned int D.22666;
  int D.22667;
  int D.22668;
  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.22584>; else goto <D.22587>;
  <D.22587>:
  D.22588 = method->klass;
  D.22589 = D.22588->parent;
  D.22590 = mono_defaults.multicastdelegate_class;
  if (D.22589 != D.22590) goto <D.22584>; else goto <D.22591>;
  <D.22591>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.22595 = "BeginInvoke";
      D.22596 = MEM[(const unsigned char *)D.22595];
      D.22597 = (int) D.22596;
      D.22598 = *__s2;
      D.22599 = (int) D.22598;
      __result = D.22597 - D.22599;
      {
        if (__s2_len != 0) goto <D.22600>; else goto <D.22601>;
        <D.22600>:
        if (__result == 0) goto <D.22602>; else goto <D.22603>;
        <D.22602>:
        D.22604 = &MEM[(void *)"BeginInvoke" + 1B];
        D.22605 = *D.22604;
        D.22606 = (int) D.22605;
        D.22607 = __s2 + 1;
        D.22608 = *D.22607;
        D.22609 = (int) D.22608;
        __result = D.22606 - D.22609;
        if (__s2_len > 1) goto <D.22610>; else goto <D.22611>;
        <D.22610>:
        if (__result == 0) goto <D.22612>; else goto <D.22613>;
        <D.22612>:
        D.22614 = &MEM[(void *)"BeginInvoke" + 2B];
        D.22615 = *D.22614;
        D.22616 = (int) D.22615;
        D.22617 = __s2 + 2;
        D.22618 = *D.22617;
        D.22619 = (int) D.22618;
        __result = D.22616 - D.22619;
        if (__s2_len > 2) goto <D.22620>; else goto <D.22621>;
        <D.22620>:
        if (__result == 0) goto <D.22622>; else goto <D.22623>;
        <D.22622>:
        D.22624 = &MEM[(void *)"BeginInvoke" + 3B];
        D.22625 = *D.22624;
        D.22626 = (int) D.22625;
        D.22627 = __s2 + 3;
        D.22628 = *D.22627;
        D.22629 = (int) D.22628;
        __result = D.22626 - D.22629;
        <D.22623>:
        <D.22621>:
        <D.22613>:
        <D.22611>:
        <D.22603>:
        <D.22601>:
      }
      D.19145 = __result;
    }
    iftmp.75 = -D.19145;
    goto <D.22630>;
    <D.22594>:
    D.22631 = method->name;
    iftmp.75 = __builtin_strcmp (D.22631, "BeginInvoke");
    <D.22630>:
    D.19146 = iftmp.75;
  }
  if (D.19146 != 0) goto <D.22584>; else goto <D.22585>;
  <D.22584>:
  iftmp.74 = 1;
  goto <D.22586>;
  <D.22585>:
  iftmp.74 = 0;
  <D.22586>:
  D.22632 = iftmp.74 != 0;
  D.22633 = (long int) D.22632;
  D.22634 = __builtin_expect (D.22633, 0);
  if (D.22634 != 0) goto <D.22635>; else goto <D.22636>;
  <D.22635>:
  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.22636>:
  D.22637 = BIT_FIELD_REF <*method, 32, 160>;
  D.22638 = D.22637 & 4096;
  if (D.22638 != 0) goto <D.22639>; else goto <D.22640>;
  <D.22639>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.22640>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.22641>; else goto <D.22642>;
  <D.22641>:
  D.22588 = method->klass;
  D.22643 = D.22588->image;
  D.22644 = &D.22643->delegate_begin_invoke_generic_cache;
  cache = get_cache (D.22644, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.22645>; else goto <D.22646>;
  <D.22645>:
  D.22647 = res;
  return D.22647;
  <D.22646>:
  goto <D.22648>;
  <D.22642>:
  D.22588 = method->klass;
  D.22643 = D.22588->image;
  D.22649 = &D.22643->delegate_begin_invoke_cache;
  cache = get_cache (D.22649, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.22650>; else goto <D.22651>;
  <D.22650>:
  D.22647 = res;
  return D.22647;
  <D.22651>:
  <D.22648>:
  D.22652 = BIT_FIELD_REF <*sig, 32, 64>;
  D.22653 = D.22652 & 4194304;
  D.22654 = D.22653 == 0;
  D.22655 = (long int) D.22654;
  D.22656 = __builtin_expect (D.22655, 0);
  if (D.22656 != 0) goto <D.22657>; else goto <D.22658>;
  <D.22657>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2866, "sig->hasthis");
  <D.22658>:
  name = mono_signature_to_name (sig, "begin_invoke");
  if (ctx != 0B) goto <D.22659>; else goto <D.22660>;
  <D.22659>:
  D.22588 = method->klass;
  mb = mono_mb_new (D.22588, name, 2);
  goto <D.22661>;
  <D.22660>:
  D.22588 = method->klass;
  D.22643 = D.22588->image;
  D.22662 = get_wrapper_target_class (D.22643);
  mb = mono_mb_new (D.22662, name, 2);
  <D.22661>:
  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.22664>; else goto <D.22665>;
  <D.22664>:
  {
    struct MonoMethod * def;

    D.22588 = method->klass;
    D.22666 = sig->param_count;
    D.22667 = (int) D.22666;
    D.22668 = D.22667 + 16;
    def = mono_mb_create_and_cache (cache, D.22588, mb, sig, D.22668);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.22669>;
  <D.22665>:
  D.22666 = sig->param_count;
  D.22667 = (int) D.22666;
  D.22668 = D.22667 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.22668);
  <D.22669>:
  mono_mb_free (mb);
  D.22647 = res;
  return D.22647;
}


check_generic_delegate_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def_method, struct MonoGenericContext * ctx)
{
  struct MonoClass * D.22671;
  struct MonoMethod * D.22674;
  struct MonoClass * D.22675;
  _Bool D.22680;
  long int D.22681;
  long int D.22682;
  _Bool D.22689;
  long int D.22690;
  long int D.22691;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;

  D.22671 = orig_method->klass;
  res = mono_marshal_find_in_cache (cache, D.22671);
  if (res != 0B) goto <D.22672>; else goto <D.22673>;
  <D.22672>:
  D.22674 = res;
  return D.22674;
  <D.22673>:
  D.22675 = def_method->klass;
  def = mono_marshal_find_in_cache (cache, D.22675);
  if (def != 0B) goto <D.22676>; else goto <D.22677>;
  <D.22676>:
  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.22678>; else goto <D.22679>;
    <D.22678>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22679>:
    D.22680 = ret != 0;
    D.22681 = (long int) D.22680;
    D.22682 = __builtin_expect (D.22681, 0);
    if (D.22682 != 0) goto <D.22683>; else goto <D.22684>;
    <D.22683>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2792, "ret == 0");
    <D.22684>:
  }
  D.22671 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.22671);
  if (res == 0B) goto <D.22685>; else goto <D.22686>;
  <D.22685>:
  D.22671 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.22671, inst, 0);
  res = inst;
  <D.22686>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22687>; else goto <D.22688>;
    <D.22687>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22688>:
    D.22689 = ret != 0;
    D.22690 = (long int) D.22689;
    D.22691 = __builtin_expect (D.22690, 0);
    if (D.22691 != 0) goto <D.22692>; else goto <D.22693>;
    <D.22692>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2798, "ret == 0");
    <D.22693>:
  }
  D.22674 = res;
  return D.22674;
  <D.22677>:
  D.22674 = 0B;
  return D.22674;
}


mono_signature_to_name (struct MonoMethodSignature * sig, const char * prefix)
{
  struct MonoType * D.22697;
  unsigned int D.22698;
  unsigned int D.22699;
  struct MonoType * D.22702;
  short unsigned int D.22703;
  int D.22704;
  char * D.22705;
  int i;
  char * result;
  struct GString * res;

  res = monoeg_g_string_new ("");
  if (prefix != 0B) goto <D.22695>; else goto <D.22696>;
  <D.22695>:
  monoeg_g_string_append (res, prefix);
  monoeg_g_string_append_c (res, 95);
  <D.22696>:
  D.22697 = sig->ret;
  mono_type_get_desc (res, D.22697, 0);
  D.22698 = BIT_FIELD_REF <*sig, 32, 64>;
  D.22699 = D.22698 & 4194304;
  if (D.22699 != 0) goto <D.22700>; else goto <D.22701>;
  <D.22700>:
  monoeg_g_string_append (res, "__this__");
  <D.22701>:
  i = 0;
  goto <D.18908>;
  <D.18907>:
  monoeg_g_string_append_c (res, 95);
  D.22702 = sig->params[i];
  mono_type_get_desc (res, D.22702, 0);
  i = i + 1;
  <D.18908>:
  D.22703 = sig->param_count;
  D.22704 = (int) D.22703;
  if (D.22704 > i) goto <D.18907>; else goto <D.18909>;
  <D.18909>:
  result = res->str;
  monoeg_g_string_free (res, 0);
  D.22705 = result;
  return D.22705;
}


get_wrapper_target_class (struct MonoImage * image)
{
  unsigned int D.22707;
  unsigned int D.22708;
  _Bool D.22712;
  long int D.22713;
  long int D.22714;
  struct MonoClass * D.22717;
  struct MonoClass * klass;

  D.22707 = BIT_FIELD_REF <*image, 32, 128>;
  D.22708 = D.22707 & 8;
  if (D.22708 != 0) goto <D.22709>; else goto <D.22710>;
  <D.22709>:
  klass = MEM[(struct MonoDynamicImage *)image].wrappers_type;
  goto <D.22711>;
  <D.22710>:
  klass = mono_class_get (image, 33554433);
  <D.22711>:
  D.22712 = klass == 0B;
  D.22713 = (long int) D.22712;
  D.22714 = __builtin_expect (D.22713, 0);
  if (D.22714 != 0) goto <D.22715>; else goto <D.22716>;
  <D.22715>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2695, "klass");
  <D.22716>:
  D.22717 = klass;
  return D.22717;
}


mono_mb_emit_save_args (struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, gboolean save_this)
{
  struct MonoClass * D.22719;
  struct MonoType * D.22720;
  short unsigned int D.22721;
  int D.22722;
  int D.22723;
  unsigned int D.22724;
  unsigned int D.22725;
  int D.22726;
  unsigned int params_var.77;
  unsigned int tmp_var.78;
  unsigned int D.22731;
  unsigned int D.22732;
  short unsigned int D.22737;
  int D.22738;
  <unnamed-unsigned:1> D.22739;
  int D.22740;
  int D.22741;
  unsigned int D.22742;
  int D.22743;
  int D.22746;
  int i;
  int params_var;
  int tmp_var;

  D.22719 = mono_defaults.int_class;
  D.22720 = &D.22719->byval_arg;
  params_var = mono_mb_add_local (mb, D.22720);
  D.22719 = mono_defaults.int_class;
  D.22720 = &D.22719->byval_arg;
  tmp_var = mono_mb_add_local (mb, D.22720);
  D.22721 = sig->param_count;
  D.22722 = (int) D.22721;
  D.22723 = D.22722 + 1;
  D.22724 = (unsigned int) D.22723;
  D.22725 = D.22724 * 4;
  D.22726 = (int) D.22725;
  mono_mb_emit_icon (mb, D.22726);
  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.22729>; else goto <D.22730>;
  <D.22729>:
  D.22731 = BIT_FIELD_REF <*sig, 32, 64>;
  D.22732 = D.22731 & 4194304;
  if (D.22732 != 0) goto <D.22733>; else goto <D.22734>;
  <D.22733>:
  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.22721 = sig->param_count;
  if (D.22721 != 0) goto <D.22735>; else goto <D.22736>;
  <D.22735>:
  D.22737 = (short unsigned int) tmp_var;
  D.22738 = (int) D.22737;
  mono_mb_emit_add_to_local (mb, D.22738, 4);
  <D.22736>:
  <D.22734>:
  <D.22730>:
  i = 0;
  goto <D.18898>;
  <D.18897>:
  tmp_var.78 = (unsigned int) tmp_var;
  mono_mb_emit_ldloc (mb, tmp_var.78);
  D.22739 = sig->hasthis;
  D.22740 = (int) D.22739;
  D.22741 = D.22740 + i;
  D.22742 = (unsigned int) D.22741;
  mono_mb_emit_ldarg_addr (mb, D.22742);
  mono_mb_emit_byte (mb, 223);
  D.22721 = sig->param_count;
  D.22722 = (int) D.22721;
  D.22743 = D.22722 + -1;
  if (D.22743 > i) goto <D.22744>; else goto <D.22745>;
  <D.22744>:
  D.22737 = (short unsigned int) tmp_var;
  D.22738 = (int) D.22737;
  mono_mb_emit_add_to_local (mb, D.22738, 4);
  <D.22745>:
  i = i + 1;
  <D.18898>:
  D.22721 = sig->param_count;
  D.22722 = (int) D.22721;
  if (D.22722 > i) goto <D.18897>; else goto <D.18899>;
  <D.18899>:
  D.22746 = params_var;
  return D.22746;
}


cache_generic_delegate_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx)
{
  _Bool D.22750;
  long int D.22751;
  long int D.22752;
  struct MonoClass * D.22755;
  _Bool D.22760;
  long int D.22761;
  long int D.22762;
  struct MonoMethod * D.22765;
  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.22748>; else goto <D.22749>;
    <D.22748>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22749>:
    D.22750 = ret != 0;
    D.22751 = (long int) D.22750;
    D.22752 = __builtin_expect (D.22751, 0);
    if (D.22752 != 0) goto <D.22753>; else goto <D.22754>;
    <D.22753>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2814, "ret == 0");
    <D.22754>:
  }
  D.22755 = orig_method->klass;
  res = monoeg_g_hash_table_lookup (cache, D.22755);
  if (res == 0B) goto <D.22756>; else goto <D.22757>;
  <D.22756>:
  D.22755 = orig_method->klass;
  monoeg_g_hash_table_insert_replace (cache, D.22755, inst, 0);
  res = inst;
  <D.22757>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22758>; else goto <D.22759>;
    <D.22758>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22759>:
    D.22760 = ret != 0;
    D.22761 = (long int) D.22760;
    D.22762 = __builtin_expect (D.22761, 0);
    if (D.22762 != 0) goto <D.22763>; else goto <D.22764>;
    <D.22763>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2820, "ret == 0");
    <D.22764>:
  }
  D.22765 = res;
  return D.22765;
}


mono_marshal_get_delegate_end_invoke (struct MonoMethod * method)
{
  int iftmp.79;
  struct MonoClass * D.22772;
  struct MonoClass * D.22773;
  struct MonoClass * D.22774;
  int D.19217;
  int iftmp.80;
  int D.19216;
  const char[10] * D.22779;
  unsigned char D.22780;
  int D.22781;
  unsigned char D.22782;
  int D.22783;
  const unsigned char * D.22788;
  unsigned char D.22789;
  int D.22790;
  const unsigned char * D.22791;
  unsigned char D.22792;
  int D.22793;
  const unsigned char * D.22798;
  unsigned char D.22799;
  int D.22800;
  const unsigned char * D.22801;
  unsigned char D.22802;
  int D.22803;
  const unsigned char * D.22808;
  unsigned char D.22809;
  int D.22810;
  const unsigned char * D.22811;
  unsigned char D.22812;
  int D.22813;
  const char * D.22815;
  _Bool D.22816;
  long int D.22817;
  long int D.22818;
  unsigned int D.22821;
  unsigned int D.22822;
  struct MonoImage * D.22827;
  struct GHashTable * * D.22828;
  struct MonoMethod * D.22831;
  struct GHashTable * * D.22833;
  unsigned int D.22836;
  unsigned int D.22837;
  _Bool D.22838;
  long int D.22839;
  long int D.22840;
  struct MonoClass * D.22846;
  unsigned int params_var.81;
  struct MonoType * D.22848;
  unsigned char D.22849;
  short unsigned int D.22855;
  int D.22856;
  int D.22857;
  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.22768>; else goto <D.22771>;
  <D.22771>:
  D.22772 = method->klass;
  D.22773 = D.22772->parent;
  D.22774 = mono_defaults.multicastdelegate_class;
  if (D.22773 != D.22774) goto <D.22768>; else goto <D.22775>;
  <D.22775>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.22779 = "EndInvoke";
      D.22780 = MEM[(const unsigned char *)D.22779];
      D.22781 = (int) D.22780;
      D.22782 = *__s2;
      D.22783 = (int) D.22782;
      __result = D.22781 - D.22783;
      {
        if (__s2_len != 0) goto <D.22784>; else goto <D.22785>;
        <D.22784>:
        if (__result == 0) goto <D.22786>; else goto <D.22787>;
        <D.22786>:
        D.22788 = &MEM[(void *)"EndInvoke" + 1B];
        D.22789 = *D.22788;
        D.22790 = (int) D.22789;
        D.22791 = __s2 + 1;
        D.22792 = *D.22791;
        D.22793 = (int) D.22792;
        __result = D.22790 - D.22793;
        if (__s2_len > 1) goto <D.22794>; else goto <D.22795>;
        <D.22794>:
        if (__result == 0) goto <D.22796>; else goto <D.22797>;
        <D.22796>:
        D.22798 = &MEM[(void *)"EndInvoke" + 2B];
        D.22799 = *D.22798;
        D.22800 = (int) D.22799;
        D.22801 = __s2 + 2;
        D.22802 = *D.22801;
        D.22803 = (int) D.22802;
        __result = D.22800 - D.22803;
        if (__s2_len > 2) goto <D.22804>; else goto <D.22805>;
        <D.22804>:
        if (__result == 0) goto <D.22806>; else goto <D.22807>;
        <D.22806>:
        D.22808 = &MEM[(void *)"EndInvoke" + 3B];
        D.22809 = *D.22808;
        D.22810 = (int) D.22809;
        D.22811 = __s2 + 3;
        D.22812 = *D.22811;
        D.22813 = (int) D.22812;
        __result = D.22810 - D.22813;
        <D.22807>:
        <D.22805>:
        <D.22797>:
        <D.22795>:
        <D.22787>:
        <D.22785>:
      }
      D.19216 = __result;
    }
    iftmp.80 = -D.19216;
    goto <D.22814>;
    <D.22778>:
    D.22815 = method->name;
    iftmp.80 = __builtin_strcmp (D.22815, "EndInvoke");
    <D.22814>:
    D.19217 = iftmp.80;
  }
  if (D.19217 != 0) goto <D.22768>; else goto <D.22769>;
  <D.22768>:
  iftmp.79 = 1;
  goto <D.22770>;
  <D.22769>:
  iftmp.79 = 0;
  <D.22770>:
  D.22816 = iftmp.79 != 0;
  D.22817 = (long int) D.22816;
  D.22818 = __builtin_expect (D.22817, 0);
  if (D.22818 != 0) goto <D.22819>; else goto <D.22820>;
  <D.22819>:
  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.22820>:
  D.22821 = BIT_FIELD_REF <*method, 32, 160>;
  D.22822 = D.22821 & 4096;
  if (D.22822 != 0) goto <D.22823>; else goto <D.22824>;
  <D.22823>:
  orig_method = method;
  ctx = &MEM[(struct MonoMethodInflated *)method].context;
  method = MEM[(struct MonoMethodInflated *)method].declaring;
  <D.22824>:
  sig = mono_signature_no_pinvoke (method);
  if (ctx != 0B) goto <D.22825>; else goto <D.22826>;
  <D.22825>:
  D.22772 = method->klass;
  D.22827 = D.22772->image;
  D.22828 = &D.22827->delegate_end_invoke_generic_cache;
  cache = get_cache (D.22828, mono_aligned_addr_hash, 0B);
  res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
  if (res != 0B) goto <D.22829>; else goto <D.22830>;
  <D.22829>:
  D.22831 = res;
  return D.22831;
  <D.22830>:
  goto <D.22832>;
  <D.22826>:
  D.22772 = method->klass;
  D.22827 = D.22772->image;
  D.22833 = &D.22827->delegate_end_invoke_cache;
  cache = get_cache (D.22833, mono_signature_hash, mono_metadata_signature_equal);
  res = mono_marshal_find_in_cache (cache, sig);
  if (res != 0B) goto <D.22834>; else goto <D.22835>;
  <D.22834>:
  D.22831 = res;
  return D.22831;
  <D.22835>:
  <D.22832>:
  D.22836 = BIT_FIELD_REF <*sig, 32, 64>;
  D.22837 = D.22836 & 4194304;
  D.22838 = D.22837 == 0;
  D.22839 = (long int) D.22838;
  D.22840 = __builtin_expect (D.22839, 0);
  if (D.22840 != 0) goto <D.22841>; else goto <D.22842>;
  <D.22841>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3076, "sig->hasthis");
  <D.22842>:
  name = mono_signature_to_name (sig, "end_invoke");
  if (ctx != 0B) goto <D.22843>; else goto <D.22844>;
  <D.22843>:
  D.22772 = method->klass;
  mb = mono_mb_new (D.22772, name, 3);
  goto <D.22845>;
  <D.22844>:
  D.22772 = method->klass;
  D.22827 = D.22772->image;
  D.22846 = get_wrapper_target_class (D.22827);
  mb = mono_mb_new (D.22846, name, 3);
  <D.22845>:
  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.22848 = sig->ret;
  D.22849 = D.22848->type;
  if (D.22849 == 1) goto <D.22850>; else goto <D.22851>;
  <D.22850>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.22852>;
  <D.22851>:
  D.22848 = sig->ret;
  mono_mb_emit_restore_result (mb, D.22848);
  <D.22852>:
  if (ctx != 0B) goto <D.22853>; else goto <D.22854>;
  <D.22853>:
  {
    struct MonoMethod * def;

    D.22772 = method->klass;
    D.22855 = sig->param_count;
    D.22856 = (int) D.22855;
    D.22857 = D.22856 + 16;
    def = mono_mb_create_and_cache (cache, D.22772, mb, sig, D.22857);
    res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
  }
  goto <D.22858>;
  <D.22854>:
  D.22855 = sig->param_count;
  D.22856 = (int) D.22855;
  D.22857 = D.22856 + 16;
  res = mono_mb_create_and_cache (cache, sig, mb, sig, D.22857);
  <D.22858>:
  mono_mb_free (mb);
  D.22831 = res;
  return D.22831;
}


mono_mb_emit_restore_result (struct MonoMethodBuilder * mb, struct MonoType * return_type)
{
  unsigned int D.22860;
  unsigned int D.22861;
  struct MonoClass * D.22864;
  unsigned char D.22865;
  int D.22866;
  struct MonoClass * D.22867;
  unsigned int D.22868;
  unsigned char D.22869;
  int D.22870;
  int D.22871;
  unsigned char D.22873;
  int D.22874;
  struct MonoType * t;

  t = mono_type_get_underlying_type (return_type);
  D.22860 = BIT_FIELD_REF <*return_type, 32, 32>;
  D.22861 = D.22860 & 1073741824;
  if (D.22861 != 0) goto <D.22862>; else goto <D.22863>;
  <D.22862>:
  D.22864 = mono_defaults.int_class;
  return_type = &D.22864->byval_arg;
  <D.22863>:
  D.22865 = t->type;
  D.22866 = (int) D.22865;
  switch (D.22866) <default: <D.19197>, case 1: <D.19169>, case 2: <D.19178>, case 3: <D.19181>, case 4: <D.19179>, case 5: <D.19177>, case 6: <D.19182>, case 7: <D.19180>, case 8: <D.19185>, case 9: <D.19186>, case 10: <D.19188>, case 11: <D.19187>, case 12: <D.19189>, case 13: <D.19190>, case 14: <D.19171>, case 15: <D.19170>, case 17: <D.19192>, case 18: <D.19172>, case 19: <D.19194>, case 20: <D.19174>, case 21: <D.19191>, case 24: <D.19183>, case 25: <D.19184>, case 28: <D.19173>, case 29: <D.19175>, case 30: <D.19195>>
  <D.19169>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2981);
  <D.19170>:
  <D.19171>:
  <D.19172>:
  <D.19173>:
  <D.19174>:
  <D.19175>:
  goto <D.19176>;
  <D.19177>:
  <D.19178>:
  <D.19179>:
  <D.19180>:
  <D.19181>:
  <D.19182>:
  <D.19183>:
  <D.19184>:
  <D.19185>:
  <D.19186>:
  <D.19187>:
  <D.19188>:
  <D.19189>:
  <D.19190>:
  D.22867 = mono_class_from_mono_type (return_type);
  mono_mb_emit_op (mb, 121, D.22867);
  D.22868 = mono_type_to_ldind (return_type);
  D.22869 = (unsigned char) D.22868;
  D.22870 = (int) D.22869;
  mono_mb_emit_byte (mb, D.22870);
  goto <D.19176>;
  <D.19191>:
  D.22871 = mono_type_generic_inst_is_valuetype (t);
  if (D.22871 == 0) goto <D.19176>; else goto <D.22872>;
  <D.22872>:
  <D.19192>:
  {
    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.19176>;
  }
  <D.19194>:
  <D.19195>:
  {
    struct MonoClass * klass;

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


mono_marshal_get_remoting_invoke (struct MonoMethod * method)
{
  _Bool D.22876;
  long int D.22877;
  long int D.22878;
  unsigned int D.22883;
  unsigned int D.22884;
  struct MonoMethod * D.22886;
  struct MonoClass * D.22889;
  unsigned int D.22890;
  unsigned int D.22891;
  struct MonoClass * D.22893;
  struct MonoDomain * D.22894;
  _Bool D.22895;
  long int D.22896;
  long int D.22897;
  unsigned int D.22900;
  unsigned int D.22901;
  unsigned int D.22904;
  unsigned int D.22905;
  const char * D.22910;
  struct MonoMethod * D.22911;
  unsigned int params_var.82;
  struct MonoType * D.22913;
  unsigned char D.22914;
  short unsigned int D.22918;
  int D.22919;
  int D.22920;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int params_var;

  D.22876 = method == 0B;
  D.22877 = (long int) D.22876;
  D.22878 = __builtin_expect (D.22877, 0);
  if (D.22878 != 0) goto <D.22879>; else goto <D.22880>;
  <D.22879>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3177, "method");
  <D.22880>:
  D.22883 = BIT_FIELD_REF <*method, 32, 160>;
  D.22884 = D.22883 & 124;
  if (D.22884 == 32) goto <D.22881>; else goto <D.22885>;
  <D.22885>:
  D.22883 = BIT_FIELD_REF <*method, 32, 160>;
  D.22884 = D.22883 & 124;
  if (D.22884 == 40) goto <D.22881>; else goto <D.22882>;
  <D.22881>:
  D.22886 = method;
  return D.22886;
  <D.22882>:
  D.22889 = method->klass;
  D.22890 = BIT_FIELD_REF <*D.22889, 32, 160>;
  D.22891 = D.22890 & 1073741824;
  if (D.22891 != 0) goto <D.22887>; else goto <D.22892>;
  <D.22892>:
  D.22889 = method->klass;
  D.22893 = mono_class_get_com_object_class ();
  if (D.22889 == D.22893) goto <D.22887>; else goto <D.22888>;
  <D.22887>:
  {
    struct MonoVTable * vtable;

    D.22894 = mono_domain_get ();
    D.22889 = method->klass;
    vtable = mono_class_vtable (D.22894, D.22889);
    D.22895 = vtable == 0B;
    D.22896 = (long int) D.22895;
    D.22897 = __builtin_expect (D.22896, 0);
    if (D.22897 != 0) goto <D.22898>; else goto <D.22899>;
    <D.22898>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3186, "vtable");
    <D.22899>:
    D.22900 = BIT_FIELD_REF <*vtable, 32, 160>;
    D.22901 = D.22900 & 16777216;
    if (D.22901 == 0) goto <D.22902>; else goto <D.22903>;
    <D.22902>:
    D.22886 = mono_cominterop_get_invoke (method);
    return D.22886;
    <D.22903>:
  }
  <D.22888>:
  sig = mono_signature_no_pinvoke (method);
  D.22904 = BIT_FIELD_REF <*sig, 32, 64>;
  D.22905 = D.22904 & 4194304;
  if (D.22905 == 0) goto <D.22906>; else goto <D.22907>;
  <D.22906>:
  D.22886 = method;
  return D.22886;
  <D.22907>:
  res = mono_marshal_remoting_find_in_cache (method, 8);
  if (res != 0B) goto <D.22908>; else goto <D.22909>;
  <D.22908>:
  D.22886 = res;
  return D.22886;
  <D.22909>:
  D.22889 = method->klass;
  D.22910 = method->name;
  mb = mono_mb_new (D.22889, D.22910, 8);
  D.22911 = mb->method;
  D.22911->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.22913 = sig->ret;
  D.22914 = D.22913->type;
  if (D.22914 == 1) goto <D.22915>; else goto <D.22916>;
  <D.22915>:
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_byte (mb, 42);
  goto <D.22917>;
  <D.22916>:
  D.22913 = sig->ret;
  mono_mb_emit_restore_result (mb, D.22913);
  <D.22917>:
  D.22918 = sig->param_count;
  D.22919 = (int) D.22918;
  D.22920 = D.22919 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.22920);
  mono_mb_free (mb);
  D.22886 = res;
  return D.22886;
}


mono_marshal_remoting_find_in_cache (struct MonoMethod * method, int wrapper_type)
{
  _Bool D.22924;
  long int D.22925;
  long int D.22926;
  struct MonoClass * D.22929;
  struct MonoImage * D.22930;
  struct GHashTable * D.22931;
  _Bool D.22940;
  long int D.22941;
  long int D.22942;
  struct MonoMethod * D.22945;
  struct MonoMethod * res;
  struct MonoRemotingMethods * wrps;

  res = 0B;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22922>; else goto <D.22923>;
    <D.22922>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22923>:
    D.22924 = ret != 0;
    D.22925 = (long int) D.22924;
    D.22926 = __builtin_expect (D.22925, 0);
    if (D.22926 != 0) goto <D.22927>; else goto <D.22928>;
    <D.22927>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2514, "ret == 0");
    <D.22928>:
  }
  D.22929 = method->klass;
  D.22930 = D.22929->image;
  D.22931 = D.22930->remoting_invoke_cache;
  if (D.22931 != 0B) goto <D.22932>; else goto <D.22933>;
  <D.22932>:
  D.22929 = method->klass;
  D.22930 = D.22929->image;
  D.22931 = D.22930->remoting_invoke_cache;
  wrps = monoeg_g_hash_table_lookup (D.22931, method);
  goto <D.22934>;
  <D.22933>:
  wrps = 0B;
  <D.22934>:
  if (wrps != 0B) goto <D.22935>; else goto <D.22936>;
  <D.22935>:
  switch (wrapper_type) <default: <D.22937>, case 8: <D.19024>, case 9: <D.19026>, case 10: <D.19027>, case 11: <D.19028>>
  <D.19024>:
  res = wrps->invoke;
  goto <D.19025>;
  <D.19026>:
  res = wrps->invoke_with_check;
  goto <D.19025>;
  <D.19027>:
  res = wrps->xdomain_invoke;
  goto <D.19025>;
  <D.19028>:
  res = wrps->xdomain_dispatch;
  goto <D.19025>;
  <D.22937>:
  <D.19025>:
  <D.22936>:
  {
    int ret;

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


mono_remoting_mb_create_and_cache (struct MonoMethod * key, struct MonoMethodBuilder * mb, struct MonoMethodSignature * sig, int max_stack)
{
  struct MonoClass * D.22947;
  struct MonoImage * D.22948;
  struct GHashTable * * D.22949;
  _Bool D.22952;
  long int D.22953;
  long int D.22954;
  struct MonoMethod * D.22959;
  <unnamed-unsigned:5> D.22960;
  int D.22961;
  _Bool D.22964;
  long int D.22965;
  long int D.22966;
  struct MonoMethod * D.22969;
  _Bool D.22974;
  long int D.22975;
  long int D.22976;
  _Bool D.22983;
  long int D.22984;
  long int D.22985;
  _Bool D.22991;
  long int D.22992;
  long int D.22993;
  struct MonoMethod * D.22996;
  struct MonoMethod * * res;
  struct MonoRemotingMethods * wrps;
  struct GHashTable * cache;

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

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22950>; else goto <D.22951>;
    <D.22950>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.22951>:
    D.22952 = ret != 0;
    D.22953 = (long int) D.22952;
    D.22954 = __builtin_expect (D.22953, 0);
    if (D.22954 != 0) goto <D.22955>; else goto <D.22956>;
    <D.22955>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2546, "ret == 0");
    <D.22956>:
  }
  wrps = monoeg_g_hash_table_lookup (cache, key);
  if (wrps == 0B) goto <D.22957>; else goto <D.22958>;
  <D.22957>:
  wrps = monoeg_malloc0 (16);
  monoeg_g_hash_table_insert_replace (cache, key, wrps, 0);
  <D.22958>:
  D.22959 = mb->method;
  D.22960 = D.22959->wrapper_type;
  D.22961 = (int) D.22960;
  switch (D.22961) <default: <D.19045>, case 8: <D.19040>, case 9: <D.19042>, case 10: <D.19043>, case 11: <D.19044>>
  <D.19040>:
  res = &wrps->invoke;
  goto <D.19041>;
  <D.19042>:
  res = &wrps->invoke_with_check;
  goto <D.19041>;
  <D.19043>:
  res = &wrps->xdomain_invoke;
  goto <D.19041>;
  <D.19044>:
  res = &wrps->xdomain_dispatch;
  goto <D.19041>;
  <D.19045>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2558);
  <D.19041>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.22962>; else goto <D.22963>;
    <D.22962>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.22963>:
    D.22964 = ret != 0;
    D.22965 = (long int) D.22964;
    D.22966 = __builtin_expect (D.22965, 0);
    if (D.22966 != 0) goto <D.22967>; else goto <D.22968>;
    <D.22967>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2560, "ret == 0");
    <D.22968>:
  }
  D.22969 = *res;
  if (D.22969 == 0B) goto <D.22970>; else goto <D.22971>;
  <D.22970>:
  {
    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.22972>; else goto <D.22973>;
      <D.22972>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.22973>:
      D.22974 = ret != 0;
      D.22975 = (long int) D.22974;
      D.22976 = __builtin_expect (D.22975, 0);
      if (D.22976 != 0) goto <D.22977>; else goto <D.22978>;
      <D.22977>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2566, "ret == 0");
      <D.22978>:
    }
    D.22969 = *res;
    if (D.22969 == 0B) goto <D.22979>; else goto <D.22980>;
    <D.22979>:
    *res = newm;
    D.22969 = *res;
    mono_marshal_set_wrapper_info (D.22969, key);
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22981>; else goto <D.22982>;
      <D.22981>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22982>:
      D.22983 = ret != 0;
      D.22984 = (long int) D.22983;
      D.22985 = __builtin_expect (D.22984, 0);
      if (D.22985 != 0) goto <D.22986>; else goto <D.22987>;
      <D.22986>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2570, "ret == 0");
      <D.22987>:
    }
    goto <D.22988>;
    <D.22980>:
    {
      int ret;

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.22989>; else goto <D.22990>;
      <D.22989>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.22990>:
      D.22991 = ret != 0;
      D.22992 = (long int) D.22991;
      D.22993 = __builtin_expect (D.22992, 0);
      if (D.22993 != 0) goto <D.22994>; else goto <D.22995>;
      <D.22994>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2572, "ret == 0");
      <D.22995>:
    }
    mono_free_method (newm);
    <D.22988>:
  }
  <D.22971>:
  D.22996 = *res;
  return D.22996;
}


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.22998;
  _Bool D.23003;
  long int D.23004;
  long int D.23005;
  _Bool D.23012;
  long int D.23013;
  long int D.23014;
  struct GHashTable * D.23017;

  D.22998 = *var;
  if (D.22998 == 0B) goto <D.22999>; else goto <D.23000>;
  <D.22999>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23001>; else goto <D.23002>;
    <D.23001>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23002>:
    D.23003 = ret != 0;
    D.23004 = (long int) D.23003;
    D.23005 = __builtin_expect (D.23004, 0);
    if (D.23005 != 0) goto <D.23006>; else goto <D.23007>;
    <D.23006>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2448, "ret == 0");
    <D.23007>:
  }
  D.22998 = *var;
  if (D.22998 == 0B) goto <D.23008>; else goto <D.23009>;
  <D.23008>:
  {
    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.23009>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23010>; else goto <D.23011>;
    <D.23010>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23011>:
    D.23012 = ret != 0;
    D.23013 = (long int) D.23012;
    D.23014 = __builtin_expect (D.23013, 0);
    if (D.23014 != 0) goto <D.23015>; else goto <D.23016>;
    <D.23015>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2455, "ret == 0");
    <D.23016>:
  }
  <D.23000>:
  D.23017 = *var;
  return D.23017;
}


mono_marshal_xdomain_copy_value (struct MonoObject * val)
{
  struct MonoObject * D.23021;
  struct MonoVTable * D.23022;
  struct MonoClass * D.23023;
  unsigned char D.23024;
  int D.23025;
  void * D.23026;
  mono_unichar2 * D.23027;
  int D.23028;
  struct MonoClass * D.23029;
  struct MonoType * D.23030;
  unsigned int D.23035;
  unsigned int i.83;
  char * D.23037;
  struct MonoObject * D.23038;
  struct MonoClass * D.23040;
  struct MonoString * * D.23043;
  struct MonoString * D.23044;
  mono_unichar2 * D.23045;
  int D.23046;
  struct MonoString * D.23047;
  int D.23048;
  struct MonoDomain * domain;

  if (val == 0B) goto <D.23019>; else goto <D.23020>;
  <D.23019>:
  D.23021 = 0B;
  return D.23021;
  <D.23020>:
  domain = mono_domain_get ();
  D.23022 = val->vtable;
  D.23023 = D.23022->klass;
  D.23024 = D.23023->byval_arg.type;
  D.23025 = (int) D.23024;
  switch (D.23025) <default: <D.23039>, case 1: <D.19269>, case 2: <D.19272>, case 3: <D.19275>, case 4: <D.19271>, case 5: <D.19270>, case 6: <D.19274>, case 7: <D.19273>, case 8: <D.19277>, case 9: <D.19276>, case 10: <D.19278>, case 11: <D.19279>, case 12: <D.19280>, case 13: <D.19281>, case 14: <D.19282>, case 20: <D.19284>, case 29: <D.19285>>
  <D.19269>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 3283);
  <D.19270>:
  <D.19271>:
  <D.19272>:
  <D.19273>:
  <D.19274>:
  <D.19275>:
  <D.19276>:
  <D.19277>:
  <D.19278>:
  <D.19279>:
  <D.19280>:
  <D.19281>:
  D.23022 = val->vtable;
  D.23023 = D.23022->klass;
  D.23026 = val + 8;
  D.23021 = mono_value_box (domain, D.23023, D.23026);
  return D.23021;
  <D.19282>:
  {
    struct MonoString * str;

    str = val;
    D.23027 = mono_string_chars (str);
    D.23028 = mono_string_length (str);
    D.23021 = mono_string_new_utf16 (domain, D.23027, D.23028);
    return D.23021;
  }
  <D.19284>:
  <D.19285>:
  {
    struct MonoArray * acopy;
    MonoXDomainMarshalType mt;

    D.23022 = val->vtable;
    D.23023 = D.23022->klass;
    D.23029 = D.23023->element_class;
    D.23030 = &D.23029->byval_arg;
    mt = mono_get_xdomain_marshal_type (D.23030);
    if (mt == 3) goto <D.23031>; else goto <D.23032>;
    <D.23031>:
    D.23021 = 0B;
    return D.23021;
    <D.23032>:
    acopy = mono_array_clone_in_domain (domain, val);
    if (mt == 1) goto <D.23033>; else goto <D.23034>;
    <D.23033>:
    {
      int i;
      int len;

      D.23035 = mono_array_length (acopy);
      len = (int) D.23035;
      i = 0;
      goto <D.19293>;
      <D.19292>:
      {
        struct MonoObject * item;

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

          i.83 = (unsigned int) i;
          __p = mono_array_addr_with_size (acopy, 4, i.83);
          D.23038 = mono_marshal_xdomain_copy_value (item);
          mono_gc_wbarrier_set_arrayref (acopy, __p, D.23038);
        }
      }
      i = i + 1;
      <D.19293>:
      if (i < len) goto <D.19292>; else goto <D.19294>;
      <D.19294>:
    }
    <D.23034>:
    D.23021 = acopy;
    return D.23021;
  }
  <D.23039>:
  D.23022 = val->vtable;
  D.23023 = D.23022->klass;
  D.23040 = mono_defaults.stringbuilder_class;
  if (D.23023 == D.23040) goto <D.23041>; else goto <D.23042>;
  <D.23041>:
  {
    struct MonoStringBuilder * oldsb;
    struct MonoStringBuilder * newsb;

    oldsb = val;
    D.23040 = mono_defaults.stringbuilder_class;
    newsb = mono_object_new (domain, D.23040);
    D.23043 = &newsb->str;
    D.23044 = oldsb->str;
    D.23045 = mono_string_chars (D.23044);
    D.23044 = oldsb->str;
    D.23046 = mono_string_length (D.23044);
    D.23047 = mono_string_new_utf16 (domain, D.23045, D.23046);
    mono_gc_wbarrier_set_field (newsb, D.23043, D.23047);
    D.23048 = oldsb->length;
    newsb->length = D.23048;
    newsb->max_capacity = 2147483647;
    D.23021 = newsb;
    return D.23021;
  }
  <D.23042>:
  D.23021 = 0B;
  return D.23021;
}


mono_marshal_get_xappdomain_invoke (struct MonoMethod * method)
{
  _Bool D.23050;
  long int D.23051;
  long int D.23052;
  unsigned int D.23057;
  unsigned int D.23058;
  struct MonoMethod * D.23060;
  struct MonoMethodSignature * D.23061;
  unsigned int D.23062;
  unsigned int D.23063;
  int D.23066;
  struct MonoClass * D.23071;
  const char * D.23072;
  struct MonoMethod * D.23073;
  short unsigned int D.23074;
  unsigned int D.23075;
  unsigned int D.23076;
  <unnamed type> D.23077;
  short unsigned int D.23080;
  int D.23081;
  int D.23082;
  unsigned int D.23085;
  unsigned int D.23086;
  unsigned int i.84;
  unsigned int D.23093;
  int * D.23094;
  int D.23095;
  struct MonoType * D.23096;
  unsigned char D.23097;
  <unnamed type> D.23100;
  _Bool D.23101;
  struct MonoClass * D.23104;
  struct MonoType * D.23105;
  struct MonoClass * byte_array_class.85;
  struct MonoType * D.23107;
  struct MonoClass * D.23110;
  struct MonoType * D.23111;
  unsigned int loc_context.86;
  struct MonoMethod * method_needs_context_sink.87;
  unsigned int D.23114;
  unsigned int loc_real_proxy.88;
  unsigned int loc_domainid.89;
  struct MonoImage * D.23117;
  unsigned int D.23118;
  unsigned int pos.90;
  int D.23120;
  unsigned int D.23121;
  struct MonoMethod * D.23122;
  unsigned int pos_dispatch.91;
  int iftmp.92;
  int D.23131;
  struct MonoType * D.23134;
  unsigned int D.23135;
  unsigned int D.23136;
  unsigned int D.23139;
  unsigned int D.23140;
  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.23154;
  unsigned int copy_local.98;
  struct MonoMethodSignature * D.23157;
  unsigned int loc_return.99;
  unsigned int D.23161;
  struct MonoMethod * method_rs_deserialize.100;
  struct MonoClass * D.23163;
  struct MonoMethod * method_exc_fixexc.101;
  unsigned int pos_noex.102;
  int j.103;
  int D.23170;
  unsigned int D.23171;
  struct MonoClass * D.23172;
  unsigned int D.23179;
  unsigned int D.23180;
  unsigned int D.23188;
  unsigned int D.23189;
  unsigned int D.23201;
  int D.23206;
  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.23050 = method == 0B;
  D.23051 = (long int) D.23050;
  D.23052 = __builtin_expect (D.23051, 0);
  if (D.23052 != 0) goto <D.23053>; else goto <D.23054>;
  <D.23053>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3744, "method");
  <D.23054>:
  D.23057 = BIT_FIELD_REF <*method, 32, 160>;
  D.23058 = D.23057 & 124;
  if (D.23058 == 32) goto <D.23055>; else goto <D.23059>;
  <D.23059>:
  D.23057 = BIT_FIELD_REF <*method, 32, 160>;
  D.23058 = D.23057 & 124;
  if (D.23058 == 40) goto <D.23055>; else goto <D.23056>;
  <D.23055>:
  D.23060 = method;
  return D.23060;
  <D.23056>:
  D.23061 = mono_method_signature (method);
  D.23062 = BIT_FIELD_REF <*D.23061, 32, 64>;
  D.23063 = D.23062 & 4194304;
  if (D.23063 == 0) goto <D.23064>; else goto <D.23065>;
  <D.23064>:
  D.23060 = method;
  return D.23060;
  <D.23065>:
  D.23066 = mono_marshal_supports_fast_xdomain (method);
  if (D.23066 == 0) goto <D.23067>; else goto <D.23068>;
  <D.23067>:
  D.23060 = mono_marshal_get_remoting_invoke (method);
  return D.23060;
  <D.23068>:
  mono_remoting_marshal_init ();
  res = mono_marshal_remoting_find_in_cache (method, 10);
  if (res != 0B) goto <D.23069>; else goto <D.23070>;
  <D.23069>:
  D.23060 = res;
  return D.23060;
  <D.23070>:
  sig = mono_signature_no_pinvoke (method);
  D.23071 = method->klass;
  D.23072 = method->name;
  mb = mono_mb_new (D.23071, D.23072, 10);
  D.23073 = mb->method;
  D.23073->save_lmf = 1;
  D.23074 = sig->param_count;
  D.23075 = (unsigned int) D.23074;
  D.23076 = D.23075 * 4;
  marshal_types = __builtin_alloca (D.23076);
  complex_out_count = 0;
  complex_count = complex_out_count;
  i = 0;
  goto <D.19433>;
  <D.19432>:
  {
    struct MonoType * ptype;
    int mt;

    ptype = sig->params[i];
    D.23077 = mono_get_xdomain_marshal_type (ptype);
    mt = (int) D.23077;
    D.23080 = ptype->attrs;
    D.23081 = (int) D.23080;
    D.23082 = D.23081 & 2;
    if (D.23082 != 0) goto <D.23083>; else goto <D.23078>;
    <D.23083>:
    if (mt == 1) goto <D.23084>; else goto <D.23078>;
    <D.23084>:
    D.23085 = BIT_FIELD_REF <*ptype, 32, 32>;
    D.23086 = D.23085 & 1073741824;
    if (D.23086 == 0) goto <D.23087>; else goto <D.23078>;
    <D.23087>:
    mt = 2;
    goto <D.23079>;
    <D.23078>:
    if (mt == 3) goto <D.23088>; else goto <D.23089>;
    <D.23088>:
    complex_count = complex_count + 1;
    D.23085 = BIT_FIELD_REF <*ptype, 32, 32>;
    D.23086 = D.23085 & 1073741824;
    if (D.23086 != 0) goto <D.23090>; else goto <D.23091>;
    <D.23090>:
    complex_out_count = complex_out_count + 1;
    <D.23091>:
    <D.23089>:
    <D.23079>:
    i.84 = (unsigned int) i;
    D.23093 = i.84 * 4;
    D.23094 = marshal_types + D.23093;
    *D.23094 = mt;
  }
  i = i + 1;
  <D.19433>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19432>; else goto <D.19434>;
  <D.19434>:
  D.23096 = sig->ret;
  D.23097 = D.23096->type;
  if (D.23097 != 1) goto <D.23098>; else goto <D.23099>;
  <D.23098>:
  D.23096 = sig->ret;
  D.23100 = mono_get_xdomain_marshal_type (D.23096);
  ret_marshal_type = (int) D.23100;
  D.23096 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23096);
  D.23101 = ret_marshal_type != 3;
  copy_return = (gboolean) D.23101;
  <D.23099>:
  if (complex_count > 0) goto <D.23102>; else goto <D.23103>;
  <D.23102>:
  D.23104 = mono_defaults.object_class;
  D.23105 = &D.23104->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23105);
  <D.23103>:
  byte_array_class.85 = byte_array_class;
  D.23107 = &byte_array_class.85->byval_arg;
  loc_serialized_data = mono_mb_add_local (mb, D.23107);
  D.23104 = mono_defaults.object_class;
  D.23105 = &D.23104->byval_arg;
  loc_real_proxy = mono_mb_add_local (mb, D.23105);
  if (copy_return != 0) goto <D.23108>; else goto <D.23109>;
  <D.23108>:
  D.23096 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23096);
  <D.23109>:
  D.23110 = mono_defaults.int32_class;
  D.23111 = &D.23110->byval_arg;
  loc_old_domainid = mono_mb_add_local (mb, D.23111);
  D.23110 = mono_defaults.int32_class;
  D.23111 = &D.23110->byval_arg;
  loc_domainid = mono_mb_add_local (mb, D.23111);
  byte_array_class.85 = byte_array_class;
  D.23107 = &byte_array_class.85->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23107);
  D.23104 = mono_defaults.object_class;
  D.23105 = &D.23104->byval_arg;
  loc_context = mono_mb_add_local (mb, D.23105);
  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.23114 = mono_mb_emit_short_branch (mb, 45);
  pos = (int) D.23114;
  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.23071 = method->klass;
  D.23117 = D.23071->image;
  mono_mb_emit_ptr (mb, D.23117);
  mono_mb_emit_icall (mb, mono_marshal_check_domain_image);
  D.23118 = mono_mb_emit_short_branch (mb, 45);
  pos_dispatch = (int) D.23118;
  pos.90 = (unsigned int) pos;
  mono_mb_patch_short_branch (mb, pos.90);
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.19436>;
  <D.19435>:
  D.23120 = i + 1;
  D.23121 = (unsigned int) D.23120;
  mono_mb_emit_ldarg (mb, D.23121);
  i = i + 1;
  <D.19436>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19435>; else goto <D.19437>;
  <D.19437>:
  D.23122 = mono_marshal_get_remoting_invoke (method);
  mono_mb_emit_managed_call (mb, D.23122, 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.23124>; else goto <D.23125>;
  <D.23124>:
  if (ret_marshal_type == 3) goto <D.23129>; else goto <D.23127>;
  <D.23129>:
  if (complex_out_count > 0) goto <D.23130>; else goto <D.23127>;
  <D.23130>:
  iftmp.92 = complex_count + 1;
  goto <D.23128>;
  <D.23127>:
  iftmp.92 = complex_count;
  <D.23128>:
  mono_mb_emit_icon (mb, iftmp.92);
  D.23104 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 141, D.23104);
  j = 0;
  i = 0;
  goto <D.19441>;
  <D.19440>:
  {
    struct MonoClass * pclass;

    i.84 = (unsigned int) i;
    D.23093 = i.84 * 4;
    D.23094 = marshal_types + D.23093;
    D.23131 = *D.23094;
    if (D.23131 != 3) goto <D.23132>; else goto <D.23133>;
    <D.23132>:
    // predicted unlikely by continue predictor.
    goto <D.19439>;
    <D.23133>:
    D.23134 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23134);
    mono_mb_emit_byte (mb, 37);
    mono_mb_emit_icon (mb, j);
    D.23120 = i + 1;
    D.23121 = (unsigned int) D.23120;
    mono_mb_emit_ldarg (mb, D.23121);
    D.23134 = sig->params[i];
    D.23135 = BIT_FIELD_REF <*D.23134, 32, 32>;
    D.23136 = D.23135 & 1073741824;
    if (D.23136 != 0) goto <D.23137>; else goto <D.23138>;
    <D.23137>:
    D.23139 = BIT_FIELD_REF <*pclass, 32, 160>;
    D.23140 = D.23139 & 8;
    if (D.23140 != 0) goto <D.23141>; else goto <D.23142>;
    <D.23141>:
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23143>;
    <D.23142>:
    mono_mb_emit_byte (mb, 80);
    <D.23143>:
    <D.23138>:
    D.23139 = BIT_FIELD_REF <*pclass, 32, 160>;
    D.23140 = D.23139 & 8;
    if (D.23140 != 0) goto <D.23144>; else goto <D.23145>;
    <D.23144>:
    mono_mb_emit_op (mb, 140, pclass);
    <D.23145>:
    mono_mb_emit_byte (mb, 162);
    j = j + 1;
  }
  <D.19439>:
  i = i + 1;
  <D.19441>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19440>; else goto <D.19442>;
  <D.19442>:
  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.23149>;
  <D.23125>:
  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.23149>:
  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.19452>;
  <D.19451>:
  i.84 = (unsigned int) i;
  D.23093 = i.84 * 4;
  D.23094 = marshal_types + D.23093;
  D.23131 = *D.23094;
  switch (D.23131) <default: <D.23156>, case 0: <D.19450>, case 1: <D.19445>, case 2: <D.19449>, case 3: <D.19443>>
  <D.19443>:
  // predicted unlikely by continue predictor.
  goto <D.19444>;
  <D.19445>:
  D.23120 = i + 1;
  D.23121 = (unsigned int) D.23120;
  mono_mb_emit_ldarg (mb, D.23121);
  D.23134 = sig->params[i];
  D.23135 = BIT_FIELD_REF <*D.23134, 32, 32>;
  D.23136 = D.23135 & 1073741824;
  if (D.23136 != 0) goto <D.23152>; else goto <D.23153>;
  <D.23152>:
  {
    struct MonoClass * pclass;
    int copy_local;

    D.23134 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23134);
    D.23154 = &pclass->byval_arg;
    copy_local = mono_mb_add_local (mb, D.23154);
    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.23153>:
  goto <D.19448>;
  <D.19449>:
  <D.19450>:
  D.23120 = i + 1;
  D.23121 = (unsigned int) D.23120;
  mono_mb_emit_ldarg (mb, D.23121);
  goto <D.19448>;
  <D.23156>:
  <D.19448>:
  <D.19444>:
  i = i + 1;
  <D.19452>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19451>; else goto <D.19453>;
  <D.19453>:
  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.23157 = mono_method_signature (xdomain_method);
  mono_mb_emit_calli (mb, D.23157);
  if (copy_return != 0) goto <D.23158>; else goto <D.23159>;
  <D.23158>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.99);
  <D.23159>:
  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.23161 = mono_mb_emit_short_branch (mb, 44);
  pos_noex = (int) D.23161;
  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.23163 = mono_defaults.exception_class;
  mono_mb_emit_op (mb, 116, D.23163);
  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.19456>;
  <D.19455>:
  D.23134 = sig->params[i];
  D.23135 = BIT_FIELD_REF <*D.23134, 32, 32>;
  D.23136 = D.23135 & 1073741824;
  if (D.23136 == 0) goto <D.23166>; else goto <D.23168>;
  <D.23168>:
  i.84 = (unsigned int) i;
  D.23093 = i.84 * 4;
  D.23094 = marshal_types + D.23093;
  D.23131 = *D.23094;
  if (D.23131 != 1) goto <D.23166>; else goto <D.23167>;
  <D.23166>:
  // predicted unlikely by continue predictor.
  goto <D.19454>;
  <D.23167>:
  D.23120 = i + 1;
  D.23121 = (unsigned int) D.23120;
  mono_mb_emit_ldarg (mb, D.23121);
  j.103 = j;
  j = j.103 + 1;
  D.23170 = j.103 + copy_locals_base;
  D.23171 = (unsigned int) D.23170;
  mono_mb_emit_ldloc (mb, D.23171);
  D.23134 = sig->params[i];
  D.23172 = mono_class_from_mono_type (D.23134);
  mono_marshal_emit_xdomain_copy_value (mb, D.23172);
  mono_mb_emit_byte (mb, 81);
  <D.19454>:
  i = i + 1;
  <D.19456>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19455>; else goto <D.19457>;
  <D.19457>:
  if (complex_out_count > 0) goto <D.23173>; else goto <D.23174>;
  <D.23173>:
  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.19461>;
  <D.19460>:
  i.84 = (unsigned int) i;
  D.23093 = i.84 * 4;
  D.23094 = marshal_types + D.23093;
  D.23131 = *D.23094;
  if (D.23131 != 3) goto <D.23175>; else goto <D.23176>;
  <D.23175>:
  // predicted unlikely by continue predictor.
  goto <D.19458>;
  <D.23176>:
  D.23134 = sig->params[i];
  D.23135 = BIT_FIELD_REF <*D.23134, 32, 32>;
  D.23136 = D.23135 & 1073741824;
  if (D.23136 != 0) goto <D.23177>; else goto <D.23178>;
  <D.23177>:
  {
    struct MonoClass * pclass;

    D.23134 = sig->params[i];
    pclass = mono_class_from_mono_type (D.23134);
    D.23120 = i + 1;
    D.23121 = (unsigned int) D.23120;
    mono_mb_emit_ldarg (mb, D.23121);
    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.23179 = BIT_FIELD_REF <*pclass, 32, 160>;
    D.23180 = D.23179 & 8;
    if (D.23180 != 0) goto <D.23181>; else goto <D.23182>;
    <D.23181>:
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    mono_mb_emit_op (mb, 129, pclass);
    goto <D.23183>;
    <D.23182>:
    D.23104 = mono_defaults.object_class;
    if (D.23104 != pclass) goto <D.23184>; else goto <D.23185>;
    <D.23184>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23185>:
    mono_mb_emit_byte (mb, 81);
    <D.23183>:
  }
  <D.23178>:
  j = j + 1;
  <D.19458>:
  i = i + 1;
  <D.19461>:
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  if (D.23095 > i) goto <D.19460>; else goto <D.19462>;
  <D.19462>:
  if (ret_marshal_type == 3) goto <D.23186>; else goto <D.23187>;
  <D.23186>:
  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.23188 = BIT_FIELD_REF <*ret_class, 32, 160>;
  D.23189 = D.23188 & 8;
  if (D.23189 != 0) goto <D.23190>; else goto <D.23191>;
  <D.23190>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  <D.23191>:
  <D.23187>:
  goto <D.23192>;
  <D.23174>:
  if (ret_marshal_type == 3) goto <D.23193>; else goto <D.23194>;
  <D.23193>:
  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.23188 = BIT_FIELD_REF <*ret_class, 32, 160>;
  D.23189 = D.23188 & 8;
  if (D.23189 != 0) goto <D.23195>; else goto <D.23196>;
  <D.23195>:
  mono_mb_emit_op (mb, 121, ret_class);
  mono_mb_emit_op (mb, 113, ret_class);
  goto <D.23197>;
  <D.23196>:
  D.23104 = mono_defaults.object_class;
  if (D.23104 != ret_class) goto <D.23198>; else goto <D.23199>;
  <D.23198>:
  mono_mb_emit_op (mb, 116, ret_class);
  <D.23199>:
  <D.23197>:
  goto <D.23200>;
  <D.23194>:
  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.23201 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23201;
  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.23200>:
  <D.23192>:
  if (copy_return != 0) goto <D.23202>; else goto <D.23203>;
  <D.23202>:
  loc_return.99 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.99);
  if (ret_marshal_type == 1) goto <D.23204>; else goto <D.23205>;
  <D.23204>:
  mono_marshal_emit_xdomain_copy_value (mb, ret_class);
  <D.23205>:
  <D.23203>:
  mono_mb_emit_byte (mb, 42);
  D.23074 = sig->param_count;
  D.23095 = (int) D.23074;
  D.23206 = D.23095 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23206);
  mono_mb_free (mb);
  D.23060 = res;
  return D.23060;
}


mono_marshal_supports_fast_xdomain (struct MonoMethod * method)
{
  gboolean D.23208;
  int iftmp.104;
  struct MonoClass * D.23213;
  unsigned int D.23214;
  unsigned int D.23215;
  short unsigned int D.23217;
  int D.23218;
  int D.23219;
  int D.19332;
  int iftmp.105;
  int D.19328;
  const char[6] * D.23224;
  unsigned char D.23225;
  int D.23226;
  unsigned char D.23227;
  int D.23228;
  const unsigned char * D.23233;
  unsigned char D.23234;
  int D.23235;
  const unsigned char * D.23236;
  unsigned char D.23237;
  int D.23238;
  const unsigned char * D.23243;
  unsigned char D.23244;
  int D.23245;
  const unsigned char * D.23246;
  unsigned char D.23247;
  int D.23248;
  const unsigned char * D.23253;
  unsigned char D.23254;
  int D.23255;
  const unsigned char * D.23256;
  unsigned char D.23257;
  int D.23258;
  const char * D.23260;

  D.23213 = method->klass;
  D.23214 = BIT_FIELD_REF <*D.23213, 32, 160>;
  D.23215 = D.23214 & 8388608;
  if (D.23215 == 0) goto <D.23216>; else goto <D.23210>;
  <D.23216>:
  D.23217 = method->flags;
  D.23218 = (int) D.23217;
  D.23219 = D.23218 & 2048;
  if (D.23219 == 0) goto <D.23211>; else goto <D.23220>;
  <D.23220>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = method->name;
      D.23224 = ".ctor";
      D.23225 = MEM[(const unsigned char *)D.23224];
      D.23226 = (int) D.23225;
      D.23227 = *__s2;
      D.23228 = (int) D.23227;
      __result = D.23226 - D.23228;
      {
        if (__s1_len != 0) goto <D.23229>; else goto <D.23230>;
        <D.23229>:
        if (__result == 0) goto <D.23231>; else goto <D.23232>;
        <D.23231>:
        D.23233 = &MEM[(void *)".ctor" + 1B];
        D.23234 = *D.23233;
        D.23235 = (int) D.23234;
        D.23236 = __s2 + 1;
        D.23237 = *D.23236;
        D.23238 = (int) D.23237;
        __result = D.23235 - D.23238;
        if (__s1_len > 1) goto <D.23239>; else goto <D.23240>;
        <D.23239>:
        if (__result == 0) goto <D.23241>; else goto <D.23242>;
        <D.23241>:
        D.23243 = &MEM[(void *)".ctor" + 2B];
        D.23244 = *D.23243;
        D.23245 = (int) D.23244;
        D.23246 = __s2 + 2;
        D.23247 = *D.23246;
        D.23248 = (int) D.23247;
        __result = D.23245 - D.23248;
        if (__s1_len > 2) goto <D.23249>; else goto <D.23250>;
        <D.23249>:
        if (__result == 0) goto <D.23251>; else goto <D.23252>;
        <D.23251>:
        D.23253 = &MEM[(void *)".ctor" + 3B];
        D.23254 = *D.23253;
        D.23255 = (int) D.23254;
        D.23256 = __s2 + 3;
        D.23257 = *D.23256;
        D.23258 = (int) D.23257;
        __result = D.23255 - D.23258;
        <D.23252>:
        <D.23250>:
        <D.23242>:
        <D.23240>:
        <D.23232>:
        <D.23230>:
      }
      D.19328 = __result;
    }
    iftmp.105 = D.19328;
    goto <D.23259>;
    <D.23223>:
    D.23260 = method->name;
    iftmp.105 = __builtin_strcmp (".ctor", D.23260);
    <D.23259>:
    D.19332 = iftmp.105;
  }
  if (D.19332 != 0) goto <D.23211>; else goto <D.23210>;
  <D.23211>:
  iftmp.104 = 1;
  goto <D.23212>;
  <D.23210>:
  iftmp.104 = 0;
  <D.23212>:
  D.23208 = iftmp.104;
  return D.23208;
}


mono_remoting_marshal_init ()
{
  int module_initialized.106;
  struct MonoImage * D.23265;
  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.23271;
  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.23263>; else goto <D.23264>;
  <D.23263>:
  D.23265 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23265, "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.23271 = mono_defaults.byte_class;
  byte_array_class.112 = mono_array_class_get (D.23271, 1);
  byte_array_class = byte_array_class.112;
  D.23265 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23265, "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.23265 = mono_defaults.corlib;
  klass = mono_class_from_name (D.23265, "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.23264>:
}


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.23277;
  int iftmp.115;
  struct MonoType * D.23281;
  unsigned char D.23282;
  struct MonoImage * D.23285;
  short unsigned int D.23286;
  int D.23287;
  int D.23288;
  int D.23289;
  unsigned int D.23290;
  int j.116;
  struct MonoClass * D.23292;
  struct MonoType * D.23293;
  int j.117;
  struct MonoClass * byte_array_class.118;
  struct MonoType * D.23296;
  int j.119;
  unsigned int i.120;
  unsigned int D.23299;
  int * D.23300;
  int D.23301;
  int j.121;
  struct MonoType * D.23305;
  struct MonoClass * D.23309;
  struct MonoType * D.23310;
  struct MonoClass * D.23311;
  const char * D.23312;
  struct MonoMethod * D.23313;
  struct MonoType * D.23314;
  struct MonoImage * D.23319;
  int D.23320;
  unsigned int D.23321;
  struct MonoMethod * method_set_call_context.122;
  unsigned int D.23323;
  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 int D.23332;
  unsigned int D.23333;
  unsigned int D.23336;
  unsigned int D.23337;
  struct MonoType * D.23347;
  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.23366;
  unsigned int D.23367;
  struct MonoClass * D.23368;
  unsigned int D.23373;
  unsigned int D.23374;
  _Bool D.23379;
  long int D.23380;
  long int D.23381;
  unsigned int D.23384;
  unsigned int D.23385;
  struct MonoMethod * method_rs_serialize.136;
  unsigned int D.23395;
  int D.23396;
  unsigned int D.23397;
  unsigned int D.23398;
  unsigned int D.23399;
  int D.23400;
  unsigned int D.23401;
  struct MonoMethod * method_rs_serialize_exc.137;
  unsigned int loc_serialized_exc.138;
  int D.23404;
  unsigned int D.23405;
  unsigned int D.23406;
  unsigned int D.23407;
  unsigned int pos_leave.139;
  short unsigned int D.23411;
  int D.23412;
  int D.23413;
  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.23275>; else goto <D.23276>;
  <D.23275>:
  D.23277 = res;
  return D.23277;
  <D.23276>:
  sig = mono_method_signature (method);
  D.23281 = sig->ret;
  D.23282 = D.23281->type;
  if (D.23282 != 1) goto <D.23283>; else goto <D.23279>;
  <D.23283>:
  if (ret_marshal_type != 3) goto <D.23284>; else goto <D.23279>;
  <D.23284>:
  iftmp.115 = 1;
  goto <D.23280>;
  <D.23279>:
  iftmp.115 = 0;
  <D.23280>:
  copy_return = iftmp.115;
  j = 0;
  D.23285 = mono_defaults.corlib;
  D.23286 = sig->param_count;
  D.23287 = (int) D.23286;
  D.23288 = D.23287 + 3;
  D.23289 = D.23288 - complex_count;
  D.23290 = (unsigned int) D.23289;
  csig = mono_metadata_signature_alloc (D.23285, D.23290);
  j.116 = j;
  j = j.116 + 1;
  D.23292 = mono_defaults.object_class;
  D.23293 = &D.23292->byval_arg;
  csig->params[j.116] = D.23293;
  j.117 = j;
  j = j.117 + 1;
  byte_array_class.118 = byte_array_class;
  D.23296 = &byte_array_class.118->this_arg;
  csig->params[j.117] = D.23296;
  j.119 = j;
  j = j.119 + 1;
  byte_array_class.118 = byte_array_class;
  D.23296 = &byte_array_class.118->this_arg;
  csig->params[j.119] = D.23296;
  i = 0;
  goto <D.19382>;
  <D.19381>:
  i.120 = (unsigned int) i;
  D.23299 = i.120 * 4;
  D.23300 = marshal_types + D.23299;
  D.23301 = *D.23300;
  if (D.23301 != 3) goto <D.23302>; else goto <D.23303>;
  <D.23302>:
  j.121 = j;
  j = j.121 + 1;
  D.23305 = sig->params[i];
  csig->params[j.121] = D.23305;
  <D.23303>:
  i = i + 1;
  <D.19382>:
  D.23286 = sig->param_count;
  D.23287 = (int) D.23286;
  if (D.23287 > i) goto <D.19381>; else goto <D.19383>;
  <D.19383>:
  if (copy_return != 0) goto <D.23306>; else goto <D.23307>;
  <D.23306>:
  D.23281 = sig->ret;
  csig->ret = D.23281;
  goto <D.23308>;
  <D.23307>:
  D.23309 = mono_defaults.void_class;
  D.23310 = &D.23309->byval_arg;
  csig->ret = D.23310;
  <D.23308>:
  csig->pinvoke = 1;
  csig->hasthis = 0;
  D.23311 = method->klass;
  D.23312 = method->name;
  mb = mono_mb_new (D.23311, D.23312, 11);
  D.23313 = mb->method;
  D.23313->save_lmf = 1;
  byte_array_class.118 = byte_array_class;
  D.23314 = &byte_array_class.118->byval_arg;
  loc_serialized_exc = mono_mb_add_local (mb, D.23314);
  if (complex_count > 0) goto <D.23315>; else goto <D.23316>;
  <D.23315>:
  D.23292 = mono_defaults.object_class;
  D.23293 = &D.23292->byval_arg;
  loc_array = mono_mb_add_local (mb, D.23293);
  <D.23316>:
  D.23281 = sig->ret;
  D.23282 = D.23281->type;
  if (D.23282 != 1) goto <D.23317>; else goto <D.23318>;
  <D.23317>:
  D.23281 = sig->ret;
  loc_return = mono_mb_add_local (mb, D.23281);
  D.23281 = sig->ret;
  ret_class = mono_class_from_mono_type (D.23281);
  <D.23318>:
  D.23311 = method->klass;
  D.23319 = D.23311->image;
  main_clause = mono_image_alloc0 (D.23319, 24);
  D.23320 = mono_mb_get_label (mb);
  D.23321 = (unsigned int) D.23320;
  main_clause->try_offset = D.23321;
  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.23323 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.23323;
  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.23325>; else goto <D.23326>;
  <D.23325>:
  loc_array.124 = (unsigned int) loc_array;
  mono_mb_emit_stloc (mb, loc_array.124);
  goto <D.23328>;
  <D.23326>:
  mono_mb_emit_byte (mb, 38);
  <D.23328>:
  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.19393>;
  <D.19392>:
  {
    struct MonoType * pt;
    struct MonoClass * pclass;

    pt = sig->params[i];
    pclass = mono_class_from_mono_type (pt);
    i.120 = (unsigned int) i;
    D.23299 = i.120 * 4;
    D.23300 = marshal_types + D.23299;
    D.23301 = *D.23300;
    switch (D.23301) <default: <D.23357>, case 0: <D.19391>, case 1: <D.19390>, case 2: <D.19388>, case 3: <D.19386>>
    <D.19386>:
    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.23332 = BIT_FIELD_REF <*pt, 32, 32>;
    D.23333 = D.23332 & 1073741824;
    if (D.23333 != 0) goto <D.23334>; else goto <D.23335>;
    <D.23334>:
    D.23336 = BIT_FIELD_REF <*pclass, 32, 160>;
    D.23337 = D.23336 & 8;
    if (D.23337 != 0) goto <D.23338>; else goto <D.23339>;
    <D.23338>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    goto <D.23340>;
    <D.23339>:
    mono_mb_emit_op (mb, 143, pclass);
    <D.23340>:
    goto <D.23341>;
    <D.23335>:
    D.23336 = BIT_FIELD_REF <*pclass, 32, 160>;
    D.23337 = D.23336 & 8;
    if (D.23337 != 0) goto <D.23342>; else goto <D.23343>;
    <D.23342>:
    mono_mb_emit_byte (mb, 154);
    mono_mb_emit_op (mb, 121, pclass);
    mono_mb_emit_op (mb, 113, pclass);
    goto <D.23344>;
    <D.23343>:
    mono_mb_emit_byte (mb, 154);
    D.23292 = mono_defaults.object_class;
    if (D.23292 != pclass) goto <D.23345>; else goto <D.23346>;
    <D.23345>:
    mono_mb_emit_op (mb, 116, pclass);
    <D.23346>:
    <D.23344>:
    <D.23341>:
    goto <D.19387>;
    <D.19388>:
    {
      int copy_local;

      D.23347 = &pclass->byval_arg;
      copy_local = mono_mb_add_local (mb, D.23347);
      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.19387>;
    }
    <D.19390>:
    param_index.131 = (unsigned int) param_index;
    mono_mb_emit_ldarg (mb, param_index.131);
    D.23332 = BIT_FIELD_REF <*pt, 32, 32>;
    D.23333 = D.23332 & 1073741824;
    if (D.23333 != 0) goto <D.23352>; else goto <D.23353>;
    <D.23352>:
    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.23354>;
    <D.23353>:
    mono_marshal_emit_xdomain_copy_value (mb, pclass);
    <D.23354>:
    param_index = param_index + 1;
    goto <D.19387>;
    <D.19391>:
    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.19387>;
    <D.23357>:
    <D.19387>:
  }
  i = i + 1;
  <D.19393>:
  D.23286 = sig->param_count;
  D.23287 = (int) D.23286;
  if (D.23287 > i) goto <D.19392>; else goto <D.19394>;
  <D.19394>:
  emit_thread_force_interrupt_checkpoint (mb);
  mono_mb_emit_op (mb, 111, method);
  D.23281 = sig->ret;
  D.23282 = D.23281->type;
  if (D.23282 != 1) goto <D.23358>; else goto <D.23359>;
  <D.23358>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_stloc (mb, loc_return.134);
  <D.23359>:
  j = 0;
  param_index = 3;
  i = 0;
  goto <D.19397>;
  <D.19396>:
  i.120 = (unsigned int) i;
  D.23299 = i.120 * 4;
  D.23300 = marshal_types + D.23299;
  D.23301 = *D.23300;
  if (D.23301 == 3) goto <D.23361>; else goto <D.23362>;
  <D.23361>:
  // predicted unlikely by continue predictor.
  goto <D.19395>;
  <D.23362>:
  i.120 = (unsigned int) i;
  D.23299 = i.120 * 4;
  D.23300 = marshal_types + D.23299;
  D.23301 = *D.23300;
  if (D.23301 == 2) goto <D.23363>; else goto <D.23364>;
  <D.23363>:
  j.135 = j;
  j = j.135 + 1;
  D.23366 = j.135 + copy_locals_base;
  D.23367 = (unsigned int) D.23366;
  mono_mb_emit_ldloc (mb, D.23367);
  param_index.131 = (unsigned int) param_index;
  mono_mb_emit_ldarg (mb, param_index.131);
  D.23305 = sig->params[i];
  D.23368 = mono_class_from_mono_type (D.23305);
  mono_marshal_emit_xdomain_copy_out_value (mb, D.23368);
  <D.23364>:
  param_index = param_index + 1;
  <D.19395>:
  i = i + 1;
  <D.19397>:
  D.23286 = sig->param_count;
  D.23287 = (int) D.23286;
  if (D.23287 > i) goto <D.19396>; else goto <D.19398>;
  <D.19398>:
  if (complex_out_count > 0) goto <D.23369>; else goto <D.23370>;
  <D.23369>:
  j = 0;
  i = 0;
  goto <D.19401>;
  <D.19400>:
  i.120 = (unsigned int) i;
  D.23299 = i.120 * 4;
  D.23300 = marshal_types + D.23299;
  D.23301 = *D.23300;
  if (D.23301 != 3) goto <D.23371>; else goto <D.23372>;
  <D.23371>:
  // predicted unlikely by continue predictor.
  goto <D.19399>;
  <D.23372>:
  D.23305 = sig->params[i];
  D.23373 = BIT_FIELD_REF <*D.23305, 32, 32>;
  D.23374 = D.23373 & 1073741824;
  if (D.23374 == 0) goto <D.23375>; else goto <D.23376>;
  <D.23375>:
  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.23376>:
  j = j + 1;
  <D.19399>:
  i = i + 1;
  <D.19401>:
  D.23286 = sig->param_count;
  D.23287 = (int) D.23286;
  if (D.23287 > i) goto <D.19400>; else goto <D.19402>;
  <D.19402>:
  if (ret_marshal_type == 3) goto <D.23377>; else goto <D.23378>;
  <D.23377>:
  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.23379 = ret_class == 0B;
  D.23380 = (long int) D.23379;
  D.23381 = __builtin_expect (D.23380, 0);
  if (D.23381 != 0) goto <D.23382>; else goto <D.23383>;
  <D.23382>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 3660, "ret_class");
  <D.23383>:
  D.23384 = BIT_FIELD_REF <*ret_class, 32, 160>;
  D.23385 = D.23384 & 8;
  if (D.23385 != 0) goto <D.23386>; else goto <D.23387>;
  <D.23386>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23387>:
  mono_mb_emit_byte (mb, 162);
  <D.23378>:
  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.23389>;
  <D.23370>:
  if (ret_marshal_type == 3) goto <D.23390>; else goto <D.23391>;
  <D.23390>:
  mono_mb_emit_ldarg (mb, 1);
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  D.23384 = BIT_FIELD_REF <*ret_class, 32, 160>;
  D.23385 = D.23384 & 8;
  if (D.23385 != 0) goto <D.23392>; else goto <D.23393>;
  <D.23392>:
  mono_mb_emit_op (mb, 140, ret_class);
  <D.23393>:
  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.23394>;
  <D.23391>:
  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.23394>:
  <D.23389>:
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  D.23395 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.23395;
  main_clause->flags = 0;
  D.23396 = mono_mb_get_pos (mb);
  D.23397 = (unsigned int) D.23396;
  D.23398 = main_clause->try_offset;
  D.23399 = D.23397 - D.23398;
  main_clause->try_len = D.23399;
  D.23292 = mono_defaults.object_class;
  main_clause->data.catch_class = D.23292;
  D.23400 = mono_mb_get_label (mb);
  D.23401 = (unsigned int) D.23400;
  main_clause->handler_offset = D.23401;
  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.23404 = mono_mb_get_pos (mb);
  D.23405 = (unsigned int) D.23404;
  D.23406 = main_clause->handler_offset;
  D.23407 = D.23405 - D.23406;
  main_clause->handler_len = D.23407;
  pos_leave.139 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.139);
  if (copy_return != 0) goto <D.23409>; else goto <D.23410>;
  <D.23409>:
  loc_return.134 = (unsigned int) loc_return;
  mono_mb_emit_ldloc (mb, loc_return.134);
  <D.23410>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, main_clause);
  D.23411 = csig->param_count;
  D.23412 = (int) D.23411;
  D.23413 = D.23412 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, csig, D.23413);
  mono_mb_free (mb);
  D.23277 = res;
  return D.23277;
}


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

  if (target_type == 1) goto <D.23415>; else goto <D.23416>;
  <D.23415>:
  D.23417 = mono_marshal_get_xappdomain_invoke (method);
  return D.23417;
  <D.23416>:
  if (target_type == 2) goto <D.23418>; else goto <D.23419>;
  <D.23418>:
  D.23417 = mono_cominterop_get_invoke (method);
  return D.23417;
  <D.23419>:
  D.23417 = mono_marshal_get_remoting_invoke (method);
  return D.23417;
  D.23417 = 0B;
  return D.23417;
}


mono_marshal_get_remoting_invoke_with_check (struct MonoMethod * method)
{
  _Bool D.23421;
  long int D.23422;
  long int D.23423;
  unsigned int D.23426;
  unsigned int D.23427;
  struct MonoMethod * D.23430;
  struct MonoMethodSignature * D.23431;
  unsigned int D.23432;
  unsigned int D.23433;
  _Bool D.23434;
  long int D.23435;
  long int D.23436;
  struct MonoClass * D.23441;
  const char * D.23442;
  unsigned int i.140;
  short unsigned int D.23444;
  int D.23445;
  int D.23446;
  struct MonoMethodSignature * D.23449;
  unsigned int pos_rem.141;
  struct MonoMethodSignature * D.23451;
  unsigned int pos.142;
  struct MonoMethodSignature * D.23453;
  int D.23454;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethod * native;
  int i;
  int pos;
  int pos_rem;

  D.23421 = method == 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", 4087, "method");
  <D.23425>:
  D.23426 = BIT_FIELD_REF <*method, 32, 160>;
  D.23427 = D.23426 & 124;
  if (D.23427 == 36) goto <D.23428>; else goto <D.23429>;
  <D.23428>:
  D.23430 = method;
  return D.23430;
  <D.23429>:
  D.23431 = mono_method_signature (method);
  D.23432 = BIT_FIELD_REF <*D.23431, 32, 64>;
  D.23433 = D.23432 & 4194304;
  D.23434 = D.23433 == 0;
  D.23435 = (long int) D.23434;
  D.23436 = __builtin_expect (D.23435, 0);
  if (D.23436 != 0) goto <D.23437>; else goto <D.23438>;
  <D.23437>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4093, "mono_method_signature (method)->hasthis");
  <D.23438>:
  res = mono_marshal_remoting_find_in_cache (method, 9);
  if (res != 0B) goto <D.23439>; else goto <D.23440>;
  <D.23439>:
  D.23430 = res;
  return D.23430;
  <D.23440>:
  sig = mono_signature_no_pinvoke (method);
  D.23441 = method->klass;
  D.23442 = method->name;
  mb = mono_mb_new (D.23441, D.23442, 9);
  i = 0;
  goto <D.19482>;
  <D.19481>:
  i.140 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.140);
  i = i + 1;
  <D.19482>:
  D.23444 = sig->param_count;
  D.23445 = (int) D.23444;
  if (D.23445 >= i) goto <D.19481>; else goto <D.19483>;
  <D.19483>:
  mono_mb_emit_ldarg (mb, 0);
  pos = mono_mb_emit_proxy_check (mb, 64);
  D.23446 = mono_marshal_supports_fast_xdomain (method);
  if (D.23446 != 0) goto <D.23447>; else goto <D.23448>;
  <D.23447>:
  mono_mb_emit_ldarg (mb, 0);
  pos_rem = mono_mb_emit_xdomain_check (mb, 59);
  native = mono_marshal_get_xappdomain_invoke (method);
  D.23449 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23449);
  mono_mb_emit_byte (mb, 42);
  pos_rem.141 = (unsigned int) pos_rem;
  mono_mb_patch_branch (mb, pos_rem.141);
  <D.23448>:
  native = mono_marshal_get_remoting_invoke (method);
  D.23451 = mono_method_signature (native);
  mono_mb_emit_managed_call (mb, native, D.23451);
  mono_mb_emit_byte (mb, 42);
  pos.142 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.142);
  D.23453 = mono_method_signature (method);
  mono_mb_emit_managed_call (mb, method, D.23453);
  mono_mb_emit_byte (mb, 42);
  D.23444 = sig->param_count;
  D.23445 = (int) D.23444;
  D.23454 = D.23445 + 16;
  res = mono_remoting_mb_create_and_cache (method, mb, sig, D.23454);
  mono_mb_free (mb);
  D.23430 = res;
  return D.23430;
}


mono_mb_emit_proxy_check (struct MonoMethodBuilder * mb, int branch_code)
{
  struct MonoClass * D.23456;
  unsigned int D.23457;
  int D.23458;
  unsigned char D.23459;
  int D.23460;
  unsigned int D.23461;
  int D.23462;
  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.23456 = mono_defaults.transparent_proxy_class;
  D.23457 = mono_mb_add_data (mb, D.23456);
  D.23458 = (int) D.23457;
  mono_mb_emit_i4 (mb, D.23458);
  D.23459 = (unsigned char) branch_code;
  D.23460 = (int) D.23459;
  D.23461 = mono_mb_emit_branch (mb, D.23460);
  pos = (int) D.23461;
  D.23462 = pos;
  return D.23462;
}


mono_mb_emit_xdomain_check (struct MonoMethodBuilder * mb, int branch_code)
{
  unsigned char D.23464;
  int D.23465;
  unsigned int D.23466;
  int D.23467;
  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.23464 = (unsigned char) branch_code;
  D.23465 = (int) D.23464;
  D.23466 = mono_mb_emit_branch (mb, D.23465);
  pos = (int) D.23466;
  D.23467 = pos;
  return D.23467;
}


mono_marshal_get_delegate_invoke (struct MonoMethod * method, struct MonoDelegate * del)
{
  struct MonoObject * D.23471;
  struct MonoMethod * D.23474;
  struct MonoMethodSignature * D.23477;
  unsigned int D.23478;
  unsigned int D.23479;
  unsigned int D.23482;
  unsigned int D.23483;
  struct MonoMethodSignature * D.23486;
  unsigned int D.23487;
  unsigned int D.23488;
  _Bool D.23489;
  long int D.23490;
  long int D.23491;
  struct MonoType * D.23494;
  struct MonoGenericContext * D.23495;
  int iftmp.143;
  struct MonoClass * D.23502;
  struct MonoClass * D.23503;
  struct MonoClass * D.23504;
  int D.19542;
  int iftmp.144;
  int D.19541;
  const char[7] * D.23509;
  unsigned char D.23510;
  int D.23511;
  unsigned char D.23512;
  int D.23513;
  const unsigned char * D.23518;
  unsigned char D.23519;
  int D.23520;
  const unsigned char * D.23521;
  unsigned char D.23522;
  int D.23523;
  const unsigned char * D.23528;
  unsigned char D.23529;
  int D.23530;
  const unsigned char * D.23531;
  unsigned char D.23532;
  int D.23533;
  const unsigned char * D.23538;
  unsigned char D.23539;
  int D.23540;
  const unsigned char * D.23541;
  unsigned char D.23542;
  int D.23543;
  const char * D.23545;
  _Bool D.23546;
  long int D.23547;
  long int D.23548;
  short unsigned int D.23553;
  struct MonoMethodSignature * D.23554;
  short unsigned int D.23555;
  _Bool D.23556;
  struct MonoMethodSignature * D.23561;
  short unsigned int D.23562;
  int D.23563;
  int D.23564;
  int D.23565;
  short unsigned int D.23568;
  int D.23569;
  int D.23570;
  _Bool D.23573;
  long int D.23574;
  long int D.23575;
  unsigned int D.23578;
  unsigned int D.23579;
  _Bool D.23588;
  long int D.23589;
  long int D.23590;
  struct MonoImage * D.23595;
  struct GHashTable * * D.23596;
  struct MonoMethod * D.23599;
  struct GHashTable * * D.23603;
  _Bool D.23611;
  long int D.23612;
  long int D.23613;
  struct GHashTable * D.23616;
  struct GHashTable * D.23619;
  _Bool D.23622;
  long int D.23623;
  long int D.23624;
  struct GHashTable * * D.23630;
  struct MonoClass * D.23641;
  struct MonoClass * D.23642;
  struct MonoType * D.23643;
  unsigned int D.23644;
  unsigned int D.23645;
  _Bool D.23646;
  long int D.23647;
  long int D.23648;
  unsigned int local_prev.145;
  unsigned int D.23652;
  int D.23653;
  unsigned int D.23654;
  struct MonoGenericContext * D.23657;
  struct MonoMethod * D.23658;
  struct MonoType * D.23660;
  unsigned char D.23661;
  unsigned int pos0.146;
  unsigned int local_target.147;
  unsigned int D.23668;
  struct MonoType * D.23680;
  int D.23681;
  struct MonoClass * D.23684;
  int D.23687;
  _Bool D.23696;
  long int D.23697;
  long int D.23698;
  struct MonoClass * D.23705;
  struct MonoImage * D.23706;
  struct MonoMethodSignature * D.23707;
  struct MonoMethodSignature * D.23708;
  _Bool D.23711;
  long int D.23712;
  long int D.23713;
  _Bool D.23719;
  long int D.23720;
  long int D.23721;
  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.23469>; else goto <D.23470>;
      <D.23469>:
      D.23471 = del->target;
      if (D.23471 == 0B) goto <D.23472>; else goto <D.23473>;
      <D.23472>:
      D.23474 = del->method;
      if (D.23474 != 0B) goto <D.23475>; else goto <D.23476>;
      <D.23475>:
      D.23474 = del->method;
      D.23477 = mono_method_signature (D.23474);
      D.23478 = BIT_FIELD_REF <*D.23477, 32, 64>;
      D.23479 = D.23478 & 4194304;
      if (D.23479 != 0) goto <D.23480>; else goto <D.23481>;
      <D.23480>:
      callvirt = 1;
      target_method = del->method;
      D.23482 = BIT_FIELD_REF <*target_method, 32, 160>;
      D.23483 = D.23482 & 4096;
      if (D.23483 != 0) goto <D.23484>; else goto <D.23485>;
      <D.23484>:
      {
        struct MonoType * target_type;

        D.23486 = method->signature;
        D.23487 = BIT_FIELD_REF <*D.23486, 32, 64>;
        D.23488 = D.23487 & 4194304;
        D.23489 = D.23488 == 0;
        D.23490 = (long int) D.23489;
        D.23491 = __builtin_expect (D.23490, 0);
        if (D.23491 != 0) goto <D.23492>; else goto <D.23493>;
        <D.23492>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4211, "method->signature->hasthis");
        <D.23493>:
        D.23486 = method->signature;
        D.23494 = D.23486->params[0];
        D.23495 = mono_method_get_context (method);
        target_type = mono_class_inflate_generic_type (D.23494, D.23495);
        target_class = mono_class_from_mono_type (target_type);
      }
      goto <D.23496>;
      <D.23485>:
      D.23474 = del->method;
      target_class = D.23474->klass;
      <D.23496>:
      <D.23481>:
      <D.23476>:
      <D.23473>:
      <D.23470>:
      if (method == 0B) goto <D.23498>; else goto <D.23501>;
      <D.23501>:
      D.23502 = method->klass;
      D.23503 = D.23502->parent;
      D.23504 = mono_defaults.multicastdelegate_class;
      if (D.23503 != D.23504) goto <D.23498>; else goto <D.23505>;
      <D.23505>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = method->name;
          D.23509 = "Invoke";
          D.23510 = MEM[(const unsigned char *)D.23509];
          D.23511 = (int) D.23510;
          D.23512 = *__s2;
          D.23513 = (int) D.23512;
          __result = D.23511 - D.23513;
          {
            if (__s2_len != 0) goto <D.23514>; else goto <D.23515>;
            <D.23514>:
            if (__result == 0) goto <D.23516>; else goto <D.23517>;
            <D.23516>:
            D.23518 = &MEM[(void *)"Invoke" + 1B];
            D.23519 = *D.23518;
            D.23520 = (int) D.23519;
            D.23521 = __s2 + 1;
            D.23522 = *D.23521;
            D.23523 = (int) D.23522;
            __result = D.23520 - D.23523;
            if (__s2_len > 1) goto <D.23524>; else goto <D.23525>;
            <D.23524>:
            if (__result == 0) goto <D.23526>; else goto <D.23527>;
            <D.23526>:
            D.23528 = &MEM[(void *)"Invoke" + 2B];
            D.23529 = *D.23528;
            D.23530 = (int) D.23529;
            D.23531 = __s2 + 2;
            D.23532 = *D.23531;
            D.23533 = (int) D.23532;
            __result = D.23530 - D.23533;
            if (__s2_len > 2) goto <D.23534>; else goto <D.23535>;
            <D.23534>:
            if (__result == 0) goto <D.23536>; else goto <D.23537>;
            <D.23536>:
            D.23538 = &MEM[(void *)"Invoke" + 3B];
            D.23539 = *D.23538;
            D.23540 = (int) D.23539;
            D.23541 = __s2 + 3;
            D.23542 = *D.23541;
            D.23543 = (int) D.23542;
            __result = D.23540 - D.23543;
            <D.23537>:
            <D.23535>:
            <D.23527>:
            <D.23525>:
            <D.23517>:
            <D.23515>:
          }
          D.19541 = __result;
        }
        iftmp.144 = -D.19541;
        goto <D.23544>;
        <D.23508>:
        D.23545 = method->name;
        iftmp.144 = __builtin_strcmp (D.23545, "Invoke");
        <D.23544>:
        D.19542 = iftmp.144;
      }
      if (D.19542 != 0) goto <D.23498>; else goto <D.23499>;
      <D.23498>:
      iftmp.143 = 1;
      goto <D.23500>;
      <D.23499>:
      iftmp.143 = 0;
      <D.23500>:
      D.23546 = iftmp.143 != 0;
      D.23547 = (long int) D.23546;
      D.23548 = __builtin_expect (D.23547, 0);
      if (D.23548 != 0) goto <D.23549>; else goto <D.23550>;
      <D.23549>:
      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.23550>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      if (callvirt != 0) goto <D.23551>; else goto <D.23552>;
      <D.23551>:
      D.23553 = sig->param_count;
      D.23474 = del->method;
      D.23554 = mono_method_signature (D.23474);
      D.23555 = D.23554->param_count;
      D.23556 = D.23553 == D.23555;
      closed_over_null = (gboolean) D.23556;
      <D.23552>:
      if (del != 0B) goto <D.23557>; else goto <D.23558>;
      <D.23557>:
      D.23474 = del->method;
      if (D.23474 != 0B) goto <D.23559>; else goto <D.23560>;
      <D.23559>:
      D.23474 = del->method;
      D.23561 = mono_method_signature (D.23474);
      D.23562 = D.23561->param_count;
      D.23563 = (int) D.23562;
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      D.23565 = D.23564 + 1;
      if (D.23563 == D.23565) goto <D.23566>; else goto <D.23567>;
      <D.23566>:
      D.23474 = del->method;
      D.23568 = D.23474->flags;
      D.23569 = (int) D.23568;
      D.23570 = D.23569 & 16;
      if (D.23570 != 0) goto <D.23571>; else goto <D.23572>;
      <D.23571>:
      D.23573 = callvirt != 0;
      D.23574 = (long int) D.23573;
      D.23575 = __builtin_expect (D.23574, 0);
      if (D.23575 != 0) goto <D.23576>; else goto <D.23577>;
      <D.23576>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4229, "!callvirt");
      <D.23577>:
      D.23474 = del->method;
      invoke_sig = mono_method_signature (D.23474);
      target_method = 0B;
      static_method_with_first_arg_bound = 1;
      <D.23572>:
      <D.23567>:
      <D.23560>:
      <D.23558>:
      D.23578 = BIT_FIELD_REF <*method, 32, 160>;
      D.23579 = D.23578 & 4096;
      if (D.23579 != 0) goto <D.23580>; else goto <D.23581>;
      <D.23580>:
      if (callvirt == 0) goto <D.23582>; else goto <D.23583>;
      <D.23582>:
      if (static_method_with_first_arg_bound == 0) goto <D.23584>; else goto <D.23585>;
      <D.23584>:
      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.23586>; else goto <D.23587>;
      <D.23586>:
      D.23502 = method->klass;
      container = D.23502->generic_container;
      <D.23587>:
      D.23588 = container == 0B;
      D.23589 = (long int) D.23588;
      D.23590 = __builtin_expect (D.23589, 0);
      if (D.23590 != 0) goto <D.23591>; else goto <D.23592>;
      <D.23591>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4246, "container");
      <D.23592>:
      sig = mono_signature_no_pinvoke (method);
      invoke_sig = sig;
      <D.23585>:
      <D.23583>:
      <D.23581>:
      if (ctx != 0B) goto <D.23593>; else goto <D.23594>;
      <D.23593>:
      D.23502 = method->klass;
      D.23595 = D.23502->image;
      D.23596 = &D.23595->delegate_invoke_generic_cache;
      cache = get_cache (D.23596, mono_aligned_addr_hash, 0B);
      res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx);
      if (res != 0B) goto <D.23597>; else goto <D.23598>;
      <D.23597>:
      D.23599 = res;
      return D.23599;
      <D.23598>:
      goto <D.23600>;
      <D.23594>:
      if (static_method_with_first_arg_bound != 0) goto <D.23601>; else goto <D.23602>;
      <D.23601>:
      D.23502 = method->klass;
      D.23595 = D.23502->image;
      D.23603 = &D.23595->delegate_bound_static_invoke_cache;
      cache = get_cache (D.23603, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, invoke_sig);
      if (res != 0B) goto <D.23604>; else goto <D.23605>;
      <D.23604>:
      D.23599 = res;
      return D.23599;
      <D.23605>:
      goto <D.23606>;
      <D.23602>:
      if (callvirt != 0) goto <D.23607>; else goto <D.23608>;
      <D.23607>:
      {
        struct GHashTable * * cache_ptr;

        D.23502 = method->klass;
        D.23595 = D.23502->image;
        cache_ptr = &D.23595->delegate_abstract_invoke_cache;
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23609>; else goto <D.23610>;
          <D.23609>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23610>:
          D.23611 = ret != 0;
          D.23612 = (long int) D.23611;
          D.23613 = __builtin_expect (D.23612, 0);
          if (D.23613 != 0) goto <D.23614>; else goto <D.23615>;
          <D.23614>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4275, "ret == 0");
          <D.23615>:
        }
        D.23616 = *cache_ptr;
        if (D.23616 == 0B) goto <D.23617>; else goto <D.23618>;
        <D.23617>:
        D.23619 = monoeg_g_hash_table_new_full (signature_method_pair_hash, signature_method_pair_equal, free_signature_method_pair, 0B);
        *cache_ptr = D.23619;
        <D.23618>:
        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.23620>; else goto <D.23621>;
          <D.23620>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23621>:
          D.23622 = ret != 0;
          D.23623 = (long int) D.23622;
          D.23624 = __builtin_expect (D.23623, 0);
          if (D.23624 != 0) goto <D.23625>; else goto <D.23626>;
          <D.23625>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4282, "ret == 0");
          <D.23626>:
        }
        if (res != 0B) goto <D.23627>; else goto <D.23628>;
        <D.23627>:
        D.23599 = res;
        return D.23599;
        <D.23628>:
      }
      goto <D.23629>;
      <D.23608>:
      D.23502 = method->klass;
      D.23595 = D.23502->image;
      D.23630 = &D.23595->delegate_invoke_cache;
      cache = get_cache (D.23630, mono_signature_hash, mono_metadata_signature_equal);
      res = mono_marshal_find_in_cache (cache, sig);
      if (res != 0B) goto <D.23631>; else goto <D.23632>;
      <D.23631>:
      D.23599 = res;
      return D.23599;
      <D.23632>:
      <D.23629>:
      <D.23606>:
      <D.23600>:
      D.23502 = method->klass;
      D.23595 = D.23502->image;
      static_sig = signature_dup (D.23595, sig);
      static_sig->hasthis = 0;
      if (static_method_with_first_arg_bound == 0) goto <D.23633>; else goto <D.23634>;
      <D.23633>:
      invoke_sig = static_sig;
      <D.23634>:
      if (static_method_with_first_arg_bound != 0) goto <D.23635>; else goto <D.23636>;
      <D.23635>:
      name = mono_signature_to_name (invoke_sig, "invoke_bound_");
      goto <D.23637>;
      <D.23636>:
      name = mono_signature_to_name (sig, "invoke");
      <D.23637>:
      if (ctx != 0B) goto <D.23638>; else goto <D.23639>;
      <D.23638>:
      D.23502 = method->klass;
      mb = mono_mb_new (D.23502, name, 1);
      goto <D.23640>;
      <D.23639>:
      D.23502 = method->klass;
      D.23595 = D.23502->image;
      D.23641 = get_wrapper_target_class (D.23595);
      mb = mono_mb_new (D.23641, name, 1);
      <D.23640>:
      monoeg_g_free (name);
      D.23642 = mono_defaults.object_class;
      D.23643 = &D.23642->byval_arg;
      local_target = mono_mb_add_local (mb, D.23643);
      D.23642 = mono_defaults.object_class;
      D.23643 = &D.23642->byval_arg;
      local_prev = mono_mb_add_local (mb, D.23643);
      D.23644 = BIT_FIELD_REF <*sig, 32, 64>;
      D.23645 = D.23644 & 4194304;
      D.23646 = D.23645 == 0;
      D.23647 = (long int) D.23646;
      D.23648 = __builtin_expect (D.23647, 0);
      if (D.23648 != 0) goto <D.23649>; else goto <D.23650>;
      <D.23649>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4314, "sig->hasthis");
      <D.23650>:
      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.23652 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.23652;
      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.19547>;
      <D.19546>:
      D.23653 = i + 1;
      D.23654 = (unsigned int) D.23653;
      mono_mb_emit_ldarg (mb, D.23654);
      i = i + 1;
      <D.19547>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      if (D.23564 > i) goto <D.19546>; else goto <D.19548>;
      <D.19548>:
      if (ctx != 0B) goto <D.23655>; else goto <D.23656>;
      <D.23655>:
      D.23657 = &container->context;
      D.23658 = mono_class_inflate_generic_method (method, D.23657);
      mono_mb_emit_op (mb, 111, D.23658);
      goto <D.23659>;
      <D.23656>:
      mono_mb_emit_op (mb, 111, method);
      <D.23659>:
      D.23660 = sig->ret;
      D.23661 = D.23660->type;
      if (D.23661 != 1) goto <D.23662>; else goto <D.23663>;
      <D.23662>:
      mono_mb_emit_byte (mb, 38);
      <D.23663>:
      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.23666>; else goto <D.23667>;
      <D.23666>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.23668 = mono_mb_emit_branch (mb, 57);
      pos0 = (int) D.23668;
      if (callvirt != 0) goto <D.23669>; else goto <D.23670>;
      <D.23669>:
      mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
      goto <D.23671>;
      <D.23670>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      i = 0;
      goto <D.19550>;
      <D.19549>:
      D.23653 = i + 1;
      D.23654 = (unsigned int) D.23653;
      mono_mb_emit_ldarg (mb, D.23654);
      i = i + 1;
      <D.19550>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      if (D.23564 > i) goto <D.19549>; else goto <D.19551>;
      <D.19551>:
      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.23671>:
      pos0.146 = (unsigned int) pos0;
      mono_mb_patch_branch (mb, pos0.146);
      <D.23667>:
      if (callvirt != 0) goto <D.23672>; else goto <D.23673>;
      <D.23672>:
      if (closed_over_null == 0) goto <D.23674>; else goto <D.23675>;
      <D.23674>:
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_op (mb, 116, target_class);
      i = 1;
      goto <D.19553>;
      <D.19552>:
      D.23653 = i + 1;
      D.23654 = (unsigned int) D.23653;
      mono_mb_emit_ldarg (mb, D.23654);
      i = i + 1;
      <D.19553>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      if (D.23564 > i) goto <D.19552>; else goto <D.19554>;
      <D.19554>:
      mono_mb_emit_op (mb, 111, target_method);
      goto <D.23676>;
      <D.23675>:
      mono_mb_emit_byte (mb, 20);
      i = 0;
      goto <D.19556>;
      <D.19555>:
      D.23653 = i + 1;
      D.23654 = (unsigned int) D.23653;
      mono_mb_emit_ldarg (mb, D.23654);
      i = i + 1;
      <D.19556>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      if (D.23564 > i) goto <D.19555>; else goto <D.19557>;
      <D.19557>:
      mono_mb_emit_op (mb, 40, target_method);
      <D.23676>:
      goto <D.23677>;
      <D.23673>:
      if (static_method_with_first_arg_bound != 0) goto <D.23678>; else goto <D.23679>;
      <D.23678>:
      local_target.147 = (unsigned int) local_target;
      mono_mb_emit_ldloc (mb, local_target.147);
      D.23680 = invoke_sig->params[0];
      D.23681 = mono_type_is_reference (D.23680);
      if (D.23681 == 0) goto <D.23682>; else goto <D.23683>;
      <D.23682>:
      D.23680 = invoke_sig->params[0];
      D.23684 = mono_class_from_mono_type (D.23680);
      mono_mb_emit_op (mb, 165, D.23684);
      <D.23683>:
      <D.23679>:
      i = 0;
      goto <D.19559>;
      <D.19558>:
      D.23653 = i + 1;
      D.23654 = (unsigned int) D.23653;
      mono_mb_emit_ldarg (mb, D.23654);
      i = i + 1;
      <D.19559>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      if (D.23564 > i) goto <D.19558>; else goto <D.19560>;
      <D.19560>:
      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.23677>:
      mono_mb_emit_byte (mb, 42);
      mb->skip_visibility = 1;
      if (ctx != 0B) goto <D.23685>; else goto <D.23686>;
      <D.23685>:
      {
        struct MonoMethod * def;

        D.23502 = method->klass;
        D.23553 = sig->param_count;
        D.23564 = (int) D.23553;
        D.23687 = D.23564 + 16;
        def = mono_mb_create_and_cache (cache, D.23502, mb, sig, D.23687);
        res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
      }
      goto <D.23688>;
      <D.23686>:
      if (static_method_with_first_arg_bound != 0) goto <D.23689>; else goto <D.23690>;
      <D.23689>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      D.23687 = D.23564 + 16;
      res = mono_mb_create_and_cache (cache, invoke_sig, mb, sig, D.23687);
      info = mono_wrapper_info_create (res, 23);
      mono_marshal_set_wrapper_info (res, info);
      goto <D.23691>;
      <D.23690>:
      if (callvirt != 0) goto <D.23692>; else goto <D.23693>;
      <D.23692>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      D.23687 = D.23564 + 16;
      newm = mono_mb_create_method (mb, sig, D.23687);
      mono_memory_barrier ();
      {
        int ret;

        ret = pthread_mutex_lock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23694>; else goto <D.23695>;
        <D.23694>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.23695>:
        D.23696 = ret != 0;
        D.23697 = (long int) D.23696;
        D.23698 = __builtin_expect (D.23697, 0);
        if (D.23698 != 0) goto <D.23699>; else goto <D.23700>;
        <D.23699>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4432, "ret == 0");
        <D.23700>:
      }
      res = monoeg_g_hash_table_lookup (cache, &key);
      if (res == 0B) goto <D.23701>; else goto <D.23702>;
      <D.23701>:
      res = newm;
      new_key = monoeg_malloc0 (8);
      *new_key = key;
      if (static_method_with_first_arg_bound != 0) goto <D.23703>; else goto <D.23704>;
      <D.23703>:
      D.23474 = del->method;
      D.23705 = D.23474->klass;
      D.23706 = D.23705->image;
      D.23707 = key.sig;
      D.23708 = signature_dup (D.23706, D.23707);
      new_key->sig = D.23708;
      <D.23704>:
      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.23709>; else goto <D.23710>;
        <D.23709>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.23710>:
        D.23711 = ret != 0;
        D.23712 = (long int) D.23711;
        D.23713 = __builtin_expect (D.23712, 0);
        if (D.23713 != 0) goto <D.23714>; else goto <D.23715>;
        <D.23714>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4445, "ret == 0");
        <D.23715>:
      }
      goto <D.23716>;
      <D.23702>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.23717>; else goto <D.23718>;
        <D.23717>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.23718>:
        D.23719 = ret != 0;
        D.23720 = (long int) D.23719;
        D.23721 = __builtin_expect (D.23720, 0);
        if (D.23721 != 0) goto <D.23722>; else goto <D.23723>;
        <D.23722>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4447, "ret == 0");
        <D.23723>:
      }
      mono_free_method (newm);
      <D.23716>:
      goto <D.23724>;
      <D.23693>:
      D.23553 = sig->param_count;
      D.23564 = (int) D.23553;
      D.23687 = D.23564 + 16;
      res = mono_mb_create_and_cache (cache, sig, mb, sig, D.23687);
      info = mono_wrapper_info_create (res, 0);
      mono_marshal_set_wrapper_info (res, info);
      <D.23724>:
      <D.23691>:
      <D.23688>:
      mono_mb_free (mb);
      D.23599 = res;
      return D.23599;
    }
  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.23727;
  int iftmp.148;
  struct MonoMethodSignature * D.23731;
  struct MonoMethodSignature * D.23732;
  int D.23733;
  struct MonoMethod * D.23735;
  struct MonoMethod * D.23736;

  D.23731 = pair1->sig;
  D.23732 = pair2->sig;
  D.23733 = mono_metadata_signature_equal (D.23731, D.23732);
  if (D.23733 != 0) goto <D.23734>; else goto <D.23729>;
  <D.23734>:
  D.23735 = pair1->method;
  D.23736 = pair2->method;
  if (D.23735 == D.23736) goto <D.23737>; else goto <D.23729>;
  <D.23737>:
  iftmp.148 = 1;
  goto <D.23730>;
  <D.23729>:
  iftmp.148 = 0;
  <D.23730>:
  D.23727 = iftmp.148;
  return D.23727;
}


signature_method_pair_hash (const void * data)
{
  guint D.23739;
  struct MonoMethodSignature * D.23740;
  unsigned int D.23741;
  struct MonoMethod * D.23742;
  unsigned int D.23743;
  struct SignatureMethodPair * pair;

  pair = data;
  D.23740 = pair->sig;
  D.23741 = mono_signature_hash (D.23740);
  D.23742 = pair->method;
  D.23743 = mono_aligned_addr_hash (D.23742);
  D.23739 = D.23741 ^ D.23743;
  return D.23739;
}


mono_wrapper_info_create (struct MonoMethod * wrapper, WrapperSubtype subtype)
{
  struct MonoClass * D.23745;
  struct MonoImage * D.23746;
  struct WrapperInfo * D.23747;
  struct WrapperInfo * info;

  D.23745 = wrapper->klass;
  D.23746 = D.23745->image;
  info = mono_image_alloc0 (D.23746, 12);
  info->subtype = subtype;
  D.23747 = info;
  return D.23747;
}


mono_marshal_get_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoMethodSignature * D.23749;
  struct MonoMethodSignature * D.23752;
  struct MonoMethodSignature * sig;

  D.23749 = mono_method_signature (method);
  sig = lookup_string_ctor_signature (D.23749);
  if (sig == 0B) goto <D.23750>; else goto <D.23751>;
  <D.23750>:
  sig = add_string_ctor_signature (method);
  <D.23751>:
  D.23752 = sig;
  return D.23752;
}


lookup_string_ctor_signature (struct MonoMethodSignature * sig)
{
  _Bool D.23756;
  long int D.23757;
  long int D.23758;
  struct MonoMethodSignature * D.23761;
  int D.23762;
  _Bool D.23767;
  long int D.23768;
  long int D.23769;
  struct MonoMethodSignature * D.23772;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;
  struct GSList * item;

  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23754>; else goto <D.23755>;
    <D.23754>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23755>:
    D.23756 = ret != 0;
    D.23757 = (long int) D.23756;
    D.23758 = __builtin_expect (D.23757, 0);
    if (D.23758 != 0) goto <D.23759>; else goto <D.23760>;
    <D.23759>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4498, "ret == 0");
    <D.23760>:
  }
  callsig = 0B;
  item = strsig_list;
  goto <D.19589>;
  <D.19588>:
  cs = item->data;
  D.23761 = cs->ctor_sig;
  D.23762 = mono_metadata_signature_equal (sig, D.23761);
  if (D.23762 != 0) goto <D.23763>; else goto <D.23764>;
  <D.23763>:
  callsig = cs->sig;
  goto <D.19587>;
  <D.23764>:
  item = item->next;
  <D.19589>:
  if (item != 0B) goto <D.19588>; else goto <D.19587>;
  <D.19587>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23765>; else goto <D.23766>;
    <D.23765>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23766>:
    D.23767 = ret != 0;
    D.23768 = (long int) D.23767;
    D.23769 = __builtin_expect (D.23768, 0);
    if (D.23769 != 0) goto <D.23770>; else goto <D.23771>;
    <D.23770>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4510, "ret == 0");
    <D.23771>:
  }
  D.23772 = callsig;
  return D.23772;
}


add_string_ctor_signature (struct MonoMethod * method)
{
  struct MonoClass * D.23774;
  struct MonoImage * D.23775;
  struct MonoMethodSignature * D.23776;
  struct MonoClass * D.23777;
  struct MonoType * D.23778;
  struct MonoMethodSignature * D.23779;
  _Bool D.23782;
  long int D.23783;
  long int D.23784;
  struct GSList * strsig_list.149;
  struct GSList * strsig_list.150;
  _Bool D.23791;
  long int D.23792;
  long int D.23793;
  struct MonoMethodSignature * D.23796;
  struct MonoMethodSignature * callsig;
  struct CtorSigPair * cs;

  D.23774 = method->klass;
  D.23775 = D.23774->image;
  D.23776 = mono_method_signature (method);
  callsig = signature_dup (D.23775, D.23776);
  D.23777 = mono_defaults.string_class;
  D.23778 = &D.23777->byval_arg;
  callsig->ret = D.23778;
  cs = monoeg_malloc (8);
  cs->sig = callsig;
  D.23779 = mono_method_signature (method);
  cs->ctor_sig = D.23779;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.23780>; else goto <D.23781>;
    <D.23780>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.23781>:
    D.23782 = ret != 0;
    D.23783 = (long int) D.23782;
    D.23784 = __builtin_expect (D.23783, 0);
    if (D.23784 != 0) goto <D.23785>; else goto <D.23786>;
    <D.23785>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4526, "ret == 0");
    <D.23786>:
  }
  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.23789>; else goto <D.23790>;
    <D.23789>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.23790>:
    D.23791 = ret != 0;
    D.23792 = (long int) D.23791;
    D.23793 = __builtin_expect (D.23792, 0);
    if (D.23793 != 0) goto <D.23794>; else goto <D.23795>;
    <D.23794>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4528, "ret == 0");
    <D.23795>:
  }
  D.23796 = callsig;
  return D.23796;
}


mono_marshal_get_runtime_invoke (struct MonoMethod * method, gboolean virtual)
{
  _Bool D.23798;
  long int D.23799;
  long int D.23800;
  struct MonoMethodSignature * cctor_signature.151;
  struct MonoImage * D.23806;
  struct MonoMethodSignature * cctor_signature.152;
  struct MonoClass * D.23808;
  struct MonoType * D.23809;
  struct MonoMethodSignature * finalize_signature.153;
  struct MonoMethodSignature * finalize_signature.154;
  struct MonoClass * D.23818;
  struct MonoImage * D.23819;
  struct GHashTable * * D.23820;
  struct GHashTable * * D.23822;
  struct MonoMethod * D.23825;
  unsigned char D.23826;
  short unsigned int D.23829;
  unsigned int D.23830;
  unsigned int D.23831;
  unsigned int D.23834;
  unsigned int D.23835;
  struct MonoMethodSignature * D.23838;
  unsigned int D.23842;
  struct MonoMethodSignature * D.23845;
  int D.23847;
  int D.23851;
  unsigned int D.23859;
  unsigned int D.23860;
  struct MonoMethodSignature * D.23862;
  unsigned int D.23863;
  unsigned int D.23864;
  struct MonoImage * D.23866;
  struct GHashTable * * D.23867;
  struct GHashTable * * D.23868;
  _Bool D.23871;
  long int D.23872;
  long int D.23873;
  _Bool D.23878;
  long int D.23879;
  long int D.23880;
  struct MonoClass * D.23885;
  struct MonoType * D.23886;
  struct MonoMethodSignature * D.23890;
  unsigned int D.23891;
  unsigned int D.23892;
  struct MonoType * D.23894;
  struct MonoType * D.23895;
  struct MonoClass * D.23896;
  struct MonoType * D.23897;
  const char * iftmp.155;
  short unsigned int D.23904;
  int D.23905;
  int D.23906;
  WrapperSubtype iftmp.156;
  _Bool D.23914;
  long int D.23915;
  long int D.23916;
  _Bool D.23921;
  long int D.23922;
  long int D.23923;
  _Bool D.23930;
  long int D.23931;
  long int D.23932;
  struct GHashTable * D.23937;
  _Bool D.23941;
  long int D.23942;
  long int D.23943;
  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.23798 = method == 0B;
      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", 4932, "method");
      <D.23802>:
      cctor_signature.151 = cctor_signature;
      if (cctor_signature.151 == 0B) goto <D.23804>; else goto <D.23805>;
      <D.23804>:
      D.23806 = mono_defaults.corlib;
      cctor_signature.152 = mono_metadata_signature_alloc (D.23806, 0);
      cctor_signature = cctor_signature.152;
      cctor_signature.151 = cctor_signature;
      D.23808 = mono_defaults.void_class;
      D.23809 = &D.23808->byval_arg;
      cctor_signature.151->ret = D.23809;
      <D.23805>:
      finalize_signature.153 = finalize_signature;
      if (finalize_signature.153 == 0B) goto <D.23811>; else goto <D.23812>;
      <D.23811>:
      D.23806 = mono_defaults.corlib;
      finalize_signature.154 = mono_metadata_signature_alloc (D.23806, 0);
      finalize_signature = finalize_signature.154;
      finalize_signature.153 = finalize_signature;
      D.23808 = mono_defaults.void_class;
      D.23809 = &D.23808->byval_arg;
      finalize_signature.153->ret = D.23809;
      finalize_signature.153 = finalize_signature;
      finalize_signature.153->hasthis = 1;
      <D.23812>:
      if (virtual != 0) goto <D.23814>; else goto <D.23815>;
      <D.23814>:
      need_direct_wrapper = 1;
      <D.23815>:
      if (virtual != 0) goto <D.23816>; else goto <D.23817>;
      <D.23816>:
      D.23818 = method->klass;
      D.23819 = D.23818->image;
      D.23820 = &D.23819->runtime_invoke_vcall_cache;
      cache = get_cache (D.23820, mono_aligned_addr_hash, 0B);
      goto <D.23821>;
      <D.23817>:
      D.23818 = method->klass;
      D.23819 = D.23818->image;
      D.23822 = &D.23819->runtime_invoke_direct_cache;
      cache = get_cache (D.23822, mono_aligned_addr_hash, 0B);
      <D.23821>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.23823>; else goto <D.23824>;
      <D.23823>:
      D.23825 = res;
      return D.23825;
      <D.23824>:
      D.23818 = method->klass;
      D.23826 = D.23818->rank;
      if (D.23826 != 0) goto <D.23827>; else goto <D.23828>;
      <D.23827>:
      D.23829 = method->iflags;
      D.23830 = (unsigned int) D.23829;
      D.23831 = D.23830 & 4097;
      if (D.23831 == 4097) goto <D.23832>; else goto <D.23833>;
      <D.23832>:
      need_direct_wrapper = 1;
      <D.23833>:
      <D.23828>:
      D.23834 = BIT_FIELD_REF <*method, 32, 160>;
      D.23835 = D.23834 & 128;
      if (D.23835 != 0) goto <D.23836>; else goto <D.23837>;
      <D.23836>:
      D.23838 = mono_method_signature (method);
      callsig = lookup_string_ctor_signature (D.23838);
      if (callsig == 0B) goto <D.23839>; else goto <D.23840>;
      <D.23839>:
      callsig = add_string_ctor_signature (method);
      <D.23840>:
      need_direct_wrapper = 1;
      goto <D.23841>;
      <D.23837>:
      D.23834 = BIT_FIELD_REF <*method, 32, 160>;
      D.23842 = D.23834 & 512;
      if (D.23842 != 0) goto <D.23843>; else goto <D.23844>;
      <D.23843>:
      D.23818 = method->klass;
      D.23819 = D.23818->image;
      D.23845 = mono_method_signature (method);
      callsig = signature_dup (D.23819, D.23845);
      goto <D.23846>;
      <D.23844>:
      callsig = mono_method_signature (method);
      <D.23846>:
      <D.23841>:
      D.23818 = method->klass;
      D.23819 = D.23818->image;
      target_klass = get_wrapper_target_class (D.23819);
      cctor_signature.151 = cctor_signature;
      D.23847 = mono_metadata_signature_equal (callsig, cctor_signature.151);
      if (D.23847 != 0) goto <D.23848>; else goto <D.23849>;
      <D.23848>:
      callsig = cctor_signature;
      target_klass = mono_defaults.object_class;
      goto <D.23850>;
      <D.23849>:
      finalize_signature.153 = finalize_signature;
      D.23851 = mono_metadata_signature_equal (callsig, finalize_signature.153);
      if (D.23851 != 0) goto <D.23852>; else goto <D.23853>;
      <D.23852>:
      callsig = finalize_signature;
      target_klass = mono_defaults.object_class;
      <D.23853>:
      <D.23850>:
      if (need_direct_wrapper != 0) goto <D.23854>; else goto <D.23855>;
      <D.23854>:
      goto <D.23856>;
      <D.23855>:
      {
        struct MonoMethodSignature * tmp_sig;

        callsig = mono_marshal_get_runtime_invoke_sig (callsig);
        D.23818 = method->klass;
        D.23859 = BIT_FIELD_REF <*D.23818, 32, 160>;
        D.23860 = D.23859 & 8;
        if (D.23860 != 0) goto <D.23861>; else goto <D.23857>;
        <D.23861>:
        D.23862 = mono_method_signature (method);
        D.23863 = BIT_FIELD_REF <*D.23862, 32, 64>;
        D.23864 = D.23863 & 4194304;
        if (D.23864 != 0) goto <D.23865>; else goto <D.23857>;
        <D.23865>:
        D.23866 = target_klass->image;
        D.23867 = &D.23866->runtime_invoke_vtype_cache;
        cache = get_cache (D.23867, mono_signature_hash, runtime_invoke_signature_equal);
        goto <D.23858>;
        <D.23857>:
        D.23866 = target_klass->image;
        D.23868 = &D.23866->runtime_invoke_cache;
        cache = get_cache (D.23868, mono_signature_hash, runtime_invoke_signature_equal);
        <D.23858>:
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23869>; else goto <D.23870>;
          <D.23869>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23870>:
          D.23871 = ret != 0;
          D.23872 = (long int) D.23871;
          D.23873 = __builtin_expect (D.23872, 0);
          if (D.23873 != 0) goto <D.23874>; else goto <D.23875>;
          <D.23874>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5010, "ret == 0");
          <D.23875>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23876>; else goto <D.23877>;
          <D.23876>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23877>:
          D.23878 = ret != 0;
          D.23879 = (long int) D.23878;
          D.23880 = __builtin_expect (D.23879, 0);
          if (D.23880 != 0) goto <D.23881>; else goto <D.23882>;
          <D.23881>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5012, "ret == 0");
          <D.23882>:
        }
        if (res != 0B) goto <D.23883>; else goto <D.23884>;
        <D.23883>:
        monoeg_g_free (callsig);
        D.23825 = res;
        return D.23825;
        <D.23884>:
        tmp_sig = callsig;
        D.23866 = target_klass->image;
        callsig = mono_metadata_signature_dup_full (D.23866, callsig);
        monoeg_g_free (tmp_sig);
      }
      <D.23856>:
      sig = mono_method_signature (method);
      D.23866 = target_klass->image;
      csig = mono_metadata_signature_alloc (D.23866, 4);
      D.23885 = mono_defaults.object_class;
      D.23886 = &D.23885->byval_arg;
      csig->ret = D.23886;
      D.23818 = method->klass;
      D.23859 = BIT_FIELD_REF <*D.23818, 32, 160>;
      D.23860 = D.23859 & 8;
      if (D.23860 != 0) goto <D.23889>; else goto <D.23887>;
      <D.23889>:
      D.23890 = mono_method_signature (method);
      D.23891 = BIT_FIELD_REF <*D.23890, 32, 64>;
      D.23892 = D.23891 & 4194304;
      if (D.23892 != 0) goto <D.23893>; else goto <D.23887>;
      <D.23893>:
      D.23818 = method->klass;
      D.23894 = &D.23818->this_arg;
      D.23895 = get_runtime_invoke_type (D.23894, 0);
      csig->params[0] = D.23895;
      goto <D.23888>;
      <D.23887>:
      D.23885 = mono_defaults.object_class;
      D.23886 = &D.23885->byval_arg;
      csig->params[0] = D.23886;
      <D.23888>:
      D.23896 = mono_defaults.int_class;
      D.23897 = &D.23896->byval_arg;
      csig->params[1] = D.23897;
      D.23896 = mono_defaults.int_class;
      D.23897 = &D.23896->byval_arg;
      csig->params[2] = D.23897;
      D.23896 = mono_defaults.int_class;
      D.23897 = &D.23896->byval_arg;
      csig->params[3] = D.23897;
      csig->pinvoke = 1;
      if (virtual != 0) goto <D.23899>; else goto <D.23900>;
      <D.23899>:
      iftmp.155 = "runtime_invoke_virtual";
      goto <D.23901>;
      <D.23900>:
      iftmp.155 = "runtime_invoke";
      <D.23901>:
      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.23902>; else goto <D.23903>;
      <D.23902>:
      mb->skip_visibility = 1;
      D.23904 = sig->param_count;
      D.23905 = (int) D.23904;
      D.23906 = D.23905 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.23906);
      if (virtual != 0) goto <D.23908>; else goto <D.23909>;
      <D.23908>:
      iftmp.156 = 14;
      goto <D.23910>;
      <D.23909>:
      iftmp.156 = 13;
      <D.23910>:
      info = mono_wrapper_info_create (res, iftmp.156);
      info->d.runtime_invoke.method = method;
      mono_marshal_set_wrapper_info (res, info);
      goto <D.23911>;
      <D.23903>:
      {
        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", 5067, "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", 5069, "ret == 0");
        <D.23925>:
      }
      if (res == 0B) goto <D.23926>; else goto <D.23927>;
      <D.23926>:
      {
        struct MonoMethod * newm;

        D.23904 = sig->param_count;
        D.23905 = (int) D.23904;
        D.23906 = D.23905 + 16;
        newm = mono_mb_create_method (mb, csig, D.23906);
        {
          int ret;

          ret = pthread_mutex_lock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23928>; else goto <D.23929>;
          <D.23928>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
          <D.23929>:
          D.23930 = ret != 0;
          D.23931 = (long int) D.23930;
          D.23932 = __builtin_expect (D.23931, 0);
          if (D.23932 != 0) goto <D.23933>; else goto <D.23934>;
          <D.23933>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5076, "ret == 0");
          <D.23934>:
        }
        res = monoeg_g_hash_table_lookup (cache, callsig);
        if (res == 0B) goto <D.23935>; else goto <D.23936>;
        <D.23935>:
        res = newm;
        monoeg_g_hash_table_insert_replace (cache, callsig, res, 0);
        D.23818 = method->klass;
        D.23819 = D.23818->image;
        D.23937 = D.23819->runtime_invoke_direct_cache;
        monoeg_g_hash_table_insert_replace (D.23937, 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.23938>;
        <D.23936>:
        mono_free_method (newm);
        <D.23938>:
        {
          int ret;

          ret = pthread_mutex_unlock (&marshal_mutex.mutex);
          if (ret != 0) goto <D.23939>; else goto <D.23940>;
          <D.23939>:
          monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
          <D.23940>:
          D.23941 = ret != 0;
          D.23942 = (long int) D.23941;
          D.23943 = __builtin_expect (D.23942, 0);
          if (D.23943 != 0) goto <D.23944>; else goto <D.23945>;
          <D.23944>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5089, "ret == 0");
          <D.23945>:
        }
      }
      <D.23927>:
      <D.23911>:
      mono_mb_free (mb);
      D.23825 = res;
      return D.23825;
    }
  finally
    {
      param_names = {CLOBBER};
    }
}


runtime_invoke_signature_equal (struct MonoMethodSignature * sig1, struct MonoMethodSignature * sig2)
{
  struct MonoType * D.23950;
  struct MonoType * D.23951;
  int D.23953;
  int D.23955;
  int D.23956;
  gboolean D.23958;

  D.23950 = sig1->ret;
  D.23951 = sig2->ret;
  if (D.23950 != D.23951) goto <D.23952>; else goto <D.23948>;
  <D.23952>:
  D.23950 = sig1->ret;
  D.23953 = mono_type_is_reference (D.23950);
  if (D.23953 == 0) goto <D.23949>; else goto <D.23954>;
  <D.23954>:
  D.23951 = sig2->ret;
  D.23955 = mono_type_is_reference (D.23951);
  if (D.23955 == 0) goto <D.23949>; else goto <D.23948>;
  <D.23949>:
  D.23950 = sig1->ret;
  D.23951 = sig2->ret;
  D.23956 = mono_metadata_type_equal (D.23950, D.23951);
  if (D.23956 == 0) goto <D.23957>; else goto <D.23948>;
  <D.23957>:
  D.23958 = 0;
  return D.23958;
  <D.23948>:
  D.23958 = mono_metadata_signature_equal (sig1, sig2);
  return D.23958;
}


mono_marshal_get_runtime_invoke_sig (struct MonoMethodSignature * sig)
{
  struct MonoType * D.23960;
  struct MonoType * D.23961;
  struct MonoType * D.23962;
  struct MonoType * D.23963;
  short unsigned int D.23964;
  int D.23965;
  struct MonoMethodSignature * D.23966;
  struct MonoMethodSignature * res;
  int i;

  res = mono_metadata_signature_dup (sig);
  D.23960 = sig->ret;
  D.23961 = get_runtime_invoke_type (D.23960, 1);
  res->ret = D.23961;
  i = 0;
  goto <D.19620>;
  <D.19619>:
  D.23962 = sig->params[i];
  D.23963 = get_runtime_invoke_type (D.23962, 0);
  res->params[i] = D.23963;
  i = i + 1;
  <D.19620>:
  D.23964 = res->param_count;
  D.23965 = (int) D.23964;
  if (D.23965 > i) goto <D.19619>; else goto <D.19621>;
  <D.19621>:
  D.23966 = res;
  return D.23966;
}


get_runtime_invoke_type (struct MonoType * t, gboolean ret)
{
  unsigned int D.23968;
  unsigned int D.23969;
  unsigned char D.23972;
  struct MonoClass * D.23975;
  int D.23976;
  struct MonoType * D.23979;
  struct MonoClass * D.23980;
  int D.23981;
  struct MonoClass * D.23984;
  int D.23987;
  struct MonoClass * D.23988;
  struct MonoClass * D.23989;
  struct MonoClass * D.23990;
  struct MonoClass * D.23991;
  unsigned int D.23992;
  unsigned int D.23993;
  void handle_enum = <<< error >>>;

  D.23968 = BIT_FIELD_REF <*t, 32, 32>;
  D.23969 = D.23968 & 1073741824;
  if (D.23969 != 0) goto <D.23970>; else goto <D.23971>;
  <D.23970>:
  D.23972 = t->type;
  if (D.23972 == 21) goto <D.23973>; else goto <D.23974>;
  <D.23973>:
  D.23975 = mono_class_from_mono_type (t);
  D.23976 = mono_class_is_nullable (D.23975);
  if (D.23976 != 0) goto <D.23977>; else goto <D.23978>;
  <D.23977>:
  D.23979 = t;
  return D.23979;
  <D.23978>:
  <D.23974>:
  D.23980 = mono_defaults.int_class;
  D.23979 = &D.23980->this_arg;
  return D.23979;
  <D.23971>:
  D.23981 = mono_type_is_reference (t);
  if (D.23981 != 0) goto <D.23982>; else goto <D.23983>;
  <D.23982>:
  D.23984 = mono_defaults.object_class;
  D.23979 = &D.23984->byval_arg;
  return D.23979;
  <D.23983>:
  if (ret != 0) goto <D.23985>; else goto <D.23986>;
  <D.23985>:
  D.23979 = t;
  return D.23979;
  <D.23986>:
  handle_enum:
  D.23972 = t->type;
  D.23987 = (int) D.23972;
  switch (D.23987) <default: <D.19613>, case 2: <D.19608>, case 3: <D.19609>, case 11: <D.19607>, case 15: <D.19611>, case 17: <D.19612>, case 25: <D.19610>>
  <D.19607>:
  D.23988 = mono_defaults.int64_class;
  D.23979 = &D.23988->byval_arg;
  return D.23979;
  <D.19608>:
  D.23989 = mono_defaults.byte_class;
  D.23979 = &D.23989->byval_arg;
  return D.23979;
  <D.19609>:
  D.23990 = mono_defaults.uint16_class;
  D.23979 = &D.23990->byval_arg;
  return D.23979;
  <D.19610>:
  <D.19611>:
  D.23980 = mono_defaults.int_class;
  D.23979 = &D.23980->byval_arg;
  return D.23979;
  <D.19612>:
  D.23991 = t->data.klass;
  D.23992 = BIT_FIELD_REF <*D.23991, 32, 160>;
  D.23993 = D.23992 & 16;
  if (D.23993 != 0) goto <D.23994>; else goto <D.23995>;
  <D.23994>:
  D.23991 = t->data.klass;
  t = mono_class_enum_basetype (D.23991);
  goto handle_enum;
  <D.23995>:
  D.23979 = t;
  return D.23979;
  <D.19613>:
  D.23979 = t;
  return D.23979;
}


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.23997;
  struct MonoType * D.23998;
  unsigned int D.23999;
  int D.24000;
  int D.24001;
  unsigned int D.24002;
  int D.24003;
  struct MonoImage * D.24004;
  struct MonoClass * D.24005;
  int D.24006;
  unsigned int D.24007;
  int D.24008;
  int D.24009;
  unsigned int D.24010;
  int D.24011;
  unsigned int D.24012;
  unsigned int loc_exc.157;
  int D.24014;
  unsigned int D.24015;
  unsigned int D.24016;
  unsigned int D.24017;
  int D.24018;
  unsigned int D.24019;
  unsigned int loc_res.158;
  int D.24021;
  unsigned int D.24022;
  gint32 labels[16];
  struct MonoExceptionClause * clause;
  int loc_res;
  int loc_exc;

  try
    {
      D.23997 = mono_defaults.object_class;
      D.23998 = &D.23997->byval_arg;
      loc_res = mono_mb_add_local (mb, D.23998);
      D.23997 = mono_defaults.object_class;
      D.23998 = &D.23997->byval_arg;
      loc_exc = mono_mb_add_local (mb, D.23998);
      mono_mb_emit_byte (mb, 4);
      D.23999 = mono_mb_emit_branch (mb, 57);
      D.24000 = (int) D.23999;
      labels[0] = D.24000;
      D.24001 = mono_mb_get_label (mb);
      labels[1] = D.24001;
      emit_thread_force_interrupt_checkpoint (mb);
      emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper);
      D.24002 = mono_mb_emit_branch (mb, 221);
      D.24003 = (int) D.24002;
      labels[2] = D.24003;
      D.24004 = target_klass->image;
      clause = mono_image_alloc0 (D.24004, 24);
      clause->flags = 0;
      D.24005 = mono_defaults.exception_class;
      clause->data.catch_class = D.24005;
      D.24006 = labels[1];
      D.24007 = (unsigned int) D.24006;
      clause->try_offset = D.24007;
      D.24008 = mono_mb_get_label (mb);
      D.24006 = labels[1];
      D.24009 = D.24008 - D.24006;
      D.24010 = (unsigned int) D.24009;
      clause->try_len = D.24010;
      D.24011 = mono_mb_get_label (mb);
      D.24012 = (unsigned int) D.24011;
      clause->handler_offset = D.24012;
      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.24014 = mono_mb_get_pos (mb);
      D.24015 = (unsigned int) D.24014;
      D.24016 = clause->handler_offset;
      D.24017 = D.24015 - D.24016;
      clause->handler_len = D.24017;
      mono_mb_set_clauses (mb, 1, clause);
      D.24018 = labels[2];
      D.24019 = (unsigned int) D.24018;
      mono_mb_patch_branch (mb, D.24019);
      loc_res.158 = (unsigned int) loc_res;
      mono_mb_emit_ldloc (mb, loc_res.158);
      mono_mb_emit_byte (mb, 42);
      D.24021 = labels[0];
      D.24022 = (unsigned int) D.24021;
      mono_mb_patch_branch (mb, D.24022);
      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.24028;
  struct MonoString * string_dummy.160;
  unsigned int D.24032;
  unsigned int D.24033;
  _Bool D.24034;
  long int D.24035;
  long int D.24036;
  short unsigned int D.24039;
  int D.24040;
  int D.24041;
  _Bool D.24042;
  long int D.24043;
  long int D.24044;
  unsigned int D.24049;
  unsigned int D.24050;
  int D.24053;
  short unsigned int D.24058;
  unsigned int D.24059;
  unsigned int D.24060;
  unsigned int i.161;
  unsigned int D.24064;
  int D.24065;
  unsigned int D.24066;
  unsigned int D.24067;
  unsigned char D.24070;
  struct MonoClass * D.24073;
  int D.24074;
  int * D.24077;
  struct MonoClass * D.24078;
  struct MonoType * D.24079;
  int D.24080;
  struct MonoClass * D.24081;
  int D.24082;
  unsigned int D.24083;
  struct MonoType * D.24084;
  unsigned char D.24085;
  unsigned int D.24086;
  unsigned char D.24087;
  int D.24088;
  unsigned int D.24089;
  unsigned char D.24090;
  int D.24091;
  int D.24092;
  unsigned int D.24095;
  unsigned char D.24096;
  int D.24097;
  struct MonoClass * D.24100;
  unsigned int D.24101;
  unsigned int D.24102;
  struct MonoType * D.24105;
  unsigned char D.24106;
  struct MonoClass * D.24107;
  int D.24108;
  struct MonoClass * D.24111;
  struct MonoClass * D.24112;
  struct MonoClass * D.24114;
  int D.24115;
  struct MonoType * D.24122;
  unsigned int D.24123;
  unsigned int D.24124;
  unsigned char D.24127;
  int D.24128;
  struct MonoClass * D.24131;
  struct MonoClass * D.24132;
  unsigned int loc_res.162;
  unsigned int D.24136;
  unsigned int D.24137;
  struct MonoClass * D.24140;
  int D.24141;
  struct MonoClass * D.24144;
  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.24024>; else goto <D.24025>;
  <D.24024>:
  if (0 != 0) goto <D.24026>; else goto <D.24027>;
  <D.24026>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4644, "sizeof (string_dummy) == sizeof (MonoObject*)");
  <D.24027>:
  D.24028 = mono_gc_make_root_descr_all_refs (1);
  mono_gc_register_root (&string_dummy, 4, D.24028);
  string_dummy.160 = mono_string_new_wrapper ("dummy");
  string_dummy = string_dummy.160;
  <D.24025>:
  if (virtual != 0) goto <D.24030>; else goto <D.24031>;
  <D.24030>:
  D.24032 = BIT_FIELD_REF <*sig, 32, 64>;
  D.24033 = D.24032 & 4194304;
  D.24034 = D.24033 == 0;
  D.24035 = (long int) D.24034;
  D.24036 = __builtin_expect (D.24035, 0);
  if (D.24036 != 0) goto <D.24037>; else goto <D.24038>;
  <D.24037>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4649, "sig->hasthis");
  <D.24038>:
  D.24039 = method->flags;
  D.24040 = (int) D.24039;
  D.24041 = D.24040 & 64;
  D.24042 = D.24041 == 0;
  D.24043 = (long int) D.24042;
  D.24044 = __builtin_expect (D.24043, 0);
  if (D.24044 != 0) goto <D.24045>; else goto <D.24046>;
  <D.24045>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 4650, "method->flags & METHOD_ATTRIBUTE_VIRTUAL");
  <D.24046>:
  <D.24031>:
  D.24032 = BIT_FIELD_REF <*sig, 32, 64>;
  D.24033 = D.24032 & 4194304;
  if (D.24033 != 0) goto <D.24047>; else goto <D.24048>;
  <D.24047>:
  D.24049 = BIT_FIELD_REF <*method, 32, 160>;
  D.24050 = D.24049 & 128;
  if (D.24050 != 0) goto <D.24051>; else goto <D.24052>;
  <D.24051>:
  D.24053 = mono_gc_is_moving ();
  if (D.24053 != 0) goto <D.24054>; else goto <D.24055>;
  <D.24054>:
  mono_mb_emit_ptr (mb, &string_dummy);
  mono_mb_emit_byte (mb, 80);
  goto <D.24056>;
  <D.24055>:
  string_dummy.159 = string_dummy;
  mono_mb_emit_ptr (mb, string_dummy.159);
  <D.24056>:
  goto <D.24057>;
  <D.24052>:
  mono_mb_emit_ldarg (mb, 0);
  <D.24057>:
  <D.24048>:
  D.24058 = sig->param_count;
  D.24059 = (unsigned int) D.24058;
  D.24060 = D.24059 * 4;
  tmp_nullable_locals = monoeg_malloc0 (D.24060);
  i = 0;
  goto <D.19668>;
  <D.19667>:
  {
    struct MonoType * t;
    int type;

    t = sig->params[i];
    mono_mb_emit_ldarg (mb, 1);
    if (i != 0) goto <D.24061>; else goto <D.24062>;
    <D.24061>:
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24065 = (int) D.24064;
    mono_mb_emit_icon (mb, D.24065);
    mono_mb_emit_byte (mb, 88);
    <D.24062>:
    D.24066 = BIT_FIELD_REF <*t, 32, 32>;
    D.24067 = D.24066 & 1073741824;
    if (D.24067 != 0) goto <D.24068>; else goto <D.24069>;
    <D.24068>:
    mono_mb_emit_byte (mb, 77);
    D.24070 = t->type;
    if (D.24070 == 21) goto <D.24071>; else goto <D.24072>;
    <D.24071>:
    D.24073 = mono_class_from_mono_type (t);
    D.24074 = mono_class_is_nullable (D.24073);
    if (D.24074 != 0) goto <D.24075>; else goto <D.24076>;
    <D.24075>:
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24077 = tmp_nullable_locals + D.24064;
    D.24078 = mono_class_from_mono_type (t);
    D.24079 = &D.24078->byval_arg;
    D.24080 = mono_mb_add_local (mb, D.24079);
    *D.24077 = D.24080;
    D.24081 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 165, D.24081);
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24077 = tmp_nullable_locals + D.24064;
    D.24082 = *D.24077;
    D.24083 = (unsigned int) D.24082;
    mono_mb_emit_stloc (mb, D.24083);
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24077 = tmp_nullable_locals + D.24064;
    D.24082 = *D.24077;
    D.24083 = (unsigned int) D.24082;
    mono_mb_emit_ldloc_addr (mb, D.24083);
    <D.24076>:
    <D.24072>:
    // predicted unlikely by continue predictor.
    goto <D.19641>;
    <D.24069>:
    D.24084 = sig->params[i];
    D.24085 = D.24084->type;
    type = (int) D.24085;
    handle_enum:
    switch (type) <default: <D.19666>, case 2: <D.19644>, case 3: <D.19648>, case 4: <D.19643>, case 5: <D.19645>, case 6: <D.19646>, case 7: <D.19647>, case 8: <D.19651>, case 9: <D.19652>, case 10: <D.19655>, case 11: <D.19656>, case 12: <D.19653>, case 13: <D.19654>, case 14: <D.19658>, case 15: <D.19661>, case 17: <D.19665>, case 18: <D.19659>, case 20: <D.19660>, case 21: <D.19664>, case 24: <D.19649>, case 25: <D.19650>, case 28: <D.19663>, case 29: <D.19662>>
    <D.19643>:
    <D.19644>:
    <D.19645>:
    <D.19646>:
    <D.19647>:
    <D.19648>:
    <D.19649>:
    <D.19650>:
    <D.19651>:
    <D.19652>:
    <D.19653>:
    <D.19654>:
    <D.19655>:
    <D.19656>:
    mono_mb_emit_byte (mb, 77);
    D.24084 = sig->params[i];
    D.24086 = mono_type_to_ldind (D.24084);
    D.24087 = (unsigned char) D.24086;
    D.24088 = (int) D.24087;
    mono_mb_emit_byte (mb, D.24088);
    goto <D.19657>;
    <D.19658>:
    <D.19659>:
    <D.19660>:
    <D.19661>:
    <D.19662>:
    <D.19663>:
    D.24084 = sig->params[i];
    D.24089 = mono_type_to_ldind (D.24084);
    D.24090 = (unsigned char) D.24089;
    D.24091 = (int) D.24090;
    mono_mb_emit_byte (mb, D.24091);
    goto <D.19657>;
    <D.19664>:
    D.24084 = sig->params[i];
    D.24092 = mono_type_generic_inst_is_valuetype (D.24084);
    if (D.24092 == 0) goto <D.24093>; else goto <D.24094>;
    <D.24093>:
    D.24084 = sig->params[i];
    D.24095 = mono_type_to_ldind (D.24084);
    D.24096 = (unsigned char) D.24095;
    D.24097 = (int) D.24096;
    mono_mb_emit_byte (mb, D.24097);
    goto <D.19657>;
    <D.24094>:
    <D.19665>:
    if (type == 17) goto <D.24098>; else goto <D.24099>;
    <D.24098>:
    D.24100 = t->data.klass;
    D.24101 = BIT_FIELD_REF <*D.24100, 32, 160>;
    D.24102 = D.24101 & 16;
    if (D.24102 != 0) goto <D.24103>; else goto <D.24104>;
    <D.24103>:
    D.24100 = t->data.klass;
    D.24105 = mono_class_enum_basetype (D.24100);
    D.24106 = D.24105->type;
    type = (int) D.24106;
    goto handle_enum;
    <D.24104>:
    <D.24099>:
    mono_mb_emit_byte (mb, 77);
    D.24084 = sig->params[i];
    D.24107 = mono_class_from_mono_type (D.24084);
    D.24108 = mono_class_is_nullable (D.24107);
    if (D.24108 != 0) goto <D.24109>; else goto <D.24110>;
    <D.24109>:
    D.24084 = sig->params[i];
    D.24111 = mono_class_from_mono_type (D.24084);
    mono_mb_emit_op (mb, 121, D.24111);
    D.24084 = sig->params[i];
    D.24112 = mono_class_from_mono_type (D.24084);
    mono_mb_emit_op (mb, 113, D.24112);
    goto <D.24113>;
    <D.24110>:
    D.24084 = sig->params[i];
    D.24114 = mono_class_from_mono_type (D.24084);
    mono_mb_emit_op (mb, 113, D.24114);
    <D.24113>:
    goto <D.19657>;
    <D.19666>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4744);
    <D.19657>:
  }
  <D.19641>:
  i = i + 1;
  <D.19668>:
  D.24058 = sig->param_count;
  D.24115 = (int) D.24058;
  if (D.24115 > i) goto <D.19667>; else goto <D.19669>;
  <D.19669>:
  if (virtual != 0) goto <D.24116>; else goto <D.24117>;
  <D.24116>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.24118>;
  <D.24117>:
  if (need_direct_wrapper != 0) goto <D.24119>; else goto <D.24120>;
  <D.24119>:
  mono_mb_emit_op (mb, 40, method);
  goto <D.24121>;
  <D.24120>:
  mono_mb_emit_ldarg (mb, 3);
  mono_mb_emit_calli (mb, callsig);
  <D.24121>:
  <D.24118>:
  D.24122 = sig->ret;
  D.24123 = BIT_FIELD_REF <*D.24122, 32, 32>;
  D.24124 = D.24123 & 1073741824;
  if (D.24124 != 0) goto <D.24125>; else goto <D.24126>;
  <D.24125>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4759);
  <D.24126>:
  D.24122 = sig->ret;
  D.24127 = D.24122->type;
  D.24128 = (int) D.24127;
  switch (D.24128) <default: <D.19695>, case 1: <D.19670>, case 2: <D.19672>, case 3: <D.19673>, case 4: <D.19674>, case 5: <D.19675>, case 6: <D.19676>, case 7: <D.19677>, case 8: <D.19678>, case 9: <D.19679>, case 10: <D.19684>, case 11: <D.19685>, case 12: <D.19682>, case 13: <D.19683>, case 14: <D.19689>, case 15: <D.19694>, case 17: <D.19686>, case 18: <D.19690>, case 20: <D.19691>, case 21: <D.19688>, case 22: <D.19687>, case 24: <D.19680>, case 25: <D.19681>, case 28: <D.19693>, case 29: <D.19692>>
  <D.19670>:
  D.24049 = BIT_FIELD_REF <*method, 32, 160>;
  D.24050 = D.24049 & 128;
  if (D.24050 == 0) goto <D.24129>; else goto <D.24130>;
  <D.24129>:
  void_ret = 1;
  <D.24130>:
  goto <D.19671>;
  <D.19672>:
  <D.19673>:
  <D.19674>:
  <D.19675>:
  <D.19676>:
  <D.19677>:
  <D.19678>:
  <D.19679>:
  <D.19680>:
  <D.19681>:
  <D.19682>:
  <D.19683>:
  <D.19684>:
  <D.19685>:
  <D.19686>:
  <D.19687>:
  <D.19688>:
  D.24122 = sig->ret;
  D.24131 = mono_class_from_mono_type (D.24122);
  mono_mb_emit_op (mb, 140, D.24131);
  goto <D.19671>;
  <D.19689>:
  <D.19690>:
  <D.19691>:
  <D.19692>:
  <D.19693>:
  goto <D.19671>;
  <D.19694>:
  D.24132 = mono_defaults.int_class;
  mono_mb_emit_op (mb, 140, D.24132);
  goto <D.19671>;
  <D.19695>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 4799);
  <D.19671>:
  if (void_ret == 0) goto <D.24133>; else goto <D.24134>;
  <D.24133>:
  loc_res.162 = (unsigned int) loc_res;
  mono_mb_emit_stloc (mb, loc_res.162);
  <D.24134>:
  i = 0;
  goto <D.19698>;
  <D.19697>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.24136 = BIT_FIELD_REF <*t, 32, 32>;
    D.24137 = D.24136 & 1090453504;
    if (D.24137 == 1075118080) goto <D.24138>; else goto <D.24139>;
    <D.24138>:
    D.24140 = mono_class_from_mono_type (t);
    D.24141 = mono_class_is_nullable (D.24140);
    if (D.24141 != 0) goto <D.24142>; else goto <D.24143>;
    <D.24142>:
    mono_mb_emit_ldarg (mb, 1);
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24065 = (int) D.24064;
    mono_mb_emit_icon (mb, D.24065);
    mono_mb_emit_byte (mb, 88);
    i.161 = (unsigned int) i;
    D.24064 = i.161 * 4;
    D.24077 = tmp_nullable_locals + D.24064;
    D.24082 = *D.24077;
    D.24083 = (unsigned int) D.24082;
    mono_mb_emit_ldloc (mb, D.24083);
    D.24144 = mono_class_from_mono_type (t);
    mono_mb_emit_op (mb, 140, D.24144);
    mono_mb_emit_byte (mb, 81);
    <D.24143>:
    <D.24139>:
  }
  i = i + 1;
  <D.19698>:
  D.24058 = sig->param_count;
  D.24115 = (int) D.24058;
  if (D.24115 > i) goto <D.19697>; else goto <D.19699>;
  <D.19699>:
  monoeg_g_free (tmp_nullable_locals);
}


mono_marshal_get_runtime_invoke_dynamic ()
{
  struct MonoMethod * method.163;
  struct MonoMethod * D.24149;
  struct MonoImage * D.24150;
  struct MonoClass * D.24151;
  struct MonoType * D.24152;
  struct MonoClass * D.24153;
  struct MonoType * D.24154;
  struct MonoClass * D.24155;
  struct MonoType * D.24156;
  unsigned int D.24157;
  int D.24158;
  unsigned int D.24159;
  int D.24160;
  unsigned int D.24161;
  int D.24162;
  unsigned int D.24163;
  struct MonoClass * D.24164;
  unsigned int D.24165;
  unsigned int posna.164;
  int D.24167;
  unsigned int D.24168;
  unsigned int D.24169;
  unsigned int D.24170;
  unsigned int pos.165;
  _Bool D.24174;
  long int D.24175;
  long int D.24176;
  struct MonoMethod * method.166;
  _Bool D.24184;
  long int D.24185;
  long int D.24186;
  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.24147>; else goto <D.24148>;
  <D.24147>:
  D.24149 = method;
  return D.24149;
  <D.24148>:
  D.24150 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24150, 4);
  D.24151 = mono_defaults.void_class;
  D.24152 = &D.24151->byval_arg;
  csig->ret = D.24152;
  D.24153 = mono_defaults.int_class;
  D.24154 = &D.24153->byval_arg;
  csig->params[0] = D.24154;
  D.24153 = mono_defaults.int_class;
  D.24154 = &D.24153->byval_arg;
  csig->params[1] = D.24154;
  D.24153 = mono_defaults.int_class;
  D.24154 = &D.24153->byval_arg;
  csig->params[2] = D.24154;
  D.24153 = mono_defaults.int_class;
  D.24154 = &D.24153->byval_arg;
  csig->params[3] = D.24154;
  name = monoeg_strdup ("runtime_invoke_dynamic");
  D.24155 = mono_defaults.object_class;
  mb = mono_mb_new (D.24155, name, 4);
  monoeg_g_free (name);
  D.24155 = mono_defaults.object_class;
  D.24156 = &D.24155->byval_arg;
  mono_mb_add_local (mb, D.24156);
  D.24155 = mono_defaults.object_class;
  D.24156 = &D.24155->byval_arg;
  mono_mb_add_local (mb, D.24156);
  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.24157 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.24157;
  D.24150 = mono_defaults.corlib;
  clause = mono_image_alloc0 (D.24150, 24);
  clause->flags = 1;
  D.24158 = mono_mb_get_label (mb);
  D.24159 = (unsigned int) D.24158;
  clause->try_len = D.24159;
  D.24160 = mono_mb_get_label (mb);
  D.24161 = (unsigned int) D.24160;
  clause->data.filter_offset = D.24161;
  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.24162 = mono_mb_get_label (mb);
  D.24163 = (unsigned int) D.24162;
  clause->handler_offset = D.24163;
  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.24164 = mono_defaults.threadabortexception_class;
  mono_mb_emit_op (mb, 117, D.24164);
  D.24165 = mono_mb_emit_short_branch (mb, 44);
  posna = (int) D.24165;
  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.24167 = mono_mb_get_pos (mb);
  D.24168 = (unsigned int) D.24167;
  D.24169 = clause->handler_offset;
  D.24170 = D.24168 - D.24169;
  clause->handler_len = D.24170;
  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.24172>; else goto <D.24173>;
    <D.24172>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24173>:
    D.24174 = ret != 0;
    D.24175 = (long int) D.24174;
    D.24176 = __builtin_expect (D.24175, 0);
    if (D.24176 != 0) goto <D.24177>; else goto <D.24178>;
    <D.24177>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5213, "ret == 0");
    <D.24178>:
  }
  method.163 = method;
  if (method.163 == 0B) goto <D.24179>; else goto <D.24180>;
  <D.24179>:
  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.24180>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24182>; else goto <D.24183>;
    <D.24182>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24183>:
    D.24184 = ret != 0;
    D.24185 = (long int) D.24184;
    D.24186 = __builtin_expect (D.24185, 0);
    if (D.24186 != 0) goto <D.24187>; else goto <D.24188>;
    <D.24187>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5220, "ret == 0");
    <D.24188>:
  }
  mono_mb_free (mb);
  D.24149 = method;
  return D.24149;
}


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

  if (str != 0B) goto <D.24190>; else goto <D.24191>;
  <D.24190>:
  D.24192 = __strdup (str);
  return D.24192;
  <D.24191>:
  D.24192 = 0B;
  return D.24192;
}


mono_marshal_get_ldfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24196;
  long int D.24197;
  long int D.24198;
  struct MonoMethod * cached.167;
  _Bool D.24206;
  long int D.24207;
  long int D.24208;
  struct MonoMethod * D.24211;
  _Bool D.24214;
  long int D.24215;
  long int D.24216;
  struct MonoClass * D.24219;
  struct MonoMethod * D.24220;
  struct MonoImage * D.24221;
  struct MonoType * D.24222;
  struct MonoClass * D.24223;
  struct MonoType * D.24224;
  _Bool D.24227;
  long int D.24228;
  long int D.24229;
  _Bool D.24234;
  long int D.24235;
  long int D.24236;
  _Bool D.24243;
  long int D.24244;
  long int D.24245;
  _Bool D.24252;
  long int D.24253;
  long int D.24254;
  _Bool D.24260;
  long int D.24261;
  long int D.24262;
  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.24194>; else goto <D.24195>;
    <D.24194>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24195>:
    D.24196 = ret != 0;
    D.24197 = (long int) D.24196;
    D.24198 = __builtin_expect (D.24197, 0);
    if (D.24198 != 0) goto <D.24199>; else goto <D.24200>;
    <D.24199>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5256, "ret == 0");
    <D.24200>:
  }
  cached.167 = cached;
  if (cached.167 != 0B) goto <D.24202>; else goto <D.24203>;
  <D.24202>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24204>; else goto <D.24205>;
    <D.24204>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24205>:
    D.24206 = ret != 0;
    D.24207 = (long int) D.24206;
    D.24208 = __builtin_expect (D.24207, 0);
    if (D.24208 != 0) goto <D.24209>; else goto <D.24210>;
    <D.24209>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5258, "ret == 0");
    <D.24210>:
  }
  D.24211 = cached;
  return D.24211;
  <D.24203>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24212>; else goto <D.24213>;
    <D.24212>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24213>:
    D.24214 = ret != 0;
    D.24215 = (long int) D.24214;
    D.24216 = __builtin_expect (D.24215, 0);
    if (D.24216 != 0) goto <D.24217>; else goto <D.24218>;
    <D.24217>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5261, "ret == 0");
    <D.24218>:
  }
  D.24219 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24219, "__mono_load_remote_field_new_wrapper", 14);
  D.24220 = mb->method;
  D.24220->save_lmf = 1;
  D.24221 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24221, 3);
  D.24219 = mono_defaults.object_class;
  D.24222 = &D.24219->byval_arg;
  sig->params[0] = D.24222;
  D.24223 = mono_defaults.int_class;
  D.24224 = &D.24223->byval_arg;
  sig->params[1] = D.24224;
  D.24223 = mono_defaults.int_class;
  D.24224 = &D.24223->byval_arg;
  sig->params[2] = D.24224;
  D.24219 = mono_defaults.object_class;
  D.24222 = &D.24219->byval_arg;
  sig->ret = D.24222;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_ldarg (mb, 2);
  D.24221 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24221, 3);
  D.24219 = mono_defaults.object_class;
  D.24222 = &D.24219->byval_arg;
  csig->params[0] = D.24222;
  D.24223 = mono_defaults.int_class;
  D.24224 = &D.24223->byval_arg;
  csig->params[1] = D.24224;
  D.24223 = mono_defaults.int_class;
  D.24224 = &D.24223->byval_arg;
  csig->params[2] = D.24224;
  D.24219 = mono_defaults.object_class;
  D.24222 = &D.24219->byval_arg;
  csig->ret = D.24222;
  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.24225>; else goto <D.24226>;
    <D.24225>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock 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", 5291, "ret == 0");
    <D.24231>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24232>; else goto <D.24233>;
    <D.24232>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24233>:
    D.24234 = ret != 0;
    D.24235 = (long int) D.24234;
    D.24236 = __builtin_expect (D.24235, 0);
    if (D.24236 != 0) goto <D.24237>; else goto <D.24238>;
    <D.24237>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5293, "ret == 0");
    <D.24238>:
  }
  if (res == 0B) goto <D.24239>; else goto <D.24240>;
  <D.24239>:
  {
    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.24241>; else goto <D.24242>;
      <D.24241>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24242>:
      D.24243 = ret != 0;
      D.24244 = (long int) D.24243;
      D.24245 = __builtin_expect (D.24244, 0);
      if (D.24245 != 0) goto <D.24246>; else goto <D.24247>;
      <D.24246>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5297, "ret == 0");
      <D.24247>:
    }
    res = cached;
    if (res == 0B) goto <D.24248>; else goto <D.24249>;
    <D.24248>:
    res = newm;
    cached = res;
    {
      int ret;

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

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24258>; else goto <D.24259>;
      <D.24258>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24259>:
      D.24260 = ret != 0;
      D.24261 = (long int) D.24260;
      D.24262 = __builtin_expect (D.24261, 0);
      if (D.24262 != 0) goto <D.24263>; else goto <D.24264>;
      <D.24263>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5304, "ret == 0");
      <D.24264>:
    }
    mono_free_method (newm);
    <D.24257>:
  }
  <D.24240>:
  mono_mb_free (mb);
  D.24211 = res;
  return D.24211;
}


mono_marshal_get_ldfld_wrapper (struct MonoType * type)
{
  unsigned char D.24266;
  unsigned int D.24267;
  unsigned int D.24268;
  int D.24288;
  struct MonoImage * D.24294;
  struct GHashTable * * D.24295;
  struct MonoMethod * D.24298;
  const char * D.24299;
  const char * D.24300;
  struct MonoClass * D.24301;
  struct MonoImage * D.24302;
  struct MonoType * D.24303;
  struct MonoClass * D.24304;
  struct MonoType * D.24305;
  struct MonoType * D.24306;
  struct MonoMethod * D.24307;
  unsigned int D.24308;
  unsigned int D.24309;
  unsigned int D.24312;
  unsigned int pos0.168;
  unsigned int pos1.169;
  unsigned int D.24318;
  unsigned char D.24319;
  int D.24320;
  unsigned int D.24321;
  _Bool D.24322;
  long int D.24323;
  long int D.24324;
  int D.24327;
  int D.24331;
  short unsigned int D.24332;
  int D.24333;
  int D.24334;
  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.24266 = type->type;
  t = (int) D.24266;
  D.24267 = BIT_FIELD_REF <*type, 32, 32>;
  D.24268 = D.24267 & 1073741824;
  if (D.24268 == 0) goto <D.24269>; else goto <D.24270>;
  <D.24269>:
  D.24266 = type->type;
  if (D.24266 == 29) goto <D.24271>; else goto <D.24272>;
  <D.24271>:
  klass = mono_defaults.array_class;
  goto <D.24273>;
  <D.24272>:
  D.24266 = type->type;
  if (D.24266 == 17) goto <D.24274>; else goto <D.24275>;
  <D.24274>:
  klass = type->data.klass;
  goto <D.24276>;
  <D.24275>:
  if (t == 28) goto <D.24277>; else goto <D.24280>;
  <D.24280>:
  if (t == 18) goto <D.24277>; else goto <D.24281>;
  <D.24281>:
  if (t == 14) goto <D.24277>; else goto <D.24278>;
  <D.24277>:
  klass = mono_defaults.object_class;
  goto <D.24279>;
  <D.24278>:
  if (t == 15) goto <D.24282>; else goto <D.24285>;
  <D.24285>:
  if (t == 27) goto <D.24282>; else goto <D.24283>;
  <D.24282>:
  klass = mono_defaults.int_class;
  goto <D.24284>;
  <D.24283>:
  if (t == 21) goto <D.24286>; else goto <D.24287>;
  <D.24286>:
  D.24288 = mono_type_generic_inst_is_valuetype (type);
  if (D.24288 != 0) goto <D.24289>; else goto <D.24290>;
  <D.24289>:
  klass = mono_class_from_mono_type (type);
  goto <D.24291>;
  <D.24290>:
  klass = mono_defaults.object_class;
  <D.24291>:
  goto <D.24292>;
  <D.24287>:
  klass = mono_class_from_mono_type (type);
  <D.24292>:
  <D.24284>:
  <D.24279>:
  <D.24276>:
  <D.24273>:
  goto <D.24293>;
  <D.24270>:
  klass = mono_defaults.int_class;
  <D.24293>:
  D.24294 = klass->image;
  D.24295 = &D.24294->ldfld_wrapper_cache;
  cache = get_cache (D.24295, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24296>; else goto <D.24297>;
  <D.24296>:
  D.24298 = res;
  return D.24298;
  <D.24297>:
  D.24299 = klass->name_space;
  D.24300 = klass->name;
  name = monoeg_g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, D.24299, D.24300);
  D.24301 = mono_defaults.object_class;
  mb = mono_mb_new (D.24301, name, 12);
  monoeg_g_free (name);
  D.24302 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24302, 4);
  D.24301 = mono_defaults.object_class;
  D.24303 = &D.24301->byval_arg;
  sig->params[0] = D.24303;
  D.24304 = mono_defaults.int_class;
  D.24305 = &D.24304->byval_arg;
  sig->params[1] = D.24305;
  D.24304 = mono_defaults.int_class;
  D.24305 = &D.24304->byval_arg;
  sig->params[2] = D.24305;
  D.24304 = mono_defaults.int_class;
  D.24305 = &D.24304->byval_arg;
  sig->params[3] = D.24305;
  D.24306 = &klass->byval_arg;
  sig->ret = D.24306;
  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.24307 = mono_marshal_get_ldfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24307, 0B);
  D.24308 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24309 = D.24308 & 8;
  if (D.24309 != 0) goto <D.24310>; else goto <D.24311>;
  <D.24310>:
  mono_mb_emit_op (mb, 121, klass);
  D.24312 = mono_mb_emit_branch (mb, 56);
  pos1 = (int) D.24312;
  goto <D.24313>;
  <D.24311>:
  mono_mb_emit_byte (mb, 42);
  <D.24313>:
  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.24308 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24309 = D.24308 & 8;
  if (D.24309 != 0) goto <D.24315>; else goto <D.24316>;
  <D.24315>:
  pos1.169 = (unsigned int) pos1;
  mono_mb_patch_branch (mb, pos1.169);
  <D.24316>:
  switch (t) <default: <D.19811>, case 2: <D.19787>, case 3: <D.19788>, case 4: <D.19785>, case 5: <D.19786>, case 6: <D.19789>, case 7: <D.19790>, case 8: <D.19791>, case 9: <D.19792>, case 10: <D.19793>, case 11: <D.19794>, case 12: <D.19795>, case 13: <D.19796>, case 14: <D.19801>, case 15: <D.19804>, case 17: <D.19807>, case 18: <D.19800>, case 19: <D.19809>, case 20: <D.19797>, case 21: <D.19808>, case 24: <D.19802>, case 25: <D.19803>, case 27: <D.19805>, case 28: <D.19799>, case 29: <D.19798>, case 30: <D.19810>>
  <D.19785>:
  <D.19786>:
  <D.19787>:
  <D.19788>:
  <D.19789>:
  <D.19790>:
  <D.19791>:
  <D.19792>:
  <D.19793>:
  <D.19794>:
  <D.19795>:
  <D.19796>:
  <D.19797>:
  <D.19798>:
  <D.19799>:
  <D.19800>:
  <D.19801>:
  <D.19802>:
  <D.19803>:
  <D.19804>:
  <D.19805>:
  D.24318 = mono_type_to_ldind (type);
  D.24319 = (unsigned char) D.24318;
  D.24320 = (int) D.24319;
  mono_mb_emit_byte (mb, D.24320);
  goto <D.19806>;
  <D.19807>:
  D.24308 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24321 = D.24308 & 16;
  D.24322 = D.24321 != 0;
  D.24323 = (long int) D.24322;
  D.24324 = __builtin_expect (D.24323, 0);
  if (D.24324 != 0) goto <D.24325>; else goto <D.24326>;
  <D.24325>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5439, "!klass->enumtype");
  <D.24326>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.19806>;
  <D.19808>:
  D.24327 = mono_type_generic_inst_is_valuetype (type);
  if (D.24327 != 0) goto <D.24328>; else goto <D.24329>;
  <D.24328>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.24330>;
  <D.24329>:
  mono_mb_emit_byte (mb, 80);
  <D.24330>:
  goto <D.19806>;
  <D.19809>:
  <D.19810>:
  mono_mb_emit_op (mb, 113, klass);
  goto <D.19806>;
  <D.19811>:
  D.24266 = type->type;
  D.24331 = (int) D.24266;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24331);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5455);
  <D.19806>:
  mono_mb_emit_byte (mb, 42);
  D.24332 = sig->param_count;
  D.24333 = (int) D.24332;
  D.24334 = D.24333 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24334);
  mono_mb_free (mb);
  D.24298 = res;
  return D.24298;
}


mono_marshal_get_ldflda_wrapper (struct MonoType * type)
{
  unsigned char D.24336;
  unsigned int D.24337;
  unsigned int D.24338;
  int D.24359;
  struct MonoImage * D.24365;
  struct GHashTable * * D.24366;
  struct MonoMethod * D.24369;
  const char * D.24370;
  const char * D.24371;
  struct MonoClass * D.24372;
  struct MonoImage * D.24373;
  struct MonoType * D.24374;
  struct MonoClass * D.24375;
  struct MonoType * D.24376;
  unsigned int pos1.170;
  unsigned int D.24378;
  unsigned int pos2.171;
  unsigned int pos3.172;
  unsigned int pos0.173;
  short unsigned int D.24382;
  int D.24383;
  int D.24384;
  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.24336 = type->type;
  t = (int) D.24336;
  D.24337 = BIT_FIELD_REF <*type, 32, 32>;
  D.24338 = D.24337 & 1073741824;
  if (D.24338 == 0) goto <D.24339>; else goto <D.24340>;
  <D.24339>:
  D.24336 = type->type;
  if (D.24336 == 29) goto <D.24341>; else goto <D.24342>;
  <D.24341>:
  klass = mono_defaults.array_class;
  goto <D.24343>;
  <D.24342>:
  D.24336 = type->type;
  if (D.24336 == 17) goto <D.24344>; else goto <D.24345>;
  <D.24344>:
  klass = type->data.klass;
  goto <D.24346>;
  <D.24345>:
  if (t == 28) goto <D.24347>; else goto <D.24350>;
  <D.24350>:
  if (t == 18) goto <D.24347>; else goto <D.24351>;
  <D.24351>:
  if (t == 14) goto <D.24347>; else goto <D.24352>;
  <D.24352>:
  if (t == 18) goto <D.24347>; else goto <D.24348>;
  <D.24347>:
  klass = mono_defaults.object_class;
  goto <D.24349>;
  <D.24348>:
  if (t == 15) goto <D.24353>; else goto <D.24356>;
  <D.24356>:
  if (t == 27) goto <D.24353>; else goto <D.24354>;
  <D.24353>:
  klass = mono_defaults.int_class;
  goto <D.24355>;
  <D.24354>:
  if (t == 21) goto <D.24357>; else goto <D.24358>;
  <D.24357>:
  D.24359 = mono_type_generic_inst_is_valuetype (type);
  if (D.24359 != 0) goto <D.24360>; else goto <D.24361>;
  <D.24360>:
  klass = mono_class_from_mono_type (type);
  goto <D.24362>;
  <D.24361>:
  klass = mono_defaults.object_class;
  <D.24362>:
  goto <D.24363>;
  <D.24358>:
  klass = mono_class_from_mono_type (type);
  <D.24363>:
  <D.24355>:
  <D.24349>:
  <D.24346>:
  <D.24343>:
  goto <D.24364>;
  <D.24340>:
  klass = mono_defaults.int_class;
  <D.24364>:
  D.24365 = klass->image;
  D.24366 = &D.24365->ldflda_wrapper_cache;
  cache = get_cache (D.24366, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24367>; else goto <D.24368>;
  <D.24367>:
  D.24369 = res;
  return D.24369;
  <D.24368>:
  D.24370 = klass->name_space;
  D.24371 = klass->name;
  name = monoeg_g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, D.24370, D.24371);
  D.24372 = mono_defaults.object_class;
  mb = mono_mb_new (D.24372, name, 23);
  monoeg_g_free (name);
  D.24373 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24373, 4);
  D.24372 = mono_defaults.object_class;
  D.24374 = &D.24372->byval_arg;
  sig->params[0] = D.24374;
  D.24375 = mono_defaults.int_class;
  D.24376 = &D.24375->byval_arg;
  sig->params[1] = D.24376;
  D.24375 = mono_defaults.int_class;
  D.24376 = &D.24375->byval_arg;
  sig->params[2] = D.24376;
  D.24375 = mono_defaults.int_class;
  D.24376 = &D.24375->byval_arg;
  sig->params[3] = D.24376;
  D.24375 = mono_defaults.int_class;
  D.24376 = &D.24375->byval_arg;
  sig->ret = D.24376;
  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.24378 = mono_mb_emit_branch (mb, 59);
  pos3 = (int) D.24378;
  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.24382 = sig->param_count;
  D.24383 = (int) D.24382;
  D.24384 = D.24383 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24384);
  mono_mb_free (mb);
  D.24369 = res;
  return D.24369;
}


mono_mb_emit_contextbound_check (struct MonoMethodBuilder * mb, int branch_code)
{
  int offset.174;
  unsigned char mask.175;
  int D.24390;
  int D.24391;
  unsigned char D.24392;
  int D.24393;
  unsigned int D.24394;
  static int offset = -1;
  static guint8 mask;

  offset.174 = offset;
  if (offset.174 < 0) goto <D.24387>; else goto <D.24388>;
  <D.24387>:
  {
    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.24388>:
  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.24390 = (int) mask.175;
  mono_mb_emit_icon (mb, D.24390);
  mono_mb_emit_byte (mb, 95);
  mono_mb_emit_icon (mb, 0);
  D.24392 = (unsigned char) branch_code;
  D.24393 = (int) D.24392;
  D.24394 = mono_mb_emit_branch (mb, D.24393);
  D.24391 = (int) D.24394;
  return D.24391;
}


mono_marshal_get_stfld_remote_wrapper (struct MonoClass * klass)
{
  _Bool D.24398;
  long int D.24399;
  long int D.24400;
  struct MonoMethod * cached.176;
  _Bool D.24408;
  long int D.24409;
  long int D.24410;
  struct MonoMethod * D.24413;
  _Bool D.24416;
  long int D.24417;
  long int D.24418;
  struct MonoClass * D.24421;
  struct MonoMethod * D.24422;
  struct MonoImage * D.24423;
  struct MonoType * D.24424;
  struct MonoClass * D.24425;
  struct MonoType * D.24426;
  struct MonoClass * D.24427;
  struct MonoType * D.24428;
  _Bool D.24431;
  long int D.24432;
  long int D.24433;
  _Bool D.24438;
  long int D.24439;
  long int D.24440;
  _Bool D.24447;
  long int D.24448;
  long int D.24449;
  _Bool D.24456;
  long int D.24457;
  long int D.24458;
  _Bool D.24464;
  long int D.24465;
  long int D.24466;
  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.24396>; else goto <D.24397>;
    <D.24396>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24397>:
    D.24398 = ret != 0;
    D.24399 = (long int) D.24398;
    D.24400 = __builtin_expect (D.24399, 0);
    if (D.24400 != 0) goto <D.24401>; else goto <D.24402>;
    <D.24401>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5608, "ret == 0");
    <D.24402>:
  }
  cached.176 = cached;
  if (cached.176 != 0B) goto <D.24404>; else goto <D.24405>;
  <D.24404>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24406>; else goto <D.24407>;
    <D.24406>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24407>:
    D.24408 = ret != 0;
    D.24409 = (long int) D.24408;
    D.24410 = __builtin_expect (D.24409, 0);
    if (D.24410 != 0) goto <D.24411>; else goto <D.24412>;
    <D.24411>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5610, "ret == 0");
    <D.24412>:
  }
  D.24413 = cached;
  return D.24413;
  <D.24405>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24414>; else goto <D.24415>;
    <D.24414>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24415>:
    D.24416 = ret != 0;
    D.24417 = (long int) D.24416;
    D.24418 = __builtin_expect (D.24417, 0);
    if (D.24418 != 0) goto <D.24419>; else goto <D.24420>;
    <D.24419>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5613, "ret == 0");
    <D.24420>:
  }
  D.24421 = mono_defaults.object_class;
  mb = mono_mb_new_no_dup_name (D.24421, "__mono_store_remote_field_new_wrapper", 15);
  D.24422 = mb->method;
  D.24422->save_lmf = 1;
  D.24423 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24423, 4);
  D.24421 = mono_defaults.object_class;
  D.24424 = &D.24421->byval_arg;
  sig->params[0] = D.24424;
  D.24425 = mono_defaults.int_class;
  D.24426 = &D.24425->byval_arg;
  sig->params[1] = D.24426;
  D.24425 = mono_defaults.int_class;
  D.24426 = &D.24425->byval_arg;
  sig->params[2] = D.24426;
  D.24421 = mono_defaults.object_class;
  D.24424 = &D.24421->byval_arg;
  sig->params[3] = D.24424;
  D.24427 = mono_defaults.void_class;
  D.24428 = &D.24427->byval_arg;
  sig->ret = D.24428;
  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.24423 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.24423, 4);
  D.24421 = mono_defaults.object_class;
  D.24424 = &D.24421->byval_arg;
  csig->params[0] = D.24424;
  D.24425 = mono_defaults.int_class;
  D.24426 = &D.24425->byval_arg;
  csig->params[1] = D.24426;
  D.24425 = mono_defaults.int_class;
  D.24426 = &D.24425->byval_arg;
  csig->params[2] = D.24426;
  D.24421 = mono_defaults.object_class;
  D.24424 = &D.24421->byval_arg;
  csig->params[3] = D.24424;
  D.24427 = mono_defaults.void_class;
  D.24428 = &D.24427->byval_arg;
  csig->ret = D.24428;
  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.24429>; else goto <D.24430>;
    <D.24429>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.24430>:
    D.24431 = ret != 0;
    D.24432 = (long int) D.24431;
    D.24433 = __builtin_expect (D.24432, 0);
    if (D.24433 != 0) goto <D.24434>; else goto <D.24435>;
    <D.24434>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5646, "ret == 0");
    <D.24435>:
  }
  res = cached;
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.24436>; else goto <D.24437>;
    <D.24436>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.24437>:
    D.24438 = ret != 0;
    D.24439 = (long int) D.24438;
    D.24440 = __builtin_expect (D.24439, 0);
    if (D.24440 != 0) goto <D.24441>; else goto <D.24442>;
    <D.24441>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5648, "ret == 0");
    <D.24442>:
  }
  if (res == 0B) goto <D.24443>; else goto <D.24444>;
  <D.24443>:
  {
    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.24445>; else goto <D.24446>;
      <D.24445>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
      <D.24446>:
      D.24447 = ret != 0;
      D.24448 = (long int) D.24447;
      D.24449 = __builtin_expect (D.24448, 0);
      if (D.24449 != 0) goto <D.24450>; else goto <D.24451>;
      <D.24450>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5652, "ret == 0");
      <D.24451>:
    }
    res = cached;
    if (res == 0B) goto <D.24452>; else goto <D.24453>;
    <D.24452>:
    res = newm;
    cached = res;
    {
      int ret;

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

      ret = pthread_mutex_unlock (&marshal_mutex.mutex);
      if (ret != 0) goto <D.24462>; else goto <D.24463>;
      <D.24462>:
      monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
      <D.24463>:
      D.24464 = ret != 0;
      D.24465 = (long int) D.24464;
      D.24466 = __builtin_expect (D.24465, 0);
      if (D.24466 != 0) goto <D.24467>; else goto <D.24468>;
      <D.24467>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5659, "ret == 0");
      <D.24468>:
    }
    mono_free_method (newm);
    <D.24461>:
  }
  <D.24444>:
  mono_mb_free (mb);
  D.24413 = res;
  return D.24413;
}


mono_marshal_get_stfld_wrapper (struct MonoType * type)
{
  unsigned char D.24470;
  unsigned int D.24471;
  unsigned int D.24472;
  int D.24492;
  struct MonoImage * D.24498;
  struct GHashTable * * D.24499;
  struct MonoMethod * D.24502;
  const char * D.24503;
  const char * D.24504;
  struct MonoClass * D.24505;
  struct MonoImage * D.24506;
  struct MonoType * D.24507;
  struct MonoClass * D.24508;
  struct MonoType * D.24509;
  struct MonoType * D.24510;
  struct MonoClass * D.24511;
  struct MonoType * D.24512;
  unsigned int D.24513;
  unsigned int D.24514;
  struct MonoMethod * D.24517;
  unsigned int pos.177;
  unsigned int D.24519;
  unsigned char D.24520;
  int D.24521;
  unsigned int D.24522;
  _Bool D.24523;
  long int D.24524;
  long int D.24525;
  int D.24528;
  short unsigned int D.24529;
  int D.24530;
  int D.24531;
  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.24470 = type->type;
  t = (int) D.24470;
  D.24471 = BIT_FIELD_REF <*type, 32, 32>;
  D.24472 = D.24471 & 1073741824;
  if (D.24472 == 0) goto <D.24473>; else goto <D.24474>;
  <D.24473>:
  D.24470 = type->type;
  if (D.24470 == 29) goto <D.24475>; else goto <D.24476>;
  <D.24475>:
  klass = mono_defaults.array_class;
  goto <D.24477>;
  <D.24476>:
  D.24470 = type->type;
  if (D.24470 == 17) goto <D.24478>; else goto <D.24479>;
  <D.24478>:
  klass = type->data.klass;
  goto <D.24480>;
  <D.24479>:
  if (t == 28) goto <D.24481>; else goto <D.24484>;
  <D.24484>:
  if (t == 18) goto <D.24481>; else goto <D.24485>;
  <D.24485>:
  if (t == 14) goto <D.24481>; else goto <D.24482>;
  <D.24481>:
  klass = mono_defaults.object_class;
  goto <D.24483>;
  <D.24482>:
  if (t == 15) goto <D.24486>; else goto <D.24489>;
  <D.24489>:
  if (t == 27) goto <D.24486>; else goto <D.24487>;
  <D.24486>:
  klass = mono_defaults.int_class;
  goto <D.24488>;
  <D.24487>:
  if (t == 21) goto <D.24490>; else goto <D.24491>;
  <D.24490>:
  D.24492 = mono_type_generic_inst_is_valuetype (type);
  if (D.24492 != 0) goto <D.24493>; else goto <D.24494>;
  <D.24493>:
  klass = mono_class_from_mono_type (type);
  goto <D.24495>;
  <D.24494>:
  klass = mono_defaults.object_class;
  <D.24495>:
  goto <D.24496>;
  <D.24491>:
  klass = mono_class_from_mono_type (type);
  <D.24496>:
  <D.24488>:
  <D.24483>:
  <D.24480>:
  <D.24477>:
  goto <D.24497>;
  <D.24474>:
  klass = mono_defaults.int_class;
  <D.24497>:
  D.24498 = klass->image;
  D.24499 = &D.24498->stfld_wrapper_cache;
  cache = get_cache (D.24499, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.24500>; else goto <D.24501>;
  <D.24500>:
  D.24502 = res;
  return D.24502;
  <D.24501>:
  D.24503 = klass->name_space;
  D.24504 = klass->name;
  name = monoeg_g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, D.24503, D.24504);
  D.24505 = mono_defaults.object_class;
  mb = mono_mb_new (D.24505, name, 13);
  monoeg_g_free (name);
  D.24506 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.24506, 5);
  D.24505 = mono_defaults.object_class;
  D.24507 = &D.24505->byval_arg;
  sig->params[0] = D.24507;
  D.24508 = mono_defaults.int_class;
  D.24509 = &D.24508->byval_arg;
  sig->params[1] = D.24509;
  D.24508 = mono_defaults.int_class;
  D.24509 = &D.24508->byval_arg;
  sig->params[2] = D.24509;
  D.24508 = mono_defaults.int_class;
  D.24509 = &D.24508->byval_arg;
  sig->params[3] = D.24509;
  D.24510 = &klass->byval_arg;
  sig->params[4] = D.24510;
  D.24511 = mono_defaults.void_class;
  D.24512 = &D.24511->byval_arg;
  sig->ret = D.24512;
  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.24513 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24514 = D.24513 & 8;
  if (D.24514 != 0) goto <D.24515>; else goto <D.24516>;
  <D.24515>:
  mono_mb_emit_op (mb, 140, klass);
  <D.24516>:
  D.24517 = mono_marshal_get_stfld_remote_wrapper (klass);
  mono_mb_emit_managed_call (mb, D.24517, 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.19880>, case 2: <D.19856>, case 3: <D.19857>, case 4: <D.19854>, case 5: <D.19855>, case 6: <D.19858>, case 7: <D.19859>, case 8: <D.19860>, case 9: <D.19861>, case 10: <D.19862>, case 11: <D.19863>, case 12: <D.19864>, case 13: <D.19865>, case 14: <D.19870>, case 15: <D.19873>, case 17: <D.19876>, case 18: <D.19869>, case 19: <D.19878>, case 20: <D.19866>, case 21: <D.19877>, case 24: <D.19871>, case 25: <D.19872>, case 27: <D.19874>, case 28: <D.19868>, case 29: <D.19867>, case 30: <D.19879>>
  <D.19854>:
  <D.19855>:
  <D.19856>:
  <D.19857>:
  <D.19858>:
  <D.19859>:
  <D.19860>:
  <D.19861>:
  <D.19862>:
  <D.19863>:
  <D.19864>:
  <D.19865>:
  <D.19866>:
  <D.19867>:
  <D.19868>:
  <D.19869>:
  <D.19870>:
  <D.19871>:
  <D.19872>:
  <D.19873>:
  <D.19874>:
  D.24519 = mono_type_to_stind (type);
  D.24520 = (unsigned char) D.24519;
  D.24521 = (int) D.24520;
  mono_mb_emit_byte (mb, D.24521);
  goto <D.19875>;
  <D.19876>:
  D.24513 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24522 = D.24513 & 16;
  D.24523 = D.24522 != 0;
  D.24524 = (long int) D.24523;
  D.24525 = __builtin_expect (D.24524, 0);
  if (D.24525 != 0) goto <D.24526>; else goto <D.24527>;
  <D.24526>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5777, "!klass->enumtype");
  <D.24527>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.19875>;
  <D.19877>:
  <D.19878>:
  <D.19879>:
  mono_mb_emit_op (mb, 129, klass);
  goto <D.19875>;
  <D.19880>:
  D.24470 = type->type;
  D.24528 = (int) D.24470;
  monoeg_g_log (0B, 16, "type %x not implemented", D.24528);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5787);
  <D.19875>:
  mono_mb_emit_byte (mb, 42);
  D.24529 = sig->param_count;
  D.24530 = (int) D.24529;
  D.24531 = D.24530 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, sig, D.24531);
  mono_mb_free (mb);
  D.24502 = res;
  return D.24502;
}


mono_marshal_get_icall_wrapper (struct MonoMethodSignature * sig, const char * name, const void * func, gboolean check_exceptions)
{
  unsigned int D.24533;
  unsigned int D.24534;
  _Bool D.24535;
  long int D.24536;
  long int D.24537;
  struct MonoClass * D.24540;
  struct MonoMethod * D.24541;
  unsigned int D.24542;
  struct MonoImage * D.24545;
  <unnamed-unsigned:1> D.24549;
  int D.24550;
  int D.24551;
  unsigned int D.24552;
  short unsigned int D.24553;
  int D.24554;
  unsigned int D.24557;
  unsigned int D.24558;
  short unsigned int D.24561;
  int D.24562;
  int D.24563;
  struct MonoMethod * D.24564;
  struct MonoMethodSignature * csig;
  struct MonoMethodSignature * csig2;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  int i;
  struct WrapperInfo * info;

  D.24533 = BIT_FIELD_REF <*sig, 32, 64>;
  D.24534 = D.24533 & 16777216;
  D.24535 = D.24534 == 0;
  D.24536 = (long int) D.24535;
  D.24537 = __builtin_expect (D.24536, 0);
  if (D.24537 != 0) goto <D.24538>; else goto <D.24539>;
  <D.24538>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5815, "sig->pinvoke");
  <D.24539>:
  D.24540 = mono_defaults.object_class;
  mb = mono_mb_new (D.24540, name, 6);
  D.24541 = mb->method;
  D.24541->save_lmf = 1;
  D.24533 = BIT_FIELD_REF <*sig, 32, 64>;
  D.24542 = D.24533 & 4194304;
  if (D.24542 != 0) goto <D.24543>; else goto <D.24544>;
  <D.24543>:
  D.24545 = mono_defaults.corlib;
  D.24540 = mono_defaults.object_class;
  csig2 = signature_dup_add_this (D.24545, sig, D.24540);
  goto <D.24546>;
  <D.24544>:
  D.24545 = mono_defaults.corlib;
  csig2 = signature_dup (D.24545, sig);
  <D.24546>:
  D.24533 = BIT_FIELD_REF <*sig, 32, 64>;
  D.24542 = D.24533 & 4194304;
  if (D.24542 != 0) goto <D.24547>; else goto <D.24548>;
  <D.24547>:
  mono_mb_emit_byte (mb, 2);
  <D.24548>:
  i = 0;
  goto <D.19894>;
  <D.19893>:
  D.24549 = sig->hasthis;
  D.24550 = (int) D.24549;
  D.24551 = D.24550 + i;
  D.24552 = (unsigned int) D.24551;
  mono_mb_emit_ldarg (mb, D.24552);
  i = i + 1;
  <D.19894>:
  D.24553 = sig->param_count;
  D.24554 = (int) D.24553;
  if (D.24554 > i) goto <D.19893>; else goto <D.19895>;
  <D.19895>:
  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.24555>; else goto <D.24556>;
  <D.24555>:
  emit_thread_interrupt_checkpoint (mb);
  <D.24556>:
  mono_mb_emit_byte (mb, 42);
  D.24545 = mono_defaults.corlib;
  csig = signature_dup (D.24545, sig);
  csig->pinvoke = 0;
  D.24557 = BIT_FIELD_REF <*csig, 32, 64>;
  D.24558 = D.24557 & 4128768;
  if (D.24558 == 327680) goto <D.24559>; else goto <D.24560>;
  <D.24559>:
  csig->call_convention = 0;
  <D.24560>:
  D.24561 = csig->param_count;
  D.24562 = (int) D.24561;
  D.24563 = D.24562 + 16;
  res = mono_mb_create_method (mb, csig, D.24563);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 15);
  info->d.icall.func = func;
  mono_marshal_set_wrapper_info (res, info);
  D.24564 = res;
  return D.24564;
}


signature_dup_add_this (struct MonoImage * image, struct MonoMethodSignature * sig, struct MonoClass * klass)
{
  short unsigned int D.24566;
  int D.24567;
  int D.24568;
  unsigned int D.24569;
  short unsigned int D.24570;
  int D.24571;
  struct MonoType * D.24572;
  struct MonoType * iftmp.178;
  unsigned int D.24574;
  unsigned int D.24575;
  struct MonoMethodSignature * D.24579;
  struct MonoMethodSignature * res;
  int i;

  D.24566 = sig->param_count;
  D.24567 = (int) D.24566;
  D.24568 = D.24567 + 1;
  D.24569 = (unsigned int) D.24568;
  res = mono_metadata_signature_alloc (image, D.24569);
  memcpy (res, sig, 12);
  D.24566 = sig->param_count;
  D.24570 = D.24566 + 1;
  res->param_count = D.24570;
  res->hasthis = 0;
  D.24566 = sig->param_count;
  D.24567 = (int) D.24566;
  i = D.24567 + -1;
  goto <D.19573>;
  <D.19572>:
  D.24571 = i + 1;
  D.24572 = sig->params[i];
  res->params[D.24571] = D.24572;
  i = i + -1;
  <D.19573>:
  if (i >= 0) goto <D.19572>; else goto <D.19574>;
  <D.19574>:
  D.24574 = BIT_FIELD_REF <*klass, 32, 160>;
  D.24575 = D.24574 & 8;
  if (D.24575 != 0) goto <D.24576>; else goto <D.24577>;
  <D.24576>:
  iftmp.178 = &klass->this_arg;
  goto <D.24578>;
  <D.24577>:
  iftmp.178 = &klass->byval_arg;
  <D.24578>:
  res->params[0] = iftmp.178;
  D.24579 = res;
  return D.24579;
}


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 int D.24583;
  unsigned int D.24584;
  _Bool D.24585;
  long int D.24586;
  long int D.24587;
  struct MonoMethod * D.24590;
  struct MonoClass * D.24591;
  struct MonoImage * D.24592;
  struct MonoClass * D.24595;
  struct MonoType * D.24596;
  struct MonoClass * D.24597;
  struct MonoType * D.24598;
  struct MonoType * D.24599;
  int D.24600;
  struct MonoMarshalSpec * D.24603;
  <unnamed type> D.24606;
  short unsigned int D.24609;
  unsigned int D.24610;
  unsigned int D.24611;
  int D.24612;
  int D.24613;
  unsigned int D.24614;
  unsigned int D.24615;
  void * D.24616;
  unsigned int i.179;
  unsigned int D.24618;
  int * D.24619;
  int D.24620;
  struct MonoType * D.24621;
  sizetype i.180;
  sizetype D.24623;
  sizetype D.24624;
  struct MonoMarshalSpec * * D.24625;
  struct MonoMarshalSpec * D.24626;
  struct MonoType * * D.24627;
  int D.24628;
  int D.24631;
  unsigned int D.24635;
  unsigned int D.24636;
  struct MonoMethod * D.24639;
  short unsigned int D.24644;
  int D.24645;
  int D.24646;
  struct MonoMethodSignature * get_last_error_sig.181;
  struct MonoImage * D.24652;
  struct MonoMethodSignature * get_last_error_sig.182;
  unsigned int D.24654;
  unsigned int D.24655;
  unsigned char D.24658;
  <unnamed type> D.24661;
  unsigned int D.24663;
  unsigned int D.24664;
  struct MonoClass * D.24667;
  struct MonoType * D.24668;
  unsigned char D.24669;
  int D.24670;
  <unnamed type> D.24678;
  unsigned char D.24680;
  int D.24681;
  int D.24683;
  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.24581>; else goto <D.24582>;
      <D.24581>:
      D.24583 = BIT_FIELD_REF <*sig, 32, 64>;
      D.24584 = D.24583 & 4194304;
      D.24585 = D.24584 != 0;
      D.24586 = (long int) D.24585;
      D.24587 = __builtin_expect (D.24586, 0);
      if (D.24587 != 0) goto <D.24588>; else goto <D.24589>;
      <D.24588>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8635, "!sig->hasthis");
      <D.24589>:
      param_shift = param_shift + 1;
      <D.24582>:
      D.24590 = mb->method;
      D.24591 = D.24590->klass;
      D.24592 = D.24591->image;
      csig = signature_dup (D.24592, sig);
      csig->pinvoke = 1;
      m.csig = csig;
      m.image = image;
      D.24583 = BIT_FIELD_REF <*sig, 32, 64>;
      D.24584 = D.24583 & 4194304;
      if (D.24584 != 0) goto <D.24593>; else goto <D.24594>;
      <D.24593>:
      param_shift = param_shift + 1;
      <D.24594>:
      D.24595 = mono_defaults.int_class;
      D.24596 = &D.24595->byval_arg;
      mono_mb_add_local (mb, D.24596);
      D.24595 = mono_defaults.int_class;
      D.24596 = &D.24595->byval_arg;
      mono_mb_add_local (mb, D.24596);
      D.24597 = mono_defaults.boolean_class;
      D.24598 = &D.24597->byval_arg;
      mono_mb_add_local (mb, D.24598);
      mono_mb_emit_icon (mb, 0);
      mono_mb_emit_stloc (mb, 2);
      D.24599 = sig->ret;
      D.24600 = mono_type_is_void (D.24599);
      if (D.24600 == 0) goto <D.24601>; else goto <D.24602>;
      <D.24601>:
      D.24599 = sig->ret;
      mono_mb_add_local (mb, D.24599);
      <D.24602>:
      D.24603 = *mspecs;
      if (D.24603 != 0B) goto <D.24604>; else goto <D.24605>;
      <D.24604>:
      D.24603 = *mspecs;
      D.24606 = D.24603->native;
      if (D.24606 == 44) goto <D.24607>; else goto <D.24608>;
      <D.24607>:
      D.24595 = mono_defaults.int_class;
      D.24596 = &D.24595->byval_arg;
      csig->ret = D.24596;
      <D.24608>:
      <D.24605>:
      D.24609 = sig->param_count;
      D.24610 = (unsigned int) D.24609;
      D.24611 = D.24610 * 4;
      tmp_locals = __builtin_alloca (D.24611);
      D.24609 = sig->param_count;
      D.24612 = (int) D.24609;
      D.24613 = D.24612 + 1;
      D.24614 = (unsigned int) D.24613;
      D.24615 = D.24614 * 4;
      D.24616 = __builtin_alloca (D.24615);
      m.orig_conv_args = D.24616;
      i = 0;
      goto <D.20383>;
      <D.20382>:
      i.179 = (unsigned int) i;
      D.24618 = i.179 * 4;
      D.24619 = tmp_locals + D.24618;
      D.24620 = i + param_shift;
      D.24621 = sig->params[i];
      i.180 = (sizetype) i;
      D.24623 = i.180 + 1;
      D.24624 = D.24623 * 4;
      D.24625 = mspecs + D.24624;
      D.24626 = *D.24625;
      D.24627 = &csig->params[i];
      D.24628 = emit_marshal (&m, D.24620, D.24621, D.24626, 0, D.24627, 0);
      *D.24619 = D.24628;
      i = i + 1;
      <D.20383>:
      D.24609 = sig->param_count;
      D.24612 = (int) D.24609;
      if (D.24612 > i) goto <D.20382>; else goto <D.20384>;
      <D.20384>:
      D.24583 = BIT_FIELD_REF <*sig, 32, 64>;
      D.24584 = D.24583 & 4194304;
      if (D.24584 != 0) goto <D.24629>; else goto <D.24630>;
      <D.24629>:
      mono_mb_emit_byte (mb, 2);
      <D.24630>:
      i = 0;
      goto <D.20386>;
      <D.20385>:
      D.24620 = i + param_shift;
      D.24621 = sig->params[i];
      i.180 = (sizetype) i;
      D.24623 = i.180 + 1;
      D.24624 = D.24623 * 4;
      D.24625 = mspecs + D.24624;
      D.24626 = *D.24625;
      i.179 = (unsigned int) i;
      D.24618 = i.179 * 4;
      D.24619 = tmp_locals + D.24618;
      D.24631 = *D.24619;
      emit_marshal (&m, D.24620, D.24621, D.24626, D.24631, 0B, 1);
      i = i + 1;
      <D.20386>:
      D.24609 = sig->param_count;
      D.24612 = (int) D.24609;
      if (D.24612 > i) goto <D.20385>; else goto <D.20387>;
      <D.20387>:
      if (func_param != 0) goto <D.24632>; else goto <D.24633>;
      <D.24632>:
      mono_mb_emit_byte (mb, 2);
      D.24595 = mono_defaults.int_class;
      mono_mb_emit_op (mb, 121, D.24595);
      mono_mb_emit_byte (mb, 77);
      mono_mb_emit_calli (mb, csig);
      goto <D.24634>;
      <D.24633>:
      D.24590 = mb->method;
      D.24591 = D.24590->klass;
      D.24635 = D.24591->flags;
      D.24636 = D.24635 & 4096;
      if (D.24636 != 0) goto <D.24637>; else goto <D.24638>;
      <D.24637>:
      D.24639 = &piinfo->method;
      mono_mb_emit_cominterop_call (mb, csig, D.24639);
      goto <D.24640>;
      <D.24638>:
      if (aot != 0) goto <D.24641>; else goto <D.24642>;
      <D.24641>:
      mono_mb_emit_byte (mb, 240);
      D.24639 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.24639);
      mono_mb_emit_calli (mb, csig);
      goto <D.24643>;
      <D.24642>:
      mono_mb_emit_native_call (mb, csig, func);
      <D.24643>:
      <D.24640>:
      <D.24634>:
      D.24644 = piinfo->piflags;
      D.24645 = (int) D.24644;
      D.24646 = D.24645 & 64;
      if (D.24646 != 0) goto <D.24647>; else goto <D.24648>;
      <D.24647>:
      get_last_error_sig.181 = get_last_error_sig;
      if (get_last_error_sig.181 == 0B) goto <D.24650>; else goto <D.24651>;
      <D.24650>:
      D.24652 = mono_defaults.corlib;
      get_last_error_sig.182 = mono_metadata_signature_alloc (D.24652, 0);
      get_last_error_sig = get_last_error_sig.182;
      get_last_error_sig.181 = get_last_error_sig;
      D.24595 = mono_defaults.int_class;
      D.24596 = &D.24595->byval_arg;
      get_last_error_sig.181->ret = D.24596;
      get_last_error_sig.181 = get_last_error_sig;
      get_last_error_sig.181->pinvoke = 1;
      <D.24651>:
      mono_mb_emit_icall (mb, mono_marshal_set_last_error);
      <D.24648>:
      D.24599 = sig->ret;
      D.24654 = BIT_FIELD_REF <*D.24599, 32, 32>;
      D.24655 = D.24654 & 1073741824;
      if (D.24655 == 0) goto <D.24656>; else goto <D.24657>;
      <D.24656>:
      {
        struct MonoMarshalSpec * spec;

        spec = *mspecs;
        D.24599 = sig->ret;
        D.24658 = D.24599->type;
        type = (int) D.24658;
        if (spec != 0B) goto <D.24660>; else goto <D.24659>;
        <D.24660>:
        D.24661 = spec->native;
        if (D.24661 == 44) goto <D.24662>; else goto <D.24659>;
        <D.24662>:
        D.24599 = sig->ret;
        emit_marshal (&m, 0, D.24599, spec, 0, 0B, 3);
        goto <D.20391>;
        <D.24659>:
        handle_enum:
        switch (type) <default: <D.20416>, case 1: <D.20390>, case 2: <D.20409>, case 3: <D.20412>, case 4: <D.20393>, case 5: <D.20394>, case 6: <D.20395>, case 7: <D.20396>, case 8: <D.20397>, case 9: <D.20398>, case 10: <D.20403>, case 11: <D.20404>, case 12: <D.20401>, case 13: <D.20402>, case 14: <D.20406>, case 15: <D.20413>, case 17: <D.20392>, case 18: <D.20407>, case 20: <D.20410>, case 21: <D.20414>, case 22: <D.20415>, case 24: <D.20399>, case 25: <D.20400>, case 27: <D.20405>, case 28: <D.20408>, case 29: <D.20411>>
        <D.20390>:
        goto <D.20391>;
        <D.20392>:
        D.24599 = sig->ret;
        klass = D.24599->data.klass;
        D.24663 = BIT_FIELD_REF <*klass, 32, 160>;
        D.24664 = D.24663 & 16;
        if (D.24664 != 0) goto <D.24665>; else goto <D.24666>;
        <D.24665>:
        D.24599 = sig->ret;
        D.24667 = D.24599->data.klass;
        D.24668 = mono_class_enum_basetype (D.24667);
        D.24669 = D.24668->type;
        type = (int) D.24669;
        goto handle_enum;
        <D.24666>:
        D.24599 = sig->ret;
        emit_marshal (&m, 0, D.24599, spec, 0, 0B, 3);
        goto <D.20391>;
        <D.20393>:
        <D.20394>:
        <D.20395>:
        <D.20396>:
        <D.20397>:
        <D.20398>:
        <D.20399>:
        <D.20400>:
        <D.20401>:
        <D.20402>:
        <D.20403>:
        <D.20404>:
        <D.20405>:
        <D.20406>:
        <D.20407>:
        <D.20408>:
        <D.20409>:
        <D.20410>:
        <D.20411>:
        <D.20412>:
        <D.20413>:
        <D.20414>:
        D.24599 = sig->ret;
        emit_marshal (&m, 0, D.24599, spec, 0, 0B, 3);
        goto <D.20391>;
        <D.20415>:
        <D.20416>:
        D.24599 = sig->ret;
        D.24658 = D.24599->type;
        D.24670 = (int) D.24658;
        monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.24670);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8782);
        <D.20391>:
      }
      goto <D.24671>;
      <D.24657>:
      mono_mb_emit_stloc (mb, 3);
      <D.24671>:
      if (check_exceptions != 0) goto <D.24672>; else goto <D.24673>;
      <D.24672>:
      emit_thread_interrupt_checkpoint (mb);
      <D.24673>:
      i = 0;
      goto <D.20428>;
      <D.20427>:
      {
        struct MonoType * t;
        struct MonoMarshalSpec * spec;

        t = sig->params[i];
        i.180 = (sizetype) i;
        D.24623 = i.180 + 1;
        D.24624 = D.24623 * 4;
        D.24625 = mspecs + D.24624;
        spec = *D.24625;
        argnum = i + param_shift;
        if (spec != 0B) goto <D.24676>; else goto <D.24677>;
        <D.24676>:
        D.24678 = spec->native;
        if (D.24678 == 44) goto <D.24674>; else goto <D.24679>;
        <D.24679>:
        D.24678 = spec->native;
        if (D.24678 == 40) goto <D.24674>; else goto <D.24675>;
        <D.24674>:
        i.179 = (unsigned int) i;
        D.24618 = i.179 * 4;
        D.24619 = tmp_locals + D.24618;
        D.24631 = *D.24619;
        emit_marshal (&m, argnum, t, spec, D.24631, 0B, 2);
        // predicted unlikely by continue predictor.
        goto <D.20419>;
        <D.24675>:
        <D.24677>:
        D.24680 = t->type;
        D.24681 = (int) D.24680;
        switch (D.24681) <default: <D.24682>, case 2: <D.20425>, case 14: <D.20420>, case 17: <D.20421>, case 18: <D.20422>, case 28: <D.20423>, case 29: <D.20424>>
        <D.20420>:
        <D.20421>:
        <D.20422>:
        <D.20423>:
        <D.20424>:
        <D.20425>:
        i.179 = (unsigned int) i;
        D.24618 = i.179 * 4;
        D.24619 = tmp_locals + D.24618;
        D.24631 = *D.24619;
        emit_marshal (&m, argnum, t, spec, D.24631, 0B, 2);
        goto <D.20426>;
        <D.24682>:
        <D.20426>:
      }
      <D.20419>:
      i = i + 1;
      <D.20428>:
      D.24609 = sig->param_count;
      D.24612 = (int) D.24609;
      if (D.24612 > i) goto <D.20427>; else goto <D.20429>;
      <D.20429>:
      D.24599 = sig->ret;
      D.24683 = mono_type_is_void (D.24599);
      if (D.24683 == 0) goto <D.24684>; else goto <D.24685>;
      <D.24684>:
      mono_mb_emit_ldloc (mb, 3);
      <D.24685>:
      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.24688;
  <unnamed type> D.24691;
  int D.24694;
  unsigned char D.24699;
  int D.24700;
  struct MonoClass * D.24701;
  struct MonoClass * D.24702;
  unsigned int D.24713;
  <unnamed type> D.24721;
  struct MonoClass * D.24726;
  int D.24731;
  int D.24734;

  D.24688 = mono_class_from_mono_type (t);
  mono_marshal_load_type_info (D.24688);
  if (spec != 0B) goto <D.24689>; else goto <D.24690>;
  <D.24689>:
  D.24691 = spec->native;
  if (D.24691 == 44) goto <D.24692>; else goto <D.24693>;
  <D.24692>:
  D.24694 = emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24693>:
  <D.24690>:
  if (spec != 0B) goto <D.24695>; else goto <D.24696>;
  <D.24695>:
  D.24691 = spec->native;
  if (D.24691 == 40) goto <D.24697>; else goto <D.24698>;
  <D.24697>:
  D.24694 = emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24698>:
  <D.24696>:
  D.24699 = t->type;
  D.24700 = (int) D.24699;
  switch (D.24700) <default: <D.24737>, case 2: <D.20345>, case 3: <D.20347>, case 4: <D.20348>, case 5: <D.20349>, case 6: <D.20350>, case 7: <D.20351>, case 8: <D.20352>, case 9: <D.20353>, case 10: <D.20358>, case 11: <D.20359>, case 12: <D.20356>, case 13: <D.20357>, case 14: <D.20340>, case 15: <D.20346>, case 17: <D.20339>, case 18: <D.20341>, case 20: <D.20343>, case 21: <D.20361>, case 24: <D.20354>, case 25: <D.20355>, case 27: <D.20360>, case 28: <D.20342>, case 29: <D.20344>>
  <D.20339>:
  D.24701 = t->data.klass;
  D.24702 = mono_defaults.handleref_class;
  if (D.24701 == D.24702) goto <D.24703>; else goto <D.24704>;
  <D.24703>:
  D.24694 = emit_marshal_handleref (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24704>:
  D.24694 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20340>:
  D.24694 = emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20341>:
  <D.20342>:
  if (spec != 0B) goto <D.24705>; else goto <D.24706>;
  <D.24705>:
  D.24691 = spec->native;
  if (D.24691 == 27) goto <D.24707>; else goto <D.24708>;
  <D.24707>:
  D.24694 = emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24708>:
  <D.24706>:
  if (spec != 0B) goto <D.24711>; else goto <D.24712>;
  <D.24711>:
  D.24691 = spec->native;
  D.24713 = D.24691 + 4294967271;
  if (D.24713 <= 1) goto <D.24709>; else goto <D.24714>;
  <D.24714>:
  D.24691 = spec->native;
  if (D.24691 == 28) goto <D.24709>; else goto <D.24710>;
  <D.24709>:
  D.24694 = mono_cominterop_emit_marshal_com_interface (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24710>:
  <D.24712>:
  if (spec != 0B) goto <D.24717>; else goto <D.24718>;
  <D.24717>:
  D.24691 = spec->native;
  if (D.24691 == 29) goto <D.24719>; else goto <D.24720>;
  <D.24719>:
  D.24721 = spec->data.safearray_data.elem_type;
  if (D.24721 == 12) goto <D.24722>; else goto <D.24723>;
  <D.24722>:
  if (action == 2) goto <D.24715>; else goto <D.24724>;
  <D.24724>:
  if (action == 0) goto <D.24715>; else goto <D.24725>;
  <D.24725>:
  if (action == 1) goto <D.24715>; else goto <D.24716>;
  <D.24715>:
  D.24694 = mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24716>:
  <D.24723>:
  <D.24720>:
  <D.24718>:
  D.24726 = mono_defaults.safehandle_class;
  if (D.24726 != 0B) goto <D.24727>; else goto <D.24728>;
  <D.24727>:
  D.24701 = t->data.klass;
  if (D.24701 != 0B) goto <D.24729>; else goto <D.24730>;
  <D.24729>:
  D.24701 = t->data.klass;
  D.24726 = mono_defaults.safehandle_class;
  D.24731 = mono_class_is_subclass_of (D.24701, D.24726, 0);
  if (D.24731 != 0) goto <D.24732>; else goto <D.24733>;
  <D.24732>:
  D.24694 = emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24733>:
  <D.24730>:
  <D.24728>:
  D.24694 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20343>:
  <D.20344>:
  D.24694 = emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20345>:
  D.24694 = emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20346>:
  D.24694 = emit_marshal_ptr (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20347>:
  D.24694 = emit_marshal_char (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20348>:
  <D.20349>:
  <D.20350>:
  <D.20351>:
  <D.20352>:
  <D.20353>:
  <D.20354>:
  <D.20355>:
  <D.20356>:
  <D.20357>:
  <D.20358>:
  <D.20359>:
  <D.20360>:
  D.24694 = emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.20361>:
  D.24734 = mono_type_generic_inst_is_valuetype (t);
  if (D.24734 != 0) goto <D.24735>; else goto <D.24736>;
  <D.24735>:
  D.24694 = emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24736>:
  D.24694 = emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
  return D.24694;
  <D.24737>:
  D.24694 = conv_arg;
  return D.24694;
}


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.24742;
  struct MonoClass * ICustomMarshaler.184;
  struct MonoMethod * cleanup_native.185;
  struct MonoMethod * cleanup_native.186;
  _Bool D.24748;
  long int D.24749;
  long int D.24750;
  struct MonoMethod * cleanup_managed.187;
  struct MonoMethod * cleanup_managed.188;
  _Bool D.24755;
  long int D.24756;
  long int D.24757;
  struct MonoMethod * marshal_managed_to_native.189;
  struct MonoMethod * marshal_managed_to_native.190;
  _Bool D.24762;
  long int D.24763;
  long int D.24764;
  struct MonoMethod * marshal_native_to_managed.191;
  struct MonoMethod * marshal_native_to_managed.192;
  _Bool D.24769;
  long int D.24770;
  long int D.24771;
  char * D.24774;
  struct MonoImage * D.24775;
  _Bool D.24776;
  long int D.24777;
  long int D.24778;
  _Bool D.24781;
  long int D.24782;
  long int D.24783;
  int D.24786;
  const char * D.24789;
  struct MonoType * D.24794;
  unsigned char D.24795;
  struct MonoClass * D.24797;
  struct MonoType * D.24799;
  unsigned char D.24800;
  int D.24808;
  unsigned char D.24809;
  int D.24810;
  struct MonoClass * D.24811;
  struct MonoType * D.24812;
  unsigned int conv_arg.193;
  unsigned int D.24814;
  unsigned int D.24815;
  short unsigned int D.24818;
  int D.24819;
  int D.24820;
  unsigned int D.24824;
  unsigned int D.24825;
  unsigned int argnum.194;
  unsigned int D.24830;
  char * D.24831;
  gchar * D.24832;
  struct MonoClass * D.24837;
  unsigned int pos2.195;
  unsigned int D.24839;
  gchar * D.24842;
  gchar * D.24846;
  gchar * D.24847;
  int D.24851;
  unsigned int D.24852;
  gchar * D.24853;
  struct MonoClass * D.24854;
  struct MonoType * D.24855;
  unsigned int D.24861;
  gchar * D.24862;
  _Bool D.24865;
  long int D.24866;
  long int D.24867;
  int D.24870;
  unsigned int D.24871;
  gchar * D.24872;
  unsigned int D.24873;
  gchar * D.24876;
  gchar * D.24877;
  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.24740>; else goto <D.24741>;
  <D.24740>:
  D.24742 = mono_defaults.corlib;
  ICustomMarshaler.184 = mono_class_from_name (D.24742, "System.Runtime.InteropServices", "ICustomMarshaler");
  ICustomMarshaler = ICustomMarshaler.184;
  ICustomMarshaler.183 = ICustomMarshaler;
  if (ICustomMarshaler.183 == 0B) goto <D.24744>; else goto <D.24745>;
  <D.24744>:
  exception_msg = monoeg_strdup ("Current profile doesn\'t support ICustomMarshaler");
  goto handle_exception;
  <D.24745>:
  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.24748 = cleanup_native.186 == 0B;
  D.24749 = (long int) D.24748;
  D.24750 = __builtin_expect (D.24749, 0);
  if (D.24750 != 0) goto <D.24751>; else goto <D.24752>;
  <D.24751>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5887, "cleanup_native");
  <D.24752>:
  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.24755 = cleanup_managed.188 == 0B;
  D.24756 = (long int) D.24755;
  D.24757 = __builtin_expect (D.24756, 0);
  if (D.24757 != 0) goto <D.24758>; else goto <D.24759>;
  <D.24758>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5889, "cleanup_managed");
  <D.24759>:
  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.24762 = marshal_managed_to_native.190 == 0B;
  D.24763 = (long int) D.24762;
  D.24764 = __builtin_expect (D.24763, 0);
  if (D.24764 != 0) goto <D.24765>; else goto <D.24766>;
  <D.24765>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5891, "marshal_managed_to_native");
  <D.24766>:
  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.24769 = marshal_native_to_managed.192 == 0B;
  D.24770 = (long int) D.24769;
  D.24771 = __builtin_expect (D.24770, 0);
  if (D.24771 != 0) goto <D.24772>; else goto <D.24773>;
  <D.24772>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5893, "marshal_native_to_managed");
  <D.24773>:
  <D.24741>:
  D.24774 = spec->data.custom_data.custom_name;
  D.24775 = m->image;
  mtype = mono_reflection_type_from_name (D.24774, D.24775);
  D.24776 = mtype == 0B;
  D.24777 = (long int) D.24776;
  D.24778 = __builtin_expect (D.24777, 0);
  if (D.24778 != 0) goto <D.24779>; else goto <D.24780>;
  <D.24779>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5897, "mtype != NULL");
  <D.24780>:
  mklass = mono_class_from_mono_type (mtype);
  D.24781 = mklass == 0B;
  D.24782 = (long int) D.24781;
  D.24783 = __builtin_expect (D.24782, 0);
  if (D.24783 != 0) goto <D.24784>; else goto <D.24785>;
  <D.24784>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 5899, "mklass != NULL");
  <D.24785>:
  ICustomMarshaler.183 = ICustomMarshaler;
  D.24786 = mono_class_is_assignable_from (ICustomMarshaler.183, mklass);
  if (D.24786 == 0) goto <D.24787>; else goto <D.24788>;
  <D.24787>:
  D.24789 = mklass->name;
  exception_msg = monoeg_g_strdup_printf ("Custom marshaler \'%s\' does not implement the ICustomMarshaler interface.", D.24789);
  <D.24788>:
  get_instance = mono_class_get_method_from_name_flags (mklass, "GetInstance", 1, 16);
  if (get_instance != 0B) goto <D.24790>; else goto <D.24791>;
  <D.24790>:
  {
    struct MonoMethodSignature * get_sig;

    get_sig = mono_method_signature (get_instance);
    D.24794 = get_sig->ret;
    D.24795 = D.24794->type;
    if (D.24795 != 18) goto <D.24792>; else goto <D.24796>;
    <D.24796>:
    D.24794 = get_sig->ret;
    D.24797 = mono_class_from_mono_type (D.24794);
    ICustomMarshaler.183 = ICustomMarshaler;
    if (D.24797 != ICustomMarshaler.183) goto <D.24792>; else goto <D.24798>;
    <D.24798>:
    D.24799 = get_sig->params[0];
    D.24800 = D.24799->type;
    if (D.24800 != 14) goto <D.24792>; else goto <D.24793>;
    <D.24792>:
    get_instance = 0B;
    <D.24793>:
  }
  <D.24791>:
  if (get_instance == 0B) goto <D.24801>; else goto <D.24802>;
  <D.24801>:
  D.24789 = 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.24789);
  <D.24802>:
  handle_exception:
  if (exception_msg != 0B) goto <D.24803>; else goto <D.24804>;
  <D.24803>:
  switch (action) <default: <D.19924>, case 0: <D.19919>, case 1: <D.19923>, case 3: <D.19920>, case 6: <D.19921>>
  <D.19919>:
  <D.19920>:
  <D.19921>:
  if (action == 3) goto <D.24805>; else goto <D.24807>;
  <D.24807>:
  if (action == 6) goto <D.24805>; else goto <D.24806>;
  <D.24805>:
  mono_mb_emit_byte (mb, 38);
  <D.24806>:
  mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
  monoeg_g_free (exception_msg);
  goto <D.19922>;
  <D.19923>:
  mono_mb_emit_byte (mb, 20);
  goto <D.19922>;
  <D.19924>:
  goto <D.19922>;
  <D.19922>:
  D.24808 = 0;
  return D.24808;
  <D.24804>:
  switch (action) <default: <D.19941>, case 0: <D.19925>, case 1: <D.19936>, case 2: <D.19935>, case 3: <D.19937>, case 4: <D.19938>, case 5: <D.19940>, case 6: <D.19939>>
  <D.19925>:
  D.24809 = t->type;
  D.24810 = (int) D.24809;
  switch (D.24810) <default: <D.19933>, case 14: <D.19928>, case 17: <D.19931>, case 18: <D.19926>, case 20: <D.19929>, case 28: <D.19927>, case 29: <D.19930>>
  <D.19926>:
  <D.19927>:
  <D.19928>:
  <D.19929>:
  <D.19930>:
  <D.19931>:
  goto <D.19932>;
  <D.19933>:
  D.24809 = t->type;
  D.24810 = (int) D.24809;
  monoeg_g_log (0B, 16, "custom marshalling of type %x is currently not supported", D.24810);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 5955);
  <D.19932>:
  D.24811 = mono_defaults.int_class;
  D.24812 = &D.24811->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.24812);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24816>; else goto <D.24817>;
  <D.24816>:
  D.24818 = t->attrs;
  D.24819 = (int) D.24818;
  D.24820 = D.24819 & 2;
  if (D.24820 != 0) goto <D.19934>; else goto <D.24821>;
  <D.24821>:
  <D.24817>:
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 == 0) goto <D.24822>; else goto <D.24823>;
  <D.24822>:
  D.24818 = t->attrs;
  D.24824 = (unsigned int) D.24818;
  D.24825 = D.24824 & 3;
  if (D.24825 == 2) goto <D.19934>; else goto <D.24826>;
  <D.24826>:
  <D.24823>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24828>; else goto <D.24829>;
  <D.24828>:
  mono_mb_emit_byte (mb, 77);
  <D.24829>:
  D.24830 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24830;
  D.24831 = spec->data.custom_data.cookie;
  D.24832 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24832);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24833>; else goto <D.24834>;
  <D.24833>:
  mono_mb_emit_byte (mb, 80);
  <D.24834>:
  D.24809 = t->type;
  if (D.24809 == 17) goto <D.24835>; else goto <D.24836>;
  <D.24835>:
  D.24811 = mono_defaults.int_class;
  D.24812 = &D.24811->byval_arg;
  *conv_arg_type = D.24812;
  D.24837 = mono_class_from_mono_type (t);
  mono_mb_emit_op (mb, 140, D.24837);
  <D.24836>:
  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.19934>;
  <D.19935>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.24839 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24839;
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24840>; else goto <D.24841>;
  <D.24840>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24831 = spec->data.custom_data.cookie;
  D.24842 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24842);
  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.24843>;
  <D.24841>:
  D.24818 = t->attrs;
  D.24819 = (int) D.24818;
  D.24820 = D.24819 & 2;
  if (D.24820 != 0) goto <D.24844>; else goto <D.24845>;
  <D.24844>:
  D.24831 = spec->data.custom_data.cookie;
  D.24846 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24846);
  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.24845>:
  <D.24843>:
  D.24831 = spec->data.custom_data.cookie;
  D.24847 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24847);
  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.19934>;
  <D.19936>:
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24848>; else goto <D.24849>;
  <D.24848>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.193);
  goto <D.24850>;
  <D.24849>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  <D.24850>:
  goto <D.19934>;
  <D.19937>:
  D.24811 = mono_defaults.int_class;
  D.24812 = &D.24811->byval_arg;
  D.24851 = mono_mb_add_local (mb, D.24812);
  loc1 = (guint32) D.24851;
  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.24852 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24852;
  D.24831 = spec->data.custom_data.cookie;
  D.24853 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24853);
  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.19934>;
  <D.19938>:
  D.24854 = mono_defaults.object_class;
  D.24855 = &D.24854->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.24855);
  mono_mb_emit_byte (mb, 20);
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.193);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24856>; else goto <D.24857>;
  <D.24856>:
  D.24818 = t->attrs;
  D.24819 = (int) D.24818;
  D.24820 = D.24819 & 2;
  if (D.24820 != 0) goto <D.19934>; else goto <D.24858>;
  <D.24858>:
  <D.24857>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24859>; else goto <D.24860>;
  <D.24859>:
  mono_mb_emit_byte (mb, 77);
  <D.24860>:
  D.24861 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24861;
  D.24831 = spec->data.custom_data.cookie;
  D.24862 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24862);
  mono_mb_emit_op (mb, 40, get_instance);
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24863>; else goto <D.24864>;
  <D.24863>:
  mono_mb_emit_byte (mb, 77);
  <D.24864>:
  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.19934>;
  <D.19939>:
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  D.24865 = D.24815 != 0;
  D.24866 = (long int) D.24865;
  D.24867 = __builtin_expect (D.24866, 0);
  if (D.24867 != 0) goto <D.24868>; else goto <D.24869>;
  <D.24868>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6102, "!t->byref");
  <D.24869>:
  D.24854 = mono_defaults.object_class;
  D.24855 = &D.24854->byval_arg;
  D.24870 = mono_mb_add_local (mb, D.24855);
  loc1 = (guint32) D.24870;
  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.24871 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24871;
  D.24831 = spec->data.custom_data.cookie;
  D.24872 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24872);
  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.19934>;
  <D.19940>:
  conv_arg.193 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.193);
  D.24873 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.24873;
  D.24814 = BIT_FIELD_REF <*t, 32, 32>;
  D.24815 = D.24814 & 1073741824;
  if (D.24815 != 0) goto <D.24874>; else goto <D.24875>;
  <D.24874>:
  argnum.194 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.194);
  D.24831 = spec->data.custom_data.cookie;
  D.24876 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24876);
  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.24875>:
  D.24831 = spec->data.custom_data.cookie;
  D.24877 = monoeg_strdup (D.24831);
  mono_mb_emit_ldstr (mb, D.24877);
  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.19934>;
  <D.19941>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6159);
  <D.19934>:
  D.24808 = conv_arg;
  return D.24808;
}


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.24881;
  unsigned char D.24882;
  _Bool D.24883;
  long int D.24884;
  long int D.24885;
  unsigned int D.24888;
  unsigned int D.24889;
  _Bool D.24890;
  long int D.24891;
  long int D.24892;
  struct MonoClass * D.24895;
  struct MonoType * D.24896;
  unsigned int argnum.196;
  int encoding.197;
  short unsigned int D.24899;
  int D.24900;
  unsigned int conv_arg.198;
  int encoding.199;
  int D.24903;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.19958>, case 0: <D.19952>, case 1: <D.19955>, case 2: <D.19956>>
  <D.19952>:
  {
    MonoMarshalNative encoding;

    D.24881 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.24881, 0B);
    D.24882 = t->type;
    D.24883 = D.24882 != 28;
    D.24884 = (long int) D.24883;
    D.24885 = __builtin_expect (D.24884, 0);
    if (D.24885 != 0) goto <D.24886>; else goto <D.24887>;
    <D.24886>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6179, "t->type == MONO_TYPE_OBJECT");
    <D.24887>:
    D.24888 = BIT_FIELD_REF <*t, 32, 32>;
    D.24889 = D.24888 & 1073741824;
    D.24890 = D.24889 != 0;
    D.24891 = (long int) D.24890;
    D.24892 = __builtin_expect (D.24891, 0);
    if (D.24892 != 0) goto <D.24893>; else goto <D.24894>;
    <D.24893>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6180, "!t->byref");
    <D.24894>:
    D.24895 = mono_defaults.int_class;
    D.24896 = &D.24895->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.24896);
    argnum.196 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.196);
    encoding.197 = (int) encoding;
    mono_mb_emit_icon (mb, encoding.197);
    D.24899 = t->attrs;
    D.24900 = (int) D.24899;
    mono_mb_emit_icon (mb, D.24900);
    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.19954>;
  }
  <D.19955>:
  conv_arg.198 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.198);
  goto <D.19954>;
  <D.19956>:
  {
    MonoMarshalNative encoding;

    D.24881 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.24881, 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.24899 = t->attrs;
    D.24900 = (int) D.24899;
    mono_mb_emit_icon (mb, D.24900);
    mono_mb_emit_icall (mb, mono_marshal_free_asany);
    goto <D.19954>;
  }
  <D.19958>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6207);
  <D.19954>:
  D.24903 = conv_arg;
  return D.24903;
}


mono_marshal_get_string_encoding (struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  <unnamed type> D.24907;
  <unnamed type> D.24910;
  MonoMarshalNative D.24915;
  short unsigned int D.24919;
  int D.24920;
  int D.24921;

  if (spec != 0B) goto <D.24905>; else goto <D.24906>;
  <D.24905>:
  D.24907 = spec->native;
  if (D.24907 == 42) goto <D.24908>; else goto <D.24909>;
  <D.24908>:
  D.24910 = spec->data.array_data.elem_type;
  if (D.24910 != 0) goto <D.24911>; else goto <D.24912>;
  <D.24911>:
  D.24910 = spec->data.array_data.elem_type;
  if (D.24910 != 80) goto <D.24913>; else goto <D.24914>;
  <D.24913>:
  D.24915 = spec->data.array_data.elem_type;
  return D.24915;
  <D.24914>:
  <D.24912>:
  goto <D.24916>;
  <D.24909>:
  D.24915 = spec->native;
  return D.24915;
  <D.24916>:
  <D.24906>:
  if (piinfo == 0B) goto <D.24917>; else goto <D.24918>;
  <D.24917>:
  D.24915 = 20;
  return D.24915;
  <D.24918>:
  D.24919 = piinfo->piflags;
  D.24920 = (int) D.24919;
  D.24921 = D.24920 & 6;
  switch (D.24921) <default: <D.18917>, case 2: <D.18914>, case 4: <D.18915>, case 6: <D.18916>>
  <D.18914>:
  D.24915 = 20;
  return D.24915;
  <D.18915>:
  D.24915 = 21;
  return D.24915;
  <D.18916>:
  D.24915 = 20;
  return D.24915;
  <D.18917>:
  D.24915 = 20;
  return D.24915;
}


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.24923;
  unsigned int D.24924;
  unsigned int D.24925;
  unsigned int argnum.200;
  unsigned int conv_arg.201;
  struct _IO_FILE * stderr.202;
  int D.24931;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20062>, case 0: <D.20051>, case 1: <D.20055>, case 2: <D.20056>, case 3: <D.20057>, case 4: <D.20059>, case 5: <D.20060>, case 6: <D.20061>>
  <D.20051>:
  {
    struct MonoType * intptr_type;

    D.24923 = mono_defaults.int_class;
    intptr_type = &D.24923->byval_arg;
    conv_arg = mono_mb_add_local (mb, intptr_type);
    *conv_arg_type = intptr_type;
    D.24924 = BIT_FIELD_REF <*t, 32, 32>;
    D.24925 = D.24924 & 1073741824;
    if (D.24925 != 0) goto <D.24926>; else goto <D.24927>;
    <D.24926>:
    {
      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.20054>;
    }
    <D.24927>:
    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.20054>;
  }
  <D.20055>:
  conv_arg.201 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.201);
  goto <D.20054>;
  <D.20056>:
  goto <D.20054>;
  <D.20057>:
  {
    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.20054>;
  }
  <D.20059>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20054>;
  <D.20060>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20054>;
  <D.20061>:
  stderr.202 = stderr;
  fprintf (stderr.202, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20054>;
  <D.20062>:
  stderr.202 = stderr;
  fprintf (stderr.202, "Unhandled case for MarshalAction: %d\n", action);
  <D.20054>:
  D.24931 = conv_arg;
  return D.24931;
}


mono_mb_emit_exception_marshal_directive (struct MonoMethodBuilder * mb, char * msg)
{
  int D.24934;
  struct MonoMethod * D.24937;
  struct MonoClass * D.24938;
  struct MonoImage * D.24939;
  char * s;

  D.24934 = mb->dynamic;
  if (D.24934 == 0) goto <D.24935>; else goto <D.24936>;
  <D.24935>:
  D.24937 = mb->method;
  D.24938 = D.24937->klass;
  D.24939 = D.24938->image;
  s = mono_image_strdup (D.24939, msg);
  monoeg_g_free (msg);
  goto <D.24940>;
  <D.24936>:
  s = monoeg_strdup (msg);
  <D.24940>:
  mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
}


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

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


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.24943;
  struct MonoClass * D.24944;
  struct MonoType * D.24945;
  unsigned int D.24946;
  unsigned int D.24947;
  short unsigned int D.24950;
  int D.24951;
  int D.24952;
  unsigned int argnum.203;
  void * D.24959;
  unsigned int conv_arg.204;
  struct MonoMethod * m.205;
  struct MonoClass * D.24968;
  struct MonoMethod * m.206;
  _Bool D.24970;
  long int D.24971;
  long int D.24972;
  _Bool D.24977;
  long int D.24978;
  long int D.24979;
  unsigned int D.24985;
  unsigned int D.24986;
  void * D.24989;
  int need_free.207;
  void * D.25002;
  struct MonoClass * D.25006;
  struct MonoType * D.25007;
  void * D.25015;
  void * D.25020;
  void * D.25021;
  void * D.25025;
  int D.25026;
  struct MonoMethodBuilder * mb;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;
  gboolean need_free;

  try
    {
      mb = m->mb;
      D.24943 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.24943, spec);
      D.24943 = m->piinfo;
      conv = mono_marshal_get_string_to_ptr_conv (D.24943, spec);
      switch (action) <default: <D.20013>, case 0: <D.19999>, case 1: <D.20006>, case 2: <D.20002>, case 3: <D.20007>, case 4: <D.20009>, case 5: <D.20011>, case 6: <D.20012>>
      <D.19999>:
      D.24944 = mono_defaults.int_class;
      D.24945 = &D.24944->byval_arg;
      *conv_arg_type = D.24945;
      D.24944 = mono_defaults.int_class;
      D.24945 = &D.24944->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.24945);
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.24948>; else goto <D.24949>;
      <D.24948>:
      D.24950 = t->attrs;
      D.24951 = (int) D.24950;
      D.24952 = D.24951 & 2;
      if (D.24952 != 0) goto <D.20000>; else goto <D.24953>;
      <D.24953>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      mono_mb_emit_byte (mb, 77);
      goto <D.24955>;
      <D.24949>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      <D.24955>:
      if (conv == 4294967295) goto <D.24956>; else goto <D.24957>;
      <D.24956>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
      }
      goto <D.24958>;
      <D.24957>:
      D.24959 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.24959);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      <D.24958>:
      goto <D.20000>;
      <D.20002>:
      D.24943 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.24943, spec, &need_free);
      if (conv == 4294967295) goto <D.24961>; else goto <D.24962>;
      <D.24961>:
      {
        char * msg;

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

        m.205 = m;
        if (m.205 == 0B) goto <D.24966>; else goto <D.24967>;
        <D.24966>:
        D.24968 = mono_defaults.string_class;
        m.206 = mono_class_get_method_from_name_flags (D.24968, "get_Length", -1, 0);
        m = m.206;
        m.205 = m;
        D.24970 = m.205 == 0B;
        D.24971 = (long int) D.24970;
        D.24972 = __builtin_expect (D.24971, 0);
        if (D.24972 != 0) goto <D.24973>; else goto <D.24974>;
        <D.24973>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6559, "m");
        <D.24974>:
        <D.24967>:
        D.24946 = BIT_FIELD_REF <*t, 32, 32>;
        D.24947 = D.24946 & 1073741824;
        if (D.24947 == 0) goto <D.24975>; else goto <D.24976>;
        <D.24975>:
        {
          char * msg;

          msg = monoeg_g_strdup_printf ("VBByRefStr marshalling requires a ref parameter.", encoding);
          mono_mb_emit_exception_marshal_directive (mb, msg);
          goto <D.20000>;
        }
        <D.24976>:
        D.24946 = BIT_FIELD_REF <*t, 32, 32>;
        D.24947 = D.24946 & 1073741824;
        D.24977 = D.24947 == 0;
        D.24978 = (long int) D.24977;
        D.24979 = __builtin_expect (D.24978, 0);
        if (D.24979 != 0) goto <D.24980>; else goto <D.24981>;
        <D.24980>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6572, "t->byref");
        <D.24981>:
        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.24982>;
      <D.24964>:
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.24983>; else goto <D.24984>;
      <D.24983>:
      D.24950 = t->attrs;
      D.24985 = (unsigned int) D.24950;
      D.24986 = D.24985 & 3;
      if (D.24986 != 1) goto <D.24987>; else goto <D.24988>;
      <D.24987>:
      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.24989 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.24989);
      mono_mb_emit_byte (mb, 81);
      need_free = 1;
      <D.24988>:
      <D.24984>:
      <D.24982>:
      need_free.207 = need_free;
      if (need_free.207 != 0) goto <D.24991>; else goto <D.24992>;
      <D.24991>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      if (conv == 32) goto <D.24993>; else goto <D.24994>;
      <D.24993>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.24995>;
      <D.24994>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.24995>:
      <D.24992>:
      goto <D.20000>;
      <D.20006>:
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.24998>; else goto <D.24996>;
      <D.24998>:
      if (encoding != 34) goto <D.24999>; else goto <D.24996>;
      <D.24999>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.204);
      goto <D.24997>;
      <D.24996>:
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.204);
      <D.24997>:
      goto <D.20000>;
      <D.20007>:
      mono_mb_emit_stloc (mb, 0);
      D.24943 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.24943, spec, &need_free);
      if (conv == 4294967295) goto <D.25000>; else goto <D.25001>;
      <D.25000>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20000>;
      }
      <D.25001>:
      mono_mb_emit_ldloc (mb, 0);
      D.25002 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25002);
      mono_mb_emit_stloc (mb, 3);
      mono_mb_emit_ldloc (mb, 0);
      if (conv == 32) goto <D.25003>; else goto <D.25004>;
      <D.25003>:
      mono_mb_emit_icall (mb, mono_free_bstr);
      goto <D.25005>;
      <D.25004>:
      mono_mb_emit_icall (mb, mono_marshal_free);
      <D.25005>:
      goto <D.20000>;
      <D.20009>:
      D.25006 = mono_defaults.object_class;
      D.25007 = &D.25006->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25007);
      D.24944 = mono_defaults.int_class;
      D.24945 = &D.24944->byval_arg;
      *conv_arg_type = D.24945;
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.25008>; else goto <D.25009>;
      <D.25008>:
      D.24950 = t->attrs;
      D.24951 = (int) D.24950;
      D.24952 = D.24951 & 2;
      if (D.24952 != 0) goto <D.20000>; else goto <D.25010>;
      <D.25010>:
      <D.25009>:
      D.24943 = m->piinfo;
      conv = mono_marshal_get_ptr_to_string_conv (D.24943, spec, &need_free);
      if (conv == 4294967295) goto <D.25011>; else goto <D.25012>;
      <D.25011>:
      {
        char * msg;

        msg = monoeg_g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
        mono_mb_emit_exception_marshal_directive (mb, msg);
        goto <D.20000>;
      }
      <D.25012>:
      argnum.203 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.203);
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.25013>; else goto <D.25014>;
      <D.25013>:
      mono_mb_emit_byte (mb, 77);
      <D.25014>:
      D.25015 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25015);
      conv_arg.204 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.204);
      goto <D.20000>;
      <D.20011>:
      D.24946 = BIT_FIELD_REF <*t, 32, 32>;
      D.24947 = D.24946 & 1073741824;
      if (D.24947 != 0) goto <D.25016>; else goto <D.25017>;
      <D.25016>:
      if (conv_arg != 0) goto <D.25018>; else goto <D.25019>;
      <D.25018>:
      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.25020 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25020);
      mono_mb_emit_byte (mb, 223);
      <D.25019>:
      <D.25017>:
      goto <D.20000>;
      <D.20012>:
      D.25021 = conv_to_icall (conv);
      if (D.25021 == mono_marshal_string_to_utf16) goto <D.25022>; else goto <D.25023>;
      <D.25022>:
      mono_mb_emit_icall (mb, mono_marshal_string_to_utf16_copy);
      goto <D.25024>;
      <D.25023>:
      D.25025 = conv_to_icall (conv);
      mono_mb_emit_icall (mb, D.25025);
      <D.25024>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20000>;
      <D.20013>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6671);
      <D.20000>:
      D.25026 = conv_arg;
      return D.25026;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.18928>, case 19: <D.18927>, case 20: <D.18924>, case 21: <D.18923>, case 22: <D.18926>, case 34: <D.18925>>
  <D.18923>:
  D.25029 = 7;
  return D.25029;
  <D.18924>:
  <D.18925>:
  D.25029 = 4;
  return D.25029;
  <D.18926>:
  D.25029 = 9;
  return D.25029;
  <D.18927>:
  D.25029 = 3;
  return D.25029;
  <D.18928>:
  D.25029 = 4294967295;
  return D.25029;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.18949>, case 19: <D.18948>, case 20: <D.18945>, case 21: <D.18944>, case 22: <D.18947>, case 34: <D.18946>>
  <D.18944>:
  *need_free = 0;
  D.25031 = 8;
  return D.25031;
  <D.18945>:
  <D.18946>:
  D.25031 = 5;
  return D.25031;
  <D.18947>:
  D.25031 = 6;
  return D.25031;
  <D.18948>:
  D.25031 = 32;
  return D.25031;
  <D.18949>:
  D.25031 = 4294967295;
  return D.25031;
}


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

  switch (conv) <default: <D.18753>, case 3: <D.18735>, case 4: <D.18734>, case 5: <D.18732>, case 6: <D.18731>, case 7: <D.18729>, case 8: <D.18730>, case 9: <D.18733>, case 10: <D.18738>, case 11: <D.18737>, case 12: <D.18751>, case 13: <D.18752>, case 14: <D.18739>, case 15: <D.18740>, case 16: <D.18741>, case 17: <D.18747>, case 18: <D.18748>, case 19: <D.18749>, case 22: <D.18742>, case 23: <D.18743>, case 24: <D.18744>, case 29: <D.18745>, case 30: <D.18746>, case 31: <D.18750>, case 32: <D.18736>>
  <D.18729>:
  D.25033 = mono_marshal_string_to_utf16;
  return D.25033;
  <D.18730>:
  D.25033 = mono_string_from_utf16;
  return D.25033;
  <D.18731>:
  D.25033 = mono_string_new_wrapper;
  return D.25033;
  <D.18732>:
  D.25033 = mono_string_new_wrapper;
  return D.25033;
  <D.18733>:
  D.25033 = mono_string_to_lpstr;
  return D.25033;
  <D.18734>:
  D.25033 = mono_string_to_lpstr;
  return D.25033;
  <D.18735>:
  D.25033 = mono_string_to_bstr;
  return D.25033;
  <D.18736>:
  D.25033 = mono_string_from_bstr;
  return D.25033;
  <D.18737>:
  <D.18738>:
  D.25033 = mono_string_to_ansibstr;
  return D.25033;
  <D.18739>:
  D.25033 = mono_string_builder_to_utf8;
  return D.25033;
  <D.18740>:
  D.25033 = mono_string_builder_to_utf8;
  return D.25033;
  <D.18741>:
  D.25033 = mono_string_builder_to_utf16;
  return D.25033;
  <D.18742>:
  D.25033 = mono_array_to_savearray;
  return D.25033;
  <D.18743>:
  D.25033 = mono_array_to_lparray;
  return D.25033;
  <D.18744>:
  D.25033 = mono_free_lparray;
  return D.25033;
  <D.18745>:
  D.25033 = mono_delegate_to_ftnptr;
  return D.25033;
  <D.18746>:
  D.25033 = mono_ftnptr_to_delegate;
  return D.25033;
  <D.18747>:
  D.25033 = mono_string_utf8_to_builder;
  return D.25033;
  <D.18748>:
  D.25033 = mono_string_utf8_to_builder;
  return D.25033;
  <D.18749>:
  D.25033 = mono_string_utf16_to_builder;
  return D.25033;
  <D.18750>:
  D.25033 = mono_marshal_free_array;
  return D.25033;
  <D.18751>:
  D.25033 = mono_string_to_byvalstr;
  return D.25033;
  <D.18752>:
  D.25033 = mono_string_to_byvalwstr;
  return D.25033;
  <D.18753>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1582);
  D.25033 = 0B;
  return D.25033;
}


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.25038;
  struct MonoMethod * get_object_for_native_variant.209;
  _Bool D.25040;
  long int D.25041;
  long int D.25042;
  struct MonoMethod * get_native_variant_for_object.210;
  struct MonoMethod * get_native_variant_for_object.211;
  _Bool D.25049;
  long int D.25050;
  long int D.25051;
  struct MonoClass * D.25054;
  struct MonoType * D.25055;
  unsigned int D.25056;
  unsigned int D.25057;
  struct MonoClass * D.25060;
  struct MonoType * D.25061;
  struct MonoClass * D.25063;
  struct MonoType * D.25064;
  short unsigned int D.25067;
  unsigned int D.25068;
  unsigned int D.25069;
  unsigned int argnum.212;
  unsigned int conv_arg.213;
  struct MonoMethod * variant_clear.214;
  struct MonoClass * D.25078;
  struct MonoMethod * variant_clear.215;
  _Bool D.25080;
  long int D.25081;
  long int D.25082;
  struct MonoClass * D.25092;
  struct MonoType * D.25093;
  struct MonoClass * D.25096;
  struct MonoType * D.25097;
  struct MonoClass * D.25099;
  struct MonoType * D.25100;
  int D.25111;
  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.25036>; else goto <D.25037>;
  <D.25036>:
  D.25038 = mono_defaults.marshal_class;
  get_object_for_native_variant.209 = mono_class_get_method_from_name (D.25038, "GetObjectForNativeVariant", 1);
  get_object_for_native_variant = get_object_for_native_variant.209;
  <D.25037>:
  get_object_for_native_variant.208 = get_object_for_native_variant;
  D.25040 = get_object_for_native_variant.208 == 0B;
  D.25041 = (long int) D.25040;
  D.25042 = __builtin_expect (D.25041, 0);
  if (D.25042 != 0) goto <D.25043>; else goto <D.25044>;
  <D.25043>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7411, "get_object_for_native_variant");
  <D.25044>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  if (get_native_variant_for_object.210 == 0B) goto <D.25046>; else goto <D.25047>;
  <D.25046>:
  D.25038 = mono_defaults.marshal_class;
  get_native_variant_for_object.211 = mono_class_get_method_from_name (D.25038, "GetNativeVariantForObject", 2);
  get_native_variant_for_object = get_native_variant_for_object.211;
  <D.25047>:
  get_native_variant_for_object.210 = get_native_variant_for_object;
  D.25049 = get_native_variant_for_object.210 == 0B;
  D.25050 = (long int) D.25049;
  D.25051 = __builtin_expect (D.25050, 0);
  if (D.25051 != 0) goto <D.25052>; else goto <D.25053>;
  <D.25052>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7415, "get_native_variant_for_object");
  <D.25053>:
  switch (action) <default: <D.20123>, case 0: <D.20112>, case 1: <D.20116>, case 2: <D.20114>, case 3: <D.20117>, case 4: <D.20119>, case 5: <D.20120>, case 6: <D.20121>>
  <D.20112>:
  D.25054 = mono_class_get_variant_class ();
  D.25055 = &D.25054->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25055);
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25058>; else goto <D.25059>;
  <D.25058>:
  D.25060 = mono_class_get_variant_class ();
  D.25061 = &D.25060->this_arg;
  *conv_arg_type = D.25061;
  goto <D.25062>;
  <D.25059>:
  D.25063 = mono_class_get_variant_class ();
  D.25064 = &D.25063->byval_arg;
  *conv_arg_type = D.25064;
  <D.25062>:
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25065>; else goto <D.25066>;
  <D.25065>:
  D.25067 = t->attrs;
  D.25068 = (unsigned int) D.25067;
  D.25069 = D.25068 & 3;
  if (D.25069 == 2) goto <D.20113>; else goto <D.25070>;
  <D.25070>:
  <D.25066>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25072>; else goto <D.25073>;
  <D.25072>:
  mono_mb_emit_byte (mb, 80);
  <D.25073>:
  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.20113>;
  <D.20114>:
  {
    static struct MonoMethod * variant_clear = 0B;

    variant_clear.214 = variant_clear;
    if (variant_clear.214 == 0B) goto <D.25076>; else goto <D.25077>;
    <D.25076>:
    D.25078 = mono_class_get_variant_class ();
    variant_clear.215 = mono_class_get_method_from_name (D.25078, "Clear", 0);
    variant_clear = variant_clear.215;
    <D.25077>:
    variant_clear.214 = variant_clear;
    D.25080 = variant_clear.214 == 0B;
    D.25081 = (long int) D.25080;
    D.25082 = __builtin_expect (D.25081, 0);
    if (D.25082 != 0) goto <D.25083>; else goto <D.25084>;
    <D.25083>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7442, "variant_clear");
    <D.25084>:
    D.25056 = BIT_FIELD_REF <*t, 32, 32>;
    D.25057 = D.25056 & 1073741824;
    if (D.25057 != 0) goto <D.25085>; else goto <D.25086>;
    <D.25085>:
    D.25067 = t->attrs;
    D.25068 = (unsigned int) D.25067;
    D.25069 = D.25068 & 3;
    if (D.25069 != 1) goto <D.25087>; else goto <D.25088>;
    <D.25087>:
    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.25088>:
    <D.25086>:
    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.20113>;
  }
  <D.20116>:
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25089>; else goto <D.25090>;
  <D.25089>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.213);
  goto <D.25091>;
  <D.25090>:
  conv_arg.213 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.213);
  <D.25091>:
  goto <D.20113>;
  <D.20117>:
  {
    char * msg;

    msg = monoeg_strdup ("Marshalling of VARIANT not supported as a return type.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20113>;
  }
  <D.20119>:
  D.25092 = mono_defaults.object_class;
  D.25093 = &D.25092->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25093);
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25094>; else goto <D.25095>;
  <D.25094>:
  D.25096 = mono_class_get_variant_class ();
  D.25097 = &D.25096->this_arg;
  *conv_arg_type = D.25097;
  goto <D.25098>;
  <D.25095>:
  D.25099 = mono_class_get_variant_class ();
  D.25100 = &D.25099->byval_arg;
  *conv_arg_type = D.25100;
  <D.25098>:
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25101>; else goto <D.25102>;
  <D.25101>:
  D.25067 = t->attrs;
  D.25068 = (unsigned int) D.25067;
  D.25069 = D.25068 & 3;
  if (D.25069 == 2) goto <D.20113>; else goto <D.25103>;
  <D.25103>:
  <D.25102>:
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25104>; else goto <D.25105>;
  <D.25104>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.212);
  goto <D.25106>;
  <D.25105>:
  argnum.212 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.212);
  <D.25106>:
  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.20113>;
  <D.20120>:
  D.25056 = BIT_FIELD_REF <*t, 32, 32>;
  D.25057 = D.25056 & 1073741824;
  if (D.25057 != 0) goto <D.25107>; else goto <D.25108>;
  <D.25107>:
  D.25067 = t->attrs;
  D.25068 = (unsigned int) D.25067;
  D.25069 = D.25068 & 3;
  if (D.25069 != 1) goto <D.25109>; else goto <D.25110>;
  <D.25109>:
  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.25110>:
  <D.25108>:
  goto <D.20113>;
  <D.20121>:
  {
    char * msg;

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


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.25113;
  struct MonoMethod * sh_dangerous_add_ref.216;
  unsigned int argnum.217;
  unsigned int D.25118;
  unsigned int pos.218;
  unsigned int D.25120;
  unsigned int D.25121;
  unsigned int conv_arg.219;
  struct MonoClass * D.25125;
  struct MonoType * D.25126;
  unsigned int dar_release_slot.220;
  struct MonoMethod * sh_dangerous_release.221;
  struct MonoClass * D.25136;
  unsigned int dar_release_slot.222;
  unsigned int D.25141;
  unsigned int label_next.223;
  unsigned int D.25143;
  unsigned int D.25144;
  gchar * D.25147;
  struct MonoType * D.25150;
  unsigned int intptr_handle_slot.224;
  struct _IO_FILE * stderr.225;
  int D.25153;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20040>, case 0: <D.20024>, case 1: <D.20029>, case 2: <D.20030>, case 3: <D.20034>, case 4: <D.20037>, case 5: <D.20038>, case 6: <D.20039>>
  <D.20024>:
  {
    struct MonoType * intptr_type;
    int dar_release_slot;
    int pos;

    D.25113 = mono_defaults.int_class;
    intptr_type = &D.25113->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.25115>; else goto <D.25116>;
    <D.25115>:
    init_safe_handle ();
    <D.25116>:
    argnum.217 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.217);
    D.25118 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.25118;
    mono_mb_emit_exception (mb, "ArgumentNullException", 0B);
    pos.218 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.218);
    D.25120 = BIT_FIELD_REF <*t, 32, 32>;
    D.25121 = D.25120 & 1073741824;
    if (D.25121 != 0) goto <D.25122>; else goto <D.25123>;
    <D.25122>:
    mono_mb_emit_icon (mb, 0);
    conv_arg.219 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.219);
    goto <D.20028>;
    <D.25123>:
    D.25125 = mono_defaults.boolean_class;
    D.25126 = &D.25125->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.25126);
    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.20028>;
  }
  <D.20029>:
  D.25120 = BIT_FIELD_REF <*t, 32, 32>;
  D.25121 = D.25120 & 1073741824;
  if (D.25121 != 0) goto <D.25128>; else goto <D.25129>;
  <D.25128>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.219);
  goto <D.25130>;
  <D.25129>:
  conv_arg.219 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.219);
  <D.25130>:
  goto <D.20028>;
  <D.20030>:
  {
    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.25132>; else goto <D.25133>;
    <D.25132>:
    init_safe_handle ();
    <D.25133>:
    D.25120 = BIT_FIELD_REF <*t, 32, 32>;
    D.25121 = D.25120 & 1073741824;
    if (D.25121 != 0) goto <D.25134>; else goto <D.25135>;
    <D.25134>:
    {
      struct MonoMethod * ctor;

      D.25136 = t->data.klass;
      ctor = mono_class_get_method_from_name (D.25136, ".ctor", 0);
      if (ctor == 0B) goto <D.25137>; else goto <D.25138>;
      <D.25137>:
      mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
      goto <D.20028>;
      <D.25138>:
      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.25139>;
    <D.25135>:
    dar_release_slot.222 = (unsigned int) dar_release_slot;
    mono_mb_emit_ldloc (mb, dar_release_slot.222);
    D.25141 = mono_mb_emit_branch (mb, 57);
    label_next = (int) D.25141;
    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.25139>:
    goto <D.20028>;
  }
  <D.20034>:
  {
    struct MonoMethod * ctor;
    int intptr_handle_slot;

    ctor = 0B;
    D.25136 = t->data.klass;
    D.25143 = D.25136->flags;
    D.25144 = D.25143 & 128;
    if (D.25144 != 0) goto <D.25145>; else goto <D.25146>;
    <D.25145>:
    mono_mb_emit_byte (mb, 38);
    D.25147 = monoeg_strdup ("Returned SafeHandles should not be abstract");
    mono_mb_emit_exception_marshal_directive (mb, D.25147);
    goto <D.20028>;
    <D.25146>:
    D.25136 = t->data.klass;
    ctor = mono_class_get_method_from_name (D.25136, ".ctor", 0);
    if (ctor == 0B) goto <D.25148>; else goto <D.25149>;
    <D.25148>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_exception (mb, "MissingMethodException", "paramterless constructor required");
    goto <D.20028>;
    <D.25149>:
    D.25113 = mono_defaults.int_class;
    D.25150 = &D.25113->byval_arg;
    intptr_handle_slot = mono_mb_add_local (mb, D.25150);
    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.20028>;
  }
  <D.20037>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n");
  goto <D.20028>;
  <D.20038>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n");
  goto <D.20028>;
  <D.20039>:
  stderr.225 = stderr;
  fprintf (stderr.225, "mono/marshal: SafeHandles missing MANAGED_CONV_RESULT\n");
  goto <D.20028>;
  <D.20040>:
  printf ("Unhandled case for MarshalAction: %d\n", action);
  <D.20028>:
  D.25153 = conv_arg;
  return D.25153;
}


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

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


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

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


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.25160;
  struct MonoClass * D.25161;
  struct MonoType * D.25162;
  struct MonoClass * D.25163;
  unsigned int D.25164;
  unsigned int D.25165;
  unsigned int argnum.228;
  unsigned int D.25169;
  unsigned int D.25170;
  void * D.25173;
  unsigned int conv_arg.229;
  struct MonoClass * D.25176;
  struct MonoType * D.25177;
  struct MonoClass * D.25178;
  struct MonoClass * D.25182;
  unsigned int src_var.230;
  struct MonoClass * D.25196;
  int iftmp.231;
  int D.25200;
  unsigned int dest_ptr.232;
  unsigned int index_var.233;
  int D.25209;
  void * D.25212;
  MonoMarshalNative iftmp.234;
  short unsigned int D.25218;
  int D.25219;
  short unsigned int D.25220;
  int D.25221;
  int iftmp.235;
  short unsigned int D.25231;
  int D.25232;
  int D.25233;
  struct MonoType * D.25234;
  int need_free.236;
  int need_free.237;
  int iftmp.238;
  int D.25247;
  unsigned int src_ptr.239;
  unsigned int index_var.240;
  int D.25256;
  _Bool D.25261;
  long int D.25262;
  long int D.25263;
  void * D.25268;
  MonoMarshalNative iftmp.241;
  unsigned int loc.242;
  short unsigned int D.25288;
  int D.25289;
  short unsigned int D.25290;
  int D.25291;
  void * D.25294;
  int D.25300;
  <unnamed type> D.25303;
  short int D.25306;
  short int D.25307;
  struct MonoMethodSignature * D.25325;
  short unsigned int D.25326;
  int D.25327;
  struct MonoType * D.25330;
  unsigned char D.25331;
  int D.25332;
  unsigned int src_ptr.243;
  unsigned int param_num.244;
  unsigned int D.25340;
  unsigned int D.25341;
  unsigned int index_var.245;
  int D.25345;
  _Bool D.25348;
  long int D.25349;
  long int D.25350;
  void * D.25353;
  short unsigned int D.25355;
  int D.25356;
  short unsigned int D.25357;
  int D.25358;
  _Bool D.25360;
  long int D.25361;
  long int D.25362;
  _Bool D.25365;
  long int D.25366;
  long int D.25367;
  _Bool D.25370;
  long int D.25371;
  long int D.25372;
  unsigned int dest_ptr.246;
  unsigned int D.25391;
  unsigned int D.25392;
  unsigned int index_var.247;
  int D.25396;
  _Bool D.25399;
  long int D.25400;
  long int D.25401;
  void * D.25404;
  short unsigned int D.25406;
  int D.25407;
  short unsigned int D.25408;
  int D.25409;
  int iftmp.248;
  int D.25421;
  unsigned int src.249;
  unsigned int dest.250;
  unsigned int index_var.251;
  int D.25431;
  _Bool D.25434;
  long int D.25435;
  long int D.25436;
  void * D.25439;
  short unsigned int D.25441;
  int D.25442;
  short unsigned int D.25443;
  int D.25444;
  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.25160 = m->piinfo;
      encoding = mono_marshal_get_string_encoding (D.25160, spec);
      switch (action) <default: <D.20229>, case 0: <D.20145>, case 1: <D.20169>, case 2: <D.20158>, case 3: <D.20170>, case 4: <D.20171>, case 5: <D.20203>, case 6: <D.20217>>
      <D.20145>:
      D.25161 = mono_defaults.object_class;
      D.25162 = &D.25161->byval_arg;
      *conv_arg_type = D.25162;
      D.25161 = mono_defaults.object_class;
      D.25162 = &D.25161->byval_arg;
      conv_arg = mono_mb_add_local (mb, D.25162);
      D.25163 = klass->element_class;
      D.25164 = BIT_FIELD_REF <*D.25163, 32, 160>;
      D.25165 = D.25164 & 32;
      if (D.25165 != 0) goto <D.25166>; else goto <D.25167>;
      <D.25166>:
      argnum.228 = (unsigned int) argnum;
      mono_mb_emit_ldarg (mb, argnum.228);
      D.25169 = BIT_FIELD_REF <*t, 32, 32>;
      D.25170 = D.25169 & 1073741824;
      if (D.25170 != 0) goto <D.25171>; else goto <D.25172>;
      <D.25171>:
      mono_mb_emit_byte (mb, 77);
      <D.25172>:
      D.25173 = conv_to_icall (23);
      mono_mb_emit_icall (mb, D.25173);
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_stloc (mb, conv_arg.229);
      goto <D.25175>;
      <D.25167>:
      {
        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.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25177);
        eklass = klass->element_class;
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25179>; else goto <D.25180>;
        <D.25179>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25160, spec);
        goto <D.25181>;
        <D.25180>:
        D.25182 = mono_defaults.stringbuilder_class;
        if (D.25182 == eklass) goto <D.25183>; else goto <D.25184>;
        <D.25183>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25160, spec);
        goto <D.25185>;
        <D.25184>:
        conv = 4294967295;
        <D.25185>:
        <D.25181>:
        if (is_string != 0) goto <D.25186>; else goto <D.25187>;
        <D.25186>:
        if (conv == 4294967295) goto <D.25188>; else goto <D.25189>;
        <D.25188>:
        {
          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.20157>;
        }
        <D.25189>:
        <D.25187>:
        D.25161 = mono_defaults.object_class;
        D.25162 = &D.25161->byval_arg;
        src_var = mono_mb_add_local (mb, D.25162);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        if (D.25170 != 0) goto <D.25190>; else goto <D.25191>;
        <D.25190>:
        mono_mb_emit_byte (mb, 77);
        <D.25191>:
        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.25193>; else goto <D.25194>;
        <D.25193>:
        esize = 4;
        goto <D.25195>;
        <D.25194>:
        D.25196 = mono_defaults.char_class;
        if (D.25196 == eklass) goto <D.25197>; else goto <D.25198>;
        <D.25197>:
        D.25160 = m->piinfo;
        D.25200 = mono_pinvoke_is_unicode (D.25160);
        if (D.25200 != 0) goto <D.25201>; else goto <D.25202>;
        <D.25201>:
        iftmp.231 = 2;
        goto <D.25203>;
        <D.25202>:
        iftmp.231 = 1;
        <D.25203>:
        esize = iftmp.231;
        goto <D.25204>;
        <D.25198>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25204>:
        <D.25195>:
        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.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25205>; else goto <D.25206>;
        <D.25205>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25206>:
        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.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        index_var = mono_mb_add_local (mb, D.25177);
        mono_mb_emit_byte (mb, 22);
        index_var.233 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.233);
        D.25209 = mono_mb_get_label (mb);
        label2 = (guint32) D.25209;
        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.25210>; else goto <D.25211>;
        <D.25210>:
        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.25212 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25212);
        mono_mb_emit_byte (mb, 223);
        goto <D.25213>;
        <D.25211>:
        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.25196 = mono_defaults.char_class;
        if (D.25196 == eklass) goto <D.25215>; else goto <D.25216>;
        <D.25215>:
        iftmp.234 = encoding;
        goto <D.25217>;
        <D.25216>:
        iftmp.234 = 4294967295;
        <D.25217>:
        emit_struct_conv_full (mb, eklass, 0, iftmp.234);
        <D.25213>:
        D.25218 = (short unsigned int) index_var;
        D.25219 = (int) D.25218;
        mono_mb_emit_add_to_local (mb, D.25219, 1);
        D.25220 = (short unsigned int) dest_ptr;
        D.25221 = (int) D.25220;
        mono_mb_emit_add_to_local (mb, D.25221, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25222>; else goto <D.25223>;
        <D.25222>:
        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.25223>:
        mono_mb_patch_branch (mb, label1);
      }
      <D.25175>:
      goto <D.20157>;
      <D.20158>:
      D.25163 = klass->element_class;
      D.25196 = mono_defaults.char_class;
      if (D.25163 == D.25196) goto <D.25229>; else goto <D.25225>;
      <D.25229>:
      if (encoding == 21) goto <D.25226>; else goto <D.25225>;
      <D.25225>:
      D.25163 = klass->element_class;
      D.25182 = mono_defaults.stringbuilder_class;
      if (D.25163 == D.25182) goto <D.25226>; else goto <D.25230>;
      <D.25230>:
      D.25231 = t->attrs;
      D.25232 = (int) D.25231;
      D.25233 = D.25232 & 2;
      if (D.25233 != 0) goto <D.25226>; else goto <D.25227>;
      <D.25226>:
      iftmp.235 = 1;
      goto <D.25228>;
      <D.25227>:
      iftmp.235 = 0;
      <D.25228>:
      need_convert = iftmp.235;
      D.25163 = klass->element_class;
      D.25234 = &D.25163->byval_arg;
      D.25160 = m->piinfo;
      need_free.236 = mono_marshal_need_free (D.25234, D.25160, spec);
      need_free = need_free.236;
      if (need_convert != 0) goto <D.25236>; else goto <D.25238>;
      <D.25238>:
      need_free.237 = need_free;
      if (need_free.237 != 0) goto <D.25236>; else goto <D.25237>;
      <D.25236>:
      {
        struct MonoClass * eklass;
        guint32 label1;
        guint32 label2;
        guint32 label3;
        int index_var;
        int src_ptr;
        int loc;
        int esize;

        eklass = klass->element_class;
        D.25182 = mono_defaults.stringbuilder_class;
        if (D.25182 == eklass) goto <D.25240>; else goto <D.25243>;
        <D.25243>:
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25240>; else goto <D.25241>;
        <D.25240>:
        esize = 4;
        goto <D.25242>;
        <D.25241>:
        D.25196 = mono_defaults.char_class;
        if (D.25196 == eklass) goto <D.25244>; else goto <D.25245>;
        <D.25244>:
        D.25160 = m->piinfo;
        D.25247 = mono_pinvoke_is_unicode (D.25160);
        if (D.25247 != 0) goto <D.25248>; else goto <D.25249>;
        <D.25248>:
        iftmp.238 = 2;
        goto <D.25250>;
        <D.25249>:
        iftmp.238 = 1;
        <D.25250>:
        esize = iftmp.238;
        goto <D.25251>;
        <D.25245>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25251>:
        <D.25242>:
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25177);
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        loc = mono_mb_add_local (mb, D.25177);
        argnum.228 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.228);
        D.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        if (D.25170 != 0) goto <D.25252>; else goto <D.25253>;
        <D.25252>:
        mono_mb_emit_byte (mb, 77);
        <D.25253>:
        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.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        index_var = mono_mb_add_local (mb, D.25177);
        mono_mb_emit_byte (mb, 22);
        index_var.240 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.240);
        D.25256 = mono_mb_get_label (mb);
        label2 = (guint32) D.25256;
        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.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        if (D.25170 != 0) goto <D.25257>; else goto <D.25258>;
        <D.25257>:
        mono_mb_emit_byte (mb, 80);
        <D.25258>:
        mono_mb_emit_byte (mb, 142);
        label3 = mono_mb_emit_branch (mb, 60);
        D.25182 = mono_defaults.stringbuilder_class;
        if (D.25182 == eklass) goto <D.25259>; else goto <D.25260>;
        <D.25259>:
        {
          gboolean need_free2;
          MonoMarshalConv conv;

          try
            {
              D.25160 = m->piinfo;
              conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25160, spec, &need_free2);
              D.25261 = conv == 4294967295;
              D.25262 = (long int) D.25261;
              D.25263 = __builtin_expect (D.25262, 0);
              if (D.25263 != 0) goto <D.25264>; else goto <D.25265>;
              <D.25264>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7735, "conv != -1");
              <D.25265>:
              argnum.228 = (unsigned int) argnum;
              mono_mb_emit_ldarg (mb, argnum.228);
              D.25169 = BIT_FIELD_REF <*t, 32, 32>;
              D.25170 = D.25169 & 1073741824;
              if (D.25170 != 0) goto <D.25266>; else goto <D.25267>;
              <D.25266>:
              mono_mb_emit_byte (mb, 77);
              <D.25267>:
              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.25268 = conv_to_icall (conv);
              mono_mb_emit_icall (mb, D.25268);
              need_free.237 = need_free;
              if (need_free.237 != 0) goto <D.25269>; else goto <D.25270>;
              <D.25269>:
              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.25270>:
            }
          finally
            {
              need_free2 = {CLOBBER};
            }
        }
        goto <D.25271>;
        <D.25260>:
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25272>; else goto <D.25273>;
        <D.25272>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.25274>; else goto <D.25275>;
        <D.25274>:
        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.25275>:
        goto <D.25276>;
        <D.25273>:
        if (need_convert != 0) goto <D.25277>; else goto <D.25278>;
        <D.25277>:
        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.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        if (D.25170 != 0) goto <D.25279>; else goto <D.25280>;
        <D.25279>:
        mono_mb_emit_byte (mb, 80);
        <D.25280>:
        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.25196 = mono_defaults.char_class;
        if (D.25196 == eklass) goto <D.25282>; else goto <D.25283>;
        <D.25282>:
        iftmp.241 = encoding;
        goto <D.25284>;
        <D.25283>:
        iftmp.241 = 4294967295;
        <D.25284>:
        emit_struct_conv_full (mb, eklass, 1, iftmp.241);
        <D.25278>:
        need_free.237 = need_free;
        if (need_free.237 != 0) goto <D.25285>; else goto <D.25286>;
        <D.25285>:
        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.25286>:
        <D.25276>:
        <D.25271>:
        D.25288 = (short unsigned int) index_var;
        D.25289 = (int) D.25288;
        mono_mb_emit_add_to_local (mb, D.25289, 1);
        D.25290 = (short unsigned int) src_ptr;
        D.25291 = (int) D.25290;
        mono_mb_emit_add_to_local (mb, D.25291, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
      }
      <D.25237>:
      D.25163 = klass->element_class;
      D.25164 = BIT_FIELD_REF <*D.25163, 32, 160>;
      D.25165 = D.25164 & 32;
      if (D.25165 != 0) goto <D.25292>; else goto <D.25293>;
      <D.25292>:
      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.25294 = conv_to_icall (24);
      mono_mb_emit_icall (mb, D.25294);
      <D.25293>:
      goto <D.20157>;
      <D.20169>:
      D.25169 = BIT_FIELD_REF <*t, 32, 32>;
      D.25170 = D.25169 & 1073741824;
      if (D.25170 != 0) goto <D.25295>; else goto <D.25296>;
      <D.25295>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc_addr (mb, conv_arg.229);
      goto <D.25297>;
      <D.25296>:
      conv_arg.229 = (unsigned int) conv_arg;
      mono_mb_emit_ldloc (mb, conv_arg.229);
      <D.25297>:
      goto <D.20157>;
      <D.20170>:
      mono_mb_emit_stloc (mb, 3);
      goto <D.20157>;
      <D.20171>:
      {
        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.25161 = mono_defaults.object_class;
        D.25162 = &D.25161->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.25162);
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        *conv_arg_type = D.25177;
        D.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        if (D.25170 != 0) goto <D.25298>; else goto <D.25299>;
        <D.25298>:
        {
          char * msg;

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

          msg = monoeg_strdup ("[MarshalAs] attribute required to marshal arrays to managed code.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25300 = conv_arg;
          return D.25300;
        }
        <D.25302>:
        D.25303 = spec->native;
        if (D.25303 != 42) goto <D.25304>; else goto <D.25305>;
        <D.25304>:
        {
          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.25300 = conv_arg;
          return D.25300;
        }
        <D.25305>:
        D.25306 = spec->data.array_data.param_num;
        param_num = (int) D.25306;
        num_elem = spec->data.array_data.num_elem;
        D.25307 = spec->data.array_data.elem_mult;
        if (D.25307 == 0) goto <D.25308>; else goto <D.25309>;
        <D.25308>:
        param_num = -1;
        <D.25309>:
        if (param_num == -1) goto <D.25310>; else goto <D.25311>;
        <D.25310>:
        if (num_elem <= 0) goto <D.25312>; else goto <D.25313>;
        <D.25312>:
        {
          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.25300 = conv_arg;
          return D.25300;
        }
        <D.25313>:
        <D.25311>:
        eklass = klass->element_class;
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25314>; else goto <D.25315>;
        <D.25314>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_ptr_to_string_conv (D.25160, spec, &need_free);
        goto <D.25316>;
        <D.25315>:
        D.25182 = mono_defaults.stringbuilder_class;
        if (D.25182 == eklass) goto <D.25317>; else goto <D.25318>;
        <D.25317>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25160, spec, &need_free);
        goto <D.25319>;
        <D.25318>:
        conv = 4294967295;
        <D.25319>:
        <D.25316>:
        mono_marshal_load_type_info (eklass);
        if (is_string != 0) goto <D.25320>; else goto <D.25321>;
        <D.25320>:
        esize = 4;
        goto <D.25322>;
        <D.25321>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25322>:
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        src_ptr = mono_mb_add_local (mb, D.25177);
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        loc = mono_mb_add_local (mb, D.25177);
        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.25323>; else goto <D.25324>;
        <D.25323>:
        D.25325 = m->sig;
        D.25326 = D.25325->param_count;
        D.25327 = (int) D.25326;
        if (D.25327 <= param_num) goto <D.25328>; else goto <D.25329>;
        <D.25328>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter index is out of range.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25300 = conv_arg;
          return D.25300;
        }
        <D.25329>:
        D.25325 = m->sig;
        D.25330 = D.25325->params[param_num];
        D.25331 = D.25330->type;
        D.25332 = (int) D.25331;
        switch (D.25332) <default: <D.20200>, case 4: <D.20189>, case 5: <D.20190>, case 6: <D.20191>, case 7: <D.20192>, case 8: <D.20193>, case 9: <D.20194>, case 10: <D.20197>, case 11: <D.20198>, case 24: <D.20195>, case 25: <D.20196>>
        <D.20189>:
        <D.20190>:
        <D.20191>:
        <D.20192>:
        <D.20193>:
        <D.20194>:
        <D.20195>:
        <D.20196>:
        <D.20197>:
        <D.20198>:
        goto <D.20199>;
        <D.20200>:
        {
          char * msg;

          msg = monoeg_strdup ("Array size control parameter must be an integral type.");
          mono_mb_emit_exception_marshal_directive (mb, msg);
          D.25300 = conv_arg;
          return D.25300;
        }
        <D.20199>:
        <D.25324>:
        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.25334>; else goto <D.25335>;
        <D.25334>:
        mono_mb_emit_icon (mb, num_elem);
        goto <D.25336>;
        <D.25335>:
        param_num.244 = (unsigned int) param_num;
        mono_mb_emit_ldarg (mb, param_num.244);
        if (num_elem > 0) goto <D.25338>; else goto <D.25339>;
        <D.25338>:
        mono_mb_emit_icon (mb, num_elem);
        mono_mb_emit_byte (mb, 88);
        <D.25339>:
        mono_mb_emit_byte (mb, 212);
        <D.25336>:
        mono_mb_emit_op (mb, 141, eklass);
        conv_arg.229 = (unsigned int) conv_arg;
        mono_mb_emit_stloc (mb, conv_arg.229);
        D.25340 = BIT_FIELD_REF <*eklass, 32, 160>;
        D.25341 = D.25340 & 32;
        if (D.25341 != 0) goto <D.25342>; else goto <D.25343>;
        <D.25342>:
        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.20157>;
        <D.25343>:
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        index_var = mono_mb_add_local (mb, D.25177);
        mono_mb_emit_byte (mb, 22);
        index_var.245 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.245);
        D.25345 = mono_mb_get_label (mb);
        label2 = (guint32) D.25345;
        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.25346>; else goto <D.25347>;
        <D.25346>:
        D.25348 = conv == 4294967295;
        D.25349 = (long int) D.25348;
        D.25350 = __builtin_expect (D.25349, 0);
        if (D.25350 != 0) goto <D.25351>; else goto <D.25352>;
        <D.25351>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7976, "conv != -1");
        <D.25352>:
        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.25353 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25353);
        mono_mb_emit_byte (mb, 162);
        goto <D.25354>;
        <D.25347>:
        {
          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.25300 = conv_arg;
          return D.25300;
        }
        <D.25354>:
        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);
        goto <D.20157>;
      }
      <D.20203>:
      {
        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.20157>; else goto <D.25359>;
        <D.25359>:
        D.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        D.25360 = D.25170 != 0;
        D.25361 = (long int) D.25360;
        D.25362 = __builtin_expect (D.25361, 0);
        if (D.25362 != 0) goto <D.25363>; else goto <D.25364>;
        <D.25363>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8015, "!t->byref");
        <D.25364>:
        D.25303 = spec->native;
        D.25365 = D.25303 != 42;
        D.25366 = (long int) D.25365;
        D.25367 = __builtin_expect (D.25366, 0);
        if (D.25367 != 0) goto <D.25368>; else goto <D.25369>;
        <D.25368>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8016, "spec->native == MONO_NATIVE_LPARRAY");
        <D.25369>:
        D.25231 = t->attrs;
        D.25232 = (int) D.25231;
        D.25233 = D.25232 & 2;
        D.25370 = D.25233 == 0;
        D.25371 = (long int) D.25370;
        D.25372 = __builtin_expect (D.25371, 0);
        if (D.25372 != 0) goto <D.25373>; else goto <D.25374>;
        <D.25373>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8017, "t->attrs & PARAM_ATTRIBUTE_OUT");
        <D.25374>:
        D.25306 = spec->data.array_data.param_num;
        param_num = (int) D.25306;
        num_elem = spec->data.array_data.num_elem;
        D.25307 = spec->data.array_data.elem_mult;
        if (D.25307 == 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>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8028);
        <D.25380>:
        <D.25378>:
        eklass = klass->element_class;
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25381>; else goto <D.25382>;
        <D.25381>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25160, spec);
        goto <D.25383>;
        <D.25382>:
        D.25182 = mono_defaults.stringbuilder_class;
        if (D.25182 == eklass) goto <D.25384>; else goto <D.25385>;
        <D.25384>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25160, spec);
        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.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        dest_ptr = mono_mb_add_local (mb, D.25177);
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        loc = mono_mb_add_local (mb, D.25177);
        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.25391 = BIT_FIELD_REF <*eklass, 32, 160>;
        D.25392 = D.25391 & 32;
        if (D.25392 != 0) goto <D.25393>; else goto <D.25394>;
        <D.25393>:
        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.20157>;
        <D.25394>:
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        index_var = mono_mb_add_local (mb, D.25177);
        mono_mb_emit_byte (mb, 22);
        index_var.247 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.247);
        D.25396 = mono_mb_get_label (mb);
        label2 = (guint32) D.25396;
        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.25397>; else goto <D.25398>;
        <D.25397>:
        D.25399 = conv == 4294967295;
        D.25400 = (long int) D.25399;
        D.25401 = __builtin_expect (D.25400, 0);
        if (D.25401 != 0) goto <D.25402>; else goto <D.25403>;
        <D.25402>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8093, "conv != -1");
        <D.25403>:
        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.25404 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25404);
        mono_mb_emit_byte (mb, 223);
        goto <D.25405>;
        <D.25398>:
        {
          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.25300 = conv_arg;
          return D.25300;
        }
        <D.25405>:
        D.25406 = (short unsigned int) index_var;
        D.25407 = (int) D.25406;
        mono_mb_emit_add_to_local (mb, D.25407, 1);
        D.25408 = (short unsigned int) dest_ptr;
        D.25409 = (int) D.25408;
        mono_mb_emit_add_to_local (mb, D.25409, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label1);
        mono_mb_patch_branch (mb, label3);
        goto <D.20157>;
      }
      <D.20217>:
      {
        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.25169 = BIT_FIELD_REF <*t, 32, 32>;
        D.25170 = D.25169 & 1073741824;
        D.25360 = D.25170 != 0;
        D.25361 = (long int) D.25360;
        D.25362 = __builtin_expect (D.25361, 0);
        if (D.25362 != 0) goto <D.25410>; else goto <D.25411>;
        <D.25410>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8130, "!t->byref");
        <D.25411>:
        eklass = klass->element_class;
        mono_marshal_load_type_info (eklass);
        D.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25412>; else goto <D.25413>;
        <D.25412>:
        is_string = 1;
        D.25160 = m->piinfo;
        conv = mono_marshal_get_string_to_ptr_conv (D.25160, spec);
        goto <D.25414>;
        <D.25413>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8141);
        <D.25414>:
        if (is_string != 0) goto <D.25415>; else goto <D.25416>;
        <D.25415>:
        esize = 4;
        goto <D.25417>;
        <D.25416>:
        D.25196 = mono_defaults.char_class;
        if (D.25196 == eklass) goto <D.25418>; else goto <D.25419>;
        <D.25418>:
        D.25160 = m->piinfo;
        D.25421 = mono_pinvoke_is_unicode (D.25160);
        if (D.25421 != 0) goto <D.25422>; else goto <D.25423>;
        <D.25422>:
        iftmp.248 = 2;
        goto <D.25424>;
        <D.25423>:
        iftmp.248 = 1;
        <D.25424>:
        esize = iftmp.248;
        goto <D.25425>;
        <D.25419>:
        esize = mono_class_native_size (eklass, 0B);
        <D.25425>:
        <D.25417>:
        D.25161 = mono_defaults.object_class;
        D.25162 = &D.25161->byval_arg;
        src = mono_mb_add_local (mb, D.25162);
        D.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        dest = mono_mb_add_local (mb, D.25177);
        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.25178 = mono_defaults.string_class;
        if (D.25178 == eklass) goto <D.25427>; else goto <D.25428>;
        <D.25427>:
        mono_mb_emit_byte (mb, 23);
        mono_mb_emit_byte (mb, 88);
        <D.25428>:
        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.25176 = mono_defaults.int_class;
        D.25177 = &D.25176->byval_arg;
        index_var = mono_mb_add_local (mb, D.25177);
        mono_mb_emit_byte (mb, 22);
        index_var.251 = (unsigned int) index_var;
        mono_mb_emit_stloc (mb, index_var.251);
        D.25431 = mono_mb_get_label (mb);
        label2 = (guint32) D.25431;
        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.25432>; else goto <D.25433>;
        <D.25432>:
        D.25434 = conv == 4294967295;
        D.25435 = (long int) D.25434;
        D.25436 = __builtin_expect (D.25435, 0);
        if (D.25436 != 0) goto <D.25437>; else goto <D.25438>;
        <D.25437>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8190, "conv != -1");
        <D.25438>:
        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.25439 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25439);
        mono_mb_emit_byte (mb, 223);
        goto <D.25440>;
        <D.25433>:
        {
          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.25300 = conv_arg;
          return D.25300;
        }
        <D.25440>:
        D.25441 = (short unsigned int) index_var;
        D.25442 = (int) D.25441;
        mono_mb_emit_add_to_local (mb, D.25442, 1);
        D.25443 = (short unsigned int) dest;
        D.25444 = (int) D.25443;
        mono_mb_emit_add_to_local (mb, D.25444, esize);
        mono_mb_emit_branch_label (mb, 56, label2);
        mono_mb_patch_branch (mb, label3);
        mono_mb_patch_branch (mb, label1);
        goto <D.20157>;
      }
      <D.20229>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8220);
      <D.20157>:
      D.25300 = conv_arg;
      return D.25300;
    }
  finally
    {
      need_free = {CLOBBER};
    }
}


mono_marshal_need_free (struct MonoType * t, struct MonoMethodPInvoke * piinfo, struct MonoMarshalSpec * spec)
{
  unsigned char D.25448;
  int D.25449;
  gboolean D.25450;
  struct MonoClass * D.25451;
  struct MonoClass * D.25452;
  _Bool D.25455;
  MonoMarshalNative encoding;
  MonoMarshalConv conv;

  D.25448 = t->type;
  D.25449 = (int) D.25448;
  switch (D.25449) <default: <D.18972>, case 14: <D.18971>, case 17: <D.18967>, case 18: <D.18969>, case 28: <D.18968>>
  <D.18967>:
  D.25450 = 1;
  return D.25450;
  <D.18968>:
  <D.18969>:
  D.25451 = t->data.klass;
  D.25452 = mono_defaults.stringbuilder_class;
  if (D.25451 == D.25452) goto <D.25453>; else goto <D.25454>;
  <D.25453>:
  {
    gboolean need_free;

    try
      {
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
        D.25450 = need_free;
        return D.25450;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.25454>:
  D.25450 = 0;
  return D.25450;
  <D.18971>:
  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  D.25455 = encoding != 21;
  D.25450 = (gboolean) D.25455;
  return D.25450;
  <D.18972>:
  D.25450 = 0;
  return D.25450;
}


emit_struct_conv_full (struct MonoMethodBuilder * mb, struct MonoClass * klass, gboolean to_object, MonoMarshalNative string_encoding)
{
  struct MonoClass * D.25458;
  unsigned int D.25461;
  unsigned int D.25464;
  unsigned int D.25465;
  unsigned int msize.252;
  _Bool D.25469;
  long int D.25470;
  long int D.25471;
  struct MonoClass * D.25474;
  unsigned int D.25477;
  unsigned int D.25478;
  struct MonoType * D.25481;
  char * D.25482;
  struct MonoClassField * D.25483;
  unsigned int i.253;
  unsigned int D.25485;
  unsigned int D.25486;
  _Bool D.25487;
  short unsigned int D.25488;
  int D.25489;
  int D.25490;
  struct MonoMarshalSpec * D.25493;
  <unnamed-unsigned:1> D.25494;
  int D.25495;
  int D.25498;
  int D.25499;
  unsigned int D.25500;
  unsigned int D.25501;
  int D.25503;
  struct MonoClassField * D.25504;
  int D.25505;
  unsigned int D.25506;
  unsigned int D.25507;
  struct MonoType * D.25516;
  int D.25517;
  struct MonoType * D.25520;
  int D.25521;
  char * D.25522;
  <unnamed type> conv.254;
  unsigned int D.25526;
  unsigned int D.25527;
  unsigned char D.25529;
  unsigned int D.25539;
  unsigned char D.25540;
  int D.25541;
  unsigned int D.25542;
  unsigned char D.25543;
  int D.25544;
  struct MonoClass * D.25545;
  unsigned int D.25546;
  unsigned int D.25547;
  struct MonoClass * D.25550;
  struct MonoType * D.25551;
  unsigned int src_var.255;
  unsigned int dst_var.256;
  struct MonoMethod * variant_clear.257;
  struct MonoClass * D.25559;
  struct MonoMethod * variant_clear.258;
  struct MonoMethod * get_object_for_native_variant.259;
  struct MonoClass * D.25564;
  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.25571;
  unsigned int src_var.263;
  unsigned int dst_var.264;
  struct MonoMarshalType * info;
  int i;
  void handle_enum = <<< error >>>;

  D.25458 = klass->parent;
  if (D.25458 != 0B) goto <D.25459>; else goto <D.25460>;
  <D.25459>:
  D.25458 = klass->parent;
  emit_struct_conv (mb, D.25458, to_object);
  <D.25460>:
  info = mono_marshal_load_type_info (klass);
  D.25461 = info->native_size;
  if (D.25461 == 0) goto <D.25462>; else goto <D.25463>;
  <D.25462>:
  return;
  <D.25463>:
  D.25464 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25465 = D.25464 & 32;
  if (D.25465 != 0) goto <D.25466>; else goto <D.25467>;
  <D.25466>:
  {
    int msize;

    msize = mono_class_value_size (klass, 0B);
    msize.252 = (unsigned int) msize;
    D.25461 = info->native_size;
    D.25469 = msize.252 != D.25461;
    D.25470 = (long int) D.25469;
    D.25471 = __builtin_expect (D.25470, 0);
    if (D.25471 != 0) goto <D.25472>; else goto <D.25473>;
    <D.25472>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1871, "msize == info->native_size");
    <D.25473>:
    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.25467>:
  D.25474 = mono_defaults.safehandle_class;
  if (D.25474 != klass) goto <D.25475>; else goto <D.25476>;
  <D.25475>:
  D.25477 = klass->flags;
  D.25478 = D.25477 & 24;
  if (D.25478 == 0) goto <D.25479>; else goto <D.25480>;
  <D.25479>:
  {
    char * msg;

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

    try
      {
        D.25483 = info->fields[i].field;
        ftype = D.25483->type;
        msize = 0;
        usize = 0;
        i.253 = (unsigned int) i;
        D.25485 = info->num_fields;
        D.25486 = D.25485 + 4294967295;
        D.25487 = i.253 >= D.25486;
        last_field = (gboolean) D.25487;
        D.25488 = ftype->attrs;
        D.25489 = (int) D.25488;
        D.25490 = D.25489 & 16;
        if (D.25490 != 0) goto <D.25491>; else goto <D.25492>;
        <D.25491>:
        // predicted unlikely by continue predictor.
        goto <D.18815>;
        <D.25492>:
        D.25493 = info->fields[i].mspec;
        D.25494 = klass->unicode;
        D.25495 = (int) D.25494;
        ntype = mono_type_to_unmanaged (ftype, D.25493, 1, D.25495, &conv);
        if (last_field != 0) goto <D.25496>; else goto <D.25497>;
        <D.25496>:
        D.25498 = klass->instance_size;
        D.25483 = info->fields[i].field;
        D.25499 = D.25483->offset;
        msize = D.25498 - D.25499;
        D.25461 = info->native_size;
        D.25500 = info->fields[i].offset;
        D.25501 = D.25461 - D.25500;
        usize = (int) D.25501;
        goto <D.25502>;
        <D.25497>:
        D.25503 = i + 1;
        D.25504 = info->fields[D.25503].field;
        D.25505 = D.25504->offset;
        D.25483 = info->fields[i].field;
        D.25499 = D.25483->offset;
        msize = D.25505 - D.25499;
        D.25503 = i + 1;
        D.25506 = info->fields[D.25503].offset;
        D.25500 = info->fields[i].offset;
        D.25507 = D.25506 - D.25500;
        usize = (int) D.25507;
        <D.25502>:
        D.25474 = mono_defaults.safehandle_class;
        if (D.25474 != klass) goto <D.25508>; else goto <D.25509>;
        <D.25508>:
        D.25477 = klass->flags;
        D.25478 = D.25477 & 24;
        if (D.25478 == 16) goto <D.25510>; else goto <D.25511>;
        <D.25510>:
        if (usize == 0) goto <D.25512>; else goto <D.25513>;
        <D.25512>:
        D.25483 = info->fields[i].field;
        D.25516 = D.25483->type;
        D.25517 = mono_type_is_reference (D.25516);
        if (D.25517 != 0) goto <D.25514>; else goto <D.25518>;
        <D.25518>:
        if (last_field == 0) goto <D.25519>; else goto <D.25515>;
        <D.25519>:
        D.25503 = i + 1;
        D.25504 = info->fields[D.25503].field;
        D.25520 = D.25504->type;
        D.25521 = mono_type_is_reference (D.25520);
        if (D.25521 != 0) goto <D.25514>; else goto <D.25515>;
        <D.25514>:
        D.25481 = &klass->byval_arg;
        D.25522 = mono_type_full_name (D.25481);
        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.25522);
        <D.18816>:
        goto <D.18816>;
        <D.25515>:
        <D.25513>:
        <D.25511>:
        <D.25509>:
        conv.254 = conv;
        switch (conv.254) <default: <D.18843>, case 0: <D.18817>>
        <D.18817>:
        {
          int t;

          D.25526 = BIT_FIELD_REF <*ftype, 32, 32>;
          D.25527 = D.25526 & 1073741824;
          if (D.25527 != 0) goto <D.25524>; else goto <D.25528>;
          <D.25528>:
          D.25529 = ftype->type;
          if (D.25529 == 24) goto <D.25524>; else goto <D.25530>;
          <D.25530>:
          D.25529 = ftype->type;
          if (D.25529 == 25) goto <D.25524>; else goto <D.25525>;
          <D.25524>:
          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.18819>;
          <D.25525>:
          handle_enum:
          D.25529 = ftype->type;
          t = (int) D.25529;
          switch (t) <default: <D.18842>, case 2: <D.18825>, case 3: <D.18828>, case 4: <D.18823>, case 5: <D.18824>, case 6: <D.18826>, case 7: <D.18827>, case 8: <D.18821>, case 9: <D.18822>, case 10: <D.18829>, case 11: <D.18830>, case 12: <D.18832>, case 13: <D.18833>, case 15: <D.18831>, case 17: <D.18835>, case 28: <D.18838>>
          <D.18821>:
          <D.18822>:
          <D.18823>:
          <D.18824>:
          <D.18825>:
          <D.18826>:
          <D.18827>:
          <D.18828>:
          <D.18829>:
          <D.18830>:
          <D.18831>:
          <D.18832>:
          <D.18833>:
          mono_mb_emit_ldloc (mb, 1);
          mono_mb_emit_ldloc (mb, 0);
          if (t == 3) goto <D.25533>; else goto <D.25531>;
          <D.25533>:
          if (ntype == 4) goto <D.25534>; else goto <D.25531>;
          <D.25534>:
          if (string_encoding != 21) goto <D.25535>; else goto <D.25531>;
          <D.25535>:
          if (to_object != 0) goto <D.25536>; else goto <D.25537>;
          <D.25536>:
          mono_mb_emit_byte (mb, 71);
          mono_mb_emit_byte (mb, 83);
          goto <D.25538>;
          <D.25537>:
          mono_mb_emit_byte (mb, 73);
          mono_mb_emit_byte (mb, 82);
          <D.25538>:
          goto <D.25532>;
          <D.25531>:
          D.25539 = mono_type_to_ldind (ftype);
          D.25540 = (unsigned char) D.25539;
          D.25541 = (int) D.25540;
          mono_mb_emit_byte (mb, D.25541);
          D.25542 = mono_type_to_stind (ftype);
          D.25543 = (unsigned char) D.25542;
          D.25544 = (int) D.25543;
          mono_mb_emit_byte (mb, D.25544);
          <D.25532>:
          goto <D.18834>;
          <D.18835>:
          {
            int src_var;
            int dst_var;

            D.25545 = ftype->data.klass;
            D.25546 = BIT_FIELD_REF <*D.25545, 32, 160>;
            D.25547 = D.25546 & 16;
            if (D.25547 != 0) goto <D.25548>; else goto <D.25549>;
            <D.25548>:
            D.25545 = ftype->data.klass;
            ftype = mono_class_enum_basetype (D.25545);
            goto handle_enum;
            <D.25549>:
            D.25550 = mono_defaults.int_class;
            D.25551 = &D.25550->byval_arg;
            src_var = mono_mb_add_local (mb, D.25551);
            D.25550 = mono_defaults.int_class;
            D.25551 = &D.25550->byval_arg;
            dst_var = mono_mb_add_local (mb, D.25551);
            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.25545 = ftype->data.klass;
            emit_struct_conv (mb, D.25545, 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.18834>;
          }
          <D.18838>:
          if (to_object != 0) goto <D.25554>; else goto <D.25555>;
          <D.25554>:
          {
            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.25557>; else goto <D.25558>;
            <D.25557>:
            D.25559 = mono_class_get_variant_class ();
            variant_clear.258 = mono_class_get_method_from_name (D.25559, "Clear", 0);
            variant_clear = variant_clear.258;
            <D.25558>:
            get_object_for_native_variant.259 = get_object_for_native_variant;
            if (get_object_for_native_variant.259 == 0B) goto <D.25562>; else goto <D.25563>;
            <D.25562>:
            D.25564 = mono_defaults.marshal_class;
            get_object_for_native_variant.260 = mono_class_get_method_from_name (D.25564, "GetObjectForNativeVariant", 1);
            get_object_for_native_variant = get_object_for_native_variant.260;
            <D.25563>:
            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.25566>;
          <D.25555>:
          {
            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.25568>; else goto <D.25569>;
            <D.25568>:
            D.25564 = mono_defaults.marshal_class;
            get_native_variant_for_object.262 = mono_class_get_method_from_name (D.25564, "GetNativeVariantForObject", 2);
            get_native_variant_for_object = get_native_variant_for_object.262;
            <D.25569>:
            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.25566>:
          goto <D.18834>;
          <D.18842>:
          D.25529 = ftype->type;
          D.25571 = (int) D.25529;
          monoeg_g_log (0B, 16, "marshaling type %02x not implemented", D.25571);
          monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 2038);
          <D.18834>:
          goto <D.18819>;
        }
        <D.18843>:
        {
          int src_var;
          int dst_var;

          D.25550 = mono_defaults.int_class;
          D.25551 = &D.25550->byval_arg;
          src_var = mono_mb_add_local (mb, D.25551);
          D.25550 = mono_defaults.int_class;
          D.25551 = &D.25550->byval_arg;
          dst_var = mono_mb_add_local (mb, D.25551);
          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.25574>; else goto <D.25575>;
          <D.25574>:
          conv.254 = conv;
          D.25493 = info->fields[i].mspec;
          emit_ptr_to_object_conv (mb, ftype, conv.254, D.25493);
          goto <D.25576>;
          <D.25575>:
          conv.254 = conv;
          D.25493 = info->fields[i].mspec;
          emit_object_to_ptr_conv (mb, ftype, conv.254, D.25493);
          <D.25576>:
          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.18819>:
        if (to_object != 0) goto <D.25577>; else goto <D.25578>;
        <D.25577>:
        mono_mb_emit_add_to_local (mb, 0, usize);
        mono_mb_emit_add_to_local (mb, 1, msize);
        goto <D.25579>;
        <D.25578>:
        mono_mb_emit_add_to_local (mb, 0, msize);
        mono_mb_emit_add_to_local (mb, 1, usize);
        <D.25579>:
      }
    finally
      {
        conv = {CLOBBER};
      }
  }
  <D.18815>:
  i = i + 1;
  <D.18847>:
  i.253 = (unsigned int) i;
  D.25485 = info->num_fields;
  if (i.253 < D.25485) goto <D.18846>; else goto <D.18848>;
  <D.18848>:
}


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.25583;
  int D.25587;
  unsigned int D.25588;
  unsigned int D.25589;
  int D.25592;
  struct MonoClass * D.25594;
  struct MonoType * D.25595;
  struct MonoClass * D.25596;
  struct MonoType * D.25597;
  unsigned int array_var.265;
  unsigned int src_var.266;
  unsigned int dst_var.267;
  unsigned int index_var.268;
  int D.25602;
  short unsigned int D.25603;
  int D.25604;
  <unnamed type> D.25608;
  unsigned int src_var.269;
  unsigned int dst_var.270;
  struct MonoClass * D.25613;
  const char * D.25614;

  switch (conv) <default: <D.18724>, case 1: <D.18690>, case 2: <D.18688>, case 3: <D.18720>, case 4: <D.18705>, case 7: <D.18706>, case 9: <D.18704>, case 10: <D.18721>, case 11: <D.18722>, case 12: <D.18702>, case 13: <D.18703>, case 20: <D.18691>, case 21: <D.18700>, case 22: <D.18723>, case 23: <D.18713>, case 25: <D.18715>, case 26: <D.18717>, case 27: <D.18716>, case 28: <D.18707>, case 29: <D.18711>, case 33: <D.18718>, case 34: <D.18719>>
  <D.18688>:
  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.18689>;
  <D.18690>:
  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.18689>;
  <D.18691>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.25583 = type->type;
    if (D.25583 == 29) goto <D.25584>; else goto <D.25585>;
    <D.25584>:
    eklass = type->data.klass;
    goto <D.25586>;
    <D.25585>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1279);
    <D.25586>:
    esize = mono_class_native_size (eklass, 0B);
    mono_mb_emit_ldloc (mb, 1);
    D.25587 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25587);
    mono_mb_emit_op (mb, 141, eklass);
    mono_mb_emit_byte (mb, 223);
    D.25588 = BIT_FIELD_REF <*eklass, 32, 160>;
    D.25589 = D.25588 & 32;
    if (D.25589 != 0) goto <D.25590>; else goto <D.25591>;
    <D.25590>:
    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.25587 = mspec->data.array_data.num_elem;
    D.25592 = D.25587 * esize;
    mono_mb_emit_icon (mb, D.25592);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.25593>;
    <D.25591>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.25594 = mono_defaults.object_class;
      D.25595 = &D.25594->byval_arg;
      array_var = mono_mb_add_local (mb, D.25595);
      D.25596 = mono_defaults.int_class;
      D.25597 = &D.25596->byval_arg;
      src_var = mono_mb_add_local (mb, D.25597);
      D.25596 = mono_defaults.int_class;
      D.25597 = &D.25596->byval_arg;
      dst_var = mono_mb_add_local (mb, D.25597);
      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.25596 = mono_defaults.int_class;
      D.25597 = &D.25596->byval_arg;
      index_var = mono_mb_add_local (mb, D.25597);
      mono_mb_emit_byte (mb, 22);
      index_var.268 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.268);
      D.25602 = mono_mb_get_label (mb);
      label2 = (guint32) D.25602;
      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.25603 = (short unsigned int) index_var;
      D.25604 = (int) D.25603;
      mono_mb_emit_add_to_local (mb, D.25604, 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.25593>:
    goto <D.18689>;
  }
  <D.18700>:
  {
    struct MonoClass * eclass;

    eclass = mono_defaults.char_class;
    mono_mb_emit_ldloc (mb, 1);
    D.25587 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25587);
    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.25587 = mspec->data.array_data.num_elem;
    mono_mb_emit_icon (mb, D.25587);
    mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
    goto <D.18689>;
  }
  <D.18702>:
  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.18689>;
  <D.18703>:
  if (mspec != 0B) goto <D.25607>; else goto <D.25605>;
  <D.25607>:
  D.25608 = mspec->native;
  if (D.25608 == 23) goto <D.25609>; else goto <D.25605>;
  <D.25609>:
  D.25587 = mspec->data.array_data.num_elem;
  if (D.25587 != 0) goto <D.25610>; else goto <D.25605>;
  <D.25610>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  D.25587 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25587);
  mono_mb_emit_icall (mb, mono_string_from_byvalwstr);
  goto <D.25606>;
  <D.25605>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_icall (mb, mono_string_from_utf16);
  <D.25606>:
  mono_mb_emit_byte (mb, 81);
  goto <D.18689>;
  <D.18704>:
  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.18689>;
  <D.18705>:
  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.18689>;
  <D.18706>:
  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.18689>;
  <D.18707>:
  {
    struct MonoClass * klass;
    int src_var;
    int dst_var;

    klass = mono_class_from_mono_type (type);
    D.25596 = mono_defaults.int_class;
    D.25597 = &D.25596->byval_arg;
    src_var = mono_mb_add_local (mb, D.25597);
    D.25596 = mono_defaults.int_class;
    D.25597 = &D.25596->byval_arg;
    dst_var = mono_mb_add_local (mb, D.25597);
    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.18689>;
  }
  <D.18711>:
  {
    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.18689>;
  }
  <D.18713>:
  D.25613 = mono_class_from_mono_type (type);
  D.25614 = D.25613->name;
  monoeg_g_log (0B, 4, "Structure field of type %s can\'t be marshalled as LPArray", D.25614);
  <D.18714>:
  goto <D.18714>;
  <D.18715>:
  <D.18716>:
  <D.18717>:
  mono_cominterop_emit_ptr_to_object_conv (mb, type, conv, mspec);
  goto <D.18689>;
  <D.18718>:
  goto <D.18689>;
  <D.18719>:
  goto <D.18689>;
  <D.18720>:
  <D.18721>:
  <D.18722>:
  <D.18723>:
  <D.18724>:
  {
    char * msg;

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


emit_object_to_ptr_conv (struct MonoMethodBuilder * mb, struct MonoType * type, MonoMarshalConv conv, struct MonoMarshalSpec * mspec)
{
  unsigned int D.25616;
  unsigned int pos.271;
  void * D.25618;
  void * D.25619;
  _Bool D.25620;
  long int D.25621;
  long int D.25622;
  int D.25625;
  void * D.25626;
  unsigned char D.25627;
  unsigned int D.25631;
  unsigned int D.25632;
  unsigned int D.25636;
  unsigned int D.25637;
  int D.25640;
  struct MonoClass * D.25642;
  struct MonoType * D.25643;
  struct MonoClass * D.25644;
  struct MonoType * D.25645;
  unsigned int array_var.272;
  unsigned int src_var.273;
  unsigned int dst_var.274;
  unsigned int index_var.275;
  int D.25650;
  short unsigned int D.25651;
  int D.25652;
  unsigned int pos.276;
  unsigned int D.25654;
  unsigned int D.25655;
  unsigned int src_var.277;
  unsigned int dst_var.278;
  struct MonoClass * D.25658;
  struct MonoClass * D.25659;
  struct MonoType * D.25660;
  unsigned int D.25661;
  unsigned int pos.279;
  int pos;

  switch (conv) <default: <D.18796>, case 1: <D.18763>, case 2: <D.18761>, case 3: <D.18767>, case 4: <D.18765>, case 7: <D.18764>, case 9: <D.18766>, case 10: <D.18768>, case 11: <D.18769>, case 12: <D.18774>, case 13: <D.18775>, case 20: <D.18776>, case 21: <D.18785>, case 22: <D.18771>, case 23: <D.18772>, case 25: <D.18789>, case 26: <D.18790>, case 27: <D.18791>, case 28: <D.18786>, case 29: <D.18773>, case 33: <D.18792>, case 34: <D.18795>>
  <D.18761>:
  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.18762>;
  <D.18763>:
  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.18762>;
  <D.18764>:
  <D.18765>:
  <D.18766>:
  <D.18767>:
  <D.18768>:
  <D.18769>:
  {
    int pos;

    mono_mb_emit_ldloc (mb, 2);
    D.25616 = mono_mb_emit_short_branch (mb, 44);
    pos = (int) D.25616;
    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.25618 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.25618);
    mono_mb_emit_byte (mb, 223);
    goto <D.18762>;
  }
  <D.18771>:
  <D.18772>:
  <D.18773>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25619 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.25619);
  mono_mb_emit_byte (mb, 223);
  goto <D.18762>;
  <D.18774>:
  <D.18775>:
  D.25620 = mspec == 0B;
  D.25621 = (long int) D.25620;
  D.25622 = __builtin_expect (D.25621, 0);
  if (D.25622 != 0) goto <D.25623>; else goto <D.25624>;
  <D.25623>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 1641, "mspec");
  <D.25624>:
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25625 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25625);
  D.25626 = conv_to_icall (conv);
  mono_mb_emit_icall (mb, D.25626);
  goto <D.18762>;
  <D.18776>:
  {
    struct MonoClass * eklass;
    int esize;

    eklass = 0B;
    D.25627 = type->type;
    if (D.25627 == 29) goto <D.25628>; else goto <D.25629>;
    <D.25628>:
    eklass = type->data.klass;
    goto <D.25630>;
    <D.25629>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 1657);
    <D.25630>:
    D.25631 = BIT_FIELD_REF <*eklass, 32, 160>;
    D.25632 = D.25631 & 8;
    if (D.25632 != 0) goto <D.25633>; else goto <D.25634>;
    <D.25633>:
    esize = mono_class_native_size (eklass, 0B);
    goto <D.25635>;
    <D.25634>:
    esize = 4;
    <D.25635>:
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 80);
    D.25636 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25636;
    D.25631 = BIT_FIELD_REF <*eklass, 32, 160>;
    D.25637 = D.25631 & 32;
    if (D.25637 != 0) goto <D.25638>; else goto <D.25639>;
    <D.25638>:
    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.25625 = mspec->data.array_data.num_elem;
    D.25640 = D.25625 * esize;
    mono_mb_emit_icon (mb, D.25640);
    mono_mb_emit_byte (mb, 254);
    mono_mb_emit_byte (mb, 23);
    goto <D.25641>;
    <D.25639>:
    {
      int array_var;
      int src_var;
      int dst_var;
      int index_var;
      guint32 label2;
      guint32 label3;

      D.25642 = mono_defaults.object_class;
      D.25643 = &D.25642->byval_arg;
      array_var = mono_mb_add_local (mb, D.25643);
      D.25644 = mono_defaults.int_class;
      D.25645 = &D.25644->byval_arg;
      src_var = mono_mb_add_local (mb, D.25645);
      D.25644 = mono_defaults.int_class;
      D.25645 = &D.25644->byval_arg;
      dst_var = mono_mb_add_local (mb, D.25645);
      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.25644 = mono_defaults.int_class;
      D.25645 = &D.25644->byval_arg;
      index_var = mono_mb_add_local (mb, D.25645);
      mono_mb_emit_byte (mb, 22);
      index_var.275 = (unsigned int) index_var;
      mono_mb_emit_stloc (mb, index_var.275);
      D.25650 = mono_mb_get_label (mb);
      label2 = (guint32) D.25650;
      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.25651 = (short unsigned int) index_var;
      D.25652 = (int) D.25651;
      mono_mb_emit_add_to_local (mb, D.25652, 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.25641>:
    pos.276 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.276);
    goto <D.18762>;
  }
  <D.18785>:
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25654 = mono_mb_emit_short_branch (mb, 44);
  pos = (int) D.25654;
  mono_mb_emit_ldloc (mb, 1);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 80);
  D.25625 = mspec->data.array_data.num_elem;
  mono_mb_emit_icon (mb, D.25625);
  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.18762>;
  <D.18786>:
  {
    int src_var;
    int dst_var;

    D.25644 = mono_defaults.int_class;
    D.25645 = &D.25644->byval_arg;
    src_var = mono_mb_add_local (mb, D.25645);
    D.25644 = mono_defaults.int_class;
    D.25645 = &D.25644->byval_arg;
    dst_var = mono_mb_add_local (mb, D.25645);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.25655 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25655;
    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.25658 = mono_class_from_mono_type (type);
    emit_struct_conv (mb, D.25658, 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.18762>;
  }
  <D.18789>:
  <D.18790>:
  <D.18791>:
  mono_cominterop_emit_object_to_ptr_conv (mb, type, conv, mspec);
  goto <D.18762>;
  <D.18792>:
  {
    int dar_release_slot;
    int pos;

    D.25659 = mono_defaults.boolean_class;
    D.25660 = &D.25659->byval_arg;
    dar_release_slot = mono_mb_add_local (mb, D.25660);
    mono_mb_emit_ldloc (mb, 0);
    mono_mb_emit_byte (mb, 77);
    D.25661 = mono_mb_emit_branch (mb, 58);
    pos = (int) D.25661;
    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.18762>;
  }
  <D.18795>:
  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.18762>;
  <D.18796>:
  {
    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.18762>:
}


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.25664;
  MonoMarshalNative encoding;

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  *need_free = 1;
  switch (encoding) <default: <D.18959>, case 20: <D.18957>, case 21: <D.18956>, case 22: <D.18958>>
  <D.18956>:
  *need_free = 0;
  D.25664 = 19;
  return D.25664;
  <D.18957>:
  D.25664 = 17;
  return D.25664;
  <D.18958>:
  D.25664 = 18;
  return D.25664;
  <D.18959>:
  D.25664 = 4294967295;
  return D.25664;
}


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

  encoding = mono_marshal_get_string_encoding (piinfo, spec);
  switch (encoding) <default: <D.18937>, case 20: <D.18935>, case 21: <D.18934>, case 22: <D.18936>>
  <D.18934>:
  D.25666 = 16;
  return D.25666;
  <D.18935>:
  D.25666 = 14;
  return D.25666;
  <D.18936>:
  D.25666 = 15;
  return D.25666;
  <D.18937>:
  D.25666 = 4294967295;
  return D.25666;
}


mono_pinvoke_is_unicode (struct MonoMethodPInvoke * piinfo)
{
  short unsigned int D.25668;
  int D.25669;
  int D.25670;
  gboolean D.25671;

  D.25668 = piinfo->piflags;
  D.25669 = (int) D.25668;
  D.25670 = D.25669 & 6;
  switch (D.25670) <default: <D.20130>, case 2: <D.20127>, case 4: <D.20128>, case 6: <D.20129>>
  <D.20127>:
  D.25671 = 0;
  return D.25671;
  <D.20128>:
  D.25671 = 1;
  return D.25671;
  <D.20129>:
  <D.20130>:
  D.25671 = 0;
  return D.25671;
}


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 int D.25673;
  unsigned int D.25674;
  struct MonoClass * D.25677;
  struct MonoType * D.25678;
  unsigned int argnum.281;
  unsigned int D.25683;
  unsigned char ldc_op.282;
  int D.25685;
  unsigned int conv_arg.283;
  unsigned int label_false.284;
  unsigned int D.25689;
  unsigned int D.25690;
  unsigned int label_false.285;
  unsigned int label_end.286;
  struct MonoClass * D.25699;
  struct MonoType * D.25700;
  struct MonoType * D.25703;
  struct MonoType * D.25705;
  unsigned int D.25708;
  unsigned char ldop.287;
  int D.25710;
  unsigned int D.25712;
  unsigned int label_false.288;
  unsigned int label_null.289;
  <unnamed type> D.25720;
  unsigned int D.25721;
  unsigned int D.25722;
  int D.25723;
  unsigned int D.25724;
  unsigned int label_false.290;
  unsigned int label_end.291;
  int D.25727;
  unsigned int label_null.292;
  int D.25729;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20286>, case 0: <D.20260>, case 1: <D.20268>, case 2: <D.20265>, case 3: <D.20269>, case 4: <D.20270>, case 5: <D.20275>>
  <D.20260>:
  {
    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.25673 = BIT_FIELD_REF <*t, 32, 32>;
        D.25674 = D.25673 & 1073741824;
        if (D.25674 != 0) goto <D.25675>; else goto <D.25676>;
        <D.25675>:
        D.25677 = mono_defaults.int_class;
        D.25678 = &D.25677->byval_arg;
        *conv_arg_type = D.25678;
        goto <D.25679>;
        <D.25676>:
        *conv_arg_type = local_type;
        <D.25679>:
        conv_arg = mono_mb_add_local (mb, local_type);
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.25673 = BIT_FIELD_REF <*t, 32, 32>;
        D.25674 = D.25673 & 1073741824;
        if (D.25674 != 0) goto <D.25681>; else goto <D.25682>;
        <D.25681>:
        mono_mb_emit_byte (mb, 70);
        <D.25682>:
        D.25683 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.25683;
        ldc_op.282 = ldc_op;
        D.25685 = (int) ldc_op.282;
        mono_mb_emit_byte (mb, D.25685);
        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.20264>;
      }
    finally
      {
        ldc_op = {CLOBBER};
      }
  }
  <D.20265>:
  {
    int label_false;
    int label_end;

    D.25673 = BIT_FIELD_REF <*t, 32, 32>;
    D.25674 = D.25673 & 1073741824;
    if (D.25674 == 0) goto <D.20264>; else goto <D.25688>;
    <D.25688>:
    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.25689 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.25689;
    mono_mb_emit_byte (mb, 23);
    D.25690 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.25690;
    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.20264>;
  }
  <D.20268>:
  D.25673 = BIT_FIELD_REF <*t, 32, 32>;
  D.25674 = D.25673 & 1073741824;
  if (D.25674 != 0) goto <D.25693>; else goto <D.25694>;
  <D.25693>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.283);
  goto <D.25695>;
  <D.25694>:
  if (conv_arg != 0) goto <D.25696>; else goto <D.25697>;
  <D.25696>:
  conv_arg.283 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.283);
  goto <D.25698>;
  <D.25697>:
  argnum.281 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.281);
  <D.25698>:
  <D.25695>:
  goto <D.20264>;
  <D.20269>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20264>;
  <D.20270>:
  {
    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.25699 = mono_defaults.boolean_class;
        D.25700 = &D.25699->byval_arg;
        conv_arg = mono_mb_add_local (mb, D.25700);
        D.25673 = BIT_FIELD_REF <*t, 32, 32>;
        D.25674 = D.25673 & 1073741824;
        if (D.25674 != 0) goto <D.25701>; else goto <D.25702>;
        <D.25701>:
        D.25703 = &conv_arg_class->this_arg;
        *conv_arg_type = D.25703;
        goto <D.25704>;
        <D.25702>:
        D.25705 = &conv_arg_class->byval_arg;
        *conv_arg_type = D.25705;
        <D.25704>:
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        D.25673 = BIT_FIELD_REF <*t, 32, 32>;
        D.25674 = D.25673 & 1073741824;
        if (D.25674 != 0) goto <D.25706>; else goto <D.25707>;
        <D.25706>:
        D.25708 = mono_mb_emit_branch (mb, 57);
        label_null = (int) D.25708;
        argnum.281 = (unsigned int) argnum;
        mono_mb_emit_ldarg (mb, argnum.281);
        ldop.287 = ldop;
        D.25710 = (int) ldop.287;
        mono_mb_emit_byte (mb, D.25710);
        goto <D.25711>;
        <D.25707>:
        label_null = 0;
        <D.25711>:
        D.25712 = mono_mb_emit_branch (mb, 57);
        label_false = (int) D.25712;
        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.25673 = BIT_FIELD_REF <*t, 32, 32>;
        D.25674 = D.25673 & 1073741824;
        if (D.25674 != 0) goto <D.25714>; else goto <D.25715>;
        <D.25714>:
        label_null.289 = (unsigned int) label_null;
        mono_mb_patch_branch (mb, label_null.289);
        <D.25715>:
        goto <D.20264>;
      }
    finally
      {
        ldop = {CLOBBER};
      }
  }
  <D.20275>:
  {
    guint8 stop;
    guint8 ldc_op;
    int label_null;
    int label_false;
    int label_end;

    stop = 84;
    ldc_op = 23;
    D.25673 = BIT_FIELD_REF <*t, 32, 32>;
    D.25674 = D.25673 & 1073741824;
    if (D.25674 == 0) goto <D.20264>; else goto <D.25717>;
    <D.25717>:
    if (spec != 0B) goto <D.25718>; else goto <D.25719>;
    <D.25718>:
    D.25720 = spec->native;
    switch (D.25720) <default: <D.20285>, case 3: <D.20281>, case 4: <D.20282>, case 37: <D.20284>>
    <D.20281>:
    <D.20282>:
    stop = 82;
    goto <D.20283>;
    <D.20284>:
    stop = 83;
    ldc_op = 21;
    goto <D.20283>;
    <D.20285>:
    goto <D.20283>;
    <D.20283>:
    <D.25719>:
    argnum.281 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.281);
    D.25721 = mono_mb_emit_branch (mb, 57);
    label_null = (int) D.25721;
    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.25722 = mono_mb_emit_branch (mb, 57);
    label_false = (int) D.25722;
    D.25723 = (int) ldc_op;
    mono_mb_emit_byte (mb, D.25723);
    D.25724 = mono_mb_emit_branch (mb, 56);
    label_end = (int) D.25724;
    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.25727 = (int) stop;
    mono_mb_emit_byte (mb, D.25727);
    label_null.292 = (unsigned int) label_null;
    mono_mb_patch_branch (mb, label_null.292);
    goto <D.20264>;
  }
  <D.20286>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 8436);
  <D.20264>:
  D.25729 = conv_arg;
  return D.25729;
}


marshal_boolean_conv_in_get_local_type (struct MonoMarshalSpec * spec, guint8 * ldc_op)
{
  struct MonoType * D.25736;
  struct MonoClass * D.25737;
  <unnamed type> D.25738;
  struct MonoClass * D.25739;
  struct MonoClass * D.25742;

  if (spec == 0B) goto <D.25734>; else goto <D.25735>;
  <D.25734>:
  D.25737 = mono_defaults.int32_class;
  D.25736 = &D.25737->byval_arg;
  return D.25736;
  <D.25735>:
  D.25738 = spec->native;
  switch (D.25738) <default: <D.20238>, case 2: <D.20237>, case 3: <D.20234>, case 4: <D.20235>, case 37: <D.20236>>
  <D.20234>:
  <D.20235>:
  D.25739 = mono_defaults.byte_class;
  D.25736 = &D.25739->byval_arg;
  return D.25736;
  <D.20236>:
  if (ldc_op != 0B) goto <D.25740>; else goto <D.25741>;
  <D.25740>:
  *ldc_op = 21;
  <D.25741>:
  D.25742 = mono_defaults.int16_class;
  D.25736 = &D.25742->byval_arg;
  return D.25736;
  <D.20237>:
  D.25737 = mono_defaults.int32_class;
  D.25736 = &D.25737->byval_arg;
  return D.25736;
  <D.20238>:
  D.25738 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.25738);
  D.25737 = mono_defaults.int32_class;
  D.25736 = &D.25737->byval_arg;
  return D.25736;
}


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

  conv_arg_class = mono_defaults.int32_class;
  if (spec != 0B) goto <D.25744>; else goto <D.25745>;
  <D.25744>:
  D.25746 = spec->native;
  switch (D.25746) <default: <D.20249>, case 2: <D.20248>, case 3: <D.20244>, case 4: <D.20245>, case 37: <D.20247>>
  <D.20244>:
  <D.20245>:
  conv_arg_class = mono_defaults.byte_class;
  if (ldop != 0B) goto <D.25747>; else goto <D.25748>;
  <D.25747>:
  *ldop = 70;
  <D.25748>:
  goto <D.20246>;
  <D.20247>:
  conv_arg_class = mono_defaults.int16_class;
  if (ldop != 0B) goto <D.25749>; else goto <D.25750>;
  <D.25749>:
  *ldop = 72;
  <D.25750>:
  goto <D.20246>;
  <D.20248>:
  goto <D.20246>;
  <D.20249>:
  D.25746 = spec->native;
  monoeg_g_log (0B, 16, "marshalling bool as native type %x is currently not supported", D.25746);
  <D.20246>:
  <D.25745>:
  D.25751 = conv_arg_class;
  return D.25751;
}


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.25755;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20301>, case 0: <D.20297>, case 1: <D.20299>, case 3: <D.20300>>
  <D.20297>:
  goto <D.20298>;
  <D.20299>:
  argnum.293 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.293);
  goto <D.20298>;
  <D.20300>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20298>;
  <D.20301>:
  goto <D.20298>;
  <D.20298>:
  D.25755 = conv_arg;
  return D.25755;
}


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.25759;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20315>, case 1: <D.20312>, case 3: <D.20314>>
  <D.20312>:
  argnum.294 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.294);
  goto <D.20313>;
  <D.20314>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20313>;
  <D.20315>:
  goto <D.20313>;
  <D.20313>:
  D.25759 = conv_arg;
  return D.25759;
}


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.25763;
  struct MonoMethodBuilder * mb;

  mb = m->mb;
  switch (action) <default: <D.20329>, case 1: <D.20326>, case 3: <D.20328>>
  <D.20326>:
  argnum.295 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.295);
  goto <D.20327>;
  <D.20328>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20327>;
  <D.20329>:
  goto <D.20327>;
  <D.20327>:
  D.25763 = conv_arg;
  return D.25763;
}


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.25771;
  struct MonoClass * tmp_klass.297;
  _Bool D.25773;
  long int D.25774;
  long int D.25775;
  struct MonoMethod * to_oadate.299;
  struct MonoMethod * to_oadate.300;
  _Bool D.25784;
  long int D.25785;
  long int D.25786;
  struct MonoClass * D.25789;
  struct MonoType * D.25790;
  unsigned int D.25791;
  unsigned int D.25792;
  unsigned int argnum.301;
  unsigned int D.25796;
  short unsigned int D.25800;
  unsigned int D.25801;
  unsigned int D.25802;
  struct MonoMethodSignature * D.25805;
  <unnamed-unsigned:1> D.25806;
  int D.25807;
  int D.25808;
  unsigned int conv_arg.302;
  unsigned int pos.303;
  unsigned int D.25813;
  unsigned int D.25814;
  unsigned int D.25816;
  unsigned int D.25817;
  struct MonoClass * D.25819;
  struct MonoType * D.25820;
  int D.25824;
  unsigned int D.25827;
  <unnamed type> D.25835;
  _Bool D.25838;
  long int D.25839;
  long int D.25840;
  struct MonoMethod * from_oadate.304;
  struct MonoMethod * from_oadate.305;
  _Bool D.25866;
  long int D.25867;
  long int D.25868;
  unsigned int D.25875;
  unsigned int D.25883;
  struct MonoType * D.25887;
  int D.25888;
  int D.25889;
  unsigned int D.25896;
  unsigned int D.25904;
  unsigned int pos2.306;
  int D.25909;
  int D.25910;
  _Bool D.25911;
  long int D.25912;
  long int D.25913;
  int D.25916;
  unsigned int D.25917;
  int D.25918;
  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.25767>; else goto <D.25768>;
      <D.25767>:
      if (0 != 0) goto <D.25769>; else goto <D.25770>;
      <D.25769>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "mono_defaults.corlib == mono_defaults.corlib");
      <D.25770>:
      D.25771 = mono_defaults.corlib;
      tmp_klass.297 = mono_class_from_name (D.25771, "System", "DateTime");
      tmp_klass = tmp_klass.297;
      tmp_klass.296 = tmp_klass;
      D.25773 = tmp_klass.296 == 0B;
      D.25774 = (long int) D.25773;
      D.25775 = __builtin_expect (D.25774, 0);
      if (D.25775 != 0) goto <D.25776>; else goto <D.25777>;
      <D.25776>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6226, "tmp_klass");
      <D.25777>:
      <D.25768>:
    }
    date_time_class.298 = tmp_klass;
  }
  date_time_class = date_time_class.298;
  switch (action) <default: <D.19985>, case 0: <D.19975>, case 1: <D.19978>, case 2: <D.19979>, case 3: <D.19981>, case 4: <D.19982>, case 5: <D.19983>, case 6: <D.19984>>
  <D.19975>:
  if (klass == date_time_class) goto <D.25778>; else goto <D.25779>;
  <D.25778>:
  {
    static struct MonoMethod * to_oadate;

    to_oadate.299 = to_oadate;
    if (to_oadate.299 == 0B) goto <D.25781>; else goto <D.25782>;
    <D.25781>:
    to_oadate.300 = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
    to_oadate = to_oadate.300;
    <D.25782>:
    to_oadate.299 = to_oadate;
    D.25784 = to_oadate.299 == 0B;
    D.25785 = (long int) D.25784;
    D.25786 = __builtin_expect (D.25785, 0);
    if (D.25786 != 0) goto <D.25787>; else goto <D.25788>;
    <D.25787>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6236, "to_oadate");
    <D.25788>:
    D.25789 = mono_defaults.double_class;
    D.25790 = &D.25789->byval_arg;
    conv_arg = mono_mb_add_local (mb, D.25790);
    D.25791 = BIT_FIELD_REF <*t, 32, 32>;
    D.25792 = D.25791 & 1073741824;
    if (D.25792 != 0) goto <D.25793>; else goto <D.25794>;
    <D.25793>:
    argnum.301 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.301);
    D.25796 = mono_mb_emit_branch (mb, 57);
    pos = (int) D.25796;
    <D.25794>:
    D.25791 = BIT_FIELD_REF <*t, 32, 32>;
    D.25792 = D.25791 & 1073741824;
    if (D.25792 == 0) goto <D.25797>; else goto <D.25799>;
    <D.25799>:
    D.25800 = t->attrs;
    D.25801 = (unsigned int) D.25800;
    D.25802 = D.25801 & 3;
    if (D.25802 != 2) goto <D.25797>; else goto <D.25798>;
    <D.25797>:
    D.25791 = BIT_FIELD_REF <*t, 32, 32>;
    D.25792 = D.25791 & 1073741824;
    if (D.25792 == 0) goto <D.25803>; else goto <D.25804>;
    <D.25803>:
    D.25805 = m->csig;
    D.25805 = m->csig;
    D.25806 = D.25805->hasthis;
    D.25807 = (int) D.25806;
    D.25808 = argnum - D.25807;
    D.25789 = mono_defaults.double_class;
    D.25790 = &D.25789->byval_arg;
    D.25805->params[D.25808] = D.25790;
    <D.25804>:
    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.25798>:
    D.25791 = BIT_FIELD_REF <*t, 32, 32>;
    D.25792 = D.25791 & 1073741824;
    if (D.25792 != 0) goto <D.25810>; else goto <D.25811>;
    <D.25810>:
    pos.303 = (unsigned int) pos;
    mono_mb_patch_branch (mb, pos.303);
    <D.25811>:
    goto <D.19977>;
  }
  <D.25779>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.19977>; else goto <D.25815>;
  <D.25815>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.19977>; else goto <D.25818>;
  <D.25818>:
  D.25819 = mono_defaults.int_class;
  D.25820 = &D.25819->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25820);
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25821>; else goto <D.25822>;
  <D.25821>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.25823>;
  <D.25822>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.25823>:
  mono_mb_emit_stloc (mb, 0);
  D.25824 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.25824);
  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.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25825>; else goto <D.25826>;
  <D.25825>:
  mono_mb_emit_ldloc (mb, 0);
  D.25827 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25827;
  <D.25826>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 == 0) goto <D.25828>; else goto <D.25830>;
  <D.25830>:
  D.25800 = t->attrs;
  D.25801 = (unsigned int) D.25800;
  D.25802 = D.25801 & 3;
  if (D.25802 != 2) goto <D.25828>; else goto <D.25829>;
  <D.25828>:
  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.25829>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25831>; else goto <D.25832>;
  <D.25831>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25832>:
  goto <D.19977>;
  <D.19978>:
  if (spec != 0B) goto <D.25833>; else goto <D.25834>;
  <D.25833>:
  D.25835 = spec->native;
  if (D.25835 == 43) goto <D.25836>; else goto <D.25837>;
  <D.25836>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  D.25838 = D.25792 != 0;
  D.25839 = (long int) D.25838;
  D.25840 = __builtin_expect (D.25839, 0);
  if (D.25840 != 0) goto <D.25841>; else goto <D.25842>;
  <D.25841>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6301, "!t->byref");
  <D.25842>:
  D.25805 = m->csig;
  D.25805 = m->csig;
  D.25806 = D.25805->hasthis;
  D.25807 = (int) D.25806;
  D.25808 = argnum - D.25807;
  D.25819 = mono_defaults.int_class;
  D.25820 = &D.25819->byval_arg;
  D.25805->params[D.25808] = D.25820;
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.25843>; else goto <D.25846>;
  <D.25846>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.25843>; else goto <D.25844>;
  <D.25843>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  goto <D.25845>;
  <D.25844>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.25845>:
  goto <D.19977>;
  <D.25837>:
  <D.25834>:
  if (klass == date_time_class) goto <D.25847>; else goto <D.25848>;
  <D.25847>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25849>; else goto <D.25850>;
  <D.25849>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.302);
  goto <D.25851>;
  <D.25850>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  <D.25851>:
  goto <D.19977>;
  <D.25848>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.25852>; else goto <D.25854>;
  <D.25854>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.25852>; else goto <D.25853>;
  <D.25852>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.19977>;
  <D.25853>:
  conv_arg.302 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.302);
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 == 0) goto <D.25855>; else goto <D.25856>;
  <D.25855>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 6, klass);
  <D.25856>:
  goto <D.19977>;
  <D.19979>:
  if (klass == date_time_class) goto <D.25857>; else goto <D.25858>;
  <D.25857>:
  {
    static struct MonoMethod * from_oadate;

    D.25791 = BIT_FIELD_REF <*t, 32, 32>;
    D.25792 = D.25791 & 1073741824;
    if (D.25792 == 0) goto <D.19977>; else goto <D.25859>;
    <D.25859>:
    D.25800 = t->attrs;
    D.25801 = (unsigned int) D.25800;
    D.25802 = D.25801 & 3;
    if (D.25802 != 1) goto <D.25860>; else goto <D.25861>;
    <D.25860>:
    from_oadate.304 = from_oadate;
    if (from_oadate.304 == 0B) goto <D.25863>; else goto <D.25864>;
    <D.25863>:
    from_oadate.305 = mono_class_get_method_from_name (date_time_class, "FromOADate", 1);
    from_oadate = from_oadate.305;
    <D.25864>:
    from_oadate.304 = from_oadate;
    D.25866 = from_oadate.304 == 0B;
    D.25867 = (long int) D.25866;
    D.25868 = __builtin_expect (D.25867, 0);
    if (D.25868 != 0) goto <D.25869>; else goto <D.25870>;
    <D.25869>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6345, "from_oadate");
    <D.25870>:
    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.25861>:
    goto <D.19977>;
  }
  <D.25858>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.19977>; else goto <D.25871>;
  <D.25871>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.19977>; else goto <D.25872>;
  <D.25872>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25873>; else goto <D.25874>;
  <D.25873>:
  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.25875 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25875;
  D.25800 = t->attrs;
  D.25801 = (unsigned int) D.25800;
  D.25802 = D.25801 & 3;
  if (D.25802 != 1) goto <D.25876>; else goto <D.25877>;
  <D.25876>:
  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.25877>:
  <D.25874>:
  emit_struct_free (mb, klass, conv_arg);
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25878>; else goto <D.25879>;
  <D.25878>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25879>:
  goto <D.19977>;
  <D.19981>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.25880>; else goto <D.25882>;
  <D.25882>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25883 = D.25816 & 32;
  if (D.25883 != 0) goto <D.25880>; else goto <D.25881>;
  <D.25880>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.19977>;
  <D.25881>:
  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.19977>;
  <D.19982>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.25884>; else goto <D.25886>;
  <D.25886>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.25884>; else goto <D.25885>;
  <D.25884>:
  conv_arg = 0;
  goto <D.19977>;
  <D.25885>:
  D.25887 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25887);
  D.25800 = t->attrs;
  D.25888 = (int) D.25800;
  D.25889 = D.25888 & 2;
  if (D.25889 != 0) goto <D.19977>; else goto <D.25890>;
  <D.25890>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25891>; else goto <D.25892>;
  <D.25891>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  goto <D.25893>;
  <D.25892>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg_addr (mb, argnum.301);
  <D.25893>:
  mono_mb_emit_stloc (mb, 0);
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 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>:
  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.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25897>; else goto <D.25898>;
  <D.25897>:
  pos.303 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.303);
  <D.25898>:
  goto <D.19977>;
  <D.19983>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.19977>; else goto <D.25899>;
  <D.25899>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.19977>; else goto <D.25900>;
  <D.25900>:
  D.25791 = BIT_FIELD_REF <*t, 32, 32>;
  D.25792 = D.25791 & 1073741824;
  if (D.25792 != 0) goto <D.25901>; else goto <D.25902>;
  <D.25901>:
  D.25800 = t->attrs;
  D.25801 = (unsigned int) D.25800;
  D.25802 = D.25801 & 3;
  if (D.25802 == 1) goto <D.19977>; else goto <D.25903>;
  <D.25903>:
  <D.25902>:
  argnum.301 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.301);
  D.25904 = mono_mb_emit_branch (mb, 57);
  pos2 = (int) D.25904;
  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.19977>;
  <D.19984>:
  D.25813 = klass->flags;
  D.25814 = D.25813 & 24;
  if (D.25814 == 16) goto <D.25906>; else goto <D.25908>;
  <D.25908>:
  D.25816 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25817 = D.25816 & 48;
  if (D.25817 != 0) goto <D.25906>; else goto <D.25907>;
  <D.25906>:
  mono_mb_emit_stloc (mb, 3);
  m->retobj_var = 0;
  goto <D.19977>;
  <D.25907>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_stloc (mb, 0);
  D.25819 = mono_defaults.int_class;
  D.25820 = &D.25819->byval_arg;
  D.25909 = mono_mb_add_local (mb, D.25820);
  m->retobj_var = D.25909;
  m->retobj_class = klass;
  D.25910 = m->retobj_var;
  D.25911 = D.25910 == 0;
  D.25912 = (long int) D.25911;
  D.25913 = __builtin_expect (D.25912, 0);
  if (D.25913 != 0) goto <D.25914>; else goto <D.25915>;
  <D.25914>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 6481, "m->retobj_var");
  <D.25915>:
  D.25916 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.25916);
  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.25910 = m->retobj_var;
  D.25917 = (unsigned int) D.25910;
  mono_mb_emit_stloc (mb, D.25917);
  emit_struct_conv (mb, klass, 0);
  goto <D.19977>;
  <D.19985>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 6494);
  <D.19977>:
  D.25918 = conv_arg;
  return D.25918;
}


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.25920;
  struct MonoType * D.25921;
  int * D.25922;
  unsigned int argnum.307;
  unsigned int D.25924;
  int * D.25925;
  struct MonoClass * D.25926;
  struct MonoClass * D.25927;
  unsigned int D.25930;
  unsigned int D.25931;
  unsigned int D.25934;
  unsigned int D.25935;
  short unsigned int D.25938;
  int D.25939;
  int D.25940;
  unsigned int conv_arg.308;
  unsigned int argnum.309;
  void * D.25946;
  struct MonoClass * D.25948;
  struct MonoMethodPInvoke * D.25951;
  unsigned int D.25954;
  unsigned int D.25955;
  void * D.25961;
  unsigned int D.25963;
  unsigned int D.25966;
  unsigned int pos.310;
  unsigned int D.25972;
  int D.25973;
  int D.25976;
  int D.25977;
  unsigned int D.25978;
  _Bool D.25981;
  long int D.25982;
  long int D.25983;
  void * D.25989;
  int need_free.311;
  void * D.25997;
  unsigned int D.26004;
  unsigned int D.26011;
  _Bool D.26014;
  long int D.26015;
  long int D.26016;
  unsigned int pos2.312;
  _Bool D.26025;
  long int D.26026;
  long int D.26027;
  void * D.26030;
  unsigned int loc.313;
  unsigned int D.26033;
  struct MonoType * D.26034;
  void * D.26039;
  _Bool D.26042;
  long int D.26043;
  long int D.26044;
  _Bool D.26049;
  long int D.26050;
  long int D.26051;
  unsigned int D.26054;
  unsigned int D.26055;
  unsigned int D.26062;
  unsigned int pos2.314;
  unsigned int D.26064;
  unsigned int D.26067;
  unsigned int D.26068;
  int D.26069;
  void * D.26073;
  unsigned int D.26076;
  unsigned int D.26077;
  int D.26078;
  int D.26079;
  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.20099>, case 0: <D.20077>, case 1: <D.20092>, case 2: <D.20084>, case 3: <D.20093>, case 4: <D.20094>, case 5: <D.20097>, case 6: <D.20098>>
  <D.20077>:
  D.25920 = mono_defaults.int_class;
  D.25921 = &D.25920->byval_arg;
  *conv_arg_type = D.25921;
  D.25920 = mono_defaults.int_class;
  D.25921 = &D.25920->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.25921);
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  *D.25925 = 0;
  D.25926 = mono_class_from_mono_type (t);
  D.25927 = mono_defaults.object_class;
  if (D.25926 == D.25927) goto <D.25928>; else goto <D.25929>;
  <D.25928>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Marshalling of type object is not implemented");
    mono_mb_emit_exception_marshal_directive (mb, msg);
    goto <D.20079>;
  }
  <D.25929>:
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25931 = D.25930 & 16777216;
  if (D.25931 != 0) goto <D.25932>; else goto <D.25933>;
  <D.25932>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.25936>; else goto <D.25937>;
  <D.25936>:
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 == 0) goto <D.25941>; else goto <D.25942>;
  <D.25941>:
  {
    char * msg;

    msg = monoeg_g_strdup_printf ("Byref marshalling of delegates is not implemented.");
    mono_mb_emit_exception_marshal_directive (mb, msg);
  }
  <D.25942>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.25944>;
  <D.25937>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.25946 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.25946);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  <D.25944>:
  goto <D.25947>;
  <D.25933>:
  D.25948 = mono_defaults.stringbuilder_class;
  if (D.25948 == klass) goto <D.25949>; else goto <D.25950>;
  <D.25949>:
  {
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    D.25951 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.25951, spec);
    D.25951 = m->piinfo;
    conv = mono_marshal_get_stringbuilder_to_ptr_conv (D.25951, spec);
    D.25934 = BIT_FIELD_REF <*t, 32, 32>;
    D.25935 = D.25934 & 1073741824;
    if (D.25935 != 0) goto <D.25952>; else goto <D.25953>;
    <D.25952>:
    D.25938 = t->attrs;
    D.25954 = (unsigned int) D.25938;
    D.25955 = D.25954 & 3;
    if (D.25955 == 2) goto <D.20079>; else goto <D.25956>;
    <D.25956>:
    <D.25953>:
    if (conv == 4294967295) goto <D.25957>; else goto <D.25958>;
    <D.25957>:
    {
      char * msg;

      msg = monoeg_g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
      mono_mb_emit_exception_marshal_directive (mb, msg);
      goto <D.20079>;
    }
    <D.25958>:
    argnum.309 = (unsigned int) argnum;
    mono_mb_emit_ldarg (mb, argnum.309);
    D.25934 = BIT_FIELD_REF <*t, 32, 32>;
    D.25935 = D.25934 & 1073741824;
    if (D.25935 != 0) goto <D.25959>; else goto <D.25960>;
    <D.25959>:
    mono_mb_emit_byte (mb, 77);
    <D.25960>:
    D.25961 = conv_to_icall (conv);
    mono_mb_emit_icall (mb, D.25961);
    conv_arg.308 = (unsigned int) conv_arg;
    mono_mb_emit_stloc (mb, conv_arg.308);
  }
  goto <D.25962>;
  <D.25950>:
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25963 = D.25930 & 32;
  if (D.25963 != 0) goto <D.25964>; else goto <D.25965>;
  <D.25964>:
  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.25966 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25966;
  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.20079>;
  <D.25965>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.25968>; else goto <D.25969>;
  <D.25968>:
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 != 0) goto <D.20079>; else goto <D.25970>;
  <D.25970>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  mono_mb_emit_byte (mb, 77);
  goto <D.25971>;
  <D.25969>:
  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.25971>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.25972 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.25972;
  D.25973 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.25973);
  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.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.25974>; else goto <D.25975>;
  <D.25974>:
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25920 = mono_defaults.int_class;
  D.25921 = &D.25920->byval_arg;
  D.25976 = mono_mb_add_local (mb, D.25921);
  *D.25925 = D.25976;
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25977 = *D.25925;
  D.25978 = (unsigned int) D.25977;
  mono_mb_emit_stloc (mb, D.25978);
  <D.25975>:
  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.25962>:
  <D.25947>:
  goto <D.20079>;
  <D.20084>:
  D.25948 = mono_defaults.stringbuilder_class;
  if (D.25948 == klass) goto <D.25979>; else goto <D.25980>;
  <D.25979>:
  {
    gboolean need_free;
    MonoMarshalNative encoding;
    MonoMarshalConv conv;

    try
      {
        D.25951 = m->piinfo;
        encoding = mono_marshal_get_string_encoding (D.25951, spec);
        D.25951 = m->piinfo;
        conv = mono_marshal_get_ptr_to_stringbuilder_conv (D.25951, spec, &need_free);
        D.25981 = encoding == 4294967295;
        D.25982 = (long int) D.25981;
        D.25983 = __builtin_expect (D.25982, 0);
        if (D.25983 != 0) goto <D.25984>; else goto <D.25985>;
        <D.25984>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7051, "encoding != -1");
        <D.25985>:
        D.25934 = BIT_FIELD_REF <*t, 32, 32>;
        D.25935 = D.25934 & 1073741824;
        if (D.25935 != 0) goto <D.25986>; else goto <D.25987>;
        <D.25986>:
        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.20091>, case 20: <D.20090>, case 21: <D.20088>>
        <D.20088>:
        mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
        goto <D.20089>;
        <D.20090>:
        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
        goto <D.20089>;
        <D.20091>:
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7069);
        <D.20089>:
        mono_mb_emit_byte (mb, 81);
        goto <D.25988>;
        <D.25987>:
        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.25989 = conv_to_icall (conv);
        mono_mb_emit_icall (mb, D.25989);
        <D.25988>:
        need_free.311 = need_free;
        if (need_free.311 != 0) goto <D.25991>; else goto <D.25992>;
        <D.25991>:
        conv_arg.308 = (unsigned int) conv_arg;
        mono_mb_emit_ldloc (mb, conv_arg.308);
        mono_mb_emit_icall (mb, mono_marshal_free);
        <D.25992>:
        goto <D.20079>;
      }
    finally
      {
        need_free = {CLOBBER};
      }
  }
  <D.25980>:
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25931 = D.25930 & 16777216;
  if (D.25931 != 0) goto <D.25993>; else goto <D.25994>;
  <D.25993>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.25995>; else goto <D.25996>;
  <D.25995>:
  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.25997 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.25997);
  mono_mb_emit_byte (mb, 81);
  <D.25996>:
  goto <D.20079>;
  <D.25994>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.25998>; else goto <D.25999>;
  <D.25998>:
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 != 0) goto <D.26000>; else goto <D.26001>;
  <D.26000>:
  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.26001>:
  <D.25999>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.26002>; else goto <D.26003>;
  <D.26002>:
  mono_mb_emit_byte (mb, 77);
  <D.26003>:
  mono_mb_emit_stloc (mb, 1);
  mono_mb_emit_ldloc (mb, 1);
  D.26004 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26004;
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.26005>; else goto <D.26008>;
  <D.26008>:
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 != 0) goto <D.26005>; else goto <D.26006>;
  <D.26005>:
  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.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25977 = *D.25925;
  if (D.25977 != 0) goto <D.26009>; else goto <D.26010>;
  <D.26009>:
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25977 = *D.25925;
  D.25978 = (unsigned int) D.25977;
  mono_mb_emit_ldloc (mb, D.25978);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.26011 = mono_mb_emit_branch (mb, 59);
  pos2 = (int) D.26011;
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 == 0) goto <D.26012>; else goto <D.26013>;
  <D.26012>:
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25977 = *D.25925;
  D.26014 = D.25977 == 0;
  D.26015 = (long int) D.26014;
  D.26016 = __builtin_expect (D.26015, 0);
  if (D.26016 != 0) goto <D.26017>; else goto <D.26018>;
  <D.26017>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7144, "m->orig_conv_args [argnum]");
  <D.26018>:
  D.25922 = m->orig_conv_args;
  argnum.307 = (unsigned int) argnum;
  D.25924 = argnum.307 * 4;
  D.25925 = D.25922 + D.25924;
  D.25977 = *D.25925;
  emit_struct_free (mb, klass, D.25977);
  <D.26013>:
  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.26010>:
  goto <D.26007>;
  <D.26006>:
  emit_struct_free (mb, klass, conv_arg);
  <D.26007>:
  pos.310 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.310);
  goto <D.20079>;
  <D.20092>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.26020>; else goto <D.26021>;
  <D.26020>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc_addr (mb, conv_arg.308);
  goto <D.26022>;
  <D.26021>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  <D.26022>:
  goto <D.20079>;
  <D.20093>:
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25931 = D.25930 & 16777216;
  if (D.25931 != 0) goto <D.26023>; else goto <D.26024>;
  <D.26023>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  D.26025 = D.25935 != 0;
  D.26026 = (long int) D.26025;
  D.26027 = __builtin_expect (D.26026, 0);
  if (D.26027 != 0) goto <D.26028>; else goto <D.26029>;
  <D.26028>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7171, "!t->byref");
  <D.26029>:
  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.26030 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26030);
  mono_mb_emit_stloc (mb, 3);
  goto <D.26031>;
  <D.26024>:
  mono_mb_emit_stloc (mb, 0);
  D.25920 = mono_defaults.int_class;
  D.25921 = &D.25920->byval_arg;
  loc = mono_mb_add_local (mb, D.25921);
  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.26033 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26033;
  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.26031>:
  goto <D.20079>;
  <D.20094>:
  D.26034 = &klass->byval_arg;
  conv_arg = mono_mb_add_local (mb, D.26034);
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25931 = D.25930 & 16777216;
  if (D.25931 != 0) goto <D.26035>; else goto <D.26036>;
  <D.26035>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  D.26025 = D.25935 != 0;
  D.26026 = (long int) D.26025;
  D.26027 = __builtin_expect (D.26026, 0);
  if (D.26027 != 0) goto <D.26037>; else goto <D.26038>;
  <D.26037>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7221, "!t->byref");
  <D.26038>:
  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.26039 = conv_to_icall (30);
  mono_mb_emit_icall (mb, D.26039);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.20079>;
  <D.26036>:
  D.25948 = mono_defaults.stringbuilder_class;
  if (D.25948 == klass) goto <D.26040>; else goto <D.26041>;
  <D.26040>:
  {
    MonoMarshalNative encoding;

    D.25951 = m->piinfo;
    encoding = mono_marshal_get_string_encoding (D.25951, spec);
    D.26042 = encoding != 20;
    D.26043 = (long int) D.26042;
    D.26044 = __builtin_expect (D.26043, 0);
    if (D.26044 != 0) goto <D.26045>; else goto <D.26046>;
    <D.26045>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7236, "encoding == MONO_NATIVE_LPSTR");
    <D.26046>:
    D.25934 = BIT_FIELD_REF <*t, 32, 32>;
    D.25935 = D.25934 & 1073741824;
    D.26025 = D.25935 != 0;
    D.26026 = (long int) D.26025;
    D.26027 = __builtin_expect (D.26026, 0);
    if (D.26027 != 0) goto <D.26047>; else goto <D.26048>;
    <D.26047>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7238, "!t->byref");
    <D.26048>:
    D.26049 = encoding == 4294967295;
    D.26050 = (long int) D.26049;
    D.26051 = __builtin_expect (D.26050, 0);
    if (D.26051 != 0) goto <D.26052>; else goto <D.26053>;
    <D.26052>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 7239, "encoding != -1");
    <D.26053>:
    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.20079>;
  }
  <D.26041>:
  D.26054 = klass->flags;
  D.26055 = D.26054 & 24;
  if (D.26055 == 0) goto <D.26056>; else goto <D.26057>;
  <D.26056>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20079>;
  <D.26057>:
  D.25938 = t->attrs;
  D.25939 = (int) D.25938;
  D.25940 = D.25939 & 2;
  if (D.25940 != 0) goto <D.26058>; else goto <D.26059>;
  <D.26058>:
  mono_mb_emit_byte (mb, 20);
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_stloc (mb, conv_arg.308);
  goto <D.20079>;
  <D.26059>:
  argnum.309 = (unsigned int) argnum;
  mono_mb_emit_ldarg (mb, argnum.309);
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.26060>; else goto <D.26061>;
  <D.26060>:
  {
    int pos2;

    D.26062 = mono_mb_emit_branch (mb, 58);
    pos2 = (int) D.26062;
    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.26061>:
  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.26064 = mono_mb_emit_branch (mb, 57);
  pos = (int) D.26064;
  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.20079>;
  <D.20097>:
  D.25934 = BIT_FIELD_REF <*t, 32, 32>;
  D.25935 = D.25934 & 1073741824;
  if (D.25935 != 0) goto <D.26065>; else goto <D.26066>;
  <D.26065>:
  conv_arg.308 = (unsigned int) conv_arg;
  mono_mb_emit_ldloc (mb, conv_arg.308);
  D.26067 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26067;
  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.26068 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26068;
  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.26069 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26069);
  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.26070>;
  <D.26066>:
  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.26070>:
  goto <D.20079>;
  <D.20098>:
  D.25930 = BIT_FIELD_REF <*klass, 32, 160>;
  D.25931 = D.25930 & 16777216;
  if (D.25931 != 0) goto <D.26071>; else goto <D.26072>;
  <D.26071>:
  D.26073 = conv_to_icall (29);
  mono_mb_emit_icall (mb, D.26073);
  mono_mb_emit_stloc (mb, 3);
  goto <D.20079>;
  <D.26072>:
  D.26054 = klass->flags;
  D.26055 = D.26054 & 24;
  if (D.26055 == 0) goto <D.26074>; else goto <D.26075>;
  <D.26074>:
  mono_mb_emit_auto_layout_exception (mb, klass);
  goto <D.20079>;
  <D.26075>:
  mono_mb_emit_stloc (mb, 0);
  mono_mb_emit_ldloc (mb, 0);
  D.26076 = mono_mb_emit_branch (mb, 58);
  pos = (int) D.26076;
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_stloc (mb, 3);
  D.26077 = mono_mb_emit_branch (mb, 56);
  pos2 = (int) D.26077;
  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.26078 = mono_class_native_size (klass, 0B);
  mono_mb_emit_icon (mb, D.26078);
  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.20079>;
  <D.20099>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 7389);
  <D.20079>:
  D.26079 = conv_arg;
  return D.26079;
}


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

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


mono_marshal_get_native_wrapper (struct MonoMethod * method, gboolean check_exceptions, gboolean aot)
{
  _Bool D.26084;
  long int D.26085;
  long int D.26086;
  struct MonoMethodSignature * D.26089;
  unsigned int D.26090;
  unsigned int D.26091;
  _Bool D.26092;
  long int D.26093;
  long int D.26094;
  struct MonoClass * D.26099;
  struct MonoImage * D.26100;
  struct GHashTable * * D.26101;
  struct GHashTable * * D.26103;
  struct MonoMethod * D.26106;
  unsigned int D.26107;
  unsigned int D.26108;
  short unsigned int D.26111;
  int D.26112;
  int D.26113;
  short unsigned int D.26116;
  int D.26117;
  int D.26118;
  void * D.26121;
  int D.26126;
  void * D.26133;
  _Bool D.26136;
  long int D.26137;
  long int D.26138;
  unsigned int D.26141;
  unsigned int D.26142;
  _Bool D.26143;
  long int D.26144;
  long int D.26145;
  unsigned int D.26148;
  unsigned int D.26149;
  _Bool D.26150;
  long int D.26151;
  long int D.26152;
  struct MonoClass * D.26155;
  struct MonoType * D.26156;
  int D.20460;
  int iftmp.315;
  int D.20456;
  const char[13] * D.26160;
  unsigned char D.26161;
  int D.26162;
  unsigned char D.26163;
  int D.26164;
  const unsigned char * D.26169;
  unsigned char D.26170;
  int D.26171;
  const unsigned char * D.26172;
  unsigned char D.26173;
  int D.26174;
  const unsigned char * D.26179;
  unsigned char D.26180;
  int D.26181;
  const unsigned char * D.26182;
  unsigned char D.26183;
  int D.26184;
  const unsigned char * D.26189;
  unsigned char D.26190;
  int D.26191;
  const unsigned char * D.26192;
  unsigned char D.26193;
  int D.26194;
  const char * D.26196;
  struct MonoMethodSignature * D.26199;
  int D.26200;
  short unsigned int D.26203;
  int D.26204;
  int D.26205;
  _Bool D.26206;
  long int D.26207;
  long int D.26208;
  short unsigned int D.26211;
  int D.26212;
  int D.26213;
  _Bool D.26214;
  long int D.26215;
  long int D.26216;
  const char * D.26219;
  unsigned int i.316;
  short unsigned int D.26221;
  int D.26222;
  int D.26223;
  struct MonoMethod * D.26224;
  const char * exc_class.317;
  const char * exc_arg.318;
  int D.26231;
  int D.26232;
  unsigned int D.26242;
  unsigned int pos.319;
  <unnamed-unsigned:1> D.26244;
  int D.26245;
  int D.26246;
  unsigned int D.26247;
  short unsigned int D.26248;
  int D.26249;
  struct MonoMethod * D.26252;
  _Bool D.26254;
  long int D.26255;
  long int D.26256;
  _Bool D.26261;
  long int D.26262;
  long int D.26263;
  int D.26270;
  unsigned int D.26271;
  unsigned int D.26272;
  struct MonoClass * D.26273;
  struct MonoImage * D.26274;
  unsigned int i.320;
  unsigned int D.26276;
  struct MonoMarshalSpec * * D.26277;
  struct MonoMarshalSpec * D.26278;
  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.26084 = method == 0B;
      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", 8859, "method != NULL");
      <D.26088>:
      D.26089 = mono_method_signature (method);
      D.26090 = BIT_FIELD_REF <*D.26089, 32, 64>;
      D.26091 = D.26090 & 16777216;
      D.26092 = D.26091 == 0;
      D.26093 = (long int) D.26092;
      D.26094 = __builtin_expect (D.26093, 0);
      if (D.26094 != 0) goto <D.26095>; else goto <D.26096>;
      <D.26095>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8860, "mono_method_signature (method)->pinvoke");
      <D.26096>:
      if (aot != 0) goto <D.26097>; else goto <D.26098>;
      <D.26097>:
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      D.26101 = &D.26100->native_wrapper_aot_cache;
      cache = get_cache (D.26101, mono_aligned_addr_hash, 0B);
      goto <D.26102>;
      <D.26098>:
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      D.26103 = &D.26100->native_wrapper_cache;
      cache = get_cache (D.26103, mono_aligned_addr_hash, 0B);
      <D.26102>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26104>; else goto <D.26105>;
      <D.26104>:
      D.26106 = res;
      return D.26106;
      <D.26105>:
      D.26099 = method->klass;
      D.26107 = D.26099->flags;
      D.26108 = D.26107 & 4096;
      if (D.26108 != 0) goto <D.26109>; else goto <D.26110>;
      <D.26109>:
      D.26106 = mono_cominterop_get_native_wrapper (method);
      return D.26106;
      <D.26110>:
      sig = mono_method_signature (method);
      D.26111 = method->iflags;
      D.26112 = (int) D.26111;
      D.26113 = D.26112 & 4096;
      if (D.26113 == 0) goto <D.26114>; else goto <D.26115>;
      <D.26114>:
      D.26116 = method->flags;
      D.26117 = (int) D.26116;
      D.26118 = D.26117 & 8192;
      if (D.26118 != 0) goto <D.26119>; else goto <D.26120>;
      <D.26119>:
      pinvoke = 1;
      <D.26120>:
      <D.26115>:
      D.26121 = piinfo->addr;
      if (D.26121 == 0B) goto <D.26122>; else goto <D.26123>;
      <D.26122>:
      if (pinvoke != 0) goto <D.26124>; else goto <D.26125>;
      <D.26124>:
      D.26111 = method->iflags;
      D.26112 = (int) D.26111;
      D.26126 = D.26112 & 1;
      if (D.26126 != 0) goto <D.26127>; else goto <D.26128>;
      <D.26127>:
      exc_arg = "Method contains unsupported native code";
      goto <D.26129>;
      <D.26128>:
      if (aot == 0) goto <D.26130>; else goto <D.26131>;
      <D.26130>:
      mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
      <D.26131>:
      <D.26129>:
      goto <D.26132>;
      <D.26125>:
      D.26133 = mono_lookup_internal_call (method);
      piinfo->addr = D.26133;
      <D.26132>:
      <D.26123>:
      D.26121 = piinfo->addr;
      if (D.26121 == ves_icall_System_String_ctor_RedirectToCreateString) goto <D.26134>; else goto <D.26135>;
      <D.26134>:
      D.26136 = pinvoke != 0;
      D.26137 = (long int) D.26136;
      D.26138 = __builtin_expect (D.26137, 0);
      if (D.26138 != 0) goto <D.26139>; else goto <D.26140>;
      <D.26139>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8896, "!pinvoke");
      <D.26140>:
      D.26141 = BIT_FIELD_REF <*method, 32, 160>;
      D.26142 = D.26141 & 128;
      D.26143 = D.26142 == 0;
      D.26144 = (long int) D.26143;
      D.26145 = __builtin_expect (D.26144, 0);
      if (D.26145 != 0) goto <D.26146>; else goto <D.26147>;
      <D.26146>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8897, "method->string_ctor");
      <D.26147>:
      D.26148 = BIT_FIELD_REF <*sig, 32, 64>;
      D.26149 = D.26148 & 4194304;
      D.26150 = D.26149 == 0;
      D.26151 = (long int) D.26150;
      D.26152 = __builtin_expect (D.26151, 0);
      if (D.26152 != 0) goto <D.26153>; else goto <D.26154>;
      <D.26153>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8898, "sig->hasthis");
      <D.26154>:
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      csig = signature_dup (D.26100, sig);
      D.26155 = mono_defaults.string_class;
      D.26156 = &D.26155->byval_arg;
      csig->ret = D.26156;
      csig->pinvoke = 0;
      iter = 0B;
      goto <D.20466>;
      <D.20465>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = res->name;
          D.26160 = "CreateString";
          D.26161 = MEM[(const unsigned char *)D.26160];
          D.26162 = (int) D.26161;
          D.26163 = *__s2;
          D.26164 = (int) D.26163;
          __result = D.26162 - D.26164;
          {
            if (__s1_len != 0) goto <D.26165>; else goto <D.26166>;
            <D.26165>:
            if (__result == 0) goto <D.26167>; else goto <D.26168>;
            <D.26167>:
            D.26169 = &MEM[(void *)"CreateString" + 1B];
            D.26170 = *D.26169;
            D.26171 = (int) D.26170;
            D.26172 = __s2 + 1;
            D.26173 = *D.26172;
            D.26174 = (int) D.26173;
            __result = D.26171 - D.26174;
            if (__s1_len > 1) goto <D.26175>; else goto <D.26176>;
            <D.26175>:
            if (__result == 0) goto <D.26177>; else goto <D.26178>;
            <D.26177>:
            D.26179 = &MEM[(void *)"CreateString" + 2B];
            D.26180 = *D.26179;
            D.26181 = (int) D.26180;
            D.26182 = __s2 + 2;
            D.26183 = *D.26182;
            D.26184 = (int) D.26183;
            __result = D.26181 - D.26184;
            if (__s1_len > 2) goto <D.26185>; else goto <D.26186>;
            <D.26185>:
            if (__result == 0) goto <D.26187>; else goto <D.26188>;
            <D.26187>:
            D.26189 = &MEM[(void *)"CreateString" + 3B];
            D.26190 = *D.26189;
            D.26191 = (int) D.26190;
            D.26192 = __s2 + 3;
            D.26193 = *D.26192;
            D.26194 = (int) D.26193;
            __result = D.26191 - D.26194;
            <D.26188>:
            <D.26186>:
            <D.26178>:
            <D.26176>:
            <D.26168>:
            <D.26166>:
          }
          D.20456 = __result;
        }
        iftmp.315 = D.20456;
        goto <D.26195>;
        <D.26159>:
        D.26196 = res->name;
        iftmp.315 = __builtin_strcmp ("CreateString", D.26196);
        <D.26195>:
        D.20460 = iftmp.315;
      }
      if (D.20460 == 0) goto <D.26197>; else goto <D.26198>;
      <D.26197>:
      D.26199 = mono_method_signature (res);
      D.26200 = mono_metadata_signature_equal (csig, D.26199);
      if (D.26200 != 0) goto <D.26201>; else goto <D.26202>;
      <D.26201>:
      {
        struct WrapperInfo * info;

        D.26203 = res->iflags;
        D.26204 = (int) D.26203;
        D.26205 = D.26204 & 4096;
        D.26206 = D.26205 != 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", 8911, "!(res->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)");
        <D.26210>:
        D.26211 = res->flags;
        D.26212 = (int) D.26211;
        D.26213 = D.26212 & 8192;
        D.26214 = D.26213 != 0;
        D.26215 = (long int) D.26214;
        D.26216 = __builtin_expect (D.26215, 0);
        if (D.26216 != 0) goto <D.26217>; else goto <D.26218>;
        <D.26217>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 8912, "!(res->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)");
        <D.26218>:
        D.26099 = method->klass;
        D.26219 = method->name;
        mb = mono_mb_new (D.26099, D.26219, 7);
        mono_mb_emit_byte (mb, 2);
        i = 1;
        goto <D.20463>;
        <D.20462>:
        i.316 = (unsigned int) i;
        mono_mb_emit_ldarg (mb, i.316);
        i = i + 1;
        <D.20463>:
        D.26221 = csig->param_count;
        D.26222 = (int) D.26221;
        if (D.26222 >= i) goto <D.20462>; else goto <D.20464>;
        <D.20464>:
        mono_mb_emit_managed_call (mb, res, 0B);
        mono_mb_emit_byte (mb, 42);
        D.26221 = csig->param_count;
        D.26222 = (int) D.26221;
        D.26223 = D.26222 + 1;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.26223);
        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.26106 = res;
        return D.26106;
      }
      <D.26202>:
      <D.26198>:
      <D.20466>:
      D.26155 = mono_defaults.string_class;
      res = mono_class_get_methods (D.26155, &iter);
      if (res != 0B) goto <D.20465>; else goto <D.20467>;
      <D.20467>:
      piinfo->addr = 0B;
      monoeg_g_log (0B, 16, "cannot find CreateString for .ctor");
      <D.26135>:
      D.26099 = method->klass;
      D.26219 = method->name;
      mb = mono_mb_new (D.26099, D.26219, 6);
      D.26224 = mb->method;
      D.26224->save_lmf = 1;
      D.26121 = piinfo->addr;
      if (D.26121 == 0B) goto <D.26225>; else goto <D.26226>;
      <D.26225>:
      if (aot == 0) goto <D.26227>; else goto <D.26228>;
      <D.26227>:
      exc_class.317 = exc_class;
      exc_arg.318 = exc_arg;
      mono_mb_emit_exception (mb, exc_class.317, exc_arg.318);
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      csig = signature_dup (D.26100, sig);
      csig->pinvoke = 0;
      D.26221 = csig->param_count;
      D.26222 = (int) D.26221;
      D.26231 = D.26222 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26231);
      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.26106 = res;
      return D.26106;
      <D.26228>:
      <D.26226>:
      D.26111 = method->iflags;
      D.26112 = (int) D.26111;
      D.26232 = D.26112 & 4099;
      if (D.26232 != 0) goto <D.26233>; else goto <D.26234>;
      <D.26233>:
      D.26148 = BIT_FIELD_REF <*sig, 32, 64>;
      D.26149 = D.26148 & 4194304;
      if (D.26149 != 0) goto <D.26235>; else goto <D.26236>;
      <D.26235>:
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      D.26099 = method->klass;
      csig = signature_dup_add_this (D.26100, sig, D.26099);
      goto <D.26237>;
      <D.26236>:
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      csig = signature_dup (D.26100, sig);
      <D.26237>:
      D.26141 = BIT_FIELD_REF <*method, 32, 160>;
      D.26142 = D.26141 & 128;
      if (D.26142 != 0) goto <D.26238>; else goto <D.26239>;
      <D.26238>:
      D.26155 = mono_defaults.string_class;
      D.26156 = &D.26155->byval_arg;
      csig->ret = D.26156;
      <D.26239>:
      D.26148 = BIT_FIELD_REF <*sig, 32, 64>;
      D.26149 = D.26148 & 4194304;
      if (D.26149 != 0) goto <D.26240>; else goto <D.26241>;
      <D.26240>:
      {
        int pos;

        mono_mb_emit_byte (mb, 2);
        D.26242 = mono_mb_emit_branch (mb, 58);
        pos = (int) D.26242;
        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.26241>:
      i = 0;
      goto <D.20470>;
      <D.20469>:
      D.26244 = sig->hasthis;
      D.26245 = (int) D.26244;
      D.26246 = D.26245 + i;
      D.26247 = (unsigned int) D.26246;
      mono_mb_emit_ldarg (mb, D.26247);
      i = i + 1;
      <D.20470>:
      D.26248 = sig->param_count;
      D.26249 = (int) D.26248;
      if (D.26249 > i) goto <D.20469>; else goto <D.20471>;
      <D.20471>:
      if (aot != 0) goto <D.26250>; else goto <D.26251>;
      <D.26250>:
      mono_mb_emit_byte (mb, 240);
      D.26252 = &piinfo->method;
      mono_mb_emit_op (mb, 14, D.26252);
      mono_mb_emit_calli (mb, csig);
      goto <D.26253>;
      <D.26251>:
      D.26121 = piinfo->addr;
      D.26254 = D.26121 == 0B;
      D.26255 = (long int) D.26254;
      D.26256 = __builtin_expect (D.26255, 0);
      if (D.26256 != 0) goto <D.26257>; else goto <D.26258>;
      <D.26257>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9005, "piinfo->addr");
      <D.26258>:
      D.26121 = piinfo->addr;
      mono_mb_emit_native_call (mb, csig, D.26121);
      <D.26253>:
      if (check_exceptions != 0) goto <D.26259>; else goto <D.26260>;
      <D.26259>:
      emit_thread_interrupt_checkpoint (mb);
      <D.26260>:
      mono_mb_emit_byte (mb, 42);
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      csig = signature_dup (D.26100, csig);
      csig->pinvoke = 0;
      D.26221 = csig->param_count;
      D.26222 = (int) D.26221;
      D.26231 = D.26222 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26231);
      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.26106 = res;
      return D.26106;
      <D.26234>:
      D.26261 = pinvoke == 0;
      D.26262 = (long int) D.26261;
      D.26263 = __builtin_expect (D.26262, 0);
      if (D.26263 != 0) goto <D.26264>; else goto <D.26265>;
      <D.26264>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9026, "pinvoke");
      <D.26265>:
      if (aot == 0) goto <D.26266>; else goto <D.26267>;
      <D.26266>:
      D.26121 = piinfo->addr;
      D.26254 = D.26121 == 0B;
      D.26255 = (long int) D.26254;
      D.26256 = __builtin_expect (D.26255, 0);
      if (D.26256 != 0) goto <D.26268>; else goto <D.26269>;
      <D.26268>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9028, "piinfo->addr");
      <D.26269>:
      <D.26267>:
      D.26248 = sig->param_count;
      D.26249 = (int) D.26248;
      D.26270 = D.26249 + 1;
      D.26271 = (unsigned int) D.26270;
      D.26272 = D.26271 * 4;
      mspecs = monoeg_malloc (D.26272);
      mono_method_get_marshal_info (method, mspecs);
      D.26224 = mb->method;
      D.26273 = D.26224->klass;
      D.26274 = D.26273->image;
      D.26121 = piinfo->addr;
      mono_marshal_emit_native_wrapper (D.26274, mb, sig, piinfo, mspecs, D.26121, aot, check_exceptions, 0);
      D.26099 = method->klass;
      D.26100 = D.26099->image;
      csig = signature_dup (D.26100, sig);
      csig->pinvoke = 0;
      D.26221 = csig->param_count;
      D.26222 = (int) D.26221;
      D.26231 = D.26222 + 16;
      res = mono_mb_create_and_cache (cache, method, mb, csig, D.26231);
      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.26248 = sig->param_count;
      i = (int) D.26248;
      goto <D.20473>;
      <D.20472>:
      i.320 = (unsigned int) i;
      D.26276 = i.320 * 4;
      D.26277 = mspecs + D.26276;
      D.26278 = *D.26277;
      if (D.26278 != 0B) goto <D.26279>; else goto <D.26280>;
      <D.26279>:
      i.320 = (unsigned int) i;
      D.26276 = i.320 * 4;
      D.26277 = mspecs + D.26276;
      D.26278 = *D.26277;
      mono_metadata_free_marshal_spec (D.26278);
      <D.26280>:
      i = i + -1;
      <D.20473>:
      if (i >= 0) goto <D.20472>; else goto <D.20474>;
      <D.20474>:
      monoeg_g_free (mspecs);
      D.26106 = res;
      return D.26106;
    }
  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.26283;
  struct MonoMethod * D.26286;
  struct MonoClass * D.26287;
  struct MonoMethod * D.26288;
  short unsigned int D.26289;
  int D.26290;
  int D.26291;
  struct MonoMethodSignature * csig;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;
  char * name;

  D.26283 = &image->native_wrapper_cache;
  cache = get_cache (D.26283, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, func);
  if (res != 0B) goto <D.26284>; else goto <D.26285>;
  <D.26284>:
  D.26286 = res;
  return D.26286;
  <D.26285>:
  name = monoeg_g_strdup_printf ("wrapper_native_%p", func);
  D.26287 = mono_defaults.object_class;
  mb = mono_mb_new (D.26287, name, 6);
  D.26288 = mb->method;
  D.26288->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.26289 = csig->param_count;
  D.26290 = (int) D.26289;
  D.26291 = D.26290 + 16;
  res = mono_mb_create_and_cache (cache, func, mb, csig, D.26291);
  mono_mb_free (mb);
  mono_marshal_set_wrapper_info (res, 0B);
  D.26286 = res;
  return D.26286;
}


mono_marshal_get_native_func_wrapper_aot (struct MonoClass * klass)
{
  struct MonoClass * D.26293;
  struct GHashTable * * D.26294;
  struct MonoMethod * D.26297;
  struct MonoMethodSignature * D.26298;
  short unsigned int D.26299;
  int D.26300;
  int D.26301;
  unsigned int D.26302;
  unsigned int D.26303;
  struct MonoMethodSignature * D.26304;
  struct MonoMethod * D.26305;
  unsigned int D.26306;
  unsigned int D.26307;
  _Bool D.26308;
  long int D.26309;
  long int D.26310;
  struct MonoClass * D.26313;
  short unsigned int D.26314;
  int D.26315;
  int D.26316;
  struct MonoMethodSignature * D.26317;
  short unsigned int D.26318;
  unsigned int i.321;
  unsigned int D.26320;
  struct MonoMarshalSpec * * D.26321;
  struct MonoMarshalSpec * D.26322;
  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.26293 = invoke->klass;
      image = D.26293->image;
      D.26294 = &image->native_func_wrapper_aot_cache;
      cache = get_cache (D.26294, mono_aligned_addr_hash, 0B);
      res = mono_marshal_find_in_cache (cache, invoke);
      if (res != 0B) goto <D.26295>; else goto <D.26296>;
      <D.26295>:
      D.26297 = res;
      return D.26297;
      <D.26296>:
      memset (&mpiinfo, 0, 32);
      parse_unmanaged_function_pointer_attr (klass, &mpiinfo);
      D.26298 = mono_method_signature (invoke);
      D.26299 = D.26298->param_count;
      D.26300 = (int) D.26299;
      D.26301 = D.26300 + 1;
      D.26302 = (unsigned int) D.26301;
      D.26303 = D.26302 * 4;
      mspecs = monoeg_malloc0 (D.26303);
      mono_method_get_marshal_info (invoke, mspecs);
      D.26304 = mono_method_signature (invoke);
      sig = mono_metadata_signature_dup (D.26304);
      sig->hasthis = 0;
      name = monoeg_g_strdup_printf ("wrapper_aot_native");
      D.26293 = invoke->klass;
      mb = mono_mb_new (D.26293, name, 6);
      D.26305 = mb->method;
      D.26305->save_lmf = 1;
      mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, 0B, 0, 1, 1);
      D.26306 = BIT_FIELD_REF <*sig, 32, 64>;
      D.26307 = D.26306 & 4194304;
      D.26308 = D.26307 != 0;
      D.26309 = (long int) D.26308;
      D.26310 = __builtin_expect (D.26309, 0);
      if (D.26310 != 0) goto <D.26311>; else goto <D.26312>;
      <D.26311>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9148, "!sig->hasthis");
      <D.26312>:
      D.26313 = mono_defaults.int_class;
      csig = signature_dup_add_this (image, sig, D.26313);
      csig->pinvoke = 0;
      D.26314 = csig->param_count;
      D.26315 = (int) D.26314;
      D.26316 = D.26315 + 16;
      res = mono_mb_create_and_cache (cache, invoke, mb, csig, D.26316);
      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.26317 = mono_method_signature (invoke);
      D.26318 = D.26317->param_count;
      i = (int) D.26318;
      goto <D.20504>;
      <D.20503>:
      i.321 = (unsigned int) i;
      D.26320 = i.321 * 4;
      D.26321 = mspecs + D.26320;
      D.26322 = *D.26321;
      if (D.26322 != 0B) goto <D.26323>; else goto <D.26324>;
      <D.26323>:
      i.321 = (unsigned int) i;
      D.26320 = i.321 * 4;
      D.26321 = mspecs + D.26320;
      D.26322 = *D.26321;
      mono_metadata_free_marshal_spec (D.26322);
      <D.26324>:
      i = i + -1;
      <D.20504>:
      if (i >= 0) goto <D.20503>; else goto <D.20505>;
      <D.20505>:
      monoeg_g_free (mspecs);
      monoeg_g_free (sig);
      D.26297 = res;
      return D.26297;
    }
  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.26327;
  struct MonoType * D.26328;
  struct MonoClass * D.26329;
  struct MonoType * D.26330;
  unsigned int D.26331;
  unsigned int D.26332;
  short unsigned int D.26335;
  short unsigned int D.26336;
  int D.26339;
  int D.26340;
  int D.26341;
  _Bool D.26342;
  long int D.26343;
  long int D.26344;
  struct MonoType * * D.26347;
  struct MonoType * * D.26348;
  int D.26349;
  unsigned int D.26350;
  unsigned int D.26351;
  short unsigned int D.26352;
  short unsigned int D.26353;
  struct MonoType * D.26354;
  int D.26355;
  unsigned int D.26358;
  unsigned int D.26359;
  unsigned char D.26360;
  int D.26361;
  unsigned int i.322;
  unsigned int D.26363;
  int * D.26364;
  struct MonoType * D.26365;
  sizetype i.323;
  sizetype D.26367;
  sizetype D.26368;
  struct MonoMarshalSpec * * D.26369;
  struct MonoMarshalSpec * D.26370;
  struct MonoType * * D.26371;
  int D.26372;
  int target_handle.324;
  int D.26382;
  unsigned int D.26385;
  unsigned int D.26386;
  unsigned int D.26389;
  unsigned int i.325;
  struct MonoMarshalSpec * D.26395;
  <unnamed type> D.26397;
  unsigned int D.26399;
  unsigned int D.26400;
  unsigned char D.26403;
  int D.26404;
  <unnamed type> D.26409;
  unsigned int D.26411;
  unsigned int D.26412;
  unsigned char D.26415;
  int D.26416;
  struct MonoType * D.26419;
  short unsigned int D.26420;
  int D.26421;
  int D.26422;
  int D.26425;
  unsigned int D.26428;
  struct MonoClass * D.26429;
  int D.26431;
  struct MonoMethodSignature * sig;
  struct MonoMethodSignature * csig;
  int i;
  int * tmp_locals;
  gboolean closed;

  closed = 0;
  sig = m->sig;
  csig = m->csig;
  D.26327 = mono_defaults.int_class;
  D.26328 = &D.26327->byval_arg;
  mono_mb_add_local (mb, D.26328);
  D.26327 = mono_defaults.int_class;
  D.26328 = &D.26327->byval_arg;
  mono_mb_add_local (mb, D.26328);
  D.26329 = mono_defaults.boolean_class;
  D.26330 = &D.26329->byval_arg;
  mono_mb_add_local (mb, D.26330);
  D.26331 = BIT_FIELD_REF <*sig, 32, 64>;
  D.26332 = D.26331 & 4194304;
  if (D.26332 == 0) goto <D.26333>; else goto <D.26334>;
  <D.26333>:
  D.26335 = sig->param_count;
  D.26336 = invoke_sig->param_count;
  if (D.26335 != D.26336) goto <D.26337>; else goto <D.26338>;
  <D.26337>:
  D.26335 = sig->param_count;
  D.26339 = (int) D.26335;
  D.26336 = invoke_sig->param_count;
  D.26340 = (int) D.26336;
  D.26341 = D.26340 + 1;
  D.26342 = D.26339 != D.26341;
  D.26343 = (long int) D.26342;
  D.26344 = __builtin_expect (D.26343, 0);
  if (D.26344 != 0) goto <D.26345>; else goto <D.26346>;
  <D.26345>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9229, "sig->param_count == invoke_sig->param_count + 1");
  <D.26346>:
  closed = 1;
  sig = mono_metadata_signature_dup (sig);
  D.26347 = &sig->params[0];
  D.26348 = &sig->params[1];
  D.26335 = sig->param_count;
  D.26339 = (int) D.26335;
  D.26349 = D.26339 + -1;
  D.26350 = (unsigned int) D.26349;
  D.26351 = D.26350 * 4;
  memmove (D.26347, D.26348, D.26351);
  D.26335 = sig->param_count;
  D.26352 = D.26335;
  D.26353 = D.26352 + 65535;
  sig->param_count = D.26353;
  <D.26338>:
  <D.26334>:
  D.26354 = sig->ret;
  D.26355 = mono_type_is_void (D.26354);
  if (D.26355 == 0) goto <D.26356>; else goto <D.26357>;
  <D.26356>:
  D.26354 = sig->ret;
  mono_mb_add_local (mb, D.26354);
  <D.26357>:
  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.26335 = sig->param_count;
  D.26358 = (unsigned int) D.26335;
  D.26359 = D.26358 * 4;
  tmp_locals = __builtin_alloca (D.26359);
  i = 0;
  goto <D.20530>;
  <D.20529>:
  {
    struct MonoType * t;

    t = sig->params[i];
    D.26360 = t->type;
    D.26361 = (int) D.26360;
    switch (D.26361) <default: <D.20528>, case 2: <D.20526>, case 14: <D.20525>, case 17: <D.20522>, case 18: <D.20521>, case 20: <D.20523>, case 28: <D.20520>, case 29: <D.20524>>
    <D.20520>:
    <D.20521>:
    <D.20522>:
    <D.20523>:
    <D.20524>:
    <D.20525>:
    <D.20526>:
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26365 = sig->params[i];
    i.323 = (sizetype) i;
    D.26367 = i.323 + 1;
    D.26368 = D.26367 * 4;
    D.26369 = mspecs + D.26368;
    D.26370 = *D.26369;
    D.26371 = &csig->params[i];
    D.26372 = emit_marshal (m, i, D.26365, D.26370, 0, D.26371, 4);
    *D.26364 = D.26372;
    goto <D.20527>;
    <D.20528>:
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    *D.26364 = 0;
    goto <D.20527>;
    <D.20527>:
  }
  i = i + 1;
  <D.20530>:
  D.26335 = sig->param_count;
  D.26339 = (int) D.26335;
  if (D.26339 > i) goto <D.20529>; else goto <D.20531>;
  <D.20531>:
  emit_thread_interrupt_checkpoint (mb);
  D.26331 = BIT_FIELD_REF <*sig, 32, 64>;
  D.26332 = D.26331 & 4194304;
  if (D.26332 != 0) goto <D.26373>; else goto <D.26374>;
  <D.26373>:
  if (target_handle != 0) goto <D.26375>; else goto <D.26376>;
  <D.26375>:
  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.26378>;
  <D.26376>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9282);
  <D.26378>:
  goto <D.26379>;
  <D.26374>:
  if (closed != 0) goto <D.26380>; else goto <D.26381>;
  <D.26380>:
  target_handle.324 = (int) target_handle;
  mono_mb_emit_icon (mb, target_handle.324);
  mono_mb_emit_icall (mb, mono_gchandle_get_target);
  <D.26381>:
  <D.26379>:
  i = 0;
  goto <D.20534>;
  <D.20533>:
  {
    struct MonoType * t;

    t = sig->params[i];
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    if (D.26382 != 0) goto <D.26383>; else goto <D.26384>;
    <D.26383>:
    D.26385 = BIT_FIELD_REF <*t, 32, 32>;
    D.26386 = D.26385 & 1073741824;
    if (D.26386 != 0) goto <D.26387>; else goto <D.26388>;
    <D.26387>:
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    D.26389 = (unsigned int) D.26382;
    mono_mb_emit_ldloc_addr (mb, D.26389);
    goto <D.26390>;
    <D.26388>:
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    D.26389 = (unsigned int) D.26382;
    mono_mb_emit_ldloc (mb, D.26389);
    <D.26390>:
    goto <D.26391>;
    <D.26384>:
    i.325 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.325);
    <D.26391>:
  }
  i = i + 1;
  <D.20534>:
  D.26335 = sig->param_count;
  D.26339 = (int) D.26335;
  if (D.26339 > i) goto <D.20533>; else goto <D.20535>;
  <D.20535>:
  mono_mb_emit_managed_call (mb, method, 0B);
  D.26395 = *mspecs;
  if (D.26395 != 0B) goto <D.26396>; else goto <D.26393>;
  <D.26396>:
  D.26395 = *mspecs;
  D.26397 = D.26395->native;
  if (D.26397 == 44) goto <D.26398>; else goto <D.26393>;
  <D.26398>:
  D.26354 = sig->ret;
  D.26395 = *mspecs;
  emit_marshal (m, 0, D.26354, D.26395, 0, 0B, 6);
  goto <D.26394>;
  <D.26393>:
  D.26354 = sig->ret;
  D.26399 = BIT_FIELD_REF <*D.26354, 32, 32>;
  D.26400 = D.26399 & 1073741824;
  if (D.26400 == 0) goto <D.26401>; else goto <D.26402>;
  <D.26401>:
  D.26354 = sig->ret;
  D.26403 = D.26354->type;
  D.26404 = (int) D.26403;
  switch (D.26404) <default: <D.20558>, case 1: <D.20536>, case 2: <D.20538>, case 3: <D.20541>, case 4: <D.20539>, case 5: <D.20540>, case 6: <D.20542>, case 7: <D.20543>, case 8: <D.20544>, case 9: <D.20545>, case 10: <D.20551>, case 11: <D.20552>, case 12: <D.20549>, case 13: <D.20550>, case 14: <D.20554>, case 15: <D.20548>, case 17: <D.20555>, case 18: <D.20556>, case 24: <D.20546>, case 25: <D.20547>, case 28: <D.20553>, case 29: <D.20557>>
  <D.20536>:
  goto <D.20537>;
  <D.20538>:
  <D.20539>:
  <D.20540>:
  <D.20541>:
  <D.20542>:
  <D.20543>:
  <D.20544>:
  <D.20545>:
  <D.20546>:
  <D.20547>:
  <D.20548>:
  <D.20549>:
  <D.20550>:
  <D.20551>:
  <D.20552>:
  <D.20553>:
  mono_mb_emit_stloc (mb, 3);
  goto <D.20537>;
  <D.20554>:
  D.26327 = mono_defaults.int_class;
  D.26328 = &D.26327->byval_arg;
  csig->ret = D.26328;
  D.26354 = sig->ret;
  D.26395 = *mspecs;
  emit_marshal (m, 0, D.26354, D.26395, 0, 0B, 6);
  goto <D.20537>;
  <D.20555>:
  <D.20556>:
  <D.20557>:
  D.26354 = sig->ret;
  D.26395 = *mspecs;
  emit_marshal (m, 0, D.26354, D.26395, 0, 0B, 6);
  goto <D.20537>;
  <D.20558>:
  D.26354 = sig->ret;
  D.26403 = D.26354->type;
  D.26404 = (int) D.26403;
  monoeg_g_log (0B, 16, "return type 0x%02x unknown", D.26404);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9339);
  <D.20537>:
  goto <D.26405>;
  <D.26402>:
  mono_mb_emit_stloc (mb, 3);
  <D.26405>:
  <D.26394>:
  i = 0;
  goto <D.20573>;
  <D.20572>:
  {
    struct MonoType * t;
    struct MonoMarshalSpec * spec;

    t = sig->params[i];
    i.323 = (sizetype) i;
    D.26367 = i.323 + 1;
    D.26368 = D.26367 * 4;
    D.26369 = mspecs + D.26368;
    spec = *D.26369;
    if (spec != 0B) goto <D.26408>; else goto <D.26406>;
    <D.26408>:
    D.26409 = spec->native;
    if (D.26409 == 44) goto <D.26410>; else goto <D.26406>;
    <D.26410>:
    i.323 = (sizetype) i;
    D.26367 = i.323 + 1;
    D.26368 = D.26367 * 4;
    D.26369 = mspecs + D.26368;
    D.26370 = *D.26369;
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    emit_marshal (m, i, t, D.26370, D.26382, 0B, 5);
    goto <D.26407>;
    <D.26406>:
    D.26411 = BIT_FIELD_REF <*t, 32, 32>;
    D.26412 = D.26411 & 1073741824;
    if (D.26412 != 0) goto <D.26413>; else goto <D.26414>;
    <D.26413>:
    D.26415 = t->type;
    D.26416 = (int) D.26415;
    switch (D.26416) <default: <D.26417>, case 2: <D.20565>, case 14: <D.20564>, case 17: <D.20562>, case 18: <D.20561>, case 28: <D.20563>>
    <D.20561>:
    <D.20562>:
    <D.20563>:
    <D.20564>:
    <D.20565>:
    i.323 = (sizetype) i;
    D.26367 = i.323 + 1;
    D.26368 = D.26367 * 4;
    D.26369 = mspecs + D.26368;
    D.26370 = *D.26369;
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    emit_marshal (m, i, t, D.26370, D.26382, 0B, 5);
    goto <D.20566>;
    <D.26417>:
    <D.20566>:
    goto <D.26418>;
    <D.26414>:
    D.26419 = invoke_sig->params[i];
    D.26420 = D.26419->attrs;
    D.26421 = (int) D.26420;
    D.26422 = D.26421 & 2;
    if (D.26422 != 0) goto <D.26423>; else goto <D.26424>;
    <D.26423>:
    D.26415 = t->type;
    D.26416 = (int) D.26415;
    switch (D.26416) <default: <D.20571>, case 17: <D.20569>, case 18: <D.20568>, case 29: <D.20567>>
    <D.20567>:
    <D.20568>:
    <D.20569>:
    D.26419 = invoke_sig->params[i];
    i.323 = (sizetype) i;
    D.26367 = i.323 + 1;
    D.26368 = D.26367 * 4;
    D.26369 = mspecs + D.26368;
    D.26370 = *D.26369;
    i.322 = (unsigned int) i;
    D.26363 = i.322 * 4;
    D.26364 = tmp_locals + D.26363;
    D.26382 = *D.26364;
    emit_marshal (m, i, D.26419, D.26370, D.26382, 0B, 5);
    goto <D.20570>;
    <D.20571>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9373);
    <D.20570>:
    <D.26424>:
    <D.26418>:
    <D.26407>:
  }
  i = i + 1;
  <D.20573>:
  D.26335 = sig->param_count;
  D.26339 = (int) D.26335;
  if (D.26339 > i) goto <D.20572>; else goto <D.20574>;
  <D.20574>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 18);
  D.26425 = m->retobj_var;
  if (D.26425 != 0) goto <D.26426>; else goto <D.26427>;
  <D.26426>:
  D.26425 = m->retobj_var;
  D.26428 = (unsigned int) D.26425;
  mono_mb_emit_ldloc (mb, D.26428);
  mono_mb_emit_byte (mb, 240);
  D.26429 = m->retobj_class;
  mono_mb_emit_op (mb, 5, D.26429);
  goto <D.26430>;
  <D.26427>:
  D.26354 = sig->ret;
  D.26431 = mono_type_is_void (D.26354);
  if (D.26431 == 0) goto <D.26432>; else goto <D.26433>;
  <D.26432>:
  mono_mb_emit_ldloc (mb, 3);
  <D.26433>:
  mono_mb_emit_byte (mb, 42);
  <D.26430>:
  if (closed != 0) goto <D.26434>; else goto <D.26435>;
  <D.26434>:
  monoeg_g_free (sig);
  <D.26435>:
}


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

  D.26440 = __builtin_object_size (__dest, 0);
  D.26439 = __builtin___memmove_chk (__dest, __src, __len, D.26440);
  return D.26439;
}


mono_marshal_get_managed_wrapper (struct MonoMethod * method, struct MonoClass * delegate_klass, uint32_t target_handle)
{
  _Bool D.26442;
  long int D.26443;
  long int D.26444;
  struct MonoMethodSignature * D.26447;
  unsigned int D.26448;
  unsigned int D.26449;
  _Bool D.26450;
  long int D.26451;
  long int D.26452;
  struct MonoClass * D.26455;
  struct MonoImage * D.26456;
  struct GHashTable * * D.26457;
  struct MonoMethod * D.26462;
  struct MonoMethodSignature * D.26463;
  short unsigned int D.26464;
  int D.26465;
  int D.26466;
  unsigned int D.26467;
  unsigned int D.26468;
  const char * D.26469;
  void * target_handle.326;
  struct MonoClass * UnmanagedFunctionPointerAttribute.327;
  struct MonoImage * D.26477;
  struct MonoClass * UnmanagedFunctionPointerAttribute.328;
  struct MonoMethod * D.26483;
  int D.26484;
  int D.26487;
  struct MonoMethod * D.26490;
  const mono_byte * D.26491;
  unsigned int D.26492;
  int D.26493;
  _Bool D.26494;
  long int D.26495;
  long int D.26496;
  struct MonoArray * typed_args.329;
  unsigned int D.26500;
  _Bool D.26501;
  long int D.26502;
  long int D.26503;
  char * D.26506;
  void * D.26507;
  struct CattrNamedArg * arginfo.330;
  unsigned int i.331;
  unsigned int D.26510;
  struct MonoArray * named_args.332;
  unsigned int i.333;
  char * D.26513;
  struct MonoClassField * D.26514;
  _Bool D.26515;
  long int D.26516;
  long int D.26517;
  int D.20672;
  int iftmp.334;
  int D.20671;
  const char[8] * D.26523;
  unsigned char D.26524;
  int D.26525;
  unsigned char D.26526;
  int D.26527;
  const unsigned char * D.26532;
  unsigned char D.26533;
  int D.26534;
  const unsigned char * D.26535;
  unsigned char D.26536;
  int D.26537;
  const unsigned char * D.26542;
  unsigned char D.26543;
  int D.26544;
  const unsigned char * D.26545;
  unsigned char D.26546;
  int D.26547;
  const unsigned char * D.26552;
  unsigned char D.26553;
  int D.26554;
  const unsigned char * D.26555;
  unsigned char D.26556;
  int D.26557;
  const char * D.26559;
  void * D.26562;
  int D.20681;
  int iftmp.335;
  int D.20680;
  const char[13] * D.26567;
  unsigned char D.26568;
  int D.26569;
  unsigned char D.26570;
  int D.26571;
  const unsigned char * D.26576;
  unsigned char D.26577;
  int D.26578;
  const unsigned char * D.26579;
  unsigned char D.26580;
  int D.26581;
  const unsigned char * D.26586;
  unsigned char D.26587;
  int D.26588;
  const unsigned char * D.26589;
  unsigned char D.26590;
  int D.26591;
  const unsigned char * D.26596;
  unsigned char D.26597;
  int D.26598;
  const unsigned char * D.26599;
  unsigned char D.26600;
  int D.26601;
  void * D.26605;
  int D.20690;
  int iftmp.336;
  int D.20689;
  const char[15] * D.26610;
  unsigned char D.26611;
  int D.26612;
  unsigned char D.26613;
  int D.26614;
  const unsigned char * D.26619;
  unsigned char D.26620;
  int D.26621;
  const unsigned char * D.26622;
  unsigned char D.26623;
  int D.26624;
  const unsigned char * D.26629;
  unsigned char D.26630;
  int D.26631;
  const unsigned char * D.26632;
  unsigned char D.26633;
  int D.26634;
  const unsigned char * D.26639;
  unsigned char D.26640;
  int D.26641;
  const unsigned char * D.26642;
  unsigned char D.26643;
  int D.26644;
  void * D.26648;
  int D.20699;
  int iftmp.337;
  int D.20698;
  const char[22] * D.26653;
  unsigned char D.26654;
  int D.26655;
  unsigned char D.26656;
  int D.26657;
  const unsigned char * D.26662;
  unsigned char D.26663;
  int D.26664;
  const unsigned char * D.26665;
  unsigned char D.26666;
  int D.26667;
  const unsigned char * D.26672;
  unsigned char D.26673;
  int D.26674;
  const unsigned char * D.26675;
  unsigned char D.26676;
  int D.26677;
  const unsigned char * D.26682;
  unsigned char D.26683;
  int D.26684;
  const unsigned char * D.26685;
  unsigned char D.26686;
  int D.26687;
  void * D.26691;
  unsigned int D.26693;
  int D.26694;
  signed short D.26695;
  signed short iftmp.338;
  int D.26699;
  unsigned short D.26700;
  unsigned short D.26701;
  signed short D.26703;
  signed short D.26704;
  signed short D.26705;
  short unsigned int D.26706;
  unsigned char D.26707;
  unsigned char D.26708;
  <unnamed-unsigned:6> D.26709;
  int D.26712;
  short unsigned int D.26717;
  int D.26718;
  int D.26719;
  struct MonoMethodSignature * D.26721;
  short unsigned int D.26722;
  unsigned int D.26723;
  struct MonoMarshalSpec * * D.26724;
  struct MonoMarshalSpec * D.26725;
  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.26442 = method == 0B;
      D.26443 = (long int) D.26442;
      D.26444 = __builtin_expect (D.26443, 0);
      if (D.26444 != 0) goto <D.26445>; else goto <D.26446>;
      <D.26445>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9450, "method != NULL");
      <D.26446>:
      D.26447 = mono_method_signature (method);
      D.26448 = BIT_FIELD_REF <*D.26447, 32, 64>;
      D.26449 = D.26448 & 16777216;
      D.26450 = D.26449 != 0;
      D.26451 = (long int) D.26450;
      D.26452 = __builtin_expect (D.26451, 0);
      if (D.26452 != 0) goto <D.26453>; else goto <D.26454>;
      <D.26453>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9451, "!mono_method_signature (method)->pinvoke");
      <D.26454>:
      D.26455 = method->klass;
      D.26456 = D.26455->image;
      D.26457 = &D.26456->managed_wrapper_cache;
      cache = get_cache (D.26457, mono_aligned_addr_hash, 0B);
      if (target_handle == 0) goto <D.26458>; else goto <D.26459>;
      <D.26458>:
      res = mono_marshal_find_in_cache (cache, method);
      if (res != 0B) goto <D.26460>; else goto <D.26461>;
      <D.26460>:
      D.26462 = res;
      return D.26462;
      <D.26461>:
      <D.26459>:
      invoke = mono_get_delegate_invoke (delegate_klass);
      invoke_sig = mono_method_signature (invoke);
      D.26463 = mono_method_signature (invoke);
      D.26464 = D.26463->param_count;
      D.26465 = (int) D.26464;
      D.26466 = D.26465 + 1;
      D.26467 = (unsigned int) D.26466;
      D.26468 = D.26467 * 4;
      mspecs = monoeg_malloc0 (D.26468);
      mono_method_get_marshal_info (invoke, mspecs);
      sig = mono_method_signature (method);
      D.26455 = method->klass;
      D.26469 = method->name;
      mb = mono_mb_new (D.26455, D.26469, 5);
      target_handle.326 = (void *) target_handle;
      mono_mb_add_data (mb, target_handle.326);
      if (target_handle != 0) goto <D.26471>; else goto <D.26472>;
      <D.26471>:
      csig = mono_metadata_signature_dup (invoke_sig);
      goto <D.26473>;
      <D.26472>:
      D.26455 = method->klass;
      D.26456 = D.26455->image;
      csig = signature_dup (D.26456, invoke_sig);
      <D.26473>:
      csig->hasthis = 0;
      csig->pinvoke = 1;
      m.mb = mb;
      m.sig = sig;
      m.piinfo = 0B;
      m.retobj_var = 0;
      m.csig = csig;
      D.26455 = method->klass;
      D.26456 = D.26455->image;
      m.image = D.26456;
      mono_marshal_set_callconv_from_modopt (invoke, csig);
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 == 0B) goto <D.26475>; else goto <D.26476>;
      <D.26475>:
      D.26477 = mono_defaults.corlib;
      UnmanagedFunctionPointerAttribute.328 = mono_class_from_name (D.26477, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
      UnmanagedFunctionPointerAttribute = UnmanagedFunctionPointerAttribute.328;
      <D.26476>:
      UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
      if (UnmanagedFunctionPointerAttribute.327 != 0B) goto <D.26479>; else goto <D.26480>;
      <D.26479>:
      {
        struct MonoCustomAttrInfo * cinfo;
        struct MonoCustomAttrEntry * attr;

        cinfo = mono_custom_attrs_from_class (delegate_klass);
        attr = 0B;
        if (cinfo != 0B) goto <D.26481>; else goto <D.26482>;
        <D.26481>:
        i = 0;
        goto <D.20652>;
        <D.20651>:
        {
          struct MonoClass * ctor_class;

          D.26483 = cinfo->attrs[i].ctor;
          ctor_class = D.26483->klass;
          UnmanagedFunctionPointerAttribute.327 = UnmanagedFunctionPointerAttribute;
          D.26484 = mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute.327);
          if (D.26484 != 0) goto <D.26485>; else goto <D.26486>;
          <D.26485>:
          attr = &cinfo->attrs[i];
          goto <D.20650>;
          <D.26486>:
        }
        i = i + 1;
        <D.20652>:
        D.26487 = cinfo->num_attrs;
        if (D.26487 > i) goto <D.20651>; else goto <D.20650>;
        <D.20650>:
        <D.26482>:
        if (attr != 0B) goto <D.26488>; else goto <D.26489>;
        <D.26488>:
        {
          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.26477 = mono_defaults.corlib;
              D.26490 = attr->ctor;
              D.26491 = attr->data;
              D.26492 = attr->data_size;
              mono_reflection_create_custom_attr_data_args (D.26477, D.26490, D.26491, D.26492, &typed_args, &named_args, &arginfo, &error);
              D.26493 = mono_error_ok (&error);
              D.26494 = D.26493 == 0;
              D.26495 = (long int) D.26494;
              D.26496 = __builtin_expect (D.26495, 0);
              if (D.26496 != 0) goto <D.26497>; else goto <D.26498>;
              <D.26497>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9530, "mono_error_ok (&error)");
              <D.26498>:
              typed_args.329 = typed_args;
              D.26500 = mono_array_length (typed_args.329);
              D.26501 = D.26500 != 1;
              D.26502 = (long int) D.26501;
              D.26503 = __builtin_expect (D.26502, 0);
              if (D.26503 != 0) goto <D.26504>; else goto <D.26505>;
              <D.26504>:
              monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9531, "mono_array_length (typed_args) == 1");
              <D.26505>:
              typed_args.329 = typed_args;
              D.26506 = mono_array_addr_with_size (typed_args.329, 4, 0);
              o = MEM[(struct MonoObject * *)D.26506];
              D.26507 = mono_object_unbox (o);
              call_conv = MEM[(gint32 *)D.26507];
              i = 0;
              goto <D.20701>;
              <D.20700>:
              {
                struct CattrNamedArg * narg;

                arginfo.330 = arginfo;
                i.331 = (unsigned int) i;
                D.26510 = i.331 * 12;
                narg = arginfo.330 + D.26510;
                named_args.332 = named_args;
                i.333 = (unsigned int) i;
                D.26513 = mono_array_addr_with_size (named_args.332, 4, i.333);
                o = MEM[(struct MonoObject * *)D.26513];
                D.26514 = narg->field;
                D.26515 = D.26514 == 0B;
                D.26516 = (long int) D.26515;
                D.26517 = __builtin_expect (D.26516, 0);
                if (D.26517 != 0) goto <D.26518>; else goto <D.26519>;
                <D.26518>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9543, "narg->field");
                <D.26519>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26514 = narg->field;
                    __s2 = D.26514->name;
                    D.26523 = "CharSet";
                    D.26524 = MEM[(const unsigned char *)D.26523];
                    D.26525 = (int) D.26524;
                    D.26526 = *__s2;
                    D.26527 = (int) D.26526;
                    __result = D.26525 - D.26527;
                    {
                      if (__s2_len != 0) goto <D.26528>; else goto <D.26529>;
                      <D.26528>:
                      if (__result == 0) goto <D.26530>; else goto <D.26531>;
                      <D.26530>:
                      D.26532 = &MEM[(void *)"CharSet" + 1B];
                      D.26533 = *D.26532;
                      D.26534 = (int) D.26533;
                      D.26535 = __s2 + 1;
                      D.26536 = *D.26535;
                      D.26537 = (int) D.26536;
                      __result = D.26534 - D.26537;
                      if (__s2_len > 1) goto <D.26538>; else goto <D.26539>;
                      <D.26538>:
                      if (__result == 0) goto <D.26540>; else goto <D.26541>;
                      <D.26540>:
                      D.26542 = &MEM[(void *)"CharSet" + 2B];
                      D.26543 = *D.26542;
                      D.26544 = (int) D.26543;
                      D.26545 = __s2 + 2;
                      D.26546 = *D.26545;
                      D.26547 = (int) D.26546;
                      __result = D.26544 - D.26547;
                      if (__s2_len > 2) goto <D.26548>; else goto <D.26549>;
                      <D.26548>:
                      if (__result == 0) goto <D.26550>; else goto <D.26551>;
                      <D.26550>:
                      D.26552 = &MEM[(void *)"CharSet" + 3B];
                      D.26553 = *D.26552;
                      D.26554 = (int) D.26553;
                      D.26555 = __s2 + 3;
                      D.26556 = *D.26555;
                      D.26557 = (int) D.26556;
                      __result = D.26554 - D.26557;
                      <D.26551>:
                      <D.26549>:
                      <D.26541>:
                      <D.26539>:
                      <D.26531>:
                      <D.26529>:
                    }
                    D.20671 = __result;
                  }
                  iftmp.334 = -D.20671;
                  goto <D.26558>;
                  <D.26522>:
                  D.26514 = narg->field;
                  D.26559 = D.26514->name;
                  iftmp.334 = __builtin_strcmp (D.26559, "CharSet");
                  <D.26558>:
                  D.20672 = iftmp.334;
                }
                if (D.20672 == 0) goto <D.26560>; else goto <D.26561>;
                <D.26560>:
                D.26562 = mono_object_unbox (o);
                charset = MEM[(gint32 *)D.26562];
                goto <D.26563>;
                <D.26561>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26514 = narg->field;
                    __s2 = D.26514->name;
                    D.26567 = "SetLastError";
                    D.26568 = MEM[(const unsigned char *)D.26567];
                    D.26569 = (int) D.26568;
                    D.26570 = *__s2;
                    D.26571 = (int) D.26570;
                    __result = D.26569 - D.26571;
                    {
                      if (__s2_len != 0) goto <D.26572>; else goto <D.26573>;
                      <D.26572>:
                      if (__result == 0) goto <D.26574>; else goto <D.26575>;
                      <D.26574>:
                      D.26576 = &MEM[(void *)"SetLastError" + 1B];
                      D.26577 = *D.26576;
                      D.26578 = (int) D.26577;
                      D.26579 = __s2 + 1;
                      D.26580 = *D.26579;
                      D.26581 = (int) D.26580;
                      __result = D.26578 - D.26581;
                      if (__s2_len > 1) goto <D.26582>; else goto <D.26583>;
                      <D.26582>:
                      if (__result == 0) goto <D.26584>; else goto <D.26585>;
                      <D.26584>:
                      D.26586 = &MEM[(void *)"SetLastError" + 2B];
                      D.26587 = *D.26586;
                      D.26588 = (int) D.26587;
                      D.26589 = __s2 + 2;
                      D.26590 = *D.26589;
                      D.26591 = (int) D.26590;
                      __result = D.26588 - D.26591;
                      if (__s2_len > 2) goto <D.26592>; else goto <D.26593>;
                      <D.26592>:
                      if (__result == 0) goto <D.26594>; else goto <D.26595>;
                      <D.26594>:
                      D.26596 = &MEM[(void *)"SetLastError" + 3B];
                      D.26597 = *D.26596;
                      D.26598 = (int) D.26597;
                      D.26599 = __s2 + 3;
                      D.26600 = *D.26599;
                      D.26601 = (int) D.26600;
                      __result = D.26598 - D.26601;
                      <D.26595>:
                      <D.26593>:
                      <D.26585>:
                      <D.26583>:
                      <D.26575>:
                      <D.26573>:
                    }
                    D.20680 = __result;
                  }
                  iftmp.335 = -D.20680;
                  goto <D.26602>;
                  <D.26566>:
                  D.26514 = narg->field;
                  D.26559 = D.26514->name;
                  iftmp.335 = __builtin_strcmp (D.26559, "SetLastError");
                  <D.26602>:
                  D.20681 = iftmp.335;
                }
                if (D.20681 == 0) goto <D.26603>; else goto <D.26604>;
                <D.26603>:
                D.26605 = mono_object_unbox (o);
                set_last_error = MEM[(MonoBoolean *)D.26605];
                goto <D.26606>;
                <D.26604>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26514 = narg->field;
                    __s2 = D.26514->name;
                    D.26610 = "BestFitMapping";
                    D.26611 = MEM[(const unsigned char *)D.26610];
                    D.26612 = (int) D.26611;
                    D.26613 = *__s2;
                    D.26614 = (int) D.26613;
                    __result = D.26612 - D.26614;
                    {
                      if (__s2_len != 0) goto <D.26615>; else goto <D.26616>;
                      <D.26615>:
                      if (__result == 0) goto <D.26617>; else goto <D.26618>;
                      <D.26617>:
                      D.26619 = &MEM[(void *)"BestFitMapping" + 1B];
                      D.26620 = *D.26619;
                      D.26621 = (int) D.26620;
                      D.26622 = __s2 + 1;
                      D.26623 = *D.26622;
                      D.26624 = (int) D.26623;
                      __result = D.26621 - D.26624;
                      if (__s2_len > 1) goto <D.26625>; else goto <D.26626>;
                      <D.26625>:
                      if (__result == 0) goto <D.26627>; else goto <D.26628>;
                      <D.26627>:
                      D.26629 = &MEM[(void *)"BestFitMapping" + 2B];
                      D.26630 = *D.26629;
                      D.26631 = (int) D.26630;
                      D.26632 = __s2 + 2;
                      D.26633 = *D.26632;
                      D.26634 = (int) D.26633;
                      __result = D.26631 - D.26634;
                      if (__s2_len > 2) goto <D.26635>; else goto <D.26636>;
                      <D.26635>:
                      if (__result == 0) goto <D.26637>; else goto <D.26638>;
                      <D.26637>:
                      D.26639 = &MEM[(void *)"BestFitMapping" + 3B];
                      D.26640 = *D.26639;
                      D.26641 = (int) D.26640;
                      D.26642 = __s2 + 3;
                      D.26643 = *D.26642;
                      D.26644 = (int) D.26643;
                      __result = D.26641 - D.26644;
                      <D.26638>:
                      <D.26636>:
                      <D.26628>:
                      <D.26626>:
                      <D.26618>:
                      <D.26616>:
                    }
                    D.20689 = __result;
                  }
                  iftmp.336 = -D.20689;
                  goto <D.26645>;
                  <D.26609>:
                  D.26514 = narg->field;
                  D.26559 = D.26514->name;
                  iftmp.336 = __builtin_strcmp (D.26559, "BestFitMapping");
                  <D.26645>:
                  D.20690 = iftmp.336;
                }
                if (D.20690 == 0) goto <D.26646>; else goto <D.26647>;
                <D.26646>:
                D.26648 = mono_object_unbox (o);
                best_fit_mapping = MEM[(MonoBoolean *)D.26648];
                goto <D.26649>;
                <D.26647>:
                {
                  size_t __s1_len;
                  size_t __s2_len;

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

                    D.26514 = narg->field;
                    __s2 = D.26514->name;
                    D.26653 = "ThrowOnUnmappableChar";
                    D.26654 = MEM[(const unsigned char *)D.26653];
                    D.26655 = (int) D.26654;
                    D.26656 = *__s2;
                    D.26657 = (int) D.26656;
                    __result = D.26655 - D.26657;
                    {
                      if (__s2_len != 0) goto <D.26658>; else goto <D.26659>;
                      <D.26658>:
                      if (__result == 0) goto <D.26660>; else goto <D.26661>;
                      <D.26660>:
                      D.26662 = &MEM[(void *)"ThrowOnUnmappableChar" + 1B];
                      D.26663 = *D.26662;
                      D.26664 = (int) D.26663;
                      D.26665 = __s2 + 1;
                      D.26666 = *D.26665;
                      D.26667 = (int) D.26666;
                      __result = D.26664 - D.26667;
                      if (__s2_len > 1) goto <D.26668>; else goto <D.26669>;
                      <D.26668>:
                      if (__result == 0) goto <D.26670>; else goto <D.26671>;
                      <D.26670>:
                      D.26672 = &MEM[(void *)"ThrowOnUnmappableChar" + 2B];
                      D.26673 = *D.26672;
                      D.26674 = (int) D.26673;
                      D.26675 = __s2 + 2;
                      D.26676 = *D.26675;
                      D.26677 = (int) D.26676;
                      __result = D.26674 - D.26677;
                      if (__s2_len > 2) goto <D.26678>; else goto <D.26679>;
                      <D.26678>:
                      if (__result == 0) goto <D.26680>; else goto <D.26681>;
                      <D.26680>:
                      D.26682 = &MEM[(void *)"ThrowOnUnmappableChar" + 3B];
                      D.26683 = *D.26682;
                      D.26684 = (int) D.26683;
                      D.26685 = __s2 + 3;
                      D.26686 = *D.26685;
                      D.26687 = (int) D.26686;
                      __result = D.26684 - D.26687;
                      <D.26681>:
                      <D.26679>:
                      <D.26671>:
                      <D.26669>:
                      <D.26661>:
                      <D.26659>:
                    }
                    D.20698 = __result;
                  }
                  iftmp.337 = -D.20698;
                  goto <D.26688>;
                  <D.26652>:
                  D.26514 = narg->field;
                  D.26559 = D.26514->name;
                  iftmp.337 = __builtin_strcmp (D.26559, "ThrowOnUnmappableChar");
                  <D.26688>:
                  D.20699 = iftmp.337;
                }
                if (D.20699 == 0) goto <D.26689>; else goto <D.26690>;
                <D.26689>:
                D.26691 = mono_object_unbox (o);
                throw_on_unmappable = MEM[(MonoBoolean *)D.26691];
                goto <D.26692>;
                <D.26690>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 9553);
                <D.26692>:
                <D.26649>:
                <D.26606>:
                <D.26563>:
              }
              i = i + 1;
              <D.20701>:
              i.333 = (unsigned int) i;
              named_args.332 = named_args;
              D.26693 = mono_array_length (named_args.332);
              if (i.333 < D.26693) goto <D.20700>; else goto <D.20702>;
              <D.20702>:
              arginfo.330 = arginfo;
              monoeg_g_free (arginfo.330);
              memset (&piinfo, 0, 32);
              m.piinfo = &piinfo;
              D.26694 = call_conv << 8;
              D.26695 = (signed short) D.26694;
              if (charset != 0) goto <D.26697>; else goto <D.26698>;
              <D.26697>:
              D.26699 = charset + -1;
              D.26700 = (unsigned short) D.26699;
              D.26701 = D.26700 * 2;
              iftmp.338 = (signed short) D.26701;
              goto <D.26702>;
              <D.26698>:
              iftmp.338 = 1;
              <D.26702>:
              D.26703 = D.26695 | iftmp.338;
              D.26704 = (signed short) set_last_error;
              D.26705 = D.26703 | D.26704;
              D.26706 = (short unsigned int) D.26705;
              piinfo.piflags = D.26706;
              D.26707 = (unsigned char) call_conv;
              D.26708 = D.26707 + 255;
              D.26709 = (<unnamed-unsigned:6>) D.26708;
              csig->call_convention = D.26709;
            }
          finally
            {
              typed_args = {CLOBBER};
              named_args = {CLOBBER};
              arginfo = {CLOBBER};
              error = {CLOBBER};
            }
        }
        <D.26489>:
        if (cinfo != 0B) goto <D.26710>; else goto <D.26711>;
        <D.26710>:
        D.26712 = cinfo->cached;
        if (D.26712 == 0) goto <D.26713>; else goto <D.26714>;
        <D.26713>:
        mono_custom_attrs_free (cinfo);
        <D.26714>:
        <D.26711>:
      }
      <D.26480>:
      mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
      if (target_handle == 0) goto <D.26715>; else goto <D.26716>;
      <D.26715>:
      {
        struct WrapperInfo * info;

        D.26717 = sig->param_count;
        D.26718 = (int) D.26717;
        D.26719 = D.26718 + 16;
        res = mono_mb_create_and_cache (cache, method, mb, csig, D.26719);
        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.26720>;
      <D.26716>:
      mb->dynamic = 1;
      D.26717 = sig->param_count;
      D.26718 = (int) D.26717;
      D.26719 = D.26718 + 16;
      res = mono_mb_create_method (mb, csig, D.26719);
      <D.26720>:
      mono_mb_free (mb);
      D.26721 = mono_method_signature (invoke);
      D.26722 = D.26721->param_count;
      i = (int) D.26722;
      goto <D.20705>;
      <D.20704>:
      i.331 = (unsigned int) i;
      D.26723 = i.331 * 4;
      D.26724 = mspecs + D.26723;
      D.26725 = *D.26724;
      if (D.26725 != 0B) goto <D.26726>; else goto <D.26727>;
      <D.26726>:
      i.331 = (unsigned int) i;
      D.26723 = i.331 * 4;
      D.26724 = mspecs + D.26723;
      D.26725 = *D.26724;
      mono_metadata_free_marshal_spec (D.26725);
      <D.26727>:
      i = i + -1;
      <D.20705>:
      if (i >= 0) goto <D.20704>; else goto <D.20706>;
      <D.20706>:
      monoeg_g_free (mspecs);
      D.26462 = res;
      return D.26462;
    }
  finally
    {
      piinfo = {CLOBBER};
      m = {CLOBBER};
    }
}


mono_marshal_set_callconv_from_modopt (struct MonoMethod * method, struct MonoMethodSignature * csig)
{
  struct MonoType * D.26730;
  unsigned int D.26733;
  unsigned int D.26734;
  struct MonoClass * D.26737;
  struct MonoImage * D.26738;
  <unnamed-unsigned:31> D.26739;
  unsigned int D.26740;
  _Bool D.26741;
  long int D.26742;
  long int D.26743;
  struct MonoImage * D.26746;
  struct MonoImage * D.26747;
  int D.20590;
  int iftmp.339;
  int D.20589;
  const char[32] * D.26753;
  unsigned char D.26754;
  int D.26755;
  unsigned char D.26756;
  int D.26757;
  const unsigned char * D.26762;
  unsigned char D.26763;
  int D.26764;
  const unsigned char * D.26765;
  unsigned char D.26766;
  int D.26767;
  const unsigned char * D.26772;
  unsigned char D.26773;
  int D.26774;
  const unsigned char * D.26775;
  unsigned char D.26776;
  int D.26777;
  const unsigned char * D.26782;
  unsigned char D.26783;
  int D.26784;
  const unsigned char * D.26785;
  unsigned char D.26786;
  int D.26787;
  const char * D.26789;
  int D.20599;
  int iftmp.340;
  int D.20598;
  const char[14] * D.26795;
  unsigned char D.26796;
  int D.26797;
  unsigned char D.26798;
  int D.26799;
  const unsigned char * D.26804;
  unsigned char D.26805;
  int D.26806;
  const unsigned char * D.26807;
  unsigned char D.26808;
  int D.26809;
  const unsigned char * D.26814;
  unsigned char D.26815;
  int D.26816;
  const unsigned char * D.26817;
  unsigned char D.26818;
  int D.26819;
  const unsigned char * D.26824;
  unsigned char D.26825;
  int D.26826;
  const unsigned char * D.26827;
  unsigned char D.26828;
  int D.26829;
  const char * D.26831;
  int D.20608;
  int iftmp.341;
  int D.20607;
  const char[16] * D.26838;
  unsigned char D.26839;
  int D.26840;
  unsigned char D.26841;
  int D.26842;
  const unsigned char * D.26847;
  unsigned char D.26848;
  int D.26849;
  const unsigned char * D.26850;
  unsigned char D.26851;
  int D.26852;
  const unsigned char * D.26857;
  unsigned char D.26858;
  int D.26859;
  const unsigned char * D.26860;
  unsigned char D.26861;
  int D.26862;
  const unsigned char * D.26867;
  unsigned char D.26868;
  int D.26869;
  const unsigned char * D.26870;
  unsigned char D.26871;
  int D.26872;
  int D.20617;
  int iftmp.342;
  int D.20616;
  const char[17] * D.26880;
  unsigned char D.26881;
  int D.26882;
  unsigned char D.26883;
  int D.26884;
  const unsigned char * D.26889;
  unsigned char D.26890;
  int D.26891;
  const unsigned char * D.26892;
  unsigned char D.26893;
  int D.26894;
  const unsigned char * D.26899;
  unsigned char D.26900;
  int D.26901;
  const unsigned char * D.26902;
  unsigned char D.26903;
  int D.26904;
  const unsigned char * D.26909;
  unsigned char D.26910;
  int D.26911;
  const unsigned char * D.26912;
  unsigned char D.26913;
  int D.26914;
  int D.20626;
  int iftmp.343;
  int D.20625;
  const char[17] * D.26922;
  unsigned char D.26923;
  int D.26924;
  unsigned char D.26925;
  int D.26926;
  const unsigned char * D.26931;
  unsigned char D.26932;
  int D.26933;
  const unsigned char * D.26934;
  unsigned char D.26935;
  int D.26936;
  const unsigned char * D.26941;
  unsigned char D.26942;
  int D.26943;
  const unsigned char * D.26944;
  unsigned char D.26945;
  int D.26946;
  const unsigned char * D.26951;
  unsigned char D.26952;
  int D.26953;
  const unsigned char * D.26954;
  unsigned char D.26955;
  int D.26956;
  <unnamed-unsigned:6> D.26960;
  int D.26961;
  struct MonoMethodSignature * sig;
  int i;

  sig = mono_method_signature (method);
  D.26730 = sig->ret;
  if (D.26730 != 0B) goto <D.26731>; else goto <D.26732>;
  <D.26731>:
  D.26730 = sig->ret;
  D.26733 = BIT_FIELD_REF <*D.26730, 32, 32>;
  D.26734 = D.26733 & 1056964608;
  if (D.26734 != 0) goto <D.26735>; else goto <D.26736>;
  <D.26735>:
  i = 0;
  goto <D.20628>;
  <D.20627>:
  {
    struct MonoClass * cmod_class;

    D.26737 = method->klass;
    D.26738 = D.26737->image;
    D.26730 = sig->ret;
    D.26739 = D.26730->modifiers[i].token;
    D.26740 = (unsigned int) D.26739;
    cmod_class = mono_class_get (D.26738, D.26740);
    D.26741 = cmod_class == 0B;
    D.26742 = (long int) D.26741;
    D.26743 = __builtin_expect (D.26742, 0);
    if (D.26743 != 0) goto <D.26744>; else goto <D.26745>;
    <D.26744>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9418, "cmod_class");
    <D.26745>:
    D.26746 = cmod_class->image;
    D.26747 = mono_defaults.corlib;
    if (D.26746 == D.26747) goto <D.26748>; else goto <D.26749>;
    <D.26748>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name_space;
        D.26753 = "System.Runtime.CompilerServices";
        D.26754 = MEM[(const unsigned char *)D.26753];
        D.26755 = (int) D.26754;
        D.26756 = *__s2;
        D.26757 = (int) D.26756;
        __result = D.26755 - D.26757;
        {
          if (__s2_len != 0) goto <D.26758>; else goto <D.26759>;
          <D.26758>:
          if (__result == 0) goto <D.26760>; else goto <D.26761>;
          <D.26760>:
          D.26762 = &MEM[(void *)"System.Runtime.CompilerServices" + 1B];
          D.26763 = *D.26762;
          D.26764 = (int) D.26763;
          D.26765 = __s2 + 1;
          D.26766 = *D.26765;
          D.26767 = (int) D.26766;
          __result = D.26764 - D.26767;
          if (__s2_len > 1) goto <D.26768>; else goto <D.26769>;
          <D.26768>:
          if (__result == 0) goto <D.26770>; else goto <D.26771>;
          <D.26770>:
          D.26772 = &MEM[(void *)"System.Runtime.CompilerServices" + 2B];
          D.26773 = *D.26772;
          D.26774 = (int) D.26773;
          D.26775 = __s2 + 2;
          D.26776 = *D.26775;
          D.26777 = (int) D.26776;
          __result = D.26774 - D.26777;
          if (__s2_len > 2) goto <D.26778>; else goto <D.26779>;
          <D.26778>:
          if (__result == 0) goto <D.26780>; else goto <D.26781>;
          <D.26780>:
          D.26782 = &MEM[(void *)"System.Runtime.CompilerServices" + 3B];
          D.26783 = *D.26782;
          D.26784 = (int) D.26783;
          D.26785 = __s2 + 3;
          D.26786 = *D.26785;
          D.26787 = (int) D.26786;
          __result = D.26784 - D.26787;
          <D.26781>:
          <D.26779>:
          <D.26771>:
          <D.26769>:
          <D.26761>:
          <D.26759>:
        }
        D.20589 = __result;
      }
      iftmp.339 = -D.20589;
      goto <D.26788>;
      <D.26752>:
      D.26789 = cmod_class->name_space;
      iftmp.339 = __builtin_strcmp (D.26789, "System.Runtime.CompilerServices");
      <D.26788>:
      D.20590 = iftmp.339;
    }
    if (D.20590 == 0) goto <D.26790>; else goto <D.26791>;
    <D.26790>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26795 = "CallConvCdecl";
        D.26796 = MEM[(const unsigned char *)D.26795];
        D.26797 = (int) D.26796;
        D.26798 = *__s2;
        D.26799 = (int) D.26798;
        __result = D.26797 - D.26799;
        {
          if (__s2_len != 0) goto <D.26800>; else goto <D.26801>;
          <D.26800>:
          if (__result == 0) goto <D.26802>; else goto <D.26803>;
          <D.26802>:
          D.26804 = &MEM[(void *)"CallConvCdecl" + 1B];
          D.26805 = *D.26804;
          D.26806 = (int) D.26805;
          D.26807 = __s2 + 1;
          D.26808 = *D.26807;
          D.26809 = (int) D.26808;
          __result = D.26806 - D.26809;
          if (__s2_len > 1) goto <D.26810>; else goto <D.26811>;
          <D.26810>:
          if (__result == 0) goto <D.26812>; else goto <D.26813>;
          <D.26812>:
          D.26814 = &MEM[(void *)"CallConvCdecl" + 2B];
          D.26815 = *D.26814;
          D.26816 = (int) D.26815;
          D.26817 = __s2 + 2;
          D.26818 = *D.26817;
          D.26819 = (int) D.26818;
          __result = D.26816 - D.26819;
          if (__s2_len > 2) goto <D.26820>; else goto <D.26821>;
          <D.26820>:
          if (__result == 0) goto <D.26822>; else goto <D.26823>;
          <D.26822>:
          D.26824 = &MEM[(void *)"CallConvCdecl" + 3B];
          D.26825 = *D.26824;
          D.26826 = (int) D.26825;
          D.26827 = __s2 + 3;
          D.26828 = *D.26827;
          D.26829 = (int) D.26828;
          __result = D.26826 - D.26829;
          <D.26823>:
          <D.26821>:
          <D.26813>:
          <D.26811>:
          <D.26803>:
          <D.26801>:
        }
        D.20598 = __result;
      }
      iftmp.340 = -D.20598;
      goto <D.26830>;
      <D.26794>:
      D.26831 = cmod_class->name;
      iftmp.340 = __builtin_strcmp (D.26831, "CallConvCdecl");
      <D.26830>:
      D.20599 = iftmp.340;
    }
    if (D.20599 == 0) goto <D.26832>; else goto <D.26833>;
    <D.26832>:
    csig->call_convention = 1;
    goto <D.26834>;
    <D.26833>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26838 = "CallConvStdcall";
        D.26839 = MEM[(const unsigned char *)D.26838];
        D.26840 = (int) D.26839;
        D.26841 = *__s2;
        D.26842 = (int) D.26841;
        __result = D.26840 - D.26842;
        {
          if (__s2_len != 0) goto <D.26843>; else goto <D.26844>;
          <D.26843>:
          if (__result == 0) goto <D.26845>; else goto <D.26846>;
          <D.26845>:
          D.26847 = &MEM[(void *)"CallConvStdcall" + 1B];
          D.26848 = *D.26847;
          D.26849 = (int) D.26848;
          D.26850 = __s2 + 1;
          D.26851 = *D.26850;
          D.26852 = (int) D.26851;
          __result = D.26849 - D.26852;
          if (__s2_len > 1) goto <D.26853>; else goto <D.26854>;
          <D.26853>:
          if (__result == 0) goto <D.26855>; else goto <D.26856>;
          <D.26855>:
          D.26857 = &MEM[(void *)"CallConvStdcall" + 2B];
          D.26858 = *D.26857;
          D.26859 = (int) D.26858;
          D.26860 = __s2 + 2;
          D.26861 = *D.26860;
          D.26862 = (int) D.26861;
          __result = D.26859 - D.26862;
          if (__s2_len > 2) goto <D.26863>; else goto <D.26864>;
          <D.26863>:
          if (__result == 0) goto <D.26865>; else goto <D.26866>;
          <D.26865>:
          D.26867 = &MEM[(void *)"CallConvStdcall" + 3B];
          D.26868 = *D.26867;
          D.26869 = (int) D.26868;
          D.26870 = __s2 + 3;
          D.26871 = *D.26870;
          D.26872 = (int) D.26871;
          __result = D.26869 - D.26872;
          <D.26866>:
          <D.26864>:
          <D.26856>:
          <D.26854>:
          <D.26846>:
          <D.26844>:
        }
        D.20607 = __result;
      }
      iftmp.341 = -D.20607;
      goto <D.26873>;
      <D.26837>:
      D.26831 = cmod_class->name;
      iftmp.341 = __builtin_strcmp (D.26831, "CallConvStdcall");
      <D.26873>:
      D.20608 = iftmp.341;
    }
    if (D.20608 == 0) goto <D.26874>; else goto <D.26875>;
    <D.26874>:
    csig->call_convention = 2;
    goto <D.26876>;
    <D.26875>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26880 = "CallConvFastcall";
        D.26881 = MEM[(const unsigned char *)D.26880];
        D.26882 = (int) D.26881;
        D.26883 = *__s2;
        D.26884 = (int) D.26883;
        __result = D.26882 - D.26884;
        {
          if (__s2_len != 0) goto <D.26885>; else goto <D.26886>;
          <D.26885>:
          if (__result == 0) goto <D.26887>; else goto <D.26888>;
          <D.26887>:
          D.26889 = &MEM[(void *)"CallConvFastcall" + 1B];
          D.26890 = *D.26889;
          D.26891 = (int) D.26890;
          D.26892 = __s2 + 1;
          D.26893 = *D.26892;
          D.26894 = (int) D.26893;
          __result = D.26891 - D.26894;
          if (__s2_len > 1) goto <D.26895>; else goto <D.26896>;
          <D.26895>:
          if (__result == 0) goto <D.26897>; else goto <D.26898>;
          <D.26897>:
          D.26899 = &MEM[(void *)"CallConvFastcall" + 2B];
          D.26900 = *D.26899;
          D.26901 = (int) D.26900;
          D.26902 = __s2 + 2;
          D.26903 = *D.26902;
          D.26904 = (int) D.26903;
          __result = D.26901 - D.26904;
          if (__s2_len > 2) goto <D.26905>; else goto <D.26906>;
          <D.26905>:
          if (__result == 0) goto <D.26907>; else goto <D.26908>;
          <D.26907>:
          D.26909 = &MEM[(void *)"CallConvFastcall" + 3B];
          D.26910 = *D.26909;
          D.26911 = (int) D.26910;
          D.26912 = __s2 + 3;
          D.26913 = *D.26912;
          D.26914 = (int) D.26913;
          __result = D.26911 - D.26914;
          <D.26908>:
          <D.26906>:
          <D.26898>:
          <D.26896>:
          <D.26888>:
          <D.26886>:
        }
        D.20616 = __result;
      }
      iftmp.342 = -D.20616;
      goto <D.26915>;
      <D.26879>:
      D.26831 = cmod_class->name;
      iftmp.342 = __builtin_strcmp (D.26831, "CallConvFastcall");
      <D.26915>:
      D.20617 = iftmp.342;
    }
    if (D.20617 == 0) goto <D.26916>; else goto <D.26917>;
    <D.26916>:
    csig->call_convention = 4;
    goto <D.26918>;
    <D.26917>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = cmod_class->name;
        D.26922 = "CallConvThiscall";
        D.26923 = MEM[(const unsigned char *)D.26922];
        D.26924 = (int) D.26923;
        D.26925 = *__s2;
        D.26926 = (int) D.26925;
        __result = D.26924 - D.26926;
        {
          if (__s2_len != 0) goto <D.26927>; else goto <D.26928>;
          <D.26927>:
          if (__result == 0) goto <D.26929>; else goto <D.26930>;
          <D.26929>:
          D.26931 = &MEM[(void *)"CallConvThiscall" + 1B];
          D.26932 = *D.26931;
          D.26933 = (int) D.26932;
          D.26934 = __s2 + 1;
          D.26935 = *D.26934;
          D.26936 = (int) D.26935;
          __result = D.26933 - D.26936;
          if (__s2_len > 1) goto <D.26937>; else goto <D.26938>;
          <D.26937>:
          if (__result == 0) goto <D.26939>; else goto <D.26940>;
          <D.26939>:
          D.26941 = &MEM[(void *)"CallConvThiscall" + 2B];
          D.26942 = *D.26941;
          D.26943 = (int) D.26942;
          D.26944 = __s2 + 2;
          D.26945 = *D.26944;
          D.26946 = (int) D.26945;
          __result = D.26943 - D.26946;
          if (__s2_len > 2) goto <D.26947>; else goto <D.26948>;
          <D.26947>:
          if (__result == 0) goto <D.26949>; else goto <D.26950>;
          <D.26949>:
          D.26951 = &MEM[(void *)"CallConvThiscall" + 3B];
          D.26952 = *D.26951;
          D.26953 = (int) D.26952;
          D.26954 = __s2 + 3;
          D.26955 = *D.26954;
          D.26956 = (int) D.26955;
          __result = D.26953 - D.26956;
          <D.26950>:
          <D.26948>:
          <D.26940>:
          <D.26938>:
          <D.26930>:
          <D.26928>:
        }
        D.20625 = __result;
      }
      iftmp.343 = -D.20625;
      goto <D.26957>;
      <D.26921>:
      D.26831 = cmod_class->name;
      iftmp.343 = __builtin_strcmp (D.26831, "CallConvThiscall");
      <D.26957>:
      D.20626 = iftmp.343;
    }
    if (D.20626 == 0) goto <D.26958>; else goto <D.26959>;
    <D.26958>:
    csig->call_convention = 3;
    <D.26959>:
    <D.26918>:
    <D.26876>:
    <D.26834>:
    <D.26791>:
    <D.26749>:
  }
  i = i + 1;
  <D.20628>:
  D.26730 = sig->ret;
  D.26960 = D.26730->num_mods;
  D.26961 = (int) D.26960;
  if (D.26961 > i) goto <D.20627>; else goto <D.20629>;
  <D.20629>:
  <D.26736>:
  <D.26732>:
}


mono_class_has_parent (struct MonoClass * klass, struct MonoClass * parent)
{
  struct MonoClass * * D.26962;
  _Bool D.26963;
  long int D.26964;
  long int D.26965;
  struct MonoClass * * D.26968;
  _Bool D.26969;
  long int D.26970;
  long int D.26971;
  gboolean D.26974;

  D.26962 = klass->supertypes;
  D.26963 = D.26962 == 0B;
  D.26964 = (long int) D.26963;
  D.26965 = __builtin_expect (D.26964, 0);
  if (D.26965 != 0) goto <D.26966>; else goto <D.26967>;
  <D.26966>:
  mono_class_setup_supertypes (klass);
  <D.26967>:
  D.26968 = parent->supertypes;
  D.26969 = D.26968 == 0B;
  D.26970 = (long int) D.26969;
  D.26971 = __builtin_expect (D.26970, 0);
  if (D.26971 != 0) goto <D.26972>; else goto <D.26973>;
  <D.26972>:
  mono_class_setup_supertypes (parent);
  <D.26973>:
  D.26974 = mono_class_has_parent_fast (klass, parent);
  return D.26974;
}


mono_class_has_parent_fast (struct MonoClass * klass, struct MonoClass * parent)
{
  gboolean D.26976;
  int iftmp.344;
  short unsigned int D.26980;
  short unsigned int D.26981;
  struct MonoClass * * D.26983;
  sizetype D.26984;
  sizetype D.26985;
  sizetype D.26986;
  struct MonoClass * * D.26987;
  struct MonoClass * D.26988;

  D.26980 = klass->idepth;
  D.26981 = parent->idepth;
  if (D.26980 >= D.26981) goto <D.26982>; else goto <D.26978>;
  <D.26982>:
  D.26983 = klass->supertypes;
  D.26981 = parent->idepth;
  D.26984 = (sizetype) D.26981;
  D.26985 = D.26984 + 1073741823;
  D.26986 = D.26985 * 4;
  D.26987 = D.26983 + D.26986;
  D.26988 = *D.26987;
  if (D.26988 == parent) goto <D.26989>; else goto <D.26978>;
  <D.26989>:
  iftmp.344 = 1;
  goto <D.26979>;
  <D.26978>:
  iftmp.344 = 0;
  <D.26979>:
  D.26976 = iftmp.344;
  return D.26976;
}


mono_marshal_get_vtfixup_ftnptr (struct MonoImage * image, guint32 token, guint16 type)
{
  _Bool D.26991;
  long int D.26992;
  long int D.26993;
  _Bool D.26996;
  long int D.26997;
  long int D.26998;
  int D.27001;
  int D.27002;
  unsigned int D.27005;
  unsigned int D.27006;
  _Bool D.27007;
  long int D.27008;
  long int D.27009;
  short unsigned int D.27012;
  int D.27013;
  int D.27014;
  unsigned int D.27015;
  unsigned int D.27016;
  struct MonoClass * D.27017;
  const char * D.27018;
  int D.27019;
  unsigned int i.345;
  unsigned int D.27021;
  struct MonoMarshalSpec * * D.27022;
  struct MonoMarshalSpec * D.27023;
  void * D.27026;
  <unnamed-unsigned:1> D.27027;
  int D.27028;
  unsigned int i.346;
  int D.27030;
  struct MonoMethod * method;
  struct MonoMethodSignature * sig;
  struct MonoMethodBuilder * mb;
  int i;
  int param_count;

  D.26991 = token == 0;
  D.26992 = (long int) D.26991;
  D.26993 = __builtin_expect (D.26992, 0);
  if (D.26993 != 0) goto <D.26994>; else goto <D.26995>;
  <D.26994>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9608, "token");
  <D.26995>:
  method = mono_get_method (image, token, 0B);
  D.26996 = method == 0B;
  D.26997 = (long int) D.26996;
  D.26998 = __builtin_expect (D.26997, 0);
  if (D.26998 != 0) goto <D.26999>; else goto <D.27000>;
  <D.26999>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9611, "method");
  <D.27000>:
  D.27001 = (int) type;
  D.27002 = D.27001 & 12;
  if (D.27002 != 0) goto <D.27003>; else goto <D.27004>;
  <D.27003>:
  {
    struct MonoMethodSignature * csig;
    struct MonoMarshalSpec * * mspecs;
    struct EmitMarshalContext m;

    try
      {
        sig = mono_method_signature (method);
        D.27005 = BIT_FIELD_REF <*sig, 32, 64>;
        D.27006 = D.27005 & 4194304;
        D.27007 = D.27006 != 0;
        D.27008 = (long int) D.27007;
        D.27009 = __builtin_expect (D.27008, 0);
        if (D.27009 != 0) goto <D.27010>; else goto <D.27011>;
        <D.27010>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 9619, "!sig->hasthis");
        <D.27011>:
        D.27012 = sig->param_count;
        D.27013 = (int) D.27012;
        D.27014 = D.27013 + 1;
        D.27015 = (unsigned int) D.27014;
        D.27016 = D.27015 * 4;
        mspecs = monoeg_malloc0 (D.27016);
        mono_method_get_marshal_info (method, mspecs);
        D.27017 = method->klass;
        D.27018 = method->name;
        mb = mono_mb_new (D.27017, D.27018, 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.27012 = sig->param_count;
        D.27013 = (int) D.27012;
        D.27019 = D.27013 + 16;
        method = mono_mb_create_method (mb, csig, D.27019);
        mono_mb_free (mb);
        D.27012 = sig->param_count;
        i = (int) D.27012;
        goto <D.20721>;
        <D.20720>:
        i.345 = (unsigned int) i;
        D.27021 = i.345 * 4;
        D.27022 = mspecs + D.27021;
        D.27023 = *D.27022;
        if (D.27023 != 0B) goto <D.27024>; else goto <D.27025>;
        <D.27024>:
        i.345 = (unsigned int) i;
        D.27021 = i.345 * 4;
        D.27022 = mspecs + D.27021;
        D.27023 = *D.27022;
        mono_metadata_free_marshal_spec (D.27023);
        <D.27025>:
        i = i + -1;
        <D.20721>:
        if (i >= 0) goto <D.20720>; else goto <D.20722>;
        <D.20722>:
        monoeg_g_free (mspecs);
        D.27026 = mono_compile_method (method);
        return D.27026;
      }
    finally
      {
        m = {CLOBBER};
      }
  }
  <D.27004>:
  sig = mono_method_signature (method);
  D.27017 = method->klass;
  D.27018 = method->name;
  mb = mono_mb_new (D.27017, D.27018, 7);
  D.27012 = sig->param_count;
  D.27013 = (int) D.27012;
  D.27027 = sig->hasthis;
  D.27028 = (int) D.27027;
  param_count = D.27013 + D.27028;
  i = 0;
  goto <D.20724>;
  <D.20723>:
  i.346 = (unsigned int) i;
  mono_mb_emit_ldarg (mb, i.346);
  i = i + 1;
  <D.20724>:
  if (i < param_count) goto <D.20723>; else goto <D.20725>;
  <D.20725>:
  D.27001 = (int) type;
  D.27030 = D.27001 & 16;
  if (D.27030 != 0) goto <D.27031>; else goto <D.27032>;
  <D.27031>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.27033>;
  <D.27032>:
  mono_mb_emit_op (mb, 40, method);
  <D.27033>:
  mono_mb_emit_byte (mb, 42);
  mb->dynamic = 1;
  method = mono_mb_create_method (mb, sig, param_count);
  mono_mb_free (mb);
  D.27026 = mono_compile_method (method);
  return D.27026;
}


mono_marshal_get_castclass_with_cache ()
{
  struct MonoMethod * cached.347;
  struct MonoMethod * D.27039;
  struct MonoClass * D.27040;
  struct MonoImage * D.27041;
  struct MonoType * D.27042;
  struct MonoClass * D.27043;
  struct MonoType * D.27044;
  unsigned int D.27045;
  unsigned int D.27046;
  unsigned int cache_miss_pos.348;
  unsigned int D.27048;
  unsigned int invalid_cast_pos.349;
  unsigned int return_null_pos.350;
  void * D.27051;
  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.27037>; else goto <D.27038>;
  <D.27037>:
  D.27039 = cached;
  return D.27039;
  <D.27038>:
  D.27040 = mono_defaults.object_class;
  mb = mono_mb_new (D.27040, "__castclass_with_cache", 19);
  D.27041 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27041, 3);
  D.27040 = mono_defaults.object_class;
  D.27042 = &D.27040->byval_arg;
  sig->params[0] = D.27042;
  D.27043 = mono_defaults.int_class;
  D.27044 = &D.27043->byval_arg;
  sig->params[1] = D.27044;
  D.27043 = mono_defaults.int_class;
  D.27044 = &D.27043->byval_arg;
  sig->params[2] = D.27044;
  D.27040 = mono_defaults.object_class;
  D.27042 = &D.27040->byval_arg;
  sig->ret = D.27042;
  sig->pinvoke = 0;
  D.27043 = mono_defaults.int_class;
  D.27044 = &D.27043->byval_arg;
  mono_mb_add_local (mb, D.27044);
  mono_mb_emit_ldarg (mb, 0);
  D.27045 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27045;
  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.27046 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27046;
  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.27048 = mono_mb_emit_branch (mb, 57);
  invalid_cast_pos = (int) D.27048;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  invalid_cast_pos.349 = (unsigned int) invalid_cast_pos;
  mono_mb_patch_branch (mb, invalid_cast_pos.349);
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  return_null_pos.350 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.350);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 9);
  mono_marshal_set_wrapper_info (res, info);
  mono_memory_write_barrier ();
  D.27051 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27051 != 0B) goto <D.27052>; else goto <D.27053>;
  <D.27052>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27053>:
  mono_mb_free (mb);
  D.27039 = cached;
  return D.27039;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


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

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


mono_marshal_get_isinst_with_cache ()
{
  struct MonoMethod * cached.353;
  struct MonoMethod * D.27063;
  struct MonoClass * D.27064;
  struct MonoImage * D.27065;
  struct MonoType * D.27066;
  struct MonoClass * D.27067;
  struct MonoType * D.27068;
  unsigned int D.27069;
  unsigned int D.27070;
  unsigned int D.27071;
  unsigned int D.27072;
  unsigned int negative_cache_hit_pos.354;
  unsigned int cache_hit_pos.355;
  unsigned int cache_miss_pos.356;
  unsigned int D.27076;
  unsigned int not_an_instance_pos.357;
  unsigned int return_null_pos.358;
  void * D.27079;
  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.27061>; else goto <D.27062>;
  <D.27061>:
  D.27063 = cached;
  return D.27063;
  <D.27062>:
  D.27064 = mono_defaults.object_class;
  mb = mono_mb_new (D.27064, "__isinst_with_cache", 19);
  D.27065 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27065, 3);
  D.27064 = mono_defaults.object_class;
  D.27066 = &D.27064->byval_arg;
  sig->params[0] = D.27066;
  D.27067 = mono_defaults.int_class;
  D.27068 = &D.27067->byval_arg;
  sig->params[1] = D.27068;
  D.27067 = mono_defaults.int_class;
  D.27068 = &D.27067->byval_arg;
  sig->params[2] = D.27068;
  D.27064 = mono_defaults.object_class;
  D.27066 = &D.27064->byval_arg;
  sig->ret = D.27066;
  sig->pinvoke = 0;
  D.27067 = mono_defaults.int_class;
  D.27068 = &D.27067->byval_arg;
  mono_mb_add_local (mb, D.27068);
  D.27067 = mono_defaults.int_class;
  D.27068 = &D.27067->byval_arg;
  mono_mb_add_local (mb, D.27068);
  mono_mb_emit_ldarg (mb, 0);
  D.27069 = mono_mb_emit_branch (mb, 57);
  return_null_pos = (int) D.27069;
  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.27070 = mono_mb_emit_branch (mb, 64);
  cache_miss_pos = (int) D.27070;
  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.27071 = mono_mb_emit_branch (mb, 58);
  negative_cache_hit_pos = (int) D.27071;
  mono_mb_emit_ldarg (mb, 0);
  D.27072 = mono_mb_emit_branch (mb, 56);
  cache_hit_pos = (int) D.27072;
  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.27076 = mono_mb_emit_branch (mb, 57);
  not_an_instance_pos = (int) D.27076;
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  not_an_instance_pos.357 = (unsigned int) not_an_instance_pos;
  mono_mb_patch_branch (mb, not_an_instance_pos.357);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 23);
  mono_mb_emit_byte (mb, 224);
  mono_mb_emit_byte (mb, 96);
  mono_mb_emit_byte (mb, 223);
  return_null_pos.358 = (unsigned int) return_null_pos;
  mono_mb_patch_branch (mb, return_null_pos.358);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, sig, 8);
  info = mono_wrapper_info_create (res, 10);
  mono_marshal_set_wrapper_info (res, info);
  mono_memory_write_barrier ();
  D.27079 = InterlockedCompareExchangePointer (&cached, res, 0B);
  if (D.27079 != 0B) goto <D.27080>; else goto <D.27081>;
  <D.27080>:
  mono_free_method (res);
  mono_metadata_free_method_signature (sig);
  <D.27081>:
  mono_mb_free (mb);
  D.27063 = cached;
  return D.27063;
}


mono_marshal_get_isinst (struct MonoClass * klass)
{
  struct MonoImage * D.27083;
  struct GHashTable * * D.27084;
  struct MonoMethod * D.27087;
  struct MonoMethodSignature * isint_sig.359;
  struct MonoImage * D.27091;
  struct MonoMethodSignature * isint_sig.360;
  struct MonoClass * D.27093;
  struct MonoType * D.27094;
  const char * D.27095;
  struct MonoMethod * D.27096;
  unsigned int D.27097;
  unsigned int D.27098;
  struct MonoMethod * D.27099;
  unsigned int D.27100;
  unsigned int pos_failed.361;
  unsigned int D.27102;
  unsigned int pos_was_ok.362;
  unsigned int pos_end.363;
  unsigned int pos_end2.364;
  short unsigned int D.27106;
  int D.27107;
  int D.27108;
  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.27083 = klass->image;
  D.27084 = &D.27083->isinst_cache;
  cache = get_cache (D.27084, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27085>; else goto <D.27086>;
  <D.27085>:
  D.27087 = res;
  return D.27087;
  <D.27086>:
  isint_sig.359 = isint_sig;
  if (isint_sig.359 == 0B) goto <D.27089>; else goto <D.27090>;
  <D.27089>:
  D.27091 = mono_defaults.corlib;
  isint_sig.360 = mono_metadata_signature_alloc (D.27091, 1);
  isint_sig = isint_sig.360;
  isint_sig.359 = isint_sig;
  D.27093 = mono_defaults.object_class;
  D.27094 = &D.27093->byval_arg;
  isint_sig.359->params[0] = D.27094;
  isint_sig.359 = isint_sig;
  D.27093 = mono_defaults.object_class;
  D.27094 = &D.27093->byval_arg;
  isint_sig.359->ret = D.27094;
  isint_sig.359 = isint_sig;
  isint_sig.359->pinvoke = 0;
  <D.27090>:
  D.27095 = klass->name;
  name = monoeg_g_strdup_printf ("__isinst_wrapper_%s", D.27095);
  D.27093 = mono_defaults.object_class;
  mb = mono_mb_new (D.27093, name, 18);
  monoeg_g_free (name);
  D.27096 = mb->method;
  D.27096->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.27097 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27097;
  mono_mb_emit_byte (mb, 24);
  D.27098 = mono_mb_emit_branch (mb, 64);
  pos_failed = (int) D.27098;
  mono_mb_emit_ldarg (mb, 0);
  D.27099 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27099, 0B);
  D.27100 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27100;
  pos_failed.361 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.361);
  mono_mb_emit_byte (mb, 20);
  D.27102 = mono_mb_emit_branch (mb, 56);
  pos_end2 = (int) D.27102;
  pos_was_ok.362 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.362);
  mono_mb_emit_byte (mb, 38);
  mono_mb_emit_ldarg (mb, 0);
  pos_end.363 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.363);
  pos_end2.364 = (unsigned int) pos_end2;
  mono_mb_patch_branch (mb, pos_end2.364);
  mono_mb_emit_byte (mb, 42);
  isint_sig.359 = isint_sig;
  isint_sig.359 = isint_sig;
  D.27106 = isint_sig.359->param_count;
  D.27107 = (int) D.27106;
  D.27108 = D.27107 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.359, D.27108);
  mono_mb_free (mb);
  D.27087 = res;
  return D.27087;
}


mono_marshal_get_castclass (struct MonoClass * klass)
{
  struct MonoImage * D.27110;
  struct GHashTable * * D.27111;
  struct MonoMethod * D.27114;
  struct MonoMethodSignature * castclass_sig.365;
  struct MonoImage * D.27118;
  struct MonoMethodSignature * castclass_sig.366;
  struct MonoClass * D.27120;
  struct MonoType * D.27121;
  const char * D.27122;
  struct MonoMethod * D.27123;
  unsigned int D.27124;
  struct MonoMethod * D.27125;
  unsigned int D.27126;
  unsigned int pos_was_ok.367;
  unsigned int pos_was_ok2.368;
  short unsigned int D.27129;
  int D.27130;
  int D.27131;
  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.27110 = klass->image;
  D.27111 = &D.27110->castclass_cache;
  cache = get_cache (D.27111, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27112>; else goto <D.27113>;
  <D.27112>:
  D.27114 = res;
  return D.27114;
  <D.27113>:
  castclass_sig.365 = castclass_sig;
  if (castclass_sig.365 == 0B) goto <D.27116>; else goto <D.27117>;
  <D.27116>:
  D.27118 = mono_defaults.corlib;
  castclass_sig.366 = mono_metadata_signature_alloc (D.27118, 1);
  castclass_sig = castclass_sig.366;
  castclass_sig.365 = castclass_sig;
  D.27120 = mono_defaults.object_class;
  D.27121 = &D.27120->byval_arg;
  castclass_sig.365->params[0] = D.27121;
  castclass_sig.365 = castclass_sig;
  D.27120 = mono_defaults.object_class;
  D.27121 = &D.27120->byval_arg;
  castclass_sig.365->ret = D.27121;
  castclass_sig.365 = castclass_sig;
  castclass_sig.365->pinvoke = 0;
  <D.27117>:
  D.27122 = klass->name;
  name = monoeg_g_strdup_printf ("__castclass_wrapper_%s", D.27122);
  D.27120 = mono_defaults.object_class;
  mb = mono_mb_new (D.27120, name, 19);
  monoeg_g_free (name);
  D.27123 = mb->method;
  D.27123->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 8, klass);
  D.27124 = mono_mb_emit_branch (mb, 57);
  pos_was_ok = (int) D.27124;
  mono_mb_emit_ldarg (mb, 0);
  D.27125 = mono_marshal_get_proxy_cancast (klass);
  mono_mb_emit_managed_call (mb, D.27125, 0B);
  D.27126 = mono_mb_emit_branch (mb, 58);
  pos_was_ok2 = (int) D.27126;
  mono_mb_emit_exception (mb, "InvalidCastException", 0B);
  pos_was_ok.367 = (unsigned int) pos_was_ok;
  mono_mb_patch_branch (mb, pos_was_ok.367);
  pos_was_ok2.368 = (unsigned int) pos_was_ok2;
  mono_mb_patch_branch (mb, pos_was_ok2.368);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 42);
  castclass_sig.365 = castclass_sig;
  castclass_sig.365 = castclass_sig;
  D.27129 = castclass_sig.365->param_count;
  D.27130 = (int) D.27129;
  D.27131 = D.27130 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig.365, D.27131);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 0);
  mono_marshal_set_wrapper_info (res, info);
  D.27114 = res;
  return D.27114;
}


mono_marshal_get_proxy_cancast (struct MonoClass * klass)
{
  struct MonoImage * D.27133;
  struct GHashTable * * D.27134;
  struct MonoMethod * D.27137;
  struct MonoMethodSignature * isint_sig.369;
  struct MonoImage * D.27141;
  struct MonoMethodSignature * isint_sig.370;
  struct MonoClass * D.27143;
  struct MonoType * D.27144;
  struct MonoType * D.27145;
  struct MonoMethod * D.27146;
  struct MonoClass * D.27147;
  _Bool D.27148;
  long int D.27149;
  long int D.27150;
  unsigned int D.27153;
  unsigned int D.27154;
  unsigned int pos_failed.371;
  unsigned int pos_end.372;
  short unsigned int D.27157;
  int D.27158;
  int D.27159;
  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.27133 = klass->image;
  D.27134 = &D.27133->proxy_isinst_cache;
  cache = get_cache (D.27134, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, klass);
  if (res != 0B) goto <D.27135>; else goto <D.27136>;
  <D.27135>:
  D.27137 = res;
  return D.27137;
  <D.27136>:
  isint_sig.369 = isint_sig;
  if (isint_sig.369 == 0B) goto <D.27139>; else goto <D.27140>;
  <D.27139>:
  D.27141 = mono_defaults.corlib;
  isint_sig.370 = mono_metadata_signature_alloc (D.27141, 1);
  isint_sig = isint_sig.370;
  isint_sig.369 = isint_sig;
  D.27143 = mono_defaults.object_class;
  D.27144 = &D.27143->byval_arg;
  isint_sig.369->params[0] = D.27144;
  isint_sig.369 = isint_sig;
  D.27143 = mono_defaults.object_class;
  D.27144 = &D.27143->byval_arg;
  isint_sig.369->ret = D.27144;
  isint_sig.369 = isint_sig;
  isint_sig.369->pinvoke = 0;
  <D.27140>:
  D.27145 = &klass->byval_arg;
  klass_name = mono_type_full_name (D.27145);
  name = monoeg_g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name);
  D.27143 = mono_defaults.object_class;
  mb = mono_mb_new (D.27143, name, 20);
  monoeg_g_free (klass_name);
  monoeg_g_free (name);
  D.27146 = mb->method;
  D.27146->save_lmf = 1;
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 80);
  D.27145 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27145);
  mono_mb_emit_icall (mb, type_from_handle);
  mono_mb_emit_ldarg (mb, 0);
  desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", 0);
  D.27147 = mono_defaults.iremotingtypeinfo_class;
  can_cast_to = mono_method_desc_search_in_class (desc, D.27147);
  D.27148 = can_cast_to == 0B;
  D.27149 = (long int) D.27148;
  D.27150 = __builtin_expect (D.27149, 0);
  if (D.27150 != 0) goto <D.27151>; else goto <D.27152>;
  <D.27151>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10142, "can_cast_to");
  <D.27152>:
  mono_method_desc_free (desc);
  mono_mb_emit_op (mb, 111, can_cast_to);
  D.27153 = mono_mb_emit_branch (mb, 57);
  pos_failed = (int) D.27153;
  D.27145 = &klass->byval_arg;
  mono_mb_emit_ptr (mb, D.27145);
  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.27154 = mono_mb_emit_branch (mb, 56);
  pos_end = (int) D.27154;
  pos_failed.371 = (unsigned int) pos_failed;
  mono_mb_patch_branch (mb, pos_failed.371);
  mono_mb_emit_byte (mb, 20);
  pos_end.372 = (unsigned int) pos_end;
  mono_mb_patch_branch (mb, pos_end.372);
  mono_mb_emit_byte (mb, 42);
  isint_sig.369 = isint_sig;
  isint_sig.369 = isint_sig;
  D.27157 = isint_sig.369->param_count;
  D.27158 = (int) D.27157;
  D.27159 = D.27158 + 16;
  res = mono_mb_create_and_cache (cache, klass, mb, isint_sig.369, D.27159);
  mono_mb_free (mb);
  D.27137 = res;
  return D.27137;
}


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

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


mono_marshal_get_struct_to_ptr (struct MonoClass * klass)
{
  _Bool D.27163;
  long int D.27164;
  long int D.27165;
  struct MonoMarshalType * D.27168;
  struct MonoMethod * D.27169;
  struct MonoMethod * D.27172;
  struct MonoMethod * stoptr.373;
  struct MonoClass * D.27176;
  struct MonoMethod * stoptr.374;
  _Bool D.27178;
  long int D.27179;
  long int D.27180;
  const char * D.27183;
  unsigned int D.27184;
  unsigned int D.27185;
  int D.27188;
  struct MonoClass * D.27190;
  struct MonoType * D.27191;
  struct MonoClass * D.27192;
  struct MonoType * D.27193;
  struct MonoMethodSignature * D.27194;
  struct MonoMethodBuilder * mb;
  static struct MonoMethod * stoptr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27163 = klass == 0B;
  D.27164 = (long int) D.27163;
  D.27165 = __builtin_expect (D.27164, 0);
  if (D.27165 != 0) goto <D.27166>; else goto <D.27167>;
  <D.27166>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10201, "klass != NULL");
  <D.27167>:
  mono_marshal_load_type_info (klass);
  D.27168 = klass->marshal_info;
  D.27169 = D.27168->str_to_ptr;
  if (D.27169 != 0B) goto <D.27170>; else goto <D.27171>;
  <D.27170>:
  D.27168 = klass->marshal_info;
  D.27172 = D.27168->str_to_ptr;
  return D.27172;
  <D.27171>:
  stoptr.373 = stoptr;
  if (stoptr.373 == 0B) goto <D.27174>; else goto <D.27175>;
  <D.27174>:
  D.27176 = mono_defaults.marshal_class;
  stoptr.374 = mono_class_get_method_from_name (D.27176, "StructureToPtr", 3);
  stoptr = stoptr.374;
  <D.27175>:
  stoptr.373 = stoptr;
  D.27178 = stoptr.373 == 0B;
  D.27179 = (long int) D.27178;
  D.27180 = __builtin_expect (D.27179, 0);
  if (D.27180 != 0) goto <D.27181>; else goto <D.27182>;
  <D.27181>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10210, "stoptr");
  <D.27182>:
  stoptr.373 = stoptr;
  D.27183 = stoptr.373->name;
  mb = mono_mb_new (klass, D.27183, 25);
  D.27184 = BIT_FIELD_REF <*klass, 32, 160>;
  D.27185 = D.27184 & 32;
  if (D.27185 != 0) goto <D.27186>; else goto <D.27187>;
  <D.27186>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_byte (mb, 2);
  mono_mb_emit_ldflda (mb, 8);
  D.27188 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27188);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27189>;
  <D.27187>:
  D.27190 = mono_defaults.int_class;
  D.27191 = &D.27190->byval_arg;
  mono_mb_add_local (mb, D.27191);
  D.27190 = mono_defaults.int_class;
  D.27191 = &D.27190->byval_arg;
  mono_mb_add_local (mb, D.27191);
  D.27192 = mono_defaults.boolean_class;
  D.27193 = &D.27192->byval_arg;
  mono_mb_add_local (mb, D.27193);
  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.27189>:
  mono_mb_emit_byte (mb, 42);
  stoptr.373 = stoptr;
  D.27194 = mono_signature_no_pinvoke (stoptr.373);
  res = mono_mb_create_method (mb, D.27194, 0);
  mono_mb_free (mb);
  info = mono_wrapper_info_create (res, 8);
  mono_marshal_set_wrapper_info (res, info);
  D.27168 = klass->marshal_info;
  D.27168->str_to_ptr = res;
  D.27172 = res;
  return D.27172;
}


mono_marshal_get_ptr_to_struct (struct MonoClass * klass)
{
  _Bool D.27196;
  long int D.27197;
  long int D.27198;
  struct MonoMarshalType * D.27201;
  struct MonoMethod * D.27202;
  struct MonoMethod * D.27205;
  struct MonoMethodSignature * ptostr.375;
  struct MonoImage * D.27209;
  unsigned int D.27210;
  unsigned int D.27211;
  int D.27214;
  struct MonoClass * D.27216;
  struct MonoType * D.27217;
  struct MonoType * D.27218;
  struct MonoMethodBuilder * mb;
  static struct MonoMethodSignature * ptostr = 0B;
  struct MonoMethod * res;
  struct WrapperInfo * info;

  D.27196 = klass == 0B;
  D.27197 = (long int) D.27196;
  D.27198 = __builtin_expect (D.27197, 0);
  if (D.27198 != 0) goto <D.27199>; else goto <D.27200>;
  <D.27199>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10273, "klass != NULL");
  <D.27200>:
  mono_marshal_load_type_info (klass);
  D.27201 = klass->marshal_info;
  D.27202 = D.27201->ptr_to_str;
  if (D.27202 != 0B) goto <D.27203>; else goto <D.27204>;
  <D.27203>:
  D.27201 = klass->marshal_info;
  D.27205 = D.27201->ptr_to_str;
  return D.27205;
  <D.27204>:
  ptostr.375 = ptostr;
  if (ptostr.375 == 0B) goto <D.27207>; else goto <D.27208>;
  <D.27207>:
  {
    struct MonoMethodSignature * sig;

    sig = mono_create_icall_signature ("void ptr object");
    D.27209 = mono_defaults.corlib;
    sig = signature_dup (D.27209, sig);
    sig->pinvoke = 0;
    mono_memory_barrier ();
    ptostr = sig;
  }
  <D.27208>:
  mb = mono_mb_new (klass, "PtrToStructure", 25);
  D.27210 = BIT_FIELD_REF <*klass, 32, 160>;
  D.27211 = D.27210 & 32;
  if (D.27211 != 0) goto <D.27212>; else goto <D.27213>;
  <D.27212>:
  mono_mb_emit_byte (mb, 3);
  mono_mb_emit_ldflda (mb, 8);
  mono_mb_emit_byte (mb, 2);
  D.27214 = mono_class_value_size (klass, 0B);
  mono_mb_emit_icon (mb, D.27214);
  mono_mb_emit_byte (mb, 254);
  mono_mb_emit_byte (mb, 23);
  goto <D.27215>;
  <D.27213>:
  D.27216 = mono_defaults.int_class;
  D.27217 = &D.27216->byval_arg;
  mono_mb_add_local (mb, D.27217);
  D.27218 = &klass->this_arg;
  mono_mb_add_local (mb, D.27218);
  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.27215>:
  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.27201 = klass->marshal_info;
  D.27201->ptr_to_str = res;
  D.27205 = res;
  return D.27205;
}


mono_marshal_get_synchronized_inner_wrapper (struct MonoMethod * method)
{
  unsigned int D.27220;
  unsigned int D.27221;
  struct MonoGenericContext * D.27224;
  struct MonoGenericInst * D.27225;
  struct MonoClass * D.27230;
  _Bool D.27231;
  long int D.27232;
  long int D.27233;
  const char * D.27236;
  struct MonoImage * D.27237;
  struct MonoMethodSignature * D.27238;
  struct MonoMethod * D.27241;
  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.27220 = BIT_FIELD_REF <*method, 32, 160>;
  D.27221 = D.27220 & 4096;
  if (D.27221 != 0) goto <D.27222>; else goto <D.27223>;
  <D.27222>:
  D.27224 = mono_method_get_context (method);
  D.27225 = D.27224->method_inst;
  if (D.27225 == 0B) goto <D.27226>; else goto <D.27227>;
  <D.27226>:
  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.27228>; else goto <D.27229>;
  <D.27228>:
  D.27230 = method->klass;
  container = D.27230->generic_container;
  <D.27229>:
  D.27231 = container == 0B;
  D.27232 = (long int) D.27231;
  D.27233 = __builtin_expect (D.27232, 0);
  if (D.27233 != 0) goto <D.27234>; else goto <D.27235>;
  <D.27234>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10360, "container");
  <D.27235>:
  <D.27227>:
  <D.27223>:
  D.27230 = method->klass;
  D.27236 = method->name;
  mb = mono_mb_new (D.27230, D.27236, 25);
  mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn\'t be called.");
  mono_mb_emit_byte (mb, 42);
  D.27230 = method->klass;
  D.27237 = D.27230->image;
  D.27238 = mono_method_signature (method);
  sig = signature_dup (D.27237, D.27238);
  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.27239>; else goto <D.27240>;
  <D.27239>:
  res = mono_class_inflate_generic_method (res, ctx);
  <D.27240>:
  D.27241 = res;
  return D.27241;
}


mono_marshal_get_synchronized_wrapper (struct MonoMethod * method)
{
  _Bool D.27243;
  long int D.27244;
  long int D.27245;
  unsigned int D.27248;
  unsigned int D.27249;
  struct MonoMethod * D.27252;
  unsigned int D.27253;
  struct MonoGenericContext * D.27256;
  struct MonoGenericInst * D.27257;
  struct MonoClass * D.27262;
  _Bool D.27263;
  long int D.27264;
  long int D.27265;
  struct MonoImage * D.27270;
  struct GHashTable * * D.27271;
  struct GHashTable * * D.27275;
  struct MonoMethodSignature * D.27278;
  const char * D.27279;
  struct MonoType * D.27280;
  int D.27281;
  unsigned int D.27284;
  unsigned int D.27285;
  short unsigned int D.27288;
  int D.27289;
  int D.27290;
  int D.27293;
  unsigned int ret_local.376;
  short unsigned int D.27297;
  int D.27298;
  int D.27299;
  struct MonoClass * D.27300;
  struct MonoType * D.27301;
  _Bool D.27304;
  long int D.27305;
  long int D.27306;
  struct MonoMethod * enter_method.377;
  struct MonoClass * D.27312;
  struct MonoMethod * enter_method.378;
  _Bool D.27314;
  long int D.27315;
  long int D.27316;
  struct MonoMethod * exit_method.379;
  struct MonoMethod * exit_method.380;
  _Bool D.27321;
  long int D.27322;
  long int D.27323;
  struct MonoClass * D.27326;
  struct MonoMethod * gettypefromhandle_method.381;
  struct MonoMethod * gettypefromhandle_method.382;
  _Bool D.27329;
  long int D.27330;
  long int D.27331;
  _Bool D.27336;
  long int D.27337;
  long int D.27338;
  unsigned int D.27343;
  struct MonoClass * D.27344;
  unsigned int this_local.383;
  int D.27347;
  unsigned int D.27348;
  unsigned int D.27349;
  unsigned int D.27350;
  _Bool D.27353;
  int D.27354;
  int D.27355;
  unsigned int D.27356;
  struct MonoGenericContext * D.27359;
  struct MonoMethod * D.27360;
  int D.27362;
  unsigned int D.27365;
  int D.27366;
  unsigned int D.27367;
  unsigned int D.27368;
  unsigned int D.27369;
  int D.27370;
  unsigned int D.27371;
  int D.27372;
  unsigned int D.27373;
  unsigned int D.27374;
  unsigned int D.27375;
  unsigned int pos.384;
  int D.27377;
  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.27243 = method == 0B;
  D.27244 = (long int) D.27243;
  D.27245 = __builtin_expect (D.27244, 0);
  if (D.27245 != 0) goto <D.27246>; else goto <D.27247>;
  <D.27246>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10397, "method");
  <D.27247>:
  D.27248 = BIT_FIELD_REF <*method, 32, 160>;
  D.27249 = D.27248 & 124;
  if (D.27249 == 64) goto <D.27250>; else goto <D.27251>;
  <D.27250>:
  D.27252 = method;
  return D.27252;
  <D.27251>:
  D.27248 = BIT_FIELD_REF <*method, 32, 160>;
  D.27253 = D.27248 & 4096;
  if (D.27253 != 0) goto <D.27254>; else goto <D.27255>;
  <D.27254>:
  D.27256 = mono_method_get_context (method);
  D.27257 = D.27256->method_inst;
  if (D.27257 == 0B) goto <D.27258>; else goto <D.27259>;
  <D.27258>:
  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.27260>; else goto <D.27261>;
  <D.27260>:
  D.27262 = method->klass;
  container = D.27262->generic_container;
  <D.27261>:
  D.27263 = container == 0B;
  D.27264 = (long int) D.27263;
  D.27265 = __builtin_expect (D.27264, 0);
  if (D.27265 != 0) goto <D.27266>; else goto <D.27267>;
  <D.27266>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10410, "container");
  <D.27267>:
  <D.27259>:
  <D.27255>:
  if (ctx != 0B) goto <D.27268>; else goto <D.27269>;
  <D.27268>:
  D.27262 = method->klass;
  D.27270 = D.27262->image;
  D.27271 = &D.27270->synchronized_generic_cache;
  cache = get_cache (D.27271, mono_aligned_addr_hash, 0B);
  res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
  if (res != 0B) goto <D.27272>; else goto <D.27273>;
  <D.27272>:
  D.27252 = res;
  return D.27252;
  <D.27273>:
  goto <D.27274>;
  <D.27269>:
  D.27262 = method->klass;
  D.27270 = D.27262->image;
  D.27275 = &D.27270->synchronized_cache;
  cache = get_cache (D.27275, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27276>; else goto <D.27277>;
  <D.27276>:
  D.27252 = res;
  return D.27252;
  <D.27277>:
  <D.27274>:
  D.27262 = method->klass;
  D.27270 = D.27262->image;
  D.27278 = mono_method_signature (method);
  sig = signature_dup (D.27270, D.27278);
  sig->pinvoke = 0;
  D.27262 = method->klass;
  D.27279 = method->name;
  mb = mono_mb_new (D.27262, D.27279, 16);
  D.27280 = sig->ret;
  D.27281 = mono_type_is_void (D.27280);
  if (D.27281 == 0) goto <D.27282>; else goto <D.27283>;
  <D.27282>:
  D.27280 = sig->ret;
  ret_local = mono_mb_add_local (mb, D.27280);
  <D.27283>:
  D.27262 = method->klass;
  D.27284 = BIT_FIELD_REF <*D.27262, 32, 160>;
  D.27285 = D.27284 & 8;
  if (D.27285 != 0) goto <D.27286>; else goto <D.27287>;
  <D.27286>:
  D.27288 = method->flags;
  D.27289 = (int) D.27288;
  D.27290 = D.27289 & 16;
  if (D.27290 == 0) goto <D.27291>; else goto <D.27292>;
  <D.27291>:
  D.27262 = method->klass;
  mono_class_set_failure (D.27262, 7, 0B);
  mono_mb_emit_byte (mb, 20);
  D.27262 = method->klass;
  mono_mb_emit_op (mb, 117, D.27262);
  mono_mb_emit_byte (mb, 38);
  D.27280 = sig->ret;
  D.27293 = mono_type_is_void (D.27280);
  if (D.27293 == 0) goto <D.27294>; else goto <D.27295>;
  <D.27294>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.27295>:
  mono_mb_emit_byte (mb, 42);
  D.27297 = sig->param_count;
  D.27298 = (int) D.27297;
  D.27299 = D.27298 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27299);
  mono_mb_free (mb);
  D.27252 = res;
  return D.27252;
  <D.27292>:
  <D.27287>:
  D.27300 = mono_defaults.object_class;
  D.27301 = &D.27300->byval_arg;
  this_local = mono_mb_add_local (mb, D.27301);
  D.27262 = method->klass;
  D.27270 = D.27262->image;
  clause = mono_image_alloc0 (D.27270, 24);
  clause->flags = 2;
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27302>; else goto <D.27303>;
    <D.27302>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27303>:
    D.27304 = ret != 0;
    D.27305 = (long int) D.27304;
    D.27306 = __builtin_expect (D.27305, 0);
    if (D.27306 != 0) goto <D.27307>; else goto <D.27308>;
    <D.27307>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10466, "ret == 0");
    <D.27308>:
  }
  enter_method.377 = enter_method;
  if (enter_method.377 == 0B) goto <D.27310>; else goto <D.27311>;
  <D.27310>:
  {
    struct MonoMethodDesc * desc;

    desc = mono_method_desc_new ("Monitor:Enter", 0);
    D.27312 = mono_defaults.monitor_class;
    enter_method.378 = mono_method_desc_search_in_class (desc, D.27312);
    enter_method = enter_method.378;
    enter_method.377 = enter_method;
    D.27314 = enter_method.377 == 0B;
    D.27315 = (long int) D.27314;
    D.27316 = __builtin_expect (D.27315, 0);
    if (D.27316 != 0) goto <D.27317>; else goto <D.27318>;
    <D.27317>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10473, "enter_method");
    <D.27318>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Monitor:Exit", 0);
    D.27312 = mono_defaults.monitor_class;
    exit_method.379 = mono_method_desc_search_in_class (desc, D.27312);
    exit_method = exit_method.379;
    exit_method.380 = exit_method;
    D.27321 = exit_method.380 == 0B;
    D.27322 = (long int) D.27321;
    D.27323 = __builtin_expect (D.27322, 0);
    if (D.27323 != 0) goto <D.27324>; else goto <D.27325>;
    <D.27324>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10478, "exit_method");
    <D.27325>:
    mono_method_desc_free (desc);
    desc = mono_method_desc_new ("Type:GetTypeFromHandle", 0);
    D.27326 = mono_defaults.systemtype_class;
    gettypefromhandle_method.381 = mono_method_desc_search_in_class (desc, D.27326);
    gettypefromhandle_method = gettypefromhandle_method.381;
    gettypefromhandle_method.382 = gettypefromhandle_method;
    D.27329 = gettypefromhandle_method.382 == 0B;
    D.27330 = (long int) D.27329;
    D.27331 = __builtin_expect (D.27330, 0);
    if (D.27331 != 0) goto <D.27332>; else goto <D.27333>;
    <D.27332>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10483, "gettypefromhandle_method");
    <D.27333>:
    mono_method_desc_free (desc);
  }
  <D.27311>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27334>; else goto <D.27335>;
    <D.27334>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27335>:
    D.27336 = ret != 0;
    D.27337 = (long int) D.27336;
    D.27338 = __builtin_expect (D.27337, 0);
    if (D.27338 != 0) goto <D.27339>; else goto <D.27340>;
    <D.27339>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10487, "ret == 0");
    <D.27340>:
  }
  D.27288 = method->flags;
  D.27289 = (int) D.27288;
  D.27290 = D.27289 & 16;
  if (D.27290 != 0) goto <D.27341>; else goto <D.27342>;
  <D.27341>:
  {
    int index;

    D.27262 = method->klass;
    D.27343 = mono_mb_add_data (mb, D.27262);
    index = (int) D.27343;
    D.27344 = mono_defaults.typehandle_class;
    mono_mb_add_data (mb, D.27344);
    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.27345>;
  <D.27342>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27345>:
  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.27347 = mono_mb_get_label (mb);
  D.27348 = (unsigned int) D.27347;
  clause->try_offset = D.27348;
  D.27349 = BIT_FIELD_REF <*sig, 32, 64>;
  D.27350 = D.27349 & 4194304;
  if (D.27350 != 0) goto <D.27351>; else goto <D.27352>;
  <D.27351>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27352>:
  i = 0;
  goto <D.20845>;
  <D.20844>:
  D.27349 = BIT_FIELD_REF <*sig, 32, 64>;
  D.27350 = D.27349 & 4194304;
  D.27353 = D.27350 != 0;
  D.27354 = (int) D.27353;
  D.27355 = D.27354 + i;
  D.27356 = (unsigned int) D.27355;
  mono_mb_emit_ldarg (mb, D.27356);
  i = i + 1;
  <D.20845>:
  D.27297 = sig->param_count;
  D.27298 = (int) D.27297;
  if (D.27298 > i) goto <D.20844>; else goto <D.20846>;
  <D.20846>:
  if (ctx != 0B) goto <D.27357>; else goto <D.27358>;
  <D.27357>:
  D.27359 = &container->context;
  D.27360 = mono_class_inflate_generic_method (method, D.27359);
  mono_mb_emit_managed_call (mb, D.27360, 0B);
  goto <D.27361>;
  <D.27358>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.27361>:
  D.27280 = sig->ret;
  D.27362 = mono_type_is_void (D.27280);
  if (D.27362 == 0) goto <D.27363>; else goto <D.27364>;
  <D.27363>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_stloc (mb, ret_local.376);
  <D.27364>:
  D.27365 = mono_mb_emit_branch (mb, 221);
  pos = (int) D.27365;
  D.27366 = mono_mb_get_pos (mb);
  D.27367 = (unsigned int) D.27366;
  D.27368 = clause->try_offset;
  D.27369 = D.27367 - D.27368;
  clause->try_len = D.27369;
  D.27370 = mono_mb_get_label (mb);
  D.27371 = (unsigned int) D.27370;
  clause->handler_offset = D.27371;
  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.27372 = mono_mb_get_pos (mb);
  D.27373 = (unsigned int) D.27372;
  D.27374 = clause->handler_offset;
  D.27375 = D.27373 - D.27374;
  clause->handler_len = D.27375;
  pos.384 = (unsigned int) pos;
  mono_mb_patch_branch (mb, pos.384);
  D.27280 = sig->ret;
  D.27377 = mono_type_is_void (D.27280);
  if (D.27377 == 0) goto <D.27378>; else goto <D.27379>;
  <D.27378>:
  ret_local.376 = (unsigned int) ret_local;
  mono_mb_emit_ldloc (mb, ret_local.376);
  <D.27379>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_set_clauses (mb, 1, clause);
  if (ctx != 0B) goto <D.27380>; else goto <D.27381>;
  <D.27380>:
  {
    struct MonoMethod * def;

    D.27297 = sig->param_count;
    D.27298 = (int) D.27297;
    D.27299 = D.27298 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.27299);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.27382>;
  <D.27381>:
  D.27297 = sig->param_count;
  D.27298 = (int) D.27297;
  D.27299 = D.27298 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27299);
  <D.27382>:
  mono_mb_free (mb);
  D.27252 = res;
  return D.27252;
}


check_generic_wrapper_cache (struct GHashTable * cache, struct MonoMethod * orig_method, void * key, void * def_key)
{
  unsigned int D.27384;
  unsigned int D.27385;
  _Bool D.27386;
  long int D.27387;
  long int D.27388;
  struct MonoMethod * D.27393;
  _Bool D.27398;
  long int D.27399;
  long int D.27400;
  _Bool D.27407;
  long int D.27408;
  long int D.27409;
  struct MonoMethod * res;
  struct MonoMethod * inst;
  struct MonoMethod * def;
  struct MonoGenericContext * ctx;
  struct MonoMethod * def_method;

  D.27384 = BIT_FIELD_REF <*orig_method, 32, 160>;
  D.27385 = D.27384 & 4096;
  D.27386 = D.27385 == 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", 2720, "orig_method->is_inflated");
  <D.27390>:
  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.27391>; else goto <D.27392>;
  <D.27391>:
  D.27393 = res;
  return D.27393;
  <D.27392>:
  def = mono_marshal_find_in_cache (cache, def_key);
  if (def != 0B) goto <D.27394>; else goto <D.27395>;
  <D.27394>:
  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.27396>; else goto <D.27397>;
    <D.27396>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27397>:
    D.27398 = ret != 0;
    D.27399 = (long int) D.27398;
    D.27400 = __builtin_expect (D.27399, 0);
    if (D.27400 != 0) goto <D.27401>; else goto <D.27402>;
    <D.27401>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2739, "ret == 0");
    <D.27402>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27403>; else goto <D.27404>;
  <D.27403>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27404>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27405>; else goto <D.27406>;
    <D.27405>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27406>:
    D.27407 = ret != 0;
    D.27408 = (long int) D.27407;
    D.27409 = __builtin_expect (D.27408, 0);
    if (D.27409 != 0) goto <D.27410>; else goto <D.27411>;
    <D.27410>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2745, "ret == 0");
    <D.27411>:
  }
  D.27393 = res;
  return D.27393;
  <D.27395>:
  D.27393 = 0B;
  return D.27393;
}


cache_generic_wrapper (struct GHashTable * cache, struct MonoMethod * orig_method, struct MonoMethod * def, struct MonoGenericContext * ctx, void * key)
{
  _Bool D.27415;
  long int D.27416;
  long int D.27417;
  _Bool D.27424;
  long int D.27425;
  long int D.27426;
  struct MonoMethod * D.27429;
  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.27413>; else goto <D.27414>;
    <D.27413>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27414>:
    D.27415 = ret != 0;
    D.27416 = (long int) D.27415;
    D.27417 = __builtin_expect (D.27416, 0);
    if (D.27417 != 0) goto <D.27418>; else goto <D.27419>;
    <D.27418>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2761, "ret == 0");
    <D.27419>:
  }
  res = monoeg_g_hash_table_lookup (cache, key);
  if (res == 0B) goto <D.27420>; else goto <D.27421>;
  <D.27420>:
  monoeg_g_hash_table_insert_replace (cache, key, inst, 0);
  res = inst;
  <D.27421>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27422>; else goto <D.27423>;
    <D.27422>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27423>:
    D.27424 = ret != 0;
    D.27425 = (long int) D.27424;
    D.27426 = __builtin_expect (D.27425, 0);
    if (D.27426 != 0) goto <D.27427>; else goto <D.27428>;
    <D.27427>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 2767, "ret == 0");
    <D.27428>:
  }
  D.27429 = res;
  return D.27429;
}


mono_marshal_get_unbox_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.27431;
  struct MonoImage * D.27432;
  struct GHashTable * * D.27433;
  struct MonoMethod * D.27436;
  const char * D.27437;
  unsigned int D.27438;
  unsigned int D.27439;
  _Bool D.27440;
  long int D.27441;
  long int D.27442;
  int D.27445;
  unsigned int D.27446;
  short unsigned int D.27447;
  int D.27448;
  int D.27449;
  struct MonoMethodSignature * sig;
  int i;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct GHashTable * cache;

  sig = mono_method_signature (method);
  D.27431 = method->klass;
  D.27432 = D.27431->image;
  D.27433 = &D.27432->unbox_wrapper_cache;
  cache = get_cache (D.27433, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27434>; else goto <D.27435>;
  <D.27434>:
  D.27436 = res;
  return D.27436;
  <D.27435>:
  D.27431 = method->klass;
  D.27437 = method->name;
  mb = mono_mb_new (D.27431, D.27437, 22);
  D.27438 = BIT_FIELD_REF <*sig, 32, 64>;
  D.27439 = D.27438 & 4194304;
  D.27440 = D.27439 == 0;
  D.27441 = (long int) D.27440;
  D.27442 = __builtin_expect (D.27441, 0);
  if (D.27442 != 0) goto <D.27443>; else goto <D.27444>;
  <D.27443>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 10576, "sig->hasthis");
  <D.27444>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  i = 0;
  goto <D.20857>;
  <D.20856>:
  D.27445 = i + 1;
  D.27446 = (unsigned int) D.27445;
  mono_mb_emit_ldarg (mb, D.27446);
  i = i + 1;
  <D.20857>:
  D.27447 = sig->param_count;
  D.27448 = (int) D.27447;
  if (D.27448 > i) goto <D.20856>; else goto <D.20858>;
  <D.20858>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  D.27447 = sig->param_count;
  D.27448 = (int) D.27447;
  D.27449 = D.27448 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27449);
  mono_mb_free (mb);
  D.27436 = res;
  return D.27436;
}


mono_marshal_get_virtual_stelemref (struct MonoClass * array_class)
{
  unsigned char D.27451;
  _Bool D.27452;
  long int D.27453;
  long int D.27454;
  struct MonoClass * D.27457;
  struct MonoMethod * D.27458;
  int kind;

  D.27451 = array_class->rank;
  D.27452 = D.27451 != 1;
  D.27453 = (long int) D.27452;
  D.27454 = __builtin_expect (D.27453, 0);
  if (D.27454 != 0) goto <D.27455>; else goto <D.27456>;
  <D.27455>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11083, "array_class->rank == 1");
  <D.27456>:
  D.27457 = array_class->element_class;
  kind = get_virtual_stelemref_kind (D.27457);
  D.27458 = get_virtual_stelemref_wrapper (kind);
  return D.27458;
}


get_virtual_stelemref_kind (struct MonoClass * element_class)
{
  struct MonoClass * D.27460;
  int D.27463;
  int D.27464;
  unsigned int D.27469;
  unsigned int D.27470;
  unsigned char D.27472;
  int D.27474;
  unsigned int D.27479;
  unsigned int D.27480;
  unsigned char D.27482;
  int D.27484;
  unsigned int D.27485;

  D.27460 = mono_defaults.object_class;
  if (D.27460 == element_class) goto <D.27461>; else goto <D.27462>;
  <D.27461>:
  D.27463 = 0;
  return D.27463;
  <D.27462>:
  D.27464 = is_monomorphic_array (element_class);
  if (D.27464 != 0) goto <D.27465>; else goto <D.27466>;
  <D.27465>:
  D.27463 = 1;
  return D.27463;
  <D.27466>:
  D.27469 = element_class->flags;
  D.27470 = D.27469 & 32;
  if (D.27470 != 0) goto <D.27467>; else goto <D.27471>;
  <D.27471>:
  D.27472 = element_class->byval_arg.type;
  if (D.27472 == 19) goto <D.27467>; else goto <D.27473>;
  <D.27473>:
  D.27472 = element_class->byval_arg.type;
  if (D.27472 == 30) goto <D.27467>; else goto <D.27468>;
  <D.27467>:
  D.27474 = mono_class_has_variant_generic_params (element_class);
  if (D.27474 == 0) goto <D.27475>; else goto <D.27476>;
  <D.27475>:
  D.27463 = 3;
  return D.27463;
  <D.27476>:
  <D.27468>:
  D.27479 = BIT_FIELD_REF <*element_class, 32, 160>;
  D.27480 = D.27479 & 4194304;
  if (D.27480 != 0) goto <D.27477>; else goto <D.27481>;
  <D.27481>:
  D.27482 = element_class->rank;
  if (D.27482 != 0) goto <D.27477>; else goto <D.27483>;
  <D.27483>:
  D.27484 = mono_class_has_variant_generic_params (element_class);
  if (D.27484 != 0) goto <D.27477>; else goto <D.27478>;
  <D.27477>:
  D.27463 = 4;
  return D.27463;
  <D.27478>:
  D.27469 = element_class->flags;
  D.27485 = D.27469 & 256;
  if (D.27485 != 0) goto <D.27486>; else goto <D.27487>;
  <D.27486>:
  D.27463 = 1;
  return D.27463;
  <D.27487>:
  D.27463 = 2;
  return D.27463;
}


is_monomorphic_array (struct MonoClass * klass)
{
  unsigned char D.27489;
  gboolean D.27492;
  int iftmp.385;
  unsigned int D.27497;
  unsigned int D.27498;
  unsigned int D.27500;
  unsigned int D.27501;
  struct MonoClass * element_class;

  D.27489 = klass->rank;
  if (D.27489 != 1) goto <D.27490>; else goto <D.27491>;
  <D.27490>:
  D.27492 = 0;
  return D.27492;
  <D.27491>:
  element_class = klass->element_class;
  D.27497 = element_class->flags;
  D.27498 = D.27497 & 256;
  if (D.27498 != 0) goto <D.27494>; else goto <D.27499>;
  <D.27499>:
  D.27500 = BIT_FIELD_REF <*element_class, 32, 160>;
  D.27501 = D.27500 & 8;
  if (D.27501 != 0) goto <D.27494>; else goto <D.27495>;
  <D.27494>:
  iftmp.385 = 1;
  goto <D.27496>;
  <D.27495>:
  iftmp.385 = 0;
  <D.27496>:
  D.27492 = iftmp.385;
  return D.27492;
}


get_virtual_stelemref_wrapper (int kind)
{
  struct MonoMethod * D.27503;
  struct MonoMethod * D.27506;
  const char * D.27507;
  struct MonoClass * D.27508;
  struct MonoMethodSignature * signature.386;
  struct MonoImage * D.27512;
  struct MonoClass * D.27513;
  struct MonoType * D.27514;
  struct MonoClass * D.27515;
  struct MonoType * D.27516;
  struct MonoType * D.27517;
  struct MonoType * D.27518;
  unsigned int array_slot_addr.387;
  unsigned int aklass.388;
  unsigned int vklass.389;
  struct MonoClass * D.27522;
  struct MonoType * D.27523;
  unsigned int vtable.390;
  unsigned int uiid.391;
  struct MonoMethod * D.27526;
  short unsigned int D.27529;
  short unsigned int D.27530;
  _Bool D.27533;
  long int D.27534;
  long int D.27535;
  _Bool D.27542;
  long int D.27543;
  long int D.27544;
  _Bool D.27550;
  long int D.27551;
  long int D.27552;
  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.27503 = cached_methods[kind];
      if (D.27503 != 0B) goto <D.27504>; else goto <D.27505>;
      <D.27504>:
      D.27506 = cached_methods[kind];
      return D.27506;
      <D.27505>:
      D.27507 = strelemref_wrapper_name[kind];
      name = monoeg_g_strdup_printf ("virt_stelemref_%s", D.27507);
      D.27508 = mono_defaults.object_class;
      mb = mono_mb_new (D.27508, name, 21);
      monoeg_g_free (name);
      signature.386 = signature;
      if (signature.386 == 0B) goto <D.27510>; else goto <D.27511>;
      <D.27510>:
      {
        struct MonoMethodSignature * sig;

        D.27512 = mono_defaults.corlib;
        sig = mono_metadata_signature_alloc (D.27512, 2);
        D.27513 = mono_defaults.void_class;
        D.27514 = &D.27513->byval_arg;
        sig->ret = D.27514;
        sig->hasthis = 1;
        D.27515 = mono_defaults.int_class;
        D.27516 = &D.27515->byval_arg;
        sig->params[0] = D.27516;
        D.27508 = mono_defaults.object_class;
        D.27517 = &D.27508->byval_arg;
        sig->params[1] = D.27517;
        signature = sig;
      }
      <D.27511>:
      param_names[0] = "index";
      param_names[1] = "value";
      mono_mb_set_param_names (mb, &param_names);
      switch (kind) <default: <D.20910>, case 0: <D.20904>, case 1: <D.20907>, case 2: <D.20908>, case 3: <D.20909>, case 4: <D.20906>>
      <D.20904>:
      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.20905>;
      <D.20906>:
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      aklass = mono_mb_add_local (mb, D.27516);
      D.27508 = mono_defaults.object_class;
      D.27518 = &D.27508->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27518);
      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.20905>;
      <D.20907>:
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      aklass = mono_mb_add_local (mb, D.27516);
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      vklass = mono_mb_add_local (mb, D.27516);
      D.27508 = mono_defaults.object_class;
      D.27518 = &D.27508->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27518);
      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.20905>;
      <D.20908>:
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      aklass = mono_mb_add_local (mb, D.27516);
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      vklass = mono_mb_add_local (mb, D.27516);
      D.27508 = mono_defaults.object_class;
      D.27518 = &D.27508->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27518);
      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.20905>;
      <D.20909>:
      D.27508 = mono_defaults.object_class;
      D.27518 = &D.27508->this_arg;
      array_slot_addr = mono_mb_add_local (mb, D.27518);
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      aklass = mono_mb_add_local (mb, D.27516);
      D.27515 = mono_defaults.int_class;
      D.27516 = &D.27515->byval_arg;
      vtable = mono_mb_add_local (mb, D.27516);
      D.27522 = mono_defaults.int32_class;
      D.27523 = &D.27522->byval_arg;
      uiid = mono_mb_add_local (mb, D.27523);
      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.20905>;
      <D.20910>:
      mono_mb_emit_ldarg (mb, 0);
      mono_mb_emit_ldarg (mb, 1);
      mono_mb_emit_ldarg (mb, 2);
      D.27526 = mono_marshal_get_stelemref ();
      mono_mb_emit_managed_call (mb, D.27526, 0B);
      mono_mb_emit_byte (mb, 42);
      if (1 != 0) goto <D.27527>; else goto <D.27528>;
      <D.27527>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11054, "0");
      <D.27528>:
      <D.20905>:
      signature.386 = signature;
      res = mono_mb_create_method (mb, signature.386, 4);
      D.27529 = res->flags;
      D.27530 = D.27529 | 64;
      res->flags = D.27530;
      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.27531>; else goto <D.27532>;
        <D.27531>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.27532>:
        D.27533 = ret != 0;
        D.27534 = (long int) D.27533;
        D.27535 = __builtin_expect (D.27534, 0);
        if (D.27535 != 0) goto <D.27536>; else goto <D.27537>;
        <D.27536>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11065, "ret == 0");
        <D.27537>:
      }
      D.27503 = cached_methods[kind];
      if (D.27503 == 0B) goto <D.27538>; else goto <D.27539>;
      <D.27538>:
      cached_methods[kind] = res;
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.27540>; else goto <D.27541>;
        <D.27540>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.27541>:
        D.27542 = ret != 0;
        D.27543 = (long int) D.27542;
        D.27544 = __builtin_expect (D.27543, 0);
        if (D.27544 != 0) goto <D.27545>; else goto <D.27546>;
        <D.27545>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11068, "ret == 0");
        <D.27546>:
      }
      goto <D.27547>;
      <D.27539>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.27548>; else goto <D.27549>;
        <D.27548>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.27549>:
        D.27550 = ret != 0;
        D.27551 = (long int) D.27550;
        D.27552 = __builtin_expect (D.27551, 0);
        if (D.27552 != 0) goto <D.27553>; else goto <D.27554>;
        <D.27553>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11070, "ret == 0");
        <D.27554>:
      }
      mono_free_method (res);
      <D.27547>:
      mono_mb_free (mb);
      D.27506 = cached_methods[kind];
      return D.27506;
    }
  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.27558;

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


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.27561;
  struct MonoMethod * * D.27562;
  struct MonoMethod * D.27563;
  struct MonoMethod * * D.27564;
  struct MonoMethod * * res;
  int i;

  *nwrappers = 5;
  res = monoeg_malloc0 (20);
  i = 0;
  goto <D.20924>;
  <D.20923>:
  i.394 = (unsigned int) i;
  D.27561 = i.394 * 4;
  D.27562 = res + D.27561;
  D.27563 = get_virtual_stelemref_wrapper (i);
  *D.27562 = D.27563;
  i = i + 1;
  <D.20924>:
  if (i <= 4) goto <D.20923>; else goto <D.20925>;
  <D.20925>:
  D.27564 = res;
  return D.27564;
}


mono_marshal_get_stelemref ()
{
  struct MonoMethod * ret.395;
  struct MonoMethod * D.27569;
  struct MonoClass * D.27570;
  struct MonoImage * D.27571;
  struct MonoClass * D.27572;
  struct MonoType * D.27573;
  struct MonoType * D.27574;
  struct MonoClass * D.27575;
  struct MonoType * D.27576;
  struct MonoType * D.27577;
  unsigned int array_slot_addr.396;
  unsigned int aklass.397;
  unsigned int vklass.398;
  int D.27581;
  int b4.399;
  unsigned int D.27583;
  unsigned int D.27584;
  int D.27585;
  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.27567>; else goto <D.27568>;
  <D.27567>:
  D.27569 = ret;
  return D.27569;
  <D.27568>:
  D.27570 = mono_defaults.object_class;
  mb = mono_mb_new (D.27570, "stelemref", 21);
  D.27571 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27571, 3);
  D.27572 = mono_defaults.void_class;
  D.27573 = &D.27572->byval_arg;
  sig->ret = D.27573;
  D.27570 = mono_defaults.object_class;
  D.27574 = &D.27570->byval_arg;
  sig->params[0] = D.27574;
  D.27575 = mono_defaults.int_class;
  D.27576 = &D.27575->byval_arg;
  sig->params[1] = D.27576;
  D.27570 = mono_defaults.object_class;
  D.27574 = &D.27570->byval_arg;
  sig->params[2] = D.27574;
  D.27575 = mono_defaults.int_class;
  D.27576 = &D.27575->byval_arg;
  aklass = mono_mb_add_local (mb, D.27576);
  D.27575 = mono_defaults.int_class;
  D.27576 = &D.27575->byval_arg;
  vklass = mono_mb_add_local (mb, D.27576);
  D.27570 = mono_defaults.object_class;
  D.27577 = &D.27570->this_arg;
  array_slot_addr = mono_mb_add_local (mb, D.27577);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_ldarg (mb, 1);
  D.27570 = mono_defaults.object_class;
  mono_mb_emit_op (mb, 143, D.27570);
  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.27581 = mono_mb_get_label (mb);
  copy_pos = (guint32) D.27581;
  mono_mb_patch_branch (mb, b1);
  array_slot_addr.396 = (unsigned int) array_slot_addr;
  mono_mb_emit_ldloc (mb, array_slot_addr.396);
  mono_mb_emit_ldarg (mb, 2);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_branch (mb, b2);
  mono_mb_patch_branch (mb, b3);
  mono_mb_emit_ldarg (mb, 2);
  aklass.397 = (unsigned int) aklass;
  mono_mb_emit_ldloc (mb, aklass.397);
  mono_mb_emit_icall (mb, mono_object_isinst);
  b4 = mono_mb_emit_branch (mb, 58);
  b4.399 = (int) b4;
  D.27583 = copy_pos - b4;
  D.27584 = D.27583 + 4294967292;
  D.27585 = (int) D.27584;
  mono_mb_patch_addr (mb, b4.399, D.27585);
  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.27569 = ret;
  return D.27569;
}


mono_marshal_get_gsharedvt_in_wrapper ()
{
  struct MonoMethod * ret.401;
  struct MonoMethod * D.27591;
  struct MonoClass * D.27592;
  struct MonoImage * D.27593;
  struct MonoClass * D.27594;
  struct MonoType * D.27595;
  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.27589>; else goto <D.27590>;
  <D.27589>:
  D.27591 = ret;
  return D.27591;
  <D.27590>:
  D.27592 = mono_defaults.object_class;
  mb = mono_mb_new (D.27592, "gsharedvt_in", 25);
  D.27593 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27593, 0);
  D.27594 = mono_defaults.void_class;
  D.27595 = &D.27594->byval_arg;
  sig->ret = D.27595;
  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.27591 = ret;
  return D.27591;
}


mono_marshal_get_gsharedvt_out_wrapper ()
{
  struct MonoMethod * ret.403;
  struct MonoMethod * D.27601;
  struct MonoClass * D.27602;
  struct MonoImage * D.27603;
  struct MonoClass * D.27604;
  struct MonoType * D.27605;
  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.27599>; else goto <D.27600>;
  <D.27599>:
  D.27601 = ret;
  return D.27601;
  <D.27600>:
  D.27602 = mono_defaults.object_class;
  mb = mono_mb_new (D.27602, "gsharedvt_out", 25);
  D.27603 = mono_defaults.corlib;
  sig = mono_metadata_signature_alloc (D.27603, 0);
  D.27604 = mono_defaults.void_class;
  D.27605 = &D.27604->byval_arg;
  sig->ret = D.27605;
  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.27601 = ret;
  return D.27601;
}


mono_marshal_get_array_address (int rank, int elem_size)
{
  _Bool D.27610;
  long int D.27611;
  long int D.27612;
  struct ArrayElemAddr * elem_addr_cache.405;
  unsigned int i.406;
  unsigned int D.27617;
  struct ArrayElemAddr * D.27618;
  int D.27619;
  int D.27622;
  int elem_addr_cache_next.407;
  _Bool D.27628;
  long int D.27629;
  long int D.27630;
  struct MonoMethod * D.27635;
  unsigned int rank.408;
  unsigned int D.27637;
  struct MonoImage * D.27638;
  int D.27639;
  unsigned int D.27640;
  struct MonoClass * D.27641;
  struct MonoType * D.27642;
  struct MonoClass * D.27643;
  struct MonoType * D.27644;
  int D.27645;
  struct MonoClass * D.27646;
  struct MonoType * D.27647;
  unsigned int bounds.409;
  unsigned int ind.410;
  unsigned int D.27650;
  unsigned int D.27651;
  unsigned int D.27652;
  unsigned int D.27653;
  int D.27654;
  unsigned int realidx.411;
  int D.27656;
  unsigned int D.27657;
  int * D.27658;
  unsigned int D.27659;
  int D.27660;
  int D.27661;
  unsigned int D.27662;
  unsigned int branch_pos.412;
  _Bool D.27666;
  long int D.27667;
  long int D.27668;
  int elem_addr_cache_size.413;
  unsigned int new_size.414;
  unsigned int D.27681;
  unsigned int elem_addr_cache_size.415;
  unsigned int D.27683;
  unsigned int elem_addr_cache_next.416;
  unsigned int D.27685;
  struct ArrayElemAddr * D.27686;
  int elem_addr_cache_next.417;
  unsigned int rank.418;
  unsigned int elem_size.419;
  _Bool D.27692;
  long int D.27693;
  long int D.27694;
  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.27608>; else goto <D.27609>;
    <D.27608>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27609>:
    D.27610 = ret != 0;
    D.27611 = (long int) D.27610;
    D.27612 = __builtin_expect (D.27611, 0);
    if (D.27612 != 0) goto <D.27613>; else goto <D.27614>;
    <D.27613>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11364, "ret == 0");
    <D.27614>:
  }
  i = 0;
  goto <D.20979>;
  <D.20978>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  D.27619 = D.27618->rank;
  if (D.27619 == rank) goto <D.27620>; else goto <D.27621>;
  <D.27620>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  D.27622 = D.27618->elem_size;
  if (D.27622 == elem_size) goto <D.27623>; else goto <D.27624>;
  <D.27623>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  ret = D.27618->method;
  goto <D.20977>;
  <D.27624>:
  <D.27621>:
  i = i + 1;
  <D.20979>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.20978>; else goto <D.20977>;
  <D.20977>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.27626>; else goto <D.27627>;
    <D.27626>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.27627>:
    D.27628 = ret != 0;
    D.27629 = (long int) D.27628;
    D.27630 = __builtin_expect (D.27629, 0);
    if (D.27630 != 0) goto <D.27631>; else goto <D.27632>;
    <D.27631>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11371, "ret == 0");
    <D.27632>:
  }
  if (ret != 0B) goto <D.27633>; else goto <D.27634>;
  <D.27633>:
  D.27635 = ret;
  return D.27635;
  <D.27634>:
  rank.408 = (unsigned int) rank;
  D.27637 = rank.408 * 4;
  branch_positions = monoeg_malloc0 (D.27637);
  D.27638 = mono_defaults.corlib;
  D.27639 = rank + 1;
  D.27640 = (unsigned int) D.27639;
  sig = mono_metadata_signature_alloc (D.27638, D.27640);
  D.27641 = mono_defaults.int_class;
  D.27642 = &D.27641->byval_arg;
  sig->ret = D.27642;
  D.27643 = mono_defaults.object_class;
  D.27644 = &D.27643->byval_arg;
  sig->params[0] = D.27644;
  i = 0;
  goto <D.20982>;
  <D.20981>:
  D.27645 = i + 1;
  D.27646 = mono_defaults.int32_class;
  D.27647 = &D.27646->byval_arg;
  sig->params[D.27645] = D.27647;
  i = i + 1;
  <D.20982>:
  if (i < rank) goto <D.20981>; else goto <D.20983>;
  <D.20983>:
  D.27643 = mono_defaults.object_class;
  mb = mono_mb_new (D.27643, "ElementAddr", 7);
  D.27641 = mono_defaults.int_class;
  D.27642 = &D.27641->byval_arg;
  bounds = mono_mb_add_local (mb, D.27642);
  D.27646 = mono_defaults.int32_class;
  D.27647 = &D.27646->byval_arg;
  ind = mono_mb_add_local (mb, D.27647);
  D.27646 = mono_defaults.int32_class;
  D.27647 = &D.27646->byval_arg;
  realidx = mono_mb_add_local (mb, D.27647);
  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.27650 = mono_mb_emit_branch (mb, 65);
  branch_pos = (int) D.27650;
  i = 1;
  goto <D.20985>;
  <D.20984>:
  D.27645 = i + 1;
  D.27651 = (unsigned int) D.27645;
  mono_mb_emit_ldarg (mb, D.27651);
  bounds.409 = (unsigned int) bounds;
  mono_mb_emit_ldloc (mb, bounds.409);
  i.406 = (unsigned int) i;
  D.27652 = i.406 * 8;
  D.27653 = D.27652 + 4;
  D.27654 = (int) D.27653;
  mono_mb_emit_icon (mb, D.27654);
  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.27652 = i.406 * 8;
  D.27656 = (int) D.27652;
  mono_mb_emit_icon (mb, D.27656);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 74);
  i.406 = (unsigned int) i;
  D.27657 = i.406 * 4;
  D.27658 = branch_positions + D.27657;
  D.27659 = mono_mb_emit_branch (mb, 65);
  D.27660 = (int) D.27659;
  *D.27658 = D.27660;
  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.27652 = i.406 * 8;
  D.27656 = (int) D.27652;
  mono_mb_emit_icon (mb, D.27656);
  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.20985>:
  if (i < rank) goto <D.20984>; else goto <D.20986>;
  <D.20986>:
  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.20988>;
  <D.20987>:
  i.406 = (unsigned int) i;
  D.27657 = i.406 * 4;
  D.27658 = branch_positions + D.27657;
  D.27661 = *D.27658;
  D.27662 = (unsigned int) D.27661;
  mono_mb_patch_branch (mb, D.27662);
  i = i + 1;
  <D.20988>:
  if (i < rank) goto <D.20987>; else goto <D.20989>;
  <D.20989>:
  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.27664>; else goto <D.27665>;
    <D.27664>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.27665>:
    D.27666 = ret != 0;
    D.27667 = (long int) D.27666;
    D.27668 = __builtin_expect (D.27667, 0);
    if (D.27668 != 0) goto <D.27669>; else goto <D.27670>;
    <D.27669>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 11475, "ret == 0");
    <D.27670>:
  }
  i = 0;
  goto <D.20993>;
  <D.20992>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  D.27619 = D.27618->rank;
  if (D.27619 == rank) goto <D.27671>; else goto <D.27672>;
  <D.27671>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  D.27622 = D.27618->elem_size;
  if (D.27622 == elem_size) goto <D.27673>; else goto <D.27674>;
  <D.27673>:
  elem_addr_cache.405 = elem_addr_cache;
  i.406 = (unsigned int) i;
  D.27617 = i.406 * 12;
  D.27618 = elem_addr_cache.405 + D.27617;
  ret = D.27618->method;
  cached = 1;
  goto <D.20991>;
  <D.27674>:
  <D.27672>:
  i = i + 1;
  <D.20993>:
  elem_addr_cache_next.407 = elem_addr_cache_next;
  if (i < elem_addr_cache_next.407) goto <D.20992>; else goto <D.20991>;
  <D.20991>:
  if (cached == 0) goto <D.27675>; else goto <D.27676>;
  <D.27675>:
  {
    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.27678>; else goto <D.27679>;
    <D.27678>:
    {
      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.27681 = new_size.414 * 12;
      new_array = monoeg_malloc0 (D.27681);
      elem_addr_cache.405 = elem_addr_cache;
      elem_addr_cache_size.413 = elem_addr_cache_size;
      elem_addr_cache_size.415 = (unsigned int) elem_addr_cache_size.413;
      D.27683 = elem_addr_cache_size.415 * 12;
      memcpy (new_array, elem_addr_cache.405, D.27683);
      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.27679>:
    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.27685 = elem_addr_cache_next.416 * 12;
    D.27686 = elem_addr_cache.405 + D.27685;
    D.27686->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.27685 = elem_addr_cache_next.416 * 12;
    D.27686 = elem_addr_cache.405 + D.27685;
    D.27686->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.27685 = elem_addr_cache_next.416 * 12;
    D.27686 = elem_addr_cache.405 + D.27685;
    D.27686->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.27676>:
  {
    int ret;

    ret = pthread_mutex_unlock (&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_unlock 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", 11505, "ret == 0");
    <D.27696>:
  }
  D.27635 = ret;
  return D.27635;
}


mono_marshal_get_array_accessor_wrapper (struct MonoMethod * method)
{
  struct MonoClass * D.27700;
  struct MonoImage * D.27701;
  struct GHashTable * * D.27702;
  struct MonoMethod * D.27705;
  struct MonoMethodSignature * D.27706;
  const char * D.27707;
  unsigned int D.27708;
  unsigned int D.27709;
  _Bool D.27712;
  int D.27713;
  int D.27714;
  unsigned int D.27715;
  short unsigned int D.27716;
  int D.27717;
  struct MonoGenericContext * D.27720;
  struct MonoMethod * D.27721;
  int D.27725;
  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.27698>; else goto <D.27699>;
  <D.27698>:
  cache = 0B;
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 11537);
  <D.27699>:
  D.27700 = method->klass;
  D.27701 = D.27700->image;
  D.27702 = &D.27701->array_accessor_cache;
  cache = get_cache (D.27702, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.27703>; else goto <D.27704>;
  <D.27703>:
  D.27705 = res;
  return D.27705;
  <D.27704>:
  D.27700 = method->klass;
  D.27701 = D.27700->image;
  D.27706 = mono_method_signature (method);
  sig = signature_dup (D.27701, D.27706);
  sig->pinvoke = 0;
  D.27700 = method->klass;
  D.27707 = method->name;
  mb = mono_mb_new (D.27700, D.27707, 25);
  D.27708 = BIT_FIELD_REF <*sig, 32, 64>;
  D.27709 = D.27708 & 4194304;
  if (D.27709 != 0) goto <D.27710>; else goto <D.27711>;
  <D.27710>:
  mono_mb_emit_ldarg (mb, 0);
  <D.27711>:
  i = 0;
  goto <D.21011>;
  <D.21010>:
  D.27708 = BIT_FIELD_REF <*sig, 32, 64>;
  D.27709 = D.27708 & 4194304;
  D.27712 = D.27709 != 0;
  D.27713 = (int) D.27712;
  D.27714 = D.27713 + i;
  D.27715 = (unsigned int) D.27714;
  mono_mb_emit_ldarg (mb, D.27715);
  i = i + 1;
  <D.21011>:
  D.27716 = sig->param_count;
  D.27717 = (int) D.27716;
  if (D.27717 > i) goto <D.21010>; else goto <D.21012>;
  <D.21012>:
  if (ctx != 0B) goto <D.27718>; else goto <D.27719>;
  <D.27718>:
  D.27720 = &container->context;
  D.27721 = mono_class_inflate_generic_method (method, D.27720);
  mono_mb_emit_managed_call (mb, D.27721, 0B);
  goto <D.27722>;
  <D.27719>:
  mono_mb_emit_managed_call (mb, method, 0B);
  <D.27722>:
  mono_mb_emit_byte (mb, 42);
  if (ctx != 0B) goto <D.27723>; else goto <D.27724>;
  <D.27723>:
  {
    struct MonoMethod * def;

    D.27716 = sig->param_count;
    D.27717 = (int) D.27716;
    D.27725 = D.27717 + 16;
    def = mono_mb_create_and_cache (cache, method, mb, sig, D.27725);
    res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
  }
  goto <D.27726>;
  <D.27724>:
  D.27716 = sig->param_count;
  D.27717 = (int) D.27716;
  D.27725 = D.27717 + 16;
  res = mono_mb_create_and_cache (cache, method, mb, sig, D.27725);
  info = mono_wrapper_info_create (res, 20);
  info->d.array_accessor.method = method;
  mono_marshal_set_wrapper_info (res, info);
  <D.27726>:
  mono_mb_free (mb);
  D.27705 = res;
  return D.27705;
}


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

  res = monoeg_try_malloc (size);
  if (res == 0B) goto <D.27728>; else goto <D.27729>;
  <D.27728>:
  mono_gc_out_of_memory (size);
  <D.27729>:
  D.27730 = res;
  return D.27730;
}


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


mono_marshal_free_array (void * * ptr, int size)
{
  unsigned int i.420;
  unsigned int D.27735;
  void * * D.27736;
  void * D.27737;
  int i;

  if (ptr == 0B) goto <D.27732>; else goto <D.27733>;
  <D.27732>:
  return;
  <D.27733>:
  i = 0;
  goto <D.21027>;
  <D.21026>:
  i.420 = (unsigned int) i;
  D.27735 = i.420 * 4;
  D.27736 = ptr + D.27735;
  D.27737 = *D.27736;
  if (D.27737 != 0B) goto <D.27738>; else goto <D.27739>;
  <D.27738>:
  i.420 = (unsigned int) i;
  D.27735 = i.420 * 4;
  D.27736 = ptr + D.27735;
  D.27737 = *D.27736;
  monoeg_g_free (D.27737);
  <D.27739>:
  i = i + 1;
  <D.21027>:
  if (i < size) goto <D.21026>; else goto <D.21028>;
  <D.21028>:
}


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

  if (s != 0B) goto <D.27743>; else goto <D.27744>;
  <D.27743>:
  iftmp.421 = mono_string_chars (s);
  goto <D.27745>;
  <D.27744>:
  iftmp.421 = 0B;
  <D.27745>:
  D.27741 = iftmp.421;
  return D.27741;
}


mono_marshal_set_last_error ()
{
  unsigned int last_error_tls_id.422;
  int * D.27748;
  int D.27749;
  void * D.27750;

  last_error_tls_id.422 = last_error_tls_id;
  D.27748 = __errno_location ();
  D.27749 = *D.27748;
  D.27750 = (void *) D.27749;
  mono_native_tls_set_value (last_error_tls_id.422, D.27750);
}


mono_native_tls_set_value (pthread_key_t key, void * value)
{
  int D.27751;
  int D.27752;
  _Bool D.27753;

  D.27752 = pthread_setspecific (key, value);
  D.27753 = D.27752 == 0;
  D.27751 = (int) D.27753;
  return D.27751;
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (struct MonoArray * src, gint32 start_index, void * dest, gint32 length)
{
  _Bool D.27755;
  long int D.27756;
  long int D.27757;
  _Bool D.27762;
  long int D.27763;
  long int D.27764;
  struct MonoVTable * D.27769;
  struct MonoClass * D.27770;
  unsigned char D.27771;
  struct MonoException * D.27774;
  struct MonoException * D.27777;
  struct MonoException * D.27780;
  int D.27781;
  unsigned int D.27782;
  unsigned int D.27783;
  struct MonoException * D.27786;
  double[0:] * D.27787;
  int D.27788;
  sizetype D.27789;
  int D.27790;
  unsigned int D.27791;
  int element_size;
  void * source_addr;

  D.27755 = src == 0B;
  D.27756 = (long int) D.27755;
  D.27757 = __builtin_expect (D.27756, 0);
  if (D.27757 != 0) goto <D.27758>; else goto <D.27759>;
  <D.27758>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27760>; else goto <D.27761>;
    <D.27760>:
    <D.27761>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27759>:
  D.27762 = dest == 0B;
  D.27763 = (long int) D.27762;
  D.27764 = __builtin_expect (D.27763, 0);
  if (D.27764 != 0) goto <D.27765>; else goto <D.27766>;
  <D.27765>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.27767>; else goto <D.27768>;
    <D.27767>:
    <D.27768>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.27766>:
  D.27769 = src->obj.vtable;
  D.27770 = D.27769->klass;
  D.27771 = D.27770->rank;
  if (D.27771 != 1) goto <D.27772>; else goto <D.27773>;
  <D.27772>:
  D.27774 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.27774);
  <D.27773>:
  if (start_index < 0) goto <D.27775>; else goto <D.27776>;
  <D.27775>:
  D.27777 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.27777);
  <D.27776>:
  if (length < 0) goto <D.27778>; else goto <D.27779>;
  <D.27778>:
  D.27780 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.27780);
  <D.27779>:
  D.27781 = start_index + length;
  D.27782 = (unsigned int) D.27781;
  D.27783 = mono_array_length (src);
  if (D.27782 > D.27783) goto <D.27784>; else goto <D.27785>;
  <D.27784>:
  D.27786 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.27786);
  <D.27785>:
  D.27769 = src->obj.vtable;
  D.27770 = D.27769->klass;
  element_size = mono_array_element_size (D.27770);
  D.27787 = &src->vector;
  D.27788 = element_size * start_index;
  D.27789 = (sizetype) D.27788;
  source_addr = D.27787 + D.27789;
  D.27790 = length * element_size;
  D.27791 = (unsigned int) D.27790;
  memcpy (dest, source_addr, D.27791);
}


ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (void * src, gint32 start_index, struct MonoArray * dest, gint32 length)
{
  _Bool D.27792;
  long int D.27793;
  long int D.27794;
  _Bool D.27799;
  long int D.27800;
  long int D.27801;
  struct MonoVTable * D.27806;
  struct MonoClass * D.27807;
  unsigned char D.27808;
  struct MonoException * D.27811;
  struct MonoException * D.27814;
  struct MonoException * D.27817;
  int D.27818;
  unsigned int D.27819;
  unsigned int D.27820;
  struct MonoException * D.27823;
  double[0:] * D.27824;
  int D.27825;
  sizetype D.27826;
  int D.27827;
  unsigned int D.27828;
  int element_size;
  void * dest_addr;

  D.27792 = src == 0B;
  D.27793 = (long int) D.27792;
  D.27794 = __builtin_expect (D.27793, 0);
  if (D.27794 != 0) goto <D.27795>; else goto <D.27796>;
  <D.27795>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27797>; else goto <D.27798>;
    <D.27797>:
    <D.27798>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27796>:
  D.27799 = dest == 0B;
  D.27800 = (long int) D.27799;
  D.27801 = __builtin_expect (D.27800, 0);
  if (D.27801 != 0) goto <D.27802>; else goto <D.27803>;
  <D.27802>:
  {
    struct MonoException * ex;

    if (dest != 0B) goto <D.27804>; else goto <D.27805>;
    <D.27804>:
    <D.27805>:
    ex = mono_get_exception_argument_null ("dest");
    mono_raise_exception (ex);
  }
  <D.27803>:
  D.27806 = dest->obj.vtable;
  D.27807 = D.27806->klass;
  D.27808 = D.27807->rank;
  if (D.27808 != 1) goto <D.27809>; else goto <D.27810>;
  <D.27809>:
  D.27811 = mono_get_exception_argument ("array", "array is multi-dimensional");
  mono_raise_exception (D.27811);
  <D.27810>:
  if (start_index < 0) goto <D.27812>; else goto <D.27813>;
  <D.27812>:
  D.27814 = mono_get_exception_argument ("startIndex", "Must be >= 0");
  mono_raise_exception (D.27814);
  <D.27813>:
  if (length < 0) goto <D.27815>; else goto <D.27816>;
  <D.27815>:
  D.27817 = mono_get_exception_argument ("length", "Must be >= 0");
  mono_raise_exception (D.27817);
  <D.27816>:
  D.27818 = start_index + length;
  D.27819 = (unsigned int) D.27818;
  D.27820 = mono_array_length (dest);
  if (D.27819 > D.27820) goto <D.27821>; else goto <D.27822>;
  <D.27821>:
  D.27823 = mono_get_exception_argument ("length", "start_index + length > array length");
  mono_raise_exception (D.27823);
  <D.27822>:
  D.27806 = dest->obj.vtable;
  D.27807 = D.27806->klass;
  element_size = mono_array_element_size (D.27807);
  D.27824 = &dest->vector;
  D.27825 = element_size * start_index;
  D.27826 = (sizetype) D.27825;
  dest_addr = D.27824 + D.27826;
  D.27827 = length * element_size;
  D.27828 = (unsigned int) D.27827;
  memcpy (dest_addr, src, D.27828);
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char * ptr)
{
  struct MonoString * D.27831;
  struct MonoDomain * D.27832;

  if (ptr == 0B) goto <D.27829>; else goto <D.27830>;
  <D.27829>:
  D.27831 = 0B;
  return D.27831;
  <D.27830>:
  D.27832 = mono_domain_get ();
  D.27831 = mono_string_new (D.27832, ptr);
  return D.27831;
}


ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char * ptr, gint32 len)
{
  struct MonoException * D.27836;
  struct MonoString * D.27837;
  struct MonoDomain * D.27838;
  unsigned int len.423;

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


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

  domain = mono_domain_get ();
  len = 0;
  t = ptr;
  if (ptr == 0B) goto <D.27841>; else goto <D.27842>;
  <D.27841>:
  D.27843 = 0B;
  return D.27843;
  <D.27842>:
  goto <D.21076>;
  <D.21075>:
  len = len + 1;
  <D.21076>:
  t.424 = t;
  t = t.424 + 2;
  D.27845 = *t.424;
  if (D.27845 != 0) goto <D.21075>; else goto <D.21077>;
  <D.21077>:
  D.27843 = mono_string_new_utf16 (domain, ptr, len);
  return D.27843;
}


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

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


ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error ()
{
  guint32 D.27852;
  unsigned int last_error_tls_id.425;
  void * D.27854;

  last_error_tls_id.425 = last_error_tls_id;
  D.27854 = pthread_getspecific (last_error_tls_id.425);
  D.27852 = (guint32) D.27854;
  return D.27852;
}


ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (struct MonoReflectionType * rtype)
{
  _Bool D.27856;
  long int D.27857;
  long int D.27858;
  int D.27863;
  struct MonoException * D.27866;
  unsigned int D.27867;
  const char * D.27870;
  guint32 D.27871;
  int D.27872;
  struct MonoClass * klass;
  struct MonoType * type;
  guint32 layout;

  D.27856 = rtype == 0B;
  D.27857 = (long int) D.27856;
  D.27858 = __builtin_expect (D.27857, 0);
  if (D.27858 != 0) goto <D.27859>; else goto <D.27860>;
  <D.27859>:
  {
    struct MonoException * ex;

    if (rtype != 0B) goto <D.27861>; else goto <D.27862>;
    <D.27861>:
    <D.27862>:
    ex = mono_get_exception_argument_null ("rtype");
    mono_raise_exception (ex);
  }
  <D.27860>:
  type = rtype->type;
  klass = mono_class_from_mono_type (type);
  D.27863 = mono_class_init (klass);
  if (D.27863 == 0) goto <D.27864>; else goto <D.27865>;
  <D.27864>:
  D.27866 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.27866);
  <D.27865>:
  D.27867 = klass->flags;
  layout = D.27867 & 24;
  if (layout == 0) goto <D.27868>; else goto <D.27869>;
  <D.27868>:
  {
    gchar * msg;
    struct MonoException * exc;

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


ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (struct MonoObject * obj, void * dst, MonoBoolean delete_old)
{
  _Bool D.27874;
  long int D.27875;
  long int D.27876;
  void * dst.426;
  _Bool D.27882;
  long int D.27883;
  long int D.27884;
  struct MonoVTable * D.27889;
  struct MonoClass * D.27890;
  struct MonoMethod * method;
  void * pa[3];

  try
    {
      D.27874 = obj == 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 (obj != 0B) goto <D.27879>; else goto <D.27880>;
        <D.27879>:
        <D.27880>:
        ex = mono_get_exception_argument_null ("obj");
        mono_raise_exception (ex);
      }
      <D.27878>:
      dst.426 = dst;
      D.27882 = dst.426 == 0B;
      D.27883 = (long int) D.27882;
      D.27884 = __builtin_expect (D.27883, 0);
      if (D.27884 != 0) goto <D.27885>; else goto <D.27886>;
      <D.27885>:
      {
        struct MonoException * ex;

        dst.426 = dst;
        if (dst.426 != 0B) goto <D.27887>; else goto <D.27888>;
        <D.27887>:
        <D.27888>:
        ex = mono_get_exception_argument_null ("dst");
        mono_raise_exception (ex);
      }
      <D.27886>:
      D.27889 = obj->vtable;
      D.27890 = D.27889->klass;
      method = mono_marshal_get_struct_to_ptr (D.27890);
      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.27891;
  long int D.27892;
  long int D.27893;
  _Bool D.27898;
  long int D.27899;
  long int D.27900;
  struct MonoVTable * D.27905;
  struct MonoClass * D.27906;
  struct MonoType * D.27907;
  unsigned char D.27908;
  struct MonoType * t;

  D.27891 = src == 0B;
  D.27892 = (long int) D.27891;
  D.27893 = __builtin_expect (D.27892, 0);
  if (D.27893 != 0) goto <D.27894>; else goto <D.27895>;
  <D.27894>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27896>; else goto <D.27897>;
    <D.27896>:
    <D.27897>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27895>:
  D.27898 = dst == 0B;
  D.27899 = (long int) D.27898;
  D.27900 = __builtin_expect (D.27899, 0);
  if (D.27900 != 0) goto <D.27901>; else goto <D.27902>;
  <D.27901>:
  {
    struct MonoException * ex;

    if (dst != 0B) goto <D.27903>; else goto <D.27904>;
    <D.27903>:
    <D.27904>:
    ex = mono_get_exception_argument_null ("dst");
    mono_raise_exception (ex);
  }
  <D.27902>:
  D.27905 = dst->vtable;
  D.27906 = D.27905->klass;
  D.27907 = mono_class_get_type (D.27906);
  t = mono_type_get_underlying_type (D.27907);
  D.27908 = t->type;
  if (D.27908 == 17) goto <D.27909>; else goto <D.27910>;
  <D.27909>:
  {
    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.27910>:
  ptr_to_structure (src, dst);
}


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

  try
    {
      D.27912 = dst->vtable;
      D.27913 = D.27912->klass;
      method = mono_marshal_get_ptr_to_struct (D.27913);
      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.27916;
  _Bool D.27917;
  long int D.27918;
  long int D.27919;
  struct MonoType * D.27924;
  int D.27925;
  struct MonoException * D.27928;
  struct MonoClass * klass;
  struct MonoDomain * domain;
  struct MonoObject * res;

  domain = mono_domain_get ();
  if (src == 0B) goto <D.27914>; else goto <D.27915>;
  <D.27914>:
  D.27916 = 0B;
  return D.27916;
  <D.27915>:
  D.27917 = type == 0B;
  D.27918 = (long int) D.27917;
  D.27919 = __builtin_expect (D.27918, 0);
  if (D.27919 != 0) goto <D.27920>; else goto <D.27921>;
  <D.27920>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.27922>; else goto <D.27923>;
    <D.27922>:
    <D.27923>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.27921>:
  D.27924 = type->type;
  klass = mono_class_from_mono_type (D.27924);
  D.27925 = mono_class_init (klass);
  if (D.27925 == 0) goto <D.27926>; else goto <D.27927>;
  <D.27926>:
  D.27928 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.27928);
  <D.27927>:
  res = mono_object_new (domain, klass);
  ptr_to_structure (src, res);
  D.27916 = res;
  return D.27916;
}


ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (struct MonoReflectionType * type, struct MonoString * field_name)
{
  _Bool D.27930;
  long int D.27931;
  long int D.27932;
  _Bool D.27937;
  long int D.27938;
  long int D.27939;
  struct MonoType * D.27944;
  int D.27945;
  struct MonoException * D.27948;
  struct MonoType * D.27949;
  short unsigned int D.27950;
  int D.27951;
  int D.27952;
  int D.21149;
  const char * D.27955;
  const char * D.27963;
  int D.27964;
  unsigned int D.27965;
  struct MonoMarshalType * info;
  struct MonoClass * klass;
  char * fname;
  int match_index;

  match_index = -1;
  D.27930 = type == 0B;
  D.27931 = (long int) D.27930;
  D.27932 = __builtin_expect (D.27931, 0);
  if (D.27932 != 0) goto <D.27933>; else goto <D.27934>;
  <D.27933>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.27935>; else goto <D.27936>;
    <D.27935>:
    <D.27936>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.27934>:
  D.27937 = field_name == 0B;
  D.27938 = (long int) D.27937;
  D.27939 = __builtin_expect (D.27938, 0);
  if (D.27939 != 0) goto <D.27940>; else goto <D.27941>;
  <D.27940>:
  {
    struct MonoException * ex;

    if (field_name != 0B) goto <D.27942>; else goto <D.27943>;
    <D.27942>:
    <D.27943>:
    ex = mono_get_exception_argument_null ("field_name");
    mono_raise_exception (ex);
  }
  <D.27941>:
  fname = mono_string_to_utf8 (field_name);
  D.27944 = type->type;
  klass = mono_class_from_mono_type (D.27944);
  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>:
  goto <D.21153>;
  <D.21152>:
  {
    struct MonoClassField * field;
    int i;
    void * iter;

    try
      {
        i = 0;
        iter = 0B;
        goto <D.21140>;
        <D.21151>:
        D.27949 = field->type;
        D.27950 = D.27949->attrs;
        D.27951 = (int) D.27950;
        D.27952 = D.27951 & 16;
        if (D.27952 != 0) goto <D.27953>; else goto <D.27954>;
        <D.27953>:
        // predicted unlikely by continue predictor.
        goto <D.21140>;
        <D.27954>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.27955 = mono_field_get_name (field);
          D.21149 = __builtin_strcmp (fname, D.27955);
        }
        if (D.21149 == 0) goto <D.27956>; else goto <D.27957>;
        <D.27956>:
        match_index = i;
        goto <D.21150>;
        <D.27957>:
        i = i + 1;
        <D.21140>:
        field = mono_class_get_fields (klass, &iter);
        if (field != 0B) goto <D.21151>; else goto <D.21150>;
        <D.21150>:
        if (match_index == -1) goto <D.27958>; else goto <D.27959>;
        <D.27958>:
        klass = klass->parent;
        <D.27959>:
      }
    finally
      {
        iter = {CLOBBER};
      }
  }
  <D.21153>:
  if (klass != 0B) goto <D.27960>; else goto <D.21154>;
  <D.27960>:
  if (match_index == -1) goto <D.21152>; else goto <D.21154>;
  <D.21154>:
  monoeg_g_free (fname);
  if (match_index == -1) goto <D.27961>; else goto <D.27962>;
  <D.27961>:
  {
    struct MonoException * exc;
    gchar * tmp;

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (struct MonoString * string)
{
  void * D.27971;
  int D.27972;
  int D.27973;
  int D.27974;
  unsigned int D.27975;
  mono_unichar2 * D.27976;
  int D.27977;
  int D.27978;
  unsigned int D.27979;
  int D.27980;
  unsigned int D.27981;
  unsigned int D.27982;
  gunichar2 * D.27983;

  if (string == 0B) goto <D.27969>; else goto <D.27970>;
  <D.27969>:
  D.27971 = 0B;
  return D.27971;
  <D.27970>:
  {
    gunichar2 * res;

    D.27972 = mono_string_length (string);
    D.27973 = D.27972 + 1;
    D.27974 = D.27973 * 2;
    D.27975 = (unsigned int) D.27974;
    res = monoeg_malloc (D.27975);
    D.27976 = mono_string_chars (string);
    D.27977 = mono_string_length (string);
    D.27978 = D.27977 * 2;
    D.27979 = (unsigned int) D.27978;
    memcpy (res, D.27976, D.27979);
    D.27980 = mono_string_length (string);
    D.27981 = (unsigned int) D.27980;
    D.27982 = D.27981 * 2;
    D.27983 = res + D.27982;
    *D.27983 = 0;
    D.27971 = res;
    return D.27971;
  }
}


ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (void * src, struct MonoReflectionType * type)
{
  _Bool D.27985;
  long int D.27986;
  long int D.27987;
  _Bool D.27992;
  long int D.27993;
  long int D.27994;
  struct MonoType * D.27999;
  int D.28000;
  struct MonoException * D.28003;
  struct MonoClass * klass;

  D.27985 = src == 0B;
  D.27986 = (long int) D.27985;
  D.27987 = __builtin_expect (D.27986, 0);
  if (D.27987 != 0) goto <D.27988>; else goto <D.27989>;
  <D.27988>:
  {
    struct MonoException * ex;

    if (src != 0B) goto <D.27990>; else goto <D.27991>;
    <D.27990>:
    <D.27991>:
    ex = mono_get_exception_argument_null ("src");
    mono_raise_exception (ex);
  }
  <D.27989>:
  D.27992 = type == 0B;
  D.27993 = (long int) D.27992;
  D.27994 = __builtin_expect (D.27993, 0);
  if (D.27994 != 0) goto <D.27995>; else goto <D.27996>;
  <D.27995>:
  {
    struct MonoException * ex;

    if (type != 0B) goto <D.27997>; else goto <D.27998>;
    <D.27997>:
    <D.27998>:
    ex = mono_get_exception_argument_null ("type");
    mono_raise_exception (ex);
  }
  <D.27996>:
  D.27999 = type->type;
  klass = mono_class_from_mono_type (D.27999);
  D.28000 = mono_class_init (klass);
  if (D.28000 == 0) goto <D.28001>; else goto <D.28002>;
  <D.28001>:
  D.28003 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28003);
  <D.28002>:
  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.28010;
  void * res;

  if (size == 0) goto <D.28004>; else goto <D.28005>;
  <D.28004>:
  size = 4;
  <D.28005>:
  size.427 = (unsigned int) size;
  res = monoeg_try_malloc (size.427);
  if (res == 0B) goto <D.28007>; else goto <D.28008>;
  <D.28007>:
  size.428 = (unsigned int) size;
  mono_gc_out_of_memory (size.428);
  <D.28008>:
  D.28010 = res;
  return D.28010;
}


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

  if (ptr == 0B) goto <D.28012>; else goto <D.28013>;
  <D.28012>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  D.28015 = 0B;
  return D.28015;
  <D.28013>:
  size.430 = (unsigned int) size;
  res = monoeg_try_realloc (ptr, size.430);
  if (res == 0B) goto <D.28017>; else goto <D.28018>;
  <D.28017>:
  size.429 = (unsigned int) size;
  mono_gc_out_of_memory (size.429);
  <D.28018>:
  D.28015 = res;
  return D.28015;
}


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


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

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


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

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


ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (struct MonoArray * arrayobj, int index)
{
  void * D.28026;
  double[0:] * D.28027;
  struct MonoVTable * D.28028;
  struct MonoClass * D.28029;
  int D.28030;
  int D.28031;
  sizetype D.28032;

  D.28027 = &arrayobj->vector;
  D.28028 = arrayobj->obj.vtable;
  D.28029 = D.28028->klass;
  D.28030 = mono_array_element_size (D.28029);
  D.28031 = D.28030 * index;
  D.28032 = (sizetype) D.28031;
  D.28026 = D.28027 + D.28032;
  return D.28026;
}


ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void * ftn, struct MonoReflectionType * type)
{
  struct MonoType * D.28034;
  int D.28035;
  struct MonoException * D.28038;
  struct MonoDelegate * D.28039;
  struct MonoClass * klass;

  D.28034 = type->type;
  klass = mono_type_get_class (D.28034);
  D.28035 = mono_class_init (klass);
  if (D.28035 == 0) goto <D.28036>; else goto <D.28037>;
  <D.28036>:
  D.28038 = mono_class_get_exception_for_failure (klass);
  mono_raise_exception (D.28038);
  <D.28037>:
  D.28039 = mono_ftnptr_to_delegate (klass, ftn);
  return D.28039;
}


mono_marshal_load_type_info (struct MonoClass * klass)
{
  _Bool D.28041;
  long int D.28042;
  long int D.28043;
  struct MonoMarshalType * D.28046;
  struct MonoMarshalType * D.28049;
  unsigned int D.28050;
  unsigned int D.28051;
  int D.28056;
  _Bool D.28057;
  long int D.28058;
  long int D.28059;
  unsigned int load_type_info_tls_id.433;
  struct MonoType * D.28063;
  short unsigned int D.28064;
  int D.28065;
  int D.28066;
  int D.28069;
  int D.21251;
  int iftmp.434;
  int D.21250;
  const char[9] * D.28075;
  unsigned char D.28076;
  int D.28077;
  unsigned char D.28078;
  int D.28079;
  const unsigned char * D.28084;
  unsigned char D.28085;
  int D.28086;
  const unsigned char * D.28087;
  unsigned char D.28088;
  int D.28089;
  const unsigned char * D.28094;
  unsigned char D.28095;
  int D.28096;
  const unsigned char * D.28097;
  unsigned char D.28098;
  int D.28099;
  const unsigned char * D.28104;
  unsigned char D.28105;
  int D.28106;
  const unsigned char * D.28107;
  unsigned char D.28108;
  int D.28109;
  const char * D.28111;
  unsigned int D.28114;
  struct MonoImage * D.28115;
  unsigned int count.435;
  unsigned int D.28117;
  unsigned int D.28118;
  unsigned int count.436;
  unsigned int D.28120;
  struct MonoClass * D.28121;
  unsigned int native_size.437;
  unsigned int parent_size.438;
  unsigned int native_size.439;
  guint32 iftmp.440;
  unsigned int D.28128;
  <unnamed-unsigned:4> D.28131;
  int D.21266;
  int iftmp.441;
  int D.21265;
  unsigned char D.28140;
  int D.28141;
  const unsigned char * D.28146;
  unsigned char D.28147;
  int D.28148;
  const unsigned char * D.28153;
  unsigned char D.28154;
  int D.28155;
  const unsigned char * D.28160;
  unsigned char D.28161;
  int D.28162;
  const char * D.28164;
  int D.28167;
  unsigned int D.28170;
  unsigned int D.28171;
  unsigned int D.28172;
  struct MonoMarshalSpec * * D.28173;
  int D.28174;
  int D.28177;
  int D.21275;
  int iftmp.442;
  int D.21274;
  const char[10] * D.28183;
  unsigned char D.28184;
  int D.28185;
  unsigned char D.28186;
  int D.28187;
  const unsigned char * D.28192;
  unsigned char D.28193;
  int D.28194;
  const unsigned char * D.28195;
  unsigned char D.28196;
  int D.28197;
  const unsigned char * D.28202;
  unsigned char D.28203;
  int D.28204;
  const unsigned char * D.28205;
  unsigned char D.28206;
  int D.28207;
  const unsigned char * D.28212;
  unsigned char D.28213;
  int D.28214;
  const unsigned char * D.28215;
  unsigned char D.28216;
  int D.28217;
  const char * D.28219;
  struct MonoMarshalSpec * D.28222;
  <unnamed-unsigned:1> D.28223;
  int D.28224;
  guint32 iftmp.443;
  unsigned int D.28228;
  unsigned int align.444;
  unsigned int D.28231;
  unsigned int D.28232;
  unsigned int D.28233;
  unsigned int D.28234;
  unsigned int D.28235;
  unsigned int D.28236;
  unsigned int size.445;
  unsigned int D.28238;
  int D.28239;
  unsigned int D.28240;
  unsigned int D.28241;
  unsigned int D.28242;
  unsigned int D.28246;
  unsigned int D.28254;
  unsigned int D.28255;
  unsigned int D.28258;
  unsigned int D.28259;
  unsigned int D.28260;
  unsigned int D.28261;
  int D.28262;
  unsigned int D.28263;
  unsigned char D.28266;
  struct MonoClass * D.28269;
  int D.28270;
  _Bool D.28275;
  long int D.28276;
  long int D.28277;
  _Bool D.28284;
  long int D.28285;
  long int D.28286;
  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.28041 = klass == 0B;
      D.28042 = (long int) D.28041;
      D.28043 = __builtin_expect (D.28042, 0);
      if (D.28043 != 0) goto <D.28044>; else goto <D.28045>;
      <D.28044>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12208, "klass != NULL");
      <D.28045>:
      D.28046 = klass->marshal_info;
      if (D.28046 != 0B) goto <D.28047>; else goto <D.28048>;
      <D.28047>:
      D.28049 = klass->marshal_info;
      return D.28049;
      <D.28048>:
      D.28050 = BIT_FIELD_REF <*klass, 32, 160>;
      D.28051 = D.28050 & 1;
      if (D.28051 == 0) goto <D.28052>; else goto <D.28053>;
      <D.28052>:
      mono_class_init (klass);
      <D.28053>:
      D.28046 = klass->marshal_info;
      if (D.28046 != 0B) goto <D.28054>; else goto <D.28055>;
      <D.28054>:
      D.28049 = klass->marshal_info;
      return D.28049;
      <D.28055>:
      D.28056 = mono_marshal_is_loading_type_info (klass);
      D.28057 = D.28056 != 0;
      D.28058 = (long int) D.28057;
      D.28059 = __builtin_expect (D.28058, 0);
      if (D.28059 != 0) goto <D.28060>; else goto <D.28061>;
      <D.28060>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12223, "!mono_marshal_is_loading_type_info (klass)");
      <D.28061>:
      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.21242>;
      <D.21252>:
      D.28063 = field->type;
      D.28064 = D.28063->attrs;
      D.28065 = (int) D.28064;
      D.28066 = D.28065 & 16;
      if (D.28066 != 0) goto <D.28067>; else goto <D.28068>;
      <D.28067>:
      // predicted unlikely by continue predictor.
      goto <D.21242>;
      <D.28068>:
      D.28063 = field->type;
      D.28064 = D.28063->attrs;
      D.28065 = (int) D.28064;
      D.28069 = D.28065 & 1536;
      if (D.28069 != 0) goto <D.28070>; else goto <D.28071>;
      <D.28070>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_field_get_name (field);
          D.28075 = "_Deleted";
          D.28076 = MEM[(const unsigned char *)D.28075];
          D.28077 = (int) D.28076;
          D.28078 = *__s2;
          D.28079 = (int) D.28078;
          __result = D.28077 - D.28079;
          {
            if (__s2_len != 0) goto <D.28080>; else goto <D.28081>;
            <D.28080>:
            if (__result == 0) goto <D.28082>; else goto <D.28083>;
            <D.28082>:
            D.28084 = &MEM[(void *)"_Deleted" + 1B];
            D.28085 = *D.28084;
            D.28086 = (int) D.28085;
            D.28087 = __s2 + 1;
            D.28088 = *D.28087;
            D.28089 = (int) D.28088;
            __result = D.28086 - D.28089;
            if (__s2_len > 1) goto <D.28090>; else goto <D.28091>;
            <D.28090>:
            if (__result == 0) goto <D.28092>; else goto <D.28093>;
            <D.28092>:
            D.28094 = &MEM[(void *)"_Deleted" + 2B];
            D.28095 = *D.28094;
            D.28096 = (int) D.28095;
            D.28097 = __s2 + 2;
            D.28098 = *D.28097;
            D.28099 = (int) D.28098;
            __result = D.28096 - D.28099;
            if (__s2_len > 2) goto <D.28100>; else goto <D.28101>;
            <D.28100>:
            if (__result == 0) goto <D.28102>; else goto <D.28103>;
            <D.28102>:
            D.28104 = &MEM[(void *)"_Deleted" + 3B];
            D.28105 = *D.28104;
            D.28106 = (int) D.28105;
            D.28107 = __s2 + 3;
            D.28108 = *D.28107;
            D.28109 = (int) D.28108;
            __result = D.28106 - D.28109;
            <D.28103>:
            <D.28101>:
            <D.28093>:
            <D.28091>:
            <D.28083>:
            <D.28081>:
          }
          D.21250 = __result;
        }
        iftmp.434 = -D.21250;
        goto <D.28110>;
        <D.28074>:
        D.28111 = mono_field_get_name (field);
        iftmp.434 = __builtin_strcmp (D.28111, "_Deleted");
        <D.28110>:
        D.21251 = iftmp.434;
      }
      if (D.21251 == 0) goto <D.28112>; else goto <D.28113>;
      <D.28112>:
      // predicted unlikely by continue predictor.
      goto <D.21242>;
      <D.28113>:
      <D.28071>:
      count = count + 1;
      <D.21242>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21252>; else goto <D.21253>;
      <D.21253>:
      D.28114 = klass->flags;
      layout = D.28114 & 24;
      D.28115 = klass->image;
      count.435 = (unsigned int) count;
      D.28117 = count.435 * 12;
      D.28118 = D.28117 + 20;
      info = mono_image_alloc0 (D.28115, D.28118);
      count.436 = (unsigned int) count;
      info->num_fields = count.436;
      D.28115 = klass->image;
      D.28120 = klass->type_token;
      mono_metadata_packing_from_typedef (D.28115, D.28120, 0B, &native_size);
      D.28121 = klass->parent;
      if (D.28121 != 0B) goto <D.28122>; else goto <D.28123>;
      <D.28122>:
      {
        int parent_size;

        D.28121 = klass->parent;
        parent_size = mono_class_native_size (D.28121, 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.28123>:
      D.28050 = BIT_FIELD_REF <*klass, 32, 160>;
      D.28128 = D.28050 & 983040;
      if (D.28128 != 0) goto <D.28129>; else goto <D.28130>;
      <D.28129>:
      D.28131 = klass->packing_size;
      iftmp.440 = (guint32) D.28131;
      goto <D.28132>;
      <D.28130>:
      iftmp.440 = 8;
      <D.28132>:
      packing = iftmp.440;
      iter = 0B;
      j = 0;
      goto <D.21257>;
      <D.21280>:
      {
        int size;
        guint32 align;

        try
          {
            D.28063 = field->type;
            D.28064 = D.28063->attrs;
            D.28065 = (int) D.28064;
            D.28066 = D.28065 & 16;
            if (D.28066 != 0) goto <D.28133>; else goto <D.28134>;
            <D.28133>:
            // predicted unlikely by continue predictor.
            goto <D.21257>;
            <D.28134>:
            D.28063 = field->type;
            D.28064 = D.28063->attrs;
            D.28065 = (int) D.28064;
            D.28069 = D.28065 & 1536;
            if (D.28069 != 0) goto <D.28135>; else goto <D.28136>;
            <D.28135>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28075 = "_Deleted";
                D.28076 = MEM[(const unsigned char *)D.28075];
                D.28077 = (int) D.28076;
                D.28140 = *__s2;
                D.28141 = (int) D.28140;
                __result = D.28077 - D.28141;
                {
                  if (__s2_len != 0) goto <D.28142>; else goto <D.28143>;
                  <D.28142>:
                  if (__result == 0) goto <D.28144>; else goto <D.28145>;
                  <D.28144>:
                  D.28084 = &MEM[(void *)"_Deleted" + 1B];
                  D.28085 = *D.28084;
                  D.28086 = (int) D.28085;
                  D.28146 = __s2 + 1;
                  D.28147 = *D.28146;
                  D.28148 = (int) D.28147;
                  __result = D.28086 - D.28148;
                  if (__s2_len > 1) goto <D.28149>; else goto <D.28150>;
                  <D.28149>:
                  if (__result == 0) goto <D.28151>; else goto <D.28152>;
                  <D.28151>:
                  D.28094 = &MEM[(void *)"_Deleted" + 2B];
                  D.28095 = *D.28094;
                  D.28096 = (int) D.28095;
                  D.28153 = __s2 + 2;
                  D.28154 = *D.28153;
                  D.28155 = (int) D.28154;
                  __result = D.28096 - D.28155;
                  if (__s2_len > 2) goto <D.28156>; else goto <D.28157>;
                  <D.28156>:
                  if (__result == 0) goto <D.28158>; else goto <D.28159>;
                  <D.28158>:
                  D.28104 = &MEM[(void *)"_Deleted" + 3B];
                  D.28105 = *D.28104;
                  D.28106 = (int) D.28105;
                  D.28160 = __s2 + 3;
                  D.28161 = *D.28160;
                  D.28162 = (int) D.28161;
                  __result = D.28106 - D.28162;
                  <D.28159>:
                  <D.28157>:
                  <D.28152>:
                  <D.28150>:
                  <D.28145>:
                  <D.28143>:
                }
                D.21265 = __result;
              }
              iftmp.441 = -D.21265;
              goto <D.28163>;
              <D.28139>:
              D.28164 = mono_field_get_name (field);
              iftmp.441 = __builtin_strcmp (D.28164, "_Deleted");
              <D.28163>:
              D.21266 = iftmp.441;
            }
            if (D.21266 == 0) goto <D.28165>; else goto <D.28166>;
            <D.28165>:
            // predicted unlikely by continue predictor.
            goto <D.21257>;
            <D.28166>:
            <D.28136>:
            D.28063 = field->type;
            D.28064 = D.28063->attrs;
            D.28065 = (int) D.28064;
            D.28167 = D.28065 & 4096;
            if (D.28167 != 0) goto <D.28168>; else goto <D.28169>;
            <D.28168>:
            D.28115 = klass->image;
            D.28170 = mono_class_get_field_token (field);
            D.28171 = D.28170 & 16777215;
            D.28172 = D.28171 + 4294967295;
            D.28173 = &info->fields[j].mspec;
            mono_metadata_field_info_with_mempool (D.28115, D.28172, 0B, 0B, D.28173);
            <D.28169>:
            info->fields[j].field = field;
            D.28174 = mono_class_num_fields (klass);
            if (D.28174 == 1) goto <D.28175>; else goto <D.28176>;
            <D.28175>:
            D.28177 = klass->instance_size;
            if (D.28177 == 8) goto <D.28178>; else goto <D.28179>;
            <D.28178>:
            {
              size_t __s1_len;
              size_t __s2_len;

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

                __s2 = mono_field_get_name (field);
                D.28183 = "$PRIVATE$";
                D.28184 = MEM[(const unsigned char *)D.28183];
                D.28185 = (int) D.28184;
                D.28186 = *__s2;
                D.28187 = (int) D.28186;
                __result = D.28185 - D.28187;
                {
                  if (__s2_len != 0) goto <D.28188>; else goto <D.28189>;
                  <D.28188>:
                  if (__result == 0) goto <D.28190>; else goto <D.28191>;
                  <D.28190>:
                  D.28192 = &MEM[(void *)"$PRIVATE$" + 1B];
                  D.28193 = *D.28192;
                  D.28194 = (int) D.28193;
                  D.28195 = __s2 + 1;
                  D.28196 = *D.28195;
                  D.28197 = (int) D.28196;
                  __result = D.28194 - D.28197;
                  if (__s2_len > 1) goto <D.28198>; else goto <D.28199>;
                  <D.28198>:
                  if (__result == 0) goto <D.28200>; else goto <D.28201>;
                  <D.28200>:
                  D.28202 = &MEM[(void *)"$PRIVATE$" + 2B];
                  D.28203 = *D.28202;
                  D.28204 = (int) D.28203;
                  D.28205 = __s2 + 2;
                  D.28206 = *D.28205;
                  D.28207 = (int) D.28206;
                  __result = D.28204 - D.28207;
                  if (__s2_len > 2) goto <D.28208>; else goto <D.28209>;
                  <D.28208>:
                  if (__result == 0) goto <D.28210>; else goto <D.28211>;
                  <D.28210>:
                  D.28212 = &MEM[(void *)"$PRIVATE$" + 3B];
                  D.28213 = *D.28212;
                  D.28214 = (int) D.28213;
                  D.28215 = __s2 + 3;
                  D.28216 = *D.28215;
                  D.28217 = (int) D.28216;
                  __result = D.28214 - D.28217;
                  <D.28211>:
                  <D.28209>:
                  <D.28201>:
                  <D.28199>:
                  <D.28191>:
                  <D.28189>:
                }
                D.21274 = __result;
              }
              iftmp.442 = -D.21274;
              goto <D.28218>;
              <D.28182>:
              D.28219 = mono_field_get_name (field);
              iftmp.442 = __builtin_strcmp (D.28219, "$PRIVATE$");
              <D.28218>:
              D.21275 = iftmp.442;
            }
            if (D.21275 == 0) goto <D.28220>; else goto <D.28221>;
            <D.28220>:
            // predicted unlikely by continue predictor.
            goto <D.21257>;
            <D.28221>:
            <D.28179>:
            <D.28176>:
            switch (layout) <default: <D.28243>, case 0: <D.21276>, case 8: <D.21277>, case 16: <D.21279>>
            <D.21276>:
            <D.21277>:
            D.28063 = field->type;
            D.28222 = info->fields[j].mspec;
            D.28223 = klass->unicode;
            D.28224 = (int) D.28223;
            size = mono_marshal_type_size (D.28063, D.28222, &align, 1, D.28224);
            D.28050 = BIT_FIELD_REF <*klass, 32, 160>;
            D.28128 = D.28050 & 983040;
            if (D.28128 != 0) goto <D.28226>; else goto <D.28227>;
            <D.28226>:
            D.28131 = klass->packing_size;
            D.28228 = (unsigned int) D.28131;
            align.444 = align;
            iftmp.443 = MIN_EXPR <D.28228, align.444>;
            goto <D.28230>;
            <D.28227>:
            iftmp.443 = align;
            <D.28230>:
            align = iftmp.443;
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.28231 = info->native_size;
            info->fields[j].offset = D.28231;
            D.28232 = info->fields[j].offset;
            align.444 = align;
            D.28233 = D.28232 + align.444;
            D.28234 = D.28233 + 4294967295;
            info->fields[j].offset = D.28234;
            D.28232 = info->fields[j].offset;
            align.444 = align;
            D.28235 = -align.444;
            D.28236 = D.28232 & D.28235;
            info->fields[j].offset = D.28236;
            D.28232 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.28238 = D.28232 + size.445;
            info->native_size = D.28238;
            goto <D.21278>;
            <D.21279>:
            D.28063 = field->type;
            D.28222 = info->fields[j].mspec;
            D.28223 = klass->unicode;
            D.28224 = (int) D.28223;
            size = mono_marshal_type_size (D.28063, D.28222, &align, 1, D.28224);
            align.444 = align;
            min_align = MAX_EXPR <min_align, align.444>;
            D.28239 = field->offset;
            D.28240 = (unsigned int) D.28239;
            D.28241 = D.28240 + 4294967288;
            info->fields[j].offset = D.28241;
            D.28232 = info->fields[j].offset;
            size.445 = (unsigned int) size;
            D.28238 = D.28232 + size.445;
            D.28231 = info->native_size;
            D.28242 = MAX_EXPR <D.28238, D.28231>;
            info->native_size = D.28242;
            goto <D.21278>;
            <D.28243>:
            <D.21278>:
            j = j + 1;
          }
        finally
          {
            align = {CLOBBER};
          }
      }
      <D.21257>:
      field = mono_class_get_fields (klass, &iter);
      if (field != 0B) goto <D.21280>; else goto <D.21281>;
      <D.21281>:
      if (layout != 0) goto <D.28244>; else goto <D.28245>;
      <D.28244>:
      D.28231 = info->native_size;
      native_size.437 = native_size;
      D.28246 = MAX_EXPR <D.28231, native_size.437>;
      info->native_size = D.28246;
      if (layout == 16) goto <D.28247>; else goto <D.28248>;
      <D.28247>:
      native_size.437 = native_size;
      if (native_size.437 != 0) goto <D.28251>; else goto <D.28249>;
      <D.28251>:
      D.28231 = info->native_size;
      native_size.437 = native_size;
      if (D.28231 == native_size.437) goto <D.28252>; else goto <D.28249>;
      <D.28252>:
      D.28050 = BIT_FIELD_REF <*klass, 32, 160>;
      D.28128 = D.28050 & 983040;
      if (D.28128 == 0) goto <D.28253>; else goto <D.28249>;
      <D.28253>:
      min_align = 1;
      goto <D.28250>;
      <D.28249>:
      min_align = MIN_EXPR <packing, min_align>;
      <D.28250>:
      <D.28248>:
      <D.28245>:
      D.28231 = info->native_size;
      D.28254 = min_align + 4294967295;
      D.28255 = D.28231 & D.28254;
      if (D.28255 != 0) goto <D.28256>; else goto <D.28257>;
      <D.28256>:
      D.28231 = info->native_size;
      D.28258 = D.28231 + min_align;
      D.28259 = D.28258 + 4294967295;
      info->native_size = D.28259;
      D.28231 = info->native_size;
      D.28260 = -min_align;
      D.28261 = D.28231 & D.28260;
      info->native_size = D.28261;
      <D.28257>:
      info->min_align = min_align;
      D.28231 = info->native_size;
      D.28262 = mono_class_value_size (klass, 0B);
      D.28263 = (unsigned int) D.28262;
      if (D.28231 != D.28263) goto <D.28264>; else goto <D.28265>;
      <D.28264>:
      klass->blittable = 0;
      <D.28265>:
      D.28266 = klass->rank;
      if (D.28266 != 0) goto <D.28267>; else goto <D.28268>;
      <D.28267>:
      D.28269 = klass->element_class;
      D.28270 = mono_marshal_is_loading_type_info (D.28269);
      if (D.28270 == 0) goto <D.28271>; else goto <D.28272>;
      <D.28271>:
      D.28269 = klass->element_class;
      mono_marshal_load_type_info (D.28269);
      <D.28272>:
      <D.28268>:
      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.28273>; else goto <D.28274>;
        <D.28273>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
        <D.28274>:
        D.28275 = ret != 0;
        D.28276 = (long int) D.28275;
        D.28277 = __builtin_expect (D.28276, 0);
        if (D.28277 != 0) goto <D.28278>; else goto <D.28279>;
        <D.28278>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12335, "ret == 0");
        <D.28279>:
      }
      D.28046 = klass->marshal_info;
      if (D.28046 == 0B) goto <D.28280>; else goto <D.28281>;
      <D.28280>:
      mono_memory_barrier ();
      klass->marshal_info = info;
      <D.28281>:
      {
        int ret;

        ret = pthread_mutex_unlock (&marshal_mutex.mutex);
        if (ret != 0) goto <D.28282>; else goto <D.28283>;
        <D.28282>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
        <D.28283>:
        D.28284 = ret != 0;
        D.28285 = (long int) D.28284;
        D.28286 = __builtin_expect (D.28285, 0);
        if (D.28286 != 0) goto <D.28287>; else goto <D.28288>;
        <D.28287>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12341, "ret == 0");
        <D.28288>:
      }
      D.28049 = klass->marshal_info;
      return D.28049;
    }
  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.28294;
  struct GSList * D.28295;
  _Bool D.28296;
  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.28295 = monoeg_g_slist_find (loads_list, klass);
  D.28296 = D.28295 != 0B;
  D.28294 = (gboolean) D.28296;
  return D.28294;
}


mono_class_native_size (struct MonoClass * klass, guint32 * align)
{
  struct MonoMarshalType * D.28298;
  int D.28301;
  gint32 D.28306;
  unsigned int D.28309;
  unsigned int D.28310;

  D.28298 = klass->marshal_info;
  if (D.28298 == 0B) goto <D.28299>; else goto <D.28300>;
  <D.28299>:
  D.28301 = mono_marshal_is_loading_type_info (klass);
  if (D.28301 != 0) goto <D.28302>; else goto <D.28303>;
  <D.28302>:
  if (align != 0B) goto <D.28304>; else goto <D.28305>;
  <D.28304>:
  *align = 0;
  <D.28305>:
  D.28306 = 0;
  return D.28306;
  <D.28303>:
  mono_marshal_load_type_info (klass);
  <D.28300>:
  if (align != 0B) goto <D.28307>; else goto <D.28308>;
  <D.28307>:
  D.28298 = klass->marshal_info;
  D.28309 = D.28298->min_align;
  *align = D.28309;
  <D.28308>:
  D.28298 = klass->marshal_info;
  D.28310 = D.28298->native_size;
  D.28306 = (gint32) D.28310;
  return D.28306;
}


mono_type_native_stack_size (struct MonoType * t, guint32 * align)
{
  _Bool D.28312;
  long int D.28313;
  long int D.28314;
  unsigned int D.28319;
  unsigned int D.28320;
  int D.28323;
  unsigned char D.28324;
  int D.28325;
  int D.28326;
  unsigned int D.28329;
  unsigned int D.28330;
  struct MonoType * D.28333;
  int D.28334;
  unsigned int D.28335;
  unsigned int D.28336;
  unsigned int D.28337;
  guint32 tmp;

  try
    {
      D.28312 = t == 0B;
      D.28313 = (long int) D.28312;
      D.28314 = __builtin_expect (D.28313, 0);
      if (D.28314 != 0) goto <D.28315>; else goto <D.28316>;
      <D.28315>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12389, "t != NULL");
      <D.28316>:
      if (align == 0B) goto <D.28317>; else goto <D.28318>;
      <D.28317>:
      align = &tmp;
      <D.28318>:
      D.28319 = BIT_FIELD_REF <*t, 32, 32>;
      D.28320 = D.28319 & 1073741824;
      if (D.28320 != 0) goto <D.28321>; else goto <D.28322>;
      <D.28321>:
      *align = 4;
      D.28323 = 4;
      return D.28323;
      <D.28322>:
      D.28324 = t->type;
      D.28325 = (int) D.28324;
      switch (D.28325) <default: <D.21325>, case 2: <D.21293>, case 3: <D.21294>, case 4: <D.21295>, case 5: <D.21296>, case 6: <D.21297>, case 7: <D.21298>, case 8: <D.21299>, case 9: <D.21300>, case 10: <D.21315>, case 11: <D.21316>, case 12: <D.21310>, case 13: <D.21311>, case 14: <D.21303>, case 15: <D.21307>, case 17: <D.21322>, case 18: <D.21305>, case 20: <D.21309>, case 21: <D.21320>, case 22: <D.21321>, case 24: <D.21301>, case 25: <D.21302>, case 27: <D.21308>, case 28: <D.21304>, case 29: <D.21306>>
      {
        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.21293>:
        <D.21294>:
        <D.21295>:
        <D.21296>:
        <D.21297>:
        <D.21298>:
        <D.21299>:
        <D.21300>:
        *align = 4;
        D.28323 = 4;
        return D.28323;
        <D.21301>:
        <D.21302>:
        <D.21303>:
        <D.21304>:
        <D.21305>:
        <D.21306>:
        <D.21307>:
        <D.21308>:
        <D.21309>:
        *align = 4;
        D.28323 = 4;
        return D.28323;
        <D.21310>:
        *align = 4;
        D.28323 = 4;
        return D.28323;
        <D.21311>:
        *align = 8;
        D.28323 = 8;
        return D.28323;
        <D.21315>:
        <D.21316>:
        *align = 4;
        D.28323 = 8;
        return D.28323;
        <D.21320>:
        D.28326 = mono_type_generic_inst_is_valuetype (t);
        if (D.28326 == 0) goto <D.28327>; else goto <D.28328>;
        <D.28327>:
        *align = 4;
        D.28323 = 4;
        return D.28323;
        <D.28328>:
        <D.21321>:
        <D.21322>:
        {
          guint32 size;
          struct MonoClass * klass;

          klass = mono_class_from_mono_type (t);
          D.28329 = BIT_FIELD_REF <*klass, 32, 160>;
          D.28330 = D.28329 & 16;
          if (D.28330 != 0) goto <D.28331>; else goto <D.28332>;
          <D.28331>:
          D.28333 = mono_class_enum_basetype (klass);
          D.28323 = mono_type_native_stack_size (D.28333, align);
          return D.28323;
          <D.28332>:
          D.28334 = mono_class_native_size (klass, align);
          size = (guint32) D.28334;
          D.28335 = *align;
          D.28336 = D.28335 + 3;
          *align = D.28336;
          D.28335 = *align;
          D.28337 = D.28335 & 4294967292;
          *align = D.28337;
          size = size + 3;
          size = size & 4294967292;
          D.28323 = (int) size;
          return D.28323;
        }
        <D.21325>:
        D.28324 = t->type;
        D.28325 = (int) D.28324;
        monoeg_g_log (0B, 4, "type 0x%02x unknown", D.28325);
        <D.21326>:
        goto <D.21326>;
      }
      D.28323 = 0;
      return D.28323;
    }
  finally
    {
      tmp = {CLOBBER};
    }
}


mono_marshal_type_size (struct MonoType * type, struct MonoMarshalSpec * mspec, guint32 * align, gboolean as_field, gboolean unicode)
{
  gint32 D.28340;
  struct MonoClass * D.28341;
  <unnamed type> D.28346;
  int iftmp.447;
  _Bool D.28353;
  long int D.28354;
  long int D.28355;
  unsigned int esize.448;
  int D.28359;
  struct MonoClass * D.28360;
  struct MonoClass * D.28361;
  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.21382>, case 2: <D.21336>, case 3: <D.21337>, case 4: <D.21338>, case 5: <D.21339>, case 6: <D.21340>, case 7: <D.21342>, case 8: <D.21343>, case 9: <D.21345>, case 10: <D.21346>, case 11: <D.21350>, case 12: <D.21351>, case 15: <D.21380>, case 19: <D.21360>, case 20: <D.21357>, case 21: <D.21358>, case 22: <D.21359>, case 23: <D.21375>, case 25: <D.21365>, case 26: <D.21366>, case 27: <D.21374>, case 28: <D.21367>, case 29: <D.21364>, case 30: <D.21377>, case 31: <D.21355>, case 32: <D.21356>, case 34: <D.21381>, case 35: <D.21361>, case 36: <D.21362>, case 37: <D.21341>, case 38: <D.21369>, case 40: <D.21368>, case 42: <D.21363>, case 43: <D.21370>, case 44: <D.21379>, case 45: <D.21344>>
  {
    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.21336>:
    *align = 4;
    D.28340 = 4;
    return D.28340;
    <D.21337>:
    <D.21338>:
    *align = 1;
    D.28340 = 1;
    return D.28340;
    <D.21339>:
    <D.21340>:
    <D.21341>:
    *align = 2;
    D.28340 = 2;
    return D.28340;
    <D.21342>:
    <D.21343>:
    <D.21344>:
    *align = 4;
    D.28340 = 4;
    return D.28340;
    <D.21345>:
    <D.21346>:
    *align = 8;
    D.28340 = 8;
    return D.28340;
    <D.21350>:
    *align = 4;
    D.28340 = 4;
    return D.28340;
    <D.21351>:
    *align = 8;
    D.28340 = 8;
    return D.28340;
    <D.21355>:
    <D.21356>:
    <D.21357>:
    <D.21358>:
    <D.21359>:
    <D.21360>:
    <D.21361>:
    <D.21362>:
    <D.21363>:
    <D.21364>:
    <D.21365>:
    <D.21366>:
    <D.21367>:
    <D.21368>:
    <D.21369>:
    <D.21370>:
    *align = 4;
    D.28340 = 4;
    return D.28340;
    <D.21374>:
    klass = mono_class_from_mono_type (type);
    D.28341 = mono_defaults.object_class;
    if (D.28341 == klass) goto <D.28342>; else goto <D.28343>;
    <D.28342>:
    if (mspec != 0B) goto <D.28344>; else goto <D.28345>;
    <D.28344>:
    D.28346 = mspec->native;
    if (D.28346 == 27) goto <D.28347>; else goto <D.28348>;
    <D.28347>:
    *align = 16;
    D.28340 = 16;
    return D.28340;
    <D.28348>:
    <D.28345>:
    <D.28343>:
    D.28340 = mono_class_native_size (klass, align);
    return D.28340;
    <D.21375>:
    {
      int esize;

      if (unicode != 0) goto <D.28350>; else goto <D.28351>;
      <D.28350>:
      iftmp.447 = 2;
      goto <D.28352>;
      <D.28351>:
      iftmp.447 = 1;
      <D.28352>:
      esize = iftmp.447;
      D.28353 = mspec == 0B;
      D.28354 = (long int) D.28353;
      D.28355 = __builtin_expect (D.28354, 0);
      if (D.28355 != 0) goto <D.28356>; else goto <D.28357>;
      <D.28356>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12524, "mspec");
      <D.28357>:
      esize.448 = (unsigned int) esize;
      *align = esize.448;
      D.28359 = mspec->data.array_data.num_elem;
      D.28340 = D.28359 * esize;
      return D.28340;
    }
    <D.21377>:
    {
      int esize;

      klass = mono_class_from_mono_type (type);
      D.28360 = klass->element_class;
      D.28361 = mono_defaults.char_class;
      if (D.28360 == D.28361) goto <D.28362>; else goto <D.28363>;
      <D.28362>:
      if (unicode != 0) goto <D.28365>; else goto <D.28366>;
      <D.28365>:
      iftmp.449 = 2;
      goto <D.28367>;
      <D.28366>:
      iftmp.449 = 1;
      <D.28367>:
      esize = iftmp.449;
      esize.450 = (unsigned int) esize;
      *align = esize.450;
      goto <D.28369>;
      <D.28363>:
      D.28360 = klass->element_class;
      esize = mono_class_native_size (D.28360, align);
      <D.28369>:
      D.28353 = mspec == 0B;
      D.28354 = (long int) D.28353;
      D.28355 = __builtin_expect (D.28354, 0);
      if (D.28355 != 0) goto <D.28370>; else goto <D.28371>;
      <D.28370>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12538, "mspec");
      <D.28371>:
      D.28359 = mspec->data.array_data.num_elem;
      D.28340 = D.28359 * esize;
      return D.28340;
    }
    <D.21379>:
    *align = 4;
    D.28340 = 4;
    return D.28340;
    <D.21380>:
    <D.21381>:
    <D.21382>:
    monoeg_g_log (0B, 4, "native type %02x not implemented", native_type);
    <D.21383>:
    goto <D.21383>;
  }
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "marshal.c", 12551);
  D.28340 = 0;
  return D.28340;
}


mono_marshal_asany (struct MonoObject * o, MonoMarshalNative string_encoding, int param_attrs)
{
  void * D.28375;
  struct MonoVTable * D.28376;
  struct MonoClass * D.28377;
  unsigned char D.28378;
  int D.28379;
  unsigned int D.28380;
  unsigned int D.28381;
  unsigned int D.28385;
  unsigned int D.28386;
  unsigned int D.28390;
  int D.28391;
  long unsigned int D.28392;
  void * res.451;
  unsigned int param_attrs.452;
  unsigned int D.28395;
  struct MonoException * D.28399;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28373>; else goto <D.28374>;
  <D.28373>:
  D.28375 = 0B;
  return D.28375;
  <D.28374>:
  D.28376 = o->vtable;
  D.28377 = D.28376->klass;
  t = &D.28377->byval_arg;
  D.28378 = t->type;
  D.28379 = (int) D.28378;
  switch (D.28379) <default: <D.28398>, case 2: <D.21396>, case 3: <D.21399>, case 4: <D.21394>, case 5: <D.21395>, case 6: <D.21397>, case 7: <D.21398>, case 8: <D.21391>, case 9: <D.21392>, case 10: <D.21400>, case 11: <D.21401>, case 12: <D.21402>, case 13: <D.21403>, case 14: <D.21404>, case 15: <D.21393>, case 17: <D.21410>, case 18: <D.21409>>
  <D.21391>:
  <D.21392>:
  <D.21393>:
  <D.21394>:
  <D.21395>:
  <D.21396>:
  <D.21397>:
  <D.21398>:
  <D.21399>:
  <D.21400>:
  <D.21401>:
  <D.21402>:
  <D.21403>:
  D.28375 = mono_object_unbox (o);
  return D.28375;
  <D.21404>:
  switch (string_encoding) <default: <D.21407>, case 20: <D.21406>, case 21: <D.21405>>
  <D.21405>:
  D.28375 = mono_marshal_string_to_utf16_copy (o);
  return D.28375;
  <D.21406>:
  D.28375 = mono_string_to_lpstr (o);
  return D.28375;
  <D.21407>:
  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.21408>;
  <D.21409>:
  <D.21410>:
  {
    struct MonoMethod * method;
    void * pa[3];
    void * res;
    MonoBoolean delete_old;

    try
      {
        delete_old = 0;
        klass = t->data.klass;
        D.28380 = klass->flags;
        D.28381 = D.28380 & 24;
        if (D.28381 == 0) goto <D.21408>; else goto <D.28382>;
        <D.28382>:
        D.28385 = BIT_FIELD_REF <*klass, 32, 160>;
        D.28386 = D.28385 & 8;
        if (D.28386 != 0) goto <D.28387>; else goto <D.28388>;
        <D.28387>:
        D.28380 = klass->flags;
        D.28381 = D.28380 & 24;
        if (D.28381 == 16) goto <D.28383>; else goto <D.28389>;
        <D.28389>:
        D.28385 = BIT_FIELD_REF <*klass, 32, 160>;
        D.28390 = D.28385 & 48;
        if (D.28390 != 0) goto <D.28383>; else goto <D.28384>;
        <D.28383>:
        D.28375 = mono_object_unbox (o);
        return D.28375;
        <D.28384>:
        <D.28388>:
        D.28391 = mono_class_native_size (klass, 0B);
        D.28392 = (long unsigned int) D.28391;
        res.451 = mono_marshal_alloc (D.28392);
        res = res.451;
        param_attrs.452 = (unsigned int) param_attrs;
        D.28395 = param_attrs.452 & 3;
        if (D.28395 != 2) goto <D.28396>; else goto <D.28397>;
        <D.28396>:
        D.28376 = o->vtable;
        D.28377 = D.28376->klass;
        method = mono_marshal_get_struct_to_ptr (D.28377);
        pa[0] = o;
        pa[1] = &res;
        pa[2] = &delete_old;
        mono_runtime_invoke (method, 0B, &pa, 0B);
        <D.28397>:
        D.28375 = res;
        return D.28375;
      }
    finally
      {
        pa = {CLOBBER};
        res = {CLOBBER};
        delete_old = {CLOBBER};
      }
  }
  <D.28398>:
  <D.21408>:
  D.28399 = mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter.");
  mono_raise_exception (D.28399);
  D.28375 = 0B;
  return D.28375;
}


mono_marshal_free_asany (struct MonoObject * o, void * ptr, MonoMarshalNative string_encoding, int param_attrs)
{
  struct MonoVTable * D.28405;
  struct MonoClass * D.28406;
  unsigned char D.28407;
  int D.28408;
  void * ptr.453;
  unsigned int D.28410;
  unsigned int D.28411;
  unsigned int D.28414;
  unsigned int D.28415;
  unsigned int D.28417;
  int D.28419;
  unsigned int param_attrs.454;
  unsigned int D.28423;
  struct MonoType * t;
  struct MonoClass * klass;

  if (o == 0B) goto <D.28403>; else goto <D.28404>;
  <D.28403>:
  return;
  <D.28404>:
  D.28405 = o->vtable;
  D.28406 = D.28405->klass;
  t = &D.28406->byval_arg;
  D.28407 = t->type;
  D.28408 = (int) D.28407;
  switch (D.28408) <default: <D.21433>, case 14: <D.21423>, case 17: <D.21430>, case 18: <D.21429>>
  <D.21423>:
  switch (string_encoding) <default: <D.21427>, case 20: <D.21425>, case 21: <D.21424>>
  <D.21424>:
  <D.21425>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.21426>;
  <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", 12650);
  <D.21426>:
  goto <D.21428>;
  <D.21429>:
  <D.21430>:
  klass = t->data.klass;
  D.28410 = BIT_FIELD_REF <*klass, 32, 160>;
  D.28411 = D.28410 & 8;
  if (D.28411 != 0) goto <D.28412>; else goto <D.28413>;
  <D.28412>:
  D.28414 = klass->flags;
  D.28415 = D.28414 & 24;
  if (D.28415 == 16) goto <D.21428>; else goto <D.28416>;
  <D.28416>:
  D.28410 = BIT_FIELD_REF <*klass, 32, 160>;
  D.28417 = D.28410 & 48;
  if (D.28417 != 0) goto <D.21428>; else goto <D.28418>;
  <D.28418>:
  <D.28413>:
  D.28419 = param_attrs & 2;
  if (D.28419 != 0) goto <D.28420>; else goto <D.28421>;
  <D.28420>:
  {
    struct MonoMethod * method;
    void * pa[2];

    try
      {
        D.28405 = o->vtable;
        D.28406 = D.28405->klass;
        method = mono_marshal_get_ptr_to_struct (D.28406);
        pa[0] = &ptr;
        pa[1] = o;
        mono_runtime_invoke (method, 0B, &pa, 0B);
      }
    finally
      {
        pa = {CLOBBER};
      }
  }
  <D.28421>:
  param_attrs.454 = (unsigned int) param_attrs;
  D.28423 = param_attrs.454 & 3;
  if (D.28423 != 2) goto <D.28424>; else goto <D.28425>;
  <D.28424>:
  ptr.453 = ptr;
  mono_struct_delete_old (klass, ptr.453);
  <D.28425>:
  ptr.453 = ptr;
  mono_marshal_free (ptr.453);
  goto <D.21428>;
  <D.21433>:
  goto <D.21428>;
  <D.21428>:
}


mono_marshal_get_generic_array_helper (struct MonoClass * class, struct MonoClass * iface, gchar * name, struct MonoMethod * method)
{
  struct MonoMethod * D.28428;
  struct MonoClass * D.28429;
  struct MonoImage * D.28430;
  int D.28431;
  unsigned int D.28432;
  short unsigned int D.28433;
  int D.28434;
  int D.28435;
  struct MonoMethod * D.28436;
  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.28428 = mb->method;
  D.28428->slot = -1;
  D.28428 = mb->method;
  D.28428->flags = 481;
  sig = mono_method_signature (method);
  D.28429 = method->klass;
  D.28430 = D.28429->image;
  csig = signature_dup (D.28430, sig);
  csig->generic_param_count = 0;
  mono_mb_emit_ldarg (mb, 0);
  i = 0;
  goto <D.21447>;
  <D.21446>:
  D.28431 = i + 1;
  D.28432 = (unsigned int) D.28431;
  mono_mb_emit_ldarg (mb, D.28432);
  i = i + 1;
  <D.21447>:
  D.28433 = csig->param_count;
  D.28434 = (int) D.28433;
  if (D.28434 > i) goto <D.21446>; else goto <D.21448>;
  <D.21448>:
  mono_mb_emit_managed_call (mb, method, 0B);
  mono_mb_emit_byte (mb, 42);
  mb->skip_visibility = 1;
  D.28433 = csig->param_count;
  D.28434 = (int) D.28433;
  D.28435 = D.28434 + 16;
  res = mono_mb_create_method (mb, csig, D.28435);
  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.28436 = res;
  return D.28436;
}


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


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

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


mono_win32_compat_MoveMemory (void * dest, const void * source, gsize length)
{
  if (dest == 0B) goto <D.28443>; else goto <D.28445>;
  <D.28445>:
  if (source == 0B) goto <D.28443>; else goto <D.28444>;
  <D.28443>:
  return;
  <D.28444>:
  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.28448;
  unsigned char D.28449;
  _Bool D.28451;
  long int D.28452;
  long int D.28453;
  int D.28457;
  int D.28458;
  _Bool D.28459;
  long int D.28460;
  long int D.28461;
  int i;
  guint8 byte;

  i = 0;
  goto <D.21478>;
  <D.21477>:
  i.455 = (sizetype) i;
  D.28448 = buf + i.455;
  D.28449 = *D.28448;
  if (D.28449 != 0) goto <D.21476>; else goto <D.28450>;
  <D.28450>:
  i = i + 1;
  <D.21478>:
  if (i < len) goto <D.21477>; else goto <D.21476>;
  <D.21476>:
  D.28451 = i >= len;
  D.28452 = (long int) D.28451;
  D.28453 = __builtin_expect (D.28452, 0);
  if (D.28453 != 0) goto <D.28454>; else goto <D.28455>;
  <D.28454>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12773, "i < len");
  <D.28455>:
  i.455 = (sizetype) i;
  D.28448 = buf + i.455;
  byte = *D.28448;
  goto <D.21480>;
  <D.21479>:
  byte = byte >> 1;
  <D.21480>:
  if (byte != 0) goto <D.28456>; else goto <D.21481>;
  <D.28456>:
  D.28457 = (int) byte;
  D.28458 = D.28457 & 1;
  if (D.28458 == 0) goto <D.21479>; else goto <D.21481>;
  <D.21481>:
  D.28459 = byte != 1;
  D.28460 = (long int) D.28459;
  D.28461 = __builtin_expect (D.28460, 0);
  if (D.28461 != 0) goto <D.28462>; else goto <D.28463>;
  <D.28462>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12778, "byte == 1");
  <D.28463>:
  *byte_offset = i;
  i.455 = (sizetype) i;
  D.28448 = buf + i.455;
  D.28449 = *D.28448;
  *bitmask = D.28449;
}


mono_marshal_get_thunk_invoke_wrapper (struct MonoMethod * method)
{
  _Bool D.28464;
  long int D.28465;
  long int D.28466;
  struct MonoClass * D.28469;
  struct GHashTable * * D.28470;
  struct MonoMethod * D.28473;
  const char * D.28474;
  short unsigned int D.28475;
  int D.28476;
  <unnamed-unsigned:1> D.28477;
  int D.28478;
  int D.28479;
  unsigned int param_count.456;
  unsigned int D.28481;
  unsigned int D.28482;
  unsigned int D.28483;
  unsigned int sig_size.457;
  short unsigned int D.28485;
  unsigned int D.28486;
  unsigned int D.28487;
  struct MonoType * D.28490;
  int D.28491;
  struct MonoType * D.28492;
  int D.28493;
  struct MonoClass * D.28494;
  struct MonoType * D.28495;
  struct MonoType * D.28496;
  struct MonoType * D.28497;
  struct MonoType * D.28498;
  int D.28499;
  struct MonoClass * D.28502;
  struct MonoType * D.28503;
  int D.28504;
  unsigned int D.28507;
  int D.28508;
  unsigned int D.28509;
  unsigned int i.458;
  struct MonoType * D.28511;
  int D.28512;
  unsigned int D.28517;
  unsigned int D.28518;
  short unsigned int D.28522;
  int D.28523;
  int D.28524;
  int D.28528;
  unsigned int D.28531;
  int D.28532;
  unsigned int D.28533;
  unsigned int D.28534;
  unsigned int D.28535;
  int D.28536;
  unsigned int D.28537;
  int D.28538;
  unsigned int D.28539;
  unsigned int D.28540;
  unsigned int D.28541;
  unsigned int pos_leave.459;
  int D.28543;
  int D.28546;
  struct MonoClass * D.28549;
  int D.28550;
  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.28464 = method == 0B;
  D.28465 = (long int) D.28464;
  D.28466 = __builtin_expect (D.28465, 0);
  if (D.28466 != 0) goto <D.28467>; else goto <D.28468>;
  <D.28467>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12796, "method");
  <D.28468>:
  klass = method->klass;
  D.28469 = method->klass;
  image = D.28469->image;
  D.28470 = &image->thunk_invoke_cache;
  cache = get_cache (D.28470, mono_aligned_addr_hash, 0B);
  res = mono_marshal_find_in_cache (cache, method);
  if (res != 0B) goto <D.28471>; else goto <D.28472>;
  <D.28471>:
  D.28473 = res;
  return D.28473;
  <D.28472>:
  sig = mono_method_signature (method);
  D.28474 = method->name;
  mb = mono_mb_new (klass, D.28474, 5);
  D.28475 = sig->param_count;
  D.28476 = (int) D.28475;
  D.28477 = sig->hasthis;
  D.28478 = (int) D.28477;
  D.28479 = D.28476 + D.28478;
  param_count = D.28479 + 1;
  param_count.456 = (unsigned int) param_count;
  csig = mono_metadata_signature_alloc (image, param_count.456);
  D.28475 = sig->param_count;
  D.28481 = (unsigned int) D.28475;
  D.28482 = D.28481 + 3;
  D.28483 = D.28482 * 4;
  sig_size = (int) D.28483;
  sig_size.457 = (unsigned int) sig_size;
  memcpy (csig, sig, sig_size.457);
  D.28485 = (short unsigned int) param_count;
  csig->param_count = D.28485;
  csig->hasthis = 0;
  csig->pinvoke = 1;
  csig->call_convention = 0;
  D.28486 = BIT_FIELD_REF <*sig, 32, 64>;
  D.28487 = D.28486 & 4194304;
  if (D.28487 != 0) goto <D.28488>; else goto <D.28489>;
  <D.28488>:
  D.28490 = &klass->byval_arg;
  csig->params[0] = D.28490;
  i = 0;
  goto <D.21498>;
  <D.21497>:
  D.28491 = i + 1;
  D.28492 = sig->params[i];
  csig->params[D.28491] = D.28492;
  i = i + 1;
  <D.21498>:
  D.28475 = sig->param_count;
  D.28476 = (int) D.28475;
  if (D.28476 > i) goto <D.21497>; else goto <D.21499>;
  <D.21499>:
  <D.28489>:
  D.28493 = param_count + -1;
  D.28494 = mono_defaults.exception_class;
  D.28495 = &D.28494->byval_arg;
  D.28496 = mono_metadata_type_dup (image, D.28495);
  csig->params[D.28493] = D.28496;
  D.28493 = param_count + -1;
  D.28497 = csig->params[D.28493];
  D.28497->byref = 1;
  D.28493 = param_count + -1;
  D.28497 = csig->params[D.28493];
  D.28497->attrs = 2;
  D.28498 = sig->ret;
  D.28499 = mono_type_is_struct (D.28498);
  if (D.28499 != 0) goto <D.28500>; else goto <D.28501>;
  <D.28500>:
  D.28502 = mono_defaults.object_class;
  D.28503 = &D.28502->byval_arg;
  csig->ret = D.28503;
  <D.28501>:
  D.28502 = mono_defaults.object_class;
  D.28503 = &D.28502->byval_arg;
  mono_mb_add_local (mb, D.28503);
  D.28498 = sig->ret;
  D.28504 = mono_type_is_void (D.28498);
  if (D.28504 == 0) goto <D.28505>; else goto <D.28506>;
  <D.28505>:
  D.28498 = sig->ret;
  mono_mb_add_local (mb, D.28498);
  <D.28506>:
  D.28493 = param_count + -1;
  D.28507 = (unsigned int) D.28493;
  mono_mb_emit_ldarg (mb, D.28507);
  mono_mb_emit_byte (mb, 20);
  mono_mb_emit_byte (mb, 81);
  clause = mono_image_alloc0 (image, 24);
  D.28508 = mono_mb_get_label (mb);
  D.28509 = (unsigned int) D.28508;
  clause->try_offset = D.28509;
  i = 0;
  goto <D.21503>;
  <D.21502>:
  {
    struct MonoType * type;
    struct MonoClass * klass;

    i.458 = (unsigned int) i;
    mono_mb_emit_ldarg (mb, i.458);
    D.28511 = csig->params[i];
    klass = mono_class_from_mono_type (D.28511);
    type = &klass->byval_arg;
    D.28512 = mono_type_is_struct (type);
    if (D.28512 != 0) goto <D.28513>; else goto <D.28514>;
    <D.28513>:
    mono_mb_emit_op (mb, 121, klass);
    D.28511 = csig->params[i];
    D.28517 = BIT_FIELD_REF <*D.28511, 32, 32>;
    D.28518 = D.28517 & 1073741824;
    if (D.28518 == 0) goto <D.28519>; else goto <D.28520>;
    <D.28519>:
    if (i != 0) goto <D.28515>; else goto <D.28521>;
    <D.28521>:
    D.28486 = BIT_FIELD_REF <*sig, 32, 64>;
    D.28487 = D.28486 & 4194304;
    if (D.28487 == 0) goto <D.28515>; else goto <D.28516>;
    <D.28515>:
    mono_mb_emit_op (mb, 113, klass);
    <D.28516>:
    <D.28520>:
    D.28502 = mono_defaults.object_class;
    D.28503 = &D.28502->byval_arg;
    csig->params[i] = D.28503;
    <D.28514>:
  }
  i = i + 1;
  <D.21503>:
  D.28493 = param_count + -1;
  if (D.28493 > i) goto <D.21502>; else goto <D.21504>;
  <D.21504>:
  D.28522 = method->flags;
  D.28523 = (int) D.28522;
  D.28524 = D.28523 & 64;
  if (D.28524 != 0) goto <D.28525>; else goto <D.28526>;
  <D.28525>:
  mono_mb_emit_op (mb, 111, method);
  goto <D.28527>;
  <D.28526>:
  mono_mb_emit_op (mb, 40, method);
  <D.28527>:
  D.28498 = sig->ret;
  D.28528 = mono_type_is_void (D.28498);
  if (D.28528 == 0) goto <D.28529>; else goto <D.28530>;
  <D.28529>:
  mono_mb_emit_stloc (mb, 1);
  <D.28530>:
  D.28531 = mono_mb_emit_branch (mb, 221);
  pos_leave = (int) D.28531;
  clause->flags = 0;
  D.28532 = mono_mb_get_pos (mb);
  D.28533 = (unsigned int) D.28532;
  D.28534 = clause->try_offset;
  D.28535 = D.28533 - D.28534;
  clause->try_len = D.28535;
  D.28502 = mono_defaults.object_class;
  clause->data.catch_class = D.28502;
  D.28536 = mono_mb_get_label (mb);
  D.28537 = (unsigned int) D.28536;
  clause->handler_offset = D.28537;
  mono_mb_emit_stloc (mb, 0);
  D.28493 = param_count + -1;
  D.28507 = (unsigned int) D.28493;
  mono_mb_emit_ldarg (mb, D.28507);
  mono_mb_emit_ldloc (mb, 0);
  mono_mb_emit_byte (mb, 81);
  mono_mb_emit_branch (mb, 221);
  D.28538 = mono_mb_get_pos (mb);
  D.28539 = (unsigned int) D.28538;
  D.28540 = clause->handler_offset;
  D.28541 = D.28539 - D.28540;
  clause->handler_len = D.28541;
  mono_mb_set_clauses (mb, 1, clause);
  pos_leave.459 = (unsigned int) pos_leave;
  mono_mb_patch_branch (mb, pos_leave.459);
  D.28498 = sig->ret;
  D.28543 = mono_type_is_void (D.28498);
  if (D.28543 == 0) goto <D.28544>; else goto <D.28545>;
  <D.28544>:
  mono_mb_emit_ldloc (mb, 1);
  D.28498 = sig->ret;
  D.28546 = mono_type_is_struct (D.28498);
  if (D.28546 != 0) goto <D.28547>; else goto <D.28548>;
  <D.28547>:
  D.28498 = sig->ret;
  D.28549 = mono_class_from_mono_type (D.28498);
  mono_mb_emit_op (mb, 140, D.28549);
  <D.28548>:
  <D.28545>:
  mono_mb_emit_byte (mb, 42);
  D.28550 = param_count + 16;
  res = mono_mb_create_and_cache (cache, method, mb, csig, D.28550);
  mono_mb_free (mb);
  D.28473 = res;
  return D.28473;
}


mono_marshal_free_dynamic_wrappers (struct MonoMethod * method)
{
  struct MonoClass * D.28552;
  unsigned int D.28553;
  unsigned int D.28554;
  _Bool D.28555;
  long int D.28556;
  long int D.28557;
  int marshal_mutex_initialized.460;
  _Bool D.28565;
  long int D.28566;
  long int D.28567;
  struct GHashTable * D.28570;
  struct GHashTable * D.28573;
  _Bool D.28580;
  long int D.28581;
  long int D.28582;
  struct MonoImage * image;

  D.28552 = method->klass;
  image = D.28552->image;
  D.28553 = BIT_FIELD_REF <*method, 32, 160>;
  D.28554 = D.28553 & 512;
  D.28555 = D.28554 == 0;
  D.28556 = (long int) D.28555;
  D.28557 = __builtin_expect (D.28556, 0);
  if (D.28557 != 0) goto <D.28558>; else goto <D.28559>;
  <D.28558>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12939, "method->dynamic");
  <D.28559>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.28561>; else goto <D.28562>;
  <D.28561>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28563>; else goto <D.28564>;
    <D.28563>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28564>:
    D.28565 = ret != 0;
    D.28566 = (long int) D.28565;
    D.28567 = __builtin_expect (D.28566, 0);
    if (D.28567 != 0) goto <D.28568>; else goto <D.28569>;
    <D.28568>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12943, "ret == 0");
    <D.28569>:
  }
  <D.28562>:
  D.28570 = image->runtime_invoke_direct_cache;
  if (D.28570 != 0B) goto <D.28571>; else goto <D.28572>;
  <D.28571>:
  D.28570 = image->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.28570, method);
  <D.28572>:
  D.28573 = image->delegate_abstract_invoke_cache;
  if (D.28573 != 0B) goto <D.28574>; else goto <D.28575>;
  <D.28574>:
  D.28573 = image->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.28573, signature_method_pair_matches_method, method);
  <D.28575>:
  marshal_mutex_initialized.460 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.460 != 0) goto <D.28576>; else goto <D.28577>;
  <D.28576>:
  {
    int ret;

    ret = pthread_mutex_unlock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28578>; else goto <D.28579>;
    <D.28578>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.28579>:
    D.28580 = ret != 0;
    D.28581 = (long int) D.28580;
    D.28582 = __builtin_expect (D.28581, 0);
    if (D.28582 != 0) goto <D.28583>; else goto <D.28584>;
    <D.28583>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12954, "ret == 0");
    <D.28584>:
  }
  <D.28577>:
}


signature_method_pair_matches_method (void * key, void * value, void * user_data)
{
  gboolean D.28585;
  struct MonoMethod * D.28586;
  _Bool D.28587;
  struct SignatureMethodPair * pair;
  struct MonoMethod * method;

  pair = key;
  method = user_data;
  D.28586 = pair->method;
  D.28587 = D.28586 == method;
  D.28585 = (gboolean) D.28587;
  return D.28585;
}


mono_marshal_free_inflated_wrappers (struct MonoMethod * method)
{
  unsigned int D.28589;
  unsigned int D.28590;
  _Bool D.28591;
  long int D.28592;
  long int D.28593;
  int marshal_mutex_initialized.461;
  _Bool D.28601;
  long int D.28602;
  long int D.28603;
  struct MonoClass * D.28608;
  struct MonoImage * D.28609;
  struct GHashTable * D.28610;
  struct GHashTable * D.28615;
  struct GHashTable * D.28620;
  struct GHashTable * D.28625;
  struct GHashTable * D.28630;
  struct GHashTable * D.28635;
  struct GHashTable * D.28638;
  struct GHashTable * D.28641;
  struct GHashTable * D.28644;
  struct GHashTable * D.28647;
  struct GHashTable * D.28650;
  struct GHashTable * D.28653;
  struct GHashTable * D.28656;
  struct GHashTable * D.28659;
  struct GHashTable * D.28662;
  struct GHashTable * D.28665;
  _Bool D.28670;
  long int D.28671;
  long int D.28672;
  struct MonoMethodSignature * sig;

  sig = method->signature;
  D.28589 = BIT_FIELD_REF <*method, 32, 160>;
  D.28590 = D.28589 & 4096;
  D.28591 = D.28590 == 0;
  D.28592 = (long int) D.28591;
  D.28593 = __builtin_expect (D.28592, 0);
  if (D.28593 != 0) goto <D.28594>; else goto <D.28595>;
  <D.28594>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12976, "method->is_inflated");
  <D.28595>:
  marshal_mutex_initialized.461 = marshal_mutex_initialized;
  if (marshal_mutex_initialized.461 == 0) goto <D.28597>; else goto <D.28598>;
  <D.28597>:
  return;
  <D.28598>:
  {
    int ret;

    ret = pthread_mutex_lock (&marshal_mutex.mutex);
    if (ret != 0) goto <D.28599>; else goto <D.28600>;
    <D.28599>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.28600>:
    D.28601 = ret != 0;
    D.28602 = (long int) D.28601;
    D.28603 = __builtin_expect (D.28602, 0);
    if (D.28603 != 0) goto <D.28604>; else goto <D.28605>;
    <D.28604>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "marshal.c", 12982, "ret == 0");
    <D.28605>:
  }
  if (sig != 0B) goto <D.28606>; else goto <D.28607>;
  <D.28606>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28610 = D.28609->delegate_begin_invoke_cache;
  if (D.28610 != 0B) goto <D.28611>; else goto <D.28612>;
  <D.28611>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28610 = D.28609->delegate_begin_invoke_cache;
  monoeg_g_hash_table_remove (D.28610, sig);
  <D.28612>:
  <D.28607>:
  if (sig != 0B) goto <D.28613>; else goto <D.28614>;
  <D.28613>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28615 = D.28609->delegate_end_invoke_cache;
  if (D.28615 != 0B) goto <D.28616>; else goto <D.28617>;
  <D.28616>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28615 = D.28609->delegate_end_invoke_cache;
  monoeg_g_hash_table_remove (D.28615, sig);
  <D.28617>:
  <D.28614>:
  if (sig != 0B) goto <D.28618>; else goto <D.28619>;
  <D.28618>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28620 = D.28609->delegate_invoke_cache;
  if (D.28620 != 0B) goto <D.28621>; else goto <D.28622>;
  <D.28621>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28620 = D.28609->delegate_invoke_cache;
  monoeg_g_hash_table_remove (D.28620, sig);
  <D.28622>:
  <D.28619>:
  if (sig != 0B) goto <D.28623>; else goto <D.28624>;
  <D.28623>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28625 = D.28609->runtime_invoke_cache;
  if (D.28625 != 0B) goto <D.28626>; else goto <D.28627>;
  <D.28626>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28625 = D.28609->runtime_invoke_cache;
  monoeg_g_hash_table_remove (D.28625, sig);
  <D.28627>:
  <D.28624>:
  if (sig != 0B) goto <D.28628>; else goto <D.28629>;
  <D.28628>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28630 = D.28609->runtime_invoke_vtype_cache;
  if (D.28630 != 0B) goto <D.28631>; else goto <D.28632>;
  <D.28631>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28630 = D.28609->runtime_invoke_vtype_cache;
  monoeg_g_hash_table_remove (D.28630, sig);
  <D.28632>:
  <D.28629>:
  if (sig != 0B) goto <D.28633>; else goto <D.28634>;
  <D.28633>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28635 = D.28609->delegate_abstract_invoke_cache;
  if (D.28635 != 0B) goto <D.28636>; else goto <D.28637>;
  <D.28636>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28635 = D.28609->delegate_abstract_invoke_cache;
  monoeg_g_hash_table_foreach_remove (D.28635, signature_method_pair_matches_signature, sig);
  <D.28637>:
  <D.28634>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28638 = D.28609->runtime_invoke_direct_cache;
  if (D.28638 != 0B) goto <D.28639>; else goto <D.28640>;
  <D.28639>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28638 = D.28609->runtime_invoke_direct_cache;
  monoeg_g_hash_table_remove (D.28638, method);
  <D.28640>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28641 = D.28609->managed_wrapper_cache;
  if (D.28641 != 0B) goto <D.28642>; else goto <D.28643>;
  <D.28642>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28641 = D.28609->managed_wrapper_cache;
  monoeg_g_hash_table_remove (D.28641, method);
  <D.28643>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28644 = D.28609->native_wrapper_cache;
  if (D.28644 != 0B) goto <D.28645>; else goto <D.28646>;
  <D.28645>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28644 = D.28609->native_wrapper_cache;
  monoeg_g_hash_table_remove (D.28644, method);
  <D.28646>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28647 = D.28609->remoting_invoke_cache;
  if (D.28647 != 0B) goto <D.28648>; else goto <D.28649>;
  <D.28648>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28647 = D.28609->remoting_invoke_cache;
  monoeg_g_hash_table_remove (D.28647, method);
  <D.28649>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28650 = D.28609->synchronized_cache;
  if (D.28650 != 0B) goto <D.28651>; else goto <D.28652>;
  <D.28651>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28650 = D.28609->synchronized_cache;
  monoeg_g_hash_table_remove (D.28650, method);
  <D.28652>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28653 = D.28609->unbox_wrapper_cache;
  if (D.28653 != 0B) goto <D.28654>; else goto <D.28655>;
  <D.28654>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28653 = D.28609->unbox_wrapper_cache;
  monoeg_g_hash_table_remove (D.28653, method);
  <D.28655>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28656 = D.28609->cominterop_invoke_cache;
  if (D.28656 != 0B) goto <D.28657>; else goto <D.28658>;
  <D.28657>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28656 = D.28609->cominterop_invoke_cache;
  monoeg_g_hash_table_remove (D.28656, method);
  <D.28658>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28659 = D.28609->cominterop_wrapper_cache;
  if (D.28659 != 0B) goto <D.28660>; else goto <D.28661>;
  <D.28660>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28659 = D.28609->cominterop_wrapper_cache;
  monoeg_g_hash_table_remove (D.28659, method);
  <D.28661>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28662 = D.28609->thunk_invoke_cache;
  if (D.28662 != 0B) goto <D.28663>; else goto <D.28664>;
  <D.28663>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28662 = D.28609->thunk_invoke_cache;
  monoeg_g_hash_table_remove (D.28662, method);
  <D.28664>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28665 = D.28609->native_func_wrapper_aot_cache;
  if (D.28665 != 0B) goto <D.28666>; else goto <D.28667>;
  <D.28666>:
  D.28608 = method->klass;
  D.28609 = D.28608->image;
  D.28665 = D.28609->native_func_wrapper_aot_cache;
  monoeg_g_hash_table_remove (D.28665, method);
  <D.28667>:
  {
    int ret;

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


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

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


