monoeg_g_dir_open (const gchar * path, guint flags, struct GError * * error)
{
  struct GDir * D.8455;
  struct GError * D.8458;
  struct DIR * D.8461;
  struct DIR * D.8462;
  int * D.8467;
  <unnamed type> D.8468;
  int D.8469;
  char * D.8470;
  struct GError * D.8471;
  gchar * D.8472;
  struct GDir * dir;

  if (path == 0B) goto <D.8453>; else goto <D.8454>;
  <D.8453>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 49, "path != NULL");
  D.8455 = 0B;
  return D.8455;
  <D.8454>:
  if (error != 0B) goto <D.8456>; else goto <D.8457>;
  <D.8456>:
  D.8458 = *error;
  if (D.8458 != 0B) goto <D.8459>; else goto <D.8460>;
  <D.8459>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 50, "error == NULL || *error == NULL");
  D.8455 = 0B;
  return D.8455;
  <D.8460>:
  <D.8457>:
  dir = monoeg_malloc (8);
  D.8461 = opendir (path);
  dir->dir = D.8461;
  D.8462 = dir->dir;
  if (D.8462 == 0B) goto <D.8463>; else goto <D.8464>;
  <D.8463>:
  if (error != 0B) goto <D.8465>; else goto <D.8466>;
  <D.8465>:
  {
    gint err;

    D.8467 = __errno_location ();
    err = *D.8467;
    D.8468 = monoeg_g_file_error_from_errno (err);
    D.8469 = (int) D.8468;
    D.8470 = strerror (err);
    D.8471 = monoeg_g_error_new (0B, D.8469, D.8470);
    *error = D.8471;
  }
  <D.8466>:
  monoeg_g_free (dir);
  D.8455 = 0B;
  return D.8455;
  <D.8464>:
  D.8472 = monoeg_strdup (path);
  dir->path = D.8472;
  D.8455 = dir;
  return D.8455;
}


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

  if (str != 0B) goto <D.8474>; else goto <D.8475>;
  <D.8474>:
  D.8476 = __strdup (str);
  return D.8476;
  <D.8475>:
  D.8476 = 0B;
  return D.8476;
}


