mono_process_list (int * size)
{
  void * * D.6264;
  long int D.6265;
  char * nend.0;
  char D.6271;
  long unsigned int D.6277;
  long unsigned int D.6278;
  int i.1;
  long unsigned int D.6280;
  long unsigned int D.6281;
  void * * D.6282;
  long int D.6283;
  void * D.6284;
  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.6260>; else goto <D.6261>;
  <D.6260>:
  if (size != 0B) goto <D.6262>; else goto <D.6263>;
  <D.6262>:
  *size = 0;
  <D.6263>:
  D.6264 = 0B;
  return D.6264;
  <D.6261>:
  goto <D.6085>;
  <D.6086>:
  {
    int pid;
    char * nend;

    try
      {
        D.6265 = strtol (name, &nend, 10);
        pid = (int) D.6265;
        if (pid <= 0) goto <D.6266>; else goto <D.6268>;
        <D.6268>:
        nend.0 = nend;
        if (nend.0 == name) goto <D.6266>; else goto <D.6270>;
        <D.6270>:
        nend.0 = nend;
        D.6271 = *nend.0;
        if (D.6271 != 0) goto <D.6266>; else goto <D.6267>;
        <D.6266>:
        // predicted unlikely by continue predictor.
        goto <D.6085>;
        <D.6267>:
        if (i >= count) goto <D.6272>; else goto <D.6273>;
        <D.6272>:
        if (count == 0) goto <D.6274>; else goto <D.6275>;
        <D.6274>:
        count = 16;
        goto <D.6276>;
        <D.6275>:
        count = count * 2;
        <D.6276>:
        D.6277 = (long unsigned int) count;
        D.6278 = D.6277 * 8;
        buf = monoeg_realloc (buf, D.6278);
        <D.6273>:
        i.1 = i;
        i = i.1 + 1;
        D.6280 = (long unsigned int) i.1;
        D.6281 = D.6280 * 8;
        D.6282 = buf + D.6281;
        D.6283 = (long int) pid;
        D.6284 = (void *) D.6283;
        *D.6282 = D.6284;
      }
    finally
      {
        nend = {CLOBBER};
      }
  }
  <D.6085>:
  name = monoeg_g_dir_read_name (dir);
  if (name != 0B) goto <D.6086>; else goto <D.6087>;
  <D.6087>:
  monoeg_g_dir_close (dir);
  if (size != 0B) goto <D.6285>; else goto <D.6286>;
  <D.6285>:
  *size = i;
  <D.6286>:
  D.6264 = buf;
  return D.6264;
}


mono_process_get_name (void * pid, char * buf, int len)
{
  long int pid.2;
  int D.6291;
  char * D.6294;
  int D.6295;
  long unsigned int D.6296;
  long unsigned int D.6297;
  sizetype D.6298;
  char * D.6299;
  char fname[128];
  struct FILE * file;
  char * p;
  int r;

  try
    {
      pid.2 = (long int) pid;
      D.6291 = (int) pid.2;
      sprintf (&fname, "/proc/%d/cmdline", D.6291);
      *buf = 0;
      file = fopen (&fname, "r");
      if (file == 0B) goto <D.6292>; else goto <D.6293>;
      <D.6292>:
      D.6294 = buf;
      return D.6294;
      <D.6293>:
      D.6295 = len + -1;
      D.6296 = (long unsigned int) D.6295;
      D.6297 = fread (buf, 1, D.6296, file);
      r = (int) D.6297;
      fclose (file);
      D.6298 = (sizetype) r;
      D.6299 = buf + D.6298;
      *D.6299 = 0;
      p = strrchr (buf, 47);
      if (p != 0B) goto <D.6300>; else goto <D.6301>;
      <D.6300>:
      D.6294 = p + 1;
      return D.6294;
      <D.6301>:
      if (r == 0) goto <D.6302>; else goto <D.6303>;
      <D.6302>:
      pid.2 = (long int) pid;
      D.6291 = (int) pid.2;
      D.6294 = get_pid_status_item_buf (D.6291, "Name", buf, len, 0B);
      return D.6294;
      <D.6303>:
      D.6294 = buf;
      return D.6294;
    }
  finally
    {
      fname = {CLOBBER};
    }
}


