#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
unsigned long fullread(char *, int, long, int /*<<< orphan*/ *);
char *malloc(long);
void *parse(char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ printparsed(void *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int cnt = 0;
  FILE *fp;
  char *inname = NULL, *outname = NULL, *adr;
  void *parsed;
  long size;
  while (++cnt < argc) {
    if (argv[cnt][0] != '-') {
      continue;
    }
    switch (argv[cnt][1]) {
    case 'i':
      inname = argv[++cnt];
      break;
    case 'o':
      outname = argv[++cnt];
      break;
    }
  }
  if (inname == NULL || outname == NULL) {
    (perror("39"), fflush(stderr), exit(errno ? errno : -1));
  }
  if (freopen(outname, "wb", stdout) == NULL) {
    (perror("42"), fflush(stderr), exit(errno ? errno : -1));
  }
  if ((fp = fopen(inname, "rb")) == NULL) {
    (perror("45"), fflush(stderr), exit(errno ? errno : -1));
  }
  if (fseek(fp, 0, SEEK_END)) {
    (perror("48"), fflush(stderr), exit(errno ? errno : -1));
  }
  if ((size = ftell(fp)) < 0) {
    (perror("51"), fflush(stderr), exit(errno ? errno : -1));
  }
  rewind(fp);
  if ((adr = malloc(size + 1)) == NULL) {
    (perror("55"), fflush(stderr), exit(errno ? errno : -1));
  }
  adr[size] = '\0';
  if (fullread(adr, 1, size, fp) != (unsigned long)size) {
    (perror("59"), fflush(stderr), exit(errno ? errno : -1));
  }
  fclose(fp);
  if (!(parsed = parse(adr))) {
    (perror("63"), fflush(stderr), exit(errno ? errno : -1));
  }
  if (printparsed(parsed)) {
    (perror("66"), fflush(stderr), exit(errno ? errno : -1));
  }
  free(adr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    12a8 <main+0xc8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     123c <main+0x5c>
jmp    120d <main+0x2d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x69,%eax
je     126e <main+0x8e>
jmp    125d <main+0x7d>
mov    -0x4c(%rbp),%eax
sub    $0x6f,%eax
je     128b <main+0xab>
jmp    12a3 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    12a3 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    120d <main+0x2d>
cmpq   $0x0,-0x28(%rbp)
je     12be <main+0xde>
cmpq   $0x0,-0x30(%rbp)
jne    130e <main+0x12e>
lea    0xd3b(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2cf1(%rip),%rax
cmpl   $0x0,(%rax)
je     12f9 <main+0x119>
mov    0x2ce1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
jmp    1306 <main+0x126>
mov    $0xffffffff,%eax
mov    %eax,-0x50(%rbp)
jmp    1306 <main+0x126>
mov    -0x50(%rbp),%edi
call   1100 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    0x2caf(%rip),%rax
mov    (%rax),%edx
lea    0xce1(%rip),%rsi
call   1070 <freopen@plt>
cmp    $0x0,%rax
jne    1381 <main+0x1a1>
lea    0xcce(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2c94(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2c7e(%rip),%rax
cmpl   $0x0,(%rax)
je     136c <main+0x18c>
mov    0x2c6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    1379 <main+0x199>
mov    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1379 <main+0x199>
mov    -0x54(%rbp),%edi
call   1100 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    0xc7d(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    13ef <main+0x20f>
lea    0xc66(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2c26(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2c10(%rip),%rax
cmpl   $0x0,(%rax)
je     13da <main+0x1fa>
mov    0x2c00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
jmp    13e7 <main+0x207>
mov    $0xffffffff,%eax
mov    %eax,-0x58(%rbp)
jmp    13e7 <main+0x207>
mov    -0x58(%rbp),%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    0x2bee(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
cmp    $0x0,%rax
je     145d <main+0x27d>
lea    0xbfb(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2ba2(%rip),%rax
cmpl   $0x0,(%rax)
je     1448 <main+0x268>
mov    0x2b92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
jmp    1455 <main+0x275>
mov    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
jmp    1455 <main+0x275>
mov    -0x5c(%rbp),%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jge    14c4 <main+0x2e4>
lea    0xb97(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2b51(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2b3b(%rip),%rax
cmpl   $0x0,(%rax)
je     14af <main+0x2cf>
mov    0x2b2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
jmp    14bc <main+0x2dc>
mov    $0xffffffff,%eax
mov    %eax,-0x60(%rbp)
jmp    14bc <main+0x2dc>
mov    -0x60(%rbp),%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0x48(%rbp),%rdi
add    $0x1,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1538 <main+0x358>
lea    0xb26(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2add(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2ac7(%rip),%rax
cmpl   $0x0,(%rax)
je     1523 <main+0x343>
mov    0x2ab7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
jmp    1530 <main+0x350>
mov    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    1530 <main+0x350>
mov    -0x64(%rbp),%edi
call   1100 <exit@plt>
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fullread@plt>
cmp    -0x48(%rbp),%rax
je     15b4 <main+0x3d4>
lea    0xaad(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2a61(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2a4b(%rip),%rax
cmpl   $0x0,(%rax)
je     159f <main+0x3bf>
mov    0x2a3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
jmp    15ac <main+0x3cc>
mov    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
jmp    15ac <main+0x3cc>
mov    -0x68(%rbp),%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   10f0 <parse@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1624 <main+0x444>
lea    0xa40(%rip),%rdi
call   10e0 <perror@plt>
mov    0x29f1(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x29db(%rip),%rax
cmpl   $0x0,(%rax)
je     160f <main+0x42f>
mov    0x29cb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
jmp    161c <main+0x43c>
mov    $0xffffffff,%eax
mov    %eax,-0x6c(%rbp)
jmp    161c <main+0x43c>
mov    -0x6c(%rbp),%edi
call   1100 <exit@plt>
mov    -0x40(%rbp),%rdi
call   10d0 <printparsed@plt>
cmp    $0x0,%rax
je     1687 <main+0x4a7>
lea    0x9e0(%rip),%rdi
call   10e0 <perror@plt>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2978(%rip),%rax
cmpl   $0x0,(%rax)
je     1672 <main+0x492>
mov    0x2968(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
jmp    167f <main+0x49f>
mov    $0xffffffff,%eax
mov    %eax,-0x70(%rbp)
jmp    167f <main+0x49f>
mov    -0x70(%rbp),%edi
call   1100 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
movslq %edi,%rax
xor    %edi,%edi
xor    %r14d,%r14d
xor    %ecx,%ecx
movslq %ecx,%rdx
add    $0x1,%rdx
cs nopw 0x0(%rax,%rax,1)
cmp    %rax,%rdx
jge    123b <main+0x5b>
mov    (%rsi,%rdx,8),%rbx
add    $0x1,%ecx
add    $0x1,%rdx
cmpb   $0x2d,(%rbx)
jne    1200 <main+0x20>
movsbl 0x1(%rbx),%edx
cmp    $0x6f,%edx
je     122f <main+0x4f>
cmp    $0x69,%edx
jne    11ef <main+0xf>
add    $0x1,%ecx
movslq %ecx,%rdx
mov    (%rsi,%rdx,8),%r14
jmp    11ef <main+0xf>
add    $0x1,%ecx
movslq %ecx,%rdx
mov    (%rsi,%rdx,8),%rdi
jmp    11ef <main+0xf>
test   %r14,%r14
je     131d <main+0x13d>
test   %rdi,%rdi
je     131d <main+0x13d>
mov    0x2d74(%rip),%rax
mov    (%rax),%edx
lea    0xda6(%rip),%rsi
call   1070 <freopen@plt>
test   %rax,%rax
je     1326 <main+0x146>
lea    0xd97(%rip),%rsi
mov    %r14,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     132f <main+0x14f>
mov    %rax,%r14
mov    0x2d5b(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
test   %rax,%rax
jne    1338 <main+0x158>
mov    %r14,%rdi
call   1080 <ftell@plt>
test   %rax,%rax
js     1341 <main+0x161>
mov    %rax,%rbx
mov    %r14,%rdi
call   1060 <rewind@plt>
lea    0x1(%rbx),%rdi
call   1090 <malloc@plt>
test   %rax,%rax
je     134a <main+0x16a>
mov    %rax,%r15
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fullread@plt>
cmp    %rbx,%rax
jne    1353 <main+0x173>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   10f0 <parse@plt>
test   %rax,%rax
je     135c <main+0x17c>
mov    %rax,%rdi
call   10d0 <printparsed@plt>
test   %rax,%rax
jne    1365 <main+0x185>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xcdc(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcd9(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcd6(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcd0(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcca(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcc4(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcbe(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcb8(%rip),%rdi
jmp    136c <main+0x18c>
lea    0xcb2(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x2c4a(%rip),%rax
mov    (%rax),%eax
cmp    $0x1,%eax
sbb    %edi,%edi
or     %eax,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"39\00"
@stderr = global i32 0
@errno = global i32 0
@.str.1 = [3 x i8] c"wb\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c"42\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [3 x i8] c"45\00"
@SEEK_END = global i32 0
@.str.5 = [3 x i8] c"48\00"
@.str.6 = [3 x i8] c"51\00"
@.str.7 = [3 x i8] c"55\00"
@.str.8 = [3 x i8] c"59\00"
@.str.9 = [3 x i8] c"63\00"
@.str.10 = [3 x i8] c"66\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %8
store i8* null, i8** %9
br label %13
13: ; preds = %52, %28, %2
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %53
18: ; preds = %13
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 45
br i1 %27, label %28, label %29
28: ; preds = %18
br label %13
29: ; preds = %18
%30 = load i8**, i8*** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
switch i32 %37, label %52 [
i32 105, label %38
i32 111, label %45
]
38: ; preds = %29
%39 = load i8**, i8*** %5
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %39, i64 %42
%44 = load i8*, i8** %43
store i8* %44, i8** %8
br label %52
45: ; preds = %29
%46 = load i8**, i8*** %5
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %46, i64 %49
%51 = load i8*, i8** %50
store i8* %51, i8** %9
br label %52
52: ; preds = %29, %45, %38
br label %13
53: ; preds = %13
%54 = load i8*, i8** %8
%55 = icmp eq i8* %54, null
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i8*, i8** %9
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %71
59: ; preds = %56, %53
%60 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%61 = load i32, i32* @stderr
%62 = call i32 @fflush(i32 %61)
%63 = load i32, i32* @errno
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %59
%66 = load i32, i32* @errno
br label %68
67: ; preds = %59
br label %68
68: ; preds = %67, %65
%69 = phi i32 [ %66, %65 ], [ -1, %67 ]
%70 = call i32 @exit(i32 %69)
unreachable
71: ; preds = %56
%72 = load i8*, i8** %9
%73 = load i32, i32* @stdout
%74 = call i32* @freopen(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %73)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %88
76: ; preds = %71
%77 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%78 = load i32, i32* @stderr
%79 = call i32 @fflush(i32 %78)
%80 = load i32, i32* @errno
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %76
%83 = load i32, i32* @errno
br label %85
84: ; preds = %76
br label %85
85: ; preds = %84, %82
%86 = phi i32 [ %83, %82 ], [ -1, %84 ]
%87 = call i32 @exit(i32 %86)
unreachable
88: ; preds = %71
%89 = load i8*, i8** %8
%90 = call i32* @fopen(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %90, i32** %7
%91 = icmp eq i32* %90, null
br i1 %91, label %92, label %104
92: ; preds = %88
%93 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%94 = load i32, i32* @stderr
%95 = call i32 @fflush(i32 %94)
%96 = load i32, i32* @errno
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %92
%99 = load i32, i32* @errno
br label %101
100: ; preds = %92
br label %101
101: ; preds = %100, %98
%102 = phi i32 [ %99, %98 ], [ -1, %100 ]
%103 = call i32 @exit(i32 %102)
unreachable
104: ; preds = %88
%105 = load i32*, i32** %7
%106 = load i32, i32* @SEEK_END
%107 = call i64 @fseek(i32* %105, i32 0, i32 %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %121
109: ; preds = %104
%110 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%111 = load i32, i32* @stderr
%112 = call i32 @fflush(i32 %111)
%113 = load i32, i32* @errno
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %117
115: ; preds = %109
%116 = load i32, i32* @errno
br label %118
117: ; preds = %109
br label %118
118: ; preds = %117, %115
%119 = phi i32 [ %116, %115 ], [ -1, %117 ]
%120 = call i32 @exit(i32 %119)
unreachable
121: ; preds = %104
%122 = load i32*, i32** %7
%123 = call i64 @ftell(i32* %122)
store i64 %123, i64* %12
%124 = icmp slt i64 %123, 0
br i1 %124, label %125, label %137
125: ; preds = %121
%126 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%127 = load i32, i32* @stderr
%128 = call i32 @fflush(i32 %127)
%129 = load i32, i32* @errno
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %125
%132 = load i32, i32* @errno
br label %134
133: ; preds = %125
br label %134
134: ; preds = %133, %131
%135 = phi i32 [ %132, %131 ], [ -1, %133 ]
%136 = call i32 @exit(i32 %135)
unreachable
137: ; preds = %121
%138 = load i32*, i32** %7
%139 = call i32 @rewind(i32* %138)
%140 = load i64, i64* %12
%141 = add nsw i64 %140, 1
%142 = call i8* @malloc(i64 %141)
store i8* %142, i8** %10
%143 = icmp eq i8* %142, null
br i1 %143, label %144, label %156
144: ; preds = %137
%145 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%146 = load i32, i32* @stderr
%147 = call i32 @fflush(i32 %146)
%148 = load i32, i32* @errno
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %144
%151 = load i32, i32* @errno
br label %153
152: ; preds = %144
br label %153
153: ; preds = %152, %150
%154 = phi i32 [ %151, %150 ], [ -1, %152 ]
%155 = call i32 @exit(i32 %154)
unreachable
156: ; preds = %137
%157 = load i8*, i8** %10
%158 = load i64, i64* %12
%159 = getelementptr inbounds i8, i8* %157, i64 %158
store i8 0, i8* %159
%160 = load i8*, i8** %10
%161 = load i64, i64* %12
%162 = load i32*, i32** %7
%163 = call i64 @fullread(i8* %160, i32 1, i64 %161, i32* %162)
%164 = load i64, i64* %12
%165 = icmp ne i64 %163, %164
br i1 %165, label %166, label %178
166: ; preds = %156
%167 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%168 = load i32, i32* @stderr
%169 = call i32 @fflush(i32 %168)
%170 = load i32, i32* @errno
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %174
172: ; preds = %166
%173 = load i32, i32* @errno
br label %175
174: ; preds = %166
br label %175
175: ; preds = %174, %172
%176 = phi i32 [ %173, %172 ], [ -1, %174 ]
%177 = call i32 @exit(i32 %176)
unreachable
178: ; preds = %156
%179 = load i32*, i32** %7
%180 = call i32 @fclose(i32* %179)
%181 = load i8*, i8** %10
%182 = call i8* @parse(i8* %181)
store i8* %182, i8** %11
%183 = icmp ne i8* %182, null
br i1 %183, label %196, label %184
184: ; preds = %178
%185 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%186 = load i32, i32* @stderr
%187 = call i32 @fflush(i32 %186)
%188 = load i32, i32* @errno
%189 = icmp ne i32 %188, 0
br i1 %189, label %190, label %192
190: ; preds = %184
%191 = load i32, i32* @errno
br label %193
192: ; preds = %184
br label %193
193: ; preds = %192, %190
%194 = phi i32 [ %191, %190 ], [ -1, %192 ]
%195 = call i32 @exit(i32 %194)
unreachable
196: ; preds = %178
%197 = load i8*, i8** %11
%198 = call i64 @printparsed(i8* %197)
%199 = icmp ne i64 %198, 0
br i1 %199, label %200, label %212
200: ; preds = %196
%201 = call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%202 = load i32, i32* @stderr
%203 = call i32 @fflush(i32 %202)
%204 = load i32, i32* @errno
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %208
206: ; preds = %200
%207 = load i32, i32* @errno
br label %209
208: ; preds = %200
br label %209
209: ; preds = %208, %206
%210 = phi i32 [ %207, %206 ], [ -1, %208 ]
%211 = call i32 @exit(i32 %210)
unreachable
212: ; preds = %196
%213 = load i8*, i8** %10
%214 = call i32 @free(i8* %213)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"39\00"
@stderr = global i32 0
@errno = global i32 0
@.str.1 = [3 x i8] c"wb\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c"42\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [3 x i8] c"45\00"
@SEEK_END = global i32 0
@.str.5 = [3 x i8] c"48\00"
@.str.6 = [3 x i8] c"51\00"
@.str.7 = [3 x i8] c"55\00"
@.str.8 = [3 x i8] c"59\00"
@.str.9 = [3 x i8] c"63\00"
@.str.10 = [3 x i8] c"66\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %34, %2
%5 = phi i8* [ %39, %34 ], [ null, %2 ]
%6 = phi i8* [ %9, %34 ], [ null, %2 ]
%7 = phi i32 [ %36, %34 ], [ 0, %2 ]
br label %8
8: ; preds = %4, %28
%9 = phi i8* [ %6, %4 ], [ %33, %28 ]
%10 = phi i32 [ %7, %4 ], [ %30, %28 ]
br label %11
11: ; preds = %8, %23
%12 = phi i32 [ %24, %23 ], [ %10, %8 ]
%13 = sext i32 %12 to i64
br label %14
14: ; preds = %11, %18
%15 = phi i64 [ %13, %11 ], [ %16, %18 ]
%16 = add nsw i64 %15, 1
%17 = icmp slt i64 %16, %3
br i1 %17, label %18, label %40
18: ; preds = %14
%19 = getelementptr inbounds i8*, i8** %1, i64 %16
%20 = load i8*, i8** %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 45
br i1 %22, label %23, label %14
23: ; preds = %18
%24 = trunc i64 %16 to i32
%25 = getelementptr inbounds i8, i8* %20, i64 1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
switch i32 %27, label %11 [
i32 105, label %28
i32 111, label %34
]
28: ; preds = %23
%29 = trunc i64 %15 to i32
%30 = add nsw i32 %29, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %1, i64 %31
%33 = load i8*, i8** %32
br label %8
34: ; preds = %23
%35 = trunc i64 %15 to i32
%36 = add nsw i32 %35, 2
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %1, i64 %37
%39 = load i8*, i8** %38
br label %4
40: ; preds = %14
%41 = icmp eq i8* %9, null
%42 = icmp eq i8* %5, null
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %44, label %52
44: ; preds = %40
%45 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 @fflush(i32 %46)
%48 = load i32, i32* @errno
%49 = icmp eq i32 %48, 0
%50 = select i1 %49, i32 -1, i32 %48
%51 = tail call i32 @exit(i32 %50)
unreachable
52: ; preds = %40
%53 = load i32, i32* @stdout
%54 = tail call i32* @freopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %64
56: ; preds = %52
%57 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = tail call i32 @fflush(i32 %58)
%60 = load i32, i32* @errno
%61 = icmp eq i32 %60, 0
%62 = select i1 %61, i32 -1, i32 %60
%63 = tail call i32 @exit(i32 %62)
unreachable
64: ; preds = %52
%65 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%66 = icmp eq i32* %65, null
br i1 %66, label %67, label %75
67: ; preds = %64
%68 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = tail call i32 @fflush(i32 %69)
%71 = load i32, i32* @errno
%72 = icmp eq i32 %71, 0
%73 = select i1 %72, i32 -1, i32 %71
%74 = tail call i32 @exit(i32 %73)
unreachable
75: ; preds = %64
%76 = load i32, i32* @SEEK_END
%77 = tail call i64 @fseek(i32* %65, i32 0, i32 %76)
%78 = icmp eq i64 %77, 0
br i1 %78, label %87, label %79
79: ; preds = %75
%80 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%81 = load i32, i32* @stderr
%82 = tail call i32 @fflush(i32 %81)
%83 = load i32, i32* @errno
%84 = icmp eq i32 %83, 0
%85 = select i1 %84, i32 -1, i32 %83
%86 = tail call i32 @exit(i32 %85)
unreachable
87: ; preds = %75
%88 = tail call i64 @ftell(i32* %65)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %98
90: ; preds = %87
%91 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%92 = load i32, i32* @stderr
%93 = tail call i32 @fflush(i32 %92)
%94 = load i32, i32* @errno
%95 = icmp eq i32 %94, 0
%96 = select i1 %95, i32 -1, i32 %94
%97 = tail call i32 @exit(i32 %96)
unreachable
98: ; preds = %87
%99 = tail call i32 @rewind(i32* %65)
%100 = add nuw nsw i64 %88, 1
%101 = tail call i8* @malloc(i64 %100)
%102 = icmp eq i8* %101, null
br i1 %102, label %103, label %111
103: ; preds = %98
%104 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%105 = load i32, i32* @stderr
%106 = tail call i32 @fflush(i32 %105)
%107 = load i32, i32* @errno
%108 = icmp eq i32 %107, 0
%109 = select i1 %108, i32 -1, i32 %107
%110 = tail call i32 @exit(i32 %109)
unreachable
111: ; preds = %98
%112 = getelementptr inbounds i8, i8* %101, i64 %88
store i8 0, i8* %112
%113 = tail call i64 @fullread(i8* %101, i32 1, i64 %88, i32* %65)
%114 = icmp eq i64 %113, %88
br i1 %114, label %123, label %115
115: ; preds = %111
%116 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%117 = load i32, i32* @stderr
%118 = tail call i32 @fflush(i32 %117)
%119 = load i32, i32* @errno
%120 = icmp eq i32 %119, 0
%121 = select i1 %120, i32 -1, i32 %119
%122 = tail call i32 @exit(i32 %121)
unreachable
123: ; preds = %111
%124 = tail call i32 @fclose(i32* %65)
%125 = tail call i8* @parse(i8* %101)
%126 = icmp eq i8* %125, null
br i1 %126, label %127, label %135
127: ; preds = %123
%128 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%129 = load i32, i32* @stderr
%130 = tail call i32 @fflush(i32 %129)
%131 = load i32, i32* @errno
%132 = icmp eq i32 %131, 0
%133 = select i1 %132, i32 -1, i32 %131
%134 = tail call i32 @exit(i32 %133)
unreachable
135: ; preds = %123
%136 = tail call i64 @printparsed(i8* %125)
%137 = icmp eq i64 %136, 0
br i1 %137, label %146, label %138
138: ; preds = %135
%139 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%140 = load i32, i32* @stderr
%141 = tail call i32 @fflush(i32 %140)
%142 = load i32, i32* @errno
%143 = icmp eq i32 %142, 0
%144 = select i1 %143, i32 -1, i32 %142
%145 = tail call i32 @exit(i32 %144)
unreachable
146: ; preds = %135
%147 = tail call i32 @free(i8* %101)
ret i32 0
}