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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void test_rewind(void) {
  DIR *dir = opendir("tests/1");
  assert(dir != NULL);
  int found = 0;
  struct dirent *ent;
  while ((ent = readdir(dir)) != NULL) {
    if (strcmp(ent->d_name, ".") == 0) {
      found += 1;
    } else if (strcmp(ent->d_name, "..") == 0) {
      found += 2;
    } else if (strcmp(ent->d_name, "file") == 0) {
      found += 4;
    } else if (strcmp(ent->d_name, "dir") == 0) {
      found += 8;
    } else {
      fprintf(stderr, "Unexpected file %s\n", ent->d_name);
      abort();
    }
  }
  assert(found == 0xf);
  rewinddir(dir);
  found = 0;
  while ((ent = readdir(dir)) != NULL) {
    if (strcmp(ent->d_name, ".") == 0) {
      found += 1;
    } else if (strcmp(ent->d_name, "..") == 0) {
      found += 2;
    } else if (strcmp(ent->d_name, "file") == 0) {
      found += 4;
    } else if (strcmp(ent->d_name, "dir") == 0) {
      found += 8;
    } else {
      fprintf(stderr, "Unexpected file %s\n", ent->d_name);
      abort();
    }
  }
  assert(found == 0xf);
  closedir(dir);
}


