#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 EXIT_SUCCESS;
scalar_t__ test_csv_IO();
scalar_t__ test_hanson_diag();
scalar_t__ test_kinetic_energy();
scalar_t__ test_rand_save_state();
scalar_t__ test_random_norm();
scalar_t__ test_random_uni();
int main(void) {
  int ret = EXIT_SUCCESS;
  ret += test_random_uni();
  ret += test_random_norm();
  ret += test_rand_save_state();
  ret += test_csv_IO();
  ret += test_hanson_diag();
  ret += test_kinetic_energy();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_random_uni@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_random_norm@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <test_rand_save_state@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <test_csv_IO@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_hanson_diag@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_kinetic_energy@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2e75(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1060 <test_random_uni@plt>
mov    %rax,%rbx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <test_random_norm@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1080 <test_rand_save_state@plt>
mov    %rax,%rbx
add    %r14d,%ebx
xor    %eax,%eax
call   1070 <test_csv_IO@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1030 <test_hanson_diag@plt>
mov    %rax,%rbx
add    %r14d,%ebx
xor    %eax,%eax
call   1040 <test_kinetic_energy@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @EXIT_SUCCESS
store i32 %3, i32* %2
%4 = call i64 (...) @test_random_uni()
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = call i64 (...) @test_random_norm()
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = call i64 (...) @test_rand_save_state()
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
%19 = call i64 (...) @test_csv_IO()
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = add nsw i64 %21, %19
%23 = trunc i64 %22 to i32
store i32 %23, i32* %2
%24 = call i64 (...) @test_hanson_diag()
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = add nsw i64 %26, %24
%28 = trunc i64 %27 to i32
store i32 %28, i32* %2
%29 = call i64 (...) @test_kinetic_energy()
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = add nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %2
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i64 (...) @test_random_uni()
%3 = trunc i64 %2 to i32
%4 = add i32 %1, %3
%5 = tail call i64 (...) @test_random_norm()
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i64 (...) @test_rand_save_state()
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = tail call i64 (...) @test_csv_IO()
%12 = trunc i64 %11 to i32
%13 = add i32 %10, %12
%14 = tail call i64 (...) @test_hanson_diag()
%15 = trunc i64 %14 to i32
%16 = add i32 %13, %15
%17 = tail call i64 (...) @test_kinetic_energy()
%18 = trunc i64 %17 to i32
%19 = add i32 %16, %18
ret i32 %19
}