mono_process_list (int * size)
{
  void * * D.5939;
  char * nend.0;
  char D.5945;
  unsigned int count.1;
  unsigned int D.5952;
  int i.2;
  unsigned int i.3;
  unsigned int D.5955;
  void * * D.5956;
  void * pid.4;
  const char * name;
  void * * buf;
  int count;
  int i;
  struct GDir * dir;

  buf = 0B;
  count = 0;
  i = 0;
  dir = monoeg_g_dir_open ("/proc/", 0, 0B);
  if (dir == 0B) goto <D.5935>; else goto <D.5936>;
  <D.5935>:
  if (size != 0B) goto <D.5937>; else goto <D.5938>;
  <D.5937>:
  *size = 0;
  <D.5938>:
  D.5939 = 0B;
  return D.5939;
  <D.5936>:
  goto <D.5760>;
  <D.5761>:
  {
    int pid;
    char * nend;

    try
      {
        pid = strtol (name, &nend, 10);
        if (pid <= 0) goto <D.5940>; else goto <D.5942>;
        <D.5942>:
        nend.0 = nend;
        if (nend.0 == name) goto <D.5940>; else goto <D.5944>;
        <D.5944>:
        nend.0 = nend;
        D.5945 = *nend.0;
        if (D.5945 != 0) goto <D.5940>; else goto <D.5941>;
        <D.5940>:
        // predicted unlikely by continue predictor.
        goto <D.5760>;
        <D.5941>:
        if (i >= count) goto <D.5946>; else goto <D.5947>;
        <D.5946>:
        if (count == 0) goto <D.5948>; else goto <D.5949>;
        <D.5948>:
        count = 16;
        goto <D.5950>;
        <D.5949>:
        count = count * 2;
        <D.5950>:
        count.1 = (unsigned int) count;
        D.5952 = count.1 * 4;
        buf = monoeg_realloc (buf, D.5952);
        <D.5947>:
        i.2 = i;
        i = i.2 + 1;
        i.3 = (unsigned int) i.2;
        D.5955 = i.3 * 4;
        D.5956 = buf + D.5955;
        pid.4 = (void *) pid;
        *D.5956 = pid.4;
      }
    finally
      {
        nend = {CLOBBER};
      }
  }
  <D.5760>:
  name = monoeg_g_dir_read_name (dir);
  if (name != 0B) goto <D.5761>; else goto <D.5762>;
  <D.5762>:
  monoeg_g_dir_close (dir);
  if (size != 0B) goto <D.5958>; else goto <D.5959>;
  <D.5958>:
  *size = i;
  <D.5959>:
  D.5939 = buf;
  return D.5939;
}


mono_process_get_name (void * pid, char * buf, int len)
{
  int pid.5;
  char * D.5966;
  int D.5967;
  unsigned int D.5968;
  unsigned int D.5969;
  sizetype r.6;
  char * D.5971;
  char fname[128];
  struct FILE * file;
  char * p;
  int r;

  try
    {
      pid.5 = (int) pid;
      sprintf (&fname, "/proc/%d/cmdline", pid.5);
      *buf = 0;
      file = fopen (&fname, "r");
      if (file == 0B) goto <D.5964>; else goto <D.5965>;
      <D.5964>:
      D.5966 = buf;
      return D.5966;
      <D.5965>:
      D.5967 = len + -1;
      D.5968 = (unsigned int) D.5967;
      D.5969 = fread (buf, 1, D.5968, file);
      r = (int) D.5969;
      fclose (file);
      r.6 = (sizetype) r;
      D.5971 = buf + r.6;
      *D.5971 = 0;
      p = strrchr (buf, 47);
      if (p != 0B) goto <D.5972>; else goto <D.5973>;
      <D.5972>:
      D.5966 = p + 1;
      return D.5966;
      <D.5973>:
      if (r == 0) goto <D.5974>; else goto <D.5975>;
      <D.5974>:
      pid.5 = (int) pid;
      D.5966 = get_pid_status_item_buf (pid.5, "Name", buf, len, 0B);
      return D.5966;
      <D.5975>:
      D.5966 = buf;
      return D.5966;
    }
  finally
    {
      fname = {CLOBBER};
    }
}


