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

/* Forward declarations */

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
scalar_t__ getenv(char *);
int /*<<< orphan*/ hexdump(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *fo;
  FILE *fi;
  char fontname[256];
  char origname[256];
  char *basename;
  char *p;
  int i, len;
  if (argc < 3) {
    fprintf(stderr, "usage: fontdump output.c input.dat\n");
    return 1;
  }
  fo = fopen(argv[1], "wb");
  if (!fo) {
    fprintf(stderr, "fontdump: could not open output file '%s'\n", argv[1]);
    return 1;
  }
  fprintf(fo, "#ifndef __STRICT_ANSI__\n");
  fprintf(fo, "#if defined(__linux__) || defined(__FreeBSD__)\n");
  fprintf(fo, "#ifndef __clang__\n");
  fprintf(fo, "#define HAVE_INCBIN\n");
  fprintf(fo, "#endif\n");
  fprintf(fo, "#endif\n");
  fprintf(fo, "#endif\n");
  for (i = 2; i < argc; i++) {
    fi = fopen(argv[i], "rb");
    if (!fi) {
      fclose(fo);
      fprintf(stderr, "fontdump: could not open input file '%s'\n", argv[i]);
      return 1;
    }
    basename = strrchr(argv[i], '/');
    if (!basename)
      basename = strrchr(argv[i], '\\');
    if (basename)
      basename++;
    else
      basename = argv[i];
    strcpy(origname, basename);
    p = strrchr(origname, '.');
    if (p)
      *p = 0;
    strcpy(fontname, origname);
    p = fontname;
    while (*p) {
      if (*p == '/' || *p == '.' || *p == '\\' || *p == '-')
        *p = '_';
      p++;
    }
    fseek(fi, 0, SEEK_END);
    len = ftell(fi);
    fseek(fi, 0, SEEK_SET);
    if (getenv("verbose"))
      printf("\t{\"%s\",pdf_font_%s,%d},\n", origname, fontname, len);
    fprintf(fo, "\n#ifdef HAVE_INCBIN\n");
    fprintf(fo, "extern const unsigned char pdf_font_%s[%d];\n", fontname, len);
    fprintf(fo, "asm(\".globl pdf_font_%s\");\n", fontname);
    fprintf(fo, "asm(\".balign 8\");\n");
    fprintf(fo, "asm(\"pdf_font_%s:\");\n", fontname);
    fprintf(fo, "asm(\".incbin \\\"%s\\\"\");\n", argv[i]);
    fprintf(fo, "#else\n");
    fprintf(fo, "static const unsigned char pdf_font_%s[%d] = {\n", fontname,
            len);
    hexdump(fo, fi);
    fprintf(fo, "};\n");
    fprintf(fo, "#endif\n");
    fclose(fi);
  }
  if (fclose(fo)) {
    fprintf(stderr, "fontdump: could not close output file '%s'\n", argv[1]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e7 <main+0x47>
mov    0x2e0e(%rip),%rax
mov    (%rax),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1665 <main+0x4c5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1236 <main+0x96>
mov    0x2dc7(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1665 <main+0x4c5>
mov    -0x18(%rbp),%rdi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe18(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x234(%rbp)
mov    -0x234(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    161f <main+0x47f>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde8(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1333 <main+0x193>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1665 <main+0x4c5>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x228(%rbp)
cmpq   $0x0,-0x228(%rbp)
jne    1381 <main+0x1e1>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x5c,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x228(%rbp)
cmpq   $0x0,-0x228(%rbp)
je     13a6 <main+0x206>
mov    -0x228(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x228(%rbp)
jmp    13bc <main+0x21c>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x228(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x228(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x220(%rbp),%rdi
mov    $0x2e,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x230(%rbp)
cmpq   $0x0,-0x230(%rbp)
je     13ff <main+0x25f>
mov    -0x230(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x120(%rbp),%rax
mov    %rax,-0x230(%rbp)
mov    -0x230(%rbp),%rax
cmpb   $0x0,(%rax)
je     149d <main+0x2fd>
mov    -0x230(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     147c <main+0x2dc>
mov    -0x230(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     147c <main+0x2dc>
mov    -0x230(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     147c <main+0x2dc>
mov    -0x230(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1486 <main+0x2e6>
mov    -0x230(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x230(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x230(%rbp)
jmp    1420 <main+0x280>
mov    -0x20(%rbp),%rdi
mov    0x2b40(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x238(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2b05(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
lea    0xc1d(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     150a <main+0x36a>
lea    -0x220(%rbp),%rsi
lea    -0x120(%rbp),%rdx
mov    -0x238(%rbp),%ecx
lea    0xbfb(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc04(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x238(%rbp),%ecx
lea    0xbfa(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc0e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc18(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc12(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc07(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc0d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x238(%rbp),%ecx
lea    0xbf5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <hexdump@plt>
mov    -0x18(%rbp),%rdi
lea    0xc06(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xac8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
jmp    12be <main+0x11e>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     165e <main+0x4be>
mov    0x299f(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xba8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1665 <main+0x4c5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
cmp    $0x2,%edi
jg     11eb <main+0x3b>
mov    0x2e0b(%rip),%rax
mov    (%rax),%rcx
lea    0xe29(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
jmp    1572 <main+0x3c2>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe29(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1512 <main+0x362>
mov    %rax,%rbx
lea    0xe3f(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
lea    0xe3f(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xe56(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xe50(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xe4c(%rip),%r14
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    $0x2,%r14d
movabs $0x800000000007,%r13
mov    %r15,%rbp
mov    %r15,(%rsp)
jmp    13f4 <main+0x244>
nopl   0x0(%rax)
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xe28(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe2b(%rip),%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
lea    0xe41(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x12,%esi
mov    $0x1,%edx
lea    0xe42(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe43(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rsp),%rbp
mov    0x0(%rbp,%r14,8),%rdx
mov    %rbx,%rdi
lea    0xe3c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xe3c(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe31(%rip),%rsi
lea    0x110(%rsp),%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <hexdump@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xe33(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xcee(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
add    $0x1,%r14
cmp    0x8(%rsp),%r14
je     1549 <main+0x399>
mov    0x0(%rbp,%r14,8),%rdi
lea    0xccb(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1529 <main+0x379>
mov    %rax,%r12
mov    0x0(%rbp,%r14,8),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
test   %rax,%rax
jne    143a <main+0x28a>
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1070 <strrchr@plt>
test   %rax,%rax
je     1441 <main+0x291>
add    $0x1,%rax
mov    %rax,%rbp
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
mov    $0x2e,%esi
call   1070 <strrchr@plt>
test   %rax,%rax
je     1466 <main+0x2b6>
movb   $0x0,(%rax)
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rax
jmp    1494 <main+0x2e4>
test   %cl,%cl
je     14b0 <main+0x300>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x2d(%rcx),%edx
cmp    $0x2f,%dl
ja     1480 <main+0x2d0>
movzbl %dl,%edx
bt     %rdx,%r13
jae    1480 <main+0x2d0>
movb   $0x5f,(%rax)
jmp    1490 <main+0x2e0>
nopl   (%rax)
mov    0x2b31(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r12,%rdi
call   1090 <ftell@plt>
mov    %eax,%r15d
mov    0x2afb(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
lea    0xc10(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     12e0 <main+0x130>
lea    0xc03(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
call   1060 <printf@plt>
jmp    12e0 <main+0x130>
mov    0x2abf(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xb00(%rip),%rsi
jmp    156b <main+0x3bb>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x2aa0(%rip),%rax
mov    (%rax),%rdi
mov    0x0(%rbp,%r14,8),%rdx
lea    0xb87(%rip),%rsi
jmp    156b <main+0x3bb>
mov    %rbx,%rdi
call   1050 <fclose@plt>
test   %rax,%rax
je     1589 <main+0x3d9>
mov    0x2a7b(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%rbp),%rdx
lea    0xc88(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    1577 <main+0x3c7>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [36 x i8] c"usage: fontdump output.c input.dat\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [43 x i8] c"fontdump: could not open output file '%s'\0A\00"
@.str.3 = [25 x i8] c"#ifndef __STRICT_ANSI__\0A\00"
@.str.4 = [48 x i8] c"#if defined(__linux__) || defined(__FreeBSD__)\0A\00"
@.str.5 = [19 x i8] c"#ifndef __clang__\0A\00"
@.str.6 = [21 x i8] c"#define HAVE_INCBIN\0A\00"
@.str.7 = [8 x i8] c"#endif\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@.str.9 = [42 x i8] c"fontdump: could not open input file '%s'\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.10 = [8 x i8] c"verbose\00"
@.str.11 = [25 x i8] c"\09{\22%s\22,pdf_font_%s,%d},\0A\00"
@.str.12 = [21 x i8] c"\0A#ifdef HAVE_INCBIN\0A\00"
@.str.13 = [45 x i8] c"extern const unsigned char pdf_font_%s[%d];\0A\00"
@.str.14 = [28 x i8] c"asm(\22.globl pdf_font_%s\22);\0A\00"
@.str.15 = [19 x i8] c"asm(\22.balign 8\22);\0A\00"
@.str.16 = [22 x i8] c"asm(\22pdf_font_%s:\22);\0A\00"
@.str.17 = [24 x i8] c"asm(\22.incbin \\\22%s\\\22\22);\0A\00"
@.str.18 = [7 x i8] c"#else\0A\00"
@.str.19 = [48 x i8] c"static const unsigned char pdf_font_%s[%d] = {\0A\00"
@.str.20 = [4 x i8] c"};\0A\00"
@.str.21 = [44 x i8] c"fontdump: could not close output file '%s'\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 [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32*, i32** @stderr
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %209
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %6
%24 = load i32*, i32** %6
%25 = icmp ne i32* %24, null
br i1 %25, label %32, label %26
26: ; preds = %19
%27 = load i32*, i32** @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %30)
store i32 1, i32* %3
br label %209
32: ; preds = %19
%33 = load i32*, i32** %6
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32*, i32** %6
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%37 = load i32*, i32** %6
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%39 = load i32*, i32** %6
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%41 = load i32*, i32** %6
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%43 = load i32*, i32** %6
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%45 = load i32*, i32** %6
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
store i32 2, i32* %12
br label %47
47: ; preds = %195, %32
%48 = load i32, i32* %12
%49 = load i32, i32* %4
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %198
51: ; preds = %47
%52 = load i8**, i8*** %5
%53 = load i32, i32* %12
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = call i32* @fopen(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %57, i32** %7
%58 = load i32*, i32** %7
%59 = icmp ne i32* %58, null
br i1 %59, label %70, label %60
60: ; preds = %51
%61 = load i32*, i32** %6
%62 = call i64 @fclose(i32* %61)
%63 = load i32*, i32** @stderr
%64 = load i8**, i8*** %5
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %64, i64 %66
%68 = load i8*, i8** %67
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %68)
store i32 1, i32* %3
br label %209
70: ; preds = %51
%71 = load i8**, i8*** %5
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
%76 = call i8* @strrchr(i8* %75, i8 signext 47)
store i8* %76, i8** %10
%77 = load i8*, i8** %10
%78 = icmp ne i8* %77, null
br i1 %78, label %86, label %79
79: ; preds = %70
%80 = load i8**, i8*** %5
%81 = load i32, i32* %12
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = call i8* @strrchr(i8* %84, i8 signext 92)
store i8* %85, i8** %10
br label %86
86: ; preds = %79, %70
%87 = load i8*, i8** %10
%88 = icmp ne i8* %87, null
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load i8*, i8** %10
%91 = getelementptr inbounds i8, i8* %90, i32 1
store i8* %91, i8** %10
br label %98
92: ; preds = %86
%93 = load i8**, i8*** %5
%94 = load i32, i32* %12
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
store i8* %97, i8** %10
br label %98
98: ; preds = %92, %89
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%100 = load i8*, i8** %10
%101 = call i32 @strcpy(i8* %99, i8* %100)
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%103 = call i8* @strrchr(i8* %102, i8 signext 46)
store i8* %103, i8** %11
%104 = load i8*, i8** %11
%105 = icmp ne i8* %104, null
br i1 %105, label %106, label %108
106: ; preds = %98
%107 = load i8*, i8** %11
store i8 0, i8* %107
br label %108
108: ; preds = %106, %98
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%110 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%111 = call i32 @strcpy(i8* %109, i8* %110)
%112 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
store i8* %112, i8** %11
br label %113
113: ; preds = %139, %108
%114 = load i8*, i8** %11
%115 = load i8, i8* %114
%116 = icmp ne i8 %115, 0
br i1 %116, label %117, label %142
117: ; preds = %113
%118 = load i8*, i8** %11
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp eq i32 %120, 47
br i1 %121, label %137, label %122
122: ; preds = %117
%123 = load i8*, i8** %11
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = icmp eq i32 %125, 46
br i1 %126, label %137, label %127
127: ; preds = %122
%128 = load i8*, i8** %11
%129 = load i8, i8* %128
%130 = sext i8 %129 to i32
%131 = icmp eq i32 %130, 92
br i1 %131, label %137, label %132
132: ; preds = %127
%133 = load i8*, i8** %11
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 45
br i1 %136, label %137, label %139
137: ; preds = %132, %127, %122, %117
%138 = load i8*, i8** %11
store i8 95, i8* %138
br label %139
139: ; preds = %137, %132
%140 = load i8*, i8** %11
%141 = getelementptr inbounds i8, i8* %140, i32 1
store i8* %141, i8** %11
br label %113
142: ; preds = %113
%143 = load i32*, i32** %7
%144 = load i32, i32* @SEEK_END
%145 = call i32 @fseek(i32* %143, i32 0, i32 %144)
%146 = load i32*, i32** %7
%147 = call i32 @ftell(i32* %146)
store i32 %147, i32* %13
%148 = load i32*, i32** %7
%149 = load i32, i32* @SEEK_SET
%150 = call i32 @fseek(i32* %148, i32 0, i32 %149)
%151 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%152 = icmp ne i64 %151, 0
br i1 %152, label %153, label %158
153: ; preds = %142
%154 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%155 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%156 = load i32, i32* %13
%157 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %154, i8* %155, i32 %156)
br label %158
158: ; preds = %153, %142
%159 = load i32*, i32** %6
%160 = call i32 (i32*, i8*, ...) @fprintf(i32* %159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
%161 = load i32*, i32** %6
%162 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%163 = load i32, i32* %13
%164 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i8* %162, i32 %163)
%165 = load i32*, i32** %6
%166 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%167 = call i32 (i32*, i8*, ...) @fprintf(i32* %165, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i8* %166)
%168 = load i32*, i32** %6
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %168, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0))
%170 = load i32*, i32** %6
%171 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%172 = call i32 (i32*, i8*, ...) @fprintf(i32* %170, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), i8* %171)
%173 = load i32*, i32** %6
%174 = load i8**, i8*** %5
%175 = load i32, i32* %12
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i8*, i8** %174, i64 %176
%178 = load i8*, i8** %177
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0), i8* %178)
%180 = load i32*, i32** %6
%181 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
%182 = load i32*, i32** %6
%183 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%184 = load i32, i32* %13
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.19, i64 0, i64 0), i8* %183, i32 %184)
%186 = load i32*, i32** %6
%187 = load i32*, i32** %7
%188 = call i32 @hexdump(i32* %186, i32* %187)
%189 = load i32*, i32** %6
%190 = call i32 (i32*, i8*, ...) @fprintf(i32* %189, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%191 = load i32*, i32** %6
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %191, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%193 = load i32*, i32** %7
%194 = call i64 @fclose(i32* %193)
br label %195
195: ; preds = %158
%196 = load i32, i32* %12
%197 = add nsw i32 %196, 1
store i32 %197, i32* %12
br label %47
198: ; preds = %47
%199 = load i32*, i32** %6
%200 = call i64 @fclose(i32* %199)
%201 = icmp ne i64 %200, 0
br i1 %201, label %202, label %208
202: ; preds = %198
%203 = load i32*, i32** @stderr
%204 = load i8**, i8*** %5
%205 = getelementptr inbounds i8*, i8** %204, i64 1
%206 = load i8*, i8** %205
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %203, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.21, i64 0, i64 0), i8* %206)
store i32 1, i32* %3
br label %209
208: ; preds = %198
store i32 0, i32* %3
br label %209
209: ; preds = %208, %202, %60, %26, %16
%210 = load i32, i32* %3
ret i32 %210
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [36 x i8] c"usage: fontdump output.c input.dat\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [43 x i8] c"fontdump: could not open output file '%s'\0A\00"
@.str.3 = [25 x i8] c"#ifndef __STRICT_ANSI__\0A\00"
@.str.4 = [48 x i8] c"#if defined(__linux__) || defined(__FreeBSD__)\0A\00"
@.str.5 = [19 x i8] c"#ifndef __clang__\0A\00"
@.str.6 = [21 x i8] c"#define HAVE_INCBIN\0A\00"
@.str.7 = [8 x i8] c"#endif\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@.str.9 = [42 x i8] c"fontdump: could not open input file '%s'\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.10 = [8 x i8] c"verbose\00"
@.str.11 = [25 x i8] c"\09{\22%s\22,pdf_font_%s,%d},\0A\00"
@.str.12 = [21 x i8] c"\0A#ifdef HAVE_INCBIN\0A\00"
@.str.13 = [45 x i8] c"extern const unsigned char pdf_font_%s[%d];\0A\00"
@.str.14 = [28 x i8] c"asm(\22.globl pdf_font_%s\22);\0A\00"
@.str.15 = [19 x i8] c"asm(\22.balign 8\22);\0A\00"
@.str.16 = [22 x i8] c"asm(\22pdf_font_%s:\22);\0A\00"
@.str.17 = [24 x i8] c"asm(\22.incbin \\\22%s\\\22\22);\0A\00"
@.str.18 = [7 x i8] c"#else\0A\00"
@.str.19 = [48 x i8] c"static const unsigned char pdf_font_%s[%d] = {\0A\00"
@.str.20 = [4 x i8] c"};\0A\00"
@.str.21 = [44 x i8] c"fontdump: could not close output file '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** @stderr
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 35, i64 1, i32* %9)
br label %97
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i32*, i32** @stderr
%18 = load i8*, i8** %12
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %97
20: ; preds = %11
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i64 24, i64 1, i32* %14)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i64 47, i64 1, i32* %14)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 18, i64 1, i32* %14)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i64 20, i64 1, i32* %14)
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %14)
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %14)
%27 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %14)
%28 = zext i32 %0 to i64
br label %29
29: ; preds = %20, %74
%30 = phi i64 [ 2, %20 ], [ %88, %74 ]
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %40
35: ; preds = %29
%36 = call i64 @fclose(i32* %14)
%37 = load i32*, i32** @stderr
%38 = load i8*, i8** %31
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %38)
br label %97
40: ; preds = %29
%41 = load i8*, i8** %31
%42 = call i8* @strrchr(i8* dereferenceable(1) %41, i8 signext 47)
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = call i8* @strrchr(i8* dereferenceable(1) %41, i8 signext 92)
%46 = icmp eq i8* %45, null
br i1 %46, label %50, label %47
47: ; preds = %40, %44
%48 = phi i8* [ %45, %44 ], [ %42, %40 ]
%49 = getelementptr inbounds i8, i8* %48, i64 1
br label %50
50: ; preds = %44, %47
%51 = phi i8* [ %49, %47 ], [ %41, %44 ]
%52 = call i32 @strcpy(i8* %6, i8* %51)
%53 = call i8* @strrchr(i8* %6, i8 signext 46)
%54 = icmp eq i8* %53, null
br i1 %54, label %56, label %55
55: ; preds = %50
store i8 0, i8* %53
br label %56
56: ; preds = %55, %50
%57 = call i32 @strcpy(i8* %5, i8* %6)
br label %58
58: ; preds = %62, %56
%59 = phi i8* [ %5, %56 ], [ %63, %62 ]
%60 = load i8, i8* %59
switch i8 %60, label %62 [
i8 0, label %64
i8 47, label %61
i8 46, label %61
i8 92, label %61
i8 45, label %61
]
61: ; preds = %58, %58, %58, %58
store i8 95, i8* %59
br label %62
62: ; preds = %58, %61
%63 = getelementptr inbounds i8, i8* %59, i64 1
br label %58
64: ; preds = %58
%65 = load i32, i32* @SEEK_END
%66 = call i32 @fseek(i32* %33, i32 0, i32 %65)
%67 = call i32 @ftell(i32* %33)
%68 = load i32, i32* @SEEK_SET
%69 = call i32 @fseek(i32* %33, i32 0, i32 %68)
%70 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %64
%73 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %6, i8* %5, i32 %67)
br label %74
74: ; preds = %72, %64
%75 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i64 20, i64 1, i32* %14)
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %67)
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i8* %5)
%78 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i64 18, i64 1, i32* %14)
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), i8* %5)
%80 = load i8*, i8** %31
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0), i8* %80)
%82 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i64 6, i64 1, i32* %14)
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.19, i64 0, i64 0), i8* %5, i32 %67)
%84 = call i32 @hexdump(i32* %14, i32* %33)
%85 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i64 3, i64 1, i32* %14)
%86 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %14)
%87 = call i64 @fclose(i32* %33)
%88 = add nuw nsw i64 %30, 1
%89 = icmp eq i64 %88, %28
br i1 %89, label %90, label %29
90: ; preds = %74
%91 = call i64 @fclose(i32* %14)
%92 = icmp eq i64 %91, 0
br i1 %92, label %97, label %93
93: ; preds = %90
%94 = load i32*, i32** @stderr
%95 = load i8*, i8** %12
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.21, i64 0, i64 0), i8* %95)
br label %97
97: ; preds = %90, %93, %35, %16, %8
%98 = phi i32 [ 1, %8 ], [ 1, %35 ], [ 1, %93 ], [ 1, %16 ], [ 0, %90 ]
ret i32 %98
}