monoeg_g_dir_open (const gchar * path, guint flags, struct GError * * error)
{
  struct GDir * D.6296;
  struct GError * D.6299;
  struct DIR * D.6302;
  struct DIR * D.6303;
  int * D.6308;
  <unnamed type> D.6309;
  int D.6310;
  char * D.6311;
  struct GError * D.6312;
  gchar * D.6313;
  struct GDir * dir;

  if (path == 0B) goto <D.6294>; else goto <D.6295>;
  <D.6294>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 49, "path != NULL");
  D.6296 = 0B;
  return D.6296;
  <D.6295>:
  if (error != 0B) goto <D.6297>; else goto <D.6298>;
  <D.6297>:
  D.6299 = *error;
  if (D.6299 != 0B) goto <D.6300>; else goto <D.6301>;
  <D.6300>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 50, "error == NULL || *error == NULL");
  D.6296 = 0B;
  return D.6296;
  <D.6301>:
  <D.6298>:
  dir = monoeg_malloc (16);
  D.6302 = opendir (path);
  dir->dir = D.6302;
  D.6303 = dir->dir;
  if (D.6303 == 0B) goto <D.6304>; else goto <D.6305>;
  <D.6304>:
  if (error != 0B) goto <D.6306>; else goto <D.6307>;
  <D.6306>:
  {
    gint err;

    D.6308 = __errno_location ();
    err = *D.6308;
    D.6309 = monoeg_g_file_error_from_errno (err);
    D.6310 = (int) D.6309;
    D.6311 = strerror (err);
    D.6312 = monoeg_g_error_new (0B, D.6310, D.6311);
    *error = D.6312;
  }
  <D.6307>:
  monoeg_g_free (dir);
  D.6296 = 0B;
  return D.6296;
  <D.6305>:
  D.6313 = monoeg_strdup (path);
  dir->path = D.6313;
  D.6296 = dir;
  return D.6296;
}


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

  if (str != 0B) goto <D.6315>; else goto <D.6316>;
  <D.6315>:
  D.6317 = __strdup (str);
  return D.6317;
  <D.6316>:
  D.6317 = 0B;
  return D.6317;
}


