mono_exceptions_init ()
{
  int mono_aot_only.0;
  void * restore_context_func.1;
  void * call_filter_func.2;
  void * throw_exception_func.3;
  void * rethrow_exception_func.4;
  void * restore_context_func.5;
  struct MonoTrampInfo * info.6;
  void * call_filter_func.7;
  void * throw_exception_func.8;
  void * rethrow_exception_func.9;
  struct MonoDomain * D.23670;
  void * try_more_restore_tramp.10;
  struct MonoDomain * D.23672;
  void * restore_stack_protection_tramp.11;
  void * D.23674;
  void (*<T2609>) (struct MonoException *) D.23675;
  struct MonoRuntimeExceptionHandlingCallbacks cbs;

  try
    {
      mono_aot_only.0 = mono_aot_only;
      if (mono_aot_only.0 != 0) goto <D.23658>; else goto <D.23659>;
      <D.23658>:
      restore_context_func.1 = mono_aot_get_trampoline ("restore_context");
      restore_context_func = restore_context_func.1;
      call_filter_func.2 = mono_aot_get_trampoline ("call_filter");
      call_filter_func = call_filter_func.2;
      throw_exception_func.3 = mono_aot_get_trampoline ("throw_exception");
      throw_exception_func = throw_exception_func.3;
      rethrow_exception_func.4 = mono_aot_get_trampoline ("rethrow_exception");
      rethrow_exception_func = rethrow_exception_func.4;
      goto <D.23664>;
      <D.23659>:
      {
        struct MonoTrampInfo * info;

        try
          {
            restore_context_func.5 = mono_arch_get_restore_context (&info, 0);
            restore_context_func = restore_context_func.5;
            info.6 = info;
            mono_tramp_info_register (info.6);
            call_filter_func.7 = mono_arch_get_call_filter (&info, 0);
            call_filter_func = call_filter_func.7;
            info.6 = info;
            mono_tramp_info_register (info.6);
            throw_exception_func.8 = mono_arch_get_throw_exception (&info, 0);
            throw_exception_func = throw_exception_func.8;
            info.6 = info;
            mono_tramp_info_register (info.6);
            rethrow_exception_func.9 = mono_arch_get_rethrow_exception (&info, 0);
            rethrow_exception_func = rethrow_exception_func.9;
            info.6 = info;
            mono_tramp_info_register (info.6);
          }
        finally
          {
            info = {CLOBBER};
          }
      }
      <D.23664>:
      D.23670 = mono_domain_get ();
      try_more_restore_tramp.10 = mono_create_specific_trampoline (try_more_restore, 8, D.23670, 0B);
      try_more_restore_tramp = try_more_restore_tramp.10;
      D.23672 = mono_domain_get ();
      restore_stack_protection_tramp.11 = mono_create_specific_trampoline (restore_stack_protection, 8, D.23672, 0B);
      restore_stack_protection_tramp = restore_stack_protection_tramp.11;
      mono_arch_exceptions_init ();
      cbs.mono_walk_stack_with_ctx = mono_runtime_walk_stack_with_ctx;
      cbs.mono_walk_stack_with_state = mono_walk_stack_with_state;
      D.23674 = mono_get_throw_exception ();
      D.23675 = (void (*<T2609>) (struct MonoException *)) D.23674;
      cbs.mono_raise_exception = D.23675;
      cbs.mono_raise_exception_with_ctx = mono_raise_exception_with_ctx;
      cbs.mono_exception_walk_trace = mono_exception_walk_trace;
      cbs.mono_install_handler_block_guard = mono_install_handler_block_guard;
      mono_install_eh_callbacks (&cbs);
    }
  finally
    {
      cbs = {CLOBBER};
    }
}


mono_raise_exception_with_ctx (struct MonoException * exc, struct MonoContext * ctx)
{
  mono_handle_exception (ctx, exc);
  mono_restore_context (ctx);
}


mono_runtime_walk_stack_with_ctx (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, struct MonoContext * start_ctx, MonoUnwindOptions unwind_options, void * user_data)
{
  unsigned int mono_jit_tls_id.12;
  int D.23681;

  if (start_ctx == 0B) goto <D.23676>; else goto <D.23677>;
  <D.23676>:
  {
    struct MonoJitTlsData * jit_tls;

    mono_jit_tls_id.12 = mono_jit_tls_id;
    jit_tls = pthread_getspecific (mono_jit_tls_id.12);
    if (jit_tls != 0B) goto <D.23679>; else goto <D.23680>;
    <D.23679>:
    D.23681 = jit_tls->orig_ex_ctx_set;
    if (D.23681 != 0) goto <D.23682>; else goto <D.23683>;
    <D.23682>:
    start_ctx = &jit_tls->orig_ex_ctx;
    <D.23683>:
    <D.23680>:
  }
  <D.23677>:
  mono_walk_stack_with_ctx (func, start_ctx, unwind_options, user_data);
}


restore_stack_protection ()
{
  unsigned int mono_jit_tls_id.13;
  struct MonoDomain * D.23685;
  int D.23686;
  void * try_more_restore_tramp.14;
  struct MonoJitTlsData * jit_tls;
  struct MonoException * ex;

  mono_jit_tls_id.13 = mono_jit_tls_id;
  jit_tls = pthread_getspecific (mono_jit_tls_id.13);
  D.23685 = mono_domain_get ();
  ex = D.23685->stack_overflow_ex;
  D.23686 = try_restore_stack_protection (jit_tls, 4096);
  if (D.23686 != 0) goto <D.23687>; else goto <D.23688>;
  <D.23687>:
  jit_tls->restore_stack_prot = 0B;
  goto <D.23689>;
  <D.23688>:
  try_more_restore_tramp.14 = try_more_restore_tramp;
  jit_tls->restore_stack_prot = try_more_restore_tramp.14;
  <D.23689>:
  ex->trace_ips = 0B;
  ex->stack_trace = 0B;
  mono_raise_exception (ex);
}


try_restore_stack_protection (struct MonoJitTlsData * jit_tls, int extra_bytes)
{
  unsigned int D.23691;
  int unprotect_size.15;
  int D.23693;
  int unprotect_size.16;
  int unprotect_size.17;
  void * D.23697;
  sizetype D.23698;
  char * D.23699;
  sizetype D.23700;
  sizetype D.23701;
  char * D.23702;
  long unsigned int D.23705;
  gboolean D.23706;
  unsigned int unprotect_size.18;
  _Bool D.23708;
  gint32 unprotect_size;

  try
    {
      D.23691 = jit_tls->stack_ovf_guard_size;
      unprotect_size.15 = (int) D.23691;
      unprotect_size = unprotect_size.15;
      goto <D.23464>;
      <D.23463>:
      D.23693 = mono_pagesize ();
      unprotect_size.16 = unprotect_size;
      unprotect_size.17 = unprotect_size.16 - D.23693;
      unprotect_size = unprotect_size.17;
      <D.23464>:
      unprotect_size.16 = unprotect_size;
      if (unprotect_size.16 >= 0) goto <D.23696>; else goto <D.23465>;
      <D.23696>:
      D.23697 = jit_tls->stack_ovf_guard_base;
      unprotect_size.16 = unprotect_size;
      D.23698 = (sizetype) unprotect_size.16;
      D.23699 = D.23697 + D.23698;
      D.23700 = (sizetype) extra_bytes;
      D.23701 = -D.23700;
      D.23702 = &unprotect_size + D.23701;
      if (D.23699 > D.23702) goto <D.23463>; else goto <D.23465>;
      <D.23465>:
      unprotect_size.16 = unprotect_size;
      if (unprotect_size.16 != 0) goto <D.23703>; else goto <D.23704>;
      <D.23703>:
      unprotect_size.16 = unprotect_size;
      D.23705 = (long unsigned int) unprotect_size.16;
      D.23697 = jit_tls->stack_ovf_guard_base;
      mono_mprotect (D.23697, D.23705, 0);
      <D.23704>:
      unprotect_size.16 = unprotect_size;
      unprotect_size.18 = (unsigned int) unprotect_size.16;
      D.23691 = jit_tls->stack_ovf_guard_size;
      D.23708 = unprotect_size.18 == D.23691;
      D.23706 = (gboolean) D.23708;
      return D.23706;
    }
  finally
    {
      unprotect_size = {CLOBBER};
    }
}


try_more_restore ()
{
  unsigned int mono_jit_tls_id.19;
  int D.23712;
  struct MonoJitTlsData * jit_tls;

  mono_jit_tls_id.19 = mono_jit_tls_id;
  jit_tls = pthread_getspecific (mono_jit_tls_id.19);
  D.23712 = try_restore_stack_protection (jit_tls, 500);
  if (D.23712 != 0) goto <D.23713>; else goto <D.23714>;
  <D.23713>:
  jit_tls->restore_stack_prot = 0B;
  <D.23714>:
}


mono_get_throw_exception ()
{
  void * throw_exception_func.20;
  _Bool D.23716;
  long int D.23717;
  long int D.23718;
  void * D.23721;

  throw_exception_func.20 = throw_exception_func;
  D.23716 = throw_exception_func.20 == 0B;
  D.23717 = (long int) D.23716;
  D.23718 = __builtin_expect (D.23717, 0);
  if (D.23718 != 0) goto <D.23719>; else goto <D.23720>;
  <D.23719>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 117, "throw_exception_func");
  <D.23720>:
  D.23721 = throw_exception_func;
  return D.23721;
}


mono_get_rethrow_exception ()
{
  void * rethrow_exception_func.21;
  _Bool D.23724;
  long int D.23725;
  long int D.23726;
  void * D.23729;

  rethrow_exception_func.21 = rethrow_exception_func;
  D.23724 = rethrow_exception_func.21 == 0B;
  D.23725 = (long int) D.23724;
  D.23726 = __builtin_expect (D.23725, 0);
  if (D.23726 != 0) goto <D.23727>; else goto <D.23728>;
  <D.23727>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 124, "rethrow_exception_func");
  <D.23728>:
  D.23729 = rethrow_exception_func;
  return D.23729;
}


mono_get_call_filter ()
{
  void * call_filter_func.22;
  _Bool D.23732;
  long int D.23733;
  long int D.23734;
  void * D.23737;

  call_filter_func.22 = call_filter_func;
  D.23732 = call_filter_func.22 == 0B;
  D.23733 = (long int) D.23732;
  D.23734 = __builtin_expect (D.23733, 0);
  if (D.23734 != 0) goto <D.23735>; else goto <D.23736>;
  <D.23735>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 131, "call_filter_func");
  <D.23736>:
  D.23737 = call_filter_func;
  return D.23737;
}


mono_get_restore_context ()
{
  void * restore_context_func.23;
  _Bool D.23740;
  long int D.23741;
  long int D.23742;
  void * D.23745;

  restore_context_func.23 = restore_context_func;
  D.23740 = restore_context_func.23 == 0B;
  D.23741 = (long int) D.23740;
  D.23742 = __builtin_expect (D.23741, 0);
  if (D.23742 != 0) goto <D.23743>; else goto <D.23744>;
  <D.23743>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 138, "restore_context_func");
  <D.23744>:
  D.23745 = restore_context_func;
  return D.23745;
}


mono_get_throw_corlib_exception ()
{
  void * throw_corlib_exception_func.24;
  void * D.23750;
  int mono_aot_only.25;
  struct MonoTrampInfo * info.26;
  void * code;
  struct MonoTrampInfo * info;

  try
    {
      code = 0B;
      throw_corlib_exception_func.24 = throw_corlib_exception_func;
      if (throw_corlib_exception_func.24 != 0B) goto <D.23748>; else goto <D.23749>;
      <D.23748>:
      D.23750 = throw_corlib_exception_func;
      return D.23750;
      <D.23749>:
      mono_aot_only.25 = mono_aot_only;
      if (mono_aot_only.25 != 0) goto <D.23752>; else goto <D.23753>;
      <D.23752>:
      code = mono_aot_get_trampoline ("throw_corlib_exception");
      goto <D.23754>;
      <D.23753>:
      code = mono_arch_get_throw_corlib_exception (&info, 0);
      info.26 = info;
      mono_tramp_info_register (info.26);
      <D.23754>:
      mono_memory_barrier ();
      throw_corlib_exception_func = code;
      D.23750 = throw_corlib_exception_func;
      return D.23750;
    }
  finally
    {
      info = {CLOBBER};
    }
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_find_jit_info (struct MonoDomain * domain, struct MonoJitTlsData * jit_tls, struct MonoJitInfo * res, struct MonoJitInfo * prev_ji, struct MonoContext * ctx, struct MonoContext * new_ctx, char * * trace, struct MonoLMF * * lmf, int * native_offset, gboolean * managed)
{
  long int D.23758;
  struct MonoJitInfo * D.23767;
  int managed2.27;
  unsigned char D.23776;
  unsigned char D.23777;
  long int D.23780;
  int D.23785;
  sizetype D.23786;
  const char * D.23787;
  long int real_ip.28;
  long int start.29;
  long int D.23791;
  unsigned char D.23796;
  _Bool D.23797;
  _Bool D.23798;
  _Bool D.23799;
  unsigned int offset.30;
  char * D.23805;
  struct MonoMethod * D.23808;
  gchar * D.23809;
  gboolean managed2;
  void * ip;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  try
    {
      D.23758 = ctx->rip;
      ip = (void *) D.23758;
      method = 0B;
      if (trace != 0B) goto <D.23759>; else goto <D.23760>;
      <D.23759>:
      *trace = 0B;
      <D.23760>:
      if (native_offset != 0B) goto <D.23761>; else goto <D.23762>;
      <D.23761>:
      *native_offset = -1;
      <D.23762>:
      if (managed != 0B) goto <D.23763>; else goto <D.23764>;
      <D.23763>:
      *managed = 0;
      <D.23764>:
      ji = find_jit_info (domain, jit_tls, res, prev_ji, ctx, new_ctx, lmf, &managed2);
      if (ji == -1B) goto <D.23765>; else goto <D.23766>;
      <D.23765>:
      D.23767 = ji;
      return D.23767;
      <D.23766>:
      if (ji != 0B) goto <D.23768>; else goto <D.23769>;
      <D.23768>:
      method = jinfo_get_method (ji);
      <D.23769>:
      managed2.27 = managed2;
      if (managed2.27 != 0) goto <D.23770>; else goto <D.23774>;
      <D.23774>:
      if (ji != 0B) goto <D.23775>; else goto <D.23771>;
      <D.23775>:
      D.23776 = BIT_FIELD_REF <*method, 8, 256>;
      D.23777 = D.23776 & 124;
      if (D.23777 != 0) goto <D.23770>; else goto <D.23771>;
      <D.23770>:
      {
        const char * real_ip;
        const char * start;
        gint32 offset;

        start = ji->code_start;
        managed2.27 = managed2;
        if (managed2.27 == 0) goto <D.23778>; else goto <D.23779>;
        <D.23778>:
        D.23780 = new_ctx->rip;
        real_ip = (const char *) D.23780;
        goto <D.23781>;
        <D.23779>:
        real_ip = ip;
        <D.23781>:
        if (real_ip >= start) goto <D.23784>; else goto <D.23782>;
        <D.23784>:
        D.23785 = ji->code_size;
        D.23786 = (sizetype) D.23785;
        D.23787 = start + D.23786;
        if (D.23787 >= real_ip) goto <D.23788>; else goto <D.23782>;
        <D.23788>:
        real_ip.28 = (long int) real_ip;
        start.29 = (long int) start;
        D.23791 = real_ip.28 - start.29;
        offset = (gint32) D.23791;
        goto <D.23783>;
        <D.23782>:
        offset = -1;
        <D.23783>:
        if (native_offset != 0B) goto <D.23792>; else goto <D.23793>;
        <D.23792>:
        *native_offset = offset;
        <D.23793>:
        if (managed != 0B) goto <D.23794>; else goto <D.23795>;
        <D.23794>:
        D.23776 = BIT_FIELD_REF <*method, 8, 256>;
        D.23796 = D.23776 & 124;
        D.23797 = D.23796 == 0;
        D.23798 = D.23796 == 68;
        D.23799 = D.23797 | D.23798;
        if (D.23799 != 0) goto <D.23800>; else goto <D.23801>;
        <D.23800>:
        *managed = 1;
        <D.23801>:
        <D.23795>:
        if (trace != 0B) goto <D.23802>; else goto <D.23803>;
        <D.23802>:
        offset.30 = (unsigned int) offset;
        D.23805 = mono_debug_print_stack_frame (method, offset.30, domain);
        *trace = D.23805;
        <D.23803>:
      }
      goto <D.23772>;
      <D.23771>:
      if (trace != 0B) goto <D.23806>; else goto <D.23807>;
      <D.23806>:
      {
        char * fname;

        D.23808 = jinfo_get_method (res);
        fname = mono_method_full_name (D.23808, 1);
        D.23809 = monoeg_g_strdup_printf ("in (unmanaged) %s", fname);
        *trace = D.23809;
        monoeg_g_free (fname);
      }
      <D.23807>:
      <D.23772>:
      D.23767 = ji;
      return D.23767;
    }
  finally
    {
      managed2 = {CLOBBER};
    }
}


find_jit_info (struct MonoDomain * domain, struct MonoJitTlsData * jit_tls, struct MonoJitInfo * res, struct MonoJitInfo * prev_ji, struct MonoContext * ctx, struct MonoContext * new_ctx, struct MonoLMF * * lmf, gboolean * managed)
{
  long int D.23812;
  void * D.23816;
  int D.23818;
  sizetype D.23819;
  guint8 * D.23820;
  struct MonoJitInfo * D.23826;
  <unnamed type> D.23827;
  struct MonoJitInfo * D.23830;
  struct MonoMethod * D.23833;
  struct StackFrameInfo frame;
  struct MonoJitInfo * ji;
  gboolean err;
  void * ip;

  try
    {
      D.23812 = ctx->rip;
      ip = (void *) D.23812;
      if (prev_ji != 0B) goto <D.23815>; else goto <D.23813>;
      <D.23815>:
      D.23816 = prev_ji->code_start;
      if (D.23816 < ip) goto <D.23817>; else goto <D.23813>;
      <D.23817>:
      D.23816 = prev_ji->code_start;
      D.23818 = prev_ji->code_size;
      D.23819 = (sizetype) D.23818;
      D.23820 = D.23816 + D.23819;
      if (D.23820 > ip) goto <D.23821>; else goto <D.23813>;
      <D.23821>:
      ji = prev_ji;
      goto <D.23814>;
      <D.23813>:
      ji = mini_jit_info_table_find (domain, ip, 0B);
      <D.23814>:
      if (managed != 0B) goto <D.23822>; else goto <D.23823>;
      <D.23822>:
      *managed = 0;
      <D.23823>:
      err = mono_arch_find_jit_info (domain, jit_tls, ji, ctx, new_ctx, lmf, 0B, &frame);
      if (err == 0) goto <D.23824>; else goto <D.23825>;
      <D.23824>:
      D.23826 = -1B;
      return D.23826;
      <D.23825>:
      D.23827 = frame.type;
      switch (D.23827) <default: <D.22962>, case 0: <D.22958>, case 1: <D.22960>, case 2: <D.22959>>
      <D.22958>:
      if (managed != 0B) goto <D.23828>; else goto <D.23829>;
      <D.23828>:
      *managed = 1;
      <D.23829>:
      D.23826 = frame.ji;
      return D.23826;
      <D.22959>:
      D.23830 = frame.ji;
      if (D.23830 != 0B) goto <D.23831>; else goto <D.23832>;
      <D.23831>:
      D.23826 = frame.ji;
      return D.23826;
      <D.23832>:
      memset (res, 0, 48);
      D.23833 = frame.method;
      res->d.method = D.23833;
      D.23826 = res;
      return D.23826;
      <D.22960>:
      {
        struct MonoContext tmp_ctx;

        try
          {
            ji = find_jit_info (domain, jit_tls, res, 0B, new_ctx, &tmp_ctx, lmf, managed);
            memcpy (new_ctx, &tmp_ctx, 136);
            D.23826 = ji;
            return D.23826;
          }
        finally
          {
            tmp_ctx = {CLOBBER};
          }
      }
      <D.22962>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 246);
      D.23826 = 0B;
      return D.23826;
    }
  finally
    {
      frame = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.23839;
  int D.23844;
  void * D.23846;
  long unsigned int D.23847;

  D.23839 = __builtin_constant_p (__len);
  if (D.23839 != 0) goto <D.23840>; else goto <D.23841>;
  <D.23840>:
  if (__len == 0) goto <D.23842>; else goto <D.23843>;
  <D.23842>:
  D.23844 = __builtin_constant_p (__ch);
  if (D.23844 == 0) goto <D.23837>; else goto <D.23845>;
  <D.23845>:
  if (__ch != 0) goto <D.23837>; else goto <D.23838>;
  <D.23837>:
  __warn_memset_zero_len ();
  D.23846 = __dest;
  return D.23846;
  <D.23838>:
  <D.23843>:
  <D.23841>:
  D.23847 = __builtin_object_size (__dest, 0);
  D.23846 = __builtin___memset_chk (__dest, __ch, __len, D.23847);
  return D.23846;
}


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

  D.23850 = __builtin_object_size (__dest, 0);
  D.23849 = __builtin___memcpy_chk (__dest, __src, __len, D.23850);
  return D.23849;
}


jinfo_get_method (struct MonoJitInfo * ji)
{
  struct MonoMethod * D.23852;

  D.23852 = mono_jit_info_get_method (ji);
  return D.23852;
}


mono_find_jit_info_ext (struct MonoDomain * domain, struct MonoJitTlsData * jit_tls, struct MonoJitInfo * prev_ji, struct MonoContext * ctx, struct MonoContext * new_ctx, char * * trace, struct MonoLMF * * lmf, mgreg_t * * save_locations, struct StackFrameInfo * frame)
{
  long int D.23854;
  void * D.23860;
  int D.23862;
  sizetype D.23863;
  guint8 * D.23864;
  struct MonoDomain * target_domain.31;
  gboolean D.23873;
  struct MonoJitInfo * D.23874;
  unsigned char D.23877;
  unsigned char D.23878;
  <unnamed type> D.23881;
  unsigned char D.23886;
  unsigned char D.23887;
  _Bool D.23888;
  _Bool D.23889;
  _Bool D.23890;
  int D.23901;
  unsigned char D.23904;
  long int D.23907;
  int D.23912;
  sizetype D.23913;
  const char * D.23914;
  long int real_ip.32;
  long int start.33;
  long int D.23918;
  int D.23919;
  int D.23922;
  unsigned int D.23923;
  char * D.23924;
  struct MonoMethod * D.23927;
  gchar * D.23930;
  gboolean err;
  void * ip;
  struct MonoJitInfo * ji;
  struct MonoDomain * target_domain;
  struct MonoMethod * method;
  gboolean async;

  try
    {
      D.23854 = ctx->rip;
      ip = (void *) D.23854;
      target_domain = domain;
      method = 0B;
      async = mono_thread_info_is_async_context ();
      if (trace != 0B) goto <D.23855>; else goto <D.23856>;
      <D.23855>:
      *trace = 0B;
      <D.23856>:
      if (prev_ji != 0B) goto <D.23859>; else goto <D.23857>;
      <D.23859>:
      D.23860 = prev_ji->code_start;
      if (D.23860 < ip) goto <D.23861>; else goto <D.23857>;
      <D.23861>:
      D.23860 = prev_ji->code_start;
      D.23862 = prev_ji->code_size;
      D.23863 = (sizetype) D.23862;
      D.23864 = D.23860 + D.23863;
      if (D.23864 > ip) goto <D.23865>; else goto <D.23857>;
      <D.23865>:
      ji = prev_ji;
      goto <D.23858>;
      <D.23857>:
      ji = mini_jit_info_table_find (domain, ip, &target_domain);
      <D.23858>:
      target_domain.31 = target_domain;
      if (target_domain.31 == 0B) goto <D.23867>; else goto <D.23868>;
      <D.23867>:
      target_domain = domain;
      <D.23868>:
      if (save_locations != 0B) goto <D.23869>; else goto <D.23870>;
      <D.23869>:
      memset (save_locations, 0, 128);
      <D.23870>:
      target_domain.31 = target_domain;
      err = mono_arch_find_jit_info (target_domain.31, jit_tls, ji, ctx, new_ctx, lmf, save_locations, frame);
      if (err == 0) goto <D.23871>; else goto <D.23872>;
      <D.23871>:
      D.23873 = 0;
      return D.23873;
      <D.23872>:
      D.23874 = frame->ji;
      if (D.23874 != 0B) goto <D.23875>; else goto <D.23876>;
      <D.23875>:
      D.23874 = frame->ji;
      D.23877 = BIT_FIELD_REF <*D.23874, 8, 280>;
      D.23878 = D.23877 & 1;
      if (D.23878 == 0) goto <D.23879>; else goto <D.23880>;
      <D.23879>:
      D.23874 = frame->ji;
      method = jinfo_get_method (D.23874);
      <D.23880>:
      <D.23876>:
      D.23881 = frame->type;
      if (D.23881 == 0) goto <D.23882>; else goto <D.23883>;
      <D.23882>:
      if (method != 0B) goto <D.23884>; else goto <D.23885>;
      <D.23884>:
      D.23886 = BIT_FIELD_REF <*method, 8, 256>;
      D.23887 = D.23886 & 124;
      D.23888 = D.23887 == 0;
      D.23889 = D.23887 == 68;
      D.23890 = D.23888 | D.23889;
      if (D.23890 != 0) goto <D.23891>; else goto <D.23892>;
      <D.23891>:
      frame->managed = 1;
      <D.23892>:
      <D.23885>:
      <D.23883>:
      D.23881 = frame->type;
      if (D.23881 == 2) goto <D.23893>; else goto <D.23894>;
      <D.23893>:
      frame->ji = 0B;
      frame->method = 0B;
      <D.23894>:
      frame->native_offset = -1;
      target_domain.31 = target_domain;
      frame->domain = target_domain.31;
      frame->async_context = async;
      ji = frame->ji;
      D.23881 = frame->type;
      if (D.23881 == 0) goto <D.23895>; else goto <D.23896>;
      <D.23895>:
      frame->method = method;
      <D.23896>:
      if (ji != 0B) goto <D.23900>; else goto <D.23897>;
      <D.23900>:
      D.23901 = frame->managed;
      if (D.23901 != 0) goto <D.23898>; else goto <D.23902>;
      <D.23902>:
      if (method != 0B) goto <D.23903>; else goto <D.23897>;
      <D.23903>:
      D.23886 = BIT_FIELD_REF <*method, 8, 256>;
      D.23904 = D.23886 & 124;
      if (D.23904 != 0) goto <D.23898>; else goto <D.23897>;
      <D.23898>:
      {
        const char * real_ip;
        const char * start;

        start = ji->code_start;
        D.23901 = frame->managed;
        if (D.23901 == 0) goto <D.23905>; else goto <D.23906>;
        <D.23905>:
        D.23907 = new_ctx->rip;
        real_ip = (const char *) D.23907;
        goto <D.23908>;
        <D.23906>:
        real_ip = ip;
        <D.23908>:
        if (real_ip >= start) goto <D.23911>; else goto <D.23909>;
        <D.23911>:
        D.23912 = ji->code_size;
        D.23913 = (sizetype) D.23912;
        D.23914 = start + D.23913;
        if (D.23914 >= real_ip) goto <D.23915>; else goto <D.23909>;
        <D.23915>:
        real_ip.32 = (long int) real_ip;
        start.33 = (long int) start;
        D.23918 = real_ip.32 - start.33;
        D.23919 = (int) D.23918;
        frame->native_offset = D.23919;
        goto <D.23910>;
        <D.23909>:
        frame->native_offset = -1;
        <D.23910>:
        if (trace != 0B) goto <D.23920>; else goto <D.23921>;
        <D.23920>:
        D.23922 = frame->native_offset;
        D.23923 = (unsigned int) D.23922;
        D.23924 = mono_debug_print_stack_frame (method, D.23923, domain);
        *trace = D.23924;
        <D.23921>:
      }
      goto <D.23899>;
      <D.23897>:
      if (trace != 0B) goto <D.23925>; else goto <D.23926>;
      <D.23925>:
      D.23927 = frame->method;
      if (D.23927 != 0B) goto <D.23928>; else goto <D.23929>;
      <D.23928>:
      {
        char * fname;

        D.23927 = frame->method;
        fname = mono_method_full_name (D.23927, 1);
        D.23930 = monoeg_g_strdup_printf ("in (unmanaged) %s", fname);
        *trace = D.23930;
        monoeg_g_free (fname);
      }
      <D.23929>:
      <D.23926>:
      <D.23899>:
      D.23873 = 1;
      return D.23873;
    }
  finally
    {
      target_domain = {CLOBBER};
    }
}