monoeg_g_dir_read_name (struct GDir * dir)
{
  struct DIR * D.8481;
  const gchar * D.8482;
  int D.8419;
  int iftmp.0;
  int D.8418;
  char[2] * D.8488;
  unsigned char D.8489;
  int D.8490;
  unsigned char D.8491;
  int D.8492;
  _Bool D.8493;
  _Bool D.8494;
  _Bool D.8495;
  const unsigned char * D.8498;
  unsigned char D.8499;
  int D.8500;
  const unsigned char * D.8501;
  unsigned char D.8502;
  int D.8503;
  _Bool D.8504;
  _Bool D.8505;
  const unsigned char * D.8508;
  unsigned char D.8509;
  int D.8510;
  const unsigned char * D.8511;
  unsigned char D.8512;
  int D.8513;
  _Bool D.8514;
  _Bool D.8515;
  const unsigned char * D.8518;
  unsigned char D.8519;
  int D.8520;
  const unsigned char * D.8521;
  unsigned char D.8522;
  int D.8523;
  char[256] * D.8525;
  int D.8428;
  int iftmp.1;
  int D.8427;
  char[3] * D.8530;
  unsigned char D.8531;
  int D.8532;
  unsigned char D.8533;
  int D.8534;
  _Bool D.8535;
  _Bool D.8536;
  _Bool D.8537;
  const unsigned char * D.8540;
  unsigned char D.8541;
  int D.8542;
  const unsigned char * D.8543;
  unsigned char D.8544;
  int D.8545;
  _Bool D.8546;
  _Bool D.8547;
  const unsigned char * D.8550;
  unsigned char D.8551;
  int D.8552;
  const unsigned char * D.8553;
  unsigned char D.8554;
  int D.8555;
  _Bool D.8556;
  _Bool D.8557;
  const unsigned char * D.8560;
  unsigned char D.8561;
  int D.8562;
  const unsigned char * D.8563;
  unsigned char D.8564;
  int D.8565;
  struct dirent * entry;

  if (dir == 0B) goto <D.8478>; else goto <D.8480>;
  <D.8480>:
  D.8481 = dir->dir;
  if (D.8481 == 0B) goto <D.8478>; else goto <D.8479>;
  <D.8478>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 74, "dir != NULL && dir->dir != NULL");
  D.8482 = 0B;
  return D.8482;
  <D.8479>:
  <D.8429>:
  D.8481 = dir->dir;
  entry = readdir (D.8481);
  if (entry == 0B) goto <D.8483>; else goto <D.8484>;
  <D.8483>:
  D.8482 = 0B;
  return D.8482;
  <D.8484>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.8488 = ".";
      D.8489 = MEM[(const unsigned char *)D.8488];
      D.8490 = (int) D.8489;
      D.8491 = *__s2;
      D.8492 = (int) D.8491;
      __result = D.8490 - D.8492;
      {
        D.8493 = __s2_len != 0;
        D.8494 = __result == 0;
        D.8495 = D.8493 & D.8494;
        if (D.8495 != 0) goto <D.8496>; else goto <D.8497>;
        <D.8496>:
        D.8498 = &MEM[(void *)"." + 1B];
        D.8499 = *D.8498;
        D.8500 = (int) D.8499;
        D.8501 = __s2 + 1;
        D.8502 = *D.8501;
        D.8503 = (int) D.8502;
        __result = D.8500 - D.8503;
        D.8504 = __s2_len > 1;
        D.8494 = __result == 0;
        D.8505 = D.8504 & D.8494;
        if (D.8505 != 0) goto <D.8506>; else goto <D.8507>;
        <D.8506>:
        D.8508 = &MEM[(void *)"." + 2B];
        D.8509 = *D.8508;
        D.8510 = (int) D.8509;
        D.8511 = __s2 + 2;
        D.8512 = *D.8511;
        D.8513 = (int) D.8512;
        __result = D.8510 - D.8513;
        D.8514 = __s2_len > 2;
        D.8494 = __result == 0;
        D.8515 = D.8514 & D.8494;
        if (D.8515 != 0) goto <D.8516>; else goto <D.8517>;
        <D.8516>:
        D.8518 = &MEM[(void *)"." + 3B];
        D.8519 = *D.8518;
        D.8520 = (int) D.8519;
        D.8521 = __s2 + 3;
        D.8522 = *D.8521;
        D.8523 = (int) D.8522;
        __result = D.8520 - D.8523;
        <D.8517>:
        <D.8507>:
        <D.8497>:
      }
      D.8418 = __result;
    }
    iftmp.0 = -D.8418;
    goto <D.8524>;
    <D.8487>:
    D.8525 = &entry->d_name;
    iftmp.0 = __builtin_strcmp (D.8525, ".");
    <D.8524>:
    D.8419 = iftmp.0;
  }
  if (D.8419 == 0) goto <D.8429>; else goto <D.8526>;
  <D.8526>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = &entry->d_name;
      D.8530 = "..";
      D.8531 = MEM[(const unsigned char *)D.8530];
      D.8532 = (int) D.8531;
      D.8533 = *__s2;
      D.8534 = (int) D.8533;
      __result = D.8532 - D.8534;
      {
        D.8535 = __s2_len != 0;
        D.8536 = __result == 0;
        D.8537 = D.8535 & D.8536;
        if (D.8537 != 0) goto <D.8538>; else goto <D.8539>;
        <D.8538>:
        D.8540 = &MEM[(void *)".." + 1B];
        D.8541 = *D.8540;
        D.8542 = (int) D.8541;
        D.8543 = __s2 + 1;
        D.8544 = *D.8543;
        D.8545 = (int) D.8544;
        __result = D.8542 - D.8545;
        D.8546 = __s2_len > 1;
        D.8536 = __result == 0;
        D.8547 = D.8546 & D.8536;
        if (D.8547 != 0) goto <D.8548>; else goto <D.8549>;
        <D.8548>:
        D.8550 = &MEM[(void *)".." + 2B];
        D.8551 = *D.8550;
        D.8552 = (int) D.8551;
        D.8553 = __s2 + 2;
        D.8554 = *D.8553;
        D.8555 = (int) D.8554;
        __result = D.8552 - D.8555;
        D.8556 = __s2_len > 2;
        D.8536 = __result == 0;
        D.8557 = D.8556 & D.8536;
        if (D.8557 != 0) goto <D.8558>; else goto <D.8559>;
        <D.8558>:
        D.8560 = &MEM[(void *)".." + 3B];
        D.8561 = *D.8560;
        D.8562 = (int) D.8561;
        D.8563 = __s2 + 3;
        D.8564 = *D.8563;
        D.8565 = (int) D.8564;
        __result = D.8562 - D.8565;
        <D.8559>:
        <D.8549>:
        <D.8539>:
      }
      D.8427 = __result;
    }
    iftmp.1 = -D.8427;
    goto <D.8566>;
    <D.8529>:
    D.8525 = &entry->d_name;
    iftmp.1 = __builtin_strcmp (D.8525, "..");
    <D.8566>:
    D.8428 = iftmp.1;
  }
  if (D.8428 == 0) goto <D.8429>; else goto <D.8430>;
  <D.8430>:
  D.8482 = &entry->d_name;
  return D.8482;
}


