monoeg_g_error_new (void * domain, gint code, const char * format)
{
  gchar * * D.5055;
  int D.5056;
  gchar * D.5059;
  struct GError * D.5060;
  struct  args[1];
  struct GError * err;

  try
    {
      err = monoeg_malloc (24);
      err->domain = domain;
      err->code = code;
      __builtin_va_start (&args, 0);
      D.5055 = &err->message;
      D.5056 = vasprintf (D.5055, format, &args);
      if (D.5056 == -1) goto <D.5057>; else goto <D.5058>;
      <D.5057>:
      D.5059 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
      err->message = D.5059;
      <D.5058>:
      __builtin_va_end (&args);
      D.5060 = err;
      return D.5060;
    }
  finally
    {
      args = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __leaf__, __nothrow__))
vasprintf (char * * restrict __ptr, const char * restrict __fmt, struct  * __ap)
{
  int D.5063;

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


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

  if (error != 0B) goto <D.5065>; else goto <D.5066>;
  <D.5065>:
  D.5067 = *error;
  if (D.5067 != 0B) goto <D.5068>; else goto <D.5069>;
  <D.5068>:
  D.5067 = *error;
  monoeg_g_error_free (D.5067);
  *error = 0B;
  <D.5069>:
  <D.5066>:
}


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

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


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

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


monoeg_g_error_vnew (void * domain, gint code, const char * format, struct  * ap)
{
  gchar * * D.5077;
  int D.5078;
  gchar * D.5081;
  struct GError * D.5082;
  struct GError * err;

  err = monoeg_malloc (24);
  err->domain = domain;
  err->code = code;
  D.5077 = &err->message;
  D.5078 = vasprintf (D.5077, format, ap);
  if (D.5078 == -1) goto <D.5079>; else goto <D.5080>;
  <D.5079>:
  D.5081 = monoeg_g_strdup_printf ("internal: invalid format string %s", format);
  err->message = D.5081;
  <D.5080>:
  D.5082 = err;
  return D.5082;
}


monoeg_g_propagate_error (struct GError * * dest, struct GError * src)
{
  if (dest == 0B) goto <D.5084>; else goto <D.5085>;
  <D.5084>:
  if (src != 0B) goto <D.5086>; else goto <D.5087>;
  <D.5086>:
  monoeg_g_error_free (src);
  <D.5087>:
  goto <D.5088>;
  <D.5085>:
  *dest = src;
  <D.5088>:
}