mono_exception_walk_trace (struct MonoException * ex, gboolean (*MonoExceptionFrameWalk) (struct MonoMethod *, void *, size_t, gboolean, void *) func, void * user_data)
{
  gboolean D.23935;
  long unsigned int D.23936;
  long unsigned int D.23937;
  int D.23938;
  long unsigned int D.23939;
  char * D.23940;
  int D.23941;
  long unsigned int D.23942;
  char * D.23943;
  int D.23946;
  long int ip.34;
  void * D.23951;
  long int D.23952;
  long int D.23953;
  long unsigned int D.23954;
  int D.23955;
  _Bool D.23958;
  struct MonoDomain * domain;
  struct MonoArray * ta;
  int len;
  int i;

  domain = mono_domain_get ();
  ta = ex->trace_ips;
  if (ta == 0B) goto <D.23933>; else goto <D.23934>;
  <D.23933>:
  D.23935 = 0;
  return D.23935;
  <D.23934>:
  D.23936 = mono_array_length (ta);
  D.23937 = D.23936 >> 1;
  len = (int) D.23937;
  i = 0;
  goto <D.23050>;
  <D.23049>:
  {
    void * ip;
    void * generic_info;
    struct MonoJitInfo * ji;

    D.23938 = i * 2;
    D.23939 = (long unsigned int) D.23938;
    D.23940 = mono_array_addr_with_size (ta, 8, D.23939);
    ip = MEM[(void * *)D.23940];
    D.23938 = i * 2;
    D.23941 = D.23938 + 1;
    D.23942 = (long unsigned int) D.23941;
    D.23943 = mono_array_addr_with_size (ta, 8, D.23942);
    generic_info = MEM[(void * *)D.23943];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.23944>; else goto <D.23945>;
    <D.23944>:
    D.23946 = func (0B, ip, 0, 0, user_data);
    if (D.23946 != 0) goto <D.23947>; else goto <D.23948>;
    <D.23947>:
    D.23935 = 1;
    return D.23935;
    <D.23948>:
    goto <D.23949>;
    <D.23945>:
    {
      struct MonoMethod * method;

      method = get_method_from_stack_frame (ji, generic_info);
      ip.34 = (long int) ip;
      D.23951 = ji->code_start;
      D.23952 = (long int) D.23951;
      D.23953 = ip.34 - D.23952;
      D.23954 = (long unsigned int) D.23953;
      D.23951 = ji->code_start;
      D.23955 = func (method, D.23951, D.23954, 1, user_data);
      if (D.23955 != 0) goto <D.23956>; else goto <D.23957>;
      <D.23956>:
      D.23935 = 1;
      return D.23935;
      <D.23957>:
    }
    <D.23949>:
  }
  i = i + 1;
  <D.23050>:
  if (i < len) goto <D.23049>; else goto <D.23051>;
  <D.23051>:
  D.23958 = len > 0;
  D.23935 = (gboolean) D.23958;
  return D.23935;
}


get_method_from_stack_frame (struct MonoJitInfo * ji, void * generic_info)
{
  unsigned char D.23962;
  unsigned char D.23963;
  struct MonoGenericJitInfo * D.23965;
  unsigned char D.23966;
  unsigned char D.23967;
  struct MonoMethod * D.23968;
  struct MonoGenericContext context;
  struct MonoMethod * method;

  try
    {
      D.23962 = BIT_FIELD_REF <*ji, 8, 272>;
      D.23963 = D.23962 & 2;
      if (D.23963 == 0) goto <D.23960>; else goto <D.23964>;
      <D.23964>:
      D.23965 = mono_jit_info_get_generic_jit_info (ji);
      D.23966 = BIT_FIELD_REF <*D.23965, 8, 232>;
      D.23967 = D.23966 & 1;
      if (D.23967 == 0) goto <D.23960>; else goto <D.23961>;
      <D.23960>:
      D.23968 = jinfo_get_method (ji);
      return D.23968;
      <D.23961>:
      context = get_generic_context_from_stack_frame (ji, generic_info);
      method = jinfo_get_method (ji);
      method = mono_method_get_declaring_generic_method (method);
      method = mono_class_inflate_generic_method (method, &context);
      D.23968 = method;
      return D.23968;
    }
  finally
    {
      context = {CLOBBER};
    }
}


get_generic_context_from_stack_frame (struct MonoJitInfo * ji, void * generic_info)
{
  _Bool D.23971;
  long int D.23972;
  long int D.23973;
  unsigned char D.23976;
  unsigned char D.23977;
  _Bool D.23978;
  long int D.23979;
  long int D.23980;
  struct MonoGenericContext * D.23983;
  struct MonoGenericInst * D.23984;
  struct MonoVTable * D.23987;
  struct MonoGenericInst * D.23988;
  struct MonoGenericInst * D.23989;
  _Bool D.23990;
  long int D.23991;
  long int D.23992;
  short unsigned int D.23999;
  int D.24000;
  int D.24001;
  struct MonoClass * D.24003;
  unsigned char D.24004;
  unsigned char D.24005;
  struct MonoGenericClass * D.24006;
  _Bool D.24010;
  long int D.24011;
  long int D.24012;
  struct MonoGenericClass * D.24016;
  struct MonoClass * D.24018;
  struct MonoGenericContainer * D.24022;
  struct MonoGenericContext * D.24023;
  struct MonoGenericInst * D.24024;
  int D.24027;
  _Bool D.24028;
  long int D.24029;
  long int D.24030;
  int D.24034;
  _Bool D.24035;
  long int D.24036;
  long int D.24037;
  struct MonoGenericContext D.24040;
  struct MonoGenericContext context;
  struct MonoClass * class;
  struct MonoClass * method_container_class;
  struct MonoMethod * method;

  try
    {
      context.class_inst = 0B;
      context.method_inst = 0B;
      D.23971 = generic_info == 0B;
      D.23972 = (long int) D.23971;
      D.23973 = __builtin_expect (D.23972, 0);
      if (D.23973 != 0) goto <D.23974>; else goto <D.23975>;
      <D.23974>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 489, "generic_info");
      <D.23975>:
      method = jinfo_get_method (ji);
      D.23976 = BIT_FIELD_REF <*method, 8, 264>;
      D.23977 = D.23976 & 16;
      D.23978 = D.23977 == 0;
      D.23979 = (long int) D.23978;
      D.23980 = __builtin_expect (D.23979, 0);
      if (D.23980 != 0) goto <D.23981>; else goto <D.23982>;
      <D.23981>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 492, "method->is_inflated");
      <D.23982>:
      D.23983 = mono_method_get_context (method);
      D.23984 = D.23983->method_inst;
      if (D.23984 != 0B) goto <D.23985>; else goto <D.23986>;
      <D.23985>:
      {
        struct MonoMethodRuntimeGenericContext * mrgctx;

        mrgctx = generic_info;
        D.23987 = mrgctx->class_vtable;
        class = D.23987->klass;
        D.23988 = mrgctx->method_inst;
        context.method_inst = D.23988;
        D.23989 = context.method_inst;
        D.23990 = D.23989 == 0B;
        D.23991 = (long int) D.23990;
        D.23992 = __builtin_expect (D.23991, 0);
        if (D.23992 != 0) goto <D.23993>; else goto <D.23994>;
        <D.23993>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 498, "context.method_inst");
        <D.23994>:
      }
      goto <D.23995>;
      <D.23986>:
      D.23999 = method->flags;
      D.24000 = (int) D.23999;
      D.24001 = D.24000 & 16;
      if (D.24001 != 0) goto <D.23996>; else goto <D.24002>;
      <D.24002>:
      D.24003 = method->klass;
      D.24004 = BIT_FIELD_REF <*D.24003, 8, 256>;
      D.24005 = D.24004 & 8;
      if (D.24005 != 0) goto <D.23996>; else goto <D.23997>;
      <D.23996>:
      {
        struct MonoVTable * vtable;

        vtable = generic_info;
        class = vtable->klass;
      }
      goto <D.23998>;
      <D.23997>:
      class = generic_info;
      <D.23998>:
      <D.23995>:
      D.24003 = method->klass;
      D.24006 = D.24003->generic_class;
      if (D.24006 != 0B) goto <D.24007>; else goto <D.24008>;
      <D.24007>:
      D.24003 = method->klass;
      D.24006 = D.24003->generic_class;
      method_container_class = D.24006->container_class;
      goto <D.24009>;
      <D.24008>:
      method_container_class = method->klass;
      <D.24009>:
      goto <D.23028>;
      <D.23027>:
      class = class->parent;
      D.24010 = class == 0B;
      D.24011 = (long int) D.24010;
      D.24012 = __builtin_expect (D.24011, 0);
      if (D.24012 != 0) goto <D.24013>; else goto <D.24014>;
      <D.24013>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 516, "class");
      <D.24014>:
      <D.23028>:
      D.24003 = method->klass;
      if (D.24003 != class) goto <D.24015>; else goto <D.23029>;
      <D.24015>:
      D.24016 = class->generic_class;
      if (D.24016 == 0B) goto <D.23027>; else goto <D.24017>;
      <D.24017>:
      D.24016 = class->generic_class;
      D.24018 = D.24016->container_class;
      if (D.24018 != method_container_class) goto <D.23027>; else goto <D.23029>;
      <D.23029>:
      D.24016 = class->generic_class;
      if (D.24016 != 0B) goto <D.24019>; else goto <D.24021>;
      <D.24021>:
      D.24022 = class->generic_container;
      if (D.24022 != 0B) goto <D.24019>; else goto <D.24020>;
      <D.24019>:
      D.24023 = mini_class_get_context (class);
      D.24024 = D.24023->class_inst;
      context.class_inst = D.24024;
      <D.24020>:
      D.24016 = class->generic_class;
      if (D.24016 != 0B) goto <D.24025>; else goto <D.24026>;
      <D.24025>:
      D.24016 = class->generic_class;
      D.24018 = D.24016->container_class;
      D.24027 = mono_class_has_parent_and_ignore_generics (D.24018, method_container_class);
      D.24028 = D.24027 == 0;
      D.24029 = (long int) D.24028;
      D.24030 = __builtin_expect (D.24029, 0);
      if (D.24030 != 0) goto <D.24031>; else goto <D.24032>;
      <D.24031>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 523, "mono_class_has_parent_and_ignore_generics (class->generic_class->container_class, method_container_class)");
      <D.24032>:
      goto <D.24033>;
      <D.24026>:
      D.24034 = mono_class_has_parent_and_ignore_generics (class, method_container_class);
      D.24035 = D.24034 == 0;
      D.24036 = (long int) D.24035;
      D.24037 = __builtin_expect (D.24036, 0);
      if (D.24037 != 0) goto <D.24038>; else goto <D.24039>;
      <D.24038>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 525, "mono_class_has_parent_and_ignore_generics (class, method_container_class)");
      <D.24039>:
      <D.24033>:
      D.24040 = context;
      return D.24040;
    }
  finally
    {
      context = {CLOBBER};
    }
}


ves_icall_System_Exception_get_trace (struct MonoException * ex)
{
  struct MonoString * D.24045;
  long unsigned int D.24046;
  long unsigned int D.24047;
  int D.24048;
  long unsigned int D.24049;
  char * D.24050;
  int D.24051;
  long unsigned int D.24052;
  char * D.24053;
  long int ip.35;
  void * D.24058;
  long int D.24059;
  long int D.24060;
  struct MonoVTable * D.24061;
  struct MonoDomain * D.24062;
  unsigned int address.36;
  char * D.24064;
  struct MonoDomain * domain;
  struct MonoString * res;
  struct MonoArray * ta;
  int i;
  int len;
  struct GString * trace_str;

  domain = mono_domain_get ();
  ta = ex->trace_ips;
  if (ta == 0B) goto <D.24043>; else goto <D.24044>;
  <D.24043>:
  D.24045 = 0B;
  return D.24045;
  <D.24044>:
  D.24046 = mono_array_length (ta);
  D.24047 = D.24046 >> 1;
  len = (int) D.24047;
  trace_str = monoeg_g_string_new ("");
  i = 0;
  goto <D.23068>;
  <D.23067>:
  {
    struct MonoJitInfo * ji;
    void * ip;
    void * generic_info;

    D.24048 = i * 2;
    D.24049 = (long unsigned int) D.24048;
    D.24050 = mono_array_addr_with_size (ta, 8, D.24049);
    ip = MEM[(void * *)D.24050];
    D.24048 = i * 2;
    D.24051 = D.24048 + 1;
    D.24052 = (long unsigned int) D.24051;
    D.24053 = mono_array_addr_with_size (ta, 8, D.24052);
    generic_info = MEM[(void * *)D.24053];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.24054>; else goto <D.24055>;
    <D.24054>:
    monoeg_g_string_append_printf (trace_str, "in (unmanaged) %p\n", ip);
    goto <D.24056>;
    <D.24055>:
    {
      gchar * location;
      gint32 address;
      struct MonoMethod * method;

      method = get_method_from_stack_frame (ji, generic_info);
      ip.35 = (long int) ip;
      D.24058 = ji->code_start;
      D.24059 = (long int) D.24058;
      D.24060 = ip.35 - D.24059;
      address = (gint32) D.24060;
      D.24061 = ex->object.vtable;
      D.24062 = D.24061->domain;
      address.36 = (unsigned int) address;
      location = mono_debug_print_stack_frame (method, address.36, D.24062);
      monoeg_g_string_append_printf (trace_str, "%s\n", location);
      monoeg_g_free (location);
    }
    <D.24056>:
  }
  i = i + 1;
  <D.23068>:
  if (i < len) goto <D.23067>; else goto <D.23069>;
  <D.23069>:
  D.24064 = trace_str->str;
  D.24061 = ex->object.vtable;
  D.24062 = D.24061->domain;
  res = mono_string_new (D.24062, D.24064);
  monoeg_g_string_free (trace_str, 1);
  D.24045 = res;
  return D.24045;
}


ves_icall_get_trace (struct MonoException * exc, gint32 skip, MonoBoolean need_file_info)
{
  struct MonoArray * D.24068;
  struct MonoClass * D.24069;
  long unsigned int D.24070;
  long unsigned int D.24071;
  uintptr_t iftmp.37;
  int D.24075;
  int D.24077;
  long unsigned int D.24078;
  char * D.24079;
  int D.24080;
  long unsigned int D.24081;
  char * D.24082;
  long unsigned int D.24085;
  _Bool D.24086;
  long int D.24087;
  long int D.24088;
  struct MonoMethod * D.24091;
  unsigned char D.24092;
  unsigned char D.24093;
  struct MonoString * D.24096;
  struct MonoString * * D.24097;
  struct MonoReflectionMethod * D.24099;
  struct MonoReflectionMethod * * D.24100;
  long int ip.38;
  void * D.24102;
  long int D.24103;
  long int D.24104;
  int D.24105;
  int D.24106;
  unsigned int D.24107;
  struct MonoMethod * D.24108;
  unsigned int D.24111;
  int D.24112;
  char * D.24119;
  struct MonoString * D.24121;
  struct MonoString * * D.24122;
  unsigned int D.24123;
  int D.24124;
  unsigned int D.24125;
  int D.24126;
  int D.24127;
  struct MonoDomain * domain;
  struct MonoArray * res;
  struct MonoArray * ta;
  struct MonoDebugSourceLocation * location;
  int i;
  int len;

  domain = mono_domain_get ();
  ta = exc->trace_ips;
  if (ta == 0B) goto <D.24066>; else goto <D.24067>;
  <D.24066>:
  D.24069 = mono_defaults.stack_frame_class;
  D.24068 = mono_array_new (domain, D.24069, 0);
  return D.24068;
  <D.24067>:
  D.24070 = mono_array_length (ta);
  D.24071 = D.24070 >> 1;
  len = (int) D.24071;
  if (len > skip) goto <D.24073>; else goto <D.24074>;
  <D.24073>:
  D.24075 = len - skip;
  iftmp.37 = (uintptr_t) D.24075;
  goto <D.24076>;
  <D.24074>:
  iftmp.37 = 0;
  <D.24076>:
  D.24069 = mono_defaults.stack_frame_class;
  res = mono_array_new (domain, D.24069, iftmp.37);
  i = skip;
  goto <D.23091>;
  <D.23090>:
  {
    struct MonoJitInfo * ji;
    struct MonoStackFrame * sf;
    void * ip;
    void * generic_info;
    struct MonoMethod * method;

    D.24069 = mono_defaults.stack_frame_class;
    sf = mono_object_new (domain, D.24069);
    D.24077 = i * 2;
    D.24078 = (long unsigned int) D.24077;
    D.24079 = mono_array_addr_with_size (ta, 8, D.24078);
    ip = MEM[(void * *)D.24079];
    D.24077 = i * 2;
    D.24080 = D.24077 + 1;
    D.24081 = (long unsigned int) D.24080;
    D.24082 = mono_array_addr_with_size (ta, 8, D.24081);
    generic_info = MEM[(void * *)D.24082];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.24083>; else goto <D.24084>;
    <D.24083>:
    {
      void * * __p;

      D.24085 = (long unsigned int) i;
      __p = mono_array_addr_with_size (res, 8, D.24085);
      mono_gc_wbarrier_set_arrayref (res, __p, sf);
    }
    // predicted unlikely by continue predictor.
    goto <D.23087>;
    <D.24084>:
    D.24086 = ji == 0B;
    D.24087 = (long int) D.24086;
    D.24088 = __builtin_expect (D.24087, 0);
    if (D.24088 != 0) goto <D.24089>; else goto <D.24090>;
    <D.24089>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 664, "ji != NULL");
    <D.24090>:
    method = get_method_from_stack_frame (ji, generic_info);
    D.24091 = jinfo_get_method (ji);
    D.24092 = BIT_FIELD_REF <*D.24091, 8, 256>;
    D.24093 = D.24092 & 124;
    if (D.24093 != 0) goto <D.24094>; else goto <D.24095>;
    <D.24094>:
    {
      char * s;

      sf->method = 0B;
      s = mono_method_full_name (method, 1);
      D.24096 = mono_string_new (domain, s);
      D.24097 = &sf->internal_method_name;
      mono_gc_wbarrier_set_field (sf, D.24097, D.24096);
      monoeg_g_free (s);
    }
    goto <D.24098>;
    <D.24095>:
    D.24099 = mono_method_get_object (domain, method, 0B);
    D.24100 = &sf->method;
    mono_gc_wbarrier_set_field (sf, D.24100, D.24099);
    <D.24098>:
    ip.38 = (long int) ip;
    D.24102 = ji->code_start;
    D.24103 = (long int) D.24102;
    D.24104 = ip.38 - D.24103;
    D.24105 = (int) D.24104;
    sf->native_offset = D.24105;
    D.24106 = sf->native_offset;
    D.24107 = (unsigned int) D.24106;
    D.24108 = jinfo_get_method (ji);
    location = mono_debug_lookup_source_location (D.24108, D.24107, domain);
    if (location != 0B) goto <D.24109>; else goto <D.24110>;
    <D.24109>:
    D.24111 = location->il_offset;
    D.24112 = (int) D.24111;
    sf->il_offset = D.24112;
    goto <D.24113>;
    <D.24110>:
    sf->il_offset = 0;
    <D.24113>:
    if (need_file_info != 0) goto <D.24114>; else goto <D.24115>;
    <D.24114>:
    if (location != 0B) goto <D.24118>; else goto <D.24116>;
    <D.24118>:
    D.24119 = location->source_file;
    if (D.24119 != 0B) goto <D.24120>; else goto <D.24116>;
    <D.24120>:
    D.24119 = location->source_file;
    D.24121 = mono_string_new (domain, D.24119);
    D.24122 = &sf->filename;
    mono_gc_wbarrier_set_field (sf, D.24122, D.24121);
    D.24123 = location->row;
    D.24124 = (int) D.24123;
    sf->line = D.24124;
    D.24125 = location->column;
    D.24126 = (int) D.24125;
    sf->column = D.24126;
    goto <D.24117>;
    <D.24116>:
    sf->column = 0;
    D.24127 = sf->column;
    sf->line = D.24127;
    sf->filename = 0B;
    <D.24117>:
    <D.24115>:
    mono_debug_free_source_location (location);
    {
      void * * __p;

      D.24085 = (long unsigned int) i;
      __p = mono_array_addr_with_size (res, 8, D.24085);
      mono_gc_wbarrier_set_arrayref (res, __p, sf);
    }
  }
  <D.23087>:
  i = i + 1;
  <D.23091>:
  if (i < len) goto <D.23090>; else goto <D.23092>;
  <D.23092>:
  D.24068 = res;
  return D.24068;
}


mono_walk_stack_with_ctx (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, struct MonoContext * start_ctx, MonoUnwindOptions unwind_options, void * user_data)
{
  void * D.24132;
  long int mono_walk_stack_with_ctx.39;
  long int stackptr.40;
  struct MonoLMF * D.24137;
  struct MonoDomain * D.24138;
  struct MonoContext extra_ctx;
  struct MonoInternalThread * thread;

  try
    {
      thread = mono_thread_internal_current ();
      if (thread == 0B) goto <D.24129>; else goto <D.24131>;
      <D.24131>:
      D.24132 = thread->jit_data;
      if (D.24132 == 0B) goto <D.24129>; else goto <D.24130>;
      <D.24129>:
      return;
      <D.24130>:
      if (start_ctx == 0B) goto <D.24133>; else goto <D.24134>;
      <D.24133>:
      mono_arch_flush_register_windows ();
      {
        int tmp;
        guint64 stackptr;

        try
          {
            stackptr = (guint64) &tmp;
            mono_arch_flush_register_windows ();
            mono_walk_stack_with_ctx.39 = (long int) mono_walk_stack_with_ctx;
            extra_ctx.rip = mono_walk_stack_with_ctx.39;
            stackptr.40 = (long int) stackptr;
            extra_ctx.rbp = stackptr.40;
            stackptr.40 = (long int) stackptr;
            extra_ctx.rsp = stackptr.40;
          }
        finally
          {
            tmp = {CLOBBER};
          }
      }
      start_ctx = &extra_ctx;
      <D.24134>:
      D.24137 = mono_get_lmf ();
      D.24132 = thread->jit_data;
      D.24138 = mono_domain_get ();
      mono_walk_stack_full (func, start_ctx, D.24138, D.24132, D.24137, unwind_options, user_data);
    }
  finally
    {
      extra_ctx = {CLOBBER};
    }
}


