mono_process_list (int * size)
{
  void * * D.5916;
  char * nend.0;
  char D.5922;
  unsigned int count.1;
  unsigned int D.5929;
  int i.2;
  unsigned int i.3;
  unsigned int D.5932;
  void * * D.5933;
  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.5912>; else goto <D.5913>;
  <D.5912>:
  if (size != 0B) goto <D.5914>; else goto <D.5915>;
  <D.5914>:
  *size = 0;
  <D.5915>:
  D.5916 = 0B;
  return D.5916;
  <D.5913>:
  goto <D.5737>;
  <D.5738>:
  {
    int pid;
    char * nend;

    try
      {
        pid = strtol (name, &nend, 10);
        if (pid <= 0) goto <D.5917>; else goto <D.5919>;
        <D.5919>:
        nend.0 = nend;
        if (nend.0 == name) goto <D.5917>; else goto <D.5921>;
        <D.5921>:
        nend.0 = nend;
        D.5922 = *nend.0;
        if (D.5922 != 0) goto <D.5917>; else goto <D.5918>;
        <D.5917>:
        // predicted unlikely by continue predictor.
        goto <D.5737>;
        <D.5918>:
        if (i >= count) goto <D.5923>; else goto <D.5924>;
        <D.5923>:
        if (count == 0) goto <D.5925>; else goto <D.5926>;
        <D.5925>:
        count = 16;
        goto <D.5927>;
        <D.5926>:
        count = count * 2;
        <D.5927>:
        count.1 = (unsigned int) count;
        D.5929 = count.1 * 4;
        buf = monoeg_realloc (buf, D.5929);
        <D.5924>:
        i.2 = i;
        i = i.2 + 1;
        i.3 = (unsigned int) i.2;
        D.5932 = i.3 * 4;
        D.5933 = buf + D.5932;
        pid.4 = (void *) pid;
        *D.5933 = pid.4;
      }
    finally
      {
        nend = {CLOBBER};
      }
  }
  <D.5737>:
  name = monoeg_g_dir_read_name (dir);
  if (name != 0B) goto <D.5738>; else goto <D.5739>;
  <D.5739>:
  monoeg_g_dir_close (dir);
  if (size != 0B) goto <D.5935>; else goto <D.5936>;
  <D.5935>:
  *size = i;
  <D.5936>:
  D.5916 = buf;
  return D.5916;
}


mono_process_get_name (void * pid, char * buf, int len)
{
  int pid.5;
  char * D.5943;
  int D.5944;
  unsigned int D.5945;
  unsigned int D.5946;
  sizetype r.6;
  char * D.5948;
  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.5941>; else goto <D.5942>;
      <D.5941>:
      D.5943 = buf;
      return D.5943;
      <D.5942>:
      D.5944 = len + -1;
      D.5945 = (unsigned int) D.5944;
      D.5946 = fread (buf, 1, D.5945, file);
      r = (int) D.5946;
      fclose (file);
      r.6 = (sizetype) r;
      D.5948 = buf + r.6;
      *D.5948 = 0;
      p = strrchr (buf, 47);
      if (p != 0B) goto <D.5949>; else goto <D.5950>;
      <D.5949>:
      D.5943 = p + 1;
      return D.5943;
      <D.5950>:
      if (r == 0) goto <D.5951>; else goto <D.5952>;
      <D.5951>:
      pid.5 = (int) pid;
      D.5943 = get_pid_status_item_buf (pid.5, "Name", buf, len, 0B);
      return D.5943;
      <D.5952>:
      D.5943 = buf;
      return D.5943;
    }
  finally
    {
      fname = {CLOBBER};
    }
}


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

  D.5956 = __builtin_object_size (__s, 1);
  D.5955 = __builtin___sprintf_chk (__s, 1, D.5956, __fmt, __builtin_va_arg_pack ());
  return D.5955;
}


