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

  timer = monoeg_malloc0 (16);
  monoeg_g_timer_start (timer);
  D.4655 = timer;
  return D.4655;
}


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


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.4662;
  struct timeval * D.4663;

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.4667;
  int D.4672;
  void * D.4674;
  unsigned int D.4675;

  D.4667 = __builtin_constant_p (__len);
  if (D.4667 != 0) goto <D.4668>; else goto <D.4669>;
  <D.4668>:
  if (__len == 0) goto <D.4670>; else goto <D.4671>;
  <D.4670>:
  D.4672 = __builtin_constant_p (__ch);
  if (D.4672 == 0) goto <D.4665>; else goto <D.4673>;
  <D.4673>:
  if (__ch != 0) goto <D.4665>; else goto <D.4666>;
  <D.4665>:
  __warn_memset_zero_len ();
  D.4674 = __dest;
  return D.4674;
  <D.4666>:
  <D.4671>:
  <D.4669>:
  D.4675 = __builtin_object_size (__dest, 0);
  D.4674 = __builtin___memset_chk (__dest, __ch, __len, D.4675);
  return D.4674;
}


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

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


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.4683;
  long int D.4686;
  long int D.4688;
  long int D.4690;
  long int D.4691;
  long int D.4692;
  long int D.4693;
  long int D.4694;
  long unsigned int usec.0;
  long unsigned int D.4700;
  long unsigned int usec.1;
  long unsigned int D.4702;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.4681>; else goto <D.4682>;
      <D.4681>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.4683 = 0.0;
      return D.4683;
      <D.4682>:
      D.4686 = timer->stop.tv_sec;
      if (D.4686 == 0) goto <D.4687>; else goto <D.4684>;
      <D.4687>:
      D.4688 = timer->stop.tv_usec;
      if (D.4688 == 0) goto <D.4689>; else goto <D.4684>;
      <D.4689>:
      gettimeofday (&tv, 0B);
      goto <D.4685>;
      <D.4684>:
      tv = timer->stop;
      <D.4685>:
      D.4690 = tv.tv_usec;
      D.4691 = timer->start.tv_usec;
      usec = D.4690 - D.4691;
      D.4692 = tv.tv_sec;
      D.4693 = timer->start.tv_sec;
      D.4694 = D.4692 - D.4693;
      seconds = (gulong) D.4694;
      if (microseconds != 0B) goto <D.4695>; else goto <D.4696>;
      <D.4695>:
      if (usec < 0) goto <D.4697>; else goto <D.4698>;
      <D.4697>:
      usec = usec + 1000000;
      seconds = seconds + 4294967295;
      <D.4698>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.4696>:
      D.4700 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.4702 = D.4700 + usec.1;
      result = (gdouble) D.4702;
      D.4683 = result / 1.0e+6;
      return D.4683;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


