mono_exception_from_name (struct MonoImage * image, const char * name_space, const char * name)
{
  struct MonoException * D.16958;
  struct MonoDomain * D.16959;

  D.16959 = mono_domain_get ();
  D.16958 = mono_exception_from_name_domain (D.16959, image, name_space, name);
  return D.16958;
}


mono_exception_from_name_domain (struct MonoDomain * domain, struct MonoImage * image, const char * name_space, const char * name)
{
  _Bool D.16961;
  long int D.16962;
  long int D.16963;
  struct MonoException * D.16970;
  struct MonoClass * klass;
  struct MonoObject * o;
  struct MonoDomain * caller_domain;

  caller_domain = mono_domain_get ();
  klass = mono_class_from_name (image, name_space, name);
  o = mono_object_new (domain, klass);
  D.16961 = o == 0B;
  D.16962 = (long int) D.16961;
  D.16963 = __builtin_expect (D.16962, 0);
  if (D.16963 != 0) goto <D.16964>; else goto <D.16965>;
  <D.16964>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 66, "o != NULL");
  <D.16965>:
  if (domain != caller_domain) goto <D.16966>; else goto <D.16967>;
  <D.16966>:
  mono_domain_set_internal (domain);
  <D.16967>:
  mono_runtime_object_init (o);
  if (domain != caller_domain) goto <D.16968>; else goto <D.16969>;
  <D.16968>:
  mono_domain_set_internal (caller_domain);
  <D.16969>:
  D.16970 = o;
  return D.16970;
}


mono_exception_from_token (struct MonoImage * image, guint32 token)
{
  struct MonoDomain * D.16972;
  _Bool D.16973;
  long int D.16974;
  long int D.16975;
  struct MonoException * D.16978;
  struct MonoClass * klass;
  struct MonoObject * o;

  klass = mono_class_get (image, token);
  D.16972 = mono_domain_get ();
  o = mono_object_new (D.16972, klass);
  D.16973 = o == 0B;
  D.16974 = (long int) D.16973;
  D.16975 = __builtin_expect (D.16974, 0);
  if (D.16975 != 0) goto <D.16976>; else goto <D.16977>;
  <D.16976>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 96, "o != NULL");
  <D.16977>:
  mono_runtime_object_init (o);
  D.16978 = o;
  return D.16978;
}


mono_exception_from_name_two_strings (struct MonoImage * image, const char * name_space, const char * name, struct MonoString * a1, struct MonoString * a2)
{
  struct MonoException * D.16980;
  struct MonoClass * klass;

  klass = mono_class_from_name (image, name_space, name);
  D.16980 = create_exception_two_strings (klass, a1, a2);
  return D.16980;
}