fread (void * restrict __ptr, size_t __size, size_t __n, struct FILE * restrict __stream)
{
  unsigned int D.5958;
  int D.5963;
  int D.5965;
  unsigned int D.5967;
  size_t D.5968;
  unsigned int D.5969;
  unsigned int D.5970;
  unsigned int D.5971;
  unsigned int D.5974;

  D.5958 = __builtin_object_size (__ptr, 0);
  if (D.5958 != 4294967295) goto <D.5959>; else goto <D.5960>;
  <D.5959>:
  D.5963 = __builtin_constant_p (__size);
  if (D.5963 == 0) goto <D.5961>; else goto <D.5964>;
  <D.5964>:
  D.5965 = __builtin_constant_p (__n);
  if (D.5965 == 0) goto <D.5961>; else goto <D.5966>;
  <D.5966>:
  D.5967 = __size | __n;
  if (D.5967 > 65535) goto <D.5961>; else goto <D.5962>;
  <D.5961>:
  D.5969 = __builtin_object_size (__ptr, 0);
  D.5968 = __fread_chk (__ptr, D.5969, __size, __n, __stream);
  return D.5968;
  <D.5962>:
  D.5970 = __size * __n;
  D.5971 = __builtin_object_size (__ptr, 0);
  if (D.5970 > D.5971) goto <D.5972>; else goto <D.5973>;
  <D.5972>:
  D.5974 = __builtin_object_size (__ptr, 0);
  D.5968 = __fread_chk_warn (__ptr, D.5974, __size, __n, __stream);
  return D.5968;
  <D.5973>:
  <D.5960>:
  D.5968 = __fread_alias (__ptr, __size, __n, __stream);
  return D.5968;
}


get_pid_status_item_buf (int pid, const char * item, char * rbuf, int blen, MonoProcessError * error)
{
  unsigned int D.5976;
  char * D.5981;
  char D.5982;
  char D.5983;
  unsigned int len.7;
  int D.5987;
  sizetype len.8;
  const short unsigned int * * D.5991;
  const short unsigned int * D.5992;
  char D.5993;
  unsigned int D.5994;
  unsigned int D.5995;
  const short unsigned int * D.5996;
  short unsigned int D.5997;
  int D.5998;
  int D.5999;
  char * s.9;
  char D.6001;
  unsigned int D.6004;
  int D.6005;
  unsigned int D.6006;
  sizetype iftmp.10;
  sizetype blen.11;
  char * D.6012;
  char buf[256];
  char * s;
  struct FILE * f;
  int len;

  try
    {
      D.5976 = strlen (item);
      len = (int) D.5976;
      monoeg_g_snprintf (&buf, 256, "/proc/%d/status", pid);
      f = fopen (&buf, "r");
      if (f == 0B) goto <D.5977>; else goto <D.5978>;
      <D.5977>:
      if (error != 0B) goto <D.5979>; else goto <D.5980>;
      <D.5979>:
      *error = 1;
      <D.5980>:
      D.5981 = 0B;
      return D.5981;
      <D.5978>:
      goto <D.5751>;
      <D.5767>:
      D.5982 = *item;
      D.5983 = buf[0];
      if (D.5982 != D.5983) goto <D.5984>; else goto <D.5985>;
      <D.5984>:
      // predicted unlikely by continue predictor.
      goto <D.5751>;
      <D.5985>:
      len.7 = (unsigned int) len;
      D.5987 = strncmp (&buf, item, len.7);
      if (D.5987 != 0) goto <D.5988>; else goto <D.5989>;
      <D.5988>:
      // predicted unlikely by continue predictor.
      goto <D.5751>;
      <D.5989>:
      len.8 = (sizetype) len;
      s = &buf + len.8;
      goto <D.5762>;
      <D.5761>:
      s = s + 1;
      <D.5762>:
      D.5991 = __ctype_b_loc ();
      D.5992 = *D.5991;
      D.5993 = *s;
      D.5994 = (unsigned int) D.5993;
      D.5995 = D.5994 * 2;
      D.5996 = D.5992 + D.5995;
      D.5997 = *D.5996;
      D.5998 = (int) D.5997;
      D.5999 = D.5998 & 8192;
      if (D.5999 != 0) goto <D.5761>; else goto <D.5763>;
      <D.5763>:
      s.9 = s;
      s = s.9 + 1;
      D.6001 = *s.9;
      if (D.6001 != 58) goto <D.6002>; else goto <D.6003>;
      <D.6002>:
      // predicted unlikely by continue predictor.
      goto <D.5751>;
      <D.6003>:
      goto <D.5765>;
      <D.5764>:
      s = s + 1;
      <D.5765>:
      D.5991 = __ctype_b_loc ();
      D.5992 = *D.5991;
      D.5993 = *s;
      D.5994 = (unsigned int) D.5993;
      D.5995 = D.5994 * 2;
      D.5996 = D.5992 + D.5995;
      D.5997 = *D.5996;
      D.5998 = (int) D.5997;
      D.5999 = D.5998 & 8192;
      if (D.5999 != 0) goto <D.5764>; else goto <D.5766>;
      <D.5766>:
      fclose (f);
      D.6004 = strlen (s);
      len = (int) D.6004;
      D.6005 = MIN_EXPR <blen, len>;
      D.6006 = (unsigned int) D.6005;
      strncpy (rbuf, s, D.6006);
      if (len < blen) goto <D.6008>; else goto <D.6009>;
      <D.6008>:
      len.8 = (sizetype) len;
      iftmp.10 = len.8 + 4294967295;
      goto <D.6010>;
      <D.6009>:
      blen.11 = (sizetype) blen;
      iftmp.10 = blen.11 + 4294967295;
      <D.6010>:
      D.6012 = rbuf + iftmp.10;
      *D.6012 = 0;
      if (error != 0B) goto <D.6013>; else goto <D.6014>;
      <D.6013>:
      *error = 0;
      <D.6014>:
      D.5981 = rbuf;
      return D.5981;
      <D.5751>:
      s = fgets (&buf, blen, f);
      if (s != 0B) goto <D.5767>; else goto <D.5768>;
      <D.5768>:
      fclose (f);
      if (error != 0B) goto <D.6015>; else goto <D.6016>;
      <D.6015>:
      *error = 2;
      <D.6016>:
      D.5981 = 0B;
      return D.5981;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


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

  D.6020 = __builtin_object_size (__dest, 1);
  D.6019 = __builtin___strncpy_chk (__dest, __src, __len, D.6020);
  return D.6019;
}


fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  unsigned int D.6022;
  int D.6027;
  char * D.6029;
  unsigned int D.6030;
  unsigned int __n.12;
  unsigned int D.6032;
  unsigned int D.6035;

  D.6022 = __builtin_object_size (__s, 1);
  if (D.6022 != 4294967295) goto <D.6023>; else goto <D.6024>;
  <D.6023>:
  D.6027 = __builtin_constant_p (__n);
  if (D.6027 == 0) goto <D.6025>; else goto <D.6028>;
  <D.6028>:
  if (__n <= 0) goto <D.6025>; else goto <D.6026>;
  <D.6025>:
  D.6030 = __builtin_object_size (__s, 1);
  D.6029 = __fgets_chk (__s, D.6030, __n, __stream);
  return D.6029;
  <D.6026>:
  __n.12 = (unsigned int) __n;
  D.6032 = __builtin_object_size (__s, 1);
  if (__n.12 > D.6032) goto <D.6033>; else goto <D.6034>;
  <D.6033>:
  D.6035 = __builtin_object_size (__s, 1);
  D.6029 = __fgets_chk_warn (__s, D.6035, __n, __stream);
  return D.6029;
  <D.6034>:
  <D.6024>:
  D.6029 = __fgets_alias (__s, __n, __stream);
  return D.6029;
}


