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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
void *MAP_FAILED;
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ dirfd(int /*<<< orphan*/ *);
int /*<<< orphan*/ fchdir(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int fstat(int, struct stat *);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
void *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *strstr(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    fprintf(stderr, "usage: %s EXPR PATH\n", argv[0]);
    return EXIT_FAILURE;
  }
  char *expr = argv[1];
  char *path = argv[2];
  int found = 0;
  int fd;
  DIR *d;
  void *map;
  if ((d = opendir(path)) == NULL) {
    perror("unable to open directory");
    return EXIT_FAILURE;
  }
  fchdir(dirfd(d));
  for (struct dirent *ent = readdir(d); ent != NULL; ent = readdir(d)) {
    if ((fd = open(ent->d_name, O_RDONLY)) == -1) {
      perror("unable to open file %s");
      continue;
    }
    struct stat st;
    if (fstat(fd, &st) == -1) {
      perror("unable to retrieve information");
      close(fd);
      continue;
    }
    if (!S_ISREG(st.st_mode)) {
      close(fd);
      continue;
    }
    int seek = lseek(fd, 0, SEEK_END);
    lseek(fd, 0, SEEK_SET);
    if ((map = mmap(NULL, seek, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) {
      perror("unable to mmap");
      close(fd);
      continue;
    }
    if (strstr((char *)map, expr) != NULL) {
      printf("%s\n", ent->d_name);
      found = 1;
    }
    munmap(map, seek);
    close(fd);
  }
  closedir(d);
  if (!found)
    printf("Aucun fichier trouvé\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     124d <main+0x4d>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdc9(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1447 <main+0x247>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12a0 <main+0xa0>
lea    0xd8b(%rip),%rdi
call   1100 <perror@plt>
mov    0x2d22(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1447 <main+0x247>
mov    -0x30(%rbp),%rdi
call   1090 <dirfd@plt>
mov    %eax,%edi
call   10d0 <fchdir@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     141a <main+0x21a>
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
mov    0x2d02(%rip),%rax
mov    (%rax),%esi
call   10f0 <open@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
jne    12fa <main+0xfa>
lea    0xd3e(%rip),%rdi
call   1100 <perror@plt>
jmp    1408 <main+0x208>
mov    -0x28(%rbp),%edi
lea    -0x48(%rbp),%rsi
call   1110 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1328 <main+0x128>
lea    0xd2f(%rip),%rdi
call   1100 <perror@plt>
mov    -0x28(%rbp),%edi
call   1070 <close@plt>
jmp    1408 <main+0x208>
mov    -0x48(%rbp),%edi
call   10b0 <S_ISREG@plt>
cmp    $0x0,%eax
jne    1346 <main+0x146>
mov    -0x28(%rbp),%edi
call   1070 <close@plt>
jmp    1408 <main+0x208>
mov    -0x28(%rbp),%edi
mov    0x2c90(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x28(%rbp),%edi
mov    0x2c5a(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    -0x4c(%rbp),%esi
mov    0x2c7f(%rip),%rax
mov    (%rax),%edx
mov    0x2c26(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x38(%rbp)
mov    0x2c01(%rip),%rcx
cmp    (%rcx),%rax
jne    13c1 <main+0x1c1>
lea    0xcb5(%rip),%rdi
call   1100 <perror@plt>
mov    -0x28(%rbp),%edi
call   1070 <close@plt>
jmp    1408 <main+0x208>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     13f4 <main+0x1f4>
mov    -0x40(%rbp),%rax
mov    (%rax),%rsi
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   10e0 <munmap@plt>
mov    -0x28(%rbp),%edi
call   1070 <close@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x40(%rbp)
jmp    12bd <main+0xbd>
mov    -0x30(%rbp),%rdi
call   1080 <closedir@plt>
cmpl   $0x0,-0x24(%rbp)
jne    143b <main+0x23b>
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x3,%edi
jne    137e <main+0x17e>
mov    0x8(%rsi),%rax
mov    %rax,0x10(%rsp)
mov    0x10(%rsi),%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     13dc <main+0x1dc>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <dirfd@plt>
mov    %eax,%edi
call   10d0 <fchdir@plt>
mov    %rbx,%rdi
call   10c0 <readdir@plt>
test   %rax,%rax
je     13b0 <main+0x1b0>
mov    %rax,%rbp
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    0x2d72(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp),%rdi
mov    (%r12),%esi
call   10f0 <open@plt>
cmp    $0xffffffff,%eax
je     1354 <main+0x154>
mov    %eax,%r13d
mov    %eax,%edi
mov    %rsp,%rsi
call   1110 <fstat@plt>
cmp    $0xffffffff,%eax
je     1362 <main+0x162>
mov    (%rsp),%edi
call   10b0 <S_ISREG@plt>
test   %eax,%eax
je     1336 <main+0x136>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edx
mov    %r13d,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,%r15d
mov    0x2cf7(%rip),%rax
mov    (%rax),%edx
mov    %r13d,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edx
mov    0x2cc3(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r15d,%esi
mov    %r13d,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,%r14
mov    0x2c9f(%rip),%rax
cmp    (%rax),%r14
je     1370 <main+0x170>
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     132b <main+0x12b>
mov    0x0(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
mov    %rax,0x8(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
call   10e0 <munmap@plt>
mov    %r13d,%edi
call   1070 <close@plt>
mov    %rbx,%rdi
call   10c0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1270 <main+0x70>
jmp    139f <main+0x19f>
lea    0xcd3(%rip),%rdi
call   1100 <perror@plt>
jmp    133e <main+0x13e>
lea    0xcdc(%rip),%rdi
call   1100 <perror@plt>
jmp    1336 <main+0x136>
lea    0xced(%rip),%rdi
call   1100 <perror@plt>
jmp    1336 <main+0x136>
mov    0x2c43(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc6f(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2c1b(%rip),%rax
jmp    13cb <main+0x1cb>
mov    %rbx,%rdi
call   1080 <closedir@plt>
cmpl   $0x0,0x8(%rsp)
jne    13c4 <main+0x1c4>
jmp    13b8 <main+0x1b8>
mov    %rbx,%rdi
call   1080 <closedir@plt>
lea    0xcb4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2be5(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc32(%rip),%rdi
call   1100 <perror@plt>
jmp    1396 <main+0x196>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s EXPR PATH\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [25 x i8] c"unable to open directory\00"
@O_RDONLY = global i32 0
@.str.2 = [23 x i8] c"unable to open file %s\00"
@.str.3 = [31 x i8] c"unable to retrieve information\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.4 = [15 x i8] c"unable to mmap\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [23 x i8] c"Aucun fichier trouv\C3\A9\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca %struct.dirent*
%13 = alloca %struct.stat
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %24
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
store i32 %23, i32* %3
br label %117
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
store i8* %27, i8** %6
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
store i8* %30, i8** %7
store i32 0, i32* %8
%31 = load i8*, i8** %7
%32 = call i32* @opendir(i8* %31)
store i32* %32, i32** %10
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %37
34: ; preds = %24
%35 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
store i32 %36, i32* %3
br label %117
37: ; preds = %24
%38 = load i32*, i32** %10
%39 = call i32 @dirfd(i32* %38)
%40 = call i32 @fchdir(i32 %39)
%41 = load i32*, i32** %10
%42 = call %struct.dirent* @readdir(i32* %41)
store %struct.dirent* %42, %struct.dirent** %12
br label %43
43: ; preds = %105, %37
%44 = load %struct.dirent*, %struct.dirent** %12
%45 = icmp ne %struct.dirent* %44, null
br i1 %45, label %46, label %108
46: ; preds = %43
%47 = load %struct.dirent*, %struct.dirent** %12
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = load i32, i32* @O_RDONLY
%51 = call i32 @open(i8* %49, i32 %50)
store i32 %51, i32* %9
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %55
53: ; preds = %46
%54 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %105
55: ; preds = %46
%56 = load i32, i32* %9
%57 = call i32 @fstat(i32 %56, %struct.stat* %13)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%61 = load i32, i32* %9
%62 = call i32 @close(i32 %61)
br label %105
63: ; preds = %55
%64 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i32 @S_ISREG(i32 %65)
%67 = icmp ne i32 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %63
%69 = load i32, i32* %9
%70 = call i32 @close(i32 %69)
br label %105
71: ; preds = %63
%72 = load i32, i32* %9
%73 = load i32, i32* @SEEK_END
%74 = call i32 @lseek(i32 %72, i32 0, i32 %73)
store i32 %74, i32* %14
%75 = load i32, i32* %9
%76 = load i32, i32* @SEEK_SET
%77 = call i32 @lseek(i32 %75, i32 0, i32 %76)
%78 = load i32, i32* %14
%79 = load i32, i32* @PROT_READ
%80 = load i32, i32* @MAP_PRIVATE
%81 = load i32, i32* %9
%82 = call i8* @mmap(i32* null, i32 %78, i32 %79, i32 %80, i32 %81, i32 0)
store i8* %82, i8** %11
%83 = load i8*, i8** @MAP_FAILED
%84 = icmp eq i8* %82, %83
br i1 %84, label %85, label %89
85: ; preds = %71
%86 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%87 = load i32, i32* %9
%88 = call i32 @close(i32 %87)
br label %105
89: ; preds = %71
%90 = load i8*, i8** %11
%91 = load i8*, i8** %6
%92 = call i32* @strstr(i8* %90, i8* %91)
%93 = icmp ne i32* %92, null
br i1 %93, label %94, label %99
94: ; preds = %89
%95 = load %struct.dirent*, %struct.dirent** %12
%96 = getelementptr inbounds %struct.dirent, %struct.dirent* %95, i32 0, i32 0
%97 = load i8*, i8** %96
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %97)
store i32 1, i32* %8
br label %99
99: ; preds = %94, %89
%100 = load i8*, i8** %11
%101 = load i32, i32* %14
%102 = call i32 @munmap(i8* %100, i32 %101)
%103 = load i32, i32* %9
%104 = call i32 @close(i32 %103)
br label %105
105: ; preds = %99, %85, %68, %59, %53
%106 = load i32*, i32** %10
%107 = call %struct.dirent* @readdir(i32* %106)
store %struct.dirent* %107, %struct.dirent** %12
br label %43
108: ; preds = %43
%109 = load i32*, i32** %10
%110 = call i32 @closedir(i32* %109)
%111 = load i32, i32* %8
%112 = icmp ne i32 %111, 0
br i1 %112, label %115, label %113
113: ; preds = %108
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %115
115: ; preds = %113, %108
%116 = load i32, i32* @EXIT_SUCCESS
store i32 %116, i32* %3
br label %117
117: ; preds = %115, %34, %17
%118 = load i32, i32* %3
ret i32 %118
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s EXPR PATH\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [25 x i8] c"unable to open directory\00"
@O_RDONLY = global i32 0
@.str.2 = [23 x i8] c"unable to open file %s\00"
@.str.3 = [31 x i8] c"unable to retrieve information\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.4 = [15 x i8] c"unable to mmap\00"
@EXIT_SUCCESS = global i32 0
@str = [22 x i8] c"Aucun fichier trouv\C3\A9\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = icmp eq i32 %0, 3
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %80
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32* @opendir(i8* %13)
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %80
18: ; preds = %9
%19 = tail call i32 @dirfd(i32* %14)
%20 = tail call i32 @fchdir(i32 %19)
%21 = tail call %struct.dirent* @readdir(i32* %14)
%22 = icmp eq %struct.dirent* %21, null
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = tail call i32 @closedir(i32* %14)
br label %78
25: ; preds = %18
%26 = bitcast %struct.stat* %3 to i8*
%27 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %31
28: ; preds = %74
%29 = tail call i32 @closedir(i32* %14)
%30 = icmp eq i32 %75, 0
br i1 %30, label %78, label %80
31: ; preds = %25, %74
%32 = phi %struct.dirent* [ %21, %25 ], [ %76, %74 ]
%33 = phi i32 [ 0, %25 ], [ %75, %74 ]
%34 = getelementptr inbounds %struct.dirent, %struct.dirent* %32, i64 0, i32 0
%35 = load i8*, i8** %34
%36 = load i32, i32* @O_RDONLY
%37 = tail call i32 @open(i8* %35, i32 %36)
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %31
%40 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %74
41: ; preds = %31
%42 = call i32 @fstat(i32 %37, %struct.stat* %3)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %71
46: ; preds = %41
%47 = load i32, i32* %27
%48 = tail call i32 @S_ISREG(i32 %47)
%49 = icmp eq i32 %48, 0
br i1 %49, label %71, label %50
50: ; preds = %46
%51 = load i32, i32* @SEEK_END
%52 = tail call i32 @lseek(i32 %37, i32 0, i32 %51)
%53 = load i32, i32* @SEEK_SET
%54 = tail call i32 @lseek(i32 %37, i32 0, i32 %53)
%55 = load i32, i32* @PROT_READ
%56 = load i32, i32* @MAP_PRIVATE
%57 = tail call i8* @mmap(i32* null, i32 %52, i32 %55, i32 %56, i32 %37, i32 0)
%58 = load i8*, i8** @MAP_FAILED
%59 = icmp eq i8* %57, %58
br i1 %59, label %60, label %62
60: ; preds = %50
%61 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %71
62: ; preds = %50
%63 = tail call i32* @strstr(i8* dereferenceable(1) %57, i8* dereferenceable(1) %11)
%64 = icmp eq i32* %63, null
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = load i8*, i8** %34
%67 = tail call i32 @puts(i8* dereferenceable(1) %66)
br label %68
68: ; preds = %65, %62
%69 = phi i32 [ 1, %65 ], [ %33, %62 ]
%70 = tail call i32 @munmap(i8* %57, i32 %52)
br label %71
71: ; preds = %46, %60, %68, %44
%72 = phi i32 [ %33, %44 ], [ %33, %60 ], [ %69, %68 ], [ %33, %46 ]
%73 = tail call i32 @close(i32 %37)
br label %74
74: ; preds = %71, %39
%75 = phi i32 [ %33, %39 ], [ %72, %71 ]
%76 = tail call %struct.dirent* @readdir(i32* %14)
%77 = icmp eq %struct.dirent* %76, null
br i1 %77, label %28, label %31
78: ; preds = %23, %28
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %80
80: ; preds = %16, %78, %28, %5
%81 = phi i32* [ @EXIT_FAILURE, %5 ], [ @EXIT_FAILURE, %16 ], [ @EXIT_SUCCESS, %78 ], [ @EXIT_SUCCESS, %28 ]
%82 = load i32, i32* %81
ret i32 %82
}