mono_walk_stack_full (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, struct MonoContext * start_ctx, struct MonoDomain * domain, struct MonoJitTlsData * jit_tls, struct MonoLMF * lmf, MonoUnwindOptions unwind_options, void * user_data)
{
  int unwind_options.41;
  _Bool D.24143;
  long int D.24144;
  long int D.24145;
  _Bool D.24148;
  long int D.24149;
  long int D.24150;
  _Bool D.24153;
  long int D.24154;
  long int D.24155;
  _Bool D.24160;
  long int D.24161;
  long int D.24162;
  struct MonoLMF * lmf.42;
  mgreg_t * * iftmp.43;
  unsigned int D.24174;
  struct MonoJitInfo * D.24176;
  int D.24178;
  unsigned int D.24179;
  struct MonoMethod * D.24180;
  gint iftmp.44;
  unsigned int D.24184;
  unsigned int D.24188;
  void * D.24191;
  struct MonoMethod * D.24192;
  struct MonoMethod * D.24193;
  int D.24196;
  mgreg_t * D.24201;
  long int D.24204;
  void * D.24205;
  void * D.24206;
  gint il_offset;
  gint i;
  struct MonoContext ctx;
  struct MonoContext new_ctx;
  struct StackFrameInfo frame;
  gboolean res;
  mgreg_t * reg_locations[16];
  mgreg_t * new_reg_locations[16];
  gboolean get_reg_locations;
  gboolean async;

  try
    {
      unwind_options.41 = (int) unwind_options;
      get_reg_locations = unwind_options.41 & 4;
      async = mono_thread_info_is_async_context ();
      D.24143 = start_ctx == 0B;
      D.24144 = (long int) D.24143;
      D.24145 = __builtin_expect (D.24144, 0);
      if (D.24145 != 0) goto <D.24146>; else goto <D.24147>;
      <D.24146>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 817, "start_ctx");
      <D.24147>:
      D.24148 = domain == 0B;
      D.24149 = (long int) D.24148;
      D.24150 = __builtin_expect (D.24149, 0);
      if (D.24150 != 0) goto <D.24151>; else goto <D.24152>;
      <D.24151>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 818, "domain");
      <D.24152>:
      D.24153 = jit_tls == 0B;
      D.24154 = (long int) D.24153;
      D.24155 = __builtin_expect (D.24154, 0);
      if (D.24155 != 0) goto <D.24156>; else goto <D.24157>;
      <D.24156>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 819, "jit_tls");
      <D.24157>:
      if (async != 0) goto <D.24158>; else goto <D.24159>;
      <D.24158>:
      D.24160 = unwind_options != 0;
      D.24161 = (long int) D.24160;
      D.24162 = __builtin_expect (D.24161, 0);
      if (D.24162 != 0) goto <D.24163>; else goto <D.24164>;
      <D.24163>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 824, "unwind_options == MONO_UNWIND_NONE");
      <D.24164>:
      <D.24159>:
      memcpy (&ctx, start_ctx, 136);
      memset (&reg_locations, 0, 128);
      goto <D.23147>;
      <D.23146>:
      lmf.42 = lmf;
      frame.lmf = lmf.42;
      if (get_reg_locations != 0) goto <D.24167>; else goto <D.24168>;
      <D.24167>:
      iftmp.43 = &new_reg_locations;
      goto <D.24169>;
      <D.24168>:
      iftmp.43 = 0B;
      <D.24169>:
      res = mono_find_jit_info_ext (domain, jit_tls, 0B, &ctx, &new_ctx, 0B, &lmf, iftmp.43, &frame);
      if (res == 0) goto <D.24170>; else goto <D.24171>;
      <D.24170>:
      return;
      <D.24171>:
      D.24174 = unwind_options & 1;
      if (D.24174 != 0) goto <D.24175>; else goto <D.24172>;
      <D.24175>:
      D.24176 = frame.ji;
      if (D.24176 != 0B) goto <D.24177>; else goto <D.24172>;
      <D.24177>:
      {
        struct MonoDebugSourceLocation * source;

        D.24178 = frame.native_offset;
        D.24179 = (unsigned int) D.24178;
        D.24176 = frame.ji;
        D.24180 = jinfo_get_method (D.24176);
        source = mono_debug_lookup_source_location (D.24180, D.24179, domain);
        if (source != 0B) goto <D.24182>; else goto <D.24183>;
        <D.24182>:
        D.24184 = source->il_offset;
        iftmp.44 = (gint) D.24184;
        goto <D.24185>;
        <D.24183>:
        iftmp.44 = -1;
        <D.24185>:
        il_offset = iftmp.44;
        mono_debug_free_source_location (source);
      }
      goto <D.24173>;
      <D.24172>:
      il_offset = -1;
      <D.24173>:
      frame.il_offset = il_offset;
      D.24188 = unwind_options & 2;
      if (D.24188 != 0) goto <D.24189>; else goto <D.24186>;
      <D.24189>:
      D.24176 = frame.ji;
      if (D.24176 != 0B) goto <D.24190>; else goto <D.24186>;
      <D.24190>:
      D.24176 = frame.ji;
      D.24191 = get_generic_info_from_stack_frame (D.24176, &ctx);
      D.24176 = frame.ji;
      D.24192 = get_method_from_stack_frame (D.24176, D.24191);
      frame.actual_method = D.24192;
      goto <D.24187>;
      <D.24186>:
      D.24193 = frame.method;
      frame.actual_method = D.24193;
      <D.24187>:
      if (get_reg_locations != 0) goto <D.24194>; else goto <D.24195>;
      <D.24194>:
      frame.reg_locations = &reg_locations;
      <D.24195>:
      D.24196 = func (&frame, &ctx, user_data);
      if (D.24196 != 0) goto <D.24197>; else goto <D.24198>;
      <D.24197>:
      return;
      <D.24198>:
      if (get_reg_locations != 0) goto <D.24199>; else goto <D.24200>;
      <D.24199>:
      i = 0;
      goto <D.23144>;
      <D.23143>:
      D.24201 = new_reg_locations[i];
      if (D.24201 != 0B) goto <D.24202>; else goto <D.24203>;
      <D.24202>:
      D.24201 = new_reg_locations[i];
      reg_locations[i] = D.24201;
      <D.24203>:
      i = i + 1;
      <D.23144>:
      if (i <= 15) goto <D.23143>; else goto <D.23145>;
      <D.23145>:
      <D.24200>:
      ctx = new_ctx;
      <D.23147>:
      D.24204 = ctx.rsp;
      D.24205 = (void *) D.24204;
      D.24206 = jit_tls->end_of_stack;
      if (D.24205 < D.24206) goto <D.23146>; else goto <D.23148>;
      <D.23148>:
    }
  finally
    {
      ctx = {CLOBBER};
      new_ctx = {CLOBBER};
      frame = {CLOBBER};
      reg_locations = {CLOBBER};
      new_reg_locations = {CLOBBER};
    }
}


get_generic_info_from_stack_frame (struct MonoJitInfo * ji, struct MonoContext * ctx)
{
  unsigned char D.24210;
  unsigned char D.24211;
  void * D.24214;
  unsigned char D.24215;
  unsigned char D.24216;
  int D.24219;
  long int D.24222;
  unsigned int D.24223;
  void * D.24224;
  long int D.24225;
  unsigned int D.24226;
  unsigned int D.24227;
  struct MonoDwarfLocListEntry * D.24228;
  long unsigned int D.24229;
  long unsigned int D.24230;
  int D.24233;
  int D.24236;
  int D.24238;
  int D.24241;
  long int D.24242;
  int D.24244;
  sizetype D.24245;
  long int D.24246;
  sizetype D.24247;
  sizetype D.24248;
  void * * D.24249;
  _Bool D.24250;
  long int D.24251;
  long int D.24252;
  unsigned char D.24256;
  unsigned char D.24259;
  int D.24260;
  long int D.24261;
  int D.24263;
  sizetype D.24264;
  long int D.24265;
  sizetype D.24266;
  sizetype D.24267;
  void * * D.24268;
  struct MonoGenericContext * D.24269;
  struct MonoGenericInst * D.24270;
  short unsigned int D.24275;
  int D.24276;
  int D.24277;
  struct MonoClass * D.24279;
  unsigned char D.24280;
  unsigned char D.24281;
  struct MonoVTable * D.24282;
  struct MonoGenericJitInfo * gi;
  struct MonoMethod * method;
  void * info;

  D.24210 = BIT_FIELD_REF <*ji, 8, 272>;
  D.24211 = D.24210 & 2;
  if (D.24211 == 0) goto <D.24212>; else goto <D.24213>;
  <D.24212>:
  D.24214 = 0B;
  return D.24214;
  <D.24213>:
  gi = mono_jit_info_get_generic_jit_info (ji);
  D.24215 = BIT_FIELD_REF <*gi, 8, 232>;
  D.24216 = D.24215 & 1;
  if (D.24216 == 0) goto <D.24217>; else goto <D.24218>;
  <D.24217>:
  D.24214 = 0B;
  return D.24214;
  <D.24218>:
  info = 0B;
  D.24219 = gi->nlocs;
  if (D.24219 != 0) goto <D.24220>; else goto <D.24221>;
  <D.24220>:
  {
    int offset;
    int i;

    D.24222 = ctx->rip;
    D.24223 = (unsigned int) D.24222;
    D.24224 = ji->code_start;
    D.24225 = (long int) D.24224;
    D.24226 = (unsigned int) D.24225;
    D.24227 = D.24223 - D.24226;
    offset = (int) D.24227;
    i = 0;
    goto <D.23015>;
    <D.23014>:
    {
      struct MonoDwarfLocListEntry * entry;

      D.24228 = gi->locations;
      D.24229 = (long unsigned int) i;
      D.24230 = D.24229 * 20;
      entry = D.24228 + D.24230;
      D.24233 = entry->from;
      if (D.24233 <= offset) goto <D.24234>; else goto <D.24235>;
      <D.24234>:
      D.24236 = entry->to;
      if (D.24236 > offset) goto <D.24231>; else goto <D.24237>;
      <D.24237>:
      D.24236 = entry->to;
      if (D.24236 == 0) goto <D.24231>; else goto <D.24232>;
      <D.24231>:
      D.24238 = entry->is_reg;
      if (D.24238 != 0) goto <D.24239>; else goto <D.24240>;
      <D.24239>:
      D.24241 = entry->reg;
      D.24242 = mono_arch_context_get_int_reg (ctx, D.24241);
      info = (void *) D.24242;
      goto <D.24243>;
      <D.24240>:
      D.24244 = entry->offset;
      D.24245 = (sizetype) D.24244;
      D.24241 = entry->reg;
      D.24246 = mono_arch_context_get_int_reg (ctx, D.24241);
      D.24247 = (sizetype) D.24246;
      D.24248 = D.24245 + D.24247;
      D.24249 = (void * *) D.24248;
      info = *D.24249;
      <D.24243>:
      goto <D.23013>;
      <D.24232>:
      <D.24235>:
    }
    i = i + 1;
    <D.23015>:
    D.24219 = gi->nlocs;
    if (D.24219 > i) goto <D.23014>; else goto <D.23013>;
    <D.23013>:
    D.24219 = gi->nlocs;
    D.24250 = D.24219 <= i;
    D.24251 = (long int) D.24250;
    D.24252 = __builtin_expect (D.24251, 0);
    if (D.24252 != 0) goto <D.24253>; else goto <D.24254>;
    <D.24253>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 460, "i < gi->nlocs");
    <D.24254>:
  }
  goto <D.24255>;
  <D.24221>:
  D.24215 = BIT_FIELD_REF <*gi, 8, 232>;
  D.24256 = D.24215 & 2;
  if (D.24256 != 0) goto <D.24257>; else goto <D.24258>;
  <D.24257>:
  D.24259 = gi->this_reg;
  D.24260 = (int) D.24259;
  D.24261 = mono_arch_context_get_int_reg (ctx, D.24260);
  info = (void *) D.24261;
  goto <D.24262>;
  <D.24258>:
  D.24263 = gi->this_offset;
  D.24264 = (sizetype) D.24263;
  D.24259 = gi->this_reg;
  D.24260 = (int) D.24259;
  D.24265 = mono_arch_context_get_int_reg (ctx, D.24260);
  D.24266 = (sizetype) D.24265;
  D.24267 = D.24264 + D.24266;
  D.24268 = (void * *) D.24267;
  info = *D.24268;
  <D.24262>:
  <D.24255>:
  method = jinfo_get_method (ji);
  D.24269 = mono_method_get_context (method);
  D.24270 = D.24269->method_inst;
  if (D.24270 != 0B) goto <D.24271>; else goto <D.24272>;
  <D.24271>:
  D.24214 = info;
  return D.24214;
  <D.24272>:
  D.24275 = method->flags;
  D.24276 = (int) D.24275;
  D.24277 = D.24276 & 16;
  if (D.24277 != 0) goto <D.24273>; else goto <D.24278>;
  <D.24278>:
  D.24279 = method->klass;
  D.24280 = BIT_FIELD_REF <*D.24279, 8, 256>;
  D.24281 = D.24280 & 8;
  if (D.24281 != 0) goto <D.24273>; else goto <D.24274>;
  <D.24273>:
  D.24214 = info;
  return D.24214;
  <D.24274>:
  {
    struct MonoObject * this_obj;

    this_obj = info;
    D.24282 = this_obj->vtable;
    D.24214 = D.24282->klass;
    return D.24214;
  }
}


mono_walk_stack_with_state (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, struct MonoThreadUnwindState * state, MonoUnwindOptions unwind_options, void * user_data)
{
  int D.24286;
  _Bool D.24287;
  long int D.24288;
  long int D.24289;
  int D.24292;
  int D.24295;
  _Bool D.24296;
  long int D.24297;
  long int D.24298;
  void * D.24301;
  void * D.24302;
  void * D.24303;
  struct MonoContext * D.24304;
  struct MonoThreadUnwindState extra_state;

  try
    {
      if (state == 0B) goto <D.24284>; else goto <D.24285>;
      <D.24284>:
      D.24286 = mono_thread_info_is_async_context ();
      D.24287 = D.24286 != 0;
      D.24288 = (long int) D.24287;
      D.24289 = __builtin_expect (D.24288, 0);
      if (D.24289 != 0) goto <D.24290>; else goto <D.24291>;
      <D.24290>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 765, "!mono_thread_info_is_async_context ()");
      <D.24291>:
      D.24292 = mono_thread_state_init_from_current (&extra_state);
      if (D.24292 == 0) goto <D.24293>; else goto <D.24294>;
      <D.24293>:
      return;
      <D.24294>:
      state = &extra_state;
      <D.24285>:
      D.24295 = state->valid;
      D.24296 = D.24295 == 0;
      D.24297 = (long int) D.24296;
      D.24298 = __builtin_expect (D.24297, 0);
      if (D.24298 != 0) goto <D.24299>; else goto <D.24300>;
      <D.24299>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 771, "state->valid");
      <D.24300>:
      D.24301 = state->unwind_data[1];
      D.24302 = state->unwind_data[2];
      D.24303 = state->unwind_data[0];
      D.24304 = &state->ctx;
      mono_walk_stack_full (func, D.24304, D.24303, D.24302, D.24301, unwind_options, user_data);
    }
  finally
    {
      extra_state = {CLOBBER};
    }
}


mono_walk_stack (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, MonoUnwindOptions options, void * user_data)
{
  int D.24308;
  struct MonoThreadUnwindState state;

  try
    {
      D.24308 = mono_thread_state_init_from_current (&state);
      if (D.24308 == 0) goto <D.24309>; else goto <D.24310>;
      <D.24309>:
      return;
      <D.24310>:
      mono_walk_stack_with_state (func, &state, options, user_data);
    }
  finally
    {
      state = {CLOBBER};
    }
}


ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, struct MonoReflectionMethod * * method, gint32 * iloffset, gint32 * native_offset, struct MonoString * * file, gint32 * line, gint32 * column)
{
  unsigned int mono_jit_tls_id.45;
  struct MonoLMF * lmf.46;
  long int ves_icall_get_frame_info.47;
  long int stackptr.48;
  MonoBoolean D.24320;
  <unnamed type> D.24321;
  unsigned int D.24322;
  int D.24325;
  unsigned char D.24326;
  unsigned char D.24327;
  _Bool D.24328;
  _Bool D.24329;
  _Bool D.24330;
  unsigned char D.24333;
  void * D.24336;
  struct MonoReflectionMethod * D.24337;
  int D.24338;
  unsigned int D.24339;
  unsigned int D.24342;
  int D.24343;
  char * D.24349;
  struct MonoString * D.24350;
  unsigned int D.24351;
  int D.24352;
  unsigned int D.24353;
  int D.24354;
  int D.24356;
  struct MonoDomain * domain;
  struct MonoJitTlsData * jit_tls;
  struct MonoLMF * lmf;
  struct MonoJitInfo * ji;
  struct MonoContext ctx;
  struct MonoContext new_ctx;
  struct MonoDebugSourceLocation * location;
  struct MonoMethod * jmethod;
  struct MonoMethod * actual_method;
  struct StackFrameInfo frame;
  gboolean res;

  try
    {
      domain = mono_domain_get ();
      mono_jit_tls_id.45 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.45);
      lmf.46 = mono_get_lmf ();
      lmf = lmf.46;
      ji = 0B;
      jmethod = 0B;
      mono_arch_flush_register_windows ();
      {
        int tmp;
        guint64 stackptr;

        try
          {
            stackptr = (guint64) &tmp;
            mono_arch_flush_register_windows ();
            ves_icall_get_frame_info.47 = (long int) ves_icall_get_frame_info;
            ctx.rip = ves_icall_get_frame_info.47;
            stackptr.48 = (long int) stackptr;
            ctx.rbp = stackptr.48;
            stackptr.48 = (long int) stackptr;
            ctx.rsp = stackptr.48;
          }
        finally
          {
            tmp = {CLOBBER};
          }
      }
      new_ctx = ctx;
      <D.23173>:
      ctx = new_ctx;
      res = mono_find_jit_info_ext (domain, jit_tls, 0B, &ctx, &new_ctx, 0B, &lmf, 0B, &frame);
      if (res == 0) goto <D.24318>; else goto <D.24319>;
      <D.24318>:
      D.24320 = 0;
      return D.24320;
      <D.24319>:
      D.24321 = frame.type;
      D.24322 = D.24321 + 4294967295;
      if (D.24322 <= 1) goto <D.24323>; else goto <D.24324>;
      <D.24323>:
      // predicted unlikely by continue predictor.
      goto <D.23172>;
      <D.24324>:
      ji = frame.ji;
      D.24325 = frame.native_offset;
      *native_offset = D.24325;
      jmethod = jinfo_get_method (ji);
      D.24326 = BIT_FIELD_REF <*jmethod, 8, 256>;
      D.24327 = D.24326 & 124;
      D.24328 = D.24327 != 0;
      D.24329 = D.24327 != 68;
      D.24330 = D.24328 & D.24329;
      if (D.24330 != 0) goto <D.24331>; else goto <D.24332>;
      <D.24331>:
      D.24326 = BIT_FIELD_REF <*jmethod, 8, 256>;
      D.24333 = D.24326 & 124;
      if (D.24333 != 24) goto <D.24334>; else goto <D.24335>;
      <D.24334>:
      // predicted unlikely by continue predictor.
      goto <D.23172>;
      <D.24335>:
      <D.24332>:
      skip = skip + -1;
      <D.23172>:
      if (skip >= 0) goto <D.23173>; else goto <D.23174>;
      <D.23174>:
      D.24336 = get_generic_info_from_stack_frame (ji, &ctx);
      actual_method = get_method_from_stack_frame (ji, D.24336);
      D.24337 = mono_method_get_object (domain, actual_method, 0B);
      mono_gc_wbarrier_generic_store (method, D.24337);
      D.24338 = *native_offset;
      D.24339 = (unsigned int) D.24338;
      location = mono_debug_lookup_source_location (jmethod, D.24339, domain);
      if (location != 0B) goto <D.24340>; else goto <D.24341>;
      <D.24340>:
      D.24342 = location->il_offset;
      D.24343 = (int) D.24342;
      *iloffset = D.24343;
      goto <D.24344>;
      <D.24341>:
      *iloffset = 0;
      <D.24344>:
      if (need_file_info != 0) goto <D.24345>; else goto <D.24346>;
      <D.24345>:
      if (location != 0B) goto <D.24347>; else goto <D.24348>;
      <D.24347>:
      D.24349 = location->source_file;
      D.24350 = mono_string_new (domain, D.24349);
      mono_gc_wbarrier_generic_store (file, D.24350);
      D.24351 = location->row;
      D.24352 = (int) D.24351;
      *line = D.24352;
      D.24353 = location->column;
      D.24354 = (int) D.24353;
      *column = D.24354;
      goto <D.24355>;
      <D.24348>:
      *file = 0B;
      *column = 0;
      D.24356 = *column;
      *line = D.24356;
      <D.24355>:
      <D.24346>:
      mono_debug_free_source_location (location);
      D.24320 = 1;
      return D.24320;
    }
  finally
    {
      lmf = {CLOBBER};
      ctx = {CLOBBER};
      new_ctx = {CLOBBER};
      frame = {CLOBBER};
    }
}


ves_icall_System_Security_SecurityFrame_GetSecurityFrame (gint32 skip)
{
  unsigned int skip.49;
  struct MonoSecurityFrame * D.24360;
  struct MonoSecurityFrame * iftmp.50;
  unsigned int D.24362;
  struct MonoFrameSecurityInfo si;

  try
    {
      skip.49 = (unsigned int) skip;
      si.skips = skip.49;
      si.frame = 0B;
      mono_walk_stack (callback_get_first_frame_security_info, 2, &si);
      D.24362 = si.skips;
      if (D.24362 == 0) goto <D.24363>; else goto <D.24364>;
      <D.24363>:
      iftmp.50 = si.frame;
      goto <D.24365>;
      <D.24364>:
      iftmp.50 = 0B;
      <D.24365>:
      D.24360 = iftmp.50;
      return D.24360;
    }
  finally
    {
      si = {CLOBBER};
    }
}


callback_get_first_frame_security_info (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  gboolean D.24370;
  unsigned char D.24373;
  unsigned char D.24374;
  _Bool D.24375;
  _Bool D.24376;
  _Bool D.24377;
  unsigned char D.24379;
  unsigned int D.24382;
  unsigned int D.24385;
  struct MonoDomain * D.24386;
  struct MonoSecurityFrame * D.24387;
  struct MonoFrameSecurityInfo * si;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  si = data;
  ji = frame->ji;
  if (ji == 0B) goto <D.24368>; else goto <D.24369>;
  <D.24368>:
  D.24370 = 0;
  return D.24370;
  <D.24369>:
  method = jinfo_get_method (ji);
  D.24373 = BIT_FIELD_REF <*method, 8, 256>;
  D.24374 = D.24373 & 124;
  D.24375 = D.24374 == 16;
  D.24376 = D.24374 == 40;
  D.24377 = D.24375 | D.24376;
  if (D.24377 != 0) goto <D.24371>; else goto <D.24378>;
  <D.24378>:
  D.24373 = BIT_FIELD_REF <*method, 8, 256>;
  D.24379 = D.24373 & 124;
  if (D.24379 == 44) goto <D.24371>; else goto <D.24380>;
  <D.24380>:
  D.24373 = BIT_FIELD_REF <*method, 8, 256>;
  D.24379 = D.24373 & 124;
  if (D.24379 == 36) goto <D.24371>; else goto <D.24381>;
  <D.24381>:
  D.24373 = BIT_FIELD_REF <*method, 8, 256>;
  D.24379 = D.24373 & 124;
  if (D.24379 == 32) goto <D.24371>; else goto <D.24372>;
  <D.24371>:
  D.24370 = 0;
  return D.24370;
  <D.24372>:
  D.24382 = si->skips;
  if (D.24382 != 0) goto <D.24383>; else goto <D.24384>;
  <D.24383>:
  D.24382 = si->skips;
  D.24385 = D.24382 + 4294967295;
  si->skips = D.24385;
  D.24370 = 0;
  return D.24370;
  <D.24384>:
  D.24386 = frame->domain;
  D.24387 = mono_declsec_create_frame (D.24386, ji);
  si->frame = D.24387;
  D.24370 = 1;
  return D.24370;
}


ves_icall_System_Security_SecurityFrame_GetSecurityStack (gint32 skip)
{
  unsigned int skip.51;
  unsigned int D.24390;
  long unsigned int D.24391;
  struct MonoClass * D.24392;
  struct MonoDomain * D.24393;
  struct MonoArray * D.24394;
  struct MonoArray * D.24395;
  struct MonoSecurityStack ss;

  try
    {
      skip.51 = (unsigned int) skip;
      ss.skips = skip.51;
      ss.count = 0;
      ss.maximum = 6;
      D.24390 = ss.maximum;
      D.24391 = (long unsigned int) D.24390;
      D.24392 = mono_defaults.runtimesecurityframe_class;
      D.24393 = mono_domain_get ();
      D.24394 = mono_array_new (D.24393, D.24392, D.24391);
      ss.stack = D.24394;
      mono_walk_stack (callback_get_stack_frames_security_info, 2, &ss);
      D.24395 = ss.stack;
      return D.24395;
    }
  finally
    {
      ss = {CLOBBER};
    }
}


callback_get_stack_frames_security_info (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  gboolean D.24400;
  unsigned char D.24403;
  unsigned char D.24404;
  _Bool D.24405;
  _Bool D.24406;
  _Bool D.24407;
  unsigned char D.24409;
  unsigned int D.24412;
  unsigned int D.24415;
  unsigned int D.24416;
  unsigned int D.24417;
  unsigned int D.24420;
  unsigned int D.24421;
  long unsigned int D.24422;
  struct MonoArray * D.24423;
  struct MonoDomain * D.24424;
  struct MonoSecurityFrame * D.24425;
  struct MonoSecurityStack * ss;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  ss = data;
  ji = frame->ji;
  if (ji == 0B) goto <D.24398>; else goto <D.24399>;
  <D.24398>:
  D.24400 = 0;
  return D.24400;
  <D.24399>:
  method = jinfo_get_method (ji);
  D.24403 = BIT_FIELD_REF <*method, 8, 256>;
  D.24404 = D.24403 & 124;
  D.24405 = D.24404 == 16;
  D.24406 = D.24404 == 40;
  D.24407 = D.24405 | D.24406;
  if (D.24407 != 0) goto <D.24401>; else goto <D.24408>;
  <D.24408>:
  D.24403 = BIT_FIELD_REF <*method, 8, 256>;
  D.24409 = D.24403 & 124;
  if (D.24409 == 44) goto <D.24401>; else goto <D.24410>;
  <D.24410>:
  D.24403 = BIT_FIELD_REF <*method, 8, 256>;
  D.24409 = D.24403 & 124;
  if (D.24409 == 36) goto <D.24401>; else goto <D.24411>;
  <D.24411>:
  D.24403 = BIT_FIELD_REF <*method, 8, 256>;
  D.24409 = D.24403 & 124;
  if (D.24409 == 32) goto <D.24401>; else goto <D.24402>;
  <D.24401>:
  D.24400 = 0;
  return D.24400;
  <D.24402>:
  D.24412 = ss->skips;
  if (D.24412 != 0) goto <D.24413>; else goto <D.24414>;
  <D.24413>:
  D.24412 = ss->skips;
  D.24415 = D.24412 + 4294967295;
  ss->skips = D.24415;
  D.24400 = 0;
  return D.24400;
  <D.24414>:
  D.24416 = ss->count;
  D.24417 = ss->maximum;
  if (D.24416 == D.24417) goto <D.24418>; else goto <D.24419>;
  <D.24418>:
  grow_array (ss);
  <D.24419>:
  {
    void * * __p;

    D.24416 = ss->count;
    D.24420 = D.24416;
    D.24421 = D.24420 + 1;
    ss->count = D.24421;
    D.24422 = (long unsigned int) D.24420;
    D.24423 = ss->stack;
    __p = mono_array_addr_with_size (D.24423, 8, D.24422);
    D.24424 = frame->domain;
    D.24425 = mono_declsec_create_frame (D.24424, ji);
    D.24423 = ss->stack;
    mono_gc_wbarrier_set_arrayref (D.24423, __p, D.24425);
  }
  D.24400 = 0;
  return D.24400;
}


