mono_profiler_startup (const char * desc)
{
  struct GHashTable * D.13176;
  struct GHashTable * D.13177;
  struct GHashTable * D.13178;
  struct MonoProfiler * prof;

  prof = monoeg_malloc0 (16);
  pthread_mutex_init (&mismatched_files_section, 0B);
  D.13176 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->mismatched_files_hash = D.13176;
  D.13177 = monoeg_g_hash_table_new (0B, 0B);
  prof->saved_strings_hash = D.13177;
  D.13178 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->string_locations_hash = D.13178;
  mono_profiler_install (prof, profiler_shutdown);
  mono_profiler_install_runtime_initialized (runtime_initialized_cb);
  mono_profiler_install_iomap (mono_portability_iomap_event);
  mono_profiler_install_allocation (mono_portability_remember_alloc);
  mono_profiler_set_events (262272);
}


mono_portability_remember_alloc (struct MonoProfiler * prof, struct MonoObject * obj, struct MonoClass * klass)
{
  struct MonoClass * string_class.0;
  struct MonoDomain * D.13186;

  string_class.0 = string_class;
  if (klass != string_class.0) goto <D.13184>; else goto <D.13185>;
  <D.13184>:
  return;
  <D.13185>:
  D.13186 = mono_object_get_domain (obj);
  mono_portability_remember_string (prof, D.13186, obj);
}


mono_portability_remember_string (struct MonoProfiler * prof, struct MonoDomain * domain, struct MonoString * str)
{
  _Bool D.13191;
  _Bool D.13192;
  _Bool D.13193;
  int runtime_initialized.1;
  void *[64] * D.13196;
  int D.13197;
  int D.13198;
  struct GHashTable * D.13201;
  struct _SavedString * D.13204;
  struct SavedString * head;
  struct SavedString * entry;

  D.13191 = str == 0B;
  D.13192 = domain == 0B;
  D.13193 = D.13191 | D.13192;
  if (D.13193 != 0) goto <D.13189>; else goto <D.13194>;
  <D.13194>:
  runtime_initialized.1 = runtime_initialized;
  if (runtime_initialized.1 == 0) goto <D.13189>; else goto <D.13190>;
  <D.13189>:
  return;
  <D.13190>:
  entry = monoeg_malloc0 (272);
  entry->string = str;
  entry->domain = domain;
  D.13196 = &entry->stack;
  D.13197 = mono_stack_backtrace (prof, domain, D.13196, 64);
  entry->stack_entries = D.13197;
  D.13198 = entry->stack_entries;
  if (D.13198 == 0) goto <D.13199>; else goto <D.13200>;
  <D.13199>:
  monoeg_g_free (entry);
  return;
  <D.13200>:
  pthread_mutex_lock (&mismatched_files_section);
  D.13201 = prof->saved_strings_hash;
  head = monoeg_g_hash_table_lookup (D.13201, str);
  if (head != 0B) goto <D.13202>; else goto <D.13203>;
  <D.13202>:
  goto <D.13146>;
  <D.13145>:
  head = head->next;
  <D.13146>:
  D.13204 = head->next;
  if (D.13204 != 0B) goto <D.13145>; else goto <D.13147>;
  <D.13147>:
  head->next = entry;
  goto <D.13205>;
  <D.13203>:
  D.13201 = prof->saved_strings_hash;
  monoeg_g_hash_table_insert_replace (D.13201, str, entry, 0);
  <D.13205>:
  pthread_mutex_unlock (&mismatched_files_section);
}


mono_stack_backtrace (struct MonoProfiler * prof, struct MonoDomain * domain, void * * stack, int size)
{
  int D.13210;
  struct StackWalkData data;

  try
    {
      data.prof = prof;
      data.stack = stack;
      data.stack_size = size;
      data.frame_count = 0;
      mono_stack_walk_no_il (stack_walk_func, &data);
      D.13210 = data.frame_count;
      return D.13210;
    }
  finally
    {
      data = {CLOBBER};
    }
}


stack_walk_func (struct MonoMethod * method, gint32 native_offset, gint32 il_offset, gboolean managed, void * data)
{
  int D.13214;
  int D.13215;
  gboolean D.13218;
  void * * D.13219;
  int D.13220;
  int D.13221;
  unsigned int D.13222;
  unsigned int D.13223;
  void * * D.13224;
  struct StackWalkData * swdata;
  struct MonoStackBacktraceInfo * info;

  swdata = data;
  D.13214 = swdata->frame_count;
  D.13215 = swdata->stack_size;
  if (D.13214 >= D.13215) goto <D.13216>; else goto <D.13217>;
  <D.13216>:
  D.13218 = 1;
  return D.13218;
  <D.13217>:
  info = monoeg_malloc (8);
  info->method = method;
  info->native_offset = native_offset;
  D.13219 = swdata->stack;
  D.13214 = swdata->frame_count;
  D.13220 = D.13214;
  D.13221 = D.13220 + 1;
  swdata->frame_count = D.13221;
  D.13222 = (unsigned int) D.13220;
  D.13223 = D.13222 * 4;
  D.13224 = D.13219 + D.13223;
  *D.13224 = info;
  D.13218 = 0;
  return D.13218;
}


