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

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


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


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.5095;
  struct timeval * D.5096;

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


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memset (void * __dest, int __ch, size_t __len)
{
  void * D.5098;
  long unsigned int D.5099;

  D.5099 = __builtin_object_size (__dest, 0);
  D.5098 = __builtin___memset_chk (__dest, __ch, __len, D.5099);
  return D.5098;
}


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

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


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.5107;
  long int D.5110;
  long int D.5112;
  long int D.5114;
  long int D.5115;
  long int D.5116;
  long int D.5117;
  long int D.5118;
  long unsigned int usec.0;
  long unsigned int D.5124;
  long unsigned int usec.1;
  long unsigned int D.5126;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.5105>; else goto <D.5106>;
      <D.5105>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.5107 = 0.0;
      return D.5107;
      <D.5106>:
      D.5110 = timer->stop.tv_sec;
      if (D.5110 == 0) goto <D.5111>; else goto <D.5108>;
      <D.5111>:
      D.5112 = timer->stop.tv_usec;
      if (D.5112 == 0) goto <D.5113>; else goto <D.5108>;
      <D.5113>:
      gettimeofday (&tv, 0B);
      goto <D.5109>;
      <D.5108>:
      tv = timer->stop;
      <D.5109>:
      D.5114 = tv.tv_usec;
      D.5115 = timer->start.tv_usec;
      usec = D.5114 - D.5115;
      D.5116 = tv.tv_sec;
      D.5117 = timer->start.tv_sec;
      D.5118 = D.5116 - D.5117;
      seconds = (gulong) D.5118;
      if (microseconds != 0B) goto <D.5119>; else goto <D.5120>;
      <D.5119>:
      if (usec < 0) goto <D.5121>; else goto <D.5122>;
      <D.5121>:
      usec = usec + 1000000;
      seconds = seconds + 18446744073709551615;
      <D.5122>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.5120>:
      D.5124 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.5126 = D.5124 + usec.1;
      result = (gdouble) D.5126;
      D.5107 = result / 1.0e+6;
      return D.5107;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


