#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 char uint8_t;
typedef int /*<<< orphan*/ linebuf;
typedef int /*<<< orphan*/ current_char_name;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *const, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ *stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char *const argv[]) {
  FILE *fontfile, *hfile, *cfile;
  char linebuf[1024], sarg1[1024], sarg2[1024];
  int iarg1, iarg2, iarg3, iarg4;
  bool bitmap_state;
  char current_char_name[1024];
  unsigned int current_char_codepoint = 0;
  unsigned int hexval[2], hexvaladd;
  unsigned int evenodd;
  const uint8_t *lptr;
  if (argc != 4) {
    fprintf(stderr, "usage: bdf2c fonf_file.bdf h_file.h c_file.c\n");
    return (-1);
  }
  if ((fontfile = fopen(argv[1], "r")) == (FILE *)0) {
    perror("input cannot be opened");
    return (-1);
  }
  if ((hfile = fopen(argv[2], "w")) == (FILE *)0) {
    perror("output h_file cannot be opened");
    return (-1);
  }
  if ((cfile = fopen(argv[3], "w")) == (FILE *)0) {
    perror("output c_file cannot be opened");
    return (-1);
  }
  fputs(""
        "#ifndef _font_bitmap_h_\n"
        "#define _font_bitmap_h_\n"
        "\n"
        "#define assert_size(type, size) _Static_assert(sizeof(type) == size, "
        "\"sizeof(\" #type \") != \" #size)\n"
        "\n"
        "#include <stdint.h>\n"
        "\n"
        "enum\n"
        "{\n"
        "	font_magic = 0x4afb4afb,\n"
        "	font_version = 0,\n"
        "	font_codepoint_last_entry = ~0,\n"
        "};\n"
        "\n"
        "typedef struct\n"
        "{\n"
        "	uint32_t codepoint;\n"
        "	uint32_t bitmap[16]; // each entry is 16 bits of the even line "
        "and 16 bits of the following odd line\n"
        "} font_bitmap_entry_t;\n"
        "\n"
        "assert_size(font_bitmap_entry_t, 68);\n"
        "\n"
        "typedef struct\n"
        "{\n"
        "	uint32_t			magic;\n"
        "	uint32_t			version;\n"
        "	font_bitmap_entry_t	entries[];\n"
        "} font_bitmap_t;\n"
        "\n"
        "#endif /*_font_bitmap_h_*/\n",
        hfile);
  fprintf(cfile, "#include \"%s\"\n\n", argv[2]);
  fputs(""
        "const font_bitmap_t font_bitmap = \n"
        "{\n"
        "	font_magic, font_version,\n"
        "	{\n",
        cfile);
  bitmap_state = false;
  while (fgets(linebuf, sizeof(linebuf), fontfile)) {
    if (!bitmap_state) {
      if (!strcmp(linebuf, "BITMAP\n")) {
        bitmap_state = true;
        evenodd = 0;
        fprintf(cfile, "		{\n");
        fprintf(cfile, "			%u,\n", current_char_codepoint);
        fprintf(cfile, "			{\n");
        continue;
      }
      if (sscanf(linebuf, "%1024s %d", sarg1, &iarg1) == 2) {
        if (!strcmp("ENCODING", sarg1)) {
          current_char_codepoint = (unsigned int)iarg1;
          continue;
        }
      }
      if (sscanf(linebuf, "%1024s %d %d %d %d", sarg1, &iarg1, &iarg2, &iarg3,
                 &iarg4) == 5) {
        if (!strcmp("FONTBOUNDINGBOX", sarg1)) {
          if (iarg1 != 16) {
            fprintf(stderr, "font width != 16\n");
            exit(-1);
          }
          if (iarg2 != 32) {
            fprintf(stderr, "font height != 32\n");
            exit(-1);
          }
          continue;
        }
      }
      if (sscanf(linebuf, "%1024s %1024s", sarg1, sarg2) == 2) {
        if (!strcmp("CHARSET_REGISTRY", sarg1)) {
          if (strcmp("\"ISO10646\"", sarg2)) {
            fprintf(stderr, "encoding should be ISO 10646\n");
            exit(-1);
          }
          continue;
        }
        if (!strcmp("STARTCHAR", sarg1)) {
          strncpy(current_char_name, sarg2, sizeof(current_char_name));
          continue;
        }
      }
    } else {
      if (!strcmp("ENDCHAR\n", linebuf)) {
        fprintf(cfile, "			},\n");
        fprintf(cfile, "		},\n");
        bitmap_state = false;
        continue;
      }
      for (lptr = (const uint8_t *)linebuf, hexval[evenodd] = 0; *lptr != '\0';
           lptr++) {
        hexvaladd = 0;
        if ((*lptr >= '0') && (*lptr <= '9'))
          hexvaladd = *lptr - '0';
        else if ((*lptr >= 'a') && (*lptr <= 'f'))
          hexvaladd = (*lptr - 'a') + 10;
        else if ((*lptr >= 'A') && (*lptr <= 'F'))
          hexvaladd = (*lptr - 'A') + 10;
        else
          break;
        hexval[evenodd] <<= 4;
        hexval[evenodd] |= hexvaladd;
      }
      unsigned int bitindex;
      if (evenodd)
        fprintf(cfile, "				0x%04x%04x, // ", hexval[0],
                hexval[1]);
      else
        fprintf(cfile, "		            		// ");
      for (bitindex = 15; bitindex > 0; bitindex--)
        fprintf(cfile, "%c ", (hexval[evenodd] & (1 << bitindex)) ? 'X' : '.');
      fprintf(cfile, "\n");
      evenodd ^= 0x01;
    }
  }
  fputs(""
        "		{\n"
        "			font_codepoint_last_entry,\n"
        "			{\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "				0x00000000,\n"
        "			},\n"
        "		},\n"
        "	},\n",
        cfile);
  fprintf(cfile, "};\n");
  fclose(hfile);
  fclose(cfile);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1054(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11f1 <main+0x51>
mov    0x2e0c(%rip),%rax
mov    (%rax),%rdi
lea    0xe22(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    122b <main+0x8b>
lea    0xe16(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe0d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1265 <main+0xc5>
lea    0xdf5(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdd3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    129f <main+0xff>
lea    0xdda(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x20(%rbp),%rsi
lea    0xddd(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0x101b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rsi
lea    0x1019(%rip),%rdi
call   1050 <fputs@plt>
movl   $0x0,-0xc44(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     17fb <main+0x65b>
cmpl   $0x0,-0xc44(%rbp)
jne    157b <main+0x3db>
lea    -0x430(%rbp),%rdi
lea    0x1014(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1381 <main+0x1e1>
movl   $0x1,-0xc44(%rbp)
movl   $0x0,-0x1064(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xff7(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1054(%rbp),%edx
lea    0xfd6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xfcc(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    12e3 <main+0x143>
lea    -0x430(%rbp),%rdi
lea    -0x830(%rbp),%rdx
lea    0xfb1(%rip),%rsi
lea    -0xc34(%rbp),%rcx
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    13e0 <main+0x240>
lea    -0x830(%rbp),%rsi
lea    0xf96(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13db <main+0x23b>
mov    -0xc34(%rbp),%eax
mov    %eax,-0x1054(%rbp)
jmp    12e3 <main+0x143>
jmp    13e0 <main+0x240>
lea    -0x430(%rbp),%rdi
lea    -0x830(%rbp),%rdx
lea    0xf65(%rip),%rsi
lea    -0xc34(%rbp),%rcx
lea    -0xc38(%rbp),%r8
lea    -0xc3c(%rbp),%r9
lea    -0xc40(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x5,%eax
jne    14aa <main+0x30a>
lea    -0x830(%rbp),%rsi
lea    0xf3a(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    14a5 <main+0x305>
cmpl   $0x10,-0xc34(%rbp)
je     1471 <main+0x2d1>
mov    0x2b8a(%rip),%rax
mov    (%rax),%rdi
lea    0xf1d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
cmpl   $0x20,-0xc38(%rbp)
je     14a0 <main+0x300>
mov    0x2b5b(%rip),%rax
mov    (%rax),%rdi
lea    0xf00(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    12e3 <main+0x143>
jmp    14aa <main+0x30a>
lea    -0x430(%rbp),%rdi
lea    -0x830(%rbp),%rdx
lea    -0xc30(%rbp),%rcx
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    1576 <main+0x3d6>
lea    -0x830(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1537 <main+0x397>
lea    -0xc30(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1532 <main+0x392>
mov    0x2ac9(%rip),%rax
mov    (%rax),%rdi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    12e3 <main+0x143>
lea    -0x830(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1571 <main+0x3d1>
lea    -0x1050(%rbp),%rdi
lea    -0xc30(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
jmp    12e3 <main+0x143>
jmp    1576 <main+0x3d6>
jmp    17f6 <main+0x656>
lea    -0x430(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15cb <main+0x42b>
mov    -0x28(%rbp),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0xc44(%rbp)
jmp    12e3 <main+0x143>
lea    -0x430(%rbp),%rax
mov    %rax,-0x1070(%rbp)
mov    -0x1064(%rbp),%eax
movl   $0x0,-0x105c(%rbp,%rax,4)
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     171e <main+0x57e>
movl   $0x0,-0x1060(%rbp)
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1645 <main+0x4a5>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1645 <main+0x4a5>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x1060(%rbp)
jmp    16d6 <main+0x536>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1686 <main+0x4e6>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jg     1686 <main+0x4e6>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x1060(%rbp)
jmp    16d1 <main+0x531>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     16c7 <main+0x527>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jg     16c7 <main+0x527>
mov    -0x1070(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x1060(%rbp)
jmp    16cc <main+0x52c>
jmp    171e <main+0x57e>
jmp    16d1 <main+0x531>
jmp    16d6 <main+0x536>
mov    -0x1064(%rbp),%eax
mov    -0x105c(%rbp,%rax,4),%ecx
shl    $0x4,%ecx
mov    %ecx,-0x105c(%rbp,%rax,4)
mov    -0x1060(%rbp),%ecx
mov    -0x1064(%rbp),%eax
or     -0x105c(%rbp,%rax,4),%ecx
mov    %ecx,-0x105c(%rbp,%rax,4)
mov    -0x1070(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1070(%rbp)
jmp    15ea <main+0x44a>
cmpl   $0x0,-0x1064(%rbp)
je     174e <main+0x5ae>
mov    -0x28(%rbp),%rdi
mov    -0x105c(%rbp),%edx
mov    -0x1058(%rbp),%ecx
lea    0xcc2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1760 <main+0x5c0>
mov    -0x28(%rbp),%rdi
lea    0xcbf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xf,-0x1074(%rbp)
cmpl   $0x0,-0x1074(%rbp)
jbe    17d5 <main+0x635>
mov    -0x28(%rbp),%rdi
mov    -0x1064(%rbp),%eax
mov    -0x105c(%rbp,%rax,4),%eax
mov    %eax,-0x1078(%rbp)
mov    -0x1074(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x1078(%rbp),%ecx
and    %eax,%ecx
mov    $0x2e,%edx
mov    $0x58,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xc72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1074(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1074(%rbp)
jmp    176a <main+0x5ca>
mov    -0x28(%rbp),%rdi
lea    0xb0b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1064(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x1064(%rbp)
jmp    12e3 <main+0x143>
mov    -0x28(%rbp),%rsi
lea    0xc2a(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rdi
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1048,%rsp
cmp    $0x4,%edi
jne    1806 <main+0x656>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe76(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     183d <main+0x68d>
mov    0x10(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     184b <main+0x69b>
mov    %rax,%r14
mov    0x18(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1859 <main+0x6a9>
mov    %rax,%rbx
lea    0xe7d(%rip),%rdi
mov    $0x255,%esi
mov    $0x1,%edx
mov    %r14,0x30(%rsp)
mov    %r14,%rcx
call   10d0 <fwrite@plt>
mov    0x10(%rbp),%rdx
lea    0x10b1(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x10b0(%rip),%rdi
mov    $0x43,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0x40(%rsp),%rdi
mov    $0x400,%esi
mov    0x18(%rsp),%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     17be <main+0x60e>
lea    0x40(%rsp),%rbp
lea    0x840(%rsp),%r15
mov    $0x2e,%r13d
lea    0x11a6(%rip),%r12
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
jmp    14e3 <main+0x333>
nopl   0x0(%rax,%rax,1)
mov    $0x13,%esi
mov    $0x1,%edx
lea    0x1167(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
test   $0x8000,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x4000,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x2000,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x1000,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x800,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x400,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x200,%r15d
mov    $0x58,%edx
cmove  %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
movd   %r15d,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xc46(%rip),%xmm1
pand   0xc4e(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebp
test   $0x80,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x40,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x20,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x10,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x8,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x4,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x2,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   $0x1,%bpl
mov    $0x58,%edx
cmovne %r13d,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
xor    $0x1,%r14d
lea    0x40(%rsp),%rbp
lea    0x840(%rsp),%r15
mov    %rbp,%rdi
mov    $0x400,%esi
mov    0x18(%rsp),%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     17be <main+0x60e>
cmpl   $0x0,0xc(%rsp)
je     15b0 <main+0x400>
lea    0xf1f(%rip),%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     16b8 <main+0x508>
mov    %r14d,%eax
movl   $0x0,0x24(%rsp,%rax,4)
mov    0x40(%rsp),%dl
xor    %r15d,%r15d
test   %dl,%dl
je     1580 <main+0x3d0>
lea    0x41(%rsp),%rcx
jmp    154c <main+0x39c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %dl,%edx
add    %esi,%edx
shl    $0x4,%r15d
or     %edx,%r15d
mov    %r15d,0x24(%rsp,%rax,4)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
je     1580 <main+0x3d0>
lea    -0x30(%rdx),%edi
mov    $0xffffffd0,%esi
cmp    $0xa,%dil
jb     1530 <main+0x380>
lea    -0x61(%rdx),%edi
mov    $0xffffffa9,%esi
cmp    $0x6,%dil
jb     1530 <main+0x380>
lea    -0x41(%rdx),%edi
mov    $0xffffffc9,%esi
cmp    $0x5,%dil
jbe    1530 <main+0x380>
cs nopw 0x0(%rax,%rax,1)
test   %r14d,%r14d
je     12c0 <main+0x110>
mov    0x24(%rsp),%edx
mov    0x28(%rsp),%ecx
mov    %rbx,%rdi
lea    0xe89(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    12d9 <main+0x129>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
lea    0xd97(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     16f7 <main+0x547>
mov    %rbp,%rdi
lea    0xd95(%rip),%rsi
mov    %r15,%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    15fe <main+0x44e>
lea    0xd84(%rip),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     179b <main+0x5eb>
lea    0x38(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbp,%rdi
lea    0xd69(%rip),%rsi
mov    %r15,%rdx
lea    0x10(%rsp),%rcx
lea    0x2c(%rsp),%r8
lea    0x3c(%rsp),%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x5,%eax
jne    1647 <main+0x497>
lea    0xd57(%rip),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     174e <main+0x59e>
mov    %rbp,%rdi
lea    0xd71(%rip),%rsi
mov    %r15,%rdx
lea    0x440(%rsp),%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    14c8 <main+0x318>
lea    0xd5d(%rip),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1771 <main+0x5c1>
lea    0xd7f(%rip),%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14c8 <main+0x318>
lea    0xc40(%rsp),%rdi
lea    0x440(%rsp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
jmp    16ea <main+0x53a>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xd54(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xd3c(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
movl   $0x0,0xc(%rsp)
jmp    14c8 <main+0x318>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xc5a(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
xor    %r14d,%r14d
mov    %rbx,%rdi
lea    0xc3c(%rip),%rsi
mov    0x14(%rsp),%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xc28(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
movl   $0x1,0xc(%rsp)
jmp    14c8 <main+0x318>
cmpl   $0x10,0x10(%rsp)
jne    1867 <main+0x6b7>
movl   $0x0,0xc(%rsp)
cmpl   $0x20,0x2c(%rsp)
je     14c8 <main+0x318>
jmp    187f <main+0x6cf>
lea    0xc69(%rip),%rdi
lea    0x440(%rsp),%rsi
call   1070 <strcmp@plt>
movl   $0x0,0xc(%rsp)
test   %rax,%rax
je     14c8 <main+0x318>
jmp    1897 <main+0x6e7>
mov    0x10(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    %rbp,%rdi
mov    $0x400,%esi
mov    0x18(%rsp),%rdx
call   1060 <fgets@plt>
test   %rax,%rax
jne    12ae <main+0xfe>
lea    0xc8b(%rip),%rdi
mov    $0x136,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xda9(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    0x30(%rsp),%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
jmp    182b <main+0x67b>
mov    0x27d3(%rip),%rax
mov    (%rax),%rcx
lea    0x809(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    $0xffffffff,%eax
add    $0x1048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x80c(%rip),%rdi
call   10b0 <perror@plt>
jmp    1826 <main+0x676>
lea    0x817(%rip),%rdi
call   10b0 <perror@plt>
jmp    1826 <main+0x676>
lea    0x828(%rip),%rdi
call   10b0 <perror@plt>
jmp    1826 <main+0x676>
mov    0x2772(%rip),%rax
mov    (%rax),%rcx
lea    0xb25(%rip),%rdi
mov    $0x11,%esi
jmp    18ad <main+0x6fd>
mov    0x275a(%rip),%rax
mov    (%rax),%rcx
lea    0xb1f(%rip),%rdi
mov    $0x12,%esi
jmp    18ad <main+0x6fd>
mov    0x2742(%rip),%rax
mov    (%rax),%rcx
lea    0xb44(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [46 x i8] c"usage: bdf2c fonf_file.bdf h_file.h c_file.c\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"input cannot be opened\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [31 x i8] c"output h_file cannot be opened\00"
@.str.5 = [31 x i8] c"output c_file cannot be opened\00"
@.str.6 = [598 x i8] c"#ifndef _font_bitmap_h_\0A#define _font_bitmap_h_\0A\0A#define assert_size(type, size) _Static_assert(sizeof(type) == size, \22sizeof(\22 #type \22) != \22 #size)\0A\0A#include <stdint.h>\0A\0Aenum\0A{\0A\09font_magic = 0x4afb4afb,\0A\09font_version = 0,\0A\09font_codepoint_last_entry = ~0,\0A};\0A\0Atypedef struct\0A{\0A\09uint32_t codepoint;\0A\09uint32_t bitmap[16]; // each entry is 16 bits of the even line and 16 bits of the following odd line\0A} font_bitmap_entry_t;\0A\0Aassert_size(font_bitmap_entry_t, 68);\0A\0Atypedef struct\0A{\0A\09uint32_t\09\09\09magic;\0A\09uint32_t\09\09\09version;\0A\09font_bitmap_entry_t\09entries[];\0A} font_bitmap_t;\0A\0A#endif /*_font_bitmap_h_*/\0A\00"
@.str.7 = [16 x i8] c"#include \22%s\22\0A\0A\00"
@.str.8 = [68 x i8] c"const font_bitmap_t font_bitmap = \0A{\0A\09font_magic, font_version,\0A\09{\0A\00"
@.str.9 = [8 x i8] c"BITMAP\0A\00"
@.str.10 = [5 x i8] c"\09\09{\0A\00"
@.str.11 = [8 x i8] c"\09\09\09%u,\0A\00"
@.str.12 = [6 x i8] c"\09\09\09{\0A\00"
@.str.13 = [10 x i8] c"%1024s %d\00"
@.str.14 = [9 x i8] c"ENCODING\00"
@.str.15 = [19 x i8] c"%1024s %d %d %d %d\00"
@.str.16 = [16 x i8] c"FONTBOUNDINGBOX\00"
@.str.17 = [18 x i8] c"font width != 16\0A\00"
@.str.18 = [19 x i8] c"font height != 32\0A\00"
@.str.19 = [14 x i8] c"%1024s %1024s\00"
@.str.20 = [17 x i8] c"CHARSET_REGISTRY\00"
@.str.21 = [11 x i8] c"\22ISO10646\22\00"
@.str.22 = [30 x i8] c"encoding should be ISO 10646\0A\00"
@.str.23 = [10 x i8] c"STARTCHAR\00"
@.str.24 = [9 x i8] c"ENDCHAR\0A\00"
@.str.25 = [7 x i8] c"\09\09\09},\0A\00"
@.str.26 = [6 x i8] c"\09\09},\0A\00"
@.str.27 = [20 x i8] c"\09\09\09\090x%04x%04x, // \00"
@.str.28 = [20 x i8] c"\09\09 \09\09// \00"
@.str.29 = [4 x i8] c"%c \00"
@.str.30 = [2 x i8] c"\0A\00"
@.str.31 = [311 x i8] c"\09\09{\0A\09\09\09font_codepoint_last_entry,\0A\09\09\09{\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09},\0A\09\09},\0A\09},\0A\00"
@.str.32 = [4 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 i32*
%8 = alloca i32*
%9 = alloca [1024 x i8]
%10 = alloca [1024 x i8]
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [1024 x i8]
%18 = alloca i32
%19 = alloca [2 x i32]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %18
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 4
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = load i32*, i32** @stderr
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %281
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %33, i32** %6
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %281
37: ; preds = %29
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %41, i32** %7
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %281
45: ; preds = %37
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %49, i32** %8
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %3
br label %281
53: ; preds = %45
%54 = load i32*, i32** %7
%55 = call i32 @fputs(i8* getelementptr inbounds ([598 x i8], [598 x i8]* @.str.6, i64 0, i64 0), i32* %54)
%56 = load i32*, i32** %8
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %59)
%61 = load i32*, i32** %8
%62 = call i32 @fputs(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.8, i64 0, i64 0), i32* %61)
store i32 0, i32* %16
br label %63
63: ; preds = %271, %153, %143, %138, %118, %92, %75, %53
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%65 = load i32*, i32** %6
%66 = call i64 @fgets(i8* %64, i32 1024, i32* %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %272
68: ; preds = %63
%69 = load i32, i32* %16
%70 = icmp ne i32 %69, 0
br i1 %70, label %149, label %71
71: ; preds = %68
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%74 = icmp ne i64 %73, 0
br i1 %74, label %83, label %75
75: ; preds = %71
store i32 1, i32* %16
store i32 0, i32* %21
%76 = load i32*, i32** %8
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%78 = load i32*, i32** %8
%79 = load i32, i32* %18
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %79)
%81 = load i32*, i32** %8
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %63
83: ; preds = %71
%84 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%86 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %84, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %85, i32* %12)
%87 = icmp eq i32 %86, 2
br i1 %87, label %88, label %95
88: ; preds = %83
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%90 = call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %89)
%91 = icmp ne i64 %90, 0
br i1 %91, label %94, label %92
92: ; preds = %88
%93 = load i32, i32* %12
store i32 %93, i32* %18
br label %63
94: ; preds = %88
br label %95
95: ; preds = %94, %83
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%98 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %96, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %97, i32* %12, i32* %13, i32* %14, i32* %15)
%99 = icmp eq i32 %98, 5
br i1 %99, label %100, label %120
100: ; preds = %95
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%102 = call i64 @strcmp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %101)
%103 = icmp ne i64 %102, 0
br i1 %103, label %119, label %104
104: ; preds = %100
%105 = load i32, i32* %12
%106 = icmp ne i32 %105, 16
br i1 %106, label %107, label %111
107: ; preds = %104
%108 = load i32*, i32** @stderr
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%110 = call i32 @exit(i32 -1)
unreachable
111: ; preds = %104
%112 = load i32, i32* %13
%113 = icmp ne i32 %112, 32
br i1 %113, label %114, label %118
114: ; preds = %111
%115 = load i32*, i32** @stderr
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
%117 = call i32 @exit(i32 -1)
unreachable
118: ; preds = %111
br label %63
119: ; preds = %100
br label %120
120: ; preds = %119, %95
%121 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%122 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%124 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %121, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8* %122, i8* %123)
%125 = icmp eq i32 %124, 2
br i1 %125, label %126, label %148
126: ; preds = %120
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%128 = call i64 @strcmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i8* %127)
%129 = icmp ne i64 %128, 0
br i1 %129, label %139, label %130
130: ; preds = %126
%131 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%132 = call i64 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %131)
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %138
134: ; preds = %130
%135 = load i32*, i32** @stderr
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.22, i64 0, i64 0))
%137 = call i32 @exit(i32 -1)
unreachable
138: ; preds = %130
br label %63
139: ; preds = %126
%140 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%141 = call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), i8* %140)
%142 = icmp ne i64 %141, 0
br i1 %142, label %147, label %143
143: ; preds = %139
%144 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%145 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%146 = call i32 @strncpy(i8* %144, i8* %145, i32 1024)
br label %63
147: ; preds = %139
br label %148
148: ; preds = %147, %120
br label %271
149: ; preds = %68
%150 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%151 = call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0), i8* %150)
%152 = icmp ne i64 %151, 0
br i1 %152, label %158, label %153
153: ; preds = %149
%154 = load i32*, i32** %8
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%156 = load i32*, i32** %8
%157 = call i32 (i32*, i8*, ...) @fprintf(i32* %156, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
store i32 0, i32* %16
br label %63
158: ; preds = %149
%159 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8* %159, i8** %22
%160 = load i32, i32* %21
%161 = zext i32 %160 to i64
%162 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 %161
store i32 0, i32* %162
br label %163
163: ; preds = %230, %158
%164 = load i8*, i8** %22
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %233
168: ; preds = %163
store i32 0, i32* %20
%169 = load i8*, i8** %22
%170 = load i8, i8* %169
%171 = sext i8 %170 to i32
%172 = icmp sge i32 %171, 48
br i1 %172, label %173, label %183
173: ; preds = %168
%174 = load i8*, i8** %22
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = icmp sle i32 %176, 57
br i1 %177, label %178, label %183
178: ; preds = %173
%179 = load i8*, i8** %22
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = sub nsw i32 %181, 48
store i32 %182, i32* %20
br label %218
183: ; preds = %173, %168
%184 = load i8*, i8** %22
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = icmp sge i32 %186, 97
br i1 %187, label %188, label %199
188: ; preds = %183
%189 = load i8*, i8** %22
%190 = load i8, i8* %189
%191 = sext i8 %190 to i32
%192 = icmp sle i32 %191, 102
br i1 %192, label %193, label %199
193: ; preds = %188
%194 = load i8*, i8** %22
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = sub nsw i32 %196, 97
%198 = add nsw i32 %197, 10
store i32 %198, i32* %20
br label %217
199: ; preds = %188, %183
%200 = load i8*, i8** %22
%201 = load i8, i8* %200
%202 = sext i8 %201 to i32
%203 = icmp sge i32 %202, 65
br i1 %203, label %204, label %215
204: ; preds = %199
%205 = load i8*, i8** %22
%206 = load i8, i8* %205
%207 = sext i8 %206 to i32
%208 = icmp sle i32 %207, 70
br i1 %208, label %209, label %215
209: ; preds = %204
%210 = load i8*, i8** %22
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = sub nsw i32 %212, 65
%214 = add nsw i32 %213, 10
store i32 %214, i32* %20
br label %216
215: ; preds = %204, %199
br label %233
216: ; preds = %209
br label %217
217: ; preds = %216, %193
br label %218
218: ; preds = %217, %178
%219 = load i32, i32* %21
%220 = zext i32 %219 to i64
%221 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 %220
%222 = load i32, i32* %221
%223 = shl i32 %222, 4
store i32 %223, i32* %221
%224 = load i32, i32* %20
%225 = load i32, i32* %21
%226 = zext i32 %225 to i64
%227 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 %226
%228 = load i32, i32* %227
%229 = or i32 %228, %224
store i32 %229, i32* %227
br label %230
230: ; preds = %218
%231 = load i8*, i8** %22
%232 = getelementptr inbounds i8, i8* %231, i32 1
store i8* %232, i8** %22
br label %163
233: ; preds = %215, %163
%234 = load i32, i32* %21
%235 = icmp ne i32 %234, 0
br i1 %235, label %236, label %243
236: ; preds = %233
%237 = load i32*, i32** %8
%238 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 0
%239 = load i32, i32* %238
%240 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%241 = load i32, i32* %240
%242 = call i32 (i32*, i8*, ...) @fprintf(i32* %237, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.27, i64 0, i64 0), i32 %239, i32 %241)
br label %246
243: ; preds = %233
%244 = load i32*, i32** %8
%245 = call i32 (i32*, i8*, ...) @fprintf(i32* %244, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0))
br label %246
246: ; preds = %243, %236
store i32 15, i32* %23
br label %247
247: ; preds = %263, %246
%248 = load i32, i32* %23
%249 = icmp ugt i32 %248, 0
br i1 %249, label %250, label %266
250: ; preds = %247
%251 = load i32*, i32** %8
%252 = load i32, i32* %21
%253 = zext i32 %252 to i64
%254 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 %253
%255 = load i32, i32* %254
%256 = load i32, i32* %23
%257 = shl i32 1, %256
%258 = and i32 %255, %257
%259 = icmp ne i32 %258, 0
%260 = zext i1 %259 to i64
%261 = select i1 %259, i32 88, i32 46
%262 = call i32 (i32*, i8*, ...) @fprintf(i32* %251, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %261)
br label %263
263: ; preds = %250
%264 = load i32, i32* %23
%265 = add i32 %264, -1
store i32 %265, i32* %23
br label %247
266: ; preds = %247
%267 = load i32*, i32** %8
%268 = call i32 (i32*, i8*, ...) @fprintf(i32* %267, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.30, i64 0, i64 0))
%269 = load i32, i32* %21
%270 = xor i32 %269, 1
store i32 %270, i32* %21
br label %271
271: ; preds = %266, %148
br label %63
272: ; preds = %63
%273 = load i32*, i32** %8
%274 = call i32 @fputs(i8* getelementptr inbounds ([311 x i8], [311 x i8]* @.str.31, i64 0, i64 0), i32* %273)
%275 = load i32*, i32** %8
%276 = call i32 (i32*, i8*, ...) @fprintf(i32* %275, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.32, i64 0, i64 0))
%277 = load i32*, i32** %7
%278 = call i32 @fclose(i32* %277)
%279 = load i32*, i32** %8
%280 = call i32 @fclose(i32* %279)
store i32 0, i32* %3
br label %281
281: ; preds = %272, %51, %43, %35, %26
%282 = load i32, i32* %3
ret i32 %282
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [46 x i8] c"usage: bdf2c fonf_file.bdf h_file.h c_file.c\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"input cannot be opened\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [31 x i8] c"output h_file cannot be opened\00"
@.str.5 = [31 x i8] c"output c_file cannot be opened\00"
@.str.6 = [598 x i8] c"#ifndef _font_bitmap_h_\0A#define _font_bitmap_h_\0A\0A#define assert_size(type, size) _Static_assert(sizeof(type) == size, \22sizeof(\22 #type \22) != \22 #size)\0A\0A#include <stdint.h>\0A\0Aenum\0A{\0A\09font_magic = 0x4afb4afb,\0A\09font_version = 0,\0A\09font_codepoint_last_entry = ~0,\0A};\0A\0Atypedef struct\0A{\0A\09uint32_t codepoint;\0A\09uint32_t bitmap[16]; // each entry is 16 bits of the even line and 16 bits of the following odd line\0A} font_bitmap_entry_t;\0A\0Aassert_size(font_bitmap_entry_t, 68);\0A\0Atypedef struct\0A{\0A\09uint32_t\09\09\09magic;\0A\09uint32_t\09\09\09version;\0A\09font_bitmap_entry_t\09entries[];\0A} font_bitmap_t;\0A\0A#endif /*_font_bitmap_h_*/\0A\00"
@.str.7 = [16 x i8] c"#include \22%s\22\0A\0A\00"
@.str.8 = [68 x i8] c"const font_bitmap_t font_bitmap = \0A{\0A\09font_magic, font_version,\0A\09{\0A\00"
@.str.9 = [8 x i8] c"BITMAP\0A\00"
@.str.10 = [5 x i8] c"\09\09{\0A\00"
@.str.11 = [8 x i8] c"\09\09\09%u,\0A\00"
@.str.12 = [6 x i8] c"\09\09\09{\0A\00"
@.str.13 = [10 x i8] c"%1024s %d\00"
@.str.14 = [9 x i8] c"ENCODING\00"
@.str.15 = [19 x i8] c"%1024s %d %d %d %d\00"
@.str.16 = [16 x i8] c"FONTBOUNDINGBOX\00"
@.str.17 = [18 x i8] c"font width != 16\0A\00"
@.str.18 = [19 x i8] c"font height != 32\0A\00"
@.str.19 = [14 x i8] c"%1024s %1024s\00"
@.str.20 = [17 x i8] c"CHARSET_REGISTRY\00"
@.str.21 = [11 x i8] c"\22ISO10646\22\00"
@.str.22 = [30 x i8] c"encoding should be ISO 10646\0A\00"
@.str.23 = [10 x i8] c"STARTCHAR\00"
@.str.24 = [9 x i8] c"ENDCHAR\0A\00"
@.str.25 = [7 x i8] c"\09\09\09},\0A\00"
@.str.26 = [6 x i8] c"\09\09},\0A\00"
@.str.27 = [20 x i8] c"\09\09\09\090x%04x%04x, // \00"
@.str.28 = [20 x i8] c"\09\09 \09\09// \00"
@.str.29 = [4 x i8] c"%c \00"
@.str.31 = [311 x i8] c"\09\09{\0A\09\09\09font_codepoint_last_entry,\0A\09\09\09{\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09\090x00000000,\0A\09\09\09},\0A\09\09},\0A\09},\0A\00"
@.str.32 = [4 x i8] c"};\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [1024 x i8]
%11 = alloca [2 x i32]
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%15 = bitcast i32* %6 to i8*
%16 = bitcast i32* %7 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast i32* %9 to i8*
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%20 = bitcast [2 x i32]* %11 to i8*
%21 = icmp eq i32 %0, 4
br i1 %21, label %25, label %22
22: ; preds = %2
%23 = load i32*, i32** @stderr
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 45, i64 1, i32* %23)
br label %234
25: ; preds = %2
%26 = getelementptr inbounds i8*, i8** %1, i64 1
%27 = load i8*, i8** %26
%28 = tail call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %234
32: ; preds = %25
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = tail call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %234
39: ; preds = %32
%40 = getelementptr inbounds i8*, i8** %1, i64 3
%41 = load i8*, i8** %40
%42 = tail call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %234
46: ; preds = %39
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([598 x i8], [598 x i8]* @.str.6, i64 0, i64 0), i64 597, i64 1, i32* %35)
%48 = load i8*, i8** %33
%49 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %48)
%50 = tail call i64 @fwrite(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.8, i64 0, i64 0), i64 67, i64 1, i32* %42)
%51 = call i64 @fgets(i8* %12, i32 1024, i32* %28)
%52 = icmp eq i64 %51, 0
br i1 %52, label %229, label %53
53: ; preds = %46
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
br label %56
56: ; preds = %53, %78
%57 = phi i32 [ undef, %53 ], [ %64, %78 ]
%58 = phi i32 [ 0, %53 ], [ %79, %78 ]
br label %59
59: ; preds = %56, %126
%60 = phi i32 [ %57, %56 ], [ %128, %126 ]
%61 = phi i32 [ 0, %56 ], [ %127, %126 ]
%62 = icmp eq i32 %61, 0
br label %63
63: ; preds = %59, %225
%64 = phi i32 [ %60, %59 ], [ %226, %225 ]
br i1 %62, label %65, label %120
65: ; preds = %63
%66 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %65
%69 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %42)
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %58)
%71 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i64 5, i64 1, i32* %42)
br label %126
72: ; preds = %65
%73 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %13, i32* %6)
%74 = icmp eq i32 %73, 2
br i1 %74, label %75, label %82
75: ; preds = %72
%76 = call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %13)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = load i32, i32* %6
%80 = call i64 @fgets(i8* %12, i32 1024, i32* %28)
%81 = icmp eq i64 %80, 0
br i1 %81, label %229, label %56
82: ; preds = %75, %72
%83 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %13, i32* %6, i32* %7, i32* %8, i32* %9)
%84 = icmp eq i32 %83, 5
br i1 %84, label %85, label %102
85: ; preds = %82
%86 = call i64 @strcmp(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %13)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %102
88: ; preds = %85
%89 = load i32, i32* %6
%90 = icmp eq i32 %89, 16
br i1 %90, label %95, label %91
91: ; preds = %88
%92 = load i32*, i32** @stderr
%93 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i64 17, i64 1, i32* %92)
%94 = call i32 @exit(i32 -1)
unreachable
95: ; preds = %88
%96 = load i32, i32* %7
%97 = icmp eq i32 %96, 32
br i1 %97, label %126, label %98
98: ; preds = %95
%99 = load i32*, i32** @stderr
%100 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0), i64 18, i64 1, i32* %99)
%101 = call i32 @exit(i32 -1)
unreachable
102: ; preds = %85, %82
%103 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8* %13, i8* %14)
%104 = icmp eq i32 %103, 2
br i1 %104, label %105, label %225
105: ; preds = %102
%106 = call i64 @strcmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i8* %13)
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %115
108: ; preds = %105
%109 = call i64 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %14)
%110 = icmp eq i64 %109, 0
br i1 %110, label %126, label %111
111: ; preds = %108
%112 = load i32*, i32** @stderr
%113 = call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.22, i64 0, i64 0), i64 29, i64 1, i32* %112)
%114 = call i32 @exit(i32 -1)
unreachable
115: ; preds = %105
%116 = call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), i8* %13)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %225
118: ; preds = %115
%119 = call i32 @strncpy(i8* %19, i8* %14, i32 1024)
br label %126
120: ; preds = %63
%121 = call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0), i8* %12)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %131
123: ; preds = %120
%124 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), i64 6, i64 1, i32* %42)
%125 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i64 5, i64 1, i32* %42)
br label %126
126: ; preds = %123, %118, %108, %95, %68
%127 = phi i32 [ 1, %68 ], [ 0, %95 ], [ 0, %108 ], [ 0, %118 ], [ 0, %123 ]
%128 = phi i32 [ 0, %68 ], [ %64, %95 ], [ %64, %108 ], [ %64, %118 ], [ %64, %123 ]
%129 = call i64 @fgets(i8* %12, i32 1024, i32* %28)
%130 = icmp eq i64 %129, 0
br i1 %130, label %229, label %59
131: ; preds = %120
%132 = zext i32 %64 to i64
%133 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 %132
store i32 0, i32* %133
%134 = load i8, i8* %12
%135 = icmp eq i8 %134, 0
br i1 %135, label %157, label %136
136: ; preds = %131, %149
%137 = phi i32 [ %153, %149 ], [ 0, %131 ]
%138 = phi i8 [ %155, %149 ], [ %134, %131 ]
%139 = phi i8* [ %154, %149 ], [ %12, %131 ]
%140 = sext i8 %138 to i32
%141 = add i8 %138, -48
%142 = icmp ult i8 %141, 10
br i1 %142, label %149, label %143
143: ; preds = %136
%144 = add i8 %138, -97
%145 = icmp ult i8 %144, 6
br i1 %145, label %149, label %146
146: ; preds = %143
%147 = add i8 %138, -65
%148 = icmp ult i8 %147, 6
br i1 %148, label %149, label %157
149: ; preds = %146, %143, %136
%150 = phi i32 [ -48, %136 ], [ -87, %143 ], [ -55, %146 ]
%151 = add nsw i32 %150, %140
%152 = shl i32 %137, 4
%153 = or i32 %152, %151
store i32 %153, i32* %133
%154 = getelementptr inbounds i8, i8* %139, i64 1
%155 = load i8, i8* %154
%156 = icmp eq i8 %155, 0
br i1 %156, label %157, label %136
157: ; preds = %149, %146, %131
%158 = phi i32 [ 0, %131 ], [ %153, %149 ], [ %137, %146 ]
%159 = icmp eq i32 %64, 0
br i1 %159, label %164, label %160
160: ; preds = %157
%161 = load i32, i32* %54
%162 = load i32, i32* %55
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.27, i64 0, i64 0), i32 %161, i32 %162)
br label %166
164: ; preds = %157
%165 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0), i64 19, i64 1, i32* %42)
br label %166
166: ; preds = %164, %160
%167 = and i32 %158, 32768
%168 = icmp eq i32 %167, 0
%169 = select i1 %168, i32 46, i32 88
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %169)
%171 = and i32 %158, 16384
%172 = icmp eq i32 %171, 0
%173 = select i1 %172, i32 46, i32 88
%174 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %173)
%175 = and i32 %158, 8192
%176 = icmp eq i32 %175, 0
%177 = select i1 %176, i32 46, i32 88
%178 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %177)
%179 = and i32 %158, 4096
%180 = icmp eq i32 %179, 0
%181 = select i1 %180, i32 46, i32 88
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %181)
%183 = and i32 %158, 2048
%184 = icmp eq i32 %183, 0
%185 = select i1 %184, i32 46, i32 88
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %185)
%187 = and i32 %158, 1024
%188 = icmp eq i32 %187, 0
%189 = select i1 %188, i32 46, i32 88
%190 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %189)
%191 = and i32 %158, 512
%192 = icmp eq i32 %191, 0
%193 = select i1 %192, i32 46, i32 88
%194 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %193)
%195 = insertelement <8 x i32> poison, i32 %158, i64 0
%196 = shufflevector <8 x i32> %195, <8 x i32> poison, <8 x i32> zeroinitializer
%197 = and <8 x i32> %196, <i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256>
%198 = icmp eq <8 x i32> %197, zeroinitializer
%199 = extractelement <8 x i1> %198, i64 7
%200 = select i1 %199, i32 46, i32 88
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %200)
%202 = extractelement <8 x i1> %198, i64 6
%203 = select i1 %202, i32 46, i32 88
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %203)
%205 = extractelement <8 x i1> %198, i64 5
%206 = select i1 %205, i32 46, i32 88
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %206)
%208 = extractelement <8 x i1> %198, i64 4
%209 = select i1 %208, i32 46, i32 88
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %209)
%211 = extractelement <8 x i1> %198, i64 3
%212 = select i1 %211, i32 46, i32 88
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %212)
%214 = extractelement <8 x i1> %198, i64 2
%215 = select i1 %214, i32 46, i32 88
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %215)
%217 = extractelement <8 x i1> %198, i64 1
%218 = select i1 %217, i32 46, i32 88
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %218)
%220 = extractelement <8 x i1> %198, i64 0
%221 = select i1 %220, i32 46, i32 88
%222 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 %221)
%223 = call i32 @fputc(i32 10, i32* %42)
%224 = xor i32 %64, 1
br label %225
225: ; preds = %102, %115, %166
%226 = phi i32 [ %224, %166 ], [ %64, %115 ], [ %64, %102 ]
%227 = call i64 @fgets(i8* %12, i32 1024, i32* %28)
%228 = icmp eq i64 %227, 0
br i1 %228, label %229, label %63
229: ; preds = %78, %126, %225, %46
%230 = call i64 @fwrite(i8* getelementptr inbounds ([311 x i8], [311 x i8]* @.str.31, i64 0, i64 0), i64 310, i64 1, i32* %42)
%231 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.32, i64 0, i64 0), i64 3, i64 1, i32* %42)
%232 = call i32 @fclose(i32* %35)
%233 = call i32 @fclose(i32* %42)
br label %234
234: ; preds = %229, %44, %37, %30, %22
%235 = phi i32 [ -1, %22 ], [ -1, %30 ], [ -1, %37 ], [ -1, %44 ], [ 0, %229 ]
ret i32 %235
}