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

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ O_RDONLY;
int chrootme();
scalar_t__ creat(char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ getcwd(char *, int);
scalar_t__ getdumpable();
int getgid();
int getpid();
int getuid();
scalar_t__ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(void) {
  char buf[1024];
  pid_t helper;
  int i;
  char *tests[] = {".", "/", "/tmp", "0", "/0", ".."};
  fprintf(stderr,
          "Hi from the sandbox example program! I'm pid=%d, uid=%d, gid=%d, "
          "dumpable=%c\n",
          getpid(), getuid(), getgid(), getdumpable() ? 'Y' : 'N');
  printf("Now asking for chroot\n");
  helper = chrootme();
  if (helper == -1) {
    fprintf(stderr, "Asking for chroot failed\n");
    return EXIT_FAILURE;
  } else
    printf("Got chrooted successfully. Helper (%d) RIP.\n", helper);
  printf("CWD = %s\n", getcwd(buf, sizeof(buf)) ? buf : "unknown");
  if (creat("test", 0000) < 0)
    printf("file creation (\"test\") failed: %m\n");
  if (creat("/test", 0000) < 0)
    printf("file creation (\"/test\") failed: %m\n");
  for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
    if (open(tests[i], O_RDONLY) >= 0)
      printf("Opening %s: success\n", tests[i]);
    else
      printf("Opening %s: %m\n", tests[i]);
  pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
lea    0xe1f(%rip),%rax
mov    %rax,-0x450(%rbp)
lea    0xe06(%rip),%rax
mov    %rax,-0x448(%rbp)
lea    0xdfa(%rip),%rax
mov    %rax,-0x440(%rbp)
lea    0xdf2(%rip),%rax
mov    %rax,-0x438(%rbp)
lea    0xde3(%rip),%rax
mov    %rax,-0x430(%rbp)
lea    0xdd8(%rip),%rax
mov    %rax,-0x428(%rbp)
mov    0x2d98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x460(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x45c(%rbp)
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,-0x458(%rbp)
mov    $0x0,%al
call   10a0 <getgid@plt>
mov    %eax,-0x454(%rbp)
mov    $0x0,%al
call   1030 <getdumpable@plt>
mov    -0x460(%rbp),%edi
mov    -0x45c(%rbp),%edx
mov    -0x458(%rbp),%ecx
mov    -0x454(%rbp),%r8d
mov    %rax,%rsi
mov    $0x4e,%r9d
mov    $0x59,%eax
cmp    $0x0,%rsi
cmovne %eax,%r9d
lea    0xd61(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10c0 <chrootme@plt>
mov    %eax,-0x414(%rbp)
cmpl   $0xffffffff,-0x414(%rbp)
jne    1303 <main+0x143>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2cd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1461 <main+0x2a1>
mov    -0x414(%rbp),%esi
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1080 <getcwd@plt>
cmp    $0x0,%rax
je     1345 <main+0x185>
lea    -0x410(%rbp),%rax
mov    %rax,-0x468(%rbp)
jmp    1358 <main+0x198>
lea    0xd77(%rip),%rax
mov    %rax,-0x468(%rbp)
jmp    1358 <main+0x198>
mov    -0x468(%rbp),%rsi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd7b(%rip),%rdi
xor    %esi,%esi
call   10e0 <creat@plt>
cmp    $0x0,%rax
jge    1393 <main+0x1d3>
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd54(%rip),%rdi
xor    %esi,%esi
call   10e0 <creat@plt>
cmp    $0x0,%rax
jge    13b9 <main+0x1f9>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x418(%rbp)
movslq -0x418(%rbp),%rax
cmp    $0x6,%rax
jae    1453 <main+0x293>
movslq -0x418(%rbp),%rax
mov    -0x450(%rbp,%rax,8),%rdi
ff
mov    0x2bfe(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
cmp    $0x0,%rax
jl     141d <main+0x25d>
movslq -0x418(%rbp),%rax
mov    -0x450(%rbp,%rax,8),%rsi
ff
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    143a <main+0x27a>
movslq -0x418(%rbp),%rax
mov    -0x450(%rbp,%rax,8),%rsi
ff
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    143f <main+0x27f>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    13c3 <main+0x203>
mov    $0x0,%al
call   10b0 <pause@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    0x2e02(%rip),%r12
mov    (%r12),%r14d
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10a0 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getdumpable@plt>
test   %rax,%rax
mov    $0x4e,%eax
mov    $0x59,%r9d
cmove  %eax,%r9d
lea    0xdf7(%rip),%rsi
mov    %r14d,%edi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xef7(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <chrootme@plt>
cmp    $0xffffffff,%eax
je     13c7 <main+0x207>
lea    0xe2a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1080 <getcwd@plt>
test   %rax,%rax
lea    0xe3e(%rip),%rsi
cmovne %rbx,%rsi
lea    0xe29(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe51(%rip),%rdi
xor    %esi,%esi
call   10e0 <creat@plt>
test   %rax,%rax
jns    12a1 <main+0xe1>
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe2f(%rip),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
call   10e0 <creat@plt>
test   %rax,%rax
jns    12c5 <main+0x105>
lea    0xe1f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2d1c(%rip),%r15
mov    (%r15),%esi
lea    0xd35(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
lea    0xe19(%rip),%r12
lea    0xe27(%rip),%rbx
mov    %rbx,%rdi
cmovns %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%esi
lea    0xcf6(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmovns %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%esi
lea    0xcd2(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmovns %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%esi
lea    0xcb2(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmovns %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%esi
lea    0xc8b(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmovns %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%esi
lea    0xc68(%rip),%rbp
mov    %rbp,%rdi
call   10d0 <open@plt>
test   %rax,%rax
cmovns %r12,%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10b0 <pause@plt>
jmp    13e3 <main+0x223>
mov    (%r12),%edi
lea    0xc89(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"/tmp\00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [3 x i8] c"/0\00"
@.str.5 = [3 x i8] c"..\00"
@stderr = global i32 0
@.str.6 = [78 x i8] c"Hi from the sandbox example program! I'm pid=%d, uid=%d, gid=%d, dumpable=%c\0A\00"
@.str.7 = [23 x i8] c"Now asking for chroot\0A\00"
@.str.8 = [26 x i8] c"Asking for chroot failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.9 = [45 x i8] c"Got chrooted successfully. Helper (%d) RIP.\0A\00"
@.str.10 = [10 x i8] c"CWD = %s\0A\00"
@.str.11 = [8 x i8] c"unknown\00"
@.str.12 = [5 x i8] c"test\00"
@.str.13 = [35 x i8] c"file creation (\22test\22) failed: %m\0A\00"
@.str.14 = [6 x i8] c"/test\00"
@.str.15 = [36 x i8] c"file creation (\22/test\22) failed: %m\0A\00"
@O_RDONLY = global i32 0
@.str.16 = [21 x i8] c"Opening %s: success\0A\00"
@.str.17 = [16 x i8] c"Opening %s: %m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i8*]
store i32 0, i32* %1
%6 = bitcast [6 x i8*]* %5 to i8*
%7 = bitcast i8* %6 to [6 x i8*]*
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8** %13
%14 = load i32, i32* @stderr
%15 = call i32 (...) @getpid()
%16 = call i32 (...) @getuid()
%17 = call i32 (...) @getgid()
%18 = call i64 (...) @getdumpable()
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 89, i32 78
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%24 = call i32 (...) @chrootme()
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %31
27: ; preds = %0
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%30 = load i32, i32* @EXIT_FAILURE
store i32 %30, i32* %1
br label %84
31: ; preds = %0
%32 = load i32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%36 = call i64 @getcwd(i8* %35, i32 1024)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %41
40: ; preds = %34
br label %41
41: ; preds = %40, %38
%42 = phi i8* [ %39, %38 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), %40 ]
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %42)
%44 = call i64 @creat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 0)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
%49 = call i64 @creat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 0)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
store i32 0, i32* %4
br label %54
54: ; preds = %79, %53
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = icmp ult i64 %56, 6
br i1 %57, label %58, label %82
58: ; preds = %54
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %60
%62 = load i8*, i8** %61
%63 = load i32, i32* @O_RDONLY
%64 = call i64 @open(i8* %62, i32 %63)
%65 = icmp sge i64 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %58
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %68
%70 = load i8*, i8** %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* %70)
br label %78
72: ; preds = %58
%73 = load i32, i32* %4
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %74
%76 = load i8*, i8** %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %72, %66
br label %79
79: ; preds = %78
%80 = load i32, i32* %4
%81 = add nsw i32 %80, 1
store i32 %81, i32* %4
br label %54
82: ; preds = %54
%83 = call i32 (...) @pause()
store i32 0, i32* %1
br label %84
84: ; preds = %82, %27
%85 = load i32, i32* %1
ret i32 %85
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"/tmp\00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [3 x i8] c"/0\00"
@.str.5 = [3 x i8] c"..\00"
@stderr = global i32 0
@.str.6 = [78 x i8] c"Hi from the sandbox example program! I'm pid=%d, uid=%d, gid=%d, dumpable=%c\0A\00"
@.str.8 = [26 x i8] c"Asking for chroot failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.9 = [45 x i8] c"Got chrooted successfully. Helper (%d) RIP.\0A\00"
@.str.10 = [10 x i8] c"CWD = %s\0A\00"
@.str.11 = [8 x i8] c"unknown\00"
@.str.12 = [5 x i8] c"test\00"
@.str.13 = [35 x i8] c"file creation (\22test\22) failed: %m\0A\00"
@.str.14 = [6 x i8] c"/test\00"
@.str.15 = [36 x i8] c"file creation (\22/test\22) failed: %m\0A\00"
@O_RDONLY = global i32 0
@.str.16 = [21 x i8] c"Opening %s: success\0A\00"
@.str.17 = [16 x i8] c"Opening %s: %m\0A\00"
@str = [22 x i8] c"Now asking for chroot\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (...) @getuid()
%6 = tail call i32 (...) @getgid()
%7 = tail call i64 (...) @getdumpable()
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 78, i32 89
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), i32 %4, i32 %5, i32 %6, i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (...) @chrootme()
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
br label %65
18: ; preds = %0
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i32 %12)
%20 = call i64 @getcwd(i8* %2, i32 1024)
%21 = icmp eq i64 %20, 0
%22 = select i1 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %22)
%24 = call i64 @creat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 0)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
br label %28
28: ; preds = %26, %18
%29 = call i64 @creat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 0)
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = load i32, i32* @O_RDONLY
%35 = call i64 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = icmp sgt i64 %35, -1
%37 = select i1 %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = load i32, i32* @O_RDONLY
%40 = call i64 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = icmp sgt i64 %40, -1
%42 = select i1 %41, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%44 = load i32, i32* @O_RDONLY
%45 = call i64 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = icmp sgt i64 %45, -1
%47 = select i1 %46, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* @O_RDONLY
%50 = call i64 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = icmp sgt i64 %50, -1
%52 = select i1 %51, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = load i32, i32* @O_RDONLY
%55 = call i64 @open(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %54)
%56 = icmp sgt i64 %55, -1
%57 = select i1 %56, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%59 = load i32, i32* @O_RDONLY
%60 = call i64 @open(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %59)
%61 = icmp sgt i64 %60, -1
%62 = select i1 %61, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%64 = call i32 (...) @pause()
br label %65
65: ; preds = %33, %14
%66 = phi i32 [ %17, %14 ], [ 0, %33 ]
ret i32 %66
}