mono_profiler_startup (const char * desc)
{
  struct GHashTable * D.13204;
  struct GHashTable * D.13205;
  struct GHashTable * D.13206;
  struct MonoProfiler * prof;

  prof = monoeg_malloc0 (16);
  pthread_mutex_init (&mismatched_files_section, 0B);
  D.13204 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->mismatched_files_hash = D.13204;
  D.13205 = monoeg_g_hash_table_new (0B, 0B);
  prof->saved_strings_hash = D.13205;
  D.13206 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->string_locations_hash = D.13206;
  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.13214;

  string_class.0 = string_class;
  if (klass != string_class.0) goto <D.13212>; else goto <D.13213>;
  <D.13212>:
  return;
  <D.13213>:
  D.13214 = mono_object_get_domain (obj);
  mono_portability_remember_string (prof, D.13214, obj);
}


mono_portability_remember_string (struct MonoProfiler * prof, struct MonoDomain * domain, struct MonoString * str)
{
  int runtime_initialized.1;
  void *[64] * D.13222;
  int D.13223;
  int D.13224;
  struct GHashTable * D.13227;
  struct _SavedString * D.13230;
  struct SavedString * head;
  struct SavedString * entry;

  if (str == 0B) goto <D.13217>; else goto <D.13219>;
  <D.13219>:
  if (domain == 0B) goto <D.13217>; else goto <D.13220>;
  <D.13220>:
  runtime_initialized.1 = runtime_initialized;
  if (runtime_initialized.1 == 0) goto <D.13217>; else goto <D.13218>;
  <D.13217>:
  return;
  <D.13218>:
  entry = monoeg_malloc0 (272);
  entry->string = str;
  entry->domain = domain;
  D.13222 = &entry->stack;
  D.13223 = mono_stack_backtrace (prof, domain, D.13222, 64);
  entry->stack_entries = D.13223;
  D.13224 = entry->stack_entries;
  if (D.13224 == 0) goto <D.13225>; else goto <D.13226>;
  <D.13225>:
  monoeg_g_free (entry);
  return;
  <D.13226>:
  pthread_mutex_lock (&mismatched_files_section);
  D.13227 = prof->saved_strings_hash;
  head = monoeg_g_hash_table_lookup (D.13227, str);
  if (head != 0B) goto <D.13228>; else goto <D.13229>;
  <D.13228>:
  goto <D.13174>;
  <D.13173>:
  head = head->next;
  <D.13174>:
  D.13230 = head->next;
  if (D.13230 != 0B) goto <D.13173>; else goto <D.13175>;
  <D.13175>:
  head->next = entry;
  goto <D.13231>;
  <D.13229>:
  D.13227 = prof->saved_strings_hash;
  monoeg_g_hash_table_insert_replace (D.13227, str, entry, 0);
  <D.13231>:
  pthread_mutex_unlock (&mismatched_files_section);
}


mono_stack_backtrace (struct MonoProfiler * prof, struct MonoDomain * domain, void * * stack, int size)
{
  int D.13236;
  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.13236 = data.frame_count;
      return D.13236;
    }
  finally
    {
      data = {CLOBBER};
    }
}