sprintf (char * restrict __s, const char * restrict __fmt)
{
  int D.5978;
  unsigned int D.5979;

  D.5979 = __builtin_object_size (__s, 1);
  D.5978 = __builtin___sprintf_chk (__s, 1, D.5979, __fmt, __builtin_va_arg_pack ());
  return D.5978;
}


fread (void * restrict __ptr, size_t __size, size_t __n, struct FILE * restrict __stream)
{
  unsigned int D.5981;
  int D.5986;
  int D.5988;
  unsigned int D.5990;
  size_t D.5991;
  unsigned int D.5992;
  unsigned int D.5993;
  unsigned int D.5994;
  unsigned int D.5997;

  D.5981 = __builtin_object_size (__ptr, 0);
  if (D.5981 != 4294967295) goto <D.5982>; else goto <D.5983>;
  <D.5982>:
  D.5986 = __builtin_constant_p (__size);
  if (D.5986 == 0) goto <D.5984>; else goto <D.5987>;
  <D.5987>:
  D.5988 = __builtin_constant_p (__n);
  if (D.5988 == 0) goto <D.5984>; else goto <D.5989>;
  <D.5989>:
  D.5990 = __size | __n;
  if (D.5990 > 65535) goto <D.5984>; else goto <D.5985>;
  <D.5984>:
  D.5992 = __builtin_object_size (__ptr, 0);
  D.5991 = __fread_chk (__ptr, D.5992, __size, __n, __stream);
  return D.5991;
  <D.5985>:
  D.5993 = __size * __n;
  D.5994 = __builtin_object_size (__ptr, 0);
  if (D.5993 > D.5994) goto <D.5995>; else goto <D.5996>;
  <D.5995>:
  D.5997 = __builtin_object_size (__ptr, 0);
  D.5991 = __fread_chk_warn (__ptr, D.5997, __size, __n, __stream);
  return D.5991;
  <D.5996>:
  <D.5983>:
  D.5991 = __fread_alias (__ptr, __size, __n, __stream);
  return D.5991;
}


