monoeg_g_error_new (void * domain, gint code, const char * format)
{
  gchar * * D.7211;
  int D.7212;
  gchar * D.7215;
  struct GError * D.7216;
  struct va_list args;
  struct GError * err;

  try
    {
      err = monoeg_malloc (12);
      err->domain = domain;
      err->code = code;
      __builtin_va_start (&args, 0);
      D.7211 = &err->message;
      D.7212 = vasprintf (D.7211, format, args);
      if (D.7212 == -1) goto <D.7213>; else goto <D.7214>;
      <D.7213>:
      D.7215 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
      err->message = D.7215;
      <D.7214>:
      __builtin_va_end (&args);
      D.7216 = err;
      return D.7216;
    }
  finally
    {
      args = {CLOBBER};
    }
}


vasprintf (char * * restrict __ptr, const char * restrict __fmt, struct __gnuc_va_list __ap)
{
  int D.7219;

  D.7219 = __vasprintf_chk (__ptr, 1, __fmt, __ap);
  return D.7219;
}


monoeg_g_clear_error (struct GError * * error)
{
  struct GError * D.7223;

  if (error != 0B) goto <D.7221>; else goto <D.7222>;
  <D.7221>:
  D.7223 = *error;
  if (D.7223 != 0B) goto <D.7224>; else goto <D.7225>;
  <D.7224>:
  D.7223 = *error;
  monoeg_g_error_free (D.7223);
  *error = 0B;
  <D.7225>:
  <D.7222>:
}


monoeg_g_error_free (struct GError * error)
{
  gchar * D.7228;

  if (error == 0B) goto <D.7226>; else goto <D.7227>;
  <D.7226>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gerror.c", 76, "error != NULL");
  return;
  <D.7227>:
  D.7228 = error->message;
  free (D.7228);
  monoeg_g_free (error);
}


monoeg_g_set_error (struct GError * * err, void * domain, gint code, const gchar * format)
{
  struct GError * D.7232;
  struct va_list args;

  try
    {
      if (err != 0B) goto <D.7230>; else goto <D.7231>;
      <D.7230>:
      __builtin_va_start (&args, 0);
      D.7232 = monoeg_g_error_vnew (domain, code, format, args);
      *err = D.7232;
      __builtin_va_end (&args);
      <D.7231>:
    }
  finally
    {
      args = {CLOBBER};
    }
}


monoeg_g_error_vnew (void * domain, gint code, const char * format, struct va_list ap)
{
  gchar * * D.7233;
  int D.7234;
  gchar * D.7237;
  struct GError * D.7238;
  struct GError * err;

  err = monoeg_malloc (12);
  err->domain = domain;
  err->code = code;
  D.7233 = &err->message;
  D.7234 = vasprintf (D.7233, format, ap);
  if (D.7234 == -1) goto <D.7235>; else goto <D.7236>;
  <D.7235>:
  D.7237 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
  err->message = D.7237;
  <D.7236>:
  D.7238 = err;
  return D.7238;
}


monoeg_g_propagate_error (struct GError * * dest, struct GError * src)
{
  if (dest == 0B) goto <D.7240>; else goto <D.7241>;
  <D.7240>:
  if (src != 0B) goto <D.7242>; else goto <D.7243>;
  <D.7242>:
  monoeg_g_error_free (src);
  <D.7243>:
  goto <D.7244>;
  <D.7241>:
  *dest = src;
  <D.7244>:
}


