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;
  void * D.22871;
  void (*<T2559>) (struct MonoException *) D.22872;
  struct MonoRuntimeExceptionHandlingCallbacks cbs;

  try
    {
      mono_aot_only.0 = mono_aot_only;
      if (mono_aot_only.0 != 0) goto <D.22859>; else goto <D.22860>;
      <D.22859>:
      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.22865>;
      <D.22860>:
      {
        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.22865>:
      cbs.mono_walk_stack_with_ctx = mono_runtime_walk_stack_with_ctx;
      cbs.mono_walk_stack_with_state = mono_walk_stack_with_state;
      D.22871 = mono_get_throw_exception ();
      D.22872 = (void (*<T2559>) (struct MonoException *)) D.22871;
      cbs.mono_raise_exception = D.22872;
      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.10;
  int D.22878;

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

    mono_jit_tls_id.10 = mono_jit_tls_id;
    jit_tls = pthread_getspecific (mono_jit_tls_id.10);
    if (jit_tls != 0B) goto <D.22876>; else goto <D.22877>;
    <D.22876>:
    D.22878 = jit_tls->orig_ex_ctx_set;
    if (D.22878 != 0) goto <D.22879>; else goto <D.22880>;
    <D.22879>:
    start_ctx = &jit_tls->orig_ex_ctx;
    <D.22880>:
    <D.22877>:
  }
  <D.22874>:
  mono_walk_stack_with_ctx (func, start_ctx, unwind_options, user_data);
}


mono_get_throw_exception ()
{
  void * throw_exception_func.11;
  _Bool D.22882;
  long int D.22883;
  long int D.22884;
  void * D.22887;

  throw_exception_func.11 = throw_exception_func;
  D.22882 = throw_exception_func.11 == 0B;
  D.22883 = (long int) D.22882;
  D.22884 = __builtin_expect (D.22883, 0);
  if (D.22884 != 0) goto <D.22885>; else goto <D.22886>;
  <D.22885>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 117, "throw_exception_func");
  <D.22886>:
  D.22887 = throw_exception_func;
  return D.22887;
}


mono_get_rethrow_exception ()
{
  void * rethrow_exception_func.12;
  _Bool D.22890;
  long int D.22891;
  long int D.22892;
  void * D.22895;

  rethrow_exception_func.12 = rethrow_exception_func;
  D.22890 = rethrow_exception_func.12 == 0B;
  D.22891 = (long int) D.22890;
  D.22892 = __builtin_expect (D.22891, 0);
  if (D.22892 != 0) goto <D.22893>; else goto <D.22894>;
  <D.22893>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 124, "rethrow_exception_func");
  <D.22894>:
  D.22895 = rethrow_exception_func;
  return D.22895;
}


mono_get_call_filter ()
{
  void * call_filter_func.13;
  _Bool D.22898;
  long int D.22899;
  long int D.22900;
  void * D.22903;

  call_filter_func.13 = call_filter_func;
  D.22898 = call_filter_func.13 == 0B;
  D.22899 = (long int) D.22898;
  D.22900 = __builtin_expect (D.22899, 0);
  if (D.22900 != 0) goto <D.22901>; else goto <D.22902>;
  <D.22901>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 131, "call_filter_func");
  <D.22902>:
  D.22903 = call_filter_func;
  return D.22903;
}


mono_get_restore_context ()
{
  void * restore_context_func.14;
  _Bool D.22906;
  long int D.22907;
  long int D.22908;
  void * D.22911;

  restore_context_func.14 = restore_context_func;
  D.22906 = restore_context_func.14 == 0B;
  D.22907 = (long int) D.22906;
  D.22908 = __builtin_expect (D.22907, 0);
  if (D.22908 != 0) goto <D.22909>; else goto <D.22910>;
  <D.22909>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 138, "restore_context_func");
  <D.22910>:
  D.22911 = restore_context_func;
  return D.22911;
}


mono_get_throw_corlib_exception ()
{
  void * throw_corlib_exception_func.15;
  void * D.22916;
  int mono_aot_only.16;
  struct MonoTrampInfo * info.17;
  void * code;
  struct MonoTrampInfo * info;

  try
    {
      code = 0B;
      throw_corlib_exception_func.15 = throw_corlib_exception_func;
      if (throw_corlib_exception_func.15 != 0B) goto <D.22914>; else goto <D.22915>;
      <D.22914>:
      D.22916 = throw_corlib_exception_func;
      return D.22916;
      <D.22915>:
      mono_aot_only.16 = mono_aot_only;
      if (mono_aot_only.16 != 0) goto <D.22918>; else goto <D.22919>;
      <D.22918>:
      code = mono_aot_get_trampoline ("throw_corlib_exception");
      goto <D.22920>;
      <D.22919>:
      code = mono_arch_get_throw_corlib_exception (&info, 0);
      info.17 = info;
      mono_tramp_info_register (info.17);
      <D.22920>:
      mono_memory_barrier ();
      throw_corlib_exception_func = code;
      D.22916 = throw_corlib_exception_func;
      return D.22916;
    }
  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)
{
  int D.22924;
  struct MonoJitInfo * D.22933;
  int managed2.18;
  unsigned int D.22942;
  unsigned int D.22943;
  int D.22946;
  int D.22951;
  sizetype D.22952;
  const char * D.22953;
  int real_ip.19;
  int start.20;
  unsigned int offset.21;
  char * D.22967;
  struct MonoMethod * D.22970;
  gchar * D.22971;
  gboolean managed2;
  void * ip;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  try
    {
      D.22924 = ctx->sc_pc;
      ip = (void *) D.22924;
      method = 0B;
      if (trace != 0B) goto <D.22925>; else goto <D.22926>;
      <D.22925>:
      *trace = 0B;
      <D.22926>:
      if (native_offset != 0B) goto <D.22927>; else goto <D.22928>;
      <D.22927>:
      *native_offset = -1;
      <D.22928>:
      if (managed != 0B) goto <D.22929>; else goto <D.22930>;
      <D.22929>:
      *managed = 0;
      <D.22930>:
      ji = find_jit_info (domain, jit_tls, res, prev_ji, ctx, new_ctx, lmf, &managed2);
      if (ji == 4294967295B) goto <D.22931>; else goto <D.22932>;
      <D.22931>:
      D.22933 = ji;
      return D.22933;
      <D.22932>:
      if (ji != 0B) goto <D.22934>; else goto <D.22935>;
      <D.22934>:
      method = jinfo_get_method (ji);
      <D.22935>:
      managed2.18 = managed2;
      if (managed2.18 != 0) goto <D.22936>; else goto <D.22940>;
      <D.22940>:
      if (ji != 0B) goto <D.22941>; else goto <D.22937>;
      <D.22941>:
      D.22942 = BIT_FIELD_REF <*method, 32, 160>;
      D.22943 = D.22942 & 124;
      if (D.22943 != 0) goto <D.22936>; else goto <D.22937>;
      <D.22936>:
      {
        const char * real_ip;
        const char * start;
        gint32 offset;

        start = ji->code_start;
        managed2.18 = managed2;
        if (managed2.18 == 0) goto <D.22944>; else goto <D.22945>;
        <D.22944>:
        D.22946 = new_ctx->sc_pc;
        real_ip = (const char *) D.22946;
        goto <D.22947>;
        <D.22945>:
        real_ip = ip;
        <D.22947>:
        if (real_ip >= start) goto <D.22950>; else goto <D.22948>;
        <D.22950>:
        D.22951 = ji->code_size;
        D.22952 = (sizetype) D.22951;
        D.22953 = start + D.22952;
        if (D.22953 >= real_ip) goto <D.22954>; else goto <D.22948>;
        <D.22954>:
        real_ip.19 = (int) real_ip;
        start.20 = (int) start;
        offset = real_ip.19 - start.20;
        goto <D.22949>;
        <D.22948>:
        offset = -1;
        <D.22949>:
        if (native_offset != 0B) goto <D.22957>; else goto <D.22958>;
        <D.22957>:
        *native_offset = offset;
        <D.22958>:
        if (managed != 0B) goto <D.22959>; else goto <D.22960>;
        <D.22959>:
        D.22942 = BIT_FIELD_REF <*method, 32, 160>;
        D.22943 = D.22942 & 124;
        if (D.22943 == 0) goto <D.22961>; else goto <D.22963>;
        <D.22963>:
        D.22942 = BIT_FIELD_REF <*method, 32, 160>;
        D.22943 = D.22942 & 124;
        if (D.22943 == 68) goto <D.22961>; else goto <D.22962>;
        <D.22961>:
        *managed = 1;
        <D.22962>:
        <D.22960>:
        if (trace != 0B) goto <D.22964>; else goto <D.22965>;
        <D.22964>:
        offset.21 = (unsigned int) offset;
        D.22967 = mono_debug_print_stack_frame (method, offset.21, domain);
        *trace = D.22967;
        <D.22965>:
      }
      goto <D.22938>;
      <D.22937>:
      if (trace != 0B) goto <D.22968>; else goto <D.22969>;
      <D.22968>:
      {
        char * fname;

        D.22970 = jinfo_get_method (res);
        fname = mono_method_full_name (D.22970, 1);
        D.22971 = monoeg_g_strdup_printf ("in (unmanaged) %s", fname);
        *trace = D.22971;
        monoeg_g_free (fname);
      }
      <D.22969>:
      <D.22938>:
      D.22933 = ji;
      return D.22933;
    }
  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)
{
  int D.22974;
  void * D.22978;
  int D.22980;
  sizetype D.22981;
  guint8 * D.22982;
  struct MonoJitInfo * D.22988;
  <unnamed type> D.22989;
  struct MonoJitInfo * D.22992;
  struct MonoMethod * D.22995;
  struct StackFrameInfo frame;
  struct MonoJitInfo * ji;
  gboolean err;
  void * ip;

  try
    {
      D.22974 = ctx->sc_pc;
      ip = (void *) D.22974;
      if (prev_ji != 0B) goto <D.22977>; else goto <D.22975>;
      <D.22977>:
      D.22978 = prev_ji->code_start;
      if (D.22978 < ip) goto <D.22979>; else goto <D.22975>;
      <D.22979>:
      D.22978 = prev_ji->code_start;
      D.22980 = prev_ji->code_size;
      D.22981 = (sizetype) D.22980;
      D.22982 = D.22978 + D.22981;
      if (D.22982 > ip) goto <D.22983>; else goto <D.22975>;
      <D.22983>:
      ji = prev_ji;
      goto <D.22976>;
      <D.22975>:
      ji = mini_jit_info_table_find (domain, ip, 0B);
      <D.22976>:
      if (managed != 0B) goto <D.22984>; else goto <D.22985>;
      <D.22984>:
      *managed = 0;
      <D.22985>:
      err = mono_arch_find_jit_info (domain, jit_tls, ji, ctx, new_ctx, lmf, 0B, &frame);
      if (err == 0) goto <D.22986>; else goto <D.22987>;
      <D.22986>:
      D.22988 = 4294967295B;
      return D.22988;
      <D.22987>:
      D.22989 = frame.type;
      switch (D.22989) <default: <D.22209>, case 0: <D.22205>, case 1: <D.22207>, case 2: <D.22206>>
      <D.22205>:
      if (managed != 0B) goto <D.22990>; else goto <D.22991>;
      <D.22990>:
      *managed = 1;
      <D.22991>:
      D.22988 = frame.ji;
      return D.22988;
      <D.22206>:
      D.22992 = frame.ji;
      if (D.22992 != 0B) goto <D.22993>; else goto <D.22994>;
      <D.22993>:
      D.22988 = frame.ji;
      return D.22988;
      <D.22994>:
      memset (res, 0, 28);
      D.22995 = frame.method;
      res->d.method = D.22995;
      D.22988 = res;
      return D.22988;
      <D.22207>:
      {
        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, 260);
            D.22988 = ji;
            return D.22988;
          }
        finally
          {
            tmp_ctx = {CLOBBER};
          }
      }
      <D.22209>:
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 246);
      D.22988 = 0B;
      return D.22988;
    }
  finally
    {
      frame = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.23001;
  int D.23006;
  void * D.23008;
  unsigned int D.23009;

  D.23001 = __builtin_constant_p (__len);
  if (D.23001 != 0) goto <D.23002>; else goto <D.23003>;
  <D.23002>:
  if (__len == 0) goto <D.23004>; else goto <D.23005>;
  <D.23004>:
  D.23006 = __builtin_constant_p (__ch);
  if (D.23006 == 0) goto <D.22999>; else goto <D.23007>;
  <D.23007>:
  if (__ch != 0) goto <D.22999>; else goto <D.23000>;
  <D.22999>:
  __warn_memset_zero_len ();
  D.23008 = __dest;
  return D.23008;
  <D.23000>:
  <D.23005>:
  <D.23003>:
  D.23009 = __builtin_object_size (__dest, 0);
  D.23008 = __builtin___memset_chk (__dest, __ch, __len, D.23009);
  return D.23008;
}


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

  D.23012 = __builtin_object_size (__dest, 0);
  D.23011 = __builtin___memcpy_chk (__dest, __src, __len, D.23012);
  return D.23011;
}


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

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


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)
{
  int D.23016;
  void * D.23022;
  int D.23024;
  sizetype D.23025;
  guint8 * D.23026;
  struct MonoDomain * target_domain.22;
  gboolean D.23035;
  struct MonoJitInfo * D.23036;
  unsigned int D.23039;
  unsigned int D.23040;
  <unnamed type> D.23043;
  unsigned int D.23050;
  unsigned int D.23051;
  int D.23061;
  int D.23066;
  int D.23071;
  sizetype D.23072;
  const char * D.23073;
  int real_ip.23;
  int start.24;
  int D.23077;
  int D.23080;
  unsigned int D.23081;
  char * D.23082;
  struct MonoMethod * D.23085;
  gchar * D.23088;
  gboolean err;
  void * ip;
  struct MonoJitInfo * ji;
  struct MonoDomain * target_domain;
  struct MonoMethod * method;
  gboolean async;

  try
    {
      D.23016 = ctx->sc_pc;
      ip = (void *) D.23016;
      target_domain = domain;
      method = 0B;
      async = mono_thread_info_is_async_context ();
      if (trace != 0B) goto <D.23017>; else goto <D.23018>;
      <D.23017>:
      *trace = 0B;
      <D.23018>:
      if (prev_ji != 0B) goto <D.23021>; else goto <D.23019>;
      <D.23021>:
      D.23022 = prev_ji->code_start;
      if (D.23022 < ip) goto <D.23023>; else goto <D.23019>;
      <D.23023>:
      D.23022 = prev_ji->code_start;
      D.23024 = prev_ji->code_size;
      D.23025 = (sizetype) D.23024;
      D.23026 = D.23022 + D.23025;
      if (D.23026 > ip) goto <D.23027>; else goto <D.23019>;
      <D.23027>:
      ji = prev_ji;
      goto <D.23020>;
      <D.23019>:
      ji = mini_jit_info_table_find (domain, ip, &target_domain);
      <D.23020>:
      target_domain.22 = target_domain;
      if (target_domain.22 == 0B) goto <D.23029>; else goto <D.23030>;
      <D.23029>:
      target_domain = domain;
      <D.23030>:
      if (save_locations != 0B) goto <D.23031>; else goto <D.23032>;
      <D.23031>:
      memset (save_locations, 0, 128);
      <D.23032>:
      target_domain.22 = target_domain;
      err = mono_arch_find_jit_info (target_domain.22, jit_tls, ji, ctx, new_ctx, lmf, save_locations, frame);
      if (err == 0) goto <D.23033>; else goto <D.23034>;
      <D.23033>:
      D.23035 = 0;
      return D.23035;
      <D.23034>:
      D.23036 = frame->ji;
      if (D.23036 != 0B) goto <D.23037>; else goto <D.23038>;
      <D.23037>:
      D.23036 = frame->ji;
      D.23039 = BIT_FIELD_REF <*D.23036, 32, 160>;
      D.23040 = D.23039 & 16777216;
      if (D.23040 == 0) goto <D.23041>; else goto <D.23042>;
      <D.23041>:
      D.23036 = frame->ji;
      method = jinfo_get_method (D.23036);
      <D.23042>:
      <D.23038>:
      D.23043 = frame->type;
      if (D.23043 == 0) goto <D.23044>; else goto <D.23045>;
      <D.23044>:
      if (method != 0B) goto <D.23046>; else goto <D.23047>;
      <D.23046>:
      D.23050 = BIT_FIELD_REF <*method, 32, 160>;
      D.23051 = D.23050 & 124;
      if (D.23051 == 0) goto <D.23048>; else goto <D.23052>;
      <D.23052>:
      D.23050 = BIT_FIELD_REF <*method, 32, 160>;
      D.23051 = D.23050 & 124;
      if (D.23051 == 68) goto <D.23048>; else goto <D.23049>;
      <D.23048>:
      frame->managed = 1;
      <D.23049>:
      <D.23047>:
      <D.23045>:
      D.23043 = frame->type;
      if (D.23043 == 2) goto <D.23053>; else goto <D.23054>;
      <D.23053>:
      frame->ji = 0B;
      frame->method = 0B;
      <D.23054>:
      frame->native_offset = -1;
      target_domain.22 = target_domain;
      frame->domain = target_domain.22;
      frame->async_context = async;
      ji = frame->ji;
      D.23043 = frame->type;
      if (D.23043 == 0) goto <D.23055>; else goto <D.23056>;
      <D.23055>:
      frame->method = method;
      <D.23056>:
      if (ji != 0B) goto <D.23060>; else goto <D.23057>;
      <D.23060>:
      D.23061 = frame->managed;
      if (D.23061 != 0) goto <D.23058>; else goto <D.23062>;
      <D.23062>:
      if (method != 0B) goto <D.23063>; else goto <D.23057>;
      <D.23063>:
      D.23050 = BIT_FIELD_REF <*method, 32, 160>;
      D.23051 = D.23050 & 124;
      if (D.23051 != 0) goto <D.23058>; else goto <D.23057>;
      <D.23058>:
      {
        const char * real_ip;
        const char * start;

        start = ji->code_start;
        D.23061 = frame->managed;
        if (D.23061 == 0) goto <D.23064>; else goto <D.23065>;
        <D.23064>:
        D.23066 = new_ctx->sc_pc;
        real_ip = (const char *) D.23066;
        goto <D.23067>;
        <D.23065>:
        real_ip = ip;
        <D.23067>:
        if (real_ip >= start) goto <D.23070>; else goto <D.23068>;
        <D.23070>:
        D.23071 = ji->code_size;
        D.23072 = (sizetype) D.23071;
        D.23073 = start + D.23072;
        if (D.23073 >= real_ip) goto <D.23074>; else goto <D.23068>;
        <D.23074>:
        real_ip.23 = (int) real_ip;
        start.24 = (int) start;
        D.23077 = real_ip.23 - start.24;
        frame->native_offset = D.23077;
        goto <D.23069>;
        <D.23068>:
        frame->native_offset = -1;
        <D.23069>:
        if (trace != 0B) goto <D.23078>; else goto <D.23079>;
        <D.23078>:
        D.23080 = frame->native_offset;
        D.23081 = (unsigned int) D.23080;
        D.23082 = mono_debug_print_stack_frame (method, D.23081, domain);
        *trace = D.23082;
        <D.23079>:
      }
      goto <D.23059>;
      <D.23057>:
      if (trace != 0B) goto <D.23083>; else goto <D.23084>;
      <D.23083>:
      D.23085 = frame->method;
      if (D.23085 != 0B) goto <D.23086>; else goto <D.23087>;
      <D.23086>:
      {
        char * fname;

        D.23085 = frame->method;
        fname = mono_method_full_name (D.23085, 1);
        D.23088 = monoeg_g_strdup_printf ("in (unmanaged) %s", fname);
        *trace = D.23088;
        monoeg_g_free (fname);
      }
      <D.23087>:
      <D.23084>:
      <D.23059>:
      D.23035 = 1;
      return D.23035;
    }
  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.23093;
  unsigned int D.23094;
  unsigned int D.23095;
  int D.23096;
  unsigned int D.23097;
  char * D.23098;
  int D.23099;
  unsigned int D.23100;
  char * D.23101;
  int D.23104;
  void * D.23108;
  int ip.25;
  int D.23110;
  int D.23111;
  unsigned int D.23112;
  int D.23113;
  _Bool D.23116;
  struct MonoDomain * domain;
  struct MonoArray * ta;
  int len;
  int i;

  domain = mono_domain_get ();
  ta = ex->trace_ips;
  if (ta == 0B) goto <D.23091>; else goto <D.23092>;
  <D.23091>:
  D.23093 = 0;
  return D.23093;
  <D.23092>:
  D.23094 = mono_array_length (ta);
  D.23095 = D.23094 >> 1;
  len = (int) D.23095;
  i = 0;
  goto <D.22297>;
  <D.22296>:
  {
    void * ip;
    void * generic_info;
    struct MonoJitInfo * ji;

    D.23096 = i * 2;
    D.23097 = (unsigned int) D.23096;
    D.23098 = mono_array_addr_with_size (ta, 4, D.23097);
    ip = MEM[(void * *)D.23098];
    D.23096 = i * 2;
    D.23099 = D.23096 + 1;
    D.23100 = (unsigned int) D.23099;
    D.23101 = mono_array_addr_with_size (ta, 4, D.23100);
    generic_info = MEM[(void * *)D.23101];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.23102>; else goto <D.23103>;
    <D.23102>:
    D.23104 = func (0B, ip, 0, 0, user_data);
    if (D.23104 != 0) goto <D.23105>; else goto <D.23106>;
    <D.23105>:
    D.23093 = 1;
    return D.23093;
    <D.23106>:
    goto <D.23107>;
    <D.23103>:
    {
      struct MonoMethod * method;

      method = get_method_from_stack_frame (ji, generic_info);
      D.23108 = ji->code_start;
      ip.25 = (int) ip;
      D.23108 = ji->code_start;
      D.23110 = (int) D.23108;
      D.23111 = ip.25 - D.23110;
      D.23112 = (unsigned int) D.23111;
      D.23113 = func (method, D.23108, D.23112, 1, user_data);
      if (D.23113 != 0) goto <D.23114>; else goto <D.23115>;
      <D.23114>:
      D.23093 = 1;
      return D.23093;
      <D.23115>:
    }
    <D.23107>:
  }
  i = i + 1;
  <D.22297>:
  if (i < len) goto <D.22296>; else goto <D.22298>;
  <D.22298>:
  D.23116 = len > 0;
  D.23093 = (gboolean) D.23116;
  return D.23093;
}


