mono_process_list (int * size)
{
  void * * D.6782;
  long int D.6783;
  char * nend.0;
  char D.6789;
  long unsigned int D.6795;
  long unsigned int D.6796;
  int i.1;
  long unsigned int D.6798;
  long unsigned int D.6799;
  void * * D.6800;
  long int D.6801;
  void * D.6802;
  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.6778>; else goto <D.6779>;
  <D.6778>:
  if (size != 0B) goto <D.6780>; else goto <D.6781>;
  <D.6780>:
  *size = 0;
  <D.6781>:
  D.6782 = 0B;
  return D.6782;
  <D.6779>:
  goto <D.6603>;
  <D.6604>:
  {
    int pid;
    char * nend;

    try
      {
        D.6783 = strtol (name, &nend, 10);
        pid = (int) D.6783;
        if (pid <= 0) goto <D.6784>; else goto <D.6786>;
        <D.6786>:
        nend.0 = nend;
        if (nend.0 == name) goto <D.6784>; else goto <D.6788>;
        <D.6788>:
        nend.0 = nend;
        D.6789 = *nend.0;
        if (D.6789 != 0) goto <D.6784>; else goto <D.6785>;
        <D.6784>:
        // predicted unlikely by continue predictor.
        goto <D.6603>;
        <D.6785>:
        if (i >= count) goto <D.6790>; else goto <D.6791>;
        <D.6790>:
        if (count == 0) goto <D.6792>; else goto <D.6793>;
        <D.6792>:
        count = 16;
        goto <D.6794>;
        <D.6793>:
        count = count * 2;
        <D.6794>:
        D.6795 = (long unsigned int) count;
        D.6796 = D.6795 * 8;
        buf = monoeg_realloc (buf, D.6796);
        <D.6791>:
        i.1 = i;
        i = i.1 + 1;
        D.6798 = (long unsigned int) i.1;
        D.6799 = D.6798 * 8;
        D.6800 = buf + D.6799;
        D.6801 = (long int) pid;
        D.6802 = (void *) D.6801;
        *D.6800 = D.6802;
      }
    finally
      {
        nend = {CLOBBER};
      }
  }
  <D.6603>:
  name = monoeg_g_dir_read_name (dir);
  if (name != 0B) goto <D.6604>; else goto <D.6605>;
  <D.6605>:
  monoeg_g_dir_close (dir);
  if (size != 0B) goto <D.6803>; else goto <D.6804>;
  <D.6803>:
  *size = i;
  <D.6804>:
  D.6782 = buf;
  return D.6782;
}


mono_process_get_name (void * pid, char * buf, int len)
{
  long int pid.2;
  int D.6809;
  char * D.6812;
  int D.6813;
  long unsigned int D.6814;
  long unsigned int D.6815;
  sizetype D.6816;
  char * D.6817;
  char fname[128];
  struct FILE * file;
  char * p;
  int r;

  try
    {
      pid.2 = (long int) pid;
      D.6809 = (int) pid.2;
      sprintf (&fname, "/proc/%d/cmdline", D.6809);
      *buf = 0;
      file = fopen (&fname, "r");
      if (file == 0B) goto <D.6810>; else goto <D.6811>;
      <D.6810>:
      D.6812 = buf;
      return D.6812;
      <D.6811>:
      D.6813 = len + -1;
      D.6814 = (long unsigned int) D.6813;
      D.6815 = fread (buf, 1, D.6814, file);
      r = (int) D.6815;
      fclose (file);
      D.6816 = (sizetype) r;
      D.6817 = buf + D.6816;
      *D.6817 = 0;
      p = strrchr (buf, 47);
      if (p != 0B) goto <D.6818>; else goto <D.6819>;
      <D.6818>:
      D.6812 = p + 1;
      return D.6812;
      <D.6819>:
      if (r == 0) goto <D.6820>; else goto <D.6821>;
      <D.6820>:
      pid.2 = (long int) pid;
      D.6809 = (int) pid.2;
      D.6812 = get_pid_status_item_buf (D.6809, "Name", buf, len, 0B);
      return D.6812;
      <D.6821>:
      D.6812 = buf;
      return D.6812;
    }
  finally
    {
      fname = {CLOBBER};
    }
}


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

  D.6825 = __builtin_object_size (__s, 1);
  D.6824 = __builtin___sprintf_chk (__s, 1, D.6825, __fmt, __builtin_va_arg_pack ());
  return D.6824;
}