stack_walk_func (struct MonoMethod * method, gint32 native_offset, gint32 il_offset, gboolean managed, void * data)
{
  int D.13240;
  int D.13241;
  gboolean D.13244;
  void * * D.13245;
  int D.13246;
  int D.13247;
  unsigned int D.13248;
  unsigned int D.13249;
  void * * D.13250;
  struct StackWalkData * swdata;
  struct MonoStackBacktraceInfo * info;

  swdata = data;
  D.13240 = swdata->frame_count;
  D.13241 = swdata->stack_size;
  if (D.13240 >= D.13241) goto <D.13242>; else goto <D.13243>;
  <D.13242>:
  D.13244 = 1;
  return D.13244;
  <D.13243>:
  info = monoeg_malloc (8);
  info->method = method;
  info->native_offset = native_offset;
  D.13245 = swdata->stack;
  D.13240 = swdata->frame_count;
  D.13246 = D.13240;
  D.13247 = D.13246 + 1;
  swdata->frame_count = D.13247;
  D.13248 = (unsigned int) D.13246;
  D.13249 = D.13248 * 4;
  D.13250 = D.13245 + D.13249;
  *D.13250 = info;
  D.13244 = 0;
  return D.13244;
}


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.13257;
  gchar * D.13260;
  gchar * D.13261;
  unsigned int hash.4;
  gchar * D.13266;
  unsigned int pathnameHash.5;
  unsigned int D.13268;
  unsigned int D.13270;
  unsigned int D.13271;
  guint32 hash;
  guint32 pathnameHash;
  struct MismatchedFilesStats * stats;

  try
    {
      runtime_initialized.2 = runtime_initialized;
      if (runtime_initialized.2 == 0) goto <D.13254>; else goto <D.13255>;
      <D.13254>:
      return;
      <D.13255>:
      pthread_mutex_lock (&mismatched_files_section);
      hash.3 = calc_strings_hash (pathname, new_pathname, &pathnameHash);
      hash = hash.3;
      D.13257 = prof->mismatched_files_hash;
      stats = monoeg_g_hash_table_lookup (D.13257, &hash);
      if (stats == 0B) goto <D.13258>; else goto <D.13259>;
      <D.13258>:
      {
        guint32 * hashptr;

        stats = monoeg_malloc (12);
        stats->count = 1;
        D.13260 = monoeg_strdup (pathname);
        stats->requestedName = D.13260;
        D.13261 = monoeg_strdup (new_pathname);
        stats->actualName = D.13261;
        hashptr = monoeg_malloc (4);
        if (hashptr != 0B) goto <D.13262>; else goto <D.13263>;
        <D.13262>:
        hash.4 = hash;
        *hashptr = hash.4;
        D.13257 = prof->mismatched_files_hash;
        monoeg_g_hash_table_insert_replace (D.13257, hashptr, stats, 0);
        goto <D.13265>;
        <D.13263>:
        monoeg_g_log (0B, 4, "Out of memory allocating integer pointer for mismatched files hash table.");
        <D.13192>:
        goto <D.13192>;
        <D.13265>:
        D.13266 = stats->requestedName;
        pathnameHash.5 = pathnameHash;
        D.13266 = stats->requestedName;
        D.13268 = strlen (D.13266);
        store_string_location (prof, D.13266, pathnameHash.5, D.13268);
        pthread_mutex_unlock (&mismatched_files_section);
        print_report ("%s -     Found file path: \'%s\'\n", report, new_pathname);
      }
      goto <D.13269>;
      <D.13259>:
      pthread_mutex_unlock (&mismatched_files_section);
      D.13270 = stats->count;
      D.13271 = D.13270 + 1;
      stats->count = D.13271;
      <D.13269>:
    }
  finally
    {
      hash = {CLOBBER};
      pathnameHash = {CLOBBER};
    }
}


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

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


do_calc_string_hash (guint32 hash, const gchar * str)
{
  unsigned int D.13288;
  sizetype D.13289;
  unsigned int D.13290;
  unsigned int D.13291;
  char D.13292;
  unsigned int D.13293;
  gchar * D.13294;
  char D.13295;
  unsigned int D.13296;
  guint32 D.13299;
  guint32 ret;
  gchar * cc;
  gchar * end;

  ret = hash;
  cc = str;
  D.13288 = strlen (str);
  D.13289 = D.13288 + 4294967295;
  end = str + D.13289;
  goto <D.13022>;
  <D.13021>:
  D.13290 = ret << 5;
  D.13291 = D.13290 - ret;
  D.13292 = *cc;
  D.13293 = (unsigned int) D.13292;
  ret = D.13291 + D.13293;
  D.13290 = ret << 5;
  D.13291 = D.13290 - ret;
  D.13294 = cc + 1;
  D.13295 = *D.13294;
  D.13296 = (unsigned int) D.13295;
  ret = D.13291 + D.13296;
  cc = cc + 2;
  <D.13022>:
  if (cc < end) goto <D.13021>; else goto <D.13023>;
  <D.13023>:
  end = end + 1;
  if (cc < end) goto <D.13297>; else goto <D.13298>;
  <D.13297>:
  D.13290 = ret << 5;
  D.13291 = D.13290 - ret;
  D.13292 = *cc;
  D.13293 = (unsigned int) D.13292;
  ret = D.13291 + D.13293;
  <D.13298>:
  D.13299 = ret;
  return D.13299;
}


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

  if (str != 0B) goto <D.13301>; else goto <D.13302>;
  <D.13301>:
  D.13303 = __strdup (str);
  return D.13303;
  <D.13302>:
  D.13303 = 0B;
  return D.13303;
}