mono_process_get_data_with_error (void * pid, MonoProcessData data, MonoProcessError * error)
{
  gint64 D.6039;
  long long int D.6044;
  int D.6045;
  long long int D.6046;
  gint64 val;
  int rpid;

  rpid = (int) pid;
  if (error != 0B) goto <D.6037>; else goto <D.6038>;
  <D.6037>:
  *error = 2;
  <D.6038>:
  switch (data) <default: <D.6047>, case 0: <D.5835>, case 1: <D.5836>, case 2: <D.5837>, case 3: <D.5838>, case 4: <D.5839>, case 5: <D.5840>, case 6: <D.5841>, case 7: <D.5842>, case 8: <D.5843>, case 9: <D.5844>, case 10: <D.5845>, case 11: <D.5846>, case 12: <D.5847>>
  <D.5835>:
  D.6039 = get_pid_status_item (rpid, "Threads", error, 1);
  return D.6039;
  <D.5836>:
  D.6039 = get_process_stat_time (rpid, 10, 0, error);
  return D.6039;
  <D.5837>:
  D.6039 = get_process_stat_time (rpid, 11, 0, error);
  return D.6039;
  <D.5838>:
  D.6039 = get_process_stat_time (rpid, 10, 1, error);
  return D.6039;
  <D.5839>:
  D.6039 = get_pid_status_item (rpid, "VmRSS", error, 1024);
  return D.6039;
  <D.5840>:
  val = get_pid_status_item (rpid, "VmHWM", error, 1024);
  if (val == 0) goto <D.6040>; else goto <D.6041>;
  <D.6040>:
  val = get_pid_status_item (rpid, "VmRSS", error, 1024);
  <D.6041>:
  D.6039 = val;
  return D.6039;
  <D.5841>:
  D.6039 = get_pid_status_item (rpid, "VmData", error, 1024);
  return D.6039;
  <D.5842>:
  D.6039 = get_pid_status_item (rpid, "VmSize", error, 1024);
  return D.6039;
  <D.5843>:
  val = get_pid_status_item (rpid, "VmPeak", error, 1024);
  if (val == 0) goto <D.6042>; else goto <D.6043>;
  <D.6042>:
  val = get_pid_status_item (rpid, "VmSize", error, 1024);
  <D.6043>:
  D.6039 = val;
  return D.6039;
  <D.5844>:
  D.6039 = get_process_stat_item (rpid, 6, 1, error);
  return D.6039;
  <D.5845>:
  D.6044 = get_process_stat_item (rpid, 18, 0, error);
  D.6045 = get_user_hz ();
  D.6046 = (long long int) D.6045;
  D.6039 = D.6044 / D.6046;
  return D.6039;
  <D.5846>:
  D.6039 = get_process_stat_time (rpid, 0, 0, error);
  return D.6039;
  <D.5847>:
  D.6039 = 0;
  return D.6039;
  <D.6047>:
  D.6039 = 0;
  return D.6039;
}


