monoeg_g_dir_open (const gchar * path, guint flags, struct GError * * error)
{
  struct GDir * D.5864;
  struct GError * D.5867;
  struct DIR * D.5870;
  struct DIR * D.5871;
  int * D.5876;
  <unnamed type> D.5877;
  int D.5878;
  char * D.5879;
  struct GError * D.5880;
  gchar * D.5881;
  struct GDir * dir;

  if (path == 0B) goto <D.5862>; else goto <D.5863>;
  <D.5862>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 49, "path != NULL");
  D.5864 = 0B;
  return D.5864;
  <D.5863>:
  if (error != 0B) goto <D.5865>; else goto <D.5866>;
  <D.5865>:
  D.5867 = *error;
  if (D.5867 != 0B) goto <D.5868>; else goto <D.5869>;
  <D.5868>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 50, "error == NULL || *error == NULL");
  D.5864 = 0B;
  return D.5864;
  <D.5869>:
  <D.5866>:
  dir = monoeg_malloc (8);
  D.5870 = opendir (path);
  dir->dir = D.5870;
  D.5871 = dir->dir;
  if (D.5871 == 0B) goto <D.5872>; else goto <D.5873>;
  <D.5872>:
  if (error != 0B) goto <D.5874>; else goto <D.5875>;
  <D.5874>:
  {
    gint err;

    D.5876 = __errno_location ();
    err = *D.5876;
    D.5877 = monoeg_g_file_error_from_errno (err);
    D.5878 = (int) D.5877;
    D.5879 = strerror (err);
    D.5880 = monoeg_g_error_new (0B, D.5878, D.5879);
    *error = D.5880;
  }
  <D.5875>:
  monoeg_g_free (dir);
  D.5864 = 0B;
  return D.5864;
  <D.5873>:
  D.5881 = monoeg_strdup (path);
  dir->path = D.5881;
  D.5864 = dir;
  return D.5864;
}


monoeg_strdup (const gchar * str)
{
  gchar * D.5885;

  if (str != 0B) goto <D.5883>; else goto <D.5884>;
  <D.5883>:
  D.5885 = __strdup (str);
  return D.5885;
  <D.5884>:
  D.5885 = 0B;
  return D.5885;
}


