#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;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int /*<<< orphan*/ printusage();
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  const char *type = "AG_FONT_VECTOR";
  const char *outfile, *fontname = "myFont", *infile;
  extern char *optarg;
  extern int optind;
  int c, cnt;
  FILE *f, *fin;
  long i, size;
  int append = 0;
  while ((c = getopt(argc, argv, "?abvo:n:")) != -1) {
    switch (c) {
    case 'a':
      append = 1;
      break;
    case 'b':
      type = "AG_FONT_BITMAP";
      break;
    case 'v':
      type = "AG_FONT_VECTOR";
      break;
    case 'o':
      outfile = optarg;
      break;
    case 'n':
      fontname = optarg;
      break;
    case '?':
    case 'h':
    default:
      printusage();
      exit(1);
    }
  }
  if (optind == argc) {
    printusage();
    exit(1);
  }
  infile = argv[optind];
  if (outfile == NULL) {
    printusage();
    exit(1);
  }
  if ((fin = fopen(infile, "r")) == NULL) {
    fprintf(stderr, "%s: %s\n", infile, strerror(errno));
    exit(1);
  }
  if ((f = fopen(outfile, append ? "a" : "w")) == NULL) {
    fprintf(stderr, "%s: %s\n", outfile, strerror(errno));
    fclose(fin);
    exit(1);
  }
  fseek(fin, 0, SEEK_END);
  size = ftell(fin);
  fseek(fin, 0, SEEK_SET);
  fprintf(f, "/* File generated by bundlefont */\n");
  fprintf(f, "const Uint8 %s_Data[%ld] = {\n", fontname, size);
  for (i = 0, cnt = 0; i < size; i++) {
    unsigned char d;
    fread(&d, 1, 1, fin);
    fprintf(f, "%d,", d);
    if (++cnt > 10000) {
      fprintf(f, "\n");
      cnt = 0;
    }
  }
  fprintf(f, "};\n");
  fprintf(f, "AG_StaticFont %s = {\n", fontname);
  fprintf(f, "\"%s\",\n", fontname);
  fprintf(f, "%s,\n", type);
  fprintf(f, "%ld,\n", size);
  fprintf(f, "%s_Data,\n", fontname);
  fprintf(f, "};\n");
  fclose(f);
  fclose(fin);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xf20(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xf24(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xf12(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     128b <main+0xeb>
mov    -0x34(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0x37,%eax
ja     1275 <main+0xd5>
mov    -0x68(%rbp),%rax
lea    0xdeb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x5c(%rbp)
jmp    1286 <main+0xe6>
lea    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1286 <main+0xe6>
lea    0xe9f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1286 <main+0xe6>
mov    0x2d87(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1286 <main+0xe6>
mov    0x2d74(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1286 <main+0xe6>
jmp    1275 <main+0xd5>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    11d6 <main+0x36>
mov    0x2d26(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    12ae <main+0x10e>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2cff(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12e0 <main+0x140>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x30(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    1345 <main+0x1a5>
mov    0x2ccb(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x78(%rbp),%rdi
mov    -0x70(%rbp),%rdx
mov    %rax,%rcx
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x5c(%rbp),%ecx
lea    0xdc7(%rip),%rsi
lea    0xdbe(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1090 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    13ca <main+0x22a>
mov    0x2c55(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x2c34(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%rdx
mov    %rax,%rcx
lea    0xd60(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x48(%rbp),%rdi
mov    0x2c13(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x48(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
mov    0x2bca(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x40(%rbp),%rdi
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x58(%rbp),%rcx
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movq   $0x0,-0x50(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x58(%rbp),%rax
jge    14b5 <main+0x315>
mov    -0x48(%rbp),%rcx
lea    -0x5d(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x40(%rbp),%rdi
movzbl -0x5d(%rbp),%edx
lea    0xcf3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmp    $0x2710,%eax
jle    149f <main+0x2ff>
mov    -0x40(%rbp),%rdi
lea    0xcf0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
jmp    14a4 <main+0x304>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    143a <main+0x29a>
mov    -0x40(%rbp),%rdi
lea    0xca2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xc81(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xc70(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xc60(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
lea    0xc22(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
lea    0xe78(%rip),%rcx
lea    0xe80(%rip),%r15
lea    0xe80(%rip),%r12
lea    0xe0f(%rip),%r13
mov    %rcx,0x18(%rsp)
mov    %ebx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r12,%rdx
call   10b0 <getopt@plt>
mov    $0x1,%ecx
cmp    $0x61,%eax
je     1200 <main+0x40>
lea    -0x62(%rax),%ecx
cmp    $0x14,%ecx
ja     1264 <main+0xa4>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
lea    0xe41(%rip),%rax
mov    %rax,0x18(%rsp)
jmp    11f6 <main+0x36>
mov    0x2d98(%rip),%rax
mov    (%rax),%r15
jmp    11f6 <main+0x36>
mov    0x2d8c(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
jmp    11f6 <main+0x36>
lea    0xdf7(%rip),%rax
mov    %rax,0x18(%rsp)
jmp    11f6 <main+0x36>
cmp    $0xffffffff,%eax
jne    146f <main+0x2af>
mov    0x2d44(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
je     146f <main+0x2af>
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
je     146f <main+0x2af>
mov    (%r14,%rax,8),%r14
lea    0xdea(%rip),%rsi
mov    %r14,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1480 <main+0x2c0>
mov    %rax,%r12
test   %ebx,%ebx
lea    0xdd9(%rip),%rax
lea    0xdd0(%rip),%rsi
cmove  %rax,%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     14b9 <main+0x2f9>
mov    %rax,%rbx
mov    0x2d0d(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r12,%rdi
call   1080 <ftell@plt>
mov    %rax,%rbp
mov    0x2cc7(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
lea    0xd84(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xd8f(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,0x20(%rsp)
mov    %r15,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,0x10(%rsp)
test   %rbp,%rbp
jle    13b0 <main+0x1f0>
lea    0xf(%rsp),%rbp
lea    0xd82(%rip),%r14
mov    0x10(%rsp),%r13
xor    %r15d,%r15d
jmp    136a <main+0x1aa>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
add    $0xffffffffffffffff,%r13
je     13b0 <main+0x1f0>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fread@plt>
movzbl 0xf(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
cmp    $0x2710,%r15d
jl     1360 <main+0x1a0>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
xor    %r15d,%r15d
add    $0xffffffffffffffff,%r13
jne    136a <main+0x1aa>
lea    0xd1f(%rip),%r14
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xd07(%rip),%rsi
mov    %rbx,%rdi
mov    0x20(%rsp),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd04(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xcf7(%rip),%rsi
mov    %rbx,%rdi
mov    0x18(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xce6(%rip),%rsi
mov    %rbx,%rdi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xcd6(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2b49(%rip),%rax
movslq (%rax),%rbx
mov    0x2b37(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xbe5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2b10(%rip),%rax
movslq (%rax),%rbx
mov    0x2afe(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xbac(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"AG_FONT_VECTOR\00"
@.str.1 = [7 x i8] c"myFont\00"
@.str.2 = [9 x i8] c"?abvo:n:\00"
@.str.3 = [15 x i8] c"AG_FONT_BITMAP\00"
@optarg = external global i8*
@optind = external global i32
@.str.4 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.5 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [2 x i8] c"w\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.8 = [36 x i8] c"/* File generated by bundlefont */\0A\00"
@.str.9 = [30 x i8] c"const Uint8 %s_Data[%ld] = {\0A\00"
@.str.10 = [4 x i8] c"%d,\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [4 x i8] c"};\0A\00"
@.str.13 = [22 x i8] c"AG_StaticFont %s = {\0A\00"
@.str.14 = [7 x i8] c"\22%s\22,\0A\00"
@.str.15 = [5 x i8] c"%s,\0A\00"
@.str.16 = [6 x i8] c"%ld,\0A\00"
@.str.17 = [10 x i8] c"%s_Data,\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i32 0, i32* %16
br label %18
18: ; preds = %36, %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt(i32 %19, i8** %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 %21, i32* %10
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %37
23: ; preds = %18
%24 = load i32, i32* %10
switch i32 %24, label %33 [
i32 97, label %25
i32 98, label %26
i32 118, label %27
i32 111, label %28
i32 110, label %30
i32 63, label %32
i32 104, label %32
]
25: ; preds = %23
store i32 1, i32* %16
br label %36
26: ; preds = %23
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %36
27: ; preds = %23
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %6
br label %36
28: ; preds = %23
%29 = load i8*, i8** @optarg
store i8* %29, i8** %7
br label %36
30: ; preds = %23
%31 = load i8*, i8** @optarg
store i8* %31, i8** %8
br label %36
32: ; preds = %23, %23
br label %33
33: ; preds = %23, %32
%34 = call i32 (...) @printusage()
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %30, %28, %27, %26, %25
br label %18
37: ; preds = %18
%38 = load i32, i32* @optind
%39 = load i32, i32* %4
%40 = icmp eq i32 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = call i32 (...) @printusage()
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %37
%45 = load i8**, i8*** %5
%46 = load i32, i32* @optind
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
store i8* %49, i8** %9
%50 = load i8*, i8** %7
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %55
52: ; preds = %44
%53 = call i32 (...) @printusage()
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %44
%56 = load i8*, i8** %9
%57 = call i32* @fopen(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %57, i32** %13
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %68
59: ; preds = %55
%60 = load i32, i32* @stderr
%61 = sext i32 %60 to i64
%62 = inttoptr i64 %61 to i32*
%63 = load i8*, i8** %9
%64 = load i32, i32* @errno
%65 = call i8* @strerror(i32 %64)
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %63, i8* %65)
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %55
%69 = load i8*, i8** %7
%70 = load i32, i32* %16
%71 = icmp ne i32 %70, 0
%72 = zext i1 %71 to i64
%73 = select i1 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
%74 = call i32* @fopen(i8* %69, i8* %73)
store i32* %74, i32** %12
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %87
76: ; preds = %68
%77 = load i32, i32* @stderr
%78 = sext i32 %77 to i64
%79 = inttoptr i64 %78 to i32*
%80 = load i8*, i8** %7
%81 = load i32, i32* @errno
%82 = call i8* @strerror(i32 %81)
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %80, i8* %82)
%84 = load i32*, i32** %13
%85 = call i32 @fclose(i32* %84)
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %68
%88 = load i32*, i32** %13
%89 = load i32, i32* @SEEK_END
%90 = call i32 @fseek(i32* %88, i32 0, i32 %89)
%91 = load i32*, i32** %13
%92 = call i64 @ftell(i32* %91)
store i64 %92, i64* %15
%93 = load i32*, i32** %13
%94 = load i32, i32* @SEEK_SET
%95 = call i32 @fseek(i32* %93, i32 0, i32 %94)
%96 = load i32*, i32** %12
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%98 = load i32*, i32** %12
%99 = load i8*, i8** %8
%100 = load i64, i64* %15
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* %99, i64 %100)
store i64 0, i64* %14
store i32 0, i32* %11
br label %102
102: ; preds = %120, %87
%103 = load i64, i64* %14
%104 = load i64, i64* %15
%105 = icmp slt i64 %103, %104
br i1 %105, label %106, label %123
106: ; preds = %102
%107 = load i32*, i32** %13
%108 = call i32 @fread(i8* %17, i32 1, i32 1, i32* %107)
%109 = load i32*, i32** %12
%110 = load i8, i8* %17
%111 = zext i8 %110 to i32
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %111)
%113 = load i32, i32* %11
%114 = add nsw i32 %113, 1
store i32 %114, i32* %11
%115 = icmp sgt i32 %114, 10000
br i1 %115, label %116, label %119
116: ; preds = %106
%117 = load i32*, i32** %12
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %11
br label %119
119: ; preds = %116, %106
br label %120
120: ; preds = %119
%121 = load i64, i64* %14
%122 = add nsw i64 %121, 1
store i64 %122, i64* %14
br label %102
123: ; preds = %102
%124 = load i32*, i32** %12
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%126 = load i32*, i32** %12
%127 = load i8*, i8** %8
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8* %127)
%129 = load i32*, i32** %12
%130 = load i8*, i8** %8
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %129, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* %130)
%132 = load i32*, i32** %12
%133 = load i8*, i8** %6
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %133)
%135 = load i32*, i32** %12
%136 = load i64, i64* %15
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i64 %136)
%138 = load i32*, i32** %12
%139 = load i8*, i8** %8
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %139)
%141 = load i32*, i32** %12
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%143 = load i32*, i32** %12
%144 = call i32 @fclose(i32* %143)
%145 = load i32*, i32** %13
%146 = call i32 @fclose(i32* %145)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"AG_FONT_VECTOR\00"
@.str.1 = [7 x i8] c"myFont\00"
@.str.2 = [9 x i8] c"?abvo:n:\00"
@.str.3 = [15 x i8] c"AG_FONT_BITMAP\00"
@optarg = external global i8*
@optind = external global i32
@.str.4 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.5 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [2 x i8] c"w\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.8 = [36 x i8] c"/* File generated by bundlefont */\0A\00"
@.str.9 = [30 x i8] c"const Uint8 %s_Data[%ld] = {\0A\00"
@.str.10 = [4 x i8] c"%d,\00"
@.str.12 = [4 x i8] c"};\0A\00"
@.str.13 = [22 x i8] c"AG_StaticFont %s = {\0A\00"
@.str.14 = [7 x i8] c"\22%s\22,\0A\00"
@.str.15 = [5 x i8] c"%s,\0A\00"
@.str.16 = [6 x i8] c"%ld,\0A\00"
@.str.17 = [10 x i8] c"%s_Data,\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8
br label %4
4: ; preds = %24, %2
%5 = phi i8* [ %25, %24 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ]
%6 = phi i8* [ %10, %24 ], [ undef, %2 ]
%7 = phi i8* [ %14, %24 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %2 ]
%8 = phi i32 [ %17, %24 ], [ 0, %2 ]
br label %9
9: ; preds = %4, %22
%10 = phi i8* [ %6, %4 ], [ %23, %22 ]
%11 = phi i8* [ %7, %4 ], [ %14, %22 ]
%12 = phi i32 [ %8, %4 ], [ %17, %22 ]
br label %13
13: ; preds = %20, %9
%14 = phi i8* [ %11, %9 ], [ %21, %20 ]
%15 = phi i32 [ %12, %9 ], [ %17, %20 ]
br label %16
16: ; preds = %13, %16
%17 = phi i32 [ 1, %16 ], [ %15, %13 ]
%18 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
switch i32 %18, label %26 [
i32 -1, label %29
i32 97, label %16
i32 98, label %20
i32 118, label %19
i32 111, label %22
i32 110, label %24
]
19: ; preds = %16
br label %20
20: ; preds = %16, %19
%21 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %19 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %16 ]
br label %13
22: ; preds = %16
%23 = load i8*, i8** @optarg
br label %9
24: ; preds = %16
%25 = load i8*, i8** @optarg
br label %4
26: ; preds = %16
%27 = tail call i32 (...) @printusage()
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %16
%30 = load i32, i32* @optind
%31 = icmp eq i32 %30, %0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = tail call i32 (...) @printusage()
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %29
%36 = sext i32 %30 to i64
%37 = getelementptr inbounds i8*, i8** %1, i64 %36
%38 = load i8*, i8** %37
%39 = icmp eq i8* %10, null
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = tail call i32 (...) @printusage()
%42 = tail call i32 @exit(i32 1)
unreachable
43: ; preds = %35
%44 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load i32, i32* @stderr
%48 = sext i32 %47 to i64
%49 = inttoptr i64 %48 to i32*
%50 = load i32, i32* @errno
%51 = tail call i8* @strerror(i32 %50)
%52 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %38, i8* %51)
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %43
%55 = icmp eq i32 %17, 0
%56 = select i1 %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%57 = tail call i32* @fopen(i8* %10, i8* %56)
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %68
59: ; preds = %54
%60 = load i32, i32* @stderr
%61 = sext i32 %60 to i64
%62 = inttoptr i64 %61 to i32*
%63 = load i32, i32* @errno
%64 = tail call i8* @strerror(i32 %63)
%65 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %10, i8* %64)
%66 = tail call i32 @fclose(i32* %44)
%67 = tail call i32 @exit(i32 1)
unreachable
68: ; preds = %54
%69 = load i32, i32* @SEEK_END
%70 = tail call i32 @fseek(i32* %44, i32 0, i32 %69)
%71 = tail call i64 @ftell(i32* %44)
%72 = load i32, i32* @SEEK_SET
%73 = tail call i32 @fseek(i32* %44, i32 0, i32 %72)
%74 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i64 35, i64 1, i32* %57)
%75 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* %5, i64 %71)
%76 = icmp sgt i64 %71, 0
br i1 %76, label %77, label %92
77: ; preds = %68, %88
%78 = phi i64 [ %90, %88 ], [ 0, %68 ]
%79 = phi i32 [ %89, %88 ], [ 0, %68 ]
%80 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %44)
%81 = load i8, i8* %3
%82 = zext i8 %81 to i32
%83 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %82)
%84 = add nsw i32 %79, 1
%85 = icmp sgt i32 %79, 9999
br i1 %85, label %86, label %88
86: ; preds = %77
%87 = tail call i32 @fputc(i32 10, i32* %57)
br label %88
88: ; preds = %86, %77
%89 = phi i32 [ 0, %86 ], [ %84, %77 ]
%90 = add nuw nsw i64 %78, 1
%91 = icmp eq i64 %90, %71
br i1 %91, label %92, label %77
92: ; preds = %88, %68
%93 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 3, i64 1, i32* %57)
%94 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8* %5)
%95 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* %5)
%96 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %14)
%97 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i64 %71)
%98 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %5)
%99 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 3, i64 1, i32* %57)
%100 = tail call i32 @fclose(i32* %57)
%101 = tail call i32 @fclose(i32* %44)
ret i32 0
}