#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_8__ TYPE_2__;
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int fts_options;
  TYPE_1__ *fts_child;
  TYPE_1__ *fts_cur;
};
struct TYPE_7__ {
  scalar_t__ fts_info;
  scalar_t__ fts_level;
  char *fts_accpath;
  struct TYPE_7__ *fts_link;
};
typedef TYPE_1__ FTSENT;
typedef TYPE_2__ FTS;

/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ FTS_D;
scalar_t__ FTS_INIT;
int FTS_NAMEONLY;
int FTS_NOCHDIR;
scalar_t__ FTS_ROOTLEVEL;
int FTS_STOP;
int O_RDONLY;
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
scalar_t__ fchdir(int);
void *fts_build(TYPE_2__ *, int);
int /*<<< orphan*/ fts_lfree(TYPE_1__ *);
int open(char *, int, int /*<<< orphan*/);
FTSENT *fts_children(FTS *sp, int instr) {
  FTSENT *p;
  int fd;
  _DIAGASSERT(sp != NULL);
  if (instr && instr != FTS_NAMEONLY) {
    errno = EINVAL;
    return (NULL);
  }
  p = sp->fts_cur;
  errno = 0;
  if ((sp->fts_options & (FTS_STOP)))
    return (NULL);
  if (p->fts_info == FTS_INIT)
    return (p->fts_link);
  if (p->fts_info != FTS_D)
    return (NULL);
  if (sp->fts_child)
    fts_lfree(sp->fts_child);
  if (instr == FTS_NAMEONLY) {
    (sp->fts_options |= (FTS_NAMEONLY));
    instr = 2;
  } else
    instr = 1;
  if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
      (sp->fts_options & (FTS_NOCHDIR)))
    return (sp->fts_child = fts_build(sp, instr));
  if ((fd = open(".", O_RDONLY | 0, 0)) == -1)
    return (sp->fts_child = NULL);
  sp->fts_child = fts_build(sp, instr);
  if (fchdir(fd)) {
    (void)close(fd);
    return (NULL);
  }
  (void)close(fd);
  return (sp->fts_child);
}