grow_array (struct MonoSecurityStack * stack)
{
  unsigned int D.24427;
  long unsigned int D.24428;
  struct MonoClass * D.24429;
  long unsigned int D.24430;
  struct MonoArray * D.24431;
  char * D.24432;
  unsigned int i.52;
  struct MonoDomain * domain;
  guint32 newsize;
  struct MonoArray * newstack;
  int i;

  domain = mono_domain_get ();
  D.24427 = stack->maximum;
  newsize = D.24427 << 1;
  D.24428 = (long unsigned int) newsize;
  D.24429 = mono_defaults.runtimesecurityframe_class;
  newstack = mono_array_new (domain, D.24429, D.24428);
  i = 0;
  goto <D.23207>;
  <D.23206>:
  {
    void * frame;

    D.24430 = (long unsigned int) i;
    D.24431 = stack->stack;
    D.24432 = mono_array_addr_with_size (D.24431, 8, D.24430);
    frame = MEM[(void * *)D.24432];
    {
      void * * __p;

      D.24430 = (long unsigned int) i;
      __p = mono_array_addr_with_size (newstack, 8, D.24430);
      mono_gc_wbarrier_set_arrayref (newstack, __p, frame);
    }
  }
  i = i + 1;
  <D.23207>:
  i.52 = (unsigned int) i;
  D.24427 = stack->maximum;
  if (i.52 < D.24427) goto <D.23206>; else goto <D.23208>;
  <D.23208>:
  stack->maximum = newsize;
  stack->stack = newstack;
}


mini_jit_info_table_find (struct MonoDomain * domain, char * addr, struct MonoDomain * * out_domain)
{
  struct MonoJitInfo * D.24440;
  struct MonoDomain * D.24441;
  struct MonoDomain * D.24444;
  struct MonoDomain * D.24449;
  void * * iftmp.53;
  void * D.24453;
  void * D.24457;
  struct MonoDomain * D.24460;
  struct MonoJitInfo * ji;
  struct MonoInternalThread * t;
  void * * refs;

  t = mono_thread_internal_current ();
  if (out_domain != 0B) goto <D.24434>; else goto <D.24435>;
  <D.24434>:
  *out_domain = 0B;
  <D.24435>:
  ji = mono_jit_info_table_find (domain, addr);
  if (ji != 0B) goto <D.24436>; else goto <D.24437>;
  <D.24436>:
  if (out_domain != 0B) goto <D.24438>; else goto <D.24439>;
  <D.24438>:
  *out_domain = domain;
  <D.24439>:
  D.24440 = ji;
  return D.24440;
  <D.24437>:
  D.24441 = mono_get_root_domain ();
  if (D.24441 != domain) goto <D.24442>; else goto <D.24443>;
  <D.24442>:
  D.24444 = mono_get_root_domain ();
  ji = mono_jit_info_table_find (D.24444, addr);
  if (ji != 0B) goto <D.24445>; else goto <D.24446>;
  <D.24445>:
  if (out_domain != 0B) goto <D.24447>; else goto <D.24448>;
  <D.24447>:
  D.24449 = mono_get_root_domain ();
  *out_domain = D.24449;
  <D.24448>:
  D.24440 = ji;
  return D.24440;
  <D.24446>:
  <D.24443>:
  if (t == 0B) goto <D.24450>; else goto <D.24451>;
  <D.24450>:
  D.24440 = 0B;
  return D.24440;
  <D.24451>:
  D.24453 = t->appdomain_refs;
  if (D.24453 != 0B) goto <D.24454>; else goto <D.24455>;
  <D.24454>:
  D.24453 = t->appdomain_refs;
  iftmp.53 = MEM[(void * *)D.24453];
  goto <D.24456>;
  <D.24455>:
  iftmp.53 = 0B;
  <D.24456>:
  refs = iftmp.53;
  goto <D.23251>;
  <D.23250>:
  D.24457 = *refs;
  if (D.24457 != domain) goto <D.24458>; else goto <D.24459>;
  <D.24458>:
  D.24457 = *refs;
  D.24460 = mono_get_root_domain ();
  if (D.24457 != D.24460) goto <D.24461>; else goto <D.24462>;
  <D.24461>:
  D.24457 = *refs;
  ji = mono_jit_info_table_find (D.24457, addr);
  if (ji != 0B) goto <D.24463>; else goto <D.24464>;
  <D.24463>:
  if (out_domain != 0B) goto <D.24465>; else goto <D.24466>;
  <D.24465>:
  D.24457 = *refs;
  *out_domain = D.24457;
  <D.24466>:
  D.24440 = ji;
  return D.24440;
  <D.24464>:
  <D.24462>:
  <D.24459>:
  refs = refs + 8;
  <D.23251>:
  if (refs != 0B) goto <D.24467>; else goto <D.23252>;
  <D.24467>:
  D.24457 = *refs;
  if (D.24457 != 0B) goto <D.23250>; else goto <D.23252>;
  <D.23252>:
  D.24440 = 0B;
  return D.24440;
}


mono_debugger_run_finally (struct MonoContext * start_ctx)
{
  unsigned int mono_jit_tls_id.54;
  struct MonoLMF * lmf.55;
  struct MonoJitInfo * D.24471;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.56;
  void * D.24477;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.57;
  long int D.24479;
  void * D.24480;
  int D.24481;
  unsigned int D.24484;
  unsigned int D.24485;
  void * D.24488;
  <unnamed-unsigned:15> D.24489;
  int D.24490;
  static int (*<T3d37>) (struct MonoContext *, void *) call_filter = 0B;
  struct MonoDomain * domain;
  struct MonoJitTlsData * jit_tls;
  struct MonoLMF * lmf;
  struct MonoContext ctx;
  struct MonoContext new_ctx;
  struct MonoJitInfo * ji;
  struct MonoJitInfo rji;
  int i;

  try
    {
      domain = mono_domain_get ();
      mono_jit_tls_id.54 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.54);
      lmf.55 = mono_get_lmf ();
      lmf = lmf.55;
      ctx = *start_ctx;
      ji = mono_find_jit_info (domain, jit_tls, &rji, 0B, &ctx, &new_ctx, 0B, &lmf, 0B, 0B);
      D.24471 = ji + 18446744073709551615;
      if (D.24471 > -3B) goto <D.24472>; else goto <D.24473>;
      <D.24472>:
      return;
      <D.24473>:
      call_filter.56 = call_filter;
      if (call_filter.56 == 0B) goto <D.24475>; else goto <D.24476>;
      <D.24475>:
      D.24477 = mono_get_call_filter ();
      call_filter.57 = (int (*<T3d37>) (struct MonoContext *, void *)) D.24477;
      call_filter = call_filter.57;
      <D.24476>:
      i = 0;
      goto <D.23440>;
      <D.23439>:
      {
        struct MonoJitExceptionInfo * ei;

        ei = &ji->clauses[i];
        D.24479 = ctx.rip;
        D.24480 = (void *) D.24479;
        D.24481 = is_address_protected (ji, ei, D.24480);
        if (D.24481 != 0) goto <D.24482>; else goto <D.24483>;
        <D.24482>:
        D.24484 = ei->flags;
        D.24485 = D.24484 & 2;
        if (D.24485 != 0) goto <D.24486>; else goto <D.24487>;
        <D.24486>:
        call_filter.56 = call_filter;
        D.24488 = ei->handler_start;
        call_filter.56 (&ctx, D.24488);
        <D.24487>:
        <D.24483>:
      }
      i = i + 1;
      <D.23440>:
      D.24489 = ji->num_clauses;
      D.24490 = (int) D.24489;
      if (D.24490 > i) goto <D.23439>; else goto <D.23441>;
      <D.23441>:
    }
  finally
    {
      lmf = {CLOBBER};
      ctx = {CLOBBER};
      new_ctx = {CLOBBER};
      rji = {CLOBBER};
    }
}


is_address_protected (struct MonoJitInfo * ji, struct MonoJitExceptionInfo * ei, void * ip)
{
  void * D.24496;
  void * D.24498;
  gboolean D.24499;
  unsigned char D.24500;
  unsigned char D.24501;
  long int ip.58;
  void * D.24505;
  long int D.24506;
  long int D.24507;
  long int ei.59;
  struct MonoJitExceptionInfo[0:] * D.24509;
  long int D.24510;
  long int D.24511;
  long int D.24512;
  int D.24513;
  <unnamed-unsigned:15> D.24514;
  int D.24515;
  _Bool D.24516;
  long int D.24517;
  long int D.24518;
  short unsigned int D.24521;
  unsigned int D.24524;
  short unsigned int D.24527;
  unsigned int D.24528;
  unsigned int D.24529;
  short unsigned int D.24532;
  int D.24533;
  struct MonoTryBlockHoleTableJitInfo * table;
  int i;
  guint32 offset;
  guint16 clause;

  D.24496 = ei->try_start;
  if (D.24496 > ip) goto <D.24494>; else goto <D.24497>;
  <D.24497>:
  D.24498 = ei->try_end;
  if (D.24498 <= ip) goto <D.24494>; else goto <D.24495>;
  <D.24494>:
  D.24499 = 0;
  return D.24499;
  <D.24495>:
  D.24500 = BIT_FIELD_REF <*ji, 8, 272>;
  D.24501 = D.24500 & 4;
  if (D.24501 == 0) goto <D.24502>; else goto <D.24503>;
  <D.24502>:
  D.24499 = 1;
  return D.24499;
  <D.24503>:
  table = mono_jit_info_get_try_block_hole_table_info (ji);
  ip.58 = (long int) ip;
  D.24505 = ji->code_start;
  D.24506 = (long int) D.24505;
  D.24507 = ip.58 - D.24506;
  offset = (guint32) D.24507;
  ei.59 = (long int) ei;
  D.24509 = &ji->clauses;
  D.24510 = (long int) D.24509;
  D.24511 = ei.59 - D.24510;
  D.24512 = D.24511 /[ex] 40;
  clause = (guint16) D.24512;
  D.24513 = (int) clause;
  D.24514 = ji->num_clauses;
  D.24515 = (int) D.24514;
  D.24516 = D.24513 >= D.24515;
  D.24517 = (long int) D.24516;
  D.24518 = __builtin_expect (D.24517, 0);
  if (D.24518 != 0) goto <D.24519>; else goto <D.24520>;
  <D.24519>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 183, "clause < ji->num_clauses");
  <D.24520>:
  i = 0;
  goto <D.22942>;
  <D.22941>:
  {
    struct MonoTryBlockHoleJitInfo * hole;

    hole = &table->holes[i];
    D.24521 = hole->clause;
    if (D.24521 == clause) goto <D.24522>; else goto <D.24523>;
    <D.24522>:
    D.24524 = hole->offset;
    if (D.24524 <= offset) goto <D.24525>; else goto <D.24526>;
    <D.24525>:
    D.24524 = hole->offset;
    D.24527 = hole->length;
    D.24528 = (unsigned int) D.24527;
    D.24529 = D.24524 + D.24528;
    if (D.24529 > offset) goto <D.24530>; else goto <D.24531>;
    <D.24530>:
    D.24499 = 0;
    return D.24499;
    <D.24531>:
    <D.24526>:
    <D.24523>:
  }
  i = i + 1;
  <D.22942>:
  D.24532 = table->num_holes;
  D.24533 = (int) D.24532;
  if (D.24533 > i) goto <D.22941>; else goto <D.22943>;
  <D.22943>:
  D.24499 = 1;
  return D.24499;
}


mono_handle_exception (struct MonoContext * ctx, void * obj)
{
  struct MonoPerfCounters * mono_perfcounters.60;
  unsigned int D.24536;
  unsigned int D.24537;
  gboolean D.24538;

  mono_perfcounters.60 = mono_perfcounters;
  D.24536 = mono_perfcounters.60->exceptions_thrown;
  D.24537 = D.24536 + 1;
  mono_perfcounters.60->exceptions_thrown = D.24537;
  D.24538 = mono_handle_exception_internal (ctx, obj, 0, 0B);
  return D.24538;
}