get_method_from_stack_frame (struct MonoJitInfo * ji, void * generic_info)
{
  unsigned int D.23120;
  unsigned int D.23121;
  struct MonoGenericJitInfo * D.23123;
  unsigned int D.23124;
  unsigned int D.23125;
  struct MonoMethod * D.23126;
  struct MonoGenericContext context;
  struct MonoMethod * method;

  try
    {
      D.23120 = BIT_FIELD_REF <*ji, 32, 160>;
      D.23121 = D.23120 & 131072;
      if (D.23121 == 0) goto <D.23118>; else goto <D.23122>;
      <D.23122>:
      D.23123 = mono_jit_info_get_generic_jit_info (ji);
      D.23124 = BIT_FIELD_REF <*D.23123, 32, 128>;
      D.23125 = D.23124 & 256;
      if (D.23125 == 0) goto <D.23118>; else goto <D.23119>;
      <D.23118>:
      D.23126 = jinfo_get_method (ji);
      return D.23126;
      <D.23119>:
      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.23126 = method;
      return D.23126;
    }
  finally
    {
      context = {CLOBBER};
    }
}


get_generic_context_from_stack_frame (struct MonoJitInfo * ji, void * generic_info)
{
  _Bool D.23130;
  long int D.23131;
  long int D.23132;
  unsigned int D.23135;
  unsigned int D.23136;
  _Bool D.23137;
  long int D.23138;
  long int D.23139;
  struct MonoGenericContext * D.23142;
  struct MonoGenericInst * D.23143;
  struct MonoVTable * D.23146;
  struct MonoGenericInst * D.23147;
  struct MonoGenericInst * D.23148;
  _Bool D.23149;
  long int D.23150;
  long int D.23151;
  short unsigned int D.23158;
  int D.23159;
  int D.23160;
  struct MonoClass * D.23162;
  unsigned int D.23163;
  unsigned int D.23164;
  struct MonoGenericClass * D.23165;
  _Bool D.23169;
  long int D.23170;
  long int D.23171;
  struct MonoGenericClass * D.23175;
  struct MonoClass * D.23177;
  struct MonoGenericContainer * D.23181;
  struct MonoGenericContext * D.23182;
  struct MonoGenericInst * D.23183;
  int D.23186;
  _Bool D.23187;
  long int D.23188;
  long int D.23189;
  int D.23193;
  _Bool D.23194;
  long int D.23195;
  long int D.23196;
  struct MonoGenericContext context;
  struct MonoClass * class;
  struct MonoClass * method_container_class;
  struct MonoMethod * method;

  try
    {
      context.class_inst = 0B;
      context.method_inst = 0B;
      D.23130 = generic_info == 0B;
      D.23131 = (long int) D.23130;
      D.23132 = __builtin_expect (D.23131, 0);
      if (D.23132 != 0) goto <D.23133>; else goto <D.23134>;
      <D.23133>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 489, "generic_info");
      <D.23134>:
      method = jinfo_get_method (ji);
      D.23135 = BIT_FIELD_REF <*method, 32, 160>;
      D.23136 = D.23135 & 4096;
      D.23137 = D.23136 == 0;
      D.23138 = (long int) D.23137;
      D.23139 = __builtin_expect (D.23138, 0);
      if (D.23139 != 0) goto <D.23140>; else goto <D.23141>;
      <D.23140>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 492, "method->is_inflated");
      <D.23141>:
      D.23142 = mono_method_get_context (method);
      D.23143 = D.23142->method_inst;
      if (D.23143 != 0B) goto <D.23144>; else goto <D.23145>;
      <D.23144>:
      {
        struct MonoMethodRuntimeGenericContext * mrgctx;

        mrgctx = generic_info;
        D.23146 = mrgctx->class_vtable;
        class = D.23146->klass;
        D.23147 = mrgctx->method_inst;
        context.method_inst = D.23147;
        D.23148 = context.method_inst;
        D.23149 = D.23148 == 0B;
        D.23150 = (long int) D.23149;
        D.23151 = __builtin_expect (D.23150, 0);
        if (D.23151 != 0) goto <D.23152>; else goto <D.23153>;
        <D.23152>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 498, "context.method_inst");
        <D.23153>:
      }
      goto <D.23154>;
      <D.23145>:
      D.23158 = method->flags;
      D.23159 = (int) D.23158;
      D.23160 = D.23159 & 16;
      if (D.23160 != 0) goto <D.23155>; else goto <D.23161>;
      <D.23161>:
      D.23162 = method->klass;
      D.23163 = BIT_FIELD_REF <*D.23162, 32, 160>;
      D.23164 = D.23163 & 8;
      if (D.23164 != 0) goto <D.23155>; else goto <D.23156>;
      <D.23155>:
      {
        struct MonoVTable * vtable;

        vtable = generic_info;
        class = vtable->klass;
      }
      goto <D.23157>;
      <D.23156>:
      class = generic_info;
      <D.23157>:
      <D.23154>:
      D.23162 = method->klass;
      D.23165 = D.23162->generic_class;
      if (D.23165 != 0B) goto <D.23166>; else goto <D.23167>;
      <D.23166>:
      D.23162 = method->klass;
      D.23165 = D.23162->generic_class;
      method_container_class = D.23165->container_class;
      goto <D.23168>;
      <D.23167>:
      method_container_class = method->klass;
      <D.23168>:
      goto <D.22275>;
      <D.22274>:
      class = class->parent;
      D.23169 = class == 0B;
      D.23170 = (long int) D.23169;
      D.23171 = __builtin_expect (D.23170, 0);
      if (D.23171 != 0) goto <D.23172>; else goto <D.23173>;
      <D.23172>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 516, "class");
      <D.23173>:
      <D.22275>:
      D.23162 = method->klass;
      if (D.23162 != class) goto <D.23174>; else goto <D.22276>;
      <D.23174>:
      D.23175 = class->generic_class;
      if (D.23175 == 0B) goto <D.22274>; else goto <D.23176>;
      <D.23176>:
      D.23175 = class->generic_class;
      D.23177 = D.23175->container_class;
      if (D.23177 != method_container_class) goto <D.22274>; else goto <D.22276>;
      <D.22276>:
      D.23175 = class->generic_class;
      if (D.23175 != 0B) goto <D.23178>; else goto <D.23180>;
      <D.23180>:
      D.23181 = class->generic_container;
      if (D.23181 != 0B) goto <D.23178>; else goto <D.23179>;
      <D.23178>:
      D.23182 = mini_class_get_context (class);
      D.23183 = D.23182->class_inst;
      context.class_inst = D.23183;
      <D.23179>:
      D.23175 = class->generic_class;
      if (D.23175 != 0B) goto <D.23184>; else goto <D.23185>;
      <D.23184>:
      D.23175 = class->generic_class;
      D.23177 = D.23175->container_class;
      D.23186 = mono_class_has_parent_and_ignore_generics (D.23177, method_container_class);
      D.23187 = D.23186 == 0;
      D.23188 = (long int) D.23187;
      D.23189 = __builtin_expect (D.23188, 0);
      if (D.23189 != 0) goto <D.23190>; else goto <D.23191>;
      <D.23190>:
      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.23191>:
      goto <D.23192>;
      <D.23185>:
      D.23193 = mono_class_has_parent_and_ignore_generics (class, method_container_class);
      D.23194 = D.23193 == 0;
      D.23195 = (long int) D.23194;
      D.23196 = __builtin_expect (D.23195, 0);
      if (D.23196 != 0) goto <D.23197>; else goto <D.23198>;
      <D.23197>:
      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.23198>:
      <D.23192>:
      <retval> = context;
      return <retval>;
    }
  finally
    {
      context = {CLOBBER};
    }
}


ves_icall_System_Exception_get_trace (struct MonoException * ex)
{
  struct MonoString * D.23203;
  unsigned int D.23204;
  unsigned int D.23205;
  int D.23206;
  unsigned int D.23207;
  char * D.23208;
  int D.23209;
  unsigned int D.23210;
  char * D.23211;
  int ip.26;
  void * D.23216;
  int D.23217;
  unsigned int address.27;
  struct MonoVTable * D.23219;
  struct MonoDomain * D.23220;
  char * D.23221;
  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.23201>; else goto <D.23202>;
  <D.23201>:
  D.23203 = 0B;
  return D.23203;
  <D.23202>:
  D.23204 = mono_array_length (ta);
  D.23205 = D.23204 >> 1;
  len = (int) D.23205;
  trace_str = monoeg_g_string_new ("");
  i = 0;
  goto <D.22315>;
  <D.22314>:
  {
    struct MonoJitInfo * ji;
    void * ip;
    void * generic_info;

    D.23206 = i * 2;
    D.23207 = (unsigned int) D.23206;
    D.23208 = mono_array_addr_with_size (ta, 4, D.23207);
    ip = MEM[(void * *)D.23208];
    D.23206 = i * 2;
    D.23209 = D.23206 + 1;
    D.23210 = (unsigned int) D.23209;
    D.23211 = mono_array_addr_with_size (ta, 4, D.23210);
    generic_info = MEM[(void * *)D.23211];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.23212>; else goto <D.23213>;
    <D.23212>:
    monoeg_g_string_append_printf (trace_str, "in (unmanaged) %p\n", ip);
    goto <D.23214>;
    <D.23213>:
    {
      gchar * location;
      gint32 address;
      struct MonoMethod * method;

      method = get_method_from_stack_frame (ji, generic_info);
      ip.26 = (int) ip;
      D.23216 = ji->code_start;
      D.23217 = (int) D.23216;
      address = ip.26 - D.23217;
      address.27 = (unsigned int) address;
      D.23219 = ex->object.vtable;
      D.23220 = D.23219->domain;
      location = mono_debug_print_stack_frame (method, address.27, D.23220);
      monoeg_g_string_append_printf (trace_str, "%s\n", location);
      monoeg_g_free (location);
    }
    <D.23214>:
  }
  i = i + 1;
  <D.22315>:
  if (i < len) goto <D.22314>; else goto <D.22316>;
  <D.22316>:
  D.23219 = ex->object.vtable;
  D.23220 = D.23219->domain;
  D.23221 = trace_str->str;
  res = mono_string_new (D.23220, D.23221);
  monoeg_g_string_free (trace_str, 1);
  D.23203 = res;
  return D.23203;
}


ves_icall_get_trace (struct MonoException * exc, gint32 skip, MonoBoolean need_file_info)
{
  struct MonoArray * D.23225;
  struct MonoClass * D.23226;
  unsigned int D.23227;
  unsigned int D.23228;
  uintptr_t iftmp.28;
  int D.23232;
  int D.23234;
  unsigned int D.23235;
  char * D.23236;
  int D.23237;
  unsigned int D.23238;
  char * D.23239;
  unsigned int i.29;
  _Bool D.23243;
  long int D.23244;
  long int D.23245;
  struct MonoMethod * D.23248;
  unsigned int D.23249;
  unsigned int D.23250;
  struct MonoString * * D.23253;
  struct MonoString * D.23254;
  struct MonoReflectionMethod * * D.23256;
  struct MonoReflectionMethod * D.23257;
  int ip.30;
  void * D.23259;
  int D.23260;
  int D.23261;
  struct MonoMethod * D.23262;
  int D.23263;
  unsigned int D.23264;
  unsigned int D.23267;
  int D.23268;
  char * D.23275;
  struct MonoString * * D.23277;
  struct MonoString * D.23278;
  unsigned int D.23279;
  int D.23280;
  unsigned int D.23281;
  int D.23282;
  int D.23283;
  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.23223>; else goto <D.23224>;
  <D.23223>:
  D.23226 = mono_defaults.stack_frame_class;
  D.23225 = mono_array_new (domain, D.23226, 0);
  return D.23225;
  <D.23224>:
  D.23227 = mono_array_length (ta);
  D.23228 = D.23227 >> 1;
  len = (int) D.23228;
  D.23226 = mono_defaults.stack_frame_class;
  if (len > skip) goto <D.23230>; else goto <D.23231>;
  <D.23230>:
  D.23232 = len - skip;
  iftmp.28 = (uintptr_t) D.23232;
  goto <D.23233>;
  <D.23231>:
  iftmp.28 = 0;
  <D.23233>:
  res = mono_array_new (domain, D.23226, iftmp.28);
  i = skip;
  goto <D.22338>;
  <D.22337>:
  {
    struct MonoJitInfo * ji;
    struct MonoStackFrame * sf;
    void * ip;
    void * generic_info;
    struct MonoMethod * method;

    D.23226 = mono_defaults.stack_frame_class;
    sf = mono_object_new (domain, D.23226);
    D.23234 = i * 2;
    D.23235 = (unsigned int) D.23234;
    D.23236 = mono_array_addr_with_size (ta, 4, D.23235);
    ip = MEM[(void * *)D.23236];
    D.23234 = i * 2;
    D.23237 = D.23234 + 1;
    D.23238 = (unsigned int) D.23237;
    D.23239 = mono_array_addr_with_size (ta, 4, D.23238);
    generic_info = MEM[(void * *)D.23239];
    ji = mono_jit_info_table_find (domain, ip);
    if (ji == 0B) goto <D.23240>; else goto <D.23241>;
    <D.23240>:
    {
      void * * __p;

      i.29 = (unsigned int) i;
      __p = mono_array_addr_with_size (res, 4, i.29);
      mono_gc_wbarrier_set_arrayref (res, __p, sf);
    }
    // predicted unlikely by continue predictor.
    goto <D.22334>;
    <D.23241>:
    D.23243 = ji == 0B;
    D.23244 = (long int) D.23243;
    D.23245 = __builtin_expect (D.23244, 0);
    if (D.23245 != 0) goto <D.23246>; else goto <D.23247>;
    <D.23246>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 664, "ji != NULL");
    <D.23247>:
    method = get_method_from_stack_frame (ji, generic_info);
    D.23248 = jinfo_get_method (ji);
    D.23249 = BIT_FIELD_REF <*D.23248, 32, 160>;
    D.23250 = D.23249 & 124;
    if (D.23250 != 0) goto <D.23251>; else goto <D.23252>;
    <D.23251>:
    {
      char * s;

      sf->method = 0B;
      s = mono_method_full_name (method, 1);
      D.23253 = &sf->internal_method_name;
      D.23254 = mono_string_new (domain, s);
      mono_gc_wbarrier_set_field (sf, D.23253, D.23254);
      monoeg_g_free (s);
    }
    goto <D.23255>;
    <D.23252>:
    D.23256 = &sf->method;
    D.23257 = mono_method_get_object (domain, method, 0B);
    mono_gc_wbarrier_set_field (sf, D.23256, D.23257);
    <D.23255>:
    ip.30 = (int) ip;
    D.23259 = ji->code_start;
    D.23260 = (int) D.23259;
    D.23261 = ip.30 - D.23260;
    sf->native_offset = D.23261;
    D.23262 = jinfo_get_method (ji);
    D.23263 = sf->native_offset;
    D.23264 = (unsigned int) D.23263;
    location = mono_debug_lookup_source_location (D.23262, D.23264, domain);
    if (location != 0B) goto <D.23265>; else goto <D.23266>;
    <D.23265>:
    D.23267 = location->il_offset;
    D.23268 = (int) D.23267;
    sf->il_offset = D.23268;
    goto <D.23269>;
    <D.23266>:
    sf->il_offset = 0;
    <D.23269>:
    if (need_file_info != 0) goto <D.23270>; else goto <D.23271>;
    <D.23270>:
    if (location != 0B) goto <D.23274>; else goto <D.23272>;
    <D.23274>:
    D.23275 = location->source_file;
    if (D.23275 != 0B) goto <D.23276>; else goto <D.23272>;
    <D.23276>:
    D.23277 = &sf->filename;
    D.23275 = location->source_file;
    D.23278 = mono_string_new (domain, D.23275);
    mono_gc_wbarrier_set_field (sf, D.23277, D.23278);
    D.23279 = location->row;
    D.23280 = (int) D.23279;
    sf->line = D.23280;
    D.23281 = location->column;
    D.23282 = (int) D.23281;
    sf->column = D.23282;
    goto <D.23273>;
    <D.23272>:
    sf->column = 0;
    D.23283 = sf->column;
    sf->line = D.23283;
    sf->filename = 0B;
    <D.23273>:
    <D.23271>:
    mono_debug_free_source_location (location);
    {
      void * * __p;

      i.29 = (unsigned int) i;
      __p = mono_array_addr_with_size (res, 4, i.29);
      mono_gc_wbarrier_set_arrayref (res, __p, sf);
    }
  }
  <D.22334>:
  i = i + 1;
  <D.22338>:
  if (i < len) goto <D.22337>; else goto <D.22339>;
  <D.22339>:
  D.23225 = res;
  return D.23225;
}


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.23288;
  void * D.23291;
  int D.23292;
  void * D.23293;
  int D.23294;
  int mono_walk_stack_with_ctx.31;
  struct MonoDomain * D.23296;
  struct MonoLMF * D.23297;
  struct MonoContext extra_ctx;
  struct MonoInternalThread * thread;

  try
    {
      thread = mono_thread_internal_current ();
      if (thread == 0B) goto <D.23285>; else goto <D.23287>;
      <D.23287>:
      D.23288 = thread->jit_data;
      if (D.23288 == 0B) goto <D.23285>; else goto <D.23286>;
      <D.23285>:
      return;
      <D.23286>:
      if (start_ctx == 0B) goto <D.23289>; else goto <D.23290>;
      <D.23289>:
      mono_arch_flush_register_windows ();
      D.23291 = __builtin_frame_address (0);
      D.23292 = (int) D.23291;
      extra_ctx.sc_regs[30] = D.23292;
      D.23293 = __builtin_frame_address (0);
      D.23294 = (int) D.23293;
      extra_ctx.sc_regs[29] = D.23294;
      mono_walk_stack_with_ctx.31 = (int) mono_walk_stack_with_ctx;
      extra_ctx.sc_pc = mono_walk_stack_with_ctx.31;
      start_ctx = &extra_ctx;
      <D.23290>:
      D.23296 = mono_domain_get ();
      D.23288 = thread->jit_data;
      D.23297 = mono_get_lmf ();
      mono_walk_stack_full (func, start_ctx, D.23296, D.23288, D.23297, 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.32;
  _Bool D.23302;
  long int D.23303;
  long int D.23304;
  _Bool D.23307;
  long int D.23308;
  long int D.23309;
  _Bool D.23312;
  long int D.23313;
  long int D.23314;
  _Bool D.23319;
  long int D.23320;
  long int D.23321;
  struct MonoLMF * lmf.33;
  mgreg_t * * iftmp.34;
  unsigned int D.23333;
  struct MonoJitInfo * D.23335;
  struct MonoMethod * D.23337;
  int D.23338;
  unsigned int D.23339;
  gint iftmp.35;
  unsigned int D.23343;
  unsigned int D.23347;
  void * D.23350;
  struct MonoMethod * D.23351;
  struct MonoMethod * D.23352;
  int D.23355;
  mgreg_t * D.23360;
  int D.23363;
  void * D.23364;
  void * D.23365;
  gint il_offset;
  gint i;
  struct MonoContext ctx;
  struct MonoContext new_ctx;
  struct StackFrameInfo frame;
  gboolean res;
  mgreg_t * reg_locations[32];
  mgreg_t * new_reg_locations[32];
  gboolean get_reg_locations;
  gboolean async;

  try
    {
      unwind_options.32 = (int) unwind_options;
      get_reg_locations = unwind_options.32 & 4;
      async = mono_thread_info_is_async_context ();
      D.23302 = start_ctx == 0B;
      D.23303 = (long int) D.23302;
      D.23304 = __builtin_expect (D.23303, 0);
      if (D.23304 != 0) goto <D.23305>; else goto <D.23306>;
      <D.23305>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 817, "start_ctx");
      <D.23306>:
      D.23307 = domain == 0B;
      D.23308 = (long int) D.23307;
      D.23309 = __builtin_expect (D.23308, 0);
      if (D.23309 != 0) goto <D.23310>; else goto <D.23311>;
      <D.23310>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 818, "domain");
      <D.23311>:
      D.23312 = jit_tls == 0B;
      D.23313 = (long int) D.23312;
      D.23314 = __builtin_expect (D.23313, 0);
      if (D.23314 != 0) goto <D.23315>; else goto <D.23316>;
      <D.23315>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 819, "jit_tls");
      <D.23316>:
      if (async != 0) goto <D.23317>; else goto <D.23318>;
      <D.23317>:
      D.23319 = unwind_options != 0;
      D.23320 = (long int) D.23319;
      D.23321 = __builtin_expect (D.23320, 0);
      if (D.23321 != 0) goto <D.23322>; else goto <D.23323>;
      <D.23322>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 824, "unwind_options == MONO_UNWIND_NONE");
      <D.23323>:
      <D.23318>:
      memcpy (&ctx, start_ctx, 260);
      memset (&reg_locations, 0, 128);
      goto <D.22392>;
      <D.22391>:
      lmf.33 = lmf;
      frame.lmf = lmf.33;
      if (get_reg_locations != 0) goto <D.23326>; else goto <D.23327>;
      <D.23326>:
      iftmp.34 = &new_reg_locations;
      goto <D.23328>;
      <D.23327>:
      iftmp.34 = 0B;
      <D.23328>:
      res = mono_find_jit_info_ext (domain, jit_tls, 0B, &ctx, &new_ctx, 0B, &lmf, iftmp.34, &frame);
      if (res == 0) goto <D.23329>; else goto <D.23330>;
      <D.23329>:
      return;
      <D.23330>:
      D.23333 = unwind_options & 1;
      if (D.23333 != 0) goto <D.23334>; else goto <D.23331>;
      <D.23334>:
      D.23335 = frame.ji;
      if (D.23335 != 0B) goto <D.23336>; else goto <D.23331>;
      <D.23336>:
      {
        struct MonoDebugSourceLocation * source;

        D.23335 = frame.ji;
        D.23337 = jinfo_get_method (D.23335);
        D.23338 = frame.native_offset;
        D.23339 = (unsigned int) D.23338;
        source = mono_debug_lookup_source_location (D.23337, D.23339, domain);
        if (source != 0B) goto <D.23341>; else goto <D.23342>;
        <D.23341>:
        D.23343 = source->il_offset;
        iftmp.35 = (gint) D.23343;
        goto <D.23344>;
        <D.23342>:
        iftmp.35 = -1;
        <D.23344>:
        il_offset = iftmp.35;
        mono_debug_free_source_location (source);
      }
      goto <D.23332>;
      <D.23331>:
      il_offset = -1;
      <D.23332>:
      frame.il_offset = il_offset;
      D.23347 = unwind_options & 2;
      if (D.23347 != 0) goto <D.23348>; else goto <D.23345>;
      <D.23348>:
      D.23335 = frame.ji;
      if (D.23335 != 0B) goto <D.23349>; else goto <D.23345>;
      <D.23349>:
      D.23335 = frame.ji;
      D.23335 = frame.ji;
      D.23350 = get_generic_info_from_stack_frame (D.23335, &ctx);
      D.23351 = get_method_from_stack_frame (D.23335, D.23350);
      frame.actual_method = D.23351;
      goto <D.23346>;
      <D.23345>:
      D.23352 = frame.method;
      frame.actual_method = D.23352;
      <D.23346>:
      if (get_reg_locations != 0) goto <D.23353>; else goto <D.23354>;
      <D.23353>:
      frame.reg_locations = &reg_locations;
      <D.23354>:
      D.23355 = func (&frame, &ctx, user_data);
      if (D.23355 != 0) goto <D.23356>; else goto <D.23357>;
      <D.23356>:
      return;
      <D.23357>:
      if (get_reg_locations != 0) goto <D.23358>; else goto <D.23359>;
      <D.23358>:
      i = 0;
      goto <D.22389>;
      <D.22388>:
      D.23360 = new_reg_locations[i];
      if (D.23360 != 0B) goto <D.23361>; else goto <D.23362>;
      <D.23361>:
      D.23360 = new_reg_locations[i];
      reg_locations[i] = D.23360;
      <D.23362>:
      i = i + 1;
      <D.22389>:
      if (i <= 31) goto <D.22388>; else goto <D.22390>;
      <D.22390>:
      <D.23359>:
      ctx = new_ctx;
      <D.22392>:
      D.23363 = ctx.sc_regs[29];
      D.23364 = (void *) D.23363;
      D.23365 = jit_tls->end_of_stack;
      if (D.23364 < D.23365) goto <D.22391>; else goto <D.22393>;
      <D.22393>:
    }
  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 int D.23369;
  unsigned int D.23370;
  void * D.23373;
  unsigned int D.23374;
  unsigned int D.23375;
  int D.23378;
  int D.23381;
  void * D.23382;
  int D.23383;
  struct MonoDwarfLocListEntry * D.23384;
  unsigned int i.36;
  unsigned int D.23386;
  int D.23389;
  int D.23392;
  int D.23394;
  int D.23397;
  int D.23398;
  int D.23400;
  sizetype D.23401;
  int D.23402;
  sizetype D.23403;
  sizetype D.23404;
  void * * D.23405;
  _Bool D.23406;
  long int D.23407;
  long int D.23408;
  unsigned int D.23412;
  unsigned char D.23415;
  int D.23416;
  int D.23417;
  int D.23419;
  sizetype D.23420;
  int D.23421;
  sizetype D.23422;
  sizetype D.23423;
  void * * D.23424;
  struct MonoGenericContext * D.23425;
  struct MonoGenericInst * D.23426;
  short unsigned int D.23431;
  int D.23432;
  int D.23433;
  struct MonoClass * D.23435;
  unsigned int D.23436;
  unsigned int D.23437;
  struct MonoVTable * D.23438;
  struct MonoGenericJitInfo * gi;
  struct MonoMethod * method;
  void * info;

  D.23369 = BIT_FIELD_REF <*ji, 32, 160>;
  D.23370 = D.23369 & 131072;
  if (D.23370 == 0) goto <D.23371>; else goto <D.23372>;
  <D.23371>:
  D.23373 = 0B;
  return D.23373;
  <D.23372>:
  gi = mono_jit_info_get_generic_jit_info (ji);
  D.23374 = BIT_FIELD_REF <*gi, 32, 128>;
  D.23375 = D.23374 & 256;
  if (D.23375 == 0) goto <D.23376>; else goto <D.23377>;
  <D.23376>:
  D.23373 = 0B;
  return D.23373;
  <D.23377>:
  info = 0B;
  D.23378 = gi->nlocs;
  if (D.23378 != 0) goto <D.23379>; else goto <D.23380>;
  <D.23379>:
  {
    int offset;
    int i;

    D.23381 = ctx->sc_pc;
    D.23382 = ji->code_start;
    D.23383 = (int) D.23382;
    offset = D.23381 - D.23383;
    i = 0;
    goto <D.22262>;
    <D.22261>:
    {
      struct MonoDwarfLocListEntry * entry;

      D.23384 = gi->locations;
      i.36 = (unsigned int) i;
      D.23386 = i.36 * 20;
      entry = D.23384 + D.23386;
      D.23389 = entry->from;
      if (D.23389 <= offset) goto <D.23390>; else goto <D.23391>;
      <D.23390>:
      D.23392 = entry->to;
      if (D.23392 > offset) goto <D.23387>; else goto <D.23393>;
      <D.23393>:
      D.23392 = entry->to;
      if (D.23392 == 0) goto <D.23387>; else goto <D.23388>;
      <D.23387>:
      D.23394 = entry->is_reg;
      if (D.23394 != 0) goto <D.23395>; else goto <D.23396>;
      <D.23395>:
      D.23397 = entry->reg;
      D.23398 = mono_arch_context_get_int_reg (ctx, D.23397);
      info = (void *) D.23398;
      goto <D.23399>;
      <D.23396>:
      D.23400 = entry->offset;
      D.23401 = (sizetype) D.23400;
      D.23397 = entry->reg;
      D.23402 = mono_arch_context_get_int_reg (ctx, D.23397);
      D.23403 = (sizetype) D.23402;
      D.23404 = D.23401 + D.23403;
      D.23405 = (void * *) D.23404;
      info = *D.23405;
      <D.23399>:
      goto <D.22260>;
      <D.23388>:
      <D.23391>:
    }
    i = i + 1;
    <D.22262>:
    D.23378 = gi->nlocs;
    if (D.23378 > i) goto <D.22261>; else goto <D.22260>;
    <D.22260>:
    D.23378 = gi->nlocs;
    D.23406 = D.23378 <= i;
    D.23407 = (long int) D.23406;
    D.23408 = __builtin_expect (D.23407, 0);
    if (D.23408 != 0) goto <D.23409>; else goto <D.23410>;
    <D.23409>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 460, "i < gi->nlocs");
    <D.23410>:
  }
  goto <D.23411>;
  <D.23380>:
  D.23374 = BIT_FIELD_REF <*gi, 32, 128>;
  D.23412 = D.23374 & 512;
  if (D.23412 != 0) goto <D.23413>; else goto <D.23414>;
  <D.23413>:
  D.23415 = gi->this_reg;
  D.23416 = (int) D.23415;
  D.23417 = mono_arch_context_get_int_reg (ctx, D.23416);
  info = (void *) D.23417;
  goto <D.23418>;
  <D.23414>:
  D.23419 = gi->this_offset;
  D.23420 = (sizetype) D.23419;
  D.23415 = gi->this_reg;
  D.23416 = (int) D.23415;
  D.23421 = mono_arch_context_get_int_reg (ctx, D.23416);
  D.23422 = (sizetype) D.23421;
  D.23423 = D.23420 + D.23422;
  D.23424 = (void * *) D.23423;
  info = *D.23424;
  <D.23418>:
  <D.23411>:
  method = jinfo_get_method (ji);
  D.23425 = mono_method_get_context (method);
  D.23426 = D.23425->method_inst;
  if (D.23426 != 0B) goto <D.23427>; else goto <D.23428>;
  <D.23427>:
  D.23373 = info;
  return D.23373;
  <D.23428>:
  D.23431 = method->flags;
  D.23432 = (int) D.23431;
  D.23433 = D.23432 & 16;
  if (D.23433 != 0) goto <D.23429>; else goto <D.23434>;
  <D.23434>:
  D.23435 = method->klass;
  D.23436 = BIT_FIELD_REF <*D.23435, 32, 160>;
  D.23437 = D.23436 & 8;
  if (D.23437 != 0) goto <D.23429>; else goto <D.23430>;
  <D.23429>:
  D.23373 = info;
  return D.23373;
  <D.23430>:
  {
    struct MonoObject * this_obj;

    this_obj = info;
    D.23438 = this_obj->vtable;
    D.23373 = D.23438->klass;
    return D.23373;
  }
}


