#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 */

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("*** Boot stage 2 verification ***\n");
  int text = open("./boot-stage2.text", O_RDONLY);
  int text_end = lseek(text, 0, SEEK_END);
  int data = open("./boot-stage2.data", O_RDONLY);
  int data_end = lseek(data, 0, SEEK_END);
  int rodata = open("./boot-stage2.rodata", O_RDONLY);
  int rodata_end = lseek(rodata, 0, SEEK_END);
  int bss = open("./boot-stage2.bss", O_RDONLY);
  int bss_end = lseek(bss, 0, SEEK_END);
  if (text < 0 || data < 0 || rodata < 0 || bss < 0) {
    printf("FATAL ERROR: problem with program segment.\n");
    char *ok = " OK ";
    char *bad = "FAIL";
    printf("\ntext: [%s]\ndata: [%s]\nrodata: [%s]\nbss: [%s]\n",
           text > 0 ? ok : bad, data > 0 ? ok : bad, rodata > 0 ? ok : bad,
           bss > 0 ? ok : bad);
    exit(1);
  }
  if (text_end > (512 * 128)) {
    printf("FATAL ERROR: Boot stage 2\n");
    printf("text section too large: %d\n", text_end);
    exit(1);
  }
  if (data_end > (512 * 4)) {
    printf("FATAL ERROR: Boot stage 2\n");
    printf("data section too large: %d\n", data_end);
    exit(1);
  }
  if (rodata_end > (512 * 4)) {
    printf("FATAL ERROR: Boot stage 2\n");
    printf("rodata section too large: %d\n", rodata_end);
    exit(1);
  }
  if (bss_end > (512 * 4)) {
    printf("FATAL ERROR: Boot stage 2\n");
    printf("bss section too large: %d\n", bss_end);
    exit(1);
  }
  close(text);
  close(data);
  close(rodata);
  close(bss);
  printf("Boot stage 2 has been verified.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e4f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2e21(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
lea    0xe66(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %eax,-0x28(%rbp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%esi
lea    0xe4d(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    0x2dc5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1257 <main+0x107>
cmpl   $0x0,-0x1c(%rbp)
jl     1257 <main+0x107>
cmpl   $0x0,-0x24(%rbp)
jl     1257 <main+0x107>
cmpl   $0x0,-0x2c(%rbp)
jge    1337 <main+0x1e7>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe30(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe2a(%rip),%rax
mov    %rax,-0x40(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1292 <main+0x142>
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    129a <main+0x14a>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    12b9 <main+0x169>
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    12c1 <main+0x171>
mov    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    12e0 <main+0x190>
mov    -0x38(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    12e8 <main+0x198>
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    1307 <main+0x1b7>
mov    -0x38(%rbp),%rax
mov    %rax,-0x78(%rbp)
jmp    130f <main+0x1bf>
mov    -0x40(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rcx
mov    -0x60(%rbp),%rdx
mov    -0x50(%rbp),%rsi
mov    -0x78(%rbp),%r8
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
cmpl   $0x10000,-0x18(%rbp)
jle    136d <main+0x21d>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
cmpl   $0x800,-0x20(%rbp)
jle    13a3 <main+0x253>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
cmpl   $0x800,-0x28(%rbp)
jle    13d9 <main+0x289>
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
cmpl   $0x800,-0x30(%rbp)
jle    140f <main+0x2bf>
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x2c(%rbp),%edi
call   1050 <close@plt>
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e62(%rip),%rbp
mov    0x0(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%r14d
mov    0x2e51(%rip),%r15
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,(%rsp)
mov    0x0(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%r12d
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,0x4(%rsp)
mov    0x0(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%ebx
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,%r13d
mov    0x0(%rbp),%esi
lea    0xe49(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%ebp
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %r12d,%ecx
or     %r14d,%ecx
or     %ebx,%ecx
or     %ebp,%ecx
js     1283 <main+0x123>
cmpl   $0x10001,(%rsp)
jge    12d8 <main+0x178>
mov    0x4(%rsp),%r15d
cmp    $0x801,%r15d
jge    12f0 <main+0x190>
cmp    $0x801,%r13d
jge    1308 <main+0x1a8>
cmp    $0x801,%eax
jge    1320 <main+0x1c0>
mov    %r14d,%edi
call   1060 <close@plt>
mov    %r12d,%edi
call   1060 <close@plt>
mov    %ebx,%edi
call   1060 <close@plt>
mov    %ebp,%edi
call   1060 <close@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
lea    0xdb4(%rip),%rax
lea    0xdb2(%rip),%r8
mov    %r8,%rsi
cmovg  %rax,%rsi
test   %r12d,%r12d
mov    %r8,%rdx
cmovg  %rax,%rdx
test   %ebx,%ebx
mov    %r8,%rcx
cmovg  %rax,%rcx
test   %ebp,%ebp
cmovg  %rax,%r8
lea    0xd90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe3e(%rip),%rdi
call   1030 <puts@plt>
lea    0xd9b(%rip),%rdi
mov    (%rsp),%esi
jmp    1337 <main+0x1d7>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
lea    0xda1(%rip),%rdi
mov    %r15d,%esi
jmp    1337 <main+0x1d7>
lea    0xe0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xd87(%rip),%rdi
mov    %r13d,%esi
jmp    1337 <main+0x1d7>
lea    0xdf6(%rip),%rdi
mov    %eax,%ebx
call   1030 <puts@plt>
lea    0xd8b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"*** Boot stage 2 verification ***\0A\00"
@.str.1 = [19 x i8] c"./boot-stage2.text\00"
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@.str.2 = [19 x i8] c"./boot-stage2.data\00"
@.str.3 = [21 x i8] c"./boot-stage2.rodata\00"
@.str.4 = [18 x i8] c"./boot-stage2.bss\00"
@.str.5 = [44 x i8] c"FATAL ERROR: problem with program segment.\0A\00"
@.str.6 = [5 x i8] c" OK \00"
@.str.7 = [5 x i8] c"FAIL\00"
@.str.8 = [47 x i8] c"\0Atext: [%s]\0Adata: [%s]\0Arodata: [%s]\0Abss: [%s]\0A\00"
@.str.9 = [27 x i8] c"FATAL ERROR: Boot stage 2\0A\00"
@.str.10 = [28 x i8] c"text section too large: %d\0A\00"
@.str.11 = [28 x i8] c"data section too large: %d\0A\00"
@.str.12 = [30 x i8] c"rodata section too large: %d\0A\00"
@.str.13 = [27 x i8] c"bss section too large: %d\0A\00"
@.str.14 = [33 x i8] c"Boot stage 2 has been verified.\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 i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @O_RDONLY
%18 = call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* @SEEK_END
%21 = call i32 @lseek(i32 %19, i32 0, i32 %20)
store i32 %21, i32* %7
%22 = load i32, i32* @O_RDONLY
%23 = call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %22)
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = load i32, i32* @SEEK_END
%26 = call i32 @lseek(i32 %24, i32 0, i32 %25)
store i32 %26, i32* %9
%27 = load i32, i32* @O_RDONLY
%28 = call i32 @open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %27)
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = load i32, i32* @SEEK_END
%31 = call i32 @lseek(i32 %29, i32 0, i32 %30)
store i32 %31, i32* %11
%32 = load i32, i32* @O_RDONLY
%33 = call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %32)
store i32 %33, i32* %12
%34 = load i32, i32* %12
%35 = load i32, i32* @SEEK_END
%36 = call i32 @lseek(i32 %34, i32 0, i32 %35)
store i32 %36, i32* %13
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 0
br i1 %38, label %48, label %39
39: ; preds = %2
%40 = load i32, i32* %8
%41 = icmp slt i32 %40, 0
br i1 %41, label %48, label %42
42: ; preds = %39
%43 = load i32, i32* %10
%44 = icmp slt i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = load i32, i32* %12
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %84
48: ; preds = %45, %42, %39, %2
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %15
%50 = load i32, i32* %6
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = load i8*, i8** %14
br label %56
54: ; preds = %48
%55 = load i8*, i8** %15
br label %56
56: ; preds = %54, %52
%57 = phi i8* [ %53, %52 ], [ %55, %54 ]
%58 = load i32, i32* %8
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = load i8*, i8** %14
br label %64
62: ; preds = %56
%63 = load i8*, i8** %15
br label %64
64: ; preds = %62, %60
%65 = phi i8* [ %61, %60 ], [ %63, %62 ]
%66 = load i32, i32* %10
%67 = icmp sgt i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = load i8*, i8** %14
br label %72
70: ; preds = %64
%71 = load i8*, i8** %15
br label %72
72: ; preds = %70, %68
%73 = phi i8* [ %69, %68 ], [ %71, %70 ]
%74 = load i32, i32* %12
%75 = icmp sgt i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %72
%77 = load i8*, i8** %14
br label %80
78: ; preds = %72
%79 = load i8*, i8** %15
br label %80
80: ; preds = %78, %76
%81 = phi i8* [ %77, %76 ], [ %79, %78 ]
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i8* %57, i8* %65, i8* %73, i8* %81)
%83 = call i32 @exit(i32 1)
unreachable
84: ; preds = %45
%85 = load i32, i32* %7
%86 = icmp sgt i32 %85, 65536
br i1 %86, label %87, label %92
87: ; preds = %84
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%89 = load i32, i32* %7
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %89)
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %84
%93 = load i32, i32* %9
%94 = icmp sgt i32 %93, 2048
br i1 %94, label %95, label %100
95: ; preds = %92
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%97 = load i32, i32* %9
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %97)
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %92
%101 = load i32, i32* %11
%102 = icmp sgt i32 %101, 2048
br i1 %102, label %103, label %108
103: ; preds = %100
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%105 = load i32, i32* %11
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i32 %105)
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %100
%109 = load i32, i32* %13
%110 = icmp sgt i32 %109, 2048
br i1 %110, label %111, label %116
111: ; preds = %108
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%113 = load i32, i32* %13
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %113)
%115 = call i32 @exit(i32 1)
unreachable
116: ; preds = %108
%117 = load i32, i32* %6
%118 = call i32 @close(i32 %117)
%119 = load i32, i32* %8
%120 = call i32 @close(i32 %119)
%121 = load i32, i32* %10
%122 = call i32 @close(i32 %121)
%123 = load i32, i32* %12
%124 = call i32 @close(i32 %123)
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"./boot-stage2.text\00"
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@.str.2 = [19 x i8] c"./boot-stage2.data\00"
@.str.3 = [21 x i8] c"./boot-stage2.rodata\00"
@.str.4 = [18 x i8] c"./boot-stage2.bss\00"
@.str.6 = [5 x i8] c" OK \00"
@.str.7 = [5 x i8] c"FAIL\00"
@.str.8 = [47 x i8] c"\0Atext: [%s]\0Adata: [%s]\0Arodata: [%s]\0Abss: [%s]\0A\00"
@.str.10 = [28 x i8] c"text section too large: %d\0A\00"
@.str.11 = [28 x i8] c"data section too large: %d\0A\00"
@.str.12 = [30 x i8] c"rodata section too large: %d\0A\00"
@.str.13 = [27 x i8] c"bss section too large: %d\0A\00"
@str = [34 x i8] c"*** Boot stage 2 verification ***\00"
@str.15 = [32 x i8] c"Boot stage 2 has been verified.\00"
@str.19 = [26 x i8] c"FATAL ERROR: Boot stage 2\00"
@str.20 = [43 x i8] c"FATAL ERROR: problem with program segment.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @SEEK_END
%7 = tail call i32 @lseek(i32 %5, i32 0, i32 %6)
%8 = load i32, i32* @O_RDONLY
%9 = tail call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @SEEK_END
%11 = tail call i32 @lseek(i32 %9, i32 0, i32 %10)
%12 = load i32, i32* @O_RDONLY
%13 = tail call i32 @open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @SEEK_END
%15 = tail call i32 @lseek(i32 %13, i32 0, i32 %14)
%16 = load i32, i32* @O_RDONLY
%17 = tail call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @SEEK_END
%19 = tail call i32 @lseek(i32 %17, i32 0, i32 %18)
%20 = or i32 %9, %5
%21 = or i32 %20, %13
%22 = or i32 %21, %17
%23 = icmp sgt i32 %22, -1
br i1 %23, label %36, label %24
24: ; preds = %2
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.20, i64 0, i64 0))
%26 = icmp sgt i32 %5, 0
%27 = select i1 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%28 = icmp sgt i32 %9, 0
%29 = select i1 %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%30 = icmp sgt i32 %13, 0
%31 = select i1 %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%32 = icmp sgt i32 %17, 0
%33 = select i1 %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i8* %27, i8* %29, i8* %31, i8* %33)
%35 = tail call i32 @exit(i32 1)
unreachable
36: ; preds = %2
%37 = icmp sgt i32 %7, 65536
br i1 %37, label %38, label %42
38: ; preds = %36
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.19, i64 0, i64 0))
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %7)
%41 = tail call i32 @exit(i32 1)
unreachable
42: ; preds = %36
%43 = icmp sgt i32 %11, 2048
br i1 %43, label %44, label %48
44: ; preds = %42
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.19, i64 0, i64 0))
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %11)
%47 = tail call i32 @exit(i32 1)
unreachable
48: ; preds = %42
%49 = icmp sgt i32 %15, 2048
br i1 %49, label %50, label %54
50: ; preds = %48
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.19, i64 0, i64 0))
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i32 %15)
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %48
%55 = icmp sgt i32 %19, 2048
br i1 %55, label %56, label %60
56: ; preds = %54
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.19, i64 0, i64 0))
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %19)
%59 = tail call i32 @exit(i32 1)
unreachable
60: ; preds = %54
%61 = tail call i32 @close(i32 %5)
%62 = tail call i32 @close(i32 %9)
%63 = tail call i32 @close(i32 %13)
%64 = tail call i32 @close(i32 %17)
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.15, i64 0, i64 0))
ret i32 0
}