#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 uint16_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, unsigned char *, int);
int main(void) {
  int fd;
  unsigned char buf[128000];
  unsigned char *size;
  uint16_t *offset;
  int i;
  int j;
  int num_line;
  unsigned char *ptr;
  int not1;
  char result[128];
  int res_i;
  fd = open("../data_1_3_1_patch/FONTS.LBX", O_RDONLY);
  if (fd == -1) {
    printf("Error opening file\n");
    exit(0);
  }
  read(fd, buf, 0x6000);
  size = buf + 0x4ba;
  offset = (uint16_t *)(buf + 0x7ba);
  for (i = 0; i < 768; i++) {
    not1 = 0;
    res_i = 0;
    num_line = size[i];
    printf("%c. %d lines\n", (i % 96) + 32, num_line);
    ptr = buf + 0x320 + offset[i];
    printf("offset = %04x\n", offset[i]);
    while (num_line > 0) {
      while (*ptr != 0x80) {
        printf("%02X ", *ptr);
        if (*ptr > 0x80) {
          for (j = 0; j < (*ptr & 0x7f); j++) {
            result[res_i] = ' ';
            res_i++;
          }
        } else {
          if ((*ptr & 0x0f) != 1) {
            not1 = 1;
          }
          for (j = 0; j < (*ptr >> 4); j++) {
            result[res_i] = '0' + (*ptr & 0x0f);
            res_i++;
          }
        }
        ptr++;
      }
      printf("%02X ", *ptr);
      result[res_i] = '\n';
      res_i++;
      num_line--;
      ptr++;
    }
    printf("\n");
    printf("\n");
    result[res_i] = 0;
    printf("%s", result);
    printf("\n");
    if (not1) {
      printf("Not 1\n");
    }
    printf("\n");
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f4d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
lea    0xe8e(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1199 <main+0x49>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%edi
lea    -0x1f410(%rbp),%rsi
mov    $0x6000,%edx
call   1050 <read@plt>
lea    -0x1f410(%rbp),%rax
add    $0x4ba,%rax
mov    %rax,-0x1f418(%rbp)
lea    -0x1f410(%rbp),%rax
add    $0x7ba,%rax
mov    %rax,-0x1f420(%rbp)
movl   $0x0,-0x1f424(%rbp)
cmpl   $0x300,-0x1f424(%rbp)
jge    14c5 <main+0x375>
movl   $0x0,-0x1f43c(%rbp)
movl   $0x0,-0x1f4c4(%rbp)
mov    -0x1f418(%rbp),%rax
movslq -0x1f424(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1f42c(%rbp)
mov    -0x1f424(%rbp),%eax
mov    $0x60,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x20,%esi
mov    -0x1f42c(%rbp),%edx
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1f410(%rbp),%rax
add    $0x320,%rax
mov    -0x1f420(%rbp),%rcx
movslq -0x1f424(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
add    %rcx,%rax
mov    %rax,-0x1f438(%rbp)
mov    -0x1f420(%rbp),%rax
movslq -0x1f424(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1f42c(%rbp)
jle    143a <main+0x2ea>
jmp    129c <main+0x14c>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x80,%eax
je     13de <main+0x28e>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%esi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x80,%eax
jle    133a <main+0x1ea>
movl   $0x0,-0x1f428(%rbp)
mov    -0x1f428(%rbp),%eax
mov    -0x1f438(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x7f,%ecx
cmp    %ecx,%eax
jge    1335 <main+0x1e5>
movslq -0x1f4c4(%rbp),%rax
movb   $0x20,-0x1f4c0(%rbp,%rax,1)
20
mov    -0x1f4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f4c4(%rbp)
mov    -0x1f428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f428(%rbp)
jmp    12e8 <main+0x198>
jmp    13c7 <main+0x277>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%eax
and    $0xf,%eax
cmp    $0x1,%eax
je     135a <main+0x20a>
movl   $0x1,-0x1f43c(%rbp)
movl   $0x0,-0x1f428(%rbp)
mov    -0x1f428(%rbp),%eax
mov    -0x1f438(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x4,%ecx
cmp    %ecx,%eax
jge    13c2 <main+0x272>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%eax
and    $0xf,%eax
add    $0x30,%eax
mov    %al,%cl
movslq -0x1f4c4(%rbp),%rax
mov    %cl,-0x1f4c0(%rbp,%rax,1)
mov    -0x1f4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f4c4(%rbp)
mov    -0x1f428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f428(%rbp)
jmp    1364 <main+0x214>
jmp    13c7 <main+0x277>
mov    -0x1f438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1f438(%rbp)
jmp    129c <main+0x14c>
mov    -0x1f438(%rbp),%rax
movzbl (%rax),%esi
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x1f4c4(%rbp),%rax
movb   $0xa,-0x1f4c0(%rbp,%rax,1)
0a
mov    -0x1f4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f4c4(%rbp)
mov    -0x1f42c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1f42c(%rbp)
mov    -0x1f438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1f438(%rbp)
jmp    128a <main+0x13a>
lea    0xc1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x1f4c4(%rbp),%rax
movb   $0x0,-0x1f4c0(%rbp,%rax,1)
lea    -0x1f4c0(%rbp),%rsi
lea    0xbe2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1f43c(%rbp)
je     14a3 <main+0x353>
lea    0xbbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1f424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f424(%rbp)
jmp    11df <main+0x8f>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x1f4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f498,%rsp
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
lea    0xe6f(%rip),%rdi
call   1080 <open@plt>
cmp    $0xffffffff,%eax
je     13b0 <main+0x240>
lea    0x90(%rsp),%rsi
mov    %eax,0x4(%rsp)
mov    %eax,%edi
mov    $0x6000,%edx
call   1070 <read@plt>
lea    0xe7d(%rip),%r14
mov    $0x1,%r12d
xor    %ebx,%ebx
jmp    11f0 <main+0x80>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%rbx
add    $0x1,%rbx
cmp    $0x300,%rbx
je     1393 <main+0x223>
movzbl 0x54a(%rsp,%rbx,1),%r13d
movzwl %bx,%eax
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
and    $0xffffffe0,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %ebx,%eax
add    $0x20,%eax
movzwl %ax,%esi
lea    0xe02(%rip),%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,0x8(%rsp)
mov    0x84a(%rsp,%rbx,4),%ebp
lea    0xdf3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x0,%r15d
mov    $0x0,%ebx
test   %r13d,%r13d
je     1340 <main+0x1d0>
movslq %ebp,%rbp
lea    0x3b0(%rsp),%rax
add    %rax,%rbp
xor    %ebx,%ebx
xor    %r15d,%r15d
jmp    129f <main+0x12f>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movslq %ebx,%rbx
movb   $0xa,0x10(%rsp,%rbx,1)
add    $0x1,%ebx
lea    -0x1(%r13),%eax
add    $0x1,%rbp
cmp    $0x1,%r13d
mov    %eax,%r13d
jle    1340 <main+0x1d0>
mov    0x0(%rbp),%al
jmp    12b7 <main+0x147>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x1(%rbp),%al
add    $0x1,%rbp
cmp    $0x80,%al
je     1270 <main+0x100>
movzbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%al
cmp    $0x81,%al
jb     1300 <main+0x190>
test   $0x7f,%al
je     12b0 <main+0x140>
movslq %ebx,%rax
lea    (%rsp,%rax,1),%rcx
add    $0x10,%rcx
xor    %eax,%eax
movb   $0x20,(%rcx,%rax,1)
movzbl 0x0(%rbp),%edx
and    $0x7f,%edx
add    $0x1,%rax
cmp    %edx,%eax
jb     12e0 <main+0x170>
add    %eax,%ebx
jmp    12b0 <main+0x140>
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
and    $0xf,%cl
cmp    $0x1,%cl
cmovne %r12d,%r15d
cmp    $0x10,%al
jb     12b0 <main+0x140>
movslq %ebx,%rcx
lea    (%rsp,%rcx,1),%rdx
add    $0x10,%rdx
xor    %ecx,%ecx
nopl   (%rax)
and    $0xf,%al
or     $0x30,%al
mov    %al,(%rdx,%rcx,1)
movzbl 0x0(%rbp),%eax
mov    %eax,%esi
shr    $0x4,%esi
add    $0x1,%rcx
cmp    %esi,%ecx
jb     1320 <main+0x1b0>
add    %ecx,%ebx
jmp    12b0 <main+0x140>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq %ebx,%rax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xcde(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
je     11d0 <main+0x60>
lea    0xcbb(%rip),%rdi
call   1040 <puts@plt>
jmp    11d0 <main+0x60>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x1f498,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc93(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"../data_1_3_1_patch/FONTS.LBX\00"
@O_RDONLY = global i32 0
@.str.1 = [20 x i8] c"Error opening file\0A\00"
@.str.2 = [14 x i8] c"%c. %d lines\0A\00"
@.str.3 = [15 x i8] c"offset = %04x\0A\00"
@.str.4 = [6 x i8] c"%02X \00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [7 x i8] c"Not 1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128000 x i8]
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [128 x i8]
%12 = alloca i32
store i32 0, i32* %1
%13 = load i32, i32* @O_RDONLY
%14 = call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %0
%21 = load i32, i32* %2
%22 = getelementptr inbounds [128000 x i8], [128000 x i8]* %3, i64 0, i64 0
%23 = call i32 @read(i32 %21, i8* %22, i32 24576)
%24 = getelementptr inbounds [128000 x i8], [128000 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 1210
store i8* %25, i8** %4
%26 = getelementptr inbounds [128000 x i8], [128000 x i8]* %3, i64 0, i64 0
%27 = getelementptr inbounds i8, i8* %26, i64 1978
%28 = bitcast i8* %27 to i32*
store i32* %28, i32** %5
store i32 0, i32* %6
br label %29
29: ; preds = %158, %20
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 768
br i1 %31, label %32, label %161
32: ; preds = %29
store i32 0, i32* %10
store i32 0, i32* %12
%33 = load i8*, i8** %4
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
store i32 %38, i32* %8
%39 = load i32, i32* %6
%40 = srem i32 %39, 96
%41 = add nsw i32 %40, 32
%42 = load i32, i32* %8
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %41, i32 %42)
%44 = getelementptr inbounds [128000 x i8], [128000 x i8]* %3, i64 0, i64 0
%45 = getelementptr inbounds i8, i8* %44, i64 800
%46 = load i32*, i32** %5
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %45, i64 %51
store i8* %52, i8** %9
%53 = load i32*, i32** %5
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %129, %32
%60 = load i32, i32* %8
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %143
62: ; preds = %59
br label %63
63: ; preds = %126, %62
%64 = load i8*, i8** %9
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = icmp ne i32 %66, 128
br i1 %67, label %68, label %129
68: ; preds = %63
%69 = load i8*, i8** %9
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %71)
%73 = load i8*, i8** %9
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = icmp sgt i32 %75, 128
br i1 %76, label %77, label %95
77: ; preds = %68
store i32 0, i32* %7
br label %78
78: ; preds = %91, %77
%79 = load i32, i32* %7
%80 = load i8*, i8** %9
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = and i32 %82, 127
%84 = icmp slt i32 %79, %83
br i1 %84, label %85, label %94
85: ; preds = %78
%86 = load i32, i32* %12
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 %87
store i8 32, i8* %88
%89 = load i32, i32* %12
%90 = add nsw i32 %89, 1
store i32 %90, i32* %12
br label %91
91: ; preds = %85
%92 = load i32, i32* %7
%93 = add nsw i32 %92, 1
store i32 %93, i32* %7
br label %78
94: ; preds = %78
br label %126
95: ; preds = %68
%96 = load i8*, i8** %9
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = and i32 %98, 15
%100 = icmp ne i32 %99, 1
br i1 %100, label %101, label %102
101: ; preds = %95
store i32 1, i32* %10
br label %102
102: ; preds = %101, %95
store i32 0, i32* %7
br label %103
103: ; preds = %122, %102
%104 = load i32, i32* %7
%105 = load i8*, i8** %9
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = ashr i32 %107, 4
%109 = icmp slt i32 %104, %108
br i1 %109, label %110, label %125
110: ; preds = %103
%111 = load i8*, i8** %9
%112 = load i8, i8* %111
%113 = zext i8 %112 to i32
%114 = and i32 %113, 15
%115 = add nsw i32 48, %114
%116 = trunc i32 %115 to i8
%117 = load i32, i32* %12
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 %118
store i8 %116, i8* %119
%120 = load i32, i32* %12
%121 = add nsw i32 %120, 1
store i32 %121, i32* %12
br label %122
122: ; preds = %110
%123 = load i32, i32* %7
%124 = add nsw i32 %123, 1
store i32 %124, i32* %7
br label %103
125: ; preds = %103
br label %126
126: ; preds = %125, %94
%127 = load i8*, i8** %9
%128 = getelementptr inbounds i8, i8* %127, i32 1
store i8* %128, i8** %9
br label %63
129: ; preds = %63
%130 = load i8*, i8** %9
%131 = load i8, i8* %130
%132 = zext i8 %131 to i32
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %132)
%134 = load i32, i32* %12
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 %135
store i8 10, i8* %136
%137 = load i32, i32* %12
%138 = add nsw i32 %137, 1
store i32 %138, i32* %12
%139 = load i32, i32* %8
%140 = add nsw i32 %139, -1
store i32 %140, i32* %8
%141 = load i8*, i8** %9
%142 = getelementptr inbounds i8, i8* %141, i32 1
store i8* %142, i8** %9
br label %59
143: ; preds = %59
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%146 = load i32, i32* %12
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 %147
store i8 0, i8* %148
%149 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %149)
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%152 = load i32, i32* %10
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %156
154: ; preds = %143
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %156
156: ; preds = %154, %143
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %158
158: ; preds = %156
%159 = load i32, i32* %6
%160 = add nsw i32 %159, 1
store i32 %160, i32* %6
br label %29
161: ; preds = %29
%162 = load i32, i32* %2
%163 = call i32 @close(i32 %162)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"../data_1_3_1_patch/FONTS.LBX\00"
@O_RDONLY = global i32 0
@.str.2 = [14 x i8] c"%c. %d lines\0A\00"
@.str.3 = [15 x i8] c"offset = %04x\0A\00"
@.str.4 = [6 x i8] c"%02X \00"
@.str.6 = [3 x i8] c"%s\00"
@str = [6 x i8] c"Not 1\00"
@str.8 = [19 x i8] c"Error opening file\00"
define i32 @main() {
%1 = alloca [128000 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128000 x i8], [128000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %0
%12 = call i32 @read(i32 %6, i8* %3, i32 24576)
%13 = getelementptr inbounds [128000 x i8], [128000 x i8]* %1, i64 0, i64 1210
%14 = getelementptr inbounds [128000 x i8], [128000 x i8]* %1, i64 0, i64 1978
%15 = bitcast i8* %14 to i32*
%16 = getelementptr inbounds [128000 x i8], [128000 x i8]* %1, i64 0, i64 800
br label %17
17: ; preds = %11, %118
%18 = phi i64 [ 0, %11 ], [ %120, %118 ]
%19 = getelementptr inbounds i8, i8* %13, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = trunc i64 %18 to i16
%23 = urem i16 %22, 96
%24 = add nuw nsw i16 %23, 32
%25 = zext i16 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32 %21)
%27 = getelementptr inbounds i32, i32* %15, i64 %18
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = icmp eq i8 %20, 0
br i1 %30, label %106, label %31
31: ; preds = %17
%32 = sext i32 %28 to i64
%33 = getelementptr inbounds i8, i8* %16, i64 %32
br label %34
34: ; preds = %31, %95
%35 = phi i32 [ %102, %95 ], [ 0, %31 ]
%36 = phi i32 [ %97, %95 ], [ 0, %31 ]
%37 = phi i8* [ %104, %95 ], [ %33, %31 ]
%38 = phi i32 [ %103, %95 ], [ %21, %31 ]
%39 = load i8, i8* %37
%40 = icmp eq i8 %39, -128
br i1 %40, label %95, label %41
41: ; preds = %34, %89
%42 = phi i8 [ %93, %89 ], [ %39, %34 ]
%43 = phi i32 [ %91, %89 ], [ %35, %34 ]
%44 = phi i32 [ %90, %89 ], [ %36, %34 ]
%45 = phi i8* [ %92, %89 ], [ %37, %34 ]
%46 = zext i8 %42 to i32
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = load i8, i8* %45
%49 = icmp ugt i8 %48, -128
br i1 %49, label %50, label %65
50: ; preds = %41
%51 = and i8 %48, 127
%52 = icmp eq i8 %51, 0
br i1 %52, label %89, label %53
53: ; preds = %50
%54 = sext i32 %43 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ %54, %53 ], [ %59, %55 ]
%57 = phi i32 [ 0, %53 ], [ %60, %55 ]
%58 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %56
store i8 32, i8* %58
%59 = add nsw i64 %56, 1
%60 = add nuw nsw i32 %57, 1
%61 = load i8, i8* %45
%62 = and i8 %61, 127
%63 = zext i8 %62 to i32
%64 = icmp ult i32 %60, %63
br i1 %64, label %55, label %85
65: ; preds = %41
%66 = and i8 %48, 15
%67 = icmp eq i8 %66, 1
%68 = select i1 %67, i32 %44, i32 1
%69 = icmp ult i8 %48, 16
br i1 %69, label %89, label %70
70: ; preds = %65
%71 = sext i32 %43 to i64
br label %72
72: ; preds = %70, %72
%73 = phi i64 [ %71, %70 ], [ %79, %72 ]
%74 = phi i8 [ %48, %70 ], [ %81, %72 ]
%75 = phi i32 [ 0, %70 ], [ %80, %72 ]
%76 = and i8 %74, 15
%77 = or i8 %76, 48
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %73
store i8 %77, i8* %78
%79 = add nsw i64 %73, 1
%80 = add nuw nsw i32 %75, 1
%81 = load i8, i8* %45
%82 = lshr i8 %81, 4
%83 = zext i8 %82 to i32
%84 = icmp ult i32 %80, %83
br i1 %84, label %72, label %87
85: ; preds = %55
%86 = trunc i64 %59 to i32
br label %89
87: ; preds = %72
%88 = trunc i64 %79 to i32
br label %89
89: ; preds = %87, %85, %65, %50
%90 = phi i32 [ %44, %50 ], [ %68, %65 ], [ %44, %85 ], [ %68, %87 ]
%91 = phi i32 [ %43, %50 ], [ %43, %65 ], [ %86, %85 ], [ %88, %87 ]
%92 = getelementptr inbounds i8, i8* %45, i64 1
%93 = load i8, i8* %92
%94 = icmp eq i8 %93, -128
br i1 %94, label %95, label %41
95: ; preds = %89, %34
%96 = phi i8* [ %37, %34 ], [ %92, %89 ]
%97 = phi i32 [ %36, %34 ], [ %90, %89 ]
%98 = phi i32 [ %35, %34 ], [ %91, %89 ]
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 128)
%100 = sext i32 %98 to i64
%101 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %100
store i8 10, i8* %101
%102 = add nsw i32 %98, 1
%103 = add nsw i32 %38, -1
%104 = getelementptr inbounds i8, i8* %96, i64 1
%105 = icmp sgt i32 %38, 1
br i1 %105, label %34, label %106
106: ; preds = %95, %17
%107 = phi i32 [ 0, %17 ], [ %97, %95 ]
%108 = phi i32 [ 0, %17 ], [ %102, %95 ]
%109 = call i32 @putchar(i32 10)
%110 = call i32 @putchar(i32 10)
%111 = sext i32 %108 to i64
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %111
store i8 0, i8* %112
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%114 = call i32 @putchar(i32 10)
%115 = icmp eq i32 %107, 0
br i1 %115, label %118, label %116
116: ; preds = %106
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %118
118: ; preds = %116, %106
%119 = call i32 @putchar(i32 10)
%120 = add nuw nsw i64 %18, 1
%121 = icmp eq i64 %120, 768
br i1 %121, label %122, label %17
122: ; preds = %118
%123 = call i32 @close(i32 %6)
ret i32 0
}