fread (void * restrict __ptr, size_t __size, size_t __n, struct FILE * restrict __stream)
{
  long unsigned int D.6827;
  int D.6832;
  int D.6834;
  long unsigned int D.6836;
  size_t D.6837;
  long unsigned int D.6838;
  long unsigned int D.6839;
  long unsigned int D.6840;
  long unsigned int D.6843;

  D.6827 = __builtin_object_size (__ptr, 0);
  if (D.6827 != 18446744073709551615) goto <D.6828>; else goto <D.6829>;
  <D.6828>:
  D.6832 = __builtin_constant_p (__size);
  if (D.6832 == 0) goto <D.6830>; else goto <D.6833>;
  <D.6833>:
  D.6834 = __builtin_constant_p (__n);
  if (D.6834 == 0) goto <D.6830>; else goto <D.6835>;
  <D.6835>:
  D.6836 = __size | __n;
  if (D.6836 > 4294967295) goto <D.6830>; else goto <D.6831>;
  <D.6830>:
  D.6838 = __builtin_object_size (__ptr, 0);
  D.6837 = __fread_chk (__ptr, D.6838, __size, __n, __stream);
  return D.6837;
  <D.6831>:
  D.6839 = __size * __n;
  D.6840 = __builtin_object_size (__ptr, 0);
  if (D.6839 > D.6840) goto <D.6841>; else goto <D.6842>;
  <D.6841>:
  D.6843 = __builtin_object_size (__ptr, 0);
  D.6837 = __fread_chk_warn (__ptr, D.6843, __size, __n, __stream);
  return D.6837;
  <D.6842>:
  <D.6829>:
  D.6837 = __fread_alias (__ptr, __size, __n, __stream);
  return D.6837;
}


