#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void *malloc(int);
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  unsigned char *charbuf, *map;
  FILE *fd, *ofd;
  char *buf;
  int s, e;
  int i, j;
  int w, h, wl;
  charbuf = malloc(65536 * 128);
  map = malloc(65536 / 8);
  memset(map, 0, 65536 / 8);
  w = 8;
  h = 16;
  wl = 0;
  for (i = 2; i < argc; i++) {
    printf("%s\n", argv[i]);
    fd = fopen(argv[i], "rb");
    s = fgetc(fd);
    s += fgetc(fd) << 8;
    e = fgetc(fd);
    e += fgetc(fd) << 8;
    if (s == 0xBF00) {
      buf = malloc(16);
      fread(buf, 1, e, fd);
      if (!wl) {
        w = buf[1];
        h = buf[2];
        printf("head %dx%d\n", w, h);
        wl = 1;
      } else if ((buf[1] != w) || (buf[2] != h)) {
        printf("font cell dimension mismatch\n");
        exit(-1);
      }
    } else {
      printf("missing head.\n");
      exit(-1);
    }
    while (1) {
      s = fgetc(fd);
      s += fgetc(fd) << 8;
      e = fgetc(fd);
      e += fgetc(fd) << 8;
      if (!s && !e)
        break;
      buf = malloc(((e - s) + 1) * ((w * h) / 8));
      fread(buf, (e - s) + 1, (w * h) / 8, fd);
      for (j = 0; j < ((e - s) + 1); j++)
        if (!(map[(s + j) / 8] & (1 << ((s + j) & 7)))) {
          map[(s + j) / 8] |= 1 << ((s + j) & 7);
          memcpy(charbuf + ((s + j) * ((w * h) / 8)), buf + (j * ((w * h) / 8)),
                 ((w * h) / 8));
        }
    }
    fclose(fd);
  }
  ofd = fopen(argv[1], "wb");
  fputc(0x00, ofd);
  fputc(0xBF, ofd);
  fputc(0x04, ofd);
  fputc(0x00, ofd);
  fputc(0x00, ofd);
  fputc(w, ofd);
  fputc(h, ofd);
  fputc(0x01, ofd);
  s = 0;
  e = 0;
  for (i = 0; i < 65536; i++) {
    if (map[i / 8] & (1 << (i & 7))) {
      if (!s) {
        s = i;
        e = i;
      } else
        e = i;
    } else {
      if (s || e) {
        fputc(s & 0xff, ofd);
        fputc((s >> 8) & 0xff, ofd);
        fputc(e & 0xff, ofd);
        fputc((e >> 8) & 0xff, ofd);
        fwrite(charbuf + (s * ((w * h) / 8)), e - s + 1, ((w * h) / 8), ofd);
      }
      s = 0;
      e = 0;
    }
  }
  if (s || e) {
    fputc(s & 0xff, ofd);
    fputc((s >> 8) & 0xff, ofd);
    fputc(e & 0xff, ofd);
    fputc((e >> 8) & 0xff, ofd);
    fwrite(charbuf + (s * ((w * h) / 8)), e - s + 1, ((w * h) / 8), ofd);
  }
  fputc(0, ofd);
  fputc(0, ofd);
  fputc(0, ofd);
  fputc(0, ofd);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x800000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1060 <memset@plt>
