mono_msec_ticks ()
{
  long int boot_time.0;
  long int boot_time.1;
  guint32 D.5172;
  long int D.5173;
  long int D.5174;
  static gint64 boot_time = 0;
  gint64 now;

  boot_time.0 = boot_time;
  if (boot_time.0 == 0) goto <D.5169>; else goto <D.5170>;
  <D.5169>:
  boot_time.1 = get_boot_time ();
  boot_time = boot_time.1;
  <D.5170>:
  now = mono_100ns_ticks ();
  boot_time.0 = boot_time;
  D.5173 = now - boot_time.0;
  D.5174 = D.5173 / 10000;
  D.5172 = (guint32) D.5174;
  return D.5172;
}


get_boot_time ()
{
  int D.5178;
  gint64 D.5181;
  double upt.2;
  double D.5183;
  long int D.5184;
  struct FILE * uptime;

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

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

          now = mono_100ns_ticks ();
          fclose (uptime);
          upt.2 = upt;
          D.5183 = upt.2 * 1.0e+7;
          D.5184 = (long int) D.5183;
          D.5181 = now - D.5184;
          return D.5181;
        }
        <D.5180>:
        fclose (uptime);
      }
    finally
      {
        upt = {CLOBBER};
      }
  }
  <D.5177>:
  D.5181 = 3000000000;
  return D.5181;
}


mono_100ns_ticks ()
{
  long int D.5188;
  int D.5191;
  _Bool D.5192;
  int can_use_clock.3;
  int can_use_clock.4;
  int D.5197;
  gint64 D.5200;
  long int D.5201;
  long int D.5202;
  long int D.5203;
  long int D.5204;
  int D.5205;
  long int D.5208;
  long int D.5209;
  long int D.5210;
  long int D.5211;
  struct timeval tv;
  struct timespec tspec;
  static struct timespec tspec_freq = {.tv_sec=0};
  static int can_use_clock = 0;

  try
    {
      D.5188 = tspec_freq.tv_nsec;
      if (D.5188 == 0) goto <D.5189>; else goto <D.5190>;
      <D.5189>:
      D.5191 = clock_getres (1, &tspec_freq);
      D.5192 = D.5191 == 0;
      can_use_clock.3 = (int) D.5192;
      can_use_clock = can_use_clock.3;
      <D.5190>:
      can_use_clock.4 = can_use_clock;
      if (can_use_clock.4 != 0) goto <D.5195>; else goto <D.5196>;
      <D.5195>:
      D.5197 = clock_gettime (1, &tspec);
      if (D.5197 == 0) goto <D.5198>; else goto <D.5199>;
      <D.5198>:
      D.5201 = tspec.tv_sec;
      D.5202 = D.5201 * 10000000;
      D.5203 = tspec.tv_nsec;
      D.5204 = D.5203 / 100;
      D.5200 = D.5202 + D.5204;
      return D.5200;
      <D.5199>:
      <D.5196>:
      D.5205 = gettimeofday (&tv, 0B);
      if (D.5205 == 0) goto <D.5206>; else goto <D.5207>;
      <D.5206>:
      D.5208 = tv.tv_sec;
      D.5209 = D.5208 * 1000000;
      D.5210 = tv.tv_usec;
      D.5211 = D.5209 + D.5210;
      D.5200 = D.5211 * 10;
      return D.5200;
      <D.5207>:
      D.5200 = 0;
      return D.5200;
    }
  finally
    {
      tv = {CLOBBER};
      tspec = {CLOBBER};
    }
}


mono_100ns_datetime ()
{
  int D.5214;
  gint64 D.5217;
  long int D.5218;
  long unsigned int D.5219;
  long unsigned int D.5220;
  long int D.5221;
  long unsigned int D.5222;
  long unsigned int D.5223;
  long unsigned int D.5224;
  long unsigned int D.5225;
  struct timeval tv;

  try
    {
      D.5214 = gettimeofday (&tv, 0B);
      if (D.5214 == 0) goto <D.5215>; else goto <D.5216>;
      <D.5215>:
      D.5218 = tv.tv_sec;
      D.5219 = (long unsigned int) D.5218;
      D.5220 = D.5219 * 1000000;
      D.5221 = tv.tv_usec;
      D.5222 = (long unsigned int) D.5221;
      D.5223 = D.5220 + D.5222;
      D.5224 = D.5223 * 10;
      D.5225 = D.5224 + 621355968000000000;
      D.5217 = (gint64) D.5225;
      return D.5217;
      <D.5216>:
      D.5217 = 0;
      return D.5217;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


