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

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
scalar_t__ WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int fork();
int /*<<< orphan*/ memcpy(char *, char *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ panic(char *);
int /*<<< orphan*/ puts(char *);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char *strtok(char *, char *);
scalar_t__ waitpid(int, int *, int /*<<< orphan*/);
int write(int, char *, int);
void launch_tests(void) {
  char cmdline[4096], *success_dev;
  int status, fd;
  pid_t pid;
  puts("\x1b[32m\x1b[1m"
       "[+] Launching tests..."
       "\x1b[0m");
  pid = fork();
  if (pid == -1)
    panic("fork");
  else if (pid == 0) {
    execl("/init.sh", "init", NULL);
    panic("exec");
  }
  if (waitpid(pid, &status, 0) < 0)
    panic("waitpid");
  if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
    puts("\x1b[32m\x1b[1m"
         "[+] Tests successful! :-)"
         "\x1b[0m");
    fd = open("/proc/cmdline", O_RDONLY);
    if (fd < 0)
      panic("open(/proc/cmdline)");
    if (read(fd, cmdline, sizeof(cmdline) - 1) <= 0)
      panic("read(/proc/cmdline)");
    cmdline[sizeof(cmdline) - 1] = '\0';
    for (success_dev = strtok(cmdline, " \n"); success_dev;
         success_dev = strtok(NULL, " \n")) {
      if (strncmp(success_dev, "wg.success=", 11))
        continue;
      memcpy(success_dev + 11 - 5, "/dev/", 5);
      success_dev += 11 - 5;
      break;
    }
    if (!success_dev || !strlen(success_dev))
      panic("Unable to find success device");
    fd = open(success_dev, O_WRONLY);
    if (fd < 0)
      panic("open(success_dev)");
    if (write(fd, "success\n", 8) != 8)
      panic("write(success_dev)");
    close(fd);
  } else
    puts("\x1b[31m\x1b[1m[-] Tests failed! :-(\x1b[0m");
}


