#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*/ *);
int /*<<< orphan*/ hexdump(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *fo;
  FILE *fi;
  char name[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, "#define HAVE_INCBIN\n");
  fprintf(fo, "#endif\n");
  fprintf(fo, "#endif\n\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(name, basename);
    p = name;
    while (*p) {
      if ((*p == '/') || (*p == '.') || (*p == '\\') || (*p == '-'))
        *p = '_';
      p++;
    }
    fseek(fi, 0, SEEK_END);
    len = ftell(fi);
    fseek(fi, 0, SEEK_SET);
    fprintf(fo, "const unsigned int pdf_font_%s_len = %d;\n", name, len);
    fprintf(fo, "#ifdef HAVE_INCBIN\n");
    fprintf(fo, "asm(\".globl pdf_font_%s_buf\");\n", name);
    fprintf(fo, "asm(\".balign 8\");\n");
    fprintf(fo, "asm(\"pdf_font_%s_buf:\");\n", name);
    fprintf(fo, "asm(\".incbin \\\"%s\\\"\");\n", argv[i]);
    fprintf(fo, "#else\n");
    fprintf(fo, "const unsigned char pdf_font_%s_buf[%d] = {\n", name, 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    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c7 <main+0x47>
mov    0x2e2e(%rip),%rax
mov    (%rax),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15a8 <main+0x428>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1216 <main+0x96>
mov    0x2de7(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15a8 <main+0x428>
mov    -0x18(%rbp),%rdi
lea    0xe31(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe38(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe59(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x2,-0x134(%rbp)
mov    -0x134(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1562 <main+0x3e2>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe22(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12ef <main+0x16f>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2d15(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15a8 <main+0x428>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    133d <main+0x1bd>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x5c,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     1362 <main+0x1e2>
mov    -0x128(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x128(%rbp)
jmp    1378 <main+0x1f8>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x128(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
cmpb   $0x0,(%rax)
je     1416 <main+0x296>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     13f5 <main+0x275>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     13f5 <main+0x275>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     13f5 <main+0x275>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    13ff <main+0x27f>
mov    -0x130(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    1399 <main+0x219>
mov    -0x20(%rbp),%rdi
mov    0x2bc7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x138(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2b8c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x138(%rbp),%ecx
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xca1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc9c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xcaa(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xca4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc9d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x138(%rbp),%ecx
lea    0xc8b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <hexdump@plt>
mov    -0x18(%rbp),%rdi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xb72(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    127a <main+0xfa>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     15a1 <main+0x421>
mov    0x2a5c(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc3b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15a8 <main+0x428>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
cmp    $0x2,%edi
jg     11cb <main+0x3b>
mov    0x2e2b(%rip),%rax
mov    (%rax),%rcx
lea    0xe49(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
jmp    14de <main+0x34e>
mov    %rsi,%r15
mov    %edi,%r14d
mov    0x8(%rsi),%rdi
lea    0xe48(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     147d <main+0x2ed>
mov    %rax,%rbp
lea    0xe5e(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
lea    0xe5e(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
lea    0xe75(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
lea    0xe71(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
lea    0xe60(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbp,(%rsp)
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
mov    $0x2,%ebp
movabs $0x800000000007,%r13
mov    %r15,0x8(%rsp)
jmp    13de <main+0x24e>
nop
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r14,%rdi
call   1070 <ftell@plt>
mov    %eax,%r12d
mov    0x2d1b(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r14,0x18(%rsp)
mov    (%rsp),%r14
mov    %r14,%rdi
lea    0xe1a(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xe21(%rip),%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
lea    0xe23(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x12,%esi
mov    $0x1,%edx
lea    0xe28(%rip),%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
lea    0xe29(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r15,%rbp,8),%rdx
mov    %r14,%rdi
lea    0xe2b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xe2b(%rip),%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
lea    0xe20(%rip),%rsi
mov    %rbx,%rdx
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
mov    0x18(%rsp),%rbx
mov    %rbx,%rsi
call   1080 <hexdump@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xe1f(%rip),%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xcf1(%rip),%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x1,%rbp
cmp    0x10(%rsp),%rbp
je     14b4 <main+0x324>
mov    (%r15,%rbp,8),%rdi
lea    0xcd8(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1494 <main+0x304>
mov    %rax,%r14
mov    (%r15,%rbp,8),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
jne    1422 <main+0x292>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1429 <main+0x299>
add    $0x1,%rax
mov    %rax,%rbx
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rax
mov    0x8(%rsp),%r15
jmp    1464 <main+0x2d4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %cl,%cl
je     1290 <main+0x100>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x2d(%rcx),%edx
cmp    $0x2f,%dl
ja     1450 <main+0x2c0>
movzbl %dl,%edx
bt     %rdx,%r13
jae    1450 <main+0x2c0>
movb   $0x5f,(%rax)
jmp    1460 <main+0x2d0>
mov    0x2b54(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xb95(%rip),%rsi
jmp    14d7 <main+0x347>
mov    (%rsp),%rdi
call   1040 <fclose@plt>
mov    0x2b34(%rip),%rax
mov    (%rax),%rdi
mov    (%r15,%rbp,8),%rdx
lea    0xc12(%rip),%rsi
jmp    14d7 <main+0x347>
mov    (%rsp),%rdi
call   1040 <fclose@plt>
test   %rax,%rax
je     14f5 <main+0x365>
mov    0x2b0f(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xcf2(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    14e3 <main+0x353>

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

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 = [21 x i8] c"#define HAVE_INCBIN\0A\00"
@.str.6 = [8 x i8] c"#endif\0A\00"
@.str.7 = [9 x i8] c"#endif\0A\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 = [42 x i8] c"const unsigned int pdf_font_%s_len = %d;\0A\00"
@.str.11 = [20 x i8] c"#ifdef HAVE_INCBIN\0A\00"
@.str.12 = [32 x i8] c"asm(\22.globl pdf_font_%s_buf\22);\0A\00"
@.str.13 = [19 x i8] c"asm(\22.balign 8\22);\0A\00"
@.str.14 = [26 x i8] c"asm(\22pdf_font_%s_buf:\22);\0A\00"
@.str.15 = [24 x i8] c"asm(\22.incbin \\\22%s\\\22\22);\0A\00"
@.str.16 = [7 x i8] c"#else\0A\00"
@.str.17 = [45 x i8] c"const unsigned char pdf_font_%s_buf[%d] = {\0A\00"
@.str.18 = [4 x i8] c"};\0A\00"
@.str.19 = [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 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32*, i32** @stderr
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 35, i64 1, i32* %7)
br label %83
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32*, i32** @stderr
%16 = load i8*, i8** %10
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %83
18: ; preds = %9
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i64 24, i64 1, i32* %12)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i64 47, i64 1, i32* %12)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i64 20, i64 1, i32* %12)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 7, i64 1, i32* %12)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 8, i64 1, i32* %12)
%24 = zext i32 %0 to i64
br label %25
25: ; preds = %18, %55
%26 = phi i64 [ 2, %18 ], [ %74, %55 ]
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = call i64 @fclose(i32* %12)
%33 = load i32*, i32** @stderr
%34 = load i8*, i8** %27
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %34)
br label %83
36: ; preds = %25
%37 = load i8*, i8** %27
%38 = call i8* @strrchr(i8* dereferenceable(1) %37, i8 signext 47)
%39 = icmp eq i8* %38, null
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = call i8* @strrchr(i8* dereferenceable(1) %37, i8 signext 92)
%42 = icmp eq i8* %41, null
br i1 %42, label %46, label %43
43: ; preds = %36, %40
%44 = phi i8* [ %41, %40 ], [ %38, %36 ]
%45 = getelementptr inbounds i8, i8* %44, i64 1
br label %46
46: ; preds = %40, %43
%47 = phi i8* [ %45, %43 ], [ %37, %40 ]
%48 = call i32 @strcpy(i8* %4, i8* %47)
br label %49
49: ; preds = %53, %46
%50 = phi i8* [ %4, %46 ], [ %54, %53 ]
%51 = load i8, i8* %50
switch i8 %51, label %53 [
i8 0, label %55
i8 47, label %52
i8 46, label %52
i8 92, label %52
i8 45, label %52
]
52: ; preds = %49, %49, %49, %49
store i8 95, i8* %50
br label %53
53: ; preds = %49, %52
%54 = getelementptr inbounds i8, i8* %50, i64 1
br label %49
55: ; preds = %49
%56 = load i32, i32* @SEEK_END
%57 = call i32 @fseek(i32* %29, i32 0, i32 %56)
%58 = call i32 @ftell(i32* %29)
%59 = load i32, i32* @SEEK_SET
%60 = call i32 @fseek(i32* %29, i32 0, i32 %59)
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %4, i32 %58)
%62 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i64 19, i64 1, i32* %12)
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i8* %4)
%64 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i64 18, i64 1, i32* %12)
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i8* %4)
%66 = load i8*, i8** %27
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %66)
%68 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i64 6, i64 1, i32* %12)
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0), i8* %4, i32 %58)
%70 = call i32 @hexdump(i32* %12, i32* %29)
%71 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i64 3, i64 1, i32* %12)
%72 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 7, i64 1, i32* %12)
%73 = call i64 @fclose(i32* %29)
%74 = add nuw nsw i64 %26, 1
%75 = icmp eq i64 %74, %24
br i1 %75, label %76, label %25
76: ; preds = %55
%77 = call i64 @fclose(i32* %12)
%78 = icmp eq i64 %77, 0
br i1 %78, label %83, label %79
79: ; preds = %76
%80 = load i32*, i32** @stderr
%81 = load i8*, i8** %10
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.19, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %76, %79, %31, %14, %6
%84 = phi i32 [ 1, %6 ], [ 1, %31 ], [ 1, %79 ], [ 1, %14 ], [ 0, %76 ]
ret i32 %84
}