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

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


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


monoeg_g_timer_start (struct GTimer * timer)
{
  struct timeval * D.7251;
  struct timeval * D.7252;

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.7256;
  int D.7261;
  void * D.7263;
  unsigned int D.7264;

  D.7256 = __builtin_constant_p (__len);
  if (D.7256 != 0) goto <D.7257>; else goto <D.7258>;
  <D.7257>:
  if (__len == 0) goto <D.7259>; else goto <D.7260>;
  <D.7259>:
  D.7261 = __builtin_constant_p (__ch);
  if (D.7261 == 0) goto <D.7254>; else goto <D.7262>;
  <D.7262>:
  if (__ch != 0) goto <D.7254>; else goto <D.7255>;
  <D.7254>:
  __warn_memset_zero_len ();
  D.7263 = __dest;
  return D.7263;
  <D.7255>:
  <D.7260>:
  <D.7258>:
  D.7264 = __builtin_object_size (__dest, 0);
  D.7263 = __builtin___memset_chk (__dest, __ch, __len, D.7264);
  return D.7263;
}


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

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


monoeg_g_timer_elapsed (struct GTimer * timer, gulong * microseconds)
{
  gdouble D.7272;
  long int D.7275;
  long int D.7277;
  long int D.7279;
  long int D.7280;
  long int D.7281;
  long int D.7282;
  long int D.7283;
  long unsigned int usec.0;
  long unsigned int D.7289;
  long unsigned int usec.1;
  long unsigned int D.7291;
  struct timeval tv;
  gulong seconds;
  long int usec;
  gdouble result;

  try
    {
      if (timer == 0B) goto <D.7270>; else goto <D.7271>;
      <D.7270>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gtimer-unix.c", 75, "timer != NULL");
      D.7272 = 0.0;
      return D.7272;
      <D.7271>:
      D.7275 = timer->stop.tv_sec;
      if (D.7275 == 0) goto <D.7276>; else goto <D.7273>;
      <D.7276>:
      D.7277 = timer->stop.tv_usec;
      if (D.7277 == 0) goto <D.7278>; else goto <D.7273>;
      <D.7278>:
      gettimeofday (&tv, 0B);
      goto <D.7274>;
      <D.7273>:
      tv = timer->stop;
      <D.7274>:
      D.7279 = tv.tv_usec;
      D.7280 = timer->start.tv_usec;
      usec = D.7279 - D.7280;
      D.7281 = tv.tv_sec;
      D.7282 = timer->start.tv_sec;
      D.7283 = D.7281 - D.7282;
      seconds = (gulong) D.7283;
      if (microseconds != 0B) goto <D.7284>; else goto <D.7285>;
      <D.7284>:
      if (usec < 0) goto <D.7286>; else goto <D.7287>;
      <D.7286>:
      usec = usec + 1000000;
      seconds = seconds + 4294967295;
      <D.7287>:
      usec.0 = (long unsigned int) usec;
      *microseconds = usec.0;
      <D.7285>:
      D.7289 = seconds * 1000000;
      usec.1 = (long unsigned int) usec;
      D.7291 = D.7289 + usec.1;
      result = (gdouble) D.7291;
      D.7272 = result / 1.0e+6;
      return D.7272;
    }
  finally
    {
      tv = {CLOBBER};
    }
}


