#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 */
struct ttf_header {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int getshort(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ skip2charcode(int /*<<< orphan*/ *);
int /*<<< orphan*/ skip2glyph(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
int slurpbdf_glyph(FILE *pcl, struct ttf_header *hdr, FILE *bdf, int fbbox[4],
                   int *cnt) {
  int encoding, size, ch;
  int desc_size, i;
  int class;
  int glyph_start;
  int restart = ftell(pcl);
  int left_off, top_off, width, height, deltax, bpl;
  if (!skip2charcode(pcl)) {
    fprintf(stderr, "Fewer glyphs in font than expected\n");
    fseek(pcl, restart, SEEK_SET);
    return (0);
  }
  fscanf(pcl, "%d", &encoding);
  ch = getc(pcl);
  if (ch != 'E') {
    fprintf(stderr, "Fewer glyphs in font than expected\n");
    fseek(pcl, restart, SEEK_SET);
    return (0);
  }
  if (!skip2glyph(pcl))
    return (0);
  fscanf(pcl, "%d", &size);
  ch = getc(pcl);
  if (ch != 'W') {
    fprintf(stderr, "Bad font, glyph size does not end in \"W\"\n");
    return (0);
  }
  glyph_start = ftell(pcl);
  if (getc(pcl) != 4) {
    fprintf(stderr, "Bad font, glyph format must be 4\n");
    return (0);
  }
  if (getc(pcl) != 0) {
    fprintf(stderr, "Bad font, I don't support continuations\n");
    return (0);
  }
  desc_size = getc(pcl);
  if (desc_size != 14) {
    fprintf(stderr, "Bad font, glyph descriptor size must be 14\n");
    return (0);
  }
  class = getc(pcl);
  if (class != 1 && class != 2) {
    fprintf(stderr, "Bad font, glyph class must be 1 or 2\n");
    return (0);
  }
  getc(pcl);
  getc(pcl);
  left_off = getshort(pcl);
  top_off = getshort(pcl);
  width = getshort(pcl);
  height = getshort(pcl);
  deltax = getshort(pcl);
  if (left_off < fbbox[2])
    fbbox[2] = left_off;
  if (left_off + width > fbbox[0])
    fbbox[0] = left_off + width;
  if (top_off - height < fbbox[3])
    fbbox[3] = top_off - height;
  if (top_off > fbbox[1])
    fbbox[1] = top_off;
  fprintf(bdf, "STARTCHAR glyph%d\n", *cnt++);
  fprintf(bdf, "ENCODING %d\n", encoding);
  fprintf(bdf, "DWIDTH %d 0\n", deltax);
  fprintf(bdf, "BBX %d %d %d %d\n", width, height, left_off, top_off - height);
  fprintf(bdf, "BITMAP\n");
  bpl = (width + 7) / 8;
  if (class == 2) {
    fprintf(stderr, "Warning: I don't support run length encoded glyphs\n");
    i = 0;
  } else {
    for (i = 0; i < size - 14 && i < height * bpl; ++i) {
      int ch = getc(pcl);
      if ((ch >> 4) >= 10)
        putc((ch >> 4) - 10 + 'A', bdf);
      else
        putc((ch >> 4) + '0', bdf);
      if ((ch & 0xf) >= 10)
        putc((ch & 0xf) - 10 + 'A', bdf);
      else
        putc((ch & 0xf) + '0', bdf);
      if (i % bpl == bpl - 1)
        putc('\n', bdf);
    }
  }
  for (; i < height * bpl; ++i) {
    putc('0', bdf);
    putc('0', bdf);
    if (i % bpl == bpl - 1)
      putc('\n', bdf);
  }
  return (1);
}


x86 assembly (clang, -O0):
<slurpbdf_glyph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <skip2charcode@plt>
cmp    $0x0,%eax
jne    1203 <slurpbdf_glyph+0x73>
mov    0x2e0f(%rip),%rax
mov    (%rax),%rdi
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%esi
mov    0x2de8(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
lea    0xe16(%rip),%rsi
lea    -0x34(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x45,-0x3c(%rbp)
je     1266 <slurpbdf_glyph+0xd6>
mov    0x2dac(%rip),%rax
mov    (%rax),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%esi
mov    0x2d85(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   1030 <skip2glyph@plt>
cmp    $0x0,%eax
jne    1284 <slurpbdf_glyph+0xf4>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
lea    0xd95(%rip),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x57,-0x3c(%rbp)
je     12d2 <slurpbdf_glyph+0x142>
mov    0x2d2b(%rip),%rax
mov    (%rax),%rdi
lea    0xd68(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
cmp    $0x4,%eax
je     1314 <slurpbdf_glyph+0x184>
mov    0x2ce9(%rip),%rax
mov    (%rax),%rdi
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
cmp    $0x0,%eax
je     134a <slurpbdf_glyph+0x1ba>
mov    0x2cb3(%rip),%rax
mov    (%rax),%rdi
lea    0xd3c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0xe,-0x40(%rbp)
je     1384 <slurpbdf_glyph+0x1f4>
mov    0x2c79(%rip),%rax
mov    (%rax),%rdi
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x1,-0x48(%rbp)
je     13c8 <slurpbdf_glyph+0x238>
cmpl   $0x2,-0x48(%rbp)
je     13c8 <slurpbdf_glyph+0x238>
mov    0x2c35(%rip),%rax
mov    (%rax),%rdi
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c2 <slurpbdf_glyph+0x532>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1040 <getshort@plt>
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getshort@plt>
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getshort@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getshort@plt>
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getshort@plt>
mov    %eax,-0x64(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%eax
jge    1430 <slurpbdf_glyph+0x2a0>
mov    -0x54(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x54(%rbp),%eax
add    -0x5c(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    144e <slurpbdf_glyph+0x2be>
mov    -0x54(%rbp),%ecx
add    -0x5c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%eax
sub    -0x60(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0xc(%rcx),%eax
jge    146e <slurpbdf_glyph+0x2de>
mov    -0x58(%rbp),%ecx
sub    -0x60(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x58(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0x4(%rcx),%eax
jle    1488 <slurpbdf_glyph+0x2f8>
mov    -0x58(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%edx
lea    0xc4a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xc48(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x64(%rbp),%edx
lea    0xc40(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x54(%rbp),%r8d
mov    -0x58(%rbp),%r9d
sub    -0x60(%rbp),%r9d
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xc28(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x5c(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x68(%rbp)
cmpl   $0x2,-0x48(%rbp)
jne    154a <slurpbdf_glyph+0x3ba>
mov    0x2ab3(%rip),%rax
mov    (%rax),%rdi
lea    0xbfd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
jmp    1652 <slurpbdf_glyph+0x4c2>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x38(%rbp),%edx
sub    $0xe,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x6d(%rbp)
jge    1579 <slurpbdf_glyph+0x3e9>
mov    -0x44(%rbp),%eax
mov    -0x60(%rbp),%ecx
imul   -0x68(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x6d(%rbp)
mov    -0x6d(%rbp),%al
test   $0x1,%al
jne    1589 <slurpbdf_glyph+0x3f9>
jmp    164d <slurpbdf_glyph+0x4bd>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
sar    $0x4,%eax
cmp    $0xa,%eax
jl     15c1 <slurpbdf_glyph+0x431>
mov    -0x6c(%rbp),%eax
sar    $0x4,%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1060 <putc@plt>
jmp    15d6 <slurpbdf_glyph+0x446>
mov    -0x6c(%rbp),%eax
sar    $0x4,%eax
add    $0x30,%eax
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1060 <putc@plt>
mov    -0x6c(%rbp),%eax
and    $0xf,%eax
cmp    $0xa,%eax
jl     1602 <slurpbdf_glyph+0x472>
mov    -0x6c(%rbp),%eax
and    $0xf,%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1060 <putc@plt>
jmp    1617 <slurpbdf_glyph+0x487>
mov    -0x6c(%rbp),%eax
and    $0xf,%eax
add    $0x30,%eax
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1060 <putc@plt>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x68(%rbp)
mov    -0x68(%rbp),%eax
sub    $0x1,%eax
cmp    %eax,%edx
jne    163a <slurpbdf_glyph+0x4aa>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1060 <putc@plt>
jmp    163f <slurpbdf_glyph+0x4af>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1551 <slurpbdf_glyph+0x3c1>
jmp    1652 <slurpbdf_glyph+0x4c2>
jmp    1657 <slurpbdf_glyph+0x4c7>
mov    -0x44(%rbp),%eax
mov    -0x60(%rbp),%ecx
imul   -0x68(%rbp),%ecx
cmp    %ecx,%eax
jge    16bb <slurpbdf_glyph+0x52b>
mov    -0x20(%rbp),%rsi
mov    $0x30,%edi
call   1060 <putc@plt>
mov    -0x20(%rbp),%rsi
mov    $0x30,%edi
call   1060 <putc@plt>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x68(%rbp)
mov    -0x68(%rbp),%eax
sub    $0x1,%eax
cmp    %eax,%edx
jne    16a8 <slurpbdf_glyph+0x518>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1060 <putc@plt>
jmp    16ad <slurpbdf_glyph+0x51d>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1657 <slurpbdf_glyph+0x4c7>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slurpbdf_glyph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r13
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rdi,%rbx
call   1080 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   10a0 <skip2charcode@plt>
test   %eax,%eax
je     1262 <slurpbdf_glyph+0xc2>
lea    0xe4c(%rip),%rsi
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
mov    %rbx,%rdi
call   10c0 <getc@plt>
cmp    $0x45,%eax
jne    1262 <slurpbdf_glyph+0xc2>
mov    %rbx,%rdi
call   1030 <skip2glyph@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     12d1 <slurpbdf_glyph+0x131>
lea    0xe19(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
mov    %rbx,%rdi
call   10c0 <getc@plt>
cmp    $0x57,%eax
jne    1299 <slurpbdf_glyph+0xf9>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %rbx,%rdi
call   10c0 <getc@plt>
cmp    $0x4,%eax
jne    12b1 <slurpbdf_glyph+0x111>
mov    %rbx,%rdi
call   10c0 <getc@plt>
test   %eax,%eax
je     12e2 <slurpbdf_glyph+0x142>
mov    0x2d8f(%rip),%rax
mov    (%rax),%rcx
lea    0xe18(%rip),%rdi
mov    $0x28,%esi
jmp    12c7 <slurpbdf_glyph+0x127>
mov    0x2d77(%rip),%rax
mov    (%rax),%rcx
lea    0xd8d(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1090 <fseek@plt>
xor    %ebp,%ebp
jmp    12d1 <slurpbdf_glyph+0x131>
mov    0x2d40(%rip),%rax
mov    (%rax),%rcx
lea    0xd7d(%rip),%rdi
mov    $0x29,%esi
jmp    12c7 <slurpbdf_glyph+0x127>
mov    0x2d28(%rip),%rax
mov    (%rax),%rcx
lea    0xd8f(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
call   10c0 <getc@plt>
cmp    $0xe,%eax
jne    1317 <slurpbdf_glyph+0x177>
mov    %rbx,%rdi
call   10c0 <getc@plt>
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     132f <slurpbdf_glyph+0x18f>
mov    0x2cda(%rip),%rax
mov    (%rax),%rcx
lea    0xdb8(%rip),%rdi
mov    $0x25,%esi
jmp    12c7 <slurpbdf_glyph+0x127>
mov    0x2cc2(%rip),%rax
mov    (%rax),%rcx
lea    0xd74(%rip),%rdi
mov    $0x2b,%esi
jmp    12c7 <slurpbdf_glyph+0x127>
mov    %rax,0x20(%rsp)
mov    %rbx,%rdi
call   10c0 <getc@plt>
mov    %rbx,%rdi
call   10c0 <getc@plt>
mov    %rbx,%rdi
call   1040 <getshort@plt>
mov    %eax,%ebp
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <getshort@plt>
mov    %eax,0x14(%rsp)
mov    %rbx,%rdi
call   1040 <getshort@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <getshort@plt>
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <getshort@plt>
mov    %eax,0x18(%rsp)
cmp    0x8(%r12),%ebp
jge    1391 <slurpbdf_glyph+0x1f1>
mov    0xc(%rsp),%eax
mov    %eax,0x8(%r12)
add    %r15d,%ebp
cmp    (%r12),%ebp
jle    139e <slurpbdf_glyph+0x1fe>
mov    %ebp,(%r12)
mov    0x14(%rsp),%eax
mov    %eax,%ebp
sub    0x8(%rsp),%ebp
cmp    0xc(%r12),%ebp
jge    13b4 <slurpbdf_glyph+0x214>
mov    %ebp,0xc(%r12)
cmp    0x4(%r12),%eax
jle    13c0 <slurpbdf_glyph+0x220>
mov    %eax,0x4(%r12)
mov    0x0(%r13),%edx
lea    0xd23(%rip),%rsi
xor    %r13d,%r13d
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x1c(%rsp),%edx
lea    0xd1e(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd1a(%rip),%rsi
mov    %r14,%rdi
mov    0x18(%rsp),%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd12(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
mov    0x8(%rsp),%r12d
mov    %r12d,%ecx
mov    0xc(%rsp),%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xcff(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x7(%r15),%eax
add    $0xe,%r15d
test   %eax,%eax
cmovns %eax,%r15d
sar    $0x3,%r15d
cmpl   $0x2,0x20(%rsp)
jne    1481 <slurpbdf_glyph+0x2e1>
mov    0x2b81(%rip),%rax
mov    (%rax),%rcx
lea    0xccb(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
imul   %r15d,%r12d
jmp    1527 <slurpbdf_glyph+0x387>
imul   %r15d,%r12d
cmpl   $0xf,0x10(%rsp)
jl     1527 <slurpbdf_glyph+0x387>
test   %r12d,%r12d
jle    1527 <slurpbdf_glyph+0x387>
mov    %r12d,0x8(%rsp)
lea    -0x1(%r15),%r12d
xor    %r13d,%r13d
mov    %rbx,%rdi
call   10c0 <getc@plt>
mov    %eax,%ebp
shr    $0x4,%eax
cmp    $0xa0,%ebp
mov    $0x30,%ecx
mov    $0x37,%edx
cmovge %edx,%ecx
add    %al,%cl
movsbl %cl,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
and    $0xf,%ebp
lea    0x30(%rbp),%eax
lea    0x37(%rbp),%ecx
cmp    $0xa,%ebp
movzbl %cl,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
mov    %r13d,%eax
cltd
idiv   %r15d
cmp    %r12d,%edx
jne    150b <slurpbdf_glyph+0x36b>
mov    $0xa,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
add    $0x1,%r13d
mov    0x10(%rsp),%eax
add    $0xfffffff2,%eax
cmp    %eax,%r13d
jge    1522 <slurpbdf_glyph+0x382>
cmp    0x8(%rsp),%r13d
jl     14a5 <slurpbdf_glyph+0x305>
mov    0x8(%rsp),%r12d
mov    $0x1,%ebp
cmp    %r12d,%r13d
jge    12d1 <slurpbdf_glyph+0x131>
lea    -0x1(%r15),%ebx
jmp    1548 <slurpbdf_glyph+0x3a8>
add    $0x1,%r13d
cmp    %r13d,%r12d
je     12d1 <slurpbdf_glyph+0x131>
mov    $0x30,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
mov    $0x30,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
mov    %r13d,%eax
cltd
idiv   %r15d
cmp    %ebx,%edx
jne    153b <slurpbdf_glyph+0x39b>
mov    $0xa,%edi
mov    %r14,%rsi
call   1060 <putc@plt>
jmp    153b <slurpbdf_glyph+0x39b>

LLVM IR (-O0):
%struct.ttf_header = type { i32 }
@stderr = global i32* null
@.str = [36 x i8] c"Fewer glyphs in font than expected\0A\00"
@SEEK_SET = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"Bad font, glyph size does not end in \22W\22\0A\00"
@.str.3 = [34 x i8] c"Bad font, glyph format must be 4\0A\00"
@.str.4 = [41 x i8] c"Bad font, I don't support continuations\0A\00"
@.str.5 = [44 x i8] c"Bad font, glyph descriptor size must be 14\0A\00"
@.str.6 = [38 x i8] c"Bad font, glyph class must be 1 or 2\0A\00"
@.str.7 = [19 x i8] c"STARTCHAR glyph%d\0A\00"
@.str.8 = [13 x i8] c"ENCODING %d\0A\00"
@.str.9 = [13 x i8] c"DWIDTH %d 0\0A\00"
@.str.10 = [17 x i8] c"BBX %d %d %d %d\0A\00"
@.str.11 = [8 x i8] c"BITMAP\0A\00"
@.str.12 = [52 x i8] c"Warning: I don't support run length encoded glyphs\0A\00"
define i32 @slurpbdf_glyph(i32* %0, %struct.ttf_header* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.ttf_header*
%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 i32
%26 = alloca i32
store i32* %0, i32** %7
store %struct.ttf_header* %1, %struct.ttf_header** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
%27 = load i32*, i32** %7
%28 = call i32 @ftell(i32* %27)
store i32 %28, i32* %19
%29 = load i32*, i32** %7
%30 = call i32 @skip2charcode(i32* %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %39, label %32
32: ; preds = %5
%33 = load i32*, i32** @stderr
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%35 = load i32*, i32** %7
%36 = load i32, i32* %19
%37 = load i32, i32* @SEEK_SET
%38 = call i32 @fseek(i32* %35, i32 %36, i32 %37)
store i32 0, i32* %6
br label %290
39: ; preds = %5
%40 = load i32*, i32** %7
%41 = call i32 @fscanf(i32* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%42 = load i32*, i32** %7
%43 = call i32 @getc(i32* %42)
store i32 %43, i32* %14
%44 = load i32, i32* %14
%45 = icmp ne i32 %44, 69
br i1 %45, label %46, label %53
46: ; preds = %39
%47 = load i32*, i32** @stderr
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%49 = load i32*, i32** %7
%50 = load i32, i32* %19
%51 = load i32, i32* @SEEK_SET
%52 = call i32 @fseek(i32* %49, i32 %50, i32 %51)
store i32 0, i32* %6
br label %290
53: ; preds = %39
%54 = load i32*, i32** %7
%55 = call i32 @skip2glyph(i32* %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %53
store i32 0, i32* %6
br label %290
58: ; preds = %53
%59 = load i32*, i32** %7
%60 = call i32 @fscanf(i32* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%61 = load i32*, i32** %7
%62 = call i32 @getc(i32* %61)
store i32 %62, i32* %14
%63 = load i32, i32* %14
%64 = icmp ne i32 %63, 87
br i1 %64, label %65, label %68
65: ; preds = %58
%66 = load i32*, i32** @stderr
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %290
68: ; preds = %58
%69 = load i32*, i32** %7
%70 = call i32 @ftell(i32* %69)
store i32 %70, i32* %18
%71 = load i32*, i32** %7
%72 = call i32 @getc(i32* %71)
%73 = icmp ne i32 %72, 4
br i1 %73, label %74, label %77
74: ; preds = %68
%75 = load i32*, i32** @stderr
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %290
77: ; preds = %68
%78 = load i32*, i32** %7
%79 = call i32 @getc(i32* %78)
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = load i32*, i32** @stderr
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %290
84: ; preds = %77
%85 = load i32*, i32** %7
%86 = call i32 @getc(i32* %85)
store i32 %86, i32* %15
%87 = load i32, i32* %15
%88 = icmp ne i32 %87, 14
br i1 %88, label %89, label %92
89: ; preds = %84
%90 = load i32*, i32** @stderr
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %290
92: ; preds = %84
%93 = load i32*, i32** %7
%94 = call i32 @getc(i32* %93)
store i32 %94, i32* %17
%95 = load i32, i32* %17
%96 = icmp ne i32 %95, 1
br i1 %96, label %97, label %103
97: ; preds = %92
%98 = load i32, i32* %17
%99 = icmp ne i32 %98, 2
br i1 %99, label %100, label %103
100: ; preds = %97
%101 = load i32*, i32** @stderr
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %6
br label %290
103: ; preds = %97, %92
%104 = load i32*, i32** %7
%105 = call i32 @getc(i32* %104)
%106 = load i32*, i32** %7
%107 = call i32 @getc(i32* %106)
%108 = load i32*, i32** %7
%109 = call i32 @getshort(i32* %108)
store i32 %109, i32* %20
%110 = load i32*, i32** %7
%111 = call i32 @getshort(i32* %110)
store i32 %111, i32* %21
%112 = load i32*, i32** %7
%113 = call i32 @getshort(i32* %112)
store i32 %113, i32* %22
%114 = load i32*, i32** %7
%115 = call i32 @getshort(i32* %114)
store i32 %115, i32* %23
%116 = load i32*, i32** %7
%117 = call i32 @getshort(i32* %116)
store i32 %117, i32* %24
%118 = load i32, i32* %20
%119 = load i32*, i32** %10
%120 = getelementptr inbounds i32, i32* %119, i64 2
%121 = load i32, i32* %120
%122 = icmp slt i32 %118, %121
br i1 %122, label %123, label %127
123: ; preds = %103
%124 = load i32, i32* %20
%125 = load i32*, i32** %10
%126 = getelementptr inbounds i32, i32* %125, i64 2
store i32 %124, i32* %126
br label %127
127: ; preds = %123, %103
%128 = load i32, i32* %20
%129 = load i32, i32* %22
%130 = add nsw i32 %128, %129
%131 = load i32*, i32** %10
%132 = getelementptr inbounds i32, i32* %131, i64 0
%133 = load i32, i32* %132
%134 = icmp sgt i32 %130, %133
br i1 %134, label %135, label %141
135: ; preds = %127
%136 = load i32, i32* %20
%137 = load i32, i32* %22
%138 = add nsw i32 %136, %137
%139 = load i32*, i32** %10
%140 = getelementptr inbounds i32, i32* %139, i64 0
store i32 %138, i32* %140
br label %141
141: ; preds = %135, %127
%142 = load i32, i32* %21
%143 = load i32, i32* %23
%144 = sub nsw i32 %142, %143
%145 = load i32*, i32** %10
%146 = getelementptr inbounds i32, i32* %145, i64 3
%147 = load i32, i32* %146
%148 = icmp slt i32 %144, %147
br i1 %148, label %149, label %155
149: ; preds = %141
%150 = load i32, i32* %21
%151 = load i32, i32* %23
%152 = sub nsw i32 %150, %151
%153 = load i32*, i32** %10
%154 = getelementptr inbounds i32, i32* %153, i64 3
store i32 %152, i32* %154
br label %155
155: ; preds = %149, %141
%156 = load i32, i32* %21
%157 = load i32*, i32** %10
%158 = getelementptr inbounds i32, i32* %157, i64 1
%159 = load i32, i32* %158
%160 = icmp sgt i32 %156, %159
br i1 %160, label %161, label %165
161: ; preds = %155
%162 = load i32, i32* %21
%163 = load i32*, i32** %10
%164 = getelementptr inbounds i32, i32* %163, i64 1
store i32 %162, i32* %164
br label %165
165: ; preds = %161, %155
%166 = load i32*, i32** %9
%167 = load i32*, i32** %11
%168 = getelementptr inbounds i32, i32* %167, i32 1
store i32* %168, i32** %11
%169 = load i32, i32* %167
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %169)
%171 = load i32*, i32** %9
%172 = load i32, i32* %12
%173 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %172)
%174 = load i32*, i32** %9
%175 = load i32, i32* %24
%176 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %175)
%177 = load i32*, i32** %9
%178 = load i32, i32* %22
%179 = load i32, i32* %23
%180 = load i32, i32* %20
%181 = load i32, i32* %21
%182 = load i32, i32* %23
%183 = sub nsw i32 %181, %182
%184 = call i32 (i32*, i8*, ...) @fprintf(i32* %177, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %178, i32 %179, i32 %180, i32 %183)
%185 = load i32*, i32** %9
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%187 = load i32, i32* %22
%188 = add nsw i32 %187, 7
%189 = sdiv i32 %188, 8
store i32 %189, i32* %25
%190 = load i32, i32* %17
%191 = icmp eq i32 %190, 2
br i1 %191, label %192, label %195
192: ; preds = %165
%193 = load i32*, i32** @stderr
%194 = call i32 (i32*, i8*, ...) @fprintf(i32* %193, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %16
br label %264
195: ; preds = %165
store i32 0, i32* %16
br label %196
196: ; preds = %260, %195
%197 = load i32, i32* %16
%198 = load i32, i32* %13
%199 = sub nsw i32 %198, 14
%200 = icmp slt i32 %197, %199
br i1 %200, label %201, label %207
201: ; preds = %196
%202 = load i32, i32* %16
%203 = load i32, i32* %23
%204 = load i32, i32* %25
%205 = mul nsw i32 %203, %204
%206 = icmp slt i32 %202, %205
br label %207
207: ; preds = %201, %196
%208 = phi i1 [ false, %196 ], [ %206, %201 ]
br i1 %208, label %209, label %263
209: ; preds = %207
%210 = load i32*, i32** %7
%211 = call i32 @getc(i32* %210)
store i32 %211, i32* %26
%212 = load i32, i32* %26
%213 = ashr i32 %212, 4
%214 = icmp sge i32 %213, 10
br i1 %214, label %215, label %223
215: ; preds = %209
%216 = load i32, i32* %26
%217 = ashr i32 %216, 4
%218 = sub nsw i32 %217, 10
%219 = add nsw i32 %218, 65
%220 = trunc i32 %219 to i8
%221 = load i32*, i32** %9
%222 = call i32 @putc(i8 signext %220, i32* %221)
br label %230
223: ; preds = %209
%224 = load i32, i32* %26
%225 = ashr i32 %224, 4
%226 = add nsw i32 %225, 48
%227 = trunc i32 %226 to i8
%228 = load i32*, i32** %9
%229 = call i32 @putc(i8 signext %227, i32* %228)
br label %230
230: ; preds = %223, %215
%231 = load i32, i32* %26
%232 = and i32 %231, 15
%233 = icmp sge i32 %232, 10
br i1 %233, label %234, label %242
234: ; preds = %230
%235 = load i32, i32* %26
%236 = and i32 %235, 15
%237 = sub nsw i32 %236, 10
%238 = add nsw i32 %237, 65
%239 = trunc i32 %238 to i8
%240 = load i32*, i32** %9
%241 = call i32 @putc(i8 signext %239, i32* %240)
br label %249
242: ; preds = %230
%243 = load i32, i32* %26
%244 = and i32 %243, 15
%245 = add nsw i32 %244, 48
%246 = trunc i32 %245 to i8
%247 = load i32*, i32** %9
%248 = call i32 @putc(i8 signext %246, i32* %247)
br label %249
249: ; preds = %242, %234
%250 = load i32, i32* %16
%251 = load i32, i32* %25
%252 = srem i32 %250, %251
%253 = load i32, i32* %25
%254 = sub nsw i32 %253, 1
%255 = icmp eq i32 %252, %254
br i1 %255, label %256, label %259
256: ; preds = %249
%257 = load i32*, i32** %9
%258 = call i32 @putc(i8 signext 10, i32* %257)
br label %259
259: ; preds = %256, %249
br label %260
260: ; preds = %259
%261 = load i32, i32* %16
%262 = add nsw i32 %261, 1
store i32 %262, i32* %16
br label %196
263: ; preds = %207
br label %264
264: ; preds = %263, %192
br label %265
265: ; preds = %286, %264
%266 = load i32, i32* %16
%267 = load i32, i32* %23
%268 = load i32, i32* %25
%269 = mul nsw i32 %267, %268
%270 = icmp slt i32 %266, %269
br i1 %270, label %271, label %289
271: ; preds = %265
%272 = load i32*, i32** %9
%273 = call i32 @putc(i8 signext 48, i32* %272)
%274 = load i32*, i32** %9
%275 = call i32 @putc(i8 signext 48, i32* %274)
%276 = load i32, i32* %16
%277 = load i32, i32* %25
%278 = srem i32 %276, %277
%279 = load i32, i32* %25
%280 = sub nsw i32 %279, 1
%281 = icmp eq i32 %278, %280
br i1 %281, label %282, label %285
282: ; preds = %271
%283 = load i32*, i32** %9
%284 = call i32 @putc(i8 signext 10, i32* %283)
br label %285
285: ; preds = %282, %271
br label %286
286: ; preds = %285
%287 = load i32, i32* %16
%288 = add nsw i32 %287, 1
store i32 %288, i32* %16
br label %265
289: ; preds = %265
store i32 1, i32* %6
br label %290
290: ; preds = %289, %100, %89, %81, %74, %65, %57, %46, %32
%291 = load i32, i32* %6
ret i32 %291
}

LLVM IR (-O2):
%struct.ttf_header = type { i32 }
@stderr = global i32* null
@.str = [36 x i8] c"Fewer glyphs in font than expected\0A\00"
@SEEK_SET = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"Bad font, glyph size does not end in \22W\22\0A\00"
@.str.3 = [34 x i8] c"Bad font, glyph format must be 4\0A\00"
@.str.4 = [41 x i8] c"Bad font, I don't support continuations\0A\00"
@.str.5 = [44 x i8] c"Bad font, glyph descriptor size must be 14\0A\00"
@.str.6 = [38 x i8] c"Bad font, glyph class must be 1 or 2\0A\00"
@.str.7 = [19 x i8] c"STARTCHAR glyph%d\0A\00"
@.str.8 = [13 x i8] c"ENCODING %d\0A\00"
@.str.9 = [13 x i8] c"DWIDTH %d 0\0A\00"
@.str.10 = [17 x i8] c"BBX %d %d %d %d\0A\00"
@.str.11 = [8 x i8] c"BITMAP\0A\00"
@.str.12 = [52 x i8] c"Warning: I don't support run length encoded glyphs\0A\00"
define i32 @slurpbdf_glyph(i32* %0, %struct.ttf_header* nocapture readnone %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %6 to i8*
%9 = bitcast i32* %7 to i8*
%10 = tail call i32 @ftell(i32* %0)
%11 = tail call i32 @skip2charcode(i32* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i32*, i32** @stderr
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 35, i64 1, i32* %14)
%16 = load i32, i32* @SEEK_SET
%17 = tail call i32 @fseek(i32* %0, i32 %10, i32 %16)
br label %159
18: ; preds = %5
%19 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%20 = call i32 @getc(i32* %0)
%21 = icmp eq i32 %20, 69
br i1 %21, label %27, label %22
22: ; preds = %18
%23 = load i32*, i32** @stderr
%24 = call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 35, i64 1, i32* %23)
%25 = load i32, i32* @SEEK_SET
%26 = call i32 @fseek(i32* %0, i32 %10, i32 %25)
br label %159
27: ; preds = %18
%28 = call i32 @skip2glyph(i32* %0)
%29 = icmp eq i32 %28, 0
br i1 %29, label %159, label %30
30: ; preds = %27
%31 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%32 = call i32 @getc(i32* %0)
%33 = icmp eq i32 %32, 87
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = load i32*, i32** @stderr
%36 = call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i64 41, i64 1, i32* %35)
br label %159
37: ; preds = %30
%38 = call i32 @ftell(i32* %0)
%39 = call i32 @getc(i32* %0)
%40 = icmp eq i32 %39, 4
br i1 %40, label %44, label %41
41: ; preds = %37
%42 = load i32*, i32** @stderr
%43 = call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 33, i64 1, i32* %42)
br label %159
44: ; preds = %37
%45 = call i32 @getc(i32* %0)
%46 = icmp eq i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32*, i32** @stderr
%49 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i64 40, i64 1, i32* %48)
br label %159
50: ; preds = %44
%51 = call i32 @getc(i32* %0)
%52 = icmp eq i32 %51, 14
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32*, i32** @stderr
%55 = call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), i64 43, i64 1, i32* %54)
br label %159
56: ; preds = %50
%57 = call i32 @getc(i32* %0)
%58 = add i32 %57, -3
%59 = icmp ult i32 %58, -2
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = load i32*, i32** @stderr
%62 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i64 37, i64 1, i32* %61)
br label %159
63: ; preds = %56
%64 = call i32 @getc(i32* %0)
%65 = call i32 @getc(i32* %0)
%66 = call i32 @getshort(i32* %0)
%67 = call i32 @getshort(i32* %0)
%68 = call i32 @getshort(i32* %0)
%69 = call i32 @getshort(i32* %0)
%70 = call i32 @getshort(i32* %0)
%71 = getelementptr inbounds i32, i32* %3, i64 2
%72 = load i32, i32* %71
%73 = icmp slt i32 %66, %72
br i1 %73, label %74, label %75
74: ; preds = %63
store i32 %66, i32* %71
br label %75
75: ; preds = %74, %63
%76 = add nsw i32 %68, %66
%77 = load i32, i32* %3
%78 = icmp sgt i32 %76, %77
br i1 %78, label %79, label %80
79: ; preds = %75
store i32 %76, i32* %3
br label %80
80: ; preds = %79, %75
%81 = sub nsw i32 %67, %69
%82 = getelementptr inbounds i32, i32* %3, i64 3
%83 = load i32, i32* %82
%84 = icmp slt i32 %81, %83
br i1 %84, label %85, label %86
85: ; preds = %80
store i32 %81, i32* %82
br label %86
86: ; preds = %85, %80
%87 = getelementptr inbounds i32, i32* %3, i64 1
%88 = load i32, i32* %87
%89 = icmp sgt i32 %67, %88
br i1 %89, label %90, label %91
90: ; preds = %86
store i32 %67, i32* %87
br label %91
91: ; preds = %90, %86
%92 = load i32, i32* %4
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %92)
%94 = load i32, i32* %6
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %94)
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %70)
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %68, i32 %69, i32 %66, i32 %81)
%98 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i64 7, i64 1, i32* %2)
%99 = add nsw i32 %68, 7
%100 = sdiv i32 %99, 8
%101 = icmp eq i32 %57, 2
br i1 %101, label %110, label %102
102: ; preds = %91
%103 = mul i32 %100, %69
%104 = load i32, i32* %7
%105 = icmp sgt i32 %104, 14
%106 = icmp sgt i32 %103, 0
%107 = select i1 %105, i1 %106, i1 false
br i1 %107, label %108, label %142
108: ; preds = %102
%109 = add nsw i32 %100, -1
br label %114
110: ; preds = %91
%111 = load i32*, i32** @stderr
%112 = call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0), i64 51, i64 1, i32* %111)
%113 = mul i32 %100, %69
br label %142
114: ; preds = %108, %135
%115 = phi i32 [ 0, %108 ], [ %136, %135 ]
%116 = call i32 @getc(i32* %0)
%117 = lshr i32 %116, 4
%118 = icmp sgt i32 %116, 159
%119 = trunc i32 %117 to i8
%120 = select i1 %118, i8 55, i8 48
%121 = add i8 %120, %119
%122 = call i32 @putc(i8 signext %121, i32* %2)
%123 = and i32 %116, 15
%124 = icmp ugt i32 %123, 9
%125 = trunc i32 %123 to i8
%126 = or i8 %125, 48
%127 = trunc i32 %123 to i8
%128 = add nuw nsw i8 %127, 55
%129 = select i1 %124, i8 %128, i8 %126
%130 = call i32 @putc(i8 signext %129, i32* %2)
%131 = srem i32 %115, %100
%132 = icmp eq i32 %131, %109
br i1 %132, label %133, label %135
133: ; preds = %114
%134 = call i32 @putc(i8 signext 10, i32* %2)
br label %135
135: ; preds = %133, %114
%136 = add nuw nsw i32 %115, 1
%137 = load i32, i32* %7
%138 = add nsw i32 %137, -14
%139 = icmp slt i32 %136, %138
%140 = icmp slt i32 %136, %103
%141 = select i1 %139, i1 %140, i1 false
br i1 %141, label %114, label %142
142: ; preds = %135, %102, %110
%143 = phi i32 [ %103, %102 ], [ %113, %110 ], [ %103, %135 ]
%144 = phi i32 [ 0, %102 ], [ 0, %110 ], [ %136, %135 ]
%145 = icmp slt i32 %144, %143
br i1 %145, label %146, label %159
146: ; preds = %142
%147 = add nsw i32 %100, -1
br label %148
148: ; preds = %146, %156
%149 = phi i32 [ %144, %146 ], [ %157, %156 ]
%150 = call i32 @putc(i8 signext 48, i32* %2)
%151 = call i32 @putc(i8 signext 48, i32* %2)
%152 = srem i32 %149, %100
%153 = icmp eq i32 %152, %147
br i1 %153, label %154, label %156
154: ; preds = %148
%155 = call i32 @putc(i8 signext 10, i32* %2)
br label %156
156: ; preds = %148, %154
%157 = add nuw i32 %149, 1
%158 = icmp eq i32 %157, %143
br i1 %158, label %159, label %148
159: ; preds = %156, %142, %27, %60, %53, %47, %41, %34, %22, %13
%160 = phi i32 [ 0, %22 ], [ 0, %34 ], [ 0, %41 ], [ 0, %47 ], [ 0, %53 ], [ 0, %60 ], [ 0, %13 ], [ 0, %27 ], [ 1, %142 ], [ 1, %156 ]
ret i32 %160
}