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

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_alu();
int /*<<< orphan*/ test_bios_memory();
int /*<<< orphan*/ test_decoder();
int /*<<< orphan*/ test_is_bit_set();
int /*<<< orphan*/ test_register_file_initialization();
void main(void) {
  clock_t start = clock();
  printf("Running Sourcery!\n");
  test_bios_memory();
  test_register_file_initialization();
  test_is_bit_set();
  test_decoder();
  test_alu();
  printf("Ran Sourcery successfully until the end!\n");
  clock_t end = clock();
  double seconds = ((double)(end - start) / CLOCKS_PER_SEC);
  printf("Running the program took all of %f seconds.\n", seconds);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x8(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <test_bios_memory@plt>
mov    $0x0,%al
call   1070 <test_register_file_initialization@plt>
mov    $0x0,%al
call   1040 <test_is_bit_set@plt>
mov    $0x0,%al
call   1090 <test_decoder@plt>
mov    $0x0,%al
call   1080 <test_alu@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e07(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <clock@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_bios_memory@plt>
xor    %eax,%eax
call   1080 <test_register_file_initialization@plt>
xor    %eax,%eax
call   1050 <test_is_bit_set@plt>
xor    %eax,%eax
call   10a0 <test_decoder@plt>
xor    %eax,%eax
call   1090 <test_alu@plt>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e0c(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe19(%rip),%rdi
mov    $0x1,%al
pop    %rbx
jmp    1070 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Running Sourcery!\0A\00"
@.str.1 = [42 x i8] c"Ran Sourcery successfully until the end!\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.2 = [45 x i8] c"Running the program took all of %f seconds.\0A\00"
define void @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca double
%4 = call i64 (...) @clock()
store i64 %4, i64* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @test_bios_memory()
%7 = call i32 (...) @test_register_file_initialization()
%8 = call i32 (...) @test_is_bit_set()
%9 = call i32 (...) @test_decoder()
%10 = call i32 (...) @test_alu()
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%12 = call i64 (...) @clock()
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = load i64, i64* %1
%15 = sub nsw i64 %13, %14
%16 = sitofp i64 %15 to double
%17 = load double, double* @CLOCKS_PER_SEC
%18 = fdiv double %16, %17
store double %18, double* %3
%19 = load double, double* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %19)
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str.2 = [45 x i8] c"Running the program took all of %f seconds.\0A\00"
@str = [18 x i8] c"Running Sourcery!\00"
@str.3 = [41 x i8] c"Ran Sourcery successfully until the end!\00"
define void @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @test_bios_memory()
%4 = tail call i32 (...) @test_register_file_initialization()
%5 = tail call i32 (...) @test_is_bit_set()
%6 = tail call i32 (...) @test_decoder()
%7 = tail call i32 (...) @test_alu()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i64 (...) @clock()
%10 = sub nsw i64 %9, %1
%11 = sitofp i64 %10 to double
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %13)
ret void
}