mono_handle_exception_internal (struct MonoContext * ctx, void * obj, gboolean resume, struct MonoJitInfo * * out_ji)
{
  unsigned int mono_jit_tls_id.61;
  struct MonoLMF * lmf.62;
  _Bool D.24542;
  long int D.24543;
  long int D.24544;
  struct MonoString * D.24549;
  struct MonoString * * D.24550;
  struct MonoException * D.24551;
  struct MonoException * D.24555;
  struct MonoClass * D.24558;
  struct MonoObject * D.24559;
  struct MonoObject * D.24562;
  struct MonoClass * D.24568;
  int D.23362;
  int iftmp.63;
  int D.23361;
  struct MonoVTable * D.24574;
  struct MonoClass * D.24575;
  const char[21] * D.24576;
  unsigned char D.24577;
  int D.24578;
  unsigned char D.24579;
  int D.24580;
  _Bool D.24581;
  _Bool D.24582;
  _Bool D.24583;
  const unsigned char * D.24586;
  unsigned char D.24587;
  int D.24588;
  const unsigned char * D.24589;
  unsigned char D.24590;
  int D.24591;
  _Bool D.24592;
  _Bool D.24593;
  const unsigned char * D.24596;
  unsigned char D.24597;
  int D.24598;
  const unsigned char * D.24599;
  unsigned char D.24600;
  int D.24601;
  _Bool D.24602;
  _Bool D.24603;
  const unsigned char * D.24606;
  unsigned char D.24607;
  int D.24608;
  const unsigned char * D.24609;
  unsigned char D.24610;
  int D.24611;
  const char * D.24613;
  struct MonoClass * D.24616;
  struct MonoString * D.24617;
  int D.23374;
  int iftmp.64;
  int D.23373;
  const char[27] * D.24621;
  unsigned char D.24622;
  int D.24623;
  unsigned char D.24624;
  int D.24625;
  _Bool D.24626;
  _Bool D.24627;
  _Bool D.24628;
  const unsigned char * D.24631;
  unsigned char D.24632;
  int D.24633;
  const unsigned char * D.24634;
  unsigned char D.24635;
  int D.24636;
  _Bool D.24637;
  _Bool D.24638;
  const unsigned char * D.24641;
  unsigned char D.24642;
  int D.24643;
  const unsigned char * D.24644;
  unsigned char D.24645;
  int D.24646;
  _Bool D.24647;
  _Bool D.24648;
  const unsigned char * D.24651;
  unsigned char D.24652;
  int D.24653;
  const unsigned char * D.24654;
  unsigned char D.24655;
  int D.24656;
  struct MonoString * D.24660;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.65;
  void * D.24664;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.66;
  void * D.24666;
  _Bool D.24667;
  long int D.24668;
  long int D.24669;
  void (*<T3272>) (struct MonoObject *) D.24672;
  _Bool D.24673;
  long int D.24674;
  long int D.24675;
  struct MonoContext * D.24678;
  int D.24681;
  struct MonoMethod * iftmp.67;
  struct MonoVTable * D.24688;
  struct MonoClass * D.24689;
  int D.23394;
  int iftmp.68;
  int D.23393;
  const char[21] * D.24699;
  unsigned char D.24700;
  int D.24701;
  unsigned char D.24702;
  int D.24703;
  _Bool D.24704;
  _Bool D.24705;
  _Bool D.24706;
  const unsigned char * D.24709;
  unsigned char D.24710;
  int D.24711;
  const unsigned char * D.24712;
  unsigned char D.24713;
  int D.24714;
  _Bool D.24715;
  _Bool D.24716;
  const unsigned char * D.24719;
  unsigned char D.24720;
  int D.24721;
  const unsigned char * D.24722;
  unsigned char D.24723;
  int D.24724;
  _Bool D.24725;
  _Bool D.24726;
  const unsigned char * D.24729;
  unsigned char D.24730;
  int D.24731;
  const unsigned char * D.24732;
  unsigned char D.24733;
  int D.24734;
  int D.23403;
  int iftmp.69;
  int D.23402;
  const char[23] * D.24740;
  unsigned char D.24741;
  int D.24742;
  unsigned char D.24743;
  int D.24744;
  _Bool D.24745;
  _Bool D.24746;
  _Bool D.24747;
  const unsigned char * D.24750;
  unsigned char D.24751;
  int D.24752;
  const unsigned char * D.24753;
  unsigned char D.24754;
  int D.24755;
  _Bool D.24756;
  _Bool D.24757;
  const unsigned char * D.24760;
  unsigned char D.24761;
  int D.24762;
  const unsigned char * D.24763;
  unsigned char D.24764;
  int D.24765;
  _Bool D.24766;
  _Bool D.24767;
  const unsigned char * D.24770;
  unsigned char D.24771;
  int D.24772;
  const unsigned char * D.24773;
  unsigned char D.24774;
  int D.24775;
  char * iftmp.70;
  struct MonoVTable * D.24783;
  struct MonoClass * D.24784;
  const char * D.24785;
  const char * D.24786;
  long unsigned int D.24787;
  void * D.24788;
  int D.24791;
  struct MonoDebugOptions * D.24796;
  int D.24797;
  struct MonoDebugOptions * D.24800;
  int D.24801;
  struct _IO_FILE * stderr.71;
  struct MonoJitInfo * ji.72;
  struct MonoMethod * D.24809;
  unsigned char D.24810;
  unsigned char D.24811;
  struct MonoJitInfo * prev_ji.73;
  struct MonoMethod * D.24817;
  struct MonoMethod * D.24818;
  struct MonoJitInfo * ji.74;
  struct MonoLMF * lmf.75;
  int first_filter_idx.76;
  <unnamed type> D.24834;
  unsigned int D.24835;
  _Bool D.24838;
  long int D.24839;
  long int D.24840;
  struct MonoJitInfo * ji.77;
  struct MonoLMF * * D.24846;
  struct MonoLMF * lmf.78;
  long int D.24852;
  unsigned int D.24853;
  long int D.24854;
  unsigned int D.24855;
  long int D.24860;
  void * D.24861;
  int D.24862;
  int D.24868;
  unsigned int D.24870;
  unsigned char D.24873;
  unsigned char D.24874;
  long int ex_obj.79;
  int D.24879;
  sizetype D.24880;
  long int D.24881;
  sizetype D.24882;
  sizetype D.24883;
  void * * D.24884;
  int first_filter_idx.80;
  _Bool D.24888;
  struct MonoObject * D.24893;
  void * D.24894;
  _Bool D.24895;
  long int D.24896;
  long int D.24897;
  long int D.24900;
  long int D.24906;
  char * D.24907;
  struct MonoJitInfo * D.24908;
  _Bool D.24909;
  long int D.24910;
  long int D.24911;
  void * D.24914;
  struct MonoJitExceptionInfo * D.24915;
  int D.24916;
  int D.24921;
  int D.24924;
  char * D.24927;
  int D.24928;
  long int D.24929;
  struct MonoLMF * * D.24930;
  struct MonoPerfCounters * mono_perfcounters.81;
  unsigned int D.24932;
  unsigned int frame_count.82;
  unsigned int D.24934;
  gboolean D.24937;
  int D.24938;
  int D.24943;
  int D.24946;
  char * D.24949;
  int D.24950;
  int D.24955;
  int D.24958;
  char * D.24961;
  unsigned int D.24962;
  unsigned int D.24963;
  struct MonoLMF * * D.24964;
  int D.24967;
  <unnamed-unsigned:15> D.24968;
  int D.24969;
  struct MonoDomain * domain;
  struct MonoJitInfo * ji;
  struct MonoJitInfo * prev_ji;
  static int (*<T3d37>) (struct MonoContext *, void *) call_filter = 0B;
  struct MonoJitTlsData * jit_tls;
  struct MonoLMF * lmf;
  struct MonoException * mono_ex;
  gboolean stack_overflow;
  struct MonoContext initial_ctx;
  struct MonoMethod * method;
  int frame_count;
  gint32 filter_idx;
  gint32 first_filter_idx;
  int i;
  struct MonoObject * ex_obj;
  struct MonoObject * non_exception;

  try
    {
      domain = mono_domain_get ();
      mono_jit_tls_id.61 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.61);
      lmf.62 = mono_get_lmf ();
      lmf = lmf.62;
      stack_overflow = 0;
      frame_count = 0;
      first_filter_idx = 0;
      non_exception = 0B;
      D.24542 = ctx == 0B;
      D.24543 = (long int) D.24542;
      D.24544 = __builtin_expect (D.24543, 0);
      if (D.24544 != 0) goto <D.24545>; else goto <D.24546>;
      <D.24545>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1517, "ctx != NULL");
      <D.24546>:
      if (obj == 0B) goto <D.24547>; else goto <D.24548>;
      <D.24547>:
      {
        struct MonoException * ex;

        ex = mono_get_exception_null_reference ();
        D.24549 = mono_string_new (domain, "Object reference not set to an instance of an object");
        D.24550 = &ex->message;
        mono_gc_wbarrier_set_field (ex, D.24550, D.24549);
        obj = ex;
      }
      <D.24548>:
      D.24551 = domain->stack_overflow_ex;
      if (D.24551 == obj) goto <D.24552>; else goto <D.24553>;
      <D.24552>:
      stack_overflow = 1;
      goto <D.24554>;
      <D.24553>:
      D.24555 = domain->null_reference_ex;
      if (D.24555 == obj) goto <D.24556>; else goto <D.24557>;
      <D.24556>:
      obj = mono_get_exception_null_reference ();
      <D.24557>:
      <D.24554>:
      D.24558 = mono_defaults.exception_class;
      D.24559 = mono_object_isinst (obj, D.24558);
      if (D.24559 == 0B) goto <D.24560>; else goto <D.24561>;
      <D.24560>:
      non_exception = obj;
      obj = mono_get_exception_runtime_wrapped (obj);
      <D.24561>:
      mono_ex = obj;
      D.24558 = mono_defaults.exception_class;
      D.24562 = mono_object_isinst (obj, D.24558);
      if (D.24562 != 0B) goto <D.24563>; else goto <D.24564>;
      <D.24563>:
      mono_ex = obj;
      goto <D.24565>;
      <D.24564>:
      mono_ex = 0B;
      <D.24565>:
      if (mono_ex != 0B) goto <D.24566>; else goto <D.24567>;
      <D.24566>:
      D.24568 = jit_tls->class_cast_from;
      if (D.24568 != 0B) goto <D.24569>; else goto <D.24570>;
      <D.24569>:
      {
        size_t __s1_len;
        size_t __s2_len;

        __s2_len = 20;
        if (__s2_len <= 3) goto <D.24572>; else goto <D.24573>;
        <D.24572>:
        {
          const unsigned char * __s2;
          int __result;

          D.24574 = mono_ex->object.vtable;
          D.24575 = D.24574->klass;
          __s2 = D.24575->name;
          D.24576 = "InvalidCastException";
          D.24577 = MEM[(const unsigned char *)D.24576];
          D.24578 = (int) D.24577;
          D.24579 = *__s2;
          D.24580 = (int) D.24579;
          __result = D.24578 - D.24580;
          {
            D.24581 = __s2_len != 0;
            D.24582 = __result == 0;
            D.24583 = D.24581 & D.24582;
            if (D.24583 != 0) goto <D.24584>; else goto <D.24585>;
            <D.24584>:
            D.24586 = &MEM[(void *)"InvalidCastException" + 1B];
            D.24587 = *D.24586;
            D.24588 = (int) D.24587;
            D.24589 = __s2 + 1;
            D.24590 = *D.24589;
            D.24591 = (int) D.24590;
            __result = D.24588 - D.24591;
            D.24592 = __s2_len > 1;
            D.24582 = __result == 0;
            D.24593 = D.24592 & D.24582;
            if (D.24593 != 0) goto <D.24594>; else goto <D.24595>;
            <D.24594>:
            D.24596 = &MEM[(void *)"InvalidCastException" + 2B];
            D.24597 = *D.24596;
            D.24598 = (int) D.24597;
            D.24599 = __s2 + 2;
            D.24600 = *D.24599;
            D.24601 = (int) D.24600;
            __result = D.24598 - D.24601;
            D.24602 = __s2_len > 2;
            D.24582 = __result == 0;
            D.24603 = D.24602 & D.24582;
            if (D.24603 != 0) goto <D.24604>; else goto <D.24605>;
            <D.24604>:
            D.24606 = &MEM[(void *)"InvalidCastException" + 3B];
            D.24607 = *D.24606;
            D.24608 = (int) D.24607;
            D.24609 = __s2 + 3;
            D.24610 = *D.24609;
            D.24611 = (int) D.24610;
            __result = D.24608 - D.24611;
            <D.24605>:
            <D.24595>:
            <D.24585>:
          }
          D.23361 = __result;
        }
        iftmp.63 = -D.23361;
        goto <D.24612>;
        <D.24573>:
        D.24574 = mono_ex->object.vtable;
        D.24575 = D.24574->klass;
        D.24613 = D.24575->name;
        iftmp.63 = __builtin_strcmp (D.24613, "InvalidCastException");
        <D.24612>:
        D.23362 = iftmp.63;
      }
      if (D.23362 == 0) goto <D.24614>; else goto <D.24615>;
      <D.24614>:
      {
        char * from_name;
        char * to_name;
        char * msg;

        D.24568 = jit_tls->class_cast_from;
        from_name = mono_type_get_full_name (D.24568);
        D.24616 = jit_tls->class_cast_to;
        to_name = mono_type_get_full_name (D.24616);
        msg = monoeg_g_strdup_printf ("Unable to cast object of type \'%s\' to type \'%s\'.", from_name, to_name);
        D.24617 = mono_string_new (domain, msg);
        mono_ex->message = D.24617;
        monoeg_g_free (from_name);
        monoeg_g_free (to_name);
        monoeg_g_free (msg);
      }
      <D.24615>:
      {
        size_t __s1_len;
        size_t __s2_len;

        __s2_len = 26;
        if (__s2_len <= 3) goto <D.24619>; else goto <D.24620>;
        <D.24619>:
        {
          const unsigned char * __s2;
          int __result;

          D.24574 = mono_ex->object.vtable;
          D.24575 = D.24574->klass;
          __s2 = D.24575->name;
          D.24621 = "ArrayTypeMismatchException";
          D.24622 = MEM[(const unsigned char *)D.24621];
          D.24623 = (int) D.24622;
          D.24624 = *__s2;
          D.24625 = (int) D.24624;
          __result = D.24623 - D.24625;
          {
            D.24626 = __s2_len != 0;
            D.24627 = __result == 0;
            D.24628 = D.24626 & D.24627;
            if (D.24628 != 0) goto <D.24629>; else goto <D.24630>;
            <D.24629>:
            D.24631 = &MEM[(void *)"ArrayTypeMismatchException" + 1B];
            D.24632 = *D.24631;
            D.24633 = (int) D.24632;
            D.24634 = __s2 + 1;
            D.24635 = *D.24634;
            D.24636 = (int) D.24635;
            __result = D.24633 - D.24636;
            D.24637 = __s2_len > 1;
            D.24627 = __result == 0;
            D.24638 = D.24637 & D.24627;
            if (D.24638 != 0) goto <D.24639>; else goto <D.24640>;
            <D.24639>:
            D.24641 = &MEM[(void *)"ArrayTypeMismatchException" + 2B];
            D.24642 = *D.24641;
            D.24643 = (int) D.24642;
            D.24644 = __s2 + 2;
            D.24645 = *D.24644;
            D.24646 = (int) D.24645;
            __result = D.24643 - D.24646;
            D.24647 = __s2_len > 2;
            D.24627 = __result == 0;
            D.24648 = D.24647 & D.24627;
            if (D.24648 != 0) goto <D.24649>; else goto <D.24650>;
            <D.24649>:
            D.24651 = &MEM[(void *)"ArrayTypeMismatchException" + 3B];
            D.24652 = *D.24651;
            D.24653 = (int) D.24652;
            D.24654 = __s2 + 3;
            D.24655 = *D.24654;
            D.24656 = (int) D.24655;
            __result = D.24653 - D.24656;
            <D.24650>:
            <D.24640>:
            <D.24630>:
          }
          D.23373 = __result;
        }
        iftmp.64 = -D.23373;
        goto <D.24657>;
        <D.24620>:
        D.24574 = mono_ex->object.vtable;
        D.24575 = D.24574->klass;
        D.24613 = D.24575->name;
        iftmp.64 = __builtin_strcmp (D.24613, "ArrayTypeMismatchException");
        <D.24657>:
        D.23374 = iftmp.64;
      }
      if (D.23374 == 0) goto <D.24658>; else goto <D.24659>;
      <D.24658>:
      {
        char * from_name;
        char * to_name;
        char * msg;

        D.24568 = jit_tls->class_cast_from;
        from_name = mono_type_get_full_name (D.24568);
        D.24616 = jit_tls->class_cast_to;
        to_name = mono_type_get_full_name (D.24616);
        msg = monoeg_g_strdup_printf ("Source array of type \'%s\' cannot be cast to destination array type \'%s\'.", from_name, to_name);
        D.24660 = mono_string_new (domain, msg);
        mono_ex->message = D.24660;
        monoeg_g_free (from_name);
        monoeg_g_free (to_name);
        monoeg_g_free (msg);
      }
      <D.24659>:
      <D.24570>:
      <D.24567>:
      call_filter.65 = call_filter;
      if (call_filter.65 == 0B) goto <D.24662>; else goto <D.24663>;
      <D.24662>:
      D.24664 = mono_get_call_filter ();
      call_filter.66 = (int (*<T3d37>) (struct MonoContext *, void *)) D.24664;
      call_filter = call_filter.66;
      <D.24663>:
      D.24666 = jit_tls->end_of_stack;
      D.24667 = D.24666 == 0B;
      D.24668 = (long int) D.24667;
      D.24669 = __builtin_expect (D.24668, 0);
      if (D.24669 != 0) goto <D.24670>; else goto <D.24671>;
      <D.24670>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1575, "jit_tls->end_of_stack");
      <D.24671>:
      D.24672 = jit_tls->abort_func;
      D.24673 = D.24672 == 0B;
      D.24674 = (long int) D.24673;
      D.24675 = __builtin_expect (D.24674, 0);
      if (D.24675 != 0) goto <D.24676>; else goto <D.24677>;
      <D.24676>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1576, "jit_tls->abort_func");
      <D.24677>:
      D.24678 = &jit_tls->orig_ex_ctx;
      memcpy (D.24678, ctx, 136);
      if (resume == 0) goto <D.24679>; else goto <D.24680>;
      <D.24679>:
      {
        gboolean res;
        struct MonoContext ctx_cp;

        try
          {
            ctx_cp = *ctx;
            D.24681 = mono_trace_is_enabled ();
            if (D.24681 != 0) goto <D.24682>; else goto <D.24683>;
            <D.24682>:
            {
              struct MonoMethod * system_exception_get_message;
              struct MonoMethod * get_message;
              struct MonoObject * message;
              const char * type_name;
              char * msg;
              struct MonoObject * exc;

              try
                {
                  D.24558 = mono_defaults.exception_class;
                  system_exception_get_message = mono_class_get_method_from_name (D.24558, "get_Message", 0);
                  if (system_exception_get_message != 0B) goto <D.24685>; else goto <D.24686>;
                  <D.24685>:
                  iftmp.67 = mono_object_get_virtual_method (obj, system_exception_get_message);
                  goto <D.24687>;
                  <D.24686>:
                  iftmp.67 = 0B;
                  <D.24687>:
                  get_message = iftmp.67;
                  D.24688 = MEM[(struct MonoObject *)mono_ex].vtable;
                  D.24689 = D.24688->klass;
                  type_name = mono_class_get_name (D.24689);
                  msg = 0B;
                  exc = 0B;
                  if (get_message == 0B) goto <D.24690>; else goto <D.24691>;
                  <D.24690>:
                  message = 0B;
                  goto <D.24692>;
                  <D.24691>:
                  {
                    size_t __s1_len;
                    size_t __s2_len;

                    __s2_len = 20;
                    if (__s2_len <= 3) goto <D.24697>; else goto <D.24698>;
                    <D.24697>:
                    {
                      const unsigned char * __s2;
                      int __result;

                      __s2 = type_name;
                      D.24699 = "OutOfMemoryException";
                      D.24700 = MEM[(const unsigned char *)D.24699];
                      D.24701 = (int) D.24700;
                      D.24702 = *__s2;
                      D.24703 = (int) D.24702;
                      __result = D.24701 - D.24703;
                      {
                        D.24704 = __s2_len != 0;
                        D.24705 = __result == 0;
                        D.24706 = D.24704 & D.24705;
                        if (D.24706 != 0) goto <D.24707>; else goto <D.24708>;
                        <D.24707>:
                        D.24709 = &MEM[(void *)"OutOfMemoryException" + 1B];
                        D.24710 = *D.24709;
                        D.24711 = (int) D.24710;
                        D.24712 = __s2 + 1;
                        D.24713 = *D.24712;
                        D.24714 = (int) D.24713;
                        __result = D.24711 - D.24714;
                        D.24715 = __s2_len > 1;
                        D.24705 = __result == 0;
                        D.24716 = D.24715 & D.24705;
                        if (D.24716 != 0) goto <D.24717>; else goto <D.24718>;
                        <D.24717>:
                        D.24719 = &MEM[(void *)"OutOfMemoryException" + 2B];
                        D.24720 = *D.24719;
                        D.24721 = (int) D.24720;
                        D.24722 = __s2 + 2;
                        D.24723 = *D.24722;
                        D.24724 = (int) D.24723;
                        __result = D.24721 - D.24724;
                        D.24725 = __s2_len > 2;
                        D.24705 = __result == 0;
                        D.24726 = D.24725 & D.24705;
                        if (D.24726 != 0) goto <D.24727>; else goto <D.24728>;
                        <D.24727>:
                        D.24729 = &MEM[(void *)"OutOfMemoryException" + 3B];
                        D.24730 = *D.24729;
                        D.24731 = (int) D.24730;
                        D.24732 = __s2 + 3;
                        D.24733 = *D.24732;
                        D.24734 = (int) D.24733;
                        __result = D.24731 - D.24734;
                        <D.24728>:
                        <D.24718>:
                        <D.24708>:
                      }
                      D.23393 = __result;
                    }
                    iftmp.68 = -D.23393;
                    goto <D.24735>;
                    <D.24698>:
                    iftmp.68 = __builtin_strcmp (type_name, "OutOfMemoryException");
                    <D.24735>:
                    D.23394 = iftmp.68;
                  }
                  if (D.23394 == 0) goto <D.24693>; else goto <D.24736>;
                  <D.24736>:
                  {
                    size_t __s1_len;
                    size_t __s2_len;

                    __s2_len = 22;
                    if (__s2_len <= 3) goto <D.24738>; else goto <D.24739>;
                    <D.24738>:
                    {
                      const unsigned char * __s2;
                      int __result;

                      __s2 = type_name;
                      D.24740 = "StackOverflowException";
                      D.24741 = MEM[(const unsigned char *)D.24740];
                      D.24742 = (int) D.24741;
                      D.24743 = *__s2;
                      D.24744 = (int) D.24743;
                      __result = D.24742 - D.24744;
                      {
                        D.24745 = __s2_len != 0;
                        D.24746 = __result == 0;
                        D.24747 = D.24745 & D.24746;
                        if (D.24747 != 0) goto <D.24748>; else goto <D.24749>;
                        <D.24748>:
                        D.24750 = &MEM[(void *)"StackOverflowException" + 1B];
                        D.24751 = *D.24750;
                        D.24752 = (int) D.24751;
                        D.24753 = __s2 + 1;
                        D.24754 = *D.24753;
                        D.24755 = (int) D.24754;
                        __result = D.24752 - D.24755;
                        D.24756 = __s2_len > 1;
                        D.24746 = __result == 0;
                        D.24757 = D.24756 & D.24746;
                        if (D.24757 != 0) goto <D.24758>; else goto <D.24759>;
                        <D.24758>:
                        D.24760 = &MEM[(void *)"StackOverflowException" + 2B];
                        D.24761 = *D.24760;
                        D.24762 = (int) D.24761;
                        D.24763 = __s2 + 2;
                        D.24764 = *D.24763;
                        D.24765 = (int) D.24764;
                        __result = D.24762 - D.24765;
                        D.24766 = __s2_len > 2;
                        D.24746 = __result == 0;
                        D.24767 = D.24766 & D.24746;
                        if (D.24767 != 0) goto <D.24768>; else goto <D.24769>;
                        <D.24768>:
                        D.24770 = &MEM[(void *)"StackOverflowException" + 3B];
                        D.24771 = *D.24770;
                        D.24772 = (int) D.24771;
                        D.24773 = __s2 + 3;
                        D.24774 = *D.24773;
                        D.24775 = (int) D.24774;
                        __result = D.24772 - D.24775;
                        <D.24769>:
                        <D.24759>:
                        <D.24749>:
                      }
                      D.23402 = __result;
                    }
                    iftmp.69 = -D.23402;
                    goto <D.24776>;
                    <D.24739>:
                    iftmp.69 = __builtin_strcmp (type_name, "StackOverflowException");
                    <D.24776>:
                    D.23403 = iftmp.69;
                  }
                  if (D.23403 == 0) goto <D.24693>; else goto <D.24694>;
                  <D.24693>:
                  message = 0B;
                  msg = monoeg_g_strdup_printf ("(No exception message for: %s)\n", type_name);
                  goto <D.24695>;
                  <D.24694>:
                  message = mono_runtime_invoke (get_message, obj, 0B, &exc);
                  <D.24695>:
                  <D.24692>:
                  if (msg == 0B) goto <D.24777>; else goto <D.24778>;
                  <D.24777>:
                  if (message != 0B) goto <D.24780>; else goto <D.24781>;
                  <D.24780>:
                  iftmp.70 = mono_string_to_utf8 (message);
                  goto <D.24782>;
                  <D.24781>:
                  iftmp.70 = monoeg_strdup ("(System.Exception.Message property not available)");
                  <D.24782>:
                  msg = iftmp.70;
                  <D.24778>:
                  D.24783 = MEM[(struct MonoObject *)obj].vtable;
                  D.24784 = D.24783->klass;
                  D.24785 = D.24784->name;
                  D.24783 = MEM[(struct MonoObject *)obj].vtable;
                  D.24784 = D.24783->klass;
                  D.24786 = D.24784->name_space;
                  D.24787 = GetCurrentThreadId ();
                  D.24788 = (void *) D.24787;
                  monoeg_g_print ("[%p:] EXCEPTION handling: %s.%s: %s\n", D.24788, D.24786, D.24785, msg);
                  monoeg_g_free (msg);
                  if (mono_ex != 0B) goto <D.24789>; else goto <D.24790>;
                  <D.24789>:
                  D.24688 = MEM[(struct MonoObject *)mono_ex].vtable;
                  D.24689 = D.24688->klass;
                  D.24791 = mono_trace_eval_exception (D.24689);
                  if (D.24791 != 0) goto <D.24792>; else goto <D.24793>;
                  <D.24792>:
                  mono_print_thread_dump_from_ctx (ctx);
                  <D.24793>:
                  <D.24790>:
                }
              finally
                {
                  exc = {CLOBBER};
                }
            }
            <D.24683>:
            jit_tls->orig_ex_ctx_set = 1;
            mono_profiler_exception_thrown (obj);
            jit_tls->orig_ex_ctx_set = 0;
            res = mono_handle_exception_internal_first_pass (&ctx_cp, obj, &first_filter_idx, &ji, &prev_ji, non_exception);
            if (res == 0) goto <D.24794>; else goto <D.24795>;
            <D.24794>:
            D.24796 = mini_get_debug_options ();
            D.24797 = D.24796->break_on_exc;
            if (D.24797 != 0) goto <D.24798>; else goto <D.24799>;
            <D.24798>:
            __asm__ __volatile__("int $03");
            <D.24799>:
            mono_debugger_agent_handle_exception (obj, ctx, 0B);
            D.24800 = mini_get_debug_options ();
            D.24801 = D.24800->suspend_on_unhandled;
            if (D.24801 != 0) goto <D.24802>; else goto <D.24803>;
            <D.24802>:
            stderr.71 = stderr;
            fprintf (stderr.71, "Unhandled exception, suspending...\n");
            <D.23404>:
            goto <D.23404>;
            <D.24803>:
            mono_unhandled_exception (obj);
            goto <D.24805>;
            <D.24795>:
            {
              gboolean unhandled;

              unhandled = 0;
              ji.72 = ji;
              if (ji.72 != 0B) goto <D.24807>; else goto <D.24808>;
              <D.24807>:
              ji.72 = ji;
              D.24809 = jinfo_get_method (ji.72);
              D.24810 = BIT_FIELD_REF <*D.24809, 8, 256>;
              D.24811 = D.24810 & 124;
              if (D.24811 == 16) goto <D.24812>; else goto <D.24813>;
              <D.24812>:
              prev_ji.73 = prev_ji;
              if (prev_ji.73 != 0B) goto <D.24815>; else goto <D.24816>;
              <D.24815>:
              {
                struct MonoInternalThread * thread;

                thread = mono_thread_internal_current ();
                prev_ji.73 = prev_ji;
                D.24817 = jinfo_get_method (prev_ji.73);
                D.24818 = thread->async_invoke_method;
                if (D.24817 == D.24818) goto <D.24819>; else goto <D.24820>;
                <D.24819>:
                unhandled = 1;
                <D.24820>:
              }
              <D.24816>:
              <D.24813>:
              <D.24808>:
              if (unhandled != 0) goto <D.24821>; else goto <D.24822>;
              <D.24821>:
              mono_debugger_agent_handle_exception (obj, ctx, 0B);
              goto <D.24823>;
              <D.24822>:
              mono_debugger_agent_handle_exception (obj, ctx, &ctx_cp);
              <D.24823>:
            }
            <D.24805>:
          }
        finally
          {
            ctx_cp = {CLOBBER};
          }
      }
      <D.24680>:
      if (out_ji != 0B) goto <D.24824>; else goto <D.24825>;
      <D.24824>:
      *out_ji = 0B;
      <D.24825>:
      filter_idx = 0;
      initial_ctx = *ctx;
      <D.23423>:
      {
        struct MonoContext new_ctx;
        guint32 free_stack;
        int clause_index_start;
        gboolean unwind_res;

        try
          {
            clause_index_start = 0;
            unwind_res = 1;
            if (resume != 0) goto <D.24826>; else goto <D.24827>;
            <D.24826>:
            resume = 0;
            ji.74 = jit_tls->resume_state.ji;
            ji = ji.74;
            new_ctx = jit_tls->resume_state.new_ctx;
            clause_index_start = jit_tls->resume_state.clause_index;
            lmf.75 = jit_tls->resume_state.lmf;
            lmf = lmf.75;
            first_filter_idx.76 = jit_tls->resume_state.first_filter_idx;
            first_filter_idx = first_filter_idx.76;
            filter_idx = jit_tls->resume_state.filter_idx;
            goto <D.24831>;
            <D.24827>:
            {
              struct StackFrameInfo frame;

              try
                {
                  unwind_res = mono_find_jit_info_ext (domain, jit_tls, 0B, ctx, &new_ctx, 0B, &lmf, 0B, &frame);
                  if (unwind_res != 0) goto <D.24832>; else goto <D.24833>;
                  <D.24832>:
                  D.24834 = frame.type;
                  D.24835 = D.24834 + 4294967295;
                  if (D.24835 <= 1) goto <D.24836>; else goto <D.24837>;
                  <D.24836>:
                  *ctx = new_ctx;
                  // predicted unlikely by continue predictor.
                  goto <D.23412>;
                  <D.24837>:
                  D.24834 = frame.type;
                  D.24838 = D.24834 != 0;
                  D.24839 = (long int) D.24838;
                  D.24840 = __builtin_expect (D.24839, 0);
                  if (D.24840 != 0) goto <D.24841>; else goto <D.24842>;
                  <D.24841>:
                  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1683, "frame.type == FRAME_TYPE_MANAGED");
                  <D.24842>:
                  ji.77 = frame.ji;
                  ji = ji.77;
                  <D.24833>:
                }
              finally
                {
                  frame = {CLOBBER};
                }
            }
            <D.24831>:
            if (unwind_res == 0) goto <D.24844>; else goto <D.24845>;
            <D.24844>:
            D.24846 = mono_get_lmf_addr ();
            lmf.78 = lmf;
            *D.24846 = lmf.78;
            D.24672 = jit_tls->abort_func;
            D.24672 (obj);
            monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1692);
            <D.24845>:
            ji.72 = ji;
            method = jinfo_get_method (ji.72);
            frame_count = frame_count + 1;
            if (stack_overflow != 0) goto <D.24848>; else goto <D.24849>;
            <D.24848>:
            if (1 != 0) goto <D.24850>; else goto <D.24851>;
            <D.24850>:
            D.24852 = ctx->rsp;
            D.24853 = (unsigned int) D.24852;
            D.24854 = initial_ctx.rsp;
            D.24855 = (unsigned int) D.24854;
            free_stack = D.24853 - D.24855;
            goto <D.24856>;
            <D.24851>:
            D.24854 = initial_ctx.rsp;
            D.24855 = (unsigned int) D.24854;
            D.24852 = ctx->rsp;
            D.24853 = (unsigned int) D.24852;
            free_stack = D.24855 - D.24853;
            <D.24856>:
            goto <D.24857>;
            <D.24849>:
            free_stack = 16777215;
            <D.24857>:
            i = clause_index_start;
            goto <D.23421>;
            <D.23420>:
            {
              struct MonoJitExceptionInfo * ei;
              gboolean filtered;

              ji.72 = ji;
              ei = &ji.72->clauses[i];
              filtered = 0;
              if (free_stack <= 65536) goto <D.24858>; else goto <D.24859>;
              <D.24858>:
              // predicted unlikely by continue predictor.
              goto <D.23415>;
              <D.24859>:
              D.24860 = ctx->rip;
              D.24861 = (void *) D.24860;
              ji.72 = ji;
              D.24862 = is_address_protected (ji.72, ei, D.24861);
              if (D.24862 != 0) goto <D.24863>; else goto <D.24864>;
              <D.24863>:
              {
                struct MonoClass * catch_class;

                ji.72 = ji;
                catch_class = get_exception_catch_class (ei, ji.72, ctx);
                if (non_exception != 0B) goto <D.24867>; else goto <D.24865>;
                <D.24867>:
                D.24868 = wrap_non_exception_throws (method);
                if (D.24868 == 0) goto <D.24869>; else goto <D.24865>;
                <D.24869>:
                ex_obj = non_exception;
                goto <D.24866>;
                <D.24865>:
                ex_obj = obj;
                <D.24866>:
                D.24870 = ei->flags;
                if (D.24870 <= 1) goto <D.24871>; else goto <D.24872>;
                <D.24871>:
                ji.72 = ji;
                D.24873 = BIT_FIELD_REF <*ji.72, 8, 272>;
                D.24874 = D.24873 & 32;
                if (D.24874 != 0) goto <D.24875>; else goto <D.24876>;
                <D.24875>:
                ex_obj.79 = (long int) ex_obj;
                ctx->rax = ex_obj.79;
                goto <D.24878>;
                <D.24876>:
                D.24879 = ei->exvar_offset;
                D.24880 = (sizetype) D.24879;
                D.24881 = ctx->rbp;
                D.24882 = (sizetype) D.24881;
                D.24883 = D.24880 + D.24882;
                D.24884 = (void * *) D.24883;
                *D.24884 = ex_obj;
                <D.24878>:
                <D.24872>:
                D.24870 = ei->flags;
                if (D.24870 == 1) goto <D.24885>; else goto <D.24886>;
                <D.24885>:
                first_filter_idx.80 = first_filter_idx;
                D.24888 = filter_idx == first_filter_idx.80;
                filtered = (gboolean) D.24888;
                filter_idx = filter_idx + 1;
                <D.24886>:
                D.24870 = ei->flags;
                if (D.24870 == 0) goto <D.24892>; else goto <D.24889>;
                <D.24892>:
                D.24893 = mono_object_isinst (ex_obj, catch_class);
                if (D.24893 != 0B) goto <D.24890>; else goto <D.24889>;
                <D.24889>:
                if (filtered != 0) goto <D.24890>; else goto <D.24891>;
                <D.24890>:
                D.24894 = jit_tls->handler_block_return_address;
                D.24895 = D.24894 != 0B;
                D.24896 = (long int) D.24895;
                D.24897 = __builtin_expect (D.24896, 0);
                if (D.24897 != 0) goto <D.24898>; else goto <D.24899>;
                <D.24898>:
                {
                  gboolean is_outside;
                  void * prot_bp;
                  void * catch_bp;

                  is_outside = 0;
                  D.24900 = jit_tls->handler_block_context.rbp;
                  prot_bp = (void *) D.24900;
                  D.24881 = ctx->rbp;
                  catch_bp = (void *) D.24881;
                  if (catch_bp > prot_bp) goto <D.24901>; else goto <D.24902>;
                  <D.24901>:
                  is_outside = 1;
                  goto <D.24903>;
                  <D.24902>:
                  if (catch_bp == prot_bp) goto <D.24904>; else goto <D.24905>;
                  <D.24904>:
                  D.24906 = jit_tls->handler_block_context.rip;
                  D.24907 = (char *) D.24906;
                  D.24908 = mini_jit_info_table_find (domain, D.24907, 0B);
                  ji.72 = ji;
                  D.24909 = D.24908 != ji.72;
                  D.24910 = (long int) D.24909;
                  D.24911 = __builtin_expect (D.24910, 0);
                  if (D.24911 != 0) goto <D.24912>; else goto <D.24913>;
                  <D.24912>:
                  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1778, "ji == mini_jit_info_table_find (domain, MONO_CONTEXT_GET_IP (&jit_tls->handler_block_context), NULL)");
                  <D.24913>:
                  D.24914 = ei->handler_start;
                  D.24915 = jit_tls->handler_block;
                  ji.72 = ji;
                  D.24916 = is_address_protected (ji.72, D.24915, D.24914);
                  if (D.24916 == 0) goto <D.24917>; else goto <D.24918>;
                  <D.24917>:
                  is_outside = 1;
                  <D.24918>:
                  <D.24905>:
                  <D.24903>:
                  if (is_outside != 0) goto <D.24919>; else goto <D.24920>;
                  <D.24919>:
                  jit_tls->handler_block_return_address = 0B;
                  jit_tls->handler_block = 0B;
                  mono_thread_resume_interruption ();
                  <D.24920>:
                }
                <D.24899>:
                D.24921 = mono_trace_is_enabled ();
                if (D.24921 != 0) goto <D.24922>; else goto <D.24923>;
                <D.24922>:
                D.24924 = mono_trace_eval (method);
                if (D.24924 != 0) goto <D.24925>; else goto <D.24926>;
                <D.24925>:
                D.24927 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: catch found at clause %d of %s\n", i, D.24927);
                <D.24926>:
                <D.24923>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24870 = ei->flags;
                D.24928 = (int) D.24870;
                mono_profiler_exception_clause_handler (method, D.24928, i);
                jit_tls->orig_ex_ctx_set = 0;
                D.24914 = ei->handler_start;
                D.24929 = (long int) D.24914;
                ctx->rip = D.24929;
                D.24930 = mono_get_lmf_addr ();
                lmf.78 = lmf;
                *D.24930 = lmf.78;
                mono_perfcounters.81 = mono_perfcounters;
                mono_perfcounters.81 = mono_perfcounters;
                D.24932 = mono_perfcounters.81->exceptions_depth;
                frame_count.82 = (unsigned int) frame_count;
                D.24934 = D.24932 + frame_count.82;
                mono_perfcounters.81->exceptions_depth = D.24934;
                D.24551 = domain->stack_overflow_ex;
                if (D.24551 == obj) goto <D.24935>; else goto <D.24936>;
                <D.24935>:
                jit_tls->handling_stack_ovf = 0;
                <D.24936>:
                D.24937 = 0;
                return D.24937;
                <D.24891>:
                D.24860 = ctx->rip;
                D.24861 = (void *) D.24860;
                ji.72 = ji;
                D.24938 = is_address_protected (ji.72, ei, D.24861);
                if (D.24938 != 0) goto <D.24939>; else goto <D.24940>;
                <D.24939>:
                D.24870 = ei->flags;
                if (D.24870 == 4) goto <D.24941>; else goto <D.24942>;
                <D.24941>:
                D.24943 = mono_trace_is_enabled ();
                if (D.24943 != 0) goto <D.24944>; else goto <D.24945>;
                <D.24944>:
                D.24946 = mono_trace_eval (method);
                if (D.24946 != 0) goto <D.24947>; else goto <D.24948>;
                <D.24947>:
                D.24949 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: fault clause %d of %s\n", i, D.24949);
                <D.24948>:
                <D.24945>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24870 = ei->flags;
                D.24928 = (int) D.24870;
                mono_profiler_exception_clause_handler (method, D.24928, i);
                jit_tls->orig_ex_ctx_set = 0;
                call_filter.65 = call_filter;
                D.24914 = ei->handler_start;
                call_filter.65 (ctx, D.24914);
                <D.24942>:
                <D.24940>:
                D.24860 = ctx->rip;
                D.24861 = (void *) D.24860;
                ji.72 = ji;
                D.24950 = is_address_protected (ji.72, ei, D.24861);
                if (D.24950 != 0) goto <D.24951>; else goto <D.24952>;
                <D.24951>:
                D.24870 = ei->flags;
                if (D.24870 == 2) goto <D.24953>; else goto <D.24954>;
                <D.24953>:
                D.24955 = mono_trace_is_enabled ();
                if (D.24955 != 0) goto <D.24956>; else goto <D.24957>;
                <D.24956>:
                D.24958 = mono_trace_eval (method);
                if (D.24958 != 0) goto <D.24959>; else goto <D.24960>;
                <D.24959>:
                D.24961 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: finally clause %d of %s\n", i, D.24961);
                <D.24960>:
                <D.24957>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24870 = ei->flags;
                D.24928 = (int) D.24870;
                mono_profiler_exception_clause_handler (method, D.24928, i);
                jit_tls->orig_ex_ctx_set = 0;
                mono_perfcounters.81 = mono_perfcounters;
                D.24962 = mono_perfcounters.81->exceptions_finallys;
                D.24963 = D.24962 + 1;
                mono_perfcounters.81->exceptions_finallys = D.24963;
                D.24964 = mono_get_lmf_addr ();
                lmf.78 = lmf;
                *D.24964 = lmf.78;
                ji.72 = ji;
                D.24873 = BIT_FIELD_REF <*ji.72, 8, 272>;
                D.24874 = D.24873 & 32;
                if (D.24874 != 0) goto <D.24965>; else goto <D.24966>;
                <D.24965>:
                jit_tls->resume_state.ex_obj = obj;
                ji.72 = ji;
                jit_tls->resume_state.ji = ji.72;
                D.24967 = i + 1;
                jit_tls->resume_state.clause_index = D.24967;
                jit_tls->resume_state.ctx = *ctx;
                jit_tls->resume_state.new_ctx = new_ctx;
                lmf.78 = lmf;
                jit_tls->resume_state.lmf = lmf.78;
                first_filter_idx.80 = first_filter_idx;
                jit_tls->resume_state.first_filter_idx = first_filter_idx.80;
                jit_tls->resume_state.filter_idx = filter_idx;
                D.24914 = ei->handler_start;
                D.24929 = (long int) D.24914;
                ctx->rip = D.24929;
                D.24937 = 0;
                return D.24937;
                <D.24966>:
                call_filter.65 = call_filter;
                D.24914 = ei->handler_start;
                call_filter.65 (ctx, D.24914);
                <D.24954>:
                <D.24952>:
              }
              <D.24864>:
            }
            <D.23415>:
            i = i + 1;
            <D.23421>:
            ji.72 = ji;
            D.24968 = ji.72->num_clauses;
            D.24969 = (int) D.24968;
            if (D.24969 > i) goto <D.23420>; else goto <D.23422>;
            <D.23422>:
            jit_tls->orig_ex_ctx_set = 1;
            mono_profiler_exception_method_leave (method);
            jit_tls->orig_ex_ctx_set = 0;
            *ctx = new_ctx;
          }
        finally
          {
            new_ctx = {CLOBBER};
          }
      }
      <D.23412>:
      goto <D.23423>;
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1859);
    }
  finally
    {
      ji = {CLOBBER};
      prev_ji = {CLOBBER};
      lmf = {CLOBBER};
      initial_ctx = {CLOBBER};
      first_filter_idx = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.24977>; else goto <D.24978>;
  <D.24977>:
  D.24979 = __strdup (str);
  return D.24979;
  <D.24978>:
  D.24979 = 0B;
  return D.24979;
}