movl   $0x8,-0x4c(%rbp)
movl   $0x10,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x2,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1527 <main+0x377>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdba(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0xbf00,-0x3c(%rbp)
jne    1343 <main+0x193>
mov    $0x10,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmpl   $0x0,-0x54(%rbp)
jne    12ff <main+0x14f>
mov    -0x38(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x38(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x54(%rbp)
jmp    133e <main+0x18e>
mov    -0x38(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    -0x4c(%rbp),%eax
jne    1321 <main+0x171>
mov    -0x38(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    -0x50(%rbp),%eax
je     1339 <main+0x189>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    133e <main+0x18e>
jmp    135b <main+0x1ab>
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    1360 <main+0x1b0>
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    13b5 <main+0x205>
cmpl   $0x0,-0x40(%rbp)
jne    13b5 <main+0x205>
jmp    1510 <main+0x360>
mov    -0x40(%rbp),%edi
sub    -0x3c(%rbp),%edi
add    $0x1,%edi
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
imul   %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%esi
sub    -0x3c(%rbp),%esi
add    $0x1,%esi
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x28(%rbp),%rcx
call   1030 <fread@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    -0x3c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    150b <main+0x35b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x48(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    14f8 <main+0x348>
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x48(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x68(%rbp),%eax
imul   %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
imul   %ecx,%eax
cltq
add    %rax,%rsi
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1090 <memcpy@plt>
jmp    14fd <main+0x34d>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1407 <main+0x257>
jmp    1360 <main+0x1b0>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1211 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xb0a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
mov    $0xbf,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
mov    $0x4,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x4c(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x50(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
mov    $0x1,%edi
call   1080 <fputc@plt>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x10000,-0x44(%rbp)
jge    16f0 <main+0x540>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x44(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1624 <main+0x474>
cmpl   $0x0,-0x3c(%rbp)
jne    1619 <main+0x469>
mov    -0x44(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    161f <main+0x46f>
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    16dd <main+0x52d>
cmpl   $0x0,-0x3c(%rbp)
jne    1638 <main+0x488>
cmpl   $0x0,-0x40(%rbp)
je     16cf <main+0x51f>
mov    -0x3c(%rbp),%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x3c(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x40(%rbp),%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x40(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
imul   %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x40(%rbp),%esi
sub    -0x3c(%rbp),%esi
add    $0x1,%esi
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x30(%rbp),%rcx
call   10d0 <fwrite@plt>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
jmp    16e2 <main+0x532>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15b7 <main+0x407>
cmpl   $0x0,-0x3c(%rbp)
jne    1704 <main+0x554>
cmpl   $0x0,-0x40(%rbp)
je     179b <main+0x5eb>
mov    -0x3c(%rbp),%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x3c(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x40(%rbp),%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x40(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x30(%rbp),%rsi
call   1080 <fputc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x80(%rbp),%eax
imul   %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x40(%rbp),%esi
sub    -0x3c(%rbp),%esi
add    $0x1,%esi
mov    -0x4c(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x30(%rbp),%rcx
call   10d0 <fwrite@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1080 <fputc@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,0x20(%rsp)
mov    %edi,%ebx
mov    $0x800000,%edi
call   10b0 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    $0x2000,%edi
call   10b0 <malloc@plt>
xor    %esi,%esi
mov    %rax,0x28(%rsp)
mov    %rax,%rdi
mov    $0x2000,%edx
call   1070 <memset@plt>
cmp    $0x3,%ebx
jl     1460 <main+0x2a0>
mov    %ebx,%eax
mov    %rax,0x38(%rsp)
movl   $0x8,0x4(%rsp)
mov    $0x10,%eax
mov    %rax,0x8(%rsp)
mov    $0x1,%r15b
mov    $0x2,%r12d
jmp    124f <main+0x8f>
nop
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x40(%rsp),%r12
add    $0x1,%r12
xor    %r15d,%r15d
cmp    0x38(%rsp),%r12
je     1472 <main+0x2b2>
mov    0x20(%rsp),%rbx
mov    (%rbx,%r12,8),%rdi
call   1030 <puts@plt>
mov    (%rbx,%r12,8),%rdi
lea    0xd98(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
add    %ebp,%ebx
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1080 <fgetc@plt>
cmp    $0xbf00,%ebx
jne    1645 <main+0x485>
mov    %eax,%ebp
shl    $0x8,%ebp
add    %r14d,%ebp
mov    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
movsbl 0x1(%rbx),%ebp
test   $0x1,%r15b
mov    %r12,0x40(%rsp)
je     1300 <main+0x140>
movsbl 0x2(%rbx),%edx
lea    0xd1a(%rip),%rdi
mov    %ebp,%esi
mov    %rdx,0x8(%rsp)
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebp,0x4(%rsp)
jmp    1318 <main+0x158>
nopl   (%rax)
cmp    %ebp,0x4(%rsp)
jne    164e <main+0x48e>
movsbl 0x2(%rbx),%eax
cmp    %eax,0x8(%rsp)
jne    164e <main+0x48e>
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    %ebx,%ebp
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
add    %r14d,%ebx
mov    %ebp,%eax
or     %ebx,%eax
je     1230 <main+0x70>
mov    0x8(%rsp),%rax
imul   0x4(%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
mov    %ecx,0x14(%rsp)
movslq %ecx,%r12
mov    %r13,0x30(%rsp)
jmp    13c3 <main+0x203>
nopl   0x0(%rax)
mov    0x30(%rsp),%r13
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    %ebx,%ebp
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1080 <fgetc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
add    %r14d,%ebx
mov    %ebp,%eax
or     %ebx,%eax
je     1230 <main+0x70>
sub    %ebp,%ebx
lea    0x1(%rbx),%r14d
mov    %r14d,%edi
mov    0x14(%rsp),%r13d
imul   %r13d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14d,%esi
mov    %r13d,%edx
mov    0x30(%rsp),%rcx
call   1040 <fread@plt>
test   %ebx,%ebx
mov    0x28(%rsp),%rbx
js     1380 <main+0x1c0>
movslq %ebp,%r13
imul   %r12,%r13
add    0x18(%rsp),%r13
jmp    1423 <main+0x263>
nopw   0x0(%rax,%rax,1)
add    %r12,%r15
add    %r12,%r13
add    $0x1,%ebp
add    $0xffffffffffffffff,%r14
je     1380 <main+0x1c0>
lea    0x7(%rbp),%edx
test   %ebp,%ebp
cmovns %ebp,%edx
sar    $0x3,%edx
mov    %ebp,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
movslq %edx,%rdx
movzbl (%rbx,%rdx,1),%esi
movzbl %cl,%ecx
bt     %ecx,%esi
jb     1410 <main+0x250>
or     %sil,%al
mov    %al,(%rbx,%rdx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    0x14(%rsp),%edx
call   10a0 <memcpy@plt>
jmp    1410 <main+0x250>
mov    $0x10,%eax
mov    %rax,0x8(%rsp)
movl   $0x8,0x4(%rsp)
mov    0x20(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0xb8d(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r12
xor    %edi,%edi
mov    %rax,%rsi
call   1090 <fputc@plt>
mov    $0xbf,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    $0x4,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    0x4(%rsp),%ebp
mov    %ebp,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    0x8(%rsp),%rbx
mov    %ebx,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    $0x1,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
imul   %ebp,%ebx
lea    0x7(%rbx),%r13d
test   %ebx,%ebx
cmovns %ebx,%r13d
sar    $0x3,%r13d
xor    %ebp,%ebp
xor    %r14d,%r14d
xor    %edx,%edx
xor    %ebx,%ebx
jmp    152b <main+0x36b>
nopl   0x0(%rax,%rax,1)
test   %edx,%edx
cmove  %ebp,%edx
mov    %ebp,%r14d
add    $0x1,%ebp
mov    %edx,%ebx
neg    %ebx
cmp    $0x10000,%ebp
je     15af <main+0x3ef>
mov    %ebp,%eax
shr    $0x3,%rax
mov    0x28(%rsp),%rcx
movzbl (%rcx,%rax,1),%eax
mov    %ebp,%ecx
and    $0x7,%cl
movzbl %cl,%ecx
bt     %ecx,%eax
jb     1510 <main+0x350>
mov    %edx,%eax
or     %r14d,%eax
je     15a5 <main+0x3e5>
movzbl %dl,%edi
mov    %r12,%rsi
mov    %edx,%r15d
call   1090 <fputc@plt>
mov    %r15d,%eax
movzbl %ah,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movzbl %r14b,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    %r14d,%edi
shr    $0x8,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    %r15d,%eax
imul   %r13d,%eax
movslq %eax,%rdi
add    0x18(%rsp),%rdi
lea    (%rbx,%r14,1),%esi
add    $0x1,%esi
mov    %r13d,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
xor    %edx,%edx
xor    %r14d,%r14d
jmp    1518 <main+0x358>
mov    %edx,%eax
or     %r14d,%eax
je     160c <main+0x44c>
movzbl %dl,%edi
mov    %r12,%rsi
mov    %edx,%ebx
call   1090 <fputc@plt>
movzbl %bh,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movzbl %r14b,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    %r14d,%edi
shr    $0x8,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
sub    %ebx,%r14d
imul   %r13d,%ebx
movslq %ebx,%rax
mov    0x18(%rsp),%rdi
add    %rax,%rdi
add    $0x1,%r14d
mov    %r14d,%esi
mov    %r13d,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %edi,%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x9c6(%rip),%rdi
jmp    1655 <main+0x495>
lea    0x9cb(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [12 x i8] c"head %dx%d\0A\00"
@.str.3 = [30 x i8] c"font cell dimension mismatch\0A\00"
@.str.4 = [15 x i8] c"missing head.\0A\00"
@.str.5 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i8* @malloc(i32 8388608)
store i8* %18, i8** %6
%19 = call i8* @malloc(i32 8192)
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = call i32 @memset(i8* %20, i32 0, i32 8192)
store i32 8, i32* %15
store i32 16, i32* %16
store i32 0, i32* %17
store i32 2, i32* %13
br label %22
22: ; preds = %215, %2
%23 = load i32, i32* %13
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %218
26: ; preds = %22
%27 = load i8**, i8*** %5
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i8**, i8*** %5
%34 = load i32, i32* %13
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %38, i32** %8
%39 = load i32*, i32** %8
%40 = call i32 @fgetc(i32* %39)
store i32 %40, i32* %11
%41 = load i32*, i32** %8
%42 = call i32 @fgetc(i32* %41)
%43 = shl i32 %42, 8
%44 = load i32, i32* %11
%45 = add nsw i32 %44, %43
store i32 %45, i32* %11
%46 = load i32*, i32** %8
%47 = call i32 @fgetc(i32* %46)
store i32 %47, i32* %12
%48 = load i32*, i32** %8
%49 = call i32 @fgetc(i32* %48)
%50 = shl i32 %49, 8
%51 = load i32, i32* %12
%52 = add nsw i32 %51, %50
store i32 %52, i32* %12
%53 = load i32, i32* %11
%54 = icmp eq i32 %53, 48896
br i1 %54, label %55, label %94
55: ; preds = %26
%56 = call i8* @malloc(i32 16)
store i8* %56, i8** %10
%57 = load i8*, i8** %10
%58 = load i32, i32* %12
%59 = load i32*, i32** %8
%60 = call i32 @fread(i8* %57, i32 1, i32 %58, i32* %59)
%61 = load i32, i32* %17
%62 = icmp ne i32 %61, 0
br i1 %62, label %75, label %63
63: ; preds = %55
%64 = load i8*, i8** %10
%65 = getelementptr inbounds i8, i8* %64, i64 1
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
store i32 %67, i32* %15
%68 = load i8*, i8** %10
%69 = getelementptr inbounds i8, i8* %68, i64 2
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
store i32 %71, i32* %16
%72 = load i32, i32* %15
%73 = load i32, i32* %16
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %72, i32 %73)
store i32 1, i32* %17
br label %93
75: ; preds = %55
%76 = load i8*, i8** %10
%77 = getelementptr inbounds i8, i8* %76, i64 1
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = load i32, i32* %15
%81 = icmp ne i32 %79, %80
br i1 %81, label %89, label %82
82: ; preds = %75
%83 = load i8*, i8** %10
%84 = getelementptr inbounds i8, i8* %83, i64 2
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = load i32, i32* %16
%88 = icmp ne i32 %86, %87
br i1 %88, label %89, label %92
89: ; preds = %82, %75
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%91 = call i32 @exit(i32 -1)
unreachable
92: ; preds = %82
br label %93
93: ; preds = %92, %63
br label %97
94: ; preds = %26
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%96 = call i32 @exit(i32 -1)
unreachable
97: ; preds = %93
br label %98
98: ; preds = %97, %211
%99 = load i32*, i32** %8
%100 = call i32 @fgetc(i32* %99)
store i32 %100, i32* %11
%101 = load i32*, i32** %8
%102 = call i32 @fgetc(i32* %101)
%103 = shl i32 %102, 8
%104 = load i32, i32* %11
%105 = add nsw i32 %104, %103
store i32 %105, i32* %11
%106 = load i32*, i32** %8
%107 = call i32 @fgetc(i32* %106)
store i32 %107, i32* %12
%108 = load i32*, i32** %8
%109 = call i32 @fgetc(i32* %108)
%110 = shl i32 %109, 8
%111 = load i32, i32* %12
%112 = add nsw i32 %111, %110
store i32 %112, i32* %12
%113 = load i32, i32* %11
%114 = icmp ne i32 %113, 0
br i1 %114, label %119, label %115
115: ; preds = %98
%116 = load i32, i32* %12
%117 = icmp ne i32 %116, 0
br i1 %117, label %119, label %118
118: ; preds = %115
br label %212
119: ; preds = %115, %98
%120 = load i32, i32* %12
%121 = load i32, i32* %11
%122 = sub nsw i32 %120, %121
%123 = add nsw i32 %122, 1
%124 = load i32, i32* %15
%125 = load i32, i32* %16
%126 = mul nsw i32 %124, %125
%127 = sdiv i32 %126, 8
%128 = mul nsw i32 %123, %127
%129 = call i8* @malloc(i32 %128)
store i8* %129, i8** %10
%130 = load i8*, i8** %10
%131 = load i32, i32* %12
%132 = load i32, i32* %11
%133 = sub nsw i32 %131, %132
%134 = add nsw i32 %133, 1
%135 = load i32, i32* %15
%136 = load i32, i32* %16
%137 = mul nsw i32 %135, %136
%138 = sdiv i32 %137, 8
%139 = load i32*, i32** %8
%140 = call i32 @fread(i8* %130, i32 %134, i32 %138, i32* %139)
store i32 0, i32* %14
br label %141
141: ; preds = %208, %119
%142 = load i32, i32* %14
%143 = load i32, i32* %12
%144 = load i32, i32* %11
%145 = sub nsw i32 %143, %144
%146 = add nsw i32 %145, 1
%147 = icmp slt i32 %142, %146
br i1 %147, label %148, label %211
148: ; preds = %141
%149 = load i8*, i8** %7
%150 = load i32, i32* %11
%151 = load i32, i32* %14
%152 = add nsw i32 %150, %151
%153 = sdiv i32 %152, 8
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8, i8* %149, i64 %154
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = load i32, i32* %11
%159 = load i32, i32* %14
%160 = add nsw i32 %158, %159
%161 = and i32 %160, 7
%162 = shl i32 1, %161
%163 = and i32 %157, %162
%164 = icmp ne i32 %163, 0
br i1 %164, label %207, label %165
165: ; preds = %148
%166 = load i32, i32* %11
%167 = load i32, i32* %14
%168 = add nsw i32 %166, %167
%169 = and i32 %168, 7
%170 = shl i32 1, %169
%171 = load i8*, i8** %7
%172 = load i32, i32* %11
%173 = load i32, i32* %14
%174 = add nsw i32 %172, %173
%175 = sdiv i32 %174, 8
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i8, i8* %171, i64 %176
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = or i32 %179, %170
%181 = trunc i32 %180 to i8
store i8 %181, i8* %177
%182 = load i8*, i8** %6
%183 = load i32, i32* %11
%184 = load i32, i32* %14
%185 = add nsw i32 %183, %184
%186 = load i32, i32* %15
%187 = load i32, i32* %16
%188 = mul nsw i32 %186, %187
%189 = sdiv i32 %188, 8
%190 = mul nsw i32 %185, %189
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i8, i8* %182, i64 %191
%193 = load i8*, i8** %10
%194 = load i32, i32* %14
%195 = load i32, i32* %15
%196 = load i32, i32* %16
%197 = mul nsw i32 %195, %196
%198 = sdiv i32 %197, 8
%199 = mul nsw i32 %194, %198
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %193, i64 %200
%202 = load i32, i32* %15
%203 = load i32, i32* %16
%204 = mul nsw i32 %202, %203
%205 = sdiv i32 %204, 8
%206 = call i32 @memcpy(i8* %192, i8* %201, i32 %205)
br label %207
207: ; preds = %165, %148
br label %208
208: ; preds = %207
%209 = load i32, i32* %14
%210 = add nsw i32 %209, 1
store i32 %210, i32* %14
br label %141
211: ; preds = %141
br label %98
212: ; preds = %118
%213 = load i32*, i32** %8
%214 = call i32 @fclose(i32* %213)
br label %215
215: ; preds = %212
%216 = load i32, i32* %13
%217 = add nsw i32 %216, 1
store i32 %217, i32* %13
br label %22
218: ; preds = %22
%219 = load i8**, i8*** %5
%220 = getelementptr inbounds i8*, i8** %219, i64 1
%221 = load i8*, i8** %220
%222 = call i32* @fopen(i8* %221, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %222, i32** %9
%223 = load i32*, i32** %9
%224 = call i32 @fputc(i32 0, i32* %223)
%225 = load i32*, i32** %9
%226 = call i32 @fputc(i32 191, i32* %225)
%227 = load i32*, i32** %9
%228 = call i32 @fputc(i32 4, i32* %227)
%229 = load i32*, i32** %9
%230 = call i32 @fputc(i32 0, i32* %229)
%231 = load i32*, i32** %9
%232 = call i32 @fputc(i32 0, i32* %231)
%233 = load i32, i32* %15
%234 = load i32*, i32** %9
%235 = call i32 @fputc(i32 %233, i32* %234)
%236 = load i32, i32* %16
%237 = load i32*, i32** %9
%238 = call i32 @fputc(i32 %236, i32* %237)
%239 = load i32*, i32** %9
%240 = call i32 @fputc(i32 1, i32* %239)
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
br label %241
241: ; preds = %312, %218
%242 = load i32, i32* %13
%243 = icmp slt i32 %242, 65536
br i1 %243, label %244, label %315
244: ; preds = %241
%245 = load i8*, i8** %7
%246 = load i32, i32* %13
%247 = sdiv i32 %246, 8
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i8, i8* %245, i64 %248
%250 = load i8, i8* %249
%251 = zext i8 %250 to i32
%252 = load i32, i32* %13
%253 = and i32 %252, 7
%254 = shl i32 1, %253
%255 = and i32 %251, %254
%256 = icmp ne i32 %255, 0
br i1 %256, label %257, label %266
257: ; preds = %244
%258 = load i32, i32* %11
%259 = icmp ne i32 %258, 0
br i1 %259, label %263, label %260
260: ; preds = %257
%261 = load i32, i32* %13
store i32 %261, i32* %11
%262 = load i32, i32* %13
store i32 %262, i32* %12
br label %265
263: ; preds = %257
%264 = load i32, i32* %13
store i32 %264, i32* %12
br label %265
265: ; preds = %263, %260
br label %311
266: ; preds = %244
%267 = load i32, i32* %11
%268 = icmp ne i32 %267, 0
br i1 %268, label %272, label %269
269: ; preds = %266
%270 = load i32, i32* %12
%271 = icmp ne i32 %270, 0
br i1 %271, label %272, label %310
272: ; preds = %269, %266
%273 = load i32, i32* %11
%274 = and i32 %273, 255
%275 = load i32*, i32** %9
%276 = call i32 @fputc(i32 %274, i32* %275)
%277 = load i32, i32* %11
%278 = ashr i32 %277, 8
%279 = and i32 %278, 255
%280 = load i32*, i32** %9
%281 = call i32 @fputc(i32 %279, i32* %280)
%282 = load i32, i32* %12
%283 = and i32 %282, 255
%284 = load i32*, i32** %9
%285 = call i32 @fputc(i32 %283, i32* %284)
%286 = load i32, i32* %12
%287 = ashr i32 %286, 8
%288 = and i32 %287, 255
%289 = load i32*, i32** %9
%290 = call i32 @fputc(i32 %288, i32* %289)
%291 = load i8*, i8** %6
%292 = load i32, i32* %11
%293 = load i32, i32* %15
%294 = load i32, i32* %16
%295 = mul nsw i32 %293, %294
%296 = sdiv i32 %295, 8
%297 = mul nsw i32 %292, %296
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds i8, i8* %291, i64 %298
%300 = load i32, i32* %12
%301 = load i32, i32* %11
%302 = sub nsw i32 %300, %301
%303 = add nsw i32 %302, 1
%304 = load i32, i32* %15
%305 = load i32, i32* %16
%306 = mul nsw i32 %304, %305
%307 = sdiv i32 %306, 8
%308 = load i32*, i32** %9
%309 = call i32 @fwrite(i8* %299, i32 %303, i32 %307, i32* %308)
br label %310
310: ; preds = %272, %269
store i32 0, i32* %11
store i32 0, i32* %12
br label %311
311: ; preds = %310, %265
br label %312
312: ; preds = %311
%313 = load i32, i32* %13
%314 = add nsw i32 %313, 1
store i32 %314, i32* %13
br label %241
315: ; preds = %241
%316 = load i32, i32* %11
%317 = icmp ne i32 %316, 0
br i1 %317, label %321, label %318
318: ; preds = %315
%319 = load i32, i32* %12
%320 = icmp ne i32 %319, 0
br i1 %320, label %321, label %359
321: ; preds = %318, %315
%322 = load i32, i32* %11
%323 = and i32 %322, 255
%324 = load i32*, i32** %9
%325 = call i32 @fputc(i32 %323, i32* %324)
%326 = load i32, i32* %11
%327 = ashr i32 %326, 8
%328 = and i32 %327, 255
%329 = load i32*, i32** %9
%330 = call i32 @fputc(i32 %328, i32* %329)
%331 = load i32, i32* %12
%332 = and i32 %331, 255
%333 = load i32*, i32** %9
%334 = call i32 @fputc(i32 %332, i32* %333)
%335 = load i32, i32* %12
%336 = ashr i32 %335, 8
%337 = and i32 %336, 255
%338 = load i32*, i32** %9
%339 = call i32 @fputc(i32 %337, i32* %338)
%340 = load i8*, i8** %6
%341 = load i32, i32* %11
%342 = load i32, i32* %15
%343 = load i32, i32* %16
%344 = mul nsw i32 %342, %343
%345 = sdiv i32 %344, 8
%346 = mul nsw i32 %341, %345
%347 = sext i32 %346 to i64
%348 = getelementptr inbounds i8, i8* %340, i64 %347
%349 = load i32, i32* %12
%350 = load i32, i32* %11
%351 = sub nsw i32 %349, %350
%352 = add nsw i32 %351, 1
%353 = load i32, i32* %15
%354 = load i32, i32* %16
%355 = mul nsw i32 %353, %354
%356 = sdiv i32 %355, 8
%357 = load i32*, i32** %9
%358 = call i32 @fwrite(i8* %348, i32 %352, i32 %356, i32* %357)
br label %359
359: ; preds = %321, %318
%360 = load i32*, i32** %9
%361 = call i32 @fputc(i32 0, i32* %360)
%362 = load i32*, i32** %9
%363 = call i32 @fputc(i32 0, i32* %362)
%364 = load i32*, i32** %9
%365 = call i32 @fputc(i32 0, i32* %364)
%366 = load i32*, i32** %9
%367 = call i32 @fputc(i32 0, i32* %366)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [12 x i8] c"head %dx%d\0A\00"
@.str.5 = [3 x i8] c"wb\00"
@str = [14 x i8] c"missing head.\00"
@str.6 = [29 x i8] c"font cell dimension mismatch\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call dereferenceable_or_null(8388608) i8* @malloc(i32 8388608)
%4 = tail call dereferenceable_or_null(8192) i8* @malloc(i32 8192)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 8192)
%6 = icmp sgt i32 %0, 2
br i1 %6, label %7, label %124
7: ; preds = %2
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %120
%10 = phi i64 [ 2, %7 ], [ %122, %120 ]
%11 = phi i1 [ true, %7 ], [ false, %120 ]
%12 = phi i32 [ 16, %7 ], [ %54, %120 ]
%13 = phi i32 [ 8, %7 ], [ %53, %120 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %10
%15 = load i8*, i8** %14
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
%17 = load i8*, i8** %14
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @fgetc(i32* %18)
%20 = tail call i32 @fgetc(i32* %18)
%21 = shl i32 %20, 8
%22 = add nsw i32 %21, %19
%23 = tail call i32 @fgetc(i32* %18)
%24 = tail call i32 @fgetc(i32* %18)
%25 = icmp eq i32 %22, 48896
br i1 %25, label %26, label %49
26: ; preds = %9
%27 = shl i32 %24, 8
%28 = add nsw i32 %27, %23
%29 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%30 = tail call i32 @fread(i8* %29, i32 1, i32 %28, i32* %18)
%31 = getelementptr inbounds i8, i8* %29, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
br i1 %11, label %34, label %39
34: ; preds = %26
%35 = getelementptr inbounds i8, i8* %29, i64 2
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %37)
br label %52
39: ; preds = %26
%40 = icmp eq i32 %13, %33
br i1 %40, label %41, label %46
41: ; preds = %39
%42 = getelementptr inbounds i8, i8* %29, i64 2
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %12, %44
br i1 %45, label %52, label %46
46: ; preds = %41, %39
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%48 = tail call i32 @exit(i32 -1)
unreachable
49: ; preds = %9
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%51 = tail call i32 @exit(i32 -1)
unreachable
52: ; preds = %34, %41
%53 = phi i32 [ %13, %41 ], [ %33, %34 ]
%54 = phi i32 [ %12, %41 ], [ %37, %34 ]
%55 = tail call i32 @fgetc(i32* %18)
%56 = tail call i32 @fgetc(i32* %18)
%57 = shl i32 %56, 8
%58 = add nsw i32 %57, %55
%59 = tail call i32 @fgetc(i32* %18)
%60 = tail call i32 @fgetc(i32* %18)
%61 = shl i32 %60, 8
%62 = add nsw i32 %61, %59
%63 = icmp ne i32 %58, 0
%64 = icmp ne i32 %62, 0
%65 = select i1 %63, i1 true, i1 %64
br i1 %65, label %66, label %120
66: ; preds = %52
%67 = mul nsw i32 %54, %53
%68 = sdiv i32 %67, 8
%69 = sext i32 %68 to i64
br label %82
70: ; preds = %117, %82
%71 = tail call i32 @fgetc(i32* %18)
%72 = tail call i32 @fgetc(i32* %18)
%73 = shl i32 %72, 8
%74 = add nsw i32 %73, %71
%75 = tail call i32 @fgetc(i32* %18)
%76 = tail call i32 @fgetc(i32* %18)
%77 = shl i32 %76, 8
%78 = add nsw i32 %77, %75
%79 = icmp ne i32 %74, 0
%80 = icmp ne i32 %78, 0
%81 = select i1 %79, i1 true, i1 %80
br i1 %81, label %82, label %120
82: ; preds = %66, %70
%83 = phi i32 [ %62, %66 ], [ %78, %70 ]
%84 = phi i32 [ %58, %66 ], [ %74, %70 ]
%85 = sub nsw i32 %83, %84
%86 = add nsw i32 %85, 1
%87 = mul nsw i32 %86, %68
%88 = tail call i8* @malloc(i32 %87)
%89 = tail call i32 @fread(i8* %88, i32 %86, i32 %68, i32* %18)
%90 = icmp slt i32 %85, 0
br i1 %90, label %70, label %91
91: ; preds = %82
%92 = sext i32 %84 to i64
%93 = add i32 %83, 1
%94 = sub i32 %93, %84
%95 = zext i32 %94 to i64
br label %96
96: ; preds = %91, %117
%97 = phi i64 [ 0, %91 ], [ %118, %117 ]
%98 = add nsw i64 %97, %92
%99 = trunc i64 %98 to i32
%100 = sdiv i32 %99, 8
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %4, i64 %101
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = and i32 %99, 7
%106 = shl nuw nsw i32 1, %105
%107 = and i32 %106, %104
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %117
109: ; preds = %96
%110 = trunc i32 %106 to i8
%111 = or i8 %103, %110
store i8 %111, i8* %102
%112 = mul nsw i64 %98, %69
%113 = getelementptr inbounds i8, i8* %3, i64 %112
%114 = mul nsw i64 %97, %69
%115 = getelementptr inbounds i8, i8* %88, i64 %114
%116 = tail call i32 @memcpy(i8* %113, i8* %115, i32 %68)
br label %117
117: ; preds = %96, %109
%118 = add nuw nsw i64 %97, 1
%119 = icmp eq i64 %118, %95
br i1 %119, label %70, label %96
120: ; preds = %70, %52
%121 = tail call i32 @fclose(i32* %18)
%122 = add nuw nsw i64 %10, 1
%123 = icmp eq i64 %122, %8
br i1 %123, label %124, label %9
124: ; preds = %120, %2
%125 = phi i32 [ 8, %2 ], [ %53, %120 ]
%126 = phi i32 [ 16, %2 ], [ %54, %120 ]
%127 = getelementptr inbounds i8*, i8** %1, i64 1
%128 = load i8*, i8** %127
%129 = tail call i32* @fopen(i8* %128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%130 = tail call i32 @fputc(i32 0, i32* %129)
%131 = tail call i32 @fputc(i32 191, i32* %129)
%132 = tail call i32 @fputc(i32 4, i32* %129)
%133 = tail call i32 @fputc(i32 0, i32* %129)
%134 = tail call i32 @fputc(i32 0, i32* %129)
%135 = tail call i32 @fputc(i32 %125, i32* %129)
%136 = tail call i32 @fputc(i32 %126, i32* %129)
%137 = tail call i32 @fputc(i32 1, i32* %129)
%138 = mul nsw i32 %126, %125
%139 = sdiv i32 %138, 8
br label %140
140: ; preds = %124, %177
%141 = phi i32 [ 0, %124 ], [ %181, %177 ]
%142 = phi i32 [ 0, %124 ], [ %180, %177 ]
%143 = phi i32 [ 0, %124 ], [ %179, %177 ]
%144 = phi i32 [ 0, %124 ], [ %178, %177 ]
%145 = lshr i32 %142, 3
%146 = zext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %4, i64 %146
%148 = load i8, i8* %147
%149 = zext i8 %148 to i32
%150 = and i32 %142, 7
%151 = shl nuw nsw i32 1, %150
%152 = and i32 %151, %149
%153 = icmp eq i32 %152, 0
br i1 %153, label %157, label %154
154: ; preds = %140
%155 = icmp eq i32 %144, 0
%156 = select i1 %155, i32 %142, i32 %144
br label %177
157: ; preds = %140
%158 = icmp ne i32 %144, 0
%159 = icmp ne i32 %143, 0
%160 = select i1 %158, i1 true, i1 %159
br i1 %160, label %161, label %177
161: ; preds = %157
%162 = and i32 %144, 255
%163 = tail call i32 @fputc(i32 %162, i32* %129)
%164 = lshr i32 %144, 8
%165 = and i32 %164, 255
%166 = tail call i32 @fputc(i32 %165, i32* %129)
%167 = and i32 %143, 255
%168 = tail call i32 @fputc(i32 %167, i32* %129)
%169 = lshr i32 %143, 8
%170 = tail call i32 @fputc(i32 %169, i32* %129)
%171 = mul nsw i32 %144, %139
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i8, i8* %3, i64 %172
%174 = add i32 %141, 1
%175 = add i32 %174, %143
%176 = tail call i32 @fwrite(i8* %173, i32 %175, i32 %139, i32* %129)
br label %177
177: ; preds = %161, %157, %154
%178 = phi i32 [ %156, %154 ], [ 0, %157 ], [ 0, %161 ]
%179 = phi i32 [ %142, %154 ], [ 0, %157 ], [ 0, %161 ]
%180 = add nuw nsw i32 %142, 1
%181 = sub i32 0, %178
%182 = icmp eq i32 %180, 65536
br i1 %182, label %183, label %140
183: ; preds = %177
%184 = icmp ne i32 %178, 0
%185 = icmp ne i32 %179, 0
%186 = select i1 %184, i1 true, i1 %185
br i1 %186, label %187, label %203
187: ; preds = %183
%188 = and i32 %178, 255
%189 = tail call i32 @fputc(i32 %188, i32* %129)
%190 = lshr i32 %178, 8
%191 = and i32 %190, 255
%192 = tail call i32 @fputc(i32 %191, i32* %129)
%193 = and i32 %179, 255
%194 = tail call i32 @fputc(i32 %193, i32* %129)
%195 = lshr i32 %179, 8
%196 = tail call i32 @fputc(i32 %195, i32* %129)
%197 = mul nsw i32 %178, %139
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i8, i8* %3, i64 %198
%200 = sub i32 1, %178
%201 = add i32 %200, %179
%202 = tail call i32 @fwrite(i8* %199, i32 %201, i32 %139, i32* %129)
br label %203
203: ; preds = %183, %187
%204 = tail call i32 @fputc(i32 0, i32* %129)
%205 = tail call i32 @fputc(i32 0, i32* %129)
%206 = tail call i32 @fputc(i32 0, i32* %129)
%207 = tail call i32 @fputc(i32 0, i32* %129)
ret i32 0
}