#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 dirent {
  char *d_name;
};
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ WEXITSTATUS(int);
int /*<<< orphan*/ chdir(char const *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
scalar_t__ isDirectory(char *);
scalar_t__ isTextFile(char *);
int /*<<< orphan*/ *opendir(char const *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ searchInFile(char *, char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(int /*<<< orphan*/);
int wait(int *);
int searchInDirectory(const char *pathName, const char *string, FILE *logFile) {
  DIR *dirp = NULL;
  struct dirent *direntp = NULL;
  pid_t childpid = 0;
  pid_t waitedChild = 0;
  char cwd[255];
  char direntName[255];
  int childStatus = 0;
  int totalOccurence = 0;
  int waitReturn = 0;
  if ((dirp = opendir(pathName)) == NULL) {
    fprintf(stderr, "Failed to open %s. Error: %s\n", pathName,
            strerror(errno));
    return -1;
  }
  chdir(pathName);
  while ((direntp = readdir(dirp)) != NULL) {
    if (strcmp(direntp->d_name, "..") != 0 && strcmp(direntp->d_name, ".")) {
      if (isTextFile(direntp->d_name) || isDirectory(direntp->d_name)) {
        childpid = fork();
        if (childpid <= 0) {
          strcpy(direntName, direntp->d_name);
          closedir(dirp);
          break;
        }
      }
    }
  }
  if (childpid > 0) {
    while ((waitReturn = wait(&childStatus)) != -1)
      totalOccurence += WEXITSTATUS(childStatus);
  }
  if (childpid == 0) {
    if (isTextFile(direntName))
      totalOccurence += searchInFile(direntName, string, logFile);
    else if (isDirectory(direntName))
      totalOccurence += searchInDirectory(direntName, string, logFile);
    dirp = NULL;
    direntp = NULL;
    exit(totalOccurence);
  }
  closedir(dirp);
  dirp = NULL;
  direntp = NULL;
  return totalOccurence;
}


x86 assembly (clang, -O0):
<searchInDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x244(%rbp)
movl   $0x0,-0x248(%rbp)
movl   $0x0,-0x24c(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    12bc <searchInDirectory+0xbc>
mov    0x2d6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x25c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x258(%rbp)
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x25c(%rbp),%edi
mov    -0x258(%rbp),%rdx
mov    %rax,%rcx
lea    0xd55(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <searchInDirectory+0x2a0>
mov    -0x10(%rbp),%rdi
call   1070 <chdir@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     1388 <searchInDirectory+0x188>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xd34(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1383 <searchInDirectory+0x183>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xd18(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1383 <searchInDirectory+0x183>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
call   1040 <isTextFile@plt>
cmp    $0x0,%rax
jne    1342 <searchInDirectory+0x142>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
call   1050 <isDirectory@plt>
cmp    $0x0,%rax
je     137e <searchInDirectory+0x17e>
mov    $0x0,%al
call   1120 <fork@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jg     1379 <searchInDirectory+0x179>
lea    -0x240(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1080 <closedir@plt>
jmp    1388 <searchInDirectory+0x188>
jmp    137e <searchInDirectory+0x17e>
jmp    1383 <searchInDirectory+0x183>
jmp    12c5 <searchInDirectory+0xc5>
cmpq   $0x0,-0x38(%rbp)
jle    13db <searchInDirectory+0x1db>
jmp    1398 <searchInDirectory+0x198>
lea    -0x244(%rbp),%rdi
call   1100 <wait@plt>
mov    %eax,-0x24c(%rbp)
cmp    $0xffffffff,%eax
je     13d6 <searchInDirectory+0x1d6>
mov    -0x244(%rbp),%edi
call   10d0 <WEXITSTATUS@plt>
mov    %rax,%rcx
movslq -0x248(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x248(%rbp)
jmp    1398 <searchInDirectory+0x198>
jmp    13db <searchInDirectory+0x1db>
cmpq   $0x0,-0x38(%rbp)
jne    147e <searchInDirectory+0x27e>
lea    -0x240(%rbp),%rdi
call   1040 <isTextFile@plt>
cmp    $0x0,%rax
je     1428 <searchInDirectory+0x228>
lea    -0x240(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1110 <searchInFile@plt>
mov    %rax,%rcx
movslq -0x248(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x248(%rbp)
jmp    1463 <searchInDirectory+0x263>
lea    -0x240(%rbp),%rdi
call   1050 <isDirectory@plt>
cmp    $0x0,%rax
je     145e <searchInDirectory+0x25e>
lea    -0x240(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   10c0 <searchInDirectory@plt>
add    -0x248(%rbp),%eax
mov    %eax,-0x248(%rbp)
jmp    1463 <searchInDirectory+0x263>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x248(%rbp),%edi
call   10e0 <exit@plt>
mov    -0x28(%rbp),%rdi
call   1080 <closedir@plt>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x248(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchInDirectory>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rdx,%rbp
mov    %rsi,%r15
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
call   1060 <opendir@plt>
test   %rax,%rax
je     130a <searchInDirectory+0x10a>
mov    %rax,%r12
mov    %rbp,0x8(%rsp)
mov    %rbx,%rdi
call   1070 <chdir@plt>
mov    %r12,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     1374 <searchInDirectory+0x174>
mov    %rax,%r14
lea    0xdc3(%rip),%r13
lea    0xdbd(%rip),%rbp
xor    %ebx,%ebx
jmp    1293 <searchInDirectory+0x93>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1120 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
jle    133c <searchInDirectory+0x13c>
mov    %r12,%rdi
call   10b0 <readdir@plt>
mov    %rax,%r14
test   %rax,%rax
je     12cf <searchInDirectory+0xcf>
mov    (%r14),%rdi
mov    %r13,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1283 <searchInDirectory+0x83>
mov    (%r14),%rdi
mov    %rbp,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1283 <searchInDirectory+0x83>
mov    (%r14),%rdi
call   1040 <isTextFile@plt>
test   %rax,%rax
jne    1270 <searchInDirectory+0x70>
mov    (%r14),%rdi
call   1050 <isDirectory@plt>
test   %rax,%rax
jne    1270 <searchInDirectory+0x70>
jmp    1283 <searchInDirectory+0x83>
test   %rbx,%rbx
jle    1351 <searchInDirectory+0x151>
lea    0x4(%rsp),%rdi
call   1100 <wait@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
je     1358 <searchInDirectory+0x158>
lea    0x4(%rsp),%rbx
xchg   %ax,%ax
mov    0x4(%rsp),%edi
call   10d0 <WEXITSTATUS@plt>
add    %eax,%ebp
mov    %rbx,%rdi
call   1100 <wait@plt>
cmp    $0xffffffff,%eax
jne    12f0 <searchInDirectory+0xf0>
jmp    1358 <searchInDirectory+0x158>
mov    0x2ccf(%rip),%rax
mov    (%rax),%ebp
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xcd8(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   10a0 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    1360 <searchInDirectory+0x160>
mov    (%r14),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1080 <closedir@plt>
xor    %ebp,%ebp
test   %rbx,%rbx
je     1374 <searchInDirectory+0x174>
mov    %r12,%rdi
call   1080 <closedir@plt>
mov    %ebp,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10(%rsp),%rdi
call   1040 <isTextFile@plt>
lea    0x10(%rsp),%rdi
test   %rax,%rax
jne    13aa <searchInDirectory+0x1aa>
call   1050 <isDirectory@plt>
xor    %edi,%edi
test   %rax,%rax
je     13be <searchInDirectory+0x1be>
lea    0x10(%rsp),%rdi
mov    %r15,%rsi
mov    0x8(%rsp),%rdx
call   10c0 <searchInDirectory@plt>
xor    %edi,%edi
jmp    13bc <searchInDirectory+0x1bc>
mov    %r15,%rsi
mov    0x8(%rsp),%rdx
call   1110 <searchInFile@plt>
mov    %rax,%rdi
xor    %eax,%eax
add    %eax,%edi
call   10e0 <exit@plt>

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

LLVM IR (-O2):
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [30 x i8] c"Failed to open %s. Error: %s\0A\00"
@errno = global i32 0
@.str.1 = [3 x i8] c"..\00"
@.str.2 = [2 x i8] c".\00"
define i32 @searchInDirectory(i8* %0, i8* %1, i32* %2) {
%4 = alloca [255 x i8]
%5 = alloca i32
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%8 = tail call i32* @opendir(i8* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %13)
br label %86
15: ; preds = %3
%16 = tail call i32 @chdir(i8* %0)
%17 = tail call %struct.dirent* @readdir(i32* %8)
%18 = icmp eq %struct.dirent* %17, null
br i1 %18, label %65, label %19
19: ; preds = %15, %45
%20 = phi %struct.dirent* [ %47, %45 ], [ %17, %15 ]
%21 = phi i64 [ %46, %45 ], [ 0, %15 ]
%22 = getelementptr inbounds %struct.dirent, %struct.dirent* %20, i64 0, i32 0
%23 = load i8*, i8** %22
%24 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %45, label %26
26: ; preds = %19
%27 = load i8*, i8** %22
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %45, label %30
30: ; preds = %26
%31 = load i8*, i8** %22
%32 = tail call i64 @isTextFile(i8* %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i8*, i8** %22
%36 = tail call i64 @isDirectory(i8* %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %45, label %38
38: ; preds = %34, %30
%39 = tail call i64 (...) @fork()
%40 = icmp slt i64 %39, 1
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = load i8*, i8** %22
%43 = call i32 @strcpy(i8* %6, i8* %42)
%44 = call i32 @closedir(i32* %8)
br label %62
45: ; preds = %34, %38, %26, %19
%46 = phi i64 [ %39, %38 ], [ %21, %34 ], [ %21, %26 ], [ %21, %19 ]
%47 = tail call %struct.dirent* @readdir(i32* %8)
%48 = icmp eq %struct.dirent* %47, null
br i1 %48, label %49, label %19
49: ; preds = %45
%50 = icmp sgt i64 %46, 0
br i1 %50, label %51, label %62
51: ; preds = %49
%52 = call i32 @wait(i32* %5)
%53 = icmp eq i32 %52, -1
br i1 %53, label %83, label %54
54: ; preds = %51, %54
%55 = phi i32 [ %59, %54 ], [ 0, %51 ]
%56 = load i32, i32* %5
%57 = call i64 @WEXITSTATUS(i32 %56)
%58 = trunc i64 %57 to i32
%59 = add i32 %55, %58
%60 = call i32 @wait(i32* %5)
%61 = icmp eq i32 %60, -1
br i1 %61, label %83, label %54
62: ; preds = %41, %49
%63 = phi i64 [ %46, %49 ], [ %39, %41 ]
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %83
65: ; preds = %15, %62
%66 = call i64 @isTextFile(i8* %6)
%67 = icmp eq i64 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %65
%69 = call i64 @searchInFile(i8* %6, i8* %1, i32* %2)
%70 = trunc i64 %69 to i32
br label %76
71: ; preds = %65
%72 = call i64 @isDirectory(i8* %6)
%73 = icmp eq i64 %72, 0
br i1 %73, label %80, label %74
74: ; preds = %71
%75 = call i32 @searchInDirectory(i8* %6, i8* %1, i32* %2)
br label %76
76: ; preds = %68, %74
%77 = phi i32 [ 0, %74 ], [ %70, %68 ]
%78 = phi i32 [ %75, %74 ], [ 0, %68 ]
%79 = add nuw nsw i32 %78, %77
br label %80
80: ; preds = %76, %71
%81 = phi i32 [ 0, %71 ], [ %79, %76 ]
%82 = call i32 @exit(i32 %81)
unreachable
83: ; preds = %54, %51, %62
%84 = phi i32 [ 0, %62 ], [ 0, %51 ], [ %59, %54 ]
%85 = call i32 @closedir(i32* %8)
br label %86
86: ; preds = %83, %10
%87 = phi i32 [ -1, %10 ], [ %84, %83 ]
ret i32 %87
}