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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t fread(int *, int, int, int /*<<< orphan*/ *);
int fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int ftello(int /*<<< orphan*/ *);
int fwrite(int *, int, int, int /*<<< orphan*/);
int getopt(int, char **, char *);
int htobe32(int);
int le32toh(int);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int strtoul(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  FILE *input;
  int opt;
  off_t pos;
  size_t size;
  uint32_t addr = 0x40200000;
  uint32_t temp;
  while ((opt = getopt(argc, argv, "a:")) != -1) {
    switch (opt) {
    case 'a':
      addr = strtoul(optarg, NULL, 0);
      break;
    }
  }
  if (optind >= argc) {
    usage(argv[0]);
    exit(1);
  }
  input = fopen(argv[optind], "r");
  if (input == NULL) {
    perror("fopen");
    exit(EXIT_FAILURE);
  }
  if (fseeko(input, 0, SEEK_END) == -1) {
    perror("fseeko");
    exit(EXIT_FAILURE);
  }
  pos = ftello(input);
  if (pos == -1) {
    perror("ftello");
    exit(EXIT_FAILURE);
  }
  if (pos > 0x100000) {
    fprintf(stderr, "error: image should be smaller than 1 MiB\n");
    exit(EXIT_FAILURE);
  }
  if (fseeko(input, 0, SEEK_SET) == -1) {
    perror("fseeko");
    exit(EXIT_FAILURE);
  }
  pos = (pos + 3) & ~3;
  temp = htobe32((uint32_t)pos);
  fwrite(&temp, sizeof(uint32_t), 1, stdout);
  temp = htobe32(addr);
  fwrite(&temp, sizeof(uint32_t), 1, stdout);
  for (;;) {
    size = fread(&temp, 1, sizeof(uint32_t), input);
    if (!size)
      break;
    if (size < 4 && !feof(input)) {
      perror("fread");
      exit(EXIT_FAILURE);
    }
    temp = htobe32(le32toh(temp));
    if (fwrite(&temp, 1, sizeof(uint32_t), stdout) != 4) {
      perror("fwrite");
      exit(EXIT_FAILURE);
    }
  }
  if (fclose(input) != 0) {
    perror("fclose");
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x40200000,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xde5(%rip),%rdx
call   10e0 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1259 <main+0x69>
mov    -0x1c(%rbp),%eax
sub    $0x61,%eax
jne    1254 <main+0x64>
jmp    123d <main+0x4d>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10f0 <strtoul@plt>
mov    %eax,-0x2c(%rbp)
jmp    120d <main+0x1d>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     1281 <main+0x91>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2d4c(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd69(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12c8 <main+0xd8>
lea    0xd50(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d0d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseeko@plt>
cmp    $0xffffffff,%eax
jne    12ff <main+0x10f>
lea    0xd1f(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ftello@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    132f <main+0x13f>
lea    0xcf6(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c90(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
cmpl   $0x100000,-0x20(%rbp)
jle    135f <main+0x16f>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
lea    0xccd(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2c56(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseeko@plt>
cmp    $0xffffffff,%eax
jne    1396 <main+0x1a6>
lea    0xc88(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c29(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1090 <htobe32@plt>
mov    %eax,-0x30(%rbp)
mov    0x2bfc(%rip),%rax
mov    (%rax),%ecx
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
mov    -0x2c(%rbp),%edi
call   1090 <htobe32@plt>
mov    %eax,-0x30(%rbp)
mov    0x2bd5(%rip),%rax
mov    (%rax),%ecx
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
mov    -0x18(%rbp),%rcx
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    141b <main+0x22b>
jmp    14a8 <main+0x2b8>
cmpq   $0x4,-0x28(%rbp)
jae    1452 <main+0x262>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
jne    1452 <main+0x262>
lea    0xc05(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2b6d(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x30(%rbp),%edi
call   1030 <le32toh@plt>
mov    %eax,%edi
call   1090 <htobe32@plt>
mov    %eax,-0x30(%rbp)
mov    0x2b45(%rip),%rax
mov    (%rax),%ecx
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1110 <fwrite@plt>
cmp    $0x4,%eax
je     14a3 <main+0x2b3>
lea    0xbba(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2b1c(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    13f0 <main+0x200>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
cmp    $0x0,%rax
je     14d5 <main+0x2e5>
lea    0xb8f(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    0x2acc(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x40200000,%r15d
lea    0xdf2(%rip),%r14
mov    0x2de3(%rip),%r12
jmp    1230 <main+0x40>
mov    (%r12),%edi
xor    %esi,%esi
xor    %edx,%edx
call   10f0 <strtoul@plt>
mov    %eax,%r15d
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10e0 <getopt@plt>
cmp    $0x61,%eax
je     1217 <main+0x27>
cmp    $0xffffffff,%eax
jne    1230 <main+0x40>
mov    0x2d8a(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
jge    1273 <main+0x83>
mov    (%rbx,%rax,8),%rdi
lea    0xda3(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1285 <main+0x95>
lea    0xd94(%rip),%rdi
jmp    12bd <main+0xcd>
mov    (%rbx),%rdi
call   10a0 <usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    %rax,%r14
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10b0 <fseeko@plt>
cmp    $0xffffffff,%eax
jne    12a9 <main+0xb9>
lea    0xd64(%rip),%rdi
jmp    12bd <main+0xcd>
mov    %r14,%rdi
call   1040 <ftello@plt>
cmp    $0xffffffff,%eax
jne    12d0 <main+0xe0>
lea    0xd55(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    %eax,%ebx
cmp    $0x100001,%eax
jl     12f0 <main+0x100>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
lea    0xd30(%rip),%rsi
call   1070 <fprintf@plt>
jmp    12c2 <main+0xd2>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10b0 <fseeko@plt>
cmp    $0xffffffff,%eax
je     12a0 <main+0xb0>
add    $0x3,%ebx
and    $0xfffffffc,%ebx
mov    %ebx,%edi
call   1090 <htobe32@plt>
mov    %eax,0xc(%rsp)
mov    0x2c90(%rip),%rbp
mov    0x0(%rbp),%ecx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
mov    %r15d,%edi
call   1090 <htobe32@plt>
mov    %eax,0xc(%rsp)
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
jmp    138e <main+0x19e>
nopl   (%rax)
mov    0xc(%rsp),%edi
call   1030 <le32toh@plt>
mov    %eax,%edi
call   1090 <htobe32@plt>
mov    %eax,0xc(%rsp)
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1110 <fwrite@plt>
cmp    $0x4,%eax
jne    13e1 <main+0x1f1>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
test   %rax,%rax
je     13c6 <main+0x1d6>
cmp    $0x3,%rax
ja     1360 <main+0x170>
mov    %r14,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1360 <main+0x170>
lea    0xc83(%rip),%rdi
jmp    12bd <main+0xcd>
mov    %r14,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
jne    13ed <main+0x1fd>
mov    0x2bce(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    0xc62(%rip),%rdi
jmp    12bd <main+0xcd>
lea    0xc5d(%rip),%rdi
jmp    12bd <main+0xcd>

LLVM IR (-O0):
@.str = [3 x i8] c"a:\00"
@optarg = global i32 0
@optind = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"fopen\00"
@EXIT_FAILURE = global i32 0
@SEEK_END = global i32 0
@.str.3 = [7 x i8] c"fseeko\00"
@.str.4 = [7 x i8] c"ftello\00"
@stderr = global i32 0
@.str.5 = [43 x i8] c"error: image should be smaller than 1 MiB\0A\00"
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.6 = [6 x i8] c"fread\00"
@.str.7 = [7 x i8] c"fwrite\00"
@.str.8 = [7 x i8] c"fclose\00"
@EXIT_SUCCESS = global i32 0
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 i64
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1075838976, i32* %10
br label %12
12: ; preds = %22, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %7
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %23
17: ; preds = %12
%18 = load i32, i32* %7
switch i32 %18, label %22 [
i32 97, label %19
]
19: ; preds = %17
%20 = load i32, i32* @optarg
%21 = call i32 @strtoul(i32 %20, i32* null, i32 0)
store i32 %21, i32* %10
br label %22
22: ; preds = %17, %19
br label %12
23: ; preds = %12
%24 = load i32, i32* @optind
%25 = load i32, i32* %4
%26 = icmp sge i32 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = call i32 @usage(i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %23
%34 = load i8**, i8*** %5
%35 = load i32, i32* @optind
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %39, i32** %6
%40 = load i32*, i32** %6
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %46
42: ; preds = %33
%43 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %33
%47 = load i32*, i32** %6
%48 = load i32, i32* @SEEK_END
%49 = call i32 @fseeko(i32* %47, i32 0, i32 %48)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%53 = load i32, i32* @EXIT_FAILURE
%54 = call i32 @exit(i32 %53)
unreachable
55: ; preds = %46
%56 = load i32*, i32** %6
%57 = call i32 @ftello(i32* %56)
store i32 %57, i32* %8
%58 = load i32, i32* %8
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%62 = load i32, i32* @EXIT_FAILURE
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %55
%65 = load i32, i32* %8
%66 = icmp sgt i32 %65, 1048576
br i1 %66, label %67, label %72
67: ; preds = %64
%68 = load i32, i32* @stderr
%69 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %64
%73 = load i32*, i32** %6
%74 = load i32, i32* @SEEK_SET
%75 = call i32 @fseeko(i32* %73, i32 0, i32 %74)
%76 = icmp eq i32 %75, -1
br i1 %76, label %77, label %81
77: ; preds = %72
%78 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%79 = load i32, i32* @EXIT_FAILURE
%80 = call i32 @exit(i32 %79)
unreachable
81: ; preds = %72
%82 = load i32, i32* %8
%83 = add nsw i32 %82, 3
%84 = and i32 %83, -4
store i32 %84, i32* %8
%85 = load i32, i32* %8
%86 = call i32 @htobe32(i32 %85)
store i32 %86, i32* %11
%87 = load i32, i32* @stdout
%88 = call i32 @fwrite(i32* %11, i32 4, i32 1, i32 %87)
%89 = load i32, i32* %10
%90 = call i32 @htobe32(i32 %89)
store i32 %90, i32* %11
%91 = load i32, i32* @stdout
%92 = call i32 @fwrite(i32* %11, i32 4, i32 1, i32 %91)
br label %93
93: ; preds = %121, %81
%94 = load i32*, i32** %6
%95 = call i64 @fread(i32* %11, i32 1, i32 4, i32* %94)
store i64 %95, i64* %9
%96 = load i64, i64* %9
%97 = icmp ne i64 %96, 0
br i1 %97, label %99, label %98
98: ; preds = %93
br label %122
99: ; preds = %93
%100 = load i64, i64* %9
%101 = icmp ult i64 %100, 4
br i1 %101, label %102, label %110
102: ; preds = %99
%103 = load i32*, i32** %6
%104 = call i32 @feof(i32* %103)
%105 = icmp ne i32 %104, 0
br i1 %105, label %110, label %106
106: ; preds = %102
%107 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%108 = load i32, i32* @EXIT_FAILURE
%109 = call i32 @exit(i32 %108)
unreachable
110: ; preds = %102, %99
%111 = load i32, i32* %11
%112 = call i32 @le32toh(i32 %111)
%113 = call i32 @htobe32(i32 %112)
store i32 %113, i32* %11
%114 = load i32, i32* @stdout
%115 = call i32 @fwrite(i32* %11, i32 1, i32 4, i32 %114)
%116 = icmp ne i32 %115, 4
br i1 %116, label %117, label %121
117: ; preds = %110
%118 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%119 = load i32, i32* @EXIT_FAILURE
%120 = call i32 @exit(i32 %119)
unreachable
121: ; preds = %110
br label %93
122: ; preds = %98
%123 = load i32*, i32** %6
%124 = call i64 @fclose(i32* %123)
%125 = icmp ne i64 %124, 0
br i1 %125, label %126, label %130
126: ; preds = %122
%127 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%128 = load i32, i32* @EXIT_FAILURE
%129 = call i32 @exit(i32 %128)
unreachable
130: ; preds = %122
%131 = load i32, i32* @EXIT_SUCCESS
%132 = call i32 @exit(i32 %131)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"a:\00"
@optarg = global i32 0
@optind = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"fopen\00"
@EXIT_FAILURE = global i32 0
@SEEK_END = global i32 0
@.str.3 = [7 x i8] c"fseeko\00"
@.str.4 = [7 x i8] c"ftello\00"
@stderr = global i32 0
@.str.5 = [43 x i8] c"error: image should be smaller than 1 MiB\0A\00"
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.6 = [6 x i8] c"fread\00"
@.str.7 = [7 x i8] c"fwrite\00"
@.str.8 = [7 x i8] c"fclose\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %9, %2
%6 = phi i32 [ %11, %9 ], [ 1075838976, %2 ]
br label %7
7: ; preds = %5, %7
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
switch i32 %8, label %7 [
i32 -1, label %12
i32 97, label %9
]
9: ; preds = %7
%10 = load i32, i32* @optarg
%11 = tail call i32 @strtoul(i32 %10, i32* null, i32 0)
br label %5
12: ; preds = %7
%13 = load i32, i32* @optind
%14 = icmp slt i32 %13, %0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = load i8*, i8** %1
%17 = tail call i32 @usage(i8* %16)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %12
%20 = sext i32 %13 to i64
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
%28 = tail call i32 @exit(i32 %27)
unreachable
29: ; preds = %19
%30 = load i32, i32* @SEEK_END
%31 = tail call i32 @fseeko(i32* %23, i32 0, i32 %30)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
%36 = tail call i32 @exit(i32 %35)
unreachable
37: ; preds = %29
%38 = tail call i32 @ftello(i32* %23)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
%43 = tail call i32 @exit(i32 %42)
unreachable
44: ; preds = %37
%45 = icmp sgt i32 %38, 1048576
br i1 %45, label %46, label %51
46: ; preds = %44
%47 = load i32, i32* @stderr
%48 = tail call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%49 = load i32, i32* @EXIT_FAILURE
%50 = tail call i32 @exit(i32 %49)
unreachable
51: ; preds = %44
%52 = load i32, i32* @SEEK_SET
%53 = tail call i32 @fseeko(i32* %23, i32 0, i32 %52)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %59
55: ; preds = %51
%56 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%57 = load i32, i32* @EXIT_FAILURE
%58 = tail call i32 @exit(i32 %57)
unreachable
59: ; preds = %51
%60 = add nsw i32 %38, 3
%61 = and i32 %60, -4
%62 = tail call i32 @htobe32(i32 %61)
store i32 %62, i32* %3
%63 = load i32, i32* @stdout
%64 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32 %63)
%65 = call i32 @htobe32(i32 %6)
store i32 %65, i32* %3
%66 = load i32, i32* @stdout
%67 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32 %66)
br label %68
68: ; preds = %80, %59
%69 = call i64 @fread(i32* %3, i32 1, i32 4, i32* %23)
%70 = icmp eq i64 %69, 0
br i1 %70, label %91, label %71
71: ; preds = %68
%72 = icmp ult i64 %69, 4
br i1 %72, label %73, label %80
73: ; preds = %71
%74 = call i32 @feof(i32* %23)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %73
%77 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%78 = load i32, i32* @EXIT_FAILURE
%79 = call i32 @exit(i32 %78)
unreachable
80: ; preds = %73, %71
%81 = load i32, i32* %3
%82 = call i32 @le32toh(i32 %81)
%83 = call i32 @htobe32(i32 %82)
store i32 %83, i32* %3
%84 = load i32, i32* @stdout
%85 = call i32 @fwrite(i32* %3, i32 1, i32 4, i32 %84)
%86 = icmp eq i32 %85, 4
br i1 %86, label %68, label %87
87: ; preds = %80
%88 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%89 = load i32, i32* @EXIT_FAILURE
%90 = call i32 @exit(i32 %89)
unreachable
91: ; preds = %68
%92 = call i64 @fclose(i32* %23)
%93 = icmp eq i64 %92, 0
br i1 %93, label %98, label %94
94: ; preds = %91
%95 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%96 = load i32, i32* @EXIT_FAILURE
%97 = call i32 @exit(i32 %96)
unreachable
98: ; preds = %91
%99 = load i32, i32* @EXIT_SUCCESS
%100 = call i32 @exit(i32 %99)
unreachable
}