get_pid_status_item (int pid, const char * item, MonoProcessError * error, int multiplier)
{
  gint64 D.6051;
  long int D.6052;
  long long int D.6053;
  long long int D.6054;
  char buf[64];
  char * s;

  try
    {
      s = get_pid_status_item_buf (pid, item, &buf, 64, error);
      if (s != 0B) goto <D.6049>; else goto <D.6050>;
      <D.6049>:
      D.6052 = atol (s);
      D.6053 = (long long int) D.6052;
      D.6054 = (long long int) multiplier;
      D.6051 = D.6053 * D.6054;
      return D.6051;
      <D.6050>:
      D.6051 = 0;
      return D.6051;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


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

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


get_process_stat_item (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6063;
  unsigned int D.6064;
  const short unsigned int * * D.6073;
  const short unsigned int * D.6074;
  char D.6075;
  unsigned int D.6076;
  unsigned int D.6077;
  const short unsigned int * D.6078;
  short unsigned int D.6079;
  int D.6080;
  int D.6081;
  long unsigned int D.6100;
  long unsigned int D.6107;
  long long int D.6108;
  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.6059>; else goto <D.6060>;
      <D.6059>:
      if (error != 0B) goto <D.6061>; else goto <D.6062>;
      <D.6061>:
      *error = 1;
      <D.6062>:
      D.6063 = 0;
      return D.6063;
      <D.6060>:
      D.6064 = fread (&buf, 1, 512, f);
      len = (int) D.6064;
      fclose (f);
      if (len <= 0) goto <D.6065>; else goto <D.6066>;
      <D.6065>:
      if (error != 0B) goto <D.6067>; else goto <D.6068>;
      <D.6067>:
      *error = 2;
      <D.6068>:
      D.6063 = 0;
      return D.6063;
      <D.6066>:
      s = __builtin_strchr (&buf, 41);
      if (s == 0B) goto <D.6069>; else goto <D.6070>;
      <D.6069>:
      if (error != 0B) goto <D.6071>; else goto <D.6072>;
      <D.6071>:
      *error = 2;
      <D.6072>:
      D.6063 = 0;
      return D.6063;
      <D.6070>:
      s = s + 1;
      goto <D.5792>;
      <D.5791>:
      s = s + 1;
      <D.5792>:
      D.6073 = __ctype_b_loc ();
      D.6074 = *D.6073;
      D.6075 = *s;
      D.6076 = (unsigned int) D.6075;
      D.6077 = D.6076 * 2;
      D.6078 = D.6074 + D.6077;
      D.6079 = *D.6078;
      D.6080 = (int) D.6079;
      D.6081 = D.6080 & 8192;
      if (D.6081 != 0) goto <D.5791>; else goto <D.5793>;
      <D.5793>:
      D.6075 = *s;
      if (D.6075 == 0) goto <D.6082>; else goto <D.6083>;
      <D.6082>:
      if (error != 0B) goto <D.6084>; else goto <D.6085>;
      <D.6084>:
      *error = 2;
      <D.6085>:
      D.6063 = 0;
      return D.6063;
      <D.6083>:
      goto <D.5795>;
      <D.5794>:
      s = s + 1;
      <D.5795>:
      D.6075 = *s;
      if (D.6075 != 0) goto <D.6086>; else goto <D.5796>;
      <D.6086>:
      D.6073 = __ctype_b_loc ();
      D.6074 = *D.6073;
      D.6075 = *s;
      D.6076 = (unsigned int) D.6075;
      D.6077 = D.6076 * 2;
      D.6078 = D.6074 + D.6077;
      D.6079 = *D.6078;
      D.6080 = (int) D.6079;
      D.6081 = D.6080 & 8192;
      if (D.6081 == 0) goto <D.5794>; else goto <D.5796>;
      <D.5796>:
      D.6075 = *s;
      if (D.6075 == 0) goto <D.6087>; else goto <D.6088>;
      <D.6087>:
      if (error != 0B) goto <D.6089>; else goto <D.6090>;
      <D.6089>:
      *error = 2;
      <D.6090>:
      D.6063 = 0;
      return D.6063;
      <D.6088>:
      i = 0;
      goto <D.5804>;
      <D.5803>:
      goto <D.5798>;
      <D.5797>:
      s = s + 1;
      <D.5798>:
      D.6073 = __ctype_b_loc ();
      D.6074 = *D.6073;
      D.6075 = *s;
      D.6076 = (unsigned int) D.6075;
      D.6077 = D.6076 * 2;
      D.6078 = D.6074 + D.6077;
      D.6079 = *D.6078;
      D.6080 = (int) D.6079;
      D.6081 = D.6080 & 8192;
      if (D.6081 != 0) goto <D.5797>; else goto <D.5799>;
      <D.5799>:
      D.6075 = *s;
      if (D.6075 == 0) goto <D.6091>; else goto <D.6092>;
      <D.6091>:
      if (error != 0B) goto <D.6093>; else goto <D.6094>;
      <D.6093>:
      *error = 2;
      <D.6094>:
      D.6063 = 0;
      return D.6063;
      <D.6092>:
      goto <D.5801>;
      <D.5800>:
      s = s + 1;
      <D.5801>:
      D.6075 = *s;
      if (D.6075 != 0) goto <D.6095>; else goto <D.5802>;
      <D.6095>:
      D.6073 = __ctype_b_loc ();
      D.6074 = *D.6073;
      D.6075 = *s;
      D.6076 = (unsigned int) D.6075;
      D.6077 = D.6076 * 2;
      D.6078 = D.6074 + D.6077;
      D.6079 = *D.6078;
      D.6080 = (int) D.6079;
      D.6081 = D.6080 & 8192;
      if (D.6081 == 0) goto <D.5800>; else goto <D.5802>;
      <D.5802>:
      D.6075 = *s;
      if (D.6075 == 0) goto <D.6096>; else goto <D.6097>;
      <D.6096>:
      if (error != 0B) goto <D.6098>; else goto <D.6099>;
      <D.6098>:
      *error = 2;
      <D.6099>:
      D.6063 = 0;
      return D.6063;
      <D.6097>:
      i = i + 1;
      <D.5804>:
      if (i < pos) goto <D.5803>; else goto <D.5805>;
      <D.5805>:
      D.6100 = strtoul (s, &end, 0);
      value = (gint64) D.6100;
      if (sum != 0) goto <D.6101>; else goto <D.6102>;
      <D.6101>:
      goto <D.5807>;
      <D.5806>:
      s = s + 1;
      <D.5807>:
      D.6073 = __ctype_b_loc ();
      D.6074 = *D.6073;
      D.6075 = *s;
      D.6076 = (unsigned int) D.6075;
      D.6077 = D.6076 * 2;
      D.6078 = D.6074 + D.6077;
      D.6079 = *D.6078;
      D.6080 = (int) D.6079;
      D.6081 = D.6080 & 8192;
      if (D.6081 != 0) goto <D.5806>; else goto <D.5808>;
      <D.5808>:
      D.6075 = *s;
      if (D.6075 == 0) goto <D.6103>; else goto <D.6104>;
      <D.6103>:
      if (error != 0B) goto <D.6105>; else goto <D.6106>;
      <D.6105>:
      *error = 2;
      <D.6106>:
      D.6063 = 0;
      return D.6063;
      <D.6104>:
      D.6107 = strtoul (s, &end, 0);
      D.6108 = (long long int) D.6107;
      value = D.6108 + value;
      <D.6102>:
      if (error != 0B) goto <D.6109>; else goto <D.6110>;
      <D.6109>:
      *error = 0;
      <D.6110>:
      D.6063 = value;
      return D.6063;
    }
  finally
    {
      buf = {CLOBBER};
      end = {CLOBBER};
    }
}


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

  user_hz.13 = user_hz;
  if (user_hz.13 == 0) goto <D.6114>; else goto <D.6115>;
  <D.6114>:
  user_hz.14 = sysconf (2);
  user_hz = user_hz.14;
  user_hz.13 = user_hz;
  if (user_hz.13 == 0) goto <D.6117>; else goto <D.6118>;
  <D.6117>:
  user_hz = 100;
  <D.6118>:
  <D.6115>:
  D.6119 = user_hz;
  return D.6119;
}