monoeg_g_dir_rewind (struct GDir * dir)
{
  struct DIR * D.8571;
  char * D.8572;
  struct DIR * D.8573;

  if (dir == 0B) goto <D.8568>; else goto <D.8570>;
  <D.8570>:
  D.8571 = dir->dir;
  if (D.8571 == 0B) goto <D.8568>; else goto <D.8569>;
  <D.8568>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 87, "dir != NULL && dir->dir != NULL");
  return;
  <D.8569>:
  D.8571 = dir->dir;
  closedir (D.8571);
  D.8572 = dir->path;
  D.8573 = opendir (D.8572);
  dir->dir = D.8573;
}


monoeg_g_dir_close (struct GDir * dir)
{
  struct DIR * D.8578;
  char * D.8579;

  if (dir == 0B) goto <D.8575>; else goto <D.8577>;
  <D.8577>:
  D.8578 = dir->dir;
  if (D.8578 == 0B) goto <D.8575>; else goto <D.8576>;
  <D.8575>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gdir-unix.c", 99, "dir != NULL && dir->dir != 0");
  return;
  <D.8576>:
  D.8578 = dir->dir;
  closedir (D.8578);
  D.8579 = dir->path;
  monoeg_g_free (D.8579);
  dir->dir = 0B;
  monoeg_g_free (dir);
}


monoeg_g_mkdir_with_parents (const gchar * pathname, int mode)
{
  char D.8584;
  int * D.8585;
  int D.8586;
  char D.8587;
  char D.8590;
  _Bool D.8591;
  _Bool D.8592;
  _Bool D.8593;
  unsigned int mode.2;
  int D.8599;
  char * d.3;
  char * path;
  char * d;
  int rv;

  if (pathname == 0B) goto <D.8581>; else goto <D.8583>;
  <D.8583>:
  D.8584 = *pathname;
  if (D.8584 == 0) goto <D.8581>; else goto <D.8582>;
  <D.8581>:
  D.8585 = __errno_location ();
  *D.8585 = 22;
  D.8586 = -1;
  return D.8586;
  <D.8582>:
  path = monoeg_strdup (pathname);
  d = path;
  D.8587 = *d;
  if (D.8587 == 47) goto <D.8588>; else goto <D.8589>;
  <D.8588>:
  d = d + 1;
  <D.8589>:
  <D.8449>:
  D.8590 = *d;
  D.8591 = D.8590 == 47;
  D.8592 = D.8590 == 0;
  D.8593 = D.8591 | D.8592;
  if (D.8593 != 0) goto <D.8594>; else goto <D.8595>;
  <D.8594>:
  {
    char orig;

    orig = *d;
    *d = 0;
    mode.2 = (unsigned int) mode;
    rv = mkdir (path, mode.2);
    if (rv == -1) goto <D.8597>; else goto <D.8598>;
    <D.8597>:
    D.8585 = __errno_location ();
    D.8599 = *D.8585;
    if (D.8599 != 17) goto <D.8600>; else goto <D.8601>;
    <D.8600>:
    monoeg_g_free (path);
    D.8586 = -1;
    return D.8586;
    <D.8601>:
    <D.8598>:
    d.3 = d;
    d = d.3 + 1;
    *d.3 = orig;
    goto <D.8446>;
    <D.8445>:
    d = d + 1;
    <D.8446>:
    if (orig == 47) goto <D.8603>; else goto <D.8447>;
    <D.8603>:
    D.8587 = *d;
    if (D.8587 == 47) goto <D.8445>; else goto <D.8447>;
    <D.8447>:
    if (orig == 0) goto <D.8448>; else goto <D.8604>;
    <D.8604>:
  }
  goto <D.8605>;
  <D.8595>:
  d = d + 1;
  <D.8605>:
  goto <D.8449>;
  <D.8448>:
  monoeg_g_free (path);
  D.8586 = 0;
  return D.8586;
}