store_string_location (struct MonoProfiler * prof, const gchar * string, guint32 hash, size_t len)
{
  struct GHashTable * D.13305;
  unsigned int hash.6;
  struct GHashTable * D.13309;
  struct MonoString * D.13312;
  gchar * D.13313;
  struct StringLocation * location;
  struct SavedString * saved;
  struct SavedStringFindInfo info;
  guint32 * hashptr;

  try
    {
      D.13305 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13305, &hash);
      if (location != 0B) goto <D.13306>; else goto <D.13307>;
      <D.13306>:
      return;
      <D.13307>:
      hash.6 = hash;
      info.hash = hash.6;
      info.len = len;
      D.13309 = prof->saved_strings_hash;
      saved = monoeg_g_hash_table_find (D.13309, saved_strings_find_func, &info);
      hashptr = monoeg_malloc (4);
      hash.6 = hash;
      *hashptr = hash.6;
      location = monoeg_malloc0 (4);
      D.13305 = prof->string_locations_hash;
      monoeg_g_hash_table_insert_replace (D.13305, hashptr, location, 0);
      if (saved == 0B) goto <D.13310>; else goto <D.13311>;
      <D.13310>:
      return;
      <D.13311>:
      D.13309 = prof->saved_strings_hash;
      D.13312 = saved->string;
      monoeg_g_hash_table_remove (D.13309, D.13312);
      D.13313 = build_hint (saved);
      location->hint = D.13313;
    }
  finally
    {
      info = {CLOBBER};
    }
}


saved_strings_find_func (void * key, void * value, void * user_data)
{
  struct MonoString * D.13327;
  int D.13328;
  unsigned int D.13329;
  unsigned int D.13330;
  gboolean D.13331;
  unsigned int D.13332;
  struct SavedStringFindInfo * info;
  struct SavedString * saved;
  gchar * utf_str;
  guint32 hash;

  info = user_data;
  saved = value;
  if (info == 0B) goto <D.13323>; else goto <D.13325>;
  <D.13325>:
  if (saved == 0B) goto <D.13323>; else goto <D.13326>;
  <D.13326>:
  D.13327 = saved->string;
  D.13328 = mono_string_length (D.13327);
  D.13329 = (unsigned int) D.13328;
  D.13330 = info->len;
  if (D.13329 != D.13330) goto <D.13323>; else goto <D.13324>;
  <D.13323>:
  D.13331 = 0;
  return D.13331;
  <D.13324>:
  D.13327 = saved->string;
  utf_str = mono_string_to_utf8 (D.13327);
  hash = do_calc_string_hash (0, utf_str);
  monoeg_g_free (utf_str);
  D.13332 = info->hash;
  if (D.13332 != hash) goto <D.13333>; else goto <D.13334>;
  <D.13333>:
  D.13331 = 0;
  return D.13331;
  <D.13334>:
  D.13331 = 1;
  return D.13331;
}


build_hint (struct SavedString * head)
{
  struct MonoDomain * D.13339;
  void *[64] * D.13340;
  int D.13341;
  struct GString * hint.7;
  unsigned int D.13347;
  gchar * D.13350;
  struct SavedString * current;
  gchar * tmp;
  struct GString * hint;

  try
    {
      hint = 0B;
      current = head;
      goto <D.13147>;
      <D.13148>:
      D.13339 = current->domain;
      D.13340 = &current->stack;
      D.13341 = current->stack_entries;
      tmp = build_hint_from_stack (D.13339, D.13340, D.13341);
      current = current->next;
      if (tmp == 0B) goto <D.13342>; else goto <D.13343>;
      <D.13342>:
      // predicted unlikely by continue predictor.
      goto <D.13147>;
      <D.13343>:
      append_report (&hint, tmp);
      <D.13147>:
      if (current != 0B) goto <D.13148>; else goto <D.13149>;
      <D.13149>:
      hint.7 = hint;
      if (hint.7 != 0B) goto <D.13345>; else goto <D.13346>;
      <D.13345>:
      hint.7 = hint;
      D.13347 = hint.7->len;
      if (D.13347 != 0) goto <D.13348>; else goto <D.13349>;
      <D.13348>:
      hint.7 = hint;
      D.13350 = monoeg_g_string_free (hint.7, 0);
      return D.13350;
      <D.13349>:
      hint.7 = hint;
      monoeg_g_string_free (hint.7, 0);
      D.13350 = 0B;
      return D.13350;
      <D.13346>:
      D.13350 = 0B;
      return D.13350;
    }
  finally
    {
      hint = {CLOBBER};
    }
}