sprintf (char * restrict __s, const char * restrict __fmt)
{
  int D.6306;
  long unsigned int D.6307;

  D.6307 = __builtin_object_size (__s, 1);
  D.6306 = __builtin___sprintf_chk (__s, 1, D.6307, __fmt, __builtin_va_arg_pack ());
  return D.6306;
}


fread (void * restrict __ptr, size_t __size, size_t __n, struct FILE * restrict __stream)
{
  long unsigned int D.6309;
  int D.6314;
  int D.6316;
  long unsigned int D.6318;
  size_t D.6319;
  long unsigned int D.6320;
  long unsigned int D.6321;
  long unsigned int D.6322;
  long unsigned int D.6325;

  D.6309 = __builtin_object_size (__ptr, 0);
  if (D.6309 != 18446744073709551615) goto <D.6310>; else goto <D.6311>;
  <D.6310>:
  D.6314 = __builtin_constant_p (__size);
  if (D.6314 == 0) goto <D.6312>; else goto <D.6315>;
  <D.6315>:
  D.6316 = __builtin_constant_p (__n);
  if (D.6316 == 0) goto <D.6312>; else goto <D.6317>;
  <D.6317>:
  D.6318 = __size | __n;
  if (D.6318 > 4294967295) goto <D.6312>; else goto <D.6313>;
  <D.6312>:
  D.6320 = __builtin_object_size (__ptr, 0);
  D.6319 = __fread_chk (__ptr, D.6320, __size, __n, __stream);
  return D.6319;
  <D.6313>:
  D.6321 = __size * __n;
  D.6322 = __builtin_object_size (__ptr, 0);
  if (D.6321 > D.6322) goto <D.6323>; else goto <D.6324>;
  <D.6323>:
  D.6325 = __builtin_object_size (__ptr, 0);
  D.6319 = __fread_chk_warn (__ptr, D.6325, __size, __n, __stream);
  return D.6319;
  <D.6324>:
  <D.6311>:
  D.6319 = __fread_alias (__ptr, __size, __n, __stream);
  return D.6319;
}


