#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;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int read(int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  int i, cnt, pos, len;
  unsigned int cksum, val;
  unsigned char *lp;
  unsigned char buf[8192];
  char *varname;
  if (argc != 2) {
    fprintf(stderr, "usage: %s name <in-file >out-file\n", argv[0]);
    exit(1);
  }
  varname = strrchr(argv[1], '/');
  if (varname)
    varname++;
  else
    varname = argv[1];
  fprintf(stdout, "#\n");
  fprintf(stdout, "# Miscellaneous data structures:\n");
  fprintf(stdout, "# WARNING - this file is automatically generated!\n");
  fprintf(stdout, "#\n");
  fprintf(stdout, "\n");
  fprintf(stdout, "\t.data\n");
  fprintf(stdout, "\t.globl %s_data\n", varname);
  fprintf(stdout, "%s_data:\n", varname);
  pos = 0;
  cksum = 0;
  while ((len = read(0, buf, sizeof(buf))) > 0) {
    cnt = 0;
    lp = (unsigned char *)buf;
    len = (len + 3) & ~3;
    for (i = 0; i < len; i += 4) {
      if (cnt == 0) {
        fprintf(stdout, "\t.long\t");
      }
      fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
      val = *(unsigned long *)lp;
      cksum ^= val;
      lp += 4;
      if (++cnt == 4) {
        cnt = 0;
        fprintf(stdout, " # %x \n", pos + i - 12);
        fflush(stdout);
      } else {
        fprintf(stdout, ",");
      }
    }
    if (cnt) {
      fprintf(stdout, "0\n");
    }
    pos += len;
  }
  fprintf(stdout, "\t.globl %s_len\n", varname);
  fprintf(stdout, "%s_len:\t.long\t0x%x\n", varname, pos);
  fflush(stdout);
  fclose(stdout);
  fprintf(stderr, "cksum = %x\n", cksum);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ab <main+0x4b>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x2038(%rbp)
