#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*/ fontname;
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 *);
int strlen(char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *fo;
  FILE *fi;
  char fontname[256];
  char *basename;
  char *p;
  int i, size;
  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__) || "
              "defined(__OpenBSD__)\n");
  fprintf(fo, "#if !defined(__ICC)\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];
    if (strlen(basename) >= sizeof(fontname)) {
      fclose(fi);
      fclose(fo);
      fprintf(stderr, "fontdump: filename '%s' too long\n", basename);
      return 1;
    }
    strcpy(fontname, basename);
    for (p = fontname; *p; ++p) {
      if (*p == '/' || *p == '.' || *p == '\\' || *p == '-')
        *p = '_';
    }
    fseek(fi, 0, SEEK_END);
    size = ftell(fi);
    fseek(fi, 0, SEEK_SET);
    fprintf(fo, "\n#ifdef HAVE_INCBIN\n");
    fprintf(fo, "const int fz_font_%s_size = %d;\n", fontname, size);
    fprintf(fo, "asm(\".section .rodata\");\n");
    fprintf(fo, "asm(\".global fz_font_%s\");\n", fontname);
    fprintf(fo, "asm(\".type fz_font_%s STT_OBJECT\");\n", fontname);
    fprintf(fo, "asm(\".size fz_font_%s, %d\");\n", fontname, size);
    fprintf(fo, "asm(\".balign 64\");\n");
    fprintf(fo, "asm(\"fz_font_%s:\");\n", fontname);
    fprintf(fo, "asm(\".incbin \\\"%s\\\"\");\n", argv[i]);
    fprintf(fo, "#else\n");
    fprintf(fo, "const int fz_font_%s_size = %d;\n", fontname, size);
    fprintf(fo, "const char fz_font_%s[] = {\n", fontname);
    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    11d7 <main+0x47>
mov    0x2e1e(%rip),%rax
mov    (%rax),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    169b <main+0x50b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1226 <main+0x96>
mov    0x2dd7(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe14(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    169b <main+0x50b>
mov    -0x18(%rbp),%rdi
lea    0xe21(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe52(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x2,-0x134(%rbp)
mov    -0x134(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1655 <main+0x4c5>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe12(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1323 <main+0x193>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2ce1(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    169b <main+0x50b>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    1371 <main+0x1e1>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     1396 <main+0x206>
mov    -0x128(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x128(%rbp)
jmp    13ac <main+0x21c>
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rdi
call   1050 <strlen@plt>
cltq
cmp    $0x100,%rax
jb     1403 <main+0x273>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2bf9(%rip),%rax
mov    (%rax),%rdi
mov    -0x128(%rbp),%rdx
lea    0xd22(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    169b <main+0x50b>
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     14a6 <main+0x316>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1480 <main+0x2f0>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1480 <main+0x2f0>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1480 <main+0x2f0>
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    148a <main+0x2fa>
mov    -0x130(%rbp),%rax
movb   $0x5f,(%rax)
jmp    148f <main+0x2ff>
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    1424 <main+0x294>
mov    -0x20(%rbp),%rdi
mov    0x2b37(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x138(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2afc(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x18(%rbp),%rdi
lea    0xc4c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x138(%rbp),%ecx
lea    0xc42(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc52(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x138(%rbp),%ecx
lea    0xc5b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc67(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc62(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x134(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc56(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc5c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    -0x138(%rbp),%ecx
lea    0xb62(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc2b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <hexdump@plt>
mov    -0x18(%rbp),%rdi
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xaac(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    12ae <main+0x11e>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     1694 <main+0x504>
mov    0x2969(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xbcb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    169b <main+0x50b>
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    $0x118,%rsp
cmp    $0x2,%edi
jg     11db <main+0x3b>
mov    0x2e1b(%rip),%rax
mov    (%rax),%rcx
lea    0xe39(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
jmp    15a5 <main+0x405>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe39(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     151f <main+0x37f>
mov    %rax,%rbx
lea    0xe4f(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10c0 <fwrite@plt>
lea    0xe4f(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0xe7e(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0xe7a(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0xe76(%rip),%r14
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    $0x2,%r14d
movabs $0x800000000007,%r13
mov    %r15,%rbp
mov    %r15,(%rsp)
jmp    1470 <main+0x2d0>
nopl   0x0(%rax)
mov    0x2d11(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r12,%rdi
call   1080 <ftell@plt>
mov    %eax,%r15d
mov    0x2cdb(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xe22(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe25(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x19,%esi
mov    $0x1,%edx
lea    0xe23(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe2b(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
lea    0xe33(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
lea    0xe44(%rip),%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xe44(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xe46(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rsp),%rax
mov    (%rax,%r14,8),%rdx
mov    %rbx,%rdi
lea    0xe3f(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xe3f(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xd52(%rip),%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
lea    0xe1d(%rip),%rsi
mov    %rbp,%rdx
mov    (%rsp),%rbp
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <hexdump@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xe10(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xc8c(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
add    $0x1,%r14
cmp    0x8(%rsp),%r14
je     157c <main+0x3dc>
mov    0x0(%rbp,%r14,8),%rdi
lea    0xc69(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1536 <main+0x396>
mov    %rax,%r12
mov    0x0(%rbp,%r14,8),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
jne    14b6 <main+0x316>
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
je     14bd <main+0x31d>
add    $0x1,%rax
mov    %rax,%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    $0x100,%eax
jae    1556 <main+0x3b6>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
jmp    1504 <main+0x364>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %cl,%cl
je     12d0 <main+0x130>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
movzbl (%r15),%ecx
lea    -0x2d(%rcx),%edx
cmp    $0x2f,%dl
ja     14f0 <main+0x350>
movzbl %dl,%edx
bt     %rdx,%r13
jae    14f0 <main+0x350>
movb   $0x5f,(%r15)
jmp    1500 <main+0x360>
mov    0x2ab2(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xaf3(%rip),%rsi
jmp    159e <main+0x3fe>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2a93(%rip),%rax
mov    (%rax),%rdi
mov    0x0(%rbp,%r14,8),%rdx
lea    0xb94(%rip),%rsi
jmp    159e <main+0x3fe>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2a6b(%rip),%rax
mov    (%rax),%rdi
lea    0xb9b(%rip),%rsi
mov    %rbp,%rdx
jmp    159e <main+0x3fe>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
je     15bc <main+0x41c>
mov    0x2a48(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%rbp),%rdx
lea    0xcae(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    15aa <main+0x40a>

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

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 = [72 x i8] c"#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)\0A\00"
@.str.5 = [21 x i8] c"#if !defined(__ICC)\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"
@.str.10 = [34 x i8] c"fontdump: filename '%s' too long\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.11 = [21 x i8] c"\0A#ifdef HAVE_INCBIN\0A\00"
@.str.12 = [33 x i8] c"const int fz_font_%s_size = %d;\0A\00"
@.str.13 = [26 x i8] c"asm(\22.section .rodata\22);\0A\00"
@.str.14 = [28 x i8] c"asm(\22.global fz_font_%s\22);\0A\00"
@.str.15 = [37 x i8] c"asm(\22.type fz_font_%s STT_OBJECT\22);\0A\00"
@.str.16 = [30 x i8] c"asm(\22.size fz_font_%s, %d\22);\0A\00"
@.str.17 = [20 x i8] c"asm(\22.balign 64\22);\0A\00"
@.str.18 = [21 x i8] c"asm(\22fz_font_%s:\22);\0A\00"
@.str.19 = [24 x i8] c"asm(\22.incbin \\\22%s\\\22\22);\0A\00"
@.str.20 = [7 x i8] c"#else\0A\00"
@.str.21 = [29 x i8] c"const char fz_font_%s[] = {\0A\00"
@.str.22 = [4 x i8] c"};\0A\00"
@.str.23 = [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 %97
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 %97
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 ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0), i64 71, 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 ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i64 20, i64 1, i32* %12)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %12)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %12)
%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* %12)
%26 = zext i32 %0 to i64
br label %27
27: ; preds = %18, %65
%28 = phi i64 [ 2, %18 ], [ %88, %65 ]
%29 = getelementptr inbounds i8*, i8** %1, i64 %28
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = call i64 @fclose(i32* %12)
%35 = load i32*, i32** @stderr
%36 = load i8*, i8** %29
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %36)
br label %97
38: ; preds = %27
%39 = load i8*, i8** %29
%40 = call i8* @strrchr(i8* dereferenceable(1) %39, i8 signext 47)
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = call i8* @strrchr(i8* dereferenceable(1) %39, i8 signext 92)
%44 = icmp eq i8* %43, null
br i1 %44, label %48, label %45
45: ; preds = %38, %42
%46 = phi i8* [ %43, %42 ], [ %40, %38 ]
%47 = getelementptr inbounds i8, i8* %46, i64 1
br label %48
48: ; preds = %42, %45
%49 = phi i8* [ %47, %45 ], [ %39, %42 ]
%50 = call i32 @strlen(i8* %49)
%51 = icmp ugt i32 %50, 255
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = call i64 @fclose(i32* %31)
%54 = call i64 @fclose(i32* %12)
%55 = load i32*, i32** @stderr
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %49)
br label %97
57: ; preds = %48
%58 = call i32 @strcpy(i8* %4, i8* %49)
br label %59
59: ; preds = %63, %57
%60 = phi i8* [ %4, %57 ], [ %64, %63 ]
%61 = load i8, i8* %60
switch i8 %61, label %63 [
i8 0, label %65
i8 47, label %62
i8 46, label %62
i8 92, label %62
i8 45, label %62
]
62: ; preds = %59, %59, %59, %59
store i8 95, i8* %60
br label %63
63: ; preds = %59, %62
%64 = getelementptr inbounds i8, i8* %60, i64 1
br label %59
65: ; preds = %59
%66 = load i32, i32* @SEEK_END
%67 = call i32 @fseek(i32* %31, i32 0, i32 %66)
%68 = call i32 @ftell(i32* %31)
%69 = load i32, i32* @SEEK_SET
%70 = call i32 @fseek(i32* %31, i32 0, i32 %69)
%71 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i64 20, i64 1, i32* %12)
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i8* %4, i32 %68)
%73 = call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i64 25, i64 1, i32* %12)
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i8* %4)
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i8* %4)
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i8* %4, i32 %68)
%77 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i64 19, i64 1, i32* %12)
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* %4)
%79 = load i8*, i8** %29
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0), i8* %79)
%81 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i64 6, i64 1, i32* %12)
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i8* %4, i32 %68)
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.21, i64 0, i64 0), i8* %4)
%84 = call i32 @hexdump(i32* %12, i32* %31)
%85 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0), i64 3, i64 1, i32* %12)
%86 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %12)
%87 = call i64 @fclose(i32* %31)
%88 = add nuw nsw i64 %28, 1
%89 = icmp eq i64 %88, %26
br i1 %89, label %90, label %27
90: ; preds = %65
%91 = call i64 @fclose(i32* %12)
%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** %10
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.23, i64 0, i64 0), i8* %95)
br label %97
97: ; preds = %90, %93, %52, %33, %14, %6
%98 = phi i32 [ 1, %6 ], [ 1, %52 ], [ 1, %33 ], [ 1, %93 ], [ 1, %14 ], [ 0, %90 ]
ret i32 %98
}