#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_16__ TYPE_2__;
typedef struct TYPE_15__ TYPE_1__;

/* Type definitions */
struct TYPE_16__ {
  int fts_options;
  scalar_t__ fts_dev;
  char *fts_path;
  TYPE_1__ *fts_cur;
  void *fts_rfd;
  TYPE_1__ *fts_child;
};
struct TYPE_15__ {
  int fts_instr;
  scalar_t__ fts_info;
  int fts_errno;
  int fts_flags;
  scalar_t__ fts_dev;
  char *fts_accpath;
  scalar_t__ fts_level;
  char *fts_path;
  int fts_pathlen;
  struct TYPE_15__ *fts_parent;
  void *fts_symfd;
  scalar_t__ fts_namelen;
  int /*<<< orphan*/ fts_name;
  struct TYPE_15__ *fts_link;
};
typedef TYPE_1__ FTSENT;
typedef TYPE_2__ FTS;

/* Variables and functions */
int FTS_AGAIN;
scalar_t__ FTS_D;
int FTS_DONTCHDIR;
void *FTS_DP;
void *FTS_ERR;
int FTS_FOLLOW;
int FTS_NAMEONLY;
int FTS_NOCHDIR;
void *FTS_NOINSTR;
scalar_t__ FTS_ROOTLEVEL;
scalar_t__ FTS_ROOTPARENTLEVEL;
int FTS_SKIP;
scalar_t__ FTS_SL;
scalar_t__ FTS_SLNONE;
int FTS_STOP;
int FTS_SYMFOLLOW;
int FTS_XDEV;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(void *);
int errno;
scalar_t__ fchdir(void *);
int /*<<< orphan*/ free(TYPE_1__ *);
TYPE_1__ *fts_build(TYPE_2__ *, int);
int /*<<< orphan*/ fts_lfree(TYPE_1__ *);
int /*<<< orphan*/ fts_load(TYPE_2__ *, TYPE_1__ *);
scalar_t__ fts_safe_changedir(TYPE_2__ *, TYPE_1__ *, int, char *);
void *fts_stat(TYPE_2__ *, TYPE_1__ *, int);
int /*<<< orphan*/ memmove(char *, int /*<<< orphan*/, scalar_t__);
void *open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
FTSENT *fts_read(FTS *sp) {
  FTSENT *p, *tmp;
  int instr;
  char *t;
  int saved_errno;
  if (sp->fts_cur == NULL || (sp->fts_options & (FTS_STOP)))
    return (NULL);
  p = sp->fts_cur;
  instr = p->fts_instr;
  p->fts_instr = FTS_NOINSTR;
  if (instr == FTS_AGAIN) {
    p->fts_info = fts_stat(sp, p, 0);
    return (p);
  }
  if (instr == FTS_FOLLOW &&
      (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
    p->fts_info = fts_stat(sp, p, 1);
    if (p->fts_info == FTS_D && !(sp->fts_options & (FTS_NOCHDIR))) {
      if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
        p->fts_errno = errno;
        p->fts_info = FTS_ERR;
      } else
        p->fts_flags |= FTS_SYMFOLLOW;
    }
    return (p);
  }
  if (p->fts_info == FTS_D) {
    if (instr == FTS_SKIP ||
        ((sp->fts_options & (FTS_XDEV)) && p->fts_dev != sp->fts_dev)) {
      if (p->fts_flags & FTS_SYMFOLLOW)
        (void)close(p->fts_symfd);
      if (sp->fts_child) {
        fts_lfree(sp->fts_child);
        sp->fts_child = NULL;
      }
      p->fts_info = FTS_DP;
      return (p);
    }
    if (sp->fts_child && (sp->fts_options & (FTS_NAMEONLY))) {
      (sp->fts_options &= ~(FTS_NAMEONLY));
      fts_lfree(sp->fts_child);
      sp->fts_child = NULL;
    }
    if (sp->fts_child) {
      if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
        p->fts_errno = errno;
        p->fts_flags |= FTS_DONTCHDIR;
        for (p = sp->fts_child; p; p = p->fts_link)
          p->fts_accpath = p->fts_parent->fts_accpath;
      }
    } else if ((sp->fts_child = fts_build(sp, 3)) == NULL) {
      if ((sp->fts_options & (FTS_STOP)))
        return (NULL);
      return (p);
    }
    p = sp->fts_child;
    sp->fts_child = NULL;
    goto name;
  }
next:
  tmp = p;
  if ((p = p->fts_link)) {
    free(tmp);
    if (p->fts_level == FTS_ROOTLEVEL) {
      if ((!(sp->fts_options & (FTS_NOCHDIR)) && fchdir(sp->fts_rfd))) {
        (sp->fts_options |= (FTS_STOP));
        return (NULL);
      }
      fts_load(sp, p);
      return (sp->fts_cur = p);
    }
    if (p->fts_instr == FTS_SKIP)
      goto next;
    if (p->fts_instr == FTS_FOLLOW) {
      p->fts_info = fts_stat(sp, p, 1);
      if (p->fts_info == FTS_D && !(sp->fts_options & (FTS_NOCHDIR))) {
        if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
          p->fts_errno = errno;
          p->fts_info = FTS_ERR;
        } else
          p->fts_flags |= FTS_SYMFOLLOW;
      }
      p->fts_instr = FTS_NOINSTR;
    }
  name:
    t = sp->fts_path +
        (p->fts_parent->fts_path[p->fts_parent->fts_pathlen - 1] == '/'
             ? p->fts_parent->fts_pathlen - 1
             : p->fts_parent->fts_pathlen);
    *t++ = '/';
    memmove(t, p->fts_name, p->fts_namelen + 1);
    return (sp->fts_cur = p);
  }
  p = tmp->fts_parent;
  free(tmp);
  if (p->fts_level == FTS_ROOTPARENTLEVEL) {
    free(p);
    errno = 0;
    return (sp->fts_cur = NULL);
  }
  sp->fts_path[p->fts_pathlen] = '\0';
  if (p->fts_level == FTS_ROOTLEVEL) {
    if ((!(sp->fts_options & (FTS_NOCHDIR)) && fchdir(sp->fts_rfd))) {
      (sp->fts_options |= (FTS_STOP));
      sp->fts_cur = p;
      return (NULL);
    }
  } else if (p->fts_flags & FTS_SYMFOLLOW) {
    if ((!(sp->fts_options & (FTS_NOCHDIR)) && fchdir(p->fts_symfd))) {
      saved_errno = errno;
      (void)close(p->fts_symfd);
      errno = saved_errno;
      (sp->fts_options |= (FTS_STOP));
      sp->fts_cur = p;
      return (NULL);
    }
    (void)close(p->fts_symfd);
  } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
             fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
    (sp->fts_options |= (FTS_STOP));
    sp->fts_cur = p;
    return (NULL);
  }
  p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
  return (sp->fts_cur = p);
}


