utils_init (int fast_time)
{
  long unsigned int D.9753;
  long unsigned int time_inc.0;
  int D.9755;
  uint64_t (*<T1081>) (void) time_func.1;
  long unsigned int D.9761;
  long unsigned int D.9762;
  int timer_overhead.2;
  int i;
  uint64_t time_start;
  uint64_t time_end;

  if (fast_time > 1) goto <D.9748>; else goto <D.9749>;
  <D.9748>:
  time_func = null_time;
  goto <D.9750>;
  <D.9749>:
  if (fast_time != 0) goto <D.9751>; else goto <D.9752>;
  <D.9751>:
  {
    uint64_t timea;
    uint64_t timeb;

    clock_time ();
    timea = clock_time ();
    timeb = clock_time ();
    D.9753 = timeb - timea;
    time_inc.0 = D.9753 / 8;
    time_inc = time_inc.0;
    D.9755 = have_rdtsc ();
    if (D.9755 != 0) goto <D.9756>; else goto <D.9757>;
    <D.9756>:
    time_func = rdtsc_current_time;
    goto <D.9758>;
    <D.9757>:
    time_func = fast_current_time;
    <D.9758>:
  }
  goto <D.9759>;
  <D.9752>:
  time_func = clock_time;
  <D.9759>:
  <D.9750>:
  time_func.1 = time_func;
  time_start = time_func.1 ();
  i = 0;
  goto <D.5458>;
  <D.5457>:
  time_func.1 = time_func;
  time_func.1 ();
  i = i + 1;
  <D.5458>:
  if (i <= 255) goto <D.5457>; else goto <D.5459>;
  <D.5459>:
  time_func.1 = time_func;
  time_end = time_func.1 ();
  D.9761 = time_end - time_start;
  D.9762 = D.9761 / 256;
  timer_overhead.2 = (int) D.9762;
  timer_overhead = timer_overhead.2;
}


fast_current_time ()
{
  unsigned int D.9769;
  unsigned int D.9770;
  unsigned int D.9771;
  unsigned int D.9772;
  long unsigned int D.9775;
  long unsigned int time_inc.3;
  long unsigned int D.9777;
  uint64_t D.9778;
  long unsigned int D.9779;
  struct TlsData * tls;

  tls = &tls_data;
  D.9769 = tls->timer_count;
  D.9770 = D.9769;
  D.9771 = D.9770 + 1;
  tls->timer_count = D.9771;
  D.9772 = D.9770 & 7;
  if (D.9772 != 0) goto <D.9773>; else goto <D.9774>;
  <D.9773>:
  D.9775 = tls->last_time;
  time_inc.3 = time_inc;
  D.9777 = D.9775 + time_inc.3;
  tls->last_time = D.9777;
  D.9778 = tls->last_time;
  return D.9778;
  <D.9774>:
  D.9779 = clock_time ();
  tls->last_time = D.9779;
  D.9778 = tls->last_time;
  return D.9778;
}


rdtsc_current_time ()
{
  unsigned int D.9782;
  unsigned int D.9783;
  unsigned int D.9784;
  unsigned int D.9785;
  int cpu.4;
  int D.9791;
  long unsigned int D.9794;
  long unsigned int D.9795;
  double D.9798;
  double cpu_freq.5;
  double D.9800;
  uint64_t D.9801;
  long unsigned int D.9802;
  long unsigned int D.9804;
  int * D.9805;
  long unsigned int D.9806;
  struct TlsData * tls;

  tls = &tls_data;
  D.9782 = tls->timer_count;
  D.9783 = D.9782;
  D.9784 = D.9783 + 1;
  tls->timer_count = D.9784;
  D.9785 = D.9783 & 63;
  if (D.9785 != 0) goto <D.9786>; else goto <D.9787>;
  <D.9786>:
  {
    int cpu;
    uint64_t tsc;

    try
      {
        tsc = safe_rdtsc (&cpu);
        cpu.4 = cpu;
        if (cpu.4 != -1) goto <D.9789>; else goto <D.9790>;
        <D.9789>:
        D.9791 = tls->last_cpu;
        cpu.4 = cpu;
        if (D.9791 == cpu.4) goto <D.9792>; else goto <D.9793>;
        <D.9792>:
        {
          int64_t diff;
          uint64_t nsecs;

          D.9794 = tls->last_rdtsc;
          D.9795 = tsc - D.9794;
          diff = (int64_t) D.9795;
          if (diff > 0) goto <D.9796>; else goto <D.9797>;
          <D.9796>:
          D.9798 = (double) diff;
          cpu_freq.5 = cpu_freq;
          D.9800 = D.9798 / cpu_freq.5;
          nsecs = (uint64_t) D.9800;
          D.9802 = tls->last_time;
          D.9801 = D.9802 + nsecs;
          return D.9801;
          <D.9797>:
          printf ("tsc went backwards\n");
        }
        goto <D.9803>;
        <D.9793>:
        <D.9803>:
        <D.9790>:
      }
    finally
      {
        cpu = {CLOBBER};
      }
  }
  <D.9787>:
  D.9804 = clock_time ();
  tls->last_time = D.9804;
  D.9805 = &tls->last_cpu;
  D.9806 = safe_rdtsc (D.9805);
  tls->last_rdtsc = D.9806;
  D.9801 = tls->last_time;
  return D.9801;
}


printf (const char * restrict __fmt)
{
  int D.9814;

  D.9814 = __printf_chk (1, __fmt, __builtin_va_arg_pack ());
  return D.9814;
}


safe_rdtsc (int * cpu)
{
  uint64_t D.9819;
  long unsigned int D.9820;
  long unsigned int D.9821;
  long unsigned int D.9822;
  unsigned int low;
  unsigned int high;
  int c1;
  int c2;

  c1 = sched_getcpu ();
  __asm__ __volatile__("rdtsc" : "=a" low, "=d" high);
  c2 = sched_getcpu ();
  if (c1 != c2) goto <D.9817>; else goto <D.9818>;
  <D.9817>:
  *cpu = -1;
  D.9819 = 0;
  return D.9819;
  <D.9818>:
  *cpu = c1;
  D.9820 = (long unsigned int) high;
  D.9821 = D.9820 << 32;
  D.9822 = (long unsigned int) low;
  D.9819 = D.9821 + D.9822;
  return D.9819;
}


null_time ()
{
  uint64_t D.9824;
  long unsigned int timer.6;
  long unsigned int timer.7;
  long unsigned int timer.8;
  static uint64_t timer = 0;

  timer.6 = timer;
  timer.7 = timer.6;
  timer.8 = timer.7 + 1;
  timer = timer.8;
  D.9824 = timer.7;
  return D.9824;
}


clock_time ()
{
  uint64_t D.9829;
  long int D.9830;
  long long unsigned int D.9831;
  long long unsigned int D.9832;
  long int D.9833;
  long long unsigned int D.9834;
  struct timespec tspec;

  try
    {
      clock_gettime (1, &tspec);
      D.9830 = tspec.tv_sec;
      D.9831 = (long long unsigned int) D.9830;
      D.9832 = D.9831 * 1000000000;
      D.9833 = tspec.tv_nsec;
      D.9834 = (long long unsigned int) D.9833;
      D.9829 = D.9832 + D.9834;
      return D.9829;
    }
  finally
    {
      tspec = {CLOBBER};
    }
}


have_rdtsc ()
{
  int D.9839;
  int D.9842;
  float val.9;
  float D.9846;
  double cpu_freq.10;
  int D.9848;
  char * D.9851;
  char * D.9854;
  int iftmp.11;
  char buf[256];
  int have_freq;
  int have_flag;
  float val;
  struct FILE * cpuinfo;
  int cpu;

  try
    {
      have_freq = 0;
      have_flag = 0;
      cpu = sched_getcpu ();
      if (cpu < 0) goto <D.9837>; else goto <D.9838>;
      <D.9837>:
      D.9839 = 0;
      return D.9839;
      <D.9838>:
      cpuinfo = fopen ("/proc/cpuinfo", "r");
      if (cpuinfo == 0B) goto <D.9840>; else goto <D.9841>;
      <D.9840>:
      D.9839 = 0;
      return D.9839;
      <D.9841>:
      goto <D.5435>;
      <D.5434>:
      D.9842 = sscanf (&buf, "cpu MHz : %f", &val);
      if (D.9842 == 1) goto <D.9843>; else goto <D.9844>;
      <D.9843>:
      have_freq = 1;
      val.9 = val;
      D.9846 = val.9 * 1.0e+6;
      cpu_freq.10 = (double) D.9846;
      cpu_freq = cpu_freq.10;
      <D.9844>:
      D.9848 = strncmp (&buf, "flags :", 5);
      if (D.9848 == 0) goto <D.9849>; else goto <D.9850>;
      <D.9849>:
      D.9851 = strstr (&buf, "constant_tsc");
      if (D.9851 != 0B) goto <D.9852>; else goto <D.9853>;
      <D.9852>:
      have_flag = 1;
      <D.9853>:
      <D.9850>:
      <D.5435>:
      D.9854 = fgets (&buf, 256, cpuinfo);
      if (D.9854 != 0B) goto <D.5434>; else goto <D.5436>;
      <D.5436>:
      fclose (cpuinfo);
      if (have_flag != 0) goto <D.9856>; else goto <D.9857>;
      <D.9856>:
      iftmp.11 = have_freq;
      goto <D.9858>;
      <D.9857>:
      iftmp.11 = 0;
      <D.9858>:
      D.9839 = iftmp.11;
      return D.9839;
    }
  finally
    {
      buf = {CLOBBER};
      val = {CLOBBER};
    }
}


fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  long unsigned int D.9864;
  int D.9869;
  char * D.9871;
  long unsigned int D.9872;
  long unsigned int D.9873;
  long unsigned int D.9874;
  long unsigned int D.9877;

  D.9864 = __builtin_object_size (__s, 1);
  if (D.9864 != 18446744073709551615) goto <D.9865>; else goto <D.9866>;
  <D.9865>:
  D.9869 = __builtin_constant_p (__n);
  if (D.9869 == 0) goto <D.9867>; else goto <D.9870>;
  <D.9870>:
  if (__n <= 0) goto <D.9867>; else goto <D.9868>;
  <D.9867>:
  D.9872 = __builtin_object_size (__s, 1);
  D.9871 = __fgets_chk (__s, D.9872, __n, __stream);
  return D.9871;
  <D.9868>:
  D.9873 = (long unsigned int) __n;
  D.9874 = __builtin_object_size (__s, 1);
  if (D.9873 > D.9874) goto <D.9875>; else goto <D.9876>;
  <D.9875>:
  D.9877 = __builtin_object_size (__s, 1);
  D.9871 = __fgets_chk_warn (__s, D.9877, __n, __stream);
  return D.9871;
  <D.9876>:
  <D.9866>:
  D.9871 = __fgets_alias (__s, __n, __stream);
  return D.9871;
}


get_timer_overhead ()
{
  int D.9882;

  D.9882 = timer_overhead;
  return D.9882;
}


current_time ()
{
  uint64_t D.9884;
  uint64_t (*<T1081>) (void) time_func.12;

  time_func.12 = time_func;
  D.9884 = time_func.12 ();
  return D.9884;
}


alloc_buffer (int size)
{
  long unsigned int D.9888;
  void * D.9891;
  void * ptr;

  D.9888 = (long unsigned int) size;
  ptr = mmap (0B, D.9888, 3, 34, -1, 0);
  if (ptr == -1B) goto <D.9889>; else goto <D.9890>;
  <D.9889>:
  D.9891 = 0B;
  return D.9891;
  <D.9890>:
  D.9891 = ptr;
  return D.9891;
}


free_buffer (void * buf, int size)
{
  long unsigned int D.9893;

  D.9893 = (long unsigned int) size;
  munmap (buf, D.9893);
}


take_lock ()
{
  pthread_mutex_lock (&log_lock);
}


release_lock ()
{
  pthread_mutex_unlock (&log_lock);
}


encode_uleb128 (uint64_t value, uint8_t * buf, uint8_t * * endbuf)
{
  unsigned char D.9894;
  uint8_t * p.13;
  uint8_t * p;

  p = buf;
  <D.5487>:
  {
    uint8_t b;

    D.9894 = (unsigned char) value;
    b = D.9894 & 127;
    value = value >> 7;
    if (value != 0) goto <D.9895>; else goto <D.9896>;
    <D.9895>:
    b = b | 128;
    <D.9896>:
    p.13 = p;
    p = p.13 + 1;
    *p.13 = b;
  }
  if (value != 0) goto <D.5487>; else goto <D.5488>;
  <D.5488>:
  *endbuf = p;
}


encode_sleb128 (intptr_t value, uint8_t * buf, uint8_t * * endbuf)
{
  _Bool D.9898;
  unsigned char D.9899;
  unsigned int D.9902;
  int D.9903;
  long int D.9904;
  long int D.9905;
  int D.9911;
  int D.9912;
  uint8_t * p.14;
  int more;
  int negative;
  unsigned int size;
  uint8_t byte;
  uint8_t * p;

  more = 1;
  D.9898 = value < 0;
  negative = (int) D.9898;
  size = 64;
  p = buf;
  goto <D.5500>;
  <D.5499>:
  D.9899 = (unsigned char) value;
  byte = D.9899 & 127;
  value = value >> 7;
  if (negative != 0) goto <D.9900>; else goto <D.9901>;
  <D.9900>:
  D.9902 = size + 4294967289;
  D.9903 = (int) D.9902;
  D.9904 = 1 << D.9903;
  D.9905 = -D.9904;
  value = D.9905 | value;
  <D.9901>:
  if (value == 0) goto <D.9910>; else goto <D.9906>;
  <D.9910>:
  D.9911 = (int) byte;
  D.9912 = D.9911 & 64;
  if (D.9912 == 0) goto <D.9907>; else goto <D.9906>;
  <D.9906>:
  if (value == -1) goto <D.9913>; else goto <D.9908>;
  <D.9913>:
  D.9911 = (int) byte;
  D.9912 = D.9911 & 64;
  if (D.9912 != 0) goto <D.9907>; else goto <D.9908>;
  <D.9907>:
  more = 0;
  goto <D.9909>;
  <D.9908>:
  byte = byte | 128;
  <D.9909>:
  p.14 = p;
  p = p.14 + 1;
  *p.14 = byte;
  <D.5500>:
  if (more != 0) goto <D.5499>; else goto <D.5501>;
  <D.5501>:
  *endbuf = p;
}


decode_uleb128 (uint8_t * buf, uint8_t * * endbuf)
{
  uint8_t * buf.15;
  long unsigned int D.9916;
  long unsigned int D.9917;
  long unsigned int D.9918;
  signed char b.16;
  uint64_t D.9921;
  uint64_t res;
  int shift;

  res = 0;
  shift = 0;
  <D.5510>:
  {
    uint8_t b;

    buf.15 = buf;
    buf = buf.15 + 1;
    b = *buf.15;
    D.9916 = (long unsigned int) b;
    D.9917 = D.9916 & 127;
    D.9918 = D.9917 << shift;
    res = D.9918 | res;
    b.16 = (signed char) b;
    if (b.16 >= 0) goto <D.5509>; else goto <D.9920>;
    <D.9920>:
    shift = shift + 7;
  }
  goto <D.5510>;
  <D.5509>:
  *endbuf = buf;
  D.9921 = res;
  return D.9921;
}


decode_sleb128 (uint8_t * buf, uint8_t * * endbuf)
{
  long int D.9923;
  long int D.9924;
  long int D.9925;
  signed char b.17;
  unsigned int shift.18;
  int D.9932;
  int D.9933;
  long int D.9936;
  long int D.9937;
  intptr_t D.9938;
  uint8_t * p;
  intptr_t res;
  int shift;

  p = buf;
  res = 0;
  shift = 0;
  <D.5520>:
  {
    uint8_t b;

    b = *p;
    p = p + 1;
    D.9923 = (long int) b;
    D.9924 = D.9923 & 127;
    D.9925 = D.9924 << shift;
    res = D.9925 | res;
    shift = shift + 7;
    b.17 = (signed char) b;
    if (b.17 >= 0) goto <D.9927>; else goto <D.9928>;
    <D.9927>:
    shift.18 = (unsigned int) shift;
    if (shift.18 <= 63) goto <D.9930>; else goto <D.9931>;
    <D.9930>:
    D.9932 = (int) b;
    D.9933 = D.9932 & 64;
    if (D.9933 != 0) goto <D.9934>; else goto <D.9935>;
    <D.9934>:
    D.9936 = 1 << shift;
    D.9937 = -D.9936;
    res = D.9937 | res;
    <D.9935>:
    <D.9931>:
    goto <D.5519>;
    <D.9928>:
  }
  goto <D.5520>;
  <D.5519>:
  *endbuf = p;
  D.9938 = res;
  return D.9938;
}


thread_id ()
{
  uintptr_t D.9940;

  D.9940 = pthread_self ();
  return D.9940;
}


process_id ()
{
  uintptr_t D.9942;
  int D.9943;

  D.9943 = getpid ();
  D.9942 = (uintptr_t) D.9943;
  return D.9942;
}


main (int argc, char * * argv)
{
  struct _IO_FILE * stdout.19;
  int D.9568;
  int iftmp.20;
  int D.9564;
  long unsigned int D.9949;
  long unsigned int D.9950;
  char * * D.9951;
  const char[8] * D.9952;
  unsigned char D.9953;
  int D.9954;
  unsigned char D.9955;
  int D.9956;
  _Bool D.9957;
  _Bool D.9958;
  _Bool D.9959;
  const unsigned char * D.9962;
  unsigned char D.9963;
  int D.9964;
  const unsigned char * D.9965;
  unsigned char D.9966;
  int D.9967;
  _Bool D.9968;
  _Bool D.9969;
  const unsigned char * D.9972;
  unsigned char D.9973;
  int D.9974;
  const unsigned char * D.9975;
  unsigned char D.9976;
  int D.9977;
  _Bool D.9978;
  _Bool D.9979;
  const unsigned char * D.9982;
  unsigned char D.9983;
  int D.9984;
  const unsigned char * D.9985;
  unsigned char D.9986;
  int D.9987;
  char * D.9989;
  int debug.21;
  int debug.22;
  int D.9577;
  int iftmp.23;
  int D.9573;
  const char[7] * D.9998;
  unsigned char D.9999;
  int D.10000;
  unsigned char D.10001;
  int D.10002;
  _Bool D.10003;
  _Bool D.10004;
  _Bool D.10005;
  const unsigned char * D.10008;
  unsigned char D.10009;
  int D.10010;
  const unsigned char * D.10011;
  unsigned char D.10012;
  int D.10013;
  _Bool D.10014;
  _Bool D.10015;
  const unsigned char * D.10018;
  unsigned char D.10019;
  int D.10020;
  const unsigned char * D.10021;
  unsigned char D.10022;
  int D.10023;
  _Bool D.10024;
  _Bool D.10025;
  const unsigned char * D.10028;
  unsigned char D.10029;
  int D.10030;
  const unsigned char * D.10031;
  unsigned char D.10032;
  int D.10033;
  int D.10037;
  int D.10038;
  int D.9596;
  int iftmp.24;
  int D.9595;
  const char[6] * D.10044;
  unsigned char D.10045;
  int D.10046;
  unsigned char D.10047;
  int D.10048;
  _Bool D.10049;
  _Bool D.10050;
  _Bool D.10051;
  const unsigned char * D.10054;
  unsigned char D.10055;
  int D.10056;
  const unsigned char * D.10057;
  unsigned char D.10058;
  int D.10059;
  _Bool D.10060;
  _Bool D.10061;
  const unsigned char * D.10064;
  unsigned char D.10065;
  int D.10066;
  const unsigned char * D.10067;
  unsigned char D.10068;
  int D.10069;
  _Bool D.10070;
  _Bool D.10071;
  const unsigned char * D.10074;
  unsigned char D.10075;
  int D.10076;
  const unsigned char * D.10077;
  unsigned char D.10078;
  int D.10079;
  int D.9605;
  int iftmp.25;
  int D.9604;
  const char[6] * D.10087;
  unsigned char D.10088;
  int D.10089;
  unsigned char D.10090;
  int D.10091;
  _Bool D.10092;
  _Bool D.10093;
  _Bool D.10094;
  const unsigned char * D.10097;
  unsigned char D.10098;
  int D.10099;
  const unsigned char * D.10100;
  unsigned char D.10101;
  int D.10102;
  _Bool D.10103;
  _Bool D.10104;
  const unsigned char * D.10107;
  unsigned char D.10108;
  int D.10109;
  const unsigned char * D.10110;
  unsigned char D.10111;
  int D.10112;
  _Bool D.10113;
  _Bool D.10114;
  const unsigned char * D.10117;
  unsigned char D.10118;
  int D.10119;
  const unsigned char * D.10120;
  unsigned char D.10121;
  int D.10122;
  int D.10128;
  int D.9624;
  int iftmp.26;
  int D.9623;
  const char[6] * D.10134;
  unsigned char D.10135;
  int D.10136;
  unsigned char D.10137;
  int D.10138;
  _Bool D.10139;
  _Bool D.10140;
  _Bool D.10141;
  const unsigned char * D.10144;
  unsigned char D.10145;
  int D.10146;
  const unsigned char * D.10147;
  unsigned char D.10148;
  int D.10149;
  _Bool D.10150;
  _Bool D.10151;
  const unsigned char * D.10154;
  unsigned char D.10155;
  int D.10156;
  const unsigned char * D.10157;
  unsigned char D.10158;
  int D.10159;
  _Bool D.10160;
  _Bool D.10161;
  const unsigned char * D.10164;
  unsigned char D.10165;
  int D.10166;
  const unsigned char * D.10167;
  unsigned char D.10168;
  int D.10169;
  int D.9633;
  int iftmp.27;
  int D.9632;
  const char[5] * D.10177;
  unsigned char D.10178;
  int D.10179;
  unsigned char D.10180;
  int D.10181;
  _Bool D.10182;
  _Bool D.10183;
  _Bool D.10184;
  const unsigned char * D.10187;
  unsigned char D.10188;
  int D.10189;
  const unsigned char * D.10190;
  unsigned char D.10191;
  int D.10192;
  _Bool D.10193;
  _Bool D.10194;
  const unsigned char * D.10197;
  unsigned char D.10198;
  int D.10199;
  const unsigned char * D.10200;
  unsigned char D.10201;
  int D.10202;
  _Bool D.10203;
  _Bool D.10204;
  const unsigned char * D.10207;
  unsigned char D.10208;
  int D.10209;
  const unsigned char * D.10210;
  unsigned char D.10211;
  int D.10212;
  int D.9642;
  int iftmp.28;
  int D.9641;
  const char[6] * D.10220;
  unsigned char D.10221;
  int D.10222;
  unsigned char D.10223;
  int D.10224;
  _Bool D.10225;
  _Bool D.10226;
  _Bool D.10227;
  const unsigned char * D.10230;
  unsigned char D.10231;
  int D.10232;
  const unsigned char * D.10233;
  unsigned char D.10234;
  int D.10235;
  _Bool D.10236;
  _Bool D.10237;
  const unsigned char * D.10240;
  unsigned char D.10241;
  int D.10242;
  const unsigned char * D.10243;
  unsigned char D.10244;
  int D.10245;
  _Bool D.10246;
  _Bool D.10247;
  const unsigned char * D.10250;
  unsigned char D.10251;
  int D.10252;
  const unsigned char * D.10253;
  unsigned char D.10254;
  int D.10255;
  int D.10261;
  int D.10264;
  int D.10268;
  struct FILE * outfile.29;
  struct FILE * outfile.30;
  int D.10276;
  long unsigned int D.10279;
  int trace_max.31;
  int D.10282;
  int D.10285;
  int D.10289;
  char D.10292;
  int D.10296;
  long unsigned int thread_filter.32;
  int D.10301;
  const char * D.10304;
  char * top.33;
  double D.10310;
  long unsigned int time_from.34;
  double D.10312;
  long unsigned int time_to.35;
  int D.9731;
  int iftmp.36;
  int D.9727;
  const char[10] * D.10318;
  unsigned char D.10319;
  int D.10320;
  unsigned char D.10321;
  int D.10322;
  _Bool D.10323;
  _Bool D.10324;
  _Bool D.10325;
  const unsigned char * D.10328;
  unsigned char D.10329;
  int D.10330;
  const unsigned char * D.10331;
  unsigned char D.10332;
  int D.10333;
  _Bool D.10334;
  _Bool D.10335;
  const unsigned char * D.10338;
  unsigned char D.10339;
  int D.10340;
  const unsigned char * D.10341;
  unsigned char D.10342;
  int D.10343;
  _Bool D.10344;
  _Bool D.10345;
  const unsigned char * D.10348;
  unsigned char D.10349;
  int D.10350;
  const unsigned char * D.10351;
  unsigned char D.10352;
  int D.10353;
  int verbose.37;
  int verbose.38;
  int D.9740;
  int iftmp.39;
  int D.9736;
  const char[9] * D.10363;
  unsigned char D.10364;
  int D.10365;
  unsigned char D.10366;
  int D.10367;
  _Bool D.10368;
  _Bool D.10369;
  _Bool D.10370;
  const unsigned char * D.10373;
  unsigned char D.10374;
  int D.10375;
  const unsigned char * D.10376;
  unsigned char D.10377;
  int D.10378;
  _Bool D.10379;
  _Bool D.10380;
  const unsigned char * D.10383;
  unsigned char D.10384;
  int D.10385;
  const unsigned char * D.10386;
  unsigned char D.10387;
  int D.10388;
  _Bool D.10389;
  _Bool D.10390;
  const unsigned char * D.10393;
  unsigned char D.10394;
  int D.10395;
  const unsigned char * D.10396;
  unsigned char D.10397;
  int D.10398;
  int D.10405;
  int num_tracked_objects.40;
  const char * reports.41;
  struct ProfContext * ctx;
  int i;

  stdout.19 = stdout;
  outfile = stdout.19;
  i = 1;
  goto <D.9743>;
  <D.9742>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s1_len = 7;
    if (__s1_len <= 3) goto <D.9947>; else goto <D.9948>;
    <D.9947>:
    {
      const unsigned char * __s2;
      int __result;

      D.9949 = (long unsigned int) i;
      D.9950 = D.9949 * 8;
      D.9951 = argv + D.9950;
      __s2 = *D.9951;
      D.9952 = "--debug";
      D.9953 = MEM[(const unsigned char *)D.9952];
      D.9954 = (int) D.9953;
      D.9955 = *__s2;
      D.9956 = (int) D.9955;
      __result = D.9954 - D.9956;
      {
        D.9957 = __s1_len != 0;
        D.9958 = __result == 0;
        D.9959 = D.9957 & D.9958;
        if (D.9959 != 0) goto <D.9960>; else goto <D.9961>;
        <D.9960>:
        D.9962 = &MEM[(void *)"--debug" + 1B];
        D.9963 = *D.9962;
        D.9964 = (int) D.9963;
        D.9965 = __s2 + 1;
        D.9966 = *D.9965;
        D.9967 = (int) D.9966;
        __result = D.9964 - D.9967;
        D.9968 = __s1_len > 1;
        D.9958 = __result == 0;
        D.9969 = D.9968 & D.9958;
        if (D.9969 != 0) goto <D.9970>; else goto <D.9971>;
        <D.9970>:
        D.9972 = &MEM[(void *)"--debug" + 2B];
        D.9973 = *D.9972;
        D.9974 = (int) D.9973;
        D.9975 = __s2 + 2;
        D.9976 = *D.9975;
        D.9977 = (int) D.9976;
        __result = D.9974 - D.9977;
        D.9978 = __s1_len > 2;
        D.9958 = __result == 0;
        D.9979 = D.9978 & D.9958;
        if (D.9979 != 0) goto <D.9980>; else goto <D.9981>;
        <D.9980>:
        D.9982 = &MEM[(void *)"--debug" + 3B];
        D.9983 = *D.9982;
        D.9984 = (int) D.9983;
        D.9985 = __s2 + 3;
        D.9986 = *D.9985;
        D.9987 = (int) D.9986;
        __result = D.9984 - D.9987;
        <D.9981>:
        <D.9971>:
        <D.9961>:
      }
      D.9564 = __result;
    }
    iftmp.20 = D.9564;
    goto <D.9988>;
    <D.9948>:
    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    iftmp.20 = __builtin_strcmp ("--debug", D.9989);
    <D.9988>:
    D.9568 = iftmp.20;
  }
  if (D.9568 == 0) goto <D.9990>; else goto <D.9991>;
  <D.9990>:
  debug.21 = debug;
  debug.22 = debug.21 + 1;
  debug = debug.22;
  goto <D.9994>;
  <D.9991>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s1_len = 6;
    if (__s1_len <= 3) goto <D.9996>; else goto <D.9997>;
    <D.9996>:
    {
      const unsigned char * __s2;
      int __result;

      D.9949 = (long unsigned int) i;
      D.9950 = D.9949 * 8;
      D.9951 = argv + D.9950;
      __s2 = *D.9951;
      D.9998 = "--help";
      D.9999 = MEM[(const unsigned char *)D.9998];
      D.10000 = (int) D.9999;
      D.10001 = *__s2;
      D.10002 = (int) D.10001;
      __result = D.10000 - D.10002;
      {
        D.10003 = __s1_len != 0;
        D.10004 = __result == 0;
        D.10005 = D.10003 & D.10004;
        if (D.10005 != 0) goto <D.10006>; else goto <D.10007>;
        <D.10006>:
        D.10008 = &MEM[(void *)"--help" + 1B];
        D.10009 = *D.10008;
        D.10010 = (int) D.10009;
        D.10011 = __s2 + 1;
        D.10012 = *D.10011;
        D.10013 = (int) D.10012;
        __result = D.10010 - D.10013;
        D.10014 = __s1_len > 1;
        D.10004 = __result == 0;
        D.10015 = D.10014 & D.10004;
        if (D.10015 != 0) goto <D.10016>; else goto <D.10017>;
        <D.10016>:
        D.10018 = &MEM[(void *)"--help" + 2B];
        D.10019 = *D.10018;
        D.10020 = (int) D.10019;
        D.10021 = __s2 + 2;
        D.10022 = *D.10021;
        D.10023 = (int) D.10022;
        __result = D.10020 - D.10023;
        D.10024 = __s1_len > 2;
        D.10004 = __result == 0;
        D.10025 = D.10024 & D.10004;
        if (D.10025 != 0) goto <D.10026>; else goto <D.10027>;
        <D.10026>:
        D.10028 = &MEM[(void *)"--help" + 3B];
        D.10029 = *D.10028;
        D.10030 = (int) D.10029;
        D.10031 = __s2 + 3;
        D.10032 = *D.10031;
        D.10033 = (int) D.10032;
        __result = D.10030 - D.10033;
        <D.10027>:
        <D.10017>:
        <D.10007>:
      }
      D.9573 = __result;
    }
    iftmp.23 = D.9573;
    goto <D.10034>;
    <D.9997>:
    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    iftmp.23 = __builtin_strcmp ("--help", D.9989);
    <D.10034>:
    D.9577 = iftmp.23;
  }
  if (D.9577 == 0) goto <D.10035>; else goto <D.10036>;
  <D.10035>:
  usage ();
  D.10037 = 0;
  return D.10037;
  <D.10036>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10038 = strncmp ("--alloc-sort=", D.9989, 13);
  if (D.10038 == 0) goto <D.10039>; else goto <D.10040>;
  <D.10039>:
  {
    const char * val;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    val = D.9989 + 13;
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = val;
        D.10044 = "bytes";
        D.10045 = MEM[(const unsigned char *)D.10044];
        D.10046 = (int) D.10045;
        D.10047 = *__s2;
        D.10048 = (int) D.10047;
        __result = D.10046 - D.10048;
        {
          D.10049 = __s2_len != 0;
          D.10050 = __result == 0;
          D.10051 = D.10049 & D.10050;
          if (D.10051 != 0) goto <D.10052>; else goto <D.10053>;
          <D.10052>:
          D.10054 = &MEM[(void *)"bytes" + 1B];
          D.10055 = *D.10054;
          D.10056 = (int) D.10055;
          D.10057 = __s2 + 1;
          D.10058 = *D.10057;
          D.10059 = (int) D.10058;
          __result = D.10056 - D.10059;
          D.10060 = __s2_len > 1;
          D.10050 = __result == 0;
          D.10061 = D.10060 & D.10050;
          if (D.10061 != 0) goto <D.10062>; else goto <D.10063>;
          <D.10062>:
          D.10064 = &MEM[(void *)"bytes" + 2B];
          D.10065 = *D.10064;
          D.10066 = (int) D.10065;
          D.10067 = __s2 + 2;
          D.10068 = *D.10067;
          D.10069 = (int) D.10068;
          __result = D.10066 - D.10069;
          D.10070 = __s2_len > 2;
          D.10050 = __result == 0;
          D.10071 = D.10070 & D.10050;
          if (D.10071 != 0) goto <D.10072>; else goto <D.10073>;
          <D.10072>:
          D.10074 = &MEM[(void *)"bytes" + 3B];
          D.10075 = *D.10074;
          D.10076 = (int) D.10075;
          D.10077 = __s2 + 3;
          D.10078 = *D.10077;
          D.10079 = (int) D.10078;
          __result = D.10076 - D.10079;
          <D.10073>:
          <D.10063>:
          <D.10053>:
        }
        D.9595 = __result;
      }
      iftmp.24 = -D.9595;
      goto <D.10080>;
      <D.10043>:
      iftmp.24 = __builtin_strcmp (val, "bytes");
      <D.10080>:
      D.9596 = iftmp.24;
    }
    if (D.9596 == 0) goto <D.10081>; else goto <D.10082>;
    <D.10081>:
    alloc_sort_mode = 0;
    goto <D.10083>;
    <D.10082>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = val;
        D.10087 = "count";
        D.10088 = MEM[(const unsigned char *)D.10087];
        D.10089 = (int) D.10088;
        D.10090 = *__s2;
        D.10091 = (int) D.10090;
        __result = D.10089 - D.10091;
        {
          D.10092 = __s2_len != 0;
          D.10093 = __result == 0;
          D.10094 = D.10092 & D.10093;
          if (D.10094 != 0) goto <D.10095>; else goto <D.10096>;
          <D.10095>:
          D.10097 = &MEM[(void *)"count" + 1B];
          D.10098 = *D.10097;
          D.10099 = (int) D.10098;
          D.10100 = __s2 + 1;
          D.10101 = *D.10100;
          D.10102 = (int) D.10101;
          __result = D.10099 - D.10102;
          D.10103 = __s2_len > 1;
          D.10093 = __result == 0;
          D.10104 = D.10103 & D.10093;
          if (D.10104 != 0) goto <D.10105>; else goto <D.10106>;
          <D.10105>:
          D.10107 = &MEM[(void *)"count" + 2B];
          D.10108 = *D.10107;
          D.10109 = (int) D.10108;
          D.10110 = __s2 + 2;
          D.10111 = *D.10110;
          D.10112 = (int) D.10111;
          __result = D.10109 - D.10112;
          D.10113 = __s2_len > 2;
          D.10093 = __result == 0;
          D.10114 = D.10113 & D.10093;
          if (D.10114 != 0) goto <D.10115>; else goto <D.10116>;
          <D.10115>:
          D.10117 = &MEM[(void *)"count" + 3B];
          D.10118 = *D.10117;
          D.10119 = (int) D.10118;
          D.10120 = __s2 + 3;
          D.10121 = *D.10120;
          D.10122 = (int) D.10121;
          __result = D.10119 - D.10122;
          <D.10116>:
          <D.10106>:
          <D.10096>:
        }
        D.9604 = __result;
      }
      iftmp.25 = -D.9604;
      goto <D.10123>;
      <D.10086>:
      iftmp.25 = __builtin_strcmp (val, "count");
      <D.10123>:
      D.9605 = iftmp.25;
    }
    if (D.9605 == 0) goto <D.10124>; else goto <D.10125>;
    <D.10124>:
    alloc_sort_mode = 1;
    goto <D.10126>;
    <D.10125>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10126>:
    <D.10083>:
  }
  goto <D.10127>;
  <D.10040>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10128 = strncmp ("--method-sort=", D.9989, 14);
  if (D.10128 == 0) goto <D.10129>; else goto <D.10130>;
  <D.10129>:
  {
    const char * val;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    val = D.9989 + 14;
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = val;
        D.10134 = "total";
        D.10135 = MEM[(const unsigned char *)D.10134];
        D.10136 = (int) D.10135;
        D.10137 = *__s2;
        D.10138 = (int) D.10137;
        __result = D.10136 - D.10138;
        {
          D.10139 = __s2_len != 0;
          D.10140 = __result == 0;
          D.10141 = D.10139 & D.10140;
          if (D.10141 != 0) goto <D.10142>; else goto <D.10143>;
          <D.10142>:
          D.10144 = &MEM[(void *)"total" + 1B];
          D.10145 = *D.10144;
          D.10146 = (int) D.10145;
          D.10147 = __s2 + 1;
          D.10148 = *D.10147;
          D.10149 = (int) D.10148;
          __result = D.10146 - D.10149;
          D.10150 = __s2_len > 1;
          D.10140 = __result == 0;
          D.10151 = D.10150 & D.10140;
          if (D.10151 != 0) goto <D.10152>; else goto <D.10153>;
          <D.10152>:
          D.10154 = &MEM[(void *)"total" + 2B];
          D.10155 = *D.10154;
          D.10156 = (int) D.10155;
          D.10157 = __s2 + 2;
          D.10158 = *D.10157;
          D.10159 = (int) D.10158;
          __result = D.10156 - D.10159;
          D.10160 = __s2_len > 2;
          D.10140 = __result == 0;
          D.10161 = D.10160 & D.10140;
          if (D.10161 != 0) goto <D.10162>; else goto <D.10163>;
          <D.10162>:
          D.10164 = &MEM[(void *)"total" + 3B];
          D.10165 = *D.10164;
          D.10166 = (int) D.10165;
          D.10167 = __s2 + 3;
          D.10168 = *D.10167;
          D.10169 = (int) D.10168;
          __result = D.10166 - D.10169;
          <D.10163>:
          <D.10153>:
          <D.10143>:
        }
        D.9623 = __result;
      }
      iftmp.26 = -D.9623;
      goto <D.10170>;
      <D.10133>:
      iftmp.26 = __builtin_strcmp (val, "total");
      <D.10170>:
      D.9624 = iftmp.26;
    }
    if (D.9624 == 0) goto <D.10171>; else goto <D.10172>;
    <D.10171>:
    method_sort_mode = 0;
    goto <D.10173>;
    <D.10172>:
    {
      size_t __s1_len;
      size_t __s2_len;

      __s2_len = 4;
      if (__s2_len <= 3) goto <D.10175>; else goto <D.10176>;
      <D.10175>:
      {
        const unsigned char * __s2;
        int __result;

        __s2 = val;
        D.10177 = "self";
        D.10178 = MEM[(const unsigned char *)D.10177];
        D.10179 = (int) D.10178;
        D.10180 = *__s2;
        D.10181 = (int) D.10180;
        __result = D.10179 - D.10181;
        {
          D.10182 = __s2_len != 0;
          D.10183 = __result == 0;
          D.10184 = D.10182 & D.10183;
          if (D.10184 != 0) goto <D.10185>; else goto <D.10186>;
          <D.10185>:
          D.10187 = &MEM[(void *)"self" + 1B];
          D.10188 = *D.10187;
          D.10189 = (int) D.10188;
          D.10190 = __s2 + 1;
          D.10191 = *D.10190;
          D.10192 = (int) D.10191;
          __result = D.10189 - D.10192;
          D.10193 = __s2_len > 1;
          D.10183 = __result == 0;
          D.10194 = D.10193 & D.10183;
          if (D.10194 != 0) goto <D.10195>; else goto <D.10196>;
          <D.10195>:
          D.10197 = &MEM[(void *)"self" + 2B];
          D.10198 = *D.10197;
          D.10199 = (int) D.10198;
          D.10200 = __s2 + 2;
          D.10201 = *D.10200;
          D.10202 = (int) D.10201;
          __result = D.10199 - D.10202;
          D.10203 = __s2_len > 2;
          D.10183 = __result == 0;
          D.10204 = D.10203 & D.10183;
          if (D.10204 != 0) goto <D.10205>; else goto <D.10206>;
          <D.10205>:
          D.10207 = &MEM[(void *)"self" + 3B];
          D.10208 = *D.10207;
          D.10209 = (int) D.10208;
          D.10210 = __s2 + 3;
          D.10211 = *D.10210;
          D.10212 = (int) D.10211;
          __result = D.10209 - D.10212;
          <D.10206>:
          <D.10196>:
          <D.10186>:
        }
        D.9632 = __result;
      }
      iftmp.27 = -D.9632;
      goto <D.10213>;
      <D.10176>:
      iftmp.27 = __builtin_strcmp (val, "self");
      <D.10213>:
      D.9633 = iftmp.27;
    }
    if (D.9633 == 0) goto <D.10214>; else goto <D.10215>;
    <D.10214>:
    method_sort_mode = 1;
    goto <D.10216>;
    <D.10215>:
    {
      size_t __s1_len;
      size_t __s2_len;

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

        __s2 = val;
        D.10220 = "calls";
        D.10221 = MEM[(const unsigned char *)D.10220];
        D.10222 = (int) D.10221;
        D.10223 = *__s2;
        D.10224 = (int) D.10223;
        __result = D.10222 - D.10224;
        {
          D.10225 = __s2_len != 0;
          D.10226 = __result == 0;
          D.10227 = D.10225 & D.10226;
          if (D.10227 != 0) goto <D.10228>; else goto <D.10229>;
          <D.10228>:
          D.10230 = &MEM[(void *)"calls" + 1B];
          D.10231 = *D.10230;
          D.10232 = (int) D.10231;
          D.10233 = __s2 + 1;
          D.10234 = *D.10233;
          D.10235 = (int) D.10234;
          __result = D.10232 - D.10235;
          D.10236 = __s2_len > 1;
          D.10226 = __result == 0;
          D.10237 = D.10236 & D.10226;
          if (D.10237 != 0) goto <D.10238>; else goto <D.10239>;
          <D.10238>:
          D.10240 = &MEM[(void *)"calls" + 2B];
          D.10241 = *D.10240;
          D.10242 = (int) D.10241;
          D.10243 = __s2 + 2;
          D.10244 = *D.10243;
          D.10245 = (int) D.10244;
          __result = D.10242 - D.10245;
          D.10246 = __s2_len > 2;
          D.10226 = __result == 0;
          D.10247 = D.10246 & D.10226;
          if (D.10247 != 0) goto <D.10248>; else goto <D.10249>;
          <D.10248>:
          D.10250 = &MEM[(void *)"calls" + 3B];
          D.10251 = *D.10250;
          D.10252 = (int) D.10251;
          D.10253 = __s2 + 3;
          D.10254 = *D.10253;
          D.10255 = (int) D.10254;
          __result = D.10252 - D.10255;
          <D.10249>:
          <D.10239>:
          <D.10229>:
        }
        D.9641 = __result;
      }
      iftmp.28 = -D.9641;
      goto <D.10256>;
      <D.10219>:
      iftmp.28 = __builtin_strcmp (val, "calls");
      <D.10256>:
      D.9642 = iftmp.28;
    }
    if (D.9642 == 0) goto <D.10257>; else goto <D.10258>;
    <D.10257>:
    method_sort_mode = 2;
    goto <D.10259>;
    <D.10258>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10259>:
    <D.10216>:
    <D.10173>:
  }
  goto <D.10260>;
  <D.10130>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10261 = strncmp ("--reports=", D.9989, 10);
  if (D.10261 == 0) goto <D.10262>; else goto <D.10263>;
  <D.10262>:
  {
    const char * val;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    val = D.9989 + 10;
    D.10264 = print_reports (0B, val, 1);
    if (D.10264 == 0) goto <D.10265>; else goto <D.10266>;
    <D.10265>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10266>:
    reports = val;
  }
  goto <D.10267>;
  <D.10263>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10268 = strncmp ("--out=", D.9989, 6);
  if (D.10268 == 0) goto <D.10269>; else goto <D.10270>;
  <D.10269>:
  {
    const char * val;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    val = D.9989 + 6;
    outfile.29 = fopen (val, "w");
    outfile = outfile.29;
    outfile.30 = outfile;
    if (outfile.30 == 0B) goto <D.10273>; else goto <D.10274>;
    <D.10273>:
    printf ("Cannot open output file: %s\n", val);
    D.10037 = 1;
    return D.10037;
    <D.10274>:
  }
  goto <D.10275>;
  <D.10270>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10276 = strncmp ("--maxframes=", D.9989, 12);
  if (D.10276 == 0) goto <D.10277>; else goto <D.10278>;
  <D.10277>:
  {
    const char * val;
    char * vale;

    try
      {
        D.9949 = (long unsigned int) i;
        D.9950 = D.9949 * 8;
        D.9951 = argv + D.9950;
        D.9989 = *D.9951;
        val = D.9989 + 12;
        D.10279 = strtoul (val, &vale, 10);
        trace_max.31 = (int) D.10279;
        trace_max = trace_max.31;
      }
    finally
      {
        vale = {CLOBBER};
      }
  }
  goto <D.10281>;
  <D.10278>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10282 = strncmp ("--find=", D.9989, 7);
  if (D.10282 == 0) goto <D.10283>; else goto <D.10284>;
  <D.10283>:
  {
    const char * val;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    val = D.9989 + 7;
    D.10285 = add_find_spec (val);
    if (D.10285 == 0) goto <D.10286>; else goto <D.10287>;
    <D.10286>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10287>:
  }
  goto <D.10288>;
  <D.10284>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10289 = strncmp ("--track=", D.9989, 8);
  if (D.10289 == 0) goto <D.10290>; else goto <D.10291>;
  <D.10290>:
  {
    const char * val;
    char * vale;

    try
      {
        D.9949 = (long unsigned int) i;
        D.9950 = D.9949 * 8;
        D.9951 = argv + D.9950;
        D.9989 = *D.9951;
        val = D.9989 + 8;
        goto <D.9696>;
        <D.9697>:
        {
          uintptr_t tracked_obj;

          D.10292 = *val;
          if (D.10292 == 44) goto <D.10293>; else goto <D.10294>;
          <D.10293>:
          val = val + 1;
          // predicted unlikely by continue predictor.
          goto <D.9696>;
          <D.10294>:
          tracked_obj = strtoul (val, &vale, 0);
          found_object (tracked_obj);
          val = vale;
        }
        <D.9696>:
        D.10292 = *val;
        if (D.10292 != 0) goto <D.9697>; else goto <D.9698>;
        <D.9698>:
      }
    finally
      {
        vale = {CLOBBER};
      }
  }
  goto <D.10295>;
  <D.10291>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10296 = strncmp ("--thread=", D.9989, 9);
  if (D.10296 == 0) goto <D.10297>; else goto <D.10298>;
  <D.10297>:
  {
    const char * val;
    char * vale;

    try
      {
        D.9949 = (long unsigned int) i;
        D.9950 = D.9949 * 8;
        D.9951 = argv + D.9950;
        D.9989 = *D.9951;
        val = D.9989 + 9;
        thread_filter.32 = strtoul (val, &vale, 0);
        thread_filter = thread_filter.32;
      }
    finally
      {
        vale = {CLOBBER};
      }
  }
  goto <D.10300>;
  <D.10298>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  D.10301 = strncmp ("--time=", D.9989, 7);
  if (D.10301 == 0) goto <D.10302>; else goto <D.10303>;
  <D.10302>:
  {
    char * val;
    double from_secs;
    double to_secs;
    char * top;

    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    D.10304 = D.9989 + 7;
    val = pstrdup (D.10304);
    top = __builtin_strchr (val, 45);
    if (top == 0B) goto <D.10305>; else goto <D.10306>;
    <D.10305>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10306>:
    top.33 = top;
    top = top.33 + 1;
    *top.33 = 0;
    from_secs = atof (val);
    to_secs = atof (top);
    free (val);
    if (from_secs > to_secs) goto <D.10308>; else goto <D.10309>;
    <D.10308>:
    usage ();
    D.10037 = 1;
    return D.10037;
    <D.10309>:
    D.10310 = from_secs * 1.0e+9;
    time_from.34 = (long unsigned int) D.10310;
    time_from = time_from.34;
    D.10312 = to_secs * 1.0e+9;
    time_to.35 = (long unsigned int) D.10312;
    time_to = time_to.35;
  }
  goto <D.10314>;
  <D.10303>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s1_len = 9;
    if (__s1_len <= 3) goto <D.10316>; else goto <D.10317>;
    <D.10316>:
    {
      const unsigned char * __s2;
      int __result;

      D.9949 = (long unsigned int) i;
      D.9950 = D.9949 * 8;
      D.9951 = argv + D.9950;
      __s2 = *D.9951;
      D.10318 = "--verbose";
      D.10319 = MEM[(const unsigned char *)D.10318];
      D.10320 = (int) D.10319;
      D.10321 = *__s2;
      D.10322 = (int) D.10321;
      __result = D.10320 - D.10322;
      {
        D.10323 = __s1_len != 0;
        D.10324 = __result == 0;
        D.10325 = D.10323 & D.10324;
        if (D.10325 != 0) goto <D.10326>; else goto <D.10327>;
        <D.10326>:
        D.10328 = &MEM[(void *)"--verbose" + 1B];
        D.10329 = *D.10328;
        D.10330 = (int) D.10329;
        D.10331 = __s2 + 1;
        D.10332 = *D.10331;
        D.10333 = (int) D.10332;
        __result = D.10330 - D.10333;
        D.10334 = __s1_len > 1;
        D.10324 = __result == 0;
        D.10335 = D.10334 & D.10324;
        if (D.10335 != 0) goto <D.10336>; else goto <D.10337>;
        <D.10336>:
        D.10338 = &MEM[(void *)"--verbose" + 2B];
        D.10339 = *D.10338;
        D.10340 = (int) D.10339;
        D.10341 = __s2 + 2;
        D.10342 = *D.10341;
        D.10343 = (int) D.10342;
        __result = D.10340 - D.10343;
        D.10344 = __s1_len > 2;
        D.10324 = __result == 0;
        D.10345 = D.10344 & D.10324;
        if (D.10345 != 0) goto <D.10346>; else goto <D.10347>;
        <D.10346>:
        D.10348 = &MEM[(void *)"--verbose" + 3B];
        D.10349 = *D.10348;
        D.10350 = (int) D.10349;
        D.10351 = __s2 + 3;
        D.10352 = *D.10351;
        D.10353 = (int) D.10352;
        __result = D.10350 - D.10353;
        <D.10347>:
        <D.10337>:
        <D.10327>:
      }
      D.9727 = __result;
    }
    iftmp.36 = D.9727;
    goto <D.10354>;
    <D.10317>:
    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    iftmp.36 = __builtin_strcmp ("--verbose", D.9989);
    <D.10354>:
    D.9731 = iftmp.36;
  }
  if (D.9731 == 0) goto <D.10355>; else goto <D.10356>;
  <D.10355>:
  verbose.37 = verbose;
  verbose.38 = verbose.37 + 1;
  verbose = verbose.38;
  goto <D.10359>;
  <D.10356>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s1_len = 8;
    if (__s1_len <= 3) goto <D.10361>; else goto <D.10362>;
    <D.10361>:
    {
      const unsigned char * __s2;
      int __result;

      D.9949 = (long unsigned int) i;
      D.9950 = D.9949 * 8;
      D.9951 = argv + D.9950;
      __s2 = *D.9951;
      D.10363 = "--traces";
      D.10364 = MEM[(const unsigned char *)D.10363];
      D.10365 = (int) D.10364;
      D.10366 = *__s2;
      D.10367 = (int) D.10366;
      __result = D.10365 - D.10367;
      {
        D.10368 = __s1_len != 0;
        D.10369 = __result == 0;
        D.10370 = D.10368 & D.10369;
        if (D.10370 != 0) goto <D.10371>; else goto <D.10372>;
        <D.10371>:
        D.10373 = &MEM[(void *)"--traces" + 1B];
        D.10374 = *D.10373;
        D.10375 = (int) D.10374;
        D.10376 = __s2 + 1;
        D.10377 = *D.10376;
        D.10378 = (int) D.10377;
        __result = D.10375 - D.10378;
        D.10379 = __s1_len > 1;
        D.10369 = __result == 0;
        D.10380 = D.10379 & D.10369;
        if (D.10380 != 0) goto <D.10381>; else goto <D.10382>;
        <D.10381>:
        D.10383 = &MEM[(void *)"--traces" + 2B];
        D.10384 = *D.10383;
        D.10385 = (int) D.10384;
        D.10386 = __s2 + 2;
        D.10387 = *D.10386;
        D.10388 = (int) D.10387;
        __result = D.10385 - D.10388;
        D.10389 = __s1_len > 2;
        D.10369 = __result == 0;
        D.10390 = D.10389 & D.10369;
        if (D.10390 != 0) goto <D.10391>; else goto <D.10392>;
        <D.10391>:
        D.10393 = &MEM[(void *)"--traces" + 3B];
        D.10394 = *D.10393;
        D.10395 = (int) D.10394;
        D.10396 = __s2 + 3;
        D.10397 = *D.10396;
        D.10398 = (int) D.10397;
        __result = D.10395 - D.10398;
        <D.10392>:
        <D.10382>:
        <D.10372>:
      }
      D.9736 = __result;
    }
    iftmp.39 = D.9736;
    goto <D.10399>;
    <D.10362>:
    D.9949 = (long unsigned int) i;
    D.9950 = D.9949 * 8;
    D.9951 = argv + D.9950;
    D.9989 = *D.9951;
    iftmp.39 = __builtin_strcmp ("--traces", D.9989);
    <D.10399>:
    D.9740 = iftmp.39;
  }
  if (D.9740 == 0) goto <D.10400>; else goto <D.9741>;
  <D.10400>:
  show_traces = 1;
  collect_traces = 1;
  <D.10359>:
  <D.10314>:
  <D.10300>:
  <D.10295>:
  <D.10288>:
  <D.10281>:
  <D.10275>:
  <D.10267>:
  <D.10260>:
  <D.10127>:
  <D.9994>:
  i = i + 1;
  <D.9743>:
  if (i < argc) goto <D.9742>; else goto <D.9741>;
  <D.9741>:
  if (i >= argc) goto <D.10401>; else goto <D.10402>;
  <D.10401>:
  usage ();
  D.10037 = 2;
  return D.10037;
  <D.10402>:
  D.9949 = (long unsigned int) i;
  D.9950 = D.9949 * 8;
  D.9951 = argv + D.9950;
  D.9989 = *D.9951;
  ctx = load_file (D.9989);
  if (ctx == 0B) goto <D.10403>; else goto <D.10404>;
  <D.10403>:
  printf ("Not a log profiler data file (or unsupported version).\n");
  D.10037 = 1;
  return D.10037;
  <D.10404>:
  goto <D.9745>;
  <D.9744>:
  <D.9745>:
  D.10405 = decode_buffer (ctx);
  if (D.10405 != 0) goto <D.9744>; else goto <D.9746>;
  <D.9746>:
  flush_context (ctx);
  num_tracked_objects.40 = num_tracked_objects;
  if (num_tracked_objects.40 != 0) goto <D.10407>; else goto <D.10408>;
  <D.10407>:
  D.10037 = 0;
  return D.10037;
  <D.10408>:
  reports.41 = reports;
  print_reports (ctx, reports.41, 0);
  D.10037 = 0;
  return D.10037;
}