mono_walk_stack_with_state (gboolean (*MonoJitStackWalk) (struct StackFrameInfo *, struct MonoContext *, void *) func, struct MonoThreadUnwindState * state, MonoUnwindOptions unwind_options, void * user_data)
{
  int D.23442;
  _Bool D.23443;
  long int D.23444;
  long int D.23445;
  int D.23448;
  int D.23451;
  _Bool D.23452;
  long int D.23453;
  long int D.23454;
  struct MonoContext * D.23457;
  void * D.23458;
  void * D.23459;
  void * D.23460;
  struct MonoThreadUnwindState extra_state;

  try
    {
      if (state == 0B) goto <D.23440>; else goto <D.23441>;
      <D.23440>:
      D.23442 = mono_thread_info_is_async_context ();
      D.23443 = D.23442 != 0;
      D.23444 = (long int) D.23443;
      D.23445 = __builtin_expect (D.23444, 0);
      if (D.23445 != 0) goto <D.23446>; else goto <D.23447>;
      <D.23446>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 765, "!mono_thread_info_is_async_context ()");
      <D.23447>:
      D.23448 = mono_thread_state_init_from_current (&extra_state);
      if (D.23448 == 0) goto <D.23449>; else goto <D.23450>;
      <D.23449>:
      return;
      <D.23450>:
      state = &extra_state;
      <D.23441>:
      D.23451 = state->valid;
      D.23452 = D.23451 == 0;
      D.23453 = (long int) D.23452;
      D.23454 = __builtin_expect (D.23453, 0);
      if (D.23454 != 0) goto <D.23455>; else goto <D.23456>;
      <D.23455>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 771, "state->valid");
      <D.23456>:
      D.23457 = &state->ctx;
      D.23458 = state->unwind_data[0];
      D.23459 = state->unwind_data[2];
      D.23460 = state->unwind_data[1];
      mono_walk_stack_full (func, D.23457, D.23458, D.23459, D.23460, 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.23464;
  struct MonoThreadUnwindState state;

  try
    {
      D.23464 = mono_thread_state_init_from_current (&state);
      if (D.23464 == 0) goto <D.23465>; else goto <D.23466>;
      <D.23465>:
      return;
      <D.23466>:
      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.37;
  struct MonoLMF * lmf.38;
  void * D.23472;
  int D.23473;
  void * D.23474;
  int D.23475;
  int ves_icall_get_frame_info.39;
  MonoBoolean D.23479;
  <unnamed type> D.23480;
  unsigned int D.23481;
  int D.23484;
  unsigned int D.23485;
  unsigned int D.23486;
  void * D.23493;
  struct MonoReflectionMethod * D.23494;
  int D.23495;
  unsigned int D.23496;
  unsigned int D.23499;
  int D.23500;
  char * D.23506;
  struct MonoString * D.23507;
  unsigned int D.23508;
  int D.23509;
  unsigned int D.23510;
  int D.23511;
  int D.23513;
  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.37 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.37);
      lmf.38 = mono_get_lmf ();
      lmf = lmf.38;
      ji = 0B;
      jmethod = 0B;
      mono_arch_flush_register_windows ();
      D.23472 = __builtin_frame_address (0);
      D.23473 = (int) D.23472;
      ctx.sc_regs[30] = D.23473;
      D.23474 = __builtin_frame_address (0);
      D.23475 = (int) D.23474;
      ctx.sc_regs[29] = D.23475;
      ves_icall_get_frame_info.39 = (int) ves_icall_get_frame_info;
      ctx.sc_pc = ves_icall_get_frame_info.39;
      new_ctx = ctx;
      <D.22416>:
      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.23477>; else goto <D.23478>;
      <D.23477>:
      D.23479 = 0;
      return D.23479;
      <D.23478>:
      D.23480 = frame.type;
      D.23481 = D.23480 + 4294967295;
      if (D.23481 <= 1) goto <D.23482>; else goto <D.23483>;
      <D.23482>:
      // predicted unlikely by continue predictor.
      goto <D.22415>;
      <D.23483>:
      ji = frame.ji;
      D.23484 = frame.native_offset;
      *native_offset = D.23484;
      jmethod = jinfo_get_method (ji);
      D.23485 = BIT_FIELD_REF <*jmethod, 32, 160>;
      D.23486 = D.23485 & 124;
      if (D.23486 != 0) goto <D.23487>; else goto <D.23488>;
      <D.23487>:
      D.23485 = BIT_FIELD_REF <*jmethod, 32, 160>;
      D.23486 = D.23485 & 124;
      if (D.23486 != 68) goto <D.23489>; else goto <D.23490>;
      <D.23489>:
      D.23485 = BIT_FIELD_REF <*jmethod, 32, 160>;
      D.23486 = D.23485 & 124;
      if (D.23486 != 24) goto <D.23491>; else goto <D.23492>;
      <D.23491>:
      // predicted unlikely by continue predictor.
      goto <D.22415>;
      <D.23492>:
      <D.23490>:
      <D.23488>:
      skip = skip + -1;
      <D.22415>:
      if (skip >= 0) goto <D.22416>; else goto <D.22417>;
      <D.22417>:
      D.23493 = get_generic_info_from_stack_frame (ji, &ctx);
      actual_method = get_method_from_stack_frame (ji, D.23493);
      D.23494 = mono_method_get_object (domain, actual_method, 0B);
      mono_gc_wbarrier_generic_store (method, D.23494);
      D.23495 = *native_offset;
      D.23496 = (unsigned int) D.23495;
      location = mono_debug_lookup_source_location (jmethod, D.23496, domain);
      if (location != 0B) goto <D.23497>; else goto <D.23498>;
      <D.23497>:
      D.23499 = location->il_offset;
      D.23500 = (int) D.23499;
      *iloffset = D.23500;
      goto <D.23501>;
      <D.23498>:
      *iloffset = 0;
      <D.23501>:
      if (need_file_info != 0) goto <D.23502>; else goto <D.23503>;
      <D.23502>:
      if (location != 0B) goto <D.23504>; else goto <D.23505>;
      <D.23504>:
      D.23506 = location->source_file;
      D.23507 = mono_string_new (domain, D.23506);
      mono_gc_wbarrier_generic_store (file, D.23507);
      D.23508 = location->row;
      D.23509 = (int) D.23508;
      *line = D.23509;
      D.23510 = location->column;
      D.23511 = (int) D.23510;
      *column = D.23511;
      goto <D.23512>;
      <D.23505>:
      *file = 0B;
      *column = 0;
      D.23513 = *column;
      *line = D.23513;
      <D.23512>:
      <D.23503>:
      mono_debug_free_source_location (location);
      D.23479 = 1;
      return D.23479;
    }
  finally
    {
      lmf = {CLOBBER};
      ctx = {CLOBBER};
      new_ctx = {CLOBBER};
      frame = {CLOBBER};
    }
}


ves_icall_System_Security_SecurityFrame_GetSecurityFrame (gint32 skip)
{
  unsigned int skip.40;
  struct MonoSecurityFrame * D.23517;
  struct MonoSecurityFrame * iftmp.41;
  unsigned int D.23519;
  struct MonoFrameSecurityInfo si;

  try
    {
      skip.40 = (unsigned int) skip;
      si.skips = skip.40;
      si.frame = 0B;
      mono_walk_stack (callback_get_first_frame_security_info, 2, &si);
      D.23519 = si.skips;
      if (D.23519 == 0) goto <D.23520>; else goto <D.23521>;
      <D.23520>:
      iftmp.41 = si.frame;
      goto <D.23522>;
      <D.23521>:
      iftmp.41 = 0B;
      <D.23522>:
      D.23517 = iftmp.41;
      return D.23517;
    }
  finally
    {
      si = {CLOBBER};
    }
}


callback_get_first_frame_security_info (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  gboolean D.23527;
  unsigned int D.23530;
  unsigned int D.23531;
  unsigned int D.23536;
  unsigned int D.23539;
  struct MonoDomain * D.23540;
  struct MonoSecurityFrame * D.23541;
  struct MonoFrameSecurityInfo * si;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  si = data;
  ji = frame->ji;
  if (ji == 0B) goto <D.23525>; else goto <D.23526>;
  <D.23525>:
  D.23527 = 0;
  return D.23527;
  <D.23526>:
  method = jinfo_get_method (ji);
  D.23530 = BIT_FIELD_REF <*method, 32, 160>;
  D.23531 = D.23530 & 124;
  if (D.23531 == 16) goto <D.23528>; else goto <D.23532>;
  <D.23532>:
  D.23530 = BIT_FIELD_REF <*method, 32, 160>;
  D.23531 = D.23530 & 124;
  if (D.23531 == 40) goto <D.23528>; else goto <D.23533>;
  <D.23533>:
  D.23530 = BIT_FIELD_REF <*method, 32, 160>;
  D.23531 = D.23530 & 124;
  if (D.23531 == 44) goto <D.23528>; else goto <D.23534>;
  <D.23534>:
  D.23530 = BIT_FIELD_REF <*method, 32, 160>;
  D.23531 = D.23530 & 124;
  if (D.23531 == 36) goto <D.23528>; else goto <D.23535>;
  <D.23535>:
  D.23530 = BIT_FIELD_REF <*method, 32, 160>;
  D.23531 = D.23530 & 124;
  if (D.23531 == 32) goto <D.23528>; else goto <D.23529>;
  <D.23528>:
  D.23527 = 0;
  return D.23527;
  <D.23529>:
  D.23536 = si->skips;
  if (D.23536 != 0) goto <D.23537>; else goto <D.23538>;
  <D.23537>:
  D.23536 = si->skips;
  D.23539 = D.23536 + 4294967295;
  si->skips = D.23539;
  D.23527 = 0;
  return D.23527;
  <D.23538>:
  D.23540 = frame->domain;
  D.23541 = mono_declsec_create_frame (D.23540, ji);
  si->frame = D.23541;
  D.23527 = 1;
  return D.23527;
}


ves_icall_System_Security_SecurityFrame_GetSecurityStack (gint32 skip)
{
  unsigned int skip.42;
  struct MonoDomain * D.23544;
  struct MonoClass * D.23545;
  unsigned int D.23546;
  struct MonoArray * D.23547;
  struct MonoArray * D.23548;
  struct MonoSecurityStack ss;

  try
    {
      skip.42 = (unsigned int) skip;
      ss.skips = skip.42;
      ss.count = 0;
      ss.maximum = 6;
      D.23544 = mono_domain_get ();
      D.23545 = mono_defaults.runtimesecurityframe_class;
      D.23546 = ss.maximum;
      D.23547 = mono_array_new (D.23544, D.23545, D.23546);
      ss.stack = D.23547;
      mono_walk_stack (callback_get_stack_frames_security_info, 2, &ss);
      D.23548 = ss.stack;
      return D.23548;
    }
  finally
    {
      ss = {CLOBBER};
    }
}


callback_get_stack_frames_security_info (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  gboolean D.23553;
  unsigned int D.23556;
  unsigned int D.23557;
  unsigned int D.23562;
  unsigned int D.23565;
  unsigned int D.23566;
  unsigned int D.23567;
  struct MonoArray * D.23570;
  unsigned int D.23571;
  unsigned int D.23572;
  struct MonoDomain * D.23573;
  struct MonoSecurityFrame * D.23574;
  struct MonoSecurityStack * ss;
  struct MonoJitInfo * ji;
  struct MonoMethod * method;

  ss = data;
  ji = frame->ji;
  if (ji == 0B) goto <D.23551>; else goto <D.23552>;
  <D.23551>:
  D.23553 = 0;
  return D.23553;
  <D.23552>:
  method = jinfo_get_method (ji);
  D.23556 = BIT_FIELD_REF <*method, 32, 160>;
  D.23557 = D.23556 & 124;
  if (D.23557 == 16) goto <D.23554>; else goto <D.23558>;
  <D.23558>:
  D.23556 = BIT_FIELD_REF <*method, 32, 160>;
  D.23557 = D.23556 & 124;
  if (D.23557 == 40) goto <D.23554>; else goto <D.23559>;
  <D.23559>:
  D.23556 = BIT_FIELD_REF <*method, 32, 160>;
  D.23557 = D.23556 & 124;
  if (D.23557 == 44) goto <D.23554>; else goto <D.23560>;
  <D.23560>:
  D.23556 = BIT_FIELD_REF <*method, 32, 160>;
  D.23557 = D.23556 & 124;
  if (D.23557 == 36) goto <D.23554>; else goto <D.23561>;
  <D.23561>:
  D.23556 = BIT_FIELD_REF <*method, 32, 160>;
  D.23557 = D.23556 & 124;
  if (D.23557 == 32) goto <D.23554>; else goto <D.23555>;
  <D.23554>:
  D.23553 = 0;
  return D.23553;
  <D.23555>:
  D.23562 = ss->skips;
  if (D.23562 != 0) goto <D.23563>; else goto <D.23564>;
  <D.23563>:
  D.23562 = ss->skips;
  D.23565 = D.23562 + 4294967295;
  ss->skips = D.23565;
  D.23553 = 0;
  return D.23553;
  <D.23564>:
  D.23566 = ss->count;
  D.23567 = ss->maximum;
  if (D.23566 == D.23567) goto <D.23568>; else goto <D.23569>;
  <D.23568>:
  grow_array (ss);
  <D.23569>:
  {
    void * * __p;

    D.23570 = ss->stack;
    D.23566 = ss->count;
    D.23571 = D.23566;
    D.23572 = D.23571 + 1;
    ss->count = D.23572;
    __p = mono_array_addr_with_size (D.23570, 4, D.23571);
    D.23570 = ss->stack;
    D.23573 = frame->domain;
    D.23574 = mono_declsec_create_frame (D.23573, ji);
    mono_gc_wbarrier_set_arrayref (D.23570, __p, D.23574);
  }
  D.23553 = 0;
  return D.23553;
}


