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

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


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


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.4642;
  struct timeval * D.4643;

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.4647;
  int D.4652;
  void * D.4654;
  unsigned int D.4655;

  D.4647 = __builtin_constant_p (__len);
  if (D.4647 != 0) goto <D.4648>; else goto <D.4649>;
  <D.4648>:
  if (__len == 0) goto <D.4650>; else goto <D.4651>;
  <D.4650>:
  D.4652 = __builtin_constant_p (__ch);
  if (D.4652 == 0) goto <D.4645>; else goto <D.4653>;
  <D.4653>:
  if (__ch != 0) goto <D.4645>; else goto <D.4646>;
  <D.4645>:
  __warn_memset_zero_len ();
  D.4654 = __dest;
  return D.4654;
  <D.4646>:
  <D.4651>:
  <D.4649>:
  D.4655 = __builtin_object_size (__dest, 0);
  D.4654 = __builtin___memset_chk (__dest, __ch, __len, D.4655);
  return D.4654;
}


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

  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", 63, "timer != NULL");
  return;
  <D.4658>:
  D.4659 = &timer->stop;
  gettimeofday (D.4659, 0B);
}


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.4663;
  long int D.4666;
  long int D.4668;
  long int D.4670;
  long int D.4671;
  long int D.4672;
  long int D.4673;
  long int D.4674;
  long unsigned int usec.0;
  long unsigned int D.4680;
  long unsigned int usec.1;
  long unsigned int D.4682;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.4661>; else goto <D.4662>;
      <D.4661>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.4663 = 0.0;
      return D.4663;
      <D.4662>:
      D.4666 = timer->stop.tv_sec;
      if (D.4666 == 0) goto <D.4667>; else goto <D.4664>;
      <D.4667>:
      D.4668 = timer->stop.tv_usec;
      if (D.4668 == 0) goto <D.4669>; else goto <D.4664>;
      <D.4669>:
      gettimeofday (&tv, 0B);
      goto <D.4665>;
      <D.4664>:
      tv = timer->stop;
      <D.4665>:
      D.4670 = tv.tv_usec;
      D.4671 = timer->start.tv_usec;
      usec = D.4670 - D.4671;
      D.4672 = tv.tv_sec;
      D.4673 = timer->start.tv_sec;
      D.4674 = D.4672 - D.4673;
      seconds = (gulong) D.4674;
      if (microseconds != 0B) goto <D.4675>; else goto <D.4676>;
      <D.4675>:
      if (usec < 0) goto <D.4677>; else goto <D.4678>;
      <D.4677>:
      usec = usec + 1000000;
      seconds = seconds + 4294967295;
      <D.4678>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.4676>:
      D.4680 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.4682 = D.4680 + usec.1;
      result = (gdouble) D.4682;
      D.4663 = result / 1.0e+6;
      return D.4663;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


