monoeg_g_dir_open (const gchar * path, guint flags, struct GError * * error)
{
  struct GDir * D.6708;
  struct GError * D.6711;
  struct DIR * D.6714;
  struct DIR * D.6715;
  int * D.6720;
  <unnamed type> D.6721;
  int D.6722;
  char * D.6723;
  struct GError * D.6724;
  gchar * D.6725;
  struct GDir * dir;

  if (path == 0B) goto <D.6706>; else goto <D.6707>;
  <D.6706>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 49, "path != NULL");
  D.6708 = 0B;
  return D.6708;
  <D.6707>:
  if (error != 0B) goto <D.6709>; else goto <D.6710>;
  <D.6709>:
  D.6711 = *error;
  if (D.6711 != 0B) goto <D.6712>; else goto <D.6713>;
  <D.6712>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 50, "error == NULL || *error == NULL");
  D.6708 = 0B;
  return D.6708;
  <D.6713>:
  <D.6710>:
  dir = monoeg_malloc (16);
  D.6714 = opendir (path);
  dir->dir = D.6714;
  D.6715 = dir->dir;
  if (D.6715 == 0B) goto <D.6716>; else goto <D.6717>;
  <D.6716>:
  if (error != 0B) goto <D.6718>; else goto <D.6719>;
  <D.6718>:
  {
    gint err;

    D.6720 = __errno_location ();
    err = *D.6720;
    D.6721 = monoeg_g_file_error_from_errno (err);
    D.6722 = (int) D.6721;
    D.6723 = strerror (err);
    D.6724 = monoeg_g_error_new (0B, D.6722, D.6723);
    *error = D.6724;
  }
  <D.6719>:
  monoeg_g_free (dir);
  D.6708 = 0B;
  return D.6708;
  <D.6717>:
  D.6725 = monoeg_strdup (path);
  dir->path = D.6725;
  D.6708 = dir;
  return D.6708;
}


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

  if (str != 0B) goto <D.6727>; else goto <D.6728>;
  <D.6727>:
  D.6729 = __strdup (str);
  return D.6729;
  <D.6728>:
  D.6729 = 0B;
  return D.6729;
}