mono_handle_exception_internal_first_pass (struct MonoContext * ctx, void * obj, gint32 * out_filter_idx, struct MonoJitInfo * * out_ji, struct MonoJitInfo * * out_prev_ji, struct MonoObject * non_exception)
{
  unsigned int mono_jit_tls_id.83;
  struct MonoLMF * lmf.84;
  _Bool D.24983;
  long int D.24984;
  long int D.24985;
  struct MonoException * D.24988;
  struct MonoClass * D.24991;
  struct MonoObject * D.24992;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.85;
  void * D.24999;
  int (*<T3d37>) (struct MonoContext *, void *) call_filter.86;
  void * D.25001;
  _Bool D.25002;
  long int D.25003;
  long int D.25004;
  void (*<T3272>) (struct MonoObject *) D.25007;
  _Bool D.25008;
  long int D.25009;
  long int D.25010;
  <unnamed type> D.25023;
  unsigned int D.25024;
  _Bool D.25027;
  long int D.25028;
  long int D.25029;
  _Bool D.25034;
  _Bool D.25035;
  _Bool D.25036;
  struct MonoClass * D.25039;
  struct MonoArray * D.25040;
  struct MonoArray * * D.25041;
  struct MonoArray * D.25042;
  struct MonoArray * * D.25043;
  struct MonoString * D.25046;
  struct MonoString * * D.25047;
  gboolean D.25048;
  struct MonoDebugOptions * D.25049;
  int D.25050;
  unsigned char D.25053;
  unsigned char D.25054;
  char * D.25057;
  _Bool D.25062;
  _Bool D.25063;
  long int D.25066;
  void * D.25067;
  void * D.25068;
  unsigned char D.25069;
  unsigned char D.25070;
  long int D.25077;
  unsigned int D.25078;
  long int D.25079;
  unsigned int D.25080;
  int D.25085;
  int D.25091;
  unsigned int D.25093;
  unsigned char D.25096;
  _Bool D.25097;
  _Bool D.25098;
  _Bool D.25099;
  struct MonoPerfCounters * mono_perfcounters.87;
  unsigned int D.25101;
  unsigned int D.25102;
  struct MonoArray * D.25107;
  struct MonoArray * D.25108;
  struct MonoString * D.25111;
  unsigned char D.25112;
  unsigned char D.25113;
  long int ex_obj.88;
  int D.25118;
  sizetype D.25119;
  long int D.25120;
  sizetype D.25121;
  sizetype D.25122;
  void * * D.25123;
  void * D.25124;
  _Bool D.25125;
  _Bool D.25126;
  _Bool D.25127;
  struct MonoArray * D.25138;
  struct MonoArray * D.25139;
  struct MonoString * D.25142;
  void * D.25143;
  long int D.25144;
  struct MonoObject * D.25147;
  struct MonoArray * D.25152;
  struct MonoArray * D.25153;
  struct MonoString * D.25156;
  <unnamed-unsigned:15> D.25159;
  int D.25160;
  struct MonoDomain * domain;
  struct MonoJitInfo * ji;
  static int (*<T3d37>) (struct MonoContext *, void *) call_filter = 0B;
  struct MonoJitTlsData * jit_tls;
  struct MonoLMF * lmf;
  struct MonoArray * initial_trace_ips;
  struct GList * trace_ips;
  struct MonoException * mono_ex;
  gboolean stack_overflow;
  struct MonoContext initial_ctx;
  struct MonoMethod * method;
  int frame_count;
  gboolean has_dynamic_methods;
  gint32 filter_idx;
  int i;
  struct MonoObject * ex_obj;

  try
    {
      domain = mono_domain_get ();
      ji = 0B;
      mono_jit_tls_id.83 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.83);
      lmf.84 = mono_get_lmf ();
      lmf = lmf.84;
      initial_trace_ips = 0B;
      trace_ips = 0B;
      stack_overflow = 0;
      frame_count = 0;
      has_dynamic_methods = 0;
      D.24983 = ctx == 0B;
      D.24984 = (long int) D.24983;
      D.24985 = __builtin_expect (D.24984, 0);
      if (D.24985 != 0) goto <D.24986>; else goto <D.24987>;
      <D.24986>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1316, "ctx != NULL");
      <D.24987>:
      D.24988 = domain->stack_overflow_ex;
      if (D.24988 == obj) goto <D.24989>; else goto <D.24990>;
      <D.24989>:
      stack_overflow = 1;
      <D.24990>:
      mono_ex = obj;
      initial_trace_ips = mono_ex->trace_ips;
      D.24991 = mono_defaults.exception_class;
      D.24992 = mono_object_isinst (obj, D.24991);
      if (D.24992 != 0B) goto <D.24993>; else goto <D.24994>;
      <D.24993>:
      mono_ex = obj;
      initial_trace_ips = mono_ex->trace_ips;
      goto <D.24995>;
      <D.24994>:
      mono_ex = 0B;
      <D.24995>:
      call_filter.85 = call_filter;
      if (call_filter.85 == 0B) goto <D.24997>; else goto <D.24998>;
      <D.24997>:
      D.24999 = mono_get_call_filter ();
      call_filter.86 = (int (*<T3d37>) (struct MonoContext *, void *)) D.24999;
      call_filter = call_filter.86;
      <D.24998>:
      D.25001 = jit_tls->end_of_stack;
      D.25002 = D.25001 == 0B;
      D.25003 = (long int) D.25002;
      D.25004 = __builtin_expect (D.25003, 0);
      if (D.25004 != 0) goto <D.25005>; else goto <D.25006>;
      <D.25005>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1334, "jit_tls->end_of_stack");
      <D.25006>:
      D.25007 = jit_tls->abort_func;
      D.25008 = D.25007 == 0B;
      D.25009 = (long int) D.25008;
      D.25010 = __builtin_expect (D.25009, 0);
      if (D.25010 != 0) goto <D.25011>; else goto <D.25012>;
      <D.25011>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1335, "jit_tls->abort_func");
      <D.25012>:
      if (out_filter_idx != 0B) goto <D.25013>; else goto <D.25014>;
      <D.25013>:
      *out_filter_idx = -1;
      <D.25014>:
      if (out_ji != 0B) goto <D.25015>; else goto <D.25016>;
      <D.25015>:
      *out_ji = 0B;
      <D.25016>:
      if (out_prev_ji != 0B) goto <D.25017>; else goto <D.25018>;
      <D.25017>:
      *out_prev_ji = 0B;
      <D.25018>:
      filter_idx = 0;
      initial_ctx = *ctx;
      <D.23328>:
      {
        struct MonoContext new_ctx;
        guint32 free_stack;
        int clause_index_start;
        gboolean unwind_res;
        struct StackFrameInfo frame;

        try
          {
            clause_index_start = 0;
            unwind_res = 1;
            if (out_prev_ji != 0B) goto <D.25019>; else goto <D.25020>;
            <D.25019>:
            *out_prev_ji = ji;
            <D.25020>:
            unwind_res = mono_find_jit_info_ext (domain, jit_tls, 0B, ctx, &new_ctx, 0B, &lmf, 0B, &frame);
            if (unwind_res != 0) goto <D.25021>; else goto <D.25022>;
            <D.25021>:
            D.25023 = frame.type;
            D.25024 = D.25023 + 4294967295;
            if (D.25024 <= 1) goto <D.25025>; else goto <D.25026>;
            <D.25025>:
            *ctx = new_ctx;
            // predicted unlikely by continue predictor.
            goto <D.23318>;
            <D.25026>:
            D.25023 = frame.type;
            D.25027 = D.25023 != 0;
            D.25028 = (long int) D.25027;
            D.25029 = __builtin_expect (D.25028, 0);
            if (D.25029 != 0) goto <D.25030>; else goto <D.25031>;
            <D.25030>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1363, "frame.type == FRAME_TYPE_MANAGED");
            <D.25031>:
            ji = frame.ji;
            <D.25022>:
            if (unwind_res == 0) goto <D.25032>; else goto <D.25033>;
            <D.25032>:
            D.25034 = mono_ex != 0B;
            D.25035 = initial_trace_ips == 0B;
            D.25036 = D.25034 & D.25035;
            if (D.25036 != 0) goto <D.25037>; else goto <D.25038>;
            <D.25037>:
            trace_ips = monoeg_g_list_reverse (trace_ips);
            D.25039 = mono_defaults.int_class;
            D.25040 = glist_to_array (trace_ips, D.25039);
            D.25041 = &mono_ex->trace_ips;
            mono_gc_wbarrier_set_field (mono_ex, D.25041, D.25040);
            D.25042 = build_native_trace ();
            D.25043 = &mono_ex->native_trace_ips;
            mono_gc_wbarrier_set_field (mono_ex, D.25043, D.25042);
            if (has_dynamic_methods != 0) goto <D.25044>; else goto <D.25045>;
            <D.25044>:
            D.25046 = ves_icall_System_Exception_get_trace (mono_ex);
            D.25047 = &mono_ex->stack_trace;
            mono_gc_wbarrier_set_field (mono_ex, D.25047, D.25046);
            <D.25045>:
            <D.25038>:
            monoeg_g_list_free (trace_ips);
            trace_ips = 0B;
            D.25048 = 0;
            return D.25048;
            <D.25033>:
            frame_count = frame_count + 1;
            method = jinfo_get_method (ji);
            D.25049 = mini_get_debug_options ();
            D.25050 = D.25049->reverse_pinvoke_exceptions;
            if (D.25050 != 0) goto <D.25051>; else goto <D.25052>;
            <D.25051>:
            D.25053 = BIT_FIELD_REF <*method, 8, 256>;
            D.25054 = D.25053 & 124;
            if (D.25054 == 20) goto <D.25055>; else goto <D.25056>;
            <D.25055>:
            D.25057 = mono_method_full_name (method, 1);
            monoeg_g_log (0B, 4, "A native frame was found while unwinding the stack after an exception.\nThe native frame called the managed method:\n%s\n", D.25057);
            <D.23319>:
            goto <D.23319>;
            <D.25056>:
            <D.25052>:
            D.25053 = BIT_FIELD_REF <*method, 8, 256>;
            D.25054 = D.25053 & 124;
            if (D.25054 != 16) goto <D.25058>; else goto <D.25059>;
            <D.25058>:
            if (mono_ex != 0B) goto <D.25060>; else goto <D.25061>;
            <D.25060>:
            D.25035 = initial_trace_ips == 0B;
            D.25062 = frame_count <= 999;
            D.25063 = D.25035 & D.25062;
            if (D.25063 != 0) goto <D.25064>; else goto <D.25065>;
            <D.25064>:
            D.25066 = ctx->rip;
            D.25067 = (void *) D.25066;
            trace_ips = monoeg_g_list_prepend (trace_ips, D.25067);
            D.25068 = get_generic_info_from_stack_frame (ji, ctx);
            trace_ips = monoeg_g_list_prepend (trace_ips, D.25068);
            <D.25065>:
            <D.25061>:
            <D.25059>:
            D.25069 = BIT_FIELD_REF <*method, 8, 264>;
            D.25070 = D.25069 & 2;
            if (D.25070 != 0) goto <D.25071>; else goto <D.25072>;
            <D.25071>:
            has_dynamic_methods = 1;
            <D.25072>:
            if (stack_overflow != 0) goto <D.25073>; else goto <D.25074>;
            <D.25073>:
            if (1 != 0) goto <D.25075>; else goto <D.25076>;
            <D.25075>:
            D.25077 = ctx->rsp;
            D.25078 = (unsigned int) D.25077;
            D.25079 = initial_ctx.rsp;
            D.25080 = (unsigned int) D.25079;
            free_stack = D.25078 - D.25080;
            goto <D.25081>;
            <D.25076>:
            D.25079 = initial_ctx.rsp;
            D.25080 = (unsigned int) D.25079;
            D.25077 = ctx->rsp;
            D.25078 = (unsigned int) D.25077;
            free_stack = D.25080 - D.25078;
            <D.25081>:
            goto <D.25082>;
            <D.25074>:
            free_stack = 16777215;
            <D.25082>:
            i = clause_index_start;
            goto <D.23326>;
            <D.23325>:
            {
              struct MonoJitExceptionInfo * ei;
              gboolean filtered;

              ei = &ji->clauses[i];
              filtered = 0;
              if (free_stack <= 65536) goto <D.25083>; else goto <D.25084>;
              <D.25083>:
              // predicted unlikely by continue predictor.
              goto <D.23322>;
              <D.25084>:
              D.25066 = ctx->rip;
              D.25067 = (void *) D.25066;
              D.25085 = is_address_protected (ji, ei, D.25067);
              if (D.25085 != 0) goto <D.25086>; else goto <D.25087>;
              <D.25086>:
              {
                struct MonoClass * catch_class;

                catch_class = get_exception_catch_class (ei, ji, ctx);
                if (non_exception != 0B) goto <D.25090>; else goto <D.25088>;
                <D.25090>:
                D.25091 = wrap_non_exception_throws (method);
                if (D.25091 == 0) goto <D.25092>; else goto <D.25088>;
                <D.25092>:
                ex_obj = non_exception;
                goto <D.25089>;
                <D.25088>:
                ex_obj = obj;
                <D.25089>:
                D.25093 = ei->flags;
                if (D.25093 == 1) goto <D.25094>; else goto <D.25095>;
                <D.25094>:
                {
                  gboolean is_user_frame;

                  D.25053 = BIT_FIELD_REF <*method, 8, 256>;
                  D.25096 = D.25053 & 124;
                  D.25097 = D.25096 == 0;
                  D.25098 = D.25096 == 68;
                  D.25099 = D.25097 | D.25098;
                  is_user_frame = (gboolean) D.25099;
                  mono_perfcounters.87 = mono_perfcounters;
                  D.25101 = mono_perfcounters.87->exceptions_filters;
                  D.25102 = D.25101 + 1;
                  mono_perfcounters.87->exceptions_filters = D.25102;
                  if (is_user_frame != 0) goto <D.25103>; else goto <D.25104>;
                  <D.25103>:
                  D.25034 = mono_ex != 0B;
                  D.25035 = initial_trace_ips == 0B;
                  D.25036 = D.25034 & D.25035;
                  if (D.25036 != 0) goto <D.25105>; else goto <D.25106>;
                  <D.25105>:
                  trace_ips = monoeg_g_list_reverse (trace_ips);
                  D.25039 = mono_defaults.int_class;
                  D.25107 = glist_to_array (trace_ips, D.25039);
                  D.25041 = &mono_ex->trace_ips;
                  mono_gc_wbarrier_set_field (mono_ex, D.25041, D.25107);
                  D.25108 = build_native_trace ();
                  D.25043 = &mono_ex->native_trace_ips;
                  mono_gc_wbarrier_set_field (mono_ex, D.25043, D.25108);
                  if (has_dynamic_methods != 0) goto <D.25109>; else goto <D.25110>;
                  <D.25109>:
                  D.25111 = ves_icall_System_Exception_get_trace (mono_ex);
                  D.25047 = &mono_ex->stack_trace;
                  mono_gc_wbarrier_set_field (mono_ex, D.25047, D.25111);
                  <D.25110>:
                  <D.25106>:
                  monoeg_g_list_free (trace_ips);
                  trace_ips = 0B;
                  <D.25104>:
                  D.25112 = BIT_FIELD_REF <*ji, 8, 272>;
                  D.25113 = D.25112 & 32;
                  if (D.25113 != 0) goto <D.25114>; else goto <D.25115>;
                  <D.25114>:
                  ex_obj.88 = (long int) ex_obj;
                  ctx->rax = ex_obj.88;
                  goto <D.25117>;
                  <D.25115>:
                  D.25118 = ei->exvar_offset;
                  D.25119 = (sizetype) D.25118;
                  D.25120 = ctx->rbp;
                  D.25121 = (sizetype) D.25120;
                  D.25122 = D.25119 + D.25121;
                  D.25123 = (void * *) D.25122;
                  *D.25123 = ex_obj;
                  <D.25117>:
                  mono_debugger_agent_begin_exception_filter (mono_ex, ctx, &initial_ctx);
                  call_filter.85 = call_filter;
                  D.25124 = ei->data.filter;
                  filtered = call_filter.85 (ctx, D.25124);
                  mono_debugger_agent_end_exception_filter (mono_ex, ctx, &initial_ctx);
                  D.25125 = filtered != 0;
                  D.25126 = out_filter_idx != 0B;
                  D.25127 = D.25125 & D.25126;
                  if (D.25127 != 0) goto <D.25128>; else goto <D.25129>;
                  <D.25128>:
                  *out_filter_idx = filter_idx;
                  <D.25129>:
                  if (out_ji != 0B) goto <D.25130>; else goto <D.25131>;
                  <D.25130>:
                  *out_ji = ji;
                  <D.25131>:
                  filter_idx = filter_idx + 1;
                  if (filtered != 0) goto <D.25132>; else goto <D.25133>;
                  <D.25132>:
                  if (is_user_frame == 0) goto <D.25134>; else goto <D.25135>;
                  <D.25134>:
                  D.25034 = mono_ex != 0B;
                  D.25035 = initial_trace_ips == 0B;
                  D.25036 = D.25034 & D.25035;
                  if (D.25036 != 0) goto <D.25136>; else goto <D.25137>;
                  <D.25136>:
                  trace_ips = monoeg_g_list_reverse (trace_ips);
                  D.25039 = mono_defaults.int_class;
                  D.25138 = glist_to_array (trace_ips, D.25039);
                  D.25041 = &mono_ex->trace_ips;
                  mono_gc_wbarrier_set_field (mono_ex, D.25041, D.25138);
                  D.25139 = build_native_trace ();
                  D.25043 = &mono_ex->native_trace_ips;
                  mono_gc_wbarrier_set_field (mono_ex, D.25043, D.25139);
                  if (has_dynamic_methods != 0) goto <D.25140>; else goto <D.25141>;
                  <D.25140>:
                  D.25142 = ves_icall_System_Exception_get_trace (mono_ex);
                  D.25047 = &mono_ex->stack_trace;
                  mono_gc_wbarrier_set_field (mono_ex, D.25047, D.25142);
                  <D.25141>:
                  <D.25137>:
                  monoeg_g_list_free (trace_ips);
                  trace_ips = 0B;
                  <D.25135>:
                  D.25143 = ei->handler_start;
                  D.25144 = (long int) D.25143;
                  ctx->rip = D.25144;
                  D.25048 = 1;
                  return D.25048;
                  <D.25133>:
                }
                <D.25095>:
                D.25093 = ei->flags;
                if (D.25093 == 0) goto <D.25145>; else goto <D.25146>;
                <D.25145>:
                D.25147 = mono_object_isinst (ex_obj, catch_class);
                if (D.25147 != 0B) goto <D.25148>; else goto <D.25149>;
                <D.25148>:
                D.25034 = mono_ex != 0B;
                D.25035 = initial_trace_ips == 0B;
                D.25036 = D.25034 & D.25035;
                if (D.25036 != 0) goto <D.25150>; else goto <D.25151>;
                <D.25150>:
                trace_ips = monoeg_g_list_reverse (trace_ips);
                D.25039 = mono_defaults.int_class;
                D.25152 = glist_to_array (trace_ips, D.25039);
                D.25041 = &mono_ex->trace_ips;
                mono_gc_wbarrier_set_field (mono_ex, D.25041, D.25152);
                D.25153 = build_native_trace ();
                D.25043 = &mono_ex->native_trace_ips;
                mono_gc_wbarrier_set_field (mono_ex, D.25043, D.25153);
                if (has_dynamic_methods != 0) goto <D.25154>; else goto <D.25155>;
                <D.25154>:
                D.25156 = ves_icall_System_Exception_get_trace (mono_ex);
                D.25047 = &mono_ex->stack_trace;
                mono_gc_wbarrier_set_field (mono_ex, D.25047, D.25156);
                <D.25155>:
                <D.25151>:
                monoeg_g_list_free (trace_ips);
                trace_ips = 0B;
                if (out_ji != 0B) goto <D.25157>; else goto <D.25158>;
                <D.25157>:
                *out_ji = ji;
                <D.25158>:
                D.25143 = ei->handler_start;
                D.25144 = (long int) D.25143;
                ctx->rip = D.25144;
                D.25048 = 1;
                return D.25048;
                <D.25149>:
                <D.25146>:
              }
              <D.25087>:
            }
            <D.23322>:
            i = i + 1;
            <D.23326>:
            D.25159 = ji->num_clauses;
            D.25160 = (int) D.25159;
            if (D.25160 > i) goto <D.23325>; else goto <D.23327>;
            <D.23327>:
            *ctx = new_ctx;
          }
        finally
          {
            new_ctx = {CLOBBER};
            frame = {CLOBBER};
          }
      }
      <D.23318>:
      goto <D.23328>;
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1490);
    }
  finally
    {
      lmf = {CLOBBER};
      initial_ctx = {CLOBBER};
    }
}


glist_to_array (struct GList * list, struct MonoClass * eclass)
{
  struct MonoArray * D.25168;
  unsigned int D.25169;
  long unsigned int D.25170;
  long unsigned int D.25171;
  void * D.25172;
  struct MonoDomain * domain;
  struct MonoArray * res;
  int len;
  int i;

  domain = mono_domain_get ();
  if (list == 0B) goto <D.25166>; else goto <D.25167>;
  <D.25166>:
  D.25168 = 0B;
  return D.25168;
  <D.25167>:
  D.25169 = monoeg_g_list_length (list);
  len = (int) D.25169;
  D.25170 = (long unsigned int) len;
  res = mono_array_new (domain, eclass, D.25170);
  i = 0;
  goto <D.23228>;
  <D.23227>:
  {
    void * * __p;

    D.25171 = (long unsigned int) i;
    __p = mono_array_addr_with_size (res, 8, D.25171);
    D.25172 = list->data;
    *__p = D.25172;
  }
  list = list->next;
  i = i + 1;
  <D.23228>:
  if (list != 0B) goto <D.23227>; else goto <D.23229>;
  <D.23229>:
  D.25168 = res;
  return D.25168;
}


build_native_trace ()
{
  struct MonoArray * D.25174;

  D.25174 = 0B;
  return D.25174;
}


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

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


get_exception_catch_class (struct MonoJitExceptionInfo * ei, struct MonoJitInfo * ji, struct MonoContext * ctx)
{
  unsigned int D.25181;
  struct MonoClass * D.25182;
  unsigned char D.25185;
  unsigned char D.25186;
  struct MonoGenericJitInfo * D.25188;
  unsigned char D.25189;
  unsigned char D.25190;
  void * D.25191;
  struct MonoType * D.25192;
  struct MonoClass * catch_class;
  struct MonoType * inflated_type;
  struct MonoGenericContext context;

  try
    {
      catch_class = ei->data.catch_class;
      if (catch_class == 0B) goto <D.25178>; else goto <D.25180>;
      <D.25180>:
      D.25181 = ei->flags;
      if (D.25181 != 0) goto <D.25178>; else goto <D.25179>;
      <D.25178>:
      D.25182 = 0B;
      return D.25182;
      <D.25179>:
      D.25185 = BIT_FIELD_REF <*ji, 8, 272>;
      D.25186 = D.25185 & 2;
      if (D.25186 == 0) goto <D.25183>; else goto <D.25187>;
      <D.25187>:
      D.25188 = mono_jit_info_get_generic_jit_info (ji);
      D.25189 = BIT_FIELD_REF <*D.25188, 8, 232>;
      D.25190 = D.25189 & 1;
      if (D.25190 == 0) goto <D.25183>; else goto <D.25184>;
      <D.25183>:
      D.25182 = catch_class;
      return D.25182;
      <D.25184>:
      D.25191 = get_generic_info_from_stack_frame (ji, ctx);
      context = get_generic_context_from_stack_frame (ji, D.25191);
      D.25192 = &catch_class->byval_arg;
      inflated_type = mono_class_inflate_generic_type (D.25192, &context);
      catch_class = mono_class_from_mono_type (inflated_type);
      mono_metadata_free_type (inflated_type);
      D.25182 = catch_class;
      return D.25182;
    }
  finally
    {
      context = {CLOBBER};
    }
}


