mono_msec_ticks ()
{
  long long int boot_time.0;
  long long int boot_time.1;
  guint32 D.4842;
  long long int D.4843;
  long long int D.4844;
  static gint64 boot_time = 0;
  gint64 now;

  boot_time.0 = boot_time;
  if (boot_time.0 == 0) goto <D.4839>; else goto <D.4840>;
  <D.4839>:
  boot_time.1 = get_boot_time ();
  boot_time = boot_time.1;
  <D.4840>:
  now = mono_100ns_ticks ();
  boot_time.0 = boot_time;
  D.4843 = now - boot_time.0;
  D.4844 = D.4843 / 10000;
  D.4842 = (guint32) D.4844;
  return D.4842;
}


get_boot_time ()
{
  int D.4848;
  gint64 D.4851;
  double upt.2;
  double D.4853;
  long long int D.4854;
  struct FILE * uptime;

  uptime = fopen ("/proc/uptime", "r");
  if (uptime != 0B) goto <D.4846>; else goto <D.4847>;
  <D.4846>:
  {
    double upt;

    try
      {
        D.4848 = fscanf (uptime, "%lf", &upt);
        if (D.4848 == 1) goto <D.4849>; else goto <D.4850>;
        <D.4849>:
        {
          gint64 now;

          now = mono_100ns_ticks ();
          fclose (uptime);
          upt.2 = upt;
          D.4853 = upt.2 * 1.0e+7;
          D.4854 = (long long int) D.4853;
          D.4851 = now - D.4854;
          return D.4851;
        }
        <D.4850>:
        fclose (uptime);
      }
    finally
      {
        upt = {CLOBBER};
      }
  }
  <D.4847>:
  D.4851 = 3000000000;
  return D.4851;
}


mono_100ns_ticks ()
{
  long int D.4858;
  int D.4861;
  _Bool D.4862;
  int can_use_clock.3;
  int can_use_clock.4;
  int D.4867;
  gint64 D.4870;
  long int D.4871;
  long long int D.4872;
  long long int D.4873;
  long int D.4874;
  long int D.4875;
  long long int D.4876;
  int D.4877;
  long int D.4880;
  long long int D.4881;
  long long int D.4882;
  long int D.4883;
  long long int D.4884;
  long long int D.4885;
  struct timeval tv;
  struct timespec tspec;
  static struct timespec tspec_freq = {.tv_sec=0};
  static int can_use_clock = 0;

  try
    {
      D.4858 = tspec_freq.tv_nsec;
      if (D.4858 == 0) goto <D.4859>; else goto <D.4860>;
      <D.4859>:
      D.4861 = clock_getres (1, &tspec_freq);
      D.4862 = D.4861 == 0;
      can_use_clock.3 = (int) D.4862;
      can_use_clock = can_use_clock.3;
      <D.4860>:
      can_use_clock.4 = can_use_clock;
      if (can_use_clock.4 != 0) goto <D.4865>; else goto <D.4866>;
      <D.4865>:
      D.4867 = clock_gettime (1, &tspec);
      if (D.4867 == 0) goto <D.4868>; else goto <D.4869>;
      <D.4868>:
      D.4871 = tspec.tv_sec;
      D.4872 = (long long int) D.4871;
      D.4873 = D.4872 * 10000000;
      D.4874 = tspec.tv_nsec;
      D.4875 = D.4874 / 100;
      D.4876 = (long long int) D.4875;
      D.4870 = D.4873 + D.4876;
      return D.4870;
      <D.4869>:
      <D.4866>:
      D.4877 = gettimeofday (&tv, 0B);
      if (D.4877 == 0) goto <D.4878>; else goto <D.4879>;
      <D.4878>:
      D.4880 = tv.tv_sec;
      D.4881 = (long long int) D.4880;
      D.4882 = D.4881 * 1000000;
      D.4883 = tv.tv_usec;
      D.4884 = (long long int) D.4883;
      D.4885 = D.4882 + D.4884;
      D.4870 = D.4885 * 10;
      return D.4870;
      <D.4879>:
      D.4870 = 0;
      return D.4870;
    }
  finally
    {
      tv = {CLOBBER};
      tspec = {CLOBBER};
    }
}


mono_100ns_datetime ()
{
  int D.4888;
  gint64 D.4891;
  long int D.4892;
  long long unsigned int D.4893;
  long long unsigned int D.4894;
  long int D.4895;
  long long unsigned int D.4896;
  long long unsigned int D.4897;
  long long unsigned int D.4898;
  long long unsigned int D.4899;
  struct timeval tv;

  try
    {
      D.4888 = gettimeofday (&tv, 0B);
      if (D.4888 == 0) goto <D.4889>; else goto <D.4890>;
      <D.4889>:
      D.4892 = tv.tv_sec;
      D.4893 = (long long unsigned int) D.4892;
      D.4894 = D.4893 * 1000000;
      D.4895 = tv.tv_usec;
      D.4896 = (long long unsigned int) D.4895;
      D.4897 = D.4894 + D.4896;
      D.4898 = D.4897 * 10;
      D.4899 = D.4898 + 621355968000000000;
      D.4891 = (gint64) D.4899;
      return D.4891;
      <D.4890>:
      D.4891 = 0;
      return D.4891;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