mono_portability_iomap_event (struct MonoProfiler * prof, const char * report, const char * pathname, const char * new_pathname)
{
  int runtime_initialized.2;
  unsigned int hash.3;
  struct GHashTable * D.13231;
  gchar * D.13234;
  gchar * D.13235;
  unsigned int hash.4;
  gchar * D.13240;
  unsigned int D.13241;
  unsigned int pathnameHash.5;
  unsigned int D.13244;
  unsigned int D.13245;
  guint32 hash;
  guint32 pathnameHash;
  struct MismatchedFilesStats * stats;

  try
    {
      runtime_initialized.2 = runtime_initialized;
      if (runtime_initialized.2 == 0) goto <D.13228>; else goto <D.13229>;
      <D.13228>:
      return;
      <D.13229>:
      pthread_mutex_lock (&mismatched_files_section);
      hash.3 = calc_strings_hash (pathname, new_pathname, &pathnameHash);
      hash = hash.3;
      D.13231 = prof->mismatched_files_hash;
      stats = monoeg_g_hash_table_lookup (D.13231, &hash);
      if (stats == 0B) goto <D.13232>; else goto <D.13233>;
      <D.13232>:
      {
        guint32 * hashptr;

        stats = monoeg_malloc (12);
        stats->count = 1;
        D.13234 = monoeg_strdup (pathname);
        stats->requestedName = D.13234;
        D.13235 = monoeg_strdup (new_pathname);
        stats->actualName = D.13235;
        hashptr = monoeg_malloc (4);
        if (hashptr != 0B) goto <D.13236>; else goto <D.13237>;
        <D.13236>:
        hash.4 = hash;
        *hashptr = hash.4;
        D.13231 = prof->mismatched_files_hash;
        monoeg_g_hash_table_insert_replace (D.13231, hashptr, stats, 0);
        goto <D.13239>;
        <D.13237>:
        monoeg_g_log (0B, 4, "Out of memory allocating integer pointer for mismatched files hash table.");
        <D.13164>:
        goto <D.13164>;
        <D.13239>:
        D.13240 = stats->requestedName;
        D.13241 = strlen (D.13240);
        pathnameHash.5 = pathnameHash;
        D.13240 = stats->requestedName;
        store_string_location (prof, D.13240, pathnameHash.5, D.13241);
        pthread_mutex_unlock (&mismatched_files_section);
        print_report ("%s -     Found file path: \'%s\'\n", report, new_pathname);
      }
      goto <D.13243>;
      <D.13233>:
      pthread_mutex_unlock (&mismatched_files_section);
      D.13244 = stats->count;
      D.13245 = D.13244 + 1;
      stats->count = D.13245;
      <D.13243>:
    }
  finally
    {
      hash = {CLOBBER};
      pathnameHash = {CLOBBER};
    }
}


calc_strings_hash (const gchar * str1, const gchar * str2, guint32 * str1hash)
{
  guint32 D.13258;
  guint32 hash;

  hash = do_calc_string_hash (0, str1);
  if (str1hash != 0B) goto <D.13256>; else goto <D.13257>;
  <D.13256>:
  *str1hash = hash;
  <D.13257>:
  D.13258 = do_calc_string_hash (hash, str2);
  return D.13258;
}


do_calc_string_hash (guint32 hash, const gchar * str)
{
  unsigned int D.13262;
  sizetype D.13263;
  unsigned int D.13264;
  unsigned int D.13265;
  char D.13266;
  unsigned int D.13267;
  gchar * D.13268;
  char D.13269;
  unsigned int D.13270;
  guint32 D.13273;
  guint32 ret;
  gchar * cc;
  gchar * end;

  ret = hash;
  cc = str;
  D.13262 = strlen (str);
  D.13263 = D.13262 + 4294967295;
  end = str + D.13263;
  goto <D.12994>;
  <D.12993>:
  D.13264 = ret << 5;
  D.13265 = D.13264 - ret;
  D.13266 = *cc;
  D.13267 = (unsigned int) D.13266;
  ret = D.13265 + D.13267;
  D.13264 = ret << 5;
  D.13265 = D.13264 - ret;
  D.13268 = cc + 1;
  D.13269 = *D.13268;
  D.13270 = (unsigned int) D.13269;
  ret = D.13265 + D.13270;
  cc = cc + 2;
  <D.12994>:
  if (cc < end) goto <D.12993>; else goto <D.12995>;
  <D.12995>:
  end = end + 1;
  if (cc < end) goto <D.13271>; else goto <D.13272>;
  <D.13271>:
  D.13264 = ret << 5;
  D.13265 = D.13264 - ret;
  D.13266 = *cc;
  D.13267 = (unsigned int) D.13266;
  ret = D.13265 + D.13267;
  <D.13272>:
  D.13273 = ret;
  return D.13273;
}


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

  if (str != 0B) goto <D.13275>; else goto <D.13276>;
  <D.13275>:
  D.13277 = __strdup (str);
  return D.13277;
  <D.13276>:
  D.13277 = 0B;
  return D.13277;
}