get_pid_status_item_buf (int pid, const char * item, char * rbuf, int blen, MonoProcessError * error)
{
  long unsigned int D.6327;
  char * D.6332;
  char D.6333;
  char D.6334;
  long unsigned int D.6337;
  int D.6338;
  sizetype D.6341;
  const short unsigned int * * D.6342;
  const short unsigned int * D.6343;
  char D.6344;
  long unsigned int D.6345;
  long unsigned int D.6346;
  const short unsigned int * D.6347;
  short unsigned int D.6348;
  int D.6349;
  int D.6350;
  char * s.3;
  char D.6352;
  long unsigned int D.6355;
  int D.6356;
  long unsigned int D.6357;
  sizetype iftmp.4;
  sizetype D.6362;
  char * D.6363;
  char buf[256];
  char * s;
  struct FILE * f;
  int len;

  try
    {
      D.6327 = strlen (item);
      len = (int) D.6327;
      monoeg_g_snprintf (&buf, 256, "/proc/%d/status", pid);
      f = fopen (&buf, "r");
      if (f == 0B) goto <D.6328>; else goto <D.6329>;
      <D.6328>:
      if (error != 0B) goto <D.6330>; else goto <D.6331>;
      <D.6330>:
      *error = 1;
      <D.6331>:
      D.6332 = 0B;
      return D.6332;
      <D.6329>:
      goto <D.6099>;
      <D.6115>:
      D.6333 = *item;
      D.6334 = buf[0];
      if (D.6333 != D.6334) goto <D.6335>; else goto <D.6336>;
      <D.6335>:
      // predicted unlikely by continue predictor.
      goto <D.6099>;
      <D.6336>:
      D.6337 = (long unsigned int) len;
      D.6338 = strncmp (&buf, item, D.6337);
      if (D.6338 != 0) goto <D.6339>; else goto <D.6340>;
      <D.6339>:
      // predicted unlikely by continue predictor.
      goto <D.6099>;
      <D.6340>:
      D.6341 = (sizetype) len;
      s = &buf + D.6341;
      goto <D.6110>;
      <D.6109>:
      s = s + 1;
      <D.6110>:
      D.6342 = __ctype_b_loc ();
      D.6343 = *D.6342;
      D.6344 = *s;
      D.6345 = (long unsigned int) D.6344;
      D.6346 = D.6345 * 2;
      D.6347 = D.6343 + D.6346;
      D.6348 = *D.6347;
      D.6349 = (int) D.6348;
      D.6350 = D.6349 & 8192;
      if (D.6350 != 0) goto <D.6109>; else goto <D.6111>;
      <D.6111>:
      s.3 = s;
      s = s.3 + 1;
      D.6352 = *s.3;
      if (D.6352 != 58) goto <D.6353>; else goto <D.6354>;
      <D.6353>:
      // predicted unlikely by continue predictor.
      goto <D.6099>;
      <D.6354>:
      goto <D.6113>;
      <D.6112>:
      s = s + 1;
      <D.6113>:
      D.6342 = __ctype_b_loc ();
      D.6343 = *D.6342;
      D.6344 = *s;
      D.6345 = (long unsigned int) D.6344;
      D.6346 = D.6345 * 2;
      D.6347 = D.6343 + D.6346;
      D.6348 = *D.6347;
      D.6349 = (int) D.6348;
      D.6350 = D.6349 & 8192;
      if (D.6350 != 0) goto <D.6112>; else goto <D.6114>;
      <D.6114>:
      fclose (f);
      D.6355 = strlen (s);
      len = (int) D.6355;
      D.6356 = MIN_EXPR <blen, len>;
      D.6357 = (long unsigned int) D.6356;
      strncpy (rbuf, s, D.6357);
      if (len < blen) goto <D.6359>; else goto <D.6360>;
      <D.6359>:
      D.6341 = (sizetype) len;
      iftmp.4 = D.6341 + 18446744073709551615;
      goto <D.6361>;
      <D.6360>:
      D.6362 = (sizetype) blen;
      iftmp.4 = D.6362 + 18446744073709551615;
      <D.6361>:
      D.6363 = rbuf + iftmp.4;
      *D.6363 = 0;
      if (error != 0B) goto <D.6364>; else goto <D.6365>;
      <D.6364>:
      *error = 0;
      <D.6365>:
      D.6332 = rbuf;
      return D.6332;
      <D.6099>:
      s = fgets (&buf, blen, f);
      if (s != 0B) goto <D.6115>; else goto <D.6116>;
      <D.6116>:
      fclose (f);
      if (error != 0B) goto <D.6366>; else goto <D.6367>;
      <D.6366>:
      *error = 2;
      <D.6367>:
      D.6332 = 0B;
      return D.6332;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


strncpy (char * restrict __dest, const char * restrict __src, size_t __len)
{
  char * D.6370;
  long unsigned int D.6371;

  D.6371 = __builtin_object_size (__dest, 1);
  D.6370 = __builtin___strncpy_chk (__dest, __src, __len, D.6371);
  return D.6370;
}


fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  long unsigned int D.6373;
  int D.6378;
  char * D.6380;
  long unsigned int D.6381;
  long unsigned int D.6382;
  long unsigned int D.6383;
  long unsigned int D.6386;

  D.6373 = __builtin_object_size (__s, 1);
  if (D.6373 != 18446744073709551615) goto <D.6374>; else goto <D.6375>;
  <D.6374>:
  D.6378 = __builtin_constant_p (__n);
  if (D.6378 == 0) goto <D.6376>; else goto <D.6379>;
  <D.6379>:
  if (__n <= 0) goto <D.6376>; else goto <D.6377>;
  <D.6376>:
  D.6381 = __builtin_object_size (__s, 1);
  D.6380 = __fgets_chk (__s, D.6381, __n, __stream);
  return D.6380;
  <D.6377>:
  D.6382 = (long unsigned int) __n;
  D.6383 = __builtin_object_size (__s, 1);
  if (D.6382 > D.6383) goto <D.6384>; else goto <D.6385>;
  <D.6384>:
  D.6386 = __builtin_object_size (__s, 1);
  D.6380 = __fgets_chk_warn (__s, D.6386, __n, __stream);
  return D.6380;
  <D.6385>:
  <D.6375>:
  D.6380 = __fgets_alias (__s, __n, __stream);
  return D.6380;
}


mono_process_get_data_with_error (void * pid, MonoProcessData data, MonoProcessError * error)
{
  long int pid.5;
  gint64 D.6391;
  long int D.6396;
  int D.6397;
  long int D.6398;
  gint64 val;
  int rpid;

  pid.5 = (long int) pid;
  rpid = (int) pid.5;
  if (error != 0B) goto <D.6389>; else goto <D.6390>;
  <D.6389>:
  *error = 2;
  <D.6390>:
  switch (data) <default: <D.6399>, case 0: <D.6183>, case 1: <D.6184>, case 2: <D.6185>, case 3: <D.6186>, case 4: <D.6187>, case 5: <D.6188>, case 6: <D.6189>, case 7: <D.6190>, case 8: <D.6191>, case 9: <D.6192>, case 10: <D.6193>, case 11: <D.6194>, case 12: <D.6195>>
  <D.6183>:
  D.6391 = get_pid_status_item (rpid, "Threads", error, 1);
  return D.6391;
  <D.6184>:
  D.6391 = get_process_stat_time (rpid, 10, 0, error);
  return D.6391;
  <D.6185>:
  D.6391 = get_process_stat_time (rpid, 11, 0, error);
  return D.6391;
  <D.6186>:
  D.6391 = get_process_stat_time (rpid, 10, 1, error);
  return D.6391;
  <D.6187>:
  D.6391 = get_pid_status_item (rpid, "VmRSS", error, 1024);
  return D.6391;
  <D.6188>:
  val = get_pid_status_item (rpid, "VmHWM", error, 1024);
  if (val == 0) goto <D.6392>; else goto <D.6393>;
  <D.6392>:
  val = get_pid_status_item (rpid, "VmRSS", error, 1024);
  <D.6393>:
  D.6391 = val;
  return D.6391;
  <D.6189>:
  D.6391 = get_pid_status_item (rpid, "VmData", error, 1024);
  return D.6391;
  <D.6190>:
  D.6391 = get_pid_status_item (rpid, "VmSize", error, 1024);
  return D.6391;
  <D.6191>:
  val = get_pid_status_item (rpid, "VmPeak", error, 1024);
  if (val == 0) goto <D.6394>; else goto <D.6395>;
  <D.6394>:
  val = get_pid_status_item (rpid, "VmSize", error, 1024);
  <D.6395>:
  D.6391 = val;
  return D.6391;
  <D.6192>:
  D.6391 = get_process_stat_item (rpid, 6, 1, error);
  return D.6391;
  <D.6193>:
  D.6396 = get_process_stat_item (rpid, 18, 0, error);
  D.6397 = get_user_hz ();
  D.6398 = (long int) D.6397;
  D.6391 = D.6396 / D.6398;
  return D.6391;
  <D.6194>:
  D.6391 = get_process_stat_time (rpid, 0, 0, error);
  return D.6391;
  <D.6195>:
  D.6391 = 0;
  return D.6391;
  <D.6399>:
  D.6391 = 0;
  return D.6391;
}


get_pid_status_item (int pid, const char * item, MonoProcessError * error, int multiplier)
{
  gint64 D.6403;
  long int D.6404;
  long int D.6405;
  char buf[64];
  char * s;

  try
    {
      s = get_pid_status_item_buf (pid, item, &buf, 64, error);
      if (s != 0B) goto <D.6401>; else goto <D.6402>;
      <D.6401>:
      D.6404 = atol (s);
      D.6405 = (long int) multiplier;
      D.6403 = D.6404 * D.6405;
      return D.6403;
      <D.6402>:
      D.6403 = 0;
      return D.6403;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


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

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


get_process_stat_item (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6414;
  long unsigned int D.6415;
  const short unsigned int * * D.6424;
  const short unsigned int * D.6425;
  char D.6426;
  long unsigned int D.6427;
  long unsigned int D.6428;
  const short unsigned int * D.6429;
  short unsigned int D.6430;
  int D.6431;
  int D.6432;
  long unsigned int D.6451;
  long unsigned int D.6458;
  long unsigned int value.6;
  long unsigned int D.6460;
  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.6410>; else goto <D.6411>;
      <D.6410>:
      if (error != 0B) goto <D.6412>; else goto <D.6413>;
      <D.6412>:
      *error = 1;
      <D.6413>:
      D.6414 = 0;
      return D.6414;
      <D.6411>:
      D.6415 = fread (&buf, 1, 512, f);
      len = (int) D.6415;
      fclose (f);
      if (len <= 0) goto <D.6416>; else goto <D.6417>;
      <D.6416>:
      if (error != 0B) goto <D.6418>; else goto <D.6419>;
      <D.6418>:
      *error = 2;
      <D.6419>:
      D.6414 = 0;
      return D.6414;
      <D.6417>:
      s = __builtin_strchr (&buf, 41);
      if (s == 0B) goto <D.6420>; else goto <D.6421>;
      <D.6420>:
      if (error != 0B) goto <D.6422>; else goto <D.6423>;
      <D.6422>:
      *error = 2;
      <D.6423>:
      D.6414 = 0;
      return D.6414;
      <D.6421>:
      s = s + 1;
      goto <D.6140>;
      <D.6139>:
      s = s + 1;
      <D.6140>:
      D.6424 = __ctype_b_loc ();
      D.6425 = *D.6424;
      D.6426 = *s;
      D.6427 = (long unsigned int) D.6426;
      D.6428 = D.6427 * 2;
      D.6429 = D.6425 + D.6428;
      D.6430 = *D.6429;
      D.6431 = (int) D.6430;
      D.6432 = D.6431 & 8192;
      if (D.6432 != 0) goto <D.6139>; else goto <D.6141>;
      <D.6141>:
      D.6426 = *s;
      if (D.6426 == 0) goto <D.6433>; else goto <D.6434>;
      <D.6433>:
      if (error != 0B) goto <D.6435>; else goto <D.6436>;
      <D.6435>:
      *error = 2;
      <D.6436>:
      D.6414 = 0;
      return D.6414;
      <D.6434>:
      goto <D.6143>;
      <D.6142>:
      s = s + 1;
      <D.6143>:
      D.6426 = *s;
      if (D.6426 != 0) goto <D.6437>; else goto <D.6144>;
      <D.6437>:
      D.6424 = __ctype_b_loc ();
      D.6425 = *D.6424;
      D.6426 = *s;
      D.6427 = (long unsigned int) D.6426;
      D.6428 = D.6427 * 2;
      D.6429 = D.6425 + D.6428;
      D.6430 = *D.6429;
      D.6431 = (int) D.6430;
      D.6432 = D.6431 & 8192;
      if (D.6432 == 0) goto <D.6142>; else goto <D.6144>;
      <D.6144>:
      D.6426 = *s;
      if (D.6426 == 0) goto <D.6438>; else goto <D.6439>;
      <D.6438>:
      if (error != 0B) goto <D.6440>; else goto <D.6441>;
      <D.6440>:
      *error = 2;
      <D.6441>:
      D.6414 = 0;
      return D.6414;
      <D.6439>:
      i = 0;
      goto <D.6152>;
      <D.6151>:
      goto <D.6146>;
      <D.6145>:
      s = s + 1;
      <D.6146>:
      D.6424 = __ctype_b_loc ();
      D.6425 = *D.6424;
      D.6426 = *s;
      D.6427 = (long unsigned int) D.6426;
      D.6428 = D.6427 * 2;
      D.6429 = D.6425 + D.6428;
      D.6430 = *D.6429;
      D.6431 = (int) D.6430;
      D.6432 = D.6431 & 8192;
      if (D.6432 != 0) goto <D.6145>; else goto <D.6147>;
      <D.6147>:
      D.6426 = *s;
      if (D.6426 == 0) goto <D.6442>; else goto <D.6443>;
      <D.6442>:
      if (error != 0B) goto <D.6444>; else goto <D.6445>;
      <D.6444>:
      *error = 2;
      <D.6445>:
      D.6414 = 0;
      return D.6414;
      <D.6443>:
      goto <D.6149>;
      <D.6148>:
      s = s + 1;
      <D.6149>:
      D.6426 = *s;
      if (D.6426 != 0) goto <D.6446>; else goto <D.6150>;
      <D.6446>:
      D.6424 = __ctype_b_loc ();
      D.6425 = *D.6424;
      D.6426 = *s;
      D.6427 = (long unsigned int) D.6426;
      D.6428 = D.6427 * 2;
      D.6429 = D.6425 + D.6428;
      D.6430 = *D.6429;
      D.6431 = (int) D.6430;
      D.6432 = D.6431 & 8192;
      if (D.6432 == 0) goto <D.6148>; else goto <D.6150>;
      <D.6150>:
      D.6426 = *s;
      if (D.6426 == 0) goto <D.6447>; else goto <D.6448>;
      <D.6447>:
      if (error != 0B) goto <D.6449>; else goto <D.6450>;
      <D.6449>:
      *error = 2;
      <D.6450>:
      D.6414 = 0;
      return D.6414;
      <D.6448>:
      i = i + 1;
      <D.6152>:
      if (i < pos) goto <D.6151>; else goto <D.6153>;
      <D.6153>:
      D.6451 = strtoul (s, &end, 0);
      value = (gint64) D.6451;
      if (sum != 0) goto <D.6452>; else goto <D.6453>;
      <D.6452>:
      goto <D.6155>;
      <D.6154>:
      s = s + 1;
      <D.6155>:
      D.6424 = __ctype_b_loc ();
      D.6425 = *D.6424;
      D.6426 = *s;
      D.6427 = (long unsigned int) D.6426;
      D.6428 = D.6427 * 2;
      D.6429 = D.6425 + D.6428;
      D.6430 = *D.6429;
      D.6431 = (int) D.6430;
      D.6432 = D.6431 & 8192;
      if (D.6432 != 0) goto <D.6154>; else goto <D.6156>;
      <D.6156>:
      D.6426 = *s;
      if (D.6426 == 0) goto <D.6454>; else goto <D.6455>;
      <D.6454>:
      if (error != 0B) goto <D.6456>; else goto <D.6457>;
      <D.6456>:
      *error = 2;
      <D.6457>:
      D.6414 = 0;
      return D.6414;
      <D.6455>:
      D.6458 = strtoul (s, &end, 0);
      value.6 = (long unsigned int) value;
      D.6460 = D.6458 + value.6;
      value = (gint64) D.6460;
      <D.6453>:
      if (error != 0B) goto <D.6461>; else goto <D.6462>;
      <D.6461>:
      *error = 0;
      <D.6462>:
      D.6414 = value;
      return D.6414;
    }
  finally
    {
      buf = {CLOBBER};
      end = {CLOBBER};
    }
}


get_user_hz ()
{
  int user_hz.7;
  long int D.6468;
  int user_hz.8;
  int D.6472;
  static int user_hz = 0;

  user_hz.7 = user_hz;
  if (user_hz.7 == 0) goto <D.6466>; else goto <D.6467>;
  <D.6466>:
  D.6468 = sysconf (2);
  user_hz.8 = (int) D.6468;
  user_hz = user_hz.8;
  user_hz.7 = user_hz;
  if (user_hz.7 == 0) goto <D.6470>; else goto <D.6471>;
  <D.6470>:
  user_hz = 100;
  <D.6471>:
  <D.6467>:
  D.6472 = user_hz;
  return D.6472;
}


get_process_stat_time (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6474;
  long int D.6475;
  int D.6476;
  long int D.6477;
  gint64 val;

  val = get_process_stat_item (pid, pos, sum, error);
  D.6475 = val * 10000000;
  D.6476 = get_user_hz ();
  D.6477 = (long int) D.6476;
  D.6474 = D.6475 / D.6477;
  return D.6474;
}


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

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


mono_cpu_count ()
{
  long int D.6482;
  int D.6485;
  int count;

  count = 0;
  D.6482 = sysconf (84);
  count = (int) D.6482;
  if (count > 0) goto <D.6483>; else goto <D.6484>;
  <D.6483>:
  D.6485 = count;
  return D.6485;
  <D.6484>:
  D.6485 = 1;
  return D.6485;
}


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

  try
    {
      value = 0;
      if (error != 0B) goto <D.6487>; else goto <D.6488>;
      <D.6487>:
      *error = 0;
      <D.6488>:
      switch (data) <default: <D.6490>, case 0: <D.6252>, case 1: <D.6254>, case 2: <D.6255>, case 3: <D.6256>, case 4: <D.6257>, case 5: <D.6258>>
      <D.6252>:
      get_cpu_times (cpu_id, &value, 0B, 0B, 0B, 0B);
      goto <D.6253>;
      <D.6254>:
      get_cpu_times (cpu_id, 0B, &value, 0B, 0B, 0B);
      goto <D.6253>;
      <D.6255>:
      get_cpu_times (cpu_id, 0B, 0B, &value, 0B, 0B);
      goto <D.6253>;
      <D.6256>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, &value, 0B);
      goto <D.6253>;
      <D.6257>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, 0B, &value);
      goto <D.6253>;
      <D.6258>:
      D.6489 = 0;
      return D.6489;
      <D.6490>:
      <D.6253>:
      D.6489 = value;
      return D.6489;
    }
  finally
    {
      value = {CLOBBER};
    }
}


