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

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char *, char *, int);
int main() {
  int i;
  int digitsout;
  int thispoint;
  char inbuf[256];
  int bbxx, bbxy, bbxxoff, bbxyoff;
  int descent = 4;
  int startrow;
  unsigned rowout;
  while (fgets(inbuf, 256 - 1, stdin) != NULL) {
    if (strncmp(inbuf, "ENCODING ", 9) == 0) {
      sscanf(&inbuf[9], "%d", &thispoint);
      if ((thispoint >= 0x2E80 && thispoint <= 0x2EFF) ||
          (thispoint >= 0x2F00 && thispoint <= 0x2FDF) ||
          (thispoint >= 0x2FF0 && thispoint <= 0x2FFF) ||
          (thispoint >= 0x3001 && thispoint <= 0x303F) ||
          (thispoint >= 0x3100 && thispoint <= 0x312F) ||
          (thispoint >= 0x31A0 && thispoint <= 0x31BF) ||
          (thispoint >= 0x31C0 && thispoint <= 0x31EF) ||
          (thispoint >= 0x3400 && thispoint <= 0x4DBF) ||
          (thispoint >= 0x4E00 && thispoint <= 0x9FCF) ||
          (thispoint >= 0xF900 && thispoint <= 0xFAFF)) {
        while (fgets(inbuf, 256 - 1, stdin) != NULL &&
               strncmp(inbuf, "BBX ", 4) != 0)
          ;
        sscanf(&inbuf[4], "%d %d %d %d", &bbxx, &bbxy, &bbxxoff, &bbxyoff);
        while (fgets(inbuf, 256 - 1, stdin) != NULL &&
               strncmp(inbuf, "BITMAP", 6) != 0)
          ;
        fprintf(stdout, "%04X:", thispoint);
        digitsout = 0;
        startrow = descent + bbxyoff + bbxy;
        for (i = 16; i > startrow; i--) {
          fprintf(stdout, "0000");
          digitsout += 4;
        }
        while (fgets(inbuf, 256 - 1, stdin) != NULL &&
               strncmp(inbuf, "END", 3) != 0) {
          sscanf(inbuf, "%X", &rowout);
          if (bbxx <= 8)
            rowout <<= 8;
          rowout >>= bbxxoff;
          fprintf(stdout, "%04X", rowout);
          digitsout += 4;
        }
        while (digitsout < 64) {
          fprintf(stdout, "0000");
          digitsout += 4;
        }
        fprintf(stdout, "\n");
      }
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x124(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     159a <main+0x44a>
lea    -0x110(%rbp),%rdi
lea    0xe62(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1595 <main+0x445>
lea    -0x110(%rbp),%rdi
add    $0x9,%rdi
lea    0xe54(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmpl   $0x2e80,-0x10(%rbp)
jl     11e9 <main+0x99>
cmpl   $0x2eff,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x2f00,-0x10(%rbp)
jl     1203 <main+0xb3>
cmpl   $0x2fdf,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x2ff0,-0x10(%rbp)
jl     121d <main+0xcd>
cmpl   $0x2fff,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x3001,-0x10(%rbp)
jl     1237 <main+0xe7>
cmpl   $0x303f,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x3100,-0x10(%rbp)
jl     1251 <main+0x101>
cmpl   $0x312f,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x31a0,-0x10(%rbp)
jl     126b <main+0x11b>
cmpl   $0x31bf,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x31c0,-0x10(%rbp)
jl     1285 <main+0x135>
cmpl   $0x31ef,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x3400,-0x10(%rbp)
jl     129f <main+0x14f>
cmpl   $0x4dbf,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0x4e00,-0x10(%rbp)
jl     12b9 <main+0x169>
cmpl   $0x9fcf,-0x10(%rbp)
jle    12d3 <main+0x183>
cmpl   $0xf900,-0x10(%rbp)
jl     1590 <main+0x440>
cmpl   $0xfaff,-0x10(%rbp)
jg     1590 <main+0x440>
jmp    12d8 <main+0x188>
lea    -0x110(%rbp),%rdi
mov    0x2d02(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x12d(%rbp)
je     132c <main+0x1dc>
lea    -0x110(%rbp),%rdi
lea    0xcf5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x12d(%rbp)
mov    -0x12d(%rbp),%al
test   $0x1,%al
jne    133f <main+0x1ef>
jmp    1344 <main+0x1f4>
jmp    12d8 <main+0x188>
lea    -0x110(%rbp),%rdi
add    $0x4,%rdi
lea    0xcb9(%rip),%rsi
lea    -0x114(%rbp),%rdx
lea    -0x118(%rbp),%rcx
lea    -0x11c(%rbp),%r8
lea    -0x120(%rbp),%r9
mov    $0x0,%al
call   1060 <sscanf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2c61(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x12e(%rbp)
je     13cd <main+0x27d>
lea    -0x110(%rbp),%rdi
lea    0xc65(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x12e(%rbp)
mov    -0x12e(%rbp),%al
test   $0x1,%al
jne    13e0 <main+0x290>
jmp    13e5 <main+0x295>
jmp    1379 <main+0x229>
mov    0x2bec(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xc2a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x124(%rbp),%eax
add    -0x120(%rbp),%eax
add    -0x118(%rbp),%eax
mov    %eax,-0x128(%rbp)
movl   $0x10,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x128(%rbp),%eax
jle    1462 <main+0x312>
mov    0x2b9d(%rip),%rax
mov    (%rax),%edi
lea    0xbe4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1425 <main+0x2d5>
jmp    1467 <main+0x317>
lea    -0x110(%rbp),%rdi
mov    0x2b73(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x12f(%rbp)
je     14bb <main+0x36b>
lea    -0x110(%rbp),%rdi
lea    0xb89(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x12f(%rbp)
mov    -0x12f(%rbp),%al
test   $0x1,%al
jne    14ce <main+0x37e>
jmp    1545 <main+0x3f5>
lea    -0x110(%rbp),%rdi
lea    0xb55(%rip),%rsi
lea    -0x12c(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmpl   $0x8,-0x114(%rbp)
jg     1506 <main+0x3b6>
mov    -0x12c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x11c(%rbp),%ecx
mov    -0x12c(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x12c(%rbp)
mov    0x2ab7(%rip),%rax
mov    (%rax),%edi
mov    -0x12c(%rbp),%edx
lea    0xb04(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1467 <main+0x317>
jmp    154a <main+0x3fa>
cmpl   $0x40,-0xc(%rbp)
jge    1579 <main+0x429>
mov    0x2a7d(%rip),%rax
mov    (%rax),%edi
lea    0xac4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    154a <main+0x3fa>
mov    0x2a58(%rip),%rax
mov    (%rax),%edi
lea    0xab0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1595 <main+0x445>
jmp    116c <main+0x1c>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    0x2e80(%rip),%rbx
mov    (%rbx),%edx
lea    0x20(%rsp),%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1185 <main+0x35>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0x20(%rsp),%rbp
lea    0xe87(%rip),%r14
lea    0x8(%rsp),%r15
mov    0x2e3b(%rip),%r12
lea    0xe77(%rip),%r13
jmp    11e4 <main+0x94>
mov    (%r12),%edi
lea    0xe88(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x20(%rsp),%rbp
lea    0xe57(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%edx
mov    %rbp,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     117e <main+0x2e>
mov    %rbp,%rdi
lea    0xe12(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11d0 <main+0x80>
lea    0x29(%rsp),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,%ecx
and    $0xffffff80,%ecx
cmp    $0x2e80,%ecx
je     1295 <main+0x145>
lea    -0x2f00(%rax),%ecx
cmp    $0xe0,%ecx
jb     1295 <main+0x145>
mov    %eax,%ecx
and    $0xfffffff0,%ecx
cmp    $0x2ff0,%ecx
je     1295 <main+0x145>
lea    -0x3001(%rax),%ecx
cmp    $0x3f,%ecx
jb     1295 <main+0x145>
lea    -0x3100(%rax),%ecx
cmp    $0x30,%ecx
jb     1295 <main+0x145>
mov    %eax,%ecx
and    $0xffffffe0,%ecx
cmp    $0x31a0,%ecx
je     1295 <main+0x145>
lea    -0x31c0(%rax),%ecx
cmp    $0x30,%ecx
jb     1295 <main+0x145>
lea    -0x3400(%rax),%ecx
cmp    $0x19c0,%ecx
jb     1295 <main+0x145>
lea    -0x4e00(%rax),%ecx
cmp    $0x51d0,%ecx
jb     1295 <main+0x145>
add    $0xffff0700,%eax
cmp    $0x1ff,%eax
ja     11d0 <main+0x80>
mov    %rbx,%r14
lea    0xd6b(%rip),%rbx
nop
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     12ca <main+0x17a>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    12a0 <main+0x150>
lea    0x24(%rsp),%rdi
lea    0xd39(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%edx
mov    %rbp,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1329 <main+0x1d9>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1300 <main+0x1b0>
mov    (%r12),%edi
mov    0x8(%rsp),%edx
xor    %r13d,%r13d
lea    0xce7(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x10(%rsp),%r15d
mov    0x18(%rsp),%eax
lea    (%r15,%rax,1),%r14d
add    $0x4,%r14d
cmp    $0xf,%r14d
jg     13a2 <main+0x252>
add    %eax,%r15d
shl    $0x2,%r15d
neg    %r15d
mov    $0x10,%ebp
mov    0x2c69(%rip),%rbx
lea    0xcb2(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0xffffffff,%ebp
cmp    %r14d,%ebp
jg     1380 <main+0x230>
add    $0x30,%r15d
mov    %r15d,%r13d
mov    0x2c46(%rip),%rbx
mov    (%rbx),%edx
lea    0x20(%rsp),%r12
mov    %r12,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
lea    0xc58(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc61(%rip),%rbp
je     1446 <main+0x2f6>
xchg   %ax,%ax
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1446 <main+0x2f6>
mov    %r12,%rdi
lea    0xc42(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%edx
shl    $0x8,%edx
cmpl   $0x9,0x1c(%rsp)
cmovge %eax,%edx
movzbl 0x14(%rsp),%ecx
shr    %cl,%edx
mov    %edx,0xc(%rsp)
mov    0x2bba(%rip),%rax
mov    (%rax),%edi
lea    0xc0d(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x4,%r13d
mov    (%rbx),%edx
mov    %r12,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    13d0 <main+0x280>
cmp    $0x3f,%r13d
mov    0x2b87(%rip),%r12
lea    0xbd0(%rip),%rbp
ja     11a6 <main+0x56>
add    $0xfffffffc,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12),%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x4,%r13d
cmp    $0x3c,%r13d
jb     1470 <main+0x320>
jmp    11a6 <main+0x56>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [10 x i8] c"ENCODING \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"BBX \00"
@.str.3 = [12 x i8] c"%d %d %d %d\00"
@.str.4 = [7 x i8] c"BITMAP\00"
@stdout = global i32 0
@.str.5 = [6 x i8] c"%04X:\00"
@.str.6 = [5 x i8] c"0000\00"
@.str.7 = [4 x i8] c"END\00"
@.str.8 = [3 x i8] c"%X\00"
@.str.9 = [5 x i8] c"%04X\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %10
br label %13
13: ; preds = %175, %0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i32* @fgets(i8* %14, i32 255, i32 %15)
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %176
18: ; preds = %13
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%20 = call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %175
22: ; preds = %18
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 9
%24 = call i32 (i8*, i8*, ...) @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%25 = load i32, i32* %4
%26 = icmp sge i32 %25, 11904
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i32, i32* %4
%29 = icmp sle i32 %28, 12031
br i1 %29, label %84, label %30
30: ; preds = %27, %22
%31 = load i32, i32* %4
%32 = icmp sge i32 %31, 12032
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %4
%35 = icmp sle i32 %34, 12255
br i1 %35, label %84, label %36
36: ; preds = %33, %30
%37 = load i32, i32* %4
%38 = icmp sge i32 %37, 12272
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* %4
%41 = icmp sle i32 %40, 12287
br i1 %41, label %84, label %42
42: ; preds = %39, %36
%43 = load i32, i32* %4
%44 = icmp sge i32 %43, 12289
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %4
%47 = icmp sle i32 %46, 12351
br i1 %47, label %84, label %48
48: ; preds = %45, %42
%49 = load i32, i32* %4
%50 = icmp sge i32 %49, 12544
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* %4
%53 = icmp sle i32 %52, 12591
br i1 %53, label %84, label %54
54: ; preds = %51, %48
%55 = load i32, i32* %4
%56 = icmp sge i32 %55, 12704
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load i32, i32* %4
%59 = icmp sle i32 %58, 12735
br i1 %59, label %84, label %60
60: ; preds = %57, %54
%61 = load i32, i32* %4
%62 = icmp sge i32 %61, 12736
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32, i32* %4
%65 = icmp sle i32 %64, 12783
br i1 %65, label %84, label %66
66: ; preds = %63, %60
%67 = load i32, i32* %4
%68 = icmp sge i32 %67, 13312
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = load i32, i32* %4
%71 = icmp sle i32 %70, 19903
br i1 %71, label %84, label %72
72: ; preds = %69, %66
%73 = load i32, i32* %4
%74 = icmp sge i32 %73, 19968
br i1 %74, label %75, label %78
75: ; preds = %72
%76 = load i32, i32* %4
%77 = icmp sle i32 %76, 40911
br i1 %77, label %84, label %78
78: ; preds = %75, %72
%79 = load i32, i32* %4
%80 = icmp sge i32 %79, 63744
br i1 %80, label %81, label %174
81: ; preds = %78
%82 = load i32, i32* %4
%83 = icmp sle i32 %82, 64255
br i1 %83, label %84, label %174
84: ; preds = %81, %75, %69, %63, %57, %51, %45, %39, %33, %27
br label %85
85: ; preds = %96, %84
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%87 = load i32, i32* @stdin
%88 = call i32* @fgets(i8* %86, i32 255, i32 %87)
%89 = icmp ne i32* %88, null
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%92 = call i64 @strncmp(i8* %91, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%93 = icmp ne i64 %92, 0
br label %94
94: ; preds = %90, %85
%95 = phi i1 [ false, %85 ], [ %93, %90 ]
br i1 %95, label %96, label %97
96: ; preds = %94
br label %85
97: ; preds = %94
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 4
%99 = call i32 (i8*, i8*, ...) @sscanf(i8* %98, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %6, i32* %7, i32* %8, i32* %9)
br label %100
100: ; preds = %111, %97
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%102 = load i32, i32* @stdin
%103 = call i32* @fgets(i8* %101, i32 255, i32 %102)
%104 = icmp ne i32* %103, null
br i1 %104, label %105, label %109
105: ; preds = %100
%106 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%107 = call i64 @strncmp(i8* %106, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 6)
%108 = icmp ne i64 %107, 0
br label %109
109: ; preds = %105, %100
%110 = phi i1 [ false, %100 ], [ %108, %105 ]
br i1 %110, label %111, label %112
111: ; preds = %109
br label %100
112: ; preds = %109
%113 = load i32, i32* @stdout
%114 = load i32, i32* %4
%115 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %114)
store i32 0, i32* %3
%116 = load i32, i32* %10
%117 = load i32, i32* %9
%118 = add nsw i32 %116, %117
%119 = load i32, i32* %7
%120 = add nsw i32 %118, %119
store i32 %120, i32* %11
store i32 16, i32* %2
br label %121
121: ; preds = %130, %112
%122 = load i32, i32* %2
%123 = load i32, i32* %11
%124 = icmp sgt i32 %122, %123
br i1 %124, label %125, label %133
125: ; preds = %121
%126 = load i32, i32* @stdout
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%128 = load i32, i32* %3
%129 = add nsw i32 %128, 4
store i32 %129, i32* %3
br label %130
130: ; preds = %125
%131 = load i32, i32* %2
%132 = add nsw i32 %131, -1
store i32 %132, i32* %2
br label %121
133: ; preds = %121
br label %134
134: ; preds = %153, %133
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%136 = load i32, i32* @stdin
%137 = call i32* @fgets(i8* %135, i32 255, i32 %136)
%138 = icmp ne i32* %137, null
br i1 %138, label %139, label %143
139: ; preds = %134
%140 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%141 = call i64 @strncmp(i8* %140, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%142 = icmp ne i64 %141, 0
br label %143
143: ; preds = %139, %134
%144 = phi i1 [ false, %134 ], [ %142, %139 ]
br i1 %144, label %145, label %162
145: ; preds = %143
%146 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%147 = call i32 (i8*, i8*, ...) @sscanf(i8* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %12)
%148 = load i32, i32* %6
%149 = icmp sle i32 %148, 8
br i1 %149, label %150, label %153
150: ; preds = %145
%151 = load i32, i32* %12
%152 = shl i32 %151, 8
store i32 %152, i32* %12
br label %153
153: ; preds = %150, %145
%154 = load i32, i32* %8
%155 = load i32, i32* %12
%156 = lshr i32 %155, %154
store i32 %156, i32* %12
%157 = load i32, i32* @stdout
%158 = load i32, i32* %12
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %158)
%160 = load i32, i32* %3
%161 = add nsw i32 %160, 4
store i32 %161, i32* %3
br label %134
162: ; preds = %143
br label %163
163: ; preds = %166, %162
%164 = load i32, i32* %3
%165 = icmp slt i32 %164, 64
br i1 %165, label %166, label %171
166: ; preds = %163
%167 = load i32, i32* @stdout
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%169 = load i32, i32* %3
%170 = add nsw i32 %169, 4
store i32 %170, i32* %3
br label %163
171: ; preds = %163
%172 = load i32, i32* @stdout
%173 = call i32 (i32, i8*, ...) @fprintf(i32 %172, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %174
174: ; preds = %171, %81, %78
br label %175
175: ; preds = %174, %18
br label %13
176: ; preds = %13
%177 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [10 x i8] c"ENCODING \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"BBX \00"
@.str.3 = [12 x i8] c"%d %d %d %d\00"
@.str.4 = [7 x i8] c"BITMAP\00"
@stdout = global i32 0
@.str.5 = [6 x i8] c"%04X:\00"
@.str.6 = [5 x i8] c"0000\00"
@.str.7 = [4 x i8] c"END\00"
@.str.8 = [3 x i8] c"%X\00"
@.str.9 = [5 x i8] c"%04X\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %1 to i8*
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = load i32, i32* @stdin
%16 = call i32* @fgets(i8* %9, i32 255, i32 %15)
%17 = icmp eq i32* %16, null
br i1 %17, label %132, label %18
18: ; preds = %0
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 9
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 4
br label %21
21: ; preds = %18, %128
%22 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %128
24: ; preds = %21
%25 = call i32 (i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%26 = load i32, i32* %1
%27 = and i32 %26, -128
%28 = icmp eq i32 %27, 11904
%29 = add i32 %26, -12032
%30 = icmp ult i32 %29, 224
%31 = or i1 %28, %30
%32 = and i32 %26, -16
%33 = icmp eq i32 %32, 12272
%34 = select i1 %31, i1 true, i1 %33
%35 = add i32 %26, -12289
%36 = icmp ult i32 %35, 63
%37 = select i1 %34, i1 true, i1 %36
%38 = add i32 %26, -12544
%39 = icmp ult i32 %38, 48
%40 = select i1 %37, i1 true, i1 %39
%41 = and i32 %26, -32
%42 = icmp eq i32 %41, 12704
%43 = select i1 %40, i1 true, i1 %42
%44 = add i32 %26, -12736
%45 = icmp ult i32 %44, 48
%46 = select i1 %43, i1 true, i1 %45
%47 = add i32 %26, -13312
%48 = icmp ult i32 %47, 6592
%49 = select i1 %46, i1 true, i1 %48
%50 = add i32 %26, -19968
%51 = icmp ult i32 %50, 20944
%52 = select i1 %49, i1 true, i1 %51
%53 = add i32 %26, -63744
%54 = icmp ult i32 %53, 512
%55 = select i1 %52, i1 true, i1 %54
br i1 %55, label %56, label %128
56: ; preds = %24, %60
%57 = load i32, i32* @stdin
%58 = call i32* @fgets(i8* %9, i32 255, i32 %57)
%59 = icmp eq i32* %58, null
br i1 %59, label %63, label %60
60: ; preds = %56
%61 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %56
63: ; preds = %56, %60
%64 = call i32 (i8*, i8*, ...) @sscanf(i8* %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
br label %65
65: ; preds = %69, %63
%66 = load i32, i32* @stdin
%67 = call i32* @fgets(i8* %9, i32 255, i32 %66)
%68 = icmp eq i32* %67, null
br i1 %68, label %72, label %69
69: ; preds = %65
%70 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 6)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %65
72: ; preds = %65, %69
%73 = load i32, i32* @stdout
%74 = load i32, i32* %1
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 4
%78 = load i32, i32* %4
%79 = add nsw i32 %77, %78
%80 = icmp slt i32 %79, 16
br i1 %80, label %81, label %86
81: ; preds = %72
%82 = add i32 %76, %78
%83 = mul i32 %82, -4
br label %91
84: ; preds = %91
%85 = add i32 %83, 48
br label %86
86: ; preds = %84, %72
%87 = phi i32 [ 0, %72 ], [ %85, %84 ]
%88 = load i32, i32* @stdin
%89 = call i32* @fgets(i8* %9, i32 255, i32 %88)
%90 = icmp eq i32* %89, null
br i1 %90, label %116, label %97
91: ; preds = %81, %91
%92 = phi i32 [ %95, %91 ], [ 16, %81 ]
%93 = load i32, i32* @stdout
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%95 = add nsw i32 %92, -1
%96 = icmp sgt i32 %95, %79
br i1 %96, label %91, label %84
97: ; preds = %86, %101
%98 = phi i32 [ %112, %101 ], [ %87, %86 ]
%99 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%100 = icmp eq i64 %99, 0
br i1 %100, label %116, label %101
101: ; preds = %97
%102 = call i32 (i8*, i8*, ...) @sscanf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %7)
%103 = load i32, i32* %3
%104 = icmp slt i32 %103, 9
%105 = load i32, i32* %7
%106 = shl i32 %105, 8
%107 = select i1 %104, i32 %106, i32 %105
%108 = load i32, i32* %5
%109 = lshr i32 %107, %108
store i32 %109, i32* %7
%110 = load i32, i32* @stdout
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %109)
%112 = add nuw nsw i32 %98, 4
%113 = load i32, i32* @stdin
%114 = call i32* @fgets(i8* %9, i32 255, i32 %113)
%115 = icmp eq i32* %114, null
br i1 %115, label %116, label %97
116: ; preds = %97, %101, %86
%117 = phi i32 [ %87, %86 ], [ %112, %101 ], [ %98, %97 ]
%118 = icmp ult i32 %117, 64
br i1 %118, label %119, label %125
119: ; preds = %116, %119
%120 = phi i32 [ %123, %119 ], [ %117, %116 ]
%121 = load i32, i32* @stdout
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%123 = add nuw nsw i32 %120, 4
%124 = icmp ult i32 %120, 60
br i1 %124, label %119, label %125
125: ; preds = %119, %116
%126 = load i32, i32* @stdout
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %128
128: ; preds = %24, %125, %21
%129 = load i32, i32* @stdin
%130 = call i32* @fgets(i8* %9, i32 255, i32 %129)
%131 = icmp eq i32* %130, null
br i1 %131, label %132, label %21
132: ; preds = %128, %0
%133 = call i32 @exit(i32 0)
unreachable
}