monoeg_g_dir_read_name (struct GDir * dir)
{
  struct DIR * D.5890;
  const gchar * D.5891;
  int D.5830;
  int iftmp.0;
  int D.5829;
  char[2] * D.5897;
  unsigned char D.5898;
  int D.5899;
  unsigned char D.5900;
  int D.5901;
  const unsigned char * D.5906;
  unsigned char D.5907;
  int D.5908;
  const unsigned char * D.5909;
  unsigned char D.5910;
  int D.5911;
  const unsigned char * D.5916;
  unsigned char D.5917;
  int D.5918;
  const unsigned char * D.5919;
  unsigned char D.5920;
  int D.5921;
  const unsigned char * D.5926;
  unsigned char D.5927;
  int D.5928;
  const unsigned char * D.5929;
  unsigned char D.5930;
  int D.5931;
  char[256] * D.5933;
  int D.5839;
  int iftmp.1;
  int D.5838;
  char[3] * D.5938;
  unsigned char D.5939;
  int D.5940;
  unsigned char D.5941;
  int D.5942;
  const unsigned char * D.5947;
  unsigned char D.5948;
  int D.5949;
  const unsigned char * D.5950;
  unsigned char D.5951;
  int D.5952;
  const unsigned char * D.5957;
  unsigned char D.5958;
  int D.5959;
  const unsigned char * D.5960;
  unsigned char D.5961;
  int D.5962;
  const unsigned char * D.5967;
  unsigned char D.5968;
  int D.5969;
  const unsigned char * D.5970;
  unsigned char D.5971;
  int D.5972;
  struct dirent * entry;

  if (dir == 0B) goto <D.5887>; else goto <D.5889>;
  <D.5889>:
  D.5890 = dir->dir;
  if (D.5890 == 0B) goto <D.5887>; else goto <D.5888>;
  <D.5887>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 74, "dir != NULL && dir->dir != NULL");
  D.5891 = 0B;
  return D.5891;
  <D.5888>:
  <D.5840>:
  D.5890 = dir->dir;
  entry = readdir (D.5890);
  if (entry == 0B) goto <D.5892>; else goto <D.5893>;
  <D.5892>:
  D.5891 = 0B;
  return D.5891;
  <D.5893>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 1;
    if (__s2_len <= 3) goto <D.5895>; else goto <D.5896>;
    <D.5895>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = &entry->d_name;
      D.5897 = ".";
      D.5898 = MEM[(const unsigned char *)D.5897];
      D.5899 = (int) D.5898;
      D.5900 = *__s2;
      D.5901 = (int) D.5900;
      __result = D.5899 - D.5901;
      {
        if (__s2_len != 0) goto <D.5902>; else goto <D.5903>;
        <D.5902>:
        if (__result == 0) goto <D.5904>; else goto <D.5905>;
        <D.5904>:
        D.5906 = &MEM[(void *)"." + 1B];
        D.5907 = *D.5906;
        D.5908 = (int) D.5907;
        D.5909 = __s2 + 1;
        D.5910 = *D.5909;
        D.5911 = (int) D.5910;
        __result = D.5908 - D.5911;
        if (__s2_len > 1) goto <D.5912>; else goto <D.5913>;
        <D.5912>:
        if (__result == 0) goto <D.5914>; else goto <D.5915>;
        <D.5914>:
        D.5916 = &MEM[(void *)"." + 2B];
        D.5917 = *D.5916;
        D.5918 = (int) D.5917;
        D.5919 = __s2 + 2;
        D.5920 = *D.5919;
        D.5921 = (int) D.5920;
        __result = D.5918 - D.5921;
        if (__s2_len > 2) goto <D.5922>; else goto <D.5923>;
        <D.5922>:
        if (__result == 0) goto <D.5924>; else goto <D.5925>;
        <D.5924>:
        D.5926 = &MEM[(void *)"." + 3B];
        D.5927 = *D.5926;
        D.5928 = (int) D.5927;
        D.5929 = __s2 + 3;
        D.5930 = *D.5929;
        D.5931 = (int) D.5930;
        __result = D.5928 - D.5931;
        <D.5925>:
        <D.5923>:
        <D.5915>:
        <D.5913>:
        <D.5905>:
        <D.5903>:
      }
      D.5829 = __result;
    }
    iftmp.0 = -D.5829;
    goto <D.5932>;
    <D.5896>:
    D.5933 = &entry->d_name;
    iftmp.0 = __builtin_strcmp (D.5933, ".");
    <D.5932>:
    D.5830 = iftmp.0;
  }
  if (D.5830 == 0) goto <D.5840>; else goto <D.5934>;
  <D.5934>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 2;
    if (__s2_len <= 3) goto <D.5936>; else goto <D.5937>;
    <D.5936>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = &entry->d_name;
      D.5938 = "..";
      D.5939 = MEM[(const unsigned char *)D.5938];
      D.5940 = (int) D.5939;
      D.5941 = *__s2;
      D.5942 = (int) D.5941;
      __result = D.5940 - D.5942;
      {
        if (__s2_len != 0) goto <D.5943>; else goto <D.5944>;
        <D.5943>:
        if (__result == 0) goto <D.5945>; else goto <D.5946>;
        <D.5945>:
        D.5947 = &MEM[(void *)".." + 1B];
        D.5948 = *D.5947;
        D.5949 = (int) D.5948;
        D.5950 = __s2 + 1;
        D.5951 = *D.5950;
        D.5952 = (int) D.5951;
        __result = D.5949 - D.5952;
        if (__s2_len > 1) goto <D.5953>; else goto <D.5954>;
        <D.5953>:
        if (__result == 0) goto <D.5955>; else goto <D.5956>;
        <D.5955>:
        D.5957 = &MEM[(void *)".." + 2B];
        D.5958 = *D.5957;
        D.5959 = (int) D.5958;
        D.5960 = __s2 + 2;
        D.5961 = *D.5960;
        D.5962 = (int) D.5961;
        __result = D.5959 - D.5962;
        if (__s2_len > 2) goto <D.5963>; else goto <D.5964>;
        <D.5963>:
        if (__result == 0) goto <D.5965>; else goto <D.5966>;
        <D.5965>:
        D.5967 = &MEM[(void *)".." + 3B];
        D.5968 = *D.5967;
        D.5969 = (int) D.5968;
        D.5970 = __s2 + 3;
        D.5971 = *D.5970;
        D.5972 = (int) D.5971;
        __result = D.5969 - D.5972;
        <D.5966>:
        <D.5964>:
        <D.5956>:
        <D.5954>:
        <D.5946>:
        <D.5944>:
      }
      D.5838 = __result;
    }
    iftmp.1 = -D.5838;
    goto <D.5973>;
    <D.5937>:
    D.5933 = &entry->d_name;
    iftmp.1 = __builtin_strcmp (D.5933, "..");
    <D.5973>:
    D.5839 = iftmp.1;
  }
  if (D.5839 == 0) goto <D.5840>; else goto <D.5841>;
  <D.5841>:
  D.5891 = &entry->d_name;
  return D.5891;
}