wrap_non_exception_throws (struct MonoMethod * m)
{
  struct MonoClass * D.25195;
  struct MonoImage * D.25196;
  _Bool D.25197;
  long int D.25198;
  long int D.25199;
  unsigned char D.25202;
  gboolean D.25205;
  unsigned char D.25206;
  struct MonoClass * klass.91;
  struct MonoClass * tmp_klass.89;
  struct MonoImage * D.25212;
  struct MonoClass * tmp_klass.90;
  _Bool D.25214;
  long int D.25215;
  long int D.25216;
  struct MonoMethod * D.25223;
  struct MonoClass * D.25225;
  struct MonoClass * klass.92;
  unsigned int D.25227;
  const mono_byte * p.93;
  const gchar * p.94;
  short unsigned int D.25230;
  _Bool D.25231;
  long int D.25232;
  long int D.25233;
  const gchar * p.95;
  char D.25239;
  const gchar * p.96;
  unsigned int D.25243;
  int D.25244;
  long unsigned int D.25245;
  long unsigned int D.25246;
  sizetype D.25247;
  char * D.25248;
  const gchar * p.97;
  int D.23280;
  int iftmp.98;
  int D.23279;
  const char[23] * D.25253;
  unsigned char D.25254;
  int D.25255;
  unsigned char D.25256;
  int D.25257;
  _Bool D.25258;
  _Bool D.25259;
  _Bool D.25260;
  const unsigned char * D.25263;
  unsigned char D.25264;
  int D.25265;
  const unsigned char * D.25266;
  unsigned char D.25267;
  int D.25268;
  _Bool D.25269;
  _Bool D.25270;
  const unsigned char * D.25273;
  unsigned char D.25274;
  int D.25275;
  const unsigned char * D.25276;
  unsigned char D.25277;
  int D.25278;
  _Bool D.25279;
  _Bool D.25280;
  const unsigned char * D.25283;
  unsigned char D.25284;
  int D.25285;
  const unsigned char * D.25286;
  unsigned char D.25287;
  int D.25288;
  _Bool D.25290;
  long int D.25291;
  long int D.25292;
  int D.25295;
  unsigned char D.25296;
  struct MonoAssembly * ass;
  struct MonoCustomAttrInfo * attrs;
  static struct MonoClass * klass;
  int i;
  gboolean val;

  D.25195 = m->klass;
  D.25196 = D.25195->image;
  ass = D.25196->assembly;
  val = 0;
  D.25197 = ass == 0B;
  D.25198 = (long int) D.25197;
  D.25199 = __builtin_expect (D.25198, 0);
  if (D.25199 != 0) goto <D.25200>; else goto <D.25201>;
  <D.25200>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1196, "ass");
  <D.25201>:
  D.25202 = ass->wrap_non_exception_throws_inited;
  if (D.25202 != 0) goto <D.25203>; else goto <D.25204>;
  <D.25203>:
  D.25206 = ass->wrap_non_exception_throws;
  D.25205 = (gboolean) D.25206;
  return D.25205;
  <D.25204>:
  {
    static struct MonoClass * tmp_klass;

    {
      tmp_klass.89 = tmp_klass;
      if (tmp_klass.89 == 0B) goto <D.25208>; else goto <D.25209>;
      <D.25208>:
      if (0 != 0) goto <D.25210>; else goto <D.25211>;
      <D.25210>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1200, "mono_defaults.corlib == mono_defaults.corlib");
      <D.25211>:
      D.25212 = mono_defaults.corlib;
      tmp_klass.90 = mono_class_from_name (D.25212, "System.Runtime.CompilerServices", "RuntimeCompatibilityAttribute");
      tmp_klass = tmp_klass.90;
      tmp_klass.89 = tmp_klass;
      D.25214 = tmp_klass.89 == 0B;
      D.25215 = (long int) D.25214;
      D.25216 = __builtin_expect (D.25215, 0);
      if (D.25216 != 0) goto <D.25217>; else goto <D.25218>;
      <D.25217>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1200, "tmp_klass");
      <D.25218>:
      <D.25209>:
    }
    klass.91 = tmp_klass;
  }
  klass = klass.91;
  attrs = mono_custom_attrs_from_assembly (ass);
  if (attrs != 0B) goto <D.25219>; else goto <D.25220>;
  <D.25219>:
  i = 0;
  goto <D.23282>;
  <D.23281>:
  {
    struct MonoCustomAttrEntry * attr;
    const gchar * p;
    int len;
    int num_named;
    int named_type;
    int data_type;
    int name_len;
    char * name;

    try
      {
        attr = &attrs->attrs[i];
        D.25223 = attr->ctor;
        if (D.25223 == 0B) goto <D.25221>; else goto <D.25224>;
        <D.25224>:
        D.25223 = attr->ctor;
        D.25225 = D.25223->klass;
        klass.92 = klass;
        if (D.25225 != klass.92) goto <D.25221>; else goto <D.25222>;
        <D.25221>:
        // predicted unlikely by continue predictor.
        goto <D.23271>;
        <D.25222>:
        D.25227 = attr->data_size;
        len = (int) D.25227;
        p.93 = attr->data;
        p = p.93;
        p.94 = p;
        D.25230 = MEM[(const guint16 *)p.94];
        D.25231 = D.25230 != 1;
        D.25232 = (long int) D.25231;
        D.25233 = __builtin_expect (D.25232, 0);
        if (D.25233 != 0) goto <D.25234>; else goto <D.25235>;
        <D.25234>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1215, "read16 (p) == 0x0001");
        <D.25235>:
        p.94 = p;
        p.95 = p.94 + 2;
        p = p.95;
        p.94 = p;
        D.25230 = MEM[(const guint16 *)p.94];
        num_named = (int) D.25230;
        if (num_named != 1) goto <D.25237>; else goto <D.25238>;
        <D.25237>:
        // predicted unlikely by continue predictor.
        goto <D.23271>;
        <D.25238>:
        p.94 = p;
        p.95 = p.94 + 2;
        p = p.95;
        p.94 = p;
        D.25239 = *p.94;
        named_type = (int) D.25239;
        p.94 = p;
        p.96 = p.94 + 1;
        p = p.96;
        p.94 = p;
        D.25239 = *p.94;
        data_type = (int) D.25239;
        p.94 = p;
        p.96 = p.94 + 1;
        p = p.96;
        if (named_type != 84) goto <D.25241>; else goto <D.25242>;
        <D.25241>:
        // predicted unlikely by continue predictor.
        goto <D.23271>;
        <D.25242>:
        p.94 = p;
        D.25243 = mono_metadata_decode_blob_size (p.94, &p);
        name_len = (int) D.25243;
        D.25244 = name_len + 1;
        D.25245 = (long unsigned int) D.25244;
        name = monoeg_malloc (D.25245);
        D.25246 = (long unsigned int) name_len;
        p.94 = p;
        memcpy (name, p.94, D.25246);
        D.25247 = (sizetype) name_len;
        D.25248 = name + D.25247;
        *D.25248 = 0;
        p.94 = p;
        D.25247 = (sizetype) name_len;
        p.97 = p.94 + D.25247;
        p = p.97;
        {
          size_t __s1_len;
          size_t __s2_len;

          __s2_len = 22;
          if (__s2_len <= 3) goto <D.25251>; else goto <D.25252>;
          <D.25251>:
          {
            const unsigned char * __s2;
            int __result;

            __s2 = name;
            D.25253 = "WrapNonExceptionThrows";
            D.25254 = MEM[(const unsigned char *)D.25253];
            D.25255 = (int) D.25254;
            D.25256 = *__s2;
            D.25257 = (int) D.25256;
            __result = D.25255 - D.25257;
            {
              D.25258 = __s2_len != 0;
              D.25259 = __result == 0;
              D.25260 = D.25258 & D.25259;
              if (D.25260 != 0) goto <D.25261>; else goto <D.25262>;
              <D.25261>:
              D.25263 = &MEM[(void *)"WrapNonExceptionThrows" + 1B];
              D.25264 = *D.25263;
              D.25265 = (int) D.25264;
              D.25266 = __s2 + 1;
              D.25267 = *D.25266;
              D.25268 = (int) D.25267;
              __result = D.25265 - D.25268;
              D.25269 = __s2_len > 1;
              D.25259 = __result == 0;
              D.25270 = D.25269 & D.25259;
              if (D.25270 != 0) goto <D.25271>; else goto <D.25272>;
              <D.25271>:
              D.25273 = &MEM[(void *)"WrapNonExceptionThrows" + 2B];
              D.25274 = *D.25273;
              D.25275 = (int) D.25274;
              D.25276 = __s2 + 2;
              D.25277 = *D.25276;
              D.25278 = (int) D.25277;
              __result = D.25275 - D.25278;
              D.25279 = __s2_len > 2;
              D.25259 = __result == 0;
              D.25280 = D.25279 & D.25259;
              if (D.25280 != 0) goto <D.25281>; else goto <D.25282>;
              <D.25281>:
              D.25283 = &MEM[(void *)"WrapNonExceptionThrows" + 3B];
              D.25284 = *D.25283;
              D.25285 = (int) D.25284;
              D.25286 = __s2 + 3;
              D.25287 = *D.25286;
              D.25288 = (int) D.25287;
              __result = D.25285 - D.25288;
              <D.25282>:
              <D.25272>:
              <D.25262>:
            }
            D.23279 = __result;
          }
          iftmp.98 = -D.23279;
          goto <D.25289>;
          <D.25252>:
          iftmp.98 = __builtin_strcmp (name, "WrapNonExceptionThrows");
          <D.25289>:
          D.23280 = iftmp.98;
        }
        D.25290 = D.23280 != 0;
        D.25291 = (long int) D.25290;
        D.25292 = __builtin_expect (D.25291, 0);
        if (D.25292 != 0) goto <D.25293>; else goto <D.25294>;
        <D.25293>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1233, "!strcmp (name, \"WrapNonExceptionThrows\")");
        <D.25294>:
        monoeg_g_free (name);
        p.94 = p;
        D.25239 = *p.94;
        val = (gboolean) D.25239;
      }
    finally
      {
        p = {CLOBBER};
      }
  }
  <D.23271>:
  i = i + 1;
  <D.23282>:
  D.25295 = attrs->num_attrs;
  if (D.25295 > i) goto <D.23281>; else goto <D.23283>;
  <D.23283>:
  mono_custom_attrs_free (attrs);
  <D.25220>:
  D.25296 = (unsigned char) val;
  ass->wrap_non_exception_throws = D.25296;
  mono_memory_barrier ();
  ass->wrap_non_exception_throws_inited = 1;
  D.25205 = val;
  return D.25205;
}


mono_setup_altstack (struct MonoJitTlsData * tls)
{
  int D.25300;
  guint8 * staddr.99;
  _Bool D.25304;
  long int D.25305;
  long int D.25306;
  long unsigned int stsize.100;
  void * D.25310;
  unsigned int D.25311;
  int D.25312;
  sizetype D.25313;
  void * D.25314;
  int D.25315;
  unsigned int D.25316;
  unsigned int D.25317;
  int D.25318;
  int D.25319;
  unsigned int D.25320;
  unsigned int D.25321;
  void * D.25322;
  unsigned int D.25323;
  sizetype D.25324;
  guint8 * D.25325;
  _Bool D.25326;
  long int D.25327;
  long int D.25328;
  long unsigned int D.25331;
  int D.25332;
  _Bool D.25335;
  long int D.25336;
  long int D.25337;
  void * D.25340;
  void * D.25341;
  _Bool D.25342;
  long int D.25343;
  long int D.25344;
  int D.25347;
  _Bool D.25348;
  long int D.25349;
  long int D.25350;
  unsigned int D.25353;
  int D.25354;
  long int staddr.101;
  long int D.25356;
  long int D.25357;
  unsigned int D.25358;
  unsigned int D.25359;
  unsigned int D.25360;
  unsigned int D.25361;
  int D.25362;
  void * D.25363;
  size_t stsize;
  struct stack_t sa;
  guint8 * staddr;

  try
    {
      stsize = 0;
      staddr = 0B;
      D.25300 = mono_running_on_valgrind ();
      if (D.25300 != 0) goto <D.25301>; else goto <D.25302>;
      <D.25301>:
      return;
      <D.25302>:
      mono_thread_get_stack_bounds (&staddr, &stsize);
      staddr.99 = staddr;
      D.25304 = staddr.99 == 0B;
      D.25305 = (long int) D.25304;
      D.25306 = __builtin_expect (D.25305, 0);
      if (D.25306 != 0) goto <D.25307>; else goto <D.25308>;
      <D.25307>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1938, "staddr");
      <D.25308>:
      staddr.99 = staddr;
      stsize.100 = stsize;
      D.25310 = staddr.99 + stsize.100;
      tls->end_of_stack = D.25310;
      stsize.100 = stsize;
      D.25311 = (unsigned int) stsize.100;
      tls->stack_size = D.25311;
      staddr.99 = staddr;
      D.25312 = mono_pagesize ();
      D.25313 = (sizetype) D.25312;
      D.25314 = staddr.99 + D.25313;
      tls->stack_ovf_guard_base = D.25314;
      D.25315 = mono_pagesize ();
      D.25316 = (unsigned int) D.25315;
      D.25317 = D.25316 + 32767;
      D.25318 = mono_pagesize ();
      D.25319 = -D.25318;
      D.25320 = (unsigned int) D.25319;
      D.25321 = D.25317 & D.25320;
      tls->stack_ovf_guard_size = D.25321;
      D.25322 = tls->stack_ovf_guard_base;
      D.25323 = tls->stack_ovf_guard_size;
      D.25324 = (sizetype) D.25323;
      D.25325 = D.25322 + D.25324;
      D.25326 = &sa < D.25325;
      D.25327 = (long int) D.25326;
      D.25328 = __builtin_expect (D.25327, 0);
      if (D.25328 != 0) goto <D.25329>; else goto <D.25330>;
      <D.25329>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1948, "(guint8*)&sa >= (guint8*)tls->stack_ovf_guard_base + tls->stack_ovf_guard_size");
      <D.25330>:
      D.25323 = tls->stack_ovf_guard_size;
      D.25331 = (long unsigned int) D.25323;
      D.25322 = tls->stack_ovf_guard_base;
      D.25332 = mono_mprotect (D.25322, D.25331, 0);
      if (D.25332 != 0) goto <D.25333>; else goto <D.25334>;
      <D.25333>:
      {
        void * gaddr;

        D.25323 = tls->stack_ovf_guard_size;
        D.25331 = (long unsigned int) D.25323;
        D.25322 = tls->stack_ovf_guard_base;
        gaddr = mono_valloc (D.25322, D.25331, 208);
        D.25322 = tls->stack_ovf_guard_base;
        D.25335 = D.25322 != gaddr;
        D.25336 = (long int) D.25335;
        D.25337 = __builtin_expect (D.25336, 0);
        if (D.25337 != 0) goto <D.25338>; else goto <D.25339>;
        <D.25338>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1953, "gaddr == tls->stack_ovf_guard_base");
        <D.25339>:
        tls->stack_ovf_valloced = 1;
      }
      <D.25334>:
      D.25340 = mono_valloc (0B, 16384, 83);
      tls->signal_stack = D.25340;
      tls->signal_stack_size = 16384;
      D.25341 = tls->signal_stack;
      D.25342 = D.25341 == 0B;
      D.25343 = (long int) D.25342;
      D.25344 = __builtin_expect (D.25343, 0);
      if (D.25344 != 0) goto <D.25345>; else goto <D.25346>;
      <D.25345>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1961, "tls->signal_stack");
      <D.25346>:
      D.25341 = tls->signal_stack;
      sa.ss_sp = D.25341;
      sa.ss_size = 16384;
      sa.ss_flags = 0;
      D.25347 = sigaltstack (&sa, 0B);
      D.25348 = D.25347 != 0;
      D.25349 = (long int) D.25348;
      D.25350 = __builtin_expect (D.25349, 0);
      if (D.25350 != 0) goto <D.25351>; else goto <D.25352>;
      <D.25351>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1966, "sigaltstack (&sa, NULL) == 0");
      <D.25352>:
      D.25353 = tls->signal_stack_size;
      D.25354 = (int) D.25353;
      D.25341 = tls->signal_stack;
      staddr.99 = staddr;
      staddr.101 = (long int) staddr.99;
      D.25322 = tls->stack_ovf_guard_base;
      D.25356 = (long int) D.25322;
      D.25357 = staddr.101 - D.25356;
      D.25358 = (unsigned int) D.25357;
      stsize.100 = stsize;
      D.25359 = (unsigned int) stsize.100;
      D.25323 = tls->stack_ovf_guard_size;
      D.25360 = D.25359 - D.25323;
      D.25361 = D.25358 + D.25360;
      D.25362 = (int) D.25361;
      D.25322 = tls->stack_ovf_guard_base;
      D.25323 = tls->stack_ovf_guard_size;
      D.25324 = (sizetype) D.25323;
      D.25363 = D.25322 + D.25324;
      mono_gc_register_altstack (D.25363, D.25362, D.25341, D.25354);
    }
  finally
    {
      stsize = {CLOBBER};
      sa = {CLOBBER};
      staddr = {CLOBBER};
    }
}


mono_free_altstack (struct MonoJitTlsData * tls)
{
  void * D.25367;
  _Bool D.25368;
  long int D.25369;
  long int D.25370;
  unsigned char D.25375;
  unsigned char D.25376;
  unsigned int D.25379;
  long unsigned int D.25380;
  void * D.25381;
  struct stack_t sa;
  int err;

  try
    {
      D.25367 = tls->signal_stack;
      sa.ss_sp = D.25367;
      sa.ss_size = 16384;
      sa.ss_flags = 2;
      err = sigaltstack (&sa, 0B);
      D.25368 = err != 0;
      D.25369 = (long int) D.25368;
      D.25370 = __builtin_expect (D.25369, 0);
      if (D.25370 != 0) goto <D.25371>; else goto <D.25372>;
      <D.25371>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1981, "err == 0");
      <D.25372>:
      D.25367 = tls->signal_stack;
      if (D.25367 != 0B) goto <D.25373>; else goto <D.25374>;
      <D.25373>:
      D.25367 = tls->signal_stack;
      mono_vfree (D.25367, 16384);
      <D.25374>:
      D.25375 = BIT_FIELD_REF <*tls, 8, 544>;
      D.25376 = D.25375 & 1;
      if (D.25376 != 0) goto <D.25377>; else goto <D.25378>;
      <D.25377>:
      D.25379 = tls->stack_ovf_guard_size;
      D.25380 = (long unsigned int) D.25379;
      D.25381 = tls->stack_ovf_guard_base;
      mono_vfree (D.25381, D.25380);
      goto <D.25382>;
      <D.25378>:
      D.25379 = tls->stack_ovf_guard_size;
      D.25380 = (long unsigned int) D.25379;
      D.25381 = tls->stack_ovf_guard_base;
      mono_mprotect (D.25381, D.25380, 3);
      <D.25382>:
    }
  finally
    {
      sa = {CLOBBER};
    }
}


mono_altstack_restore_prot (mgreg_t * regs, guint8 * code, void * * tramp_data, guint8 * tramp)
{
  void * D.25383;
  void (*<T552>) (void) func;

  func = (void (*<T552>) (void)) tramp_data;
  func ();
  D.25383 = 0B;
  return D.25383;
}


mono_handle_soft_stack_ovf (struct MonoJitTlsData * jit_tls, struct MonoJitInfo * ji, void * ctx, guint8 * fault_addr)
{
  unsigned int D.25385;
  void * D.25388;
  sizetype D.25391;
  guint8 * D.25392;
  int D.25395;
  int D.25396;
  unsigned int D.25397;
  int D.25398;
  unsigned int D.25399;
  sizetype D.25401;
  guint8 * D.25402;
  long unsigned int D.25403;
  sizetype D.25404;
  void * D.25405;
  void * D.25410;
  struct _IO_FILE * stderr.102;
  unsigned int D.25412;
  void * restore_stack_protection_tramp.103;
  gboolean D.25417;

  D.25385 = jit_tls->stack_ovf_guard_size;
  if (D.25385 != 0) goto <D.25386>; else goto <D.25387>;
  <D.25386>:
  D.25388 = jit_tls->stack_ovf_guard_base;
  if (D.25388 <= fault_addr) goto <D.25389>; else goto <D.25390>;
  <D.25389>:
  D.25388 = jit_tls->stack_ovf_guard_base;
  D.25385 = jit_tls->stack_ovf_guard_size;
  D.25391 = (sizetype) D.25385;
  D.25392 = D.25388 + D.25391;
  if (D.25392 > fault_addr) goto <D.25393>; else goto <D.25394>;
  <D.25393>:
  {
    guint32 guard_size;
    gboolean handled;

    handled = 0;
    D.25385 = jit_tls->stack_ovf_guard_size;
    D.25395 = mono_pagesize ();
    D.25396 = D.25395 * -2;
    D.25397 = (unsigned int) D.25396;
    guard_size = D.25385 + D.25397;
    goto <D.23492>;
    <D.23491>:
    D.25398 = mono_pagesize ();
    D.25399 = (unsigned int) D.25398;
    guard_size = guard_size - D.25399;
    <D.23492>:
    if (guard_size != 0) goto <D.25400>; else goto <D.23493>;
    <D.25400>:
    D.25388 = jit_tls->stack_ovf_guard_base;
    D.25401 = (sizetype) guard_size;
    D.25402 = D.25388 + D.25401;
    if (D.25402 > fault_addr) goto <D.23491>; else goto <D.23493>;
    <D.23493>:
    D.25385 = jit_tls->stack_ovf_guard_size;
    guard_size = D.25385 - guard_size;
    D.25403 = (long unsigned int) guard_size;
    D.25388 = jit_tls->stack_ovf_guard_base;
    D.25385 = jit_tls->stack_ovf_guard_size;
    D.25391 = (sizetype) D.25385;
    D.25401 = (sizetype) guard_size;
    D.25404 = D.25391 - D.25401;
    D.25405 = D.25388 + D.25404;
    mono_mprotect (D.25405, D.25403, 3);
    if (ji != 0B) goto <D.25406>; else goto <D.25407>;
    <D.25406>:
    mono_arch_handle_altstack_exception (ctx, fault_addr, 1);
    handled = 1;
    <D.25407>:
    if (handled == 0) goto <D.25408>; else goto <D.25409>;
    <D.25408>:
    D.25410 = mono_arch_ip_from_context (ctx);
    stderr.102 = stderr;
    fprintf (stderr.102, "Stack overflow in unmanaged: IP: %p, fault addr: %p\n", D.25410, fault_addr);
    D.25412 = jit_tls->handling_stack_ovf;
    if (D.25412 == 0) goto <D.25413>; else goto <D.25414>;
    <D.25413>:
    restore_stack_protection_tramp.103 = restore_stack_protection_tramp;
    jit_tls->restore_stack_prot = restore_stack_protection_tramp.103;
    jit_tls->handling_stack_ovf = 1;
    goto <D.25416>;
    <D.25414>:
    <D.25416>:
    <D.25409>:
    D.25417 = 1;
    return D.25417;
  }
  <D.25394>:
  <D.25390>:
  <D.25387>:
  D.25417 = 0;
  return D.25417;
}


mono_handle_hard_stack_ovf (struct MonoJitTlsData * jit_tls, struct MonoJitInfo * ji, void * ctx, guint8 * fault_addr)
{
  void * D.25419;
  struct _IO_FILE * stderr.104;
  struct PrintOverflowUserData ud;
  struct MonoContext mctx;

  try
    {
      D.25419 = mono_arch_ip_from_context (ctx);
      stderr.104 = stderr;
      fprintf (stderr.104, "Stack overflow: IP: %p, fault addr: %p\n", D.25419, fault_addr);
      mono_arch_sigctx_to_monoctx (ctx, &mctx);
      stderr.104 = stderr;
      fprintf (stderr.104, "Stacktrace:\n");
      memset (&ud, 0, 16);
      mono_walk_stack_with_ctx (print_overflow_stack_frame, &mctx, 2, &ud);
      _exit (1);
    }
  finally
    {
      ud = {CLOBBER};
      mctx = {CLOBBER};
    }
}


print_overflow_stack_frame (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  struct MonoJitInfo * D.25421;
  int D.25426;
  int D.25429;
  gboolean D.25430;
  struct MonoMethod * D.25431;
  struct MonoDomain * D.25434;
  int D.25435;
  unsigned int D.25436;
  struct _IO_FILE * stderr.105;
  struct MonoMethod * method;
  struct PrintOverflowUserData * user_data;
  gchar * location;

  method = 0B;
  user_data = data;
  D.25421 = frame->ji;
  if (D.25421 != 0B) goto <D.25422>; else goto <D.25423>;
  <D.25422>:
  D.25421 = frame->ji;
  method = jinfo_get_method (D.25421);
  <D.25423>:
  if (method != 0B) goto <D.25424>; else goto <D.25425>;
  <D.25424>:
  D.25426 = user_data->count;
  if (D.25426 == 0) goto <D.25427>; else goto <D.25428>;
  <D.25427>:
  D.25426 = user_data->count;
  D.25429 = D.25426 + 1;
  user_data->count = D.25429;
  D.25430 = 0;
  return D.25430;
  <D.25428>:
  D.25431 = user_data->omethod;
  if (D.25431 == method) goto <D.25432>; else goto <D.25433>;
  <D.25432>:
  D.25430 = 0;
  return D.25430;
  <D.25433>:
  D.25434 = mono_domain_get ();
  D.25435 = frame->native_offset;
  D.25436 = (unsigned int) D.25435;
  location = mono_debug_print_stack_frame (method, D.25436, D.25434);
  stderr.105 = stderr;
  fprintf (stderr.105, "  %s\n", location);
  monoeg_g_free (location);
  D.25426 = user_data->count;
  if (D.25426 == 1) goto <D.25438>; else goto <D.25439>;
  <D.25438>:
  stderr.105 = stderr;
  fprintf (stderr.105, "  <...>\n");
  user_data->omethod = method;
  goto <D.25440>;
  <D.25439>:
  user_data->omethod = 0B;
  <D.25440>:
  D.25426 = user_data->count;
  D.25429 = D.25426 + 1;
  user_data->count = D.25429;
  goto <D.25441>;
  <D.25425>:
  D.25435 = frame->native_offset;
  stderr.105 = stderr;
  fprintf (stderr.105, "  at <unknown> <0x%05x>\n", D.25435);
  <D.25441>:
  D.25430 = 0;
  return D.25430;
}