get_process_stat_time (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6121;
  long long int D.6122;
  int D.6123;
  long long int D.6124;
  gint64 val;

  val = get_process_stat_item (pid, pos, sum, error);
  D.6122 = val * 10000000;
  D.6123 = get_user_hz ();
  D.6124 = (long long int) D.6123;
  D.6121 = D.6122 / D.6124;
  return D.6121;
}


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

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


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

  count = 0;
  count = sysconf (84);
  if (count > 0) goto <D.6129>; else goto <D.6130>;
  <D.6129>:
  D.6131 = count;
  return D.6131;
  <D.6130>:
  D.6131 = 1;
  return D.6131;
}


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

  try
    {
      value = 0;
      if (error != 0B) goto <D.6133>; else goto <D.6134>;
      <D.6133>:
      *error = 0;
      <D.6134>:
      switch (data) <default: <D.6136>, case 0: <D.5904>, case 1: <D.5906>, case 2: <D.5907>, case 3: <D.5908>, case 4: <D.5909>, case 5: <D.5910>>
      <D.5904>:
      get_cpu_times (cpu_id, &value, 0B, 0B, 0B, 0B);
      goto <D.5905>;
      <D.5906>:
      get_cpu_times (cpu_id, 0B, &value, 0B, 0B, 0B);
      goto <D.5905>;
      <D.5907>:
      get_cpu_times (cpu_id, 0B, 0B, &value, 0B, 0B);
      goto <D.5905>;
      <D.5908>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, &value, 0B);
      goto <D.5905>;
      <D.5909>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, 0B, &value);
      goto <D.5905>;
      <D.5910>:
      D.6135 = 0;
      return D.6135;
      <D.6136>:
      <D.5905>:
      D.6135 = value;
      return D.6135;
    }
  finally
    {
      value = {CLOBBER};
    }
}


