mono_profiler_startup (const char * desc)
{
  struct GHashTable * D.13526;
  struct GHashTable * D.13527;
  struct GHashTable * D.13528;
  struct MonoProfiler * prof;

  prof = monoeg_malloc0 (32);
  pthread_mutex_init (&mismatched_files_section, 0B);
  D.13526 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->mismatched_files_hash = D.13526;
  D.13527 = monoeg_g_hash_table_new (0B, 0B);
  prof->saved_strings_hash = D.13527;
  D.13528 = monoeg_g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
  prof->string_locations_hash = D.13528;
  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.13536;

  string_class.0 = string_class;
  if (klass != string_class.0) goto <D.13534>; else goto <D.13535>;
  <D.13534>:
  return;
  <D.13535>:
  D.13536 = mono_object_get_domain (obj);
  mono_portability_remember_string (prof, D.13536, obj);
}


mono_portability_remember_string (struct MonoProfiler * prof, struct MonoDomain * domain, struct MonoString * str)
{
  _Bool D.13541;
  _Bool D.13542;
  _Bool D.13543;
  int runtime_initialized.1;
  void *[64] * D.13546;
  int D.13547;
  int D.13548;
  struct GHashTable * D.13551;
  struct _SavedString * D.13554;
  struct SavedString * head;
  struct SavedString * entry;

  D.13541 = str == 0B;
  D.13542 = domain == 0B;
  D.13543 = D.13541 | D.13542;
  if (D.13543 != 0) goto <D.13539>; else goto <D.13544>;
  <D.13544>:
  runtime_initialized.1 = runtime_initialized;
  if (runtime_initialized.1 == 0) goto <D.13539>; else goto <D.13540>;
  <D.13539>:
  return;
  <D.13540>:
  entry = monoeg_malloc0 (544);
  entry->string = str;
  entry->domain = domain;
  D.13546 = &entry->stack;
  D.13547 = mono_stack_backtrace (prof, domain, D.13546, 64);
  entry->stack_entries = D.13547;
  D.13548 = entry->stack_entries;
  if (D.13548 == 0) goto <D.13549>; else goto <D.13550>;
  <D.13549>:
  monoeg_g_free (entry);
  return;
  <D.13550>:
  pthread_mutex_lock (&mismatched_files_section);
  D.13551 = prof->saved_strings_hash;
  head = monoeg_g_hash_table_lookup (D.13551, str);
  if (head != 0B) goto <D.13552>; else goto <D.13553>;
  <D.13552>:
  goto <D.13496>;
  <D.13495>:
  head = head->next;
  <D.13496>:
  D.13554 = head->next;
  if (D.13554 != 0B) goto <D.13495>; else goto <D.13497>;
  <D.13497>:
  head->next = entry;
  goto <D.13555>;
  <D.13553>:
  D.13551 = prof->saved_strings_hash;
  monoeg_g_hash_table_insert_replace (D.13551, str, entry, 0);
  <D.13555>:
  pthread_mutex_unlock (&mismatched_files_section);
}


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


