monoeg_g_file_get_contents (const gchar * filename, gchar * * contents, gsize * length, struct GError * * error)
{
  gboolean D.6768;
  struct GError * D.6773;
  int * D.6782;
  <unnamed type> D.6783;
  int D.6784;
  struct GError * D.6785;
  int D.6786;
  <unnamed type> D.6791;
  int D.6792;
  struct GError * D.6793;
  long int D.6794;
  long int D.6795;
  long unsigned int D.6796;
  sizetype offset.0;
  void * D.6798;
  long int D.6799;
  long unsigned int D.6800;
  long int D.6801;
  long int D.6804;
  int D.6808;
  sizetype D.6809;
  gchar * D.6810;
  long unsigned int D.6813;
  gchar * str;
  int fd;
  struct stat st;
  long int offset;
  int nread;

  try
    {
      if (filename == 0B) goto <D.6766>; else goto <D.6767>;
      <D.6766>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gfile-posix.c", 61, "filename != NULL");
      D.6768 = 0;
      return D.6768;
      <D.6767>:
      if (contents == 0B) goto <D.6769>; else goto <D.6770>;
      <D.6769>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gfile-posix.c", 62, "contents != NULL");
      D.6768 = 0;
      return D.6768;
      <D.6770>:
      if (error != 0B) goto <D.6771>; else goto <D.6772>;
      <D.6771>:
      D.6773 = *error;
      if (D.6773 != 0B) goto <D.6774>; else goto <D.6775>;
      <D.6774>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gfile-posix.c", 63, "error == NULL || *error == NULL");
      D.6768 = 0;
      return D.6768;
      <D.6775>:
      <D.6772>:
      *contents = 0B;
      if (length != 0B) goto <D.6776>; else goto <D.6777>;
      <D.6776>:
      *length = 0;
      <D.6777>:
      fd = open (filename, 0);
      if (fd == -1) goto <D.6778>; else goto <D.6779>;
      <D.6778>:
      if (error != 0B) goto <D.6780>; else goto <D.6781>;
      <D.6780>:
      {
        int err;

        D.6782 = __errno_location ();
        err = *D.6782;
        D.6783 = monoeg_g_file_error_from_errno (err);
        D.6784 = (int) D.6783;
        D.6785 = monoeg_g_error_new (0B, D.6784, "Error opening file");
        *error = D.6785;
      }
      <D.6781>:
      D.6768 = 0;
      return D.6768;
      <D.6779>:
      D.6786 = fstat (fd, &st);
      if (D.6786 != 0) goto <D.6787>; else goto <D.6788>;
      <D.6787>:
      if (error != 0B) goto <D.6789>; else goto <D.6790>;
      <D.6789>:
      {
        int err;

        D.6782 = __errno_location ();
        err = *D.6782;
        D.6791 = monoeg_g_file_error_from_errno (err);
        D.6792 = (int) D.6791;
        D.6793 = monoeg_g_error_new (0B, D.6792, "Error in fstat()");
        *error = D.6793;
      }
      <D.6790>:
      close (fd);
      D.6768 = 0;
      return D.6768;
      <D.6788>:
      D.6794 = st.st_size;
      D.6795 = D.6794 + 1;
      D.6796 = (long unsigned int) D.6795;
      str = monoeg_malloc (D.6796);
      offset = 0;
      <D.6735>:
      offset.0 = (sizetype) offset;
      D.6798 = str + offset.0;
      D.6794 = st.st_size;
      D.6799 = D.6794 - offset;
      D.6800 = (long unsigned int) D.6799;
      D.6801 = read (fd, D.6798, D.6800);
      nread = (int) D.6801;
      if (nread > 0) goto <D.6802>; else goto <D.6803>;
      <D.6802>:
      D.6804 = (long int) nread;
      offset = D.6804 + offset;
      <D.6803>:
      if (nread > 0) goto <D.6806>; else goto <D.6805>;
      <D.6806>:
      D.6794 = st.st_size;
      if (D.6794 > offset) goto <D.6735>; else goto <D.6805>;
      <D.6805>:
      if (nread == -1) goto <D.6807>; else goto <D.6736>;
      <D.6807>:
      D.6782 = __errno_location ();
      D.6808 = *D.6782;
      if (D.6808 == 4) goto <D.6735>; else goto <D.6736>;
      <D.6736>:
      close (fd);
      D.6794 = st.st_size;
      D.6809 = (sizetype) D.6794;
      D.6810 = str + D.6809;
      *D.6810 = 0;
      if (length != 0B) goto <D.6811>; else goto <D.6812>;
      <D.6811>:
      D.6794 = st.st_size;
      D.6813 = (long unsigned int) D.6794;
      *length = D.6813;
      <D.6812>:
      *contents = str;
      D.6768 = 1;
      return D.6768;
    }
  finally
    {
      st = {CLOBBER};
    }
}