get_cpu_times (int cpu_id, gint64 * user, gint64 * systemt, gint64 * irq, gint64 * sirq, gint64 * idle)
{
  int D.6143;
  int D.6147;
  const short unsigned int * * D.6149;
  const short unsigned int * D.6150;
  char * D.6151;
  char D.6152;
  unsigned int D.6153;
  unsigned int D.6154;
  const short unsigned int * D.6155;
  short unsigned int D.6156;
  int D.6157;
  int D.6158;
  char * data.15;
  int D.6164;
  long int D.6166;
  char * data.16;
  char * data.17;
  long long unsigned int D.6174;
  long long unsigned int D.6175;
  long long unsigned int D.6176;
  long long unsigned int D.6177;
  long long int D.6178;
  long long unsigned int D.6181;
  long long unsigned int D.6182;
  long long int D.6183;
  long long unsigned int D.6186;
  long long unsigned int D.6187;
  long long int D.6188;
  long long unsigned int D.6191;
  long long unsigned int D.6192;
  long long int D.6193;
  long long unsigned int D.6196;
  long long unsigned int D.6197;
  long long int D.6198;
  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.6139>; else goto <D.6140>;
      <D.6139>:
      return;
      <D.6140>:
      if (cpu_id < 0) goto <D.6141>; else goto <D.6142>;
      <D.6141>:
      D.6143 = mono_cpu_count ();
      hz = D.6143 * hz;
      <D.6142>:
      goto <D.5895>;
      <D.5897>:
      {
        char * data;

        try
          {
            data = 0B;
            if (cpu_id < 0) goto <D.6146>; else goto <D.6144>;
            <D.6146>:
            D.6147 = strncmp (s, "cpu", 3);
            if (D.6147 == 0) goto <D.6148>; else goto <D.6144>;
            <D.6148>:
            D.6149 = __ctype_b_loc ();
            D.6150 = *D.6149;
            D.6151 = s + 3;
            D.6152 = *D.6151;
            D.6153 = (unsigned int) D.6152;
            D.6154 = D.6153 * 2;
            D.6155 = D.6150 + D.6154;
            D.6156 = *D.6155;
            D.6157 = (int) D.6156;
            D.6158 = D.6157 & 8192;
            if (D.6158 != 0) goto <D.6159>; else goto <D.6144>;
            <D.6159>:
            data.15 = s + 4;
            data = data.15;
            goto <D.6145>;
            <D.6144>:
            if (cpu_id >= 0) goto <D.6163>; else goto <D.6161>;
            <D.6163>:
            D.6164 = strncmp (s, "cpu", 3);
            if (D.6164 == 0) goto <D.6165>; else goto <D.6161>;
            <D.6165>:
            D.6151 = s + 3;
            D.6166 = strtol (D.6151, &data, 10);
            if (D.6166 == cpu_id) goto <D.6167>; else goto <D.6161>;
            <D.6167>:
            D.6151 = s + 3;
            data.16 = data;
            if (D.6151 == data.16) goto <D.6169>; else goto <D.6170>;
            <D.6169>:
            // predicted unlikely by continue predictor.
            goto <D.5895>;
            <D.6170>:
            data.16 = data;
            data.17 = data.16 + 1;
            data = data.17;
            goto <D.6162>;
            <D.6161>:
            // predicted unlikely by continue predictor.
            goto <D.5895>;
            <D.6162>:
            <D.6145>:
            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.5896>;
          }
        finally
          {
            data = {CLOBBER};
          }
      }
      <D.5895>:
      s = fgets (&buf, 256, f);
      if (s != 0B) goto <D.5897>; else goto <D.5896>;
      <D.5896>:
      fclose (f);
      if (user != 0B) goto <D.6172>; else goto <D.6173>;
      <D.6172>:
      D.6174 = user_ticks + nice_ticks;
      D.6175 = D.6174 * 10000000;
      D.6176 = (long long unsigned int) hz;
      D.6177 = D.6175 / D.6176;
      D.6178 = (long long int) D.6177;
      *user = D.6178;
      <D.6173>:
      if (systemt != 0B) goto <D.6179>; else goto <D.6180>;
      <D.6179>:
      D.6181 = system_ticks * 10000000;
      D.6176 = (long long unsigned int) hz;
      D.6182 = D.6181 / D.6176;
      D.6183 = (long long int) D.6182;
      *systemt = D.6183;
      <D.6180>:
      if (irq != 0B) goto <D.6184>; else goto <D.6185>;
      <D.6184>:
      D.6186 = irq_ticks * 10000000;
      D.6176 = (long long unsigned int) hz;
      D.6187 = D.6186 / D.6176;
      D.6188 = (long long int) D.6187;
      *irq = D.6188;
      <D.6185>:
      if (sirq != 0B) goto <D.6189>; else goto <D.6190>;
      <D.6189>:
      D.6191 = sirq_ticks * 10000000;
      D.6176 = (long long unsigned int) hz;
      D.6192 = D.6191 / D.6176;
      D.6193 = (long long int) D.6192;
      *sirq = D.6193;
      <D.6190>:
      if (idle != 0B) goto <D.6194>; else goto <D.6195>;
      <D.6194>:
      D.6196 = idle_ticks * 10000000;
      D.6176 = (long long unsigned int) hz;
      D.6197 = D.6196 / D.6176;
      D.6198 = (long long int) D.6197;
      *idle = D.6198;
      <D.6195>:
    }
  finally
    {
      buf = {CLOBBER};
    }
}