stack_walk_func (struct MonoMethod * method, gint32 native_offset, gint32 il_offset, gboolean managed, void * data)
{
  int D.13564;
  int D.13565;
  gboolean D.13568;
  void * * D.13569;
  int D.13570;
  int D.13571;
  long unsigned int D.13572;
  long unsigned int D.13573;
  void * * D.13574;
  struct StackWalkData * swdata;
  struct MonoStackBacktraceInfo * info;

  swdata = data;
  D.13564 = swdata->frame_count;
  D.13565 = swdata->stack_size;
  if (D.13564 >= D.13565) goto <D.13566>; else goto <D.13567>;
  <D.13566>:
  D.13568 = 1;
  return D.13568;
  <D.13567>:
  info = monoeg_malloc (16);
  info->method = method;
  info->native_offset = native_offset;
  D.13569 = swdata->stack;
  D.13564 = swdata->frame_count;
  D.13570 = D.13564;
  D.13571 = D.13570 + 1;
  swdata->frame_count = D.13571;
  D.13572 = (long unsigned int) D.13570;
  D.13573 = D.13572 * 8;
  D.13574 = D.13569 + D.13573;
  *D.13574 = info;
  D.13568 = 0;
  return D.13568;
}


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.13581;
  gchar * D.13584;
  gchar * D.13585;
  unsigned int hash.4;
  gchar * D.13590;
  long unsigned int D.13591;
  unsigned int pathnameHash.5;
  unsigned int D.13594;
  unsigned int D.13595;
  guint32 hash;
  guint32 pathnameHash;
  struct MismatchedFilesStats * stats;

  try
    {
      runtime_initialized.2 = runtime_initialized;
      if (runtime_initialized.2 == 0) goto <D.13578>; else goto <D.13579>;
      <D.13578>:
      return;
      <D.13579>:
      pthread_mutex_lock (&mismatched_files_section);
      hash.3 = calc_strings_hash (pathname, new_pathname, &pathnameHash);
      hash = hash.3;
      D.13581 = prof->mismatched_files_hash;
      stats = monoeg_g_hash_table_lookup (D.13581, &hash);
      if (stats == 0B) goto <D.13582>; else goto <D.13583>;
      <D.13582>:
      {
        guint32 * hashptr;

        stats = monoeg_malloc (24);
        stats->count = 1;
        D.13584 = monoeg_strdup (pathname);
        stats->requestedName = D.13584;
        D.13585 = monoeg_strdup (new_pathname);
        stats->actualName = D.13585;
        hashptr = monoeg_malloc (4);
        if (hashptr != 0B) goto <D.13586>; else goto <D.13587>;
        <D.13586>:
        hash.4 = hash;
        *hashptr = hash.4;
        D.13581 = prof->mismatched_files_hash;
        monoeg_g_hash_table_insert_replace (D.13581, hashptr, stats, 0);
        goto <D.13589>;
        <D.13587>:
        monoeg_g_log (0B, 4, "Out of memory allocating integer pointer for mismatched files hash table.");
        <D.13514>:
        goto <D.13514>;
        <D.13589>:
        D.13590 = stats->requestedName;
        D.13591 = strlen (D.13590);
        pathnameHash.5 = pathnameHash;
        D.13590 = stats->requestedName;
        store_string_location (prof, D.13590, pathnameHash.5, D.13591);
        pthread_mutex_unlock (&mismatched_files_section);
        print_report ("%s -     Found file path: \'%s\'\n", report, new_pathname);
      }
      goto <D.13593>;
      <D.13583>:
      pthread_mutex_unlock (&mismatched_files_section);
      D.13594 = stats->count;
      D.13595 = D.13594 + 1;
      stats->count = D.13595;
      <D.13593>:
    }
  finally
    {
      hash = {CLOBBER};
      pathnameHash = {CLOBBER};
    }
}


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

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


do_calc_string_hash (guint32 hash, const gchar * str)
{
  long unsigned int D.13612;
  sizetype D.13613;
  unsigned int D.13614;
  unsigned int D.13615;
  char D.13616;
  unsigned int D.13617;
  gchar * D.13618;
  char D.13619;
  unsigned int D.13620;
  guint32 D.13623;
  guint32 ret;
  gchar * cc;
  gchar * end;

  ret = hash;
  cc = str;
  D.13612 = strlen (str);
  D.13613 = D.13612 + 18446744073709551615;
  end = str + D.13613;
  goto <D.13344>;
  <D.13343>:
  D.13614 = ret << 5;
  D.13615 = D.13614 - ret;
  D.13616 = *cc;
  D.13617 = (unsigned int) D.13616;
  ret = D.13615 + D.13617;
  D.13614 = ret << 5;
  D.13615 = D.13614 - ret;
  D.13618 = cc + 1;
  D.13619 = *D.13618;
  D.13620 = (unsigned int) D.13619;
  ret = D.13615 + D.13620;
  cc = cc + 2;
  <D.13344>:
  if (cc < end) goto <D.13343>; else goto <D.13345>;
  <D.13345>:
  end = end + 1;
  if (cc < end) goto <D.13621>; else goto <D.13622>;
  <D.13621>:
  D.13614 = ret << 5;
  D.13615 = D.13614 - ret;
  D.13616 = *cc;
  D.13617 = (unsigned int) D.13616;
  ret = D.13615 + D.13617;
  <D.13622>:
  D.13623 = ret;
  return D.13623;
}


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

  if (str != 0B) goto <D.13625>; else goto <D.13626>;
  <D.13625>:
  D.13627 = __strdup (str);
  return D.13627;
  <D.13626>:
  D.13627 = 0B;
  return D.13627;
}


store_string_location (struct MonoProfiler * prof, const gchar * string, guint32 hash, size_t len)
{
  struct GHashTable * D.13629;
  unsigned int hash.6;
  struct GHashTable * D.13633;
  struct MonoString * D.13636;
  gchar * D.13637;
  struct StringLocation * location;
  struct SavedString * saved;
  struct SavedStringFindInfo info;
  guint32 * hashptr;

  try
    {
      D.13629 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13629, &hash);
      if (location != 0B) goto <D.13630>; else goto <D.13631>;
      <D.13630>:
      return;
      <D.13631>:
      hash.6 = hash;
      info.hash = hash.6;
      info.len = len;
      D.13633 = prof->saved_strings_hash;
      saved = monoeg_g_hash_table_find (D.13633, saved_strings_find_func, &info);
      hashptr = monoeg_malloc (4);
      hash.6 = hash;
      *hashptr = hash.6;
      location = monoeg_malloc0 (8);
      D.13629 = prof->string_locations_hash;
      monoeg_g_hash_table_insert_replace (D.13629, hashptr, location, 0);
      if (saved == 0B) goto <D.13634>; else goto <D.13635>;
      <D.13634>:
      return;
      <D.13635>:
      D.13636 = saved->string;
      D.13633 = prof->saved_strings_hash;
      monoeg_g_hash_table_remove (D.13633, D.13636);
      D.13637 = build_hint (saved);
      location->hint = D.13637;
    }
  finally
    {
      info = {CLOBBER};
    }
}