monoeg_g_dir_read_name (struct GDir * dir)
{
  struct DIR * D.6322;
  const gchar * D.6323;
  int D.6262;
  int iftmp.0;
  int D.6261;
  char[2] * D.6329;
  unsigned char D.6330;
  int D.6331;
  unsigned char D.6332;
  int D.6333;
  const unsigned char * D.6338;
  unsigned char D.6339;
  int D.6340;
  const unsigned char * D.6341;
  unsigned char D.6342;
  int D.6343;
  const unsigned char * D.6348;
  unsigned char D.6349;
  int D.6350;
  const unsigned char * D.6351;
  unsigned char D.6352;
  int D.6353;
  const unsigned char * D.6358;
  unsigned char D.6359;
  int D.6360;
  const unsigned char * D.6361;
  unsigned char D.6362;
  int D.6363;
  char[256] * D.6365;
  int D.6271;
  int iftmp.1;
  int D.6270;
  char[3] * D.6370;
  unsigned char D.6371;
  int D.6372;
  unsigned char D.6373;
  int D.6374;
  const unsigned char * D.6379;
  unsigned char D.6380;
  int D.6381;
  const unsigned char * D.6382;
  unsigned char D.6383;
  int D.6384;
  const unsigned char * D.6389;
  unsigned char D.6390;
  int D.6391;
  const unsigned char * D.6392;
  unsigned char D.6393;
  int D.6394;
  const unsigned char * D.6399;
  unsigned char D.6400;
  int D.6401;
  const unsigned char * D.6402;
  unsigned char D.6403;
  int D.6404;
  struct dirent * entry;

  if (dir == 0B) goto <D.6319>; else goto <D.6321>;
  <D.6321>:
  D.6322 = dir->dir;
  if (D.6322 == 0B) goto <D.6319>; else goto <D.6320>;
  <D.6319>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 74, "dir != NULL && dir->dir != NULL");
  D.6323 = 0B;
  return D.6323;
  <D.6320>:
  <D.6272>:
  D.6322 = dir->dir;
  entry = readdir (D.6322);
  if (entry == 0B) goto <D.6324>; else goto <D.6325>;
  <D.6324>:
  D.6323 = 0B;
  return D.6323;
  <D.6325>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.6329 = ".";
      D.6330 = MEM[(const unsigned char *)D.6329];
      D.6331 = (int) D.6330;
      D.6332 = *__s2;
      D.6333 = (int) D.6332;
      __result = D.6331 - D.6333;
      {
        if (__s2_len != 0) goto <D.6334>; else goto <D.6335>;
        <D.6334>:
        if (__result == 0) goto <D.6336>; else goto <D.6337>;
        <D.6336>:
        D.6338 = "." + 1;
        D.6339 = *D.6338;
        D.6340 = (int) D.6339;
        D.6341 = __s2 + 1;
        D.6342 = *D.6341;
        D.6343 = (int) D.6342;
        __result = D.6340 - D.6343;
        if (__s2_len > 1) goto <D.6344>; else goto <D.6345>;
        <D.6344>:
        if (__result == 0) goto <D.6346>; else goto <D.6347>;
        <D.6346>:
        D.6348 = "." + 2;
        D.6349 = *D.6348;
        D.6350 = (int) D.6349;
        D.6351 = __s2 + 2;
        D.6352 = *D.6351;
        D.6353 = (int) D.6352;
        __result = D.6350 - D.6353;
        if (__s2_len > 2) goto <D.6354>; else goto <D.6355>;
        <D.6354>:
        if (__result == 0) goto <D.6356>; else goto <D.6357>;
        <D.6356>:
        D.6358 = "." + 3;
        D.6359 = *D.6358;
        D.6360 = (int) D.6359;
        D.6361 = __s2 + 3;
        D.6362 = *D.6361;
        D.6363 = (int) D.6362;
        __result = D.6360 - D.6363;
        <D.6357>:
        <D.6355>:
        <D.6347>:
        <D.6345>:
        <D.6337>:
        <D.6335>:
      }
      D.6261 = __result;
    }
    iftmp.0 = -D.6261;
    goto <D.6364>;
    <D.6328>:
    D.6365 = &entry->d_name;
    iftmp.0 = __builtin_strcmp (D.6365, ".");
    <D.6364>:
    D.6262 = iftmp.0;
  }
  if (D.6262 == 0) goto <D.6272>; else goto <D.6366>;
  <D.6366>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.6370 = "..";
      D.6371 = MEM[(const unsigned char *)D.6370];
      D.6372 = (int) D.6371;
      D.6373 = *__s2;
      D.6374 = (int) D.6373;
      __result = D.6372 - D.6374;
      {
        if (__s2_len != 0) goto <D.6375>; else goto <D.6376>;
        <D.6375>:
        if (__result == 0) goto <D.6377>; else goto <D.6378>;
        <D.6377>:
        D.6379 = ".." + 1;
        D.6380 = *D.6379;
        D.6381 = (int) D.6380;
        D.6382 = __s2 + 1;
        D.6383 = *D.6382;
        D.6384 = (int) D.6383;
        __result = D.6381 - D.6384;
        if (__s2_len > 1) goto <D.6385>; else goto <D.6386>;
        <D.6385>:
        if (__result == 0) goto <D.6387>; else goto <D.6388>;
        <D.6387>:
        D.6389 = ".." + 2;
        D.6390 = *D.6389;
        D.6391 = (int) D.6390;
        D.6392 = __s2 + 2;
        D.6393 = *D.6392;
        D.6394 = (int) D.6393;
        __result = D.6391 - D.6394;
        if (__s2_len > 2) goto <D.6395>; else goto <D.6396>;
        <D.6395>:
        if (__result == 0) goto <D.6397>; else goto <D.6398>;
        <D.6397>:
        D.6399 = ".." + 3;
        D.6400 = *D.6399;
        D.6401 = (int) D.6400;
        D.6402 = __s2 + 3;
        D.6403 = *D.6402;
        D.6404 = (int) D.6403;
        __result = D.6401 - D.6404;
        <D.6398>:
        <D.6396>:
        <D.6388>:
        <D.6386>:
        <D.6378>:
        <D.6376>:
      }
      D.6270 = __result;
    }
    iftmp.1 = -D.6270;
    goto <D.6405>;
    <D.6369>:
    D.6365 = &entry->d_name;
    iftmp.1 = __builtin_strcmp (D.6365, "..");
    <D.6405>:
    D.6271 = iftmp.1;
  }
  if (D.6271 == 0) goto <D.6272>; else goto <D.6273>;
  <D.6273>:
  D.6323 = &entry->d_name;
  return D.6323;
}