build_hint_from_stack (struct MonoDomain * domain, void * * stack, gint stack_entries)
{
  unsigned int i.8;
  unsigned int D.13357;
  void * * D.13358;
  struct MonoMethod * iftmp.9;
  unsigned int D.13366;
  unsigned int D.13367;
  struct MonoClass * D.13370;
  unsigned char D.13375;
  int D.13376;
  struct MonoMethod * iftmp.10;
  int D.13386;
  struct GString * trace.11;
  struct MonoMethod * iftmp.12;
  int D.13399;
  unsigned int D.13400;
  char * D.13403;
  unsigned int D.13404;
  struct GString * trace.13;
  unsigned int D.13409;
  unsigned int native_offset.14;
  gchar * D.13418;
  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.13131>;
  <D.13130>:
  i.8 = (unsigned int) i;
  D.13357 = i.8 * 4;
  D.13358 = stack + D.13357;
  info = *D.13358;
  if (info != 0B) goto <D.13360>; else goto <D.13361>;
  <D.13360>:
  iftmp.9 = info->method;
  goto <D.13362>;
  <D.13361>:
  iftmp.9 = 0B;
  <D.13362>:
  method = iftmp.9;
  if (method == 0B) goto <D.13363>; else goto <D.13365>;
  <D.13365>:
  D.13366 = BIT_FIELD_REF <*method, 32, 160>;
  D.13367 = D.13366 & 124;
  if (D.13367 != 0) goto <D.13363>; else goto <D.13364>;
  <D.13363>:
  // predicted unlikely by continue predictor.
  goto <D.13128>;
  <D.13364>:
  if (firstAvailable == -1) goto <D.13368>; else goto <D.13369>;
  <D.13368>:
  firstAvailable = i;
  <D.13369>:
  D.13370 = method->klass;
  image = D.13370->image;
  assembly = image->assembly;
  if (assembly != 0B) goto <D.13374>; else goto <D.13371>;
  <D.13374>:
  D.13375 = assembly->in_gac;
  if (D.13375 != 0) goto <D.13372>; else goto <D.13371>;
  <D.13371>:
  D.13376 = ignore_frame (method);
  if (D.13376 != 0) goto <D.13372>; else goto <D.13373>;
  <D.13372>:
  // predicted unlikely by continue predictor.
  goto <D.13128>;
  <D.13373>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13129>;
  <D.13128>:
  i = i + 1;
  <D.13131>:
  if (i < stack_entries) goto <D.13130>; else goto <D.13129>;
  <D.13129>:
  if (selectedMethod == 0B) goto <D.13377>; else goto <D.13378>;
  <D.13377>:
  i = 0;
  goto <D.13135>;
  <D.13134>:
  i.8 = (unsigned int) i;
  D.13357 = i.8 * 4;
  D.13358 = stack + D.13357;
  info = *D.13358;
  if (info != 0B) goto <D.13380>; else goto <D.13381>;
  <D.13380>:
  iftmp.10 = info->method;
  goto <D.13382>;
  <D.13381>:
  iftmp.10 = 0B;
  <D.13382>:
  method = iftmp.10;
  if (method == 0B) goto <D.13383>; else goto <D.13385>;
  <D.13385>:
  D.13386 = ignore_frame (method);
  if (D.13386 != 0) goto <D.13383>; else goto <D.13384>;
  <D.13383>:
  // predicted unlikely by continue predictor.
  goto <D.13132>;
  <D.13384>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13133>;
  <D.13132>:
  i = i + 1;
  <D.13135>:
  if (i < stack_entries) goto <D.13134>; else goto <D.13133>;
  <D.13133>:
  if (selectedMethod == 0B) goto <D.13387>; else goto <D.13388>;
  <D.13387>:
  use_full_trace = 1;
  <D.13388>:
  <D.13378>:
  hint = 0B;
  if (use_full_trace != 0) goto <D.13389>; else goto <D.13390>;
  <D.13389>:
  {
    struct GString * trace;

    try
      {
        trace.11 = monoeg_g_string_new ("Full trace:\n");
        trace = trace.11;
        i = firstAvailable;
        goto <D.13139>;
        <D.13138>:
        i.8 = (unsigned int) i;
        D.13357 = i.8 * 4;
        D.13358 = stack + D.13357;
        info = *D.13358;
        if (info != 0B) goto <D.13393>; else goto <D.13394>;
        <D.13393>:
        iftmp.12 = info->method;
        goto <D.13395>;
        <D.13394>:
        iftmp.12 = 0B;
        <D.13395>:
        method = iftmp.12;
        if (method == 0B) goto <D.13396>; else goto <D.13398>;
        <D.13398>:
        D.13366 = BIT_FIELD_REF <*method, 32, 160>;
        D.13367 = D.13366 & 124;
        if (D.13367 != 0) goto <D.13396>; else goto <D.13397>;
        <D.13396>:
        // predicted unlikely by continue predictor.
        goto <D.13137>;
        <D.13397>:
        D.13399 = info->native_offset;
        D.13400 = (unsigned int) D.13399;
        location = mono_debug_lookup_source_location (method, D.13400, domain);
        methodName = mono_method_full_name (method, 1);
        if (location != 0B) goto <D.13401>; else goto <D.13402>;
        <D.13401>:
        D.13403 = location->source_file;
        D.13404 = location->row;
        append_report (&trace, "        %s in %s:%u\n", methodName, D.13403, D.13404);
        mono_debug_free_source_location (location);
        goto <D.13405>;
        <D.13402>:
        append_report (&trace, "        %s\n", methodName);
        <D.13405>:
        monoeg_g_free (methodName);
        <D.13137>:
        i = i + 1;
        <D.13139>:
        if (i < stack_entries) goto <D.13138>; else goto <D.13140>;
        <D.13140>:
        trace.13 = trace;
        if (trace.13 != 0B) goto <D.13407>; else goto <D.13408>;
        <D.13407>:
        trace.13 = trace;
        D.13409 = trace.13->len;
        if (D.13409 != 0) goto <D.13410>; else goto <D.13411>;
        <D.13410>:
        trace.13 = trace;
        hint = monoeg_g_string_free (trace.13, 0);
        goto <D.13412>;
        <D.13411>:
        trace.13 = trace;
        monoeg_g_string_free (trace.13, 1);
        <D.13412>:
        <D.13408>:
      }
    finally
      {
        trace = {CLOBBER};
      }
  }
  goto <D.13413>;
  <D.13390>:
  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.13415>; else goto <D.13416>;
  <D.13415>:
  D.13403 = location->source_file;
  D.13404 = location->row;
  hint = monoeg_g_strdup_printf ("        %s in %s:%u\n", methodName, D.13403, D.13404);
  mono_debug_free_source_location (location);
  goto <D.13417>;
  <D.13416>:
  hint = monoeg_g_strdup_printf ("        %s\n", methodName);
  <D.13417>:
  monoeg_g_free (methodName);
  <D.13413>:
  D.13418 = hint;
  return D.13418;
}