grow_array (struct MonoSecurityStack * stack)
{
  unsigned int D.23576;
  struct MonoClass * D.23577;
  struct MonoArray * D.23578;
  unsigned int i.43;
  char * D.23580;
  unsigned int i.44;
  struct MonoDomain * domain;
  guint32 newsize;
  struct MonoArray * newstack;
  int i;

  domain = mono_domain_get ();
  D.23576 = stack->maximum;
  newsize = D.23576 << 1;
  D.23577 = mono_defaults.runtimesecurityframe_class;
  newstack = mono_array_new (domain, D.23577, newsize);
  i = 0;
  goto <D.22450>;
  <D.22449>:
  {
    void * frame;

    D.23578 = stack->stack;
    i.43 = (unsigned int) i;
    D.23580 = mono_array_addr_with_size (D.23578, 4, i.43);
    frame = MEM[(void * *)D.23580];
    {
      void * * __p;

      i.43 = (unsigned int) i;
      __p = mono_array_addr_with_size (newstack, 4, i.43);
      mono_gc_wbarrier_set_arrayref (newstack, __p, frame);
    }
  }
  i = i + 1;
  <D.22450>:
  i.44 = (unsigned int) i;
  D.23576 = stack->maximum;
  if (i.44 < D.23576) goto <D.22449>; else goto <D.22451>;
  <D.22451>:
  stack->maximum = newsize;
  stack->stack = newstack;
}


mini_jit_info_table_find (struct MonoDomain * domain, char * addr, struct MonoDomain * * out_domain)
{
  struct MonoJitInfo * D.23588;
  struct MonoDomain * D.23589;
  struct MonoDomain * D.23592;
  struct MonoDomain * D.23597;
  void * * iftmp.45;
  void * D.23601;
  void * D.23605;
  struct MonoDomain * D.23608;
  struct MonoJitInfo * ji;
  struct MonoInternalThread * t;
  void * * refs;

  t = mono_thread_internal_current ();
  if (out_domain != 0B) goto <D.23582>; else goto <D.23583>;
  <D.23582>:
  *out_domain = 0B;
  <D.23583>:
  ji = mono_jit_info_table_find (domain, addr);
  if (ji != 0B) goto <D.23584>; else goto <D.23585>;
  <D.23584>:
  if (out_domain != 0B) goto <D.23586>; else goto <D.23587>;
  <D.23586>:
  *out_domain = domain;
  <D.23587>:
  D.23588 = ji;
  return D.23588;
  <D.23585>:
  D.23589 = mono_get_root_domain ();
  if (D.23589 != domain) goto <D.23590>; else goto <D.23591>;
  <D.23590>:
  D.23592 = mono_get_root_domain ();
  ji = mono_jit_info_table_find (D.23592, addr);
  if (ji != 0B) goto <D.23593>; else goto <D.23594>;
  <D.23593>:
  if (out_domain != 0B) goto <D.23595>; else goto <D.23596>;
  <D.23595>:
  D.23597 = mono_get_root_domain ();
  *out_domain = D.23597;
  <D.23596>:
  D.23588 = ji;
  return D.23588;
  <D.23594>:
  <D.23591>:
  if (t == 0B) goto <D.23598>; else goto <D.23599>;
  <D.23598>:
  D.23588 = 0B;
  return D.23588;
  <D.23599>:
  D.23601 = t->appdomain_refs;
  if (D.23601 != 0B) goto <D.23602>; else goto <D.23603>;
  <D.23602>:
  D.23601 = t->appdomain_refs;
  iftmp.45 = MEM[(void * *)D.23601];
  goto <D.23604>;
  <D.23603>:
  iftmp.45 = 0B;
  <D.23604>:
  refs = iftmp.45;
  goto <D.22494>;
  <D.22493>:
  D.23605 = *refs;
  if (D.23605 != domain) goto <D.23606>; else goto <D.23607>;
  <D.23606>:
  D.23605 = *refs;
  D.23608 = mono_get_root_domain ();
  if (D.23605 != D.23608) goto <D.23609>; else goto <D.23610>;
  <D.23609>:
  D.23605 = *refs;
  ji = mono_jit_info_table_find (D.23605, addr);
  if (ji != 0B) goto <D.23611>; else goto <D.23612>;
  <D.23611>:
  if (out_domain != 0B) goto <D.23613>; else goto <D.23614>;
  <D.23613>:
  D.23605 = *refs;
  *out_domain = D.23605;
  <D.23614>:
  D.23588 = ji;
  return D.23588;
  <D.23612>:
  <D.23610>:
  <D.23607>:
  refs = refs + 4;
  <D.22494>:
  if (refs != 0B) goto <D.23615>; else goto <D.22495>;
  <D.23615>:
  D.23605 = *refs;
  if (D.23605 != 0B) goto <D.22493>; else goto <D.22495>;
  <D.22495>:
  D.23588 = 0B;
  return D.23588;
}


mono_debugger_run_finally (struct MonoContext * start_ctx)
{
  unsigned int mono_jit_tls_id.46;
  struct MonoLMF * lmf.47;
  struct MonoJitInfo * D.23619;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.48;
  void * D.23625;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.49;
  int D.23627;
  void * D.23628;
  int D.23629;
  unsigned int D.23632;
  unsigned int D.23633;
  void * D.23636;
  <unnamed-unsigned:15> D.23637;
  int D.23638;
  static int (*<T3c4c>) (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.46 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.46);
      lmf.47 = mono_get_lmf ();
      lmf = lmf.47;
      ctx = *start_ctx;
      ji = mono_find_jit_info (domain, jit_tls, &rji, 0B, &ctx, &new_ctx, 0B, &lmf, 0B, 0B);
      D.23619 = ji + 4294967295;
      if (D.23619 > 4294967293B) goto <D.23620>; else goto <D.23621>;
      <D.23620>:
      return;
      <D.23621>:
      call_filter.48 = call_filter;
      if (call_filter.48 == 0B) goto <D.23623>; else goto <D.23624>;
      <D.23623>:
      D.23625 = mono_get_call_filter ();
      call_filter.49 = (int (*<T3c4c>) (struct MonoContext *, void *)) D.23625;
      call_filter = call_filter.49;
      <D.23624>:
      i = 0;
      goto <D.22683>;
      <D.22682>:
      {
        struct MonoJitExceptionInfo * ei;

        ei = &ji->clauses[i];
        D.23627 = ctx.sc_pc;
        D.23628 = (void *) D.23627;
        D.23629 = is_address_protected (ji, ei, D.23628);
        if (D.23629 != 0) goto <D.23630>; else goto <D.23631>;
        <D.23630>:
        D.23632 = ei->flags;
        D.23633 = D.23632 & 2;
        if (D.23633 != 0) goto <D.23634>; else goto <D.23635>;
        <D.23634>:
        call_filter.48 = call_filter;
        D.23636 = ei->handler_start;
        call_filter.48 (&ctx, D.23636);
        <D.23635>:
        <D.23631>:
      }
      i = i + 1;
      <D.22683>:
      D.23637 = ji->num_clauses;
      D.23638 = (int) D.23637;
      if (D.23638 > i) goto <D.22682>; else goto <D.22684>;
      <D.22684>:
    }
  finally
    {
      lmf = {CLOBBER};
      ctx = {CLOBBER};
      new_ctx = {CLOBBER};
      rji = {CLOBBER};
    }
}


is_address_protected (struct MonoJitInfo * ji, struct MonoJitExceptionInfo * ei, void * ip)
{
  void * D.23644;
  void * D.23646;
  gboolean D.23647;
  unsigned int D.23648;
  unsigned int D.23649;
  int ip.50;
  void * D.23653;
  int D.23654;
  int D.23655;
  int ei.51;
  struct MonoJitExceptionInfo[0:] * D.23657;
  int D.23658;
  int D.23659;
  int D.23660;
  int D.23661;
  <unnamed-unsigned:15> D.23662;
  int D.23663;
  _Bool D.23664;
  long int D.23665;
  long int D.23666;
  short unsigned int D.23669;
  unsigned int D.23672;
  short unsigned int D.23675;
  unsigned int D.23676;
  unsigned int D.23677;
  short unsigned int D.23680;
  int D.23681;
  struct MonoTryBlockHoleTableJitInfo * table;
  int i;
  guint32 offset;
  guint16 clause;

  D.23644 = ei->try_start;
  if (D.23644 > ip) goto <D.23642>; else goto <D.23645>;
  <D.23645>:
  D.23646 = ei->try_end;
  if (D.23646 <= ip) goto <D.23642>; else goto <D.23643>;
  <D.23642>:
  D.23647 = 0;
  return D.23647;
  <D.23643>:
  D.23648 = BIT_FIELD_REF <*ji, 32, 160>;
  D.23649 = D.23648 & 262144;
  if (D.23649 == 0) goto <D.23650>; else goto <D.23651>;
  <D.23650>:
  D.23647 = 1;
  return D.23647;
  <D.23651>:
  table = mono_jit_info_get_try_block_hole_table_info (ji);
  ip.50 = (int) ip;
  D.23653 = ji->code_start;
  D.23654 = (int) D.23653;
  D.23655 = ip.50 - D.23654;
  offset = (guint32) D.23655;
  ei.51 = (int) ei;
  D.23657 = &ji->clauses;
  D.23658 = (int) D.23657;
  D.23659 = ei.51 - D.23658;
  D.23660 = D.23659 /[ex] 24;
  clause = (guint16) D.23660;
  D.23661 = (int) clause;
  D.23662 = ji->num_clauses;
  D.23663 = (int) D.23662;
  D.23664 = D.23661 >= D.23663;
  D.23665 = (long int) D.23664;
  D.23666 = __builtin_expect (D.23665, 0);
  if (D.23666 != 0) goto <D.23667>; else goto <D.23668>;
  <D.23667>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 183, "clause < ji->num_clauses");
  <D.23668>:
  i = 0;
  goto <D.22189>;
  <D.22188>:
  {
    struct MonoTryBlockHoleJitInfo * hole;

    hole = &table->holes[i];
    D.23669 = hole->clause;
    if (D.23669 == clause) goto <D.23670>; else goto <D.23671>;
    <D.23670>:
    D.23672 = hole->offset;
    if (D.23672 <= offset) goto <D.23673>; else goto <D.23674>;
    <D.23673>:
    D.23672 = hole->offset;
    D.23675 = hole->length;
    D.23676 = (unsigned int) D.23675;
    D.23677 = D.23672 + D.23676;
    if (D.23677 > offset) goto <D.23678>; else goto <D.23679>;
    <D.23678>:
    D.23647 = 0;
    return D.23647;
    <D.23679>:
    <D.23674>:
    <D.23671>:
  }
  i = i + 1;
  <D.22189>:
  D.23680 = table->num_holes;
  D.23681 = (int) D.23680;
  if (D.23681 > i) goto <D.22188>; else goto <D.22190>;
  <D.22190>:
  D.23647 = 1;
  return D.23647;
}


mono_handle_exception (struct MonoContext * ctx, void * obj)
{
  struct MonoPerfCounters * mono_perfcounters.52;
  unsigned int D.23684;
  unsigned int D.23685;
  gboolean D.23686;

  mono_perfcounters.52 = mono_perfcounters;
  D.23684 = mono_perfcounters.52->exceptions_thrown;
  D.23685 = D.23684 + 1;
  mono_perfcounters.52->exceptions_thrown = D.23685;
  D.23686 = mono_handle_exception_internal (ctx, obj, 0, 0B);
  return D.23686;
}