store_string_location (struct MonoProfiler * prof, const gchar * string, guint32 hash, size_t len)
{
  struct GHashTable * D.13279;
  unsigned int hash.6;
  struct GHashTable * D.13283;
  struct MonoString * D.13286;
  gchar * D.13287;
  struct StringLocation * location;
  struct SavedString * saved;
  struct SavedStringFindInfo info;
  guint32 * hashptr;

  try
    {
      D.13279 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13279, &hash);
      if (location != 0B) goto <D.13280>; else goto <D.13281>;
      <D.13280>:
      return;
      <D.13281>:
      hash.6 = hash;
      info.hash = hash.6;
      info.len = len;
      D.13283 = prof->saved_strings_hash;
      saved = monoeg_g_hash_table_find (D.13283, saved_strings_find_func, &info);
      hashptr = monoeg_malloc (4);
      hash.6 = hash;
      *hashptr = hash.6;
      location = monoeg_malloc0 (4);
      D.13279 = prof->string_locations_hash;
      monoeg_g_hash_table_insert_replace (D.13279, hashptr, location, 0);
      if (saved == 0B) goto <D.13284>; else goto <D.13285>;
      <D.13284>:
      return;
      <D.13285>:
      D.13286 = saved->string;
      D.13283 = prof->saved_strings_hash;
      monoeg_g_hash_table_remove (D.13283, D.13286);
      D.13287 = build_hint (saved);
      location->hint = D.13287;
    }
  finally
    {
      info = {CLOBBER};
    }
}


saved_strings_find_func (void * key, void * value, void * user_data)
{
  _Bool D.13299;
  _Bool D.13300;
  _Bool D.13301;
  struct MonoString * D.13303;
  int D.13304;
  unsigned int D.13305;
  unsigned int D.13306;
  gboolean D.13307;
  unsigned int D.13308;
  struct SavedStringFindInfo * info;
  struct SavedString * saved;
  gchar * utf_str;
  guint32 hash;

  info = user_data;
  saved = value;
  D.13299 = info == 0B;
  D.13300 = saved == 0B;
  D.13301 = D.13299 | D.13300;
  if (D.13301 != 0) goto <D.13297>; else goto <D.13302>;
  <D.13302>:
  D.13303 = saved->string;
  D.13304 = mono_string_length (D.13303);
  D.13305 = (unsigned int) D.13304;
  D.13306 = info->len;
  if (D.13305 != D.13306) goto <D.13297>; else goto <D.13298>;
  <D.13297>:
  D.13307 = 0;
  return D.13307;
  <D.13298>:
  D.13303 = saved->string;
  utf_str = mono_string_to_utf8 (D.13303);
  hash = do_calc_string_hash (0, utf_str);
  monoeg_g_free (utf_str);
  D.13308 = info->hash;
  if (D.13308 != hash) goto <D.13309>; else goto <D.13310>;
  <D.13309>:
  D.13307 = 0;
  return D.13307;
  <D.13310>:
  D.13307 = 1;
  return D.13307;
}


build_hint (struct SavedString * head)
{
  int D.13315;
  void *[64] * D.13316;
  struct MonoDomain * D.13317;
  struct GString * hint.7;
  unsigned int D.13323;
  gchar * D.13326;
  struct SavedString * current;
  gchar * tmp;
  struct GString * hint;

  try
    {
      hint = 0B;
      current = head;
      goto <D.13119>;
      <D.13120>:
      D.13315 = current->stack_entries;
      D.13316 = &current->stack;
      D.13317 = current->domain;
      tmp = build_hint_from_stack (D.13317, D.13316, D.13315);
      current = current->next;
      if (tmp == 0B) goto <D.13318>; else goto <D.13319>;
      <D.13318>:
      // predicted unlikely by continue predictor.
      goto <D.13119>;
      <D.13319>:
      append_report (&hint, tmp);
      <D.13119>:
      if (current != 0B) goto <D.13120>; else goto <D.13121>;
      <D.13121>:
      hint.7 = hint;
      if (hint.7 != 0B) goto <D.13321>; else goto <D.13322>;
      <D.13321>:
      hint.7 = hint;
      D.13323 = hint.7->len;
      if (D.13323 != 0) goto <D.13324>; else goto <D.13325>;
      <D.13324>:
      hint.7 = hint;
      D.13326 = monoeg_g_string_free (hint.7, 0);
      return D.13326;
      <D.13325>:
      hint.7 = hint;
      monoeg_g_string_free (hint.7, 0);
      D.13326 = 0B;
      return D.13326;
      <D.13322>:
      D.13326 = 0B;
      return D.13326;
    }
  finally
    {
      hint = {CLOBBER};
    }
}