open (const char * __path, int __oflag)
{
  int D.6816;
  int D.6819;
  int D.6824;
  int D.6826;
  int D.6827;
  int D.6830;
  int D.6831;

  D.6816 = __builtin_va_arg_pack_len ();
  if (D.6816 > 1) goto <D.6817>; else goto <D.6818>;
  <D.6817>:
  __open_too_many_args ();
  <D.6818>:
  D.6819 = __builtin_constant_p (__oflag);
  if (D.6819 != 0) goto <D.6820>; else goto <D.6821>;
  <D.6820>:
  D.6824 = __oflag & 64;
  if (D.6824 != 0) goto <D.6822>; else goto <D.6825>;
  <D.6825>:
  D.6826 = __oflag & 4259840;
  if (D.6826 == 4259840) goto <D.6822>; else goto <D.6823>;
  <D.6822>:
  D.6827 = __builtin_va_arg_pack_len ();
  if (D.6827 <= 0) goto <D.6828>; else goto <D.6829>;
  <D.6828>:
  __open_missing_mode ();
  D.6830 = __open_2 (__path, __oflag);
  return D.6830;
  <D.6829>:
  <D.6823>:
  D.6830 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.6830;
  <D.6821>:
  D.6831 = __builtin_va_arg_pack_len ();
  if (D.6831 <= 0) goto <D.6832>; else goto <D.6833>;
  <D.6832>:
  D.6830 = __open_2 (__path, __oflag);
  return D.6830;
  <D.6833>:
  D.6830 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.6830;
}


fstat (int __fd, struct stat * __statbuf)
{
  int D.6835;

  D.6835 = __fxstat (1, __fd, __statbuf);
  return D.6835;
}


read (int __fd, void * __buf, size_t __nbytes)
{
  long unsigned int D.6837;
  int D.6840;
  ssize_t D.6843;
  long unsigned int D.6844;
  long unsigned int D.6845;
  long unsigned int D.6848;

  D.6837 = __builtin_object_size (__buf, 0);
  if (D.6837 != 18446744073709551615) goto <D.6838>; else goto <D.6839>;
  <D.6838>:
  D.6840 = __builtin_constant_p (__nbytes);
  if (D.6840 == 0) goto <D.6841>; else goto <D.6842>;
  <D.6841>:
  D.6844 = __builtin_object_size (__buf, 0);
  D.6843 = __read_chk (__fd, __buf, __nbytes, D.6844);
  return D.6843;
  <D.6842>:
  D.6845 = __builtin_object_size (__buf, 0);
  if (D.6845 < __nbytes) goto <D.6846>; else goto <D.6847>;
  <D.6846>:
  D.6848 = __builtin_object_size (__buf, 0);
  D.6843 = __read_chk_warn (__fd, __buf, __nbytes, D.6848);
  return D.6843;
  <D.6847>:
  <D.6839>:
  D.6843 = __read_alias (__fd, __buf, __nbytes);
  return D.6843;
}