create_exception_two_strings (struct MonoClass * klass, struct MonoString * a1, struct MonoString * a2)
{
  int D.16732;
  int iftmp.0;
  int D.16728;
  const char[6] * D.16987;
  unsigned char D.16988;
  int D.16989;
  unsigned char D.16990;
  int D.16991;
  const unsigned char * D.16996;
  unsigned char D.16997;
  int D.16998;
  const unsigned char * D.16999;
  unsigned char D.17000;
  int D.17001;
  const unsigned char * D.17006;
  unsigned char D.17007;
  int D.17008;
  const unsigned char * D.17009;
  unsigned char D.17010;
  int D.17011;
  const unsigned char * D.17016;
  unsigned char D.17017;
  int D.17018;
  const unsigned char * D.17019;
  unsigned char D.17020;
  int D.17021;
  const char * D.17023;
  short unsigned int D.17026;
  int D.17027;
  struct MonoType * D.17030;
  unsigned char D.17031;
  struct MonoType * D.17036;
  unsigned char D.17037;
  struct MonoException * D.17040;
  struct MonoDomain * domain;
  struct MonoMethod * method;
  struct MonoObject * o;
  int count;
  void * args[2];
  void * iter;
  struct MonoMethod * m;

  try
    {
      domain = mono_domain_get ();
      method = 0B;
      count = 1;
      if (a2 != 0B) goto <D.16982>; else goto <D.16983>;
      <D.16982>:
      count = count + 1;
      <D.16983>:
      o = mono_object_new (domain, klass);
      iter = 0B;
      goto <D.16733>;
      <D.16735>:
      {
        struct MonoMethodSignature * sig;

        {
          size_t __s1_len;
          size_t __s2_len;

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

            __s2 = mono_method_get_name (m);
            D.16987 = ".ctor";
            D.16988 = MEM[(const unsigned char *)D.16987];
            D.16989 = (int) D.16988;
            D.16990 = *__s2;
            D.16991 = (int) D.16990;
            __result = D.16989 - D.16991;
            {
              if (__s1_len != 0) goto <D.16992>; else goto <D.16993>;
              <D.16992>:
              if (__result == 0) goto <D.16994>; else goto <D.16995>;
              <D.16994>:
              D.16996 = &MEM[(void *)".ctor" + 1B];
              D.16997 = *D.16996;
              D.16998 = (int) D.16997;
              D.16999 = __s2 + 1;
              D.17000 = *D.16999;
              D.17001 = (int) D.17000;
              __result = D.16998 - D.17001;
              if (__s1_len > 1) goto <D.17002>; else goto <D.17003>;
              <D.17002>:
              if (__result == 0) goto <D.17004>; else goto <D.17005>;
              <D.17004>:
              D.17006 = &MEM[(void *)".ctor" + 2B];
              D.17007 = *D.17006;
              D.17008 = (int) D.17007;
              D.17009 = __s2 + 2;
              D.17010 = *D.17009;
              D.17011 = (int) D.17010;
              __result = D.17008 - D.17011;
              if (__s1_len > 2) goto <D.17012>; else goto <D.17013>;
              <D.17012>:
              if (__result == 0) goto <D.17014>; else goto <D.17015>;
              <D.17014>:
              D.17016 = &MEM[(void *)".ctor" + 3B];
              D.17017 = *D.17016;
              D.17018 = (int) D.17017;
              D.17019 = __s2 + 3;
              D.17020 = *D.17019;
              D.17021 = (int) D.17020;
              __result = D.17018 - D.17021;
              <D.17015>:
              <D.17013>:
              <D.17005>:
              <D.17003>:
              <D.16995>:
              <D.16993>:
            }
            D.16728 = __result;
          }
          iftmp.0 = D.16728;
          goto <D.17022>;
          <D.16986>:
          D.17023 = mono_method_get_name (m);
          iftmp.0 = __builtin_strcmp (".ctor", D.17023);
          <D.17022>:
          D.16732 = iftmp.0;
        }
        if (D.16732 != 0) goto <D.17024>; else goto <D.17025>;
        <D.17024>:
        // predicted unlikely by continue predictor.
        goto <D.16733>;
        <D.17025>:
        sig = mono_method_signature (m);
        D.17026 = sig->param_count;
        D.17027 = (int) D.17026;
        if (D.17027 != count) goto <D.17028>; else goto <D.17029>;
        <D.17028>:
        // predicted unlikely by continue predictor.
        goto <D.16733>;
        <D.17029>:
        D.17030 = sig->params[0];
        D.17031 = D.17030->type;
        if (D.17031 != 14) goto <D.17032>; else goto <D.17033>;
        <D.17032>:
        // predicted unlikely by continue predictor.
        goto <D.16733>;
        <D.17033>:
        if (count == 2) goto <D.17034>; else goto <D.17035>;
        <D.17034>:
        D.17036 = sig->params[1];
        D.17037 = D.17036->type;
        if (D.17037 != 14) goto <D.17038>; else goto <D.17039>;
        <D.17038>:
        // predicted unlikely by continue predictor.
        goto <D.16733>;
        <D.17039>:
        <D.17035>:
        method = m;
        goto <D.16734>;
      }
      <D.16733>:
      m = mono_class_get_methods (klass, &iter);
      if (m != 0B) goto <D.16735>; else goto <D.16734>;
      <D.16734>:
      args[0] = a1;
      args[1] = a2;
      mono_runtime_invoke (method, o, &args, 0B);
      D.17040 = o;
      return D.17040;
    }
  finally
    {
      args = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_exception_from_name_msg (struct MonoImage * image, const char * name_space, const char * name, const char * msg)
{
  struct MonoString * * D.17045;
  struct MonoDomain * D.17046;
  struct MonoString * D.17047;
  struct MonoException * D.17048;
  struct MonoException * ex;

  ex = mono_exception_from_name (image, name_space, name);
  if (msg != 0B) goto <D.17043>; else goto <D.17044>;
  <D.17043>:
  D.17045 = &ex->message;
  D.17046 = mono_object_get_domain (ex);
  D.17047 = mono_string_new (D.17046, msg);
  mono_gc_wbarrier_set_field (ex, D.17045, D.17047);
  <D.17044>:
  D.17048 = ex;
  return D.17048;
}


mono_exception_from_token_two_strings (struct MonoImage * image, guint32 token, struct MonoString * a1, struct MonoString * a2)
{
  struct MonoException * D.17050;
  struct MonoClass * klass;

  klass = mono_class_get (image, token);
  D.17050 = create_exception_two_strings (klass, a1, a2);
  return D.17050;
}


mono_get_exception_divide_by_zero ()
{
  struct MonoException * D.17052;
  struct MonoImage * D.17053;

  D.17053 = mono_get_corlib ();
  D.17052 = mono_exception_from_name (D.17053, "System", "DivideByZeroException");
  return D.17052;
}


mono_get_exception_security ()
{
  struct MonoException * D.17055;
  struct MonoImage * D.17056;

  D.17056 = mono_get_corlib ();
  D.17055 = mono_exception_from_name (D.17056, "System.Security", "SecurityException");
  return D.17055;
}


mono_get_exception_thread_abort ()
{
  struct MonoException * D.17058;
  struct MonoImage * D.17059;

  D.17059 = mono_get_corlib ();
  D.17058 = mono_exception_from_name (D.17059, "System.Threading", "ThreadAbortException");
  return D.17058;
}


mono_get_exception_thread_interrupted ()
{
  struct MonoException * D.17061;
  struct MonoImage * D.17062;

  D.17062 = mono_get_corlib ();
  D.17061 = mono_exception_from_name (D.17062, "System.Threading", "ThreadInterruptedException");
  return D.17061;
}


mono_get_exception_arithmetic ()
{
  struct MonoException * D.17064;
  struct MonoImage * D.17065;

  D.17065 = mono_get_corlib ();
  D.17064 = mono_exception_from_name (D.17065, "System", "ArithmeticException");
  return D.17064;
}


mono_get_exception_overflow ()
{
  struct MonoException * D.17067;
  struct MonoImage * D.17068;

  D.17068 = mono_get_corlib ();
  D.17067 = mono_exception_from_name (D.17068, "System", "OverflowException");
  return D.17067;
}


mono_get_exception_null_reference ()
{
  struct MonoException * D.17070;
  struct MonoImage * D.17071;

  D.17071 = mono_get_corlib ();
  D.17070 = mono_exception_from_name (D.17071, "System", "NullReferenceException");
  return D.17070;
}


mono_get_exception_execution_engine (const char * msg)
{
  struct MonoException * D.17073;
  struct MonoImage * D.17074;

  D.17074 = mono_get_corlib ();
  D.17073 = mono_exception_from_name_msg (D.17074, "System", "ExecutionEngineException", msg);
  return D.17073;
}


mono_get_exception_serialization (const char * msg)
{
  struct MonoException * D.17076;
  struct MonoImage * D.17077;

  D.17077 = mono_get_corlib ();
  D.17076 = mono_exception_from_name_msg (D.17077, "System.Runtime.Serialization", "SerializationException", msg);
  return D.17076;
}


mono_get_exception_invalid_cast ()
{
  struct MonoException * D.17079;
  struct MonoImage * D.17080;

  D.17080 = mono_get_corlib ();
  D.17079 = mono_exception_from_name (D.17080, "System", "InvalidCastException");
  return D.17079;
}


mono_get_exception_invalid_operation (const char * msg)
{
  struct MonoException * D.17082;
  struct MonoImage * D.17083;

  D.17083 = mono_get_corlib ();
  D.17082 = mono_exception_from_name_msg (D.17083, "System", "InvalidOperationException", msg);
  return D.17082;
}


mono_get_exception_index_out_of_range ()
{
  struct MonoException * D.17085;
  struct MonoImage * D.17086;

  D.17086 = mono_get_corlib ();
  D.17085 = mono_exception_from_name (D.17086, "System", "IndexOutOfRangeException");
  return D.17085;
}


mono_get_exception_array_type_mismatch ()
{
  struct MonoException * D.17088;
  struct MonoImage * D.17089;

  D.17089 = mono_get_corlib ();
  D.17088 = mono_exception_from_name (D.17089, "System", "ArrayTypeMismatchException");
  return D.17088;
}


mono_get_exception_type_load (struct MonoString * class_name, char * assembly_name)
{
  struct MonoString * iftmp.1;
  struct MonoDomain * D.17094;
  struct MonoDomain * D.17096;
  struct MonoException * D.17097;
  struct MonoImage * D.17098;
  struct MonoString * s;

  if (assembly_name != 0B) goto <D.17092>; else goto <D.17093>;
  <D.17092>:
  D.17094 = mono_domain_get ();
  iftmp.1 = mono_string_new (D.17094, assembly_name);
  goto <D.17095>;
  <D.17093>:
  D.17096 = mono_domain_get ();
  iftmp.1 = mono_string_new (D.17096, "");
  <D.17095>:
  s = iftmp.1;
  D.17098 = mono_get_corlib ();
  D.17097 = mono_exception_from_name_two_strings (D.17098, "System", "TypeLoadException", class_name, s);
  return D.17097;
}


mono_get_exception_not_implemented (const char * msg)
{
  struct MonoException * D.17100;
  struct MonoImage * D.17101;

  D.17101 = mono_get_corlib ();
  D.17100 = mono_exception_from_name_msg (D.17101, "System", "NotImplementedException", msg);
  return D.17100;
}


mono_get_exception_not_supported (const char * msg)
{
  struct MonoException * D.17103;
  struct MonoImage * D.17104;

  D.17104 = mono_get_corlib ();
  D.17103 = mono_exception_from_name_msg (D.17104, "System", "NotSupportedException", msg);
  return D.17103;
}


mono_get_exception_missing_method (const char * class_name, const char * member_name)
{
  struct MonoDomain * D.17106;
  struct MonoDomain * D.17107;
  struct MonoException * D.17108;
  struct MonoImage * D.17109;
  struct MonoString * s1;
  struct MonoString * s2;

  D.17106 = mono_domain_get ();
  s1 = mono_string_new (D.17106, class_name);
  D.17107 = mono_domain_get ();
  s2 = mono_string_new (D.17107, member_name);
  D.17109 = mono_get_corlib ();
  D.17108 = mono_exception_from_name_two_strings (D.17109, "System", "MissingMethodException", s1, s2);
  return D.17108;
}


mono_get_exception_missing_field (const char * class_name, const char * member_name)
{
  struct MonoDomain * D.17111;
  struct MonoDomain * D.17112;
  struct MonoException * D.17113;
  struct MonoImage * D.17114;
  struct MonoString * s1;
  struct MonoString * s2;

  D.17111 = mono_domain_get ();
  s1 = mono_string_new (D.17111, class_name);
  D.17112 = mono_domain_get ();
  s2 = mono_string_new (D.17112, member_name);
  D.17114 = mono_get_corlib ();
  D.17113 = mono_exception_from_name_two_strings (D.17114, "System", "MissingFieldException", s1, s2);
  return D.17113;
}


mono_get_exception_argument_null (const char * arg)
{
  struct MonoImage * D.17116;
  struct MonoString * * D.17119;
  struct MonoDomain * D.17120;
  struct MonoString * D.17121;
  struct MonoException * D.17122;
  struct MonoException * ex;

  D.17116 = mono_get_corlib ();
  ex = mono_exception_from_name (D.17116, "System", "ArgumentNullException");
  if (arg != 0B) goto <D.17117>; else goto <D.17118>;
  <D.17117>:
  {
    struct MonoArgumentException * argex;

    argex = ex;
    D.17119 = &argex->param_name;
    D.17120 = mono_object_get_domain (ex);
    D.17121 = mono_string_new (D.17120, arg);
    mono_gc_wbarrier_set_field (argex, D.17119, D.17121);
  }
  <D.17118>:
  D.17122 = ex;
  return D.17122;
}


mono_get_exception_argument (const char * arg, const char * msg)
{
  struct MonoImage * D.17124;
  struct MonoString * * D.17127;
  struct MonoDomain * D.17128;
  struct MonoString * D.17129;
  struct MonoException * D.17130;
  struct MonoException * ex;

  D.17124 = mono_get_corlib ();
  ex = mono_exception_from_name_msg (D.17124, "System", "ArgumentException", msg);
  if (arg != 0B) goto <D.17125>; else goto <D.17126>;
  <D.17125>:
  {
    struct MonoArgumentException * argex;

    argex = ex;
    D.17127 = &argex->param_name;
    D.17128 = mono_object_get_domain (ex);
    D.17129 = mono_string_new (D.17128, arg);
    mono_gc_wbarrier_set_field (argex, D.17127, D.17129);
  }
  <D.17126>:
  D.17130 = ex;
  return D.17130;
}


mono_get_exception_argument_out_of_range (const char * arg)
{
  struct MonoImage * D.17132;
  struct MonoString * * D.17135;
  struct MonoDomain * D.17136;
  struct MonoString * D.17137;
  struct MonoException * D.17138;
  struct MonoException * ex;

  D.17132 = mono_get_corlib ();
  ex = mono_exception_from_name (D.17132, "System", "ArgumentOutOfRangeException");
  if (arg != 0B) goto <D.17133>; else goto <D.17134>;
  <D.17133>:
  {
    struct MonoArgumentException * argex;

    argex = ex;
    D.17135 = &argex->param_name;
    D.17136 = mono_object_get_domain (ex);
    D.17137 = mono_string_new (D.17136, arg);
    mono_gc_wbarrier_set_field (argex, D.17135, D.17137);
  }
  <D.17134>:
  D.17138 = ex;
  return D.17138;
}


mono_get_exception_thread_state (const char * msg)
{
  struct MonoException * D.17140;
  struct MonoImage * D.17141;

  D.17141 = mono_get_corlib ();
  D.17140 = mono_exception_from_name_msg (D.17141, "System.Threading", "ThreadStateException", msg);
  return D.17140;
}


mono_get_exception_io (const char * msg)
{
  struct MonoException * D.17143;
  struct MonoImage * D.17144;

  D.17144 = mono_get_corlib ();
  D.17143 = mono_exception_from_name_msg (D.17144, "System.IO", "IOException", msg);
  return D.17143;
}


mono_get_exception_file_not_found (struct MonoString * fname)
{
  struct MonoException * D.17146;
  struct MonoImage * D.17147;

  D.17147 = mono_get_corlib ();
  D.17146 = mono_exception_from_name_two_strings (D.17147, "System.IO", "FileNotFoundException", fname, fname);
  return D.17146;
}


mono_get_exception_file_not_found2 (const char * msg, struct MonoString * fname)
{
  struct MonoString * iftmp.2;
  struct MonoDomain * D.17152;
  struct MonoException * D.17154;
  struct MonoImage * D.17155;
  struct MonoString * s;

  if (msg != 0B) goto <D.17150>; else goto <D.17151>;
  <D.17150>:
  D.17152 = mono_domain_get ();
  iftmp.2 = mono_string_new (D.17152, msg);
  goto <D.17153>;
  <D.17151>:
  iftmp.2 = 0B;
  <D.17153>:
  s = iftmp.2;
  D.17155 = mono_get_corlib ();
  D.17154 = mono_exception_from_name_two_strings (D.17155, "System.IO", "FileNotFoundException", s, fname);
  return D.17154;
}


mono_get_exception_type_initialization (const gchar * type_name, struct MonoException * inner)
{
  struct MonoImage * D.17157;
  _Bool D.17158;
  long int D.17159;
  long int D.17160;
  int D.16857;
  int iftmp.3;
  int D.16853;
  const char[6] * D.17166;
  unsigned char D.17167;
  int D.17168;
  unsigned char D.17169;
  int D.17170;
  const unsigned char * D.17175;
  unsigned char D.17176;
  int D.17177;
  const unsigned char * D.17178;
  unsigned char D.17179;
  int D.17180;
  const unsigned char * D.17185;
  unsigned char D.17186;
  int D.17187;
  const unsigned char * D.17188;
  unsigned char D.17189;
  int D.17190;
  const unsigned char * D.17195;
  unsigned char D.17196;
  int D.17197;
  const unsigned char * D.17198;
  unsigned char D.17199;
  int D.17200;
  const char * D.17202;
  short unsigned int D.17205;
  struct MonoType * D.17208;
  unsigned char D.17209;
  struct MonoType * D.17212;
  struct MonoClass * D.17213;
  struct MonoClass * D.17214;
  _Bool D.17216;
  long int D.17217;
  long int D.17218;
  struct MonoDomain * D.17221;
  struct MonoString * D.17222;
  struct MonoDomain * D.17223;
  struct MonoException * D.17224;
  struct MonoClass * klass;
  void * args[2];
  struct MonoObject * exc;
  struct MonoMethod * method;
  void * iter;

  try
    {
      D.17157 = mono_get_corlib ();
      klass = mono_class_from_name (D.17157, "System", "TypeInitializationException");
      D.17158 = klass == 0B;
      D.17159 = (long int) D.17158;
      D.17160 = __builtin_expect (D.17159, 0);
      if (D.17160 != 0) goto <D.17161>; else goto <D.17162>;
      <D.17161>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 573, "klass");
      <D.17162>:
      mono_class_init (klass);
      iter = 0B;
      goto <D.16861>;
      <D.16860>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_method_get_name (method);
          D.17166 = ".ctor";
          D.17167 = MEM[(const unsigned char *)D.17166];
          D.17168 = (int) D.17167;
          D.17169 = *__s2;
          D.17170 = (int) D.17169;
          __result = D.17168 - D.17170;
          {
            if (__s1_len != 0) goto <D.17171>; else goto <D.17172>;
            <D.17171>:
            if (__result == 0) goto <D.17173>; else goto <D.17174>;
            <D.17173>:
            D.17175 = &MEM[(void *)".ctor" + 1B];
            D.17176 = *D.17175;
            D.17177 = (int) D.17176;
            D.17178 = __s2 + 1;
            D.17179 = *D.17178;
            D.17180 = (int) D.17179;
            __result = D.17177 - D.17180;
            if (__s1_len > 1) goto <D.17181>; else goto <D.17182>;
            <D.17181>:
            if (__result == 0) goto <D.17183>; else goto <D.17184>;
            <D.17183>:
            D.17185 = &MEM[(void *)".ctor" + 2B];
            D.17186 = *D.17185;
            D.17187 = (int) D.17186;
            D.17188 = __s2 + 2;
            D.17189 = *D.17188;
            D.17190 = (int) D.17189;
            __result = D.17187 - D.17190;
            if (__s1_len > 2) goto <D.17191>; else goto <D.17192>;
            <D.17191>:
            if (__result == 0) goto <D.17193>; else goto <D.17194>;
            <D.17193>:
            D.17195 = &MEM[(void *)".ctor" + 3B];
            D.17196 = *D.17195;
            D.17197 = (int) D.17196;
            D.17198 = __s2 + 3;
            D.17199 = *D.17198;
            D.17200 = (int) D.17199;
            __result = D.17197 - D.17200;
            <D.17194>:
            <D.17192>:
            <D.17184>:
            <D.17182>:
            <D.17174>:
            <D.17172>:
          }
          D.16853 = __result;
        }
        iftmp.3 = D.16853;
        goto <D.17201>;
        <D.17165>:
        D.17202 = mono_method_get_name (method);
        iftmp.3 = __builtin_strcmp (".ctor", D.17202);
        <D.17201>:
        D.16857 = iftmp.3;
      }
      if (D.16857 == 0) goto <D.17203>; else goto <D.17204>;
      <D.17203>:
      {
        struct MonoMethodSignature * sig;

        sig = mono_method_signature (method);
        D.17205 = sig->param_count;
        if (D.17205 == 2) goto <D.17206>; else goto <D.17207>;
        <D.17206>:
        D.17208 = sig->params[0];
        D.17209 = D.17208->type;
        if (D.17209 == 14) goto <D.17210>; else goto <D.17211>;
        <D.17210>:
        D.17212 = sig->params[1];
        D.17213 = mono_class_from_mono_type (D.17212);
        D.17214 = mono_defaults.exception_class;
        if (D.17213 == D.17214) goto <D.16859>; else goto <D.17215>;
        <D.17215>:
        <D.17211>:
        <D.17207>:
      }
      <D.17204>:
      method = 0B;
      <D.16861>:
      method = mono_class_get_methods (klass, &iter);
      if (method != 0B) goto <D.16860>; else goto <D.16859>;
      <D.16859>:
      D.17216 = method == 0B;
      D.17217 = (long int) D.17216;
      D.17218 = __builtin_expect (D.17217, 0);
      if (D.17218 != 0) goto <D.17219>; else goto <D.17220>;
      <D.17219>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 587, "method");
      <D.17220>:
      D.17221 = mono_domain_get ();
      D.17222 = mono_string_new (D.17221, type_name);
      args[0] = D.17222;
      args[1] = inner;
      D.17223 = mono_domain_get ();
      exc = mono_object_new (D.17223, klass);
      mono_runtime_invoke (method, exc, &args, 0B);
      D.17224 = exc;
      return D.17224;
    }
  finally
    {
      args = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_get_exception_synchronization_lock (const char * msg)
{
  struct MonoException * D.17227;
  struct MonoImage * D.17228;

  D.17228 = mono_get_corlib ();
  D.17227 = mono_exception_from_name_msg (D.17228, "System.Threading", "SynchronizationLockException", msg);
  return D.17227;
}


mono_get_exception_cannot_unload_appdomain (const char * msg)
{
  struct MonoException * D.17230;
  struct MonoImage * D.17231;

  D.17231 = mono_get_corlib ();
  D.17230 = mono_exception_from_name_msg (D.17231, "System", "CannotUnloadAppDomainException", msg);
  return D.17230;
}


mono_get_exception_appdomain_unloaded ()
{
  struct MonoException * D.17233;
  struct MonoImage * D.17234;

  D.17234 = mono_get_corlib ();
  D.17233 = mono_exception_from_name (D.17234, "System", "AppDomainUnloadedException");
  return D.17233;
}


mono_get_exception_bad_image_format (const char * msg)
{
  struct MonoException * D.17236;
  struct MonoImage * D.17237;

  D.17237 = mono_get_corlib ();
  D.17236 = mono_exception_from_name_msg (D.17237, "System", "BadImageFormatException", msg);
  return D.17236;
}


mono_get_exception_bad_image_format2 (const char * msg, struct MonoString * fname)
{
  struct MonoString * iftmp.4;
  struct MonoDomain * D.17242;
  struct MonoException * D.17244;
  struct MonoImage * D.17245;
  struct MonoString * s;

  if (msg != 0B) goto <D.17240>; else goto <D.17241>;
  <D.17240>:
  D.17242 = mono_domain_get ();
  iftmp.4 = mono_string_new (D.17242, msg);
  goto <D.17243>;
  <D.17241>:
  iftmp.4 = 0B;
  <D.17243>:
  s = iftmp.4;
  D.17245 = mono_get_corlib ();
  D.17244 = mono_exception_from_name_two_strings (D.17245, "System", "BadImageFormatException", s, fname);
  return D.17244;
}


mono_get_exception_stack_overflow ()
{
  struct MonoException * D.17247;
  struct MonoImage * D.17248;

  D.17248 = mono_get_corlib ();
  D.17247 = mono_exception_from_name (D.17248, "System", "StackOverflowException");
  return D.17247;
}


mono_get_exception_out_of_memory ()
{
  struct MonoException * D.17250;
  struct MonoImage * D.17251;

  D.17251 = mono_get_corlib ();
  D.17250 = mono_exception_from_name (D.17251, "System", "OutOfMemoryException");
  return D.17250;
}


mono_get_exception_field_access ()
{
  struct MonoException * D.17253;
  struct MonoImage * D.17254;

  D.17254 = mono_get_corlib ();
  D.17253 = mono_exception_from_name (D.17254, "System", "FieldAccessException");
  return D.17253;
}


mono_get_exception_field_access_msg (const char * msg)
{
  struct MonoException * D.17256;
  struct MonoImage * D.17257;

  D.17257 = mono_get_corlib ();
  D.17256 = mono_exception_from_name_msg (D.17257, "System", "FieldAccessException", msg);
  return D.17256;
}


mono_get_exception_method_access ()
{
  struct MonoException * D.17259;
  struct MonoImage * D.17260;

  D.17260 = mono_get_corlib ();
  D.17259 = mono_exception_from_name (D.17260, "System", "MethodAccessException");
  return D.17259;
}


mono_get_exception_method_access_msg (const char * msg)
{
  struct MonoException * D.17262;
  struct MonoImage * D.17263;

  D.17263 = mono_get_corlib ();
  D.17262 = mono_exception_from_name_msg (D.17263, "System", "MethodAccessException", msg);
  return D.17262;
}


mono_get_exception_reflection_type_load (struct MonoArray * types, struct MonoArray * exceptions)
{
  struct MonoImage * D.17265;
  _Bool D.17266;
  long int D.17267;
  long int D.17268;
  int D.16914;
  int iftmp.5;
  int D.16910;
  const char[6] * D.17274;
  unsigned char D.17275;
  int D.17276;
  unsigned char D.17277;
  int D.17278;
  const unsigned char * D.17283;
  unsigned char D.17284;
  int D.17285;
  const unsigned char * D.17286;
  unsigned char D.17287;
  int D.17288;
  const unsigned char * D.17293;
  unsigned char D.17294;
  int D.17295;
  const unsigned char * D.17296;
  unsigned char D.17297;
  int D.17298;
  const unsigned char * D.17303;
  unsigned char D.17304;
  int D.17305;
  const unsigned char * D.17306;
  unsigned char D.17307;
  int D.17308;
  const char * D.17310;
  short unsigned int D.17313;
  struct MonoType * D.17316;
  unsigned char D.17317;
  struct MonoType * D.17320;
  unsigned char D.17321;
  _Bool D.17323;
  long int D.17324;
  long int D.17325;
  struct MonoDomain * D.17328;
  struct MonoException * D.17329;
  struct MonoClass * klass;
  void * args[2];
  struct MonoObject * exc;
  struct MonoMethod * method;
  void * iter;

  try
    {
      D.17265 = mono_get_corlib ();
      klass = mono_class_from_name (D.17265, "System.Reflection", "ReflectionTypeLoadException");
      D.17266 = klass == 0B;
      D.17267 = (long int) D.17266;
      D.17268 = __builtin_expect (D.17267, 0);
      if (D.17268 != 0) goto <D.17269>; else goto <D.17270>;
      <D.17269>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 746, "klass");
      <D.17270>:
      mono_class_init (klass);
      iter = 0B;
      goto <D.16918>;
      <D.16917>:
      {
        size_t __s1_len;
        size_t __s2_len;

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

          __s2 = mono_method_get_name (method);
          D.17274 = ".ctor";
          D.17275 = MEM[(const unsigned char *)D.17274];
          D.17276 = (int) D.17275;
          D.17277 = *__s2;
          D.17278 = (int) D.17277;
          __result = D.17276 - D.17278;
          {
            if (__s1_len != 0) goto <D.17279>; else goto <D.17280>;
            <D.17279>:
            if (__result == 0) goto <D.17281>; else goto <D.17282>;
            <D.17281>:
            D.17283 = &MEM[(void *)".ctor" + 1B];
            D.17284 = *D.17283;
            D.17285 = (int) D.17284;
            D.17286 = __s2 + 1;
            D.17287 = *D.17286;
            D.17288 = (int) D.17287;
            __result = D.17285 - D.17288;
            if (__s1_len > 1) goto <D.17289>; else goto <D.17290>;
            <D.17289>:
            if (__result == 0) goto <D.17291>; else goto <D.17292>;
            <D.17291>:
            D.17293 = &MEM[(void *)".ctor" + 2B];
            D.17294 = *D.17293;
            D.17295 = (int) D.17294;
            D.17296 = __s2 + 2;
            D.17297 = *D.17296;
            D.17298 = (int) D.17297;
            __result = D.17295 - D.17298;
            if (__s1_len > 2) goto <D.17299>; else goto <D.17300>;
            <D.17299>:
            if (__result == 0) goto <D.17301>; else goto <D.17302>;
            <D.17301>:
            D.17303 = &MEM[(void *)".ctor" + 3B];
            D.17304 = *D.17303;
            D.17305 = (int) D.17304;
            D.17306 = __s2 + 3;
            D.17307 = *D.17306;
            D.17308 = (int) D.17307;
            __result = D.17305 - D.17308;
            <D.17302>:
            <D.17300>:
            <D.17292>:
            <D.17290>:
            <D.17282>:
            <D.17280>:
          }
          D.16910 = __result;
        }
        iftmp.5 = D.16910;
        goto <D.17309>;
        <D.17273>:
        D.17310 = mono_method_get_name (method);
        iftmp.5 = __builtin_strcmp (".ctor", D.17310);
        <D.17309>:
        D.16914 = iftmp.5;
      }
      if (D.16914 == 0) goto <D.17311>; else goto <D.17312>;
      <D.17311>:
      {
        struct MonoMethodSignature * sig;

        sig = mono_method_signature (method);
        D.17313 = sig->param_count;
        if (D.17313 == 2) goto <D.17314>; else goto <D.17315>;
        <D.17314>:
        D.17316 = sig->params[0];
        D.17317 = D.17316->type;
        if (D.17317 == 29) goto <D.17318>; else goto <D.17319>;
        <D.17318>:
        D.17320 = sig->params[1];
        D.17321 = D.17320->type;
        if (D.17321 == 29) goto <D.16916>; else goto <D.17322>;
        <D.17322>:
        <D.17319>:
        <D.17315>:
      }
      <D.17312>:
      method = 0B;
      <D.16918>:
      method = mono_class_get_methods (klass, &iter);
      if (method != 0B) goto <D.16917>; else goto <D.16916>;
      <D.16916>:
      D.17323 = method == 0B;
      D.17324 = (long int) D.17323;
      D.17325 = __builtin_expect (D.17324, 0);
      if (D.17325 != 0) goto <D.17326>; else goto <D.17327>;
      <D.17326>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "exception.c", 760, "method");
      <D.17327>:
      args[0] = types;
      args[1] = exceptions;
      D.17328 = mono_domain_get ();
      exc = mono_object_new (D.17328, klass);
      mono_runtime_invoke (method, exc, &args, 0B);
      D.17329 = exc;
      return D.17329;
    }
  finally
    {
      args = {CLOBBER};
      iter = {CLOBBER};
    }
}


