#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 atoi(char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  FILE *in, *out;
  char buf[256], **bufs;
  int i, j, k, l;
  char charn[256];
  int idx, lidx, inbm, hp;
  int rs, re, chk;
  int w, h, head;
  char *charbuf;
  in = fopen(argv[1], "rt");
  if (!in) {
    printf("open %s failed\n", argv[1]);
    return (-1);
  }
  out = fopen(argv[2], "wb");
  bufs = malloc(64 * sizeof(char *));
  for (i = 0; i < 64; i++)
    bufs[i] = malloc(64);
  inbm = 0;
  charbuf = malloc(65536 * 32);
  memset(charbuf, 0, 65536 * 32);
  lidx = 0;
  rs = 0;
  re = 0;
  chk = 0;
  w = 16;
  h = 16;
  head = 1;
  while (!feof(in)) {
    fgets(buf, 255, in);
    j = 0;
    k = 0;
    for (i = 0; i < 256; i++)
      if (buf[i] <= ' ') {
        bufs[j][k] = 0;
        if (k)
          j++;
        k = 0;
      } else
        bufs[j][k++] = buf[i];
    if (!strcmp(bufs[0], "FONTBOUNDINGBOX")) {
      w = atoi(bufs[1]);
      h = atoi(bufs[2]);
      continue;
    }
    if (!strcmp(bufs[0], "STARTCHAR")) {
      for (i = 0; i < 256; i++)
        if (buf[i] <= ' ')
          break;
      for (; i < 256; i++)
        if (buf[i] > ' ')
          break;
      j = 0;
      for (; i < 256; i++)
        if (buf[i] == '\n')
          break;
        else
          charn[j++] = buf[i];
      charn[j] = 0;
      continue;
    }
    if (!strcmp(bufs[0], "ENCODING")) {
      idx = atoi(bufs[1]);
      if (idx != (lidx + 1)) {
        printf("chunk %d, break %d-%d, last range %d-%d\n", chk, lidx, idx, rs,
               re);
        if (rs | re) {
          if (head) {
            fputc(0x00, out);
            fputc(0xBF, out);
            fputc(0x04, out);
            fputc(0x00, out);
            fputc(0x00, out);
            fputc(w, out);
            fputc(h, out);
            fputc(0x01, out);
            head = 0;
          }
          fputc(rs & 0xff, out);
          fputc((rs >> 8) & 0xff, out);
          fputc(re & 0xff, out);
          fputc((re >> 8) & 0xff, out);
          fwrite(charbuf, re - rs + 1, (w * h) / 8, out);
        }
        rs = idx;
        re = idx;
        chk++;
      } else
        re = idx;
      lidx = idx;
      continue;
    }
    if (!strcmp(bufs[0], "BITMAP")) {
      inbm = 1;
      hp = 0;
      continue;
    }
    if (!strcmp(bufs[0], "ENDCHAR")) {
      inbm = 0;
      continue;
    }
    if (inbm) {
      sscanf(bufs[0], "%X", &i);
      if (w == 16) {
        charbuf[((idx - rs) * ((w * h) / 8)) + ((hp * w) / 8)] = i >> 8;
        charbuf[((idx - rs) * ((w * h) / 8)) + ((hp * w) / 8) + 1] = i;
      } else
        charbuf[((idx - rs) * ((w * h) / 8)) + ((hp * w) / 8)] = i;
      hp++;
    }
  }
  printf("chunk %d, range %d-%d\n", chk, rs, re);
  if (rs | re) {
    if (head) {
      fputc(0x00, out);
      fputc(0xBF, out);
      fputc(0x04, out);
      fputc(0x00, out);
      fputc(0x00, out);
      fputc(w, out);
      fputc(h, out);
      fputc(0x01, out);
      head = 0;
    }
    fputc(rs & 0xff, out);
    fputc((rs >> 8) & 0xff, out);
    fputc(re & 0xff, out);
    fputc((re >> 8) & 0xff, out);
    fwrite(charbuf, re - rs + 1, (w * h) / 8, out);
  }
  fputc(0, out);
  fputc(0, out);
  fputc(0, out);
  fputc(0, out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    120e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1aef <main+0x93f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdf6(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    $0x200,%edi
call   1090 <malloc@plt>
mov    %rax,-0x128(%rbp)
movl   $0x0,-0x12c(%rbp)
cmpl   $0x40,-0x12c(%rbp)
jge    1281 <main+0xd1>
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x128(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    1241 <main+0x91>
movl   $0x0,-0x24c(%rbp)
mov    $0x200000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x270(%rbp)
mov    -0x270(%rbp),%rdi
xor    %esi,%esi
mov    $0x200000,%edx
call   1040 <memset@plt>
movl   $0x0,-0x248(%rbp)
movl   $0x0,-0x254(%rbp)
movl   $0x0,-0x258(%rbp)
movl   $0x0,-0x25c(%rbp)
movl   $0x10,-0x260(%rbp)
movl   $0x10,-0x264(%rbp)
movl   $0x1,-0x268(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1313 <main+0x163>
jmp    197e <main+0x7ce>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xff,%esi
call   1060 <fgets@plt>
movl   $0x0,-0x130(%rbp)
movl   $0x0,-0x134(%rbp)
movl   $0x0,-0x12c(%rbp)
cmpl   $0x100,-0x12c(%rbp)
jge    1406 <main+0x256>
movslq -0x12c(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jg     13b6 <main+0x206>
mov    -0x128(%rbp),%rax
movslq -0x130(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x134(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x0,-0x134(%rbp)
je     13a7 <main+0x1f7>
mov    -0x130(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x130(%rbp)
movl   $0x0,-0x134(%rbp)
jmp    13ed <main+0x23d>
movslq -0x12c(%rbp),%rax
mov    -0x120(%rbp,%rax,1),%dl
mov    -0x128(%rbp),%rax
movslq -0x130(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x134(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x134(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    13f2 <main+0x242>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    1346 <main+0x196>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0xbff(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1456 <main+0x2a6>
mov    -0x128(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x260(%rbp)
mov    -0x128(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x264(%rbp)
jmp    12f5 <main+0x145>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0xbbf(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    159c <main+0x3ec>
movl   $0x0,-0x12c(%rbp)
cmpl   $0x100,-0x12c(%rbp)
jge    14c5 <main+0x315>
movslq -0x12c(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jg     14ac <main+0x2fc>
jmp    14c5 <main+0x315>
jmp    14b1 <main+0x301>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    147f <main+0x2cf>
jmp    14ca <main+0x31a>
cmpl   $0x100,-0x12c(%rbp)
jge    1510 <main+0x360>
movslq -0x12c(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jle    14f7 <main+0x347>
jmp    1510 <main+0x360>
jmp    14fc <main+0x34c>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    14ca <main+0x31a>
movl   $0x0,-0x130(%rbp)
cmpl   $0x100,-0x12c(%rbp)
jge    1588 <main+0x3d8>
movslq -0x12c(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1547 <main+0x397>
jmp    1588 <main+0x3d8>
movslq -0x12c(%rbp),%rax
mov    -0x120(%rbp,%rax,1),%cl
mov    -0x130(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x130(%rbp)
cltq
mov    %cl,-0x240(%rbp,%rax,1)
jmp    1574 <main+0x3c4>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    151a <main+0x36a>
movslq -0x130(%rbp),%rax
movb   $0x0,-0x240(%rbp,%rax,1)
jmp    12f5 <main+0x145>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0xa83(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1784 <main+0x5d4>
mov    -0x128(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x244(%rbp)
mov    -0x244(%rbp),%eax
mov    -0x248(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     1767 <main+0x5b7>
mov    -0x25c(%rbp),%esi
mov    -0x248(%rbp),%edx
mov    -0x244(%rbp),%ecx
mov    -0x254(%rbp),%r8d
mov    -0x258(%rbp),%r9d
lea    0xa2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x254(%rbp),%eax
or     -0x258(%rbp),%eax
cmp    $0x0,%eax
je     173b <main+0x58b>
cmpl   $0x0,-0x268(%rbp)
je     16ab <main+0x4fb>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0xbf,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x260(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x264(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1050 <fputc@plt>
movl   $0x0,-0x268(%rbp)
mov    -0x254(%rbp),%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x254(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x258(%rbp),%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x258(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x270(%rbp),%rdi
mov    -0x258(%rbp),%esi
sub    -0x254(%rbp),%esi
add    $0x1,%esi
mov    -0x260(%rbp),%eax
imul   -0x264(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x20(%rbp),%rcx
call   10d0 <fwrite@plt>
mov    -0x244(%rbp),%eax
mov    %eax,-0x254(%rbp)
mov    -0x244(%rbp),%eax
mov    %eax,-0x258(%rbp)
mov    -0x25c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x25c(%rbp)
jmp    1773 <main+0x5c3>
mov    -0x244(%rbp),%eax
mov    %eax,-0x258(%rbp)
mov    -0x244(%rbp),%eax
mov    %eax,-0x248(%rbp)
jmp    12f5 <main+0x145>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0x8cd(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    17bc <main+0x60c>
movl   $0x1,-0x24c(%rbp)
movl   $0x0,-0x250(%rbp)
jmp    12f5 <main+0x145>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0x89c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    17ea <main+0x63a>
movl   $0x0,-0x24c(%rbp)
jmp    12f5 <main+0x145>
cmpl   $0x0,-0x24c(%rbp)
je     1979 <main+0x7c9>
mov    -0x128(%rbp),%rax
mov    (%rax),%rdi
lea    0x869(%rip),%rsi
lea    -0x12c(%rbp),%rdx
call   10a0 <sscanf@plt>
cmpl   $0x10,-0x260(%rbp)
jne    1900 <main+0x750>
mov    -0x12c(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x289(%rbp)
mov    -0x270(%rbp),%rax
mov    %rax,-0x288(%rbp)
mov    -0x244(%rbp),%ecx
sub    -0x254(%rbp),%ecx
mov    -0x260(%rbp),%eax
imul   -0x264(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
imul   %eax,%ecx
mov    -0x250(%rbp),%eax
imul   -0x260(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
mov    -0x289(%rbp),%dl
mov    %eax,%esi
mov    -0x288(%rbp),%rax
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x12c(%rbp),%eax
mov    %al,-0x279(%rbp)
mov    -0x270(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x244(%rbp),%ecx
sub    -0x254(%rbp),%ecx
mov    -0x260(%rbp),%eax
imul   -0x264(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
imul   %eax,%ecx
mov    -0x250(%rbp),%eax
imul   -0x260(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
mov    -0x279(%rbp),%dl
mov    %eax,%esi
mov    -0x278(%rbp),%rax
add    %esi,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    196a <main+0x7ba>
mov    -0x12c(%rbp),%eax
mov    %al,-0x299(%rbp)
mov    -0x270(%rbp),%rax
mov    %rax,-0x298(%rbp)
mov    -0x244(%rbp),%ecx
sub    -0x254(%rbp),%ecx
mov    -0x260(%rbp),%eax
imul   -0x264(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
imul   %eax,%ecx
mov    -0x250(%rbp),%eax
imul   -0x260(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
mov    -0x299(%rbp),%dl
mov    %eax,%esi
mov    -0x298(%rbp),%rax
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x250(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x250(%rbp)
jmp    12f5 <main+0x145>
mov    -0x25c(%rbp),%esi
mov    -0x254(%rbp),%edx
mov    -0x258(%rbp),%ecx
lea    0x6dd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x254(%rbp),%eax
or     -0x258(%rbp),%eax
cmp    $0x0,%eax
je     1ac3 <main+0x913>
cmpl   $0x0,-0x268(%rbp)
je     1a33 <main+0x883>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0xbf,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x260(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x264(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1050 <fputc@plt>
movl   $0x0,-0x268(%rbp)
mov    -0x254(%rbp),%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x254(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x258(%rbp),%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x258(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x270(%rbp),%rdi
mov    -0x258(%rbp),%esi
sub    -0x254(%rbp),%esi
add    $0x1,%esi
mov    -0x260(%rbp),%eax
imul   -0x264(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x20(%rbp),%rcx
call   10d0 <fwrite@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1050 <fputc@plt>
mov    -0x4(%rbp),%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x158,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe31(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1284 <main+0xd4>
mov    %rax,%r13
mov    0x10(%rbx),%rdi
lea    0xe28(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
mov    $0x200,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    1210 <main+0x60>
movl   $0x40,(%rsp)
mov    $0x200000,%edi
call   1090 <malloc@plt>
movl   $0x0,0x4(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x200000,%edx
call   1040 <memset@plt>
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     12a0 <main+0xf0>
movl   $0x10,0xc(%rsp)
movl   $0x1,0x1c(%rsp)
xor    %ecx,%ecx
xor    %esi,%esi
mov    $0x10,%eax
mov    %rax,0x20(%rsp)
jmp    16e7 <main+0x537>
mov    0x8(%rbx),%rsi
lea    0xd74(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
jmp    17fc <main+0x64c>
mov    $0x10,%eax
mov    %rax,0x20(%rsp)
movl   $0x1,0x1c(%rsp)
lea    0x50(%rsp),%rbp
lea    0xd58(%rip),%r14
movl   $0x10,0xc(%rsp)
xor    %esi,%esi
xor    %ecx,%ecx
movl   $0x0,0x4(%rsp)
mov    %rax,0x38(%rsp)
movl   $0x0,0x2c(%rsp)
mov    %esi,0x8(%rsp)
mov    %ecx,%eax
mov    %rax,0x10(%rsp)
sub    0x4(%rsp),%ecx
mov    %rcx,0x30(%rsp)
lea    (%rcx,%rcx,1),%eax
mov    %eax,0x4c(%rsp)
jmp    1320 <main+0x170>
add    $0x1,%ecx
mov    %ecx,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    16de <main+0x52e>
mov    %rbp,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1060 <fgets@plt>
movl   $0x0,(%rsp)
xor    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
jmp    135a <main+0x1aa>
nop
movslq %ecx,%rdi
add    $0x1,%ecx
mov    %dl,(%rsi,%rdi,1)
mov    (%rsp),%esi
lea    0x1(%rsi),%edx
mov    %edx,(%rsp)
cmp    $0xff,%esi
jge    1380 <main+0x1d0>
movslq %edx,%rdx
movzbl 0x50(%rsp,%rdx,1),%edx
movslq %eax,%rsi
mov    (%rbx,%rsi,8),%rsi
cmp    $0x20,%dl
jg     1340 <main+0x190>
movslq %ecx,%rdx
movb   $0x0,(%rsi,%rdx,1)
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
xor    %ecx,%ecx
jmp    1349 <main+0x199>
nop
mov    (%rbx),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     146f <main+0x2bf>
mov    %r15,%rdi
lea    0xc86(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    148f <main+0x2df>
xor    %eax,%eax
nop
cmpb   $0x21,0x50(%rsp,%rax,1)
jl     13f4 <main+0x244>
cmpb   $0x21,0x51(%rsp,%rax,1)
jl     13e4 <main+0x234>
cmpb   $0x21,0x52(%rsp,%rax,1)
jl     13ea <main+0x23a>
cmpb   $0x21,0x53(%rsp,%rax,1)
jl     13f0 <main+0x240>
add    $0x4,%rax
cmp    $0x100,%rax
jne    13b0 <main+0x200>
movl   $0x100,(%rsp)
jmp    1310 <main+0x160>
add    $0x1,%rax
jmp    13f4 <main+0x244>
add    $0x2,%rax
jmp    13f4 <main+0x244>
add    $0x3,%rax
mov    %eax,(%rsp)
cmp    $0xff,%eax
jg     1310 <main+0x160>
mov    %eax,%ecx
cmpb   $0x20,0x50(%rsp,%rcx,1)
jg     142e <main+0x27e>
nopl   0x0(%rax,%rax,1)
cmp    $0xff,%rcx
je     12fc <main+0x14c>
lea    0x1(%rcx),%rax
cmpb   $0x20,0x51(%rsp,%rcx,1)
mov    %rax,%rcx
jle    1410 <main+0x260>
mov    %eax,(%rsp)
cmp    $0xff,%eax
jg     1310 <main+0x160>
movslq %eax,%rcx
add    %rsp,%rcx
add    $0x50,%rcx
add    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
cmpb   $0xa,(%rcx)
je     1310 <main+0x160>
mov    %eax,(%rsp)
add    $0x1,%rcx
add    $0x1,%eax
cmp    $0x101,%eax
jne    1450 <main+0x2a0>
jmp    1310 <main+0x160>
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %rax,0x20(%rsp)
jmp    1310 <main+0x160>
mov    %r15,%rdi
lea    0xb97(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1584 <main+0x3d4>
mov    %r15,%rdi
lea    0xbb2(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1563 <main+0x3b3>
mov    %r15,%rdi
lea    0xba2(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1577 <main+0x3c7>
cmpl   $0x0,0x2c(%rsp)
je     1310 <main+0x160>
mov    %r15,%rdi
lea    0xb88(%rip),%rsi
mov    %rsp,%rdx
call   10a0 <sscanf@plt>
mov    (%rsp),%eax
mov    0xc(%rsp),%esi
cmp    $0x10,%esi
jne    151e <main+0x36e>
mov    0x4c(%rsp),%ecx
imul   0x20(%rsp),%ecx
mov    0x38(%rsp),%rdi
lea    (%rcx,%rdi,2),%ecx
movslq %ecx,%rcx
mov    0x40(%rsp),%rdx
mov    %ah,(%rdx,%rcx,1)
or     $0x1,%ecx
jmp    1550 <main+0x3a0>
mov    0x20(%rsp),%rcx
imul   %esi,%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0x3,%edx
imul   0x30(%rsp),%edx
mov    0x38(%rsp),%rdi
imul   %edi,%esi
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
add    %edx,%ecx
mov    0x40(%rsp),%rdx
movslq %ecx,%rcx
mov    %al,(%rdx,%rcx,1)
add    $0x1,%edi
mov    %rdi,0x38(%rsp)
jmp    1310 <main+0x160>
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x1,0x2c(%rsp)
jmp    1310 <main+0x160>
movl   $0x0,0x2c(%rsp)
jmp    1310 <main+0x160>
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    0x10(%rsp),%rcx
add    $0x1,%ecx
cmp    %ecx,%eax
mov    %rax,0x30(%rsp)
je     16c3 <main+0x513>
lea    0xa90(%rip),%rdi
mov    0x8(%rsp),%esi
mov    0x10(%rsp),%rdx
mov    %rax,%rcx
mov    0x4(%rsp),%r15d
mov    %r15d,%r8d
mov    0x10(%rsp),%r9
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
or     %r15d,%eax
je     16b5 <main+0x505>
cmpl   $0x0,0x1c(%rsp)
mov    0x20(%rsp),%r15
je     163f <main+0x48f>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0xbf,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0x4,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    0xc(%rsp),%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %r15d,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0x1,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
movzbl 0x4(%rsp),%edi
mov    %r15,0x20(%rsp)
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    0x4(%rsp),%eax
movzbl %ah,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    0x10(%rsp),%r15
movzbl %r15b,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %r15,%rax
movzbl %ah,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
sub    0x4(%rsp),%r15d
add    $0x1,%r15d
mov    0x20(%rsp),%rax
imul   0xc(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
mov    0x40(%rsp),%rdi
mov    %r15d,%esi
mov    %r12,%rcx
call   10d0 <fwrite@plt>
movl   $0x0,0x1c(%rsp)
addl   $0x1,0x8(%rsp)
mov    0x30(%rsp),%rax
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
mov    0x30(%rsp),%rcx
mov    0x8(%rsp),%esi
je     12df <main+0x12f>
jmp    16e7 <main+0x537>
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%esi
lea    0x986(%rip),%rdi
xor    %ebx,%ebx
mov    0x4(%rsp),%ebp
mov    %ebp,%edx
mov    %rcx,%r13
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rax
or     %ebp,%eax
je     17d4 <main+0x624>
cmpl   $0x0,0x1c(%rsp)
mov    0x20(%rsp),%rbp
mov    0xc(%rsp),%r15d
je     1776 <main+0x5c6>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0xbf,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0x4,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %r15d,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %ebp,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    $0x1,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    0x4(%rsp),%eax
movzbl %al,%edi
mov    %eax,%ebx
mov    %r12,%rsi
call   1050 <fputc@plt>
movzbl %bh,%edi
mov    %ebx,%r14d
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %r13,%rbx
movzbl %bl,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
movzbl %bh,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
sub    %r14d,%ebx
add    $0x1,%ebx
imul   %r15d,%ebp
lea    0x7(%rbp),%edx
test   %ebp,%ebp
cmovns %ebp,%edx
sar    $0x3,%edx
mov    0x40(%rsp),%rdi
mov    %ebx,%esi
mov    %r12,%rcx
call   10d0 <fwrite@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    %ebx,%eax
add    $0x158,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@.str.1 = [16 x i8] c"open %s failed\0A\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [16 x i8] c"FONTBOUNDINGBOX\00"
@.str.4 = [10 x i8] c"STARTCHAR\00"
@.str.5 = [9 x i8] c"ENCODING\00"
@.str.6 = [41 x i8] c"chunk %d, break %d-%d, last range %d-%d\0A\00"
@.str.7 = [7 x i8] c"BITMAP\00"
@.str.8 = [8 x i8] c"ENDCHAR\00"
@.str.9 = [3 x i8] c"%X\00"
@.str.10 = [23 x i8] c"chunk %d, range %d-%d\0A\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 [256 x i8]
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [256 x i8]
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %29, i32** %6
%30 = load i32*, i32** %6
%31 = icmp ne i32* %30, null
br i1 %31, label %37, label %32
32: ; preds = %2
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %35)
store i32 -1, i32* %3
br label %437
37: ; preds = %2
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %41, i32** %7
%42 = call i8* @malloc(i32 512)
%43 = bitcast i8* %42 to i8**
store i8** %43, i8*** %9
store i32 0, i32* %10
br label %44
44: ; preds = %53, %37
%45 = load i32, i32* %10
%46 = icmp slt i32 %45, 64
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = call i8* @malloc(i32 64)
%49 = load i8**, i8*** %9
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
store i8* %48, i8** %52
br label %53
53: ; preds = %47
%54 = load i32, i32* %10
%55 = add nsw i32 %54, 1
store i32 %55, i32* %10
br label %44
56: ; preds = %44
store i32 0, i32* %17
%57 = call i8* @malloc(i32 2097152)
store i8* %57, i8** %25
%58 = load i8*, i8** %25
%59 = call i32 @memset(i8* %58, i32 0, i32 2097152)
store i32 0, i32* %16
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 16, i32* %22
store i32 16, i32* %23
store i32 1, i32* %24
br label %60
60: ; preds = %366, %294, %287, %279, %190, %118, %56
%61 = load i32*, i32** %6
%62 = call i32 @feof(i32* %61)
%63 = icmp ne i32 %62, 0
%64 = xor i1 %63, true
br i1 %64, label %65, label %367
65: ; preds = %60
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%67 = load i32*, i32** %6
%68 = call i32 @fgets(i8* %66, i32 255, i32* %67)
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %10
br label %69
69: ; preds = %109, %65
%70 = load i32, i32* %10
%71 = icmp slt i32 %70, 256
br i1 %71, label %72, label %112
72: ; preds = %69
%73 = load i32, i32* %10
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp sle i32 %77, 32
br i1 %78, label %79, label %94
79: ; preds = %72
%80 = load i8**, i8*** %9
%81 = load i32, i32* %11
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = load i32, i32* %12
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %84, i64 %86
store i8 0, i8* %87
%88 = load i32, i32* %12
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %79
%91 = load i32, i32* %11
%92 = add nsw i32 %91, 1
store i32 %92, i32* %11
br label %93
93: ; preds = %90, %79
store i32 0, i32* %12
br label %108
94: ; preds = %72
%95 = load i32, i32* %10
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %96
%98 = load i8, i8* %97
%99 = load i8**, i8*** %9
%100 = load i32, i32* %11
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8*, i8** %99, i64 %101
%103 = load i8*, i8** %102
%104 = load i32, i32* %12
%105 = add nsw i32 %104, 1
store i32 %105, i32* %12
%106 = sext i32 %104 to i64
%107 = getelementptr inbounds i8, i8* %103, i64 %106
store i8 %98, i8* %107
br label %108
108: ; preds = %94, %93
br label %109
109: ; preds = %108
%110 = load i32, i32* %10
%111 = add nsw i32 %110, 1
store i32 %111, i32* %10
br label %69
112: ; preds = %69
%113 = load i8**, i8*** %9
%114 = getelementptr inbounds i8*, i8** %113, i64 0
%115 = load i8*, i8** %114
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%117 = icmp ne i32 %116, 0
br i1 %117, label %127, label %118
118: ; preds = %112
%119 = load i8**, i8*** %9
%120 = getelementptr inbounds i8*, i8** %119, i64 1
%121 = load i8*, i8** %120
%122 = call i32 @atoi(i8* %121)
store i32 %122, i32* %22
%123 = load i8**, i8*** %9
%124 = getelementptr inbounds i8*, i8** %123, i64 2
%125 = load i8*, i8** %124
%126 = call i32 @atoi(i8* %125)
store i32 %126, i32* %23
br label %60
127: ; preds = %112
%128 = load i8**, i8*** %9
%129 = getelementptr inbounds i8*, i8** %128, i64 0
%130 = load i8*, i8** %129
%131 = call i32 @strcmp(i8* %130, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%132 = icmp ne i32 %131, 0
br i1 %132, label %194, label %133
133: ; preds = %127
store i32 0, i32* %10
br label %134
134: ; preds = %146, %133
%135 = load i32, i32* %10
%136 = icmp slt i32 %135, 256
br i1 %136, label %137, label %149
137: ; preds = %134
%138 = load i32, i32* %10
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp sle i32 %142, 32
br i1 %143, label %144, label %145
144: ; preds = %137
br label %149
145: ; preds = %137
br label %146
146: ; preds = %145
%147 = load i32, i32* %10
%148 = add nsw i32 %147, 1
store i32 %148, i32* %10
br label %134
149: ; preds = %144, %134
br label %150
150: ; preds = %162, %149
%151 = load i32, i32* %10
%152 = icmp slt i32 %151, 256
br i1 %152, label %153, label %165
153: ; preds = %150
%154 = load i32, i32* %10
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %155
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp sgt i32 %158, 32
br i1 %159, label %160, label %161
160: ; preds = %153
br label %165
161: ; preds = %153
br label %162
162: ; preds = %161
%163 = load i32, i32* %10
%164 = add nsw i32 %163, 1
store i32 %164, i32* %10
br label %150
165: ; preds = %160, %150
store i32 0, i32* %11
br label %166
166: ; preds = %187, %165
%167 = load i32, i32* %10
%168 = icmp slt i32 %167, 256
br i1 %168, label %169, label %190
169: ; preds = %166
%170 = load i32, i32* %10
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %171
%173 = load i8, i8* %172
%174 = sext i8 %173 to i32
%175 = icmp eq i32 %174, 10
br i1 %175, label %176, label %177
176: ; preds = %169
br label %190
177: ; preds = %169
%178 = load i32, i32* %10
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %179
%181 = load i8, i8* %180
%182 = load i32, i32* %11
%183 = add nsw i32 %182, 1
store i32 %183, i32* %11
%184 = sext i32 %182 to i64
%185 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 %184
store i8 %181, i8* %185
br label %186
186: ; preds = %177
br label %187
187: ; preds = %186
%188 = load i32, i32* %10
%189 = add nsw i32 %188, 1
store i32 %189, i32* %10
br label %166
190: ; preds = %176, %166
%191 = load i32, i32* %11
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 %192
store i8 0, i8* %193
br label %60
194: ; preds = %127
%195 = load i8**, i8*** %9
%196 = getelementptr inbounds i8*, i8** %195, i64 0
%197 = load i8*, i8** %196
%198 = call i32 @strcmp(i8* %197, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%199 = icmp ne i32 %198, 0
br i1 %199, label %281, label %200
200: ; preds = %194
%201 = load i8**, i8*** %9
%202 = getelementptr inbounds i8*, i8** %201, i64 1
%203 = load i8*, i8** %202
%204 = call i32 @atoi(i8* %203)
store i32 %204, i32* %15
%205 = load i32, i32* %15
%206 = load i32, i32* %16
%207 = add nsw i32 %206, 1
%208 = icmp ne i32 %205, %207
br i1 %208, label %209, label %277
209: ; preds = %200
%210 = load i32, i32* %21
%211 = load i32, i32* %16
%212 = load i32, i32* %15
%213 = load i32, i32* %19
%214 = load i32, i32* %20
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i32 %210, i32 %211, i32 %212, i32 %213, i32 %214)
%216 = load i32, i32* %19
%217 = load i32, i32* %20
%218 = or i32 %216, %217
%219 = icmp ne i32 %218, 0
br i1 %219, label %220, label %272
220: ; preds = %209
%221 = load i32, i32* %24
%222 = icmp ne i32 %221, 0
br i1 %222, label %223, label %242
223: ; preds = %220
%224 = load i32*, i32** %7
%225 = call i32 @fputc(i32 0, i32* %224)
%226 = load i32*, i32** %7
%227 = call i32 @fputc(i32 191, i32* %226)
%228 = load i32*, i32** %7
%229 = call i32 @fputc(i32 4, i32* %228)
%230 = load i32*, i32** %7
%231 = call i32 @fputc(i32 0, i32* %230)
%232 = load i32*, i32** %7
%233 = call i32 @fputc(i32 0, i32* %232)
%234 = load i32, i32* %22
%235 = load i32*, i32** %7
%236 = call i32 @fputc(i32 %234, i32* %235)
%237 = load i32, i32* %23
%238 = load i32*, i32** %7
%239 = call i32 @fputc(i32 %237, i32* %238)
%240 = load i32*, i32** %7
%241 = call i32 @fputc(i32 1, i32* %240)
store i32 0, i32* %24
br label %242
242: ; preds = %223, %220
%243 = load i32, i32* %19
%244 = and i32 %243, 255
%245 = load i32*, i32** %7
%246 = call i32 @fputc(i32 %244, i32* %245)
%247 = load i32, i32* %19
%248 = ashr i32 %247, 8
%249 = and i32 %248, 255
%250 = load i32*, i32** %7
%251 = call i32 @fputc(i32 %249, i32* %250)
%252 = load i32, i32* %20
%253 = and i32 %252, 255
%254 = load i32*, i32** %7
%255 = call i32 @fputc(i32 %253, i32* %254)
%256 = load i32, i32* %20
%257 = ashr i32 %256, 8
%258 = and i32 %257, 255
%259 = load i32*, i32** %7
%260 = call i32 @fputc(i32 %258, i32* %259)
%261 = load i8*, i8** %25
%262 = load i32, i32* %20
%263 = load i32, i32* %19
%264 = sub nsw i32 %262, %263
%265 = add nsw i32 %264, 1
%266 = load i32, i32* %22
%267 = load i32, i32* %23
%268 = mul nsw i32 %266, %267
%269 = sdiv i32 %268, 8
%270 = load i32*, i32** %7
%271 = call i32 @fwrite(i8* %261, i32 %265, i32 %269, i32* %270)
br label %272
272: ; preds = %242, %209
%273 = load i32, i32* %15
store i32 %273, i32* %19
%274 = load i32, i32* %15
store i32 %274, i32* %20
%275 = load i32, i32* %21
%276 = add nsw i32 %275, 1
store i32 %276, i32* %21
br label %279
277: ; preds = %200
%278 = load i32, i32* %15
store i32 %278, i32* %20
br label %279
279: ; preds = %277, %272
%280 = load i32, i32* %15
store i32 %280, i32* %16
br label %60
281: ; preds = %194
%282 = load i8**, i8*** %9
%283 = getelementptr inbounds i8*, i8** %282, i64 0
%284 = load i8*, i8** %283
%285 = call i32 @strcmp(i8* %284, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%286 = icmp ne i32 %285, 0
br i1 %286, label %288, label %287
287: ; preds = %281
store i32 1, i32* %17
store i32 0, i32* %18
br label %60
288: ; preds = %281
%289 = load i8**, i8*** %9
%290 = getelementptr inbounds i8*, i8** %289, i64 0
%291 = load i8*, i8** %290
%292 = call i32 @strcmp(i8* %291, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%293 = icmp ne i32 %292, 0
br i1 %293, label %295, label %294
294: ; preds = %288
store i32 0, i32* %17
br label %60
295: ; preds = %288
%296 = load i32, i32* %17
%297 = icmp ne i32 %296, 0
br i1 %297, label %298, label %366
298: ; preds = %295
%299 = load i8**, i8*** %9
%300 = getelementptr inbounds i8*, i8** %299, i64 0
%301 = load i8*, i8** %300
%302 = call i32 @sscanf(i8* %301, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %10)
%303 = load i32, i32* %22
%304 = icmp eq i32 %303, 16
br i1 %304, label %305, label %344
305: ; preds = %298
%306 = load i32, i32* %10
%307 = ashr i32 %306, 8
%308 = trunc i32 %307 to i8
%309 = load i8*, i8** %25
%310 = load i32, i32* %15
%311 = load i32, i32* %19
%312 = sub nsw i32 %310, %311
%313 = load i32, i32* %22
%314 = load i32, i32* %23
%315 = mul nsw i32 %313, %314
%316 = sdiv i32 %315, 8
%317 = mul nsw i32 %312, %316
%318 = load i32, i32* %18
%319 = load i32, i32* %22
%320 = mul nsw i32 %318, %319
%321 = sdiv i32 %320, 8
%322 = add nsw i32 %317, %321
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i8, i8* %309, i64 %323
store i8 %308, i8* %324
%325 = load i32, i32* %10
%326 = trunc i32 %325 to i8
%327 = load i8*, i8** %25
%328 = load i32, i32* %15
%329 = load i32, i32* %19
%330 = sub nsw i32 %328, %329
%331 = load i32, i32* %22
%332 = load i32, i32* %23
%333 = mul nsw i32 %331, %332
%334 = sdiv i32 %333, 8
%335 = mul nsw i32 %330, %334
%336 = load i32, i32* %18
%337 = load i32, i32* %22
%338 = mul nsw i32 %336, %337
%339 = sdiv i32 %338, 8
%340 = add nsw i32 %335, %339
%341 = add nsw i32 %340, 1
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds i8, i8* %327, i64 %342
store i8 %326, i8* %343
br label %363
344: ; preds = %298
%345 = load i32, i32* %10
%346 = trunc i32 %345 to i8
%347 = load i8*, i8** %25
%348 = load i32, i32* %15
%349 = load i32, i32* %19
%350 = sub nsw i32 %348, %349
%351 = load i32, i32* %22
%352 = load i32, i32* %23
%353 = mul nsw i32 %351, %352
%354 = sdiv i32 %353, 8
%355 = mul nsw i32 %350, %354
%356 = load i32, i32* %18
%357 = load i32, i32* %22
%358 = mul nsw i32 %356, %357
%359 = sdiv i32 %358, 8
%360 = add nsw i32 %355, %359
%361 = sext i32 %360 to i64
%362 = getelementptr inbounds i8, i8* %347, i64 %361
store i8 %346, i8* %362
br label %363
363: ; preds = %344, %305
%364 = load i32, i32* %18
%365 = add nsw i32 %364, 1
store i32 %365, i32* %18
br label %366
366: ; preds = %363, %295
br label %60
367: ; preds = %60
%368 = load i32, i32* %21
%369 = load i32, i32* %19
%370 = load i32, i32* %20
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %368, i32 %369, i32 %370)
%372 = load i32, i32* %19
%373 = load i32, i32* %20
%374 = or i32 %372, %373
%375 = icmp ne i32 %374, 0
br i1 %375, label %376, label %428
376: ; preds = %367
%377 = load i32, i32* %24
%378 = icmp ne i32 %377, 0
br i1 %378, label %379, label %398
379: ; preds = %376
%380 = load i32*, i32** %7
%381 = call i32 @fputc(i32 0, i32* %380)
%382 = load i32*, i32** %7
%383 = call i32 @fputc(i32 191, i32* %382)
%384 = load i32*, i32** %7
%385 = call i32 @fputc(i32 4, i32* %384)
%386 = load i32*, i32** %7
%387 = call i32 @fputc(i32 0, i32* %386)
%388 = load i32*, i32** %7
%389 = call i32 @fputc(i32 0, i32* %388)
%390 = load i32, i32* %22
%391 = load i32*, i32** %7
%392 = call i32 @fputc(i32 %390, i32* %391)
%393 = load i32, i32* %23
%394 = load i32*, i32** %7
%395 = call i32 @fputc(i32 %393, i32* %394)
%396 = load i32*, i32** %7
%397 = call i32 @fputc(i32 1, i32* %396)
store i32 0, i32* %24
br label %398
398: ; preds = %379, %376
%399 = load i32, i32* %19
%400 = and i32 %399, 255
%401 = load i32*, i32** %7
%402 = call i32 @fputc(i32 %400, i32* %401)
%403 = load i32, i32* %19
%404 = ashr i32 %403, 8
%405 = and i32 %404, 255
%406 = load i32*, i32** %7
%407 = call i32 @fputc(i32 %405, i32* %406)
%408 = load i32, i32* %20
%409 = and i32 %408, 255
%410 = load i32*, i32** %7
%411 = call i32 @fputc(i32 %409, i32* %410)
%412 = load i32, i32* %20
%413 = ashr i32 %412, 8
%414 = and i32 %413, 255
%415 = load i32*, i32** %7
%416 = call i32 @fputc(i32 %414, i32* %415)
%417 = load i8*, i8** %25
%418 = load i32, i32* %20
%419 = load i32, i32* %19
%420 = sub nsw i32 %418, %419
%421 = add nsw i32 %420, 1
%422 = load i32, i32* %22
%423 = load i32, i32* %23
%424 = mul nsw i32 %422, %423
%425 = sdiv i32 %424, 8
%426 = load i32*, i32** %7
%427 = call i32 @fwrite(i8* %417, i32 %421, i32 %425, i32* %426)
br label %428
428: ; preds = %398, %367
%429 = load i32*, i32** %7
%430 = call i32 @fputc(i32 0, i32* %429)
%431 = load i32*, i32** %7
%432 = call i32 @fputc(i32 0, i32* %431)
%433 = load i32*, i32** %7
%434 = call i32 @fputc(i32 0, i32* %433)
%435 = load i32*, i32** %7
%436 = call i32 @fputc(i32 0, i32* %435)
br label %437
437: ; preds = %428, %32
%438 = load i32, i32* %3
ret i32 %438
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@.str.1 = [16 x i8] c"open %s failed\0A\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [16 x i8] c"FONTBOUNDINGBOX\00"
@.str.4 = [10 x i8] c"STARTCHAR\00"
@.str.5 = [9 x i8] c"ENCODING\00"
@.str.6 = [41 x i8] c"chunk %d, break %d-%d, last range %d-%d\0A\00"
@.str.7 = [7 x i8] c"BITMAP\00"
@.str.8 = [8 x i8] c"ENDCHAR\00"
@.str.9 = [3 x i8] c"%X\00"
@.str.10 = [23 x i8] c"chunk %d, range %d-%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %296
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call dereferenceable_or_null(512) i8* @malloc(i32 512)
%19 = bitcast i8* %18 to i8**
br label %20
20: ; preds = %14, %20
%21 = phi i64 [ 0, %14 ], [ %24, %20 ]
%22 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%23 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* %22, i8** %23
%24 = add nuw nsw i64 %21, 1
%25 = icmp eq i64 %24, 64
br i1 %25, label %26, label %20
26: ; preds = %20
store i32 64, i32* %4
%27 = tail call dereferenceable_or_null(2097152) i8* @malloc(i32 2097152)
%28 = tail call i32 @memset(i8* %27, i32 0, i32 2097152)
%29 = call i32 @feof(i32* %9)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %254
31: ; preds = %26
%32 = getelementptr inbounds i8*, i8** %19, i64 1
%33 = getelementptr inbounds i8*, i8** %19, i64 2
br label %34
34: ; preds = %31, %211
%35 = phi i32 [ 1, %31 ], [ %214, %211 ]
%36 = phi i32 [ 16, %31 ], [ %62, %211 ]
%37 = phi i32 [ 16, %31 ], [ %63, %211 ]
%38 = phi i32 [ 0, %31 ], [ %213, %211 ]
%39 = phi i32 [ 0, %31 ], [ %174, %211 ]
%40 = phi i32 [ 0, %31 ], [ %212, %211 ]
%41 = phi i32 [ undef, %31 ], [ %60, %211 ]
%42 = phi i32 [ 0, %31 ], [ %55, %211 ]
%43 = phi i32 [ undef, %31 ], [ %174, %211 ]
%44 = sub nsw i32 %43, %40
%45 = shl i32 %44, 1
br label %51
46: ; preds = %217, %220
%47 = phi i32 [ 1, %217 ], [ 0, %220 ]
%48 = phi i32 [ 0, %217 ], [ %60, %220 ]
%49 = call i32 @feof(i32* %9)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %254
51: ; preds = %34, %46
%52 = phi i32 [ %36, %34 ], [ %62, %46 ]
%53 = phi i32 [ %37, %34 ], [ %63, %46 ]
%54 = phi i32 [ %41, %34 ], [ %48, %46 ]
%55 = phi i32 [ %42, %34 ], [ %47, %46 ]
%56 = icmp eq i32 %55, 0
br label %57
57: ; preds = %51, %250
%58 = phi i32 [ %52, %51 ], [ %62, %250 ]
%59 = phi i32 [ %53, %51 ], [ %63, %250 ]
%60 = phi i32 [ %54, %51 ], [ %251, %250 ]
br label %61
61: ; preds = %57, %97
%62 = phi i32 [ %58, %57 ], [ %101, %97 ]
%63 = phi i32 [ %59, %57 ], [ %99, %97 ]
br label %64
64: ; preds = %61, %166
%65 = call i32 @fgets(i8* %5, i32 255, i32* %9)
store i32 0, i32* %4
br label %66
66: ; preds = %64, %87
%67 = phi i32 [ 0, %64 ], [ %89, %87 ]
%68 = phi i32 [ 0, %64 ], [ %88, %87 ]
%69 = phi i32 [ 0, %64 ], [ %91, %87 ]
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = icmp slt i8 %72, 33
%74 = sext i32 %67 to i64
%75 = getelementptr inbounds i8*, i8** %19, i64 %74
%76 = load i8*, i8** %75
br i1 %73, label %77, label %83
77: ; preds = %66
%78 = sext i32 %68 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
store i8 0, i8* %79
%80 = icmp ne i32 %68, 0
%81 = zext i1 %80 to i32
%82 = add nsw i32 %67, %81
br label %87
83: ; preds = %66
%84 = add nsw i32 %68, 1
%85 = sext i32 %68 to i64
%86 = getelementptr inbounds i8, i8* %76, i64 %85
store i8 %72, i8* %86
br label %87
87: ; preds = %77, %83
%88 = phi i32 [ 0, %77 ], [ %84, %83 ]
%89 = phi i32 [ %82, %77 ], [ %67, %83 ]
%90 = load i32, i32* %4
%91 = add nsw i32 %90, 1
store i32 %91, i32* %4
%92 = icmp slt i32 %90, 255
br i1 %92, label %66, label %93
93: ; preds = %87
%94 = load i8*, i8** %19
%95 = call i32 @strcmp(i8* dereferenceable(1) %94, i8* dereferenceable(16) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %104
97: ; preds = %93
%98 = load i8*, i8** %32
%99 = call i32 @atoi(i8* %98)
%100 = load i8*, i8** %33
%101 = call i32 @atoi(i8* %100)
%102 = call i32 @feof(i32* %9)
%103 = icmp eq i32 %102, 0
br i1 %103, label %61, label %254
104: ; preds = %93
%105 = call i32 @strcmp(i8* dereferenceable(1) %94, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%106 = icmp eq i32 %105, 0
br i1 %106, label %107, label %169
107: ; preds = %104, %127
%108 = phi i64 [ %128, %127 ], [ 0, %104 ]
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = icmp slt i8 %110, 33
br i1 %111, label %131, label %112
112: ; preds = %107
%113 = or i64 %108, 1
%114 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = icmp slt i8 %115, 33
br i1 %116, label %131, label %117
117: ; preds = %112
%118 = or i64 %108, 2
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = icmp slt i8 %120, 33
br i1 %121, label %131, label %122
122: ; preds = %117
%123 = or i64 %108, 3
%124 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %123
%125 = load i8, i8* %124
%126 = icmp slt i8 %125, 33
br i1 %126, label %131, label %127
127: ; preds = %122
%128 = add nuw nsw i64 %108, 4
%129 = icmp eq i64 %128, 256
br i1 %129, label %130, label %107
130: ; preds = %127
store i32 256, i32* %4
br label %166
131: ; preds = %122, %117, %112, %107
%132 = phi i64 [ %108, %107 ], [ %113, %112 ], [ %118, %117 ], [ %123, %122 ]
%133 = trunc i64 %132 to i32
store i32 %133, i32* %4
%134 = icmp slt i32 %133, 256
br i1 %134, label %135, label %166
135: ; preds = %131
%136 = and i64 %132, 4294967295
%137 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %136
%138 = load i8, i8* %137
%139 = icmp sgt i8 %138, 32
br i1 %139, label %151, label %144
140: ; preds = %144
%141 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %146
%142 = load i8, i8* %141
%143 = icmp sgt i8 %142, 32
br i1 %143, label %149, label %144
144: ; preds = %135, %140
%145 = phi i64 [ %146, %140 ], [ %136, %135 ]
%146 = add nuw nsw i64 %145, 1
%147 = trunc i64 %146 to i32
%148 = icmp eq i64 %146, 256
br i1 %148, label %165, label %140
149: ; preds = %140
store i32 %147, i32* %4
%150 = trunc i64 %146 to i32
br label %151
151: ; preds = %149, %135
%152 = phi i32 [ %133, %135 ], [ %150, %149 ]
%153 = icmp slt i32 %152, 256
br i1 %153, label %154, label %166
154: ; preds = %151
%155 = sext i32 %152 to i64
br label %156
156: ; preds = %154, %161
%157 = phi i64 [ %155, %154 ], [ %162, %161 ]
%158 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %157
%159 = load i8, i8* %158
%160 = icmp eq i8 %159, 10
br i1 %160, label %166, label %161
161: ; preds = %156
%162 = add nsw i64 %157, 1
%163 = trunc i64 %162 to i32
store i32 %163, i32* %4
%164 = icmp eq i32 %163, 256
br i1 %164, label %166, label %156
165: ; preds = %144
store i32 %147, i32* %4
br label %166
166: ; preds = %161, %156, %165, %130, %131, %151
%167 = call i32 @feof(i32* %9)
%168 = icmp eq i32 %167, 0
br i1 %168, label %64, label %254
169: ; preds = %104
%170 = call i32 @strcmp(i8* dereferenceable(1) %94, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%171 = icmp eq i32 %170, 0
br i1 %171, label %172, label %217
172: ; preds = %169
%173 = load i8*, i8** %32
%174 = call i32 @atoi(i8* %173)
%175 = add nsw i32 %39, 1
%176 = icmp eq i32 %174, %175
br i1 %176, label %211, label %177
177: ; preds = %172
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i32 %38, i32 %39, i32 %174, i32 %40, i32 %39)
%179 = or i32 %39, %40
%180 = icmp eq i32 %179, 0
br i1 %180, label %208, label %181
181: ; preds = %177
%182 = icmp eq i32 %35, 0
br i1 %182, label %192, label %183
183: ; preds = %181
%184 = call i32 @fputc(i32 0, i32* %17)
%185 = call i32 @fputc(i32 191, i32* %17)
%186 = call i32 @fputc(i32 4, i32* %17)
%187 = call i32 @fputc(i32 0, i32* %17)
%188 = call i32 @fputc(i32 0, i32* %17)
%189 = call i32 @fputc(i32 %63, i32* %17)
%190 = call i32 @fputc(i32 %62, i32* %17)
%191 = call i32 @fputc(i32 1, i32* %17)
br label %192
192: ; preds = %183, %181
%193 = and i32 %40, 255
%194 = call i32 @fputc(i32 %193, i32* %17)
%195 = lshr i32 %40, 8
%196 = and i32 %195, 255
%197 = call i32 @fputc(i32 %196, i32* %17)
%198 = and i32 %39, 255
%199 = call i32 @fputc(i32 %198, i32* %17)
%200 = lshr i32 %39, 8
%201 = and i32 %200, 255
%202 = call i32 @fputc(i32 %201, i32* %17)
%203 = sub i32 1, %40
%204 = add i32 %203, %39
%205 = mul nsw i32 %62, %63
%206 = sdiv i32 %205, 8
%207 = call i32 @fwrite(i8* %27, i32 %204, i32 %206, i32* %17)
br label %208
208: ; preds = %192, %177
%209 = phi i32 [ 0, %192 ], [ %35, %177 ]
%210 = add nsw i32 %38, 1
br label %211
211: ; preds = %172, %208
%212 = phi i32 [ %174, %208 ], [ %40, %172 ]
%213 = phi i32 [ %210, %208 ], [ %38, %172 ]
%214 = phi i32 [ %209, %208 ], [ %35, %172 ]
%215 = call i32 @feof(i32* %9)
%216 = icmp eq i32 %215, 0
br i1 %216, label %34, label %254
217: ; preds = %169
%218 = call i32 @strcmp(i8* dereferenceable(1) %94, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%219 = icmp eq i32 %218, 0
br i1 %219, label %46, label %220
220: ; preds = %217
%221 = call i32 @strcmp(i8* dereferenceable(1) %94, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%222 = icmp eq i32 %221, 0
br i1 %222, label %46, label %223
223: ; preds = %220
br i1 %56, label %250, label %224
224: ; preds = %223
%225 = call i32 @sscanf(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %4)
%226 = icmp eq i32 %63, 16
%227 = load i32, i32* %4
br i1 %226, label %228, label %237
228: ; preds = %224
%229 = lshr i32 %227, 8
%230 = trunc i32 %229 to i8
%231 = mul i32 %45, %62
%232 = shl nsw i32 %60, 1
%233 = add nsw i32 %231, %232
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i8, i8* %27, i64 %234
store i8 %230, i8* %235
%236 = or i32 %233, 1
br label %244
237: ; preds = %224
%238 = mul nsw i32 %62, %63
%239 = sdiv i32 %238, 8
%240 = mul nsw i32 %239, %44
%241 = mul nsw i32 %63, %60
%242 = sdiv i32 %241, 8
%243 = add nsw i32 %240, %242
br label %244
244: ; preds = %237, %228
%245 = phi i32 [ %243, %237 ], [ %236, %228 ]
%246 = trunc i32 %227 to i8
%247 = sext i32 %245 to i64
%248 = getelementptr inbounds i8, i8* %27, i64 %247
store i8 %246, i8* %248
%249 = add nsw i32 %60, 1
br label %250
250: ; preds = %244, %223
%251 = phi i32 [ %249, %244 ], [ %60, %223 ]
%252 = call i32 @feof(i32* %9)
%253 = icmp eq i32 %252, 0
br i1 %253, label %57, label %254
254: ; preds = %211, %46, %250, %97, %166, %26
%255 = phi i32 [ 0, %26 ], [ %40, %166 ], [ %40, %97 ], [ %40, %250 ], [ %40, %46 ], [ %212, %211 ]
%256 = phi i32 [ 0, %26 ], [ %39, %166 ], [ %39, %97 ], [ %39, %250 ], [ %39, %46 ], [ %174, %211 ]
%257 = phi i32 [ 0, %26 ], [ %38, %166 ], [ %38, %97 ], [ %38, %250 ], [ %38, %46 ], [ %213, %211 ]
%258 = phi i32 [ 1, %26 ], [ %35, %166 ], [ %35, %97 ], [ %35, %250 ], [ %35, %46 ], [ %214, %211 ]
%259 = phi i32 [ 16, %26 ], [ %63, %166 ], [ %99, %97 ], [ %63, %250 ], [ %63, %46 ], [ %63, %211 ]
%260 = phi i32 [ 16, %26 ], [ %62, %166 ], [ %101, %97 ], [ %62, %250 ], [ %62, %46 ], [ %62, %211 ]
%261 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %257, i32 %255, i32 %256)
%262 = or i32 %256, %255
%263 = icmp eq i32 %262, 0
br i1 %263, label %291, label %264
264: ; preds = %254
%265 = icmp eq i32 %258, 0
br i1 %265, label %275, label %266
266: ; preds = %264
%267 = call i32 @fputc(i32 0, i32* %17)
%268 = call i32 @fputc(i32 191, i32* %17)
%269 = call i32 @fputc(i32 4, i32* %17)
%270 = call i32 @fputc(i32 0, i32* %17)
%271 = call i32 @fputc(i32 0, i32* %17)
%272 = call i32 @fputc(i32 %259, i32* %17)
%273 = call i32 @fputc(i32 %260, i32* %17)
%274 = call i32 @fputc(i32 1, i32* %17)
br label %275
275: ; preds = %266, %264
%276 = and i32 %255, 255
%277 = call i32 @fputc(i32 %276, i32* %17)
%278 = lshr i32 %255, 8
%279 = and i32 %278, 255
%280 = call i32 @fputc(i32 %279, i32* %17)
%281 = and i32 %256, 255
%282 = call i32 @fputc(i32 %281, i32* %17)
%283 = lshr i32 %256, 8
%284 = and i32 %283, 255
%285 = call i32 @fputc(i32 %284, i32* %17)
%286 = sub i32 1, %255
%287 = add i32 %286, %256
%288 = mul nsw i32 %260, %259
%289 = sdiv i32 %288, 8
%290 = call i32 @fwrite(i8* %27, i32 %287, i32 %289, i32* %17)
br label %291
291: ; preds = %275, %254
%292 = call i32 @fputc(i32 0, i32* %17)
%293 = call i32 @fputc(i32 0, i32* %17)
%294 = call i32 @fputc(i32 0, i32* %17)
%295 = call i32 @fputc(i32 0, i32* %17)
br label %296
296: ; preds = %291, %11
%297 = phi i32 [ 0, %291 ], [ -1, %11 ]
ret i32 %297
}