x86 assembly (clang, -O0):
<launch_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
lea    0xdfe(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1110 <fork@plt>
mov    %eax,-0x1014(%rbp)
cmpl   $0xffffffff,-0x1014(%rbp)
jne    1232 <launch_tests+0x42>
lea    0xdfc(%rip),%rdi
call   1070 <panic@plt>
jmp    1267 <launch_tests+0x77>
cmpl   $0x0,-0x1014(%rbp)
jne    1262 <launch_tests+0x72>
lea    0xde3(%rip),%rdi
lea    0xde5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1100 <execl@plt>
lea    0xdda(%rip),%rdi
call   1070 <panic@plt>
jmp    1267 <launch_tests+0x77>
mov    -0x1014(%rbp),%edi
lea    -0x100c(%rbp),%rsi
xor    %edx,%edx
call   10c0 <waitpid@plt>
cmp    $0x0,%rax
jge    1291 <launch_tests+0xa1>
lea    0xdb0(%rip),%rdi
call   1070 <panic@plt>
mov    -0x100c(%rbp),%edi
call   10f0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     146d <launch_tests+0x27d>
mov    -0x100c(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
cmp    $0x0,%rax
jne    146d <launch_tests+0x27d>
lea    0xd82(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%esi
lea    0xd94(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,-0x1010(%rbp)
cmpl   $0x0,-0x1010(%rbp)
jge    12fb <launch_tests+0x10b>
lea    0xd83(%rip),%rdi
call   1070 <panic@plt>
mov    -0x1010(%rbp),%edi
lea    -0x1000(%rbp),%rsi
mov    $0xfff,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jg     1328 <launch_tests+0x138>
lea    0xd6a(%rip),%rdi
call   1070 <panic@plt>
movb   $0x0,-0x1(%rbp)
lea    -0x1000(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x1008(%rbp)
cmpq   $0x0,-0x1008(%rbp)
je     13ce <launch_tests+0x1de>
mov    -0x1008(%rbp),%rdi
lea    0xd42(%rip),%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     137b <launch_tests+0x18b>
jmp    13b2 <launch_tests+0x1c2>
mov    -0x1008(%rbp),%rdi
add    $0xb,%rdi
add    $0xfffffffffffffffb,%rdi
lea    0xd1f(%rip),%rsi
mov    $0x5,%edx
call   10a0 <memcpy@plt>
mov    -0x1008(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x1008(%rbp)
jmp    13ce <launch_tests+0x1de>
xor    %eax,%eax
mov    %eax,%edi
lea    0xce4(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x1008(%rbp)
jmp    1346 <launch_tests+0x156>
cmpq   $0x0,-0x1008(%rbp)
je     13f1 <launch_tests+0x201>
mov    -0x1008(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x0,%eax
jne    13fd <launch_tests+0x20d>
lea    0xcbe(%rip),%rdi
call   1070 <panic@plt>
mov    -0x1008(%rbp),%rdi
mov    0x2bc5(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
mov    %eax,-0x1010(%rbp)
cmpl   $0x0,-0x1010(%rbp)
jge    1431 <launch_tests+0x241>
lea    0xca8(%rip),%rdi
call   1070 <panic@plt>
mov    -0x1010(%rbp),%edi
lea    0xca8(%rip),%rsi
mov    $0x8,%edx
call   1050 <write@plt>
cmp    $0x8,%eax
je     145d <launch_tests+0x26d>
lea    0xc97(%rip),%rdi
call   1070 <panic@plt>
mov    -0x1010(%rbp),%edi
call   1080 <close@plt>
jmp    1479 <launch_tests+0x289>
lea    0xc8e(%rip),%rdi
call   1040 <puts@plt>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<launch_tests>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1018,%rsp
lea    0xdfb(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1110 <fork@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     123a <launch_tests+0x4a>
test   %ebx,%ebx
jne    1246 <launch_tests+0x56>
lea    0xe06(%rip),%rdi
lea    0xe08(%rip),%rsi
xor    %edx,%edx
call   1100 <execl@plt>
lea    0xdff(%rip),%rdi
jmp    1241 <launch_tests+0x51>
lea    0xde3(%rip),%rdi
call   1070 <panic@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   10c0 <waitpid@plt>
test   %rax,%rax
jns    1265 <launch_tests+0x75>
lea    0xddc(%rip),%rdi
call   1070 <panic@plt>
mov    0xc(%rsp),%edi
call   10f0 <WIFEXITED@plt>
test   %rax,%rax
je     1281 <launch_tests+0x91>
mov    0xc(%rsp),%edi
call   10b0 <WEXITSTATUS@plt>
test   %rax,%rax
je     1292 <launch_tests+0xa2>
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
jmp    13cf <launch_tests+0x1df>
lea    0xdab(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d43(%rip),%rax
mov    (%rax),%esi
lea    0xdbd(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    12c5 <launch_tests+0xd5>
lea    0xdb9(%rip),%rdi
call   1070 <panic@plt>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0xfff,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     12e7 <launch_tests+0xf7>
lea    0xdab(%rip),%rdi
call   1070 <panic@plt>
movb   $0x0,0x100f(%rsp)
lea    0xdab(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strtok@plt>
test   %rax,%rax
je     1349 <launch_tests+0x159>
mov    %rax,%rbx
lea    0xd95(%rip),%r15
lea    0xd8b(%rip),%r12
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     134e <launch_tests+0x15e>
xor    %edi,%edi
mov    %r12,%rsi
call   10e0 <strtok@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1320 <launch_tests+0x130>
jmp    1375 <launch_tests+0x185>
xor    %r14d,%r14d
jmp    1375 <launch_tests+0x185>
add    $0x6,%rbx
lea    0xd57(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   10a0 <memcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%r14
test   %eax,%eax
jne    1381 <launch_tests+0x191>
lea    0xd3a(%rip),%rdi
call   1070 <panic@plt>
mov    0x2c48(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10d0 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    13a4 <launch_tests+0x1b4>
lea    0xd35(%rip),%rdi
call   1070 <panic@plt>
lea    0xd3b(%rip),%rsi
mov    %ebx,%edi
mov    $0x8,%edx
call   1050 <write@plt>
cmp    $0x8,%eax
je     13c8 <launch_tests+0x1d8>
lea    0xd2c(%rip),%rdi
call   1070 <panic@plt>
mov    %ebx,%edi
call   1080 <close@plt>
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\1B[32m\1B[1m[+] Launching tests...\1B[0m\00"
@.str.1 = [5 x i8] c"fork\00"
@.str.2 = [9 x i8] c"/init.sh\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [5 x i8] c"exec\00"
@.str.5 = [8 x i8] c"waitpid\00"
@.str.6 = [39 x i8] c"\1B[32m\1B[1m[+] Tests successful! :-)\1B[0m\00"
@.str.7 = [14 x i8] c"/proc/cmdline\00"
@O_RDONLY = global i32 0
@.str.8 = [20 x i8] c"open(/proc/cmdline)\00"
@.str.9 = [20 x i8] c"read(/proc/cmdline)\00"
@.str.10 = [3 x i8] c" \0A\00"
@.str.11 = [12 x i8] c"wg.success=\00"
@.str.12 = [6 x i8] c"/dev/\00"
@.str.13 = [30 x i8] c"Unable to find success device\00"
@O_WRONLY = global i32 0
@.str.14 = [18 x i8] c"open(success_dev)\00"
@.str.15 = [9 x i8] c"success\0A\00"
@.str.16 = [19 x i8] c"write(success_dev)\00"
@.str.17 = [35 x i8] c"\1B[31m\1B[1m[-] Tests failed! :-(\1B[0m\00"
define void @launch_tests() {
%1 = alloca [4096 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @fork()
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @panic(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %19
12: ; preds = %0
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* null)
%17 = call i32 @panic(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %5
%21 = call i64 @waitpid(i32 %20, i32* %3, i32 0)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @panic(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
%26 = load i32, i32* %3
%27 = call i64 @WIFEXITED(i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %95
29: ; preds = %25
%30 = load i32, i32* %3
%31 = call i64 @WEXITSTATUS(i32 %30)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %95
33: ; preds = %29
%34 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%35 = load i32, i32* @O_RDONLY
%36 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %35)
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %41
41: ; preds = %39, %33
%42 = load i32, i32* %4
%43 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%44 = call i64 @read(i32 %42, i8* %43, i32 4095)
%45 = icmp sle i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
%49 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 4095
store i8 0, i8* %49
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%51 = call i8* @strtok(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i8* %51, i8** %2
br label %52
52: ; preds = %67, %48
%53 = load i8*, i8** %2
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %69
55: ; preds = %52
%56 = load i8*, i8** %2
%57 = call i64 @strncmp(i8* %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 11)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %55
br label %67
60: ; preds = %55
%61 = load i8*, i8** %2
%62 = getelementptr inbounds i8, i8* %61, i64 11
%63 = getelementptr inbounds i8, i8* %62, i64 -5
%64 = call i32 @memcpy(i8* %63, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%65 = load i8*, i8** %2
%66 = getelementptr inbounds i8, i8* %65, i64 6
store i8* %66, i8** %2
br label %69
67: ; preds = %59
%68 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i8* %68, i8** %2
br label %52
69: ; preds = %60, %52
%70 = load i8*, i8** %2
%71 = icmp ne i8* %70, null
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load i8*, i8** %2
%74 = call i32 @strlen(i8* %73)
%75 = icmp ne i32 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %72, %69
%77 = call i32 @panic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
br label %78
78: ; preds = %76, %72
%79 = load i8*, i8** %2
%80 = load i32, i32* @O_WRONLY
%81 = call i32 @open(i8* %79, i32 %80)
store i32 %81, i32* %4
%82 = load i32, i32* %4
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %78
%85 = call i32 @panic(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0))
br label %86
86: ; preds = %84, %78
%87 = load i32, i32* %4
%88 = call i32 @write(i32 %87, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i32 8)
%89 = icmp ne i32 %88, 8
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
br label %92
92: ; preds = %90, %86
%93 = load i32, i32* %4
%94 = call i32 @close(i32 %93)
br label %97
95: ; preds = %29, %25
%96 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0))
br label %97
97: ; preds = %95, %92
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\1B[32m\1B[1m[+] Launching tests...\1B[0m\00"
@.str.1 = [5 x i8] c"fork\00"
@.str.2 = [9 x i8] c"/init.sh\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [5 x i8] c"exec\00"
@.str.5 = [8 x i8] c"waitpid\00"
@.str.6 = [39 x i8] c"\1B[32m\1B[1m[+] Tests successful! :-)\1B[0m\00"
@.str.7 = [14 x i8] c"/proc/cmdline\00"
@O_RDONLY = global i32 0
@.str.8 = [20 x i8] c"open(/proc/cmdline)\00"
@.str.9 = [20 x i8] c"read(/proc/cmdline)\00"
@.str.10 = [3 x i8] c" \0A\00"
@.str.11 = [12 x i8] c"wg.success=\00"
@.str.12 = [6 x i8] c"/dev/\00"
@.str.13 = [30 x i8] c"Unable to find success device\00"
@O_WRONLY = global i32 0
@.str.14 = [18 x i8] c"open(success_dev)\00"
@.str.15 = [9 x i8] c"success\0A\00"
@.str.16 = [19 x i8] c"write(success_dev)\00"
@.str.17 = [35 x i8] c"\1B[31m\1B[1m[-] Tests failed! :-(\1B[0m\00"
define void @launch_tests() {
%1 = alloca [4096 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @fork()
switch i32 %6, label %12 [
i32 -1, label %9
i32 0, label %7
]
7: ; preds = %0
%8 = tail call i32 @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* null)
br label %9
9: ; preds = %0, %7
%10 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %0 ]
%11 = tail call i32 @panic(i8* %10)
br label %12
12: ; preds = %9, %0
%13 = call i64 @waitpid(i32 %6, i32* %2, i32 0)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @panic(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
%19 = call i64 @WIFEXITED(i32 %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %70, label %21
21: ; preds = %17
%22 = load i32, i32* %2
%23 = call i64 @WEXITSTATUS(i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %70
25: ; preds = %21
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%27 = load i32, i32* @O_RDONLY
%28 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = call i64 @read(i32 %28, i8* %3, i32 4095)
%34 = icmp slt i64 %33, 1
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
%38 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 4095
store i8 0, i8* %38
%39 = call i8* @strtok(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%40 = icmp eq i8* %39, null
br i1 %40, label %53, label %41
41: ; preds = %37, %45
%42 = phi i8* [ %46, %45 ], [ %39, %37 ]
%43 = call i64 @strncmp(i8* %42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 11)
%44 = icmp eq i64 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %41
%46 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%47 = icmp eq i8* %46, null
br i1 %47, label %53, label %41
48: ; preds = %41
%49 = getelementptr inbounds i8, i8* %42, i64 6
%50 = call i32 @memcpy(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%51 = call i32 @strlen(i8* %49)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %45, %37, %48
%54 = phi i8* [ %49, %48 ], [ null, %37 ], [ null, %45 ]
%55 = call i32 @panic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
br label %56
56: ; preds = %53, %48
%57 = phi i8* [ %54, %53 ], [ %49, %48 ]
%58 = load i32, i32* @O_WRONLY
%59 = call i32 @open(i8* %57, i32 %58)
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 @panic(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0))
br label %63
63: ; preds = %61, %56
%64 = call i32 @write(i32 %59, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i32 8)
%65 = icmp eq i32 %64, 8
br i1 %65, label %68, label %66
66: ; preds = %63
%67 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
br label %68
68: ; preds = %66, %63
%69 = call i32 @close(i32 %59)
br label %72
70: ; preds = %21, %17
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0))
br label %72
72: ; preds = %70, %68
ret void
}