x86 assembly (clang, -O0):
<test_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe71(%rip),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     12ab <test_rewind+0x12b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe33(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11f3 <test_rewind+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12a6 <test_rewind+0x126>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe07(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    121e <test_rewind+0x9e>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    12a1 <test_rewind+0x121>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xddf(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1249 <test_rewind+0xc9>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    129c <test_rewind+0x11c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xdb9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1274 <test_rewind+0xf4>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1297 <test_rewind+0x117>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xd89(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    129c <test_rewind+0x11c>
jmp    12a1 <test_rewind+0x121>
jmp    12a6 <test_rewind+0x126>
jmp    11b1 <test_rewind+0x31>
cmpl   $0xf,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <rewinddir@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     13c6 <test_rewind+0x246>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd18(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    130e <test_rewind+0x18e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13c1 <test_rewind+0x241>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcec(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1339 <test_rewind+0x1b9>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    13bc <test_rewind+0x23c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcc4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1364 <test_rewind+0x1e4>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    13b7 <test_rewind+0x237>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xc9e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    138f <test_rewind+0x20f>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    13b2 <test_rewind+0x232>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xc6e(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    13b7 <test_rewind+0x237>
jmp    13bc <test_rewind+0x23c>
jmp    13c1 <test_rewind+0x241>
jmp    12cc <test_rewind+0x14c>
cmpl   $0xf,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1060 <closedir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rewind>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe6e(%rip),%rdi
call   1040 <opendir@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
call   10a0 <readdir@plt>
xor    %r15d,%r15d
mov    $0x0,%edi
test   %rax,%rax
je     126b <test_rewind+0xeb>
mov    %rax,%r14
xor    %r13d,%r13d
lea    0xe3b(%rip),%rbp
lea    0xe33(%rip),%r15
lea    0xe2f(%rip),%r12
jmp    11f8 <test_rewind+0x78>
xchg   %ax,%ax
mov    $0x1,%ecx
add    %ecx,%r13d
mov    %rbx,%rdi
call   10a0 <readdir@plt>
mov    %rax,%r14
test   %rax,%rax
je     125e <test_rewind+0xde>
mov    (%r14),%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11e0 <test_rewind+0x60>
mov    (%r14),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1250 <test_rewind+0xd0>
mov    (%r14),%rdi
mov    %r12,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1257 <test_rewind+0xd7>
mov    (%r14),%rdi
lea    0xdde(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x8,%ecx
test   %rax,%rax
je     11e5 <test_rewind+0x65>
jmp    1357 <test_rewind+0x1d7>
cs nopw 0x0(%rax,%rax,1)
mov    $0x2,%ecx
jmp    11e5 <test_rewind+0x65>
mov    $0x4,%ecx
jmp    11e5 <test_rewind+0x65>
xor    %edi,%edi
cmp    $0xf,%r13d
sete   %dil
xor    %r15d,%r15d
call   1080 <assert@plt>
mov    %rbx,%rdi
call   1050 <rewinddir@plt>
mov    %rbx,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1339 <test_rewind+0x1b9>
mov    %rax,%rbp
xor    %r12d,%r12d
lea    0xd73(%rip),%r13
lea    0xd6b(%rip),%r14
lea    0xd67(%rip),%r15
jmp    12c8 <test_rewind+0x148>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%ecx
add    %ecx,%r12d
mov    %rbx,%rdi
call   10a0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     132e <test_rewind+0x1ae>
mov    0x0(%rbp),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12b0 <test_rewind+0x130>
mov    0x0(%rbp),%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1320 <test_rewind+0x1a0>
mov    0x0(%rbp),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1327 <test_rewind+0x1a7>
mov    0x0(%rbp),%rdi
lea    0xd0a(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x8,%ecx
test   %rax,%rax
je     12b5 <test_rewind+0x135>
jmp    1365 <test_rewind+0x1e5>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%ecx
jmp    12b5 <test_rewind+0x135>
mov    $0x4,%ecx
jmp    12b5 <test_rewind+0x135>
xor    %r15d,%r15d
cmp    $0xf,%r12d
sete   %r15b
mov    %r15d,%edi
call   1080 <assert@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <closedir@plt>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
jmp    1372 <test_rewind+0x1f2>
mov    0x2c74(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xc9b(%rip),%rsi
call   1090 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [8 x i8] c"tests/1\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [5 x i8] c"file\00"
@.str.4 = [4 x i8] c"dir\00"
@stderr = global i32 0
@.str.5 = [20 x i8] c"Unexpected file %s\0A\00"
define void @test_rewind() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call %struct.dirent* @readdir(i32* %1)
%6 = icmp eq %struct.dirent* %5, null
br i1 %6, label %39, label %7
7: ; preds = %0, %31
%8 = phi %struct.dirent* [ %34, %31 ], [ %5, %0 ]
%9 = phi i32 [ %33, %31 ], [ 0, %0 ]
%10 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %31, label %14
14: ; preds = %7
%15 = load i8*, i8** %10
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %14
%19 = load i8*, i8** %10
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %31, label %22
22: ; preds = %18
%23 = load i8*, i8** %10
%24 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %10
%29 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = tail call i32 (...) @abort()
unreachable
31: ; preds = %22, %18, %14, %7
%32 = phi i32 [ 1, %7 ], [ 2, %14 ], [ 4, %18 ], [ 8, %22 ]
%33 = add nuw nsw i32 %9, %32
%34 = tail call %struct.dirent* @readdir(i32* %1)
%35 = icmp eq %struct.dirent* %34, null
br i1 %35, label %36, label %7
36: ; preds = %31
%37 = icmp eq i32 %33, 15
%38 = zext i1 %37 to i32
br label %39
39: ; preds = %36, %0
%40 = phi i32 [ 0, %0 ], [ %38, %36 ]
%41 = tail call i32 @assert(i32 %40)
%42 = tail call i32 @rewinddir(i32* %1)
%43 = tail call %struct.dirent* @readdir(i32* %1)
%44 = icmp eq %struct.dirent* %43, null
br i1 %44, label %77, label %45
45: ; preds = %39, %69
%46 = phi %struct.dirent* [ %72, %69 ], [ %43, %39 ]
%47 = phi i32 [ %71, %69 ], [ 0, %39 ]
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %46, i64 0, i32 0
%49 = load i8*, i8** %48
%50 = tail call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %69, label %52
52: ; preds = %45
%53 = load i8*, i8** %48
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %69, label %56
56: ; preds = %52
%57 = load i8*, i8** %48
%58 = tail call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %69, label %60
60: ; preds = %56
%61 = load i8*, i8** %48
%62 = tail call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %69, label %64
64: ; preds = %60
%65 = load i32, i32* @stderr
%66 = load i8*, i8** %48
%67 = tail call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %66)
%68 = tail call i32 (...) @abort()
unreachable
69: ; preds = %60, %56, %52, %45
%70 = phi i32 [ 1, %45 ], [ 2, %52 ], [ 4, %56 ], [ 8, %60 ]
%71 = add nuw nsw i32 %47, %70
%72 = tail call %struct.dirent* @readdir(i32* %1)
%73 = icmp eq %struct.dirent* %72, null
br i1 %73, label %74, label %45
74: ; preds = %69
%75 = icmp eq i32 %71, 15
%76 = zext i1 %75 to i32
br label %77
77: ; preds = %74, %39
%78 = phi i32 [ 0, %39 ], [ %76, %74 ]
%79 = tail call i32 @assert(i32 %78)
%80 = tail call i32 @closedir(i32* %1)
ret void
}