mono_get_exception_runtime_wrapped (struct MonoObject * wrapped_exception)
{
  struct MonoImage * D.17332;
  struct MonoObject * * D.17333;
  struct MonoException * D.17334;
  struct MonoRuntimeWrappedException * ex;

  D.17332 = mono_get_corlib ();
  ex = mono_exception_from_name (D.17332, "System.Runtime.CompilerServices", "RuntimeWrappedException");
  D.17333 = &ex->wrapped_exception;
  mono_gc_wbarrier_set_field (ex, D.17333, wrapped_exception);
  D.17334 = ex;
  return D.17334;
}


mono_exception_get_managed_backtrace (struct MonoException * exc)
{
  struct MonoRuntimeExceptionHandlingCallbacks * D.17336;
  gboolean (*<T2653>) (struct MonoException *, gboolean (*MonoInternalExceptionFrameWalk) (struct MonoMethod *, void *, size_t, gboolean, void *), void *) D.17337;
  int D.17338;
  char * D.17341;
  struct GString * text;

  text = monoeg_g_string_new_len (0B, 20);
  D.17336 = mono_get_eh_callbacks ();
  D.17337 = D.17336->mono_exception_walk_trace;
  D.17338 = D.17337 (exc, append_frame_and_continue, text);
  if (D.17338 == 0) goto <D.17339>; else goto <D.17340>;
  <D.17339>:
  monoeg_g_string_append (text, "managed backtrace not available\n");
  <D.17340>:
  D.17341 = monoeg_g_string_free (text, 0);
  return D.17341;
}


