#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 scalar_t__ pid_t;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ chdir(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getpid();
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int, char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ wait(int *);
void process_dir(char *this_dir) {
  DIR *dir;
  struct dirent *direntry;
  struct stat file_info;
  int status;
  if (chdir(this_dir)) {
    perror(this_dir);
    exit(errno);
  };
  if (!(dir = opendir("./"))) {
    perror(this_dir);
    exit(errno);
  };
  while ((direntry = readdir(dir))) {
    if (lstat(direntry->d_name, &file_info))
      fprintf(stderr, "Error lstat()ing %s\n", direntry->d_name);
    printf("     %d:  %s\n", getpid(), direntry->d_name);
  }
  rewinddir(dir);
  while ((direntry = readdir(dir))) {
    if (lstat(direntry->d_name, &file_info))
      fprintf(stderr, "Error lstat()ing %s\n", direntry->d_name);
    else if (S_ISDIR(file_info.st_mode)) {
      pid_t pid;
      if (strcmp(direntry->d_name, ".") && strcmp(direntry->d_name, "..")) {
        fflush(stdout);
        pid = fork();
        if (pid == 0) {
          printf("\nPID  %d DIRECTORY: %s\n", getpid(), direntry->d_name);
          process_dir(direntry->d_name);
          exit(EXIT_SUCCESS);
        }
        if (pid > 0)
          wait(&status);
        else {
          perror("fork failed");
          exit(errno);
        };
      }
    }
  }
  closedir(dir);
}


x86 assembly (clang, -O0):
<process_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <chdir@plt>
cmp    $0x0,%rax
je     1246 <process_dir+0x36>
mov    -0x8(%rbp),%rdi
call   1100 <perror@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    0xdb3(%rip),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1277 <process_dir+0x67>
mov    -0x8(%rbp),%rdi
call   1100 <perror@plt>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
jmp    127c <process_dir+0x6c>
mov    -0x10(%rbp),%rdi
call   10d0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     12ea <process_dir+0xda>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10a0 <lstat@plt>
cmp    $0x0,%rax
je     12c9 <process_dir+0xb9>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xd3f(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xd38(%rip),%rdi
call   1060 <printf@plt>
jmp    127c <process_dir+0x6c>
mov    -0x10(%rbp),%rdi
call   1080 <rewinddir@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1432 <process_dir+0x222>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10a0 <lstat@plt>
cmp    $0x0,%rax
je     1345 <process_dir+0x135>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xcc8(%rip),%rsi
call   10c0 <fprintf@plt>
jmp    142d <process_dir+0x21d>
mov    -0x20(%rbp),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1428 <process_dir+0x218>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcc2(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     1423 <process_dir+0x213>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xca4(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     1423 <process_dir+0x213>
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
call   10e0 <fflush@plt>
mov    $0x0,%al
call   1130 <fork@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13eb <process_dir+0x1db>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xc5d(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   10f0 <process_dir@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
cmpq   $0x0,-0x30(%rbp)
jle    1404 <process_dir+0x1f4>
lea    -0x24(%rbp),%rdi
call   1120 <wait@plt>
jmp    141e <process_dir+0x20e>
lea    0xc36(%rip),%rdi
call   1100 <perror@plt>
mov    0x2bc1(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
jmp    1423 <process_dir+0x213>
jmp    1428 <process_dir+0x218>
jmp    142d <process_dir+0x21d>
jmp    12f3 <process_dir+0xe3>
mov    -0x10(%rbp),%rdi
call   1090 <closedir@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_dir>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <chdir@plt>
test   %rax,%rax
jne    138f <process_dir+0x17f>
lea    0xdcd(%rip),%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     138f <process_dir+0x17f>
mov    %rax,%r14
mov    %rax,%rdi
call   10d0 <readdir@plt>
test   %rax,%rax
je     12b5 <process_dir+0xa5>
mov    %rax,%rbx
mov    %rsp,%r12
lea    0xdba(%rip),%rbp
mov    0x2d7b(%rip),%r13
lea    0xd97(%rip),%r15
jmp    1294 <process_dir+0x84>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    (%rbx),%rdx
mov    %rbp,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    %r14,%rdi
call   10d0 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     12b5 <process_dir+0xa5>
mov    (%rbx),%rdi
mov    %r12,%rsi
call   10a0 <lstat@plt>
test   %rax,%rax
je     1270 <process_dir+0x60>
mov    0x0(%r13),%edi
mov    (%rbx),%rdx
mov    %r15,%rsi
call   10c0 <fprintf@plt>
jmp    1270 <process_dir+0x60>
mov    %r14,%rdi
call   1080 <rewinddir@plt>
mov    %r14,%rdi
call   10d0 <readdir@plt>
test   %rax,%rax
je     1378 <process_dir+0x168>
mov    %rax,%rbx
mov    %rsp,%r15
lea    0xd4c(%rip),%r12
mov    0x2cfe(%rip),%r13
lea    0xd1a(%rip),%rbp
jmp    130f <process_dir+0xff>
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
mov    (%rbx),%rdx
mov    %rbp,%rsi
call   10c0 <fprintf@plt>
mov    %r14,%rdi
call   10d0 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1378 <process_dir+0x168>
mov    (%rbx),%rdi
mov    %r15,%rsi
call   10a0 <lstat@plt>
test   %rax,%rax
jne    12f0 <process_dir+0xe0>
mov    (%rsp),%edi
call   1070 <S_ISDIR@plt>
test   %rax,%rax
je     12ff <process_dir+0xef>
mov    (%rbx),%rdi
mov    %r12,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12ff <process_dir+0xef>
mov    (%rbx),%rdi
lea    0xce0(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12ff <process_dir+0xef>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
call   10e0 <fflush@plt>
xor    %eax,%eax
call   1130 <fork@plt>
test   %rax,%rax
je     1394 <process_dir+0x184>
jle    13c2 <process_dir+0x1b2>
lea    0x4(%rsp),%rdi
call   1120 <wait@plt>
jmp    12ff <process_dir+0xef>
mov    %r14,%rdi
call   1090 <closedir@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
jmp    13c9 <process_dir+0x1b9>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    (%rbx),%rdx
lea    0xc84(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    (%rbx),%rdi
call   10f0 <process_dir@plt>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    0xc78(%rip),%rdi
call   1100 <perror@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>

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

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