saved_strings_find_func (void * key, void * value, void * user_data)
{
  _Bool D.13649;
  _Bool D.13650;
  _Bool D.13651;
  struct MonoString * D.13653;
  int D.13654;
  long unsigned int D.13655;
  long unsigned int D.13656;
  gboolean D.13657;
  unsigned int D.13658;
  struct SavedStringFindInfo * info;
  struct SavedString * saved;
  gchar * utf_str;
  guint32 hash;

  info = user_data;
  saved = value;
  D.13649 = info == 0B;
  D.13650 = saved == 0B;
  D.13651 = D.13649 | D.13650;
  if (D.13651 != 0) goto <D.13647>; else goto <D.13652>;
  <D.13652>:
  D.13653 = saved->string;
  D.13654 = mono_string_length (D.13653);
  D.13655 = (long unsigned int) D.13654;
  D.13656 = info->len;
  if (D.13655 != D.13656) goto <D.13647>; else goto <D.13648>;
  <D.13647>:
  D.13657 = 0;
  return D.13657;
  <D.13648>:
  D.13653 = saved->string;
  utf_str = mono_string_to_utf8 (D.13653);
  hash = do_calc_string_hash (0, utf_str);
  monoeg_g_free (utf_str);
  D.13658 = info->hash;
  if (D.13658 != hash) goto <D.13659>; else goto <D.13660>;
  <D.13659>:
  D.13657 = 0;
  return D.13657;
  <D.13660>:
  D.13657 = 1;
  return D.13657;
}


build_hint (struct SavedString * head)
{
  int D.13665;
  void *[64] * D.13666;
  struct MonoDomain * D.13667;
  struct GString * hint.7;
  long unsigned int D.13673;
  gchar * D.13676;
  struct SavedString * current;
  gchar * tmp;
  struct GString * hint;

  try
    {
      hint = 0B;
      current = head;
      goto <D.13469>;
      <D.13470>:
      D.13665 = current->stack_entries;
      D.13666 = &current->stack;
      D.13667 = current->domain;
      tmp = build_hint_from_stack (D.13667, D.13666, D.13665);
      current = current->next;
      if (tmp == 0B) goto <D.13668>; else goto <D.13669>;
      <D.13668>:
      // predicted unlikely by continue predictor.
      goto <D.13469>;
      <D.13669>:
      append_report (&hint, tmp);
      <D.13469>:
      if (current != 0B) goto <D.13470>; else goto <D.13471>;
      <D.13471>:
      hint.7 = hint;
      if (hint.7 != 0B) goto <D.13671>; else goto <D.13672>;
      <D.13671>:
      hint.7 = hint;
      D.13673 = hint.7->len;
      if (D.13673 != 0) goto <D.13674>; else goto <D.13675>;
      <D.13674>:
      hint.7 = hint;
      D.13676 = monoeg_g_string_free (hint.7, 0);
      return D.13676;
      <D.13675>:
      hint.7 = hint;
      monoeg_g_string_free (hint.7, 0);
      D.13676 = 0B;
      return D.13676;
      <D.13672>:
      D.13676 = 0B;
      return D.13676;
    }
  finally
    {
      hint = {CLOBBER};
    }
}


