#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*/ read_and_test(char *, long *);
int main(void) {
  long expected1[] = {450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 6225};
  read_and_test("./input1.dat", expected1);
  long expected2[] = {910, 839, 1120, 1014, 1126, 900,
                      974, 866, 1698, 1384, 10944};
  read_and_test("./input2.dat", expected2);
  long expected3[] = {0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  read_and_test("./input3.dat", expected3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x60(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x58,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xf5d(%rip),%rdi
call   1030 <read_and_test@plt>
lea    -0xc0(%rbp),%rdi
lea    0xef2(%rip),%rsi
mov    $0x58,%edx
call   1050 <memcpy@plt>
lea    -0xc0(%rbp),%rsi
lea    0xf3f(%rip),%rdi
call   1030 <read_and_test@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x58,%edx
call   1040 <memset@plt>
movq   $0x6c,-0x118(%rbp)
lea    -0x120(%rbp),%rsi
lea    0xf1b(%rip),%rdi
call   1030 <read_and_test@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x118,%rsp
mov    0xf32(%rip),%rax
mov    %rax,0x110(%rsp)
movaps 0xf13(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
lea    0xf40(%rip),%rdi
lea    0xc0(%rsp),%rsi
call   1030 <read_and_test@plt>
mov    0xf24(%rip),%rax
mov    %rax,0xb0(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0xee5(%rip),%rdi
lea    0x60(%rsp),%rsi
call   1030 <read_and_test@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x50(%rsp)
movq   $0x6c,0x8(%rsp)
lea    0xeb4(%rip),%rdi
mov    %rsp,%rsi
call   1030 <read_and_test@plt>
xor    %eax,%eax
add    $0x118,%rsp
ret

LLVM IR (-O0):
@__const.main.expected1 = [11 x i64] [i64 450, i64 460, i64 470, i64 480, i64 490, i64 500, i64 510, i64 520, i64 530, i64 540, i64 6225]
@.str = [13 x i8] c"./input1.dat\00"
@__const.main.expected2 = [11 x i64] [i64 910, i64 839, i64 1120, i64 1014, i64 1126, i64 900, i64 974, i64 866, i64 1698, i64 1384, i64 10944]
@.str.1 = [13 x i8] c"./input2.dat\00"
@.str.2 = [13 x i8] c"./input3.dat\00"
define i32 @main() {
%1 = alloca [11 x i64]
%2 = alloca [11 x i64]
%3 = alloca [11 x i64]
%4 = bitcast [11 x i64]* %1 to i8*
%5 = getelementptr inbounds [11 x i64], [11 x i64]* %1, i64 0, i64 0
%6 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %5)
%7 = bitcast [11 x i64]* %2 to i8*
%8 = getelementptr inbounds [11 x i64], [11 x i64]* %2, i64 0, i64 0
%9 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64* %8)
%10 = bitcast [11 x i64]* %3 to i8*
%11 = bitcast i8* %10 to <{ i64, i64, [9 x i64] }>*
%12 = getelementptr inbounds <{ i64, i64, [9 x i64] }>, <{ i64, i64, [9 x i64] }>* %11, i32 0, i32 1
store i64 108, i64* %12
%13 = getelementptr inbounds [11 x i64], [11 x i64]* %3, i64 0, i64 0
%14 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.expected1 = [11 x i64] [i64 450, i64 460, i64 470, i64 480, i64 490, i64 500, i64 510, i64 520, i64 530, i64 540, i64 6225]
@.str = [13 x i8] c"./input1.dat\00"
@__const.main.expected2 = [11 x i64] [i64 910, i64 839, i64 1120, i64 1014, i64 1126, i64 900, i64 974, i64 866, i64 1698, i64 1384, i64 10944]
@.str.1 = [13 x i8] c"./input2.dat\00"
@.str.2 = [13 x i8] c"./input3.dat\00"
define i32 @main() {
%1 = alloca [11 x i64]
%2 = alloca [11 x i64]
%3 = alloca [11 x i64]
%4 = bitcast [11 x i64]* %1 to i8*
%5 = getelementptr inbounds [11 x i64], [11 x i64]* %1, i64 0, i64 0
%6 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %5)
%7 = bitcast [11 x i64]* %2 to i8*
%8 = getelementptr inbounds [11 x i64], [11 x i64]* %2, i64 0, i64 0
%9 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64* %8)
%10 = bitcast [11 x i64]* %3 to i8*
%11 = getelementptr inbounds [11 x i64], [11 x i64]* %3, i64 0, i64 1
store i64 108, i64* %11
%12 = getelementptr inbounds [11 x i64], [11 x i64]* %3, i64 0, i64 0
%13 = call i32 @read_and_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64* %12)
ret i32 0
}