append_frame_and_continue (struct MonoMethod * method, void * ip, size_t native_offset, gboolean managed, void * user_data)
{
  unsigned int D.17345;
  gboolean D.17347;
  struct MonoDomain * domain;
  struct GString * text;

  domain = mono_domain_get ();
  text = user_data;
  if (method != 0B) goto <D.17343>; else goto <D.17344>;
  <D.17343>:
  {
    char * msg;

    D.17345 = (unsigned int) native_offset;
    msg = mono_debug_print_stack_frame (method, D.17345, domain);
    monoeg_g_string_append_printf (text, "%s\n", msg);
    monoeg_g_free (msg);
  }
  goto <D.17346>;
  <D.17344>:
  monoeg_g_string_append_printf (text, "<unknown native frame 0x%x>\n", ip);
  <D.17346>:
  D.17347 = 0;
  return D.17347;
}


mono_exception_get_native_backtrace (struct MonoException * exc)
{
  char * D.17351;
  long unsigned int D.17352;
  int D.17353;
  long int D.17354;
  char * D.17355;
  long unsigned int D.17356;
  char * D.17357;
  struct MonoDomain * D.17358;
  struct MonoMethod * D.17361;
  long int ip.6;
  void * D.17363;
  long int D.17364;
  long int D.17365;
  unsigned int D.17366;
  long unsigned int D.17368;
  long unsigned int D.17369;
  char * * D.17370;
  char * D.17371;
  struct MonoDomain * domain;
  struct MonoArray * arr;
  int i;
  int len;
  struct GString * text;
  char * * messages;

  arr = exc->native_trace_ips;
  if (arr == 0B) goto <D.17349>; else goto <D.17350>;
  <D.17349>:
  D.17351 = monoeg_strdup ("");
  return D.17351;
  <D.17350>:
  domain = mono_domain_get ();
  D.17352 = mono_array_length (arr);
  len = (int) D.17352;
  D.17353 = len * 20;
  D.17354 = (long int) D.17353;
  text = monoeg_g_string_new_len (0B, D.17354);
  D.17355 = mono_array_addr_with_size (arr, 8, 0);
  messages = backtrace_symbols (D.17355, len);
  i = 0;
  goto <D.16950>;
  <D.16949>:
  {
    void * ip;
    struct MonoJitInfo * ji;

    D.17356 = (long unsigned int) i;
    D.17357 = mono_array_addr_with_size (arr, 8, D.17356);
    ip = MEM[(void * *)D.17357];
    D.17358 = mono_domain_get ();
    ji = mono_jit_info_table_find (D.17358, ip);
    if (ji != 0B) goto <D.17359>; else goto <D.17360>;
    <D.17359>:
    {
      char * msg;

      D.17361 = mono_jit_info_get_method (ji);
      ip.6 = (long int) ip;
      D.17363 = ji->code_start;
      D.17364 = (long int) D.17363;
      D.17365 = ip.6 - D.17364;
      D.17366 = (unsigned int) D.17365;
      msg = mono_debug_print_stack_frame (D.17361, D.17366, domain);
      monoeg_g_string_append_printf (text, "%s\n", msg);
      monoeg_g_free (msg);
    }
    goto <D.17367>;
    <D.17360>:
    D.17368 = (long unsigned int) i;
    D.17369 = D.17368 * 8;
    D.17370 = messages + D.17369;
    D.17371 = *D.17370;
    monoeg_g_string_append_printf (text, "%s\n", D.17371);
    <D.17367>:
  }
  i = i + 1;
  <D.16950>:
  if (i < len) goto <D.16949>; else goto <D.16951>;
  <D.16951>:
  free (messages);
  D.17351 = monoeg_g_string_free (text, 0);
  return D.17351;
}


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

  if (str != 0B) goto <D.17373>; else goto <D.17374>;
  <D.17373>:
  D.17375 = __strdup (str);
  return D.17375;
  <D.17374>:
  D.17375 = 0B;
  return D.17375;
}


ves_icall_Mono_Runtime_GetNativeStackTrace (struct MonoException * exc)
{
  struct MonoException * D.17379;
  struct MonoDomain * D.17380;
  struct MonoString * D.17381;
  char * trace;
  struct MonoString * res;

  if (exc == 0B) goto <D.17377>; else goto <D.17378>;
  <D.17377>:
  D.17379 = mono_get_exception_argument_null ("exception");
  mono_raise_exception (D.17379);
  <D.17378>:
  trace = mono_exception_get_native_backtrace (exc);
  D.17380 = mono_domain_get ();
  res = mono_string_new (D.17380, trace);
  monoeg_g_free (trace);
  D.17381 = res;
  return D.17381;
}