monoeg_g_file_open_tmp (const gchar * tmpl, gchar * * name_used, struct GError * * error)
{
  struct GError * D.6852;
  gint D.6855;
  char * D.6858;
  struct GError * D.6863;
  int D.6754;
  int iftmp.1;
  int D.6753;
  sizetype D.6870;
  char[7] * D.6871;
  unsigned char D.6872;
  int D.6873;
  unsigned char D.6874;
  int D.6875;
  const unsigned char * D.6880;
  unsigned char D.6881;
  int D.6882;
  const unsigned char * D.6883;
  unsigned char D.6884;
  int D.6885;
  const unsigned char * D.6890;
  unsigned char D.6891;
  int D.6892;
  const unsigned char * D.6893;
  unsigned char D.6894;
  int D.6895;
  const unsigned char * D.6900;
  unsigned char D.6901;
  int D.6902;
  const unsigned char * D.6903;
  unsigned char D.6904;
  int D.6905;
  const gchar * D.6907;
  struct GError * D.6910;
  const gchar * D.6911;
  int * D.6916;
  <unnamed type> D.6917;
  int D.6918;
  struct GError * D.6919;
  static const gchar * default_tmpl = (const gchar *) ".XXXXXX";
  gchar * t;
  gint fd;
  size_t len;

  if (error != 0B) goto <D.6850>; else goto <D.6851>;
  <D.6850>:
  D.6852 = *error;
  if (D.6852 != 0B) goto <D.6853>; else goto <D.6854>;
  <D.6853>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gfile-posix.c", 113, "error == NULL || *error == NULL");
  D.6855 = -1;
  return D.6855;
  <D.6854>:
  <D.6851>:
  if (tmpl == 0B) goto <D.6856>; else goto <D.6857>;
  <D.6856>:
  tmpl = default_tmpl;
  <D.6857>:
  D.6858 = __builtin_strchr (tmpl, 47);
  if (D.6858 != 0B) goto <D.6859>; else goto <D.6860>;
  <D.6859>:
  if (error != 0B) goto <D.6861>; else goto <D.6862>;
  <D.6861>:
  D.6863 = monoeg_g_error_new (0B, 24, "Template should not have any /");
  *error = D.6863;
  <D.6862>:
  D.6855 = -1;
  return D.6855;
  <D.6860>:
  len = strlen (tmpl);
  if (len <= 5) goto <D.6864>; else goto <D.6866>;
  <D.6866>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 6;
    if (__s2_len <= 3) goto <D.6868>; else goto <D.6869>;
    <D.6868>:
    {
      const unsigned char * __s2;
      int __result;

      D.6870 = len + 18446744073709551610;
      __s2 = tmpl + D.6870;
      D.6871 = "XXXXXX";
      D.6872 = MEM[(const unsigned char *)D.6871];
      D.6873 = (int) D.6872;
      D.6874 = *__s2;
      D.6875 = (int) D.6874;
      __result = D.6873 - D.6875;
      {
        if (__s2_len != 0) goto <D.6876>; else goto <D.6877>;
        <D.6876>:
        if (__result == 0) goto <D.6878>; else goto <D.6879>;
        <D.6878>:
        D.6880 = &MEM[(void *)"XXXXXX" + 1B];
        D.6881 = *D.6880;
        D.6882 = (int) D.6881;
        D.6883 = __s2 + 1;
        D.6884 = *D.6883;
        D.6885 = (int) D.6884;
        __result = D.6882 - D.6885;
        if (__s2_len > 1) goto <D.6886>; else goto <D.6887>;
        <D.6886>:
        if (__result == 0) goto <D.6888>; else goto <D.6889>;
        <D.6888>:
        D.6890 = &MEM[(void *)"XXXXXX" + 2B];
        D.6891 = *D.6890;
        D.6892 = (int) D.6891;
        D.6893 = __s2 + 2;
        D.6894 = *D.6893;
        D.6895 = (int) D.6894;
        __result = D.6892 - D.6895;
        if (__s2_len > 2) goto <D.6896>; else goto <D.6897>;
        <D.6896>:
        if (__result == 0) goto <D.6898>; else goto <D.6899>;
        <D.6898>:
        D.6900 = &MEM[(void *)"XXXXXX" + 3B];
        D.6901 = *D.6900;
        D.6902 = (int) D.6901;
        D.6903 = __s2 + 3;
        D.6904 = *D.6903;
        D.6905 = (int) D.6904;
        __result = D.6902 - D.6905;
        <D.6899>:
        <D.6897>:
        <D.6889>:
        <D.6887>:
        <D.6879>:
        <D.6877>:
      }
      D.6753 = __result;
    }
    iftmp.1 = -D.6753;
    goto <D.6906>;
    <D.6869>:
    D.6870 = len + 18446744073709551610;
    D.6907 = tmpl + D.6870;
    iftmp.1 = __builtin_strcmp (D.6907, "XXXXXX");
    <D.6906>:
    D.6754 = iftmp.1;
  }
  if (D.6754 != 0) goto <D.6864>; else goto <D.6865>;
  <D.6864>:
  if (error != 0B) goto <D.6908>; else goto <D.6909>;
  <D.6908>:
  D.6910 = monoeg_g_error_new (0B, 24, "Template should end with XXXXXX");
  *error = D.6910;
  <D.6909>:
  D.6855 = -1;
  return D.6855;
  <D.6865>:
  D.6911 = monoeg_g_get_tmp_dir ();
  t = monoeg_g_build_path ("/", D.6911, tmpl, 0B);
  fd = mkstemp (t);
  if (fd == -1) goto <D.6912>; else goto <D.6913>;
  <D.6912>:
  if (error != 0B) goto <D.6914>; else goto <D.6915>;
  <D.6914>:
  {
    int err;

    D.6916 = __errno_location ();
    err = *D.6916;
    D.6917 = monoeg_g_file_error_from_errno (err);
    D.6918 = (int) D.6917;
    D.6919 = monoeg_g_error_new (0B, D.6918, "Error in mkstemp()");
    *error = D.6919;
  }
  <D.6915>:
  monoeg_g_free (t);
  D.6855 = -1;
  return D.6855;
  <D.6913>:
  if (name_used != 0B) goto <D.6920>; else goto <D.6921>;
  <D.6920>:
  *name_used = t;
  goto <D.6922>;
  <D.6921>:
  monoeg_g_free (t);
  <D.6922>:
  D.6855 = fd;
  return D.6855;
}


