#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 */

/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
  scalar_t__ st_size;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ closedir(int /*<<< orphan*/ *);
scalar_t__ errno;
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int printFiles(char *directoryName, int indent, char *fileName) {
  DIR *directory = opendir(directoryName);
  struct dirent *currentFile;
  struct stat statp;
  char fileNameString[1024];
  if (directory == NULL) {
    perror("failed to open directory");
    return -1;
  }
  while ((currentFile = readdir(directory))) {
    if (!(strcmp(currentFile->d_name, ".") &&
          strcmp(currentFile->d_name, ".."))) {
      continue;
    }
    strcpy(fileNameString, directoryName);
    strcat(fileNameString, "/");
    strcat(fileNameString, currentFile->d_name);
    if (stat(fileNameString, &statp)) {
      perror("stat failed");
      return -1;
    }
    if (S_ISREG(statp.st_mode)) {
      int i;
      for (i = 0; i < indent; i++) {
        printf("    ");
      }
      printf("%s (%d bytes)\n", currentFile->d_name, (int)statp.st_size);
    } else if (!S_ISREG(statp.st_mode)) {
      int i;
      for (i = 0; i < indent; i++) {
        printf("    ");
      }
      printf("%s (subdirectory)\n", currentFile->d_name);
      printFiles(fileNameString, indent + 1, fileName);
    }
  }
  if (errno != 0) {
    perror("readdir failed");
    return -1;
  }
  if (closedir(directory)) {
    perror("closedir failed");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<printFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11f6 <printFiles+0x46>
lea    0xe1b(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <printFiles+0x253>
jmp    11fb <printFiles+0x4b>
mov    -0x28(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     13a8 <printFiles+0x1f8>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xdfa(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     124c <printFiles+0x9c>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xddc(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1251 <printFiles+0xa1>
jmp    11fb <printFiles+0x4b>
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x440(%rbp),%rdi
lea    0xdad(%rip),%rsi
call   10d0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10d0 <strcat@plt>
lea    -0x440(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <stat@plt>
cmp    $0x0,%rax
je     12b9 <printFiles+0x109>
lea    0xd76(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <printFiles+0x253>
mov    -0x40(%rbp),%edi
call   10a0 <S_ISREG@plt>
cmp    $0x0,%rax
je     1326 <printFiles+0x176>
movl   $0x0,-0x444(%rbp)
mov    -0x444(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1306 <printFiles+0x156>
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x444(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x444(%rbp)
jmp    12d5 <printFiles+0x125>
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13a3 <printFiles+0x1f3>
mov    -0x40(%rbp),%edi
call   10a0 <S_ISREG@plt>
cmp    $0x0,%rax
jne    139e <printFiles+0x1ee>
movl   $0x0,-0x448(%rbp)
mov    -0x448(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1373 <printFiles+0x1c3>
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x448(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x448(%rbp)
jmp    1342 <printFiles+0x192>
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x440(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%rdx
call   1060 <printFiles@plt>
jmp    13a3 <printFiles+0x1f3>
jmp    11fb <printFiles+0x4b>
mov    0x2c31(%rip),%rax
cmpq   $0x0,(%rax)
je     13d1 <printFiles+0x221>
lea    0xc91(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <printFiles+0x253>
mov    -0x28(%rbp),%rdi
call   1070 <closedir@plt>
cmp    $0x0,%rax
je     13fc <printFiles+0x24c>
lea    0xc75(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <printFiles+0x253>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFiles>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    %rdx,0x10(%rsp)
mov    %rsi,(%rsp)
mov    %rdi,0x18(%rsp)
call   1040 <opendir@plt>
test   %rax,%rax
je     138a <printFiles+0x1da>
mov    %rax,%r14
mov    %rax,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     1359 <printFiles+0x1a9>
mov    %rax,%r12
mov    (%rsp),%rax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
lea    0xe14(%rip),%rbp
lea    0xe0c(%rip),%r15
lea    0xe16(%rip),%r13
jmp    1258 <printFiles+0xa8>
cs nopw 0x0(%rax,%rax,1)
mov    (%r12),%rsi
mov    0x28(%rsp),%edx
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddd(%rip),%rbp
lea    0xdd5(%rip),%r15
mov    %r14,%rdi
call   10b0 <readdir@plt>
mov    %rax,%r12
test   %rax,%rax
je     1359 <printFiles+0x1a9>
mov    (%r12),%rdi
mov    %rbp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1244 <printFiles+0x94>
mov    (%r12),%rdi
mov    %r15,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1244 <printFiles+0x94>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
lea    0xd86(%rip),%rsi
call   10d0 <strcat@plt>
mov    (%r12),%rsi
mov    %rbx,%rdi
call   10d0 <strcat@plt>
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
call   1090 <stat@plt>
test   %rax,%rax
jne    13a5 <printFiles+0x1f5>
mov    0x20(%rsp),%edi
call   10a0 <S_ISREG@plt>
test   %rax,%rax
je     12f5 <printFiles+0x145>
cmpl   $0x0,(%rsp)
jle    1220 <printFiles+0x70>
mov    (%rsp),%rax
mov    %eax,%r15d
nopl   0x0(%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%r15d
jne    12e0 <printFiles+0x130>
jmp    1220 <printFiles+0x70>
mov    0x20(%rsp),%edi
call   10a0 <S_ISREG@plt>
test   %rax,%rax
jne    1244 <printFiles+0x94>
mov    (%rsp),%rax
test   %eax,%eax
jle    132f <printFiles+0x17f>
mov    %rax,%rcx
mov    %ecx,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1320 <printFiles+0x170>
mov    (%r12),%rsi
lea    0xd04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x30(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%rdx
call   1060 <printFiles@plt>
jmp    1236 <printFiles+0x86>
mov    0x2c80(%rip),%rax
cmpq   $0x0,(%rax)
jne    1393 <printFiles+0x1e3>
mov    %r14,%rdi
call   1070 <closedir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    139c <printFiles+0x1ec>
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc6f(%rip),%rdi
jmp    13ac <printFiles+0x1fc>
lea    0xcb7(%rip),%rdi
jmp    13ac <printFiles+0x1fc>
lea    0xcbd(%rip),%rdi
jmp    13ac <printFiles+0x1fc>
lea    0xc72(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%eax
jmp    1378 <printFiles+0x1c8>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32, i64 }
@.str = [25 x i8] c"failed to open directory\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [12 x i8] c"stat failed\00"
@.str.5 = [5 x i8] c" \00"
@.str.6 = [15 x i8] c"%s (%d bytes)\0A\00"
@.str.7 = [19 x i8] c"%s (subdirectory)\0A\00"
@errno = global i64 0
@.str.8 = [15 x i8] c"readdir failed\00"
@.str.9 = [16 x i8] c"closedir failed\00"
define i32 @printFiles(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca %struct.dirent*
%10 = alloca %struct.stat
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%14 = load i8*, i8** %5
%15 = call i32* @opendir(i8* %14)
store i32* %15, i32** %8
%16 = load i32*, i32** %8
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %116
20: ; preds = %3
br label %21
21: ; preds = %103, %37, %20
%22 = load i32*, i32** %8
%23 = call %struct.dirent* @readdir(i32* %22)
store %struct.dirent* %23, %struct.dirent** %9
%24 = icmp ne %struct.dirent* %23, null
br i1 %24, label %25, label %104
25: ; preds = %21
%26 = load %struct.dirent*, %struct.dirent** %9
%27 = getelementptr inbounds %struct.dirent, %struct.dirent* %26, i32 0, i32 0
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %25
%32 = load %struct.dirent*, %struct.dirent** %9
%33 = getelementptr inbounds %struct.dirent, %struct.dirent* %32, i32 0, i32 0
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp ne i64 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %31, %25
br label %21
38: ; preds = %31
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%40 = load i8*, i8** %5
%41 = call i32 @strcpy(i8* %39, i8* %40)
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%43 = call i32 @strcat(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%45 = load %struct.dirent*, %struct.dirent** %9
%46 = getelementptr inbounds %struct.dirent, %struct.dirent* %45, i32 0, i32 0
%47 = load i8*, i8** %46
%48 = call i32 @strcat(i8* %44, i8* %47)
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%50 = call i64 @stat(i8* %49, %struct.stat* %10)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %38
%53 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %4
br label %116
54: ; preds = %38
%55 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%56 = load i32, i32* %55
%57 = call i64 @S_ISREG(i32 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %77
59: ; preds = %54
store i32 0, i32* %12
br label %60
60: ; preds = %66, %59
%61 = load i32, i32* %12
%62 = load i32, i32* %6
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %69
64: ; preds = %60
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %66
66: ; preds = %64
%67 = load i32, i32* %12
%68 = add nsw i32 %67, 1
store i32 %68, i32* %12
br label %60
69: ; preds = %60
%70 = load %struct.dirent*, %struct.dirent** %9
%71 = getelementptr inbounds %struct.dirent, %struct.dirent* %70, i32 0, i32 0
%72 = load i8*, i8** %71
%73 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%74 = load i64, i64* %73
%75 = trunc i64 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %72, i32 %75)
br label %103
77: ; preds = %54
%78 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%79 = load i32, i32* %78
%80 = call i64 @S_ISREG(i32 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %102, label %82
82: ; preds = %77
store i32 0, i32* %13
br label %83
83: ; preds = %89, %82
%84 = load i32, i32* %13
%85 = load i32, i32* %6
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %92
87: ; preds = %83
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %89
89: ; preds = %87
%90 = load i32, i32* %13
%91 = add nsw i32 %90, 1
store i32 %91, i32* %13
br label %83
92: ; preds = %83
%93 = load %struct.dirent*, %struct.dirent** %9
%94 = getelementptr inbounds %struct.dirent, %struct.dirent* %93, i32 0, i32 0
%95 = load i8*, i8** %94
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%98 = load i32, i32* %6
%99 = add nsw i32 %98, 1
%100 = load i8*, i8** %7
%101 = call i32 @printFiles(i8* %97, i32 %99, i8* %100)
br label %102
102: ; preds = %92, %77
br label %103
103: ; preds = %102, %69
br label %21
104: ; preds = %21
%105 = load i64, i64* @errno
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %104
%108 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %4
br label %116
109: ; preds = %104
%110 = load i32*, i32** %8
%111 = call i64 @closedir(i32* %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %109
%114 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %4
br label %116
115: ; preds = %109
store i32 0, i32* %4
br label %116
116: ; preds = %115, %113, %107, %52, %18
%117 = load i32, i32* %4
ret i32 %117
}

LLVM IR (-O2):
%struct.stat = type { i32, i64 }
%struct.dirent = type { i8* }
@.str = [25 x i8] c"failed to open directory\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [12 x i8] c"stat failed\00"
@.str.5 = [5 x i8] c" \00"
@.str.6 = [15 x i8] c"%s (%d bytes)\0A\00"
@.str.7 = [19 x i8] c"%s (subdirectory)\0A\00"
@errno = global i64 0
@.str.8 = [15 x i8] c"readdir failed\00"
@.str.9 = [16 x i8] c"closedir failed\00"
define i32 @printFiles(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = alloca %struct.stat
%5 = alloca [1024 x i8]
%6 = tail call i32* @opendir(i8* %0)
%7 = bitcast %struct.stat* %4 to i8*
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32* %6, null
br i1 %9, label %18, label %10
10: ; preds = %3
%11 = call %struct.dirent* @readdir(i32* %6)
%12 = icmp eq %struct.dirent* %11, null
br i1 %12, label %71, label %13
13: ; preds = %10
%14 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%15 = icmp sgt i32 %1, 0
%16 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%17 = add nsw i32 %1, 1
br label %20
18: ; preds = %3
%19 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %81
20: ; preds = %13, %30
%21 = phi %struct.dirent* [ %11, %13 ], [ %31, %30 ]
%22 = getelementptr inbounds %struct.dirent, %struct.dirent* %21, i64 0, i32 0
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %20
%27 = load i8*, i8** %22
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %52, %67, %57, %20, %26
%31 = call %struct.dirent* @readdir(i32* %6)
%32 = icmp eq %struct.dirent* %31, null
br i1 %32, label %71, label %20
33: ; preds = %26
%34 = call i32 @strcpy(i8* %8, i8* %0)
%35 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = load i8*, i8** %22
%37 = call i32 @strcat(i8* %8, i8* %36)
%38 = call i64 @stat(i8* %8, %struct.stat* %4)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %33
%41 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %81
42: ; preds = %33
%43 = load i32, i32* %14
%44 = call i64 @S_ISREG(i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %57, label %46
46: ; preds = %42
br i1 %15, label %47, label %52
47: ; preds = %46, %47
%48 = phi i32 [ %50, %47 ], [ 0, %46 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%50 = add nuw nsw i32 %48, 1
%51 = icmp eq i32 %50, %1
br i1 %51, label %52, label %47
52: ; preds = %47, %46
%53 = load i8*, i8** %22
%54 = load i64, i64* %16
%55 = trunc i64 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %53, i32 %55)
br label %30
57: ; preds = %42
%58 = load i32, i32* %14
%59 = call i64 @S_ISREG(i32 %58)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %30
61: ; preds = %57
br i1 %15, label %62, label %67
62: ; preds = %61, %62
%63 = phi i32 [ %65, %62 ], [ 0, %61 ]
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%65 = add nuw nsw i32 %63, 1
%66 = icmp eq i32 %65, %1
br i1 %66, label %67, label %62
67: ; preds = %62, %61
%68 = load i8*, i8** %22
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %68)
%70 = call i32 @printFiles(i8* %8, i32 %17, i8* %2)
br label %30
71: ; preds = %30, %10
%72 = load i64, i64* @errno
%73 = icmp eq i64 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %71
%75 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %81
76: ; preds = %71
%77 = call i64 @closedir(i32* %6)
%78 = icmp eq i64 %77, 0
br i1 %78, label %81, label %79
79: ; preds = %76
%80 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %81
81: ; preds = %76, %79, %74, %40, %18
%82 = phi i32 [ -1, %18 ], [ -1, %40 ], [ -1, %74 ], [ -1, %79 ], [ 0, %76 ]
ret i32 %82
}