build_hint_from_stack (struct MonoDomain * domain, void * * stack, gint stack_entries)
{
  long unsigned int D.13682;
  long unsigned int D.13683;
  void * * D.13684;
  struct MonoMethod * iftmp.8;
  unsigned char D.13692;
  unsigned char D.13693;
  struct MonoClass * D.13696;
  unsigned char D.13701;
  int D.13702;
  struct MonoMethod * iftmp.9;
  int D.13712;
  struct GString * trace.10;
  struct MonoMethod * iftmp.11;
  int D.13725;
  unsigned int D.13726;
  unsigned int D.13729;
  char * D.13730;
  struct GString * trace.12;
  long unsigned int D.13735;
  unsigned int native_offset.13;
  gchar * D.13744;
  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.13453>;
  <D.13452>:
  D.13682 = (long unsigned int) i;
  D.13683 = D.13682 * 8;
  D.13684 = stack + D.13683;
  info = *D.13684;
  if (info != 0B) goto <D.13686>; else goto <D.13687>;
  <D.13686>:
  iftmp.8 = info->method;
  goto <D.13688>;
  <D.13687>:
  iftmp.8 = 0B;
  <D.13688>:
  method = iftmp.8;
  if (method == 0B) goto <D.13689>; else goto <D.13691>;
  <D.13691>:
  D.13692 = BIT_FIELD_REF <*method, 8, 256>;
  D.13693 = D.13692 & 124;
  if (D.13693 != 0) goto <D.13689>; else goto <D.13690>;
  <D.13689>:
  // predicted unlikely by continue predictor.
  goto <D.13450>;
  <D.13690>:
  if (firstAvailable == -1) goto <D.13694>; else goto <D.13695>;
  <D.13694>:
  firstAvailable = i;
  <D.13695>:
  D.13696 = method->klass;
  image = D.13696->image;
  assembly = image->assembly;
  if (assembly != 0B) goto <D.13700>; else goto <D.13697>;
  <D.13700>:
  D.13701 = assembly->in_gac;
  if (D.13701 != 0) goto <D.13698>; else goto <D.13697>;
  <D.13697>:
  D.13702 = ignore_frame (method);
  if (D.13702 != 0) goto <D.13698>; else goto <D.13699>;
  <D.13698>:
  // predicted unlikely by continue predictor.
  goto <D.13450>;
  <D.13699>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13451>;
  <D.13450>:
  i = i + 1;
  <D.13453>:
  if (i < stack_entries) goto <D.13452>; else goto <D.13451>;
  <D.13451>:
  if (selectedMethod == 0B) goto <D.13703>; else goto <D.13704>;
  <D.13703>:
  i = 0;
  goto <D.13457>;
  <D.13456>:
  D.13682 = (long unsigned int) i;
  D.13683 = D.13682 * 8;
  D.13684 = stack + D.13683;
  info = *D.13684;
  if (info != 0B) goto <D.13706>; else goto <D.13707>;
  <D.13706>:
  iftmp.9 = info->method;
  goto <D.13708>;
  <D.13707>:
  iftmp.9 = 0B;
  <D.13708>:
  method = iftmp.9;
  if (method == 0B) goto <D.13709>; else goto <D.13711>;
  <D.13711>:
  D.13712 = ignore_frame (method);
  if (D.13712 != 0) goto <D.13709>; else goto <D.13710>;
  <D.13709>:
  // predicted unlikely by continue predictor.
  goto <D.13454>;
  <D.13710>:
  selectedMethod = method;
  native_offset = info->native_offset;
  goto <D.13455>;
  <D.13454>:
  i = i + 1;
  <D.13457>:
  if (i < stack_entries) goto <D.13456>; else goto <D.13455>;
  <D.13455>:
  if (selectedMethod == 0B) goto <D.13713>; else goto <D.13714>;
  <D.13713>:
  use_full_trace = 1;
  <D.13714>:
  <D.13704>:
  hint = 0B;
  if (use_full_trace != 0) goto <D.13715>; else goto <D.13716>;
  <D.13715>:
  {
    struct GString * trace;

    try
      {
        trace.10 = monoeg_g_string_new ("Full trace:\n");
        trace = trace.10;
        i = firstAvailable;
        goto <D.13461>;
        <D.13460>:
        D.13682 = (long unsigned int) i;
        D.13683 = D.13682 * 8;
        D.13684 = stack + D.13683;
        info = *D.13684;
        if (info != 0B) goto <D.13719>; else goto <D.13720>;
        <D.13719>:
        iftmp.11 = info->method;
        goto <D.13721>;
        <D.13720>:
        iftmp.11 = 0B;
        <D.13721>:
        method = iftmp.11;
        if (method == 0B) goto <D.13722>; else goto <D.13724>;
        <D.13724>:
        D.13692 = BIT_FIELD_REF <*method, 8, 256>;
        D.13693 = D.13692 & 124;
        if (D.13693 != 0) goto <D.13722>; else goto <D.13723>;
        <D.13722>:
        // predicted unlikely by continue predictor.
        goto <D.13459>;
        <D.13723>:
        D.13725 = info->native_offset;
        D.13726 = (unsigned int) D.13725;
        location = mono_debug_lookup_source_location (method, D.13726, domain);
        methodName = mono_method_full_name (method, 1);
        if (location != 0B) goto <D.13727>; else goto <D.13728>;
        <D.13727>:
        D.13729 = location->row;
        D.13730 = location->source_file;
        append_report (&trace, "        %s in %s:%u\n", methodName, D.13730, D.13729);
        mono_debug_free_source_location (location);
        goto <D.13731>;
        <D.13728>:
        append_report (&trace, "        %s\n", methodName);
        <D.13731>:
        monoeg_g_free (methodName);
        <D.13459>:
        i = i + 1;
        <D.13461>:
        if (i < stack_entries) goto <D.13460>; else goto <D.13462>;
        <D.13462>:
        trace.12 = trace;
        if (trace.12 != 0B) goto <D.13733>; else goto <D.13734>;
        <D.13733>:
        trace.12 = trace;
        D.13735 = trace.12->len;
        if (D.13735 != 0) goto <D.13736>; else goto <D.13737>;
        <D.13736>:
        trace.12 = trace;
        hint = monoeg_g_string_free (trace.12, 0);
        goto <D.13738>;
        <D.13737>:
        trace.12 = trace;
        monoeg_g_string_free (trace.12, 1);
        <D.13738>:
        <D.13734>:
      }
    finally
      {
        trace = {CLOBBER};
      }
  }
  goto <D.13739>;
  <D.13716>:
  native_offset.13 = (unsigned int) native_offset;
  location = mono_debug_lookup_source_location (selectedMethod, native_offset.13, domain);
  methodName = mono_method_full_name (selectedMethod, 1);
  if (location != 0B) goto <D.13741>; else goto <D.13742>;
  <D.13741>:
  D.13729 = location->row;
  D.13730 = location->source_file;
  hint = monoeg_g_strdup_printf ("        %s in %s:%u\n", methodName, D.13730, D.13729);
  mono_debug_free_source_location (location);
  goto <D.13743>;
  <D.13742>:
  hint = monoeg_g_strdup_printf ("        %s\n", methodName);
  <D.13743>:
  monoeg_g_free (methodName);
  <D.13739>:
  D.13744 = hint;
  return D.13744;
}