cmpq   $0x0,-0x2038(%rbp)
je     11e9 <main+0x89>
mov    -0x2038(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2038(%rbp)
jmp    11f8 <main+0x98>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x2038(%rbp)
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
lea    0xe12(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%rdx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%rdx
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x2030(%rbp),%rsi
xor    %edi,%edi
mov    $0x2000,%edx
call   1050 <read@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jle    1439 <main+0x2d9>
movl   $0x0,-0x18(%rbp)
lea    -0x2030(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    140a <main+0x2aa>
cmpl   $0x0,-0x18(%rbp)
jne    133d <main+0x1dd>
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
lea    0xd68(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c94(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
movzbl (%rax),%edx
mov    -0x30(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%r9d
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
xor    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x4,%eax
jne    13e0 <main+0x280>
movl   $0x0,-0x18(%rbp)
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
add    -0x14(%rbp),%edx
sub    $0xc,%edx
lea    0xcf3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    13f7 <main+0x297>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
lea    0xcd1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13fc <main+0x29c>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1310 <main+0x1b0>
cmpl   $0x0,-0x18(%rbp)
je     142b <main+0x2cb>
mov    0x2bbd(%rip),%rax
mov    (%rax),%edi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    12cc <main+0x16c>
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%rdx
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b7a(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xc65(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b59(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    0x2b4b(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xc43(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@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    $0x2018,%rsp
cmp    $0x2,%edi
jne    1360 <main+0x200>
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rbp
test   %rax,%rax
cmove  %rbx,%rbp
mov    0x2e3b(%rip),%r13
mov    0x0(%r13),%edi
lea    0xe7b(%rip),%rbx
xor    %r14d,%r14d
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe66(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe76(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe77(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe6d(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe69(%rip),%rsi
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0x10(%rsp),%rsi
xor    %edi,%edi
mov    $0x2000,%edx
call   1050 <read@plt>
mov    $0x0,%ebp
test   %eax,%eax
jle    1384 <main+0x224>
mov    %eax,%ebx
xor    %ebp,%ebp
xor    %r14d,%r14d
jmp    1292 <main+0x132>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%r14
add    %ebx,%r14d
xor    %edi,%edi
lea    0x10(%rsp),%rsi
mov    $0x2000,%edx
call   1050 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1384 <main+0x224>
add    $0x3,%ebx
and    $0xfffffffc,%ebx
je     1274 <main+0x114>
mov    %r14,(%rsp)
lea    -0xc(%r14),%r15d
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    1304 <main+0x1a4>
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
movzbl 0x10(%rsp,%r12,1),%edx
movzbl 0x11(%rsp,%r12,1),%ecx
movzbl 0x12(%rsp,%r12,1),%r8d
movzbl 0x13(%rsp,%r12,1),%r9d
lea    0xdd3(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    0x10(%rsp,%r12,1),%ebp
add    $0x1,%r14d
mov    0x0(%r13),%edi
cmp    $0x4,%r14d
je     1320 <main+0x1c0>
lea    0xdcd(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x4,%r12
cmp    %ebx,%r12d
jge    1340 <main+0x1e0>
test   %r14d,%r14d
jne    12b0 <main+0x150>
mov    0x0(%r13),%edi
lea    0xd8a(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    12b0 <main+0x150>
nopl   (%rax)
lea    (%r15,%r12,1),%edx
xor    %r14d,%r14d
lea    0xd8b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
call   1070 <fflush@plt>
jmp    12fb <main+0x19b>
test   %r14d,%r14d
je     1270 <main+0x110>
mov    0x0(%r13),%edi
lea    0xd6f(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1270 <main+0x110>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc8d(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x0(%r13),%edi
lea    0xd37(%rip),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xd2d(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
call   1070 <fflush@plt>
mov    0x0(%r13),%edi
call   1030 <fclose@plt>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
lea    0xd12(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s name <in-file >out-file\0A\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"#\0A\00"
@.str.2 = [34 x i8] c"# Miscellaneous data structures:\0A\00"
@.str.3 = [51 x i8] c"# WARNING - this file is automatically generated!\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"\09.data\0A\00"
@.str.6 = [17 x i8] c"\09.globl %s_data\0A\00"
@.str.7 = [10 x i8] c"%s_data:\0A\00"
@.str.8 = [8 x i8] c"\09.long\09\00"
@.str.9 = [19 x i8] c"0x%02X%02X%02X%02X\00"
@.str.10 = [8 x i8] c" # %x \0A\00"
@.str.11 = [2 x i8] c",\00"
@.str.12 = [3 x i8] c"0\0A\00"
@.str.13 = [16 x i8] c"\09.globl %s_len\0A\00"
@.str.14 = [20 x i8] c"%s_len:\09.long\090x%x\0A\00"
@.str.15 = [12 x i8] c"cksum = %x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i8* @strrchr(i8* dereferenceable(1) %13, i8 signext 47)
%15 = icmp eq i8* %14, null
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = select i1 %15, i8* %13, i8* %16
%18 = load i32, i32* @stdout
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @stdout
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* @stdout
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* @stdout
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* @stdout
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %17)
%32 = load i32, i32* @stdout
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %17)
%34 = call i32 @read(i32 0, i8* %4, i32 8192)
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %97
36: ; preds = %11, %92
%37 = phi i32 [ %95, %92 ], [ %34, %11 ]
%38 = phi i32 [ %93, %92 ], [ 0, %11 ]
%39 = phi i32 [ %94, %92 ], [ 0, %11 ]
%40 = add nuw nsw i32 %37, 3
%41 = and i32 %40, -4
%42 = icmp eq i32 %41, 0
br i1 %42, label %92, label %43
43: ; preds = %36
%44 = add i32 %39, -12
br label %45
45: ; preds = %43, %83
%46 = phi i8* [ %4, %43 ], [ %72, %83 ]
%47 = phi i32 [ 0, %43 ], [ %85, %83 ]
%48 = phi i32 [ %38, %43 ], [ %71, %83 ]
%49 = phi i32 [ 0, %43 ], [ %84, %83 ]
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = load i32, i32* @stdout
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %54
54: ; preds = %51, %45
%55 = load i32, i32* @stdout
%56 = load i8, i8* %46
%57 = zext i8 %56 to i32
%58 = getelementptr inbounds i8, i8* %46, i64 1
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %46, i64 2
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = getelementptr inbounds i8, i8* %46, i64 3
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %57, i32 %60, i32 %63, i32 %66)
%68 = bitcast i8* %46 to i64*
%69 = load i64, i64* %68
%70 = trunc i64 %69 to i32
%71 = xor i32 %48, %70
%72 = getelementptr inbounds i8, i8* %46, i64 4
%73 = add nsw i32 %49, 1
%74 = icmp eq i32 %73, 4
%75 = load i32, i32* @stdout
br i1 %74, label %76, label %81
76: ; preds = %54
%77 = add i32 %44, %47
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %77)
%79 = load i32, i32* @stdout
%80 = tail call i32 @fflush(i32 %79)
br label %83
81: ; preds = %54
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %83
83: ; preds = %76, %81
%84 = phi i32 [ 0, %76 ], [ %73, %81 ]
%85 = add nuw nsw i32 %47, 4
%86 = icmp slt i32 %85, %41
br i1 %86, label %45, label %87
87: ; preds = %83
%88 = icmp eq i32 %84, 0
br i1 %88, label %92, label %89
89: ; preds = %87
%90 = load i32, i32* @stdout
%91 = tail call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %92
92: ; preds = %36, %89, %87
%93 = phi i32 [ %71, %89 ], [ %71, %87 ], [ %38, %36 ]
%94 = add nsw i32 %41, %39
%95 = call i32 @read(i32 0, i8* %4, i32 8192)
%96 = icmp sgt i32 %95, 0
br i1 %96, label %36, label %97
97: ; preds = %92, %11
%98 = phi i32 [ 0, %11 ], [ %94, %92 ]
%99 = phi i32 [ 0, %11 ], [ %93, %92 ]
%100 = load i32, i32* @stdout
%101 = tail call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* %17)
%102 = load i32, i32* @stdout
%103 = tail call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8* %17, i32 %98)
%104 = load i32, i32* @stdout
%105 = tail call i32 @fflush(i32 %104)
%106 = load i32, i32* @stdout
%107 = tail call i32 @fclose(i32 %106)
%108 = load i32, i32* @stderr
%109 = tail call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 %99)
%110 = tail call i32 @exit(i32 0)
unreachable
}