mono_msec_ticks ()
{
  long long int boot_time.0;
  long long int boot_time.1;
  guint32 D.7431;
  long long int D.7432;
  long long int D.7433;
  static gint64 boot_time = 0;
  gint64 now;

  boot_time.0 = boot_time;
  if (boot_time.0 == 0) goto <D.7428>; else goto <D.7429>;
  <D.7428>:
  boot_time.1 = get_boot_time ();
  boot_time = boot_time.1;
  <D.7429>:
  now = mono_100ns_ticks ();
  boot_time.0 = boot_time;
  D.7432 = now - boot_time.0;
  D.7433 = D.7432 / 10000;
  D.7431 = (guint32) D.7433;
  return D.7431;
}


get_boot_time ()
{
  int D.7437;
  gint64 D.7440;
  double upt.2;
  double D.7442;
  long long int D.7443;
  struct FILE * uptime;

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

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

          now = mono_100ns_ticks ();
          fclose (uptime);
          upt.2 = upt;
          D.7442 = upt.2 * 1.0e+7;
          D.7443 = (long long int) D.7442;
          D.7440 = now - D.7443;
          return D.7440;
        }
        <D.7439>:
        fclose (uptime);
      }
    finally
      {
        upt = {CLOBBER};
      }
  }
  <D.7436>:
  D.7440 = 3000000000;
  return D.7440;
}


mono_100ns_ticks ()
{
  long int D.7447;
  int D.7450;
  _Bool D.7451;
  int can_use_clock.3;
  int can_use_clock.4;
  int D.7456;
  gint64 D.7459;
  long int D.7460;
  long long int D.7461;
  long long int D.7462;
  long int D.7463;
  long int D.7464;
  long long int D.7465;
  int D.7466;
  long int D.7469;
  long long int D.7470;
  long long int D.7471;
  long int D.7472;
  long long int D.7473;
  long long int D.7474;
  struct timeval tv;
  struct timespec tspec;
  static struct timespec tspec_freq = {.tv_sec=0};
  static int can_use_clock = 0;

  try
    {
      D.7447 = tspec_freq.tv_nsec;
      if (D.7447 == 0) goto <D.7448>; else goto <D.7449>;
      <D.7448>:
      D.7450 = clock_getres (1, &tspec_freq);
      D.7451 = D.7450 == 0;
      can_use_clock.3 = (int) D.7451;
      can_use_clock = can_use_clock.3;
      <D.7449>:
      can_use_clock.4 = can_use_clock;
      if (can_use_clock.4 != 0) goto <D.7454>; else goto <D.7455>;
      <D.7454>:
      D.7456 = clock_gettime (1, &tspec);
      if (D.7456 == 0) goto <D.7457>; else goto <D.7458>;
      <D.7457>:
      D.7460 = tspec.tv_sec;
      D.7461 = (long long int) D.7460;
      D.7462 = D.7461 * 10000000;
      D.7463 = tspec.tv_nsec;
      D.7464 = D.7463 / 100;
      D.7465 = (long long int) D.7464;
      D.7459 = D.7462 + D.7465;
      return D.7459;
      <D.7458>:
      <D.7455>:
      D.7466 = gettimeofday (&tv, 0B);
      if (D.7466 == 0) goto <D.7467>; else goto <D.7468>;
      <D.7467>:
      D.7469 = tv.tv_sec;
      D.7470 = (long long int) D.7469;
      D.7471 = D.7470 * 1000000;
      D.7472 = tv.tv_usec;
      D.7473 = (long long int) D.7472;
      D.7474 = D.7471 + D.7473;
      D.7459 = D.7474 * 10;
      return D.7459;
      <D.7468>:
      D.7459 = 0;
      return D.7459;
    }
  finally
    {
      tv = {CLOBBER};
      tspec = {CLOBBER};
    }
}


mono_100ns_datetime ()
{
  int D.7477;
  gint64 D.7480;
  long int D.7481;
  long long unsigned int D.7482;
  long long unsigned int D.7483;
  long int D.7484;
  long long unsigned int D.7485;
  long long unsigned int D.7486;
  long long unsigned int D.7487;
  long long unsigned int D.7488;
  struct timeval tv;

  try
    {
      D.7477 = gettimeofday (&tv, 0B);
      if (D.7477 == 0) goto <D.7478>; else goto <D.7479>;
      <D.7478>:
      D.7481 = tv.tv_sec;
      D.7482 = (long long unsigned int) D.7481;
      D.7483 = D.7482 * 1000000;
      D.7484 = tv.tv_usec;
      D.7485 = (long long unsigned int) D.7484;
      D.7486 = D.7483 + D.7485;
      D.7487 = D.7486 * 10;
      D.7488 = D.7487 + 621355968000000000;
      D.7480 = (gint64) D.7488;
      return D.7480;
      <D.7479>:
      D.7480 = 0;
      return D.7480;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


