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

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


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


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.5506;
  struct timeval * D.5507;

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.5511;
  int D.5516;
  void * D.5518;
  long unsigned int D.5519;

  D.5511 = __builtin_constant_p (__len);
  if (D.5511 != 0) goto <D.5512>; else goto <D.5513>;
  <D.5512>:
  if (__len == 0) goto <D.5514>; else goto <D.5515>;
  <D.5514>:
  D.5516 = __builtin_constant_p (__ch);
  if (D.5516 == 0) goto <D.5509>; else goto <D.5517>;
  <D.5517>:
  if (__ch != 0) goto <D.5509>; else goto <D.5510>;
  <D.5509>:
  __warn_memset_zero_len ();
  D.5518 = __dest;
  return D.5518;
  <D.5510>:
  <D.5515>:
  <D.5513>:
  D.5519 = __builtin_object_size (__dest, 0);
  D.5518 = __builtin___memset_chk (__dest, __ch, __len, D.5519);
  return D.5518;
}


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

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


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.5527;
  long int D.5530;
  long int D.5532;
  long int D.5534;
  long int D.5535;
  long int D.5536;
  long int D.5537;
  long int D.5538;
  long unsigned int usec.0;
  long unsigned int D.5544;
  long unsigned int usec.1;
  long unsigned int D.5546;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.5525>; else goto <D.5526>;
      <D.5525>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.5527 = 0.0;
      return D.5527;
      <D.5526>:
      D.5530 = timer->stop.tv_sec;
      if (D.5530 == 0) goto <D.5531>; else goto <D.5528>;
      <D.5531>:
      D.5532 = timer->stop.tv_usec;
      if (D.5532 == 0) goto <D.5533>; else goto <D.5528>;
      <D.5533>:
      gettimeofday (&tv, 0B);
      goto <D.5529>;
      <D.5528>:
      tv = timer->stop;
      <D.5529>:
      D.5534 = tv.tv_usec;
      D.5535 = timer->start.tv_usec;
      usec = D.5534 - D.5535;
      D.5536 = tv.tv_sec;
      D.5537 = timer->start.tv_sec;
      D.5538 = D.5536 - D.5537;
      seconds = (gulong) D.5538;
      if (microseconds != 0B) goto <D.5539>; else goto <D.5540>;
      <D.5539>:
      if (usec < 0) goto <D.5541>; else goto <D.5542>;
      <D.5541>:
      usec = usec + 1000000;
      seconds = seconds + 18446744073709551615;
      <D.5542>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.5540>:
      D.5544 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.5546 = D.5544 + usec.1;
      result = (gdouble) D.5546;
      D.5527 = result / 1.0e+6;
      return D.5527;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