monoeg_g_dir_rewind (struct GDir * dir)
{
  struct DIR * D.6410;
  char * D.6411;
  struct DIR * D.6412;

  if (dir == 0B) goto <D.6407>; else goto <D.6409>;
  <D.6409>:
  D.6410 = dir->dir;
  if (D.6410 == 0B) goto <D.6407>; else goto <D.6408>;
  <D.6407>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 87, "dir != NULL && dir->dir != NULL");
  return;
  <D.6408>:
  D.6410 = dir->dir;
  closedir (D.6410);
  D.6411 = dir->path;
  D.6412 = opendir (D.6411);
  dir->dir = D.6412;
}


monoeg_g_dir_close (struct GDir * dir)
{
  struct DIR * D.6417;
  char * D.6418;

  if (dir == 0B) goto <D.6414>; else goto <D.6416>;
  <D.6416>:
  D.6417 = dir->dir;
  if (D.6417 == 0B) goto <D.6414>; else goto <D.6415>;
  <D.6414>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 99, "dir != NULL && dir->dir != 0");
  return;
  <D.6415>:
  D.6417 = dir->dir;
  closedir (D.6417);
  D.6418 = dir->path;
  monoeg_g_free (D.6418);
  dir->dir = 0B;
  monoeg_g_free (dir);
}


monoeg_g_mkdir_with_parents (const gchar * pathname, int mode)
{
  char D.6423;
  int * D.6424;
  int D.6425;
  char D.6426;
  unsigned int mode.2;
  int D.6436;
  char * d.3;
  char * path;
  char * d;
  int rv;

  if (pathname == 0B) goto <D.6420>; else goto <D.6422>;
  <D.6422>:
  D.6423 = *pathname;
  if (D.6423 == 0) goto <D.6420>; else goto <D.6421>;
  <D.6420>:
  D.6424 = __errno_location ();
  *D.6424 = 22;
  D.6425 = -1;
  return D.6425;
  <D.6421>:
  path = monoeg_strdup (pathname);
  d = path;
  D.6426 = *d;
  if (D.6426 == 47) goto <D.6427>; else goto <D.6428>;
  <D.6427>:
  d = d + 1;
  <D.6428>:
  <D.6292>:
  D.6426 = *d;
  if (D.6426 == 47) goto <D.6429>; else goto <D.6432>;
  <D.6432>:
  D.6426 = *d;
  if (D.6426 == 0) goto <D.6429>; else goto <D.6430>;
  <D.6429>:
  {
    char orig;

    orig = *d;
    *d = 0;
    mode.2 = (unsigned int) mode;
    rv = mkdir (path, mode.2);
    if (rv == -1) goto <D.6434>; else goto <D.6435>;
    <D.6434>:
    D.6424 = __errno_location ();
    D.6436 = *D.6424;
    if (D.6436 != 17) goto <D.6437>; else goto <D.6438>;
    <D.6437>:
    monoeg_g_free (path);
    D.6425 = -1;
    return D.6425;
    <D.6438>:
    <D.6435>:
    d.3 = d;
    d = d.3 + 1;
    *d.3 = orig;
    goto <D.6289>;
    <D.6288>:
    d = d + 1;
    <D.6289>:
    if (orig == 47) goto <D.6440>; else goto <D.6290>;
    <D.6440>:
    D.6426 = *d;
    if (D.6426 == 47) goto <D.6288>; else goto <D.6290>;
    <D.6290>:
    if (orig == 0) goto <D.6291>; else goto <D.6441>;
    <D.6441>:
  }
  goto <D.6431>;
  <D.6430>:
  d = d + 1;
  <D.6431>:
  goto <D.6292>;
  <D.6291>:
  monoeg_g_free (path);
  D.6425 = 0;
  return D.6425;
}


