#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];
  for (i = 0; i < 256; i++) {
    ofstbl[i] = 0;
  }
  if (argc < 2)
    return 0;
  strcpy(fontdesc, argv[1]);
  printf("\n");
  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("void font%s_init (S_FONT_T *font)\n", fontdesc);
  printf("{\n");
  printf("\tfont->fh = %d;\n", fh);
  printf("\tfont->oy = %d;\n", foy);
  printf("\tfont->yofs = %d;\n", fh - maxy);
  printf("\t\n");
  printf("\tfont->dat = font%sdat;\n", fontdesc);
  printf("\tfont->tbl = font%stbl;\n", fontdesc);
  printf("}\n");
  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    0x2e08(%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)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x100,-0xb4(%rbp)
jge    124f <main+0x8f>
movslq -0xb4(%rbp),%rax
movl   $0x0,-0x4f0(%rbp,%rax,4)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1219 <main+0x59>
cmpl   $0x2,-0x8(%rbp)
jge    1264 <main+0xa4>
xor    %eax,%eax
add    $0x600,%rsp
pop    %rbp
ret
lea    -0x5f0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <strcpy@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd81(%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     17f9 <main+0x639>
lea    -0xa0(%rbp),%rdi
lea    0xd87(%rip),%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1322 <main+0x162>
lea    -0xa0(%rbp),%rdi
add    $0x10,%rdi
lea    0xd72(%rip),%rsi
lea    -0xbc(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
lea    -0xc4(%rbp),%r8
lea    -0xc8(%rbp),%r9
call   10c0 <sscanf@plt>
jmp    17f4 <main+0x634>
lea    -0xa0(%rbp),%rdi
lea    0xd4a(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    135f <main+0x19f>
lea    -0xa0(%rbp),%rdi
add    $0x9,%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xac(%rbp)
jmp    17ef <main+0x62f>
lea    -0xa0(%rbp),%rdi
lea    0xd17(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    139c <main+0x1dc>
lea    -0xa0(%rbp),%rdi
add    $0x7,%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xb0(%rbp)
jmp    17ea <main+0x62a>
lea    -0xa0(%rbp),%rdi
lea    0xce2(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13f6 <main+0x236>
lea    -0xa0(%rbp),%rdi
add    $0x4,%rdi
lea    0xc9e(%rip),%rsi
lea    -0xcc(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    -0xd4(%rbp),%r8
lea    -0xd8(%rbp),%r9
call   10c0 <sscanf@plt>
jmp    17e5 <main+0x625>
lea    -0xa0(%rbp),%rdi
lea    0xc8d(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    17e0 <main+0x620>
cmpl   $0x20,-0xac(%rbp)
jl     1430 <main+0x270>
cmpl   $0xff,-0xac(%rbp)
jle    1435 <main+0x275>
jmp    12a9 <main+0xe9>
mov    -0xe4(%rbp),%ecx
movslq -0xac(%rbp),%rax
mov    %ecx,-0x4f0(%rbp,%rax,4)
mov    -0xac(%rbp),%esi
lea    0xc43(%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    0xc21(%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    14d0 <main+0x310>
mov    -0xd8(%rbp),%eax
add    -0xd0(%rbp),%eax
sub    -0xc8(%rbp),%eax
mov    %eax,-0xe0(%rbp)
jmp    14d5 <main+0x315>
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     151f <main+0x35f>
lea    -0xa0(%rbp),%rdi
lea    0xba9(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5f1(%rbp)
mov    -0x5f1(%rbp),%al
test   $0x1,%al
jne    1532 <main+0x372>
jmp    17d6 <main+0x616>
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    16f7 <main+0x537>
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    15b6 <main+0x3f6>
mov    -0xac(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0xac(%rbp)
cmpl   $0x0,-0xac(%rbp)
jl     15d0 <main+0x410>
cmpl   $0xf,-0xac(%rbp)
jle    15ef <main+0x42f>
mov    0x2a01(%rip),%rax
mov    (%rax),%edi
lea    0xadf(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <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     16d9 <main+0x519>
movl   $0x0,-0xa8(%rbp)
movl   $0x80,-0xb8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0xa8(%rbp)
mov    %al,-0x5f9(%rbp)
jge    165c <main+0x49c>
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    166f <main+0x4af>
jmp    16cf <main+0x50f>
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    162a <main+0x46a>
movl   $0x0,-0xb4(%rbp)
jmp    16de <main+0x51e>
jmp    16e3 <main+0x523>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1552 <main+0x392>
mov    -0xa4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     17c7 <main+0x607>
movl   $0x0,-0xa8(%rbp)
movl   $0x80,-0xb8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0xa8(%rbp)
mov    %al,-0x5fa(%rbp)
jge    174f <main+0x58f>
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    1762 <main+0x5a2>
jmp    17c2 <main+0x602>
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    171d <main+0x55d>
jmp    17c7 <main+0x607>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    14d5 <main+0x315>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    17e5 <main+0x625>
jmp    17ea <main+0x62a>
jmp    17ef <main+0x62f>
jmp    17f4 <main+0x634>
jmp    12a9 <main+0xe9>
lea    0x8fa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0x8c4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x20,-0xa4(%rbp)
cmpl   $0x100,-0xa4(%rbp)
jge    1882 <main+0x6c2>
mov    -0xa4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    1852 <main+0x692>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq -0xa4(%rbp),%rax
mov    -0x4f0(%rbp,%rax,4),%esi
lea    0x88e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1826 <main+0x666>
lea    0x870(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0x861(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x876(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xc0(%rbp),%esi
lea    0x865(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xc8(%rbp),%esi
lea    0x862(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xc0(%rbp),%esi
sub    -0xe0(%rbp),%esi
lea    0x859(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x85e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0x84c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x5f0(%rbp),%rsi
lea    0x850(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x85b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   10e0 <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,%ebp
mov    0x2deb(%rip),%rax
mov    (%rax),%rbx
lea    0x1c0(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   10a0 <memset@plt>
cmp    $0x1,%ebp
jg     122d <main+0x4d>
xor    %eax,%eax
add    $0x5c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r14),%rsi
lea    0xc0(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strcpy@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdae(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xee6(%rip),%rdi
call   1070 <puts@plt>
mov    $0xfffffc19,%r13d
lea    0x40(%rsp),%r12
lea    0xda9(%rip),%r14
xor    %r15d,%r15d
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
mov    %rbx,%rbp
mov    %rbx,0x28(%rsp)
jmp    12af <main+0xcf>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x30(%rsp),%r13d
lea    -0x100(%r15),%ebx
jmp    12e0 <main+0x100>
lea    0x50(%rsp),%rdi
lea    0xd70(%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   10b0 <fgets@plt>
test   %rax,%rax
je     1701 <main+0x521>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12b8 <main+0xd8>
mov    %r12,%rdi
lea    0xd28(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     137f <main+0x19f>
mov    %r12,%rdi
lea    0xd19(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1399 <main+0x1b9>
mov    %r12,%rdi
lea    0xd08(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ac <main+0x1cc>
mov    %r12,%rdi
lea    0xcf4(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    12e0 <main+0x100>
cmp    $0xffffff20,%ebx
jb     12e0 <main+0x100>
jmp    13e0 <main+0x200>
lea    0x49(%rsp),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r15d
mov    %eax,%ebx
add    $0xffffff00,%ebx
jmp    12e0 <main+0x100>
lea    0x47(%rsp),%rdi
call   10f0 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    12e0 <main+0x100>
lea    0x44(%rsp),%rdi
lea    0xc7c(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x34(%rsp),%r8
lea    0x14(%rsp),%r9
call   10e0 <sscanf@plt>
jmp    12e0 <main+0x100>
cs nopw 0x0(%rax,%rax,1)
mov    %r15d,%eax
mov    0xc(%rsp),%ebx
mov    %ebx,0x1c0(%rsp,%rax,4)
lea    0xc6a(%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    0xc54(%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    %r13d,%eax
cmovle %r13d,%eax
mov    %eax,0x30(%rsp)
jmp    1466 <main+0x286>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x28(%rsp),%rbp
lea    0xbc7(%rip),%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     12a0 <main+0xc0>
mov    %r12,%rdi
lea    0xbf3(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     12a0 <main+0xc0>
mov    0x1c(%rsp),%r14d
mov    %r12,%rdi
call   1080 <strlen@plt>
cmp    $0x2,%eax
jl     1450 <main+0x270>
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    14e0 <main+0x300>
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    1680 <main+0x4a0>
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    16e2 <main+0x502>
shl    $0x4,%r13d
add    %r15d,%r13d
test   $0x1,%bl
je     14c6 <main+0x2e6>
cmp    $0x7,%r14d
mov    $0x7,%r12d
cmovb  %r14d,%r12d
mov    $0xffffffff,%ebp
test   %r14d,%r14d
je     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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     14b0 <main+0x2d0>
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    14b4 <main+0x2d4>
nopl   (%rax)
test   $0x1,%bl
je     1450 <main+0x270>
test   %r14d,%r14d
je     1450 <main+0x270>
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    16b0 <main+0x4d0>
sub    %ebx,0xc(%rsp)
jmp    1450 <main+0x270>
mov    0x28ef(%rip),%rax
mov    (%rax),%edi
lea    0x993(%rip),%rsi
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xa7b(%rip),%rdi
call   1070 <puts@plt>
lea    0x98b(%rip),%rdi
lea    0xc0(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x20,%ebp
lea    0x98c(%rip),%rbx
jmp    175e <main+0x57e>
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     1770 <main+0x590>
test   $0x7,%bpl
jne    1740 <main+0x560>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1740 <main+0x560>
lea    0xa0b(%rip),%rdi
call   1070 <puts@plt>
lea    0x93c(%rip),%rdi
lea    0xc0(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x91d(%rip),%rdi
call   1070 <puts@plt>
mov    0x24(%rsp),%esi
lea    0x936(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x20(%rsp),%esi
lea    0x935(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x24(%rsp),%esi
sub    %r13d,%esi
lea    0x931(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x9a6(%rip),%rdi
call   1070 <puts@plt>
lea    0x92a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x932(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x97a(%rip),%rdi
call   1070 <puts@plt>
xor    %edi,%edi
call   1100 <exit@plt>

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

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