ignore_frame (struct MonoMethod * method)
{
  unsigned int D.13432;
  unsigned int D.13433;
  gboolean D.13436;
  struct MonoImage * D.13437;
  int D.13074;
  int iftmp.15;
  int D.13073;
  const char[9] * D.13443;
  unsigned char D.13444;
  int D.13445;
  unsigned char D.13446;
  int D.13447;
  const unsigned char * D.13452;
  unsigned char D.13453;
  int D.13454;
  const unsigned char * D.13455;
  unsigned char D.13456;
  int D.13457;
  const unsigned char * D.13462;
  unsigned char D.13463;
  int D.13464;
  const unsigned char * D.13465;
  unsigned char D.13466;
  int D.13467;
  const unsigned char * D.13472;
  unsigned char D.13473;
  int D.13474;
  const unsigned char * D.13475;
  unsigned char D.13476;
  int D.13477;
  const char * D.13479;
  int D.13083;
  int iftmp.16;
  int D.13082;
  const char[7] * D.13485;
  unsigned char D.13486;
  int D.13487;
  unsigned char D.13488;
  int D.13489;
  const unsigned char * D.13494;
  unsigned char D.13495;
  int D.13496;
  const unsigned char * D.13497;
  unsigned char D.13498;
  int D.13499;
  const unsigned char * D.13504;
  unsigned char D.13505;
  int D.13506;
  const unsigned char * D.13507;
  unsigned char D.13508;
  int D.13509;
  const unsigned char * D.13514;
  unsigned char D.13515;
  int D.13516;
  const unsigned char * D.13517;
  unsigned char D.13518;
  int D.13519;
  int D.13523;
  int D.13526;
  int D.13110;
  int iftmp.17;
  int D.13109;
  const char[6] * D.13532;
  unsigned char D.13533;
  int D.13534;
  unsigned char D.13535;
  int D.13536;
  const unsigned char * D.13541;
  unsigned char D.13542;
  int D.13543;
  const unsigned char * D.13544;
  unsigned char D.13545;
  int D.13546;
  const unsigned char * D.13551;
  unsigned char D.13552;
  int D.13553;
  const unsigned char * D.13554;
  unsigned char D.13555;
  int D.13556;
  const unsigned char * D.13561;
  unsigned char D.13562;
  int D.13563;
  const unsigned char * D.13564;
  unsigned char D.13565;
  int D.13566;
  struct MonoClass * klass;

  klass = method->klass;
  D.13432 = BIT_FIELD_REF <*method, 32, 160>;
  D.13433 = D.13432 & 124;
  if (D.13433 != 0) goto <D.13434>; else goto <D.13435>;
  <D.13434>:
  D.13436 = 1;
  return D.13436;
  <D.13435>:
  D.13437 = klass->image;
  if (D.13437 != 0B) goto <D.13438>; else goto <D.13439>;
  <D.13438>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13437 = klass->image;
      __s2 = D.13437->assembly_name;
      D.13443 = "mscorlib";
      D.13444 = MEM[(const unsigned char *)D.13443];
      D.13445 = (int) D.13444;
      D.13446 = *__s2;
      D.13447 = (int) D.13446;
      __result = D.13445 - D.13447;
      {
        if (__s2_len != 0) goto <D.13448>; else goto <D.13449>;
        <D.13448>:
        if (__result == 0) goto <D.13450>; else goto <D.13451>;
        <D.13450>:
        D.13452 = &MEM[(void *)"mscorlib" + 1B];
        D.13453 = *D.13452;
        D.13454 = (int) D.13453;
        D.13455 = __s2 + 1;
        D.13456 = *D.13455;
        D.13457 = (int) D.13456;
        __result = D.13454 - D.13457;
        if (__s2_len > 1) goto <D.13458>; else goto <D.13459>;
        <D.13458>:
        if (__result == 0) goto <D.13460>; else goto <D.13461>;
        <D.13460>:
        D.13462 = &MEM[(void *)"mscorlib" + 2B];
        D.13463 = *D.13462;
        D.13464 = (int) D.13463;
        D.13465 = __s2 + 2;
        D.13466 = *D.13465;
        D.13467 = (int) D.13466;
        __result = D.13464 - D.13467;
        if (__s2_len > 2) goto <D.13468>; else goto <D.13469>;
        <D.13468>:
        if (__result == 0) goto <D.13470>; else goto <D.13471>;
        <D.13470>:
        D.13472 = &MEM[(void *)"mscorlib" + 3B];
        D.13473 = *D.13472;
        D.13474 = (int) D.13473;
        D.13475 = __s2 + 3;
        D.13476 = *D.13475;
        D.13477 = (int) D.13476;
        __result = D.13474 - D.13477;
        <D.13471>:
        <D.13469>:
        <D.13461>:
        <D.13459>:
        <D.13451>:
        <D.13449>:
      }
      D.13073 = __result;
    }
    iftmp.15 = -D.13073;
    goto <D.13478>;
    <D.13442>:
    D.13437 = klass->image;
    D.13479 = D.13437->assembly_name;
    iftmp.15 = __builtin_strcmp (D.13479, "mscorlib");
    <D.13478>:
    D.13074 = iftmp.15;
  }
  if (D.13074 == 0) goto <D.13480>; else goto <D.13481>;
  <D.13480>:
  D.13436 = 1;
  return D.13436;
  <D.13481>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13437 = klass->image;
      __s2 = D.13437->assembly_name;
      D.13485 = "System";
      D.13486 = MEM[(const unsigned char *)D.13485];
      D.13487 = (int) D.13486;
      D.13488 = *__s2;
      D.13489 = (int) D.13488;
      __result = D.13487 - D.13489;
      {
        if (__s2_len != 0) goto <D.13490>; else goto <D.13491>;
        <D.13490>:
        if (__result == 0) goto <D.13492>; else goto <D.13493>;
        <D.13492>:
        D.13494 = &MEM[(void *)"System" + 1B];
        D.13495 = *D.13494;
        D.13496 = (int) D.13495;
        D.13497 = __s2 + 1;
        D.13498 = *D.13497;
        D.13499 = (int) D.13498;
        __result = D.13496 - D.13499;
        if (__s2_len > 1) goto <D.13500>; else goto <D.13501>;
        <D.13500>:
        if (__result == 0) goto <D.13502>; else goto <D.13503>;
        <D.13502>:
        D.13504 = &MEM[(void *)"System" + 2B];
        D.13505 = *D.13504;
        D.13506 = (int) D.13505;
        D.13507 = __s2 + 2;
        D.13508 = *D.13507;
        D.13509 = (int) D.13508;
        __result = D.13506 - D.13509;
        if (__s2_len > 2) goto <D.13510>; else goto <D.13511>;
        <D.13510>:
        if (__result == 0) goto <D.13512>; else goto <D.13513>;
        <D.13512>:
        D.13514 = &MEM[(void *)"System" + 3B];
        D.13515 = *D.13514;
        D.13516 = (int) D.13515;
        D.13517 = __s2 + 3;
        D.13518 = *D.13517;
        D.13519 = (int) D.13518;
        __result = D.13516 - D.13519;
        <D.13513>:
        <D.13511>:
        <D.13503>:
        <D.13501>:
        <D.13493>:
        <D.13491>:
      }
      D.13082 = __result;
    }
    iftmp.16 = -D.13082;
    goto <D.13520>;
    <D.13484>:
    D.13437 = klass->image;
    D.13479 = D.13437->assembly_name;
    iftmp.16 = __builtin_strcmp (D.13479, "System");
    <D.13520>:
    D.13083 = iftmp.16;
  }
  if (D.13083 == 0) goto <D.13521>; else goto <D.13522>;
  <D.13521>:
  D.13436 = 1;
  return D.13436;
  <D.13522>:
  D.13437 = klass->image;
  D.13479 = D.13437->assembly_name;
  D.13523 = strncmp (D.13479, "Mono.", 5);
  if (D.13523 == 0) goto <D.13524>; else goto <D.13525>;
  <D.13524>:
  D.13436 = 1;
  return D.13436;
  <D.13525>:
  D.13437 = klass->image;
  D.13479 = D.13437->assembly_name;
  D.13526 = strncmp (D.13479, "System.", 7);
  if (D.13526 == 0) goto <D.13527>; else goto <D.13528>;
  <D.13527>:
  D.13436 = 1;
  return D.13436;
  <D.13528>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13437 = klass->image;
      __s2 = D.13437->assembly_name;
      D.13532 = "PEAPI";
      D.13533 = MEM[(const unsigned char *)D.13532];
      D.13534 = (int) D.13533;
      D.13535 = *__s2;
      D.13536 = (int) D.13535;
      __result = D.13534 - D.13536;
      {
        if (__s2_len != 0) goto <D.13537>; else goto <D.13538>;
        <D.13537>:
        if (__result == 0) goto <D.13539>; else goto <D.13540>;
        <D.13539>:
        D.13541 = &MEM[(void *)"PEAPI" + 1B];
        D.13542 = *D.13541;
        D.13543 = (int) D.13542;
        D.13544 = __s2 + 1;
        D.13545 = *D.13544;
        D.13546 = (int) D.13545;
        __result = D.13543 - D.13546;
        if (__s2_len > 1) goto <D.13547>; else goto <D.13548>;
        <D.13547>:
        if (__result == 0) goto <D.13549>; else goto <D.13550>;
        <D.13549>:
        D.13551 = &MEM[(void *)"PEAPI" + 2B];
        D.13552 = *D.13551;
        D.13553 = (int) D.13552;
        D.13554 = __s2 + 2;
        D.13555 = *D.13554;
        D.13556 = (int) D.13555;
        __result = D.13553 - D.13556;
        if (__s2_len > 2) goto <D.13557>; else goto <D.13558>;
        <D.13557>:
        if (__result == 0) goto <D.13559>; else goto <D.13560>;
        <D.13559>:
        D.13561 = &MEM[(void *)"PEAPI" + 3B];
        D.13562 = *D.13561;
        D.13563 = (int) D.13562;
        D.13564 = __s2 + 3;
        D.13565 = *D.13564;
        D.13566 = (int) D.13565;
        __result = D.13563 - D.13566;
        <D.13560>:
        <D.13558>:
        <D.13550>:
        <D.13548>:
        <D.13540>:
        <D.13538>:
      }
      D.13109 = __result;
    }
    iftmp.17 = -D.13109;
    goto <D.13567>;
    <D.13531>:
    D.13437 = klass->image;
    D.13479 = D.13437->assembly_name;
    iftmp.17 = __builtin_strcmp (D.13479, "PEAPI");
    <D.13567>:
    D.13110 = iftmp.17;
  }
  if (D.13110 == 0) goto <D.13568>; else goto <D.13569>;
  <D.13568>:
  D.13436 = 1;
  return D.13436;
  <D.13569>:
  <D.13439>:
  D.13436 = 0;
  return D.13436;
}