get_pid_status_item_buf (int pid, const char * item, char * rbuf, int blen, MonoProcessError * error)
{
  unsigned int D.5999;
  char * D.6004;
  char D.6005;
  char D.6006;
  unsigned int len.7;
  int D.6010;
  sizetype len.8;
  const short unsigned int * * D.6014;
  const short unsigned int * D.6015;
  char D.6016;
  unsigned int D.6017;
  unsigned int D.6018;
  const short unsigned int * D.6019;
  short unsigned int D.6020;
  int D.6021;
  int D.6022;
  char * s.9;
  char D.6024;
  unsigned int D.6027;
  int D.6028;
  unsigned int D.6029;
  sizetype iftmp.10;
  sizetype blen.11;
  char * D.6035;
  char buf[256];
  char * s;
  struct FILE * f;
  int len;

  try
    {
      D.5999 = strlen (item);
      len = (int) D.5999;
      monoeg_g_snprintf (&buf, 256, "/proc/%d/status", pid);
      f = fopen (&buf, "r");
      if (f == 0B) goto <D.6000>; else goto <D.6001>;
      <D.6000>:
      if (error != 0B) goto <D.6002>; else goto <D.6003>;
      <D.6002>:
      *error = 1;
      <D.6003>:
      D.6004 = 0B;
      return D.6004;
      <D.6001>:
      goto <D.5774>;
      <D.5790>:
      D.6005 = *item;
      D.6006 = buf[0];
      if (D.6005 != D.6006) goto <D.6007>; else goto <D.6008>;
      <D.6007>:
      // predicted unlikely by continue predictor.
      goto <D.5774>;
      <D.6008>:
      len.7 = (unsigned int) len;
      D.6010 = strncmp (&buf, item, len.7);
      if (D.6010 != 0) goto <D.6011>; else goto <D.6012>;
      <D.6011>:
      // predicted unlikely by continue predictor.
      goto <D.5774>;
      <D.6012>:
      len.8 = (sizetype) len;
      s = &buf + len.8;
      goto <D.5785>;
      <D.5784>:
      s = s + 1;
      <D.5785>:
      D.6014 = __ctype_b_loc ();
      D.6015 = *D.6014;
      D.6016 = *s;
      D.6017 = (unsigned int) D.6016;
      D.6018 = D.6017 * 2;
      D.6019 = D.6015 + D.6018;
      D.6020 = *D.6019;
      D.6021 = (int) D.6020;
      D.6022 = D.6021 & 8192;
      if (D.6022 != 0) goto <D.5784>; else goto <D.5786>;
      <D.5786>:
      s.9 = s;
      s = s.9 + 1;
      D.6024 = *s.9;
      if (D.6024 != 58) goto <D.6025>; else goto <D.6026>;
      <D.6025>:
      // predicted unlikely by continue predictor.
      goto <D.5774>;
      <D.6026>:
      goto <D.5788>;
      <D.5787>:
      s = s + 1;
      <D.5788>:
      D.6014 = __ctype_b_loc ();
      D.6015 = *D.6014;
      D.6016 = *s;
      D.6017 = (unsigned int) D.6016;
      D.6018 = D.6017 * 2;
      D.6019 = D.6015 + D.6018;
      D.6020 = *D.6019;
      D.6021 = (int) D.6020;
      D.6022 = D.6021 & 8192;
      if (D.6022 != 0) goto <D.5787>; else goto <D.5789>;
      <D.5789>:
      fclose (f);
      D.6027 = strlen (s);
      len = (int) D.6027;
      D.6028 = MIN_EXPR <blen, len>;
      D.6029 = (unsigned int) D.6028;
      strncpy (rbuf, s, D.6029);
      if (len < blen) goto <D.6031>; else goto <D.6032>;
      <D.6031>:
      len.8 = (sizetype) len;
      iftmp.10 = len.8 + 4294967295;
      goto <D.6033>;
      <D.6032>:
      blen.11 = (sizetype) blen;
      iftmp.10 = blen.11 + 4294967295;
      <D.6033>:
      D.6035 = rbuf + iftmp.10;
      *D.6035 = 0;
      if (error != 0B) goto <D.6036>; else goto <D.6037>;
      <D.6036>:
      *error = 0;
      <D.6037>:
      D.6004 = rbuf;
      return D.6004;
      <D.5774>:
      s = fgets (&buf, blen, f);
      if (s != 0B) goto <D.5790>; else goto <D.5791>;
      <D.5791>:
      fclose (f);
      if (error != 0B) goto <D.6038>; else goto <D.6039>;
      <D.6038>:
      *error = 2;
      <D.6039>:
      D.6004 = 0B;
      return D.6004;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


strncpy (char * restrict __dest, const char * restrict __src, size_t __len)
{
  char * D.6042;
  unsigned int D.6043;

  D.6043 = __builtin_object_size (__dest, 1);
  D.6042 = __builtin___strncpy_chk (__dest, __src, __len, D.6043);
  return D.6042;
}


fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  unsigned int D.6045;
  int D.6050;
  char * D.6052;
  unsigned int D.6053;
  unsigned int __n.12;
  unsigned int D.6055;
  unsigned int D.6058;

  D.6045 = __builtin_object_size (__s, 1);
  if (D.6045 != 4294967295) goto <D.6046>; else goto <D.6047>;
  <D.6046>:
  D.6050 = __builtin_constant_p (__n);
  if (D.6050 == 0) goto <D.6048>; else goto <D.6051>;
  <D.6051>:
  if (__n <= 0) goto <D.6048>; else goto <D.6049>;
  <D.6048>:
  D.6053 = __builtin_object_size (__s, 1);
  D.6052 = __fgets_chk (__s, D.6053, __n, __stream);
  return D.6052;
  <D.6049>:
  __n.12 = (unsigned int) __n;
  D.6055 = __builtin_object_size (__s, 1);
  if (__n.12 > D.6055) goto <D.6056>; else goto <D.6057>;
  <D.6056>:
  D.6058 = __builtin_object_size (__s, 1);
  D.6052 = __fgets_chk_warn (__s, D.6058, __n, __stream);
  return D.6052;
  <D.6057>:
  <D.6047>:
  D.6052 = __fgets_alias (__s, __n, __stream);
  return D.6052;
}


mono_process_get_data_with_error (void * pid, MonoProcessData data, MonoProcessError * error)
{
  gint64 D.6062;
  long long int D.6067;
  int D.6068;
  long long int D.6069;
  gint64 val;
  int rpid;

  rpid = (int) pid;
  if (error != 0B) goto <D.6060>; else goto <D.6061>;
  <D.6060>:
  *error = 2;
  <D.6061>:
  switch (data) <default: <D.6070>, case 0: <D.5858>, case 1: <D.5859>, case 2: <D.5860>, case 3: <D.5861>, case 4: <D.5862>, case 5: <D.5863>, case 6: <D.5864>, case 7: <D.5865>, case 8: <D.5866>, case 9: <D.5867>, case 10: <D.5868>, case 11: <D.5869>, case 12: <D.5870>>
  <D.5858>:
  D.6062 = get_pid_status_item (rpid, "Threads", error, 1);
  return D.6062;
  <D.5859>:
  D.6062 = get_process_stat_time (rpid, 10, 0, error);
  return D.6062;
  <D.5860>:
  D.6062 = get_process_stat_time (rpid, 11, 0, error);
  return D.6062;
  <D.5861>:
  D.6062 = get_process_stat_time (rpid, 10, 1, error);
  return D.6062;
  <D.5862>:
  D.6062 = get_pid_status_item (rpid, "VmRSS", error, 1024);
  return D.6062;
  <D.5863>:
  val = get_pid_status_item (rpid, "VmHWM", error, 1024);
  if (val == 0) goto <D.6063>; else goto <D.6064>;
  <D.6063>:
  val = get_pid_status_item (rpid, "VmRSS", error, 1024);
  <D.6064>:
  D.6062 = val;
  return D.6062;
  <D.5864>:
  D.6062 = get_pid_status_item (rpid, "VmData", error, 1024);
  return D.6062;
  <D.5865>:
  D.6062 = get_pid_status_item (rpid, "VmSize", error, 1024);
  return D.6062;
  <D.5866>:
  val = get_pid_status_item (rpid, "VmPeak", error, 1024);
  if (val == 0) goto <D.6065>; else goto <D.6066>;
  <D.6065>:
  val = get_pid_status_item (rpid, "VmSize", error, 1024);
  <D.6066>:
  D.6062 = val;
  return D.6062;
  <D.5867>:
  D.6062 = get_process_stat_item (rpid, 6, 1, error);
  return D.6062;
  <D.5868>:
  D.6067 = get_process_stat_item (rpid, 18, 0, error);
  D.6068 = get_user_hz ();
  D.6069 = (long long int) D.6068;
  D.6062 = D.6067 / D.6069;
  return D.6062;
  <D.5869>:
  D.6062 = get_process_stat_time (rpid, 0, 0, error);
  return D.6062;
  <D.5870>:
  D.6062 = 0;
  return D.6062;
  <D.6070>:
  D.6062 = 0;
  return D.6062;
}


get_pid_status_item (int pid, const char * item, MonoProcessError * error, int multiplier)
{
  gint64 D.6074;
  long int D.6075;
  long long int D.6076;
  long long int D.6077;
  char buf[64];
  char * s;

  try
    {
      s = get_pid_status_item_buf (pid, item, &buf, 64, error);
      if (s != 0B) goto <D.6072>; else goto <D.6073>;
      <D.6072>:
      D.6075 = atol (s);
      D.6076 = (long long int) D.6075;
      D.6077 = (long long int) multiplier;
      D.6074 = D.6076 * D.6077;
      return D.6074;
      <D.6073>:
      D.6074 = 0;
      return D.6074;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


atol (const char * __nptr)
{
  long int D.6080;

  D.6080 = strtol (__nptr, 0B, 10);
  return D.6080;
}


get_process_stat_item (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6086;
  unsigned int D.6087;
  const short unsigned int * * D.6096;
  const short unsigned int * D.6097;
  char D.6098;
  unsigned int D.6099;
  unsigned int D.6100;
  const short unsigned int * D.6101;
  short unsigned int D.6102;
  int D.6103;
  int D.6104;
  long unsigned int D.6123;
  long unsigned int D.6130;
  long long int D.6131;
  char buf[512];
  char * s;
  char * end;
  struct FILE * f;
  int len;
  int i;
  gint64 value;

  try
    {
      monoeg_g_snprintf (&buf, 512, "/proc/%d/stat", pid);
      f = fopen (&buf, "r");
      if (f == 0B) goto <D.6082>; else goto <D.6083>;
      <D.6082>:
      if (error != 0B) goto <D.6084>; else goto <D.6085>;
      <D.6084>:
      *error = 1;
      <D.6085>:
      D.6086 = 0;
      return D.6086;
      <D.6083>:
      D.6087 = fread (&buf, 1, 512, f);
      len = (int) D.6087;
      fclose (f);
      if (len <= 0) goto <D.6088>; else goto <D.6089>;
      <D.6088>:
      if (error != 0B) goto <D.6090>; else goto <D.6091>;
      <D.6090>:
      *error = 2;
      <D.6091>:
      D.6086 = 0;
      return D.6086;
      <D.6089>:
      s = __builtin_strchr (&buf, 41);
      if (s == 0B) goto <D.6092>; else goto <D.6093>;
      <D.6092>:
      if (error != 0B) goto <D.6094>; else goto <D.6095>;
      <D.6094>:
      *error = 2;
      <D.6095>:
      D.6086 = 0;
      return D.6086;
      <D.6093>:
      s = s + 1;
      goto <D.5815>;
      <D.5814>:
      s = s + 1;
      <D.5815>:
      D.6096 = __ctype_b_loc ();
      D.6097 = *D.6096;
      D.6098 = *s;
      D.6099 = (unsigned int) D.6098;
      D.6100 = D.6099 * 2;
      D.6101 = D.6097 + D.6100;
      D.6102 = *D.6101;
      D.6103 = (int) D.6102;
      D.6104 = D.6103 & 8192;
      if (D.6104 != 0) goto <D.5814>; else goto <D.5816>;
      <D.5816>:
      D.6098 = *s;
      if (D.6098 == 0) goto <D.6105>; else goto <D.6106>;
      <D.6105>:
      if (error != 0B) goto <D.6107>; else goto <D.6108>;
      <D.6107>:
      *error = 2;
      <D.6108>:
      D.6086 = 0;
      return D.6086;
      <D.6106>:
      goto <D.5818>;
      <D.5817>:
      s = s + 1;
      <D.5818>:
      D.6098 = *s;
      if (D.6098 != 0) goto <D.6109>; else goto <D.5819>;
      <D.6109>:
      D.6096 = __ctype_b_loc ();
      D.6097 = *D.6096;
      D.6098 = *s;
      D.6099 = (unsigned int) D.6098;
      D.6100 = D.6099 * 2;
      D.6101 = D.6097 + D.6100;
      D.6102 = *D.6101;
      D.6103 = (int) D.6102;
      D.6104 = D.6103 & 8192;
      if (D.6104 == 0) goto <D.5817>; else goto <D.5819>;
      <D.5819>:
      D.6098 = *s;
      if (D.6098 == 0) goto <D.6110>; else goto <D.6111>;
      <D.6110>:
      if (error != 0B) goto <D.6112>; else goto <D.6113>;
      <D.6112>:
      *error = 2;
      <D.6113>:
      D.6086 = 0;
      return D.6086;
      <D.6111>:
      i = 0;
      goto <D.5827>;
      <D.5826>:
      goto <D.5821>;
      <D.5820>:
      s = s + 1;
      <D.5821>:
      D.6096 = __ctype_b_loc ();
      D.6097 = *D.6096;
      D.6098 = *s;
      D.6099 = (unsigned int) D.6098;
      D.6100 = D.6099 * 2;
      D.6101 = D.6097 + D.6100;
      D.6102 = *D.6101;
      D.6103 = (int) D.6102;
      D.6104 = D.6103 & 8192;
      if (D.6104 != 0) goto <D.5820>; else goto <D.5822>;
      <D.5822>:
      D.6098 = *s;
      if (D.6098 == 0) goto <D.6114>; else goto <D.6115>;
      <D.6114>:
      if (error != 0B) goto <D.6116>; else goto <D.6117>;
      <D.6116>:
      *error = 2;
      <D.6117>:
      D.6086 = 0;
      return D.6086;
      <D.6115>:
      goto <D.5824>;
      <D.5823>:
      s = s + 1;
      <D.5824>:
      D.6098 = *s;
      if (D.6098 != 0) goto <D.6118>; else goto <D.5825>;
      <D.6118>:
      D.6096 = __ctype_b_loc ();
      D.6097 = *D.6096;
      D.6098 = *s;
      D.6099 = (unsigned int) D.6098;
      D.6100 = D.6099 * 2;
      D.6101 = D.6097 + D.6100;
      D.6102 = *D.6101;
      D.6103 = (int) D.6102;
      D.6104 = D.6103 & 8192;
      if (D.6104 == 0) goto <D.5823>; else goto <D.5825>;
      <D.5825>:
      D.6098 = *s;
      if (D.6098 == 0) goto <D.6119>; else goto <D.6120>;
      <D.6119>:
      if (error != 0B) goto <D.6121>; else goto <D.6122>;
      <D.6121>:
      *error = 2;
      <D.6122>:
      D.6086 = 0;
      return D.6086;
      <D.6120>:
      i = i + 1;
      <D.5827>:
      if (i < pos) goto <D.5826>; else goto <D.5828>;
      <D.5828>:
      D.6123 = strtoul (s, &end, 0);
      value = (gint64) D.6123;
      if (sum != 0) goto <D.6124>; else goto <D.6125>;
      <D.6124>:
      goto <D.5830>;
      <D.5829>:
      s = s + 1;
      <D.5830>:
      D.6096 = __ctype_b_loc ();
      D.6097 = *D.6096;
      D.6098 = *s;
      D.6099 = (unsigned int) D.6098;
      D.6100 = D.6099 * 2;
      D.6101 = D.6097 + D.6100;
      D.6102 = *D.6101;
      D.6103 = (int) D.6102;
      D.6104 = D.6103 & 8192;
      if (D.6104 != 0) goto <D.5829>; else goto <D.5831>;
      <D.5831>:
      D.6098 = *s;
      if (D.6098 == 0) goto <D.6126>; else goto <D.6127>;
      <D.6126>:
      if (error != 0B) goto <D.6128>; else goto <D.6129>;
      <D.6128>:
      *error = 2;
      <D.6129>:
      D.6086 = 0;
      return D.6086;
      <D.6127>:
      D.6130 = strtoul (s, &end, 0);
      D.6131 = (long long int) D.6130;
      value = D.6131 + value;
      <D.6125>:
      if (error != 0B) goto <D.6132>; else goto <D.6133>;
      <D.6132>:
      *error = 0;
      <D.6133>:
      D.6086 = value;
      return D.6086;
    }
  finally
    {
      buf = {CLOBBER};
      end = {CLOBBER};
    }
}


get_user_hz ()
{
  int user_hz.13;
  long int user_hz.14;
  int D.6142;
  static int user_hz = 0;

  user_hz.13 = user_hz;
  if (user_hz.13 == 0) goto <D.6137>; else goto <D.6138>;
  <D.6137>:
  user_hz.14 = sysconf (2);
  user_hz = user_hz.14;
  user_hz.13 = user_hz;
  if (user_hz.13 == 0) goto <D.6140>; else goto <D.6141>;
  <D.6140>:
  user_hz = 100;
  <D.6141>:
  <D.6138>:
  D.6142 = user_hz;
  return D.6142;
}


get_process_stat_time (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6144;
  long long int D.6145;
  int D.6146;
  long long int D.6147;
  gint64 val;

  val = get_process_stat_item (pid, pos, sum, error);
  D.6145 = val * 10000000;
  D.6146 = get_user_hz ();
  D.6147 = (long long int) D.6146;
  D.6144 = D.6145 / D.6147;
  return D.6144;
}


mono_process_get_data (void * pid, MonoProcessData data)
{
  gint64 D.6149;
  MonoProcessError error;

  try
    {
      D.6149 = mono_process_get_data_with_error (pid, data, &error);
      return D.6149;
    }
  finally
    {
      error = {CLOBBER};
    }
}


mono_cpu_count ()
{
  int D.6154;
  int count;

  count = 0;
  count = sysconf (84);
  if (count > 0) goto <D.6152>; else goto <D.6153>;
  <D.6152>:
  D.6154 = count;
  return D.6154;
  <D.6153>:
  D.6154 = 1;
  return D.6154;
}


mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError * error)
{
  gint64 D.6158;
  gint64 value;

  try
    {
      value = 0;
      if (error != 0B) goto <D.6156>; else goto <D.6157>;
      <D.6156>:
      *error = 0;
      <D.6157>:
      switch (data) <default: <D.6159>, case 0: <D.5927>, case 1: <D.5929>, case 2: <D.5930>, case 3: <D.5931>, case 4: <D.5932>, case 5: <D.5933>>
      <D.5927>:
      get_cpu_times (cpu_id, &value, 0B, 0B, 0B, 0B);
      goto <D.5928>;
      <D.5929>:
      get_cpu_times (cpu_id, 0B, &value, 0B, 0B, 0B);
      goto <D.5928>;
      <D.5930>:
      get_cpu_times (cpu_id, 0B, 0B, &value, 0B, 0B);
      goto <D.5928>;
      <D.5931>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, &value, 0B);
      goto <D.5928>;
      <D.5932>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, 0B, &value);
      goto <D.5928>;
      <D.5933>:
      D.6158 = 0;
      return D.6158;
      <D.6159>:
      <D.5928>:
      D.6158 = value;
      return D.6158;
    }
  finally
    {
      value = {CLOBBER};
    }
}