get_cpu_times (int cpu_id, gint64 * user, gint64 * systemt, gint64 * irq, gint64 * sirq, gint64 * idle)
{
  int D.6497;
  int D.6501;
  const short unsigned int * * D.6503;
  const short unsigned int * D.6504;
  char * D.6505;
  char D.6506;
  long unsigned int D.6507;
  long unsigned int D.6508;
  const short unsigned int * D.6509;
  short unsigned int D.6510;
  int D.6511;
  int D.6512;
  char * data.9;
  int D.6518;
  long int D.6520;
  long int D.6521;
  char * data.10;
  char * data.11;
  long unsigned int D.6529;
  long unsigned int D.6530;
  long unsigned int D.6531;
  long unsigned int D.6532;
  long int D.6533;
  long unsigned int D.6536;
  long unsigned int D.6537;
  long int D.6538;
  long unsigned int D.6541;
  long unsigned int D.6542;
  long int D.6543;
  long unsigned int D.6546;
  long unsigned int D.6547;
  long int D.6548;
  long unsigned int D.6551;
  long unsigned int D.6552;
  long int D.6553;
  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.6493>; else goto <D.6494>;
      <D.6493>:
      return;
      <D.6494>:
      if (cpu_id < 0) goto <D.6495>; else goto <D.6496>;
      <D.6495>:
      D.6497 = mono_cpu_count ();
      hz = D.6497 * hz;
      <D.6496>:
      goto <D.6243>;
      <D.6245>:
      {
        char * data;

        try
          {
            data = 0B;
            if (cpu_id < 0) goto <D.6500>; else goto <D.6498>;
            <D.6500>:
            D.6501 = strncmp (s, "cpu", 3);
            if (D.6501 == 0) goto <D.6502>; else goto <D.6498>;
            <D.6502>:
            D.6503 = __ctype_b_loc ();
            D.6504 = *D.6503;
            D.6505 = s + 3;
            D.6506 = *D.6505;
            D.6507 = (long unsigned int) D.6506;
            D.6508 = D.6507 * 2;
            D.6509 = D.6504 + D.6508;
            D.6510 = *D.6509;
            D.6511 = (int) D.6510;
            D.6512 = D.6511 & 8192;
            if (D.6512 != 0) goto <D.6513>; else goto <D.6498>;
            <D.6513>:
            data.9 = s + 4;
            data = data.9;
            goto <D.6499>;
            <D.6498>:
            if (cpu_id >= 0) goto <D.6517>; else goto <D.6515>;
            <D.6517>:
            D.6518 = strncmp (s, "cpu", 3);
            if (D.6518 == 0) goto <D.6519>; else goto <D.6515>;
            <D.6519>:
            D.6505 = s + 3;
            D.6520 = strtol (D.6505, &data, 10);
            D.6521 = (long int) cpu_id;
            if (D.6520 == D.6521) goto <D.6522>; else goto <D.6515>;
            <D.6522>:
            D.6505 = s + 3;
            data.10 = data;
            if (D.6505 == data.10) goto <D.6524>; else goto <D.6525>;
            <D.6524>:
            // predicted unlikely by continue predictor.
            goto <D.6243>;
            <D.6525>:
            data.10 = data;
            data.11 = data.10 + 1;
            data = data.11;
            goto <D.6516>;
            <D.6515>:
            // predicted unlikely by continue predictor.
            goto <D.6243>;
            <D.6516>:
            <D.6499>:
            data.10 = data;
            user_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            nice_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            system_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            idle_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            iowait_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            irq_ticks = strtoull (data.10, &data, 10);
            data.10 = data;
            sirq_ticks = strtoull (data.10, &data, 10);
            goto <D.6244>;
          }
        finally
          {
            data = {CLOBBER};
          }
      }
      <D.6243>:
      s = fgets (&buf, 256, f);
      if (s != 0B) goto <D.6245>; else goto <D.6244>;
      <D.6244>:
      fclose (f);
      if (user != 0B) goto <D.6527>; else goto <D.6528>;
      <D.6527>:
      D.6529 = user_ticks + nice_ticks;
      D.6530 = D.6529 * 10000000;
      D.6531 = (long unsigned int) hz;
      D.6532 = D.6530 / D.6531;
      D.6533 = (long int) D.6532;
      *user = D.6533;
      <D.6528>:
      if (systemt != 0B) goto <D.6534>; else goto <D.6535>;
      <D.6534>:
      D.6536 = system_ticks * 10000000;
      D.6531 = (long unsigned int) hz;
      D.6537 = D.6536 / D.6531;
      D.6538 = (long int) D.6537;
      *systemt = D.6538;
      <D.6535>:
      if (irq != 0B) goto <D.6539>; else goto <D.6540>;
      <D.6539>:
      D.6541 = irq_ticks * 10000000;
      D.6531 = (long unsigned int) hz;
      D.6542 = D.6541 / D.6531;
      D.6543 = (long int) D.6542;
      *irq = D.6543;
      <D.6540>:
      if (sirq != 0B) goto <D.6544>; else goto <D.6545>;
      <D.6544>:
      D.6546 = sirq_ticks * 10000000;
      D.6531 = (long unsigned int) hz;
      D.6547 = D.6546 / D.6531;
      D.6548 = (long int) D.6547;
      *sirq = D.6548;
      <D.6545>:
      if (idle != 0B) goto <D.6549>; else goto <D.6550>;
      <D.6549>:
      D.6551 = idle_ticks * 10000000;
      D.6531 = (long unsigned int) hz;
      D.6552 = D.6551 / D.6531;
      D.6553 = (long int) D.6552;
      *idle = D.6553;
      <D.6550>:
    }
  finally
    {
      buf = {CLOBBER};
    }
}