append_report (struct GString * * report, const gchar * format)
{
  struct GString * D.13571;
  struct GString * D.13574;
  void * ap.18;
  void * ap;

  try
    {
      D.13571 = *report;
      if (D.13571 == 0B) goto <D.13572>; else goto <D.13573>;
      <D.13572>:
      D.13574 = monoeg_g_string_new ("");
      *report = D.13574;
      <D.13573>:
      __builtin_va_start (&ap, 0);
      D.13571 = *report;
      ap.18 = ap;
      monoeg_g_string_append_vprintf (D.13571, format, ap.18);
      __builtin_va_end (&ap);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


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

  try
    {
      stdout.19 = stdout;
      fprintf (stdout.19, "-=-=-=-=-=-=- MONO_IOMAP REPORT -=-=-=-=-=-=-\n");
      __builtin_va_start (&ap, 0);
      stdout.19 = stdout;
      ap.20 = ap;
      vfprintf (stdout.19, format, ap.20);
      stdout.19 = stdout;
      fprintf (stdout.19, "\n");
      __builtin_va_end (&ap);
      D.13581 = mono_get_corlib ();
      klass = mono_class_from_name (D.13581, "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, void * __ap)
{
  int D.13589;

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


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

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


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.13599;
  unsigned int D.13601;
  struct GHashTable * D.13602;
  unsigned int D.13603;
  _Bool D.13604;
  int D.13605;
  struct _IO_FILE * stdout.22;

  D.13599 = prof->mismatched_files_hash;
  if (D.13599 == 0B) goto <D.13597>; else goto <D.13600>;
  <D.13600>:
  D.13599 = prof->mismatched_files_hash;
  D.13601 = monoeg_g_hash_table_size (D.13599);
  if (D.13601 == 0) goto <D.13597>; else goto <D.13598>;
  <D.13597>:
  return;
  <D.13598>:
  D.13602 = prof->string_locations_hash;
  D.13603 = monoeg_g_hash_table_size (D.13602);
  D.13604 = D.13603 != 0;
  D.13605 = (int) D.13604;
  prof->may_have_locations = D.13605;
  stdout.22 = stdout;
  fprintf (stdout.22, "\n-=-=-=-=-=-=-= MONO_IOMAP Stats -=-=-=-=-=-=-=\n");
  D.13599 = prof->mismatched_files_hash;
  monoeg_g_hash_table_foreach (D.13599, mismatched_stats_foreach_func, prof);
  stdout.22 = stdout;
  fflush (stdout.22);
}


mismatched_stats_foreach_func (void * key, void * value, void * user_data)
{
  gchar * D.13610;
  unsigned int hash.23;
  struct _IO_FILE * stdout.24;
  unsigned int D.13613;
  gchar * D.13614;
  int D.13615;
  struct GHashTable * D.13618;
  gchar * D.13619;
  char D.13622;
  struct MismatchedFilesStats * stats;
  struct StringLocation * location;
  struct MonoProfiler * prof;
  guint32 hash;
  gboolean bannerShown;

  try
    {
      stats = value;
      prof = user_data;
      bannerShown = 0;
      D.13610 = stats->requestedName;
      hash.23 = do_calc_string_hash (0, D.13610);
      hash = hash.23;
      stdout.24 = stdout;
      D.13613 = stats->count;
      D.13610 = stats->requestedName;
      D.13614 = stats->actualName;
      fprintf (stdout.24, "    Count: %u\nRequested: %s\n   Actual: %s\n", D.13613, D.13610, D.13614);
      D.13615 = prof->may_have_locations;
      if (D.13615 == 0) goto <D.13616>; else goto <D.13617>;
      <D.13616>:
      stdout.24 = stdout;
      fprintf (stdout.24, "\n");
      return;
      <D.13617>:
      D.13618 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13618, &hash);
      goto <D.13002>;
      <D.13001>:
      D.13619 = location->hint;
      if (D.13619 != 0B) goto <D.13620>; else goto <D.13621>;
      <D.13620>:
      D.13619 = location->hint;
      D.13622 = MEM[(const char *)D.13619];
      if (D.13622 != 0) goto <D.13623>; else goto <D.13624>;
      <D.13623>:
      if (bannerShown == 0) goto <D.13625>; else goto <D.13626>;
      <D.13625>:
      stdout.24 = stdout;
      fprintf (stdout.24, "Locations:\n");
      bannerShown = 1;
      <D.13626>:
      stdout.24 = stdout;
      D.13619 = location->hint;
      fprintf (stdout.24, "%s", D.13619);
      <D.13624>:
      <D.13621>:
      location = location->next;
      if (location != 0B) goto <D.13627>; else goto <D.13628>;
      <D.13627>:
      stdout.24 = stdout;
      fprintf (stdout.24, "        --\n");
      <D.13628>:
      <D.13002>:
      if (location != 0B) goto <D.13001>; else goto <D.13003>;
      <D.13003>:
      stdout.24 = stdout;
      fprintf (stdout.24, "\n");
    }
  finally
    {
      hash = {CLOBBER};
    }
}


mismatched_files_guint32_equal (const void * key1, const void * key2)
{
  gboolean D.13638;
  unsigned int D.13639;
  unsigned int D.13640;
  _Bool D.13641;

  if (key1 == 0B) goto <D.13635>; else goto <D.13637>;
  <D.13637>:
  if (key2 == 0B) goto <D.13635>; else goto <D.13636>;
  <D.13635>:
  D.13638 = 0;
  return D.13638;
  <D.13636>:
  D.13639 = MEM[(guint32 *)key1];
  D.13640 = MEM[(guint32 *)key2];
  D.13641 = D.13639 == D.13640;
  D.13638 = (gboolean) D.13641;
  return D.13638;
}


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

  if (key == 0B) goto <D.13643>; else goto <D.13644>;
  <D.13643>:
  D.13645 = 0;
  return D.13645;
  <D.13644>:
  D.13645 = MEM[(guint32 *)key];
  return D.13645;
}