build_hint_from_stack (struct MonoDomain * domain, void * * stack, gint stack_entries)
{
  unsigned int i.8;
  unsigned int D.13333;
  void * * D.13334;
  struct MonoMethod * iftmp.9;
  unsigned char D.13342;
  unsigned char D.13343;
  struct MonoClass * D.13346;
  unsigned char D.13351;
  int D.13352;
  struct MonoMethod * iftmp.10;
  int D.13362;
  struct GString * trace.11;
  struct MonoMethod * iftmp.12;
  int D.13375;
  unsigned int D.13376;
  unsigned int D.13379;
  char * D.13380;
  struct GString * trace.13;
  unsigned int D.13385;
  unsigned int native_offset.14;
  gchar * D.13394;
  gchar * hint;
  struct MonoMethod * method;
  struct MonoMethod * selectedMethod;
  struct MonoAssembly * assembly;
  struct MonoImage * image;
  struct MonoDebugSourceLocation * location;
  struct MonoStackBacktraceInfo * info;
  gboolean use_full_trace;
  char * methodName;
  gint i;
  gint native_offset;
  gint firstAvailable;

  selectedMethod = 0B;
  firstAvailable = -1;
  use_full_trace = 0;
  native_offset = -1;
  i = 0;
  goto <D.13103>;
  <D.13102>:
  i.8 = (unsigned int) i;
  D.13333 = i.8 * 4;
  D.13334 = stack + D.13333;
  info = *D.13334;
  if (info != 0B) goto <D.13336>; else goto <D.13337>;
  <D.13336>:
  iftmp.9 = info->method;
  goto <D.13338>;
  <D.13337>:
  iftmp.9 = 0B;
  <D.13338>:
  method = iftmp.9;
  if (method == 0B) goto <D.13339>; else goto <D.13341>;
  <D.13341>:
  D.13342 = BIT_FIELD_REF <*method, 8, 160>;
  D.13343 = D.13342 & 124;
  if (D.13343 != 0) goto <D.13339>; else goto <D.13340>;
  <D.13339>:
  // predicted unlikely by continue predictor.
  goto <D.13100>;
  <D.13340>:
  if (firstAvailable == -1) goto <D.13344>; else goto <D.13345>;
  <D.13344>:
  firstAvailable = i;
  <D.13345>:
  D.13346 = method->klass;
  image = D.13346->image;
  assembly = image->assembly;
  if (assembly != 0B) goto <D.13350>; else goto <D.13347>;
  <D.13350>:
  D.13351 = assembly->in_gac;
  if (D.13351 != 0) goto <D.13348>; else goto <D.13347>;
  <D.13347>:
  D.13352 = ignore_frame (method);
  if (D.13352 != 0) goto <D.13348>; else goto <D.13349>;
  <D.13348>:
  // predicted unlikely by continue predictor.
  goto <D.13100>;
  <D.13349>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13101>;
  <D.13100>:
  i = i + 1;
  <D.13103>:
  if (i < stack_entries) goto <D.13102>; else goto <D.13101>;
  <D.13101>:
  if (selectedMethod == 0B) goto <D.13353>; else goto <D.13354>;
  <D.13353>:
  i = 0;
  goto <D.13107>;
  <D.13106>:
  i.8 = (unsigned int) i;
  D.13333 = i.8 * 4;
  D.13334 = stack + D.13333;
  info = *D.13334;
  if (info != 0B) goto <D.13356>; else goto <D.13357>;
  <D.13356>:
  iftmp.10 = info->method;
  goto <D.13358>;
  <D.13357>:
  iftmp.10 = 0B;
  <D.13358>:
  method = iftmp.10;
  if (method == 0B) goto <D.13359>; else goto <D.13361>;
  <D.13361>:
  D.13362 = ignore_frame (method);
  if (D.13362 != 0) goto <D.13359>; else goto <D.13360>;
  <D.13359>:
  // predicted unlikely by continue predictor.
  goto <D.13104>;
  <D.13360>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13105>;
  <D.13104>:
  i = i + 1;
  <D.13107>:
  if (i < stack_entries) goto <D.13106>; else goto <D.13105>;
  <D.13105>:
  if (selectedMethod == 0B) goto <D.13363>; else goto <D.13364>;
  <D.13363>:
  use_full_trace = 1;
  <D.13364>:
  <D.13354>:
  hint = 0B;
  if (use_full_trace != 0) goto <D.13365>; else goto <D.13366>;
  <D.13365>:
  {
    struct GString * trace;

    try
      {
        trace.11 = monoeg_g_string_new ("Full trace:\n");
        trace = trace.11;
        i = firstAvailable;
        goto <D.13111>;
        <D.13110>:
        i.8 = (unsigned int) i;
        D.13333 = i.8 * 4;
        D.13334 = stack + D.13333;
        info = *D.13334;
        if (info != 0B) goto <D.13369>; else goto <D.13370>;
        <D.13369>:
        iftmp.12 = info->method;
        goto <D.13371>;
        <D.13370>:
        iftmp.12 = 0B;
        <D.13371>:
        method = iftmp.12;
        if (method == 0B) goto <D.13372>; else goto <D.13374>;
        <D.13374>:
        D.13342 = BIT_FIELD_REF <*method, 8, 160>;
        D.13343 = D.13342 & 124;
        if (D.13343 != 0) goto <D.13372>; else goto <D.13373>;
        <D.13372>:
        // predicted unlikely by continue predictor.
        goto <D.13109>;
        <D.13373>:
        D.13375 = info->native_offset;
        D.13376 = (unsigned int) D.13375;
        location = mono_debug_lookup_source_location (method, D.13376, domain);
        methodName = mono_method_full_name (method, 1);
        if (location != 0B) goto <D.13377>; else goto <D.13378>;
        <D.13377>:
        D.13379 = location->row;
        D.13380 = location->source_file;
        append_report (&trace, "        %s in %s:%u\n", methodName, D.13380, D.13379);
        mono_debug_free_source_location (location);
        goto <D.13381>;
        <D.13378>:
        append_report (&trace, "        %s\n", methodName);
        <D.13381>:
        monoeg_g_free (methodName);
        <D.13109>:
        i = i + 1;
        <D.13111>:
        if (i < stack_entries) goto <D.13110>; else goto <D.13112>;
        <D.13112>:
        trace.13 = trace;
        if (trace.13 != 0B) goto <D.13383>; else goto <D.13384>;
        <D.13383>:
        trace.13 = trace;
        D.13385 = trace.13->len;
        if (D.13385 != 0) goto <D.13386>; else goto <D.13387>;
        <D.13386>:
        trace.13 = trace;
        hint = monoeg_g_string_free (trace.13, 0);
        goto <D.13388>;
        <D.13387>:
        trace.13 = trace;
        monoeg_g_string_free (trace.13, 1);
        <D.13388>:
        <D.13384>:
      }
    finally
      {
        trace = {CLOBBER};
      }
  }
  goto <D.13389>;
  <D.13366>:
  native_offset.14 = (unsigned int) native_offset;
  location = mono_debug_lookup_source_location (selectedMethod, native_offset.14, domain);
  methodName = mono_method_full_name (selectedMethod, 1);
  if (location != 0B) goto <D.13391>; else goto <D.13392>;
  <D.13391>:
  D.13379 = location->row;
  D.13380 = location->source_file;
  hint = monoeg_g_strdup_printf ("        %s in %s:%u\n", methodName, D.13380, D.13379);
  mono_debug_free_source_location (location);
  goto <D.13393>;
  <D.13392>:
  hint = monoeg_g_strdup_printf ("        %s\n", methodName);
  <D.13393>:
  monoeg_g_free (methodName);
  <D.13389>:
  D.13394 = hint;
  return D.13394;
}