monoeg_g_get_current_dir ()
{
  long unsigned int D.6924;
  long unsigned int D.6925;
  int iftmp.2;
  int * D.6930;
  int D.6931;
  gchar * D.6935;
  int s;
  char * buffer;
  char * r;
  gboolean fail;

  s = 32;
  buffer = 0B;
  <D.6763>:
  D.6924 = (long unsigned int) s;
  buffer = monoeg_realloc (buffer, D.6924);
  D.6925 = (long unsigned int) s;
  r = getcwd (buffer, D.6925);
  if (r == 0B) goto <D.6929>; else goto <D.6927>;
  <D.6929>:
  D.6930 = __errno_location ();
  D.6931 = *D.6930;
  if (D.6931 == 34) goto <D.6932>; else goto <D.6927>;
  <D.6932>:
  iftmp.2 = 1;
  goto <D.6928>;
  <D.6927>:
  iftmp.2 = 0;
  <D.6928>:
  fail = iftmp.2;
  if (fail != 0) goto <D.6933>; else goto <D.6934>;
  <D.6933>:
  s = s << 1;
  <D.6934>:
  if (fail != 0) goto <D.6763>; else goto <D.6764>;
  <D.6764>:
  D.6935 = buffer;
  return D.6935;
}


getcwd (char * __buf, size_t __size)
{
  long unsigned int D.6937;
  int D.6940;
  char * D.6943;
  long unsigned int D.6944;
  long unsigned int D.6945;
  long unsigned int D.6948;

  D.6937 = __builtin_object_size (__buf, 1);
  if (D.6937 != 18446744073709551615) goto <D.6938>; else goto <D.6939>;
  <D.6938>:
  D.6940 = __builtin_constant_p (__size);
  if (D.6940 == 0) goto <D.6941>; else goto <D.6942>;
  <D.6941>:
  D.6944 = __builtin_object_size (__buf, 1);
  D.6943 = __getcwd_chk (__buf, __size, D.6944);
  return D.6943;
  <D.6942>:
  D.6945 = __builtin_object_size (__buf, 1);
  if (D.6945 < __size) goto <D.6946>; else goto <D.6947>;
  <D.6946>:
  D.6948 = __builtin_object_size (__buf, 1);
  D.6943 = __getcwd_chk_warn (__buf, __size, D.6948);
  return D.6943;
  <D.6947>:
  <D.6939>:
  D.6943 = __getcwd_alias (__buf, __size);
  return D.6943;
}