mono_handle_exception_internal (struct MonoContext * ctx, void * obj, gboolean resume, struct MonoJitInfo * * out_ji)
{
  unsigned int mono_jit_tls_id.53;
  struct MonoLMF * lmf.54;
  _Bool D.23690;
  long int D.23691;
  long int D.23692;
  struct MonoString * * D.23697;
  struct MonoString * D.23698;
  struct MonoException * D.23699;
  struct MonoException * D.23703;
  struct MonoClass * D.23706;
  struct MonoObject * D.23707;
  struct MonoObject * D.23710;
  struct MonoClass * D.23716;
  int D.22605;
  int iftmp.55;
  int D.22604;
  struct MonoVTable * D.23722;
  struct MonoClass * D.23723;
  const char[21] * D.23724;
  unsigned char D.23725;
  int D.23726;
  unsigned char D.23727;
  int D.23728;
  const unsigned char * D.23733;
  unsigned char D.23734;
  int D.23735;
  const unsigned char * D.23736;
  unsigned char D.23737;
  int D.23738;
  const unsigned char * D.23743;
  unsigned char D.23744;
  int D.23745;
  const unsigned char * D.23746;
  unsigned char D.23747;
  int D.23748;
  const unsigned char * D.23753;
  unsigned char D.23754;
  int D.23755;
  const unsigned char * D.23756;
  unsigned char D.23757;
  int D.23758;
  const char * D.23760;
  struct MonoClass * D.23763;
  struct MonoString * D.23764;
  int D.22617;
  int iftmp.56;
  int D.22616;
  const char[27] * D.23768;
  unsigned char D.23769;
  int D.23770;
  unsigned char D.23771;
  int D.23772;
  const unsigned char * D.23777;
  unsigned char D.23778;
  int D.23779;
  const unsigned char * D.23780;
  unsigned char D.23781;
  int D.23782;
  const unsigned char * D.23787;
  unsigned char D.23788;
  int D.23789;
  const unsigned char * D.23790;
  unsigned char D.23791;
  int D.23792;
  const unsigned char * D.23797;
  unsigned char D.23798;
  int D.23799;
  const unsigned char * D.23800;
  unsigned char D.23801;
  int D.23802;
  struct MonoString * D.23806;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.57;
  void * D.23810;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.58;
  void * D.23812;
  _Bool D.23813;
  long int D.23814;
  long int D.23815;
  void (*<T3189>) (struct MonoObject *) D.23818;
  _Bool D.23819;
  long int D.23820;
  long int D.23821;
  struct MonoContext * D.23824;
  int D.23827;
  struct MonoMethod * iftmp.59;
  struct MonoVTable * D.23834;
  struct MonoClass * D.23835;
  int D.22637;
  int iftmp.60;
  int D.22636;
  const char[21] * D.23845;
  unsigned char D.23846;
  int D.23847;
  unsigned char D.23848;
  int D.23849;
  const unsigned char * D.23854;
  unsigned char D.23855;
  int D.23856;
  const unsigned char * D.23857;
  unsigned char D.23858;
  int D.23859;
  const unsigned char * D.23864;
  unsigned char D.23865;
  int D.23866;
  const unsigned char * D.23867;
  unsigned char D.23868;
  int D.23869;
  const unsigned char * D.23874;
  unsigned char D.23875;
  int D.23876;
  const unsigned char * D.23877;
  unsigned char D.23878;
  int D.23879;
  int D.22646;
  int iftmp.61;
  int D.22645;
  const char[23] * D.23885;
  unsigned char D.23886;
  int D.23887;
  unsigned char D.23888;
  int D.23889;
  const unsigned char * D.23894;
  unsigned char D.23895;
  int D.23896;
  const unsigned char * D.23897;
  unsigned char D.23898;
  int D.23899;
  const unsigned char * D.23904;
  unsigned char D.23905;
  int D.23906;
  const unsigned char * D.23907;
  unsigned char D.23908;
  int D.23909;
  const unsigned char * D.23914;
  unsigned char D.23915;
  int D.23916;
  const unsigned char * D.23917;
  unsigned char D.23918;
  int D.23919;
  char * iftmp.62;
  unsigned int D.23927;
  void * D.23928;
  struct MonoVTable * D.23929;
  struct MonoClass * D.23930;
  const char * D.23931;
  const char * D.23932;
  int D.23935;
  struct MonoDebugOptions * D.23940;
  int D.23941;
  struct MonoDebugOptions * D.23944;
  int D.23945;
  struct _IO_FILE * stderr.63;
  struct MonoJitInfo * ji.64;
  struct MonoMethod * D.23953;
  unsigned int D.23954;
  unsigned int D.23955;
  struct MonoJitInfo * prev_ji.65;
  struct MonoMethod * D.23961;
  struct MonoMethod * D.23962;
  struct MonoJitInfo * ji.66;
  struct MonoLMF * lmf.67;
  int first_filter_idx.68;
  <unnamed type> D.23978;
  unsigned int D.23979;
  _Bool D.23982;
  long int D.23983;
  long int D.23984;
  struct MonoJitInfo * ji.69;
  struct MonoLMF * * D.23990;
  struct MonoLMF * lmf.70;
  int D.23996;
  int D.23997;
  int D.23998;
  int D.24000;
  int D.24004;
  void * D.24005;
  int D.24006;
  int D.24012;
  unsigned int D.24014;
  unsigned int D.24017;
  unsigned int D.24018;
  int D.24021;
  sizetype D.24022;
  int D.24023;
  sizetype D.24024;
  sizetype D.24025;
  void * * D.24026;
  int first_filter_idx.71;
  _Bool D.24030;
  struct MonoObject * D.24035;
  void * D.24036;
  _Bool D.24037;
  long int D.24038;
  long int D.24039;
  int D.24042;
  int D.24048;
  char * D.24049;
  struct MonoJitInfo * D.24050;
  _Bool D.24051;
  long int D.24052;
  long int D.24053;
  struct MonoJitExceptionInfo * D.24056;
  void * D.24057;
  int D.24058;
  int D.24063;
  int D.24066;
  char * D.24069;
  int D.24070;
  int D.24071;
  struct MonoLMF * * D.24072;
  struct MonoPerfCounters * mono_perfcounters.72;
  unsigned int D.24074;
  unsigned int frame_count.73;
  unsigned int D.24076;
  gboolean D.24079;
  int D.24080;
  int D.24085;
  int D.24088;
  char * D.24091;
  int D.24092;
  int D.24097;
  int D.24100;
  char * D.24103;
  unsigned int D.24104;
  unsigned int D.24105;
  struct MonoLMF * * D.24106;
  int D.24109;
  <unnamed-unsigned:15> D.24110;
  int D.24111;
  struct MonoDomain * domain;
  struct MonoJitInfo * ji;
  struct MonoJitInfo * prev_ji;
  static int (*<T3c4c>) (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.53 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.53);
      lmf.54 = mono_get_lmf ();
      lmf = lmf.54;
      stack_overflow = 0;
      frame_count = 0;
      first_filter_idx = 0;
      non_exception = 0B;
      D.23690 = ctx == 0B;
      D.23691 = (long int) D.23690;
      D.23692 = __builtin_expect (D.23691, 0);
      if (D.23692 != 0) goto <D.23693>; else goto <D.23694>;
      <D.23693>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1517, "ctx != NULL");
      <D.23694>:
      if (obj == 0B) goto <D.23695>; else goto <D.23696>;
      <D.23695>:
      {
        struct MonoException * ex;

        ex = mono_get_exception_null_reference ();
        D.23697 = &ex->message;
        D.23698 = mono_string_new (domain, "Object reference not set to an instance of an object");
        mono_gc_wbarrier_set_field (ex, D.23697, D.23698);
        obj = ex;
      }
      <D.23696>:
      D.23699 = domain->stack_overflow_ex;
      if (D.23699 == obj) goto <D.23700>; else goto <D.23701>;
      <D.23700>:
      stack_overflow = 1;
      goto <D.23702>;
      <D.23701>:
      D.23703 = domain->null_reference_ex;
      if (D.23703 == obj) goto <D.23704>; else goto <D.23705>;
      <D.23704>:
      obj = mono_get_exception_null_reference ();
      <D.23705>:
      <D.23702>:
      D.23706 = mono_defaults.exception_class;
      D.23707 = mono_object_isinst (obj, D.23706);
      if (D.23707 == 0B) goto <D.23708>; else goto <D.23709>;
      <D.23708>:
      non_exception = obj;
      obj = mono_get_exception_runtime_wrapped (obj);
      <D.23709>:
      mono_ex = obj;
      D.23706 = mono_defaults.exception_class;
      D.23710 = mono_object_isinst (obj, D.23706);
      if (D.23710 != 0B) goto <D.23711>; else goto <D.23712>;
      <D.23711>:
      mono_ex = obj;
      goto <D.23713>;
      <D.23712>:
      mono_ex = 0B;
      <D.23713>:
      if (mono_ex != 0B) goto <D.23714>; else goto <D.23715>;
      <D.23714>:
      D.23716 = jit_tls->class_cast_from;
      if (D.23716 != 0B) goto <D.23717>; else goto <D.23718>;
      <D.23717>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          D.23722 = mono_ex->object.vtable;
          D.23723 = D.23722->klass;
          __s2 = D.23723->name;
          D.23724 = "InvalidCastException";
          D.23725 = MEM[(const unsigned char *)D.23724];
          D.23726 = (int) D.23725;
          D.23727 = *__s2;
          D.23728 = (int) D.23727;
          __result = D.23726 - D.23728;
          {
            if (__s2_len != 0) goto <D.23729>; else goto <D.23730>;
            <D.23729>:
            if (__result == 0) goto <D.23731>; else goto <D.23732>;
            <D.23731>:
            D.23733 = &MEM[(void *)"InvalidCastException" + 1B];
            D.23734 = *D.23733;
            D.23735 = (int) D.23734;
            D.23736 = __s2 + 1;
            D.23737 = *D.23736;
            D.23738 = (int) D.23737;
            __result = D.23735 - D.23738;
            if (__s2_len > 1) goto <D.23739>; else goto <D.23740>;
            <D.23739>:
            if (__result == 0) goto <D.23741>; else goto <D.23742>;
            <D.23741>:
            D.23743 = &MEM[(void *)"InvalidCastException" + 2B];
            D.23744 = *D.23743;
            D.23745 = (int) D.23744;
            D.23746 = __s2 + 2;
            D.23747 = *D.23746;
            D.23748 = (int) D.23747;
            __result = D.23745 - D.23748;
            if (__s2_len > 2) goto <D.23749>; else goto <D.23750>;
            <D.23749>:
            if (__result == 0) goto <D.23751>; else goto <D.23752>;
            <D.23751>:
            D.23753 = &MEM[(void *)"InvalidCastException" + 3B];
            D.23754 = *D.23753;
            D.23755 = (int) D.23754;
            D.23756 = __s2 + 3;
            D.23757 = *D.23756;
            D.23758 = (int) D.23757;
            __result = D.23755 - D.23758;
            <D.23752>:
            <D.23750>:
            <D.23742>:
            <D.23740>:
            <D.23732>:
            <D.23730>:
          }
          D.22604 = __result;
        }
        iftmp.55 = -D.22604;
        goto <D.23759>;
        <D.23721>:
        D.23722 = mono_ex->object.vtable;
        D.23723 = D.23722->klass;
        D.23760 = D.23723->name;
        iftmp.55 = __builtin_strcmp (D.23760, "InvalidCastException");
        <D.23759>:
        D.22605 = iftmp.55;
      }
      if (D.22605 == 0) goto <D.23761>; else goto <D.23762>;
      <D.23761>:
      {
        char * from_name;
        char * to_name;
        char * msg;

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

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

          D.23722 = mono_ex->object.vtable;
          D.23723 = D.23722->klass;
          __s2 = D.23723->name;
          D.23768 = "ArrayTypeMismatchException";
          D.23769 = MEM[(const unsigned char *)D.23768];
          D.23770 = (int) D.23769;
          D.23771 = *__s2;
          D.23772 = (int) D.23771;
          __result = D.23770 - D.23772;
          {
            if (__s2_len != 0) goto <D.23773>; else goto <D.23774>;
            <D.23773>:
            if (__result == 0) goto <D.23775>; else goto <D.23776>;
            <D.23775>:
            D.23777 = &MEM[(void *)"ArrayTypeMismatchException" + 1B];
            D.23778 = *D.23777;
            D.23779 = (int) D.23778;
            D.23780 = __s2 + 1;
            D.23781 = *D.23780;
            D.23782 = (int) D.23781;
            __result = D.23779 - D.23782;
            if (__s2_len > 1) goto <D.23783>; else goto <D.23784>;
            <D.23783>:
            if (__result == 0) goto <D.23785>; else goto <D.23786>;
            <D.23785>:
            D.23787 = &MEM[(void *)"ArrayTypeMismatchException" + 2B];
            D.23788 = *D.23787;
            D.23789 = (int) D.23788;
            D.23790 = __s2 + 2;
            D.23791 = *D.23790;
            D.23792 = (int) D.23791;
            __result = D.23789 - D.23792;
            if (__s2_len > 2) goto <D.23793>; else goto <D.23794>;
            <D.23793>:
            if (__result == 0) goto <D.23795>; else goto <D.23796>;
            <D.23795>:
            D.23797 = &MEM[(void *)"ArrayTypeMismatchException" + 3B];
            D.23798 = *D.23797;
            D.23799 = (int) D.23798;
            D.23800 = __s2 + 3;
            D.23801 = *D.23800;
            D.23802 = (int) D.23801;
            __result = D.23799 - D.23802;
            <D.23796>:
            <D.23794>:
            <D.23786>:
            <D.23784>:
            <D.23776>:
            <D.23774>:
          }
          D.22616 = __result;
        }
        iftmp.56 = -D.22616;
        goto <D.23803>;
        <D.23767>:
        D.23722 = mono_ex->object.vtable;
        D.23723 = D.23722->klass;
        D.23760 = D.23723->name;
        iftmp.56 = __builtin_strcmp (D.23760, "ArrayTypeMismatchException");
        <D.23803>:
        D.22617 = iftmp.56;
      }
      if (D.22617 == 0) goto <D.23804>; else goto <D.23805>;
      <D.23804>:
      {
        char * from_name;
        char * to_name;
        char * msg;

        D.23716 = jit_tls->class_cast_from;
        from_name = mono_type_get_full_name (D.23716);
        D.23763 = jit_tls->class_cast_to;
        to_name = mono_type_get_full_name (D.23763);
        msg = monoeg_g_strdup_printf ("Source array of type \'%s\' cannot be cast to destination array type \'%s\'.", from_name, to_name);
        D.23806 = mono_string_new (domain, msg);
        mono_ex->message = D.23806;
        monoeg_g_free (from_name);
        monoeg_g_free (to_name);
        monoeg_g_free (msg);
      }
      <D.23805>:
      <D.23718>:
      <D.23715>:
      call_filter.57 = call_filter;
      if (call_filter.57 == 0B) goto <D.23808>; else goto <D.23809>;
      <D.23808>:
      D.23810 = mono_get_call_filter ();
      call_filter.58 = (int (*<T3c4c>) (struct MonoContext *, void *)) D.23810;
      call_filter = call_filter.58;
      <D.23809>:
      D.23812 = jit_tls->end_of_stack;
      D.23813 = D.23812 == 0B;
      D.23814 = (long int) D.23813;
      D.23815 = __builtin_expect (D.23814, 0);
      if (D.23815 != 0) goto <D.23816>; else goto <D.23817>;
      <D.23816>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1575, "jit_tls->end_of_stack");
      <D.23817>:
      D.23818 = jit_tls->abort_func;
      D.23819 = D.23818 == 0B;
      D.23820 = (long int) D.23819;
      D.23821 = __builtin_expect (D.23820, 0);
      if (D.23821 != 0) goto <D.23822>; else goto <D.23823>;
      <D.23822>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1576, "jit_tls->abort_func");
      <D.23823>:
      D.23824 = &jit_tls->orig_ex_ctx;
      memcpy (D.23824, ctx, 260);
      if (resume == 0) goto <D.23825>; else goto <D.23826>;
      <D.23825>:
      {
        gboolean res;
        struct MonoContext ctx_cp;

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

              try
                {
                  D.23706 = mono_defaults.exception_class;
                  system_exception_get_message = mono_class_get_method_from_name (D.23706, "get_Message", 0);
                  if (system_exception_get_message != 0B) goto <D.23831>; else goto <D.23832>;
                  <D.23831>:
                  iftmp.59 = mono_object_get_virtual_method (obj, system_exception_get_message);
                  goto <D.23833>;
                  <D.23832>:
                  iftmp.59 = 0B;
                  <D.23833>:
                  get_message = iftmp.59;
                  D.23834 = MEM[(struct MonoObject *)mono_ex].vtable;
                  D.23835 = D.23834->klass;
                  type_name = mono_class_get_name (D.23835);
                  msg = 0B;
                  exc = 0B;
                  if (get_message == 0B) goto <D.23836>; else goto <D.23837>;
                  <D.23836>:
                  message = 0B;
                  goto <D.23838>;
                  <D.23837>:
                  {
                    size_t __s1_len;
                    size_t __s2_len;

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

                      __s2 = type_name;
                      D.23845 = "OutOfMemoryException";
                      D.23846 = MEM[(const unsigned char *)D.23845];
                      D.23847 = (int) D.23846;
                      D.23848 = *__s2;
                      D.23849 = (int) D.23848;
                      __result = D.23847 - D.23849;
                      {
                        if (__s2_len != 0) goto <D.23850>; else goto <D.23851>;
                        <D.23850>:
                        if (__result == 0) goto <D.23852>; else goto <D.23853>;
                        <D.23852>:
                        D.23854 = &MEM[(void *)"OutOfMemoryException" + 1B];
                        D.23855 = *D.23854;
                        D.23856 = (int) D.23855;
                        D.23857 = __s2 + 1;
                        D.23858 = *D.23857;
                        D.23859 = (int) D.23858;
                        __result = D.23856 - D.23859;
                        if (__s2_len > 1) goto <D.23860>; else goto <D.23861>;
                        <D.23860>:
                        if (__result == 0) goto <D.23862>; else goto <D.23863>;
                        <D.23862>:
                        D.23864 = &MEM[(void *)"OutOfMemoryException" + 2B];
                        D.23865 = *D.23864;
                        D.23866 = (int) D.23865;
                        D.23867 = __s2 + 2;
                        D.23868 = *D.23867;
                        D.23869 = (int) D.23868;
                        __result = D.23866 - D.23869;
                        if (__s2_len > 2) goto <D.23870>; else goto <D.23871>;
                        <D.23870>:
                        if (__result == 0) goto <D.23872>; else goto <D.23873>;
                        <D.23872>:
                        D.23874 = &MEM[(void *)"OutOfMemoryException" + 3B];
                        D.23875 = *D.23874;
                        D.23876 = (int) D.23875;
                        D.23877 = __s2 + 3;
                        D.23878 = *D.23877;
                        D.23879 = (int) D.23878;
                        __result = D.23876 - D.23879;
                        <D.23873>:
                        <D.23871>:
                        <D.23863>:
                        <D.23861>:
                        <D.23853>:
                        <D.23851>:
                      }
                      D.22636 = __result;
                    }
                    iftmp.60 = -D.22636;
                    goto <D.23880>;
                    <D.23844>:
                    iftmp.60 = __builtin_strcmp (type_name, "OutOfMemoryException");
                    <D.23880>:
                    D.22637 = iftmp.60;
                  }
                  if (D.22637 == 0) goto <D.23839>; else goto <D.23881>;
                  <D.23881>:
                  {
                    size_t __s1_len;
                    size_t __s2_len;

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

                      __s2 = type_name;
                      D.23885 = "StackOverflowException";
                      D.23886 = MEM[(const unsigned char *)D.23885];
                      D.23887 = (int) D.23886;
                      D.23888 = *__s2;
                      D.23889 = (int) D.23888;
                      __result = D.23887 - D.23889;
                      {
                        if (__s2_len != 0) goto <D.23890>; else goto <D.23891>;
                        <D.23890>:
                        if (__result == 0) goto <D.23892>; else goto <D.23893>;
                        <D.23892>:
                        D.23894 = &MEM[(void *)"StackOverflowException" + 1B];
                        D.23895 = *D.23894;
                        D.23896 = (int) D.23895;
                        D.23897 = __s2 + 1;
                        D.23898 = *D.23897;
                        D.23899 = (int) D.23898;
                        __result = D.23896 - D.23899;
                        if (__s2_len > 1) goto <D.23900>; else goto <D.23901>;
                        <D.23900>:
                        if (__result == 0) goto <D.23902>; else goto <D.23903>;
                        <D.23902>:
                        D.23904 = &MEM[(void *)"StackOverflowException" + 2B];
                        D.23905 = *D.23904;
                        D.23906 = (int) D.23905;
                        D.23907 = __s2 + 2;
                        D.23908 = *D.23907;
                        D.23909 = (int) D.23908;
                        __result = D.23906 - D.23909;
                        if (__s2_len > 2) goto <D.23910>; else goto <D.23911>;
                        <D.23910>:
                        if (__result == 0) goto <D.23912>; else goto <D.23913>;
                        <D.23912>:
                        D.23914 = &MEM[(void *)"StackOverflowException" + 3B];
                        D.23915 = *D.23914;
                        D.23916 = (int) D.23915;
                        D.23917 = __s2 + 3;
                        D.23918 = *D.23917;
                        D.23919 = (int) D.23918;
                        __result = D.23916 - D.23919;
                        <D.23913>:
                        <D.23911>:
                        <D.23903>:
                        <D.23901>:
                        <D.23893>:
                        <D.23891>:
                      }
                      D.22645 = __result;
                    }
                    iftmp.61 = -D.22645;
                    goto <D.23920>;
                    <D.23884>:
                    iftmp.61 = __builtin_strcmp (type_name, "StackOverflowException");
                    <D.23920>:
                    D.22646 = iftmp.61;
                  }
                  if (D.22646 == 0) goto <D.23839>; else goto <D.23840>;
                  <D.23839>:
                  message = 0B;
                  msg = monoeg_g_strdup_printf ("(No exception message for: %s)\n", type_name);
                  goto <D.23841>;
                  <D.23840>:
                  message = mono_runtime_invoke (get_message, obj, 0B, &exc);
                  <D.23841>:
                  <D.23838>:
                  if (msg == 0B) goto <D.23921>; else goto <D.23922>;
                  <D.23921>:
                  if (message != 0B) goto <D.23924>; else goto <D.23925>;
                  <D.23924>:
                  iftmp.62 = mono_string_to_utf8 (message);
                  goto <D.23926>;
                  <D.23925>:
                  iftmp.62 = monoeg_strdup ("(System.Exception.Message property not available)");
                  <D.23926>:
                  msg = iftmp.62;
                  <D.23922>:
                  D.23927 = GetCurrentThreadId ();
                  D.23928 = (void *) D.23927;
                  D.23929 = MEM[(struct MonoObject *)obj].vtable;
                  D.23930 = D.23929->klass;
                  D.23931 = D.23930->name_space;
                  D.23929 = MEM[(struct MonoObject *)obj].vtable;
                  D.23930 = D.23929->klass;
                  D.23932 = D.23930->name;
                  monoeg_g_print ("[%p:] EXCEPTION handling: %s.%s: %s\n", D.23928, D.23931, D.23932, msg);
                  monoeg_g_free (msg);
                  if (mono_ex != 0B) goto <D.23933>; else goto <D.23934>;
                  <D.23933>:
                  D.23834 = MEM[(struct MonoObject *)mono_ex].vtable;
                  D.23835 = D.23834->klass;
                  D.23935 = mono_trace_eval_exception (D.23835);
                  if (D.23935 != 0) goto <D.23936>; else goto <D.23937>;
                  <D.23936>:
                  mono_print_thread_dump_from_ctx (ctx);
                  <D.23937>:
                  <D.23934>:
                }
              finally
                {
                  exc = {CLOBBER};
                }
            }
            <D.23829>:
            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.23938>; else goto <D.23939>;
            <D.23938>:
            D.23940 = mini_get_debug_options ();
            D.23941 = D.23940->break_on_exc;
            if (D.23941 != 0) goto <D.23942>; else goto <D.23943>;
            <D.23942>:
            raise (5);
            <D.23943>:
            mono_debugger_agent_handle_exception (obj, ctx, 0B);
            D.23944 = mini_get_debug_options ();
            D.23945 = D.23944->suspend_on_unhandled;
            if (D.23945 != 0) goto <D.23946>; else goto <D.23947>;
            <D.23946>:
            stderr.63 = stderr;
            fprintf (stderr.63, "Unhandled exception, suspending...\n");
            <D.22647>:
            goto <D.22647>;
            <D.23947>:
            mono_unhandled_exception (obj);
            goto <D.23949>;
            <D.23939>:
            {
              gboolean unhandled;

              unhandled = 0;
              ji.64 = ji;
              if (ji.64 != 0B) goto <D.23951>; else goto <D.23952>;
              <D.23951>:
              ji.64 = ji;
              D.23953 = jinfo_get_method (ji.64);
              D.23954 = BIT_FIELD_REF <*D.23953, 32, 160>;
              D.23955 = D.23954 & 124;
              if (D.23955 == 16) goto <D.23956>; else goto <D.23957>;
              <D.23956>:
              prev_ji.65 = prev_ji;
              if (prev_ji.65 != 0B) goto <D.23959>; else goto <D.23960>;
              <D.23959>:
              {
                struct MonoInternalThread * thread;

                thread = mono_thread_internal_current ();
                prev_ji.65 = prev_ji;
                D.23961 = jinfo_get_method (prev_ji.65);
                D.23962 = thread->async_invoke_method;
                if (D.23961 == D.23962) goto <D.23963>; else goto <D.23964>;
                <D.23963>:
                unhandled = 1;
                <D.23964>:
              }
              <D.23960>:
              <D.23957>:
              <D.23952>:
              if (unhandled != 0) goto <D.23965>; else goto <D.23966>;
              <D.23965>:
              mono_debugger_agent_handle_exception (obj, ctx, 0B);
              goto <D.23967>;
              <D.23966>:
              mono_debugger_agent_handle_exception (obj, ctx, &ctx_cp);
              <D.23967>:
            }
            <D.23949>:
          }
        finally
          {
            ctx_cp = {CLOBBER};
          }
      }
      <D.23826>:
      if (out_ji != 0B) goto <D.23968>; else goto <D.23969>;
      <D.23968>:
      *out_ji = 0B;
      <D.23969>:
      filter_idx = 0;
      initial_ctx = *ctx;
      <D.22666>:
      {
        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.23970>; else goto <D.23971>;
            <D.23970>:
            resume = 0;
            ji.66 = jit_tls->resume_state.ji;
            ji = ji.66;
            new_ctx = jit_tls->resume_state.new_ctx;
            clause_index_start = jit_tls->resume_state.clause_index;
            lmf.67 = jit_tls->resume_state.lmf;
            lmf = lmf.67;
            first_filter_idx.68 = jit_tls->resume_state.first_filter_idx;
            first_filter_idx = first_filter_idx.68;
            filter_idx = jit_tls->resume_state.filter_idx;
            goto <D.23975>;
            <D.23971>:
            {
              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.23976>; else goto <D.23977>;
                  <D.23976>:
                  D.23978 = frame.type;
                  D.23979 = D.23978 + 4294967295;
                  if (D.23979 <= 1) goto <D.23980>; else goto <D.23981>;
                  <D.23980>:
                  *ctx = new_ctx;
                  // predicted unlikely by continue predictor.
                  goto <D.22655>;
                  <D.23981>:
                  D.23978 = frame.type;
                  D.23982 = D.23978 != 0;
                  D.23983 = (long int) D.23982;
                  D.23984 = __builtin_expect (D.23983, 0);
                  if (D.23984 != 0) goto <D.23985>; else goto <D.23986>;
                  <D.23985>:
                  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1683, "frame.type == FRAME_TYPE_MANAGED");
                  <D.23986>:
                  ji.69 = frame.ji;
                  ji = ji.69;
                  <D.23977>:
                }
              finally
                {
                  frame = {CLOBBER};
                }
            }
            <D.23975>:
            if (unwind_res == 0) goto <D.23988>; else goto <D.23989>;
            <D.23988>:
            D.23990 = mono_get_lmf_addr ();
            lmf.70 = lmf;
            *D.23990 = lmf.70;
            D.23818 = jit_tls->abort_func;
            D.23818 (obj);
            monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1692);
            <D.23989>:
            ji.64 = ji;
            method = jinfo_get_method (ji.64);
            frame_count = frame_count + 1;
            if (stack_overflow != 0) goto <D.23992>; else goto <D.23993>;
            <D.23992>:
            if (1 != 0) goto <D.23994>; else goto <D.23995>;
            <D.23994>:
            D.23996 = ctx->sc_regs[29];
            D.23997 = initial_ctx.sc_regs[29];
            D.23998 = D.23996 - D.23997;
            free_stack = (guint32) D.23998;
            goto <D.23999>;
            <D.23995>:
            D.23997 = initial_ctx.sc_regs[29];
            D.23996 = ctx->sc_regs[29];
            D.24000 = D.23997 - D.23996;
            free_stack = (guint32) D.24000;
            <D.23999>:
            goto <D.24001>;
            <D.23993>:
            free_stack = 16777215;
            <D.24001>:
            i = clause_index_start;
            goto <D.22664>;
            <D.22663>:
            {
              struct MonoJitExceptionInfo * ei;
              gboolean filtered;

              ji.64 = ji;
              ei = &ji.64->clauses[i];
              filtered = 0;
              if (free_stack <= 65536) goto <D.24002>; else goto <D.24003>;
              <D.24002>:
              // predicted unlikely by continue predictor.
              goto <D.22658>;
              <D.24003>:
              ji.64 = ji;
              D.24004 = ctx->sc_pc;
              D.24005 = (void *) D.24004;
              D.24006 = is_address_protected (ji.64, ei, D.24005);
              if (D.24006 != 0) goto <D.24007>; else goto <D.24008>;
              <D.24007>:
              {
                struct MonoClass * catch_class;

                ji.64 = ji;
                catch_class = get_exception_catch_class (ei, ji.64, ctx);
                if (non_exception != 0B) goto <D.24011>; else goto <D.24009>;
                <D.24011>:
                D.24012 = wrap_non_exception_throws (method);
                if (D.24012 == 0) goto <D.24013>; else goto <D.24009>;
                <D.24013>:
                ex_obj = non_exception;
                goto <D.24010>;
                <D.24009>:
                ex_obj = obj;
                <D.24010>:
                D.24014 = ei->flags;
                if (D.24014 <= 1) goto <D.24015>; else goto <D.24016>;
                <D.24015>:
                ji.64 = ji;
                D.24017 = BIT_FIELD_REF <*ji.64, 32, 160>;
                D.24018 = D.24017 & 2097152;
                if (D.24018 != 0) goto <D.24019>; else goto <D.24020>;
                <D.24019>:
                monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1737);
                <D.24020>:
                D.24021 = ei->exvar_offset;
                D.24022 = (sizetype) D.24021;
                D.24023 = ctx->sc_regs[30];
                D.24024 = (sizetype) D.24023;
                D.24025 = D.24022 + D.24024;
                D.24026 = (void * *) D.24025;
                *D.24026 = ex_obj;
                <D.24016>:
                D.24014 = ei->flags;
                if (D.24014 == 1) goto <D.24027>; else goto <D.24028>;
                <D.24027>:
                first_filter_idx.71 = first_filter_idx;
                D.24030 = filter_idx == first_filter_idx.71;
                filtered = (gboolean) D.24030;
                filter_idx = filter_idx + 1;
                <D.24028>:
                D.24014 = ei->flags;
                if (D.24014 == 0) goto <D.24034>; else goto <D.24031>;
                <D.24034>:
                D.24035 = mono_object_isinst (ex_obj, catch_class);
                if (D.24035 != 0B) goto <D.24032>; else goto <D.24031>;
                <D.24031>:
                if (filtered != 0) goto <D.24032>; else goto <D.24033>;
                <D.24032>:
                D.24036 = jit_tls->handler_block_return_address;
                D.24037 = D.24036 != 0B;
                D.24038 = (long int) D.24037;
                D.24039 = __builtin_expect (D.24038, 0);
                if (D.24039 != 0) goto <D.24040>; else goto <D.24041>;
                <D.24040>:
                {
                  gboolean is_outside;
                  void * prot_bp;
                  void * catch_bp;

                  is_outside = 0;
                  D.24042 = jit_tls->handler_block_context.sc_regs[30];
                  prot_bp = (void *) D.24042;
                  D.24023 = ctx->sc_regs[30];
                  catch_bp = (void *) D.24023;
                  if (catch_bp > prot_bp) goto <D.24043>; else goto <D.24044>;
                  <D.24043>:
                  is_outside = 1;
                  goto <D.24045>;
                  <D.24044>:
                  if (catch_bp == prot_bp) goto <D.24046>; else goto <D.24047>;
                  <D.24046>:
                  D.24048 = jit_tls->handler_block_context.sc_pc;
                  D.24049 = (char *) D.24048;
                  D.24050 = mini_jit_info_table_find (domain, D.24049, 0B);
                  ji.64 = ji;
                  D.24051 = D.24050 != ji.64;
                  D.24052 = (long int) D.24051;
                  D.24053 = __builtin_expect (D.24052, 0);
                  if (D.24053 != 0) goto <D.24054>; else goto <D.24055>;
                  <D.24054>:
                  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.24055>:
                  ji.64 = ji;
                  D.24056 = jit_tls->handler_block;
                  D.24057 = ei->handler_start;
                  D.24058 = is_address_protected (ji.64, D.24056, D.24057);
                  if (D.24058 == 0) goto <D.24059>; else goto <D.24060>;
                  <D.24059>:
                  is_outside = 1;
                  <D.24060>:
                  <D.24047>:
                  <D.24045>:
                  if (is_outside != 0) goto <D.24061>; else goto <D.24062>;
                  <D.24061>:
                  jit_tls->handler_block_return_address = 0B;
                  jit_tls->handler_block = 0B;
                  mono_thread_resume_interruption ();
                  <D.24062>:
                }
                <D.24041>:
                D.24063 = mono_trace_is_enabled ();
                if (D.24063 != 0) goto <D.24064>; else goto <D.24065>;
                <D.24064>:
                D.24066 = mono_trace_eval (method);
                if (D.24066 != 0) goto <D.24067>; else goto <D.24068>;
                <D.24067>:
                D.24069 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: catch found at clause %d of %s\n", i, D.24069);
                <D.24068>:
                <D.24065>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24014 = ei->flags;
                D.24070 = (int) D.24014;
                mono_profiler_exception_clause_handler (method, D.24070, i);
                jit_tls->orig_ex_ctx_set = 0;
                D.24057 = ei->handler_start;
                D.24071 = (int) D.24057;
                ctx->sc_pc = D.24071;
                D.24072 = mono_get_lmf_addr ();
                lmf.70 = lmf;
                *D.24072 = lmf.70;
                mono_perfcounters.72 = mono_perfcounters;
                mono_perfcounters.72 = mono_perfcounters;
                D.24074 = mono_perfcounters.72->exceptions_depth;
                frame_count.73 = (unsigned int) frame_count;
                D.24076 = D.24074 + frame_count.73;
                mono_perfcounters.72->exceptions_depth = D.24076;
                D.23699 = domain->stack_overflow_ex;
                if (D.23699 == obj) goto <D.24077>; else goto <D.24078>;
                <D.24077>:
                jit_tls->handling_stack_ovf = 0;
                <D.24078>:
                D.24079 = 0;
                return D.24079;
                <D.24033>:
                ji.64 = ji;
                D.24004 = ctx->sc_pc;
                D.24005 = (void *) D.24004;
                D.24080 = is_address_protected (ji.64, ei, D.24005);
                if (D.24080 != 0) goto <D.24081>; else goto <D.24082>;
                <D.24081>:
                D.24014 = ei->flags;
                if (D.24014 == 4) goto <D.24083>; else goto <D.24084>;
                <D.24083>:
                D.24085 = mono_trace_is_enabled ();
                if (D.24085 != 0) goto <D.24086>; else goto <D.24087>;
                <D.24086>:
                D.24088 = mono_trace_eval (method);
                if (D.24088 != 0) goto <D.24089>; else goto <D.24090>;
                <D.24089>:
                D.24091 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: fault clause %d of %s\n", i, D.24091);
                <D.24090>:
                <D.24087>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24014 = ei->flags;
                D.24070 = (int) D.24014;
                mono_profiler_exception_clause_handler (method, D.24070, i);
                jit_tls->orig_ex_ctx_set = 0;
                call_filter.57 = call_filter;
                D.24057 = ei->handler_start;
                call_filter.57 (ctx, D.24057);
                <D.24084>:
                <D.24082>:
                ji.64 = ji;
                D.24004 = ctx->sc_pc;
                D.24005 = (void *) D.24004;
                D.24092 = is_address_protected (ji.64, ei, D.24005);
                if (D.24092 != 0) goto <D.24093>; else goto <D.24094>;
                <D.24093>:
                D.24014 = ei->flags;
                if (D.24014 == 2) goto <D.24095>; else goto <D.24096>;
                <D.24095>:
                D.24097 = mono_trace_is_enabled ();
                if (D.24097 != 0) goto <D.24098>; else goto <D.24099>;
                <D.24098>:
                D.24100 = mono_trace_eval (method);
                if (D.24100 != 0) goto <D.24101>; else goto <D.24102>;
                <D.24101>:
                D.24103 = mono_method_full_name (method, 1);
                monoeg_g_print ("EXCEPTION: finally clause %d of %s\n", i, D.24103);
                <D.24102>:
                <D.24099>:
                jit_tls->orig_ex_ctx_set = 1;
                D.24014 = ei->flags;
                D.24070 = (int) D.24014;
                mono_profiler_exception_clause_handler (method, D.24070, i);
                jit_tls->orig_ex_ctx_set = 0;
                mono_perfcounters.72 = mono_perfcounters;
                D.24104 = mono_perfcounters.72->exceptions_finallys;
                D.24105 = D.24104 + 1;
                mono_perfcounters.72->exceptions_finallys = D.24105;
                D.24106 = mono_get_lmf_addr ();
                lmf.70 = lmf;
                *D.24106 = lmf.70;
                ji.64 = ji;
                D.24017 = BIT_FIELD_REF <*ji.64, 32, 160>;
                D.24018 = D.24017 & 2097152;
                if (D.24018 != 0) goto <D.24107>; else goto <D.24108>;
                <D.24107>:
                jit_tls->resume_state.ex_obj = obj;
                ji.64 = ji;
                jit_tls->resume_state.ji = ji.64;
                D.24109 = i + 1;
                jit_tls->resume_state.clause_index = D.24109;
                jit_tls->resume_state.ctx = *ctx;
                jit_tls->resume_state.new_ctx = new_ctx;
                lmf.70 = lmf;
                jit_tls->resume_state.lmf = lmf.70;
                first_filter_idx.71 = first_filter_idx;
                jit_tls->resume_state.first_filter_idx = first_filter_idx.71;
                jit_tls->resume_state.filter_idx = filter_idx;
                D.24057 = ei->handler_start;
                D.24071 = (int) D.24057;
                ctx->sc_pc = D.24071;
                D.24079 = 0;
                return D.24079;
                <D.24108>:
                call_filter.57 = call_filter;
                D.24057 = ei->handler_start;
                call_filter.57 (ctx, D.24057);
                <D.24096>:
                <D.24094>:
              }
              <D.24008>:
            }
            <D.22658>:
            i = i + 1;
            <D.22664>:
            ji.64 = ji;
            D.24110 = ji.64->num_clauses;
            D.24111 = (int) D.24110;
            if (D.24111 > i) goto <D.22663>; else goto <D.22665>;
            <D.22665>:
            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.22655>:
      goto <D.22666>;
      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.24121;

  if (str != 0B) goto <D.24119>; else goto <D.24120>;
  <D.24119>:
  D.24121 = __strdup (str);
  return D.24121;
  <D.24120>:
  D.24121 = 0B;
  return D.24121;
}


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.74;
  struct MonoLMF * lmf.75;
  _Bool D.24125;
  long int D.24126;
  long int D.24127;
  struct MonoException * D.24130;
  struct MonoClass * D.24133;
  struct MonoObject * D.24134;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.76;
  void * D.24141;
  int (*<T3c4c>) (struct MonoContext *, void *) call_filter.77;
  void * D.24143;
  _Bool D.24144;
  long int D.24145;
  long int D.24146;
  void (*<T3189>) (struct MonoObject *) D.24149;
  _Bool D.24150;
  long int D.24151;
  long int D.24152;
  <unnamed type> D.24165;
  unsigned int D.24166;
  _Bool D.24169;
  long int D.24170;
  long int D.24171;
  struct MonoArray * * D.24180;
  struct MonoClass * D.24181;
  struct MonoArray * D.24182;
  struct MonoArray * * D.24183;
  struct MonoArray * D.24184;
  struct MonoString * * D.24187;
  struct MonoString * D.24188;
  gboolean D.24189;
  struct MonoDebugOptions * D.24190;
  int D.24191;
  unsigned int D.24194;
  unsigned int D.24195;
  char * D.24198;
  int D.24207;
  void * D.24208;
  void * D.24209;
  unsigned int D.24210;
  int D.24217;
  int D.24218;
  int D.24219;
  int D.24221;
  int D.24225;
  int D.24231;
  unsigned int D.24233;
  int iftmp.78;
  struct MonoPerfCounters * mono_perfcounters.79;
  unsigned int D.24242;
  unsigned int D.24243;
  struct MonoArray * D.24250;
  struct MonoArray * D.24251;
  struct MonoString * D.24254;
  unsigned int D.24255;
  unsigned int D.24256;
  int D.24259;
  sizetype D.24260;
  int D.24261;
  sizetype D.24262;
  sizetype D.24263;
  void * * D.24264;
  void * D.24265;
  struct MonoArray * D.24280;
  struct MonoArray * D.24281;
  struct MonoString * D.24284;
  void * D.24285;
  int D.24286;
  struct MonoObject * D.24289;
  struct MonoArray * D.24296;
  struct MonoArray * D.24297;
  struct MonoString * D.24300;
  <unnamed-unsigned:15> D.24303;
  int D.24304;
  struct MonoDomain * domain;
  struct MonoJitInfo * ji;
  static int (*<T3c4c>) (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.74 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.74);
      lmf.75 = mono_get_lmf ();
      lmf = lmf.75;
      initial_trace_ips = 0B;
      trace_ips = 0B;
      stack_overflow = 0;
      frame_count = 0;
      has_dynamic_methods = 0;
      D.24125 = ctx == 0B;
      D.24126 = (long int) D.24125;
      D.24127 = __builtin_expect (D.24126, 0);
      if (D.24127 != 0) goto <D.24128>; else goto <D.24129>;
      <D.24128>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1316, "ctx != NULL");
      <D.24129>:
      D.24130 = domain->stack_overflow_ex;
      if (D.24130 == obj) goto <D.24131>; else goto <D.24132>;
      <D.24131>:
      stack_overflow = 1;
      <D.24132>:
      mono_ex = obj;
      initial_trace_ips = mono_ex->trace_ips;
      D.24133 = mono_defaults.exception_class;
      D.24134 = mono_object_isinst (obj, D.24133);
      if (D.24134 != 0B) goto <D.24135>; else goto <D.24136>;
      <D.24135>:
      mono_ex = obj;
      initial_trace_ips = mono_ex->trace_ips;
      goto <D.24137>;
      <D.24136>:
      mono_ex = 0B;
      <D.24137>:
      call_filter.76 = call_filter;
      if (call_filter.76 == 0B) goto <D.24139>; else goto <D.24140>;
      <D.24139>:
      D.24141 = mono_get_call_filter ();
      call_filter.77 = (int (*<T3c4c>) (struct MonoContext *, void *)) D.24141;
      call_filter = call_filter.77;
      <D.24140>:
      D.24143 = jit_tls->end_of_stack;
      D.24144 = D.24143 == 0B;
      D.24145 = (long int) D.24144;
      D.24146 = __builtin_expect (D.24145, 0);
      if (D.24146 != 0) goto <D.24147>; else goto <D.24148>;
      <D.24147>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1334, "jit_tls->end_of_stack");
      <D.24148>:
      D.24149 = jit_tls->abort_func;
      D.24150 = D.24149 == 0B;
      D.24151 = (long int) D.24150;
      D.24152 = __builtin_expect (D.24151, 0);
      if (D.24152 != 0) goto <D.24153>; else goto <D.24154>;
      <D.24153>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1335, "jit_tls->abort_func");
      <D.24154>:
      if (out_filter_idx != 0B) goto <D.24155>; else goto <D.24156>;
      <D.24155>:
      *out_filter_idx = -1;
      <D.24156>:
      if (out_ji != 0B) goto <D.24157>; else goto <D.24158>;
      <D.24157>:
      *out_ji = 0B;
      <D.24158>:
      if (out_prev_ji != 0B) goto <D.24159>; else goto <D.24160>;
      <D.24159>:
      *out_prev_ji = 0B;
      <D.24160>:
      filter_idx = 0;
      initial_ctx = *ctx;
      <D.22571>:
      {
        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.24161>; else goto <D.24162>;
            <D.24161>:
            *out_prev_ji = ji;
            <D.24162>:
            unwind_res = mono_find_jit_info_ext (domain, jit_tls, 0B, ctx, &new_ctx, 0B, &lmf, 0B, &frame);
            if (unwind_res != 0) goto <D.24163>; else goto <D.24164>;
            <D.24163>:
            D.24165 = frame.type;
            D.24166 = D.24165 + 4294967295;
            if (D.24166 <= 1) goto <D.24167>; else goto <D.24168>;
            <D.24167>:
            *ctx = new_ctx;
            // predicted unlikely by continue predictor.
            goto <D.22561>;
            <D.24168>:
            D.24165 = frame.type;
            D.24169 = D.24165 != 0;
            D.24170 = (long int) D.24169;
            D.24171 = __builtin_expect (D.24170, 0);
            if (D.24171 != 0) goto <D.24172>; else goto <D.24173>;
            <D.24172>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1363, "frame.type == FRAME_TYPE_MANAGED");
            <D.24173>:
            ji = frame.ji;
            <D.24164>:
            if (unwind_res == 0) goto <D.24174>; else goto <D.24175>;
            <D.24174>:
            if (mono_ex != 0B) goto <D.24176>; else goto <D.24177>;
            <D.24176>:
            if (initial_trace_ips == 0B) goto <D.24178>; else goto <D.24179>;
            <D.24178>:
            trace_ips = monoeg_g_list_reverse (trace_ips);
            D.24180 = &mono_ex->trace_ips;
            D.24181 = mono_defaults.int_class;
            D.24182 = glist_to_array (trace_ips, D.24181);
            mono_gc_wbarrier_set_field (mono_ex, D.24180, D.24182);
            D.24183 = &mono_ex->native_trace_ips;
            D.24184 = build_native_trace ();
            mono_gc_wbarrier_set_field (mono_ex, D.24183, D.24184);
            if (has_dynamic_methods != 0) goto <D.24185>; else goto <D.24186>;
            <D.24185>:
            D.24187 = &mono_ex->stack_trace;
            D.24188 = ves_icall_System_Exception_get_trace (mono_ex);
            mono_gc_wbarrier_set_field (mono_ex, D.24187, D.24188);
            <D.24186>:
            <D.24179>:
            <D.24177>:
            monoeg_g_list_free (trace_ips);
            trace_ips = 0B;
            D.24189 = 0;
            return D.24189;
            <D.24175>:
            frame_count = frame_count + 1;
            method = jinfo_get_method (ji);
            D.24190 = mini_get_debug_options ();
            D.24191 = D.24190->reverse_pinvoke_exceptions;
            if (D.24191 != 0) goto <D.24192>; else goto <D.24193>;
            <D.24192>:
            D.24194 = BIT_FIELD_REF <*method, 32, 160>;
            D.24195 = D.24194 & 124;
            if (D.24195 == 20) goto <D.24196>; else goto <D.24197>;
            <D.24196>:
            D.24198 = 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.24198);
            <D.22562>:
            goto <D.22562>;
            <D.24197>:
            <D.24193>:
            D.24194 = BIT_FIELD_REF <*method, 32, 160>;
            D.24195 = D.24194 & 124;
            if (D.24195 != 16) goto <D.24199>; else goto <D.24200>;
            <D.24199>:
            if (mono_ex != 0B) goto <D.24201>; else goto <D.24202>;
            <D.24201>:
            if (initial_trace_ips == 0B) goto <D.24203>; else goto <D.24204>;
            <D.24203>:
            if (frame_count <= 999) goto <D.24205>; else goto <D.24206>;
            <D.24205>:
            D.24207 = ctx->sc_pc;
            D.24208 = (void *) D.24207;
            trace_ips = monoeg_g_list_prepend (trace_ips, D.24208);
            D.24209 = get_generic_info_from_stack_frame (ji, ctx);
            trace_ips = monoeg_g_list_prepend (trace_ips, D.24209);
            <D.24206>:
            <D.24204>:
            <D.24202>:
            <D.24200>:
            D.24194 = BIT_FIELD_REF <*method, 32, 160>;
            D.24210 = D.24194 & 512;
            if (D.24210 != 0) goto <D.24211>; else goto <D.24212>;
            <D.24211>:
            has_dynamic_methods = 1;
            <D.24212>:
            if (stack_overflow != 0) goto <D.24213>; else goto <D.24214>;
            <D.24213>:
            if (1 != 0) goto <D.24215>; else goto <D.24216>;
            <D.24215>:
            D.24217 = ctx->sc_regs[29];
            D.24218 = initial_ctx.sc_regs[29];
            D.24219 = D.24217 - D.24218;
            free_stack = (guint32) D.24219;
            goto <D.24220>;
            <D.24216>:
            D.24218 = initial_ctx.sc_regs[29];
            D.24217 = ctx->sc_regs[29];
            D.24221 = D.24218 - D.24217;
            free_stack = (guint32) D.24221;
            <D.24220>:
            goto <D.24222>;
            <D.24214>:
            free_stack = 16777215;
            <D.24222>:
            i = clause_index_start;
            goto <D.22569>;
            <D.22568>:
            {
              struct MonoJitExceptionInfo * ei;
              gboolean filtered;

              ei = &ji->clauses[i];
              filtered = 0;
              if (free_stack <= 65536) goto <D.24223>; else goto <D.24224>;
              <D.24223>:
              // predicted unlikely by continue predictor.
              goto <D.22565>;
              <D.24224>:
              D.24207 = ctx->sc_pc;
              D.24208 = (void *) D.24207;
              D.24225 = is_address_protected (ji, ei, D.24208);
              if (D.24225 != 0) goto <D.24226>; else goto <D.24227>;
              <D.24226>:
              {
                struct MonoClass * catch_class;

                catch_class = get_exception_catch_class (ei, ji, ctx);
                if (non_exception != 0B) goto <D.24230>; else goto <D.24228>;
                <D.24230>:
                D.24231 = wrap_non_exception_throws (method);
                if (D.24231 == 0) goto <D.24232>; else goto <D.24228>;
                <D.24232>:
                ex_obj = non_exception;
                goto <D.24229>;
                <D.24228>:
                ex_obj = obj;
                <D.24229>:
                D.24233 = ei->flags;
                if (D.24233 == 1) goto <D.24234>; else goto <D.24235>;
                <D.24234>:
                {
                  gboolean is_user_frame;

                  D.24194 = BIT_FIELD_REF <*method, 32, 160>;
                  D.24195 = D.24194 & 124;
                  if (D.24195 == 0) goto <D.24237>; else goto <D.24240>;
                  <D.24240>:
                  D.24194 = BIT_FIELD_REF <*method, 32, 160>;
                  D.24195 = D.24194 & 124;
                  if (D.24195 == 68) goto <D.24237>; else goto <D.24238>;
                  <D.24237>:
                  iftmp.78 = 1;
                  goto <D.24239>;
                  <D.24238>:
                  iftmp.78 = 0;
                  <D.24239>:
                  is_user_frame = iftmp.78;
                  mono_perfcounters.79 = mono_perfcounters;
                  D.24242 = mono_perfcounters.79->exceptions_filters;
                  D.24243 = D.24242 + 1;
                  mono_perfcounters.79->exceptions_filters = D.24243;
                  if (is_user_frame != 0) goto <D.24244>; else goto <D.24245>;
                  <D.24244>:
                  if (mono_ex != 0B) goto <D.24246>; else goto <D.24247>;
                  <D.24246>:
                  if (initial_trace_ips == 0B) goto <D.24248>; else goto <D.24249>;
                  <D.24248>:
                  trace_ips = monoeg_g_list_reverse (trace_ips);
                  D.24180 = &mono_ex->trace_ips;
                  D.24181 = mono_defaults.int_class;
                  D.24250 = glist_to_array (trace_ips, D.24181);
                  mono_gc_wbarrier_set_field (mono_ex, D.24180, D.24250);
                  D.24183 = &mono_ex->native_trace_ips;
                  D.24251 = build_native_trace ();
                  mono_gc_wbarrier_set_field (mono_ex, D.24183, D.24251);
                  if (has_dynamic_methods != 0) goto <D.24252>; else goto <D.24253>;
                  <D.24252>:
                  D.24187 = &mono_ex->stack_trace;
                  D.24254 = ves_icall_System_Exception_get_trace (mono_ex);
                  mono_gc_wbarrier_set_field (mono_ex, D.24187, D.24254);
                  <D.24253>:
                  <D.24249>:
                  <D.24247>:
                  monoeg_g_list_free (trace_ips);
                  trace_ips = 0B;
                  <D.24245>:
                  D.24255 = BIT_FIELD_REF <*ji, 32, 160>;
                  D.24256 = D.24255 & 2097152;
                  if (D.24256 != 0) goto <D.24257>; else goto <D.24258>;
                  <D.24257>:
                  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 1449);
                  <D.24258>:
                  D.24259 = ei->exvar_offset;
                  D.24260 = (sizetype) D.24259;
                  D.24261 = ctx->sc_regs[30];
                  D.24262 = (sizetype) D.24261;
                  D.24263 = D.24260 + D.24262;
                  D.24264 = (void * *) D.24263;
                  *D.24264 = ex_obj;
                  mono_debugger_agent_begin_exception_filter (mono_ex, ctx, &initial_ctx);
                  call_filter.76 = call_filter;
                  D.24265 = ei->data.filter;
                  filtered = call_filter.76 (ctx, D.24265);
                  mono_debugger_agent_end_exception_filter (mono_ex, ctx, &initial_ctx);
                  if (filtered != 0) goto <D.24266>; else goto <D.24267>;
                  <D.24266>:
                  if (out_filter_idx != 0B) goto <D.24268>; else goto <D.24269>;
                  <D.24268>:
                  *out_filter_idx = filter_idx;
                  <D.24269>:
                  <D.24267>:
                  if (out_ji != 0B) goto <D.24270>; else goto <D.24271>;
                  <D.24270>:
                  *out_ji = ji;
                  <D.24271>:
                  filter_idx = filter_idx + 1;
                  if (filtered != 0) goto <D.24272>; else goto <D.24273>;
                  <D.24272>:
                  if (is_user_frame == 0) goto <D.24274>; else goto <D.24275>;
                  <D.24274>:
                  if (mono_ex != 0B) goto <D.24276>; else goto <D.24277>;
                  <D.24276>:
                  if (initial_trace_ips == 0B) goto <D.24278>; else goto <D.24279>;
                  <D.24278>:
                  trace_ips = monoeg_g_list_reverse (trace_ips);
                  D.24180 = &mono_ex->trace_ips;
                  D.24181 = mono_defaults.int_class;
                  D.24280 = glist_to_array (trace_ips, D.24181);
                  mono_gc_wbarrier_set_field (mono_ex, D.24180, D.24280);
                  D.24183 = &mono_ex->native_trace_ips;
                  D.24281 = build_native_trace ();
                  mono_gc_wbarrier_set_field (mono_ex, D.24183, D.24281);
                  if (has_dynamic_methods != 0) goto <D.24282>; else goto <D.24283>;
                  <D.24282>:
                  D.24187 = &mono_ex->stack_trace;
                  D.24284 = ves_icall_System_Exception_get_trace (mono_ex);
                  mono_gc_wbarrier_set_field (mono_ex, D.24187, D.24284);
                  <D.24283>:
                  <D.24279>:
                  <D.24277>:
                  monoeg_g_list_free (trace_ips);
                  trace_ips = 0B;
                  <D.24275>:
                  D.24285 = ei->handler_start;
                  D.24286 = (int) D.24285;
                  ctx->sc_pc = D.24286;
                  D.24189 = 1;
                  return D.24189;
                  <D.24273>:
                }
                <D.24235>:
                D.24233 = ei->flags;
                if (D.24233 == 0) goto <D.24287>; else goto <D.24288>;
                <D.24287>:
                D.24289 = mono_object_isinst (ex_obj, catch_class);
                if (D.24289 != 0B) goto <D.24290>; else goto <D.24291>;
                <D.24290>:
                if (mono_ex != 0B) goto <D.24292>; else goto <D.24293>;
                <D.24292>:
                if (initial_trace_ips == 0B) goto <D.24294>; else goto <D.24295>;
                <D.24294>:
                trace_ips = monoeg_g_list_reverse (trace_ips);
                D.24180 = &mono_ex->trace_ips;
                D.24181 = mono_defaults.int_class;
                D.24296 = glist_to_array (trace_ips, D.24181);
                mono_gc_wbarrier_set_field (mono_ex, D.24180, D.24296);
                D.24183 = &mono_ex->native_trace_ips;
                D.24297 = build_native_trace ();
                mono_gc_wbarrier_set_field (mono_ex, D.24183, D.24297);
                if (has_dynamic_methods != 0) goto <D.24298>; else goto <D.24299>;
                <D.24298>:
                D.24187 = &mono_ex->stack_trace;
                D.24300 = ves_icall_System_Exception_get_trace (mono_ex);
                mono_gc_wbarrier_set_field (mono_ex, D.24187, D.24300);
                <D.24299>:
                <D.24295>:
                <D.24293>:
                monoeg_g_list_free (trace_ips);
                trace_ips = 0B;
                if (out_ji != 0B) goto <D.24301>; else goto <D.24302>;
                <D.24301>:
                *out_ji = ji;
                <D.24302>:
                D.24285 = ei->handler_start;
                D.24286 = (int) D.24285;
                ctx->sc_pc = D.24286;
                D.24189 = 1;
                return D.24189;
                <D.24291>:
                <D.24288>:
              }
              <D.24227>:
            }
            <D.22565>:
            i = i + 1;
            <D.22569>:
            D.24303 = ji->num_clauses;
            D.24304 = (int) D.24303;
            if (D.24304 > i) goto <D.22568>; else goto <D.22570>;
            <D.22570>:
            *ctx = new_ctx;
          }
        finally
          {
            new_ctx = {CLOBBER};
            frame = {CLOBBER};
          }
      }
      <D.22561>:
      goto <D.22571>;
      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.24312;
  unsigned int D.24313;
  unsigned int len.80;
  unsigned int i.81;
  void * D.24316;
  struct MonoDomain * domain;
  struct MonoArray * res;
  int len;
  int i;

  domain = mono_domain_get ();
  if (list == 0B) goto <D.24310>; else goto <D.24311>;
  <D.24310>:
  D.24312 = 0B;
  return D.24312;
  <D.24311>:
  D.24313 = monoeg_g_list_length (list);
  len = (int) D.24313;
  len.80 = (unsigned int) len;
  res = mono_array_new (domain, eclass, len.80);
  i = 0;
  goto <D.22471>;
  <D.22470>:
  {
    void * * __p;

    i.81 = (unsigned int) i;
    __p = mono_array_addr_with_size (res, 4, i.81);
    D.24316 = list->data;
    *__p = D.24316;
  }
  list = list->next;
  i = i + 1;
  <D.22471>:
  if (list != 0B) goto <D.22470>; else goto <D.22472>;
  <D.22472>:
  D.24312 = res;
  return D.24312;
}