ignore_frame (struct MonoMethod * method)
{
  unsigned char D.13408;
  unsigned char D.13409;
  gboolean D.13412;
  struct MonoImage * D.13413;
  int D.13046;
  int iftmp.15;
  int D.13045;
  const char[9] * D.13419;
  unsigned char D.13420;
  int D.13421;
  unsigned char D.13422;
  int D.13423;
  _Bool D.13424;
  _Bool D.13425;
  _Bool D.13426;
  const unsigned char * D.13429;
  unsigned char D.13430;
  int D.13431;
  const unsigned char * D.13432;
  unsigned char D.13433;
  int D.13434;
  _Bool D.13435;
  _Bool D.13436;
  const unsigned char * D.13439;
  unsigned char D.13440;
  int D.13441;
  const unsigned char * D.13442;
  unsigned char D.13443;
  int D.13444;
  _Bool D.13445;
  _Bool D.13446;
  const unsigned char * D.13449;
  unsigned char D.13450;
  int D.13451;
  const unsigned char * D.13452;
  unsigned char D.13453;
  int D.13454;
  const char * D.13456;
  int D.13055;
  int iftmp.16;
  int D.13054;
  const char[7] * D.13462;
  unsigned char D.13463;
  int D.13464;
  unsigned char D.13465;
  int D.13466;
  _Bool D.13467;
  _Bool D.13468;
  _Bool D.13469;
  const unsigned char * D.13472;
  unsigned char D.13473;
  int D.13474;
  const unsigned char * D.13475;
  unsigned char D.13476;
  int D.13477;
  _Bool D.13478;
  _Bool D.13479;
  const unsigned char * D.13482;
  unsigned char D.13483;
  int D.13484;
  const unsigned char * D.13485;
  unsigned char D.13486;
  int D.13487;
  _Bool D.13488;
  _Bool D.13489;
  const unsigned char * D.13492;
  unsigned char D.13493;
  int D.13494;
  const unsigned char * D.13495;
  unsigned char D.13496;
  int D.13497;
  int D.13501;
  int D.13504;
  int D.13082;
  int iftmp.17;
  int D.13081;
  const char[6] * D.13510;
  unsigned char D.13511;
  int D.13512;
  unsigned char D.13513;
  int D.13514;
  _Bool D.13515;
  _Bool D.13516;
  _Bool D.13517;
  const unsigned char * D.13520;
  unsigned char D.13521;
  int D.13522;
  const unsigned char * D.13523;
  unsigned char D.13524;
  int D.13525;
  _Bool D.13526;
  _Bool D.13527;
  const unsigned char * D.13530;
  unsigned char D.13531;
  int D.13532;
  const unsigned char * D.13533;
  unsigned char D.13534;
  int D.13535;
  _Bool D.13536;
  _Bool D.13537;
  const unsigned char * D.13540;
  unsigned char D.13541;
  int D.13542;
  const unsigned char * D.13543;
  unsigned char D.13544;
  int D.13545;
  struct MonoClass * klass;

  klass = method->klass;
  D.13408 = BIT_FIELD_REF <*method, 8, 160>;
  D.13409 = D.13408 & 124;
  if (D.13409 != 0) goto <D.13410>; else goto <D.13411>;
  <D.13410>:
  D.13412 = 1;
  return D.13412;
  <D.13411>:
  D.13413 = klass->image;
  if (D.13413 != 0B) goto <D.13414>; else goto <D.13415>;
  <D.13414>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13413 = klass->image;
      __s2 = D.13413->assembly_name;
      D.13419 = "mscorlib";
      D.13420 = MEM[(const unsigned char *)D.13419];
      D.13421 = (int) D.13420;
      D.13422 = *__s2;
      D.13423 = (int) D.13422;
      __result = D.13421 - D.13423;
      {
        D.13424 = __s2_len != 0;
        D.13425 = __result == 0;
        D.13426 = D.13424 & D.13425;
        if (D.13426 != 0) goto <D.13427>; else goto <D.13428>;
        <D.13427>:
        D.13429 = &MEM[(void *)"mscorlib" + 1B];
        D.13430 = *D.13429;
        D.13431 = (int) D.13430;
        D.13432 = __s2 + 1;
        D.13433 = *D.13432;
        D.13434 = (int) D.13433;
        __result = D.13431 - D.13434;
        D.13435 = __s2_len > 1;
        D.13425 = __result == 0;
        D.13436 = D.13435 & D.13425;
        if (D.13436 != 0) goto <D.13437>; else goto <D.13438>;
        <D.13437>:
        D.13439 = &MEM[(void *)"mscorlib" + 2B];
        D.13440 = *D.13439;
        D.13441 = (int) D.13440;
        D.13442 = __s2 + 2;
        D.13443 = *D.13442;
        D.13444 = (int) D.13443;
        __result = D.13441 - D.13444;
        D.13445 = __s2_len > 2;
        D.13425 = __result == 0;
        D.13446 = D.13445 & D.13425;
        if (D.13446 != 0) goto <D.13447>; else goto <D.13448>;
        <D.13447>:
        D.13449 = &MEM[(void *)"mscorlib" + 3B];
        D.13450 = *D.13449;
        D.13451 = (int) D.13450;
        D.13452 = __s2 + 3;
        D.13453 = *D.13452;
        D.13454 = (int) D.13453;
        __result = D.13451 - D.13454;
        <D.13448>:
        <D.13438>:
        <D.13428>:
      }
      D.13045 = __result;
    }
    iftmp.15 = -D.13045;
    goto <D.13455>;
    <D.13418>:
    D.13413 = klass->image;
    D.13456 = D.13413->assembly_name;
    iftmp.15 = __builtin_strcmp (D.13456, "mscorlib");
    <D.13455>:
    D.13046 = iftmp.15;
  }
  if (D.13046 == 0) goto <D.13457>; else goto <D.13458>;
  <D.13457>:
  D.13412 = 1;
  return D.13412;
  <D.13458>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13413 = klass->image;
      __s2 = D.13413->assembly_name;
      D.13462 = "System";
      D.13463 = MEM[(const unsigned char *)D.13462];
      D.13464 = (int) D.13463;
      D.13465 = *__s2;
      D.13466 = (int) D.13465;
      __result = D.13464 - D.13466;
      {
        D.13467 = __s2_len != 0;
        D.13468 = __result == 0;
        D.13469 = D.13467 & D.13468;
        if (D.13469 != 0) goto <D.13470>; else goto <D.13471>;
        <D.13470>:
        D.13472 = &MEM[(void *)"System" + 1B];
        D.13473 = *D.13472;
        D.13474 = (int) D.13473;
        D.13475 = __s2 + 1;
        D.13476 = *D.13475;
        D.13477 = (int) D.13476;
        __result = D.13474 - D.13477;
        D.13478 = __s2_len > 1;
        D.13468 = __result == 0;
        D.13479 = D.13478 & D.13468;
        if (D.13479 != 0) goto <D.13480>; else goto <D.13481>;
        <D.13480>:
        D.13482 = &MEM[(void *)"System" + 2B];
        D.13483 = *D.13482;
        D.13484 = (int) D.13483;
        D.13485 = __s2 + 2;
        D.13486 = *D.13485;
        D.13487 = (int) D.13486;
        __result = D.13484 - D.13487;
        D.13488 = __s2_len > 2;
        D.13468 = __result == 0;
        D.13489 = D.13488 & D.13468;
        if (D.13489 != 0) goto <D.13490>; else goto <D.13491>;
        <D.13490>:
        D.13492 = &MEM[(void *)"System" + 3B];
        D.13493 = *D.13492;
        D.13494 = (int) D.13493;
        D.13495 = __s2 + 3;
        D.13496 = *D.13495;
        D.13497 = (int) D.13496;
        __result = D.13494 - D.13497;
        <D.13491>:
        <D.13481>:
        <D.13471>:
      }
      D.13054 = __result;
    }
    iftmp.16 = -D.13054;
    goto <D.13498>;
    <D.13461>:
    D.13413 = klass->image;
    D.13456 = D.13413->assembly_name;
    iftmp.16 = __builtin_strcmp (D.13456, "System");
    <D.13498>:
    D.13055 = iftmp.16;
  }
  if (D.13055 == 0) goto <D.13499>; else goto <D.13500>;
  <D.13499>:
  D.13412 = 1;
  return D.13412;
  <D.13500>:
  D.13413 = klass->image;
  D.13456 = D.13413->assembly_name;
  D.13501 = strncmp (D.13456, "Mono.", 5);
  if (D.13501 == 0) goto <D.13502>; else goto <D.13503>;
  <D.13502>:
  D.13412 = 1;
  return D.13412;
  <D.13503>:
  D.13413 = klass->image;
  D.13456 = D.13413->assembly_name;
  D.13504 = strncmp (D.13456, "System.", 7);
  if (D.13504 == 0) goto <D.13505>; else goto <D.13506>;
  <D.13505>:
  D.13412 = 1;
  return D.13412;
  <D.13506>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.13508>; else goto <D.13509>;
    <D.13508>:
    {
      const unsigned char * __s2;
      int __result;

      D.13413 = klass->image;
      __s2 = D.13413->assembly_name;
      D.13510 = "PEAPI";
      D.13511 = MEM[(const unsigned char *)D.13510];
      D.13512 = (int) D.13511;
      D.13513 = *__s2;
      D.13514 = (int) D.13513;
      __result = D.13512 - D.13514;
      {
        D.13515 = __s2_len != 0;
        D.13516 = __result == 0;
        D.13517 = D.13515 & D.13516;
        if (D.13517 != 0) goto <D.13518>; else goto <D.13519>;
        <D.13518>:
        D.13520 = &MEM[(void *)"PEAPI" + 1B];
        D.13521 = *D.13520;
        D.13522 = (int) D.13521;
        D.13523 = __s2 + 1;
        D.13524 = *D.13523;
        D.13525 = (int) D.13524;
        __result = D.13522 - D.13525;
        D.13526 = __s2_len > 1;
        D.13516 = __result == 0;
        D.13527 = D.13526 & D.13516;
        if (D.13527 != 0) goto <D.13528>; else goto <D.13529>;
        <D.13528>:
        D.13530 = &MEM[(void *)"PEAPI" + 2B];
        D.13531 = *D.13530;
        D.13532 = (int) D.13531;
        D.13533 = __s2 + 2;
        D.13534 = *D.13533;
        D.13535 = (int) D.13534;
        __result = D.13532 - D.13535;
        D.13536 = __s2_len > 2;
        D.13516 = __result == 0;
        D.13537 = D.13536 & D.13516;
        if (D.13537 != 0) goto <D.13538>; else goto <D.13539>;
        <D.13538>:
        D.13540 = &MEM[(void *)"PEAPI" + 3B];
        D.13541 = *D.13540;
        D.13542 = (int) D.13541;
        D.13543 = __s2 + 3;
        D.13544 = *D.13543;
        D.13545 = (int) D.13544;
        __result = D.13542 - D.13545;
        <D.13539>:
        <D.13529>:
        <D.13519>:
      }
      D.13081 = __result;
    }
    iftmp.17 = -D.13081;
    goto <D.13546>;
    <D.13509>:
    D.13413 = klass->image;
    D.13456 = D.13413->assembly_name;
    iftmp.17 = __builtin_strcmp (D.13456, "PEAPI");
    <D.13546>:
    D.13082 = iftmp.17;
  }
  if (D.13082 == 0) goto <D.13547>; else goto <D.13548>;
  <D.13547>:
  D.13412 = 1;
  return D.13412;
  <D.13548>:
  <D.13415>:
  D.13412 = 0;
  return D.13412;
}


