mono_msec_ticks ()
{
  long long int boot_time.0;
  long long int boot_time.1;
  guint32 D.4822;
  long long int D.4823;
  long long int D.4824;
  static gint64 boot_time = 0;
  gint64 now;

  boot_time.0 = boot_time;
  if (boot_time.0 == 0) goto <D.4819>; else goto <D.4820>;
  <D.4819>:
  boot_time.1 = get_boot_time ();
  boot_time = boot_time.1;
  <D.4820>:
  now = mono_100ns_ticks ();
  boot_time.0 = boot_time;
  D.4823 = now - boot_time.0;
  D.4824 = D.4823 / 10000;
  D.4822 = (guint32) D.4824;
  return D.4822;
}


get_boot_time ()
{
  int D.4828;
  gint64 D.4831;
  double upt.2;
  double D.4833;
  long long int D.4834;
  struct FILE * uptime;

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

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

          now = mono_100ns_ticks ();
          fclose (uptime);
          upt.2 = upt;
          D.4833 = upt.2 * 1.0e+7;
          D.4834 = (long long int) D.4833;
          D.4831 = now - D.4834;
          return D.4831;
        }
        <D.4830>:
        fclose (uptime);
      }
    finally
      {
        upt = {CLOBBER};
      }
  }
  <D.4827>:
  D.4831 = 3000000000;
  return D.4831;
}


mono_100ns_ticks ()
{
  long int D.4838;
  int D.4841;
  _Bool D.4842;
  int can_use_clock.3;
  int can_use_clock.4;
  int D.4847;
  gint64 D.4850;
  long int D.4851;
  long long int D.4852;
  long long int D.4853;
  long int D.4854;
  long int D.4855;
  long long int D.4856;
  int D.4857;
  long int D.4860;
  long long int D.4861;
  long long int D.4862;
  long int D.4863;
  long long int D.4864;
  long long int D.4865;
  struct timeval tv;
  struct timespec tspec;
  static struct timespec tspec_freq = {.tv_sec=0};
  static int can_use_clock = 0;

  try
    {
      D.4838 = tspec_freq.tv_nsec;
      if (D.4838 == 0) goto <D.4839>; else goto <D.4840>;
      <D.4839>:
      D.4841 = clock_getres (1, &tspec_freq);
      D.4842 = D.4841 == 0;
      can_use_clock.3 = (int) D.4842;
      can_use_clock = can_use_clock.3;
      <D.4840>:
      can_use_clock.4 = can_use_clock;
      if (can_use_clock.4 != 0) goto <D.4845>; else goto <D.4846>;
      <D.4845>:
      D.4847 = clock_gettime (1, &tspec);
      if (D.4847 == 0) goto <D.4848>; else goto <D.4849>;
      <D.4848>:
      D.4851 = tspec.tv_sec;
      D.4852 = (long long int) D.4851;
      D.4853 = D.4852 * 10000000;
      D.4854 = tspec.tv_nsec;
      D.4855 = D.4854 / 100;
      D.4856 = (long long int) D.4855;
      D.4850 = D.4853 + D.4856;
      return D.4850;
      <D.4849>:
      <D.4846>:
      D.4857 = gettimeofday (&tv, 0B);
      if (D.4857 == 0) goto <D.4858>; else goto <D.4859>;
      <D.4858>:
      D.4860 = tv.tv_sec;
      D.4861 = (long long int) D.4860;
      D.4862 = D.4861 * 1000000;
      D.4863 = tv.tv_usec;
      D.4864 = (long long int) D.4863;
      D.4865 = D.4862 + D.4864;
      D.4850 = D.4865 * 10;
      return D.4850;
      <D.4859>:
      D.4850 = 0;
      return D.4850;
    }
  finally
    {
      tv = {CLOBBER};
      tspec = {CLOBBER};
    }
}


mono_100ns_datetime ()
{
  int D.4868;
  gint64 D.4871;
  long int D.4872;
  long long unsigned int D.4873;
  long long unsigned int D.4874;
  long int D.4875;
  long long unsigned int D.4876;
  long long unsigned int D.4877;
  long long unsigned int D.4878;
  long long unsigned int D.4879;
  struct timeval tv;

  try
    {
      D.4868 = gettimeofday (&tv, 0B);
      if (D.4868 == 0) goto <D.4869>; else goto <D.4870>;
      <D.4869>:
      D.4872 = tv.tv_sec;
      D.4873 = (long long unsigned int) D.4872;
      D.4874 = D.4873 * 1000000;
      D.4875 = tv.tv_usec;
      D.4876 = (long long unsigned int) D.4875;
      D.4877 = D.4874 + D.4876;
      D.4878 = D.4877 * 10;
      D.4879 = D.4878 + 621355968000000000;
      D.4871 = (gint64) D.4879;
      return D.4871;
      <D.4870>:
      D.4871 = 0;
      return D.4871;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