build_native_trace ()
{
  struct MonoArray * D.24318;

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


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

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


get_exception_catch_class (struct MonoJitExceptionInfo * ei, struct MonoJitInfo * ji, struct MonoContext * ctx)
{
  unsigned int D.24325;
  struct MonoClass * D.24326;
  unsigned int D.24329;
  unsigned int D.24330;
  struct MonoGenericJitInfo * D.24332;
  unsigned int D.24333;
  unsigned int D.24334;
  void * D.24335;
  struct MonoType * D.24336;
  struct MonoClass * catch_class;
  struct MonoType * inflated_type;
  struct MonoGenericContext context;

  try
    {
      catch_class = ei->data.catch_class;
      if (catch_class == 0B) goto <D.24322>; else goto <D.24324>;
      <D.24324>:
      D.24325 = ei->flags;
      if (D.24325 != 0) goto <D.24322>; else goto <D.24323>;
      <D.24322>:
      D.24326 = 0B;
      return D.24326;
      <D.24323>:
      D.24329 = BIT_FIELD_REF <*ji, 32, 160>;
      D.24330 = D.24329 & 131072;
      if (D.24330 == 0) goto <D.24327>; else goto <D.24331>;
      <D.24331>:
      D.24332 = mono_jit_info_get_generic_jit_info (ji);
      D.24333 = BIT_FIELD_REF <*D.24332, 32, 128>;
      D.24334 = D.24333 & 256;
      if (D.24334 == 0) goto <D.24327>; else goto <D.24328>;
      <D.24327>:
      D.24326 = catch_class;
      return D.24326;
      <D.24328>:
      D.24335 = get_generic_info_from_stack_frame (ji, ctx);
      context = get_generic_context_from_stack_frame (ji, D.24335);
      D.24336 = &catch_class->byval_arg;
      inflated_type = mono_class_inflate_generic_type (D.24336, &context);
      catch_class = mono_class_from_mono_type (inflated_type);
      mono_metadata_free_type (inflated_type);
      D.24326 = catch_class;
      return D.24326;
    }
  finally
    {
      context = {CLOBBER};
    }
}


wrap_non_exception_throws (struct MonoMethod * m)
{
  struct MonoClass * D.24339;
  struct MonoImage * D.24340;
  _Bool D.24341;
  long int D.24342;
  long int D.24343;
  unsigned char D.24346;
  gboolean D.24349;
  unsigned char D.24350;
  struct MonoClass * klass.84;
  struct MonoClass * tmp_klass.82;
  struct MonoImage * D.24356;
  struct MonoClass * tmp_klass.83;
  _Bool D.24358;
  long int D.24359;
  long int D.24360;
  struct MonoMethod * D.24367;
  struct MonoClass * D.24369;
  struct MonoClass * klass.85;
  unsigned int D.24371;
  const mono_byte * p.86;
  const gchar * p.87;
  short unsigned int D.24374;
  _Bool D.24375;
  long int D.24376;
  long int D.24377;
  const gchar * p.88;
  short unsigned int D.24381;
  char D.24384;
  const gchar * p.89;
  unsigned int D.24388;
  int D.24389;
  unsigned int D.24390;
  unsigned int name_len.90;
  sizetype name_len.91;
  char * D.24393;
  const gchar * p.92;
  int D.22523;
  int iftmp.93;
  int D.22522;
  const char[23] * D.24398;
  unsigned char D.24399;
  int D.24400;
  unsigned char D.24401;
  int D.24402;
  const unsigned char * D.24407;
  unsigned char D.24408;
  int D.24409;
  const unsigned char * D.24410;
  unsigned char D.24411;
  int D.24412;
  const unsigned char * D.24417;
  unsigned char D.24418;
  int D.24419;
  const unsigned char * D.24420;
  unsigned char D.24421;
  int D.24422;
  const unsigned char * D.24427;
  unsigned char D.24428;
  int D.24429;
  const unsigned char * D.24430;
  unsigned char D.24431;
  int D.24432;
  _Bool D.24434;
  long int D.24435;
  long int D.24436;
  int D.24439;
  unsigned char D.24440;
  struct MonoAssembly * ass;
  struct MonoCustomAttrInfo * attrs;
  static struct MonoClass * klass;
  int i;
  gboolean val;

  D.24339 = m->klass;
  D.24340 = D.24339->image;
  ass = D.24340->assembly;
  val = 0;
  D.24341 = ass == 0B;
  D.24342 = (long int) D.24341;
  D.24343 = __builtin_expect (D.24342, 0);
  if (D.24343 != 0) goto <D.24344>; else goto <D.24345>;
  <D.24344>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1196, "ass");
  <D.24345>:
  D.24346 = ass->wrap_non_exception_throws_inited;
  if (D.24346 != 0) goto <D.24347>; else goto <D.24348>;
  <D.24347>:
  D.24350 = ass->wrap_non_exception_throws;
  D.24349 = (gboolean) D.24350;
  return D.24349;
  <D.24348>:
  {
    static struct MonoClass * tmp_klass;

    {
      tmp_klass.82 = tmp_klass;
      if (tmp_klass.82 == 0B) goto <D.24352>; else goto <D.24353>;
      <D.24352>:
      if (0 != 0) goto <D.24354>; else goto <D.24355>;
      <D.24354>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1200, "mono_defaults.corlib == mono_defaults.corlib");
      <D.24355>:
      D.24356 = mono_defaults.corlib;
      tmp_klass.83 = mono_class_from_name (D.24356, "System.Runtime.CompilerServices", "RuntimeCompatibilityAttribute");
      tmp_klass = tmp_klass.83;
      tmp_klass.82 = tmp_klass;
      D.24358 = tmp_klass.82 == 0B;
      D.24359 = (long int) D.24358;
      D.24360 = __builtin_expect (D.24359, 0);
      if (D.24360 != 0) goto <D.24361>; else goto <D.24362>;
      <D.24361>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1200, "tmp_klass");
      <D.24362>:
      <D.24353>:
    }
    klass.84 = tmp_klass;
  }
  klass = klass.84;
  attrs = mono_custom_attrs_from_assembly (ass);
  if (attrs != 0B) goto <D.24363>; else goto <D.24364>;
  <D.24363>:
  i = 0;
  goto <D.22525>;
  <D.22524>:
  {
    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.24367 = attr->ctor;
        if (D.24367 == 0B) goto <D.24365>; else goto <D.24368>;
        <D.24368>:
        D.24367 = attr->ctor;
        D.24369 = D.24367->klass;
        klass.85 = klass;
        if (D.24369 != klass.85) goto <D.24365>; else goto <D.24366>;
        <D.24365>:
        // predicted unlikely by continue predictor.
        goto <D.22514>;
        <D.24366>:
        D.24371 = attr->data_size;
        len = (int) D.24371;
        p.86 = attr->data;
        p = p.86;
        p.87 = p;
        D.24374 = mono_read16 (p.87);
        D.24375 = D.24374 != 1;
        D.24376 = (long int) D.24375;
        D.24377 = __builtin_expect (D.24376, 0);
        if (D.24377 != 0) goto <D.24378>; else goto <D.24379>;
        <D.24378>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1215, "read16 (p) == 0x0001");
        <D.24379>:
        p.87 = p;
        p.88 = p.87 + 2;
        p = p.88;
        p.87 = p;
        D.24381 = mono_read16 (p.87);
        num_named = (int) D.24381;
        if (num_named != 1) goto <D.24382>; else goto <D.24383>;
        <D.24382>:
        // predicted unlikely by continue predictor.
        goto <D.22514>;
        <D.24383>:
        p.87 = p;
        p.88 = p.87 + 2;
        p = p.88;
        p.87 = p;
        D.24384 = *p.87;
        named_type = (int) D.24384;
        p.87 = p;
        p.89 = p.87 + 1;
        p = p.89;
        p.87 = p;
        D.24384 = *p.87;
        data_type = (int) D.24384;
        p.87 = p;
        p.89 = p.87 + 1;
        p = p.89;
        if (named_type != 84) goto <D.24386>; else goto <D.24387>;
        <D.24386>:
        // predicted unlikely by continue predictor.
        goto <D.22514>;
        <D.24387>:
        p.87 = p;
        D.24388 = mono_metadata_decode_blob_size (p.87, &p);
        name_len = (int) D.24388;
        D.24389 = name_len + 1;
        D.24390 = (unsigned int) D.24389;
        name = monoeg_malloc (D.24390);
        p.87 = p;
        name_len.90 = (unsigned int) name_len;
        memcpy (name, p.87, name_len.90);
        name_len.91 = (sizetype) name_len;
        D.24393 = name + name_len.91;
        *D.24393 = 0;
        p.87 = p;
        name_len.91 = (sizetype) name_len;
        p.92 = p.87 + name_len.91;
        p = p.92;
        {
          size_t __s1_len;
          size_t __s2_len;

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

            __s2 = name;
            D.24398 = "WrapNonExceptionThrows";
            D.24399 = MEM[(const unsigned char *)D.24398];
            D.24400 = (int) D.24399;
            D.24401 = *__s2;
            D.24402 = (int) D.24401;
            __result = D.24400 - D.24402;
            {
              if (__s2_len != 0) goto <D.24403>; else goto <D.24404>;
              <D.24403>:
              if (__result == 0) goto <D.24405>; else goto <D.24406>;
              <D.24405>:
              D.24407 = &MEM[(void *)"WrapNonExceptionThrows" + 1B];
              D.24408 = *D.24407;
              D.24409 = (int) D.24408;
              D.24410 = __s2 + 1;
              D.24411 = *D.24410;
              D.24412 = (int) D.24411;
              __result = D.24409 - D.24412;
              if (__s2_len > 1) goto <D.24413>; else goto <D.24414>;
              <D.24413>:
              if (__result == 0) goto <D.24415>; else goto <D.24416>;
              <D.24415>:
              D.24417 = &MEM[(void *)"WrapNonExceptionThrows" + 2B];
              D.24418 = *D.24417;
              D.24419 = (int) D.24418;
              D.24420 = __s2 + 2;
              D.24421 = *D.24420;
              D.24422 = (int) D.24421;
              __result = D.24419 - D.24422;
              if (__s2_len > 2) goto <D.24423>; else goto <D.24424>;
              <D.24423>:
              if (__result == 0) goto <D.24425>; else goto <D.24426>;
              <D.24425>:
              D.24427 = &MEM[(void *)"WrapNonExceptionThrows" + 3B];
              D.24428 = *D.24427;
              D.24429 = (int) D.24428;
              D.24430 = __s2 + 3;
              D.24431 = *D.24430;
              D.24432 = (int) D.24431;
              __result = D.24429 - D.24432;
              <D.24426>:
              <D.24424>:
              <D.24416>:
              <D.24414>:
              <D.24406>:
              <D.24404>:
            }
            D.22522 = __result;
          }
          iftmp.93 = -D.22522;
          goto <D.24433>;
          <D.24397>:
          iftmp.93 = __builtin_strcmp (name, "WrapNonExceptionThrows");
          <D.24433>:
          D.22523 = iftmp.93;
        }
        D.24434 = D.22523 != 0;
        D.24435 = (long int) D.24434;
        D.24436 = __builtin_expect (D.24435, 0);
        if (D.24436 != 0) goto <D.24437>; else goto <D.24438>;
        <D.24437>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 1233, "!strcmp (name, \"WrapNonExceptionThrows\")");
        <D.24438>:
        monoeg_g_free (name);
        p.87 = p;
        D.24384 = *p.87;
        val = (gboolean) D.24384;
      }
    finally
      {
        p = {CLOBBER};
      }
  }
  <D.22514>:
  i = i + 1;
  <D.22525>:
  D.24439 = attrs->num_attrs;
  if (D.24439 > i) goto <D.22524>; else goto <D.22526>;
  <D.22526>:
  mono_custom_attrs_free (attrs);
  <D.24364>:
  D.24440 = (unsigned char) val;
  ass->wrap_non_exception_throws = D.24440;
  mono_memory_barrier ();
  ass->wrap_non_exception_throws_inited = 1;
  D.24349 = val;
  return D.24349;
}


