#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
main(int argc, char *argv[]) {
  FILE *out, *in;
  int i, cnt, pos;
  unsigned char *lp;
  unsigned char buf[4096];
  if (argc != 3) {
    fprintf(stderr, "usage: %s <in-file> <out-file>\n", argv[0]);
    exit(1);
  }
  if ((out = fopen(argv[2], "w")) == (FILE *)0) {
    fprintf(stderr, "Can't create '%s'\n", argv[2]);
    exit(1);
  }
  if ((in = fopen(argv[1], "r")) == (FILE *)0) {
    fprintf(stderr, "Can't open '%s'\n", argv[1]);
    exit(1);
  }
  fprintf(out, "#\n");
  fprintf(out, "# Miscellaneous data structures:\n");
  fprintf(out, "# WARNING - this file is automatically generated!\n");
  fprintf(out, "#\n");
  fprintf(out, "\n");
  fprintf(out, "\t.data\n");
  fprintf(out, "\t.globl builtin_ramdisk_image\n");
  fprintf(out, "builtin_ramdisk_image:\n");
  pos = 0;
  while (fread(buf, sizeof(buf), 1, in) == 1) {
    cnt = 0;
    lp = (unsigned char *)buf;
    for (i = 0; i < sizeof(buf); i += 4) {
      if (cnt == 0) {
        fprintf(out, "\t.long\t");
      }
      fprintf(out, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
      lp += 4;
      if (++cnt == 4) {
        cnt = 0;
        fprintf(out, " # %x \n", pos + i - 12);
        fflush(out);
      } else {
        fprintf(out, ",");
      }
    }
    pos += sizeof(buf);
  }
  fprintf(out, "\t.globl builtin_ramdisk_size\n");
  fprintf(out, "builtin_ramdisk_size:\t.long\t0x%x\n", pos);
  fflush(out);
  fclose(out);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ac <main+0x4c>
mov    0x2e56(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe65(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe65(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11f8 <main+0x98>
mov    0x2e0b(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1244 <main+0xe4>
mov    0x2dbf(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    0xdf9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdfa(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdfa(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x2c(%rbp)
lea    -0x1040(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1000,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    13fb <main+0x29b>
movl   $0x0,-0x28(%rbp)
lea    -0x1040(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x1000,%rax
jae    13e9 <main+0x289>
cmpl   $0x0,-0x28(%rbp)
jne    1343 <main+0x1e3>
mov    -0x18(%rbp),%rdi
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rax
movzbl (%rax),%edx
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x38(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x38(%rbp),%rax
movzbl 0x3(%rax),%r9d
lea    0xd78(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmp    $0x4,%eax
jne    13c4 <main+0x264>
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    -0x24(%rbp),%edx
sub    $0xc,%edx
lea    0xd4b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fflush@plt>
jmp    13d6 <main+0x276>
mov    -0x18(%rbp),%rdi
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    13db <main+0x27b>
mov    -0x24(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x24(%rbp)
jmp    1317 <main+0x1b7>
movslq -0x2c(%rbp),%rax
add    $0x1000,%rax
mov    %eax,-0x2c(%rbp)
jmp    12db <main+0x17b>
mov    -0x18(%rbp),%rdi
lea    0xcfe(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xd07(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fflush@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    11c5 <main+0x45>
mov    0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    11eb <main+0x6b>
mov    0x2e2b(%rip),%rax
movslq (%rax),%rdi
mov    0x10(%rbp),%rdx
lea    0xe5f(%rip),%rsi
jmp    11da <main+0x5a>
mov    0x2e14(%rip),%rax
movslq (%rax),%rdi
mov    0x0(%rbp),%rdx
lea    0xe26(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    %rax,%rbx
mov    0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    121a <main+0x9a>
mov    0x2dd6(%rip),%rax
movslq (%rax),%rdi
mov    0x8(%rbp),%rdx
lea    0xe1f(%rip),%rsi
jmp    11da <main+0x5a>
mov    %rax,%r15
lea    0xe24(%rip),%rbp
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0xe0b(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0xe14(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xe0c(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0xdfb(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0xe01(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0x10(%rsp),%rdi
mov    $0x1000,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
xor    %ebp,%ebp
cmp    $0x1,%eax
jne    13f2 <main+0x272>
mov    $0xfffff000,%ecx
lea    0xde1(%rip),%r14
xor    %ebp,%ebp
mov    %r15,0x8(%rsp)
jmp    1342 <main+0x1c2>
nop
add    $0x1000,%ebp
lea    0x10(%rsp),%rdi
mov    $0x1000,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%rcx
call   1030 <fread@plt>
mov    0x4(%rsp),%ecx
add    $0x1000,%ecx
cmp    $0x1,%eax
jne    13f2 <main+0x272>
mov    %ecx,0x4(%rsp)
mov    %ecx,%r15d
add    $0xff4,%r15
xor    %r13d,%r13d
xor    %r12d,%r12d
jmp    13af <main+0x22f>
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%r13,1),%edx
movzbl 0x11(%rsp,%r13,1),%ecx
movzbl 0x12(%rsp,%r13,1),%r8d
movzbl 0x13(%rsp,%r13,1),%r9d
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%r12d
cmp    $0x4,%r12d
je     13d0 <main+0x250>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
add    $0x4,%r13
lea    -0x4(%r13),%eax
cmp    $0xffc,%eax
jae    1310 <main+0x190>
test   %r12d,%r12d
jne    1360 <main+0x1e0>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xd1a(%rip),%rdi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
jmp    1360 <main+0x1e0>
nop
lea    (%r15,%r13,1),%edx
xor    %r12d,%r12d
mov    %rbx,%rdi
lea    0xd19(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1070 <fflush@plt>
jmp    139c <main+0x21c>
lea    0xd09(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
lea    0xd0e(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1070 <fflush@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: %s <in-file> <out-file>\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [19 x i8] c"Can't create '%s'\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [17 x i8] c"Can't open '%s'\0A\00"
@.str.5 = [3 x i8] c"#\0A\00"
@.str.6 = [34 x i8] c"# Miscellaneous data structures:\0A\00"
@.str.7 = [51 x i8] c"# WARNING - this file is automatically generated!\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [8 x i8] c"\09.data\0A\00"
@.str.10 = [31 x i8] c"\09.globl builtin_ramdisk_image\0A\00"
@.str.11 = [24 x i8] c"builtin_ramdisk_image:\0A\00"
@.str.12 = [8 x i8] c"\09.long\09\00"
@.str.13 = [19 x i8] c"0x%02X%02X%02X%02X\00"
@.str.14 = [8 x i8] c" # %x \0A\00"
@.str.15 = [2 x i8] c",\00"
@.str.16 = [30 x i8] c"\09.globl builtin_ramdisk_size\0A\00"
@.str.17 = [34 x i8] c"builtin_ramdisk_size:\09.long\090x%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca [4096 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %24
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %28, i32** %6
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %39
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 2
%36 = load i8*, i8** %35
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %24
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %43, i32** %7
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %54
45: ; preds = %39
%46 = load i32, i32* @stderr
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i32*
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %39
%55 = load i32*, i32** %6
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%57 = load i32*, i32** %6
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
%59 = load i32*, i32** %6
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%61 = load i32*, i32** %6
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32*, i32** %6
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%65 = load i32*, i32** %6
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%67 = load i32*, i32** %6
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
%69 = load i32*, i32** %6
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %10
br label %71
71: ; preds = %128, %54
%72 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%73 = load i32*, i32** %7
%74 = call i32 @fread(i8* %72, i32 4096, i32 1, i32* %73)
%75 = icmp eq i32 %74, 1
br i1 %75, label %76, label %133
76: ; preds = %71
store i32 0, i32* %9
%77 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
store i8* %77, i8** %11
store i32 0, i32* %8
br label %78
78: ; preds = %125, %76
%79 = load i32, i32* %8
%80 = sext i32 %79 to i64
%81 = icmp ult i64 %80, 4096
br i1 %81, label %82, label %128
82: ; preds = %78
%83 = load i32, i32* %9
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32*, i32** %6
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
br label %88
88: ; preds = %85, %82
%89 = load i32*, i32** %6
%90 = load i8*, i8** %11
%91 = getelementptr inbounds i8, i8* %90, i64 0
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = load i8*, i8** %11
%95 = getelementptr inbounds i8, i8* %94, i64 1
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = load i8*, i8** %11
%99 = getelementptr inbounds i8, i8* %98, i64 2
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = load i8*, i8** %11
%103 = getelementptr inbounds i8, i8* %102, i64 3
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %93, i32 %97, i32 %101, i32 %105)
%107 = load i8*, i8** %11
%108 = getelementptr inbounds i8, i8* %107, i64 4
store i8* %108, i8** %11
%109 = load i32, i32* %9
%110 = add nsw i32 %109, 1
store i32 %110, i32* %9
%111 = icmp eq i32 %110, 4
br i1 %111, label %112, label %121
112: ; preds = %88
store i32 0, i32* %9
%113 = load i32*, i32** %6
%114 = load i32, i32* %10
%115 = load i32, i32* %8
%116 = add nsw i32 %114, %115
%117 = sub nsw i32 %116, 12
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %117)
%119 = load i32*, i32** %6
%120 = call i32 @fflush(i32* %119)
br label %124
121: ; preds = %88
%122 = load i32*, i32** %6
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
br label %124
124: ; preds = %121, %112
br label %125
125: ; preds = %124
%126 = load i32, i32* %8
%127 = add nsw i32 %126, 4
store i32 %127, i32* %8
br label %78
128: ; preds = %78
%129 = load i32, i32* %10
%130 = sext i32 %129 to i64
%131 = add i64 %130, 4096
%132 = trunc i64 %131 to i32
store i32 %132, i32* %10
br label %71
133: ; preds = %71
%134 = load i32*, i32** %6
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
%136 = load i32*, i32** %6
%137 = load i32, i32* %10
%138 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0), i32 %137)
%139 = load i32*, i32** %6
%140 = call i32 @fflush(i32* %139)
%141 = load i32*, i32** %6
%142 = call i32 @fclose(i32* %141)
%143 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: %s <in-file> <out-file>\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [19 x i8] c"Can't create '%s'\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [17 x i8] c"Can't open '%s'\0A\00"
@.str.5 = [3 x i8] c"#\0A\00"
@.str.6 = [34 x i8] c"# Miscellaneous data structures:\0A\00"
@.str.7 = [51 x i8] c"# WARNING - this file is automatically generated!\0A\00"
@.str.9 = [8 x i8] c"\09.data\0A\00"
@.str.10 = [31 x i8] c"\09.globl builtin_ramdisk_image\0A\00"
@.str.11 = [24 x i8] c"builtin_ramdisk_image:\0A\00"
@.str.12 = [8 x i8] c"\09.long\09\00"
@.str.13 = [19 x i8] c"0x%02X%02X%02X%02X\00"
@.str.14 = [8 x i8] c" # %x \0A\00"
@.str.16 = [30 x i8] c"\09.globl builtin_ramdisk_size\0A\00"
@.str.17 = [34 x i8] c"builtin_ramdisk_size:\09.long\090x%x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load i8*, i8** %1
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i32, i32* @stderr
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load i8*, i8** %14
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %13
%26 = getelementptr inbounds i8*, i8** %1, i64 1
%27 = load i8*, i8** %26
%28 = tail call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %37
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = load i8*, i8** %26
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %34)
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %25
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %16)
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i64 33, i64 1, i32* %16)
%40 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0), i64 50, i64 1, i32* %16)
%41 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %16)
%42 = tail call i32 @fputc(i32 10, i32* %16)
%43 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i64 7, i64 1, i32* %16)
%44 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i64 30, i64 1, i32* %16)
%45 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i64 23, i64 1, i32* %16)
%46 = call i32 @fread(i8* %4, i32 4096, i32 1, i32* %28)
%47 = icmp eq i32 %46, 1
br i1 %47, label %48, label %88
48: ; preds = %37, %84
%49 = phi i32 [ %85, %84 ], [ 0, %37 ]
%50 = add i32 %49, -12
br label %51
51: ; preds = %48, %80
%52 = phi i8* [ %4, %48 ], [ %71, %80 ]
%53 = phi i32 [ 0, %48 ], [ %81, %80 ]
%54 = phi i32 [ 0, %48 ], [ %82, %80 ]
%55 = icmp eq i32 %53, 0
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i64 7, i64 1, i32* %16)
br label %58
58: ; preds = %56, %51
%59 = load i8, i8* %52
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %52, i64 1
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = getelementptr inbounds i8, i8* %52, i64 2
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = getelementptr inbounds i8, i8* %52, i64 3
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %60, i32 %63, i32 %66, i32 %69)
%71 = getelementptr inbounds i8, i8* %52, i64 4
%72 = add nsw i32 %53, 1
%73 = icmp eq i32 %72, 4
br i1 %73, label %74, label %78
74: ; preds = %58
%75 = add i32 %50, %54
%76 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %75)
%77 = tail call i32 @fflush(i32* %16)
br label %80
78: ; preds = %58
%79 = tail call i32 @fputc(i32 44, i32* %16)
br label %80
80: ; preds = %74, %78
%81 = phi i32 [ 0, %74 ], [ %72, %78 ]
%82 = add nuw nsw i32 %54, 4
%83 = icmp ult i32 %54, 4092
br i1 %83, label %51, label %84
84: ; preds = %80
%85 = add i32 %49, 4096
%86 = call i32 @fread(i8* %4, i32 4096, i32 1, i32* %28)
%87 = icmp eq i32 %86, 1
br i1 %87, label %48, label %88
88: ; preds = %84, %37
%89 = phi i32 [ 0, %37 ], [ %85, %84 ]
%90 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i64 29, i64 1, i32* %16)
%91 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0), i32 %89)
%92 = tail call i32 @fflush(i32* %16)
%93 = tail call i32 @fclose(i32* %16)
%94 = tail call i32 @exit(i32 0)
unreachable
}