x86 assembly (clang, -O0):
<fts_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     11d3 <fts_read+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2d88(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11e0 <fts_read+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d7c(%rip),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
mov    0x2dbf(%rip),%rcx
cmp    (%rcx),%eax
jne    1240 <fts_read+0xa0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1050 <fts_stat@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x24(%rbp),%eax
mov    0x2dae(%rip),%rcx
cmp    (%rcx),%eax
jne    1344 <fts_read+0x1a4>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d3f(%rip),%rcx
cmp    (%rcx),%rax
je     1282 <fts_read+0xe2>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d1f(%rip),%rcx
cmp    (%rcx),%rax
jne    1344 <fts_read+0x1a4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1050 <fts_stat@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ce2(%rip),%rcx
cmp    (%rcx),%rax
jne    1337 <fts_read+0x197>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2ca4(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1337 <fts_read+0x197>
mov    0x2cd2(%rip),%rax
mov    (%rax),%esi
lea    0xd22(%rip),%rdi
xor    %edx,%edx
call   10b0 <open@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,0x48(%rcx)
cmp    $0x0,%rax
jae    131f <fts_read+0x17f>
mov    0x2c81(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2c61(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
jmp    1332 <fts_read+0x192>
mov    0x2cc2(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
jmp    1337 <fts_read+0x197>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2c3d(%rip),%rcx
cmp    (%rcx),%rax
jne    156d <fts_read+0x3cd>
mov    -0x24(%rbp),%eax
mov    0x2c52(%rip),%rcx
cmp    (%rcx),%eax
je     139c <fts_read+0x1fc>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2bdd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1409 <fts_read+0x269>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
je     1409 <fts_read+0x269>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
mov    0x2c3e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13c2 <fts_read+0x222>
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rdi
call   1060 <close@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x28(%rax)
je     13ea <fts_read+0x24a>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1070 <fts_lfree@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,0x28(%rax)
mov    0x2bbf(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x28(%rax)
je     145d <fts_read+0x2bd>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2b3b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     145d <fts_read+0x2bd>
mov    0x2b29(%rip),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x10(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1070 <fts_lfree@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,0x28(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x28(%rax)
je     14f9 <fts_read+0x359>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rcx
mov    $0xffffffff,%edx
call   1090 <fts_safe_changedir@plt>
cmp    $0x0,%rax
je     14f4 <fts_read+0x354>
mov    0x2ae9(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2b39(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     14ef <fts_read+0x34f>
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rax
mov    0x20(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    0x60(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    14bf <fts_read+0x31f>
jmp    14f4 <fts_read+0x354>
jmp    1550 <fts_read+0x3b0>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   10c0 <fts_build@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,0x28(%rcx)
cmp    $0x0,%rax
jne    154b <fts_read+0x3ab>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2a2a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     153e <fts_read+0x39e>
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
jmp    1550 <fts_read+0x3b0>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,0x28(%rax)
jmp    171b <fts_read+0x57b>
jmp    1572 <fts_read+0x3d2>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x60(%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     17c9 <fts_read+0x629>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x2a18(%rip),%rcx
cmp    (%rcx),%rax
jne    1620 <fts_read+0x480>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x29aa(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    15fe <fts_read+0x45e>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1080 <fchdir@plt>
cmp    $0x0,%rax
je     15fe <fts_read+0x45e>
mov    0x2969(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fts_load@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rax,0x18(%rcx)
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x298b(%rip),%rcx
cmp    (%rcx),%eax
jne    163a <fts_read+0x49a>
jmp    1572 <fts_read+0x3d2>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x29b1(%rip),%rcx
cmp    (%rcx),%eax
jne    1716 <fts_read+0x576>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1050 <fts_stat@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2915(%rip),%rcx
cmp    (%rcx),%rax
jne    1704 <fts_read+0x564>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x28d7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1704 <fts_read+0x564>
mov    0x2905(%rip),%rax
mov    (%rax),%esi
lea    0x955(%rip),%rdi
xor    %edx,%edx
call   10b0 <open@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,0x48(%rcx)
cmp    $0x0,%rax
jae    16ec <fts_read+0x54c>
mov    0x28b4(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2894(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
jmp    16ff <fts_read+0x55f>
mov    0x28f5(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
jmp    1704 <fts_read+0x564>
mov    0x286d(%rip),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    171b <fts_read+0x57b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rax
mov    0x30(%rax),%rax
mov    -0x18(%rbp),%rcx
mov    0x40(%rcx),%rcx
mov    0x38(%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1767 <fts_read+0x5c7>
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rax
mov    0x38(%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1775 <fts_read+0x5d5>
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rax
mov    0x38(%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0x2f,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x58(%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x50(%rax),%rdx
add    $0x1,%rdx
call   10a0 <memmove@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rax,0x18(%rcx)
mov    %rax,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x20(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x2803(%rip),%rcx
cmp    (%rcx),%rax
jne    1825 <fts_read+0x685>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x277a(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x18(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x18(%rbp),%rcx
movslq 0x38(%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x2778(%rip),%rcx
cmp    (%rcx),%rax
jne    18af <fts_read+0x70f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x270a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    18aa <fts_read+0x70a>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1080 <fchdir@plt>
cmp    $0x0,%rax
je     18aa <fts_read+0x70a>
mov    0x26c9(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
jmp    19cc <fts_read+0x82c>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
mov    0x272b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1958 <fts_read+0x7b8>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2693(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1946 <fts_read+0x7a6>
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rdi
call   1080 <fchdir@plt>
cmp    $0x0,%rax
je     1946 <fts_read+0x7a6>
mov    0x2682(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rdi
call   1060 <close@plt>
mov    -0x34(%rbp),%ecx
mov    0x2666(%rip),%rax
mov    %ecx,(%rax)
mov    0x262d(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rdi
call   1060 <close@plt>
jmp    19c7 <fts_read+0x827>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
mov    0x267a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    19c2 <fts_read+0x822>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rsi
mov    $0xffffffff,%edx
lea    0x677(%rip),%rcx
call   1090 <fts_safe_changedir@plt>
cmp    $0x0,%rax
je     19c2 <fts_read+0x822>
mov    0x25b1(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1a17 <fts_read+0x877>
jmp    19c7 <fts_read+0x827>
jmp    19cc <fts_read+0x82c>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x10(%rax)
je     19ed <fts_read+0x84d>
mov    0x258f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    19fb <fts_read+0x85b>
mov    0x25bc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rax,0x18(%rcx)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x18(%rdi),%rbx
test   %rbx,%rbx
je     11c5 <fts_read+0x25>
mov    %rdi,%r14
mov    (%rdi),%eax
mov    0x2d90(%rip),%r15
test   %eax,(%r15)
je     11d9 <fts_read+0x39>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%ecx
mov    0x2d96(%rip),%r12
mov    (%r12),%edx
mov    %edx,(%rbx)
mov    0x2de1(%rip),%rdx
cmp    (%rdx),%ecx
jne    1206 <fts_read+0x66>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <fts_stat@plt>
mov    %rax,0x8(%rbx)
jmp    11c7 <fts_read+0x27>
mov    0x2deb(%rip),%rsi
mov    0x8(%rbx),%rdx
cmp    (%rsi),%ecx
jne    1235 <fts_read+0x95>
mov    0x2d84(%rip),%rsi
cmp    (%rsi),%rdx
je     13ae <fts_read+0x20e>
mov    0x2d6c(%rip),%rsi
cmp    (%rsi),%rdx
je     13ae <fts_read+0x20e>
mov    0x2d54(%rip),%rsi
cmp    (%rsi),%rdx
jne    12c6 <fts_read+0x126>
mov    0x2d6c(%rip),%rdx
cmp    (%rdx),%ecx
je     1410 <fts_read+0x270>
mov    0x2cfd(%rip),%rcx
test   %eax,(%rcx)
je     126d <fts_read+0xcd>
mov    0x18(%rbx),%rcx
cmp    0x8(%r14),%rcx
jne    1410 <fts_read+0x270>
mov    0x28(%r14),%rdi
test   %rdi,%rdi
je     129b <fts_read+0xfb>
mov    0x2ce3(%rip),%rcx
mov    (%rcx),%ecx
test   %eax,%ecx
je     153b <fts_read+0x39b>
not    %ecx
and    %ecx,%eax
mov    %eax,(%r14)
call   1070 <fts_lfree@plt>
movq   $0x0,0x28(%r14)
mov    %r14,%rdi
mov    $0x3,%esi
call   10c0 <fts_build@plt>
mov    %rax,0x28(%r14)
test   %rax,%rax
je     14fc <fts_read+0x35c>
mov    0x28(%r14),%rbx
movq   $0x0,0x28(%r14)
jmp    1371 <fts_read+0x1d1>
mov    0x2cf3(%rip),%rbp
mov    0x2ce4(%rip),%r13
mov    %rbx,%rdi
nopw   0x0(%rax,%rax,1)
mov    0x60(%rdi),%rbx
test   %rbx,%rbx
je     1450 <fts_read+0x2b0>
call   1030 <free@plt>
mov    0x28(%rbx),%rax
cmp    0x0(%rbp),%rax
je     148d <fts_read+0x2ed>
mov    (%rbx),%eax
mov    %rbx,%rdi
cmp    0x0(%r13),%eax
je     12e0 <fts_read+0x140>
mov    0x2ce6(%rip),%rcx
cmp    (%rcx),%eax
jne    1371 <fts_read+0x1d1>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <fts_stat@plt>
mov    %rax,0x8(%rbx)
mov    0x2c5f(%rip),%rcx
cmp    %rax,(%rcx)
jne    136b <fts_read+0x1cb>
mov    0x2c2b(%rip),%rax
mov    (%rax),%eax
test   %eax,(%r14)
jne    136b <fts_read+0x1cb>
mov    0x2c5d(%rip),%rax
mov    (%rax),%esi
lea    0xcad(%rip),%rdi
xor    %edx,%edx
call   10b0 <open@plt>
mov    %rax,0x48(%rbx)
mov    0x2c82(%rip),%rax
mov    (%rax),%eax
or     %eax,0x14(%rbx)
mov    (%r12),%eax
mov    %eax,(%rbx)
mov    0x10(%r14),%rax
mov    0x40(%rbx),%rcx
mov    0x30(%rcx),%rdx
movslq 0x38(%rcx),%rcx
lea    -0x1(%rcx),%rsi
cmpb   $0x2f,-0x1(%rdx,%rcx,1)
cmovne %ecx,%esi
movslq %esi,%rcx
lea    0x1(%rax,%rcx,1),%rdi
movb   $0x2f,(%rax,%rcx,1)
mov    0x58(%rbx),%esi
mov    0x50(%rbx),%rdx
add    $0x1,%rdx
call   10a0 <memmove@plt>
jmp    15df <fts_read+0x43f>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <fts_stat@plt>
mov    %rax,0x8(%rbx)
mov    0x2bc7(%rip),%rcx
cmp    %rax,(%rcx)
jne    11c7 <fts_read+0x27>
mov    0x2b8f(%rip),%rax
mov    (%rax),%eax
test   %eax,(%r14)
jne    11c7 <fts_read+0x27>
mov    0x2bbd(%rip),%rax
mov    (%rax),%esi
lea    0xc0d(%rip),%rdi
xor    %edx,%edx
call   10b0 <open@plt>
mov    %rax,0x48(%rbx)
mov    0x2be2(%rip),%rax
mov    (%rax),%eax
or     %eax,0x14(%rbx)
jmp    11c7 <fts_read+0x27>
mov    0x2bd1(%rip),%rax
mov    (%rax),%eax
test   %eax,0x14(%rbx)
je     1427 <fts_read+0x287>
mov    0x48(%rbx),%rdi
call   1060 <close@plt>
mov    0x28(%r14),%rdi
test   %rdi,%rdi
je     143d <fts_read+0x29d>
call   1070 <fts_lfree@plt>
movq   $0x0,0x28(%r14)
mov    0x2b6c(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rbx)
jmp    11c7 <fts_read+0x27>
mov    0x40(%rdi),%rbx
call   1030 <free@plt>
mov    0x28(%rbx),%rax
mov    0x2b8c(%rip),%rcx
cmp    (%rcx),%rax
jne    14ab <fts_read+0x30b>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2b08(%rip),%rax
movl   $0x0,(%rax)
movq   $0x0,0x18(%r14)
xor    %ebx,%ebx
jmp    11c7 <fts_read+0x27>
mov    0x2ad4(%rip),%rax
mov    (%rax),%eax
test   %eax,(%r14)
je     14e1 <fts_read+0x341>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fts_load@plt>
jmp    15df <fts_read+0x43f>
mov    0x10(%r14),%rax
movslq 0x38(%rbx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    0x28(%rbx),%rax
cmp    0x0(%rbp),%rax
jne    150d <fts_read+0x36d>
mov    0x2aa0(%rip),%rax
mov    (%rax),%eax
test   %eax,(%r14)
jne    15c2 <fts_read+0x422>
mov    0x20(%r14),%rdi
call   1080 <fchdir@plt>
jmp    15bd <fts_read+0x41d>
mov    0x20(%r14),%rdi
call   1080 <fchdir@plt>
test   %rax,%rax
je     149b <fts_read+0x2fb>
mov    (%r15),%eax
or     %eax,(%r14)
xor    %ebx,%ebx
jmp    11c7 <fts_read+0x27>
mov    (%r15),%eax
xor    %ecx,%ecx
test   %eax,(%r14)
cmovne %rcx,%rbx
jmp    11c7 <fts_read+0x27>
mov    0x14(%rbx),%eax
mov    0x2ad1(%rip),%rcx
test   %eax,(%rcx)
je     159a <fts_read+0x3fa>
mov    0x2a46(%rip),%rax
mov    (%rax),%eax
test   %eax,(%r14)
je     15e8 <fts_read+0x448>
mov    0x48(%rbx),%rdi
call   1060 <close@plt>
jmp    15c2 <fts_read+0x422>
mov    0x20(%rbx),%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xffffffff,%edx
call   1090 <fts_safe_changedir@plt>
test   %rax,%rax
je     12b5 <fts_read+0x115>
mov    0x2a21(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rbx)
mov    0x2a75(%rip),%rax
mov    (%rax),%eax
or     %eax,0x14(%rbx)
mov    0x28(%r14),%rax
test   %rax,%rax
je     12b5 <fts_read+0x115>
mov    0x40(%rax),%rcx
mov    0x60(%rax),%rdx
mov    0x20(%rcx),%rcx
mov    %rcx,0x20(%rax)
mov    %rdx,%rax
test   %rdx,%rdx
jne    157d <fts_read+0x3dd>
jmp    12b5 <fts_read+0x115>
mov    0x2a3f(%rip),%rcx
test   %eax,(%rcx)
jne    15c2 <fts_read+0x422>
mov    0x40(%rbx),%rsi
lea    0xa50(%rip),%rcx
mov    %r14,%rdi
mov    $0xffffffff,%edx
call   1090 <fts_safe_changedir@plt>
test   %rax,%rax
jne    1612 <fts_read+0x472>
cmpl   $0x0,0x10(%rbx)
jne    15d1 <fts_read+0x431>
mov    0x29e1(%rip),%rax
jmp    15d8 <fts_read+0x438>
mov    0x2998(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rbx)
mov    %rbx,0x18(%r14)
jmp    11c7 <fts_read+0x27>
mov    0x48(%rbx),%rdi
call   1080 <fchdir@plt>
test   %rax,%rax
je     152d <fts_read+0x38d>
mov    0x297f(%rip),%r12
mov    (%r12),%ebp
mov    0x48(%rbx),%rdi
call   1060 <close@plt>
mov    %ebp,(%r12)
mov    (%r15),%eax
or     %eax,(%r14)
mov    %rbx,0x18(%r14)
xor    %ebx,%ebx
jmp    11c7 <fts_read+0x27>

LLVM IR (-O0):
%struct.TYPE_15__ = type { i32, i64, i32, i32, i64, i8*, i64, i8*, i32, %struct.TYPE_15__*, i8*, i64, i32, %struct.TYPE_15__* }
%struct.TYPE_16__ = type { i32, i64, i8*, %struct.TYPE_15__*, i8*, %struct.TYPE_15__* }
@FTS_STOP = global i32 0
@FTS_NOINSTR = global i8* null
@FTS_AGAIN = global i32 0
@FTS_FOLLOW = global i32 0
@FTS_SL = global i64 0
@FTS_SLNONE = global i64 0
@FTS_D = global i64 0
@FTS_NOCHDIR = global i32 0
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
@errno = global i32 0
@FTS_ERR = global i8* null
@FTS_SYMFOLLOW = global i32 0
@FTS_SKIP = global i32 0
@FTS_XDEV = global i32 0
@FTS_DP = global i8* null
@FTS_NAMEONLY = global i32 0
@FTS_DONTCHDIR = global i32 0
@FTS_ROOTLEVEL = global i64 0
@FTS_ROOTPARENTLEVEL = global i64 0
@.str.1 = [3 x i8] c"..\00"
define %struct.TYPE_15__* @fts_read(%struct.TYPE_16__* %0) {
%2 = alloca %struct.TYPE_15__*
%3 = alloca %struct.TYPE_16__*
%4 = alloca %struct.TYPE_15__*
%5 = alloca %struct.TYPE_15__*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.TYPE_16__* %0, %struct.TYPE_16__** %3
%9 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%10 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %9, i32 0, i32 3
%11 = load %struct.TYPE_15__*, %struct.TYPE_15__** %10
%12 = icmp eq %struct.TYPE_15__* %11, null
br i1 %12, label %20, label %13
13: ; preds = %1
%14 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%15 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* @FTS_STOP
%18 = and i32 %16, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %13, %1
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
21: ; preds = %13
%22 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%23 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %22, i32 0, i32 3
%24 = load %struct.TYPE_15__*, %struct.TYPE_15__** %23
store %struct.TYPE_15__* %24, %struct.TYPE_15__** %4
%25 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%26 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %25, i32 0, i32 0
%27 = load i32, i32* %26
store i32 %27, i32* %6
%28 = load i8*, i8** @FTS_NOINSTR
%29 = ptrtoint i8* %28 to i32
%30 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%31 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %30, i32 0, i32 0
store i32 %29, i32* %31
%32 = load i32, i32* %6
%33 = load i32, i32* @FTS_AGAIN
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %43
35: ; preds = %21
%36 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%37 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%38 = call i8* @fts_stat(%struct.TYPE_16__* %36, %struct.TYPE_15__* %37, i32 0)
%39 = ptrtoint i8* %38 to i64
%40 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%41 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %40, i32 0, i32 1
store i64 %39, i64* %41
%42 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
store %struct.TYPE_15__* %42, %struct.TYPE_15__** %2
br label %532
43: ; preds = %21
%44 = load i32, i32* %6
%45 = load i32, i32* @FTS_FOLLOW
%46 = icmp eq i32 %44, %45
br i1 %46, label %47, label %101
47: ; preds = %43
%48 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%49 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %48, i32 0, i32 1
%50 = load i64, i64* %49
%51 = load i64, i64* @FTS_SL
%52 = icmp eq i64 %50, %51
br i1 %52, label %59, label %53
53: ; preds = %47
%54 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%55 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %54, i32 0, i32 1
%56 = load i64, i64* %55
%57 = load i64, i64* @FTS_SLNONE
%58 = icmp eq i64 %56, %57
br i1 %58, label %59, label %101
59: ; preds = %53, %47
%60 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%61 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%62 = call i8* @fts_stat(%struct.TYPE_16__* %60, %struct.TYPE_15__* %61, i32 1)
%63 = ptrtoint i8* %62 to i64
%64 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%65 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %64, i32 0, i32 1
store i64 %63, i64* %65
%66 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%67 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %66, i32 0, i32 1
%68 = load i64, i64* %67
%69 = load i64, i64* @FTS_D
%70 = icmp eq i64 %68, %69
br i1 %70, label %71, label %99
71: ; preds = %59
%72 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%73 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %72, i32 0, i32 0
%74 = load i32, i32* %73
%75 = load i32, i32* @FTS_NOCHDIR
%76 = and i32 %74, %75
%77 = icmp ne i32 %76, 0
br i1 %77, label %99, label %78
78: ; preds = %71
%79 = load i32, i32* @O_RDONLY
%80 = call i8* @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %79, i32 0)
%81 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%82 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %81, i32 0, i32 10
store i8* %80, i8** %82
%83 = icmp ult i8* %80, null
br i1 %83, label %84, label %92
84: ; preds = %78
%85 = load i32, i32* @errno
%86 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%87 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %86, i32 0, i32 2
store i32 %85, i32* %87
%88 = load i8*, i8** @FTS_ERR
%89 = ptrtoint i8* %88 to i64
%90 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%91 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %90, i32 0, i32 1
store i64 %89, i64* %91
br label %98
92: ; preds = %78
%93 = load i32, i32* @FTS_SYMFOLLOW
%94 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%95 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %94, i32 0, i32 3
%96 = load i32, i32* %95
%97 = or i32 %96, %93
store i32 %97, i32* %95
br label %98
98: ; preds = %92, %84
br label %99
99: ; preds = %98, %71, %59
%100 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
store %struct.TYPE_15__* %100, %struct.TYPE_15__** %2
br label %532
101: ; preds = %53, %43
%102 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%103 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %102, i32 0, i32 1
%104 = load i64, i64* %103
%105 = load i64, i64* @FTS_D
%106 = icmp eq i64 %104, %105
br i1 %106, label %107, label %246
107: ; preds = %101
%108 = load i32, i32* %6
%109 = load i32, i32* @FTS_SKIP
%110 = icmp eq i32 %108, %109
br i1 %110, label %126, label %111
111: ; preds = %107
%112 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%113 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %112, i32 0, i32 0
%114 = load i32, i32* %113
%115 = load i32, i32* @FTS_XDEV
%116 = and i32 %114, %115
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %156
118: ; preds = %111
%119 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%120 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %119, i32 0, i32 4
%121 = load i64, i64* %120
%122 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%123 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %122, i32 0, i32 1
%124 = load i64, i64* %123
%125 = icmp ne i64 %121, %124
br i1 %125, label %126, label %156
126: ; preds = %118, %107
%127 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%128 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %127, i32 0, i32 3
%129 = load i32, i32* %128
%130 = load i32, i32* @FTS_SYMFOLLOW
%131 = and i32 %129, %130
%132 = icmp ne i32 %131, 0
br i1 %132, label %133, label %138
133: ; preds = %126
%134 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%135 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %134, i32 0, i32 10
%136 = load i8*, i8** %135
%137 = call i32 @close(i8* %136)
br label %138
138: ; preds = %133, %126
%139 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%140 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %139, i32 0, i32 5
%141 = load %struct.TYPE_15__*, %struct.TYPE_15__** %140
%142 = icmp ne %struct.TYPE_15__* %141, null
br i1 %142, label %143, label %150
143: ; preds = %138
%144 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%145 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %144, i32 0, i32 5
%146 = load %struct.TYPE_15__*, %struct.TYPE_15__** %145
%147 = call i32 @fts_lfree(%struct.TYPE_15__* %146)
%148 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%149 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %148, i32 0, i32 5
store %struct.TYPE_15__* null, %struct.TYPE_15__** %149
br label %150
150: ; preds = %143, %138
%151 = load i8*, i8** @FTS_DP
%152 = ptrtoint i8* %151 to i64
%153 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%154 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %153, i32 0, i32 1
store i64 %152, i64* %154
%155 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
store %struct.TYPE_15__* %155, %struct.TYPE_15__** %2
br label %532
156: ; preds = %118, %111
%157 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%158 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %157, i32 0, i32 5
%159 = load %struct.TYPE_15__*, %struct.TYPE_15__** %158
%160 = icmp ne %struct.TYPE_15__* %159, null
br i1 %160, label %161, label %181
161: ; preds = %156
%162 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%163 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %162, i32 0, i32 0
%164 = load i32, i32* %163
%165 = load i32, i32* @FTS_NAMEONLY
%166 = and i32 %164, %165
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %181
168: ; preds = %161
%169 = load i32, i32* @FTS_NAMEONLY
%170 = xor i32 %169, -1
%171 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%172 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %171, i32 0, i32 0
%173 = load i32, i32* %172
%174 = and i32 %173, %170
store i32 %174, i32* %172
%175 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%176 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %175, i32 0, i32 5
%177 = load %struct.TYPE_15__*, %struct.TYPE_15__** %176
%178 = call i32 @fts_lfree(%struct.TYPE_15__* %177)
%179 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%180 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %179, i32 0, i32 5
store %struct.TYPE_15__* null, %struct.TYPE_15__** %180
br label %181
181: ; preds = %168, %161, %156
%182 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%183 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %182, i32 0, i32 5
%184 = load %struct.TYPE_15__*, %struct.TYPE_15__** %183
%185 = icmp ne %struct.TYPE_15__* %184, null
br i1 %185, label %186, label %223
186: ; preds = %181
%187 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%188 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%189 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%190 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %189, i32 0, i32 5
%191 = load i8*, i8** %190
%192 = call i64 @fts_safe_changedir(%struct.TYPE_16__* %187, %struct.TYPE_15__* %188, i32 -1, i8* %191)
%193 = icmp ne i64 %192, 0
br i1 %193, label %194, label %222
194: ; preds = %186
%195 = load i32, i32* @errno
%196 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%197 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %196, i32 0, i32 2
store i32 %195, i32* %197
%198 = load i32, i32* @FTS_DONTCHDIR
%199 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%200 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %199, i32 0, i32 3
%201 = load i32, i32* %200
%202 = or i32 %201, %198
store i32 %202, i32* %200
%203 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%204 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %203, i32 0, i32 5
%205 = load %struct.TYPE_15__*, %struct.TYPE_15__** %204
store %struct.TYPE_15__* %205, %struct.TYPE_15__** %4
br label %206
206: ; preds = %217, %194
%207 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%208 = icmp ne %struct.TYPE_15__* %207, null
br i1 %208, label %209, label %221
209: ; preds = %206
%210 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%211 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %210, i32 0, i32 9
%212 = load %struct.TYPE_15__*, %struct.TYPE_15__** %211
%213 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %212, i32 0, i32 5
%214 = load i8*, i8** %213
%215 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%216 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %215, i32 0, i32 5
store i8* %214, i8** %216
br label %217
217: ; preds = %209
%218 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%219 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %218, i32 0, i32 13
%220 = load %struct.TYPE_15__*, %struct.TYPE_15__** %219
store %struct.TYPE_15__* %220, %struct.TYPE_15__** %4
br label %206
221: ; preds = %206
br label %222
222: ; preds = %221, %186
br label %240
223: ; preds = %181
%224 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%225 = call %struct.TYPE_15__* @fts_build(%struct.TYPE_16__* %224, i32 3)
%226 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%227 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %226, i32 0, i32 5
store %struct.TYPE_15__* %225, %struct.TYPE_15__** %227
%228 = icmp eq %struct.TYPE_15__* %225, null
br i1 %228, label %229, label %239
229: ; preds = %223
%230 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%231 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %230, i32 0, i32 0
%232 = load i32, i32* %231
%233 = load i32, i32* @FTS_STOP
%234 = and i32 %232, %233
%235 = icmp ne i32 %234, 0
br i1 %235, label %236, label %237
236: ; preds = %229
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
237: ; preds = %229
%238 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
store %struct.TYPE_15__* %238, %struct.TYPE_15__** %2
br label %532
239: ; preds = %223
br label %240
240: ; preds = %239, %222
%241 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%242 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %241, i32 0, i32 5
%243 = load %struct.TYPE_15__*, %struct.TYPE_15__** %242
store %struct.TYPE_15__* %243, %struct.TYPE_15__** %4
%244 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%245 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %244, i32 0, i32 5
store %struct.TYPE_15__* null, %struct.TYPE_15__** %245
br label %346
246: ; preds = %101
br label %247
247: ; preds = %293, %246
%248 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
store %struct.TYPE_15__* %248, %struct.TYPE_15__** %5
%249 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%250 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %249, i32 0, i32 13
%251 = load %struct.TYPE_15__*, %struct.TYPE_15__** %250
store %struct.TYPE_15__* %251, %struct.TYPE_15__** %4
%252 = icmp ne %struct.TYPE_15__* %251, null
br i1 %252, label %253, label %397
253: ; preds = %247
%254 = load %struct.TYPE_15__*, %struct.TYPE_15__** %5
%255 = call i32 @free(%struct.TYPE_15__* %254)
%256 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%257 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %256, i32 0, i32 6
%258 = load i64, i64* %257
%259 = load i64, i64* @FTS_ROOTLEVEL
%260 = icmp eq i64 %258, %259
br i1 %260, label %261, label %287
261: ; preds = %253
%262 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%263 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %262, i32 0, i32 0
%264 = load i32, i32* %263
%265 = load i32, i32* @FTS_NOCHDIR
%266 = and i32 %264, %265
%267 = icmp ne i32 %266, 0
br i1 %267, label %280, label %268
268: ; preds = %261
%269 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%270 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %269, i32 0, i32 4
%271 = load i8*, i8** %270
%272 = call i64 @fchdir(i8* %271)
%273 = icmp ne i64 %272, 0
br i1 %273, label %274, label %280
274: ; preds = %268
%275 = load i32, i32* @FTS_STOP
%276 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%277 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %276, i32 0, i32 0
%278 = load i32, i32* %277
%279 = or i32 %278, %275
store i32 %279, i32* %277
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
280: ; preds = %268, %261
%281 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%282 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%283 = call i32 @fts_load(%struct.TYPE_16__* %281, %struct.TYPE_15__* %282)
%284 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%285 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%286 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %285, i32 0, i32 3
store %struct.TYPE_15__* %284, %struct.TYPE_15__** %286
store %struct.TYPE_15__* %284, %struct.TYPE_15__** %2
br label %532
287: ; preds = %253
%288 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%289 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %288, i32 0, i32 0
%290 = load i32, i32* %289
%291 = load i32, i32* @FTS_SKIP
%292 = icmp eq i32 %290, %291
br i1 %292, label %293, label %294
293: ; preds = %287
br label %247
294: ; preds = %287
%295 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%296 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %295, i32 0, i32 0
%297 = load i32, i32* %296
%298 = load i32, i32* @FTS_FOLLOW
%299 = icmp eq i32 %297, %298
br i1 %299, label %300, label %345
300: ; preds = %294
%301 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%302 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%303 = call i8* @fts_stat(%struct.TYPE_16__* %301, %struct.TYPE_15__* %302, i32 1)
%304 = ptrtoint i8* %303 to i64
%305 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%306 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %305, i32 0, i32 1
store i64 %304, i64* %306
%307 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%308 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %307, i32 0, i32 1
%309 = load i64, i64* %308
%310 = load i64, i64* @FTS_D
%311 = icmp eq i64 %309, %310
br i1 %311, label %312, label %340
312: ; preds = %300
%313 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%314 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %313, i32 0, i32 0
%315 = load i32, i32* %314
%316 = load i32, i32* @FTS_NOCHDIR
%317 = and i32 %315, %316
%318 = icmp ne i32 %317, 0
br i1 %318, label %340, label %319
319: ; preds = %312
%320 = load i32, i32* @O_RDONLY
%321 = call i8* @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %320, i32 0)
%322 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%323 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %322, i32 0, i32 10
store i8* %321, i8** %323
%324 = icmp ult i8* %321, null
br i1 %324, label %325, label %333
325: ; preds = %319
%326 = load i32, i32* @errno
%327 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%328 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %327, i32 0, i32 2
store i32 %326, i32* %328
%329 = load i8*, i8** @FTS_ERR
%330 = ptrtoint i8* %329 to i64
%331 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%332 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %331, i32 0, i32 1
store i64 %330, i64* %332
br label %339
333: ; preds = %319
%334 = load i32, i32* @FTS_SYMFOLLOW
%335 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%336 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %335, i32 0, i32 3
%337 = load i32, i32* %336
%338 = or i32 %337, %334
store i32 %338, i32* %336
br label %339
339: ; preds = %333, %325
br label %340
340: ; preds = %339, %312, %300
%341 = load i8*, i8** @FTS_NOINSTR
%342 = ptrtoint i8* %341 to i32
%343 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%344 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %343, i32 0, i32 0
store i32 %342, i32* %344
br label %345
345: ; preds = %340, %294
br label %346
346: ; preds = %345, %240
%347 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%348 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %347, i32 0, i32 2
%349 = load i8*, i8** %348
%350 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%351 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %350, i32 0, i32 9
%352 = load %struct.TYPE_15__*, %struct.TYPE_15__** %351
%353 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %352, i32 0, i32 7
%354 = load i8*, i8** %353
%355 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%356 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %355, i32 0, i32 9
%357 = load %struct.TYPE_15__*, %struct.TYPE_15__** %356
%358 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %357, i32 0, i32 8
%359 = load i32, i32* %358
%360 = sub nsw i32 %359, 1
%361 = sext i32 %360 to i64
%362 = getelementptr inbounds i8, i8* %354, i64 %361
%363 = load i8, i8* %362
%364 = sext i8 %363 to i32
%365 = icmp eq i32 %364, 47
br i1 %365, label %366, label %373
366: ; preds = %346
%367 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%368 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %367, i32 0, i32 9
%369 = load %struct.TYPE_15__*, %struct.TYPE_15__** %368
%370 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %369, i32 0, i32 8
%371 = load i32, i32* %370
%372 = sub nsw i32 %371, 1
br label %379
373: ; preds = %346
%374 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%375 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %374, i32 0, i32 9
%376 = load %struct.TYPE_15__*, %struct.TYPE_15__** %375
%377 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %376, i32 0, i32 8
%378 = load i32, i32* %377
br label %379
379: ; preds = %373, %366
%380 = phi i32 [ %372, %366 ], [ %378, %373 ]
%381 = sext i32 %380 to i64
%382 = getelementptr inbounds i8, i8* %349, i64 %381
store i8* %382, i8** %7
%383 = load i8*, i8** %7
%384 = getelementptr inbounds i8, i8* %383, i32 1
store i8* %384, i8** %7
store i8 47, i8* %383
%385 = load i8*, i8** %7
%386 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%387 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %386, i32 0, i32 12
%388 = load i32, i32* %387
%389 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%390 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %389, i32 0, i32 11
%391 = load i64, i64* %390
%392 = add nsw i64 %391, 1
%393 = call i32 @memmove(i8* %385, i32 %388, i64 %392)
%394 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%395 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%396 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %395, i32 0, i32 3
store %struct.TYPE_15__* %394, %struct.TYPE_15__** %396
store %struct.TYPE_15__* %394, %struct.TYPE_15__** %2
br label %532
397: ; preds = %247
%398 = load %struct.TYPE_15__*, %struct.TYPE_15__** %5
%399 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %398, i32 0, i32 9
%400 = load %struct.TYPE_15__*, %struct.TYPE_15__** %399
store %struct.TYPE_15__* %400, %struct.TYPE_15__** %4
%401 = load %struct.TYPE_15__*, %struct.TYPE_15__** %5
%402 = call i32 @free(%struct.TYPE_15__* %401)
%403 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%404 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %403, i32 0, i32 6
%405 = load i64, i64* %404
%406 = load i64, i64* @FTS_ROOTPARENTLEVEL
%407 = icmp eq i64 %405, %406
br i1 %407, label %408, label %413
408: ; preds = %397
%409 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%410 = call i32 @free(%struct.TYPE_15__* %409)
store i32 0, i32* @errno
%411 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%412 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %411, i32 0, i32 3
store %struct.TYPE_15__* null, %struct.TYPE_15__** %412
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
413: ; preds = %397
%414 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%415 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %414, i32 0, i32 2
%416 = load i8*, i8** %415
%417 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%418 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %417, i32 0, i32 8
%419 = load i32, i32* %418
%420 = sext i32 %419 to i64
%421 = getelementptr inbounds i8, i8* %416, i64 %420
store i8 0, i8* %421
%422 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%423 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %422, i32 0, i32 6
%424 = load i64, i64* %423
%425 = load i64, i64* @FTS_ROOTLEVEL
%426 = icmp eq i64 %424, %425
br i1 %426, label %427, label %450
427: ; preds = %413
%428 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%429 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %428, i32 0, i32 0
%430 = load i32, i32* %429
%431 = load i32, i32* @FTS_NOCHDIR
%432 = and i32 %430, %431
%433 = icmp ne i32 %432, 0
br i1 %433, label %449, label %434
434: ; preds = %427
%435 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%436 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %435, i32 0, i32 4
%437 = load i8*, i8** %436
%438 = call i64 @fchdir(i8* %437)
%439 = icmp ne i64 %438, 0
br i1 %439, label %440, label %449
440: ; preds = %434
%441 = load i32, i32* @FTS_STOP
%442 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%443 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %442, i32 0, i32 0
%444 = load i32, i32* %443
%445 = or i32 %444, %441
store i32 %445, i32* %443
%446 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%447 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%448 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %447, i32 0, i32 3
store %struct.TYPE_15__* %446, %struct.TYPE_15__** %448
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
449: ; preds = %434, %427
br label %515
450: ; preds = %413
%451 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%452 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %451, i32 0, i32 3
%453 = load i32, i32* %452
%454 = load i32, i32* @FTS_SYMFOLLOW
%455 = and i32 %453, %454
%456 = icmp ne i32 %455, 0
br i1 %456, label %457, label %490
457: ; preds = %450
%458 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%459 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %458, i32 0, i32 0
%460 = load i32, i32* %459
%461 = load i32, i32* @FTS_NOCHDIR
%462 = and i32 %460, %461
%463 = icmp ne i32 %462, 0
br i1 %463, label %485, label %464
464: ; preds = %457
%465 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%466 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %465, i32 0, i32 10
%467 = load i8*, i8** %466
%468 = call i64 @fchdir(i8* %467)
%469 = icmp ne i64 %468, 0
br i1 %469, label %470, label %485
470: ; preds = %464
%471 = load i32, i32* @errno
store i32 %471, i32* %8
%472 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%473 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %472, i32 0, i32 10
%474 = load i8*, i8** %473
%475 = call i32 @close(i8* %474)
%476 = load i32, i32* %8
store i32 %476, i32* @errno
%477 = load i32, i32* @FTS_STOP
%478 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%479 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %478, i32 0, i32 0
%480 = load i32, i32* %479
%481 = or i32 %480, %477
store i32 %481, i32* %479
%482 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%483 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%484 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %483, i32 0, i32 3
store %struct.TYPE_15__* %482, %struct.TYPE_15__** %484
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
485: ; preds = %464, %457
%486 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%487 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %486, i32 0, i32 10
%488 = load i8*, i8** %487
%489 = call i32 @close(i8* %488)
br label %514
490: ; preds = %450
%491 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%492 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %491, i32 0, i32 3
%493 = load i32, i32* %492
%494 = load i32, i32* @FTS_DONTCHDIR
%495 = and i32 %493, %494
%496 = icmp ne i32 %495, 0
br i1 %496, label %513, label %497
497: ; preds = %490
%498 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%499 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%500 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %499, i32 0, i32 9
%501 = load %struct.TYPE_15__*, %struct.TYPE_15__** %500
%502 = call i64 @fts_safe_changedir(%struct.TYPE_16__* %498, %struct.TYPE_15__* %501, i32 -1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%503 = icmp ne i64 %502, 0
br i1 %503, label %504, label %513
504: ; preds = %497
%505 = load i32, i32* @FTS_STOP
%506 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%507 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %506, i32 0, i32 0
%508 = load i32, i32* %507
%509 = or i32 %508, %505
store i32 %509, i32* %507
%510 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%511 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%512 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %511, i32 0, i32 3
store %struct.TYPE_15__* %510, %struct.TYPE_15__** %512
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %532
513: ; preds = %497, %490
br label %514
514: ; preds = %513, %485
br label %515
515: ; preds = %514, %449
%516 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%517 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %516, i32 0, i32 2
%518 = load i32, i32* %517
%519 = icmp ne i32 %518, 0
br i1 %519, label %520, label %522
520: ; preds = %515
%521 = load i8*, i8** @FTS_ERR
br label %524
522: ; preds = %515
%523 = load i8*, i8** @FTS_DP
br label %524
524: ; preds = %522, %520
%525 = phi i8* [ %521, %520 ], [ %523, %522 ]
%526 = ptrtoint i8* %525 to i64
%527 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%528 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %527, i32 0, i32 1
store i64 %526, i64* %528
%529 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%530 = load %struct.TYPE_16__*, %struct.TYPE_16__** %3
%531 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %530, i32 0, i32 3
store %struct.TYPE_15__* %529, %struct.TYPE_15__** %531
store %struct.TYPE_15__* %529, %struct.TYPE_15__** %2
br label %532
532: ; preds = %524, %504, %470, %440, %408, %379, %280, %274, %237, %236, %150, %99, %35, %20
%533 = load %struct.TYPE_15__*, %struct.TYPE_15__** %2
ret %struct.TYPE_15__* %533
}

LLVM IR (-O2):
%struct.TYPE_15__ = type { i32, i64, i32, i32, i64, i8*, i64, i8*, i32, %struct.TYPE_15__*, i8*, i64, i32, %struct.TYPE_15__* }
%struct.TYPE_16__ = type { i32, i64, i8*, %struct.TYPE_15__*, i8*, %struct.TYPE_15__* }
@FTS_STOP = global i32 0
@FTS_NOINSTR = global i8* null
@FTS_AGAIN = global i32 0
@FTS_FOLLOW = global i32 0
@FTS_SL = global i64 0
@FTS_SLNONE = global i64 0
@FTS_D = global i64 0
@FTS_NOCHDIR = global i32 0
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
@errno = global i32 0
@FTS_ERR = global i8* null
@FTS_SYMFOLLOW = global i32 0
@FTS_SKIP = global i32 0
@FTS_XDEV = global i32 0
@FTS_DP = global i8* null
@FTS_NAMEONLY = global i32 0
@FTS_DONTCHDIR = global i32 0
@FTS_ROOTLEVEL = global i64 0
@FTS_ROOTPARENTLEVEL = global i64 0
@.str.1 = [3 x i8] c"..\00"
define %struct.TYPE_15__* @fts_read(%struct.TYPE_16__* %0) {
%2 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 3
%3 = load %struct.TYPE_15__*, %struct.TYPE_15__** %2
%4 = icmp eq %struct.TYPE_15__* %3, null
br i1 %4, label %302, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @FTS_STOP
%9 = and i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %302
11: ; preds = %5
%12 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 0
%13 = load i32, i32* %12
%14 = load i8*, i8** @FTS_NOINSTR
%15 = ptrtoint i8* %14 to i64
%16 = trunc i64 %15 to i32
store i32 %16, i32* %12
%17 = load i32, i32* @FTS_AGAIN
%18 = icmp eq i32 %13, %17
br i1 %18, label %19, label %23
19: ; preds = %11
%20 = tail call i8* @fts_stat(%struct.TYPE_16__* %0, %struct.TYPE_15__* %3, i32 0)
%21 = ptrtoint i8* %20 to i64
%22 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 1
store i64 %21, i64* %22
br label %302
23: ; preds = %11
%24 = load i32, i32* @FTS_FOLLOW
%25 = icmp eq i32 %13, %24
%26 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 1
%27 = load i64, i64* %26
br i1 %25, label %28, label %52
28: ; preds = %23
%29 = load i64, i64* @FTS_SL
%30 = icmp eq i64 %27, %29
%31 = load i64, i64* @FTS_SLNONE
%32 = icmp eq i64 %27, %31
%33 = select i1 %30, i1 true, i1 %32
br i1 %33, label %34, label %52
34: ; preds = %28
%35 = tail call i8* @fts_stat(%struct.TYPE_16__* %0, %struct.TYPE_15__* %3, i32 1)
%36 = ptrtoint i8* %35 to i64
store i64 %36, i64* %26
%37 = load i64, i64* @FTS_D
%38 = icmp eq i64 %37, %36
br i1 %38, label %39, label %302
39: ; preds = %34
%40 = load i32, i32* %6
%41 = load i32, i32* @FTS_NOCHDIR
%42 = and i32 %41, %40
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %302
44: ; preds = %39
%45 = load i32, i32* @O_RDONLY
%46 = tail call i8* @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %45, i32 0)
%47 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 10
store i8* %46, i8** %47
%48 = load i32, i32* @FTS_SYMFOLLOW
%49 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 3
%50 = load i32, i32* %49
%51 = or i32 %50, %48
store i32 %51, i32* %49
br label %302
52: ; preds = %23, %28
%53 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 1
%54 = load i64, i64* @FTS_D
%55 = icmp eq i64 %27, %54
br i1 %55, label %56, label %135
56: ; preds = %52
%57 = load i32, i32* @FTS_SKIP
%58 = icmp eq i32 %13, %57
br i1 %58, label %69, label %59
59: ; preds = %56
%60 = load i32, i32* @FTS_XDEV
%61 = and i32 %60, %7
%62 = icmp eq i32 %61, 0
br i1 %62, label %88, label %63
63: ; preds = %59
%64 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 4
%65 = load i64, i64* %64
%66 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 1
%67 = load i64, i64* %66
%68 = icmp eq i64 %65, %67
br i1 %68, label %88, label %69
69: ; preds = %63, %56
%70 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 3
%71 = load i32, i32* %70
%72 = load i32, i32* @FTS_SYMFOLLOW
%73 = and i32 %72, %71
%74 = icmp eq i32 %73, 0
br i1 %74, label %79, label %75
75: ; preds = %69
%76 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 10
%77 = load i8*, i8** %76
%78 = tail call i32 @close(i8* %77)
br label %79
79: ; preds = %75, %69
%80 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 5
%81 = load %struct.TYPE_15__*, %struct.TYPE_15__** %80
%82 = icmp eq %struct.TYPE_15__* %81, null
br i1 %82, label %85, label %83
83: ; preds = %79
%84 = tail call i32 @fts_lfree(%struct.TYPE_15__* %81)
store %struct.TYPE_15__* null, %struct.TYPE_15__** %80
br label %85
85: ; preds = %83, %79
%86 = load i8*, i8** @FTS_DP
%87 = ptrtoint i8* %86 to i64
store i64 %87, i64* %53
br label %302
88: ; preds = %63, %59
%89 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 5
%90 = load %struct.TYPE_15__*, %struct.TYPE_15__** %89
%91 = icmp eq %struct.TYPE_15__* %90, null
br i1 %91, label %124, label %92
92: ; preds = %88
%93 = load i32, i32* @FTS_NAMEONLY
%94 = and i32 %93, %7
%95 = icmp eq i32 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %92
%97 = xor i32 %93, -1
%98 = and i32 %7, %97
store i32 %98, i32* %6
%99 = tail call i32 @fts_lfree(%struct.TYPE_15__* %90)
store %struct.TYPE_15__* null, %struct.TYPE_15__** %89
br label %124
100: ; preds = %92
%101 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 5
%102 = load i8*, i8** %101
%103 = tail call i64 @fts_safe_changedir(%struct.TYPE_16__* %0, %struct.TYPE_15__* %3, i32 -1, i8* %102)
%104 = icmp eq i64 %103, 0
br i1 %104, label %133, label %105
105: ; preds = %100
%106 = load i32, i32* @errno
%107 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 2
store i32 %106, i32* %107
%108 = load i32, i32* @FTS_DONTCHDIR
%109 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %3, i64 0, i32 3
%110 = load i32, i32* %109
%111 = or i32 %110, %108
store i32 %111, i32* %109
%112 = load %struct.TYPE_15__*, %struct.TYPE_15__** %89
%113 = icmp eq %struct.TYPE_15__* %112, null
br i1 %113, label %133, label %114
114: ; preds = %105, %114
%115 = phi %struct.TYPE_15__* [ %122, %114 ], [ %112, %105 ]
%116 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %115, i64 0, i32 9
%117 = load %struct.TYPE_15__*, %struct.TYPE_15__** %116
%118 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %117, i64 0, i32 5
%119 = load i8*, i8** %118
%120 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %115, i64 0, i32 5
store i8* %119, i8** %120
%121 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %115, i64 0, i32 13
%122 = load %struct.TYPE_15__*, %struct.TYPE_15__** %121
%123 = icmp eq %struct.TYPE_15__* %122, null
br i1 %123, label %133, label %114
124: ; preds = %88, %96
%125 = tail call %struct.TYPE_15__* @fts_build(%struct.TYPE_16__* %0, i32 3)
store %struct.TYPE_15__* %125, %struct.TYPE_15__** %89
%126 = icmp eq %struct.TYPE_15__* %125, null
br i1 %126, label %127, label %133
127: ; preds = %124
%128 = load i32, i32* %6
%129 = load i32, i32* @FTS_STOP
%130 = and i32 %129, %128
%131 = icmp eq i32 %130, 0
%132 = select i1 %131, %struct.TYPE_15__* %3, %struct.TYPE_15__* null
br label %302
133: ; preds = %114, %105, %124, %100
%134 = load %struct.TYPE_15__*, %struct.TYPE_15__** %89
store %struct.TYPE_15__* null, %struct.TYPE_15__** %89
br label %194
135: ; preds = %52, %162
%136 = phi %struct.TYPE_15__* [ %138, %162 ], [ %3, %52 ]
%137 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %136, i64 0, i32 13
%138 = load %struct.TYPE_15__*, %struct.TYPE_15__** %137
%139 = icmp eq %struct.TYPE_15__* %138, null
br i1 %139, label %219, label %140
140: ; preds = %135
%141 = tail call i32 @free(%struct.TYPE_15__* %136)
%142 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 6
%143 = load i64, i64* %142
%144 = load i64, i64* @FTS_ROOTLEVEL
%145 = icmp eq i64 %143, %144
br i1 %145, label %146, label %162
146: ; preds = %140
%147 = load i32, i32* %6
%148 = load i32, i32* @FTS_NOCHDIR
%149 = and i32 %148, %147
%150 = icmp eq i32 %149, 0
br i1 %150, label %151, label %160
151: ; preds = %146
%152 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 4
%153 = load i8*, i8** %152
%154 = tail call i64 @fchdir(i8* %153)
%155 = icmp eq i64 %154, 0
br i1 %155, label %160, label %156
156: ; preds = %151
%157 = load i32, i32* @FTS_STOP
%158 = load i32, i32* %6
%159 = or i32 %158, %157
store i32 %159, i32* %6
br label %302
160: ; preds = %151, %146
%161 = tail call i32 @fts_load(%struct.TYPE_16__* %0, %struct.TYPE_15__* %138)
store %struct.TYPE_15__* %138, %struct.TYPE_15__** %2
br label %302
162: ; preds = %140
%163 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 0
%164 = load i32, i32* %163
%165 = load i32, i32* @FTS_SKIP
%166 = icmp eq i32 %164, %165
br i1 %166, label %135, label %167
167: ; preds = %162
%168 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 0
%169 = load i32, i32* @FTS_FOLLOW
%170 = icmp eq i32 %164, %169
br i1 %170, label %171, label %194
171: ; preds = %167
%172 = tail call i8* @fts_stat(%struct.TYPE_16__* %0, %struct.TYPE_15__* %138, i32 1)
%173 = ptrtoint i8* %172 to i64
%174 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 1
store i64 %173, i64* %174
%175 = load i64, i64* @FTS_D
%176 = icmp eq i64 %175, %173
br i1 %176, label %177, label %190
177: ; preds = %171
%178 = load i32, i32* %6
%179 = load i32, i32* @FTS_NOCHDIR
%180 = and i32 %179, %178
%181 = icmp eq i32 %180, 0
br i1 %181, label %182, label %190
182: ; preds = %177
%183 = load i32, i32* @O_RDONLY
%184 = tail call i8* @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %183, i32 0)
%185 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 10
store i8* %184, i8** %185
%186 = load i32, i32* @FTS_SYMFOLLOW
%187 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %138, i64 0, i32 3
%188 = load i32, i32* %187
%189 = or i32 %188, %186
store i32 %189, i32* %187
br label %190
190: ; preds = %182, %177, %171
%191 = load i8*, i8** @FTS_NOINSTR
%192 = ptrtoint i8* %191 to i64
%193 = trunc i64 %192 to i32
store i32 %193, i32* %168
br label %194
194: ; preds = %167, %190, %133
%195 = phi %struct.TYPE_15__* [ %134, %133 ], [ %138, %190 ], [ %138, %167 ]
%196 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 2
%197 = load i8*, i8** %196
%198 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %195, i64 0, i32 9
%199 = load %struct.TYPE_15__*, %struct.TYPE_15__** %198
%200 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %199, i64 0, i32 7
%201 = load i8*, i8** %200
%202 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %199, i64 0, i32 8
%203 = load i32, i32* %202
%204 = add nsw i32 %203, -1
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i8, i8* %201, i64 %205
%207 = load i8, i8* %206
%208 = icmp eq i8 %207, 47
%209 = select i1 %208, i32 %204, i32 %203
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %197, i64 %210
%212 = getelementptr inbounds i8, i8* %211, i64 1
store i8 47, i8* %211
%213 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %195, i64 0, i32 12
%214 = load i32, i32* %213
%215 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %195, i64 0, i32 11
%216 = load i64, i64* %215
%217 = add nsw i64 %216, 1
%218 = tail call i32 @memmove(i8* %212, i32 %214, i64 %217)
store %struct.TYPE_15__* %195, %struct.TYPE_15__** %2
br label %302
219: ; preds = %135
%220 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %136, i64 0, i32 9
%221 = load %struct.TYPE_15__*, %struct.TYPE_15__** %220
%222 = tail call i32 @free(%struct.TYPE_15__* %136)
%223 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 6
%224 = load i64, i64* %223
%225 = load i64, i64* @FTS_ROOTPARENTLEVEL
%226 = icmp eq i64 %224, %225
br i1 %226, label %227, label %229
227: ; preds = %219
%228 = tail call i32 @free(%struct.TYPE_15__* %221)
store i32 0, i32* @errno
store %struct.TYPE_15__* null, %struct.TYPE_15__** %2
br label %302
229: ; preds = %219
%230 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 2
%231 = load i8*, i8** %230
%232 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 8
%233 = load i32, i32* %232
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i8, i8* %231, i64 %234
store i8 0, i8* %235
%236 = load i64, i64* %223
%237 = load i64, i64* @FTS_ROOTLEVEL
%238 = icmp eq i64 %236, %237
br i1 %238, label %239, label %253
239: ; preds = %229
%240 = load i32, i32* %6
%241 = load i32, i32* @FTS_NOCHDIR
%242 = and i32 %241, %240
%243 = icmp eq i32 %242, 0
br i1 %243, label %244, label %293
244: ; preds = %239
%245 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %0, i64 0, i32 4
%246 = load i8*, i8** %245
%247 = tail call i64 @fchdir(i8* %246)
%248 = icmp eq i64 %247, 0
br i1 %248, label %293, label %249
249: ; preds = %244
%250 = load i32, i32* @FTS_STOP
%251 = load i32, i32* %6
%252 = or i32 %251, %250
store i32 %252, i32* %6
store %struct.TYPE_15__* %221, %struct.TYPE_15__** %2
br label %302
253: ; preds = %229
%254 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 3
%255 = load i32, i32* %254
%256 = load i32, i32* @FTS_SYMFOLLOW
%257 = and i32 %256, %255
%258 = icmp eq i32 %257, 0
br i1 %258, label %280, label %259
259: ; preds = %253
%260 = load i32, i32* %6
%261 = load i32, i32* @FTS_NOCHDIR
%262 = and i32 %261, %260
%263 = icmp eq i32 %262, 0
br i1 %263, label %264, label %276
264: ; preds = %259
%265 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 10
%266 = load i8*, i8** %265
%267 = tail call i64 @fchdir(i8* %266)
%268 = icmp eq i64 %267, 0
br i1 %268, label %276, label %269
269: ; preds = %264
%270 = load i32, i32* @errno
%271 = load i8*, i8** %265
%272 = tail call i32 @close(i8* %271)
store i32 %270, i32* @errno
%273 = load i32, i32* @FTS_STOP
%274 = load i32, i32* %6
%275 = or i32 %274, %273
store i32 %275, i32* %6
store %struct.TYPE_15__* %221, %struct.TYPE_15__** %2
br label %302
276: ; preds = %264, %259
%277 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 10
%278 = load i8*, i8** %277
%279 = tail call i32 @close(i8* %278)
br label %293
280: ; preds = %253
%281 = load i32, i32* @FTS_DONTCHDIR
%282 = and i32 %281, %255
%283 = icmp eq i32 %282, 0
br i1 %283, label %284, label %293
284: ; preds = %280
%285 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 9
%286 = load %struct.TYPE_15__*, %struct.TYPE_15__** %285
%287 = tail call i64 @fts_safe_changedir(%struct.TYPE_16__* %0, %struct.TYPE_15__* %286, i32 -1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%288 = icmp eq i64 %287, 0
br i1 %288, label %293, label %289
289: ; preds = %284
%290 = load i32, i32* @FTS_STOP
%291 = load i32, i32* %6
%292 = or i32 %291, %290
store i32 %292, i32* %6
store %struct.TYPE_15__* %221, %struct.TYPE_15__** %2
br label %302
293: ; preds = %276, %284, %280, %239, %244
%294 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 2
%295 = load i32, i32* %294
%296 = icmp eq i32 %295, 0
%297 = load i8*, i8** @FTS_ERR
%298 = load i8*, i8** @FTS_DP
%299 = select i1 %296, i8* %298, i8* %297
%300 = ptrtoint i8* %299 to i64
%301 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %221, i64 0, i32 1
store i64 %300, i64* %301
store %struct.TYPE_15__* %221, %struct.TYPE_15__** %2
br label %302
302: ; preds = %127, %34, %39, %44, %1, %5, %293, %289, %269, %249, %227, %194, %160, %156, %85, %19
%303 = phi %struct.TYPE_15__* [ %3, %19 ], [ %3, %85 ], [ %195, %194 ], [ %138, %160 ], [ null, %156 ], [ null, %227 ], [ %221, %293 ], [ null, %249 ], [ null, %269 ], [ null, %289 ], [ null, %5 ], [ null, %1 ], [ %3, %44 ], [ %3, %39 ], [ %3, %34 ], [ %132, %127 ]
ret %struct.TYPE_15__* %303
}