monoeg_g_error_new (void * domain, gint code, const char * format)
{
  char * args.0;
  gchar * * D.4603;
  int D.4604;
  gchar * D.4607;
  struct GError * D.4608;
  char * args;
  struct GError * err;

  try
    {
      err = monoeg_malloc (12);
      err->domain = domain;
      err->code = code;
      __builtin_va_start (&args, 0);
      args.0 = args;
      D.4603 = &err->message;
      D.4604 = vasprintf (D.4603, format, args.0);
      if (D.4604 == -1) goto <D.4605>; else goto <D.4606>;
      <D.4605>:
      D.4607 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
      err->message = D.4607;
      <D.4606>:
      __builtin_va_end (&args);
      D.4608 = err;
      return D.4608;
    }
  finally
    {
      args = {CLOBBER};
    }
}


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

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


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

  if (error != 0B) goto <D.4613>; else goto <D.4614>;
  <D.4613>:
  D.4615 = *error;
  if (D.4615 != 0B) goto <D.4616>; else goto <D.4617>;
  <D.4616>:
  D.4615 = *error;
  monoeg_g_error_free (D.4615);
  *error = 0B;
  <D.4617>:
  <D.4614>:
}


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

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


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

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


monoeg_g_error_vnew (void * domain, gint code, const char * format, char * ap)
{
  gchar * * D.4626;
  int D.4627;
  gchar * D.4630;
  struct GError * D.4631;
  struct GError * err;

  err = monoeg_malloc (12);
  err->domain = domain;
  err->code = code;
  D.4626 = &err->message;
  D.4627 = vasprintf (D.4626, format, ap);
  if (D.4627 == -1) goto <D.4628>; else goto <D.4629>;
  <D.4628>:
  D.4630 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
  err->message = D.4630;
  <D.4629>:
  D.4631 = err;
  return D.4631;
}


monoeg_g_propagate_error (struct GError * * dest, struct GError * src)
{
  if (dest == 0B) goto <D.4633>; else goto <D.4634>;
  <D.4633>:
  if (src != 0B) goto <D.4635>; else goto <D.4636>;
  <D.4635>:
  monoeg_g_error_free (src);
  <D.4636>:
  goto <D.4637>;
  <D.4634>:
  *dest = src;
  <D.4637>:
}