ignore_frame (struct MonoMethod * method)
{
  unsigned char D.13758;
  unsigned char D.13759;
  gboolean D.13762;
  struct MonoImage * D.13763;
  int D.13396;
  int iftmp.14;
  int D.13395;
  const char[9] * D.13769;
  unsigned char D.13770;
  int D.13771;
  unsigned char D.13772;
  int D.13773;
  _Bool D.13774;
  _Bool D.13775;
  _Bool D.13776;
  const unsigned char * D.13779;
  unsigned char D.13780;
  int D.13781;
  const unsigned char * D.13782;
  unsigned char D.13783;
  int D.13784;
  _Bool D.13785;
  _Bool D.13786;
  const unsigned char * D.13789;
  unsigned char D.13790;
  int D.13791;
  const unsigned char * D.13792;
  unsigned char D.13793;
  int D.13794;
  _Bool D.13795;
  _Bool D.13796;
  const unsigned char * D.13799;
  unsigned char D.13800;
  int D.13801;
  const unsigned char * D.13802;
  unsigned char D.13803;
  int D.13804;
  const char * D.13806;
  int D.13405;
  int iftmp.15;
  int D.13404;
  const char[7] * D.13812;
  unsigned char D.13813;
  int D.13814;
  unsigned char D.13815;
  int D.13816;
  _Bool D.13817;
  _Bool D.13818;
  _Bool D.13819;
  const unsigned char * D.13822;
  unsigned char D.13823;
  int D.13824;
  const unsigned char * D.13825;
  unsigned char D.13826;
  int D.13827;
  _Bool D.13828;
  _Bool D.13829;
  const unsigned char * D.13832;
  unsigned char D.13833;
  int D.13834;
  const unsigned char * D.13835;
  unsigned char D.13836;
  int D.13837;
  _Bool D.13838;
  _Bool D.13839;
  const unsigned char * D.13842;
  unsigned char D.13843;
  int D.13844;
  const unsigned char * D.13845;
  unsigned char D.13846;
  int D.13847;
  int D.13851;
  int D.13854;
  int D.13432;
  int iftmp.16;
  int D.13431;
  const char[6] * D.13860;
  unsigned char D.13861;
  int D.13862;
  unsigned char D.13863;
  int D.13864;
  _Bool D.13865;
  _Bool D.13866;
  _Bool D.13867;
  const unsigned char * D.13870;
  unsigned char D.13871;
  int D.13872;
  const unsigned char * D.13873;
  unsigned char D.13874;
  int D.13875;
  _Bool D.13876;
  _Bool D.13877;
  const unsigned char * D.13880;
  unsigned char D.13881;
  int D.13882;
  const unsigned char * D.13883;
  unsigned char D.13884;
  int D.13885;
  _Bool D.13886;
  _Bool D.13887;
  const unsigned char * D.13890;
  unsigned char D.13891;
  int D.13892;
  const unsigned char * D.13893;
  unsigned char D.13894;
  int D.13895;
  struct MonoClass * klass;

  klass = method->klass;
  D.13758 = BIT_FIELD_REF <*method, 8, 256>;
  D.13759 = D.13758 & 124;
  if (D.13759 != 0) goto <D.13760>; else goto <D.13761>;
  <D.13760>:
  D.13762 = 1;
  return D.13762;
  <D.13761>:
  D.13763 = klass->image;
  if (D.13763 != 0B) goto <D.13764>; else goto <D.13765>;
  <D.13764>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13763 = klass->image;
      __s2 = D.13763->assembly_name;
      D.13769 = "mscorlib";
      D.13770 = MEM[(const unsigned char *)D.13769];
      D.13771 = (int) D.13770;
      D.13772 = *__s2;
      D.13773 = (int) D.13772;
      __result = D.13771 - D.13773;
      {
        D.13774 = __s2_len != 0;
        D.13775 = __result == 0;
        D.13776 = D.13774 & D.13775;
        if (D.13776 != 0) goto <D.13777>; else goto <D.13778>;
        <D.13777>:
        D.13779 = &MEM[(void *)"mscorlib" + 1B];
        D.13780 = *D.13779;
        D.13781 = (int) D.13780;
        D.13782 = __s2 + 1;
        D.13783 = *D.13782;
        D.13784 = (int) D.13783;
        __result = D.13781 - D.13784;
        D.13785 = __s2_len > 1;
        D.13775 = __result == 0;
        D.13786 = D.13785 & D.13775;
        if (D.13786 != 0) goto <D.13787>; else goto <D.13788>;
        <D.13787>:
        D.13789 = &MEM[(void *)"mscorlib" + 2B];
        D.13790 = *D.13789;
        D.13791 = (int) D.13790;
        D.13792 = __s2 + 2;
        D.13793 = *D.13792;
        D.13794 = (int) D.13793;
        __result = D.13791 - D.13794;
        D.13795 = __s2_len > 2;
        D.13775 = __result == 0;
        D.13796 = D.13795 & D.13775;
        if (D.13796 != 0) goto <D.13797>; else goto <D.13798>;
        <D.13797>:
        D.13799 = &MEM[(void *)"mscorlib" + 3B];
        D.13800 = *D.13799;
        D.13801 = (int) D.13800;
        D.13802 = __s2 + 3;
        D.13803 = *D.13802;
        D.13804 = (int) D.13803;
        __result = D.13801 - D.13804;
        <D.13798>:
        <D.13788>:
        <D.13778>:
      }
      D.13395 = __result;
    }
    iftmp.14 = -D.13395;
    goto <D.13805>;
    <D.13768>:
    D.13763 = klass->image;
    D.13806 = D.13763->assembly_name;
    iftmp.14 = __builtin_strcmp (D.13806, "mscorlib");
    <D.13805>:
    D.13396 = iftmp.14;
  }
  if (D.13396 == 0) goto <D.13807>; else goto <D.13808>;
  <D.13807>:
  D.13762 = 1;
  return D.13762;
  <D.13808>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13763 = klass->image;
      __s2 = D.13763->assembly_name;
      D.13812 = "System";
      D.13813 = MEM[(const unsigned char *)D.13812];
      D.13814 = (int) D.13813;
      D.13815 = *__s2;
      D.13816 = (int) D.13815;
      __result = D.13814 - D.13816;
      {
        D.13817 = __s2_len != 0;
        D.13818 = __result == 0;
        D.13819 = D.13817 & D.13818;
        if (D.13819 != 0) goto <D.13820>; else goto <D.13821>;
        <D.13820>:
        D.13822 = &MEM[(void *)"System" + 1B];
        D.13823 = *D.13822;
        D.13824 = (int) D.13823;
        D.13825 = __s2 + 1;
        D.13826 = *D.13825;
        D.13827 = (int) D.13826;
        __result = D.13824 - D.13827;
        D.13828 = __s2_len > 1;
        D.13818 = __result == 0;
        D.13829 = D.13828 & D.13818;
        if (D.13829 != 0) goto <D.13830>; else goto <D.13831>;
        <D.13830>:
        D.13832 = &MEM[(void *)"System" + 2B];
        D.13833 = *D.13832;
        D.13834 = (int) D.13833;
        D.13835 = __s2 + 2;
        D.13836 = *D.13835;
        D.13837 = (int) D.13836;
        __result = D.13834 - D.13837;
        D.13838 = __s2_len > 2;
        D.13818 = __result == 0;
        D.13839 = D.13838 & D.13818;
        if (D.13839 != 0) goto <D.13840>; else goto <D.13841>;
        <D.13840>:
        D.13842 = &MEM[(void *)"System" + 3B];
        D.13843 = *D.13842;
        D.13844 = (int) D.13843;
        D.13845 = __s2 + 3;
        D.13846 = *D.13845;
        D.13847 = (int) D.13846;
        __result = D.13844 - D.13847;
        <D.13841>:
        <D.13831>:
        <D.13821>:
      }
      D.13404 = __result;
    }
    iftmp.15 = -D.13404;
    goto <D.13848>;
    <D.13811>:
    D.13763 = klass->image;
    D.13806 = D.13763->assembly_name;
    iftmp.15 = __builtin_strcmp (D.13806, "System");
    <D.13848>:
    D.13405 = iftmp.15;
  }
  if (D.13405 == 0) goto <D.13849>; else goto <D.13850>;
  <D.13849>:
  D.13762 = 1;
  return D.13762;
  <D.13850>:
  D.13763 = klass->image;
  D.13806 = D.13763->assembly_name;
  D.13851 = strncmp (D.13806, "Mono.", 5);
  if (D.13851 == 0) goto <D.13852>; else goto <D.13853>;
  <D.13852>:
  D.13762 = 1;
  return D.13762;
  <D.13853>:
  D.13763 = klass->image;
  D.13806 = D.13763->assembly_name;
  D.13854 = strncmp (D.13806, "System.", 7);
  if (D.13854 == 0) goto <D.13855>; else goto <D.13856>;
  <D.13855>:
  D.13762 = 1;
  return D.13762;
  <D.13856>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.13763 = klass->image;
      __s2 = D.13763->assembly_name;
      D.13860 = "PEAPI";
      D.13861 = MEM[(const unsigned char *)D.13860];
      D.13862 = (int) D.13861;
      D.13863 = *__s2;
      D.13864 = (int) D.13863;
      __result = D.13862 - D.13864;
      {
        D.13865 = __s2_len != 0;
        D.13866 = __result == 0;
        D.13867 = D.13865 & D.13866;
        if (D.13867 != 0) goto <D.13868>; else goto <D.13869>;
        <D.13868>:
        D.13870 = &MEM[(void *)"PEAPI" + 1B];
        D.13871 = *D.13870;
        D.13872 = (int) D.13871;
        D.13873 = __s2 + 1;
        D.13874 = *D.13873;
        D.13875 = (int) D.13874;
        __result = D.13872 - D.13875;
        D.13876 = __s2_len > 1;
        D.13866 = __result == 0;
        D.13877 = D.13876 & D.13866;
        if (D.13877 != 0) goto <D.13878>; else goto <D.13879>;
        <D.13878>:
        D.13880 = &MEM[(void *)"PEAPI" + 2B];
        D.13881 = *D.13880;
        D.13882 = (int) D.13881;
        D.13883 = __s2 + 2;
        D.13884 = *D.13883;
        D.13885 = (int) D.13884;
        __result = D.13882 - D.13885;
        D.13886 = __s2_len > 2;
        D.13866 = __result == 0;
        D.13887 = D.13886 & D.13866;
        if (D.13887 != 0) goto <D.13888>; else goto <D.13889>;
        <D.13888>:
        D.13890 = &MEM[(void *)"PEAPI" + 3B];
        D.13891 = *D.13890;
        D.13892 = (int) D.13891;
        D.13893 = __s2 + 3;
        D.13894 = *D.13893;
        D.13895 = (int) D.13894;
        __result = D.13892 - D.13895;
        <D.13889>:
        <D.13879>:
        <D.13869>:
      }
      D.13431 = __result;
    }
    iftmp.16 = -D.13431;
    goto <D.13896>;
    <D.13859>:
    D.13763 = klass->image;
    D.13806 = D.13763->assembly_name;
    iftmp.16 = __builtin_strcmp (D.13806, "PEAPI");
    <D.13896>:
    D.13432 = iftmp.16;
  }
  if (D.13432 == 0) goto <D.13897>; else goto <D.13898>;
  <D.13897>:
  D.13762 = 1;
  return D.13762;
  <D.13898>:
  <D.13765>:
  D.13762 = 0;
  return D.13762;
}