monoeg_g_dir_read_name (struct GDir * dir)
{
  struct DIR * D.6734;
  const gchar * D.6735;
  int D.6674;
  int iftmp.0;
  int D.6673;
  char[2] * D.6741;
  unsigned char D.6742;
  int D.6743;
  unsigned char D.6744;
  int D.6745;
  const unsigned char * D.6750;
  unsigned char D.6751;
  int D.6752;
  const unsigned char * D.6753;
  unsigned char D.6754;
  int D.6755;
  const unsigned char * D.6760;
  unsigned char D.6761;
  int D.6762;
  const unsigned char * D.6763;
  unsigned char D.6764;
  int D.6765;
  const unsigned char * D.6770;
  unsigned char D.6771;
  int D.6772;
  const unsigned char * D.6773;
  unsigned char D.6774;
  int D.6775;
  char[256] * D.6777;
  int D.6683;
  int iftmp.1;
  int D.6682;
  char[3] * D.6782;
  unsigned char D.6783;
  int D.6784;
  unsigned char D.6785;
  int D.6786;
  const unsigned char * D.6791;
  unsigned char D.6792;
  int D.6793;
  const unsigned char * D.6794;
  unsigned char D.6795;
  int D.6796;
  const unsigned char * D.6801;
  unsigned char D.6802;
  int D.6803;
  const unsigned char * D.6804;
  unsigned char D.6805;
  int D.6806;
  const unsigned char * D.6811;
  unsigned char D.6812;
  int D.6813;
  const unsigned char * D.6814;
  unsigned char D.6815;
  int D.6816;
  struct dirent * entry;

  if (dir == 0B) goto <D.6731>; else goto <D.6733>;
  <D.6733>:
  D.6734 = dir->dir;
  if (D.6734 == 0B) goto <D.6731>; else goto <D.6732>;
  <D.6731>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 74, "dir != NULL && dir->dir != NULL");
  D.6735 = 0B;
  return D.6735;
  <D.6732>:
  <D.6684>:
  D.6734 = dir->dir;
  entry = readdir (D.6734);
  if (entry == 0B) goto <D.6736>; else goto <D.6737>;
  <D.6736>:
  D.6735 = 0B;
  return D.6735;
  <D.6737>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.6741 = ".";
      D.6742 = MEM[(const unsigned char *)D.6741];
      D.6743 = (int) D.6742;
      D.6744 = *__s2;
      D.6745 = (int) D.6744;
      __result = D.6743 - D.6745;
      {
        if (__s2_len != 0) goto <D.6746>; else goto <D.6747>;
        <D.6746>:
        if (__result == 0) goto <D.6748>; else goto <D.6749>;
        <D.6748>:
        D.6750 = &MEM[(void *)"." + 1B];
        D.6751 = *D.6750;
        D.6752 = (int) D.6751;
        D.6753 = __s2 + 1;
        D.6754 = *D.6753;
        D.6755 = (int) D.6754;
        __result = D.6752 - D.6755;
        if (__s2_len > 1) goto <D.6756>; else goto <D.6757>;
        <D.6756>:
        if (__result == 0) goto <D.6758>; else goto <D.6759>;
        <D.6758>:
        D.6760 = &MEM[(void *)"." + 2B];
        D.6761 = *D.6760;
        D.6762 = (int) D.6761;
        D.6763 = __s2 + 2;
        D.6764 = *D.6763;
        D.6765 = (int) D.6764;
        __result = D.6762 - D.6765;
        if (__s2_len > 2) goto <D.6766>; else goto <D.6767>;
        <D.6766>:
        if (__result == 0) goto <D.6768>; else goto <D.6769>;
        <D.6768>:
        D.6770 = &MEM[(void *)"." + 3B];
        D.6771 = *D.6770;
        D.6772 = (int) D.6771;
        D.6773 = __s2 + 3;
        D.6774 = *D.6773;
        D.6775 = (int) D.6774;
        __result = D.6772 - D.6775;
        <D.6769>:
        <D.6767>:
        <D.6759>:
        <D.6757>:
        <D.6749>:
        <D.6747>:
      }
      D.6673 = __result;
    }
    iftmp.0 = -D.6673;
    goto <D.6776>;
    <D.6740>:
    D.6777 = &entry->d_name;
    iftmp.0 = __builtin_strcmp (D.6777, ".");
    <D.6776>:
    D.6674 = iftmp.0;
  }
  if (D.6674 == 0) goto <D.6684>; else goto <D.6778>;
  <D.6778>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.6782 = "..";
      D.6783 = MEM[(const unsigned char *)D.6782];
      D.6784 = (int) D.6783;
      D.6785 = *__s2;
      D.6786 = (int) D.6785;
      __result = D.6784 - D.6786;
      {
        if (__s2_len != 0) goto <D.6787>; else goto <D.6788>;
        <D.6787>:
        if (__result == 0) goto <D.6789>; else goto <D.6790>;
        <D.6789>:
        D.6791 = &MEM[(void *)".." + 1B];
        D.6792 = *D.6791;
        D.6793 = (int) D.6792;
        D.6794 = __s2 + 1;
        D.6795 = *D.6794;
        D.6796 = (int) D.6795;
        __result = D.6793 - D.6796;
        if (__s2_len > 1) goto <D.6797>; else goto <D.6798>;
        <D.6797>:
        if (__result == 0) goto <D.6799>; else goto <D.6800>;
        <D.6799>:
        D.6801 = &MEM[(void *)".." + 2B];
        D.6802 = *D.6801;
        D.6803 = (int) D.6802;
        D.6804 = __s2 + 2;
        D.6805 = *D.6804;
        D.6806 = (int) D.6805;
        __result = D.6803 - D.6806;
        if (__s2_len > 2) goto <D.6807>; else goto <D.6808>;
        <D.6807>:
        if (__result == 0) goto <D.6809>; else goto <D.6810>;
        <D.6809>:
        D.6811 = &MEM[(void *)".." + 3B];
        D.6812 = *D.6811;
        D.6813 = (int) D.6812;
        D.6814 = __s2 + 3;
        D.6815 = *D.6814;
        D.6816 = (int) D.6815;
        __result = D.6813 - D.6816;
        <D.6810>:
        <D.6808>:
        <D.6800>:
        <D.6798>:
        <D.6790>:
        <D.6788>:
      }
      D.6682 = __result;
    }
    iftmp.1 = -D.6682;
    goto <D.6817>;
    <D.6781>:
    D.6777 = &entry->d_name;
    iftmp.1 = __builtin_strcmp (D.6777, "..");
    <D.6817>:
    D.6683 = iftmp.1;
  }
  if (D.6683 == 0) goto <D.6684>; else goto <D.6685>;
  <D.6685>:
  D.6735 = &entry->d_name;
  return D.6735;
}