get_pid_status_item_buf (int pid, const char * item, char * rbuf, int blen, MonoProcessError * error)
{
  long unsigned int D.6845;
  char * D.6850;
  char D.6851;
  char D.6852;
  long unsigned int D.6855;
  int D.6856;
  sizetype D.6859;
  const short unsigned int * * D.6860;
  const short unsigned int * D.6861;
  char D.6862;
  long unsigned int D.6863;
  long unsigned int D.6864;
  const short unsigned int * D.6865;
  short unsigned int D.6866;
  int D.6867;
  int D.6868;
  char * s.3;
  char D.6870;
  long unsigned int D.6873;
  int D.6874;
  long unsigned int D.6875;
  sizetype iftmp.4;
  sizetype D.6880;
  char * D.6881;
  char buf[256];
  char * s;
  struct FILE * f;
  int len;

  try
    {
      D.6845 = strlen (item);
      len = (int) D.6845;
      monoeg_g_snprintf (&buf, 256, "/proc/%d/status", pid);
      f = fopen (&buf, "r");
      if (f == 0B) goto <D.6846>; else goto <D.6847>;
      <D.6846>:
      if (error != 0B) goto <D.6848>; else goto <D.6849>;
      <D.6848>:
      *error = 1;
      <D.6849>:
      D.6850 = 0B;
      return D.6850;
      <D.6847>:
      goto <D.6617>;
      <D.6633>:
      D.6851 = *item;
      D.6852 = buf[0];
      if (D.6851 != D.6852) goto <D.6853>; else goto <D.6854>;
      <D.6853>:
      // predicted unlikely by continue predictor.
      goto <D.6617>;
      <D.6854>:
      D.6855 = (long unsigned int) len;
      D.6856 = strncmp (&buf, item, D.6855);
      if (D.6856 != 0) goto <D.6857>; else goto <D.6858>;
      <D.6857>:
      // predicted unlikely by continue predictor.
      goto <D.6617>;
      <D.6858>:
      D.6859 = (sizetype) len;
      s = &buf + D.6859;
      goto <D.6628>;
      <D.6627>:
      s = s + 1;
      <D.6628>:
      D.6860 = __ctype_b_loc ();
      D.6861 = *D.6860;
      D.6862 = *s;
      D.6863 = (long unsigned int) D.6862;
      D.6864 = D.6863 * 2;
      D.6865 = D.6861 + D.6864;
      D.6866 = *D.6865;
      D.6867 = (int) D.6866;
      D.6868 = D.6867 & 8192;
      if (D.6868 != 0) goto <D.6627>; else goto <D.6629>;
      <D.6629>:
      s.3 = s;
      s = s.3 + 1;
      D.6870 = *s.3;
      if (D.6870 != 58) goto <D.6871>; else goto <D.6872>;
      <D.6871>:
      // predicted unlikely by continue predictor.
      goto <D.6617>;
      <D.6872>:
      goto <D.6631>;
      <D.6630>:
      s = s + 1;
      <D.6631>:
      D.6860 = __ctype_b_loc ();
      D.6861 = *D.6860;
      D.6862 = *s;
      D.6863 = (long unsigned int) D.6862;
      D.6864 = D.6863 * 2;
      D.6865 = D.6861 + D.6864;
      D.6866 = *D.6865;
      D.6867 = (int) D.6866;
      D.6868 = D.6867 & 8192;
      if (D.6868 != 0) goto <D.6630>; else goto <D.6632>;
      <D.6632>:
      fclose (f);
      D.6873 = strlen (s);
      len = (int) D.6873;
      D.6874 = MIN_EXPR <blen, len>;
      D.6875 = (long unsigned int) D.6874;
      strncpy (rbuf, s, D.6875);
      if (len < blen) goto <D.6877>; else goto <D.6878>;
      <D.6877>:
      D.6859 = (sizetype) len;
      iftmp.4 = D.6859 + 18446744073709551615;
      goto <D.6879>;
      <D.6878>:
      D.6880 = (sizetype) blen;
      iftmp.4 = D.6880 + 18446744073709551615;
      <D.6879>:
      D.6881 = rbuf + iftmp.4;
      *D.6881 = 0;
      if (error != 0B) goto <D.6882>; else goto <D.6883>;
      <D.6882>:
      *error = 0;
      <D.6883>:
      D.6850 = rbuf;
      return D.6850;
      <D.6617>:
      s = fgets (&buf, blen, f);
      if (s != 0B) goto <D.6633>; else goto <D.6634>;
      <D.6634>:
      fclose (f);
      if (error != 0B) goto <D.6884>; else goto <D.6885>;
      <D.6884>:
      *error = 2;
      <D.6885>:
      D.6850 = 0B;
      return D.6850;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


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

  D.6889 = __builtin_object_size (__dest, 1);
  D.6888 = __builtin___strncpy_chk (__dest, __src, __len, D.6889);
  return D.6888;
}


fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  long unsigned int D.6891;
  int D.6896;
  char * D.6898;
  long unsigned int D.6899;
  long unsigned int D.6900;
  long unsigned int D.6901;
  long unsigned int D.6904;

  D.6891 = __builtin_object_size (__s, 1);
  if (D.6891 != 18446744073709551615) goto <D.6892>; else goto <D.6893>;
  <D.6892>:
  D.6896 = __builtin_constant_p (__n);
  if (D.6896 == 0) goto <D.6894>; else goto <D.6897>;
  <D.6897>:
  if (__n <= 0) goto <D.6894>; else goto <D.6895>;
  <D.6894>:
  D.6899 = __builtin_object_size (__s, 1);
  D.6898 = __fgets_chk (__s, D.6899, __n, __stream);
  return D.6898;
  <D.6895>:
  D.6900 = (long unsigned int) __n;
  D.6901 = __builtin_object_size (__s, 1);
  if (D.6900 > D.6901) goto <D.6902>; else goto <D.6903>;
  <D.6902>:
  D.6904 = __builtin_object_size (__s, 1);
  D.6898 = __fgets_chk_warn (__s, D.6904, __n, __stream);
  return D.6898;
  <D.6903>:
  <D.6893>:
  D.6898 = __fgets_alias (__s, __n, __stream);
  return D.6898;
}


