#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned char rom[1500];
  unsigned char ram[65536];
  FILE *arch;
  unsigned char b, opcode, c, x, exit = 0;
  char buf[80];
  int ptr = 0, oldptr, siz, count, scan, oldscan, index;
  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);
  ptr = 0x400;
  do {
    printf("%04x: ", ptr);
    gets(buf);
    scan = 0;
    oldscan = 0;
    index = 0;
    opcode = 0;
    do {
      while (buf[index] == ' ')
        index++;
      while (rom[scan] == ' ')
        scan++;
      b = buf[index];
      if (b >= 'a' && b <= 'z')
        b &= 223;
      c = rom[scan] & 127;
      x = rom[scan] & 128;
      if (b != c) {
        printf("(%02x)", opcode);
        while (rom[scan++] < 128)
          ;
        oldscan = scan;
        opcode++;
        index = 0;
        x = 0;
      } else {
        index++;
        scan++;
      }
    } while (!x && opcode < 256);
    if (opcode < 256) {
      oldscan--;
      printf("[%02x] ", opcode);
      do {
        printf("%c", rom[++oldscan] & 127);
      } while (rom[oldscan] < 128);
    } else {
      printf("***ERROR***");
    }
    printf("\n");
    ptr++;
  } while (-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10660,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x105ed(%rbp)
movl   $0x0,-0x10644(%rbp)
lea    0xe76(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x105e8(%rbp)
cmpq   $0x0,-0x105e8(%rbp)
jne    11c5 <main+0x65>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ed <main+0x38d>
mov    -0x105e8(%rbp),%rdi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <fseek@plt>
mov    -0x105e8(%rbp),%rdi
call   1050 <ftell@plt>
mov    %eax,-0x1064c(%rbp)
mov    -0x105e8(%rbp),%rdi
mov    0x2ddc(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <fseek@plt>
lea    -0x5e0(%rbp),%rdi
mov    -0x1064c(%rbp),%esi
mov    -0x105e8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
movl   $0x400,-0x10644(%rbp)
mov    -0x10644(%rbp),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10640(%rbp),%rdi
call   1060 <gets@plt>
movl   $0x0,-0x10654(%rbp)
movl   $0x0,-0x10658(%rbp)
movl   $0x0,-0x1065c(%rbp)
movb   $0x0,-0x105ea(%rbp)
jmp    1277 <main+0x117>
movslq -0x1065c(%rbp),%rax
movsbl -0x10640(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    12a3 <main+0x143>
mov    -0x1065c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1065c(%rbp)
jmp    1277 <main+0x117>
jmp    12a8 <main+0x148>
movslq -0x10654(%rbp),%rax
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    12d4 <main+0x174>
mov    -0x10654(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10654(%rbp)
jmp    12a8 <main+0x148>
movslq -0x1065c(%rbp),%rax
mov    -0x10640(%rbp,%rax,1),%al
mov    %al,-0x105e9(%rbp)
movzbl -0x105e9(%rbp),%eax
cmp    $0x61,%eax
jl     131a <main+0x1ba>
movzbl -0x105e9(%rbp),%eax
cmp    $0x7a,%eax
jg     131a <main+0x1ba>
movzbl -0x105e9(%rbp),%eax
and    $0xdf,%eax
mov    %al,-0x105e9(%rbp)
movslq -0x10654(%rbp),%rax
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
and    $0x7f,%eax
mov    %al,-0x105eb(%rbp)
movslq -0x10654(%rbp),%rax
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
and    $0x80,%eax
mov    %al,-0x105ec(%rbp)
movzbl -0x105e9(%rbp),%eax
movzbl -0x105eb(%rbp),%ecx
cmp    %ecx,%eax
je     13d2 <main+0x272>
movzbl -0x105ea(%rbp),%esi
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10654(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10654(%rbp)
cltq
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
cmp    $0x80,%eax
jge    13a2 <main+0x242>
jmp    1377 <main+0x217>
mov    -0x10654(%rbp),%eax
mov    %eax,-0x10658(%rbp)
mov    -0x105ea(%rbp),%al
add    $0x1,%al
mov    %al,-0x105ea(%rbp)
movl   $0x0,-0x1065c(%rbp)
movb   $0x0,-0x105ec(%rbp)
jmp    13f0 <main+0x290>
mov    -0x1065c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1065c(%rbp)
mov    -0x10654(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10654(%rbp)
jmp    13f5 <main+0x295>
xor    %eax,%eax
cmpb   $0x0,-0x105ec(%rbp)
mov    %al,-0x1065d(%rbp)
jne    141f <main+0x2bf>
movzbl -0x105ea(%rbp),%eax
cmp    $0x100,%eax
setl   %al
mov    %al,-0x1065d(%rbp)
mov    -0x1065d(%rbp),%al
test   $0x1,%al
jne    1272 <main+0x112>
movzbl -0x105ea(%rbp),%eax
cmp    $0x100,%eax
jge    14ac <main+0x34c>
mov    -0x10658(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10658(%rbp)
movzbl -0x105ea(%rbp),%esi
lea    0xbf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10658(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10658(%rbp)
cltq
movzbl -0x5e0(%rbp,%rax,1),%esi
ff
and    $0x7f,%esi
lea    0xbce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x10658(%rbp),%rax
movzbl -0x5e0(%rbp,%rax,1),%eax
ff
cmp    $0x80,%eax
jl     1463 <main+0x303>
jmp    14ba <main+0x35a>
lea    0xba4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10644(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10644(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    122d <main+0xcd>
jmp    14e6 <main+0x386>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x648,%rsp
lea    0xe68(%rip),%rdi
lea    0xe6b(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     132c <main+0x1ac>
mov    %rax,%rbx
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %rbx,%rdi
call   1070 <ftell@plt>
mov    %eax,%ebp
mov    0x2e04(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
lea    0x60(%rsp),%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
mov    $0x400,%esi
movabs $0xffffffff00000000,%r13
movabs $0x100000000,%r14
nopl   (%rax)
lea    0xdf6(%rip),%rdi
mov    %esi,0xc(%rsp)
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rdi
call   1080 <gets@plt>
xor    %r15d,%r15d
xor    %eax,%eax
xor    %r12d,%r12d
xor    %ecx,%ecx
jmp    124b <main+0xcb>
nopl   0x0(%rax,%rax,1)
and    $0x80,%dl
test   %dl,%dl
jne    12de <main+0x15e>
movslq %ecx,%rcx
xchg   %ax,%ax
movzbl 0x10(%rsp,%rcx,1),%esi
add    $0x1,%rcx
cmp    $0x20,%sil
je     1250 <main+0xd0>
mov    %rax,%rbp
shl    $0x20,%rbp
add    %r13,%rbp
cltq
nopl   0x0(%rax,%rax,1)
add    %r14,%rbp
movzbl 0x60(%rsp,%rax,1),%edx
add    $0x1,%rax
cmp    $0x20,%dl
je     1270 <main+0xf0>
lea    -0x61(%rsi),%edi
movzbl %sil,%ebx
and    $0xdf,%sil
cmp    $0x1a,%dil
movzbl %sil,%esi
cmovae %ebx,%esi
mov    %edx,%ebx
and    $0x7f,%bl
cmp    %bl,%sil
je     1240 <main+0xc0>
movzbl %r15b,%esi
lea    0xd68(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
sar    $0x20,%rbp
mov    %rbp,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x60(%rsp,%rax,1)
lea    0x1(%rax),%rax
jns    12c0 <main+0x140>
add    $0x1,%r15b
xor    %edx,%edx
mov    %eax,%r12d
xor    %ecx,%ecx
test   %dl,%dl
je     124b <main+0xcb>
movzbl %r15b,%esi
add    $0xffffffff,%r12d
lea    0xd2e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movslq %r12d,%rbp
lea    0x61(%rsp),%rax
add    %rax,%rbp
nop
movzbl 0x0(%rbp),%ebx
mov    %ebx,%edi
and    $0x7f,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
test   %bl,%bl
jns    1300 <main+0x180>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
add    $0x1,%esi
jmp    1210 <main+0x90>
lea    0xcf0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
add    $0x648,%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 = [7 x i8] c"%04x: \00"
@.str.4 = [7 x i8] c"(%02x)\00"
@.str.5 = [8 x i8] c"[%02x] \00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [12 x i8] c"***ERROR***\00"
@.str.8 = [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 i8
%9 = alloca i8
%10 = alloca [80 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %1
store i8 0, i8* %9
store i32 0, i32* %11
%18 = 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* %18, i32** %4
%19 = load i32*, i32** %4
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = 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 %167
23: ; preds = %0
%24 = load i32*, i32** %4
%25 = load i32, i32* @SEEK_END
%26 = call i32 @fseek(i32* %24, i32 0, i32 %25)
%27 = load i32*, i32** %4
%28 = call i32 @ftell(i32* %27)
store i32 %28, i32* %13
%29 = load i32*, i32** %4
%30 = load i32, i32* @SEEK_SET
%31 = call i32 @fseek(i32* %29, i32 0, i32 %30)
%32 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 0
%33 = load i32, i32* %13
%34 = load i32*, i32** %4
%35 = call i32 @fread(i8* %32, i32 %33, i32 1, i32* %34)
store i32 1024, i32* %11
br label %36
36: ; preds = %165, %23
%37 = load i32, i32* %11
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%40 = call i32 @gets(i8* %39)
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i8 0, i8* %6
br label %41
41: ; preds = %130, %36
br label %42
42: ; preds = %49, %41
%43 = load i32, i32* %17
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 32
br i1 %48, label %49, label %52
49: ; preds = %42
%50 = load i32, i32* %17
%51 = add nsw i32 %50, 1
store i32 %51, i32* %17
br label %42
52: ; preds = %42
br label %53
53: ; preds = %60, %52
%54 = load i32, i32* %15
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = icmp eq i32 %58, 32
br i1 %59, label %60, label %63
60: ; preds = %53
%61 = load i32, i32* %15
%62 = add nsw i32 %61, 1
store i32 %62, i32* %15
br label %53
63: ; preds = %53
%64 = load i32, i32* %17
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 %65
%67 = load i8, i8* %66
store i8 %67, i8* %5
%68 = load i8, i8* %5
%69 = zext i8 %68 to i32
%70 = icmp sge i32 %69, 97
br i1 %70, label %71, label %80
71: ; preds = %63
%72 = load i8, i8* %5
%73 = zext i8 %72 to i32
%74 = icmp sle i32 %73, 122
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = load i8, i8* %5
%77 = zext i8 %76 to i32
%78 = and i32 %77, 223
%79 = trunc i32 %78 to i8
store i8 %79, i8* %5
br label %80
80: ; preds = %75, %71, %63
%81 = load i32, i32* %15
%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, 127
%87 = trunc i32 %86 to i8
store i8 %87, i8* %7
%88 = load i32, i32* %15
%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, 128
%94 = trunc i32 %93 to i8
store i8 %94, i8* %8
%95 = load i8, i8* %5
%96 = zext i8 %95 to i32
%97 = load i8, i8* %7
%98 = zext i8 %97 to i32
%99 = icmp ne i32 %96, %98
br i1 %99, label %100, label %117
100: ; preds = %80
%101 = load i8, i8* %6
%102 = zext i8 %101 to i32
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %102)
br label %104
104: ; preds = %112, %100
%105 = load i32, i32* %15
%106 = add nsw i32 %105, 1
store i32 %106, i32* %15
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %107
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = icmp slt i32 %110, 128
br i1 %111, label %112, label %113
112: ; preds = %104
br label %104
113: ; preds = %104
%114 = load i32, i32* %15
store i32 %114, i32* %16
%115 = load i8, i8* %6
%116 = add i8 %115, 1
store i8 %116, i8* %6
store i32 0, i32* %17
store i8 0, i8* %8
br label %122
117: ; preds = %80
%118 = load i32, i32* %17
%119 = add nsw i32 %118, 1
store i32 %119, i32* %17
%120 = load i32, i32* %15
%121 = add nsw i32 %120, 1
store i32 %121, i32* %15
br label %122
122: ; preds = %117, %113
br label %123
123: ; preds = %122
%124 = load i8, i8* %8
%125 = icmp ne i8 %124, 0
br i1 %125, label %130, label %126
126: ; preds = %123
%127 = load i8, i8* %6
%128 = zext i8 %127 to i32
%129 = icmp slt i32 %128, 256
br label %130
130: ; preds = %126, %123
%131 = phi i1 [ false, %123 ], [ %129, %126 ]
br i1 %131, label %41, label %132
132: ; preds = %130
%133 = load i8, i8* %6
%134 = zext i8 %133 to i32
%135 = icmp slt i32 %134, 256
br i1 %135, label %136, label %159
136: ; preds = %132
%137 = load i32, i32* %16
%138 = add nsw i32 %137, -1
store i32 %138, i32* %16
%139 = load i8, i8* %6
%140 = zext i8 %139 to i32
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %140)
br label %142
142: ; preds = %151, %136
%143 = load i32, i32* %16
%144 = add nsw i32 %143, 1
store i32 %144, i32* %16
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %145
%147 = load i8, i8* %146
%148 = zext i8 %147 to i32
%149 = and i32 %148, 127
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %149)
br label %151
151: ; preds = %142
%152 = load i32, i32* %16
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [1500 x i8], [1500 x i8]* %2, i64 0, i64 %153
%155 = load i8, i8* %154
%156 = zext i8 %155 to i32
%157 = icmp slt i32 %156, 128
br i1 %157, label %142, label %158
158: ; preds = %151
br label %161
159: ; preds = %132
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %161
161: ; preds = %159, %158
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%163 = load i32, i32* %11
%164 = add nsw i32 %163, 1
store i32 %164, i32* %11
br label %165
165: ; preds = %161
br i1 true, label %36, label %166
166: ; preds = %165
store i32 0, i32* %1
br label %167
167: ; preds = %166, %21
%168 = load i32, i32* %1
ret i32 %168
}

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 = [7 x i8] c"%04x: \00"
@.str.4 = [7 x i8] c"(%02x)\00"
@.str.5 = [8 x i8] c"[%02x] \00"
@str = [48 x i8] c"\0A***Problem opening Opcode List '65C02.bin'!***\00"
define i32 @main() {
%1 = alloca [1500 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 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 %7, label %9
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 -1
9: ; preds = %0
%10 = load i32, i32* @SEEK_END
%11 = tail call i32 @fseek(i32* %5, i32 0, i32 %10)
%12 = tail call i32 @ftell(i32* %5)
%13 = load i32, i32* @SEEK_SET
%14 = tail call i32 @fseek(i32* %5, i32 0, i32 %13)
%15 = call i32 @fread(i8* %3, i32 %12, i32 1, i32* %5)
br label %16
16: ; preds = %88, %9
%17 = phi i32 [ 1024, %9 ], [ %90, %88 ]
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = call i32 @gets(i8* %4)
br label %20
20: ; preds = %67, %16
%21 = phi i8 [ 0, %16 ], [ %69, %67 ]
%22 = phi i64 [ 0, %16 ], [ %70, %67 ]
%23 = phi i32 [ 0, %16 ], [ %71, %67 ]
%24 = phi i64 [ 0, %16 ], [ %72, %67 ]
%25 = shl i64 %24, 32
%26 = ashr exact i64 %25, 32
br label %27
27: ; preds = %27, %20
%28 = phi i64 [ %32, %27 ], [ %26, %20 ]
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 32
%32 = add i64 %28, 1
br i1 %31, label %27, label %33
33: ; preds = %27
%34 = shl i64 %22, 32
%35 = ashr exact i64 %34, 32
br label %36
36: ; preds = %36, %33
%37 = phi i64 [ %41, %36 ], [ %35, %33 ]
%38 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 32
%41 = add i64 %37, 1
br i1 %40, label %36, label %42
42: ; preds = %36
%43 = add i8 %30, -97
%44 = icmp ult i8 %43, 26
%45 = and i8 %30, -33
%46 = select i1 %44, i8 %45, i8 %30
%47 = and i8 %39, 127
%48 = icmp eq i8 %46, %47
br i1 %48, label %63, label %49
49: ; preds = %42
%50 = zext i8 %21 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = shl i64 %37, 32
%53 = ashr exact i64 %52, 32
br label %54
54: ; preds = %54, %49
%55 = phi i64 [ %56, %54 ], [ %53, %49 ]
%56 = add i64 %55, 1
%57 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %55
%58 = load i8, i8* %57
%59 = icmp sgt i8 %58, -1
br i1 %59, label %54, label %60
60: ; preds = %54
%61 = trunc i64 %56 to i32
%62 = add i8 %21, 1
br label %67
63: ; preds = %42
%64 = and i8 %39, -128
%65 = add i64 %28, 1
%66 = add i64 %37, 1
br label %67
67: ; preds = %60, %63
%68 = phi i8 [ 0, %60 ], [ %64, %63 ]
%69 = phi i8 [ %62, %60 ], [ %21, %63 ]
%70 = phi i64 [ %56, %60 ], [ %66, %63 ]
%71 = phi i32 [ %61, %60 ], [ %23, %63 ]
%72 = phi i64 [ 0, %60 ], [ %65, %63 ]
%73 = icmp eq i8 %68, 0
br i1 %73, label %20, label %74
74: ; preds = %67
%75 = zext i8 %69 to i32
%76 = add i32 %71, -1
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %75)
%78 = sext i32 %76 to i64
br label %79
79: ; preds = %79, %74
%80 = phi i64 [ %81, %79 ], [ %78, %74 ]
%81 = add i64 %80, 1
%82 = getelementptr inbounds [1500 x i8], [1500 x i8]* %1, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = and i8 %83, 127
%85 = zext i8 %84 to i32
%86 = call i32 @putchar(i32 %85)
%87 = icmp sgt i8 %83, -1
br i1 %87, label %79, label %88
88: ; preds = %79
%89 = call i32 @putchar(i32 10)
%90 = add nuw nsw i32 %17, 1
br label %16
}