monoeg_g_dir_rewind (struct GDir * dir)
{
  struct DIR * D.6822;
  char * D.6823;
  struct DIR * D.6824;

  if (dir == 0B) goto <D.6819>; else goto <D.6821>;
  <D.6821>:
  D.6822 = dir->dir;
  if (D.6822 == 0B) goto <D.6819>; else goto <D.6820>;
  <D.6819>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 87, "dir != NULL && dir->dir != NULL");
  return;
  <D.6820>:
  D.6822 = dir->dir;
  closedir (D.6822);
  D.6823 = dir->path;
  D.6824 = opendir (D.6823);
  dir->dir = D.6824;
}


monoeg_g_dir_close (struct GDir * dir)
{
  struct DIR * D.6829;
  char * D.6830;

  if (dir == 0B) goto <D.6826>; else goto <D.6828>;
  <D.6828>:
  D.6829 = dir->dir;
  if (D.6829 == 0B) goto <D.6826>; else goto <D.6827>;
  <D.6826>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 99, "dir != NULL && dir->dir != 0");
  return;
  <D.6827>:
  D.6829 = dir->dir;
  closedir (D.6829);
  D.6830 = dir->path;
  monoeg_g_free (D.6830);
  dir->dir = 0B;
  monoeg_g_free (dir);
}


monoeg_g_mkdir_with_parents (const gchar * pathname, int mode)
{
  char D.6835;
  int * D.6836;
  int D.6837;
  char D.6838;
  unsigned int mode.2;
  int D.6848;
  char * d.3;
  char * path;
  char * d;
  int rv;

  if (pathname == 0B) goto <D.6832>; else goto <D.6834>;
  <D.6834>:
  D.6835 = *pathname;
  if (D.6835 == 0) goto <D.6832>; else goto <D.6833>;
  <D.6832>:
  D.6836 = __errno_location ();
  *D.6836 = 22;
  D.6837 = -1;
  return D.6837;
  <D.6833>:
  path = monoeg_strdup (pathname);
  d = path;
  D.6838 = *d;
  if (D.6838 == 47) goto <D.6839>; else goto <D.6840>;
  <D.6839>:
  d = d + 1;
  <D.6840>:
  <D.6704>:
  D.6838 = *d;
  if (D.6838 == 47) goto <D.6841>; else goto <D.6844>;
  <D.6844>:
  D.6838 = *d;
  if (D.6838 == 0) goto <D.6841>; else goto <D.6842>;
  <D.6841>:
  {
    char orig;

    orig = *d;
    *d = 0;
    mode.2 = (unsigned int) mode;
    rv = mkdir (path, mode.2);
    if (rv == -1) goto <D.6846>; else goto <D.6847>;
    <D.6846>:
    D.6836 = __errno_location ();
    D.6848 = *D.6836;
    if (D.6848 != 17) goto <D.6849>; else goto <D.6850>;
    <D.6849>:
    monoeg_g_free (path);
    D.6837 = -1;
    return D.6837;
    <D.6850>:
    <D.6847>:
    d.3 = d;
    d = d.3 + 1;
    *d.3 = orig;
    goto <D.6701>;
    <D.6700>:
    d = d + 1;
    <D.6701>:
    if (orig == 47) goto <D.6852>; else goto <D.6702>;
    <D.6852>:
    D.6838 = *d;
    if (D.6838 == 47) goto <D.6700>; else goto <D.6702>;
    <D.6702>:
    if (orig == 0) goto <D.6703>; else goto <D.6853>;
    <D.6853>:
  }
  goto <D.6843>;
  <D.6842>:
  d = d + 1;
  <D.6843>:
  goto <D.6704>;
  <D.6703>:
  monoeg_g_free (path);
  D.6837 = 0;
  return D.6837;
}