mono_process_get_data_with_error (void * pid, MonoProcessData data, MonoProcessError * error)
{
  long int pid.5;
  gint64 D.6909;
  long int D.6914;
  int D.6915;
  long int D.6916;
  gint64 val;
  int rpid;

  pid.5 = (long int) pid;
  rpid = (int) pid.5;
  if (error != 0B) goto <D.6907>; else goto <D.6908>;
  <D.6907>:
  *error = 2;
  <D.6908>:
  switch (data) <default: <D.6917>, case 0: <D.6701>, case 1: <D.6702>, case 2: <D.6703>, case 3: <D.6704>, case 4: <D.6705>, case 5: <D.6706>, case 6: <D.6707>, case 7: <D.6708>, case 8: <D.6709>, case 9: <D.6710>, case 10: <D.6711>, case 11: <D.6712>, case 12: <D.6713>>
  <D.6701>:
  D.6909 = get_pid_status_item (rpid, "Threads", error, 1);
  return D.6909;
  <D.6702>:
  D.6909 = get_process_stat_time (rpid, 10, 0, error);
  return D.6909;
  <D.6703>:
  D.6909 = get_process_stat_time (rpid, 11, 0, error);
  return D.6909;
  <D.6704>:
  D.6909 = get_process_stat_time (rpid, 10, 1, error);
  return D.6909;
  <D.6705>:
  D.6909 = get_pid_status_item (rpid, "VmRSS", error, 1024);
  return D.6909;
  <D.6706>:
  val = get_pid_status_item (rpid, "VmHWM", error, 1024);
  if (val == 0) goto <D.6910>; else goto <D.6911>;
  <D.6910>:
  val = get_pid_status_item (rpid, "VmRSS", error, 1024);
  <D.6911>:
  D.6909 = val;
  return D.6909;
  <D.6707>:
  D.6909 = get_pid_status_item (rpid, "VmData", error, 1024);
  return D.6909;
  <D.6708>:
  D.6909 = get_pid_status_item (rpid, "VmSize", error, 1024);
  return D.6909;
  <D.6709>:
  val = get_pid_status_item (rpid, "VmPeak", error, 1024);
  if (val == 0) goto <D.6912>; else goto <D.6913>;
  <D.6912>:
  val = get_pid_status_item (rpid, "VmSize", error, 1024);
  <D.6913>:
  D.6909 = val;
  return D.6909;
  <D.6710>:
  D.6909 = get_process_stat_item (rpid, 6, 1, error);
  return D.6909;
  <D.6711>:
  D.6914 = get_process_stat_item (rpid, 18, 0, error);
  D.6915 = get_user_hz ();
  D.6916 = (long int) D.6915;
  D.6909 = D.6914 / D.6916;
  return D.6909;
  <D.6712>:
  D.6909 = get_process_stat_time (rpid, 0, 0, error);
  return D.6909;
  <D.6713>:
  D.6909 = 0;
  return D.6909;
  <D.6917>:
  D.6909 = 0;
  return D.6909;
}


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

  try
    {
      s = get_pid_status_item_buf (pid, item, &buf, 64, error);
      if (s != 0B) goto <D.6919>; else goto <D.6920>;
      <D.6919>:
      D.6922 = atol (s);
      D.6923 = (long int) multiplier;
      D.6921 = D.6922 * D.6923;
      return D.6921;
      <D.6920>:
      D.6921 = 0;
      return D.6921;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


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

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


get_process_stat_item (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6932;
  long unsigned int D.6933;
  const short unsigned int * * D.6942;
  const short unsigned int * D.6943;
  char D.6944;
  long unsigned int D.6945;
  long unsigned int D.6946;
  const short unsigned int * D.6947;
  short unsigned int D.6948;
  int D.6949;
  int D.6950;
  long unsigned int D.6969;
  long unsigned int D.6976;
  long unsigned int value.6;
  long unsigned int D.6978;
  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.6928>; else goto <D.6929>;
      <D.6928>:
      if (error != 0B) goto <D.6930>; else goto <D.6931>;
      <D.6930>:
      *error = 1;
      <D.6931>:
      D.6932 = 0;
      return D.6932;
      <D.6929>:
      D.6933 = fread (&buf, 1, 512, f);
      len = (int) D.6933;
      fclose (f);
      if (len <= 0) goto <D.6934>; else goto <D.6935>;
      <D.6934>:
      if (error != 0B) goto <D.6936>; else goto <D.6937>;
      <D.6936>:
      *error = 2;
      <D.6937>:
      D.6932 = 0;
      return D.6932;
      <D.6935>:
      s = __builtin_strchr (&buf, 41);
      if (s == 0B) goto <D.6938>; else goto <D.6939>;
      <D.6938>:
      if (error != 0B) goto <D.6940>; else goto <D.6941>;
      <D.6940>:
      *error = 2;
      <D.6941>:
      D.6932 = 0;
      return D.6932;
      <D.6939>:
      s = s + 1;
      goto <D.6658>;
      <D.6657>:
      s = s + 1;
      <D.6658>:
      D.6942 = __ctype_b_loc ();
      D.6943 = *D.6942;
      D.6944 = *s;
      D.6945 = (long unsigned int) D.6944;
      D.6946 = D.6945 * 2;
      D.6947 = D.6943 + D.6946;
      D.6948 = *D.6947;
      D.6949 = (int) D.6948;
      D.6950 = D.6949 & 8192;
      if (D.6950 != 0) goto <D.6657>; else goto <D.6659>;
      <D.6659>:
      D.6944 = *s;
      if (D.6944 == 0) goto <D.6951>; else goto <D.6952>;
      <D.6951>:
      if (error != 0B) goto <D.6953>; else goto <D.6954>;
      <D.6953>:
      *error = 2;
      <D.6954>:
      D.6932 = 0;
      return D.6932;
      <D.6952>:
      goto <D.6661>;
      <D.6660>:
      s = s + 1;
      <D.6661>:
      D.6944 = *s;
      if (D.6944 != 0) goto <D.6955>; else goto <D.6662>;
      <D.6955>:
      D.6942 = __ctype_b_loc ();
      D.6943 = *D.6942;
      D.6944 = *s;
      D.6945 = (long unsigned int) D.6944;
      D.6946 = D.6945 * 2;
      D.6947 = D.6943 + D.6946;
      D.6948 = *D.6947;
      D.6949 = (int) D.6948;
      D.6950 = D.6949 & 8192;
      if (D.6950 == 0) goto <D.6660>; else goto <D.6662>;
      <D.6662>:
      D.6944 = *s;
      if (D.6944 == 0) goto <D.6956>; else goto <D.6957>;
      <D.6956>:
      if (error != 0B) goto <D.6958>; else goto <D.6959>;
      <D.6958>:
      *error = 2;
      <D.6959>:
      D.6932 = 0;
      return D.6932;
      <D.6957>:
      i = 0;
      goto <D.6670>;
      <D.6669>:
      goto <D.6664>;
      <D.6663>:
      s = s + 1;
      <D.6664>:
      D.6942 = __ctype_b_loc ();
      D.6943 = *D.6942;
      D.6944 = *s;
      D.6945 = (long unsigned int) D.6944;
      D.6946 = D.6945 * 2;
      D.6947 = D.6943 + D.6946;
      D.6948 = *D.6947;
      D.6949 = (int) D.6948;
      D.6950 = D.6949 & 8192;
      if (D.6950 != 0) goto <D.6663>; else goto <D.6665>;
      <D.6665>:
      D.6944 = *s;
      if (D.6944 == 0) goto <D.6960>; else goto <D.6961>;
      <D.6960>:
      if (error != 0B) goto <D.6962>; else goto <D.6963>;
      <D.6962>:
      *error = 2;
      <D.6963>:
      D.6932 = 0;
      return D.6932;
      <D.6961>:
      goto <D.6667>;
      <D.6666>:
      s = s + 1;
      <D.6667>:
      D.6944 = *s;
      if (D.6944 != 0) goto <D.6964>; else goto <D.6668>;
      <D.6964>:
      D.6942 = __ctype_b_loc ();
      D.6943 = *D.6942;
      D.6944 = *s;
      D.6945 = (long unsigned int) D.6944;
      D.6946 = D.6945 * 2;
      D.6947 = D.6943 + D.6946;
      D.6948 = *D.6947;
      D.6949 = (int) D.6948;
      D.6950 = D.6949 & 8192;
      if (D.6950 == 0) goto <D.6666>; else goto <D.6668>;
      <D.6668>:
      D.6944 = *s;
      if (D.6944 == 0) goto <D.6965>; else goto <D.6966>;
      <D.6965>:
      if (error != 0B) goto <D.6967>; else goto <D.6968>;
      <D.6967>:
      *error = 2;
      <D.6968>:
      D.6932 = 0;
      return D.6932;
      <D.6966>:
      i = i + 1;
      <D.6670>:
      if (i < pos) goto <D.6669>; else goto <D.6671>;
      <D.6671>:
      D.6969 = strtoul (s, &end, 0);
      value = (gint64) D.6969;
      if (sum != 0) goto <D.6970>; else goto <D.6971>;
      <D.6970>:
      goto <D.6673>;
      <D.6672>:
      s = s + 1;
      <D.6673>:
      D.6942 = __ctype_b_loc ();
      D.6943 = *D.6942;
      D.6944 = *s;
      D.6945 = (long unsigned int) D.6944;
      D.6946 = D.6945 * 2;
      D.6947 = D.6943 + D.6946;
      D.6948 = *D.6947;
      D.6949 = (int) D.6948;
      D.6950 = D.6949 & 8192;
      if (D.6950 != 0) goto <D.6672>; else goto <D.6674>;
      <D.6674>:
      D.6944 = *s;
      if (D.6944 == 0) goto <D.6972>; else goto <D.6973>;
      <D.6972>:
      if (error != 0B) goto <D.6974>; else goto <D.6975>;
      <D.6974>:
      *error = 2;
      <D.6975>:
      D.6932 = 0;
      return D.6932;
      <D.6973>:
      D.6976 = strtoul (s, &end, 0);
      value.6 = (long unsigned int) value;
      D.6978 = D.6976 + value.6;
      value = (gint64) D.6978;
      <D.6971>:
      if (error != 0B) goto <D.6979>; else goto <D.6980>;
      <D.6979>:
      *error = 0;
      <D.6980>:
      D.6932 = value;
      return D.6932;
    }
  finally
    {
      buf = {CLOBBER};
      end = {CLOBBER};
    }
}