append_report (struct GString * * report, const gchar * format)
{
  struct GString * D.13550;
  struct GString * D.13553;
  char * ap.18;
  char * ap;

  try
    {
      D.13550 = *report;
      if (D.13550 == 0B) goto <D.13551>; else goto <D.13552>;
      <D.13551>:
      D.13553 = monoeg_g_string_new ("");
      *report = D.13553;
      <D.13552>:
      __builtin_va_start (&ap, 0);
      ap.18 = ap;
      D.13550 = *report;
      monoeg_g_string_append_vprintf (D.13550, format, ap.18);
      __builtin_va_end (&ap);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


print_report (const gchar * format)
{
  struct _IO_FILE * stdout.19;
  char * ap.20;
  struct MonoImage * D.13560;
  struct MonoClass * klass;
  struct MonoProperty * prop;
  struct MonoString * str;
  char * stack_trace;
  char * ap;

  try
    {
      stdout.19 = stdout;
      fprintf (stdout.19, "-=-=-=-=-=-=- MONO_IOMAP REPORT -=-=-=-=-=-=-\n");
      __builtin_va_start (&ap, 0);
      ap.20 = ap;
      stdout.19 = stdout;
      vfprintf (stdout.19, format, ap.20);
      stdout.19 = stdout;
      fprintf (stdout.19, "\n");
      __builtin_va_end (&ap);
      D.13560 = mono_get_corlib ();
      klass = mono_class_from_name (D.13560, "System", "Environment");
      mono_class_init (klass);
      prop = mono_class_get_property_from_name (klass, "StackTrace");
      str = mono_property_get_value (prop, 0B, 0B, 0B);
      stack_trace = mono_string_to_utf8 (str);
      stdout.19 = stdout;
      fprintf (stdout.19, "-= Stack Trace =-\n%s\n\n", stack_trace);
      monoeg_g_free (stack_trace);
      stdout.19 = stdout;
      fflush (stdout.19);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


vfprintf (struct FILE * restrict __stream, const char * restrict __fmt, char * __ap)
{
  int D.13568;

  D.13568 = __vfprintf_chk (__stream, 1, __fmt, __ap);
  return D.13568;
}


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

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


runtime_initialized_cb (struct MonoProfiler * prof)
{
  struct MonoClass * string_class.21;

  runtime_initialized = 1;
  string_class.21 = mono_get_string_class ();
  string_class = string_class.21;
}


profiler_shutdown (struct MonoProfiler * prof)
{
  print_mismatched_stats (prof);
  pthread_mutex_destroy (&mismatched_files_section);
}


print_mismatched_stats (struct MonoProfiler * prof)
{
  struct GHashTable * D.13578;
  unsigned int D.13580;
  struct GHashTable * D.13581;
  unsigned int D.13582;
  _Bool D.13583;
  int D.13584;
  struct _IO_FILE * stdout.22;

  D.13578 = prof->mismatched_files_hash;
  if (D.13578 == 0B) goto <D.13576>; else goto <D.13579>;
  <D.13579>:
  D.13578 = prof->mismatched_files_hash;
  D.13580 = monoeg_g_hash_table_size (D.13578);
  if (D.13580 == 0) goto <D.13576>; else goto <D.13577>;
  <D.13576>:
  return;
  <D.13577>:
  D.13581 = prof->string_locations_hash;
  D.13582 = monoeg_g_hash_table_size (D.13581);
  D.13583 = D.13582 != 0;
  D.13584 = (int) D.13583;
  prof->may_have_locations = D.13584;
  stdout.22 = stdout;
  fprintf (stdout.22, "\n-=-=-=-=-=-=-= MONO_IOMAP Stats -=-=-=-=-=-=-=\n");
  D.13578 = prof->mismatched_files_hash;
  monoeg_g_hash_table_foreach (D.13578, mismatched_stats_foreach_func, prof);
  stdout.22 = stdout;
  fflush (stdout.22);
}


mismatched_stats_foreach_func (void * key, void * value, void * user_data)
{
  gchar * D.13589;
  unsigned int hash.23;
  gchar * D.13591;
  unsigned int D.13592;
  struct _IO_FILE * stdout.24;
  int D.13594;
  struct GHashTable * D.13597;
  gchar * D.13598;
  char D.13601;
  struct MismatchedFilesStats * stats;
  struct StringLocation * location;
  struct MonoProfiler * prof;
  guint32 hash;
  gboolean bannerShown;

  try
    {
      stats = value;
      prof = user_data;
      bannerShown = 0;
      D.13589 = stats->requestedName;
      hash.23 = do_calc_string_hash (0, D.13589);
      hash = hash.23;
      D.13591 = stats->actualName;
      D.13589 = stats->requestedName;
      D.13592 = stats->count;
      stdout.24 = stdout;
      fprintf (stdout.24, "    Count: %u\nRequested: %s\n   Actual: %s\n", D.13592, D.13589, D.13591);
      D.13594 = prof->may_have_locations;
      if (D.13594 == 0) goto <D.13595>; else goto <D.13596>;
      <D.13595>:
      stdout.24 = stdout;
      fprintf (stdout.24, "\n");
      return;
      <D.13596>:
      D.13597 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13597, &hash);
      goto <D.12974>;
      <D.12973>:
      D.13598 = location->hint;
      if (D.13598 != 0B) goto <D.13599>; else goto <D.13600>;
      <D.13599>:
      D.13598 = location->hint;
      D.13601 = MEM[(const char *)D.13598];
      if (D.13601 != 0) goto <D.13602>; else goto <D.13603>;
      <D.13602>:
      if (bannerShown == 0) goto <D.13604>; else goto <D.13605>;
      <D.13604>:
      stdout.24 = stdout;
      fprintf (stdout.24, "Locations:\n");
      bannerShown = 1;
      <D.13605>:
      D.13598 = location->hint;
      stdout.24 = stdout;
      fprintf (stdout.24, "%s", D.13598);
      <D.13603>:
      <D.13600>:
      location = location->next;
      if (location != 0B) goto <D.13606>; else goto <D.13607>;
      <D.13606>:
      stdout.24 = stdout;
      fprintf (stdout.24, "        --\n");
      <D.13607>:
      <D.12974>:
      if (location != 0B) goto <D.12973>; else goto <D.12975>;
      <D.12975>:
      stdout.24 = stdout;
      fprintf (stdout.24, "\n");
    }
  finally
    {
      hash = {CLOBBER};
    }
}


mismatched_files_guint32_equal (const void * key1, const void * key2)
{
  _Bool D.13614;
  _Bool D.13615;
  _Bool D.13616;
  gboolean D.13619;
  unsigned int D.13620;
  unsigned int D.13621;
  _Bool D.13622;

  D.13614 = key1 == 0B;
  D.13615 = key2 == 0B;
  D.13616 = D.13614 | D.13615;
  if (D.13616 != 0) goto <D.13617>; else goto <D.13618>;
  <D.13617>:
  D.13619 = 0;
  return D.13619;
  <D.13618>:
  D.13620 = MEM[(guint32 *)key1];
  D.13621 = MEM[(guint32 *)key2];
  D.13622 = D.13620 == D.13621;
  D.13619 = (gboolean) D.13622;
  return D.13619;
}


mismatched_files_guint32_hash (const void * key)
{
  guint D.13626;

  if (key == 0B) goto <D.13624>; else goto <D.13625>;
  <D.13624>:
  D.13626 = 0;
  return D.13626;
  <D.13625>:
  D.13626 = MEM[(guint32 *)key];
  return D.13626;
}