mono_setup_altstack (struct MonoJitTlsData * tls)
{

}


mono_free_altstack (struct MonoJitTlsData * tls)
{

}


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

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


mono_handle_soft_stack_ovf (struct MonoJitTlsData * jit_tls, struct MonoJitInfo * ji, void * ctx, guint8 * fault_addr)
{
  unsigned int D.24446;
  void * D.24449;
  guint8 * D.24452;
  int D.24455;
  unsigned int D.24456;
  int D.24457;
  unsigned int D.24458;
  guint8 * D.24460;
  sizetype D.24461;
  void * D.24462;
  struct _IO_FILE * stderr.94;
  void * D.24466;
  unsigned int D.24467;
  void * restore_stack_protection_tramp.95;
  gboolean D.24472;

  D.24446 = jit_tls->stack_ovf_guard_size;
  if (D.24446 != 0) goto <D.24447>; else goto <D.24448>;
  <D.24447>:
  D.24449 = jit_tls->stack_ovf_guard_base;
  if (D.24449 <= fault_addr) goto <D.24450>; else goto <D.24451>;
  <D.24450>:
  D.24449 = jit_tls->stack_ovf_guard_base;
  D.24446 = jit_tls->stack_ovf_guard_size;
  D.24452 = D.24449 + D.24446;
  if (D.24452 > fault_addr) goto <D.24453>; else goto <D.24454>;
  <D.24453>:
  {
    guint32 guard_size;
    gboolean handled;

    handled = 0;
    D.24446 = jit_tls->stack_ovf_guard_size;
    D.24455 = mono_pagesize ();
    D.24456 = (unsigned int) D.24455;
    guard_size = D.24446 - D.24456;
    goto <D.22729>;
    <D.22728>:
    D.24457 = mono_pagesize ();
    D.24458 = (unsigned int) D.24457;
    guard_size = guard_size - D.24458;
    <D.22729>:
    if (guard_size != 0) goto <D.24459>; else goto <D.22730>;
    <D.24459>:
    D.24449 = jit_tls->stack_ovf_guard_base;
    D.24460 = D.24449 + guard_size;
    if (D.24460 > fault_addr) goto <D.22728>; else goto <D.22730>;
    <D.22730>:
    D.24446 = jit_tls->stack_ovf_guard_size;
    guard_size = D.24446 - guard_size;
    D.24449 = jit_tls->stack_ovf_guard_base;
    D.24446 = jit_tls->stack_ovf_guard_size;
    D.24461 = D.24446 - guard_size;
    D.24462 = D.24449 + D.24461;
    mono_mprotect (D.24462, guard_size, 3);
    if (handled == 0) goto <D.24463>; else goto <D.24464>;
    <D.24463>:
    stderr.94 = stderr;
    D.24466 = mono_arch_ip_from_context (ctx);
    fprintf (stderr.94, "Stack overflow in unmanaged: IP: %p, fault addr: %p\n", D.24466, fault_addr);
    D.24467 = jit_tls->handling_stack_ovf;
    if (D.24467 == 0) goto <D.24468>; else goto <D.24469>;
    <D.24468>:
    restore_stack_protection_tramp.95 = restore_stack_protection_tramp;
    jit_tls->restore_stack_prot = restore_stack_protection_tramp.95;
    jit_tls->handling_stack_ovf = 1;
    goto <D.24471>;
    <D.24469>:
    <D.24471>:
    <D.24464>:
    D.24472 = 1;
    return D.24472;
  }
  <D.24454>:
  <D.24451>:
  <D.24448>:
  D.24472 = 0;
  return D.24472;
}


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

  try
    {
      stderr.96 = stderr;
      D.24475 = mono_arch_ip_from_context (ctx);
      fprintf (stderr.96, "Stack overflow: IP: %p, fault addr: %p\n", D.24475, fault_addr);
      mono_arch_sigctx_to_monoctx (ctx, &mctx);
      stderr.96 = stderr;
      fprintf (stderr.96, "Stacktrace:\n");
      memset (&ud, 0, 8);
      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.24476;
  int D.24481;
  int D.24484;
  gboolean D.24485;
  struct MonoMethod * D.24486;
  int D.24489;
  unsigned int D.24490;
  struct MonoDomain * D.24491;
  struct _IO_FILE * stderr.97;
  struct MonoMethod * method;
  struct PrintOverflowUserData * user_data;
  gchar * location;

  method = 0B;
  user_data = data;
  D.24476 = frame->ji;
  if (D.24476 != 0B) goto <D.24477>; else goto <D.24478>;
  <D.24477>:
  D.24476 = frame->ji;
  method = jinfo_get_method (D.24476);
  <D.24478>:
  if (method != 0B) goto <D.24479>; else goto <D.24480>;
  <D.24479>:
  D.24481 = user_data->count;
  if (D.24481 == 0) goto <D.24482>; else goto <D.24483>;
  <D.24482>:
  D.24481 = user_data->count;
  D.24484 = D.24481 + 1;
  user_data->count = D.24484;
  D.24485 = 0;
  return D.24485;
  <D.24483>:
  D.24486 = user_data->omethod;
  if (D.24486 == method) goto <D.24487>; else goto <D.24488>;
  <D.24487>:
  D.24485 = 0;
  return D.24485;
  <D.24488>:
  D.24489 = frame->native_offset;
  D.24490 = (unsigned int) D.24489;
  D.24491 = mono_domain_get ();
  location = mono_debug_print_stack_frame (method, D.24490, D.24491);
  stderr.97 = stderr;
  fprintf (stderr.97, "  %s\n", location);
  monoeg_g_free (location);
  D.24481 = user_data->count;
  if (D.24481 == 1) goto <D.24493>; else goto <D.24494>;
  <D.24493>:
  stderr.97 = stderr;
  fprintf (stderr.97, "  <...>\n");
  user_data->omethod = method;
  goto <D.24495>;
  <D.24494>:
  user_data->omethod = 0B;
  <D.24495>:
  D.24481 = user_data->count;
  D.24484 = D.24481 + 1;
  user_data->count = D.24484;
  goto <D.24496>;
  <D.24480>:
  stderr.97 = stderr;
  D.24489 = frame->native_offset;
  fprintf (stderr.97, "  at <unknown> <0x%05x>\n", D.24489);
  <D.24496>:
  D.24485 = 0;
  return D.24485;
}


