mono_msec_ticks ()
{
  long int boot_time.0;
  long int boot_time.1;
  guint32 D.5686;
  long int D.5687;
  long int D.5688;
  static gint64 boot_time = 0;
  gint64 now;

  boot_time.0 = boot_time;
  if (boot_time.0 == 0) goto <D.5683>; else goto <D.5684>;
  <D.5683>:
  boot_time.1 = get_boot_time ();
  boot_time = boot_time.1;
  <D.5684>:
  now = mono_100ns_ticks ();
  boot_time.0 = boot_time;
  D.5687 = now - boot_time.0;
  D.5688 = D.5687 / 10000;
  D.5686 = (guint32) D.5688;
  return D.5686;
}


get_boot_time ()
{
  int D.5692;
  gint64 D.5695;
  double upt.2;
  double D.5697;
  long int D.5698;
  struct FILE * uptime;

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

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

          now = mono_100ns_ticks ();
          fclose (uptime);
          upt.2 = upt;
          D.5697 = upt.2 * 1.0e+7;
          D.5698 = (long int) D.5697;
          D.5695 = now - D.5698;
          return D.5695;
        }
        <D.5694>:
        fclose (uptime);
      }
    finally
      {
        upt = {CLOBBER};
      }
  }
  <D.5691>:
  D.5695 = 3000000000;
  return D.5695;
}


mono_100ns_ticks ()
{
  long int D.5702;
  int D.5705;
  _Bool D.5706;
  int can_use_clock.3;
  int can_use_clock.4;
  int D.5711;
  gint64 D.5714;
  long int D.5715;
  long int D.5716;
  long int D.5717;
  long int D.5718;
  int D.5719;
  long int D.5722;
  long int D.5723;
  long int D.5724;
  long int D.5725;
  struct timeval tv;
  struct timespec tspec;
  static struct timespec tspec_freq = {.tv_sec=0};
  static int can_use_clock = 0;

  try
    {
      D.5702 = tspec_freq.tv_nsec;
      if (D.5702 == 0) goto <D.5703>; else goto <D.5704>;
      <D.5703>:
      D.5705 = clock_getres (1, &tspec_freq);
      D.5706 = D.5705 == 0;
      can_use_clock.3 = (int) D.5706;
      can_use_clock = can_use_clock.3;
      <D.5704>:
      can_use_clock.4 = can_use_clock;
      if (can_use_clock.4 != 0) goto <D.5709>; else goto <D.5710>;
      <D.5709>:
      D.5711 = clock_gettime (1, &tspec);
      if (D.5711 == 0) goto <D.5712>; else goto <D.5713>;
      <D.5712>:
      D.5715 = tspec.tv_sec;
      D.5716 = D.5715 * 10000000;
      D.5717 = tspec.tv_nsec;
      D.5718 = D.5717 / 100;
      D.5714 = D.5716 + D.5718;
      return D.5714;
      <D.5713>:
      <D.5710>:
      D.5719 = gettimeofday (&tv, 0B);
      if (D.5719 == 0) goto <D.5720>; else goto <D.5721>;
      <D.5720>:
      D.5722 = tv.tv_sec;
      D.5723 = D.5722 * 1000000;
      D.5724 = tv.tv_usec;
      D.5725 = D.5723 + D.5724;
      D.5714 = D.5725 * 10;
      return D.5714;
      <D.5721>:
      D.5714 = 0;
      return D.5714;
    }
  finally
    {
      tv = {CLOBBER};
      tspec = {CLOBBER};
    }
}


mono_100ns_datetime ()
{
  int D.5728;
  gint64 D.5731;
  long int D.5732;
  long unsigned int D.5733;
  long unsigned int D.5734;
  long int D.5735;
  long unsigned int D.5736;
  long unsigned int D.5737;
  long unsigned int D.5738;
  long unsigned int D.5739;
  struct timeval tv;

  try
    {
      D.5728 = gettimeofday (&tv, 0B);
      if (D.5728 == 0) goto <D.5729>; else goto <D.5730>;
      <D.5729>:
      D.5732 = tv.tv_sec;
      D.5733 = (long unsigned int) D.5732;
      D.5734 = D.5733 * 1000000;
      D.5735 = tv.tv_usec;
      D.5736 = (long unsigned int) D.5735;
      D.5737 = D.5734 + D.5736;
      D.5738 = D.5737 * 10;
      D.5739 = D.5738 + 621355968000000000;
      D.5731 = (gint64) D.5739;
      return D.5731;
      <D.5730>:
      D.5731 = 0;
      return D.5731;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


