#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int toupper(char);
int main(int argc, char *argv[]) {
  FILE *in = stdin;
  char buf[128];
  int f, g;
  int c = 0, w = 0, i, mask;
  int fw, fh, fox, foy, width, height, x, y, wcount;
  int maxy = -999;
  int ofs = 0;
  int ofstbl[256];
  char fontdesc[256] = "unnamed";
  if (argc == 2)
    strcpy(fontdesc, argv[1]);
  printf("static signed char font%sdat[]={\n\n", fontdesc);
  printf("/* data for each char is ox oy w h dwidth, then data */\n\n");
  while (fgets(buf, sizeof(buf), in) != NULL) {
    if (strncmp(buf, "FONTBOUNDINGBOX ", 16) == 0)
      sscanf(buf + 16, "%d %d %d %d", &fw, &fh, &fox, &foy);
    else if (strncmp(buf, "ENCODING ", 9) == 0)
      c = atoi(buf + 9);
    else if (strncmp(buf, "DWIDTH ", 7) == 0)
      w = atoi(buf + 7);
    else if (strncmp(buf, "BBX ", 4) == 0) {
      sscanf(buf + 4, "%d %d %d %d", &width, &height, &x, &y);
    } else if (strcmp(buf, "BITMAP\n") == 0) {
      if (c < 32 || c > 255)
        continue;
      ofstbl[c] = ofs;
      printf("/* `%c' */\n", c);
      printf("%d,%d,%d,%d,%d,\n", x, y, width, height, w);
      ofs += 5;
      if (y + height - foy > maxy)
        maxy = y + height - foy;
      while (fgets(buf, sizeof(buf), in) != NULL &&
             strcmp(buf, "ENDCHAR\n") != 0) {
        i = 0;
        wcount = width;
        for (f = 0; f < strlen(buf) - 1; f++) {
          c = toupper(buf[f]) - 48;
          if (c > 9)
            c -= 7;
          if (c < 0 || c > 15) {
            fprintf(stderr, "error in font - bad hex!\n");
            exit(1);
          } else {
            i = i * 16 + c;
            if (f & 1) {
              for (g = 0, mask = 128; g < 8 && wcount--;
                   g++, ofs++, mask >>= 1) {
                putchar((i & mask) ? '1' : '0');
                putchar(',');
              }
              i = 0;
            }
          }
        }
        if (f & 1) {
          for (g = 0, mask = 128; g < 8 && wcount--; g++, ofs++, mask >>= 1) {
            putchar((i & mask) ? '1' : '0');
            putchar(',');
          }
        }
        putchar('\n');
      }
      putchar('\n');
    }
  }
  printf("};\n\n");
  printf("static int font%stbl[224]={", fontdesc);
  for (f = 32; f < 256; f++) {
    if ((f & 7) == 0)
      putchar('\n');
    printf("%d,", ofstbl[f]);
  }
  printf("\n};\n\n");
  printf("static int font%syofs=%d,", fontdesc, fh - maxy);
  printf("font%sfh=%d,", fontdesc, fh);
  printf("font%soy=%d;\n\n\n", fontdesc, foy);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0xfffffc19,-0xe0(%rbp)
fc ff ff
movl   $0x0,-0xe4(%rbp)
lea    -0x5f0(%rbp),%rdi
lea    0xdd3(%rip),%rsi
mov    $0x100,%edx
call   10c0 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1255 <main+0x85>
lea    -0x5f0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <strcpy@plt>
lea    -0x5f0(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     17c8 <main+0x5f8>
lea    -0xa0(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12f1 <main+0x121>
lea    -0xa0(%rbp),%rdi
add    $0x10,%rdi
lea    0xea3(%rip),%rsi
lea    -0xbc(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
lea    -0xc4(%rbp),%r8
lea    -0xc8(%rbp),%r9
call   10d0 <sscanf@plt>
jmp    17c3 <main+0x5f3>
lea    -0xa0(%rbp),%rdi
lea    0xe7b(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    132e <main+0x15e>
lea    -0xa0(%rbp),%rdi
add    $0x9,%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xac(%rbp)
jmp    17be <main+0x5ee>
lea    -0xa0(%rbp),%rdi
lea    0xe48(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    136b <main+0x19b>
lea    -0xa0(%rbp),%rdi
add    $0x7,%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xb0(%rbp)
jmp    17b9 <main+0x5e9>
lea    -0xa0(%rbp),%rdi
lea    0xe13(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13c5 <main+0x1f5>
lea    -0xa0(%rbp),%rdi
add    $0x4,%rdi
lea    0xdcf(%rip),%rsi
lea    -0xcc(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    -0xd4(%rbp),%r8
lea    -0xd8(%rbp),%r9
call   10d0 <sscanf@plt>
jmp    17b4 <main+0x5e4>
lea    -0xa0(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    17af <main+0x5df>
cmpl   $0x20,-0xac(%rbp)
jl     13ff <main+0x22f>
cmpl   $0xff,-0xac(%rbp)
jle    1404 <main+0x234>
jmp    1278 <main+0xa8>
mov    -0xe4(%rbp),%ecx
movslq -0xac(%rbp),%rax
mov    %ecx,-0x4f0(%rbp,%rax,4)
mov    -0xac(%rbp),%esi
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xd4(%rbp),%esi
mov    -0xd8(%rbp),%edx
mov    -0xcc(%rbp),%ecx
mov    -0xd0(%rbp),%r8d
mov    -0xb0(%rbp),%r9d
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xe4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xe4(%rbp)
mov    -0xd8(%rbp),%eax
add    -0xd0(%rbp),%eax
sub    -0xc8(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jle    149f <main+0x2cf>
mov    -0xd8(%rbp),%eax
add    -0xd0(%rbp),%eax
sub    -0xc8(%rbp),%eax
mov    %eax,-0xe0(%rbp)
jmp    14a4 <main+0x2d4>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1090 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5f1(%rbp)
je     14ee <main+0x31e>
lea    -0xa0(%rbp),%rdi
lea    0xcda(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5f1(%rbp)
mov    -0x5f1(%rbp),%al
test   $0x1,%al
jne    1501 <main+0x331>
jmp    17a5 <main+0x5d5>
movl   $0x0,-0xb4(%rbp)
mov    -0xcc(%rbp),%eax
mov    %eax,-0xdc(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,-0x5f8(%rbp)
lea    -0xa0(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x5f8(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    16c6 <main+0x4f6>
movslq -0xa4(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%edi
ff
call   1060 <toupper@plt>
sub    $0x30,%eax
mov    %eax,-0xac(%rbp)
cmpl   $0x9,-0xac(%rbp)
jle    1585 <main+0x3b5>
mov    -0xac(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0xac(%rbp)
cmpl   $0x0,-0xac(%rbp)
jl     159f <main+0x3cf>
cmpl   $0xf,-0xac(%rbp)
jle    15be <main+0x3ee>
mov    0x2a32(%rip),%rax
mov    (%rax),%edi
lea    0xc10(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0xb4(%rbp),%eax
shl    $0x4,%eax
add    -0xac(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0xa4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     16a8 <main+0x4d8>
movl   $0x0,-0xa8(%rbp)
movl   $0x80,-0xb8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0xa8(%rbp)
mov    %al,-0x5f9(%rbp)
jge    162b <main+0x45b>
mov    -0xdc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xdc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5f9(%rbp)
mov    -0x5f9(%rbp),%al
test   $0x1,%al
jne    163e <main+0x46e>
jmp    169e <main+0x4ce>
mov    -0xb4(%rbp),%edx
and    -0xb8(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
mov    -0xb8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    15f9 <main+0x429>
movl   $0x0,-0xb4(%rbp)
jmp    16ad <main+0x4dd>
jmp    16b2 <main+0x4e2>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1521 <main+0x351>
mov    -0xa4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1796 <main+0x5c6>
movl   $0x0,-0xa8(%rbp)
movl   $0x80,-0xb8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0xa8(%rbp)
mov    %al,-0x5fa(%rbp)
jge    171e <main+0x54e>
mov    -0xdc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xdc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5fa(%rbp)
mov    -0x5fa(%rbp),%al
test   $0x1,%al
jne    1731 <main+0x561>
jmp    1791 <main+0x5c1>
mov    -0xb4(%rbp),%edx
and    -0xb8(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
mov    -0xb8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    16ec <main+0x51c>
jmp    1796 <main+0x5c6>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    14a4 <main+0x2d4>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    17b4 <main+0x5e4>
jmp    17b9 <main+0x5e9>
jmp    17be <main+0x5ee>
jmp    17c3 <main+0x5f3>
jmp    1278 <main+0xa8>
lea    0xa27(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0x9f5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x20,-0xa4(%rbp)
cmpl   $0x100,-0xa4(%rbp)
jge    1851 <main+0x681>
mov    -0xa4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    1821 <main+0x651>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq -0xa4(%rbp),%rax
mov    -0x4f0(%rbp,%rax,4),%esi
lea    0x9e8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    17f5 <main+0x625>
lea    0x99d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
mov    -0xc0(%rbp),%edx
sub    -0xe0(%rbp),%edx
lea    0x982(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
mov    -0xc0(%rbp),%edx
lea    0x981(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
mov    -0xc8(%rbp),%edx
lea    0x973(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5c8,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
mov    0x2deb(%rip),%rax
mov    (%rax),%rbp
lea    0xdf9(%rip),%rsi
lea    0xc0(%rsp),%rdi
mov    $0x100,%edx
call   10d0 <memcpy@plt>
cmp    $0x2,%ebx
jne    122f <main+0x4f>
mov    0x8(%r14),%rsi
lea    0xc0(%rsp),%rdi
call   1050 <strcpy@plt>
lea    0xeca(%rip),%rdi
lea    0xc0(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xfa6(%rip),%rdi
call   1070 <puts@plt>
mov    $0xfffffc19,%r14d
lea    0x40(%rsp),%r12
lea    0xec0(%rip),%r13
xor    %r15d,%r15d
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
mov    %rbp,0x28(%rsp)
jmp    128f <main+0xaf>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x30(%rsp),%r14d
lea    -0x100(%r15),%ebx
jmp    12c0 <main+0xe0>
lea    0x50(%rsp),%rdi
lea    0xe90(%rip),%rsi
lea    0x3c(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x38(%rsp),%r8
lea    0x20(%rsp),%r9
call   10e0 <sscanf@plt>
nopl   (%rax)
mov    %r12,%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     16e1 <main+0x501>
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1298 <main+0xb8>
mov    %r12,%rdi
lea    0xe48(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     135f <main+0x17f>
mov    %r12,%rdi
lea    0xe39(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1379 <main+0x199>
mov    %r12,%rdi
lea    0xe28(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     138c <main+0x1ac>
mov    %r12,%rdi
lea    0xe14(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    12c0 <main+0xe0>
cmp    $0xffffff20,%ebx
jb     12c0 <main+0xe0>
jmp    13c0 <main+0x1e0>
lea    0x49(%rsp),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r15d
mov    %eax,%ebx
add    $0xffffff00,%ebx
jmp    12c0 <main+0xe0>
lea    0x47(%rsp),%rdi
call   10f0 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    12c0 <main+0xe0>
lea    0x44(%rsp),%rdi
lea    0xd9c(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x34(%rsp),%r8
lea    0x14(%rsp),%r9
call   10e0 <sscanf@plt>
jmp    12c0 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
mov    %r15d,%eax
mov    0xc(%rsp),%ebx
mov    %ebx,0x1c0(%rsp,%rax,4)
lea    0xd8a(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x34(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
lea    0xd74(%rip),%rdi
mov    0x10(%rsp),%r9d
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x18(%rsp),%eax
add    0x14(%rsp),%eax
sub    0x20(%rsp),%eax
add    $0x5,%ebx
mov    %ebx,0xc(%rsp)
cmp    %r14d,%eax
cmovle %r14d,%eax
mov    %eax,0x30(%rsp)
jmp    1446 <main+0x266>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x28(%rsp),%rbp
lea    0xce7(%rip),%r13
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1280 <main+0xa0>
mov    %r12,%rdi
lea    0xd13(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1280 <main+0xa0>
mov    0x1c(%rsp),%r14d
mov    %r12,%rdi
call   1080 <strlen@plt>
cmp    $0x2,%eax
jl     143c <main+0x25c>
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    14c0 <main+0x2e0>
mov    0xc(%rsp),%eax
add    %r12d,%eax
mov    %eax,0xc(%rsp)
xor    %r13d,%r13d
mov    %ebp,%r14d
lea    0x40(%rsp),%r12
add    $0x1,%rbx
mov    %r12,%rdi
call   1080 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbx
jge    1660 <main+0x480>
movsbl 0x40(%rsp,%rbx,1),%edi
call   1060 <toupper@plt>
lea    -0x30(%rax),%ecx
lea    -0x37(%rax),%r15d
cmp    $0x3a,%eax
cmovl  %ecx,%r15d
cmp    $0x10,%r15d
jae    16c2 <main+0x4e2>
shl    $0x4,%r13d
add    %r15d,%r13d
test   $0x1,%bl
je     14a6 <main+0x2c6>
cmp    $0x7,%r14d
mov    $0x7,%r12d
cmovb  %r14d,%r12d
mov    $0xffffffff,%ebp
test   %r14d,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x80,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x1,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x40,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x2,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x20,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x3,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x10,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x4,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x8,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x5,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x4,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x6,%r14d
je     1490 <main+0x2b0>
mov    %r13d,%eax
and    $0x2,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
cmp    $0x7,%r14d
je     1490 <main+0x2b0>
mov    0xc(%rsp),%ebp
add    $0x1,%ebp
add    $0xfffffff8,%r14d
and    $0x1,%r13d
or     $0x30,%r13d
mov    %r13d,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %ebp,%eax
mov    %r14d,%ebp
jmp    1494 <main+0x2b4>
nopl   (%rax)
test   $0x1,%bl
je     1430 <main+0x250>
test   %r14d,%r14d
je     1430 <main+0x250>
add    $0xffffffff,%r14d
cmp    $0x7,%r14d
mov    $0x7,%eax
cmovae %eax,%r14d
not    %r14d
mov    $0x80,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    %ebp,%eax
and    %r13d,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
shr    %ebp
add    $0xffffffff,%ebx
cmp    %ebx,%r14d
jne    1690 <main+0x4b0>
sub    %ebx,0xc(%rsp)
jmp    1430 <main+0x250>
mov    0x290f(%rip),%rax
mov    (%rax),%edi
lea    0xab3(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xb44(%rip),%rdi
call   1070 <puts@plt>
lea    0xaab(%rip),%rdi
lea    0xc0(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x20,%ebp
lea    0xacf(%rip),%rbx
jmp    173e <main+0x55e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x1c0(%rsp,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%rbp
cmp    $0x100,%rbp
je     1750 <main+0x570>
test   $0x7,%bpl
jne    1720 <main+0x540>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1720 <main+0x540>
lea    0xad4(%rip),%rdi
call   1070 <puts@plt>
mov    0x24(%rsp),%edx
sub    %r14d,%edx
lea    0xa51(%rip),%rdi
lea    0xc0(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x24(%rsp),%edx
lea    0xa4e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x20(%rsp),%edx
lea    0xa46(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@stdin = global i32* null
@__const.main.fontdesc = [256 x i8] c"unnamed\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [35 x i8] c"static signed char font%sdat[]={\0A\0A\00"
@.str.1 = [58 x i8] c"/* data for each char is ox oy w h dwidth, then data */\0A\0A\00"
@.str.2 = [17 x i8] c"FONTBOUNDINGBOX \00"
@.str.3 = [12 x i8] c"%d %d %d %d\00"
@.str.4 = [10 x i8] c"ENCODING \00"
@.str.5 = [8 x i8] c"DWIDTH \00"
@.str.6 = [5 x i8] c"BBX \00"
@.str.7 = [8 x i8] c"BITMAP\0A\00"
@.str.8 = [12 x i8] c"/* `%c' */\0A\00"
@.str.9 = [17 x i8] c"%d,%d,%d,%d,%d,\0A\00"
@.str.10 = [9 x i8] c"ENDCHAR\0A\00"
@stderr = global i32 0
@.str.11 = [26 x i8] c"error in font - bad hex!\0A\00"
@.str.12 = [5 x i8] c"};\0A\0A\00"
@.str.13 = [28 x i8] c"static int font%stbl[224]={\00"
@.str.14 = [4 x i8] c"%d,\00"
@.str.15 = [6 x i8] c"\0A};\0A\0A\00"
@.str.16 = [26 x i8] c"static int font%syofs=%d,\00"
@.str.17 = [13 x i8] c"font%sfh=%d,\00"
@.str.18 = [16 x i8] c"font%soy=%d;\0A\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [128 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%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 [256 x i32]
%26 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%27 = load i32*, i32** @stdin
store i32* %27, i32** %6
store i32 0, i32* %10
store i32 0, i32* %11
store i32 -999, i32* %23
store i32 0, i32* %24
%28 = bitcast [256 x i8]* %26 to i8*
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %37
31: ; preds = %2
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %32, i8* %35)
br label %37
37: ; preds = %31, %2
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
br label %41
41: ; preds = %240, %88, %37
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%43 = load i32*, i32** %6
%44 = call i32* @fgets(i8* %42, i32 128, i32* %43)
%45 = icmp ne i32* %44, null
br i1 %45, label %46, label %241
46: ; preds = %41
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%48 = call i64 @strncmp(i8* %47, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 16)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%52 = getelementptr inbounds i8, i8* %51, i64 16
%53 = call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %14, i32* %15, i32* %16, i32* %17)
br label %240
54: ; preds = %46
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%56 = call i64 @strncmp(i8* %55, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 9)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%60 = getelementptr inbounds i8, i8* %59, i64 9
%61 = call i32 @atoi(i8* %60)
store i32 %61, i32* %10
br label %239
62: ; preds = %54
%63 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%64 = call i64 @strncmp(i8* %63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%68 = getelementptr inbounds i8, i8* %67, i64 7
%69 = call i32 @atoi(i8* %68)
store i32 %69, i32* %11
br label %238
70: ; preds = %62
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%72 = call i64 @strncmp(i8* %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %70
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%76 = getelementptr inbounds i8, i8* %75, i64 4
%77 = call i32 @sscanf(i8* %76, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %18, i32* %19, i32* %20, i32* %21)
br label %237
78: ; preds = %70
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %236
82: ; preds = %78
%83 = load i32, i32* %10
%84 = icmp slt i32 %83, 32
br i1 %84, label %88, label %85
85: ; preds = %82
%86 = load i32, i32* %10
%87 = icmp sgt i32 %86, 255
br i1 %87, label %88, label %89
88: ; preds = %85, %82
br label %41
89: ; preds = %85
%90 = load i32, i32* %24
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [256 x i32], [256 x i32]* %25, i64 0, i64 %92
store i32 %90, i32* %93
%94 = load i32, i32* %10
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %20
%97 = load i32, i32* %21
%98 = load i32, i32* %18
%99 = load i32, i32* %19
%100 = load i32, i32* %11
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %96, i32 %97, i32 %98, i32 %99, i32 %100)
%102 = load i32, i32* %24
%103 = add nsw i32 %102, 5
store i32 %103, i32* %24
%104 = load i32, i32* %21
%105 = load i32, i32* %19
%106 = add nsw i32 %104, %105
%107 = load i32, i32* %17
%108 = sub nsw i32 %106, %107
%109 = load i32, i32* %23
%110 = icmp sgt i32 %108, %109
br i1 %110, label %111, label %117
111: ; preds = %89
%112 = load i32, i32* %21
%113 = load i32, i32* %19
%114 = add nsw i32 %112, %113
%115 = load i32, i32* %17
%116 = sub nsw i32 %114, %115
store i32 %116, i32* %23
br label %117
117: ; preds = %111, %89
br label %118
118: ; preds = %232, %117
%119 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%120 = load i32*, i32** %6
%121 = call i32* @fgets(i8* %119, i32 128, i32* %120)
%122 = icmp ne i32* %121, null
br i1 %122, label %123, label %127
123: ; preds = %118
%124 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%125 = call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%126 = icmp ne i64 %125, 0
br label %127
127: ; preds = %123, %118
%128 = phi i1 [ false, %118 ], [ %126, %123 ]
br i1 %128, label %129, label %234
129: ; preds = %127
store i32 0, i32* %12
%130 = load i32, i32* %18
store i32 %130, i32* %22
store i32 0, i32* %8
br label %131
131: ; preds = %197, %129
%132 = load i32, i32* %8
%133 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%134 = call i32 @strlen(i8* %133)
%135 = sub nsw i32 %134, 1
%136 = icmp slt i32 %132, %135
br i1 %136, label %137, label %200
137: ; preds = %131
%138 = load i32, i32* %8
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = call i32 @toupper(i8 signext %141)
%143 = sub nsw i32 %142, 48
store i32 %143, i32* %10
%144 = load i32, i32* %10
%145 = icmp sgt i32 %144, 9
br i1 %145, label %146, label %149
146: ; preds = %137
%147 = load i32, i32* %10
%148 = sub nsw i32 %147, 7
store i32 %148, i32* %10
br label %149
149: ; preds = %146, %137
%150 = load i32, i32* %10
%151 = icmp slt i32 %150, 0
br i1 %151, label %155, label %152
152: ; preds = %149
%153 = load i32, i32* %10
%154 = icmp sgt i32 %153, 15
br i1 %154, label %155, label %159
155: ; preds = %152, %149
%156 = load i32, i32* @stderr
%157 = call i32 @fprintf(i32 %156, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%158 = call i32 @exit(i32 1)
unreachable
159: ; preds = %152
%160 = load i32, i32* %12
%161 = mul nsw i32 %160, 16
%162 = load i32, i32* %10
%163 = add nsw i32 %161, %162
store i32 %163, i32* %12
%164 = load i32, i32* %8
%165 = and i32 %164, 1
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %195
167: ; preds = %159
store i32 0, i32* %9
store i32 128, i32* %13
br label %168
168: ; preds = %187, %167
%169 = load i32, i32* %9
%170 = icmp slt i32 %169, 8
br i1 %170, label %171, label %175
171: ; preds = %168
%172 = load i32, i32* %22
%173 = add nsw i32 %172, -1
store i32 %173, i32* %22
%174 = icmp ne i32 %172, 0
br label %175
175: ; preds = %171, %168
%176 = phi i1 [ false, %168 ], [ %174, %171 ]
br i1 %176, label %177, label %194
177: ; preds = %175
%178 = load i32, i32* %12
%179 = load i32, i32* %13
%180 = and i32 %178, %179
%181 = icmp ne i32 %180, 0
%182 = zext i1 %181 to i64
%183 = select i1 %181, i32 49, i32 48
%184 = trunc i32 %183 to i8
%185 = call i32 @putchar(i8 signext %184)
%186 = call i32 @putchar(i8 signext 44)
br label %187
187: ; preds = %177
%188 = load i32, i32* %9
%189 = add nsw i32 %188, 1
store i32 %189, i32* %9
%190 = load i32, i32* %24
%191 = add nsw i32 %190, 1
store i32 %191, i32* %24
%192 = load i32, i32* %13
%193 = ashr i32 %192, 1
store i32 %193, i32* %13
br label %168
194: ; preds = %175
store i32 0, i32* %12
br label %195
195: ; preds = %194, %159
br label %196
196: ; preds = %195
br label %197
197: ; preds = %196
%198 = load i32, i32* %8
%199 = add nsw i32 %198, 1
store i32 %199, i32* %8
br label %131
200: ; preds = %131
%201 = load i32, i32* %8
%202 = and i32 %201, 1
%203 = icmp ne i32 %202, 0
br i1 %203, label %204, label %232
204: ; preds = %200
store i32 0, i32* %9
store i32 128, i32* %13
br label %205
205: ; preds = %224, %204
%206 = load i32, i32* %9
%207 = icmp slt i32 %206, 8
br i1 %207, label %208, label %212
208: ; preds = %205
%209 = load i32, i32* %22
%210 = add nsw i32 %209, -1
store i32 %210, i32* %22
%211 = icmp ne i32 %209, 0
br label %212
212: ; preds = %208, %205
%213 = phi i1 [ false, %205 ], [ %211, %208 ]
br i1 %213, label %214, label %231
214: ; preds = %212
%215 = load i32, i32* %12
%216 = load i32, i32* %13
%217 = and i32 %215, %216
%218 = icmp ne i32 %217, 0
%219 = zext i1 %218 to i64
%220 = select i1 %218, i32 49, i32 48
%221 = trunc i32 %220 to i8
%222 = call i32 @putchar(i8 signext %221)
%223 = call i32 @putchar(i8 signext 44)
br label %224
224: ; preds = %214
%225 = load i32, i32* %9
%226 = add nsw i32 %225, 1
store i32 %226, i32* %9
%227 = load i32, i32* %24
%228 = add nsw i32 %227, 1
store i32 %228, i32* %24
%229 = load i32, i32* %13
%230 = ashr i32 %229, 1
store i32 %230, i32* %13
br label %205
231: ; preds = %212
br label %232
232: ; preds = %231, %200
%233 = call i32 @putchar(i8 signext 10)
br label %118
234: ; preds = %127
%235 = call i32 @putchar(i8 signext 10)
br label %236
236: ; preds = %234, %78
br label %237
237: ; preds = %236, %74
br label %238
238: ; preds = %237, %66
br label %239
239: ; preds = %238, %58
br label %240
240: ; preds = %239, %50
br label %41
241: ; preds = %41
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%243 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i8* %243)
store i32 32, i32* %8
br label %245
245: ; preds = %260, %241
%246 = load i32, i32* %8
%247 = icmp slt i32 %246, 256
br i1 %247, label %248, label %263
248: ; preds = %245
%249 = load i32, i32* %8
%250 = and i32 %249, 7
%251 = icmp eq i32 %250, 0
br i1 %251, label %252, label %254
252: ; preds = %248
%253 = call i32 @putchar(i8 signext 10)
br label %254
254: ; preds = %252, %248
%255 = load i32, i32* %8
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds [256 x i32], [256 x i32]* %25, i64 0, i64 %256
%258 = load i32, i32* %257
%259 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 %258)
br label %260
260: ; preds = %254
%261 = load i32, i32* %8
%262 = add nsw i32 %261, 1
store i32 %262, i32* %8
br label %245
263: ; preds = %245
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%265 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%266 = load i32, i32* %15
%267 = load i32, i32* %23
%268 = sub nsw i32 %266, %267
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i8* %265, i32 %268)
%270 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%271 = load i32, i32* %15
%272 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i8* %270, i32 %271)
%273 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%274 = load i32, i32* %17
%275 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i8* %273, i32 %274)
%276 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32* null
@__const.main.fontdesc = [256 x i8] c"unnamed\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [35 x i8] c"static signed char font%sdat[]={\0A\0A\00"
@.str.2 = [17 x i8] c"FONTBOUNDINGBOX \00"
@.str.3 = [12 x i8] c"%d %d %d %d\00"
@.str.4 = [10 x i8] c"ENCODING \00"
@.str.5 = [8 x i8] c"DWIDTH \00"
@.str.6 = [5 x i8] c"BBX \00"
@.str.7 = [8 x i8] c"BITMAP\0A\00"
@.str.8 = [12 x i8] c"/* `%c' */\0A\00"
@.str.9 = [17 x i8] c"%d,%d,%d,%d,%d,\0A\00"
@.str.10 = [9 x i8] c"ENDCHAR\0A\00"
@stderr = global i32 0
@.str.11 = [26 x i8] c"error in font - bad hex!\0A\00"
@.str.13 = [28 x i8] c"static int font%stbl[224]={\00"
@.str.14 = [4 x i8] c"%d,\00"
@.str.16 = [26 x i8] c"static int font%syofs=%d,\00"
@.str.17 = [13 x i8] c"font%sfh=%d,\00"
@.str.18 = [16 x i8] c"font%soy=%d;\0A\0A\0A\00"
@str = [57 x i8] c"/* data for each char is ox oy w h dwidth, then data */\0A\00"
@str.19 = [4 x i8] c"};\0A\00"
@str.20 = [5 x i8] c"\0A};\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [256 x i32]
%13 = alloca [256 x i8]
%14 = load i32*, i32** @stdin
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%16 = bitcast i32* %4 to i8*
%17 = bitcast i32* %5 to i8*
%18 = bitcast i32* %6 to i8*
%19 = bitcast i32* %7 to i8*
%20 = bitcast i32* %8 to i8*
%21 = bitcast i32* %9 to i8*
%22 = bitcast i32* %10 to i8*
%23 = bitcast i32* %11 to i8*
%24 = bitcast [256 x i32]* %12 to i8*
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%26 = icmp eq i32 %0, 2
br i1 %26, label %27, label %31
27: ; preds = %2
%28 = getelementptr inbounds i8*, i8** %1, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strcpy(i8* %25, i8* %29)
br label %31
31: ; preds = %27, %2
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %25)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 4
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 7
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 9
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 16
br label %38
38: ; preds = %31, %228
%39 = phi i32 [ 0, %31 ], [ %229, %228 ]
%40 = phi i32 [ 0, %31 ], [ %68, %228 ]
%41 = phi i32 [ -999, %31 ], [ %95, %228 ]
%42 = phi i32 [ 0, %31 ], [ %230, %228 ]
br label %43
43: ; preds = %38, %60
%44 = phi i32 [ %61, %60 ], [ %39, %38 ]
%45 = phi i32 [ %68, %60 ], [ %40, %38 ]
%46 = add i32 %44, -256
%47 = icmp ult i32 %46, -224
br label %67
48: ; preds = %74, %67
br label %49
49: ; preds = %48, %78
%50 = call i32* @fgets(i8* %15, i32 128, i32* %14)
%51 = icmp eq i32* %50, null
br i1 %51, label %232, label %52
52: ; preds = %49
%53 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 16)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @sscanf(i8* %37, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
br label %74
57: ; preds = %52
%58 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 9)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @atoi(i8* %36)
br label %43
62: ; preds = %57
%63 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = call i32 @atoi(i8* %35)
br label %67
67: ; preds = %43, %65
%68 = phi i32 [ %45, %43 ], [ %66, %65 ]
br label %48
69: ; preds = %62
%70 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = call i32 @sscanf(i8* %34, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32* %9, i32* %10, i32* %11)
br label %74
74: ; preds = %75, %72, %55
br label %48
75: ; preds = %69
%76 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %74
78: ; preds = %75
br i1 %47, label %49, label %79
79: ; preds = %78
%80 = zext i32 %44 to i64
%81 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %80
store i32 %42, i32* %81
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %44)
%83 = load i32, i32* %10
%84 = load i32, i32* %11
%85 = load i32, i32* %8
%86 = load i32, i32* %9
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %83, i32 %84, i32 %85, i32 %86, i32 %68)
%88 = add nsw i32 %42, 5
%89 = load i32, i32* %11
%90 = load i32, i32* %9
%91 = add nsw i32 %90, %89
%92 = load i32, i32* %7
%93 = sub i32 %91, %92
%94 = icmp sgt i32 %93, %41
%95 = select i1 %94, i32 %93, i32 %41
%96 = call i32* @fgets(i8* %15, i32 128, i32* %14)
%97 = icmp eq i32* %96, null
br i1 %97, label %228, label %98
98: ; preds = %79, %222
%99 = phi i32 [ %224, %222 ], [ %88, %79 ]
%100 = phi i32 [ %223, %222 ], [ %44, %79 ]
%101 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %228, label %103
103: ; preds = %98
%104 = load i32, i32* %8
%105 = call i32 @strlen(i8* %15)
%106 = icmp sgt i32 %105, 1
br i1 %106, label %107, label %222
107: ; preds = %103, %192
%108 = phi i64 [ %196, %192 ], [ 0, %103 ]
%109 = phi i32 [ %195, %192 ], [ %99, %103 ]
%110 = phi i32 [ %194, %192 ], [ %104, %103 ]
%111 = phi i32 [ %193, %192 ], [ 0, %103 ]
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %108
%113 = load i8, i8* %112
%114 = call i32 @toupper(i8 signext %113)
%115 = icmp sgt i32 %114, 57
%116 = select i1 %115, i32 -55, i32 -48
%117 = add nsw i32 %116, %114
%118 = icmp ugt i32 %117, 15
br i1 %118, label %119, label %123
119: ; preds = %107
%120 = load i32, i32* @stderr
%121 = call i32 @fprintf(i32 %120, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%122 = call i32 @exit(i32 1)
unreachable
123: ; preds = %107
%124 = shl nsw i32 %111, 4
%125 = add nuw nsw i32 %117, %124
%126 = and i64 %108, 1
%127 = icmp eq i64 %126, 0
br i1 %127, label %192, label %128
128: ; preds = %123
%129 = call i32 @llvm.umin.i32(i32 %110, i32 7)
%130 = add i32 %109, 1
%131 = icmp eq i32 %110, 0
br i1 %131, label %188, label %132
132: ; preds = %128
%133 = and i32 %125, 128
%134 = icmp eq i32 %133, 0
%135 = select i1 %134, i8 48, i8 49
%136 = call i32 @putchar(i8 signext %135)
%137 = call i32 @putchar(i8 signext 44)
%138 = icmp eq i32 %110, 1
br i1 %138, label %188, label %139
139: ; preds = %132
%140 = and i32 %125, 64
%141 = icmp eq i32 %140, 0
%142 = select i1 %141, i8 48, i8 49
%143 = call i32 @putchar(i8 signext %142)
%144 = call i32 @putchar(i8 signext 44)
%145 = icmp eq i32 %110, 2
br i1 %145, label %188, label %146
146: ; preds = %139
%147 = and i32 %125, 32
%148 = icmp eq i32 %147, 0
%149 = select i1 %148, i8 48, i8 49
%150 = call i32 @putchar(i8 signext %149)
%151 = call i32 @putchar(i8 signext 44)
%152 = icmp eq i32 %110, 3
br i1 %152, label %188, label %153
153: ; preds = %146
%154 = and i32 %125, 16
%155 = icmp eq i32 %154, 0
%156 = select i1 %155, i8 48, i8 49
%157 = call i32 @putchar(i8 signext %156)
%158 = call i32 @putchar(i8 signext 44)
%159 = icmp eq i32 %110, 4
br i1 %159, label %188, label %160
160: ; preds = %153
%161 = and i32 %125, 8
%162 = icmp eq i32 %161, 0
%163 = select i1 %162, i8 48, i8 49
%164 = call i32 @putchar(i8 signext %163)
%165 = call i32 @putchar(i8 signext 44)
%166 = icmp eq i32 %110, 5
br i1 %166, label %188, label %167
167: ; preds = %160
%168 = and i32 %125, 4
%169 = icmp eq i32 %168, 0
%170 = select i1 %169, i8 48, i8 49
%171 = call i32 @putchar(i8 signext %170)
%172 = call i32 @putchar(i8 signext 44)
%173 = icmp eq i32 %110, 6
br i1 %173, label %188, label %174
174: ; preds = %167
%175 = and i32 %125, 2
%176 = icmp eq i32 %175, 0
%177 = select i1 %176, i8 48, i8 49
%178 = call i32 @putchar(i8 signext %177)
%179 = call i32 @putchar(i8 signext 44)
%180 = icmp eq i32 %110, 7
br i1 %180, label %188, label %181
181: ; preds = %174
%182 = add nsw i32 %110, -8
%183 = and i32 %125, 1
%184 = icmp eq i32 %183, 0
%185 = select i1 %184, i8 48, i8 49
%186 = call i32 @putchar(i8 signext %185)
%187 = call i32 @putchar(i8 signext 44)
br label %188
188: ; preds = %181, %174, %167, %160, %153, %146, %139, %132, %128
%189 = phi i32 [ -1, %128 ], [ -1, %132 ], [ -1, %139 ], [ -1, %146 ], [ -1, %153 ], [ -1, %160 ], [ -1, %167 ], [ -1, %174 ], [ %182, %181 ]
%190 = phi i32 [ %109, %128 ], [ %109, %132 ], [ %109, %139 ], [ %109, %146 ], [ %109, %153 ], [ %109, %160 ], [ %109, %167 ], [ %109, %174 ], [ %130, %181 ]
%191 = add i32 %190, %129
br label %192
192: ; preds = %188, %123
%193 = phi i32 [ %125, %123 ], [ 0, %188 ]
%194 = phi i32 [ %110, %123 ], [ %189, %188 ]
%195 = phi i32 [ %109, %123 ], [ %191, %188 ]
%196 = add nuw nsw i64 %108, 1
%197 = call i32 @strlen(i8* %15)
%198 = add nsw i32 %197, -1
%199 = sext i32 %198 to i64
%200 = icmp slt i64 %196, %199
br i1 %200, label %107, label %201
201: ; preds = %192
%202 = and i64 %196, 1
%203 = icmp eq i64 %202, 0
%204 = icmp eq i32 %194, 0
%205 = select i1 %203, i1 true, i1 %204
br i1 %205, label %222, label %206
206: ; preds = %201
%207 = add i32 %194, -1
%208 = call i32 @llvm.umin.i32(i32 %207, i32 7)
br label %209
209: ; preds = %206, %209
%210 = phi i32 [ %219, %209 ], [ %195, %206 ]
%211 = phi i32 [ %220, %209 ], [ 128, %206 ]
%212 = phi i32 [ %218, %209 ], [ 0, %206 ]
%213 = and i32 %211, %193
%214 = icmp eq i32 %213, 0
%215 = select i1 %214, i8 48, i8 49
%216 = call i32 @putchar(i8 signext %215)
%217 = call i32 @putchar(i8 signext 44)
%218 = add nuw nsw i32 %212, 1
%219 = add nsw i32 %210, 1
%220 = lshr i32 %211, 1
%221 = icmp eq i32 %212, %208
br i1 %221, label %222, label %209
222: ; preds = %209, %103, %201
%223 = phi i32 [ %117, %201 ], [ %100, %103 ], [ %117, %209 ]
%224 = phi i32 [ %195, %201 ], [ %99, %103 ], [ %219, %209 ]
%225 = call i32 @putchar(i8 signext 10)
%226 = call i32* @fgets(i8* %15, i32 128, i32* %14)
%227 = icmp eq i32* %226, null
br i1 %227, label %228, label %98
228: ; preds = %98, %222, %79
%229 = phi i32 [ %44, %79 ], [ %223, %222 ], [ %100, %98 ]
%230 = phi i32 [ %88, %79 ], [ %224, %222 ], [ %99, %98 ]
%231 = call i32 @putchar(i8 signext 10)
br label %38
232: ; preds = %49
%233 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.19, i64 0, i64 0))
%234 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i8* %25)
br label %235
235: ; preds = %232, %241
%236 = phi i64 [ 32, %232 ], [ %245, %241 ]
%237 = and i64 %236, 7
%238 = icmp eq i64 %237, 0
br i1 %238, label %239, label %241
239: ; preds = %235
%240 = call i32 @putchar(i8 signext 10)
br label %241
241: ; preds = %239, %235
%242 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %236
%243 = load i32, i32* %242
%244 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 %243)
%245 = add nuw nsw i64 %236, 1
%246 = icmp eq i64 %245, 256
br i1 %246, label %247, label %235
247: ; preds = %241
%248 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.20, i64 0, i64 0))
%249 = load i32, i32* %5
%250 = sub nsw i32 %249, %41
%251 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i8* %25, i32 %250)
%252 = load i32, i32* %5
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i8* %25, i32 %252)
%254 = load i32, i32* %7
%255 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i8* %25, i32 %254)
%256 = call i32 @exit(i32 0)
unreachable
}