get_user_hz ()
{
  int user_hz.7;
  long int D.6986;
  int user_hz.8;
  int D.6990;
  static int user_hz = 0;

  user_hz.7 = user_hz;
  if (user_hz.7 == 0) goto <D.6984>; else goto <D.6985>;
  <D.6984>:
  D.6986 = sysconf (2);
  user_hz.8 = (int) D.6986;
  user_hz = user_hz.8;
  user_hz.7 = user_hz;
  if (user_hz.7 == 0) goto <D.6988>; else goto <D.6989>;
  <D.6988>:
  user_hz = 100;
  <D.6989>:
  <D.6985>:
  D.6990 = user_hz;
  return D.6990;
}


get_process_stat_time (int pid, int pos, int sum, MonoProcessError * error)
{
  gint64 D.6992;
  long int D.6993;
  int D.6994;
  long int D.6995;
  gint64 val;

  val = get_process_stat_item (pid, pos, sum, error);
  D.6993 = val * 10000000;
  D.6994 = get_user_hz ();
  D.6995 = (long int) D.6994;
  D.6992 = D.6993 / D.6995;
  return D.6992;
}


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

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


mono_cpu_count ()
{
  long int D.7000;
  int D.7003;
  int count;

  count = 0;
  D.7000 = sysconf (84);
  count = (int) D.7000;
  if (count > 0) goto <D.7001>; else goto <D.7002>;
  <D.7001>:
  D.7003 = count;
  return D.7003;
  <D.7002>:
  D.7003 = 1;
  return D.7003;
}


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

  try
    {
      value = 0;
      if (error != 0B) goto <D.7005>; else goto <D.7006>;
      <D.7005>:
      *error = 0;
      <D.7006>:
      switch (data) <default: <D.7008>, case 0: <D.6770>, case 1: <D.6772>, case 2: <D.6773>, case 3: <D.6774>, case 4: <D.6775>, case 5: <D.6776>>
      <D.6770>:
      get_cpu_times (cpu_id, &value, 0B, 0B, 0B, 0B);
      goto <D.6771>;
      <D.6772>:
      get_cpu_times (cpu_id, 0B, &value, 0B, 0B, 0B);
      goto <D.6771>;
      <D.6773>:
      get_cpu_times (cpu_id, 0B, 0B, &value, 0B, 0B);
      goto <D.6771>;
      <D.6774>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, &value, 0B);
      goto <D.6771>;
      <D.6775>:
      get_cpu_times (cpu_id, 0B, 0B, 0B, 0B, &value);
      goto <D.6771>;
      <D.6776>:
      D.7007 = 0;
      return D.7007;
      <D.7008>:
      <D.6771>:
      D.7007 = value;
      return D.7007;
    }
  finally
    {
      value = {CLOBBER};
    }
}