x86 assembly (clang, -O0):
<fts_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <_DIAGASSERT@plt>
cmpl   $0x0,-0x14(%rbp)
je     11be <fts_children+0x5e>
mov    -0x14(%rbp),%eax
mov    0x2e23(%rip),%rcx
cmp    (%rcx),%eax
je     11be <fts_children+0x5e>
mov    0x2e04(%rip),%rax
mov    (%rax),%rcx
mov    0x2e1a(%rip),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2df7(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2dbb(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11fd <fts_children+0x9d>
movq   $0x0,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x2da5(%rip),%rcx
cmp    (%rcx),%rax
jne    1225 <fts_children+0xc5>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x2da5(%rip),%rcx
cmp    (%rcx),%rax
je     1249 <fts_children+0xe9>
movq   $0x0,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1265 <fts_children+0x105>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <fts_lfree@plt>
mov    -0x14(%rbp),%eax
mov    0x2d49(%rip),%rcx
cmp    (%rcx),%eax
jne    1294 <fts_children+0x134>
mov    0x2d3a(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x2,-0x14(%rbp)
jmp    129b <fts_children+0x13b>
movl   $0x1,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d3e(%rip),%rcx
cmp    (%rcx),%rax
jne    12df <fts_children+0x17f>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     12df <fts_children+0x17f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2cec(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12fc <fts_children+0x19c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <fts_build@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,0x8(%rcx)
mov    %rax,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    0x2cdd(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
lea    0xcf1(%rip),%rdi
xor    %edx,%edx
call   1070 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    133b <fts_children+0x1db>
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
movq   $0x0,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <fts_build@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x24(%rbp),%edi
call   1060 <fchdir@plt>
cmp    $0x0,%rax
je     1379 <fts_children+0x219>
mov    -0x24(%rbp),%edi
call   1030 <close@plt>
movq   $0x0,-0x8(%rbp)
jmp    138d <fts_children+0x22d>
mov    -0x24(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_children>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <_DIAGASSERT@plt>
mov    0x2e37(%rip),%r14
mov    (%r14),%eax
test   %ebp,%ebp
je     11a2 <fts_children+0x42>
cmp    %ebp,%eax
je     11a2 <fts_children+0x42>
mov    0x2e15(%rip),%rax
mov    (%rax),%rax
mov    0x2e2b(%rip),%rcx
mov    %rax,(%rcx)
jmp    11c1 <fts_children+0x61>
mov    0x10(%rbx),%r15
mov    0x2e1b(%rip),%rcx
movq   $0x0,(%rcx)
mov    0x2de5(%rip),%rcx
mov    (%rcx),%ecx
test   %ecx,(%rbx)
je     11ce <fts_children+0x6e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r15),%rcx
mov    0x2dd8(%rip),%rdx
cmp    (%rdx),%rcx
jne    11e3 <fts_children+0x83>
mov    0x18(%r15),%rax
jmp    11c3 <fts_children+0x63>
mov    0x2dee(%rip),%rdx
cmp    (%rdx),%rcx
jne    11c1 <fts_children+0x61>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     1200 <fts_children+0xa0>
call   1040 <fts_lfree@plt>
mov    (%r14),%eax
mov    $0x1,%r14d
cmp    %ebp,%eax
jne    1212 <fts_children+0xb2>
or     %ebp,(%rbx)
mov    $0x2,%r14d
mov    0x8(%r15),%rax
mov    0x2dcb(%rip),%rcx
cmp    (%rcx),%rax
jne    1238 <fts_children+0xd8>
mov    0x10(%r15),%rax
cmpb   $0x2f,(%rax)
je     1238 <fts_children+0xd8>
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rbx)
je     124c <fts_children+0xec>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1080 <fts_build@plt>
mov    %rax,0x8(%rbx)
jmp    11c3 <fts_children+0x63>
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
lea    0xda4(%rip),%rdi
xor    %edx,%edx
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     129c <fts_children+0x13c>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1080 <fts_build@plt>
mov    %rax,0x8(%rbx)
mov    %ebp,%edi
call   1060 <fchdir@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1030 <close@plt>
test   %r14,%r14
jne    11c1 <fts_children+0x61>
mov    0x8(%rbx),%rax
jmp    11c3 <fts_children+0x63>
movq   $0x0,0x8(%rbx)
jmp    11c1 <fts_children+0x61>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i64, i64, i8*, %struct.TYPE_7__* }
%struct.TYPE_8__ = type { i32, %struct.TYPE_7__*, %struct.TYPE_7__* }
@FTS_NAMEONLY = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@FTS_STOP = global i32 0
@FTS_INIT = global i64 0
@FTS_D = global i64 0
@FTS_ROOTLEVEL = global i64 0
@FTS_NOCHDIR = global i32 0
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define %struct.TYPE_7__* @fts_children(%struct.TYPE_8__* %0, i32 %1) {
%3 = alloca %struct.TYPE_7__*
%4 = alloca %struct.TYPE_8__*
%5 = alloca i32
%6 = alloca %struct.TYPE_7__*
%7 = alloca i32
store %struct.TYPE_8__* %0, %struct.TYPE_8__** %4
store i32 %1, i32* %5
%8 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%9 = icmp ne %struct.TYPE_8__* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @_DIAGASSERT(i32 %10)
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* @FTS_NAMEONLY
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i64, i64* @EINVAL
store i64 %19, i64* @errno
store %struct.TYPE_7__* null, %struct.TYPE_7__** %3
br label %124
20: ; preds = %14, %2
%21 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%22 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %21, i32 0, i32 2
%23 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
store %struct.TYPE_7__* %23, %struct.TYPE_7__** %6
store i64 0, i64* @errno
%24 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%25 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %24, i32 0, i32 0
%26 = load i32, i32* %25
%27 = load i32, i32* @FTS_STOP
%28 = and i32 %26, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %20
store %struct.TYPE_7__* null, %struct.TYPE_7__** %3
br label %124
31: ; preds = %20
%32 = load %struct.TYPE_7__*, %struct.TYPE_7__** %6
%33 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %32, i32 0, i32 0
%34 = load i64, i64* %33
%35 = load i64, i64* @FTS_INIT
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %41
37: ; preds = %31
%38 = load %struct.TYPE_7__*, %struct.TYPE_7__** %6
%39 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %38, i32 0, i32 3
%40 = load %struct.TYPE_7__*, %struct.TYPE_7__** %39
store %struct.TYPE_7__* %40, %struct.TYPE_7__** %3
br label %124
41: ; preds = %31
%42 = load %struct.TYPE_7__*, %struct.TYPE_7__** %6
%43 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %42, i32 0, i32 0
%44 = load i64, i64* %43
%45 = load i64, i64* @FTS_D
%46 = icmp ne i64 %44, %45
br i1 %46, label %47, label %48
47: ; preds = %41
store %struct.TYPE_7__* null, %struct.TYPE_7__** %3
br label %124
48: ; preds = %41
%49 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%50 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %49, i32 0, i32 1
%51 = load %struct.TYPE_7__*, %struct.TYPE_7__** %50
%52 = icmp ne %struct.TYPE_7__* %51, null
br i1 %52, label %53, label %58
53: ; preds = %48
%54 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%55 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %54, i32 0, i32 1
%56 = load %struct.TYPE_7__*, %struct.TYPE_7__** %55
%57 = call i32 @fts_lfree(%struct.TYPE_7__* %56)
br label %58
58: ; preds = %53, %48
%59 = load i32, i32* %5
%60 = load i32, i32* @FTS_NAMEONLY
%61 = icmp eq i32 %59, %60
br i1 %61, label %62, label %68
62: ; preds = %58
%63 = load i32, i32* @FTS_NAMEONLY
%64 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%65 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %64, i32 0, i32 0
%66 = load i32, i32* %65
%67 = or i32 %66, %63
store i32 %67, i32* %65
store i32 2, i32* %5
br label %69
68: ; preds = %58
store i32 1, i32* %5
br label %69
69: ; preds = %68, %62
%70 = load %struct.TYPE_7__*, %struct.TYPE_7__** %6
%71 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %70, i32 0, i32 1
%72 = load i64, i64* %71
%73 = load i64, i64* @FTS_ROOTLEVEL
%74 = icmp ne i64 %72, %73
br i1 %74, label %90, label %75
75: ; preds = %69
%76 = load %struct.TYPE_7__*, %struct.TYPE_7__** %6
%77 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %76, i32 0, i32 2
%78 = load i8*, i8** %77
%79 = getelementptr inbounds i8, i8* %78, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 47
br i1 %82, label %90, label %83
83: ; preds = %75
%84 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%85 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %84, i32 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* @FTS_NOCHDIR
%88 = and i32 %86, %87
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %97
90: ; preds = %83, %75, %69
%91 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%92 = load i32, i32* %5
%93 = call i8* @fts_build(%struct.TYPE_8__* %91, i32 %92)
%94 = bitcast i8* %93 to %struct.TYPE_7__*
%95 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%96 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %95, i32 0, i32 1
store %struct.TYPE_7__* %94, %struct.TYPE_7__** %96
store %struct.TYPE_7__* %94, %struct.TYPE_7__** %3
br label %124
97: ; preds = %83
%98 = load i32, i32* @O_RDONLY
%99 = or i32 %98, 0
%100 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %99, i32 0)
store i32 %100, i32* %7
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %105
102: ; preds = %97
%103 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%104 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %103, i32 0, i32 1
store %struct.TYPE_7__* null, %struct.TYPE_7__** %104
store %struct.TYPE_7__* null, %struct.TYPE_7__** %3
br label %124
105: ; preds = %97
%106 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%107 = load i32, i32* %5
%108 = call i8* @fts_build(%struct.TYPE_8__* %106, i32 %107)
%109 = bitcast i8* %108 to %struct.TYPE_7__*
%110 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%111 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %110, i32 0, i32 1
store %struct.TYPE_7__* %109, %struct.TYPE_7__** %111
%112 = load i32, i32* %7
%113 = call i64 @fchdir(i32 %112)
%114 = icmp ne i64 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %105
%116 = load i32, i32* %7
%117 = call i32 @close(i32 %116)
store %struct.TYPE_7__* null, %struct.TYPE_7__** %3
br label %124
118: ; preds = %105
%119 = load i32, i32* %7
%120 = call i32 @close(i32 %119)
%121 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%122 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %121, i32 0, i32 1
%123 = load %struct.TYPE_7__*, %struct.TYPE_7__** %122
store %struct.TYPE_7__* %123, %struct.TYPE_7__** %3
br label %124
124: ; preds = %118, %115, %102, %90, %47, %37, %30, %18
%125 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
ret %struct.TYPE_7__* %125
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i64, i64, i8*, %struct.TYPE_7__* }
%struct.TYPE_8__ = type { i32, %struct.TYPE_7__*, %struct.TYPE_7__* }
@FTS_NAMEONLY = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@FTS_STOP = global i32 0
@FTS_INIT = global i64 0
@FTS_D = global i64 0
@FTS_ROOTLEVEL = global i64 0
@FTS_NOCHDIR = global i32 0
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define %struct.TYPE_7__* @fts_children(%struct.TYPE_8__* %0, i32 %1) {
%3 = icmp ne %struct.TYPE_8__* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @_DIAGASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* @FTS_NAMEONLY
%8 = icmp eq i32 %7, %1
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i64, i64* @EINVAL
store i64 %11, i64* @errno
br label %77
12: ; preds = %2
%13 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 2
%14 = load %struct.TYPE_7__*, %struct.TYPE_7__** %13
store i64 0, i64* @errno
%15 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* @FTS_STOP
%18 = and i32 %17, %16
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %77
20: ; preds = %12
%21 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i64 0, i32 0
%22 = load i64, i64* %21
%23 = load i64, i64* @FTS_INIT
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i64 0, i32 3
%27 = load %struct.TYPE_7__*, %struct.TYPE_7__** %26
br label %77
28: ; preds = %20
%29 = load i64, i64* @FTS_D
%30 = icmp eq i64 %22, %29
br i1 %30, label %31, label %77
31: ; preds = %28
%32 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 1
%33 = load %struct.TYPE_7__*, %struct.TYPE_7__** %32
%34 = icmp eq %struct.TYPE_7__* %33, null
br i1 %34, label %38, label %35
35: ; preds = %31
%36 = tail call i32 @fts_lfree(%struct.TYPE_7__* %33)
%37 = load i32, i32* @FTS_NAMEONLY
br label %38
38: ; preds = %35, %31
%39 = phi i32 [ %37, %35 ], [ %7, %31 ]
%40 = icmp eq i32 %39, %1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %15
%43 = or i32 %42, %1
store i32 %43, i32* %15
br label %44
44: ; preds = %38, %41
%45 = phi i32 [ 2, %41 ], [ 1, %38 ]
%46 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i64 0, i32 1
%47 = load i64, i64* %46
%48 = load i64, i64* @FTS_ROOTLEVEL
%49 = icmp eq i64 %47, %48
br i1 %49, label %50, label %60
50: ; preds = %44
%51 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i64 0, i32 2
%52 = load i8*, i8** %51
%53 = load i8, i8* %52
%54 = icmp eq i8 %53, 47
br i1 %54, label %60, label %55
55: ; preds = %50
%56 = load i32, i32* %15
%57 = load i32, i32* @FTS_NOCHDIR
%58 = and i32 %57, %56
%59 = icmp eq i32 %58, 0
br i1 %59, label %64, label %60
60: ; preds = %55, %50, %44
%61 = tail call i8* @fts_build(%struct.TYPE_8__* %0, i32 %45)
%62 = bitcast i8* %61 to %struct.TYPE_7__*
%63 = bitcast %struct.TYPE_7__** %32 to i8**
store i8* %61, i8** %63
br label %77
64: ; preds = %55
%65 = load i32, i32* @O_RDONLY
%66 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %65, i32 0)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %69
68: ; preds = %64
store %struct.TYPE_7__* null, %struct.TYPE_7__** %32
br label %77
69: ; preds = %64
%70 = tail call i8* @fts_build(%struct.TYPE_8__* %0, i32 %45)
%71 = bitcast %struct.TYPE_7__** %32 to i8**
store i8* %70, i8** %71
%72 = tail call i64 @fchdir(i32 %66)
%73 = icmp eq i64 %72, 0
%74 = tail call i32 @close(i32 %66)
br i1 %73, label %75, label %77
75: ; preds = %69
%76 = load %struct.TYPE_7__*, %struct.TYPE_7__** %32
br label %77
77: ; preds = %69, %28, %12, %75, %68, %60, %25, %10
%78 = phi %struct.TYPE_7__* [ null, %10 ], [ %27, %25 ], [ %62, %60 ], [ null, %68 ], [ %76, %75 ], [ null, %12 ], [ null, %28 ], [ null, %69 ]
ret %struct.TYPE_7__* %78
}