mono_handle_native_sigsegv (int signal, void * ctx)
{
  unsigned int mono_jit_tls_id.106;
  const char * iftmp.107;
  int handling_sigsegv.108;
  struct MonoDebugOptions * D.25451;
  int D.25452;
  struct _IO_FILE * stderr.109;
  struct MonoInternalThread * D.25458;
  long unsigned int D.25461;
  long unsigned int D.25462;
  char * * D.25463;
  char * D.25464;
  struct MonoDebugOptions * D.25465;
  int D.25466;
  int D.25471;
  _Bool D.25472;
  long int D.25473;
  long int D.25474;
  struct sigaction sa;
  struct MonoJitTlsData * jit_tls;
  const char * signal_str;

  try
    {
      mono_jit_tls_id.106 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.106);
      if (signal == 11) goto <D.25445>; else goto <D.25446>;
      <D.25445>:
      iftmp.107 = "SIGSEGV";
      goto <D.25447>;
      <D.25446>:
      iftmp.107 = "SIGABRT";
      <D.25447>:
      signal_str = iftmp.107;
      handling_sigsegv.108 = handling_sigsegv;
      if (handling_sigsegv.108 != 0) goto <D.25449>; else goto <D.25450>;
      <D.25449>:
      return;
      <D.25450>:
      D.25451 = mini_get_debug_options ();
      D.25452 = D.25451->suspend_on_sigsegv;
      if (D.25452 != 0) goto <D.25453>; else goto <D.25454>;
      <D.25453>:
      stderr.109 = stderr;
      fprintf (stderr.109, "Received SIGSEGV, suspending...\n");
      <D.23537>:
      sleep (0);
      goto <D.23537>;
      <D.25454>:
      handling_sigsegv = 1;
      if (jit_tls != 0B) goto <D.25456>; else goto <D.25457>;
      <D.25456>:
      D.25458 = mono_thread_internal_current ();
      if (D.25458 != 0B) goto <D.25459>; else goto <D.25460>;
      <D.25459>:
      stderr.109 = stderr;
      fprintf (stderr.109, "Stacktrace:\n\n");
      mono_walk_stack (print_stack_frame_to_stderr, 1, 0B);
      <D.25460>:
      <D.25457>:
      {
        void * array[256];
        char * * names;
        int i;
        int size;

        try
          {
            stderr.109 = stderr;
            fprintf (stderr.109, "\nNative stacktrace:\n\n");
            size = backtrace (&array, 256);
            names = backtrace_symbols (&array, size);
            i = 0;
            goto <D.23543>;
            <D.23542>:
            D.25461 = (long unsigned int) i;
            D.25462 = D.25461 * 8;
            D.25463 = names + D.25462;
            D.25464 = *D.25463;
            stderr.109 = stderr;
            fprintf (stderr.109, "\t%s\n", D.25464);
            i = i + 1;
            <D.23543>:
            if (i < size) goto <D.23542>; else goto <D.23544>;
            <D.23544>:
            free (names);
            D.25465 = mini_get_debug_options ();
            D.25466 = D.25465->no_gdb_backtrace;
            if (D.25466 == 0) goto <D.25467>; else goto <D.25468>;
            <D.25467>:
            {
              pid_t pid;
              int status;
              pid_t crashed_pid;

              try
                {
                  crashed_pid = getpid ();
                  pid = mono_runtime_syscall_fork ();
                  if (pid == 0) goto <D.25469>; else goto <D.25470>;
                  <D.25469>:
                  dup2 (2, 1);
                  mono_gdb_render_native_backtraces (crashed_pid);
                  exit (1);
                  <D.25470>:
                  stderr.109 = stderr;
                  fprintf (stderr.109, "\nDebug info from gdb:\n\n");
                  waitpid (pid, &status, 0);
                }
              finally
                {
                  status = {CLOBBER};
                }
            }
            <D.25468>:
          }
        finally
          {
            array = {CLOBBER};
          }
      }
      stderr.109 = stderr;
      fprintf (stderr.109, "\n=================================================================\nGot a %s while executing native code. This usually indicates\na fatal error in the mono runtime or one of the native libraries \nused by your application.\n=================================================================\n\n", signal_str);
      sa.__sigaction_handler.sa_handler = 0B;
      sigemptyset (&sa.sa_mask);
      sa.sa_flags = 0;
      D.25471 = sigaction (6, &sa, 0B);
      D.25472 = D.25471 == -1;
      D.25473 = (long int) D.25472;
      D.25474 = __builtin_expect (D.25473, 0);
      if (D.25474 != 0) goto <D.25475>; else goto <D.25476>;
      <D.25475>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 2327, "sigaction (SIGABRT, &sa, NULL) != -1");
      <D.25476>:
      abort ();
    }
  finally
    {
      sa = {CLOBBER};
    }
}


print_stack_frame_to_stderr (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  struct MonoJitInfo * D.25479;
  struct MonoDomain * D.25484;
  int D.25485;
  unsigned int D.25486;
  struct _IO_FILE * stderr.110;
  gboolean D.25489;
  struct MonoMethod * method;

  method = 0B;
  D.25479 = frame->ji;
  if (D.25479 != 0B) goto <D.25480>; else goto <D.25481>;
  <D.25480>:
  D.25479 = frame->ji;
  method = jinfo_get_method (D.25479);
  <D.25481>:
  if (method != 0B) goto <D.25482>; else goto <D.25483>;
  <D.25482>:
  {
    gchar * location;

    D.25484 = mono_domain_get ();
    D.25485 = frame->native_offset;
    D.25486 = (unsigned int) D.25485;
    location = mono_debug_print_stack_frame (method, D.25486, D.25484);
    stderr.110 = stderr;
    fprintf (stderr.110, "  %s\n", location);
    monoeg_g_free (location);
  }
  goto <D.25488>;
  <D.25483>:
  D.25485 = frame->native_offset;
  stderr.110 = stderr;
  fprintf (stderr.110, "  at <unknown> <0x%05x>\n", D.25485);
  <D.25488>:
  D.25489 = 0;
  return D.25489;
}


mono_print_thread_dump (void * sigctx)
{
  mono_print_thread_dump_internal (sigctx, 0B);
}


mono_print_thread_dump_internal (void * sigctx, struct MonoContext * start_ctx)
{
  gunichar2 * D.25491;
  unsigned int D.25494;
  long int D.25495;
  struct GError * error.111;
  _Bool D.25497;
  long int D.25498;
  long int D.25499;
  unsigned char D.25503;
  long unsigned int D.25507;
  void * D.25508;
  long int mono_print_thread_dump.112;
  long int stackptr.113;
  char * D.25517;
  struct _IO_FILE * stdout.114;
  struct MonoInternalThread * thread;
  struct MonoContext ctx;
  struct GString * text;
  char * name;
  char * wapi_desc;
  struct GError * error;

  try
    {
      thread = mono_thread_internal_current ();
      text = monoeg_g_string_new (0B);
      error = 0B;
      D.25491 = thread->name;
      if (D.25491 != 0B) goto <D.25492>; else goto <D.25493>;
      <D.25492>:
      D.25494 = thread->name_len;
      D.25495 = (long int) D.25494;
      D.25491 = thread->name;
      name = monoeg_g_utf16_to_utf8 (D.25491, D.25495, 0B, 0B, &error);
      error.111 = error;
      D.25497 = error.111 != 0B;
      D.25498 = (long int) D.25497;
      D.25499 = __builtin_expect (D.25498, 0);
      if (D.25499 != 0) goto <D.25500>; else goto <D.25501>;
      <D.25500>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 2352, "!error");
      <D.25501>:
      monoeg_g_string_append_printf (text, "\n\"%s\"", name);
      monoeg_g_free (name);
      goto <D.25502>;
      <D.25493>:
      D.25503 = thread->threadpool_thread;
      if (D.25503 != 0) goto <D.25504>; else goto <D.25505>;
      <D.25504>:
      monoeg_g_string_append (text, "\n\"<threadpool thread>\"");
      goto <D.25506>;
      <D.25505>:
      monoeg_g_string_append (text, "\n\"<unnamed thread>\"");
      <D.25506>:
      <D.25502>:
      wapi_desc = wapi_current_thread_desc ();
      D.25507 = thread->tid;
      D.25508 = (void *) D.25507;
      monoeg_g_string_append_printf (text, " tid=0x%p this=0x%p %s\n", D.25508, thread, wapi_desc);
      free (wapi_desc);
      if (start_ctx != 0B) goto <D.25509>; else goto <D.25510>;
      <D.25509>:
      memcpy (&ctx, start_ctx, 136);
      goto <D.25511>;
      <D.25510>:
      if (sigctx == 0B) goto <D.25512>; else goto <D.25513>;
      <D.25512>:
      {
        int tmp;
        guint64 stackptr;

        try
          {
            stackptr = (guint64) &tmp;
            mono_arch_flush_register_windows ();
            mono_print_thread_dump.112 = (long int) mono_print_thread_dump;
            ctx.rip = mono_print_thread_dump.112;
            stackptr.113 = (long int) stackptr;
            ctx.rbp = stackptr.113;
            stackptr.113 = (long int) stackptr;
            ctx.rsp = stackptr.113;
          }
        finally
          {
            tmp = {CLOBBER};
          }
      }
      goto <D.25516>;
      <D.25513>:
      mono_arch_sigctx_to_monoctx (sigctx, &ctx);
      <D.25516>:
      <D.25511>:
      mono_walk_stack_with_ctx (print_stack_frame_to_string, &ctx, 3, text);
      D.25517 = text->str;
      stdout.114 = stdout;
      fprintf (stdout.114, "%s\n", D.25517);
      monoeg_g_string_free (text, 1);
      stdout.114 = stdout;
      fflush (stdout.114);
    }
  finally
    {
      ctx = {CLOBBER};
      error = {CLOBBER};
    }
}


print_stack_frame_to_string (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  struct MonoJitInfo * D.25519;
  struct MonoDomain * D.25524;
  int D.25525;
  unsigned int D.25526;
  gboolean D.25528;
  struct GString * p;
  struct MonoMethod * method;

  p = data;
  method = 0B;
  D.25519 = frame->ji;
  if (D.25519 != 0B) goto <D.25520>; else goto <D.25521>;
  <D.25520>:
  D.25519 = frame->ji;
  method = jinfo_get_method (D.25519);
  <D.25521>:
  if (method != 0B) goto <D.25522>; else goto <D.25523>;
  <D.25522>:
  {
    gchar * location;

    D.25524 = mono_domain_get ();
    D.25525 = frame->native_offset;
    D.25526 = (unsigned int) D.25525;
    location = mono_debug_print_stack_frame (method, D.25526, D.25524);
    monoeg_g_string_append_printf (p, "  %s\n", location);
    monoeg_g_free (location);
  }
  goto <D.25527>;
  <D.25523>:
  D.25525 = frame->native_offset;
  monoeg_g_string_append_printf (p, "  at <unknown> <0x%05x>\n", D.25525);
  <D.25527>:
  D.25528 = 0;
  return D.25528;
}


mono_print_thread_dump_from_ctx (struct MonoContext * ctx)
{
  mono_print_thread_dump_internal (0B, ctx);
}


mono_resume_unwind (struct MonoContext * ctx)
{
  unsigned int mono_jit_tls_id.115;
  long int D.25531;
  long int D.25532;
  void * D.25533;
  struct MonoJitTlsData * jit_tls;
  struct MonoContext new_ctx;

  try
    {
      mono_jit_tls_id.115 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.115);
      D.25531 = jit_tls->resume_state.ctx.rip;
      ctx->rip = D.25531;
      D.25532 = jit_tls->resume_state.ctx.rsp;
      ctx->rsp = D.25532;
      new_ctx = *ctx;
      D.25533 = jit_tls->resume_state.ex_obj;
      mono_handle_exception_internal (&new_ctx, D.25533, 1, 0B);
      mono_restore_context (&new_ctx);
    }
  finally
    {
      new_ctx = {CLOBBER};
    }
}


mono_install_handler_block_guard (struct MonoThreadUnwindState * ctx)
{
  int mono_aot_only.116;
  gboolean D.25537;
  void * D.25541;
  struct MonoJitInfo * D.25542;
  struct MonoContext * D.25545;
  struct MonoJitExceptionInfo * D.25548;
  struct FindHandlerBlockData data;
  struct MonoJitTlsData * jit_tls;
  void * resume_ip;

  try
    {
      data = {};
      jit_tls = ctx->unwind_data[2];
      mono_aot_only.116 = mono_aot_only;
      if (mono_aot_only.116 != 0) goto <D.25535>; else goto <D.25536>;
      <D.25535>:
      D.25537 = 0;
      return D.25537;
      <D.25536>:
      if (jit_tls == 0B) goto <D.25538>; else goto <D.25540>;
      <D.25540>:
      D.25541 = jit_tls->handler_block_return_address;
      if (D.25541 != 0B) goto <D.25538>; else goto <D.25539>;
      <D.25538>:
      D.25537 = 0;
      return D.25537;
      <D.25539>:
      mono_thread_info_set_is_async_context (1);
      mono_walk_stack_with_state (find_last_handler_block, ctx, 0, &data);
      mono_thread_info_set_is_async_context (0);
      D.25542 = data.ji;
      if (D.25542 == 0B) goto <D.25543>; else goto <D.25544>;
      <D.25543>:
      D.25537 = 0;
      return D.25537;
      <D.25544>:
      D.25545 = &jit_tls->handler_block_context;
      memcpy (D.25545, &data.ctx, 136);
      D.25542 = data.ji;
      resume_ip = install_handler_block_guard (D.25542, &data.ctx);
      if (resume_ip == 0B) goto <D.25546>; else goto <D.25547>;
      <D.25546>:
      D.25537 = 0;
      return D.25537;
      <D.25547>:
      jit_tls->handler_block_return_address = resume_ip;
      D.25548 = data.ei;
      jit_tls->handler_block = D.25548;
      D.25537 = 1;
      return D.25537;
    }
  finally
    {
      data = {CLOBBER};
    }
}


find_last_handler_block (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  gboolean D.25553;
  long int D.25554;
  sizetype D.25555;
  unsigned int D.25556;
  void * D.25559;
  void * D.25562;
  <unnamed-unsigned:15> D.25565;
  int D.25566;
  int i;
  void * ip;
  struct FindHandlerBlockData * pdata;
  struct MonoJitInfo * ji;

  pdata = data;
  ji = frame->ji;
  if (ji == 0B) goto <D.25551>; else goto <D.25552>;
  <D.25551>:
  D.25553 = 0;
  return D.25553;
  <D.25552>:
  D.25554 = ctx->rip;
  ip = (void *) D.25554;
  i = 0;
  goto <D.23589>;
  <D.23588>:
  {
    struct MonoJitExceptionInfo * ei;

    D.25555 = (sizetype) i;
    ei = &ji->clauses[D.25555];
    D.25556 = ei->flags;
    if (D.25556 != 2) goto <D.25557>; else goto <D.25558>;
    <D.25557>:
    // predicted unlikely by continue predictor.
    goto <D.23586>;
    <D.25558>:
    D.25559 = ei->handler_start;
    if (D.25559 < ip) goto <D.25560>; else goto <D.25561>;
    <D.25560>:
    D.25562 = ei->data.handler_end;
    if (D.25562 > ip) goto <D.25563>; else goto <D.25564>;
    <D.25563>:
    pdata->ji = ji;
    pdata->ei = ei;
    pdata->ctx = *ctx;
    goto <D.23587>;
    <D.25564>:
    <D.25561>:
  }
  <D.23586>:
  i = i + 1;
  <D.23589>:
  D.25565 = ji->num_clauses;
  D.25566 = (int) D.25565;
  if (D.25566 > i) goto <D.23588>; else goto <D.23587>;
  <D.23587>:
  D.25553 = 0;
  return D.25553;
}


install_handler_block_guard (struct MonoJitInfo * ji, struct MonoContext * ctx)
{
  long int D.25568;
  unsigned int D.25569;
  void * D.25572;
  void * D.25575;
  <unnamed-unsigned:15> D.25577;
  int D.25578;
  void * D.25581;
  void * D.25584;
  int i;
  struct MonoJitExceptionInfo * clause;
  void * ip;

  clause = 0B;
  D.25568 = ctx->rip;
  ip = (void *) D.25568;
  i = 0;
  goto <D.23600>;
  <D.23599>:
  clause = &ji->clauses[i];
  D.25569 = clause->flags;
  if (D.25569 != 2) goto <D.25570>; else goto <D.25571>;
  <D.25570>:
  // predicted unlikely by continue predictor.
  goto <D.23597>;
  <D.25571>:
  D.25572 = clause->handler_start;
  if (D.25572 < ip) goto <D.25573>; else goto <D.25574>;
  <D.25573>:
  D.25575 = clause->data.handler_end;
  if (D.25575 > ip) goto <D.23598>; else goto <D.25576>;
  <D.25576>:
  <D.25574>:
  <D.23597>:
  i = i + 1;
  <D.23600>:
  D.25577 = ji->num_clauses;
  D.25578 = (int) D.25577;
  if (D.25578 > i) goto <D.23599>; else goto <D.23598>;
  <D.23598>:
  D.25577 = ji->num_clauses;
  D.25578 = (int) D.25577;
  if (D.25578 == i) goto <D.25579>; else goto <D.25580>;
  <D.25579>:
  D.25581 = 0B;
  return D.25581;
  <D.25580>:
  D.25572 = clause->handler_start;
  if (D.25572 == ip) goto <D.25582>; else goto <D.25583>;
  <D.25582>:
  D.25581 = 0B;
  return D.25581;
  <D.25583>:
  D.25584 = mono_create_handler_block_trampoline ();
  D.25581 = mono_arch_install_handler_block_guard (ji, clause, ctx, D.25584);
  return D.25581;
}


mono_set_cast_details (struct MonoClass * from, struct MonoClass * to)
{
  struct MonoDebugOptions * D.25586;
  int D.25587;
  unsigned int mono_jit_tls_id.117;
  struct MonoJitTlsData * jit_tls;

  jit_tls = 0B;
  D.25586 = mini_get_debug_options ();
  D.25587 = D.25586->better_cast_details;
  if (D.25587 != 0) goto <D.25588>; else goto <D.25589>;
  <D.25588>:
  mono_jit_tls_id.117 = mono_jit_tls_id;
  jit_tls = pthread_getspecific (mono_jit_tls_id.117);
  jit_tls->class_cast_from = from;
  jit_tls->class_cast_to = to;
  <D.25589>:
}


mono_thread_state_init_from_sigctx (struct MonoThreadUnwindState * ctx, void * sigctx)
{
  void * D.25594;
  gboolean D.25595;
  struct MonoContext * D.25598;
  struct MonoDomain * D.25600;
  struct MonoLMF * D.25601;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  if (thread == 0B) goto <D.25591>; else goto <D.25593>;
  <D.25593>:
  D.25594 = thread->jit_data;
  if (D.25594 == 0B) goto <D.25591>; else goto <D.25592>;
  <D.25591>:
  ctx->valid = 0;
  D.25595 = 0;
  return D.25595;
  <D.25592>:
  if (sigctx != 0B) goto <D.25596>; else goto <D.25597>;
  <D.25596>:
  D.25598 = &ctx->ctx;
  mono_arch_sigctx_to_monoctx (sigctx, D.25598);
  goto <D.25599>;
  <D.25597>:
  D.25598 = &ctx->ctx;
  __asm__ __volatile__("movq $0x0,  0x00(%0)
movq %%rbx, 0x08(%0)
movq %%rcx, 0x10(%0)
movq %%rdx, 0x18(%0)
movq %%rbp, 0x20(%0)
movq %%rsp, 0x28(%0)
movq %%rsi, 0x30(%0)
movq %%rdi, 0x38(%0)
movq %%r8,  0x40(%0)
movq %%r9,  0x48(%0)
movq %%r10, 0x50(%0)
movq %%r11, 0x58(%0)
movq %%r12, 0x60(%0)
movq %%r13, 0x68(%0)
movq %%r14, 0x70(%0)
movq %%r15, 0x78(%0)
leaq (%%rip), %%rdx
movq %%rdx, 0x80(%0)
" :  : "a" D.25598 : "memory", "rdx");
  <D.25599>:
  D.25600 = mono_domain_get ();
  ctx->unwind_data[0] = D.25600;
  D.25601 = mono_get_lmf ();
  ctx->unwind_data[1] = D.25601;
  D.25594 = thread->jit_data;
  ctx->unwind_data[2] = D.25594;
  ctx->valid = 1;
  D.25595 = 1;
  return D.25595;
}


mono_thread_state_init_from_monoctx (struct MonoThreadUnwindState * ctx, struct MonoContext * mctx)
{
  void * D.25606;
  gboolean D.25607;
  struct MonoDomain * D.25608;
  struct MonoLMF * D.25609;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  if (thread == 0B) goto <D.25603>; else goto <D.25605>;
  <D.25605>:
  D.25606 = thread->jit_data;
  if (D.25606 == 0B) goto <D.25603>; else goto <D.25604>;
  <D.25603>:
  ctx->valid = 0;
  D.25607 = 0;
  return D.25607;
  <D.25604>:
  ctx->ctx = *mctx;
  D.25608 = mono_domain_get ();
  ctx->unwind_data[0] = D.25608;
  D.25609 = mono_get_lmf ();
  ctx->unwind_data[1] = D.25609;
  D.25606 = thread->jit_data;
  ctx->unwind_data[2] = D.25606;
  ctx->valid = 1;
  D.25607 = 1;
  return D.25607;
}


mono_thread_state_init_from_current (struct MonoThreadUnwindState * ctx)
{
  void * D.25614;
  gboolean D.25615;
  long int mono_thread_state_init_from_current.118;
  long int stackptr.119;
  struct MonoDomain * D.25618;
  struct MonoLMF * D.25619;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  mono_arch_flush_register_windows ();
  if (thread == 0B) goto <D.25611>; else goto <D.25613>;
  <D.25613>:
  D.25614 = thread->jit_data;
  if (D.25614 == 0B) goto <D.25611>; else goto <D.25612>;
  <D.25611>:
  ctx->valid = 0;
  D.25615 = 0;
  return D.25615;
  <D.25612>:
  {
    int tmp;
    guint64 stackptr;

    try
      {
        stackptr = (guint64) &tmp;
        mono_arch_flush_register_windows ();
        mono_thread_state_init_from_current.118 = (long int) mono_thread_state_init_from_current;
        ctx->ctx.rip = mono_thread_state_init_from_current.118;
        stackptr.119 = (long int) stackptr;
        ctx->ctx.rbp = stackptr.119;
        stackptr.119 = (long int) stackptr;
        ctx->ctx.rsp = stackptr.119;
      }
    finally
      {
        tmp = {CLOBBER};
      }
  }
  D.25618 = mono_domain_get ();
  ctx->unwind_data[0] = D.25618;
  D.25619 = mono_get_lmf ();
  ctx->unwind_data[1] = D.25619;
  D.25614 = thread->jit_data;
  ctx->unwind_data[2] = D.25614;
  ctx->valid = 1;
  D.25615 = 1;
  return D.25615;
}


mono_setup_async_callback (struct MonoContext * ctx, void (*<Tc2>) (void *) async_cb, void * user_data)
{
  unsigned int mono_jit_tls_id.120;
  struct MonoJitTlsData * jit_tls;

  mono_jit_tls_id.120 = mono_jit_tls_id;
  jit_tls = pthread_getspecific (mono_jit_tls_id.120);
  jit_tls->ex_ctx = *ctx;
  mono_arch_setup_async_callback (ctx, async_cb, user_data);
}


mono_install_unhandled_exception_hook (void (*MonoUnhandledExceptionFunc) (struct MonoObject *, void *) func, void * user_data)
{
  unhandled_exception_hook = func;
  unhandled_exception_hook_data = user_data;
}


mono_invoke_unhandled_exception_hook (struct MonoObject * exc)
{
  void (*<T3953>) (struct MonoObject *, void *) unhandled_exception_hook.121;
  void * unhandled_exception_hook_data.122;
  struct MonoObject * other.123;
  struct _IO_FILE * stderr.124;
  int D.25635;

  unhandled_exception_hook.121 = unhandled_exception_hook;
  if (unhandled_exception_hook.121 != 0B) goto <D.25623>; else goto <D.25624>;
  <D.25623>:
  unhandled_exception_hook.121 = unhandled_exception_hook;
  unhandled_exception_hook_data.122 = unhandled_exception_hook_data;
  unhandled_exception_hook.121 (exc, unhandled_exception_hook_data.122);
  goto <D.25626>;
  <D.25624>:
  {
    struct MonoObject * other;
    struct MonoString * str;
    char * msg;

    try
      {
        other = 0B;
        str = mono_object_to_string (exc, &other);
        msg = 0B;
        if (str != 0B) goto <D.25627>; else goto <D.25628>;
        <D.25627>:
        msg = mono_string_to_utf8 (str);
        goto <D.25629>;
        <D.25628>:
        other.123 = other;
        if (other.123 != 0B) goto <D.25631>; else goto <D.25632>;
        <D.25631>:
        {
          char * original_backtrace;
          char * nested_backtrace;

          original_backtrace = mono_exception_get_managed_backtrace (exc);
          other.123 = other;
          nested_backtrace = mono_exception_get_managed_backtrace (other.123);
          msg = monoeg_g_strdup_printf ("Nested exception detected.\nOriginal Exception: %s\nNested exception:%s\n", original_backtrace, nested_backtrace);
          monoeg_g_free (original_backtrace);
          monoeg_g_free (nested_backtrace);
        }
        goto <D.25633>;
        <D.25632>:
        msg = monoeg_strdup ("Nested exception trying to figure out what went wrong");
        <D.25633>:
        <D.25629>:
        stderr.124 = stderr;
        fprintf (stderr.124, "[ERROR] FATAL UNHANDLED EXCEPTION: %s\n", msg);
        monoeg_g_free (msg);
        D.25635 = mono_environment_exitcode_get ();
        exit (D.25635);
      }
    finally
      {
        other = {CLOBBER};
      }
  }
  <D.25626>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 2693);
}


mono_restore_context (struct MonoContext * ctx)
{
  void (*<T3e59>) (struct MonoContext *) restore_context.125;
  void * D.25639;
  void (*<T3e59>) (struct MonoContext *) restore_context.126;
  static void (*<T3e59>) (struct MonoContext *) restore_context;

  restore_context.125 = restore_context;
  if (restore_context.125 == 0B) goto <D.25637>; else goto <D.25638>;
  <D.25637>:
  D.25639 = mono_get_restore_context ();
  restore_context.126 = (void (*<T3e59>) (struct MonoContext *)) D.25639;
  restore_context = restore_context.126;
  <D.25638>:
  restore_context.125 = restore_context;
  restore_context.125 (ctx);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 2709);
}