get_cpu_times (int cpu_id, gint64 * user, gint64 * systemt, gint64 * irq, gint64 * sirq, gint64 * idle)
{
  int D.7015;
  int D.7019;
  const short unsigned int * * D.7021;
  const short unsigned int * D.7022;
  char * D.7023;
  char D.7024;
  long unsigned int D.7025;
  long unsigned int D.7026;
  const short unsigned int * D.7027;
  short unsigned int D.7028;
  int D.7029;
  int D.7030;
  char * data.9;
  int D.7036;
  long int D.7038;
  long int D.7039;
  char * data.10;
  char * data.11;
  long unsigned int D.7047;
  long unsigned int D.7048;
  long unsigned int D.7049;
  long unsigned int D.7050;
  long int D.7051;
  long unsigned int D.7054;
  long unsigned int D.7055;
  long int D.7056;
  long unsigned int D.7059;
  long unsigned int D.7060;
  long int D.7061;
  long unsigned int D.7064;
  long unsigned int D.7065;
  long int D.7066;
  long unsigned int D.7069;
  long unsigned int D.7070;
  long int D.7071;
  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.7011>; else goto <D.7012>;
      <D.7011>:
      return;
      <D.7012>:
      if (cpu_id < 0) goto <D.7013>; else goto <D.7014>;
      <D.7013>:
      D.7015 = mono_cpu_count ();
      hz = D.7015 * hz;
      <D.7014>:
      goto <D.6761>;
      <D.6763>:
      {
        char * data;

        try
          {
            data = 0B;
            if (cpu_id < 0) goto <D.7018>; else goto <D.7016>;
            <D.7018>:
            D.7019 = strncmp (s, "cpu", 3);
            if (D.7019 == 0) goto <D.7020>; else goto <D.7016>;
            <D.7020>:
            D.7021 = __ctype_b_loc ();
            D.7022 = *D.7021;
            D.7023 = s + 3;
            D.7024 = *D.7023;
            D.7025 = (long unsigned int) D.7024;
            D.7026 = D.7025 * 2;
            D.7027 = D.7022 + D.7026;
            D.7028 = *D.7027;
            D.7029 = (int) D.7028;
            D.7030 = D.7029 & 8192;
            if (D.7030 != 0) goto <D.7031>; else goto <D.7016>;
            <D.7031>:
            data.9 = s + 4;
            data = data.9;
            goto <D.7017>;
            <D.7016>:
            if (cpu_id >= 0) goto <D.7035>; else goto <D.7033>;
            <D.7035>:
            D.7036 = strncmp (s, "cpu", 3);
            if (D.7036 == 0) goto <D.7037>; else goto <D.7033>;
            <D.7037>:
            D.7023 = s + 3;
            D.7038 = strtol (D.7023, &data, 10);
            D.7039 = (long int) cpu_id;
            if (D.7038 == D.7039) goto <D.7040>; else goto <D.7033>;
            <D.7040>:
            D.7023 = s + 3;
            data.10 = data;
            if (D.7023 == data.10) goto <D.7042>; else goto <D.7043>;
            <D.7042>:
            // predicted unlikely by continue predictor.
            goto <D.6761>;
            <D.7043>:
            data.10 = data;
            data.11 = data.10 + 1;
            data = data.11;
            goto <D.7034>;
            <D.7033>:
            // predicted unlikely by continue predictor.
            goto <D.6761>;
            <D.7034>:
            <D.7017>:
            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.6762>;
          }
        finally
          {
            data = {CLOBBER};
          }
      }
      <D.6761>:
      s = fgets (&buf, 256, f);
      if (s != 0B) goto <D.6763>; else goto <D.6762>;
      <D.6762>:
      fclose (f);
      if (user != 0B) goto <D.7045>; else goto <D.7046>;
      <D.7045>:
      D.7047 = user_ticks + nice_ticks;
      D.7048 = D.7047 * 10000000;
      D.7049 = (long unsigned int) hz;
      D.7050 = D.7048 / D.7049;
      D.7051 = (long int) D.7050;
      *user = D.7051;
      <D.7046>:
      if (systemt != 0B) goto <D.7052>; else goto <D.7053>;
      <D.7052>:
      D.7054 = system_ticks * 10000000;
      D.7049 = (long unsigned int) hz;
      D.7055 = D.7054 / D.7049;
      D.7056 = (long int) D.7055;
      *systemt = D.7056;
      <D.7053>:
      if (irq != 0B) goto <D.7057>; else goto <D.7058>;
      <D.7057>:
      D.7059 = irq_ticks * 10000000;
      D.7049 = (long unsigned int) hz;
      D.7060 = D.7059 / D.7049;
      D.7061 = (long int) D.7060;
      *irq = D.7061;
      <D.7058>:
      if (sirq != 0B) goto <D.7062>; else goto <D.7063>;
      <D.7062>:
      D.7064 = sirq_ticks * 10000000;
      D.7049 = (long unsigned int) hz;
      D.7065 = D.7064 / D.7049;
      D.7066 = (long int) D.7065;
      *sirq = D.7066;
      <D.7063>:
      if (idle != 0B) goto <D.7067>; else goto <D.7068>;
      <D.7067>:
      D.7069 = idle_ticks * 10000000;
      D.7049 = (long unsigned int) hz;
      D.7070 = D.7069 / D.7049;
      D.7071 = (long int) D.7070;
      *idle = D.7071;
      <D.7068>:
    }
  finally
    {
      buf = {CLOBBER};
    }
}