monoeg_g_dir_rewind (struct GDir * dir)
{
  struct DIR * D.5978;
  char * D.5979;
  struct DIR * D.5980;

  if (dir == 0B) goto <D.5975>; else goto <D.5977>;
  <D.5977>:
  D.5978 = dir->dir;
  if (D.5978 == 0B) goto <D.5975>; else goto <D.5976>;
  <D.5975>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 87, "dir != NULL && dir->dir != NULL");
  return;
  <D.5976>:
  D.5978 = dir->dir;
  closedir (D.5978);
  D.5979 = dir->path;
  D.5980 = opendir (D.5979);
  dir->dir = D.5980;
}


monoeg_g_dir_close (struct GDir * dir)
{
  struct DIR * D.5985;
  char * D.5986;

  if (dir == 0B) goto <D.5982>; else goto <D.5984>;
  <D.5984>:
  D.5985 = dir->dir;
  if (D.5985 == 0B) goto <D.5982>; else goto <D.5983>;
  <D.5982>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 99, "dir != NULL && dir->dir != 0");
  return;
  <D.5983>:
  D.5985 = dir->dir;
  closedir (D.5985);
  D.5986 = dir->path;
  monoeg_g_free (D.5986);
  dir->dir = 0B;
  monoeg_g_free (dir);
}


monoeg_g_mkdir_with_parents (const gchar * pathname, int mode)
{
  char D.5991;
  int * D.5992;
  int D.5993;
  char D.5994;
  unsigned int mode.2;
  int D.6004;
  char * d.3;
  char * path;
  char * d;
  int rv;

  if (pathname == 0B) goto <D.5988>; else goto <D.5990>;
  <D.5990>:
  D.5991 = *pathname;
  if (D.5991 == 0) goto <D.5988>; else goto <D.5989>;
  <D.5988>:
  D.5992 = __errno_location ();
  *D.5992 = 22;
  D.5993 = -1;
  return D.5993;
  <D.5989>:
  path = monoeg_strdup (pathname);
  d = path;
  D.5994 = *d;
  if (D.5994 == 47) goto <D.5995>; else goto <D.5996>;
  <D.5995>:
  d = d + 1;
  <D.5996>:
  <D.5860>:
  D.5994 = *d;
  if (D.5994 == 47) goto <D.5997>; else goto <D.6000>;
  <D.6000>:
  D.5994 = *d;
  if (D.5994 == 0) goto <D.5997>; else goto <D.5998>;
  <D.5997>:
  {
    char orig;

    orig = *d;
    *d = 0;
    mode.2 = (unsigned int) mode;
    rv = mkdir (path, mode.2);
    if (rv == -1) goto <D.6002>; else goto <D.6003>;
    <D.6002>:
    D.5992 = __errno_location ();
    D.6004 = *D.5992;
    if (D.6004 != 17) goto <D.6005>; else goto <D.6006>;
    <D.6005>:
    monoeg_g_free (path);
    D.5993 = -1;
    return D.5993;
    <D.6006>:
    <D.6003>:
    d.3 = d;
    d = d.3 + 1;
    *d.3 = orig;
    goto <D.5857>;
    <D.5856>:
    d = d + 1;
    <D.5857>:
    if (orig == 47) goto <D.6008>; else goto <D.5858>;
    <D.6008>:
    D.5994 = *d;
    if (D.5994 == 47) goto <D.5856>; else goto <D.5858>;
    <D.5858>:
    if (orig == 0) goto <D.5859>; else goto <D.6009>;
    <D.6009>:
  }
  goto <D.5999>;
  <D.5998>:
  d = d + 1;
  <D.5999>:
  goto <D.5860>;
  <D.5859>:
  monoeg_g_free (path);
  D.5993 = 0;
  return D.5993;
}


