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

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
int /*<<< orphan*/ test_compression(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_key_generation(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_number_theory(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_self(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_verification(int /*<<< orphan*/ *);
bool test(FILE *out) {
  clock_t start = clock();
  if (!test_key_generation(out))
    return false;
  if (!test_verification(out))
    return false;
  if (!test_self(out))
    return false;
  if (!test_compression(out))
    return false;
  if (!test_number_theory(out))
    return false;
  double elapsed = ((double)(clock() - start)) / CLOCKS_PER_SEC;
  fprintf(out, "\n\nAll Test successfully completed in %.4f seconds.\n",
          elapsed);
  return true;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <test_key_generation@plt>
cmp    $0x0,%eax
jne    11a5 <test+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1259 <test+0xe9>
mov    -0x10(%rbp),%rdi
call   1050 <test_verification@plt>
cmp    $0x0,%eax
jne    11c3 <test+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1259 <test+0xe9>
mov    -0x10(%rbp),%rdi
call   1060 <test_self@plt>
cmp    $0x0,%eax
jne    11e1 <test+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1259 <test+0xe9>
mov    -0x10(%rbp),%rdi
call   1030 <test_compression@plt>
cmp    $0x0,%eax
jne    11ff <test+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    1259 <test+0xe9>
mov    -0x10(%rbp),%rdi
call   1080 <test_number_theory@plt>
cmp    $0x0,%eax
jne    121d <test+0xad>
movl   $0x0,-0x4(%rbp)
jmp    1259 <test+0xe9>
mov    $0x0,%al
call   1040 <clock@plt>
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2db4(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    0xdb3(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <clock@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1090 <test_key_generation@plt>
test   %eax,%eax
je     11ed <test+0x7d>
mov    %rbx,%rdi
call   1050 <test_verification@plt>
test   %eax,%eax
je     11ed <test+0x7d>
mov    %rbx,%rdi
call   1060 <test_self@plt>
test   %eax,%eax
je     11ed <test+0x7d>
mov    %rbx,%rdi
call   1030 <test_compression@plt>
test   %eax,%eax
je     11ed <test+0x7d>
mov    %rbx,%rdi
call   1080 <test_number_theory@plt>
test   %eax,%eax
je     11ed <test+0x7d>
xor    %eax,%eax
call   1040 <clock@plt>
sub    %r14,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e13(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fprintf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [52 x i8] c"\0A\0AAll Test successfully completed in %.4f seconds.\0A\00"
define i32 @test(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
%5 = alloca double
store i32* %0, i32** %3
%6 = call i64 (...) @clock()
store i64 %6, i64* %4
%7 = load i32*, i32** %3
%8 = call i32 @test_key_generation(i32* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %41
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i32 @test_verification(i32* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 0, i32* %2
br label %41
16: ; preds = %11
%17 = load i32*, i32** %3
%18 = call i32 @test_self(i32* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16
store i32 0, i32* %2
br label %41
21: ; preds = %16
%22 = load i32*, i32** %3
%23 = call i32 @test_compression(i32* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
store i32 0, i32* %2
br label %41
26: ; preds = %21
%27 = load i32*, i32** %3
%28 = call i32 @test_number_theory(i32* %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %26
store i32 0, i32* %2
br label %41
31: ; preds = %26
%32 = call i64 (...) @clock()
%33 = load i64, i64* %4
%34 = sub nsw i64 %32, %33
%35 = sitofp i64 %34 to double
%36 = load double, double* @CLOCKS_PER_SEC
%37 = fdiv double %35, %36
store double %37, double* %5
%38 = load i32*, i32** %3
%39 = load double, double* %5
%40 = call i32 @fprintf(i32* %38, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), double %39)
store i32 1, i32* %2
br label %41
41: ; preds = %31, %30, %25, %20, %15, %10
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [52 x i8] c"\0A\0AAll Test successfully completed in %.4f seconds.\0A\00"
define i32 @test(i32* %0) {
%2 = tail call i64 (...) @clock()
%3 = tail call i32 @test_key_generation(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %24, label %5
5: ; preds = %1
%6 = tail call i32 @test_verification(i32* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %24, label %8
8: ; preds = %5
%9 = tail call i32 @test_self(i32* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %24, label %11
11: ; preds = %8
%12 = tail call i32 @test_compression(i32* %0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %24, label %14
14: ; preds = %11
%15 = tail call i32 @test_number_theory(i32* %0)
%16 = icmp eq i32 %15, 0
br i1 %16, label %24, label %17
17: ; preds = %14
%18 = tail call i64 (...) @clock()
%19 = sub nsw i64 %18, %2
%20 = sitofp i64 %19 to double
%21 = load double, double* @CLOCKS_PER_SEC
%22 = fdiv double %20, %21
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), double %22)
br label %24
24: ; preds = %14, %11, %8, %5, %1, %17
%25 = phi i32 [ 1, %17 ], [ 0, %1 ], [ 0, %5 ], [ 0, %8 ], [ 0, %11 ], [ 0, %14 ]
ret i32 %25
}