monoeg_g_timer_new ()
{
  struct GTimer * D.4985;
  struct GTimer * timer;

  timer = monoeg_malloc0 (32);
  monoeg_g_timer_start (timer);
  D.4985 = timer;
  return D.4985;
}


monoeg_g_timer_destroy (struct GTimer * timer)
{
  if (timer == 0B) goto <D.4987>; else goto <D.4988>;
  <D.4987>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 48, "timer != NULL");
  return;
  <D.4988>:
  monoeg_g_free (timer);
}


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.4992;
  struct timeval * D.4993;

  if (timer == 0B) goto <D.4990>; else goto <D.4991>;
  <D.4990>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 55, "timer != NULL");
  return;
  <D.4991>:
  D.4992 = &timer->start;
  gettimeofday (D.4992, 0B);
  D.4993 = &timer->stop;
  memset (D.4993, 0, 16);
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.4997;
  int D.5002;
  void * D.5004;
  long unsigned int D.5005;

  D.4997 = __builtin_constant_p (__len);
  if (D.4997 != 0) goto <D.4998>; else goto <D.4999>;
  <D.4998>:
  if (__len == 0) goto <D.5000>; else goto <D.5001>;
  <D.5000>:
  D.5002 = __builtin_constant_p (__ch);
  if (D.5002 == 0) goto <D.4995>; else goto <D.5003>;
  <D.5003>:
  if (__ch != 0) goto <D.4995>; else goto <D.4996>;
  <D.4995>:
  __warn_memset_zero_len ();
  D.5004 = __dest;
  return D.5004;
  <D.4996>:
  <D.5001>:
  <D.4999>:
  D.5005 = __builtin_object_size (__dest, 0);
  D.5004 = __builtin___memset_chk (__dest, __ch, __len, D.5005);
  return D.5004;
}


monoeg_g_timer_stop (struct GTimer * timer)
{
  struct timeval * D.5009;

  if (timer == 0B) goto <D.5007>; else goto <D.5008>;
  <D.5007>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 63, "timer != NULL");
  return;
  <D.5008>:
  D.5009 = &timer->stop;
  gettimeofday (D.5009, 0B);
}


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.5013;
  long int D.5016;
  long int D.5018;
  long int D.5020;
  long int D.5021;
  long int D.5022;
  long int D.5023;
  long int D.5024;
  long unsigned int usec.0;
  long unsigned int D.5030;
  long unsigned int usec.1;
  long unsigned int D.5032;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.5011>; else goto <D.5012>;
      <D.5011>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.5013 = 0.0;
      return D.5013;
      <D.5012>:
      D.5016 = timer->stop.tv_sec;
      if (D.5016 == 0) goto <D.5017>; else goto <D.5014>;
      <D.5017>:
      D.5018 = timer->stop.tv_usec;
      if (D.5018 == 0) goto <D.5019>; else goto <D.5014>;
      <D.5019>:
      gettimeofday (&tv, 0B);
      goto <D.5015>;
      <D.5014>:
      tv = timer->stop;
      <D.5015>:
      D.5020 = tv.tv_usec;
      D.5021 = timer->start.tv_usec;
      usec = D.5020 - D.5021;
      D.5022 = tv.tv_sec;
      D.5023 = timer->start.tv_sec;
      D.5024 = D.5022 - D.5023;
      seconds = (gulong) D.5024;
      if (microseconds != 0B) goto <D.5025>; else goto <D.5026>;
      <D.5025>:
      if (usec < 0) goto <D.5027>; else goto <D.5028>;
      <D.5027>:
      usec = usec + 1000000;
      seconds = seconds + 18446744073709551615;
      <D.5028>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.5026>:
      D.5030 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.5032 = D.5030 + usec.1;
      result = (gdouble) D.5032;
      D.5013 = result / 1.0e+6;
      return D.5013;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