add_find_spec (const char * p)
{
  char D.10420;
  const char * D.10422;
  char D.10423;
  const char * find_name.43;
  long unsigned int find_size.42;
  int D.10427;

  D.10420 = *p;
  if (D.10420 == 83) goto <D.10421>; else goto <D.10419>;
  <D.10421>:
  D.10422 = p + 1;
  D.10423 = *D.10422;
  if (D.10423 == 58) goto <D.10424>; else goto <D.10419>;
  <D.10424>:
  {
    char * vale;

    try
      {
        find_name.43 = p + 2;
        find_size.42 = strtoul (find_name.43, &vale, 10);
        find_size = find_size.42;
        D.10427 = 1;
        return D.10427;
      }
    finally
      {
        vale = {CLOBBER};
      }
  }
  <D.10419>:
  D.10420 = *p;
  if (D.10420 == 84) goto <D.10428>; else goto <D.10429>;
  <D.10428>:
  D.10422 = p + 1;
  D.10423 = *D.10422;
  if (D.10423 == 58) goto <D.10430>; else goto <D.10431>;
  <D.10430>:
  find_name.43 = p + 2;
  find_name = find_name.43;
  D.10427 = 1;
  return D.10427;
  <D.10431>:
  <D.10429>:
  D.10427 = 0;
  return D.10427;
}


found_object (uintptr_t obj)
{
  int num_tracked_objects.44;
  int num_tracked_objects.45;
  long unsigned int D.10436;
  long unsigned int D.10437;
  uintptr_t * tracked_objects.46;
  void * tracked_objects.47;
  sizetype D.10440;
  uintptr_t * D.10441;

  num_tracked_objects.44 = num_tracked_objects;
  num_tracked_objects.45 = num_tracked_objects.44 + 1;
  num_tracked_objects = num_tracked_objects.45;
  num_tracked_objects.44 = num_tracked_objects;
  D.10436 = (long unsigned int) num_tracked_objects.44;
  D.10437 = D.10436 * 8;
  tracked_objects.46 = tracked_objects;
  tracked_objects.47 = realloc (tracked_objects.46, D.10437);
  tracked_objects = tracked_objects.47;
  tracked_objects.46 = tracked_objects;
  num_tracked_objects.44 = num_tracked_objects;
  D.10436 = (long unsigned int) num_tracked_objects.44;
  D.10437 = D.10436 * 8;
  D.10440 = D.10437 + 18446744073709551608;
  D.10441 = tracked_objects.46 + D.10440;
  *D.10441 = obj;
}


pstrdup (const char * s)
{
  long unsigned int D.10442;
  unsigned int D.10443;
  unsigned int D.10444;
  long unsigned int D.10445;
  char * D.10446;
  int len;
  char * p;

  D.10442 = strlen (s);
  D.10443 = (unsigned int) D.10442;
  D.10444 = D.10443 + 1;
  len = (int) D.10444;
  D.10445 = (long unsigned int) len;
  p = malloc (D.10445);
  D.10445 = (long unsigned int) len;
  memcpy (p, s, D.10445);
  D.10446 = p;
  return D.10446;
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.10448;
  long unsigned int D.10449;

  D.10449 = __builtin_object_size (__dest, 0);
  D.10448 = __builtin___memcpy_chk (__dest, __src, __len, D.10449);
  return D.10448;
}


atof (const char * __nptr)
{
  double D.10451;

  D.10451 = strtod (__nptr, 0B);
  return D.10451;
}


usage ()
{
  const char * reports.48;

  printf ("Mono log profiler report version %d.%d\n", 0, 4);
  printf ("Usage: mprof-report [OPTIONS] FILENAME\n");
  printf ("FILENAME can be \'-\' to read from standard input.\n");
  printf ("Options:\n");
  printf ("\t--help               display this help\n");
  printf ("\t--out=FILE           write to FILE instead of stdout\n");
  printf ("\t--traces             collect and show backtraces\n");
  printf ("\t--maxframes=NUM      limit backtraces to NUM entries\n");
  printf ("\t--reports=R1[,R2...] print the specified reports. Defaults are:\n");
  reports.48 = reports;
  printf ("\t                     %s\n", reports.48);
  printf ("\t--method-sort=MODE   sort methods according to MODE: total, self, calls\n");
  printf ("\t--alloc-sort=MODE    sort allocations according to MODE: bytes, count\n");
  printf ("\t--track=OB1[,OB2...] track what happens to objects OBJ1, O2 etc.\n");
  printf ("\t--find=FINDSPEC      find and track objects matching FINFSPEC, where FINDSPEC is:\n");
  printf ("\t                     S:minimum_size or T:partial_name\n");
  printf ("\t--thread=THREADID    consider just the data for thread THREADID\n");
  printf ("\t--time=FROM-TO       consider data FROM seconds from startup up to TO seconds\n");
  printf ("\t--verbose            increase verbosity level\n");
  printf ("\t--debug              display decoding debug info for mprof-report devs\n");
}


load_file (char * name)
{
  int D.9279;
  int iftmp.49;
  int D.9278;
  const char[2] * D.10457;
  unsigned char D.10458;
  int D.10459;
  unsigned char D.10460;
  int D.10461;
  _Bool D.10462;
  _Bool D.10463;
  _Bool D.10464;
  const unsigned char * D.10467;
  unsigned char D.10468;
  int D.10469;
  const unsigned char * D.10470;
  unsigned char D.10471;
  int D.10472;
  _Bool D.10473;
  _Bool D.10474;
  const unsigned char * D.10477;
  unsigned char D.10478;
  int D.10479;
  const unsigned char * D.10480;
  unsigned char D.10481;
  int D.10482;
  _Bool D.10483;
  _Bool D.10484;
  const unsigned char * D.10487;
  unsigned char D.10488;
  int D.10489;
  const unsigned char * D.10490;
  unsigned char D.10491;
  int D.10492;
  struct _IO_FILE * stdin.50;
  struct FILE * D.10498;
  struct FILE * D.10499;
  int D.10504;
  struct gzFile_s * D.10505;
  int D.10506;
  struct ProfContext * D.10509;
  int D.10512;
  unsigned char * D.10514;
  unsigned char D.10515;
  unsigned char * D.10516;
  unsigned char D.10517;
  int D.10518;
  unsigned char * D.10519;
  unsigned char D.10520;
  int D.10521;
  int D.10522;
  unsigned char * D.10523;
  unsigned char D.10524;
  unsigned char * D.10527;
  int D.10528;
  unsigned char * D.10531;
  long int D.10532;
  long unsigned int D.10533;
  unsigned char * D.10534;
  int D.10535;
  unsigned char * D.10536;
  int D.10537;
  unsigned char * D.10538;
  int D.10539;
  unsigned char * p;
  struct ProfContext * ctx;

  ctx = calloc (80, 1);
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 1;
    if (__s2_len <= 3) goto <D.10455>; else goto <D.10456>;
    <D.10455>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = name;
      D.10457 = "-";
      D.10458 = MEM[(const unsigned char *)D.10457];
      D.10459 = (int) D.10458;
      D.10460 = *__s2;
      D.10461 = (int) D.10460;
      __result = D.10459 - D.10461;
      {
        D.10462 = __s2_len != 0;
        D.10463 = __result == 0;
        D.10464 = D.10462 & D.10463;
        if (D.10464 != 0) goto <D.10465>; else goto <D.10466>;
        <D.10465>:
        D.10467 = &MEM[(void *)"-" + 1B];
        D.10468 = *D.10467;
        D.10469 = (int) D.10468;
        D.10470 = __s2 + 1;
        D.10471 = *D.10470;
        D.10472 = (int) D.10471;
        __result = D.10469 - D.10472;
        D.10473 = __s2_len > 1;
        D.10463 = __result == 0;
        D.10474 = D.10473 & D.10463;
        if (D.10474 != 0) goto <D.10475>; else goto <D.10476>;
        <D.10475>:
        D.10477 = &MEM[(void *)"-" + 2B];
        D.10478 = *D.10477;
        D.10479 = (int) D.10478;
        D.10480 = __s2 + 2;
        D.10481 = *D.10480;
        D.10482 = (int) D.10481;
        __result = D.10479 - D.10482;
        D.10483 = __s2_len > 2;
        D.10463 = __result == 0;
        D.10484 = D.10483 & D.10463;
        if (D.10484 != 0) goto <D.10485>; else goto <D.10486>;
        <D.10485>:
        D.10487 = &MEM[(void *)"-" + 3B];
        D.10488 = *D.10487;
        D.10489 = (int) D.10488;
        D.10490 = __s2 + 3;
        D.10491 = *D.10490;
        D.10492 = (int) D.10491;
        __result = D.10489 - D.10492;
        <D.10486>:
        <D.10476>:
        <D.10466>:
      }
      D.9278 = __result;
    }
    iftmp.49 = -D.9278;
    goto <D.10493>;
    <D.10456>:
    iftmp.49 = __builtin_strcmp (name, "-");
    <D.10493>:
    D.9279 = iftmp.49;
  }
  if (D.9279 == 0) goto <D.10494>; else goto <D.10495>;
  <D.10494>:
  stdin.50 = stdin;
  ctx->file = stdin.50;
  goto <D.10497>;
  <D.10495>:
  D.10498 = fopen (name, "rb");
  ctx->file = D.10498;
  <D.10497>:
  D.10499 = ctx->file;
  if (D.10499 == 0B) goto <D.10500>; else goto <D.10501>;
  <D.10500>:
  printf ("Cannot open file: %s\n", name);
  exit (1);
  <D.10501>:
  D.10499 = ctx->file;
  stdin.50 = stdin;
  if (D.10499 != stdin.50) goto <D.10502>; else goto <D.10503>;
  <D.10502>:
  D.10499 = ctx->file;
  D.10504 = fileno (D.10499);
  D.10505 = gzdopen (D.10504, "rb");
  ctx->gzfile = D.10505;
  <D.10503>:
  D.10506 = load_data (ctx, 32);
  if (D.10506 == 0) goto <D.10507>; else goto <D.10508>;
  <D.10507>:
  D.10509 = 0B;
  return D.10509;
  <D.10508>:
  p = ctx->buf;
  D.10512 = read_int32 (p);
  if (D.10512 != 1297111553) goto <D.10510>; else goto <D.10513>;
  <D.10513>:
  D.10514 = p + 6;
  D.10515 = *D.10514;
  if (D.10515 > 4) goto <D.10510>; else goto <D.10511>;
  <D.10510>:
  D.10509 = 0B;
  return D.10509;
  <D.10511>:
  D.10516 = p + 4;
  D.10517 = *D.10516;
  D.10518 = (int) D.10517;
  ctx->version_major = D.10518;
  D.10519 = p + 5;
  D.10520 = *D.10519;
  D.10521 = (int) D.10520;
  ctx->version_minor = D.10521;
  D.10514 = p + 6;
  D.10515 = *D.10514;
  D.10522 = (int) D.10515;
  ctx->data_version = D.10522;
  D.10523 = p + 7;
  D.10524 = *D.10523;
  if (D.10524 > 8) goto <D.10525>; else goto <D.10526>;
  <D.10525>:
  D.10509 = 0B;
  return D.10509;
  <D.10526>:
  D.10527 = p + 20;
  D.10528 = read_int32 (D.10527);
  if (D.10528 != 0) goto <D.10529>; else goto <D.10530>;
  <D.10529>:
  D.10509 = 0B;
  return D.10509;
  <D.10530>:
  D.10531 = p + 8;
  D.10532 = read_int64 (D.10531);
  D.10533 = (long unsigned int) D.10532;
  ctx->startup_time = D.10533;
  D.10534 = p + 16;
  D.10535 = read_int32 (D.10534);
  ctx->timer_overhead = D.10535;
  D.10536 = p + 24;
  D.10537 = read_int32 (D.10536);
  ctx->pid = D.10537;
  D.10538 = p + 28;
  D.10539 = read_int16 (D.10538);
  ctx->port = D.10539;
  D.10509 = ctx;
  return D.10509;
}


load_data (struct ProfContext * ctx, int size)
{
  struct gzFile_s * * D.10550;
  unsigned int size.51;
  unsigned char * D.10554;
  int D.10557;
  _Bool D.10558;
  _Bool D.10559;
  struct FILE * D.10560;
  long unsigned int D.10561;
  long unsigned int D.10562;

  ensure_buffer (ctx, size);
  D.10550 = ctx->gzfile;
  if (D.10550 != 0B) goto <D.10551>; else goto <D.10552>;
  <D.10551>:
  {
    int r;

    size.51 = (unsigned int) size;
    D.10554 = ctx->buf;
    D.10550 = ctx->gzfile;
    r = gzread (D.10550, D.10554, size.51);
    if (r == 0) goto <D.10555>; else goto <D.10556>;
    <D.10555>:
    D.10558 = size == 0;
    D.10557 = (int) D.10558;
    return D.10557;
    <D.10556>:
    D.10559 = r == size;
    D.10557 = (int) D.10559;
    return D.10557;
  }
  <D.10552>:
  {
    int r;

    D.10560 = ctx->file;
    D.10561 = (long unsigned int) size;
    D.10554 = ctx->buf;
    D.10562 = fread (D.10554, D.10561, 1, D.10560);
    r = (int) D.10562;
    if (r == 0) goto <D.10563>; else goto <D.10564>;
    <D.10563>:
    D.10558 = size == 0;
    D.10557 = (int) D.10558;
    return D.10557;
    <D.10564>:
    D.10557 = r;
    return D.10557;
  }
}


ensure_buffer (struct ProfContext * ctx, int size)
{
  int D.10568;
  long unsigned int D.10571;
  unsigned char * D.10572;
  void * D.10573;

  D.10568 = ctx->size;
  if (D.10568 < size) goto <D.10569>; else goto <D.10570>;
  <D.10569>:
  D.10571 = (long unsigned int) size;
  D.10572 = ctx->buf;
  D.10573 = realloc (D.10572, D.10571);
  ctx->buf = D.10573;
  ctx->size = size;
  <D.10570>:
}


fread (void * restrict __ptr, size_t __size, size_t __n, struct FILE * restrict __stream)
{
  long unsigned int D.10574;
  int D.10579;
  int D.10581;
  long unsigned int D.10583;
  size_t D.10584;
  long unsigned int D.10585;
  long unsigned int D.10586;
  long unsigned int D.10587;
  long unsigned int D.10590;

  D.10574 = __builtin_object_size (__ptr, 0);
  if (D.10574 != 18446744073709551615) goto <D.10575>; else goto <D.10576>;
  <D.10575>:
  D.10579 = __builtin_constant_p (__size);
  if (D.10579 == 0) goto <D.10577>; else goto <D.10580>;
  <D.10580>:
  D.10581 = __builtin_constant_p (__n);
  if (D.10581 == 0) goto <D.10577>; else goto <D.10582>;
  <D.10582>:
  D.10583 = __size | __n;
  if (D.10583 > 4294967295) goto <D.10577>; else goto <D.10578>;
  <D.10577>:
  D.10585 = __builtin_object_size (__ptr, 0);
  D.10584 = __fread_chk (__ptr, D.10585, __size, __n, __stream);
  return D.10584;
  <D.10578>:
  D.10586 = __size * __n;
  D.10587 = __builtin_object_size (__ptr, 0);
  if (D.10586 > D.10587) goto <D.10588>; else goto <D.10589>;
  <D.10588>:
  D.10590 = __builtin_object_size (__ptr, 0);
  D.10584 = __fread_chk_warn (__ptr, D.10590, __size, __n, __stream);
  return D.10584;
  <D.10589>:
  <D.10576>:
  D.10584 = __fread_alias (__ptr, __size, __n, __stream);
  return D.10584;
}


read_int64 (unsigned char * p)
{
  unsigned char * p.52;
  unsigned char D.10596;
  unsigned char * p.53;
  unsigned char D.10598;
  int D.10599;
  int D.10600;
  long unsigned int D.10601;
  unsigned char * p.54;
  unsigned char D.10603;
  int D.10604;
  int D.10605;
  long unsigned int D.10606;
  unsigned char * p.55;
  unsigned char D.10608;
  long unsigned int D.10609;
  long unsigned int D.10610;
  unsigned char * p.56;
  unsigned char D.10612;
  long unsigned int D.10613;
  long unsigned int D.10614;
  unsigned char * p.57;
  unsigned char D.10616;
  long unsigned int D.10617;
  long unsigned int D.10618;
  unsigned char * p.58;
  unsigned char D.10620;
  long unsigned int D.10621;
  long unsigned int D.10622;
  unsigned char * p.59;
  unsigned char D.10624;
  long unsigned int D.10625;
  long unsigned int D.10626;
  int64_t D.10627;
  uint64_t value;

  p.52 = p;
  p = p.52 + 1;
  D.10596 = *p.52;
  value = (uint64_t) D.10596;
  p.53 = p;
  p = p.53 + 1;
  D.10598 = *p.53;
  D.10599 = (int) D.10598;
  D.10600 = D.10599 << 8;
  D.10601 = (long unsigned int) D.10600;
  value = D.10601 | value;
  p.54 = p;
  p = p.54 + 1;
  D.10603 = *p.54;
  D.10604 = (int) D.10603;
  D.10605 = D.10604 << 16;
  D.10606 = (long unsigned int) D.10605;
  value = D.10606 | value;
  p.55 = p;
  p = p.55 + 1;
  D.10608 = *p.55;
  D.10609 = (long unsigned int) D.10608;
  D.10610 = D.10609 << 24;
  value = D.10610 | value;
  p.56 = p;
  p = p.56 + 1;
  D.10612 = *p.56;
  D.10613 = (long unsigned int) D.10612;
  D.10614 = D.10613 << 32;
  value = D.10614 | value;
  p.57 = p;
  p = p.57 + 1;
  D.10616 = *p.57;
  D.10617 = (long unsigned int) D.10616;
  D.10618 = D.10617 << 40;
  value = D.10618 | value;
  p.58 = p;
  p = p.58 + 1;
  D.10620 = *p.58;
  D.10621 = (long unsigned int) D.10620;
  D.10622 = D.10621 << 48;
  value = D.10622 | value;
  p.59 = p;
  p = p.59 + 1;
  D.10624 = *p.59;
  D.10625 = (long unsigned int) D.10624;
  D.10626 = D.10625 << 54;
  value = D.10626 | value;
  D.10627 = (int64_t) value;
  return D.10627;
}


read_int32 (unsigned char * p)
{
  unsigned char * p.60;
  unsigned char D.10630;
  unsigned char * p.61;
  unsigned char D.10632;
  int D.10633;
  int D.10634;
  unsigned char * p.62;
  unsigned char D.10636;
  int D.10637;
  int D.10638;
  unsigned char * p.63;
  unsigned char D.10640;
  unsigned int D.10641;
  unsigned int D.10642;
  unsigned int value.64;
  unsigned int D.10644;
  int32_t D.10645;
  int32_t value;

  p.60 = p;
  p = p.60 + 1;
  D.10630 = *p.60;
  value = (int32_t) D.10630;
  p.61 = p;
  p = p.61 + 1;
  D.10632 = *p.61;
  D.10633 = (int) D.10632;
  D.10634 = D.10633 << 8;
  value = D.10634 | value;
  p.62 = p;
  p = p.62 + 1;
  D.10636 = *p.62;
  D.10637 = (int) D.10636;
  D.10638 = D.10637 << 16;
  value = D.10638 | value;
  p.63 = p;
  p = p.63 + 1;
  D.10640 = *p.63;
  D.10641 = (unsigned int) D.10640;
  D.10642 = D.10641 << 24;
  value.64 = (unsigned int) value;
  D.10644 = D.10642 | value.64;
  value = (int32_t) D.10644;
  D.10645 = value;
  return D.10645;
}