mono_handle_native_sigsegv (int signal, void * ctx)
{
  unsigned int mono_jit_tls_id.98;
  const char * iftmp.99;
  int handling_sigsegv.100;
  struct MonoDebugOptions * D.24506;
  int D.24507;
  struct _IO_FILE * stderr.101;
  struct MonoInternalThread * D.24513;
  unsigned int i.102;
  unsigned int D.24517;
  char * * D.24518;
  char * D.24519;
  struct MonoDebugOptions * D.24520;
  int D.24521;
  int D.24526;
  _Bool D.24527;
  long int D.24528;
  long int D.24529;
  struct sigaction sa;
  struct MonoJitTlsData * jit_tls;
  const char * signal_str;

  try
    {
      mono_jit_tls_id.98 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.98);
      if (signal == 11) goto <D.24500>; else goto <D.24501>;
      <D.24500>:
      iftmp.99 = "SIGSEGV";
      goto <D.24502>;
      <D.24501>:
      iftmp.99 = "SIGABRT";
      <D.24502>:
      signal_str = iftmp.99;
      handling_sigsegv.100 = handling_sigsegv;
      if (handling_sigsegv.100 != 0) goto <D.24504>; else goto <D.24505>;
      <D.24504>:
      return;
      <D.24505>:
      D.24506 = mini_get_debug_options ();
      D.24507 = D.24506->suspend_on_sigsegv;
      if (D.24507 != 0) goto <D.24508>; else goto <D.24509>;
      <D.24508>:
      stderr.101 = stderr;
      fprintf (stderr.101, "Received SIGSEGV, suspending...\n");
      <D.22774>:
      sleep (0);
      goto <D.22774>;
      <D.24509>:
      handling_sigsegv = 1;
      if (jit_tls != 0B) goto <D.24511>; else goto <D.24512>;
      <D.24511>:
      D.24513 = mono_thread_internal_current ();
      if (D.24513 != 0B) goto <D.24514>; else goto <D.24515>;
      <D.24514>:
      stderr.101 = stderr;
      fprintf (stderr.101, "Stacktrace:\n\n");
      mono_walk_stack (print_stack_frame_to_stderr, 1, 0B);
      <D.24515>:
      <D.24512>:
      {
        void * array[256];
        char * * names;
        int i;
        int size;

        try
          {
            stderr.101 = stderr;
            fprintf (stderr.101, "\nNative stacktrace:\n\n");
            size = backtrace (&array, 256);
            names = backtrace_symbols (&array, size);
            i = 0;
            goto <D.22780>;
            <D.22779>:
            stderr.101 = stderr;
            i.102 = (unsigned int) i;
            D.24517 = i.102 * 4;
            D.24518 = names + D.24517;
            D.24519 = *D.24518;
            fprintf (stderr.101, "\t%s\n", D.24519);
            i = i + 1;
            <D.22780>:
            if (i < size) goto <D.22779>; else goto <D.22781>;
            <D.22781>:
            free (names);
            D.24520 = mini_get_debug_options ();
            D.24521 = D.24520->no_gdb_backtrace;
            if (D.24521 == 0) goto <D.24522>; else goto <D.24523>;
            <D.24522>:
            {
              pid_t pid;
              int status;
              pid_t crashed_pid;

              try
                {
                  crashed_pid = getpid ();
                  pid = mono_runtime_syscall_fork ();
                  if (pid == 0) goto <D.24524>; else goto <D.24525>;
                  <D.24524>:
                  dup2 (2, 1);
                  mono_gdb_render_native_backtraces (crashed_pid);
                  exit (1);
                  <D.24525>:
                  stderr.101 = stderr;
                  fprintf (stderr.101, "\nDebug info from gdb:\n\n");
                  waitpid (pid, &status, 0);
                }
              finally
                {
                  status = {CLOBBER};
                }
            }
            <D.24523>:
          }
        finally
          {
            array = {CLOBBER};
          }
      }
      stderr.101 = stderr;
      fprintf (stderr.101, "\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.24526 = sigaction (6, &sa, 0B);
      D.24527 = D.24526 == -1;
      D.24528 = (long int) D.24527;
      D.24529 = __builtin_expect (D.24528, 0);
      if (D.24529 != 0) goto <D.24530>; else goto <D.24531>;
      <D.24530>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 2327, "sigaction (SIGABRT, &sa, NULL) != -1");
      <D.24531>:
      abort ();
    }
  finally
    {
      sa = {CLOBBER};
    }
}


print_stack_frame_to_stderr (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  struct MonoJitInfo * D.24534;
  int D.24539;
  unsigned int D.24540;
  struct MonoDomain * D.24541;
  struct _IO_FILE * stderr.103;
  gboolean D.24544;
  struct MonoMethod * method;

  method = 0B;
  D.24534 = frame->ji;
  if (D.24534 != 0B) goto <D.24535>; else goto <D.24536>;
  <D.24535>:
  D.24534 = frame->ji;
  method = jinfo_get_method (D.24534);
  <D.24536>:
  if (method != 0B) goto <D.24537>; else goto <D.24538>;
  <D.24537>:
  {
    gchar * location;

    D.24539 = frame->native_offset;
    D.24540 = (unsigned int) D.24539;
    D.24541 = mono_domain_get ();
    location = mono_debug_print_stack_frame (method, D.24540, D.24541);
    stderr.103 = stderr;
    fprintf (stderr.103, "  %s\n", location);
    monoeg_g_free (location);
  }
  goto <D.24543>;
  <D.24538>:
  stderr.103 = stderr;
  D.24539 = frame->native_offset;
  fprintf (stderr.103, "  at <unknown> <0x%05x>\n", D.24539);
  <D.24543>:
  D.24544 = 0;
  return D.24544;
}


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.24546;
  unsigned int D.24549;
  long int D.24550;
  struct GError * error.104;
  _Bool D.24552;
  long int D.24553;
  long int D.24554;
  unsigned char D.24558;
  long long unsigned int D.24562;
  unsigned int D.24563;
  void * D.24564;
  void * D.24570;
  int D.24571;
  void * D.24572;
  int D.24573;
  int mono_print_thread_dump.105;
  struct _IO_FILE * stdout.106;
  char * D.24577;
  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.24546 = thread->name;
      if (D.24546 != 0B) goto <D.24547>; else goto <D.24548>;
      <D.24547>:
      D.24546 = thread->name;
      D.24549 = thread->name_len;
      D.24550 = (long int) D.24549;
      name = monoeg_g_utf16_to_utf8 (D.24546, D.24550, 0B, 0B, &error);
      error.104 = error;
      D.24552 = error.104 != 0B;
      D.24553 = (long int) D.24552;
      D.24554 = __builtin_expect (D.24553, 0);
      if (D.24554 != 0) goto <D.24555>; else goto <D.24556>;
      <D.24555>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mini-exceptions.c", 2352, "!error");
      <D.24556>:
      monoeg_g_string_append_printf (text, "\n\"%s\"", name);
      monoeg_g_free (name);
      goto <D.24557>;
      <D.24548>:
      D.24558 = thread->threadpool_thread;
      if (D.24558 != 0) goto <D.24559>; else goto <D.24560>;
      <D.24559>:
      monoeg_g_string_append (text, "\n\"<threadpool thread>\"");
      goto <D.24561>;
      <D.24560>:
      monoeg_g_string_append (text, "\n\"<unnamed thread>\"");
      <D.24561>:
      <D.24557>:
      wapi_desc = wapi_current_thread_desc ();
      D.24562 = thread->tid;
      D.24563 = (unsigned int) D.24562;
      D.24564 = (void *) D.24563;
      monoeg_g_string_append_printf (text, " tid=0x%p this=0x%p %s\n", D.24564, thread, wapi_desc);
      free (wapi_desc);
      if (start_ctx != 0B) goto <D.24565>; else goto <D.24566>;
      <D.24565>:
      memcpy (&ctx, start_ctx, 260);
      goto <D.24567>;
      <D.24566>:
      if (sigctx == 0B) goto <D.24568>; else goto <D.24569>;
      <D.24568>:
      D.24570 = __builtin_frame_address (0);
      D.24571 = (int) D.24570;
      ctx.sc_regs[30] = D.24571;
      D.24572 = __builtin_frame_address (0);
      D.24573 = (int) D.24572;
      ctx.sc_regs[29] = D.24573;
      mono_print_thread_dump.105 = (int) mono_print_thread_dump;
      ctx.sc_pc = mono_print_thread_dump.105;
      goto <D.24575>;
      <D.24569>:
      mono_arch_sigctx_to_monoctx (sigctx, &ctx);
      <D.24575>:
      <D.24567>:
      mono_walk_stack_with_ctx (print_stack_frame_to_string, &ctx, 3, text);
      stdout.106 = stdout;
      D.24577 = text->str;
      fprintf (stdout.106, "%s\n", D.24577);
      monoeg_g_string_free (text, 1);
      stdout.106 = stdout;
      fflush (stdout.106);
    }
  finally
    {
      ctx = {CLOBBER};
      error = {CLOBBER};
    }
}


print_stack_frame_to_string (struct StackFrameInfo * frame, struct MonoContext * ctx, void * data)
{
  struct MonoJitInfo * D.24578;
  int D.24583;
  unsigned int D.24584;
  struct MonoDomain * D.24585;
  gboolean D.24587;
  struct GString * p;
  struct MonoMethod * method;

  p = data;
  method = 0B;
  D.24578 = frame->ji;
  if (D.24578 != 0B) goto <D.24579>; else goto <D.24580>;
  <D.24579>:
  D.24578 = frame->ji;
  method = jinfo_get_method (D.24578);
  <D.24580>:
  if (method != 0B) goto <D.24581>; else goto <D.24582>;
  <D.24581>:
  {
    gchar * location;

    D.24583 = frame->native_offset;
    D.24584 = (unsigned int) D.24583;
    D.24585 = mono_domain_get ();
    location = mono_debug_print_stack_frame (method, D.24584, D.24585);
    monoeg_g_string_append_printf (p, "  %s\n", location);
    monoeg_g_free (location);
  }
  goto <D.24586>;
  <D.24582>:
  D.24583 = frame->native_offset;
  monoeg_g_string_append_printf (p, "  at <unknown> <0x%05x>\n", D.24583);
  <D.24586>:
  D.24587 = 0;
  return D.24587;
}


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.107;
  int D.24590;
  int D.24591;
  void * D.24592;
  struct MonoJitTlsData * jit_tls;
  struct MonoContext new_ctx;

  try
    {
      mono_jit_tls_id.107 = mono_jit_tls_id;
      jit_tls = pthread_getspecific (mono_jit_tls_id.107);
      D.24590 = jit_tls->resume_state.ctx.sc_pc;
      ctx->sc_pc = D.24590;
      D.24591 = jit_tls->resume_state.ctx.sc_regs[29];
      ctx->sc_regs[29] = D.24591;
      new_ctx = *ctx;
      D.24592 = jit_tls->resume_state.ex_obj;
      mono_handle_exception_internal (&new_ctx, D.24592, 1, 0B);
      mono_restore_context (&new_ctx);
    }
  finally
    {
      new_ctx = {CLOBBER};
    }
}


mono_install_handler_block_guard (struct MonoThreadUnwindState * ctx)
{
  gboolean D.24593;

  D.24593 = 0;
  return D.24593;
}


mono_set_cast_details (struct MonoClass * from, struct MonoClass * to)
{
  struct MonoDebugOptions * D.24595;
  int D.24596;
  unsigned int mono_jit_tls_id.108;
  struct MonoJitTlsData * jit_tls;

  jit_tls = 0B;
  D.24595 = mini_get_debug_options ();
  D.24596 = D.24595->better_cast_details;
  if (D.24596 != 0) goto <D.24597>; else goto <D.24598>;
  <D.24597>:
  mono_jit_tls_id.108 = mono_jit_tls_id;
  jit_tls = pthread_getspecific (mono_jit_tls_id.108);
  jit_tls->class_cast_from = from;
  jit_tls->class_cast_to = to;
  <D.24598>:
}


mono_thread_state_init_from_sigctx (struct MonoThreadUnwindState * ctx, void * sigctx)
{
  void * D.24603;
  gboolean D.24604;
  struct MonoContext * D.24607;
  struct MonoDomain * D.24609;
  struct MonoLMF * D.24610;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  if (thread == 0B) goto <D.24600>; else goto <D.24602>;
  <D.24602>:
  D.24603 = thread->jit_data;
  if (D.24603 == 0B) goto <D.24600>; else goto <D.24601>;
  <D.24600>:
  ctx->valid = 0;
  D.24604 = 0;
  return D.24604;
  <D.24601>:
  if (sigctx != 0B) goto <D.24605>; else goto <D.24606>;
  <D.24605>:
  D.24607 = &ctx->ctx;
  mono_arch_sigctx_to_monoctx (sigctx, D.24607);
  goto <D.24608>;
  <D.24606>:
  monoeg_g_log (0B, 4, "Use a null sigctx requires a working mono-context");
  <D.22819>:
  goto <D.22819>;
  <D.24608>:
  D.24609 = mono_domain_get ();
  ctx->unwind_data[0] = D.24609;
  D.24610 = mono_get_lmf ();
  ctx->unwind_data[1] = D.24610;
  D.24603 = thread->jit_data;
  ctx->unwind_data[2] = D.24603;
  ctx->valid = 1;
  D.24604 = 1;
  return D.24604;
}


mono_thread_state_init_from_monoctx (struct MonoThreadUnwindState * ctx, struct MonoContext * mctx)
{
  void * D.24615;
  gboolean D.24616;
  struct MonoDomain * D.24617;
  struct MonoLMF * D.24618;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  if (thread == 0B) goto <D.24612>; else goto <D.24614>;
  <D.24614>:
  D.24615 = thread->jit_data;
  if (D.24615 == 0B) goto <D.24612>; else goto <D.24613>;
  <D.24612>:
  ctx->valid = 0;
  D.24616 = 0;
  return D.24616;
  <D.24613>:
  ctx->ctx = *mctx;
  D.24617 = mono_domain_get ();
  ctx->unwind_data[0] = D.24617;
  D.24618 = mono_get_lmf ();
  ctx->unwind_data[1] = D.24618;
  D.24615 = thread->jit_data;
  ctx->unwind_data[2] = D.24615;
  ctx->valid = 1;
  D.24616 = 1;
  return D.24616;
}


mono_thread_state_init_from_current (struct MonoThreadUnwindState * ctx)
{
  void * D.24623;
  gboolean D.24624;
  void * D.24625;
  int D.24626;
  void * D.24627;
  int D.24628;
  int mono_thread_state_init_from_current.109;
  struct MonoDomain * D.24630;
  struct MonoLMF * D.24631;
  struct MonoInternalThread * thread;

  thread = mono_thread_internal_current ();
  mono_arch_flush_register_windows ();
  if (thread == 0B) goto <D.24620>; else goto <D.24622>;
  <D.24622>:
  D.24623 = thread->jit_data;
  if (D.24623 == 0B) goto <D.24620>; else goto <D.24621>;
  <D.24620>:
  ctx->valid = 0;
  D.24624 = 0;
  return D.24624;
  <D.24621>:
  D.24625 = __builtin_frame_address (0);
  D.24626 = (int) D.24625;
  ctx->ctx.sc_regs[30] = D.24626;
  D.24627 = __builtin_frame_address (0);
  D.24628 = (int) D.24627;
  ctx->ctx.sc_regs[29] = D.24628;
  mono_thread_state_init_from_current.109 = (int) mono_thread_state_init_from_current;
  ctx->ctx.sc_pc = mono_thread_state_init_from_current.109;
  D.24630 = mono_domain_get ();
  ctx->unwind_data[0] = D.24630;
  D.24631 = mono_get_lmf ();
  ctx->unwind_data[1] = D.24631;
  D.24623 = thread->jit_data;
  ctx->unwind_data[2] = D.24623;
  ctx->valid = 1;
  D.24624 = 1;
  return D.24624;
}


mono_setup_async_callback (struct MonoContext * ctx, void (*<Tc3>) (void *) async_cb, void * user_data)
{
  monoeg_g_log (0B, 4, "This target doesn\'t support mono_arch_setup_async_callback");
  <D.22839>:
  goto <D.22839>;
}


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 (*<T386a>) (struct MonoObject *, void *) unhandled_exception_hook.110;
  void * unhandled_exception_hook_data.111;
  struct MonoObject * other.112;
  struct _IO_FILE * stderr.113;
  int D.24646;

  unhandled_exception_hook.110 = unhandled_exception_hook;
  if (unhandled_exception_hook.110 != 0B) goto <D.24634>; else goto <D.24635>;
  <D.24634>:
  unhandled_exception_hook.110 = unhandled_exception_hook;
  unhandled_exception_hook_data.111 = unhandled_exception_hook_data;
  unhandled_exception_hook.110 (exc, unhandled_exception_hook_data.111);
  goto <D.24637>;
  <D.24635>:
  {
    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.24638>; else goto <D.24639>;
        <D.24638>:
        msg = mono_string_to_utf8 (str);
        goto <D.24640>;
        <D.24639>:
        other.112 = other;
        if (other.112 != 0B) goto <D.24642>; else goto <D.24643>;
        <D.24642>:
        {
          char * original_backtrace;
          char * nested_backtrace;

          original_backtrace = mono_exception_get_managed_backtrace (exc);
          other.112 = other;
          nested_backtrace = mono_exception_get_managed_backtrace (other.112);
          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.24644>;
        <D.24643>:
        msg = monoeg_strdup ("Nested exception trying to figure out what went wrong");
        <D.24644>:
        <D.24640>:
        stderr.113 = stderr;
        fprintf (stderr.113, "[ERROR] FATAL UNHANDLED EXCEPTION: %s\n", msg);
        monoeg_g_free (msg);
        D.24646 = mono_environment_exitcode_get ();
        exit (D.24646);
      }
    finally
      {
        other = {CLOBBER};
      }
  }
  <D.24637>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 2693);
}


mono_restore_context (struct MonoContext * ctx)
{
  void (*<T3d72>) (struct MonoContext *) restore_context.114;
  void * D.24650;
  void (*<T3d72>) (struct MonoContext *) restore_context.115;
  static void (*<T3d72>) (struct MonoContext *) restore_context;

  restore_context.114 = restore_context;
  if (restore_context.114 == 0B) goto <D.24648>; else goto <D.24649>;
  <D.24648>:
  D.24650 = mono_get_restore_context ();
  restore_context.115 = (void (*<T3d72>) (struct MonoContext *)) D.24650;
  restore_context = restore_context.115;
  <D.24649>:
  restore_context.114 = restore_context;
  restore_context.114 (ctx);
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mini-exceptions.c", 2709);
}