append_report (struct GString * * report, const gchar * format)
{
  struct GString * D.13900;
  struct GString * D.13903;
  struct  ap[1];

  try
    {
      D.13900 = *report;
      if (D.13900 == 0B) goto <D.13901>; else goto <D.13902>;
      <D.13901>:
      D.13903 = monoeg_g_string_new ("");
      *report = D.13903;
      <D.13902>:
      __builtin_va_start (&ap, 0);
      D.13900 = *report;
      monoeg_g_string_append_vprintf (D.13900, format, &ap);
      __builtin_va_end (&ap);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


print_report (const gchar * format)
{
  struct _IO_FILE * stdout.17;
  struct MonoImage * D.13908;
  struct MonoClass * klass;
  struct MonoProperty * prop;
  struct MonoString * str;
  char * stack_trace;
  struct  ap[1];

  try
    {
      stdout.17 = stdout;
      fprintf (stdout.17, "-=-=-=-=-=-=- MONO_IOMAP REPORT -=-=-=-=-=-=-\n");
      __builtin_va_start (&ap, 0);
      stdout.17 = stdout;
      vfprintf (stdout.17, format, &ap);
      stdout.17 = stdout;
      fprintf (stdout.17, "\n");
      __builtin_va_end (&ap);
      D.13908 = mono_get_corlib ();
      klass = mono_class_from_name (D.13908, "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.17 = stdout;
      fprintf (stdout.17, "-= Stack Trace =-\n%s\n\n", stack_trace);
      monoeg_g_free (stack_trace);
      stdout.17 = stdout;
      fflush (stdout.17);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


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

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


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

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


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

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


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


print_mismatched_stats (struct MonoProfiler * prof)
{
  struct GHashTable * D.13926;
  unsigned int D.13928;
  struct GHashTable * D.13929;
  unsigned int D.13930;
  _Bool D.13931;
  int D.13932;
  struct _IO_FILE * stdout.19;

  D.13926 = prof->mismatched_files_hash;
  if (D.13926 == 0B) goto <D.13924>; else goto <D.13927>;
  <D.13927>:
  D.13926 = prof->mismatched_files_hash;
  D.13928 = monoeg_g_hash_table_size (D.13926);
  if (D.13928 == 0) goto <D.13924>; else goto <D.13925>;
  <D.13924>:
  return;
  <D.13925>:
  D.13929 = prof->string_locations_hash;
  D.13930 = monoeg_g_hash_table_size (D.13929);
  D.13931 = D.13930 != 0;
  D.13932 = (int) D.13931;
  prof->may_have_locations = D.13932;
  stdout.19 = stdout;
  fprintf (stdout.19, "\n-=-=-=-=-=-=-= MONO_IOMAP Stats -=-=-=-=-=-=-=\n");
  D.13926 = prof->mismatched_files_hash;
  monoeg_g_hash_table_foreach (D.13926, mismatched_stats_foreach_func, prof);
  stdout.19 = stdout;
  fflush (stdout.19);
}


mismatched_stats_foreach_func (void * key, void * value, void * user_data)
{
  gchar * D.13937;
  unsigned int hash.20;
  gchar * D.13939;
  unsigned int D.13940;
  struct _IO_FILE * stdout.21;
  int D.13942;
  struct GHashTable * D.13945;
  gchar * D.13946;
  char D.13949;
  struct MismatchedFilesStats * stats;
  struct StringLocation * location;
  struct MonoProfiler * prof;
  guint32 hash;
  gboolean bannerShown;

  try
    {
      stats = value;
      prof = user_data;
      bannerShown = 0;
      D.13937 = stats->requestedName;
      hash.20 = do_calc_string_hash (0, D.13937);
      hash = hash.20;
      D.13939 = stats->actualName;
      D.13937 = stats->requestedName;
      D.13940 = stats->count;
      stdout.21 = stdout;
      fprintf (stdout.21, "    Count: %u\nRequested: %s\n   Actual: %s\n", D.13940, D.13937, D.13939);
      D.13942 = prof->may_have_locations;
      if (D.13942 == 0) goto <D.13943>; else goto <D.13944>;
      <D.13943>:
      stdout.21 = stdout;
      fprintf (stdout.21, "\n");
      return;
      <D.13944>:
      D.13945 = prof->string_locations_hash;
      location = monoeg_g_hash_table_lookup (D.13945, &hash);
      goto <D.13324>;
      <D.13323>:
      D.13946 = location->hint;
      if (D.13946 != 0B) goto <D.13947>; else goto <D.13948>;
      <D.13947>:
      D.13946 = location->hint;
      D.13949 = MEM[(const char *)D.13946];
      if (D.13949 != 0) goto <D.13950>; else goto <D.13951>;
      <D.13950>:
      if (bannerShown == 0) goto <D.13952>; else goto <D.13953>;
      <D.13952>:
      stdout.21 = stdout;
      fprintf (stdout.21, "Locations:\n");
      bannerShown = 1;
      <D.13953>:
      D.13946 = location->hint;
      stdout.21 = stdout;
      fprintf (stdout.21, "%s", D.13946);
      <D.13951>:
      <D.13948>:
      location = location->next;
      if (location != 0B) goto <D.13954>; else goto <D.13955>;
      <D.13954>:
      stdout.21 = stdout;
      fprintf (stdout.21, "        --\n");
      <D.13955>:
      <D.13324>:
      if (location != 0B) goto <D.13323>; else goto <D.13325>;
      <D.13325>:
      stdout.21 = stdout;
      fprintf (stdout.21, "\n");
    }
  finally
    {
      hash = {CLOBBER};
    }
}


mismatched_files_guint32_equal (const void * key1, const void * key2)
{
  _Bool D.13962;
  _Bool D.13963;
  _Bool D.13964;
  gboolean D.13967;
  unsigned int D.13968;
  unsigned int D.13969;
  _Bool D.13970;

  D.13962 = key1 == 0B;
  D.13963 = key2 == 0B;
  D.13964 = D.13962 | D.13963;
  if (D.13964 != 0) goto <D.13965>; else goto <D.13966>;
  <D.13965>:
  D.13967 = 0;
  return D.13967;
  <D.13966>:
  D.13968 = MEM[(guint32 *)key1];
  D.13969 = MEM[(guint32 *)key2];
  D.13970 = D.13968 == D.13969;
  D.13967 = (gboolean) D.13970;
  return D.13967;
}


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

  if (key == 0B) goto <D.13972>; else goto <D.13973>;
  <D.13972>:
  D.13974 = 0;
  return D.13974;
  <D.13973>:
  D.13974 = MEM[(guint32 *)key];
  return D.13974;
}