read_int16 (unsigned char * p)
{
  unsigned char * p.65;
  unsigned char D.10648;
  unsigned char * p.66;
  unsigned char D.10650;
  int D.10651;
  int D.10652;
  int32_t D.10653;
  int32_t value;

  p.65 = p;
  p = p.65 + 1;
  D.10648 = *p.65;
  value = (int32_t) D.10648;
  p.66 = p;
  p = p.66 + 1;
  D.10650 = *p.66;
  D.10651 = (int) D.10650;
  D.10652 = D.10651 << 8;
  value = D.10652 | value;
  D.10653 = value;
  return D.10653;
}


decode_buffer (struct ProfContext * ctx)
{
  struct gzFile_s * * D.10655;
  long int D.10658;
  struct FILE * D.10660;
  long int D.10661;
  int D.10662;
  int D.10665;
  unsigned char * p.67;
  unsigned char * p.68;
  int D.10668;
  int D.10671;
  struct FILE * outfile.69;
  const char * iftmp.70;
  unsigned int i.71;
  unsigned int D.10675;
  sizetype D.10679;
  unsigned char * D.10680;
  unsigned char D.10681;
  int D.10682;
  unsigned char * D.10683;
  unsigned char * D.10684;
  long int D.10685;
  unsigned char * D.10686;
  unsigned char * D.10687;
  unsigned char * D.10688;
  unsigned char * D.10689;
  int debug.72;
  int D.10693;
  long unsigned int startup_time.73;
  long unsigned int time_from.74;
  long unsigned int time_from.75;
  long unsigned int time_to.76;
  long unsigned int time_to.77;
  char * D.10705;
  char * D.10708;
  struct MethodDesc * * D.10709;
  long unsigned int D.10710;
  long unsigned int D.10711;
  struct MethodDesc * * D.10712;
  struct MethodDesc * D.10713;
  int D.10714;
  int D.10715;
  int D.10716;
  sizetype D.10717;
  unsigned char D.10718;
  int D.10719;
  int D.10720;
  uint8_t * D.10721;
  int gc_resizes.78;
  int gc_resizes.79;
  long unsigned int max_heap_size.80;
  long unsigned int D.10734;
  long int D.10737;
  int D.10738;
  const char * D.10739;
  int D.10744;
  int D.10745;
  long unsigned int D.10749;
  long unsigned int D.10750;
  long unsigned int D.10751;
  long unsigned int D.10752;
  long unsigned int D.10758;
  int D.10759;
  long unsigned int D.10760;
  long unsigned int gc_object_moves.81;
  long unsigned int gc_object_moves.82;
  int num_tracked_objects.83;
  long int D.10766;
  long int D.10767;
  long unsigned int D.10768;
  long int D.10769;
  long int D.10770;
  long unsigned int D.10771;
  void * D.10774;
  void * D.10775;
  long unsigned int D.10779;
  long unsigned int D.10780;
  long unsigned int D.10783;
  long unsigned int D.10784;
  long unsigned int D.10785;
  long unsigned int D.10786;
  struct TraceDesc * D.10787;
  long unsigned int D.10788;
  long int D.10793;
  long int D.10794;
  long unsigned int D.10795;
  void * D.10798;
  const char * D.10799;
  long unsigned int D.10803;
  long unsigned int D.10804;
  long unsigned int D.10807;
  long unsigned int D.10808;
  long unsigned int D.10809;
  long unsigned int D.10810;
  const char * D.10813;
  unsigned char * p.84;
  unsigned char * p.85;
  unsigned char D.10816;
  long int D.10823;
  void * D.10824;
  long int D.10825;
  void * D.10826;
  unsigned char * p.86;
  long int D.10844;
  char * D.10845;
  long int D.10848;
  struct ClassDesc * D.10851;
  char * D.10852;
  long int D.10853;
  long int D.10854;
  void * D.10855;
  long unsigned int thread_filter.87;
  long unsigned int D.10865;
  long int D.10867;
  long int D.10868;
  long unsigned int D.10869;
  long unsigned int D.10870;
  struct TraceDesc * D.10873;
  int num_bt.88;
  long unsigned int find_size.89;
  const char * find_name.90;
  char * D.10885;
  char * D.10886;
  long unsigned int D.10887;
  char * D.10892;
  long unsigned int D.10901;
  long int D.10904;
  void * D.10905;
  void * method_base.91;
  struct TraceDesc * D.10913;
  char * D.10917;
  const char * iftmp.92;
  const char * iftmp.93;
  long int D.10928;
  struct HeapShot * D.10931;
  int collect_traces.94;
  long int D.10935;
  long int D.10936;
  long unsigned int D.10937;
  long unsigned int iftmp.95;
  int D.10942;
  long unsigned int D.10945;
  long unsigned int D.10949;
  long unsigned int ref_offset.96;
  long unsigned int D.10951;
  long int D.10952;
  long int D.10953;
  long unsigned int D.10954;
  char * D.10961;
  void * D.10962;
  long unsigned int D.10966;
  const char * D.10969;
  long int D.10970;
  long int D.10971;
  void * D.10972;
  long unsigned int D.10975;
  long unsigned int D.10976;
  long unsigned int D.10987;
  uintptr_t * D.10989;
  uintptr_t * D.10990;
  int * D.10991;
  struct HeapShot * D.10997;
  unsigned char D.10998;
  int D.10999;
  int iftmp.97;
  long int D.11007;
  long int D.11008;
  long unsigned int D.11009;
  long unsigned int monitor_contention.98;
  long unsigned int monitor_contention.99;
  long unsigned int D.11014;
  long unsigned int D.11015;
  struct TraceDesc * D.11022;
  int num_bt.100;
  long unsigned int monitor_failed.101;
  long unsigned int monitor_failed.102;
  struct MonitorDesc * D.11034;
  long unsigned int D.11037;
  long unsigned int D.11040;
  long unsigned int D.11043;
  long unsigned int D.11044;
  long unsigned int monitor_acquired.103;
  long unsigned int monitor_acquired.104;
  long unsigned int D.11058;
  void * D.11061;
  const char * D.11062;
  int has_bt.105;
  int iftmp.106;
  long unsigned int D.11073;
  long unsigned int D.11074;
  long unsigned int D.11077;
  long unsigned int D.11078;
  struct MethodDesc * D.11081;
  char * D.11082;
  const char * D.11083;
  long unsigned int throw_count.107;
  long unsigned int throw_count.108;
  int has_bt.109;
  long int D.11103;
  long int D.11104;
  void * D.11105;
  long unsigned int D.11108;
  long unsigned int D.11109;
  long int D.11110;
  long int D.11111;
  void * ip.110;
  long int D.11118;
  long int D.11119;
  void * addr.111;
  long int D.11126;
  void * addr.112;
  long int p.113;
  long int p.114;
  long int D.11133;
  unsigned char * p;
  unsigned char * end;
  intptr_t thread_id;
  intptr_t ptr_base;
  intptr_t obj_base;
  intptr_t method_base;
  uint64_t time_base;
  uint64_t file_offset;
  int len;
  int i;
  struct ThreadContext * thread;

  try
    {
      D.10655 = ctx->gzfile;
      if (D.10655 != 0B) goto <D.10656>; else goto <D.10657>;
      <D.10656>:
      D.10655 = ctx->gzfile;
      D.10658 = gztell (D.10655);
      file_offset = (uint64_t) D.10658;
      goto <D.10659>;
      <D.10657>:
      D.10660 = ctx->file;
      D.10661 = ftell (D.10660);
      file_offset = (uint64_t) D.10661;
      <D.10659>:
      D.10662 = load_data (ctx, 48);
      if (D.10662 == 0) goto <D.10663>; else goto <D.10664>;
      <D.10663>:
      D.10665 = 0;
      return D.10665;
      <D.10664>:
      p.67 = ctx->buf;
      p = p.67;
      p.68 = p;
      D.10668 = read_int32 (p.68);
      if (D.10668 != 1297107969) goto <D.10669>; else goto <D.10670>;
      <D.10669>:
      p.68 = p;
      D.10671 = read_int32 (p.68);
      outfile.69 = outfile;
      fprintf (outfile.69, "Incorrect buffer id: 0x%x\n", D.10671);
      i = 0;
      goto <D.9119>;
      <D.9118>:
      i.71 = (unsigned int) i;
      D.10675 = i.71 & 7;
      if (D.10675 != 0) goto <D.10676>; else goto <D.10677>;
      <D.10676>:
      iftmp.70 = " ";
      goto <D.10678>;
      <D.10677>:
      iftmp.70 = "\n";
      <D.10678>:
      p.68 = p;
      D.10679 = (sizetype) i;
      D.10680 = p.68 + D.10679;
      D.10681 = *D.10680;
      D.10682 = (int) D.10681;
      outfile.69 = outfile;
      fprintf (outfile.69, "0x%x%s", D.10682, iftmp.70);
      i = i + 1;
      <D.9119>:
      if (i <= 47) goto <D.9118>; else goto <D.9120>;
      <D.9120>:
      D.10665 = 0;
      return D.10665;
      <D.10670>:
      p.68 = p;
      D.10683 = p.68 + 4;
      len = read_int32 (D.10683);
      p.68 = p;
      D.10684 = p.68 + 8;
      D.10685 = read_int64 (D.10684);
      time_base = (uint64_t) D.10685;
      p.68 = p;
      D.10686 = p.68 + 16;
      ptr_base = read_int64 (D.10686);
      p.68 = p;
      D.10687 = p.68 + 24;
      obj_base = read_int64 (D.10687);
      p.68 = p;
      D.10688 = p.68 + 32;
      thread_id = read_int64 (D.10688);
      p.68 = p;
      D.10689 = p.68 + 40;
      method_base = read_int64 (D.10689);
      debug.72 = debug;
      if (debug.72 != 0) goto <D.10691>; else goto <D.10692>;
      <D.10691>:
      outfile.69 = outfile;
      fprintf (outfile.69, "buf: thread:%x, len: %d, time: %llu, file offset: %llu\n", thread_id, len, time_base, file_offset);
      <D.10692>:
      thread = load_thread (ctx, thread_id);
      D.10693 = load_data (ctx, len);
      if (D.10693 == 0) goto <D.10694>; else goto <D.10695>;
      <D.10694>:
      D.10665 = 0;
      return D.10665;
      <D.10695>:
      startup_time.73 = startup_time;
      if (startup_time.73 == 0) goto <D.10697>; else goto <D.10698>;
      <D.10697>:
      startup_time = time_base;
      time_from.74 = time_from;
      if (time_from.74 != 0) goto <D.10700>; else goto <D.10701>;
      <D.10700>:
      time_from.74 = time_from;
      startup_time.73 = startup_time;
      time_from.75 = time_from.74 + startup_time.73;
      time_from = time_from.75;
      time_to.76 = time_to;
      startup_time.73 = startup_time;
      time_to.77 = time_to.76 + startup_time.73;
      time_to = time_to.77;
      <D.10701>:
      D.10705 = thread->name;
      if (D.10705 == 0B) goto <D.10706>; else goto <D.10707>;
      <D.10706>:
      D.10708 = pstrdup ("Main");
      thread->name = D.10708;
      <D.10707>:
      <D.10698>:
      i = 0;
      goto <D.9122>;
      <D.9121>:
      D.10709 = thread->stack;
      D.10710 = (long unsigned int) i;
      D.10711 = D.10710 * 8;
      D.10712 = D.10709 + D.10711;
      D.10713 = *D.10712;
      D.10714 = D.10713->recurse_count;
      D.10715 = D.10714 + 1;
      D.10713->recurse_count = D.10715;
      i = i + 1;
      <D.9122>:
      D.10716 = thread->stack_id;
      if (D.10716 > i) goto <D.9121>; else goto <D.9123>;
      <D.9123>:
      p.67 = ctx->buf;
      p = p.67;
      p.68 = p;
      D.10717 = (sizetype) len;
      end = p.68 + D.10717;
      goto <D.9261>;
      <D.9260>:
      p.68 = p;
      D.10718 = *p.68;
      D.10719 = (int) D.10718;
      D.10720 = D.10719 & 15;
      switch (D.10720) <default: <D.9259>, case 0: <D.9162>, case 1: <D.9124>, case 2: <D.9143>, case 3: <D.9173>, case 4: <D.9224>, case 5: <D.9212>, case 6: <D.9183>, case 7: <D.9235>>
      <D.9124>:
      {
        int subtype;
        uint64_t tdiff;

        p.68 = p;
        D.10718 = *p.68;
        D.10719 = (int) D.10718;
        subtype = D.10719 & 240;
        p.68 = p;
        D.10721 = p.68 + 1;
        tdiff = decode_uleb128 (D.10721, &p);
        time_base = time_base + tdiff;
        if (subtype == 32) goto <D.10722>; else goto <D.10723>;
        <D.10722>:
        {
          uint64_t new_size;

          p.68 = p;
          new_size = decode_uleb128 (p.68, &p);
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10724>; else goto <D.10725>;
          <D.10724>:
          outfile.69 = outfile;
          fprintf (outfile.69, "gc heap resized to %llu\n", new_size);
          <D.10725>:
          gc_resizes.78 = gc_resizes;
          gc_resizes.79 = gc_resizes.78 + 1;
          gc_resizes = gc_resizes.79;
          max_heap_size.80 = max_heap_size;
          if (new_size > max_heap_size.80) goto <D.10729>; else goto <D.10730>;
          <D.10729>:
          max_heap_size = new_size;
          <D.10730>:
        }
        goto <D.10731>;
        <D.10723>:
        if (subtype == 16) goto <D.10732>; else goto <D.10733>;
        <D.10732>:
        {
          uint64_t ev;
          int gen;

          p.68 = p;
          ev = decode_uleb128 (p.68, &p);
          p.68 = p;
          D.10734 = decode_uleb128 (p.68, &p);
          gen = (int) D.10734;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10735>; else goto <D.10736>;
          <D.10735>:
          D.10737 = thread->thread_id;
          D.10738 = (int) ev;
          D.10739 = gc_event_name (D.10738);
          outfile.69 = outfile;
          fprintf (outfile.69, "gc event for gen%d: %s at %llu (thread: 0x%x)\n", gen, D.10739, time_base, D.10737);
          <D.10736>:
          if (gen > 2) goto <D.10740>; else goto <D.10741>;
          <D.10740>:
          outfile.69 = outfile;
          fprintf (outfile.69, "incorrect gc gen: %d\n", gen);
          goto <D.9130>;
          <D.10741>:
          if (ev == 0) goto <D.10742>; else goto <D.10743>;
          <D.10742>:
          thread->gc_start_times[gen] = time_base;
          D.10744 = gc_info[gen].count;
          D.10745 = D.10744 + 1;
          gc_info[gen].count = D.10745;
          goto <D.10746>;
          <D.10743>:
          if (ev == 5) goto <D.10747>; else goto <D.10748>;
          <D.10747>:
          D.10749 = thread->gc_start_times[gen];
          tdiff = time_base - D.10749;
          D.10750 = gc_info[gen].total_time;
          D.10751 = D.10750 + tdiff;
          gc_info[gen].total_time = D.10751;
          D.10752 = gc_info[gen].max_time;
          if (D.10752 < tdiff) goto <D.10753>; else goto <D.10754>;
          <D.10753>:
          gc_info[gen].max_time = tdiff;
          <D.10754>:
          <D.10748>:
          <D.10746>:
        }
        goto <D.10755>;
        <D.10733>:
        if (subtype == 48) goto <D.10756>; else goto <D.10757>;
        <D.10756>:
        {
          int j;
          int num;

          p.68 = p;
          D.10758 = decode_uleb128 (p.68, &p);
          num = (int) D.10758;
          D.10759 = num / 2;
          D.10760 = (long unsigned int) D.10759;
          gc_object_moves.81 = gc_object_moves;
          gc_object_moves.82 = D.10760 + gc_object_moves.81;
          gc_object_moves = gc_object_moves.82;
          j = 0;
          goto <D.9136>;
          <D.9135>:
          {
            intptr_t obj1diff;
            intptr_t obj2diff;

            p.68 = p;
            obj1diff = decode_sleb128 (p.68, &p);
            p.68 = p;
            obj2diff = decode_sleb128 (p.68, &p);
            num_tracked_objects.83 = num_tracked_objects;
            if (num_tracked_objects.83 != 0) goto <D.10764>; else goto <D.10765>;
            <D.10764>:
            D.10766 = obj_base + obj2diff;
            D.10767 = D.10766 << 3;
            D.10768 = (long unsigned int) D.10767;
            D.10769 = obj_base + obj1diff;
            D.10770 = D.10769 << 3;
            D.10771 = (long unsigned int) D.10770;
            track_move (D.10771, D.10768);
            <D.10765>:
            debug.72 = debug;
            if (debug.72 != 0) goto <D.10772>; else goto <D.10773>;
            <D.10772>:
            D.10766 = obj_base + obj2diff;
            D.10767 = D.10766 << 3;
            D.10774 = (void *) D.10767;
            D.10769 = obj_base + obj1diff;
            D.10770 = D.10769 << 3;
            D.10775 = (void *) D.10770;
            outfile.69 = outfile;
            fprintf (outfile.69, "moved obj %p to %p\n", D.10775, D.10774);
            <D.10773>:
          }
          j = j + 2;
          <D.9136>:
          if (j < num) goto <D.9135>; else goto <D.9137>;
          <D.9137>:
        }
        goto <D.10776>;
        <D.10757>:
        if (subtype == 64) goto <D.10777>; else goto <D.10778>;
        <D.10777>:
        {
          int htype;
          uint32_t handle;
          intptr_t objdiff;

          p.68 = p;
          D.10779 = decode_uleb128 (p.68, &p);
          htype = (int) D.10779;
          p.68 = p;
          D.10780 = decode_uleb128 (p.68, &p);
          handle = (uint32_t) D.10780;
          p.68 = p;
          objdiff = decode_sleb128 (p.68, &p);
          if (htype > 3) goto <D.10781>; else goto <D.10782>;
          <D.10781>:
          D.10665 = 0;
          return D.10665;
          <D.10782>:
          D.10783 = handle_info[htype].created;
          D.10784 = D.10783 + 1;
          handle_info[htype].created = D.10784;
          D.10785 = handle_info[htype].live;
          D.10786 = D.10785 + 1;
          handle_info[htype].live = D.10786;
          D.10787 = &handle_info[htype].traces;
          add_trace_thread (thread, D.10787, 1);
          D.10785 = handle_info[htype].live;
          D.10788 = handle_info[htype].max_live;
          if (D.10785 > D.10788) goto <D.10789>; else goto <D.10790>;
          <D.10789>:
          D.10785 = handle_info[htype].live;
          handle_info[htype].max_live = D.10785;
          <D.10790>:
          num_tracked_objects.83 = num_tracked_objects;
          if (num_tracked_objects.83 != 0) goto <D.10791>; else goto <D.10792>;
          <D.10791>:
          D.10793 = obj_base + objdiff;
          D.10794 = D.10793 << 3;
          D.10795 = (long unsigned int) D.10794;
          track_handle (D.10795, htype, handle);
          <D.10792>:
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10796>; else goto <D.10797>;
          <D.10796>:
          D.10793 = obj_base + objdiff;
          D.10794 = D.10793 << 3;
          D.10798 = (void *) D.10794;
          D.10799 = get_handle_name (htype);
          outfile.69 = outfile;
          fprintf (outfile.69, "handle (%s) %u created for object %p\n", D.10799, handle, D.10798);
          <D.10797>:
        }
        goto <D.10800>;
        <D.10778>:
        if (subtype == 80) goto <D.10801>; else goto <D.10802>;
        <D.10801>:
        {
          int htype;
          uint32_t handle;

          p.68 = p;
          D.10803 = decode_uleb128 (p.68, &p);
          htype = (int) D.10803;
          p.68 = p;
          D.10804 = decode_uleb128 (p.68, &p);
          handle = (uint32_t) D.10804;
          if (htype > 3) goto <D.10805>; else goto <D.10806>;
          <D.10805>:
          D.10665 = 0;
          return D.10665;
          <D.10806>:
          D.10807 = handle_info[htype].destroyed;
          D.10808 = D.10807 + 1;
          handle_info[htype].destroyed = D.10808;
          D.10809 = handle_info[htype].live;
          D.10810 = D.10809 + 18446744073709551615;
          handle_info[htype].live = D.10810;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10811>; else goto <D.10812>;
          <D.10811>:
          D.10813 = get_handle_name (htype);
          outfile.69 = outfile;
          fprintf (outfile.69, "handle (%s) %u destroyed\n", D.10813, handle);
          <D.10812>:
        }
        <D.10802>:
        <D.10800>:
        <D.10776>:
        <D.10755>:
        <D.10731>:
        goto <D.9130>;
      }
      <D.9143>:
      {
        int error;
        uint64_t tdiff;
        int mtype;
        intptr_t ptrdiff;

        p.68 = p;
        D.10718 = *p.68;
        D.10719 = (int) D.10718;
        error = D.10719 & 128;
        p.68 = p;
        D.10721 = p.68 + 1;
        tdiff = decode_uleb128 (D.10721, &p);
        p.68 = p;
        p.84 = p.68;
        p.85 = p.84 + 1;
        p = p.85;
        D.10816 = *p.84;
        mtype = (int) D.10816;
        p.68 = p;
        ptrdiff = decode_sleb128 (p.68, &p);
        time_base = time_base + tdiff;
        if (mtype == 1) goto <D.10817>; else goto <D.10818>;
        <D.10817>:
        {
          intptr_t imptrdiff;
          uint64_t flags;

          p.68 = p;
          imptrdiff = decode_sleb128 (p.68, &p);
          p.68 = p;
          flags = decode_uleb128 (p.68, &p);
          if (flags != 0) goto <D.10819>; else goto <D.10820>;
          <D.10819>:
          outfile.69 = outfile;
          fprintf (outfile.69, "non-zero flags in class\n");
          D.10665 = 0;
          return D.10665;
          <D.10820>:
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10821>; else goto <D.10822>;
          <D.10821>:
          D.10823 = ptr_base + imptrdiff;
          D.10824 = (void *) D.10823;
          p.68 = p;
          D.10825 = ptr_base + ptrdiff;
          D.10826 = (void *) D.10825;
          outfile.69 = outfile;
          fprintf (outfile.69, "loaded class %p (%s in %p) at %llu\n", D.10826, p.68, D.10824, time_base);
          <D.10822>:
          if (error == 0) goto <D.10827>; else goto <D.10828>;
          <D.10827>:
          p.68 = p;
          D.10825 = ptr_base + ptrdiff;
          add_class (D.10825, p.68);
          <D.10828>:
          goto <D.9151>;
          <D.9150>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9151>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9150>; else goto <D.9152>;
          <D.9152>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        goto <D.10830>;
        <D.10818>:
        if (mtype == 2) goto <D.10831>; else goto <D.10832>;
        <D.10831>:
        {
          uint64_t flags;

          p.68 = p;
          flags = decode_uleb128 (p.68, &p);
          if (flags != 0) goto <D.10833>; else goto <D.10834>;
          <D.10833>:
          outfile.69 = outfile;
          fprintf (outfile.69, "non-zero flags in image\n");
          D.10665 = 0;
          return D.10665;
          <D.10834>:
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10835>; else goto <D.10836>;
          <D.10835>:
          p.68 = p;
          D.10825 = ptr_base + ptrdiff;
          D.10826 = (void *) D.10825;
          outfile.69 = outfile;
          fprintf (outfile.69, "loaded image %p (%s) at %llu\n", D.10826, p.68, time_base);
          <D.10836>:
          if (error == 0) goto <D.10837>; else goto <D.10838>;
          <D.10837>:
          p.68 = p;
          D.10825 = ptr_base + ptrdiff;
          add_image (D.10825, p.68);
          <D.10838>:
          goto <D.9155>;
          <D.9154>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9155>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9154>; else goto <D.9156>;
          <D.9156>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        goto <D.10839>;
        <D.10832>:
        if (mtype == 5) goto <D.10840>; else goto <D.10841>;
        <D.10840>:
        {
          struct ThreadContext * nt;
          uint64_t flags;

          p.68 = p;
          flags = decode_uleb128 (p.68, &p);
          if (flags != 0) goto <D.10842>; else goto <D.10843>;
          <D.10842>:
          outfile.69 = outfile;
          fprintf (outfile.69, "non-zero flags in thread\n");
          D.10665 = 0;
          return D.10665;
          <D.10843>:
          D.10844 = ptr_base * ptrdiff;
          nt = get_thread (ctx, D.10844);
          p.68 = p;
          D.10845 = pstrdup (p.68);
          nt->name = D.10845;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10846>; else goto <D.10847>;
          <D.10846>:
          p.68 = p;
          D.10825 = ptr_base + ptrdiff;
          D.10826 = (void *) D.10825;
          outfile.69 = outfile;
          fprintf (outfile.69, "thread %p named: %s\n", D.10826, p.68);
          <D.10847>:
          goto <D.9160>;
          <D.9159>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9160>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9159>; else goto <D.9161>;
          <D.9161>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        <D.10841>:
        <D.10839>:
        <D.10830>:
        goto <D.9130>;
      }
      <D.9162>:
      {
        int has_bt;
        uint64_t tdiff;
        intptr_t ptrdiff;
        intptr_t objdiff;
        uint64_t len;
        int num_bt;
        struct MethodDesc * sframes[8];
        struct MethodDesc * * frames;
        struct ClassDesc * cd;

        try
          {
            p.68 = p;
            D.10718 = *p.68;
            D.10719 = (int) D.10718;
            has_bt = D.10719 & 16;
            p.68 = p;
            D.10721 = p.68 + 1;
            tdiff = decode_uleb128 (D.10721, &p);
            p.68 = p;
            ptrdiff = decode_sleb128 (p.68, &p);
            p.68 = p;
            objdiff = decode_sleb128 (p.68, &p);
            num_bt = 0;
            frames = &sframes;
            D.10848 = ptr_base + ptrdiff;
            cd = lookup_class (D.10848);
            p.68 = p;
            len = decode_uleb128 (p.68, &p);
            time_base = time_base + tdiff;
            debug.72 = debug;
            if (debug.72 != 0) goto <D.10849>; else goto <D.10850>;
            <D.10849>:
            D.10848 = ptr_base + ptrdiff;
            D.10851 = lookup_class (D.10848);
            D.10852 = D.10851->name;
            D.10853 = obj_base + objdiff;
            D.10854 = D.10853 << 3;
            D.10855 = (void *) D.10854;
            outfile.69 = outfile;
            fprintf (outfile.69, "alloced object %p, size %llu (%s) at %llu\n", D.10855, len, D.10852, time_base);
            <D.10850>:
            if (has_bt != 0) goto <D.10856>; else goto <D.10857>;
            <D.10856>:
            num_bt = 8;
            p.68 = p;
            frames = decode_bt (&sframes, &num_bt, p.68, &p, ptr_base);
            if (frames == 0B) goto <D.10858>; else goto <D.10859>;
            <D.10858>:
            outfile.69 = outfile;
            fprintf (outfile.69, "Cannot load backtrace\n");
            D.10665 = 0;
            return D.10665;
            <D.10859>:
            <D.10857>:
            thread_filter.87 = thread_filter;
            if (thread_filter.87 != 0) goto <D.10864>; else goto <D.10860>;
            <D.10864>:
            D.10737 = thread->thread_id;
            D.10865 = (long unsigned int) D.10737;
            thread_filter.87 = thread_filter;
            if (D.10865 == thread_filter.87) goto <D.10861>; else goto <D.10860>;
            <D.10860>:
            time_from.74 = time_from;
            if (time_base >= time_from.74) goto <D.10866>; else goto <D.10862>;
            <D.10866>:
            time_to.76 = time_to;
            if (time_base < time_to.76) goto <D.10861>; else goto <D.10862>;
            <D.10861>:
            {
              struct BackTrace * bt;

              D.10867 = cd->allocs;
              D.10868 = D.10867 + 1;
              cd->allocs = D.10868;
              D.10869 = cd->alloc_size;
              D.10870 = D.10869 + len;
              cd->alloc_size = D.10870;
              if (has_bt != 0) goto <D.10871>; else goto <D.10872>;
              <D.10871>:
              D.10873 = &cd->traces;
              num_bt.88 = num_bt;
              bt = add_trace_methods (frames, num_bt.88, D.10873, len);
              goto <D.10875>;
              <D.10872>:
              D.10873 = &cd->traces;
              bt = add_trace_thread (thread, D.10873, len);
              <D.10875>:
              find_size.89 = find_size;
              if (find_size.89 != 0) goto <D.10879>; else goto <D.10876>;
              <D.10879>:
              find_size.89 = find_size;
              if (len >= find_size.89) goto <D.10880>; else goto <D.10876>;
              <D.10880>:
              find_name.90 = find_name;
              if (find_name.90 == 0B) goto <D.10881>; else goto <D.10884>;
              <D.10884>:
              find_name.90 = find_name;
              D.10885 = cd->name;
              D.10886 = strstr (D.10885, find_name.90);
              if (D.10886 != 0B) goto <D.10881>; else goto <D.10882>;
              <D.10881>:
              D.10853 = obj_base + objdiff;
              D.10854 = D.10853 << 3;
              D.10887 = (long unsigned int) D.10854;
              found_object (D.10887);
              <D.10882>:
              goto <D.10877>;
              <D.10876>:
              find_size.89 = find_size;
              if (find_size.89 == 0) goto <D.10888>; else goto <D.10889>;
              <D.10888>:
              find_name.90 = find_name;
              if (find_name.90 != 0B) goto <D.10890>; else goto <D.10891>;
              <D.10890>:
              find_name.90 = find_name;
              D.10885 = cd->name;
              D.10892 = strstr (D.10885, find_name.90);
              if (D.10892 != 0B) goto <D.10893>; else goto <D.10894>;
              <D.10893>:
              D.10853 = obj_base + objdiff;
              D.10854 = D.10853 << 3;
              D.10887 = (long unsigned int) D.10854;
              found_object (D.10887);
              <D.10894>:
              <D.10891>:
              <D.10889>:
              <D.10877>:
              num_tracked_objects.83 = num_tracked_objects;
              if (num_tracked_objects.83 != 0) goto <D.10895>; else goto <D.10896>;
              <D.10895>:
              D.10853 = obj_base + objdiff;
              D.10854 = D.10853 << 3;
              D.10887 = (long unsigned int) D.10854;
              tracked_creation (D.10887, cd, len, bt, time_base);
              <D.10896>:
            }
            <D.10862>:
            if (&sframes != frames) goto <D.10897>; else goto <D.10898>;
            <D.10897>:
            free (frames);
            <D.10898>:
            goto <D.9130>;
          }
        finally
          {
            num_bt = {CLOBBER};
            sframes = {CLOBBER};
          }
      }
      <D.9173>:
      {
        int subtype;
        uint64_t tdiff;
        int64_t ptrdiff;

        p.68 = p;
        D.10718 = *p.68;
        D.10719 = (int) D.10718;
        subtype = D.10719 & 240;
        p.68 = p;
        D.10721 = p.68 + 1;
        tdiff = decode_uleb128 (D.10721, &p);
        p.68 = p;
        ptrdiff = decode_sleb128 (p.68, &p);
        time_base = time_base + tdiff;
        method_base = method_base + ptrdiff;
        if (subtype == 64) goto <D.10899>; else goto <D.10900>;
        <D.10899>:
        {
          intptr_t codediff;
          int codelen;

          p.68 = p;
          codediff = decode_sleb128 (p.68, &p);
          p.68 = p;
          D.10901 = decode_uleb128 (p.68, &p);
          codelen = (int) D.10901;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10902>; else goto <D.10903>;
          <D.10902>:
          D.10904 = ptr_base + codediff;
          D.10905 = (void *) D.10904;
          p.68 = p;
          method_base.91 = (void *) method_base;
          outfile.69 = outfile;
          fprintf (outfile.69, "jitted method %p (%s), size: %d, code: %p\n", method_base.91, p.68, codelen, D.10905);
          <D.10903>:
          D.10904 = ptr_base + codediff;
          p.68 = p;
          add_method (method_base, p.68, D.10904, codelen);
          goto <D.9180>;
          <D.9179>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9180>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9179>; else goto <D.9181>;
          <D.9181>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        goto <D.10907>;
        <D.10900>:
        {
          struct MethodDesc * method;

          thread_filter.87 = thread_filter;
          if (thread_filter.87 != 0) goto <D.10908>; else goto <D.10909>;
          <D.10908>:
          D.10737 = thread->thread_id;
          D.10865 = (long unsigned int) D.10737;
          thread_filter.87 = thread_filter;
          if (D.10865 != thread_filter.87) goto <D.9130>; else goto <D.10910>;
          <D.10910>:
          <D.10909>:
          method = lookup_method (method_base);
          if (subtype == 32) goto <D.10911>; else goto <D.10912>;
          <D.10911>:
          D.10913 = &method->traces;
          add_trace_thread (thread, D.10913, 1);
          push_method (thread, method, time_base);
          goto <D.10914>;
          <D.10912>:
          pop_method (thread, method, time_base);
          <D.10914>:
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10915>; else goto <D.10916>;
          <D.10915>:
          D.10917 = method->name;
          if (subtype != 32) goto <D.10919>; else goto <D.10920>;
          <D.10919>:
          if (subtype == 48) goto <D.10922>; else goto <D.10923>;
          <D.10922>:
          iftmp.93 = "exleave";
          goto <D.10924>;
          <D.10923>:
          iftmp.93 = "leave";
          <D.10924>:
          iftmp.92 = iftmp.93;
          goto <D.10925>;
          <D.10920>:
          iftmp.92 = "enter";
          <D.10925>:
          outfile.69 = outfile;
          fprintf (outfile.69, "%s method %s\n", iftmp.92, D.10917);
          <D.10916>:
        }
        <D.10907>:
        goto <D.9130>;
      }
      <D.9183>:
      {
        int subtype;

        p.68 = p;
        D.10718 = *p.68;
        D.10719 = (int) D.10718;
        subtype = D.10719 & 240;
        if (subtype == 32) goto <D.10926>; else goto <D.10927>;
        <D.10926>:
        {
          struct HeapObjectDesc * ho;
          int i;
          intptr_t objdiff;
          intptr_t ptrdiff;
          uint64_t size;
          uintptr_t num;
          uintptr_t ref_offset;
          uintptr_t last_obj_offset;
          struct ClassDesc * cd;

          try
            {
              p.68 = p;
              D.10721 = p.68 + 1;
              objdiff = decode_sleb128 (D.10721, &p);
              p.68 = p;
              ptrdiff = decode_sleb128 (p.68, &p);
              p.68 = p;
              size = decode_uleb128 (p.68, &p);
              p.68 = p;
              num = decode_uleb128 (p.68, &p);
              last_obj_offset = 0;
              D.10928 = ptr_base + ptrdiff;
              cd = lookup_class (D.10928);
              if (size != 0) goto <D.10929>; else goto <D.10930>;
              <D.10929>:
              {
                struct HeapClassDesc * hcd;

                D.10931 = thread->current_heap_shot;
                hcd = add_heap_shot_class (D.10931, cd, size);
                collect_traces.94 = collect_traces;
                if (collect_traces.94 != 0) goto <D.10933>; else goto <D.10934>;
                <D.10933>:
                D.10935 = obj_base + objdiff;
                D.10936 = D.10935 << 3;
                D.10937 = (long unsigned int) D.10936;
                ho = alloc_heap_obj (D.10937, hcd, num);
                D.10931 = thread->current_heap_shot;
                add_heap_shot_obj (D.10931, ho);
                ref_offset = 0;
                <D.10934>:
              }
              goto <D.10938>;
              <D.10930>:
              collect_traces.94 = collect_traces;
              if (collect_traces.94 != 0) goto <D.10939>; else goto <D.10940>;
              <D.10939>:
              D.10935 = obj_base + objdiff;
              D.10936 = D.10935 << 3;
              D.10937 = (long unsigned int) D.10936;
              D.10931 = thread->current_heap_shot;
              ho = heap_shot_obj_add_refs (D.10931, D.10937, num, &ref_offset);
              <D.10940>:
              <D.10938>:
              i = 0;
              goto <D.9198>;
              <D.9197>:
              {
                uintptr_t offset;
                intptr_t obj1diff;

                D.10942 = ctx->data_version;
                if (D.10942 > 1) goto <D.10943>; else goto <D.10944>;
                <D.10943>:
                p.68 = p;
                D.10945 = decode_uleb128 (p.68, &p);
                iftmp.95 = D.10945 + last_obj_offset;
                goto <D.10946>;
                <D.10944>:
                iftmp.95 = 18446744073709551615;
                <D.10946>:
                offset = iftmp.95;
                p.68 = p;
                obj1diff = decode_sleb128 (p.68, &p);
                last_obj_offset = offset;
                collect_traces.94 = collect_traces;
                if (collect_traces.94 != 0) goto <D.10947>; else goto <D.10948>;
                <D.10947>:
                D.10949 = (long unsigned int) i;
                ref_offset.96 = ref_offset;
                D.10951 = D.10949 + ref_offset.96;
                D.10952 = obj_base + obj1diff;
                D.10953 = D.10952 << 3;
                D.10954 = (long unsigned int) D.10953;
                ho->refs[D.10951] = D.10954;
                <D.10948>:
                num_tracked_objects.83 = num_tracked_objects;
                if (num_tracked_objects.83 != 0) goto <D.10955>; else goto <D.10956>;
                <D.10955>:
                D.10935 = obj_base + objdiff;
                D.10936 = D.10935 << 3;
                D.10937 = (long unsigned int) D.10936;
                D.10952 = obj_base + obj1diff;
                D.10953 = D.10952 << 3;
                D.10954 = (long unsigned int) D.10953;
                track_obj_reference (D.10954, D.10937, cd);
                <D.10956>:
              }
              i = i + 1;
              <D.9198>:
              D.10949 = (long unsigned int) i;
              if (D.10949 < num) goto <D.9197>; else goto <D.9199>;
              <D.9199>:
              debug.72 = debug;
              if (debug.72 != 0) goto <D.10957>; else goto <D.10958>;
              <D.10957>:
              if (size != 0) goto <D.10959>; else goto <D.10960>;
              <D.10959>:
              D.10961 = cd->name;
              D.10935 = obj_base + objdiff;
              D.10936 = D.10935 << 3;
              D.10962 = (void *) D.10936;
              outfile.69 = outfile;
              fprintf (outfile.69, "traced object %p, size %llu (%s), refs: %d\n", D.10962, size, D.10961, num);
              <D.10960>:
              <D.10958>:
            }
          finally
            {
              ref_offset = {CLOBBER};
            }
        }
        goto <D.10963>;
        <D.10927>:
        if (subtype == 48) goto <D.10964>; else goto <D.10965>;
        <D.10964>:
        {
          uintptr_t num;
          uintptr_t gc_num;
          int i;

          p.68 = p;
          D.10721 = p.68 + 1;
          num = decode_uleb128 (D.10721, &p);
          p.68 = p;
          gc_num = decode_uleb128 (p.68, &p);
          i = 0;
          goto <D.9207>;
          <D.9206>:
          {
            intptr_t objdiff;
            int root_type;
            uintptr_t extra_info;

            p.68 = p;
            objdiff = decode_sleb128 (p.68, &p);
            p.68 = p;
            D.10966 = decode_uleb128 (p.68, &p);
            root_type = (int) D.10966;
            p.68 = p;
            extra_info = decode_uleb128 (p.68, &p);
            debug.72 = debug;
            if (debug.72 != 0) goto <D.10967>; else goto <D.10968>;
            <D.10967>:
            D.10969 = get_root_name (root_type);
            D.10970 = obj_base + objdiff;
            D.10971 = D.10970 << 3;
            D.10972 = (void *) D.10971;
            outfile.69 = outfile;
            fprintf (outfile.69, "object %p is a %s root\n", D.10972, D.10969);
            <D.10968>:
            collect_traces.94 = collect_traces;
            if (collect_traces.94 != 0) goto <D.10973>; else goto <D.10974>;
            <D.10973>:
            D.10970 = obj_base + objdiff;
            D.10971 = D.10970 << 3;
            D.10975 = (long unsigned int) D.10971;
            thread_add_root (thread, D.10975, root_type, extra_info);
            <D.10974>:
          }
          i = i + 1;
          <D.9207>:
          D.10976 = (long unsigned int) i;
          if (D.10976 < num) goto <D.9206>; else goto <D.9208>;
          <D.9208>:
        }
        goto <D.10977>;
        <D.10965>:
        if (subtype == 16) goto <D.10978>; else goto <D.10979>;
        <D.10978>:
        {
          uint64_t tdiff;

          p.68 = p;
          D.10721 = p.68 + 1;
          tdiff = decode_uleb128 (D.10721, &p);
          time_base = time_base + tdiff;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10980>; else goto <D.10981>;
          <D.10980>:
          outfile.69 = outfile;
          fprintf (outfile.69, "heap shot end\n");
          <D.10981>:
          collect_traces.94 = collect_traces;
          if (collect_traces.94 != 0) goto <D.10982>; else goto <D.10983>;
          <D.10982>:
          {
            struct HeapShot * hs;

            hs = thread->current_heap_shot;
            if (hs != 0B) goto <D.10986>; else goto <D.10984>;
            <D.10986>:
            D.10987 = thread->num_roots;
            if (D.10987 != 0) goto <D.10988>; else goto <D.10984>;
            <D.10988>:
            D.10987 = thread->num_roots;
            hs->num_roots = D.10987;
            D.10989 = thread->roots;
            hs->roots = D.10989;
            D.10990 = thread->roots_extra;
            hs->roots_extra = D.10990;
            D.10991 = thread->roots_types;
            hs->roots_types = D.10991;
            goto <D.10985>;
            <D.10984>:
            D.10989 = thread->roots;
            free (D.10989);
            D.10990 = thread->roots_extra;
            free (D.10990);
            D.10991 = thread->roots_types;
            free (D.10991);
            <D.10985>:
            thread->num_roots = 0;
            thread->size_roots = 0;
            thread->roots = 0B;
            thread->roots_extra = 0B;
            thread->roots_types = 0B;
            heap_shot_resolve_reverse_refs (hs);
            heap_shot_mark_objects (hs);
            heap_shot_free_objects (hs);
          }
          <D.10983>:
          thread->current_heap_shot = 0B;
        }
        goto <D.10992>;
        <D.10979>:
        if (subtype == 0) goto <D.10993>; else goto <D.10994>;
        <D.10993>:
        {
          uint64_t tdiff;

          p.68 = p;
          D.10721 = p.68 + 1;
          tdiff = decode_uleb128 (D.10721, &p);
          time_base = time_base + tdiff;
          debug.72 = debug;
          if (debug.72 != 0) goto <D.10995>; else goto <D.10996>;
          <D.10995>:
          outfile.69 = outfile;
          fprintf (outfile.69, "heap shot start\n");
          <D.10996>:
          D.10997 = new_heap_shot (time_base);
          thread->current_heap_shot = D.10997;
        }
        <D.10994>:
        <D.10992>:
        <D.10977>:
        <D.10963>:
        goto <D.9130>;
      }
      <D.9212>:
      {
        int event;
        int has_bt;
        uint64_t tdiff;
        intptr_t objdiff;
        struct MethodDesc * sframes[8];
        struct MethodDesc * * frames;
        int record;
        int num_bt;

        try
          {
            p.68 = p;
            D.10718 = *p.68;
            D.10998 = D.10718 >> 4;
            D.10999 = (int) D.10998;
            event = D.10999 & 3;
            p.68 = p;
            D.10718 = *p.68;
            D.10719 = (int) D.10718;
            has_bt = D.10719 & 128;
            p.68 = p;
            D.10721 = p.68 + 1;
            tdiff = decode_uleb128 (D.10721, &p);
            p.68 = p;
            objdiff = decode_sleb128 (p.68, &p);
            frames = &sframes;
            num_bt = 0;
            time_base = time_base + tdiff;
            thread_filter.87 = thread_filter;
            if (thread_filter.87 == 0) goto <D.11001>; else goto <D.11004>;
            <D.11004>:
            D.10737 = thread->thread_id;
            D.10865 = (long unsigned int) D.10737;
            thread_filter.87 = thread_filter;
            if (D.10865 == thread_filter.87) goto <D.11001>; else goto <D.11002>;
            <D.11001>:
            iftmp.97 = 1;
            goto <D.11003>;
            <D.11002>:
            iftmp.97 = 0;
            <D.11003>:
            record = iftmp.97;
            if (event == 1) goto <D.11005>; else goto <D.11006>;
            <D.11005>:
            {
              struct MonitorDesc * mdesc;

              D.11007 = obj_base + objdiff;
              D.11008 = D.11007 << 3;
              D.11009 = (long unsigned int) D.11008;
              mdesc = lookup_monitor (D.11009);
              if (record != 0) goto <D.11010>; else goto <D.11011>;
              <D.11010>:
              monitor_contention.98 = monitor_contention;
              monitor_contention.99 = monitor_contention.98 + 1;
              monitor_contention = monitor_contention.99;
              D.11014 = mdesc->contentions;
              D.11015 = D.11014 + 1;
              mdesc->contentions = D.11015;
              thread->monitor = mdesc;
              thread->contention_start = time_base;
              <D.11011>:
              if (has_bt != 0) goto <D.11016>; else goto <D.11017>;
              <D.11016>:
              num_bt = 8;
              p.68 = p;
              frames = decode_bt (&sframes, &num_bt, p.68, &p, ptr_base);
              if (frames == 0B) goto <D.11018>; else goto <D.11019>;
              <D.11018>:
              outfile.69 = outfile;
              fprintf (outfile.69, "Cannot load backtrace\n");
              D.10665 = 0;
              return D.10665;
              <D.11019>:
              if (record != 0) goto <D.11020>; else goto <D.11021>;
              <D.11020>:
              D.11022 = &mdesc->traces;
              num_bt.100 = num_bt;
              add_trace_methods (frames, num_bt.100, D.11022, 1);
              <D.11021>:
              goto <D.11024>;
              <D.11017>:
              if (record != 0) goto <D.11025>; else goto <D.11026>;
              <D.11025>:
              D.11022 = &mdesc->traces;
              add_trace_thread (thread, D.11022, 1);
              <D.11026>:
              <D.11024>:
            }
            goto <D.11027>;
            <D.11006>:
            if (event == 3) goto <D.11028>; else goto <D.11029>;
            <D.11028>:
            if (record != 0) goto <D.11030>; else goto <D.11031>;
            <D.11030>:
            monitor_failed.101 = monitor_failed;
            monitor_failed.102 = monitor_failed.101 + 1;
            monitor_failed = monitor_failed.102;
            D.11034 = thread->monitor;
            if (D.11034 != 0B) goto <D.11035>; else goto <D.11036>;
            <D.11035>:
            D.11037 = thread->contention_start;
            if (D.11037 != 0) goto <D.11038>; else goto <D.11039>;
            <D.11038>:
            {
              uint64_t wait_time;

              D.11037 = thread->contention_start;
              wait_time = time_base - D.11037;
              D.11034 = thread->monitor;
              D.11040 = D.11034->max_wait_time;
              if (D.11040 < wait_time) goto <D.11041>; else goto <D.11042>;
              <D.11041>:
              D.11034 = thread->monitor;
              D.11034->max_wait_time = wait_time;
              <D.11042>:
              D.11034 = thread->monitor;
              D.11034 = thread->monitor;
              D.11043 = D.11034->wait_time;
              D.11044 = D.11043 + wait_time;
              D.11034->wait_time = D.11044;
              thread->monitor = 0B;
              thread->contention_start = 0;
            }
            <D.11039>:
            <D.11036>:
            <D.11031>:
            goto <D.11045>;
            <D.11029>:
            if (event == 2) goto <D.11046>; else goto <D.11047>;
            <D.11046>:
            if (record != 0) goto <D.11048>; else goto <D.11049>;
            <D.11048>:
            monitor_acquired.103 = monitor_acquired;
            monitor_acquired.104 = monitor_acquired.103 + 1;
            monitor_acquired = monitor_acquired.104;
            D.11034 = thread->monitor;
            if (D.11034 != 0B) goto <D.11052>; else goto <D.11053>;
            <D.11052>:
            D.11037 = thread->contention_start;
            if (D.11037 != 0) goto <D.11054>; else goto <D.11055>;
            <D.11054>:
            {
              uint64_t wait_time;

              D.11037 = thread->contention_start;
              wait_time = time_base - D.11037;
              D.11034 = thread->monitor;
              D.11040 = D.11034->max_wait_time;
              if (D.11040 < wait_time) goto <D.11056>; else goto <D.11057>;
              <D.11056>:
              D.11034 = thread->monitor;
              D.11034->max_wait_time = wait_time;
              <D.11057>:
              D.11034 = thread->monitor;
              D.11034 = thread->monitor;
              D.11043 = D.11034->wait_time;
              D.11058 = D.11043 + wait_time;
              D.11034->wait_time = D.11058;
              thread->monitor = 0B;
              thread->contention_start = 0;
            }
            <D.11055>:
            <D.11053>:
            <D.11049>:
            <D.11047>:
            <D.11045>:
            <D.11027>:
            debug.72 = debug;
            if (debug.72 != 0) goto <D.11059>; else goto <D.11060>;
            <D.11059>:
            D.11007 = obj_base + objdiff;
            D.11008 = D.11007 << 3;
            D.11061 = (void *) D.11008;
            D.11062 = monitor_ev_name (event);
            outfile.69 = outfile;
            fprintf (outfile.69, "monitor %s for object %p\n", D.11062, D.11061);
            <D.11060>:
            if (&sframes != frames) goto <D.11063>; else goto <D.11064>;
            <D.11063>:
            free (frames);
            <D.11064>:
            goto <D.9130>;
          }
        finally
          {
            sframes = {CLOBBER};
            num_bt = {CLOBBER};
          }
      }
      <D.9224>:
      {
        int subtype;
        int has_bt;
        uint64_t tdiff;
        struct MethodDesc * sframes[8];
        struct MethodDesc * * frames;
        int record;

        try
          {
            p.68 = p;
            D.10718 = *p.68;
            D.10719 = (int) D.10718;
            subtype = D.10719 & 112;
            p.68 = p;
            D.10718 = *p.68;
            D.10719 = (int) D.10718;
            has_bt.105 = D.10719 & 128;
            has_bt = has_bt.105;
            p.68 = p;
            D.10721 = p.68 + 1;
            tdiff = decode_uleb128 (D.10721, &p);
            frames = &sframes;
            time_base = time_base + tdiff;
            thread_filter.87 = thread_filter;
            if (thread_filter.87 == 0) goto <D.11067>; else goto <D.11070>;
            <D.11070>:
            D.10737 = thread->thread_id;
            D.10865 = (long unsigned int) D.10737;
            thread_filter.87 = thread_filter;
            if (D.10865 == thread_filter.87) goto <D.11067>; else goto <D.11068>;
            <D.11067>:
            iftmp.106 = 1;
            goto <D.11069>;
            <D.11068>:
            iftmp.106 = 0;
            <D.11069>:
            record = iftmp.106;
            if (subtype == 16) goto <D.11071>; else goto <D.11072>;
            <D.11071>:
            {
              int clause_type;
              int clause_num;
              int64_t ptrdiff;

              p.68 = p;
              D.11073 = decode_uleb128 (p.68, &p);
              clause_type = (int) D.11073;
              p.68 = p;
              D.11074 = decode_uleb128 (p.68, &p);
              clause_num = (int) D.11074;
              p.68 = p;
              ptrdiff = decode_sleb128 (p.68, &p);
              method_base = method_base + ptrdiff;
              if (record != 0) goto <D.11075>; else goto <D.11076>;
              <D.11075>:
              D.11077 = clause_summary[clause_type];
              D.11078 = D.11077 + 1;
              clause_summary[clause_type] = D.11078;
              <D.11076>:
              debug.72 = debug;
              if (debug.72 != 0) goto <D.11079>; else goto <D.11080>;
              <D.11079>:
              D.11081 = lookup_method (method_base);
              D.11082 = D.11081->name;
              D.11083 = clause_name (clause_type);
              outfile.69 = outfile;
              fprintf (outfile.69, "clause %s (%d) in method %s\n", D.11083, clause_num, D.11082);
              <D.11080>:
            }
            goto <D.11084>;
            <D.11072>:
            {
              intptr_t objdiff;

              p.68 = p;
              objdiff = decode_sleb128 (p.68, &p);
              if (record != 0) goto <D.11085>; else goto <D.11086>;
              <D.11085>:
              throw_count.107 = throw_count;
              throw_count.108 = throw_count.107 + 1;
              throw_count = throw_count.108;
              <D.11086>:
              has_bt.109 = has_bt;
              if (has_bt.109 != 0) goto <D.11090>; else goto <D.11091>;
              <D.11090>:
              has_bt = 8;
              p.68 = p;
              frames = decode_bt (&sframes, &has_bt, p.68, &p, ptr_base);
              if (frames == 0B) goto <D.11092>; else goto <D.11093>;
              <D.11092>:
              outfile.69 = outfile;
              fprintf (outfile.69, "Cannot load backtrace\n");
              D.10665 = 0;
              return D.10665;
              <D.11093>:
              if (record != 0) goto <D.11094>; else goto <D.11095>;
              <D.11094>:
              has_bt.109 = has_bt;
              add_trace_methods (frames, has_bt.109, &exc_traces, 1);
              <D.11095>:
              goto <D.11096>;
              <D.11091>:
              if (record != 0) goto <D.11097>; else goto <D.11098>;
              <D.11097>:
              add_trace_thread (thread, &exc_traces, 1);
              <D.11098>:
              <D.11096>:
              if (&sframes != frames) goto <D.11099>; else goto <D.11100>;
              <D.11099>:
              free (frames);
              <D.11100>:
              debug.72 = debug;
              if (debug.72 != 0) goto <D.11101>; else goto <D.11102>;
              <D.11101>:
              D.11103 = obj_base + objdiff;
              D.11104 = D.11103 << 3;
              D.11105 = (void *) D.11104;
              outfile.69 = outfile;
              fprintf (outfile.69, "throw %p\n", D.11105);
              <D.11102>:
            }
            <D.11084>:
            goto <D.9130>;
          }
        finally
          {
            has_bt = {CLOBBER};
            sframes = {CLOBBER};
          }
      }
      <D.9235>:
      {
        int subtype;

        p.68 = p;
        D.10718 = *p.68;
        D.10719 = (int) D.10718;
        subtype = D.10719 & 240;
        if (subtype == 0) goto <D.11106>; else goto <D.11107>;
        <D.11106>:
        {
          int i;
          int sample_type;
          uint64_t tstamp;
          int count;

          p.68 = p;
          D.10721 = p.68 + 1;
          D.11108 = decode_uleb128 (D.10721, &p);
          sample_type = (int) D.11108;
          p.68 = p;
          tstamp = decode_uleb128 (p.68, &p);
          p.68 = p;
          D.11109 = decode_uleb128 (p.68, &p);
          count = (int) D.11109;
          i = 0;
          goto <D.9243>;
          <D.9242>:
          {
            uintptr_t ip;

            p.68 = p;
            D.11110 = decode_sleb128 (p.68, &p);
            D.11111 = D.11110 + ptr_base;
            ip = (uintptr_t) D.11111;
            add_stat_sample (sample_type, ip);
            debug.72 = debug;
            if (debug.72 != 0) goto <D.11112>; else goto <D.11113>;
            <D.11112>:
            ip.110 = (void *) ip;
            outfile.69 = outfile;
            fprintf (outfile.69, "sample hit, type: %d at %p\n", sample_type, ip.110);
            <D.11113>:
          }
          i = i + 1;
          <D.9243>:
          if (i < count) goto <D.9242>; else goto <D.9244>;
          <D.9244>:
        }
        goto <D.11115>;
        <D.11107>:
        if (subtype == 16) goto <D.11116>; else goto <D.11117>;
        <D.11116>:
        {
          uintptr_t addr;
          uintptr_t size;
          char * name;

          p.68 = p;
          D.10721 = p.68 + 1;
          D.11118 = decode_sleb128 (D.10721, &p);
          D.11119 = D.11118 + ptr_base;
          addr = (uintptr_t) D.11119;
          p.68 = p;
          size = decode_uleb128 (p.68, &p);
          p.68 = p;
          name = pstrdup (p.68);
          add_unmanaged_symbol (addr, name, size);
          debug.72 = debug;
          if (debug.72 != 0) goto <D.11120>; else goto <D.11121>;
          <D.11120>:
          addr.111 = (void *) addr;
          outfile.69 = outfile;
          fprintf (outfile.69, "unmanaged symbol %s at %p\n", name, addr.111);
          <D.11121>:
          goto <D.9249>;
          <D.9248>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9249>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9248>; else goto <D.9250>;
          <D.9250>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        goto <D.11123>;
        <D.11117>:
        if (subtype == 32) goto <D.11124>; else goto <D.11125>;
        <D.11124>:
        {
          uint64_t tdiff;
          uintptr_t addr;
          uint64_t offset;
          uintptr_t size;
          char * name;

          p.68 = p;
          D.10721 = p.68 + 1;
          tdiff = decode_uleb128 (D.10721, &p);
          p.68 = p;
          D.11126 = decode_sleb128 (p.68, &p);
          addr = (uintptr_t) D.11126;
          p.68 = p;
          offset = decode_uleb128 (p.68, &p);
          p.68 = p;
          size = decode_uleb128 (p.68, &p);
          time_base = time_base + tdiff;
          p.68 = p;
          name = pstrdup (p.68);
          add_unmanaged_binary (addr, name, size);
          debug.72 = debug;
          if (debug.72 != 0) goto <D.11127>; else goto <D.11128>;
          <D.11127>:
          addr.112 = (void *) addr;
          outfile.69 = outfile;
          fprintf (outfile.69, "unmanaged binary %s at %p\n", name, addr.112);
          <D.11128>:
          goto <D.9257>;
          <D.9256>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
          <D.9257>:
          p.68 = p;
          D.10718 = *p.68;
          if (D.10718 != 0) goto <D.9256>; else goto <D.9258>;
          <D.9258>:
          p.68 = p;
          p.86 = p.68 + 1;
          p = p.86;
        }
        goto <D.11130>;
        <D.11125>:
        D.10665 = 0;
        return D.10665;
        <D.11130>:
        <D.11123>:
        <D.11115>:
        goto <D.9130>;
      }
      <D.9259>:
      p.68 = p;
      p.113 = (long int) p.68;
      p.67 = ctx->buf;
      p.114 = (long int) p.67;
      D.11133 = p.113 - p.114;
      p.68 = p;
      D.10718 = *p.68;
      D.10719 = (int) D.10718;
      outfile.69 = outfile;
      fprintf (outfile.69, "unhandled profiler event: 0x%x at file offset: %llu + %d (len: %d\n)\n", D.10719, file_offset, D.11133, len);
      exit (1);
      <D.9130>:
      <D.9261>:
      p.68 = p;
      if (p.68 < end) goto <D.9260>; else goto <D.9262>;
      <D.9262>:
      thread->last_time = time_base;
      i = 0;
      goto <D.9264>;
      <D.9263>:
      D.10709 = thread->stack;
      D.10710 = (long unsigned int) i;
      D.10711 = D.10710 * 8;
      D.10712 = D.10709 + D.10711;
      D.10713 = *D.10712;
      D.10713->recurse_count = 0;
      i = i + 1;
      <D.9264>:
      D.10716 = thread->stack_id;
      if (D.10716 > i) goto <D.9263>; else goto <D.9265>;
      <D.9265>:
      D.10665 = 1;
      return D.10665;
    }
  finally
    {
      p = {CLOBBER};
    }
}


load_thread (struct ProfContext * ctx, intptr_t thread_id)
{
  struct ThreadContext * D.11243;
  struct ThreadContext * thread;

  thread = get_thread (ctx, thread_id);
  ctx->current = thread;
  D.11243 = thread;
  return D.11243;
}


gc_event_name (int ev)
{
  const char * D.11246;

  switch (ev) <default: <D.8989>, case 0: <D.8979>, case 1: <D.8980>, case 2: <D.8981>, case 3: <D.8982>, case 4: <D.8983>, case 5: <D.8984>, case 6: <D.8985>, case 7: <D.8986>, case 8: <D.8987>, case 9: <D.8988>>
  <D.8979>:
  D.11246 = "start";
  return D.11246;
  <D.8980>:
  D.11246 = "mark start";
  return D.11246;
  <D.8981>:
  D.11246 = "mark end";
  return D.11246;
  <D.8982>:
  D.11246 = "reclaim start";
  return D.11246;
  <D.8983>:
  D.11246 = "reclaim end";
  return D.11246;
  <D.8984>:
  D.11246 = "end";
  return D.11246;
  <D.8985>:
  D.11246 = "pre stop";
  return D.11246;
  <D.8986>:
  D.11246 = "post stop";
  return D.11246;
  <D.8987>:
  D.11246 = "pre start";
  return D.11246;
  <D.8988>:
  D.11246 = "post start";
  return D.11246;
  <D.8989>:
  D.11246 = "unknown";
  return D.11246;
}


track_move (uintptr_t src, uintptr_t dst)
{
  uintptr_t * tracked_objects.115;
  long unsigned int D.11249;
  long unsigned int D.11250;
  uintptr_t * D.11251;
  long unsigned int D.11252;
  void * dst.116;
  void * src.117;
  struct FILE * outfile.118;
  int num_tracked_objects.119;
  int i;

  i = 0;
  goto <D.9090>;
  <D.9089>:
  tracked_objects.115 = tracked_objects;
  D.11249 = (long unsigned int) i;
  D.11250 = D.11249 * 8;
  D.11251 = tracked_objects.115 + D.11250;
  D.11252 = *D.11251;
  if (D.11252 == src) goto <D.11253>; else goto <D.11254>;
  <D.11253>:
  dst.116 = (void *) dst;
  src.117 = (void *) src;
  outfile.118 = outfile;
  fprintf (outfile.118, "Object %p moved to %p\n", src.117, dst.116);
  goto <D.11258>;
  <D.11254>:
  tracked_objects.115 = tracked_objects;
  D.11249 = (long unsigned int) i;
  D.11250 = D.11249 * 8;
  D.11251 = tracked_objects.115 + D.11250;
  D.11252 = *D.11251;
  if (D.11252 == dst) goto <D.11259>; else goto <D.11260>;
  <D.11259>:
  src.117 = (void *) src;
  dst.116 = (void *) dst;
  outfile.118 = outfile;
  fprintf (outfile.118, "Object %p moved from %p\n", dst.116, src.117);
  <D.11260>:
  <D.11258>:
  i = i + 1;
  <D.9090>:
  num_tracked_objects.119 = num_tracked_objects;
  if (i < num_tracked_objects.119) goto <D.9089>; else goto <D.9091>;
  <D.9091>:
}


track_handle (uintptr_t obj, int htype, uint32_t handle)
{
  uintptr_t * tracked_objects.120;
  long unsigned int D.11263;
  long unsigned int D.11264;
  uintptr_t * D.11265;
  long unsigned int D.11266;
  void * obj.121;
  struct FILE * outfile.122;
  int num_tracked_objects.123;
  int i;

  i = 0;
  goto <D.9082>;
  <D.9081>:
  tracked_objects.120 = tracked_objects;
  D.11263 = (long unsigned int) i;
  D.11264 = D.11263 * 8;
  D.11265 = tracked_objects.120 + D.11264;
  D.11266 = *D.11265;
  if (D.11266 == obj) goto <D.11267>; else goto <D.11268>;
  <D.11267>:
  obj.121 = (void *) obj;
  outfile.122 = outfile;
  fprintf (outfile.122, "Object %p referenced from handle %u\n", obj.121, handle);
  <D.11268>:
  i = i + 1;
  <D.9082>:
  num_tracked_objects.123 = num_tracked_objects;
  if (i < num_tracked_objects.123) goto <D.9081>; else goto <D.9083>;
  <D.9083>:
}


get_handle_name (int htype)
{
  const char * D.11272;

  switch (htype) <default: <D.9034>, case 0: <D.9030>, case 1: <D.9031>, case 2: <D.9032>, case 3: <D.9033>>
  <D.9030>:
  D.11272 = "weak";
  return D.11272;
  <D.9031>:
  D.11272 = "weaktrack";
  return D.11272;
  <D.9032>:
  D.11272 = "normal";
  return D.11272;
  <D.9033>:
  D.11272 = "pinned";
  return D.11272;
  <D.9034>:
  D.11272 = "unknown";
  return D.11272;
}


add_class (intptr_t klass, const char * name)
{
  long int D.11274;
  long int D.11275;
  long int D.11276;
  long int D.11278;
  char * D.11281;
  char * D.11282;
  struct ClassDesc * D.11283;
  char * D.11284;
  struct ClassDesc * D.11285;
  int num_classes.124;
  int num_classes.125;
  int slot;
  struct ClassDesc * cd;

  D.11274 = klass >> 2;
  D.11275 = D.11274 & 65535;
  D.11276 = D.11275 % 9371;
  slot = (int) D.11276;
  cd = class_hash[slot];
  goto <D.8410>;
  <D.8409>:
  cd = cd->next;
  <D.8410>:
  if (cd != 0B) goto <D.11277>; else goto <D.8411>;
  <D.11277>:
  D.11278 = cd->klass;
  if (D.11278 != klass) goto <D.8409>; else goto <D.8411>;
  <D.8411>:
  if (cd != 0B) goto <D.11279>; else goto <D.11280>;
  <D.11279>:
  D.11281 = cd->name;
  free (D.11281);
  D.11282 = pstrdup (name);
  cd->name = D.11282;
  D.11283 = cd;
  return D.11283;
  <D.11280>:
  cd = calloc (56, 1);
  cd->klass = klass;
  D.11284 = pstrdup (name);
  cd->name = D.11284;
  D.11285 = class_hash[slot];
  cd->next = D.11285;
  cd->allocs = 0;
  cd->alloc_size = 0;
  cd->traces.count = 0;
  cd->traces.size = 0;
  cd->traces.traces = 0B;
  class_hash[slot] = cd;
  num_classes.124 = num_classes;
  num_classes.125 = num_classes.124 + 1;
  num_classes = num_classes.125;
  D.11283 = cd;
  return D.11283;
}


add_image (intptr_t image, char * name)
{
  long int D.11291;
  long int D.11292;
  long int D.11293;
  char * D.11294;
  struct ImageDesc * D.11295;
  int num_images.126;
  int num_images.127;
  int slot;
  struct ImageDesc * cd;

  D.11291 = image >> 2;
  D.11292 = D.11291 & 65535;
  D.11293 = D.11292 % 31;
  slot = (int) D.11293;
  cd = malloc (24);
  cd->image = image;
  D.11294 = pstrdup (name);
  cd->filename = D.11294;
  D.11295 = image_hash[slot];
  cd->next = D.11295;
  image_hash[slot] = cd;
  num_images.126 = num_images;
  num_images.127 = num_images.126 + 1;
  num_images = num_images.127;
}


get_thread (struct ProfContext * ctx, intptr_t thread_id)
{
  struct ThreadContext * D.11299;
  long int D.11302;
  struct ThreadContext * D.11305;
  long int D.11306;
  struct ThreadContext * D.11309;
  int D.11310;
  long unsigned int D.11311;
  long unsigned int D.11312;
  void * D.11313;
  void * D.11314;
  void * D.11315;
  struct ThreadContext * thread;

  D.11299 = ctx->current;
  if (D.11299 != 0B) goto <D.11300>; else goto <D.11301>;
  <D.11300>:
  D.11299 = ctx->current;
  D.11302 = D.11299->thread_id;
  if (D.11302 == thread_id) goto <D.11303>; else goto <D.11304>;
  <D.11303>:
  D.11305 = ctx->current;
  return D.11305;
  <D.11304>:
  <D.11301>:
  thread = ctx->threads;
  goto <D.8882>;
  <D.8881>:
  D.11306 = thread->thread_id;
  if (D.11306 == thread_id) goto <D.11307>; else goto <D.11308>;
  <D.11307>:
  D.11305 = thread;
  return D.11305;
  <D.11308>:
  thread = thread->next;
  <D.8882>:
  if (thread != 0B) goto <D.8881>; else goto <D.8883>;
  <D.8883>:
  thread = calloc (152, 1);
  D.11309 = ctx->threads;
  thread->next = D.11309;
  ctx->threads = thread;
  thread->thread_id = thread_id;
  thread->last_time = 0;
  thread->stack_id = 0;
  thread->stack_size = 32;
  D.11310 = thread->stack_size;
  D.11311 = (long unsigned int) D.11310;
  D.11312 = D.11311 * 8;
  D.11313 = malloc (D.11312);
  thread->stack = D.11313;
  D.11310 = thread->stack_size;
  D.11311 = (long unsigned int) D.11310;
  D.11312 = D.11311 * 8;
  D.11314 = malloc (D.11312);
  thread->time_stack = D.11314;
  D.11310 = thread->stack_size;
  D.11311 = (long unsigned int) D.11310;
  D.11312 = D.11311 * 8;
  D.11315 = malloc (D.11312);
  thread->callee_time_stack = D.11315;
  D.11305 = thread;
  return D.11305;
}


tracked_creation (uintptr_t obj, struct ClassDesc * cd, uint64_t size, struct BackTrace * bt, uint64_t timestamp)
{
  uintptr_t * tracked_objects.128;
  long unsigned int D.11318;
  long unsigned int D.11319;
  uintptr_t * D.11320;
  long unsigned int D.11321;
  long unsigned int startup_time.129;
  long unsigned int D.11325;
  double D.11326;
  double D.11327;
  char * D.11328;
  void * obj.130;
  struct FILE * outfile.131;
  int D.11333;
  struct MethodDesc * D.11336;
  char * D.11337;
  int num_tracked_objects.132;
  int i;

  i = 0;
  goto <D.9073>;
  <D.9072>:
  tracked_objects.128 = tracked_objects;
  D.11318 = (long unsigned int) i;
  D.11319 = D.11318 * 8;
  D.11320 = tracked_objects.128 + D.11319;
  D.11321 = *D.11320;
  if (D.11321 != obj) goto <D.11322>; else goto <D.11323>;
  <D.11322>:
  // predicted unlikely by continue predictor.
  goto <D.9067>;
  <D.11323>:
  startup_time.129 = startup_time;
  D.11325 = timestamp - startup_time.129;
  D.11326 = (double) D.11325;
  D.11327 = D.11326 / 1.0e+9;
  D.11328 = cd->name;
  obj.130 = (void *) obj;
  outfile.131 = outfile;
  fprintf (outfile.131, "Object %p created (%s, %llu bytes) at %.3f secs.\n", obj.130, D.11328, size, D.11327);
  if (bt != 0B) goto <D.11331>; else goto <D.11332>;
  <D.11331>:
  D.11333 = bt->count;
  if (D.11333 != 0) goto <D.11334>; else goto <D.11335>;
  <D.11334>:
  {
    int k;

    k = 0;
    goto <D.9070>;
    <D.9069>:
    D.11336 = bt->methods[k];
    D.11337 = D.11336->name;
    outfile.131 = outfile;
    fprintf (outfile.131, "\t%s\n", D.11337);
    k = k + 1;
    <D.9070>:
    D.11333 = bt->count;
    if (D.11333 > k) goto <D.9069>; else goto <D.9071>;
    <D.9071>:
  }
  <D.11335>:
  <D.11332>:
  <D.9067>:
  i = i + 1;
  <D.9073>:
  num_tracked_objects.132 = num_tracked_objects;
  if (i < num_tracked_objects.132) goto <D.9072>; else goto <D.9074>;
  <D.9074>:
}


add_method (intptr_t method, const char * name, intptr_t code, int len)
{
  long int D.11339;
  long int D.11340;
  long int D.11341;
  long int D.11343;
  char * D.11346;
  char * D.11347;
  struct MethodDesc * D.11348;
  char * D.11349;
  struct MethodDesc * D.11350;
  int num_methods.133;
  int num_methods.134;
  int slot;
  struct MethodDesc * cd;

  D.11339 = method >> 2;
  D.11340 = D.11339 & 65535;
  D.11341 = D.11340 % 9371;
  slot = (int) D.11341;
  cd = method_hash[slot];
  goto <D.8446>;
  <D.8445>:
  cd = cd->next;
  <D.8446>:
  if (cd != 0B) goto <D.11342>; else goto <D.8447>;
  <D.11342>:
  D.11343 = cd->method;
  if (D.11343 != method) goto <D.8445>; else goto <D.8447>;
  <D.8447>:
  if (cd != 0B) goto <D.11344>; else goto <D.11345>;
  <D.11344>:
  cd->code = code;
  cd->len = len;
  D.11346 = cd->name;
  free (D.11346);
  D.11347 = pstrdup (name);
  cd->name = D.11347;
  D.11348 = cd;
  return D.11348;
  <D.11345>:
  cd = calloc (96, 1);
  cd->method = method;
  D.11349 = pstrdup (name);
  cd->name = D.11349;
  cd->code = code;
  cd->len = len;
  cd->calls = 0;
  cd->total_time = 0;
  cd->traces.count = 0;
  cd->traces.size = 0;
  cd->traces.traces = 0B;
  D.11350 = method_hash[slot];
  cd->next = D.11350;
  method_hash[slot] = cd;
  num_methods.133 = num_methods;
  num_methods.134 = num_methods.133 + 1;
  num_methods = num_methods.134;
  D.11348 = cd;
  return D.11348;
}


push_method (struct ThreadContext * thread, struct MethodDesc * method, uint64_t timestamp)
{
  uint64_t * D.11356;
  int D.11357;
  long unsigned int D.11358;
  long unsigned int D.11359;
  uint64_t * D.11360;
  uint64_t * D.11361;
  uint64_t * D.11362;
  struct MethodDesc * * D.11363;
  int D.11364;
  int D.11365;
  long unsigned int D.11366;
  long unsigned int D.11367;
  struct MethodDesc * * D.11368;
  int D.11369;
  int D.11370;

  ensure_thread_stack (thread);
  D.11356 = thread->time_stack;
  D.11357 = thread->stack_id;
  D.11358 = (long unsigned int) D.11357;
  D.11359 = D.11358 * 8;
  D.11360 = D.11356 + D.11359;
  *D.11360 = timestamp;
  D.11361 = thread->callee_time_stack;
  D.11357 = thread->stack_id;
  D.11358 = (long unsigned int) D.11357;
  D.11359 = D.11358 * 8;
  D.11362 = D.11361 + D.11359;
  *D.11362 = 0;
  D.11363 = thread->stack;
  D.11357 = thread->stack_id;
  D.11364 = D.11357;
  D.11365 = D.11364 + 1;
  thread->stack_id = D.11365;
  D.11366 = (long unsigned int) D.11364;
  D.11367 = D.11366 * 8;
  D.11368 = D.11363 + D.11367;
  *D.11368 = method;
  D.11369 = method->recurse_count;
  D.11370 = D.11369 + 1;
  method->recurse_count = D.11370;
}


ensure_thread_stack (struct ThreadContext * thread)
{
  int D.11371;
  int D.11372;
  int D.11375;
  long unsigned int D.11376;
  long unsigned int D.11377;
  struct MethodDesc * * D.11378;
  void * D.11379;
  uint64_t * D.11380;
  void * D.11381;
  uint64_t * D.11382;
  void * D.11383;

  D.11371 = thread->stack_id;
  D.11372 = thread->stack_size;
  if (D.11371 == D.11372) goto <D.11373>; else goto <D.11374>;
  <D.11373>:
  D.11372 = thread->stack_size;
  D.11375 = D.11372 * 2;
  thread->stack_size = D.11375;
  D.11372 = thread->stack_size;
  D.11376 = (long unsigned int) D.11372;
  D.11377 = D.11376 * 8;
  D.11378 = thread->stack;
  D.11379 = realloc (D.11378, D.11377);
  thread->stack = D.11379;
  D.11372 = thread->stack_size;
  D.11376 = (long unsigned int) D.11372;
  D.11377 = D.11376 * 8;
  D.11380 = thread->time_stack;
  D.11381 = realloc (D.11380, D.11377);
  thread->time_stack = D.11381;
  D.11372 = thread->stack_size;
  D.11376 = (long unsigned int) D.11372;
  D.11377 = D.11376 * 8;
  D.11382 = thread->callee_time_stack;
  D.11383 = realloc (D.11382, D.11377);
  thread->callee_time_stack = D.11383;
  <D.11374>:
}


pop_method (struct ThreadContext * thread, struct MethodDesc * method, uint64_t timestamp)
{
  int D.11384;
  int D.11385;
  int D.11388;
  struct MethodDesc * * D.11390;
  long unsigned int D.11391;
  long unsigned int D.11392;
  sizetype D.11393;
  struct MethodDesc * * D.11394;
  struct MethodDesc * D.11395;
  int D.11397;
  long unsigned int D.11398;
  long unsigned int D.11399;
  uint64_t * D.11400;
  uint64_t * D.11401;
  long unsigned int D.11402;
  char * D.11405;
  struct FILE * outfile.135;
  uint64_t * D.11407;
  uint64_t * D.11408;
  long unsigned int D.11409;
  long unsigned int D.11412;
  long unsigned int D.11413;
  long unsigned int D.11414;
  long unsigned int D.11415;
  long unsigned int D.11416;
  uint64_t * D.11419;
  long unsigned int D.11420;
  long unsigned int D.11421;

  D.11384 = method->recurse_count;
  D.11385 = D.11384 + -1;
  method->recurse_count = D.11385;
  D.11388 = thread->stack_id;
  if (D.11388 > 0) goto <D.11389>; else goto <D.11386>;
  <D.11389>:
  D.11390 = thread->stack;
  D.11388 = thread->stack_id;
  D.11391 = (long unsigned int) D.11388;
  D.11392 = D.11391 * 8;
  D.11393 = D.11392 + 18446744073709551608;
  D.11394 = D.11390 + D.11393;
  D.11395 = *D.11394;
  if (D.11395 == method) goto <D.11396>; else goto <D.11386>;
  <D.11396>:
  {
    uint64_t tdiff;

    D.11388 = thread->stack_id;
    D.11397 = D.11388 + -1;
    thread->stack_id = D.11397;
    D.11398 = method->calls;
    D.11399 = D.11398 + 1;
    method->calls = D.11399;
    D.11400 = thread->time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11401 = D.11400 + D.11392;
    D.11402 = *D.11401;
    if (D.11402 > timestamp) goto <D.11403>; else goto <D.11404>;
    <D.11403>:
    D.11405 = method->name;
    outfile.135 = outfile;
    fprintf (outfile.135, "time went backwards for %s\n", D.11405);
    <D.11404>:
    D.11400 = thread->time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11401 = D.11400 + D.11392;
    D.11402 = *D.11401;
    tdiff = timestamp - D.11402;
    D.11407 = thread->callee_time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11408 = D.11407 + D.11392;
    D.11409 = *D.11408;
    if (D.11409 > tdiff) goto <D.11410>; else goto <D.11411>;
    <D.11410>:
    D.11405 = method->name;
    outfile.135 = outfile;
    fprintf (outfile.135, "callee time bigger for %s\n", D.11405);
    <D.11411>:
    D.11412 = method->self_time;
    D.11407 = thread->callee_time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11408 = D.11407 + D.11392;
    D.11409 = *D.11408;
    D.11413 = tdiff - D.11409;
    D.11414 = D.11412 + D.11413;
    method->self_time = D.11414;
    D.11415 = method->callee_time;
    D.11407 = thread->callee_time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11408 = D.11407 + D.11392;
    D.11409 = *D.11408;
    D.11416 = D.11415 + D.11409;
    method->callee_time = D.11416;
    D.11388 = thread->stack_id;
    if (D.11388 != 0) goto <D.11417>; else goto <D.11418>;
    <D.11417>:
    D.11407 = thread->callee_time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11393 = D.11392 + 18446744073709551608;
    D.11419 = D.11407 + D.11393;
    D.11407 = thread->callee_time_stack;
    D.11388 = thread->stack_id;
    D.11391 = (long unsigned int) D.11388;
    D.11392 = D.11391 * 8;
    D.11393 = D.11392 + 18446744073709551608;
    D.11419 = D.11407 + D.11393;
    D.11420 = *D.11419;
    D.11421 = D.11420 + tdiff;
    *D.11419 = D.11421;
    <D.11418>:
  }
  goto <D.11387>;
  <D.11386>:
  D.11405 = method->name;
  D.11388 = thread->stack_id;
  outfile.135 = outfile;
  fprintf (outfile.135, "unmatched leave at stack pos: %d for method %s\n", D.11388, D.11405);
  <D.11387>:
}


lookup_class (intptr_t klass)
{
  long int D.11422;
  long int D.11423;
  long int D.11424;
  long int D.11426;
  void * klass.136;
  struct ClassDesc * D.11430;
  int slot;
  struct ClassDesc * cd;

  D.11422 = klass >> 2;
  D.11423 = D.11422 & 65535;
  D.11424 = D.11423 % 9371;
  slot = (int) D.11424;
  cd = class_hash[slot];
  goto <D.8418>;
  <D.8417>:
  cd = cd->next;
  <D.8418>:
  if (cd != 0B) goto <D.11425>; else goto <D.8419>;
  <D.11425>:
  D.11426 = cd->klass;
  if (D.11426 != klass) goto <D.8417>; else goto <D.8419>;
  <D.8419>:
  if (cd == 0B) goto <D.11427>; else goto <D.11428>;
  <D.11427>:
  {
    char buf[128];

    try
      {
        klass.136 = (void *) klass;
        snprintf (&buf, 128, "unresolved class %p", klass.136);
        D.11430 = add_class (klass, &buf);
        return D.11430;
      }
    finally
      {
        buf = {CLOBBER};
      }
  }
  <D.11428>:
  D.11430 = cd;
  return D.11430;
}


snprintf (char * restrict __s, size_t __n, const char * restrict __fmt)
{
  int D.11435;
  long unsigned int D.11436;

  D.11436 = __builtin_object_size (__s, 1);
  D.11435 = __builtin___snprintf_chk (__s, __n, 1, D.11436, __fmt, __builtin_va_arg_pack ());
  return D.11435;
}


add_heap_shot_class (struct HeapShot * hs, struct ClassDesc * klass, uint64_t size)
{
  int D.11438;
  int D.11439;
  int D.11440;
  int D.11443;
  long unsigned int D.11446;
  long unsigned int D.11447;
  struct HeapClassDesc * * D.11448;
  long unsigned int D.11449;
  long unsigned int D.11450;
  struct HeapClassDesc * * D.11451;
  struct HeapClassDesc * res.137;
  long int D.11455;
  long unsigned int D.11456;
  long int D.11457;
  long unsigned int D.11458;
  struct ClassDesc * D.11459;
  long unsigned int D.11460;
  int D.11463;
  int D.11464;
  struct HeapClassDesc * D.11465;
  struct HeapClassDesc * res;
  int i;

  try
    {
      D.11438 = hs->class_count;
      D.11439 = D.11438 * 2;
      D.11440 = hs->hash_size;
      if (D.11439 >= D.11440) goto <D.11441>; else goto <D.11442>;
      <D.11441>:
      {
        struct HeapClassDesc * * n;
        int old_size;

        old_size = hs->hash_size;
        D.11440 = hs->hash_size;
        D.11443 = D.11440 * 2;
        hs->hash_size = D.11443;
        D.11440 = hs->hash_size;
        if (D.11440 == 0) goto <D.11444>; else goto <D.11445>;
        <D.11444>:
        hs->hash_size = 4;
        <D.11445>:
        D.11440 = hs->hash_size;
        D.11446 = (long unsigned int) D.11440;
        D.11447 = D.11446 * 8;
        n = calloc (D.11447, 1);
        i = 0;
        goto <D.8687>;
        <D.8686>:
        D.11448 = hs->class_hash;
        D.11449 = (long unsigned int) i;
        D.11450 = D.11449 * 8;
        D.11451 = D.11448 + D.11450;
        res.137 = *D.11451;
        res = res.137;
        D.11448 = hs->class_hash;
        D.11449 = (long unsigned int) i;
        D.11450 = D.11449 * 8;
        D.11451 = D.11448 + D.11450;
        res.137 = *D.11451;
        if (res.137 != 0B) goto <D.11453>; else goto <D.11454>;
        <D.11453>:
        D.11448 = hs->class_hash;
        D.11449 = (long unsigned int) i;
        D.11450 = D.11449 * 8;
        D.11451 = D.11448 + D.11450;
        res.137 = *D.11451;
        D.11455 = res.137->count;
        D.11456 = (long unsigned int) D.11455;
        D.11448 = hs->class_hash;
        D.11449 = (long unsigned int) i;
        D.11450 = D.11449 * 8;
        D.11451 = D.11448 + D.11450;
        res.137 = *D.11451;
        D.11457 = res.137->total_size;
        D.11458 = (long unsigned int) D.11457;
        D.11448 = hs->class_hash;
        D.11449 = (long unsigned int) i;
        D.11450 = D.11449 * 8;
        D.11451 = D.11448 + D.11450;
        res.137 = *D.11451;
        D.11459 = res.137->klass;
        D.11440 = hs->hash_size;
        D.11460 = (long unsigned int) D.11440;
        add_heap_hashed (n, &res, D.11460, D.11459, D.11458, D.11456);
        <D.11454>:
        i = i + 1;
        <D.8687>:
        if (i < old_size) goto <D.8686>; else goto <D.8688>;
        <D.8688>:
        D.11448 = hs->class_hash;
        if (D.11448 != 0B) goto <D.11461>; else goto <D.11462>;
        <D.11461>:
        D.11448 = hs->class_hash;
        free (D.11448);
        <D.11462>:
        hs->class_hash = n;
      }
      <D.11442>:
      res = 0B;
      D.11440 = hs->hash_size;
      D.11460 = (long unsigned int) D.11440;
      D.11448 = hs->class_hash;
      D.11463 = add_heap_hashed (D.11448, &res, D.11460, klass, size, 1);
      D.11438 = hs->class_count;
      D.11464 = D.11438 + D.11463;
      hs->class_count = D.11464;
      D.11465 = res;
      return D.11465;
    }
  finally
    {
      res = {CLOBBER};
    }
}


add_heap_hashed (struct HeapClassDesc * * hash, struct HeapClassDesc * * retv, uintptr_t hsize, struct ClassDesc * klass, uint64_t size, uint64_t count)
{
  long int D.11470;
  long unsigned int D.11471;
  long unsigned int D.11472;
  long unsigned int D.11474;
  struct HeapClassDesc * * D.11475;
  struct HeapClassDesc * D.11476;
  struct ClassDesc * D.11478;
  long int D.11480;
  long unsigned int D.11481;
  long unsigned int D.11482;
  long int D.11483;
  long int D.11484;
  long unsigned int D.11485;
  long unsigned int D.11486;
  long int D.11487;
  int D.11488;
  struct HeapClassDesc * D.11491;
  void * D.11494;
  uintptr_t i;
  uintptr_t start_pos;

  D.11470 = klass->klass;
  D.11471 = (long unsigned int) D.11470;
  D.11472 = D.11471 >> 2;
  start_pos = D.11472 % hsize;
  i = start_pos;
  <D.8675>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  if (D.11476 != 0B) goto <D.11477>; else goto <D.11473>;
  <D.11477>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11478 = D.11476->klass;
  if (D.11478 == klass) goto <D.11479>; else goto <D.11473>;
  <D.11479>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11480 = D.11476->total_size;
  D.11481 = (long unsigned int) D.11480;
  D.11482 = D.11481 + size;
  D.11483 = (long int) D.11482;
  D.11476->total_size = D.11483;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11484 = D.11476->count;
  D.11485 = (long unsigned int) D.11484;
  D.11486 = D.11485 + count;
  D.11487 = (long int) D.11486;
  D.11476->count = D.11487;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  *retv = D.11476;
  D.11488 = 0;
  return D.11488;
  <D.11473>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  if (D.11476 == 0B) goto <D.11489>; else goto <D.11490>;
  <D.11489>:
  D.11491 = *retv;
  if (D.11491 != 0B) goto <D.11492>; else goto <D.11493>;
  <D.11492>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11491 = *retv;
  *D.11475 = D.11491;
  D.11488 = 1;
  return D.11488;
  <D.11493>:
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11494 = calloc (56, 1);
  *D.11475 = D.11494;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11476->klass = klass;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11480 = D.11476->total_size;
  D.11481 = (long unsigned int) D.11480;
  D.11482 = D.11481 + size;
  D.11483 = (long int) D.11482;
  D.11476->total_size = D.11483;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  D.11484 = D.11476->count;
  D.11485 = (long unsigned int) D.11484;
  D.11486 = D.11485 + count;
  D.11487 = (long int) D.11486;
  D.11476->count = D.11487;
  D.11474 = i * 8;
  D.11475 = hash + D.11474;
  D.11476 = *D.11475;
  *retv = D.11476;
  D.11488 = 1;
  return D.11488;
  <D.11490>:
  i = i + 1;
  if (i == hsize) goto <D.11495>; else goto <D.11496>;
  <D.11495>:
  i = 0;
  <D.11496>:
  if (i != start_pos) goto <D.8675>; else goto <D.8676>;
  <D.8676>:
  printf ("failed heap class store\n");
  D.11488 = 0;
  return D.11488;
}


alloc_heap_obj (uintptr_t objaddr, struct HeapClassDesc * hklass, uintptr_t num_refs)
{
  long unsigned int D.11498;
  long unsigned int D.11499;
  struct HeapObjectDesc * D.11500;
  struct HeapObjectDesc * ho;

  D.11498 = num_refs + 3;
  D.11499 = D.11498 * 8;
  ho = calloc (D.11499, 1);
  ho->objaddr = objaddr;
  ho->hklass = hklass;
  ho->num_refs = num_refs;
  D.11500 = ho;
  return D.11500;
}


add_heap_shot_obj (struct HeapShot * hs, struct HeapObjectDesc * obj)
{
  long unsigned int D.11502;
  long unsigned int D.11503;
  long unsigned int D.11504;
  long unsigned int D.11507;
  long unsigned int D.11510;
  struct HeapObjectDesc * * D.11511;
  long unsigned int D.11512;
  struct HeapObjectDesc * * D.11513;
  struct HeapObjectDesc * D.11514;
  long unsigned int D.11519;
  long unsigned int D.11520;
  uintptr_t i;

  D.11502 = hs->objects_count;
  D.11503 = D.11502 * 2;
  D.11504 = hs->objects_hash_size;
  if (D.11503 >= D.11504) goto <D.11505>; else goto <D.11506>;
  <D.11505>:
  {
    struct HeapObjectDesc * * n;
    uintptr_t old_size;

    old_size = hs->objects_hash_size;
    D.11504 = hs->objects_hash_size;
    D.11507 = D.11504 * 2;
    hs->objects_hash_size = D.11507;
    D.11504 = hs->objects_hash_size;
    if (D.11504 == 0) goto <D.11508>; else goto <D.11509>;
    <D.11508>:
    hs->objects_hash_size = 4;
    <D.11509>:
    D.11504 = hs->objects_hash_size;
    D.11510 = D.11504 * 8;
    n = calloc (D.11510, 1);
    i = 0;
    goto <D.8730>;
    <D.8729>:
    D.11511 = hs->objects_hash;
    D.11512 = i * 8;
    D.11513 = D.11511 + D.11512;
    D.11514 = *D.11513;
    if (D.11514 != 0B) goto <D.11515>; else goto <D.11516>;
    <D.11515>:
    D.11511 = hs->objects_hash;
    D.11512 = i * 8;
    D.11513 = D.11511 + D.11512;
    D.11514 = *D.11513;
    D.11504 = hs->objects_hash_size;
    add_heap_hashed_obj (n, D.11504, D.11514);
    <D.11516>:
    i = i + 1;
    <D.8730>:
    if (i < old_size) goto <D.8729>; else goto <D.8731>;
    <D.8731>:
    D.11511 = hs->objects_hash;
    if (D.11511 != 0B) goto <D.11517>; else goto <D.11518>;
    <D.11517>:
    D.11511 = hs->objects_hash;
    free (D.11511);
    <D.11518>:
    hs->objects_hash = n;
  }
  <D.11506>:
  D.11504 = hs->objects_hash_size;
  D.11511 = hs->objects_hash;
  D.11519 = add_heap_hashed_obj (D.11511, D.11504, obj);
  D.11502 = hs->objects_count;
  D.11520 = D.11502 + D.11519;
  hs->objects_count = D.11520;
}


add_heap_hashed_obj (struct HeapObjectDesc * * hash, uintptr_t hsize, struct HeapObjectDesc * obj)
{
  long unsigned int D.11522;
  long unsigned int D.11523;
  long unsigned int D.11525;
  struct HeapObjectDesc * * D.11526;
  struct HeapObjectDesc * D.11527;
  long unsigned int D.11529;
  uintptr_t D.11531;
  uintptr_t i;
  uintptr_t start_pos;

  D.11522 = obj->objaddr;
  D.11523 = D.11522 >> 3;
  start_pos = D.11523 % hsize;
  i = start_pos;
  <D.8720>:
  D.11525 = i * 8;
  D.11526 = hash + D.11525;
  D.11527 = *D.11526;
  if (D.11527 != 0B) goto <D.11528>; else goto <D.11524>;
  <D.11528>:
  D.11525 = i * 8;
  D.11526 = hash + D.11525;
  D.11527 = *D.11526;
  D.11529 = D.11527->objaddr;
  D.11522 = obj->objaddr;
  if (D.11529 == D.11522) goto <D.11530>; else goto <D.11524>;
  <D.11530>:
  printf ("duplicate object!\n");
  D.11531 = 0;
  return D.11531;
  <D.11524>:
  D.11525 = i * 8;
  D.11526 = hash + D.11525;
  D.11527 = *D.11526;
  if (D.11527 == 0B) goto <D.11532>; else goto <D.11533>;
  <D.11532>:
  D.11525 = i * 8;
  D.11526 = hash + D.11525;
  *D.11526 = obj;
  D.11531 = 1;
  return D.11531;
  <D.11533>:
  i = i + 1;
  if (i == hsize) goto <D.11534>; else goto <D.11535>;
  <D.11534>:
  i = 0;
  <D.11535>:
  if (i != start_pos) goto <D.8720>; else goto <D.8721>;
  <D.8721>:
  printf ("failed heap obj store\n");
  D.11531 = 0;
  return D.11531;
}


heap_shot_obj_add_refs (struct HeapShot * hs, uintptr_t objaddr, uintptr_t num, uintptr_t * ref_offset)
{
  long unsigned int D.11539;
  struct HeapObjectDesc * * D.11540;
  struct HeapObjectDesc * D.11541;
  long unsigned int D.11542;
  long unsigned int D.11543;
  struct HeapClassDesc * D.11544;
  long unsigned int D.11545;
  uintptr_t[0:] * D.11546;
  uintptr_t[0:] * D.11547;
  struct HeapObjectDesc * D.11548;
  struct HeapObjectDesc * * hash;
  uintptr_t i;

  hash = hs->objects_hash;
  i = heap_shot_find_obj_slot (hs, objaddr);
  if (1 != 0) goto <D.11537>; else goto <D.11538>;
  <D.11537>:
  {
    struct HeapObjectDesc * ho;

    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    D.11542 = D.11541->num_refs;
    D.11543 = D.11542 + num;
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    D.11544 = D.11541->hklass;
    ho = alloc_heap_obj (objaddr, D.11544, D.11543);
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    D.11542 = D.11541->num_refs;
    *ref_offset = D.11542;
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    D.11542 = D.11541->num_refs;
    D.11545 = D.11542 * 8;
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    D.11546 = &D.11541->refs;
    D.11547 = &ho->refs;
    memcpy (D.11547, D.11546, D.11545);
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    D.11541 = *D.11540;
    free (D.11541);
    D.11539 = i * 8;
    D.11540 = hash + D.11539;
    *D.11540 = ho;
    D.11548 = ho;
    return D.11548;
  }
  <D.11538>:
  printf ("failed heap obj update\n");
  D.11548 = 0B;
  return D.11548;
}


heap_shot_find_obj_slot (struct HeapShot * hs, uintptr_t objaddr)
{
  long unsigned int D.11552;
  long unsigned int D.11553;
  long unsigned int D.11555;
  struct HeapObjectDesc * * D.11556;
  struct HeapObjectDesc * D.11557;
  long unsigned int D.11559;
  uintptr_t D.11561;
  uintptr_t i;
  uintptr_t start_pos;
  struct HeapObjectDesc * * hash;

  hash = hs->objects_hash;
  D.11552 = objaddr >> 3;
  D.11553 = hs->objects_hash_size;
  start_pos = D.11552 % D.11553;
  i = start_pos;
  <D.8703>:
  D.11555 = i * 8;
  D.11556 = hash + D.11555;
  D.11557 = *D.11556;
  if (D.11557 != 0B) goto <D.11558>; else goto <D.11554>;
  <D.11558>:
  D.11555 = i * 8;
  D.11556 = hash + D.11555;
  D.11557 = *D.11556;
  D.11559 = D.11557->objaddr;
  if (D.11559 == objaddr) goto <D.11560>; else goto <D.11554>;
  <D.11560>:
  D.11561 = i;
  return D.11561;
  <D.11554>:
  D.11555 = i * 8;
  D.11556 = hash + D.11555;
  D.11557 = *D.11556;
  if (D.11557 == 0B) goto <D.8702>; else goto <D.11562>;
  <D.11562>:
  i = i + 1;
  D.11553 = hs->objects_hash_size;
  if (i == D.11553) goto <D.11563>; else goto <D.11564>;
  <D.11563>:
  i = 0;
  <D.11564>:
  if (i != start_pos) goto <D.8703>; else goto <D.8702>;
  <D.8702>:
  D.11561 = 18446744073709551615;
  return D.11561;
}


track_obj_reference (uintptr_t obj, uintptr_t parent, struct ClassDesc * cd)
{
  uintptr_t * tracked_objects.138;
  long unsigned int D.11567;
  long unsigned int D.11568;
  uintptr_t * D.11569;
  long unsigned int D.11570;
  char * D.11573;
  void * parent.139;
  void * obj.140;
  struct FILE * outfile.141;
  int num_tracked_objects.142;
  int i;

  i = 0;
  goto <D.9099>;
  <D.9098>:
  tracked_objects.138 = tracked_objects;
  D.11567 = (long unsigned int) i;
  D.11568 = D.11567 * 8;
  D.11569 = tracked_objects.138 + D.11568;
  D.11570 = *D.11569;
  if (D.11570 == obj) goto <D.11571>; else goto <D.11572>;
  <D.11571>:
  D.11573 = cd->name;
  parent.139 = (void *) parent;
  obj.140 = (void *) obj;
  outfile.141 = outfile;
  fprintf (outfile.141, "Object %p referenced from %p (%s).\n", obj.140, parent.139, D.11573);
  <D.11572>:
  i = i + 1;
  <D.9099>:
  num_tracked_objects.142 = num_tracked_objects;
  if (i < num_tracked_objects.142) goto <D.9098>; else goto <D.9100>;
  <D.9100>:
}


get_root_name (int rtype)
{
  int D.11578;
  const char * D.11579;

  D.11578 = rtype & 255;
  switch (D.11578) <default: <D.9043>, case 0: <D.9038>, case 1: <D.9039>, case 2: <D.9040>, case 3: <D.9041>, case 4: <D.9042>>
  <D.9038>:
  D.11579 = "stack";
  return D.11579;
  <D.9039>:
  D.11579 = "finalizer";
  return D.11579;
  <D.9040>:
  D.11579 = "handle";
  return D.11579;
  <D.9041>:
  D.11579 = "other";
  return D.11579;
  <D.9042>:
  D.11579 = "misc";
  return D.11579;
  <D.9043>:
  D.11579 = "unknown";
  return D.11579;
}


thread_add_root (struct ThreadContext * ctx, uintptr_t obj, int root_type, uintptr_t extra_info)
{
  long unsigned int D.11581;
  long unsigned int D.11582;
  unsigned int D.11585;
  unsigned int D.11586;
  long unsigned int D.11589;
  long unsigned int D.11590;
  uintptr_t * D.11591;
  void * D.11592;
  uintptr_t * D.11593;
  void * D.11594;
  long unsigned int D.11595;
  int * D.11596;
  void * D.11597;
  long unsigned int D.11598;
  long unsigned int D.11599;
  int * D.11600;
  long unsigned int D.11601;
  uintptr_t * D.11602;
  long unsigned int D.11603;
  long unsigned int D.11604;
  long unsigned int D.11605;
  uintptr_t * D.11606;

  D.11581 = ctx->num_roots;
  D.11582 = ctx->size_roots;
  if (D.11581 == D.11582) goto <D.11583>; else goto <D.11584>;
  <D.11583>:
  {
    int new_size;

    D.11582 = ctx->size_roots;
    D.11585 = (unsigned int) D.11582;
    D.11586 = D.11585 * 2;
    new_size = (int) D.11586;
    if (new_size == 0) goto <D.11587>; else goto <D.11588>;
    <D.11587>:
    new_size = 4;
    <D.11588>:
    D.11589 = (long unsigned int) new_size;
    D.11590 = D.11589 * 8;
    D.11591 = ctx->roots;
    D.11592 = realloc (D.11591, D.11590);
    ctx->roots = D.11592;
    D.11589 = (long unsigned int) new_size;
    D.11590 = D.11589 * 8;
    D.11593 = ctx->roots_extra;
    D.11594 = realloc (D.11593, D.11590);
    ctx->roots_extra = D.11594;
    D.11589 = (long unsigned int) new_size;
    D.11595 = D.11589 * 4;
    D.11596 = ctx->roots_types;
    D.11597 = realloc (D.11596, D.11595);
    ctx->roots_types = D.11597;
    D.11598 = (long unsigned int) new_size;
    ctx->size_roots = D.11598;
  }
  <D.11584>:
  D.11596 = ctx->roots_types;
  D.11581 = ctx->num_roots;
  D.11599 = D.11581 * 4;
  D.11600 = D.11596 + D.11599;
  *D.11600 = root_type;
  D.11593 = ctx->roots_extra;
  D.11581 = ctx->num_roots;
  D.11601 = D.11581 * 8;
  D.11602 = D.11593 + D.11601;
  *D.11602 = extra_info;
  D.11591 = ctx->roots;
  D.11581 = ctx->num_roots;
  D.11603 = D.11581;
  D.11604 = D.11603 + 1;
  ctx->num_roots = D.11604;
  D.11605 = D.11603 * 8;
  D.11606 = D.11591 + D.11605;
  *D.11606 = obj;
}


heap_shot_resolve_reverse_refs (struct HeapShot * hs)
{
  struct HeapObjectDesc * * D.11607;
  long unsigned int D.11608;
  struct HeapObjectDesc * * D.11609;
  long unsigned int D.11612;
  long unsigned int D.11613;
  struct HeapObjectDesc * * D.11614;
  struct HeapObjectDesc * D.11615;
  struct HeapClassDesc * D.11616;
  struct HeapClassDesc * D.11617;
  long unsigned int D.11618;
  long unsigned int D.11619;
  uintptr_t i;

  i = 0;
  goto <D.8744>;
  <D.8743>:
  {
    uintptr_t r;
    struct HeapObjectDesc * ho;

    D.11607 = hs->objects_hash;
    D.11608 = i * 8;
    D.11609 = D.11607 + D.11608;
    ho = *D.11609;
    if (ho == 0B) goto <D.11610>; else goto <D.11611>;
    <D.11610>:
    // predicted unlikely by continue predictor.
    goto <D.8738>;
    <D.11611>:
    r = 0;
    goto <D.8741>;
    <D.8740>:
    {
      uintptr_t oi;

      D.11612 = ho->refs[r];
      oi = heap_shot_find_obj_slot (hs, D.11612);
      D.11607 = hs->objects_hash;
      D.11613 = oi * 8;
      D.11614 = D.11607 + D.11613;
      D.11615 = *D.11614;
      D.11616 = D.11615->hklass;
      D.11617 = ho->hklass;
      add_heap_class_rev (D.11617, D.11616);
    }
    r = r + 1;
    <D.8741>:
    D.11618 = ho->num_refs;
    if (D.11618 > r) goto <D.8740>; else goto <D.8742>;
    <D.8742>:
  }
  <D.8738>:
  i = i + 1;
  <D.8744>:
  D.11619 = hs->objects_hash_size;
  if (D.11619 > i) goto <D.8743>; else goto <D.8745>;
  <D.8745>:
}


add_heap_class_rev (struct HeapClassDesc * from, struct HeapClassDesc * to)
{
  int D.11621;
  int D.11622;
  int D.11623;
  int D.11626;
  long unsigned int D.11629;
  long unsigned int D.11630;
  struct HeapClassRevRef * D.11631;
  long unsigned int D.11632;
  struct HeapClassRevRef * D.11633;
  struct HeapClassDesc * D.11634;
  long unsigned int D.11637;
  long unsigned int D.11638;
  int D.11641;
  int D.11642;
  uintptr_t i;

  D.11621 = to->rev_count;
  D.11622 = D.11621 * 2;
  D.11623 = to->rev_hash_size;
  if (D.11622 >= D.11623) goto <D.11624>; else goto <D.11625>;
  <D.11624>:
  {
    struct HeapClassRevRef * n;
    uintptr_t old_size;

    D.11623 = to->rev_hash_size;
    old_size = (uintptr_t) D.11623;
    D.11623 = to->rev_hash_size;
    D.11626 = D.11623 * 2;
    to->rev_hash_size = D.11626;
    D.11623 = to->rev_hash_size;
    if (D.11623 == 0) goto <D.11627>; else goto <D.11628>;
    <D.11627>:
    to->rev_hash_size = 4;
    <D.11628>:
    D.11623 = to->rev_hash_size;
    D.11629 = (long unsigned int) D.11623;
    D.11630 = D.11629 * 16;
    n = calloc (D.11630, 1);
    i = 0;
    goto <D.8627>;
    <D.8626>:
    D.11631 = to->rev_hash;
    D.11632 = i * 16;
    D.11633 = D.11631 + D.11632;
    D.11634 = D.11633->klass;
    if (D.11634 != 0B) goto <D.11635>; else goto <D.11636>;
    <D.11635>:
    D.11631 = to->rev_hash;
    D.11632 = i * 16;
    D.11633 = D.11631 + D.11632;
    D.11637 = D.11633->count;
    D.11631 = to->rev_hash;
    D.11632 = i * 16;
    D.11633 = D.11631 + D.11632;
    D.11634 = D.11633->klass;
    D.11623 = to->rev_hash_size;
    D.11638 = (long unsigned int) D.11623;
    add_rev_class_hashed (n, D.11638, D.11634, D.11637);
    <D.11636>:
    i = i + 1;
    <D.8627>:
    if (i < old_size) goto <D.8626>; else goto <D.8628>;
    <D.8628>:
    D.11631 = to->rev_hash;
    if (D.11631 != 0B) goto <D.11639>; else goto <D.11640>;
    <D.11639>:
    D.11631 = to->rev_hash;
    free (D.11631);
    <D.11640>:
    to->rev_hash = n;
  }
  <D.11625>:
  D.11623 = to->rev_hash_size;
  D.11638 = (long unsigned int) D.11623;
  D.11631 = to->rev_hash;
  D.11641 = add_rev_class_hashed (D.11631, D.11638, from, 1);
  D.11621 = to->rev_count;
  D.11642 = D.11621 + D.11641;
  to->rev_count = D.11642;
}


add_rev_class_hashed (struct HeapClassRevRef * rev_hash, uintptr_t size, struct HeapClassDesc * hklass, uint64_t value)
{
  struct ClassDesc * D.11644;
  long int D.11645;
  long int D.11646;
  long unsigned int D.11647;
  long unsigned int D.11650;
  struct HeapClassRevRef * D.11651;
  struct HeapClassDesc * D.11652;
  long unsigned int D.11655;
  long unsigned int D.11656;
  int D.11657;
  struct ClassDesc * D.11662;
  uintptr_t i;
  uintptr_t start_pos;
  static const char __PRETTY_FUNCTION__[21] = "add_rev_class_hashed";

  D.11644 = hklass->klass;
  D.11645 = D.11644->klass;
  D.11646 = D.11645 >> 2;
  D.11647 = (long unsigned int) D.11646;
  start_pos = D.11647 % size;
  if (start_pos >= size) goto <D.11648>; else goto <D.11649>;
  <D.11648>:
  __assert_fail ("start_pos < size", "decode.c", 573, &__PRETTY_FUNCTION__);
  <D.11649>:
  i = start_pos;
  <D.8617>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11652 = D.11651->klass;
  if (D.11652 == hklass) goto <D.11653>; else goto <D.11654>;
  <D.11653>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11655 = D.11651->count;
  D.11656 = D.11655 + value;
  D.11651->count = D.11656;
  D.11657 = 0;
  return D.11657;
  <D.11654>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11652 = D.11651->klass;
  if (D.11652 == 0B) goto <D.11658>; else goto <D.11659>;
  <D.11658>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11651->klass = hklass;
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11655 = D.11651->count;
  D.11656 = D.11655 + value;
  D.11651->count = D.11656;
  start_pos = 0;
  i = 0;
  goto <D.8615>;
  <D.8614>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11652 = D.11651->klass;
  if (D.11652 != 0B) goto <D.11660>; else goto <D.11661>;
  <D.11660>:
  D.11650 = i * 16;
  D.11651 = rev_hash + D.11650;
  D.11652 = D.11651->klass;
  D.11662 = D.11652->klass;
  D.11644 = hklass->klass;
  if (D.11662 == D.11644) goto <D.11663>; else goto <D.11664>;
  <D.11663>:
  start_pos = start_pos + 1;
  <D.11664>:
  <D.11661>:
  i = i + 1;
  <D.8615>:
  if (i < size) goto <D.8614>; else goto <D.8616>;
  <D.8616>:
  if (start_pos != 1) goto <D.11665>; else goto <D.11666>;
  <D.11665>:
  __assert_fail ("start_pos == 1", "decode.c", 586, &__PRETTY_FUNCTION__);
  <D.11666>:
  D.11657 = 1;
  return D.11657;
  <D.11659>:
  i = i + 1;
  if (i == size) goto <D.11667>; else goto <D.11668>;
  <D.11667>:
  i = 0;
  <D.11668>:
  if (i != start_pos) goto <D.8617>; else goto <D.8618>;
  <D.8618>:
  printf ("failed revref store\n");
  D.11657 = 0;
  return D.11657;
}


heap_shot_mark_objects (struct HeapShot * hs)
{
  uintptr_t * D.11670;
  long unsigned int D.11671;
  uintptr_t * D.11672;
  long unsigned int D.11673;
  struct HeapObjectDesc * * D.11676;
  long unsigned int D.11677;
  struct HeapObjectDesc * * D.11678;
  int * D.11679;
  long unsigned int D.11680;
  int * D.11681;
  int D.11682;
  int D.11683;
  long unsigned int D.11686;
  long unsigned int D.11687;
  long unsigned int D.11688;
  long unsigned int D.11689;
  long unsigned int D.11690;
  int debug.143;
  long unsigned int D.11694;
  uintptr_t * D.11699;
  uintptr_t * D.11700;
  long unsigned int D.11701;
  long int D.11702;
  struct ClassDesc * D.11703;
  char * D.11704;
  void * D.11705;
  struct FILE * outfile.144;
  unsigned char * D.11707;
  unsigned char D.11708;
  unsigned char iftmp.145;
  long unsigned int D.11712;
  unsigned char * D.11716;
  unsigned char D.11717;
  struct HeapObjectDesc * * D.11720;
  long unsigned int D.11721;
  void * D.11724;
  unsigned char iftmp.146;
  long unsigned int D.11728;
  struct HeapObjectDesc * D.11732;
  struct HeapClassDesc * D.11737;
  struct ClassDesc * D.11738;
  char * D.11739;
  long unsigned int D.11740;
  uintptr_t i;
  uintptr_t oi;
  uintptr_t r;
  unsigned char * marks;
  struct HeapObjectDesc * obj;
  struct HeapObjectDesc * ref;
  int marked_some;
  uintptr_t num_marked;
  uintptr_t num_unmarked;

  num_marked = 0;
  i = 0;
  goto <D.8761>;
  <D.8760>:
  {
    struct HeapClassDesc * cd;

    D.11670 = hs->roots;
    D.11671 = i * 8;
    D.11672 = D.11670 + D.11671;
    D.11673 = *D.11672;
    oi = heap_shot_find_obj_slot (hs, D.11673);
    if (oi == 18446744073709551615) goto <D.11674>; else goto <D.11675>;
    <D.11674>:
    // predicted unlikely by continue predictor.
    goto <D.8759>;
    <D.11675>:
    D.11676 = hs->objects_hash;
    D.11677 = oi * 8;
    D.11678 = D.11676 + D.11677;
    obj = *D.11678;
    cd = obj->hklass;
    D.11679 = hs->roots_types;
    D.11680 = i * 4;
    D.11681 = D.11679 + D.11680;
    D.11682 = *D.11681;
    D.11683 = D.11682 & 256;
    if (D.11683 != 0) goto <D.11684>; else goto <D.11685>;
    <D.11684>:
    D.11686 = cd->pinned_references;
    D.11687 = D.11686 + 1;
    cd->pinned_references = D.11687;
    <D.11685>:
    D.11688 = cd->root_references;
    D.11689 = D.11688 + 1;
    cd->root_references = D.11689;
  }
  <D.8759>:
  i = i + 1;
  <D.8761>:
  D.11690 = hs->num_roots;
  if (D.11690 > i) goto <D.8760>; else goto <D.8762>;
  <D.8762>:
  debug.143 = debug;
  if (debug.143 == 0) goto <D.11692>; else goto <D.11693>;
  <D.11692>:
  return;
  <D.11693>:
  D.11694 = hs->objects_hash_size;
  marks = calloc (D.11694, 1);
  if (marks == 0B) goto <D.11695>; else goto <D.11696>;
  <D.11695>:
  return;
  <D.11696>:
  i = 0;
  goto <D.8765>;
  <D.8764>:
  D.11670 = hs->roots;
  D.11671 = i * 8;
  D.11672 = D.11670 + D.11671;
  D.11673 = *D.11672;
  oi = heap_shot_find_obj_slot (hs, D.11673);
  if (oi == 18446744073709551615) goto <D.11697>; else goto <D.11698>;
  <D.11697>:
  D.11699 = hs->roots_extra;
  D.11671 = i * 8;
  D.11700 = D.11699 + D.11671;
  D.11701 = *D.11700;
  D.11702 = (long int) D.11701;
  D.11703 = lookup_class (D.11702);
  D.11704 = D.11703->name;
  D.11670 = hs->roots;
  D.11671 = i * 8;
  D.11672 = D.11670 + D.11671;
  D.11673 = *D.11672;
  D.11705 = (void *) D.11673;
  D.11679 = hs->roots_types;
  D.11680 = i * 4;
  D.11681 = D.11679 + D.11680;
  D.11682 = *D.11681;
  outfile.144 = outfile;
  fprintf (outfile.144, "root type 0x%x for obj %p (%s) not found in heap\n", D.11682, D.11705, D.11704);
  // predicted unlikely by continue predictor.
  goto <D.8763>;
  <D.11698>:
  D.11676 = hs->objects_hash;
  D.11677 = oi * 8;
  D.11678 = D.11676 + D.11677;
  obj = *D.11678;
  D.11707 = marks + oi;
  D.11708 = *D.11707;
  if (D.11708 == 0) goto <D.11709>; else goto <D.11710>;
  <D.11709>:
  D.11707 = marks + oi;
  D.11712 = obj->num_refs;
  if (D.11712 != 0) goto <D.11713>; else goto <D.11714>;
  <D.11713>:
  iftmp.145 = 1;
  goto <D.11715>;
  <D.11714>:
  iftmp.145 = 2;
  <D.11715>:
  *D.11707 = iftmp.145;
  num_marked = num_marked + 1;
  <D.11710>:
  <D.8763>:
  i = i + 1;
  <D.8765>:
  D.11690 = hs->num_roots;
  if (D.11690 > i) goto <D.8764>; else goto <D.8766>;
  <D.8766>:
  marked_some = 1;
  goto <D.8776>;
  <D.8775>:
  marked_some = 0;
  i = 0;
  goto <D.8773>;
  <D.8772>:
  D.11716 = marks + i;
  D.11717 = *D.11716;
  if (D.11717 != 1) goto <D.11718>; else goto <D.11719>;
  <D.11718>:
  // predicted unlikely by continue predictor.
  goto <D.8767>;
  <D.11719>:
  D.11716 = marks + i;
  *D.11716 = 2;
  D.11676 = hs->objects_hash;
  D.11671 = i * 8;
  D.11720 = D.11676 + D.11671;
  obj = *D.11720;
  r = 0;
  goto <D.8770>;
  <D.8769>:
  D.11721 = obj->refs[r];
  oi = heap_shot_find_obj_slot (hs, D.11721);
  if (oi == 18446744073709551615) goto <D.11722>; else goto <D.11723>;
  <D.11722>:
  D.11721 = obj->refs[r];
  D.11724 = (void *) D.11721;
  outfile.144 = outfile;
  fprintf (outfile.144, "referenced obj %p not found in heap\n", D.11724);
  // predicted unlikely by continue predictor.
  goto <D.8768>;
  <D.11723>:
  D.11676 = hs->objects_hash;
  D.11677 = oi * 8;
  D.11678 = D.11676 + D.11677;
  ref = *D.11678;
  D.11707 = marks + oi;
  D.11708 = *D.11707;
  if (D.11708 == 0) goto <D.11725>; else goto <D.11726>;
  <D.11725>:
  D.11707 = marks + oi;
  D.11728 = ref->num_refs;
  if (D.11728 != 0) goto <D.11729>; else goto <D.11730>;
  <D.11729>:
  iftmp.146 = 1;
  goto <D.11731>;
  <D.11730>:
  iftmp.146 = 2;
  <D.11731>:
  *D.11707 = iftmp.146;
  <D.11726>:
  <D.8768>:
  r = r + 1;
  <D.8770>:
  D.11712 = obj->num_refs;
  if (D.11712 > r) goto <D.8769>; else goto <D.8771>;
  <D.8771>:
  marked_some = marked_some + 1;
  <D.8767>:
  i = i + 1;
  <D.8773>:
  D.11694 = hs->objects_hash_size;
  if (D.11694 > i) goto <D.8772>; else goto <D.8774>;
  <D.8774>:
  <D.8776>:
  if (marked_some != 0) goto <D.8775>; else goto <D.8777>;
  <D.8777>:
  num_unmarked = 0;
  i = 0;
  goto <D.8779>;
  <D.8778>:
  D.11676 = hs->objects_hash;
  D.11671 = i * 8;
  D.11720 = D.11676 + D.11671;
  D.11732 = *D.11720;
  if (D.11732 != 0B) goto <D.11733>; else goto <D.11734>;
  <D.11733>:
  D.11716 = marks + i;
  D.11717 = *D.11716;
  if (D.11717 == 0) goto <D.11735>; else goto <D.11736>;
  <D.11735>:
  num_unmarked = num_unmarked + 1;
  D.11676 = hs->objects_hash;
  D.11671 = i * 8;
  D.11720 = D.11676 + D.11671;
  D.11732 = *D.11720;
  D.11737 = D.11732->hklass;
  D.11738 = D.11737->klass;
  D.11739 = D.11738->name;
  D.11676 = hs->objects_hash;
  D.11671 = i * 8;
  D.11720 = D.11676 + D.11671;
  D.11732 = *D.11720;
  outfile.144 = outfile;
  fprintf (outfile.144, "object %p (%s) unmarked\n", D.11732, D.11739);
  <D.11736>:
  <D.11734>:
  i = i + 1;
  <D.8779>:
  D.11694 = hs->objects_hash_size;
  if (D.11694 > i) goto <D.8778>; else goto <D.8780>;
  <D.8780>:
  D.11740 = hs->objects_count;
  outfile.144 = outfile;
  fprintf (outfile.144, "Total unmarked: %d/%d\n", num_unmarked, D.11740);
  free (marks);
}


heap_shot_free_objects (struct HeapShot * hs)
{
  struct HeapObjectDesc * * D.11746;
  long unsigned int D.11747;
  struct HeapObjectDesc * * D.11748;
  long unsigned int D.11751;
  uintptr_t i;

  i = 0;
  goto <D.8787>;
  <D.8786>:
  {
    struct HeapObjectDesc * ho;

    D.11746 = hs->objects_hash;
    D.11747 = i * 8;
    D.11748 = D.11746 + D.11747;
    ho = *D.11748;
    if (ho != 0B) goto <D.11749>; else goto <D.11750>;
    <D.11749>:
    free (ho);
    <D.11750>:
  }
  i = i + 1;
  <D.8787>:
  D.11751 = hs->objects_hash_size;
  if (D.11751 > i) goto <D.8786>; else goto <D.8788>;
  <D.8788>:
  D.11746 = hs->objects_hash;
  if (D.11746 != 0B) goto <D.11752>; else goto <D.11753>;
  <D.11752>:
  D.11746 = hs->objects_hash;
  free (D.11746);
  <D.11753>:
  hs->objects_hash = 0B;
  hs->objects_hash_size = 0;
  hs->objects_count = 0;
}


new_heap_shot (uint64_t timestamp)
{
  int D.11754;
  long unsigned int D.11755;
  void * D.11756;
  int num_heap_shots.147;
  int num_heap_shots.148;
  struct HeapShot * heap_shots.149;
  struct HeapShot * D.11760;
  struct HeapShot * hs;

  hs = calloc (96, 1);
  hs->hash_size = 4;
  D.11754 = hs->hash_size;
  D.11755 = (long unsigned int) D.11754;
  D.11756 = calloc (8, D.11755);
  hs->class_hash = D.11756;
  hs->timestamp = timestamp;
  num_heap_shots.147 = num_heap_shots;
  num_heap_shots.148 = num_heap_shots.147 + 1;
  num_heap_shots = num_heap_shots.148;
  heap_shots.149 = heap_shots;
  hs->next = heap_shots.149;
  heap_shots = hs;
  D.11760 = hs;
  return D.11760;
}


lookup_monitor (uintptr_t objid)
{
  long unsigned int D.11762;
  long unsigned int D.11763;
  long unsigned int D.11764;
  long unsigned int D.11766;
  struct MonitorDesc * D.11769;
  int num_monitors.150;
  int num_monitors.151;
  struct MonitorDesc * D.11772;
  int slot;
  struct MonitorDesc * cd;

  D.11762 = objid >> 3;
  D.11763 = D.11762 & 65535;
  D.11764 = D.11763 % 31;
  slot = (int) D.11764;
  cd = monitor_hash[slot];
  goto <D.9018>;
  <D.9017>:
  cd = cd->next;
  <D.9018>:
  if (cd != 0B) goto <D.11765>; else goto <D.9019>;
  <D.11765>:
  D.11766 = cd->objid;
  if (D.11766 != objid) goto <D.9017>; else goto <D.9019>;
  <D.9019>:
  if (cd == 0B) goto <D.11767>; else goto <D.11768>;
  <D.11767>:
  cd = calloc (56, 1);
  cd->objid = objid;
  D.11769 = monitor_hash[slot];
  cd->next = D.11769;
  monitor_hash[slot] = cd;
  num_monitors.150 = num_monitors;
  num_monitors.151 = num_monitors.150 + 1;
  num_monitors = num_monitors.151;
  <D.11768>:
  D.11772 = cd;
  return D.11772;
}


monitor_ev_name (int ev)
{
  const char * D.11774;

  switch (ev) <default: <D.9026>, case 1: <D.9023>, case 2: <D.9024>, case 3: <D.9025>>
  <D.9023>:
  D.11774 = "contended";
  return D.11774;
  <D.9024>:
  D.11774 = "acquired";
  return D.11774;
  <D.9025>:
  D.11774 = "not taken";
  return D.11774;
  <D.9026>:
  D.11774 = "invalid";
  return D.11774;
}


lookup_method (intptr_t method)
{
  long int D.11776;
  long int D.11777;
  long int D.11778;
  long int D.11780;
  void * method.152;
  struct MethodDesc * D.11784;
  int slot;
  struct MethodDesc * cd;

  D.11776 = method >> 2;
  D.11777 = D.11776 & 65535;
  D.11778 = D.11777 % 9371;
  slot = (int) D.11778;
  cd = method_hash[slot];
  goto <D.8454>;
  <D.8453>:
  cd = cd->next;
  <D.8454>:
  if (cd != 0B) goto <D.11779>; else goto <D.8455>;
  <D.11779>:
  D.11780 = cd->method;
  if (D.11780 != method) goto <D.8453>; else goto <D.8455>;
  <D.8455>:
  if (cd == 0B) goto <D.11781>; else goto <D.11782>;
  <D.11781>:
  {
    char buf[128];

    try
      {
        method.152 = (void *) method;
        snprintf (&buf, 128, "unknown method %p", method.152);
        D.11784 = add_method (method, &buf, 0, 0);
        return D.11784;
      }
    finally
      {
        buf = {CLOBBER};
      }
  }
  <D.11782>:
  D.11784 = cd;
  return D.11784;
}


clause_name (int type)
{
  const char * D.11789;

  switch (type) <default: <D.9000>, case 0: <D.8996>, case 1: <D.8997>, case 2: <D.8998>, case 4: <D.8999>>
  <D.8996>:
  D.11789 = "catch";
  return D.11789;
  <D.8997>:
  D.11789 = "filter";
  return D.11789;
  <D.8998>:
  D.11789 = "finally";
  return D.11789;
  <D.8999>:
  D.11789 = "fault";
  return D.11789;
  <D.9000>:
  D.11789 = "invalid";
  return D.11789;
}


decode_bt (struct MethodDesc * * sframes, int * size, unsigned char * p, unsigned char * * endp, intptr_t ptr_base)
{
  unsigned char * p.153;
  long unsigned int D.11792;
  long unsigned int D.11793;
  struct MethodDesc * * D.11796;
  int D.11797;
  long unsigned int D.11800;
  long unsigned int D.11801;
  long unsigned int D.11803;
  long unsigned int D.11804;
  struct MethodDesc * * D.11805;
  long int D.11806;
  struct MethodDesc * D.11807;
  struct MethodDesc * * frames;
  int i;
  int flags;
  int count;

  p.153 = p;
  D.11792 = decode_uleb128 (p.153, &p);
  flags = (int) D.11792;
  p.153 = p;
  D.11793 = decode_uleb128 (p.153, &p);
  count = (int) D.11793;
  if (flags != 0) goto <D.11794>; else goto <D.11795>;
  <D.11794>:
  D.11796 = 0B;
  return D.11796;
  <D.11795>:
  D.11797 = *size;
  if (D.11797 < count) goto <D.11798>; else goto <D.11799>;
  <D.11798>:
  D.11800 = (long unsigned int) count;
  D.11801 = D.11800 * 8;
  frames = malloc (D.11801);
  goto <D.11802>;
  <D.11799>:
  frames = sframes;
  <D.11802>:
  i = 0;
  goto <D.9057>;
  <D.9056>:
  {
    intptr_t ptrdiff;

    p.153 = p;
    ptrdiff = decode_sleb128 (p.153, &p);
    D.11803 = (long unsigned int) i;
    D.11804 = D.11803 * 8;
    D.11805 = frames + D.11804;
    D.11806 = ptr_base + ptrdiff;
    D.11807 = lookup_method (D.11806);
    *D.11805 = D.11807;
  }
  i = i + 1;
  <D.9057>:
  if (i < count) goto <D.9056>; else goto <D.9058>;
  <D.9058>:
  *size = count;
  p.153 = p;
  *endp = p.153;
  D.11796 = frames;
  return D.11796;
}


add_trace_methods (struct MethodDesc * * methods, int count, struct TraceDesc * trace, uint64_t value)
{
  int collect_traces.154;
  struct BackTrace * D.11816;
  int trace_max.155;
  struct BackTrace * bt;

  collect_traces.154 = collect_traces;
  if (collect_traces.154 == 0) goto <D.11814>; else goto <D.11815>;
  <D.11814>:
  D.11816 = 0B;
  return D.11816;
  <D.11815>:
  trace_max.155 = trace_max;
  if (count > trace_max.155) goto <D.11818>; else goto <D.11819>;
  <D.11818>:
  count = trace_max;
  <D.11819>:
  bt = add_backtrace (count, methods);
  add_trace_bt (bt, trace, value);
  D.11816 = bt;
  return D.11816;
}


add_backtrace (int count, struct MethodDesc * * methods)
{
  int D.11822;
  unsigned int D.11823;
  unsigned int hash.156;
  int D.11827;
  struct BackTrace * D.11830;
  int D.11831;
  long unsigned int D.11832;
  long unsigned int D.11833;
  long unsigned int D.11834;
  struct BackTrace * D.11835;
  int next_backtrace.157;
  int num_backtraces.158;
  int num_backtraces.159;
  long unsigned int D.11843;
  long unsigned int D.11844;
  struct BackTrace * * backtraces.160;
  void * backtraces.161;
  int next_backtrace.162;
  int next_backtrace.163;
  int D.11849;
  long unsigned int D.11850;
  long unsigned int D.11851;
  struct BackTrace * * D.11852;
  long unsigned int D.11853;
  long unsigned int D.11854;
  struct MethodDesc * * D.11855;
  struct MethodDesc * D.11856;
  int hash;
  int slot;
  struct BackTrace * bt;

  hash = hash_backtrace (count, methods);
  D.11822 = hash & 65535;
  slot = D.11822 % 9371;
  bt = backtrace_hash[slot];
  goto <D.8824>;
  <D.8823>:
  D.11823 = bt->hash;
  hash.156 = (unsigned int) hash;
  if (D.11823 == hash.156) goto <D.11825>; else goto <D.11826>;
  <D.11825>:
  D.11827 = compare_backtrace (bt, count, methods);
  if (D.11827 != 0) goto <D.11828>; else goto <D.11829>;
  <D.11828>:
  D.11830 = bt;
  return D.11830;
  <D.11829>:
  <D.11826>:
  bt = bt->next;
  <D.8824>:
  if (bt != 0B) goto <D.8823>; else goto <D.8825>;
  <D.8825>:
  D.11831 = count + -1;
  D.11832 = (long unsigned int) D.11831;
  D.11833 = D.11832 + 4;
  D.11834 = D.11833 * 8;
  bt = malloc (D.11834);
  D.11835 = backtrace_hash[slot];
  bt->next = D.11835;
  backtrace_hash[slot] = bt;
  next_backtrace.157 = next_backtrace;
  num_backtraces.158 = num_backtraces;
  if (next_backtrace.157 == num_backtraces.158) goto <D.11838>; else goto <D.11839>;
  <D.11838>:
  num_backtraces.158 = num_backtraces;
  num_backtraces.159 = num_backtraces.158 * 2;
  num_backtraces = num_backtraces.159;
  num_backtraces.158 = num_backtraces;
  if (num_backtraces.158 == 0) goto <D.11841>; else goto <D.11842>;
  <D.11841>:
  num_backtraces = 16;
  <D.11842>:
  num_backtraces.158 = num_backtraces;
  D.11843 = (long unsigned int) num_backtraces.158;
  D.11844 = D.11843 * 8;
  backtraces.160 = backtraces;
  backtraces.161 = realloc (backtraces.160, D.11844);
  backtraces = backtraces.161;
  <D.11839>:
  next_backtrace.157 = next_backtrace;
  next_backtrace.162 = next_backtrace.157;
  next_backtrace.163 = next_backtrace.162 + 1;
  next_backtrace = next_backtrace.163;
  bt->id = next_backtrace.162;
  backtraces.160 = backtraces;
  D.11849 = bt->id;
  D.11850 = (long unsigned int) D.11849;
  D.11851 = D.11850 * 8;
  D.11852 = backtraces.160 + D.11851;
  *D.11852 = bt;
  bt->count = count;
  hash.156 = (unsigned int) hash;
  bt->hash = hash.156;
  slot = 0;
  goto <D.8827>;
  <D.8826>:
  D.11853 = (long unsigned int) slot;
  D.11854 = D.11853 * 8;
  D.11855 = methods + D.11854;
  D.11856 = *D.11855;
  bt->methods[slot] = D.11856;
  slot = slot + 1;
  <D.8827>:
  if (slot < count) goto <D.8826>; else goto <D.8828>;
  <D.8828>:
  D.11830 = bt;
  return D.11830;
}


hash_backtrace (int count, struct MethodDesc * * methods)
{
  int D.11860;
  int D.11861;
  unsigned int D.11862;
  long unsigned int D.11863;
  long unsigned int D.11864;
  struct MethodDesc * * D.11865;
  struct MethodDesc * D.11866;
  long int D.11867;
  unsigned int D.11868;
  unsigned int D.11869;
  int D.11870;
  int hash;
  int i;

  hash = count;
  i = 0;
  goto <D.8805>;
  <D.8804>:
  D.11860 = hash << 5;
  D.11861 = D.11860 - hash;
  D.11862 = (unsigned int) D.11861;
  D.11863 = (long unsigned int) i;
  D.11864 = D.11863 * 8;
  D.11865 = methods + D.11864;
  D.11866 = *D.11865;
  D.11867 = D.11866->method;
  D.11868 = (unsigned int) D.11867;
  D.11869 = D.11862 + D.11868;
  hash = (int) D.11869;
  i = i + 1;
  <D.8805>:
  if (i < count) goto <D.8804>; else goto <D.8806>;
  <D.8806>:
  D.11870 = hash;
  return D.11870;
}


compare_backtrace (struct BackTrace * bt, int count, struct MethodDesc * * methods)
{
  int D.11872;
  int D.11875;
  long unsigned int D.11876;
  long unsigned int D.11877;
  struct MethodDesc * * D.11878;
  struct MethodDesc * D.11879;
  struct MethodDesc * D.11880;
  int i;

  D.11872 = bt->count;
  if (D.11872 != count) goto <D.11873>; else goto <D.11874>;
  <D.11873>:
  D.11875 = 0;
  return D.11875;
  <D.11874>:
  i = 0;
  goto <D.8814>;
  <D.8813>:
  D.11876 = (long unsigned int) i;
  D.11877 = D.11876 * 8;
  D.11878 = methods + D.11877;
  D.11879 = *D.11878;
  D.11880 = bt->methods[i];
  if (D.11879 != D.11880) goto <D.11881>; else goto <D.11882>;
  <D.11881>:
  D.11875 = 0;
  return D.11875;
  <D.11882>:
  i = i + 1;
  <D.8814>:
  if (i < count) goto <D.8813>; else goto <D.8815>;
  <D.8815>:
  D.11875 = 1;
  return D.11875;
}


add_trace_bt (struct BackTrace * bt, struct TraceDesc * trace, uint64_t value)
{
  int collect_traces.164;
  int D.11887;
  int D.11888;
  int D.11889;
  int D.11892;
  long unsigned int D.11895;
  long unsigned int D.11896;
  struct CallContext * D.11897;
  long unsigned int D.11898;
  long unsigned int D.11899;
  struct CallContext * D.11900;
  struct BackTrace * D.11901;
  long unsigned int D.11904;
  int D.11907;
  int D.11908;
  int i;

  collect_traces.164 = collect_traces;
  if (collect_traces.164 == 0) goto <D.11885>; else goto <D.11886>;
  <D.11885>:
  return;
  <D.11886>:
  D.11887 = trace->count;
  D.11888 = D.11887 * 2;
  D.11889 = trace->size;
  if (D.11888 >= D.11889) goto <D.11890>; else goto <D.11891>;
  <D.11890>:
  {
    struct CallContext * n;
    int old_size;

    old_size = trace->size;
    D.11889 = trace->size;
    D.11892 = D.11889 * 2;
    trace->size = D.11892;
    D.11889 = trace->size;
    if (D.11889 == 0) goto <D.11893>; else goto <D.11894>;
    <D.11893>:
    trace->size = 4;
    <D.11894>:
    D.11889 = trace->size;
    D.11895 = (long unsigned int) D.11889;
    D.11896 = D.11895 * 16;
    n = calloc (D.11896, 1);
    i = 0;
    goto <D.8911>;
    <D.8910>:
    D.11897 = trace->traces;
    D.11898 = (long unsigned int) i;
    D.11899 = D.11898 * 16;
    D.11900 = D.11897 + D.11899;
    D.11901 = D.11900->bt;
    if (D.11901 != 0B) goto <D.11902>; else goto <D.11903>;
    <D.11902>:
    D.11897 = trace->traces;
    D.11898 = (long unsigned int) i;
    D.11899 = D.11898 * 16;
    D.11900 = D.11897 + D.11899;
    D.11904 = D.11900->count;
    D.11897 = trace->traces;
    D.11898 = (long unsigned int) i;
    D.11899 = D.11898 * 16;
    D.11900 = D.11897 + D.11899;
    D.11901 = D.11900->bt;
    D.11889 = trace->size;
    add_trace_hashed (n, D.11889, D.11901, D.11904);
    <D.11903>:
    i = i + 1;
    <D.8911>:
    if (i < old_size) goto <D.8910>; else goto <D.8912>;
    <D.8912>:
    D.11897 = trace->traces;
    if (D.11897 != 0B) goto <D.11905>; else goto <D.11906>;
    <D.11905>:
    D.11897 = trace->traces;
    free (D.11897);
    <D.11906>:
    trace->traces = n;
  }
  <D.11891>:
  D.11889 = trace->size;
  D.11897 = trace->traces;
  D.11907 = add_trace_hashed (D.11897, D.11889, bt, value);
  D.11887 = trace->count;
  D.11908 = D.11887 + D.11907;
  trace->count = D.11908;
}


add_trace_hashed (struct CallContext * traces, int size, struct BackTrace * bt, uint64_t value)
{
  unsigned int D.11911;
  unsigned int size.165;
  long unsigned int D.11913;
  long unsigned int D.11914;
  struct CallContext * D.11915;
  struct BackTrace * D.11916;
  long unsigned int D.11919;
  long unsigned int D.11920;
  int D.11921;
  unsigned int i.166;
  int i;
  unsigned int start_pos;

  D.11911 = bt->hash;
  size.165 = (unsigned int) size;
  start_pos = D.11911 % size.165;
  i = (int) start_pos;
  <D.8900>:
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11916 = D.11915->bt;
  if (D.11916 == bt) goto <D.11917>; else goto <D.11918>;
  <D.11917>:
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11919 = D.11915->count;
  D.11920 = D.11919 + value;
  D.11915->count = D.11920;
  D.11921 = 0;
  return D.11921;
  <D.11918>:
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11916 = D.11915->bt;
  if (D.11916 == 0B) goto <D.11922>; else goto <D.11923>;
  <D.11922>:
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11915->bt = bt;
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11913 = (long unsigned int) i;
  D.11914 = D.11913 * 16;
  D.11915 = traces + D.11914;
  D.11919 = D.11915->count;
  D.11920 = D.11919 + value;
  D.11915->count = D.11920;
  D.11921 = 1;
  return D.11921;
  <D.11923>:
  i = i + 1;
  if (i == size) goto <D.11924>; else goto <D.11925>;
  <D.11924>:
  i = 0;
  <D.11925>:
  i.166 = (unsigned int) i;
  if (i.166 != start_pos) goto <D.8900>; else goto <D.8901>;
  <D.8901>:
  printf ("failed trace store\n");
  D.11921 = 0;
  return D.11921;
}


add_trace_thread (struct ThreadContext * thread, struct TraceDesc * trace, uint64_t value)
{
  int collect_traces.167;
  struct BackTrace * D.11931;
  int trace_max.168;
  struct MethodDesc * * D.11935;
  int D.11936;
  sizetype D.11937;
  sizetype D.11938;
  sizetype D.11939;
  sizetype D.11940;
  struct MethodDesc * * D.11941;
  struct BackTrace * bt;
  int count;

  count = thread->stack_id;
  collect_traces.167 = collect_traces;
  if (collect_traces.167 == 0) goto <D.11929>; else goto <D.11930>;
  <D.11929>:
  D.11931 = 0B;
  return D.11931;
  <D.11930>:
  trace_max.168 = trace_max;
  if (count > trace_max.168) goto <D.11933>; else goto <D.11934>;
  <D.11933>:
  count = trace_max;
  <D.11934>:
  D.11935 = thread->stack;
  D.11936 = thread->stack_id;
  D.11937 = (sizetype) D.11936;
  D.11938 = (sizetype) count;
  D.11939 = D.11937 - D.11938;
  D.11940 = D.11939 * 8;
  D.11941 = D.11935 + D.11940;
  bt = add_backtrace (count, D.11941);
  add_trace_bt (bt, trace, value);
  D.11931 = bt;
  return D.11931;
}


add_stat_sample (int type, uintptr_t ip)
{
  int num_stat_samples.169;
  int size_stat_samples.170;
  int size_stat_samples.171;
  long unsigned int D.11951;
  long unsigned int D.11952;
  uintptr_t * stat_samples.172;
  void * stat_samples.173;
  long unsigned int D.11955;
  int * stat_sample_desc.174;
  void * stat_sample_desc.175;
  long unsigned int D.11958;
  long unsigned int D.11959;
  uintptr_t * D.11960;
  int num_stat_samples.176;
  int num_stat_samples.177;
  long unsigned int D.11963;
  long unsigned int D.11964;
  int * D.11965;

  num_stat_samples.169 = num_stat_samples;
  size_stat_samples.170 = size_stat_samples;
  if (num_stat_samples.169 == size_stat_samples.170) goto <D.11946>; else goto <D.11947>;
  <D.11946>:
  size_stat_samples.170 = size_stat_samples;
  size_stat_samples.171 = size_stat_samples.170 * 2;
  size_stat_samples = size_stat_samples.171;
  size_stat_samples.170 = size_stat_samples;
  if (size_stat_samples.170 == 0) goto <D.11949>; else goto <D.11950>;
  <D.11949>:
  size_stat_samples = 32;
  <D.11950>:
  size_stat_samples.170 = size_stat_samples;
  D.11951 = (long unsigned int) size_stat_samples.170;
  D.11952 = D.11951 * 8;
  stat_samples.172 = stat_samples;
  stat_samples.173 = realloc (stat_samples.172, D.11952);
  stat_samples = stat_samples.173;
  size_stat_samples.170 = size_stat_samples;
  D.11951 = (long unsigned int) size_stat_samples.170;
  D.11955 = D.11951 * 4;
  stat_sample_desc.174 = stat_sample_desc;
  stat_sample_desc.175 = realloc (stat_sample_desc.174, D.11955);
  stat_sample_desc = stat_sample_desc.175;
  <D.11947>:
  stat_samples.172 = stat_samples;
  num_stat_samples.169 = num_stat_samples;
  D.11958 = (long unsigned int) num_stat_samples.169;
  D.11959 = D.11958 * 8;
  D.11960 = stat_samples.172 + D.11959;
  *D.11960 = ip;
  stat_sample_desc.174 = stat_sample_desc;
  num_stat_samples.169 = num_stat_samples;
  num_stat_samples.176 = num_stat_samples.169;
  num_stat_samples.177 = num_stat_samples.176 + 1;
  num_stat_samples = num_stat_samples.177;
  D.11963 = (long unsigned int) num_stat_samples.176;
  D.11964 = D.11963 * 4;
  D.11965 = stat_sample_desc.174 + D.11964;
  *D.11965 = type;
}


add_unmanaged_symbol (uintptr_t addr, char * name, uintptr_t size)
{
  int usymbols_num.178;
  int usymbols_size.179;
  long unsigned int D.11972;
  long unsigned int D.11973;
  struct UnmanagedSymbol * * usymbols.180;
  void * usymbols.181;
  int usymbols_num.182;
  int usymbols_num.183;
  long unsigned int D.11978;
  long unsigned int D.11979;
  struct UnmanagedSymbol * * D.11980;
  struct UnmanagedSymbol * sym;

  usymbols_num.178 = usymbols_num;
  usymbols_size.179 = usymbols_size;
  if (usymbols_num.178 == usymbols_size.179) goto <D.11968>; else goto <D.11969>;
  <D.11968>:
  {
    int new_size;

    usymbols_size.179 = usymbols_size;
    new_size = usymbols_size.179 * 2;
    if (new_size == 0) goto <D.11970>; else goto <D.11971>;
    <D.11970>:
    new_size = 16;
    <D.11971>:
    D.11972 = (long unsigned int) new_size;
    D.11973 = D.11972 * 8;
    usymbols.180 = usymbols;
    usymbols.181 = realloc (usymbols.180, D.11973);
    usymbols = usymbols.181;
    usymbols_size = new_size;
  }
  <D.11969>:
  sym = calloc (48, 1);
  sym->addr = addr;
  sym->name = name;
  sym->size = size;
  usymbols.180 = usymbols;
  usymbols_num.178 = usymbols_num;
  usymbols_num.182 = usymbols_num.178;
  usymbols_num.183 = usymbols_num.182 + 1;
  usymbols_num = usymbols_num.183;
  D.11978 = (long unsigned int) usymbols_num.182;
  D.11979 = D.11978 * 8;
  D.11980 = usymbols.180 + D.11979;
  *D.11980 = sym;
}


add_unmanaged_binary (uintptr_t addr, char * name, uintptr_t size)
{
  int ubinaries_num.184;
  int ubinaries_size.185;
  long unsigned int D.11987;
  long unsigned int D.11988;
  struct UnmanagedSymbol * * ubinaries.186;
  void * ubinaries.187;
  int ubinaries_num.188;
  int ubinaries_num.189;
  long unsigned int D.11993;
  long unsigned int D.11994;
  struct UnmanagedSymbol * * D.11995;
  struct UnmanagedSymbol * sym;

  ubinaries_num.184 = ubinaries_num;
  ubinaries_size.185 = ubinaries_size;
  if (ubinaries_num.184 == ubinaries_size.185) goto <D.11983>; else goto <D.11984>;
  <D.11983>:
  {
    int new_size;

    ubinaries_size.185 = ubinaries_size;
    new_size = ubinaries_size.185 * 2;
    if (new_size == 0) goto <D.11985>; else goto <D.11986>;
    <D.11985>:
    new_size = 16;
    <D.11986>:
    D.11987 = (long unsigned int) new_size;
    D.11988 = D.11987 * 8;
    ubinaries.186 = ubinaries;
    ubinaries.187 = realloc (ubinaries.186, D.11988);
    ubinaries = ubinaries.187;
    ubinaries_size = new_size;
  }
  <D.11984>:
  sym = calloc (48, 1);
  sym->addr = addr;
  sym->name = name;
  sym->size = size;
  sym->is_binary = 1;
  ubinaries.186 = ubinaries;
  ubinaries_num.184 = ubinaries_num;
  ubinaries_num.188 = ubinaries_num.184;
  ubinaries_num.189 = ubinaries_num.188 + 1;
  ubinaries_num = ubinaries_num.189;
  D.11993 = (long unsigned int) ubinaries_num.188;
  D.11994 = D.11993 * 8;
  D.11995 = ubinaries.186 + D.11994;
  *D.11995 = sym;
}


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

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


flush_context (struct ProfContext * ctx)
{
  int debug.190;
  int D.12002;
  long int D.12003;
  void * D.12004;
  struct FILE * outfile.191;
  long unsigned int D.12006;
  struct MethodDesc * * D.12007;
  long unsigned int D.12008;
  long unsigned int D.12009;
  sizetype D.12010;
  struct MethodDesc * * D.12011;
  struct MethodDesc * D.12012;
  struct ThreadContext * thread;

  thread = ctx->threads;
  goto <D.9519>;
  <D.9518>:
  goto <D.9516>;
  <D.9515>:
  debug.190 = debug;
  if (debug.190 != 0) goto <D.12000>; else goto <D.12001>;
  <D.12000>:
  D.12002 = thread->stack_id;
  D.12003 = thread->thread_id;
  D.12004 = (void *) D.12003;
  outfile.191 = outfile;
  fprintf (outfile.191, "thread %p has %d items on stack\n", D.12004, D.12002);
  <D.12001>:
  D.12006 = thread->last_time;
  D.12007 = thread->stack;
  D.12002 = thread->stack_id;
  D.12008 = (long unsigned int) D.12002;
  D.12009 = D.12008 * 8;
  D.12010 = D.12009 + 18446744073709551608;
  D.12011 = D.12007 + D.12010;
  D.12012 = *D.12011;
  pop_method (thread, D.12012, D.12006);
  <D.9516>:
  D.12002 = thread->stack_id;
  if (D.12002 != 0) goto <D.9515>; else goto <D.9517>;
  <D.9517>:
  thread = thread->next;
  <D.9519>:
  if (thread != 0B) goto <D.9518>; else goto <D.9520>;
  <D.9520>:
}


print_reports (struct ProfContext * ctx, const char * reps, int parse_only)
{
  int D.12057;
  char D.12058;
  const char * opt;
  const char * p;

  p = reps;
  goto <D.9545>;
  <D.9544>:
  opt = match_option (p, "header");
  if (opt != p) goto <D.12013>; else goto <D.12014>;
  <D.12013>:
  if (parse_only == 0) goto <D.12015>; else goto <D.12016>;
  <D.12015>:
  dump_header (ctx);
  <D.12016>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12014>:
  opt = match_option (p, "thread");
  if (opt != p) goto <D.12017>; else goto <D.12018>;
  <D.12017>:
  if (parse_only == 0) goto <D.12019>; else goto <D.12020>;
  <D.12019>:
  dump_threads (ctx);
  <D.12020>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12018>:
  opt = match_option (p, "gc");
  if (opt != p) goto <D.12021>; else goto <D.12022>;
  <D.12021>:
  if (parse_only == 0) goto <D.12023>; else goto <D.12024>;
  <D.12023>:
  dump_gcs ();
  <D.12024>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12022>:
  opt = match_option (p, "jit");
  if (opt != p) goto <D.12025>; else goto <D.12026>;
  <D.12025>:
  if (parse_only == 0) goto <D.12027>; else goto <D.12028>;
  <D.12027>:
  dump_jit ();
  <D.12028>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12026>:
  opt = match_option (p, "alloc");
  if (opt != p) goto <D.12029>; else goto <D.12030>;
  <D.12029>:
  if (parse_only == 0) goto <D.12031>; else goto <D.12032>;
  <D.12031>:
  dump_allocations ();
  <D.12032>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12030>:
  opt = match_option (p, "call");
  if (opt != p) goto <D.12033>; else goto <D.12034>;
  <D.12033>:
  if (parse_only == 0) goto <D.12035>; else goto <D.12036>;
  <D.12035>:
  dump_methods ();
  <D.12036>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12034>:
  opt = match_option (p, "metadata");
  if (opt != p) goto <D.12037>; else goto <D.12038>;
  <D.12037>:
  if (parse_only == 0) goto <D.12039>; else goto <D.12040>;
  <D.12039>:
  dump_metadata ();
  <D.12040>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12038>:
  opt = match_option (p, "exception");
  if (opt != p) goto <D.12041>; else goto <D.12042>;
  <D.12041>:
  if (parse_only == 0) goto <D.12043>; else goto <D.12044>;
  <D.12043>:
  dump_exceptions ();
  <D.12044>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12042>:
  opt = match_option (p, "monitor");
  if (opt != p) goto <D.12045>; else goto <D.12046>;
  <D.12045>:
  if (parse_only == 0) goto <D.12047>; else goto <D.12048>;
  <D.12047>:
  dump_monitors ();
  <D.12048>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12046>:
  opt = match_option (p, "heapshot");
  if (opt != p) goto <D.12049>; else goto <D.12050>;
  <D.12049>:
  if (parse_only == 0) goto <D.12051>; else goto <D.12052>;
  <D.12051>:
  dump_heap_shots ();
  <D.12052>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12050>:
  opt = match_option (p, "sample");
  if (opt != p) goto <D.12053>; else goto <D.12054>;
  <D.12053>:
  if (parse_only == 0) goto <D.12055>; else goto <D.12056>;
  <D.12055>:
  dump_samples ();
  <D.12056>:
  // predicted unlikely by continue predictor.
  goto <D.9543>;
  <D.12054>:
  D.12057 = 0;
  return D.12057;
  <D.9543>:
  p = opt;
  <D.9545>:
  D.12058 = *p;
  if (D.12058 != 0) goto <D.9544>; else goto <D.9546>;
  <D.9546>:
  D.12057 = 1;
  return D.12057;
}


dump_header (struct ProfContext * ctx)
{
  long unsigned int D.12071;
  long unsigned int D.12072;
  long int st.192;
  struct FILE * outfile.193;
  int D.12075;
  int D.12076;
  int D.12077;
  int D.12078;
  int D.12079;
  int D.12082;
  time_t st;
  char * t;

  try
    {
      D.12071 = ctx->startup_time;
      D.12072 = D.12071 / 1000;
      st.192 = (long int) D.12072;
      st = st.192;
      t = ctime (&st);
      outfile.193 = outfile;
      fprintf (outfile.193, "\nMono log profiler data\n");
      D.12075 = ctx->version_minor;
      D.12076 = ctx->version_major;
      outfile.193 = outfile;
      fprintf (outfile.193, "\tProfiler version: %d.%d\n", D.12076, D.12075);
      D.12077 = ctx->data_version;
      outfile.193 = outfile;
      fprintf (outfile.193, "\tData version: %d\n", D.12077);
      D.12078 = ctx->timer_overhead;
      outfile.193 = outfile;
      fprintf (outfile.193, "\tMean timer overhead: %d nanoseconds\n", D.12078);
      outfile.193 = outfile;
      fprintf (outfile.193, "\tProgram startup: %s", t);
      D.12079 = ctx->pid;
      if (D.12079 != 0) goto <D.12080>; else goto <D.12081>;
      <D.12080>:
      D.12079 = ctx->pid;
      outfile.193 = outfile;
      fprintf (outfile.193, "\tProgram ID: %d\n", D.12079);
      <D.12081>:
      D.12082 = ctx->port;
      if (D.12082 != 0) goto <D.12083>; else goto <D.12084>;
      <D.12083>:
      D.12082 = ctx->port;
      outfile.193 = outfile;
      fprintf (outfile.193, "\tServer listening on: %d\n", D.12082);
      <D.12084>:
    }
  finally
    {
      st = {CLOBBER};
    }
}


dump_threads (struct ProfContext * ctx)
{
  struct FILE * outfile.194;
  const char * iftmp.195;
  char * D.12089;
  long int D.12093;
  void * D.12094;
  struct ThreadContext * thread;

  outfile.194 = outfile;
  fprintf (outfile.194, "\nThread summary\n");
  thread = ctx->threads;
  goto <D.9316>;
  <D.9315>:
  D.12089 = thread->name;
  if (D.12089 != 0B) goto <D.12090>; else goto <D.12091>;
  <D.12090>:
  iftmp.195 = thread->name;
  goto <D.12092>;
  <D.12091>:
  iftmp.195 = "";
  <D.12092>:
  D.12093 = thread->thread_id;
  D.12094 = (void *) D.12093;
  outfile.194 = outfile;
  fprintf (outfile.194, "\tThread: %p, name: \"%s\"\n", D.12094, iftmp.195);
  thread = thread->next;
  <D.9316>:
  if (thread != 0B) goto <D.9315>; else goto <D.9317>;
  <D.9317>:
}


dump_gcs ()
{
  struct FILE * outfile.196;
  int gc_resizes.197;
  long unsigned int max_heap_size.198;
  long unsigned int gc_object_moves.199;
  int D.12099;
  long unsigned int D.12102;
  long unsigned int D.12103;
  long unsigned int D.12104;
  long unsigned int D.12105;
  long unsigned int D.12106;
  long unsigned int D.12107;
  long unsigned int D.12108;
  long unsigned int D.12109;
  long unsigned int D.12112;
  long unsigned int D.12113;
  const char * D.12114;
  struct TraceDesc * D.12115;
  int i;

  outfile.196 = outfile;
  fprintf (outfile.196, "\nGC summary\n");
  gc_resizes.197 = gc_resizes;
  outfile.196 = outfile;
  fprintf (outfile.196, "\tGC resizes: %d\n", gc_resizes.197);
  max_heap_size.198 = max_heap_size;
  outfile.196 = outfile;
  fprintf (outfile.196, "\tMax heap size: %llu\n", max_heap_size.198);
  gc_object_moves.199 = gc_object_moves;
  outfile.196 = outfile;
  fprintf (outfile.196, "\tObject moves: %llu\n", gc_object_moves.199);
  i = 0;
  goto <D.9355>;
  <D.9354>:
  D.12099 = gc_info[i].count;
  if (D.12099 == 0) goto <D.12100>; else goto <D.12101>;
  <D.12100>:
  // predicted unlikely by continue predictor.
  goto <D.9353>;
  <D.12101>:
  D.12102 = gc_info[i].total_time;
  D.12099 = gc_info[i].count;
  D.12103 = (long unsigned int) D.12099;
  D.12104 = D.12102 / D.12103;
  D.12105 = D.12104 / 1000;
  D.12102 = gc_info[i].total_time;
  D.12106 = D.12102 / 1000;
  D.12107 = gc_info[i].max_time;
  D.12108 = D.12107 / 1000;
  D.12099 = gc_info[i].count;
  outfile.196 = outfile;
  fprintf (outfile.196, "\tGen%d collections: %d, max time: %lluus, total time: %lluus, average: %lluus\n", i, D.12099, D.12108, D.12106, D.12105);
  <D.9353>:
  i = i + 1;
  <D.9355>:
  if (i <= 2) goto <D.9354>; else goto <D.9356>;
  <D.9356>:
  i = 0;
  goto <D.9359>;
  <D.9358>:
  D.12109 = handle_info[i].max_live;
  if (D.12109 == 0) goto <D.12110>; else goto <D.12111>;
  <D.12110>:
  // predicted unlikely by continue predictor.
  goto <D.9357>;
  <D.12111>:
  D.12109 = handle_info[i].max_live;
  D.12112 = handle_info[i].destroyed;
  D.12113 = handle_info[i].created;
  D.12114 = get_handle_name (i);
  outfile.196 = outfile;
  fprintf (outfile.196, "\tGC handles %s: created: %llu, destroyed: %llu, max: %llu\n", D.12114, D.12113, D.12112, D.12109);
  D.12115 = &handle_info[i].traces;
  dump_traces (D.12115, "created");
  <D.9357>:
  i = i + 1;
  <D.9359>:
  if (i <= 2) goto <D.9358>; else goto <D.9360>;
  <D.9360>:
}


dump_traces (struct TraceDesc * traces, const char * desc)
{
  int show_traces.200;
  int D.12120;
  struct CallContext * D.12123;
  long unsigned int D.12124;
  long unsigned int D.12125;
  struct CallContext * D.12126;
  int D.12127;
  long unsigned int D.12130;
  struct FILE * outfile.201;
  struct MethodDesc * D.12132;
  char * D.12133;
  int j;

  show_traces.200 = show_traces;
  if (show_traces.200 == 0) goto <D.12118>; else goto <D.12119>;
  <D.12118>:
  return;
  <D.12119>:
  D.12120 = traces->count;
  if (D.12120 == 0) goto <D.12121>; else goto <D.12122>;
  <D.12121>:
  return;
  <D.12122>:
  sort_context_array (traces);
  j = 0;
  goto <D.9309>;
  <D.9308>:
  {
    int k;
    struct BackTrace * bt;

    D.12123 = traces->traces;
    D.12124 = (long unsigned int) j;
    D.12125 = D.12124 * 16;
    D.12126 = D.12123 + D.12125;
    bt = D.12126->bt;
    D.12127 = bt->count;
    if (D.12127 == 0) goto <D.12128>; else goto <D.12129>;
    <D.12128>:
    // predicted unlikely by continue predictor.
    goto <D.9304>;
    <D.12129>:
    D.12123 = traces->traces;
    D.12124 = (long unsigned int) j;
    D.12125 = D.12124 * 16;
    D.12126 = D.12123 + D.12125;
    D.12130 = D.12126->count;
    outfile.201 = outfile;
    fprintf (outfile.201, "\t%llu %s from:\n", D.12130, desc);
    k = 0;
    goto <D.9306>;
    <D.9305>:
    D.12132 = bt->methods[k];
    D.12133 = D.12132->name;
    outfile.201 = outfile;
    fprintf (outfile.201, "\t\t%s\n", D.12133);
    k = k + 1;
    <D.9306>:
    D.12127 = bt->count;
    if (D.12127 > k) goto <D.9305>; else goto <D.9307>;
    <D.9307>:
  }
  <D.9304>:
  j = j + 1;
  <D.9309>:
  D.12120 = traces->count;
  if (D.12120 > j) goto <D.9308>; else goto <D.9310>;
  <D.9310>:
}


sort_context_array (struct TraceDesc * traces)
{
  struct CallContext * D.12135;
  long unsigned int D.12136;
  long unsigned int D.12137;
  struct CallContext * D.12138;
  struct BackTrace * D.12139;
  long unsigned int D.12142;
  long unsigned int D.12143;
  struct CallContext * D.12144;
  long unsigned int D.12145;
  int D.12146;
  int D.12147;
  long unsigned int D.12148;
  int i;
  int j;

  i = 0;
  j = 0;
  goto <D.8946>;
  <D.8945>:
  D.12135 = traces->traces;
  D.12136 = (long unsigned int) i;
  D.12137 = D.12136 * 16;
  D.12138 = D.12135 + D.12137;
  D.12139 = D.12138->bt;
  if (D.12139 != 0B) goto <D.12140>; else goto <D.12141>;
  <D.12140>:
  D.12135 = traces->traces;
  D.12142 = (long unsigned int) j;
  D.12143 = D.12142 * 16;
  D.12144 = D.12135 + D.12143;
  D.12135 = traces->traces;
  D.12136 = (long unsigned int) i;
  D.12137 = D.12136 * 16;
  D.12138 = D.12135 + D.12137;
  D.12139 = D.12138->bt;
  D.12144->bt = D.12139;
  D.12135 = traces->traces;
  D.12142 = (long unsigned int) j;
  D.12143 = D.12142 * 16;
  D.12144 = D.12135 + D.12143;
  D.12135 = traces->traces;
  D.12136 = (long unsigned int) i;
  D.12137 = D.12136 * 16;
  D.12138 = D.12135 + D.12137;
  D.12145 = D.12138->count;
  D.12144->count = D.12145;
  j = j + 1;
  <D.12141>:
  i = i + 1;
  <D.8946>:
  D.12146 = traces->size;
  if (D.12146 > i) goto <D.8945>; else goto <D.8947>;
  <D.8947>:
  D.12147 = traces->count;
  D.12148 = (long unsigned int) D.12147;
  D.12135 = traces->traces;
  qsort (D.12135, D.12148, 16, compare_callc);
}


compare_callc (const void * a, const void * b)
{
  long unsigned int D.12149;
  long unsigned int D.12150;
  int D.12153;
  const struct CallContext * A;
  const struct CallContext * B;

  A = a;
  B = b;
  D.12149 = B->count;
  D.12150 = A->count;
  if (D.12149 == D.12150) goto <D.12151>; else goto <D.12152>;
  <D.12151>:
  D.12153 = 0;
  return D.12153;
  <D.12152>:
  D.12149 = B->count;
  D.12150 = A->count;
  if (D.12149 < D.12150) goto <D.12154>; else goto <D.12155>;
  <D.12154>:
  D.12153 = -1;
  return D.12153;
  <D.12155>:
  D.12153 = 1;
  return D.12153;
}


dump_jit ()
{
  struct FILE * outfile.202;
  long int D.12158;
  int D.12161;
  int i;
  int code_size;
  int compiled_methods;
  struct MethodDesc * m;

  code_size = 0;
  compiled_methods = 0;
  outfile.202 = outfile;
  fprintf (outfile.202, "\nJIT summary\n");
  i = 0;
  goto <D.9373>;
  <D.9372>:
  m = method_hash[i];
  m = method_hash[i];
  goto <D.9370>;
  <D.9369>:
  D.12158 = m->code;
  if (D.12158 == 0) goto <D.12159>; else goto <D.12160>;
  <D.12159>:
  // predicted unlikely by continue predictor.
  goto <D.9368>;
  <D.12160>:
  compiled_methods = compiled_methods + 1;
  D.12161 = m->len;
  code_size = D.12161 + code_size;
  <D.9368>:
  m = m->next;
  <D.9370>:
  if (m != 0B) goto <D.9369>; else goto <D.9371>;
  <D.9371>:
  i = i + 1;
  <D.9373>:
  if (i <= 9370) goto <D.9372>; else goto <D.9374>;
  <D.9374>:
  outfile.202 = outfile;
  fprintf (outfile.202, "\tCompiled methods: %d\n", compiled_methods);
  outfile.202 = outfile;
  fprintf (outfile.202, "\tGenerated code size: %d\n", code_size);
}


dump_allocations ()
{
  int num_classes.203;
  long unsigned int D.12163;
  long unsigned int D.12164;
  int c.204;
  long unsigned int D.12166;
  long unsigned int D.12167;
  struct ClassDesc * * D.12168;
  long unsigned int D.12169;
  long unsigned int D.12170;
  long unsigned int D.12171;
  struct ClassDesc * * D.12172;
  long int D.12173;
  long unsigned int D.12176;
  int header_done.205;
  struct FILE * outfile.206;
  char * D.12181;
  long unsigned int D.12182;
  long unsigned int D.12183;
  struct TraceDesc * D.12184;
  int i;
  int c;
  intptr_t allocs;
  uint64_t size;
  int header_done;
  struct ClassDesc * * classes;
  struct ClassDesc * cd;

  allocs = 0;
  size = 0;
  header_done = 0;
  num_classes.203 = num_classes;
  D.12163 = (long unsigned int) num_classes.203;
  D.12164 = D.12163 * 8;
  classes = malloc (D.12164);
  c = 0;
  i = 0;
  goto <D.9389>;
  <D.9388>:
  cd = class_hash[i];
  goto <D.9386>;
  <D.9385>:
  c.204 = c;
  c = c.204 + 1;
  D.12166 = (long unsigned int) c.204;
  D.12167 = D.12166 * 8;
  D.12168 = classes + D.12167;
  *D.12168 = cd;
  cd = cd->next;
  <D.9386>:
  if (cd != 0B) goto <D.9385>; else goto <D.9387>;
  <D.9387>:
  i = i + 1;
  <D.9389>:
  if (i <= 9370) goto <D.9388>; else goto <D.9390>;
  <D.9390>:
  num_classes.203 = num_classes;
  D.12169 = (long unsigned int) num_classes.203;
  qsort (classes, D.12169, 8, compare_class);
  i = 0;
  goto <D.9393>;
  <D.9392>:
  D.12170 = (long unsigned int) i;
  D.12171 = D.12170 * 8;
  D.12172 = classes + D.12171;
  cd = *D.12172;
  D.12173 = cd->allocs;
  if (D.12173 == 0) goto <D.12174>; else goto <D.12175>;
  <D.12174>:
  // predicted unlikely by continue predictor.
  goto <D.9391>;
  <D.12175>:
  D.12173 = cd->allocs;
  allocs = D.12173 + allocs;
  D.12176 = cd->alloc_size;
  size = D.12176 + size;
  header_done.205 = header_done;
  header_done = header_done.205 + 1;
  if (header_done.205 == 0) goto <D.12178>; else goto <D.12179>;
  <D.12178>:
  outfile.206 = outfile;
  fprintf (outfile.206, "\nAllocation summary\n");
  outfile.206 = outfile;
  fprintf (outfile.206, "%10s %10s %8s Type name\n", "Bytes", "Count", "Average");
  <D.12179>:
  D.12181 = cd->name;
  D.12176 = cd->alloc_size;
  D.12173 = cd->allocs;
  D.12182 = (long unsigned int) D.12173;
  D.12183 = D.12176 / D.12182;
  D.12173 = cd->allocs;
  D.12176 = cd->alloc_size;
  outfile.206 = outfile;
  fprintf (outfile.206, "%10llu %10d %8llu %s\n", D.12176, D.12173, D.12183, D.12181);
  D.12184 = &cd->traces;
  dump_traces (D.12184, "bytes");
  <D.9391>:
  i = i + 1;
  <D.9393>:
  num_classes.203 = num_classes;
  if (i < num_classes.203) goto <D.9392>; else goto <D.9394>;
  <D.9394>:
  if (allocs != 0) goto <D.12185>; else goto <D.12186>;
  <D.12185>:
  outfile.206 = outfile;
  fprintf (outfile.206, "Total memory allocated: %llu bytes in %d objects\n", size, allocs);
  <D.12186>:
}


compare_class (const void * a, const void * b)
{
  int alloc_sort_mode.207;
  struct ClassDesc * D.12190;
  struct ClassDesc * D.12191;
  long int D.12193;
  long int D.12194;
  int D.12197;
  struct ClassDesc * const * A;
  struct ClassDesc * const * B;
  uint64_t vala;
  uint64_t valb;

  A = a;
  B = b;
  alloc_sort_mode.207 = alloc_sort_mode;
  if (alloc_sort_mode.207 == 0) goto <D.12188>; else goto <D.12189>;
  <D.12188>:
  D.12190 = *A;
  vala = D.12190->alloc_size;
  D.12191 = *B;
  valb = D.12191->alloc_size;
  goto <D.12192>;
  <D.12189>:
  D.12190 = *A;
  D.12193 = D.12190->allocs;
  vala = (uint64_t) D.12193;
  D.12191 = *B;
  D.12194 = D.12191->allocs;
  valb = (uint64_t) D.12194;
  <D.12192>:
  if (valb == vala) goto <D.12195>; else goto <D.12196>;
  <D.12195>:
  D.12197 = 0;
  return D.12197;
  <D.12196>:
  if (valb < vala) goto <D.12198>; else goto <D.12199>;
  <D.12198>:
  D.12197 = -1;
  return D.12197;
  <D.12199>:
  D.12197 = 1;
  return D.12197;
}


dump_methods ()
{
  int num_methods.208;
  long unsigned int D.12202;
  long unsigned int D.12203;
  long unsigned int D.12204;
  long unsigned int D.12205;
  long unsigned int D.12206;
  int c.209;
  long unsigned int D.12208;
  long unsigned int D.12209;
  struct MethodDesc * * D.12210;
  long unsigned int D.12211;
  long unsigned int D.12212;
  long unsigned int D.12213;
  struct MethodDesc * * D.12214;
  long unsigned int D.12215;
  long unsigned int D.12218;
  long unsigned int D.12219;
  int verbose.210;
  int header_done.211;
  struct FILE * outfile.212;
  char * D.12229;
  struct TraceDesc * D.12230;
  int i;
  int c;
  uint64_t calls;
  int header_done;
  struct MethodDesc * * methods;
  struct MethodDesc * cd;

  calls = 0;
  header_done = 0;
  num_methods.208 = num_methods;
  D.12202 = (long unsigned int) num_methods.208;
  D.12203 = D.12202 * 8;
  methods = malloc (D.12203);
  c = 0;
  i = 0;
  goto <D.9432>;
  <D.9431>:
  cd = method_hash[i];
  goto <D.9429>;
  <D.9428>:
  D.12204 = cd->self_time;
  D.12205 = cd->callee_time;
  D.12206 = D.12204 + D.12205;
  cd->total_time = D.12206;
  c.209 = c;
  c = c.209 + 1;
  D.12208 = (long unsigned int) c.209;
  D.12209 = D.12208 * 8;
  D.12210 = methods + D.12209;
  *D.12210 = cd;
  cd = cd->next;
  <D.9429>:
  if (cd != 0B) goto <D.9428>; else goto <D.9430>;
  <D.9430>:
  i = i + 1;
  <D.9432>:
  if (i <= 9370) goto <D.9431>; else goto <D.9433>;
  <D.9433>:
  num_methods.208 = num_methods;
  D.12211 = (long unsigned int) num_methods.208;
  qsort (methods, D.12211, 8, compare_method);
  i = 0;
  goto <D.9438>;
  <D.9437>:
  {
    uint64_t msecs;
    uint64_t smsecs;

    D.12212 = (long unsigned int) i;
    D.12213 = D.12212 * 8;
    D.12214 = methods + D.12213;
    cd = *D.12214;
    D.12215 = cd->calls;
    if (D.12215 == 0) goto <D.12216>; else goto <D.12217>;
    <D.12216>:
    // predicted unlikely by continue predictor.
    goto <D.9436>;
    <D.12217>:
    D.12215 = cd->calls;
    calls = D.12215 + calls;
    D.12218 = cd->total_time;
    msecs = D.12218 / 1000000;
    D.12218 = cd->total_time;
    D.12205 = cd->callee_time;
    D.12219 = D.12218 - D.12205;
    smsecs = D.12219 / 1000000;
    if (msecs == 0) goto <D.12220>; else goto <D.12221>;
    <D.12220>:
    verbose.210 = verbose;
    if (verbose.210 == 0) goto <D.12223>; else goto <D.12224>;
    <D.12223>:
    // predicted unlikely by continue predictor.
    goto <D.9436>;
    <D.12224>:
    <D.12221>:
    header_done.211 = header_done;
    header_done = header_done.211 + 1;
    if (header_done.211 == 0) goto <D.12226>; else goto <D.12227>;
    <D.12226>:
    outfile.212 = outfile;
    fprintf (outfile.212, "\nMethod call summary\n");
    outfile.212 = outfile;
    fprintf (outfile.212, "%8s %8s %10s Method name\n", "Total(ms)", "Self(ms)", "Calls");
    <D.12227>:
    D.12229 = cd->name;
    D.12215 = cd->calls;
    outfile.212 = outfile;
    fprintf (outfile.212, "%8llu %8llu %10llu %s\n", msecs, smsecs, D.12215, D.12229);
    D.12230 = &cd->traces;
    dump_traces (D.12230, "calls");
  }
  <D.9436>:
  i = i + 1;
  <D.9438>:
  num_methods.208 = num_methods;
  if (i < num_methods.208) goto <D.9437>; else goto <D.9439>;
  <D.9439>:
  if (calls != 0) goto <D.12231>; else goto <D.12232>;
  <D.12231>:
  outfile.212 = outfile;
  fprintf (outfile.212, "Total calls: %llu\n", calls);
  <D.12232>:
}


compare_method (const void * a, const void * b)
{
  int method_sort_mode.213;
  struct MethodDesc * D.12236;
  struct MethodDesc * D.12237;
  int D.12244;
  struct MethodDesc * const * A;
  struct MethodDesc * const * B;
  uint64_t vala;
  uint64_t valb;

  A = a;
  B = b;
  method_sort_mode.213 = method_sort_mode;
  if (method_sort_mode.213 == 1) goto <D.12234>; else goto <D.12235>;
  <D.12234>:
  D.12236 = *A;
  vala = D.12236->self_time;
  D.12237 = *B;
  valb = D.12237->self_time;
  goto <D.12238>;
  <D.12235>:
  method_sort_mode.213 = method_sort_mode;
  if (method_sort_mode.213 == 2) goto <D.12239>; else goto <D.12240>;
  <D.12239>:
  D.12236 = *A;
  vala = D.12236->calls;
  D.12237 = *B;
  valb = D.12237->calls;
  goto <D.12241>;
  <D.12240>:
  D.12236 = *A;
  vala = D.12236->total_time;
  D.12237 = *B;
  valb = D.12237->total_time;
  <D.12241>:
  <D.12238>:
  if (vala == valb) goto <D.12242>; else goto <D.12243>;
  <D.12242>:
  D.12244 = 0;
  return D.12244;
  <D.12243>:
  if (valb < vala) goto <D.12245>; else goto <D.12246>;
  <D.12245>:
  D.12244 = -1;
  return D.12244;
  <D.12246>:
  D.12244 = 1;
  return D.12244;
}


dump_metadata ()
{
  struct FILE * outfile.214;
  int num_images.215;
  int verbose.216;
  char * D.12253;

  outfile.214 = outfile;
  fprintf (outfile.214, "\nMetadata summary\n");
  num_images.215 = num_images;
  outfile.214 = outfile;
  fprintf (outfile.214, "\tLoaded images: %d\n", num_images.215);
  verbose.216 = verbose;
  if (verbose.216 != 0) goto <D.12251>; else goto <D.12252>;
  <D.12251>:
  {
    struct ImageDesc * image;
    int i;

    i = 0;
    goto <D.9417>;
    <D.9416>:
    image = image_hash[i];
    goto <D.9414>;
    <D.9413>:
    D.12253 = image->filename;
    outfile.214 = outfile;
    fprintf (outfile.214, "\t\t%s\n", D.12253);
    image = image->next;
    <D.9414>:
    if (image != 0B) goto <D.9413>; else goto <D.9415>;
    <D.9415>:
    i = i + 1;
    <D.9417>:
    if (i <= 30) goto <D.9416>; else goto <D.9418>;
    <D.9418>:
  }
  <D.12252>:
}


dump_exceptions ()
{
  struct FILE * outfile.217;
  long unsigned int throw_count.218;
  long unsigned int D.12256;
  const char * D.12259;
  int i;

  outfile.217 = outfile;
  fprintf (outfile.217, "\nException summary\n");
  throw_count.218 = throw_count;
  outfile.217 = outfile;
  fprintf (outfile.217, "\tThrows: %llu\n", throw_count.218);
  dump_traces (&exc_traces, "throws");
  i = 0;
  goto <D.9324>;
  <D.9323>:
  D.12256 = clause_summary[i];
  if (D.12256 == 0) goto <D.12257>; else goto <D.12258>;
  <D.12257>:
  // predicted unlikely by continue predictor.
  goto <D.9322>;
  <D.12258>:
  D.12256 = clause_summary[i];
  D.12259 = clause_name (i);
  outfile.217 = outfile;
  fprintf (outfile.217, "\tExecuted %s clauses: %llu\n", D.12259, D.12256);
  <D.9322>:
  i = i + 1;
  <D.9324>:
  if (i <= 4) goto <D.9323>; else goto <D.9325>;
  <D.9325>:
}


dump_monitors ()
{
  int num_monitors.219;
  long unsigned int D.12264;
  long unsigned int D.12265;
  int j.220;
  long unsigned int D.12267;
  long unsigned int D.12268;
  struct MonitorDesc * * D.12269;
  long unsigned int D.12270;
  struct FILE * outfile.221;
  long unsigned int D.12272;
  long unsigned int D.12273;
  struct MonitorDesc * * D.12274;
  long unsigned int D.12275;
  int D.12276;
  long unsigned int D.12277;
  void * D.12278;
  long unsigned int D.12279;
  double D.12280;
  double D.12281;
  double D.12282;
  double D.12283;
  long unsigned int D.12284;
  double D.12285;
  double D.12286;
  struct TraceDesc * D.12287;
  long unsigned int monitor_contention.222;
  long unsigned int monitor_acquired.223;
  long unsigned int monitor_failed.224;
  struct MonitorDesc * * monitors;
  int i;
  int j;

  num_monitors.219 = num_monitors;
  if (num_monitors.219 == 0) goto <D.12262>; else goto <D.12263>;
  <D.12262>:
  return;
  <D.12263>:
  num_monitors.219 = num_monitors;
  D.12264 = (long unsigned int) num_monitors.219;
  D.12265 = D.12264 * 8;
  monitors = malloc (D.12265);
  i = 0;
  j = 0;
  goto <D.9343>;
  <D.9342>:
  {
    struct MonitorDesc * mdesc;

    mdesc = monitor_hash[i];
    goto <D.9340>;
    <D.9339>:
    j.220 = j;
    j = j.220 + 1;
    D.12267 = (long unsigned int) j.220;
    D.12268 = D.12267 * 8;
    D.12269 = monitors + D.12268;
    *D.12269 = mdesc;
    mdesc = mdesc->next;
    <D.9340>:
    if (mdesc != 0B) goto <D.9339>; else goto <D.9341>;
    <D.9341>:
  }
  i = i + 1;
  <D.9343>:
  if (i <= 30) goto <D.9342>; else goto <D.9344>;
  <D.9344>:
  num_monitors.219 = num_monitors;
  D.12270 = (long unsigned int) num_monitors.219;
  qsort (monitors, D.12270, 8, compare_monitor);
  outfile.221 = outfile;
  fprintf (outfile.221, "\nMonitor lock summary\n");
  i = 0;
  goto <D.9347>;
  <D.9346>:
  {
    struct MonitorDesc * mdesc;

    D.12272 = (long unsigned int) i;
    D.12273 = D.12272 * 8;
    D.12274 = monitors + D.12273;
    mdesc = *D.12274;
    D.12275 = mdesc->contentions;
    D.12276 = (int) D.12275;
    D.12277 = mdesc->objid;
    D.12278 = (void *) D.12277;
    outfile.221 = outfile;
    fprintf (outfile.221, "\tLock object %p: %d contentions\n", D.12278, D.12276);
    D.12279 = mdesc->wait_time;
    D.12280 = (double) D.12279;
    D.12281 = D.12280 / 1.0e+9;
    D.12275 = mdesc->contentions;
    D.12282 = (double) D.12275;
    D.12283 = D.12281 / D.12282;
    D.12284 = mdesc->max_wait_time;
    D.12285 = (double) D.12284;
    D.12286 = D.12285 / 1.0e+9;
    D.12279 = mdesc->wait_time;
    D.12280 = (double) D.12279;
    D.12281 = D.12280 / 1.0e+9;
    outfile.221 = outfile;
    fprintf (outfile.221, "\t\t%.6f secs total wait time, %.6f max, %.6f average\n", D.12281, D.12286, D.12283);
    D.12287 = &mdesc->traces;
    dump_traces (D.12287, "contentions");
  }
  i = i + 1;
  <D.9347>:
  num_monitors.219 = num_monitors;
  if (i < num_monitors.219) goto <D.9346>; else goto <D.9348>;
  <D.9348>:
  monitor_contention.222 = monitor_contention;
  outfile.221 = outfile;
  fprintf (outfile.221, "\tLock contentions: %llu\n", monitor_contention.222);
  monitor_acquired.223 = monitor_acquired;
  outfile.221 = outfile;
  fprintf (outfile.221, "\tLock acquired: %llu\n", monitor_acquired.223);
  monitor_failed.224 = monitor_failed;
  outfile.221 = outfile;
  fprintf (outfile.221, "\tLock failures: %llu\n", monitor_failed.224);
}


compare_monitor (const void * a, const void * b)
{
  struct MonitorDesc * D.12292;
  long unsigned int D.12293;
  struct MonitorDesc * D.12294;
  long unsigned int D.12295;
  int D.12298;
  struct MonitorDesc * const * A;
  struct MonitorDesc * const * B;

  A = a;
  B = b;
  D.12292 = *B;
  D.12293 = D.12292->wait_time;
  D.12294 = *A;
  D.12295 = D.12294->wait_time;
  if (D.12293 == D.12295) goto <D.12296>; else goto <D.12297>;
  <D.12296>:
  D.12298 = 0;
  return D.12298;
  <D.12297>:
  D.12292 = *B;
  D.12293 = D.12292->wait_time;
  D.12294 = *A;
  D.12295 = D.12294->wait_time;
  if (D.12293 < D.12295) goto <D.12299>; else goto <D.12300>;
  <D.12299>:
  D.12298 = -1;
  return D.12298;
  <D.12300>:
  D.12298 = 1;
  return D.12298;
}


dump_heap_shots ()
{
  struct HeapShot * heap_shots.225;
  int num_heap_shots.226;
  long unsigned int D.12306;
  long unsigned int D.12307;
  struct FILE * outfile.227;
  int i.228;
  long unsigned int D.12310;
  long unsigned int D.12311;
  struct HeapShot * * D.12312;
  long unsigned int D.12313;
  long unsigned int D.12314;
  long unsigned int D.12315;
  struct HeapShot * * D.12316;
  struct HeapShot * * hs_sorted;
  struct HeapShot * hs;
  struct HeapShot * last_hs;
  int i;

  last_hs = 0B;
  heap_shots.225 = heap_shots;
  if (heap_shots.225 == 0B) goto <D.12303>; else goto <D.12304>;
  <D.12303>:
  return;
  <D.12304>:
  num_heap_shots.226 = num_heap_shots;
  D.12306 = (long unsigned int) num_heap_shots.226;
  D.12307 = D.12306 * 8;
  hs_sorted = malloc (D.12307);
  outfile.227 = outfile;
  fprintf (outfile.227, "\nHeap shot summary\n");
  i = 0;
  hs = heap_shots;
  goto <D.9506>;
  <D.9505>:
  i.228 = i;
  i = i.228 + 1;
  D.12310 = (long unsigned int) i.228;
  D.12311 = D.12310 * 8;
  D.12312 = hs_sorted + D.12311;
  *D.12312 = hs;
  hs = hs->next;
  <D.9506>:
  if (hs != 0B) goto <D.9505>; else goto <D.9507>;
  <D.9507>:
  num_heap_shots.226 = num_heap_shots;
  D.12313 = (long unsigned int) num_heap_shots.226;
  qsort (hs_sorted, D.12313, 8, compare_heap_shots);
  i = 0;
  goto <D.9509>;
  <D.9508>:
  D.12314 = (long unsigned int) i;
  D.12315 = D.12314 * 8;
  D.12316 = hs_sorted + D.12315;
  hs = *D.12316;
  heap_shot_summary (hs, i, last_hs);
  last_hs = hs;
  i = i + 1;
  <D.9509>:
  num_heap_shots.226 = num_heap_shots;
  if (i < num_heap_shots.226) goto <D.9508>; else goto <D.9510>;
  <D.9510>:
}


compare_heap_shots (const void * a, const void * b)
{
  struct HeapShot * D.12318;
  long unsigned int D.12319;
  struct HeapShot * D.12320;
  long unsigned int D.12321;
  int D.12324;
  struct HeapShot * const * A;
  struct HeapShot * const * B;

  A = a;
  B = b;
  D.12318 = *B;
  D.12319 = D.12318->timestamp;
  D.12320 = *A;
  D.12321 = D.12320->timestamp;
  if (D.12319 == D.12321) goto <D.12322>; else goto <D.12323>;
  <D.12322>:
  D.12324 = 0;
  return D.12324;
  <D.12323>:
  D.12318 = *B;
  D.12319 = D.12318->timestamp;
  D.12320 = *A;
  D.12321 = D.12320->timestamp;
  if (D.12319 > D.12321) goto <D.12325>; else goto <D.12326>;
  <D.12325>:
  D.12324 = -1;
  return D.12324;
  <D.12326>:
  D.12324 = 1;
  return D.12324;
}


heap_shot_summary (struct HeapShot * hs, int hs_num, struct HeapShot * last_hs)
{
  int D.12328;
  long unsigned int D.12329;
  long unsigned int D.12330;
  struct HeapClassDesc * * D.12331;
  long unsigned int D.12332;
  long unsigned int D.12333;
  struct HeapClassDesc * * D.12334;
  long int D.12337;
  long unsigned int D.12338;
  long int D.12339;
  long unsigned int D.12340;
  int ccount.229;
  long unsigned int D.12342;
  long unsigned int D.12343;
  struct HeapClassDesc * * D.12344;
  int D.12345;
  long unsigned int D.12346;
  long unsigned int D.12347;
  long unsigned int D.12348;
  long unsigned int startup_time.230;
  long unsigned int D.12350;
  double D.12351;
  double D.12352;
  struct FILE * outfile.231;
  int verbose.232;
  struct HeapClassDesc * * D.12359;
  struct ClassDesc * D.12362;
  char * D.12363;
  long int D.12364;
  long int D.12367;
  long int D.12368;
  int collect_traces.233;
  int D.12373;
  long unsigned int D.12374;
  long unsigned int D.12375;
  struct HeapClassRevRef * D.12376;
  long unsigned int D.12377;
  long unsigned int D.12378;
  struct HeapClassRevRef * D.12379;
  struct HeapClassDesc * D.12380;
  int k.234;
  long unsigned int D.12384;
  long unsigned int D.12385;
  struct HeapClassRevRef * D.12386;
  int D.12387;
  long unsigned int D.12390;
  long unsigned int D.12391;
  long unsigned int D.12394;
  uint64_t size;
  uint64_t count;
  int ccount;
  int i;
  struct HeapClassDesc * cd;
  struct HeapClassDesc * * sorted;
  static const char __PRETTY_FUNCTION__[18] = "heap_shot_summary";

  size = 0;
  count = 0;
  ccount = 0;
  D.12328 = hs->class_count;
  D.12329 = (long unsigned int) D.12328;
  D.12330 = D.12329 * 8;
  sorted = malloc (D.12330);
  i = 0;
  goto <D.9476>;
  <D.9475>:
  D.12331 = hs->class_hash;
  D.12332 = (long unsigned int) i;
  D.12333 = D.12332 * 8;
  D.12334 = D.12331 + D.12333;
  cd = *D.12334;
  if (cd == 0B) goto <D.12335>; else goto <D.12336>;
  <D.12335>:
  // predicted unlikely by continue predictor.
  goto <D.9474>;
  <D.12336>:
  D.12337 = cd->count;
  D.12338 = (long unsigned int) D.12337;
  count = D.12338 + count;
  D.12339 = cd->total_size;
  D.12340 = (long unsigned int) D.12339;
  size = D.12340 + size;
  ccount.229 = ccount;
  ccount = ccount.229 + 1;
  D.12342 = (long unsigned int) ccount.229;
  D.12343 = D.12342 * 8;
  D.12344 = sorted + D.12343;
  *D.12344 = cd;
  <D.9474>:
  i = i + 1;
  <D.9476>:
  D.12345 = hs->hash_size;
  if (D.12345 > i) goto <D.9475>; else goto <D.9477>;
  <D.9477>:
  hs->sorted = sorted;
  D.12346 = (long unsigned int) ccount;
  qsort (sorted, D.12346, 8, compare_heap_class);
  D.12347 = hs->num_roots;
  D.12348 = hs->timestamp;
  startup_time.230 = startup_time;
  D.12350 = D.12348 - startup_time.230;
  D.12351 = (double) D.12350;
  D.12352 = D.12351 / 1.0e+9;
  outfile.231 = outfile;
  fprintf (outfile.231, "\n\tHeap shot %d at %.3f secs: size: %llu, object count: %llu, class count: %d, roots: %d\n", hs_num, D.12352, size, count, ccount, D.12347);
  verbose.232 = verbose;
  if (verbose.232 == 0) goto <D.12355>; else goto <D.12356>;
  <D.12355>:
  if (ccount > 30) goto <D.12357>; else goto <D.12358>;
  <D.12357>:
  ccount = 30;
  <D.12358>:
  <D.12356>:
  outfile.231 = outfile;
  fprintf (outfile.231, "\t%10s %10s %8s Class name\n", "Bytes", "Count", "Average");
  i = 0;
  goto <D.9490>;
  <D.9489>:
  {
    struct HeapClassRevRef * rev_sorted;
    int j;
    int k;
    struct HeapClassDesc * ocd;

    ocd = 0B;
    D.12332 = (long unsigned int) i;
    D.12333 = D.12332 * 8;
    D.12359 = sorted + D.12333;
    cd = *D.12359;
    if (last_hs != 0B) goto <D.12360>; else goto <D.12361>;
    <D.12360>:
    D.12362 = cd->klass;
    ocd = heap_class_lookup (last_hs, D.12362);
    <D.12361>:
    D.12362 = cd->klass;
    D.12363 = D.12362->name;
    D.12339 = cd->total_size;
    D.12337 = cd->count;
    D.12364 = D.12339 / D.12337;
    D.12337 = cd->count;
    D.12339 = cd->total_size;
    outfile.231 = outfile;
    fprintf (outfile.231, "\t%10llu %10llu %8llu %s", D.12339, D.12337, D.12364, D.12363);
    if (ocd != 0B) goto <D.12365>; else goto <D.12366>;
    <D.12365>:
    {
      int64_t bdiff;
      int64_t cdiff;

      D.12339 = cd->total_size;
      D.12367 = ocd->total_size;
      bdiff = D.12339 - D.12367;
      D.12337 = cd->count;
      D.12368 = ocd->count;
      cdiff = D.12337 - D.12368;
      outfile.231 = outfile;
      fprintf (outfile.231, " (bytes: %+lld, count: %+lld)\n", bdiff, cdiff);
    }
    goto <D.12369>;
    <D.12366>:
    outfile.231 = outfile;
    fprintf (outfile.231, "\n");
    <D.12369>:
    collect_traces.233 = collect_traces;
    if (collect_traces.233 == 0) goto <D.12371>; else goto <D.12372>;
    <D.12371>:
    // predicted unlikely by continue predictor.
    goto <D.9484>;
    <D.12372>:
    D.12373 = cd->rev_count;
    D.12374 = (long unsigned int) D.12373;
    D.12375 = D.12374 * 16;
    rev_sorted = malloc (D.12375);
    k = 0;
    j = 0;
    goto <D.9486>;
    <D.9485>:
    D.12376 = cd->rev_hash;
    D.12377 = (long unsigned int) j;
    D.12378 = D.12377 * 16;
    D.12379 = D.12376 + D.12378;
    D.12380 = D.12379->klass;
    if (D.12380 != 0B) goto <D.12381>; else goto <D.12382>;
    <D.12381>:
    k.234 = k;
    k = k.234 + 1;
    D.12384 = (long unsigned int) k.234;
    D.12385 = D.12384 * 16;
    D.12386 = rev_sorted + D.12385;
    D.12376 = cd->rev_hash;
    D.12377 = (long unsigned int) j;
    D.12378 = D.12377 * 16;
    D.12379 = D.12376 + D.12378;
    *D.12386 = *D.12379;
    <D.12382>:
    j = j + 1;
    <D.9486>:
    D.12387 = cd->rev_hash_size;
    if (D.12387 > j) goto <D.9485>; else goto <D.9487>;
    <D.9487>:
    D.12373 = cd->rev_count;
    if (D.12373 != k) goto <D.12388>; else goto <D.12389>;
    <D.12388>:
    __assert_fail ("cd->rev_count == k", "decode.c", 2416, &__PRETTY_FUNCTION__);
    <D.12389>:
    D.12373 = cd->rev_count;
    D.12390 = (long unsigned int) D.12373;
    qsort (rev_sorted, D.12390, 16, compare_rev_class);
    D.12391 = cd->root_references;
    if (D.12391 != 0) goto <D.12392>; else goto <D.12393>;
    <D.12392>:
    D.12394 = cd->pinned_references;
    D.12391 = cd->root_references;
    outfile.231 = outfile;
    fprintf (outfile.231, "\t\t%d root references (%d pinning)\n", D.12391, D.12394);
    <D.12393>:
    D.12373 = cd->rev_count;
    dump_rev_claases (rev_sorted, D.12373);
    free (rev_sorted);
  }
  <D.9484>:
  i = i + 1;
  <D.9490>:
  if (i < ccount) goto <D.9489>; else goto <D.9491>;
  <D.9491>:
  free (sorted);
}


compare_rev_class (const void * a, const void * b)
{
  long unsigned int D.12396;
  long unsigned int D.12397;
  int D.12400;
  const struct HeapClassRevRef * A;
  const struct HeapClassRevRef * B;

  A = a;
  B = b;
  D.12396 = B->count;
  D.12397 = A->count;
  if (D.12396 == D.12397) goto <D.12398>; else goto <D.12399>;
  <D.12398>:
  D.12400 = 0;
  return D.12400;
  <D.12399>:
  D.12396 = B->count;
  D.12397 = A->count;
  if (D.12396 < D.12397) goto <D.12401>; else goto <D.12402>;
  <D.12401>:
  D.12400 = -1;
  return D.12400;
  <D.12402>:
  D.12400 = 1;
  return D.12400;
}


compare_heap_class (const void * a, const void * b)
{
  int alloc_sort_mode.235;
  struct HeapClassDesc * D.12407;
  long int D.12408;
  struct HeapClassDesc * D.12409;
  long int D.12410;
  long int D.12412;
  long int D.12413;
  int D.12416;
  struct HeapClassDesc * const * A;
  struct HeapClassDesc * const * B;
  uint64_t vala;
  uint64_t valb;

  A = a;
  B = b;
  alloc_sort_mode.235 = alloc_sort_mode;
  if (alloc_sort_mode.235 == 0) goto <D.12405>; else goto <D.12406>;
  <D.12405>:
  D.12407 = *A;
  D.12408 = D.12407->total_size;
  vala = (uint64_t) D.12408;
  D.12409 = *B;
  D.12410 = D.12409->total_size;
  valb = (uint64_t) D.12410;
  goto <D.12411>;
  <D.12406>:
  D.12407 = *A;
  D.12412 = D.12407->count;
  vala = (uint64_t) D.12412;
  D.12409 = *B;
  D.12413 = D.12409->count;
  valb = (uint64_t) D.12413;
  <D.12411>:
  if (valb == vala) goto <D.12414>; else goto <D.12415>;
  <D.12414>:
  D.12416 = 0;
  return D.12416;
  <D.12415>:
  if (valb < vala) goto <D.12417>; else goto <D.12418>;
  <D.12417>:
  D.12416 = -1;
  return D.12416;
  <D.12418>:
  D.12416 = 1;
  return D.12416;
}


heap_class_lookup (struct HeapShot * hs, struct ClassDesc * klass)
{
  long int D.12420;
  long unsigned int D.12421;
  long unsigned int D.12422;
  int D.12423;
  long unsigned int D.12424;
  long unsigned int D.12425;
  struct HeapClassDesc * * D.12426;
  long unsigned int D.12427;
  long unsigned int D.12428;
  struct HeapClassDesc * * D.12429;
  struct HeapClassDesc * D.12432;
  struct ClassDesc * D.12433;
  unsigned int i.236;
  int i;
  unsigned int start_pos;

  D.12420 = klass->klass;
  D.12421 = (long unsigned int) D.12420;
  D.12422 = D.12421 >> 2;
  D.12423 = hs->hash_size;
  D.12424 = (long unsigned int) D.12423;
  D.12425 = D.12422 % D.12424;
  start_pos = (unsigned int) D.12425;
  i = (int) start_pos;
  <D.8663>:
  {
    struct HeapClassDesc * cd;

    D.12426 = hs->class_hash;
    D.12427 = (long unsigned int) i;
    D.12428 = D.12427 * 8;
    D.12429 = D.12426 + D.12428;
    cd = *D.12429;
    if (cd == 0B) goto <D.12430>; else goto <D.12431>;
    <D.12430>:
    D.12432 = 0B;
    return D.12432;
    <D.12431>:
    D.12433 = cd->klass;
    if (D.12433 == klass) goto <D.12434>; else goto <D.12435>;
    <D.12434>:
    D.12432 = cd;
    return D.12432;
    <D.12435>:
    i = i + 1;
    D.12423 = hs->hash_size;
    if (i == D.12423) goto <D.12436>; else goto <D.12437>;
    <D.12436>:
    i = 0;
    <D.12437>:
  }
  i.236 = (unsigned int) i;
  if (i.236 != start_pos) goto <D.8663>; else goto <D.8664>;
  <D.8664>:
  D.12432 = 0B;
  return D.12432;
}


dump_rev_claases (struct HeapClassRevRef * revs, int count)
{
  int show_traces.237;
  long unsigned int D.12445;
  long unsigned int D.12446;
  struct HeapClassRevRef * D.12447;
  struct ClassDesc * D.12448;
  char * D.12449;
  long unsigned int D.12450;
  struct FILE * outfile.238;
  int j;

  show_traces.237 = show_traces;
  if (show_traces.237 == 0) goto <D.12441>; else goto <D.12442>;
  <D.12441>:
  return;
  <D.12442>:
  if (count == 0) goto <D.12443>; else goto <D.12444>;
  <D.12443>:
  return;
  <D.12444>:
  j = 0;
  goto <D.9461>;
  <D.9460>:
  {
    struct HeapClassDesc * cd;

    D.12445 = (long unsigned int) j;
    D.12446 = D.12445 * 16;
    D.12447 = revs + D.12446;
    cd = D.12447->klass;
    D.12448 = cd->klass;
    D.12449 = D.12448->name;
    D.12445 = (long unsigned int) j;
    D.12446 = D.12445 * 16;
    D.12447 = revs + D.12446;
    D.12450 = D.12447->count;
    outfile.238 = outfile;
    fprintf (outfile.238, "\t\t%llu references from: %s\n", D.12450, D.12449);
  }
  j = j + 1;
  <D.9461>:
  if (j < count) goto <D.9460>; else goto <D.9462>;
  <D.9462>:
}


match_option (const char * p, const char * opt)
{
  long unsigned int D.12453;
  long unsigned int D.12454;
  int D.12455;
  sizetype D.12458;
  const char * D.12459;
  char D.12460;
  const char * D.12463;
  int len;

  D.12453 = strlen (opt);
  len = (int) D.12453;
  D.12454 = (long unsigned int) len;
  D.12455 = strncmp (p, opt, D.12454);
  if (D.12455 == 0) goto <D.12456>; else goto <D.12457>;
  <D.12456>:
  D.12458 = (sizetype) len;
  D.12459 = p + D.12458;
  D.12460 = *D.12459;
  if (D.12460 == 44) goto <D.12461>; else goto <D.12462>;
  <D.12461>:
  len = len + 1;
  <D.12462>:
  D.12458 = (sizetype) len;
  D.12463 = p + D.12458;
  return D.12463;
  <D.12457>:
  D.12463 = p;
  return D.12463;
}


dump_samples ()
{
  int num_stat_samples.239;
  int usymbols_num.240;
  long unsigned int D.12469;
  struct UnmanagedSymbol * * usymbols.241;
  uintptr_t * stat_samples.242;
  long unsigned int D.12472;
  long unsigned int D.12473;
  uintptr_t * D.12474;
  long unsigned int D.12475;
  int D.12478;
  long unsigned int D.12485;
  long unsigned int D.12486;
  int count.243;
  long unsigned int D.12488;
  long unsigned int D.12489;
  struct MethodDesc * * D.12490;
  int D.12491;
  long unsigned int D.12497;
  long unsigned int D.12504;
  long unsigned int D.12505;
  int ucount.244;
  long unsigned int D.12507;
  long unsigned int D.12508;
  struct UnmanagedSymbol * * D.12509;
  long unsigned int D.12510;
  long unsigned int D.12511;
  long unsigned int D.12512;
  struct FILE * outfile.245;
  int * stat_sample_desc.246;
  int D.12515;
  const char * D.12516;
  double D.12517;
  double D.12518;
  double D.12519;
  double D.12520;
  int D.12521;
  double D.12522;
  double D.12523;
  double D.12524;
  double D.12525;
  double D.12526;
  double D.12527;
  struct MethodDesc * * D.12530;
  long unsigned int D.12533;
  long unsigned int D.12534;
  struct UnmanagedSymbol * * D.12535;
  long unsigned int D.12536;
  int D.12537;
  long unsigned int D.12538;
  int D.12541;
  int D.12543;
  char * D.12545;
  double D.12546;
  double D.12547;
  double D.12548;
  long unsigned int D.12551;
  int D.12552;
  _Bool D.12554;
  _Bool D.12555;
  _Bool D.12556;
  int i;
  int u;
  int count;
  int msize;
  int unmanaged_hits;
  int unresolved_hits;
  struct MethodDesc * * cachedm;
  int ucount;
  int usize;
  struct UnmanagedSymbol * * cachedus;

  count = 0;
  msize = 0;
  unmanaged_hits = 0;
  unresolved_hits = 0;
  cachedm = 0B;
  ucount = 0;
  usize = 0;
  cachedus = 0B;
  num_stat_samples.239 = num_stat_samples;
  if (num_stat_samples.239 == 0) goto <D.12466>; else goto <D.12467>;
  <D.12466>:
  return;
  <D.12467>:
  usymbols_num.240 = usymbols_num;
  D.12469 = (long unsigned int) usymbols_num.240;
  usymbols.241 = usymbols;
  qsort (usymbols.241, D.12469, 8, compare_usymbol_addr);
  i = 0;
  goto <D.8583>;
  <D.8582>:
  {
    struct MethodDesc * m;

    stat_samples.242 = stat_samples;
    D.12472 = (long unsigned int) i;
    D.12473 = D.12472 * 8;
    D.12474 = stat_samples.242 + D.12473;
    D.12475 = *D.12474;
    m = lookup_method_by_ip (D.12475);
    if (m != 0B) goto <D.12476>; else goto <D.12477>;
    <D.12476>:
    D.12478 = m->sample_hits;
    if (D.12478 == 0) goto <D.12479>; else goto <D.12480>;
    <D.12479>:
    if (count == msize) goto <D.12481>; else goto <D.12482>;
    <D.12481>:
    msize = msize * 2;
    if (msize == 0) goto <D.12483>; else goto <D.12484>;
    <D.12483>:
    msize = 4;
    <D.12484>:
    D.12485 = (long unsigned int) msize;
    D.12486 = D.12485 * 8;
    cachedm = realloc (cachedm, D.12486);
    <D.12482>:
    count.243 = count;
    count = count.243 + 1;
    D.12488 = (long unsigned int) count.243;
    D.12489 = D.12488 * 8;
    D.12490 = cachedm + D.12489;
    *D.12490 = m;
    <D.12480>:
    D.12478 = m->sample_hits;
    D.12491 = D.12478 + 1;
    m->sample_hits = D.12491;
    goto <D.12492>;
    <D.12477>:
    {
      struct UnmanagedSymbol * usym;

      stat_samples.242 = stat_samples;
      D.12472 = (long unsigned int) i;
      D.12473 = D.12472 * 8;
      D.12474 = stat_samples.242 + D.12473;
      D.12475 = *D.12474;
      usym = lookup_unmanaged_symbol (D.12475);
      if (usym == 0B) goto <D.12493>; else goto <D.12494>;
      <D.12493>:
      unresolved_hits = unresolved_hits + 1;
      stat_samples.242 = stat_samples;
      D.12472 = (long unsigned int) i;
      D.12473 = D.12472 * 8;
      D.12474 = stat_samples.242 + D.12473;
      D.12475 = *D.12474;
      usym = lookup_unmanaged_binary (D.12475);
      <D.12494>:
      if (usym != 0B) goto <D.12495>; else goto <D.12496>;
      <D.12495>:
      D.12497 = usym->sample_hits;
      if (D.12497 == 0) goto <D.12498>; else goto <D.12499>;
      <D.12498>:
      if (ucount == usize) goto <D.12500>; else goto <D.12501>;
      <D.12500>:
      usize = usize * 2;
      if (usize == 0) goto <D.12502>; else goto <D.12503>;
      <D.12502>:
      usize = 4;
      <D.12503>:
      D.12504 = (long unsigned int) usize;
      D.12505 = D.12504 * 8;
      cachedus = realloc (cachedus, D.12505);
      <D.12501>:
      ucount.244 = ucount;
      ucount = ucount.244 + 1;
      D.12507 = (long unsigned int) ucount.244;
      D.12508 = D.12507 * 8;
      D.12509 = cachedus + D.12508;
      *D.12509 = usym;
      <D.12499>:
      D.12497 = usym->sample_hits;
      D.12510 = D.12497 + 1;
      usym->sample_hits = D.12510;
      <D.12496>:
      unmanaged_hits = unmanaged_hits + 1;
    }
    <D.12492>:
  }
  i = i + 1;
  <D.8583>:
  num_stat_samples.239 = num_stat_samples;
  if (i < num_stat_samples.239) goto <D.8582>; else goto <D.8584>;
  <D.8584>:
  D.12511 = (long unsigned int) count;
  qsort (cachedm, D.12511, 8, compare_method_samples);
  D.12512 = (long unsigned int) ucount;
  qsort (cachedus, D.12512, 8, compare_usymbol_samples);
  set_usym_parent (cachedus, ucount);
  outfile.245 = outfile;
  fprintf (outfile.245, "\nStatistical samples summary\n");
  stat_sample_desc.246 = stat_sample_desc;
  D.12515 = *stat_sample_desc.246;
  D.12516 = sample_type_name (D.12515);
  outfile.245 = outfile;
  fprintf (outfile.245, "\tSample type: %s\n", D.12516);
  D.12517 = (double) unmanaged_hits;
  D.12518 = D.12517 * 1.0e+2;
  num_stat_samples.239 = num_stat_samples;
  D.12519 = (double) num_stat_samples.239;
  D.12520 = D.12518 / D.12519;
  outfile.245 = outfile;
  fprintf (outfile.245, "\tUnmanaged hits:  %6d (%4.1f%%)\n", unmanaged_hits, D.12520);
  num_stat_samples.239 = num_stat_samples;
  D.12521 = num_stat_samples.239 - unmanaged_hits;
  D.12522 = (double) D.12521;
  D.12523 = D.12522 * 1.0e+2;
  num_stat_samples.239 = num_stat_samples;
  D.12519 = (double) num_stat_samples.239;
  D.12524 = D.12523 / D.12519;
  num_stat_samples.239 = num_stat_samples;
  D.12521 = num_stat_samples.239 - unmanaged_hits;
  outfile.245 = outfile;
  fprintf (outfile.245, "\tManaged hits:    %6d (%4.1f%%)\n", D.12521, D.12524);
  D.12525 = (double) unresolved_hits;
  D.12526 = D.12525 * 1.0e+2;
  num_stat_samples.239 = num_stat_samples;
  D.12519 = (double) num_stat_samples.239;
  D.12527 = D.12526 / D.12519;
  outfile.245 = outfile;
  fprintf (outfile.245, "\tUnresolved hits: %6d (%4.1f%%)\n", unresolved_hits, D.12527);
  outfile.245 = outfile;
  fprintf (outfile.245, "\t%6s %6s %s\n", "Hits", "%", "Method name");
  i = 0;
  u = 0;
  goto <D.8588>;
  <D.8590>:
  if (i < count) goto <D.12528>; else goto <D.12529>;
  <D.12528>:
  {
    struct MethodDesc * m;

    D.12472 = (long unsigned int) i;
    D.12473 = D.12472 * 8;
    D.12530 = cachedm + D.12473;
    m = *D.12530;
    if (u < ucount) goto <D.12531>; else goto <D.12532>;
    <D.12531>:
    {
      struct UnmanagedSymbol * um;

      D.12533 = (long unsigned int) u;
      D.12534 = D.12533 * 8;
      D.12535 = cachedus + D.12534;
      um = *D.12535;
      D.12536 = um->sample_hits;
      D.12537 = m->sample_hits;
      D.12538 = (long unsigned int) D.12537;
      if (D.12536 > D.12538) goto <D.12539>; else goto <D.12540>;
      <D.12539>:
      D.12536 = um->sample_hits;
      D.12541 = sym_percent (D.12536);
      if (D.12541 == 0) goto <D.8587>; else goto <D.12542>;
      <D.12542>:
      print_usym (um);
      u = u + 1;
      // predicted unlikely by continue predictor.
      goto <D.8588>;
      <D.12540>:
    }
    <D.12532>:
    D.12537 = m->sample_hits;
    D.12538 = (long unsigned int) D.12537;
    D.12543 = sym_percent (D.12538);
    if (D.12543 == 0) goto <D.8587>; else goto <D.12544>;
    <D.12544>:
    D.12545 = m->name;
    D.12537 = m->sample_hits;
    D.12546 = (double) D.12537;
    D.12547 = D.12546 * 1.0e+2;
    num_stat_samples.239 = num_stat_samples;
    D.12519 = (double) num_stat_samples.239;
    D.12548 = D.12547 / D.12519;
    D.12537 = m->sample_hits;
    outfile.245 = outfile;
    fprintf (outfile.245, "\t%6d %6.2f %s\n", D.12537, D.12548, D.12545);
    i = i + 1;
    // predicted unlikely by continue predictor.
    goto <D.8588>;
  }
  <D.12529>:
  if (u < ucount) goto <D.12549>; else goto <D.12550>;
  <D.12549>:
  {
    struct UnmanagedSymbol * um;

    D.12533 = (long unsigned int) u;
    D.12534 = D.12533 * 8;
    D.12535 = cachedus + D.12534;
    um = *D.12535;
    D.12551 = um->sample_hits;
    D.12552 = sym_percent (D.12551);
    if (D.12552 == 0) goto <D.8587>; else goto <D.12553>;
    <D.12553>:
    print_usym (um);
    u = u + 1;
    // predicted unlikely by continue predictor.
    goto <D.8588>;
  }
  <D.12550>:
  <D.8588>:
  D.12554 = i < count;
  D.12555 = u < ucount;
  D.12556 = D.12554 | D.12555;
  if (D.12556 != 0) goto <D.8590>; else goto <D.8587>;
  <D.8587>:
}


compare_usymbol_samples (const void * a, const void * b)
{
  struct UnmanagedSymbol * D.12565;
  long unsigned int D.12566;
  struct UnmanagedSymbol * D.12567;
  long unsigned int D.12568;
  int D.12571;
  struct UnmanagedSymbol * const * A;
  struct UnmanagedSymbol * const * B;

  A = a;
  B = b;
  D.12565 = *B;
  D.12566 = D.12565->sample_hits;
  D.12567 = *A;
  D.12568 = D.12567->sample_hits;
  if (D.12566 == D.12568) goto <D.12569>; else goto <D.12570>;
  <D.12569>:
  D.12571 = 0;
  return D.12571;
  <D.12570>:
  D.12565 = *B;
  D.12566 = D.12565->sample_hits;
  D.12567 = *A;
  D.12568 = D.12567->sample_hits;
  if (D.12566 < D.12568) goto <D.12572>; else goto <D.12573>;
  <D.12572>:
  D.12571 = -1;
  return D.12571;
  <D.12573>:
  D.12571 = 1;
  return D.12571;
}


compare_method_samples (const void * a, const void * b)
{
  struct MethodDesc * D.12575;
  int D.12576;
  struct MethodDesc * D.12577;
  int D.12578;
  int D.12581;
  struct MethodDesc * const * A;
  struct MethodDesc * const * B;

  A = a;
  B = b;
  D.12575 = *A;
  D.12576 = D.12575->sample_hits;
  D.12577 = *B;
  D.12578 = D.12577->sample_hits;
  if (D.12576 == D.12578) goto <D.12579>; else goto <D.12580>;
  <D.12579>:
  D.12581 = 0;
  return D.12581;
  <D.12580>:
  D.12577 = *B;
  D.12578 = D.12577->sample_hits;
  D.12575 = *A;
  D.12576 = D.12575->sample_hits;
  if (D.12578 < D.12576) goto <D.12582>; else goto <D.12583>;
  <D.12582>:
  D.12581 = -1;
  return D.12581;
  <D.12583>:
  D.12581 = 1;
  return D.12581;
}


compare_usymbol_addr (const void * a, const void * b)
{
  struct UnmanagedSymbol * D.12585;
  long unsigned int D.12586;
  struct UnmanagedSymbol * D.12587;
  long unsigned int D.12588;
  int D.12591;
  struct UnmanagedSymbol * const * A;
  struct UnmanagedSymbol * const * B;

  A = a;
  B = b;
  D.12585 = *B;
  D.12586 = D.12585->addr;
  D.12587 = *A;
  D.12588 = D.12587->addr;
  if (D.12586 == D.12588) goto <D.12589>; else goto <D.12590>;
  <D.12589>:
  D.12591 = 0;
  return D.12591;
  <D.12590>:
  D.12585 = *B;
  D.12586 = D.12585->addr;
  D.12587 = *A;
  D.12588 = D.12587->addr;
  if (D.12586 > D.12588) goto <D.12592>; else goto <D.12593>;
  <D.12592>:
  D.12591 = -1;
  return D.12591;
  <D.12593>:
  D.12591 = 1;
  return D.12591;
}


lookup_method_by_ip (uintptr_t ip)
{
  long int D.12595;
  long unsigned int D.12596;
  int D.12599;
  long unsigned int D.12600;
  long unsigned int D.12601;
  struct MethodDesc * D.12604;
  int i;
  struct MethodDesc * m;

  i = 0;
  goto <D.8474>;
  <D.8473>:
  m = method_hash[i];
  goto <D.8471>;
  <D.8470>:
  D.12595 = m->code;
  D.12596 = (long unsigned int) D.12595;
  if (D.12596 <= ip) goto <D.12597>; else goto <D.12598>;
  <D.12597>:
  D.12595 = m->code;
  D.12596 = (long unsigned int) D.12595;
  D.12599 = m->len;
  D.12600 = (long unsigned int) D.12599;
  D.12601 = D.12596 + D.12600;
  if (D.12601 > ip) goto <D.12602>; else goto <D.12603>;
  <D.12602>:
  D.12604 = m;
  return D.12604;
  <D.12603>:
  <D.12598>:
  m = m->next;
  <D.8471>:
  if (m != 0B) goto <D.8470>; else goto <D.8472>;
  <D.8472>:
  i = i + 1;
  <D.8474>:
  if (i <= 9370) goto <D.8473>; else goto <D.8475>;
  <D.8475>:
  D.12604 = 0B;
  return D.12604;
}


lookup_unmanaged_symbol (uintptr_t addr)
{
  int usymbols_num.247;
  int D.12607;
  struct UnmanagedSymbol * * usymbols.248;
  long unsigned int D.12609;
  long unsigned int D.12610;
  struct UnmanagedSymbol * * D.12611;
  long unsigned int D.12612;
  struct UnmanagedSymbol * D.12615;
  long unsigned int D.12623;
  long unsigned int D.12624;
  struct UnmanagedSymbol * * D.12625;
  struct UnmanagedSymbol * D.12626;
  long unsigned int D.12627;
  long unsigned int D.12628;
  int r;
  int l;
  struct UnmanagedSymbol * sym;
  int last_best;

  usymbols_num.247 = usymbols_num;
  r = usymbols_num.247 + -1;
  l = 0;
  last_best = -1;
  goto <D.8521>;
  <D.8520>:
  {
    int m;

    D.12607 = l + r;
    m = D.12607 / 2;
    usymbols.248 = usymbols;
    D.12609 = (long unsigned int) m;
    D.12610 = D.12609 * 8;
    D.12611 = usymbols.248 + D.12610;
    sym = *D.12611;
    D.12612 = sym->addr;
    if (D.12612 == addr) goto <D.12613>; else goto <D.12614>;
    <D.12613>:
    D.12615 = sym;
    return D.12615;
    <D.12614>:
    D.12612 = sym->addr;
    if (D.12612 > addr) goto <D.12616>; else goto <D.12617>;
    <D.12616>:
    r = m + -1;
    goto <D.12618>;
    <D.12617>:
    D.12612 = sym->addr;
    if (D.12612 < addr) goto <D.12619>; else goto <D.12620>;
    <D.12619>:
    l = m + 1;
    last_best = m;
    <D.12620>:
    <D.12618>:
  }
  <D.8521>:
  if (r >= l) goto <D.8520>; else goto <D.8522>;
  <D.8522>:
  if (last_best >= 0) goto <D.12621>; else goto <D.12622>;
  <D.12621>:
  usymbols.248 = usymbols;
  D.12623 = (long unsigned int) last_best;
  D.12624 = D.12623 * 8;
  D.12625 = usymbols.248 + D.12624;
  D.12626 = *D.12625;
  D.12627 = D.12626->addr;
  D.12628 = addr - D.12627;
  if (D.12628 <= 4095) goto <D.12629>; else goto <D.12630>;
  <D.12629>:
  usymbols.248 = usymbols;
  D.12623 = (long unsigned int) last_best;
  D.12624 = D.12623 * 8;
  D.12625 = usymbols.248 + D.12624;
  D.12615 = *D.12625;
  return D.12615;
  <D.12630>:
  <D.12622>:
  D.12615 = 0B;
  return D.12615;
}


lookup_unmanaged_binary (uintptr_t addr)
{
  struct UnmanagedSymbol * * ubinaries.249;
  long unsigned int D.12633;
  long unsigned int D.12634;
  struct UnmanagedSymbol * * D.12635;
  long unsigned int D.12636;
  long unsigned int D.12639;
  long unsigned int D.12640;
  struct UnmanagedSymbol * D.12643;
  int ubinaries_num.250;
  int i;

  i = 0;
  goto <D.8539>;
  <D.8538>:
  {
    struct UnmanagedSymbol * ubin;

    ubinaries.249 = ubinaries;
    D.12633 = (long unsigned int) i;
    D.12634 = D.12633 * 8;
    D.12635 = ubinaries.249 + D.12634;
    ubin = *D.12635;
    D.12636 = ubin->addr;
    if (D.12636 <= addr) goto <D.12637>; else goto <D.12638>;
    <D.12637>:
    D.12636 = ubin->addr;
    D.12639 = ubin->size;
    D.12640 = D.12636 + D.12639;
    if (D.12640 > addr) goto <D.12641>; else goto <D.12642>;
    <D.12641>:
    D.12643 = ubin;
    return D.12643;
    <D.12642>:
    <D.12638>:
  }
  i = i + 1;
  <D.8539>:
  ubinaries_num.250 = ubinaries_num;
  if (i < ubinaries_num.250) goto <D.8538>; else goto <D.8540>;
  <D.8540>:
  D.12643 = 0B;
  return D.12643;
}


set_usym_parent (struct UnmanagedSymbol * * cachedus, int count)
{
  long unsigned int D.12646;
  long unsigned int D.12647;
  struct UnmanagedSymbol * * D.12648;
  struct UnmanagedSymbol * D.12649;
  long unsigned int D.12650;
  int i;

  i = 0;
  goto <D.8558>;
  <D.8557>:
  {
    struct UnmanagedSymbol * ubin;

    D.12646 = (long unsigned int) i;
    D.12647 = D.12646 * 8;
    D.12648 = cachedus + D.12647;
    D.12649 = *D.12648;
    D.12650 = D.12649->addr;
    ubin = lookup_unmanaged_binary (D.12650);
    D.12646 = (long unsigned int) i;
    D.12647 = D.12646 * 8;
    D.12648 = cachedus + D.12647;
    D.12649 = *D.12648;
    if (D.12649 == ubin) goto <D.12651>; else goto <D.12652>;
    <D.12651>:
    // predicted unlikely by continue predictor.
    goto <D.8556>;
    <D.12652>:
    D.12646 = (long unsigned int) i;
    D.12647 = D.12646 * 8;
    D.12648 = cachedus + D.12647;
    D.12649 = *D.12648;
    D.12649->parent = ubin;
  }
  <D.8556>:
  i = i + 1;
  <D.8558>:
  if (i < count) goto <D.8557>; else goto <D.8559>;
  <D.8559>:
}


sample_type_name (int type)
{
  const char * D.12654;

  switch (type) <default: <D.12655>, case 1: <D.8544>, case 2: <D.8545>, case 3: <D.8546>, case 4: <D.8547>, case 5: <D.8548>, case 6: <D.8549>>
  <D.8544>:
  D.12654 = "cycles";
  return D.12654;
  <D.8545>:
  D.12654 = "instructions retired";
  return D.12654;
  <D.8546>:
  D.12654 = "cache misses";
  return D.12654;
  <D.8547>:
  D.12654 = "cache references";
  return D.12654;
  <D.8548>:
  D.12654 = "executed branches";
  return D.12654;
  <D.8549>:
  D.12654 = "unpredicted branches";
  return D.12654;
  <D.12655>:
  D.12654 = "unknown";
  return D.12654;
}


sym_percent (uintptr_t sample_hits)
{
  int verbose.251;
  int D.12660;
  double D.12661;
  double D.12662;
  int num_stat_samples.252;
  double D.12664;
  _Bool D.12665;
  double pc;

  verbose.251 = verbose;
  if (verbose.251 != 0) goto <D.12658>; else goto <D.12659>;
  <D.12658>:
  D.12660 = 1;
  return D.12660;
  <D.12659>:
  D.12661 = (double) sample_hits;
  D.12662 = D.12661 * 1.0e+2;
  num_stat_samples.252 = num_stat_samples;
  D.12664 = (double) num_stat_samples.252;
  pc = D.12662 / D.12664;
  D.12665 = pc >= 1.000000000000000055511151231257827021181583404541015625e-1;
  D.12660 = (int) D.12665;
  return D.12660;
}


print_usym (struct UnmanagedSymbol * um)
{
  struct UnmanagedSymbol * D.12667;
  char * D.12670;
  char * D.12671;
  long unsigned int D.12672;
  double D.12673;
  double D.12674;
  int num_stat_samples.253;
  double D.12676;
  double D.12677;
  struct FILE * outfile.254;

  D.12667 = um->parent;
  if (D.12667 != 0B) goto <D.12668>; else goto <D.12669>;
  <D.12668>:
  D.12667 = um->parent;
  D.12670 = D.12667->name;
  D.12671 = um->name;
  D.12672 = um->sample_hits;
  D.12673 = (double) D.12672;
  D.12674 = D.12673 * 1.0e+2;
  num_stat_samples.253 = num_stat_samples;
  D.12676 = (double) num_stat_samples.253;
  D.12677 = D.12674 / D.12676;
  D.12672 = um->sample_hits;
  outfile.254 = outfile;
  fprintf (outfile.254, "\t%6d %6.2f %-36s in %s\n", D.12672, D.12677, D.12671, D.12670);
  goto <D.12679>;
  <D.12669>:
  D.12671 = um->name;
  D.12672 = um->sample_hits;
  D.12673 = (double) D.12672;
  D.12674 = D.12673 * 1.0e+2;
  num_stat_samples.253 = num_stat_samples;
  D.12676 = (double) num_stat_samples.253;
  D.12677 = D.12674 / D.12676;
  D.12672 = um->sample_hits;
  outfile.254 = outfile;
  fprintf (outfile.254, "\t%6d %6.2f %s\n", D.12672, D.12677, D.12671);
  <D.12679>:
}


