#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 /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned char rom[1500];
  unsigned char ram[65536];
  FILE *arch;
  unsigned char c, opcode, flag;
  int ptr = 0, oldptr, siz, count, scan;
  arch = fopen("65C02.bin", "rb");
  if (arch == NULL) {
    printf("\n***Problem opening Opcode List '65C02.bin'!***\n");
    return -1;
  }
  fseek(arch, 0, SEEK_END);
  siz = ftell(arch);
  fseek(arch, 0, SEEK_SET);
  fread(rom, siz, 1, arch);
  arch = fopen("test.bin", "rb");
  if (arch == NULL) {
    printf("\n***Problem opening CODE!***\n");
    return -1;
  }
  fseek(arch, 0, SEEK_END);
  siz = ftell(arch);
  fseek(arch, 0, SEEK_SET);
  fread(ram, siz, 1, arch);
  do {
    opcode = ram[ptr];
    printf("%04x: %02x... ", ptr, opcode);
    count = 0;
    scan = 0;
    while (opcode != count) {
      while (rom[scan] < 128)
        scan++;
      scan++;
      count++;
    }
    do {
      flag = rom[scan] & 128;
      c = rom[scan] & 127;
      switch (c) {
      case '@':
        printf("$%02x", ram[++ptr]);
        break;
      case '&':
        printf("$%04x", ram[++ptr] + 256 * ram[++ptr]);
        break;
      default:
        printf("%c", c);
      }
      scan++;
    } while (!flag);
    ptr++;
    printf("\n");
  } while (ram[ptr]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10610,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x105f0(%rbp)
lea    0xe8d(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x105e8(%rbp)
cmpq   $0x0,-0x105e8(%rbp)
jne    11ae <main+0x5e>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    149f <main+0x34f>
mov    -0x105e8(%rbp),%rdi
mov    0x2e2c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <fseek@plt>
mov    -0x105e8(%rbp),%rdi
call   1050 <ftell@plt>
mov    %eax,-0x105f8(%rbp)
mov    -0x105e8(%rbp),%rdi
mov    0x2df3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <fseek@plt>
lea    -0x5e0(%rbp),%rdi
mov    -0x105f8(%rbp),%esi
mov    -0x105e8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
lea    0xe2b(%rip),%rdi
lea    0xdf0(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x105e8(%rbp)
cmpq   $0x0,-0x105e8(%rbp)
jne    124e <main+0xfe>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    149f <main+0x34f>
mov    -0x105e8(%rbp),%rdi
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <fseek@plt>
mov    -0x105e8(%rbp),%rdi
call   1050 <ftell@plt>
mov    %eax,-0x105f8(%rbp)
mov    -0x105e8(%rbp),%rdi
mov    0x2d53(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <fseek@plt>
lea    -0x105e0(%rbp),%rdi
mov    -0x105f8(%rbp),%esi
mov    -0x105e8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
movslq -0x105f0(%rbp),%rax
mov    -0x105e0(%rbp,%rax,1),%al
mov    %al,-0x105ea(%rbp)
mov    -0x105f0(%rbp),%esi
movzbl -0x105ea(%rbp),%edx
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x105fc(%rbp)
movl   $0x0,-0x10600(%rbp)
movzbl -0x105ea(%rbp),%eax
cmp    -0x105fc(%rbp),%eax
je     1358 <main+0x208>
jmp    1307 <main+0x1b7>
movslq -0x10600(%rbp),%rax
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
cmp    $0x80,%eax
jge    1335 <main+0x1e5>
mov    -0x10600(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10600(%rbp)
jmp    1307 <main+0x1b7>
mov    -0x10600(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10600(%rbp)
mov    -0x105fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105fc(%rbp)
jmp    12ef <main+0x19f>
jmp    135d <main+0x20d>
movslq -0x10600(%rbp),%rax
mov    -0x5e0(%rbp,%rax,1),%al
and    $0x80,%al
mov    %al,-0x105eb(%rbp)
movslq -0x10600(%rbp),%rax
mov    -0x5e0(%rbp,%rax,1),%al
and    $0x7f,%al
mov    %al,-0x105e9(%rbp)
movzbl -0x105e9(%rbp),%eax
mov    %eax,-0x10604(%rbp)
sub    $0x26,%eax
je     13e4 <main+0x294>
jmp    13a4 <main+0x254>
mov    -0x10604(%rbp),%eax
sub    $0x40,%eax
jne    142e <main+0x2de>
jmp    13b8 <main+0x268>
mov    -0x105f0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105f0(%rbp)
cltq
movzbl -0x105e0(%rbp,%rax,1),%esi
ff
lea    0xc9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1443 <main+0x2f3>
mov    -0x105f0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105f0(%rbp)
cltq
movzbl -0x105e0(%rbp,%rax,1),%esi
ff
mov    -0x105f0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105f0(%rbp)
cltq
movzbl -0x105e0(%rbp,%rax,1),%eax
ff
shl    $0x8,%eax
add    %eax,%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1443 <main+0x2f3>
movzbl -0x105e9(%rbp),%esi
lea    0xc44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10600(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10600(%rbp)
cmpb   $0x0,-0x105eb(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    135d <main+0x20d>
mov    -0x105f0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x105f0(%rbp)
lea    0xbc0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x105f0(%rbp),%rax
cmpb   $0x0,-0x105e0(%rbp,%rax,1)
jne    12ac <main+0x15c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10610,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x105e8,%rsp
lea    0xe78(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     137d <main+0x20d>
mov    %rax,%rbx
mov    0x2e41(%rip),%r14
mov    (%r14),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
mov    %rbx,%rdi
call   1070 <ftell@plt>
mov    %eax,%ebp
mov    0x2e13(%rip),%r15
mov    (%r15),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
mov    %rsp,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
lea    0xe22(%rip),%rdi
lea    0xe18(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1386 <main+0x216>
mov    %rax,%rbx
mov    (%r14),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
mov    %rbx,%rdi
call   1070 <ftell@plt>
mov    %eax,%ebp
mov    (%r15),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
lea    0x5e0(%rsp),%r12
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
mov    0x5e0(%rsp),%r15b
movabs $0x100000000,%r14
xor    %r13d,%r13d
jmp    1282 <main+0x112>
nopl   0x0(%rax,%rax,1)
movslq %r13d,%rbx
lea    0x1(%rbx),%r13
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x5e1(%rsp,%rbx,1),%r15b
test   %r15b,%r15b
je     1379 <main+0x209>
mov    %r12,%rbx
movzbl %r15b,%ebp
xor    %r12d,%r12d
lea    0xd83(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
test   %bpl,%bpl
je     130d <main+0x19d>
xor    %r12d,%r12d
cmp    $0x1,%r15b
je     12f3 <main+0x183>
and    $0xfffffffe,%ebp
xor    %r12d,%r12d
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movslq %r12d,%r12
lea    (%rsp,%r12,1),%rcx
shl    $0x20,%r12
nopl   0x0(%rax,%rax,1)
add    %r14,%r12
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jns    12d0 <main+0x160>
sar    $0x20,%r12
cmpb   $0x0,(%rsp,%r12,1)
lea    0x1(%r12),%r12
jns    12e0 <main+0x170>
add    $0x2,%eax
cmp    %ebp,%eax
jne    12c0 <main+0x150>
test   $0x1,%r15b
je     130d <main+0x19d>
movslq %r12d,%rax
add    %rsp,%rax
nop
add    $0x1,%r12d
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jns    1300 <main+0x190>
movslq %r12d,%rax
lea    (%rsp,%rax,1),%rbp
mov    %rbx,%r12
lea    0xd0d(%rip),%r15
jmp    1331 <main+0x1c1>
call   1030 <putchar@plt>
add    $0x1,%rbp
test   %bl,%bl
js     1260 <main+0xf0>
movzbl 0x0(%rbp),%ebx
mov    %ebx,%edi
and    $0x7f,%edi
cmp    $0x26,%edi
je     1360 <main+0x1f0>
cmp    $0x40,%edi
jne    1320 <main+0x1b0>
movslq %r13d,%r13
movzbl 0x5e1(%rsp,%r13,1),%esi
add    $0x1,%r13
lea    0xcca(%rip),%rdi
jmp    1370 <main+0x200>
nopl   (%rax)
movslq %r13d,%rax
lea    0x2(%rax),%r13d
movzwl 0x1(%rax,%r12,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1325 <main+0x1b5>
xor    %eax,%eax
jmp    1397 <main+0x227>
lea    0xcca(%rip),%rdi
jmp    138d <main+0x21d>
lea    0xca4(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
add    $0x105e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"65C02.bin\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [49 x i8] c"\0A***Problem opening Opcode List '65C02.bin'!***\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [9 x i8] c"test.bin\00"
@.str.4 = [30 x i8] c"\0A***Problem opening CODE!***\0A\00"
@.str.5 = [15 x i8] c"%04x: %02x... \00"
@.str.6 = [6 x i8] c"$%02x\00"
@.str.7 = [6 x i8] c"$%04x\00"
@.str.8 = [3 x i8] c"%c\00"
@.str.9 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1500 x i8]
%3 = alloca [65536 x i8]
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %8
%13 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %4
%14 = load i32*, i32** %4
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %143
18: ; preds = %0
%19 = load i32*, i32** %4
%20 = load i32, i32* @SEEK_END
%21 = call i32 @fseek(i32* %19, i32 0, i32 %20)
%22 = load i32*, i32** %4
%23 = call i32 @ftell(i32* %22)
store i32 %23, i32* %10
%24 = load i32*, i32** %4
%25 = load i32, i32* @SEEK_SET
%26 = call i32 @fseek(i32* %24, i32 0, i32 %25)
%27 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 0
%28 = load i32, i32* %10
%29 = load i32*, i32** %4
%30 = call i32 @fread(i8* %27, i32 %28, i32 1, i32* %29)
%31 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %31, i32** %4
%32 = load i32*, i32** %4
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %18
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %1
br label %143
36: ; preds = %18
%37 = load i32*, i32** %4
%38 = load i32, i32* @SEEK_END
%39 = call i32 @fseek(i32* %37, i32 0, i32 %38)
%40 = load i32*, i32** %4
%41 = call i32 @ftell(i32* %40)
store i32 %41, i32* %10
%42 = load i32*, i32** %4
%43 = load i32, i32* @SEEK_SET
%44 = call i32 @fseek(i32* %42, i32 0, i32 %43)
%45 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%46 = load i32, i32* %10
%47 = load i32*, i32** %4
%48 = call i32 @fread(i8* %45, i32 %46, i32 1, i32* %47)
br label %49
49: ; preds = %136, %36
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %51
%53 = load i8, i8* %52
store i8 %53, i8* %6
%54 = load i32, i32* %8
%55 = load i8, i8* %6
%56 = zext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %54, i32 %56)
store i32 0, i32* %11
store i32 0, i32* %12
br label %58
58: ; preds = %74, %49
%59 = load i8, i8* %6
%60 = zext i8 %59 to i32
%61 = load i32, i32* %11
%62 = icmp ne i32 %60, %61
br i1 %62, label %63, label %79
63: ; preds = %58
br label %64
64: ; preds = %71, %63
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = icmp slt i32 %69, 128
br i1 %70, label %71, label %74
71: ; preds = %64
%72 = load i32, i32* %12
%73 = add nsw i32 %72, 1
store i32 %73, i32* %12
br label %64
74: ; preds = %64
%75 = load i32, i32* %12
%76 = add nsw i32 %75, 1
store i32 %76, i32* %12
%77 = load i32, i32* %11
%78 = add nsw i32 %77, 1
store i32 %78, i32* %11
br label %58
79: ; preds = %58
br label %80
80: ; preds = %128, %79
%81 = load i32, i32* %12
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = and i32 %85, 128
%87 = trunc i32 %86 to i8
store i8 %87, i8* %7
%88 = load i32, i32* %12
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = and i32 %92, 127
%94 = trunc i32 %93 to i8
store i8 %94, i8* %5
%95 = load i8, i8* %5
%96 = zext i8 %95 to i32
switch i32 %96, label %121 [
i32 64, label %97
i32 38, label %105
]
97: ; preds = %80
%98 = load i32, i32* %8
%99 = add nsw i32 %98, 1
store i32 %99, i32* %8
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %103)
br label %125
105: ; preds = %80
%106 = load i32, i32* %8
%107 = add nsw i32 %106, 1
store i32 %107, i32* %8
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = zext i8 %110 to i32
%112 = load i32, i32* %8
%113 = add nsw i32 %112, 1
store i32 %113, i32* %8
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
%118 = mul nsw i32 256, %117
%119 = add nsw i32 %111, %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %119)
br label %125
121: ; preds = %80
%122 = load i8, i8* %5
%123 = zext i8 %122 to i32
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 %123)
br label %125
125: ; preds = %121, %105, %97
%126 = load i32, i32* %12
%127 = add nsw i32 %126, 1
store i32 %127, i32* %12
br label %128
128: ; preds = %125
%129 = load i8, i8* %7
%130 = icmp ne i8 %129, 0
%131 = xor i1 %130, true
br i1 %131, label %80, label %132
132: ; preds = %128
%133 = load i32, i32* %8
%134 = add nsw i32 %133, 1
store i32 %134, i32* %8
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %136
136: ; preds = %132
%137 = load i32, i32* %8
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = icmp ne i8 %140, 0
br i1 %141, label %49, label %142
142: ; preds = %136
store i32 0, i32* %1
br label %143
143: ; preds = %142, %34, %16
%144 = load i32, i32* %1
ret i32 %144
}

LLVM IR (-O2):
@.str = [10 x i8] c"65C02.bin\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [9 x i8] c"test.bin\00"
@.str.5 = [15 x i8] c"%04x: %02x... \00"
@.str.6 = [6 x i8] c"$%02x\00"
@.str.7 = [6 x i8] c"$%04x\00"
@str = [29 x i8] c"\0A***Problem opening CODE!***\00"
@str.10 = [48 x i8] c"\0A***Problem opening Opcode List '65C02.bin'!***\00"
define i32 @main() {
%1 = alloca [1500 x i8]
%2 = alloca [65536 x i8]
%3 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %119, label %7
7: ; preds = %0
%8 = load i32, i32* @SEEK_END
%9 = tail call i32 @fseek(i32* %5, i32 0, i32 %8)
%10 = tail call i32 @ftell(i32* %5)
%11 = load i32, i32* @SEEK_SET
%12 = tail call i32 @fseek(i32* %5, i32 0, i32 %11)
%13 = call i32 @fread(i8* %3, i32 %10, i32 1, i32* %5)
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %119, label %16
16: ; preds = %7
%17 = load i32, i32* @SEEK_END
%18 = tail call i32 @fseek(i32* %14, i32 0, i32 %17)
%19 = tail call i32 @ftell(i32* %14)
%20 = load i32, i32* @SEEK_SET
%21 = tail call i32 @fseek(i32* %14, i32 0, i32 %20)
%22 = call i32 @fread(i8* %4, i32 %19, i32 1, i32* %14)
%23 = load i8, i8* %4
br label %24
24: ; preds = %112, %16
%25 = phi i8 [ %23, %16 ], [ %117, %112 ]
%26 = phi i32 [ 0, %16 ], [ %113, %112 ]
%27 = zext i8 %25 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %26, i32 %27)
%29 = icmp eq i8 %25, 0
br i1 %29, label %50, label %30
30: ; preds = %24
%31 = and i32 %27, 1
%32 = icmp eq i8 %25, 1
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = and i32 %27, 254
br label %53
35: ; preds = %73, %30
%36 = phi i32 [ undef, %30 ], [ %75, %73 ]
%37 = phi i32 [ 0, %30 ], [ %75, %73 ]
%38 = icmp eq i32 %31, 0
br i1 %38, label %50, label %39
39: ; preds = %35
%40 = sext i32 %37 to i64
br label %41
41: ; preds = %41, %39
%42 = phi i64 [ %46, %41 ], [ %40, %39 ]
%43 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = icmp sgt i8 %44, -1
%46 = add i64 %42, 1
br i1 %45, label %41, label %47
47: ; preds = %41
%48 = trunc i64 %42 to i32
%49 = add nsw i32 %48, 1
br label %50
50: ; preds = %47, %35, %24
%51 = phi i32 [ 0, %24 ], [ %36, %35 ], [ %49, %47 ]
%52 = sext i32 %51 to i64
br label %78
53: ; preds = %73, %33
%54 = phi i32 [ 0, %33 ], [ %75, %73 ]
%55 = phi i32 [ 0, %33 ], [ %76, %73 ]
%56 = sext i32 %54 to i64
br label %57
57: ; preds = %57, %53
%58 = phi i64 [ %62, %57 ], [ %56, %53 ]
%59 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = icmp sgt i8 %60, -1
%62 = add i64 %58, 1
br i1 %61, label %57, label %63
63: ; preds = %57
%64 = shl i64 %58, 32
%65 = add i64 %64, 4294967296
%66 = ashr exact i64 %65, 32
br label %67
67: ; preds = %67, %63
%68 = phi i64 [ %72, %67 ], [ %66, %63 ]
%69 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = icmp sgt i8 %70, -1
%72 = add i64 %68, 1
br i1 %71, label %67, label %73
73: ; preds = %67
%74 = trunc i64 %68 to i32
%75 = add nsw i32 %74, 1
%76 = add i32 %55, 2
%77 = icmp eq i32 %76, %34
br i1 %77, label %35, label %53
78: ; preds = %50, %108
%79 = phi i64 [ %52, %50 ], [ %110, %108 ]
%80 = phi i32 [ %26, %50 ], [ %109, %108 ]
%81 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %79
%82 = load i8, i8* %81
%83 = and i8 %82, 127
%84 = zext i8 %83 to i32
switch i32 %84, label %106 [
i32 64, label %85
i32 38, label %92
]
85: ; preds = %78
%86 = add nsw i32 %80, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 %87
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %90)
br label %108
92: ; preds = %78
%93 = add nsw i32 %80, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 %94
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = add nsw i32 %80, 2
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 %99
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = shl nuw nsw i32 %102, 8
%104 = or i32 %103, %97
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %104)
br label %108
106: ; preds = %78
%107 = tail call i32 @putchar(i32 %84)
br label %108
108: ; preds = %106, %92, %85
%109 = phi i32 [ %80, %106 ], [ %98, %92 ], [ %86, %85 ]
%110 = add i64 %79, 1
%111 = icmp sgt i8 %82, -1
br i1 %111, label %78, label %112
112: ; preds = %108
%113 = add nsw i32 %109, 1
%114 = tail call i32 @putchar(i32 10)
%115 = sext i32 %113 to i64
%116 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 %115
%117 = load i8, i8* %116
%118 = icmp eq i8 %117, 0
br i1 %118, label %122, label %24
119: ; preds = %7, %0
%120 = phi i8* [ getelementptr inbounds ([48 x i8], [48 x i8]* @str.10, i64 0, i64 0), %0 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0), %7 ]
%121 = tail call i32 @puts(i8* dereferenceable(1) %120)
br label %122
122: ; preds = %112, %119
%123 = phi i32 [ -1, %119 ], [ 0, %112 ]
ret i32 %123
}