get_cpu_times (int cpu_id, gint64 * user, gint64 * systemt, gint64 * irq, gint64 * sirq, gint64 * idle)
{
  int D.6166;
  int D.6170;
  const short unsigned int * * D.6172;
  const short unsigned int * D.6173;
  char * D.6174;
  char D.6175;
  unsigned int D.6176;
  unsigned int D.6177;
  const short unsigned int * D.6178;
  short unsigned int D.6179;
  int D.6180;
  int D.6181;
  char * data.15;
  int D.6187;
  long int D.6189;
  char * data.16;
  char * data.17;
  long long unsigned int D.6197;
  long long unsigned int D.6198;
  long long unsigned int D.6199;
  long long unsigned int D.6200;
  long long int D.6201;
  long long unsigned int D.6204;
  long long unsigned int D.6205;
  long long int D.6206;
  long long unsigned int D.6209;
  long long unsigned int D.6210;
  long long int D.6211;
  long long unsigned int D.6214;
  long long unsigned int D.6215;
  long long int D.6216;
  long long unsigned int D.6219;
  long long unsigned int D.6220;
  long long int D.6221;
  char buf[256];
  char * s;
  int hz;
  guint64 user_ticks;
  guint64 nice_ticks;
  guint64 system_ticks;
  guint64 idle_ticks;
  guint64 iowait_ticks;
  guint64 irq_ticks;
  guint64 sirq_ticks;
  struct FILE * f;

  try
    {
      hz = get_user_hz ();
      user_ticks = 0;
      nice_ticks = 0;
      system_ticks = 0;
      idle_ticks = 0;
      irq_ticks = 0;
      sirq_ticks = 0;
      f = fopen ("/proc/stat", "r");
      if (f == 0B) goto <D.6162>; else goto <D.6163>;
      <D.6162>:
      return;
      <D.6163>:
      if (cpu_id < 0) goto <D.6164>; else goto <D.6165>;
      <D.6164>:
      D.6166 = mono_cpu_count ();
      hz = D.6166 * hz;
      <D.6165>:
      goto <D.5918>;
      <D.5920>:
      {
        char * data;

        try
          {
            data = 0B;
            if (cpu_id < 0) goto <D.6169>; else goto <D.6167>;
            <D.6169>:
            D.6170 = strncmp (s, "cpu", 3);
            if (D.6170 == 0) goto <D.6171>; else goto <D.6167>;
            <D.6171>:
            D.6172 = __ctype_b_loc ();
            D.6173 = *D.6172;
            D.6174 = s + 3;
            D.6175 = *D.6174;
            D.6176 = (unsigned int) D.6175;
            D.6177 = D.6176 * 2;
            D.6178 = D.6173 + D.6177;
            D.6179 = *D.6178;
            D.6180 = (int) D.6179;
            D.6181 = D.6180 & 8192;
            if (D.6181 != 0) goto <D.6182>; else goto <D.6167>;
            <D.6182>:
            data.15 = s + 4;
            data = data.15;
            goto <D.6168>;
            <D.6167>:
            if (cpu_id >= 0) goto <D.6186>; else goto <D.6184>;
            <D.6186>:
            D.6187 = strncmp (s, "cpu", 3);
            if (D.6187 == 0) goto <D.6188>; else goto <D.6184>;
            <D.6188>:
            D.6174 = s + 3;
            D.6189 = strtol (D.6174, &data, 10);
            if (D.6189 == cpu_id) goto <D.6190>; else goto <D.6184>;
            <D.6190>:
            D.6174 = s + 3;
            data.16 = data;
            if (D.6174 == data.16) goto <D.6192>; else goto <D.6193>;
            <D.6192>:
            // predicted unlikely by continue predictor.
            goto <D.5918>;
            <D.6193>:
            data.16 = data;
            data.17 = data.16 + 1;
            data = data.17;
            goto <D.6185>;
            <D.6184>:
            // predicted unlikely by continue predictor.
            goto <D.5918>;
            <D.6185>:
            <D.6168>:
            data.16 = data;
            user_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            nice_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            system_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            idle_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            iowait_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            irq_ticks = strtoull (data.16, &data, 10);
            data.16 = data;
            sirq_ticks = strtoull (data.16, &data, 10);
            goto <D.5919>;
          }
        finally
          {
            data = {CLOBBER};
          }
      }
      <D.5918>:
      s = fgets (&buf, 256, f);
      if (s != 0B) goto <D.5920>; else goto <D.5919>;
      <D.5919>:
      fclose (f);
      if (user != 0B) goto <D.6195>; else goto <D.6196>;
      <D.6195>:
      D.6197 = user_ticks + nice_ticks;
      D.6198 = D.6197 * 10000000;
      D.6199 = (long long unsigned int) hz;
      D.6200 = D.6198 / D.6199;
      D.6201 = (long long int) D.6200;
      *user = D.6201;
      <D.6196>:
      if (systemt != 0B) goto <D.6202>; else goto <D.6203>;
      <D.6202>:
      D.6204 = system_ticks * 10000000;
      D.6199 = (long long unsigned int) hz;
      D.6205 = D.6204 / D.6199;
      D.6206 = (long long int) D.6205;
      *systemt = D.6206;
      <D.6203>:
      if (irq != 0B) goto <D.6207>; else goto <D.6208>;
      <D.6207>:
      D.6209 = irq_ticks * 10000000;
      D.6199 = (long long unsigned int) hz;
      D.6210 = D.6209 / D.6199;
      D.6211 = (long long int) D.6210;
      *irq = D.6211;
      <D.6208>:
      if (sirq != 0B) goto <D.6212>; else goto <D.6213>;
      <D.6212>:
      D.6214 = sirq_ticks * 10000000;
      D.6199 = (long long unsigned int) hz;
      D.6215 = D.6214 / D.6199;
      D.6216 = (long long int) D.6215;
      *sirq = D.6216;
      <D.6213>:
      if (idle != 0B) goto <D.6217>; else goto <D.6218>;
      <D.6217>:
      D.6219 = idle_ticks * 10000000;
      D.6199 = (long long unsigned int) hz;
      D.6220 = D.6219 / D.6199;
      D.6221 = (long long int) D.6220;
      *idle = D.6221;
      <D.6218>:
    }
  finally
    {
      buf = {CLOBBER};
    }
}


