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

/* Variables and functions */
int /*<<< orphan*/ BN_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BN_CTX_new();
int /*<<< orphan*/ BN_performance(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ DAPS_H2_GQ_performance(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ DAPS_H2_MR_performance(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ DAPS_ID2_GQ_performance(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ DAPS_PS_performance(int, int, int /*<<< orphan*/ *);
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ ID_GQ_performance(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_performance(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ TDF_PS_performance(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  BN_CTX *bn_ctx = BN_CTX_new();
  if (bn_ctx == NULL) {
    fprintf(stderr, "BN_CTX_new failed\n");
    return EXIT_FAILURE;
  }
  printf("\n");
  printf("For most accurate results:\n");
  printf(" - disable hyperthreading a.k.a. hardware multithreading\n");
  printf("   (Linux instructions: http://bench.cr.yp.to/supercop.html)\n");
  printf("   (Mac OS X instructions: Instruments -> Preferences -> CPUs -> "
         "uncheck \"Hardware Multi-Threading\"  "
         "http://forums.macrumors.com/showthread.php?t=1484684)\n");
  printf(" - disable TurboBoost\n");
  printf("   (Linux instructions: http://bench.cr.yp.to/supercop.html)\n");
  printf("   (Max OS X: use "
         "http://www.rugarciap.com/turbo-boost-switcher-for-os-x/)\n");
  printf(" - run when the computer is idle (e.g., shut down all other "
         "applications, disable network access if possible, ...\n");
  printf("\n");
  int mod_sizes[1] = {2048};
  int h_sizes[1] = {256};
  for (int i = 0; i < 1; i++) {
    printf("\n=== MODULUS = %d, HASH = %d ===\n", mod_sizes[i], h_sizes[i]);
    printf("Started at ");
    {
      char _bench_time_buff[20];
      time_t _bench_time_now = time(0);
      strftime(_bench_time_buff, 20, "%Y-%m-%d %H:%M:%S",
               localtime(&_bench_time_now));
      printf("%s", _bench_time_buff);
    }
    printf("\n");
    printf("%-30s %15s %15s %15s %15s %15s %15s\n", "Operation", "Iterations",
           "Total time (s)", "Time(us): mean", "pop. stdev", "Cycles: mean",
           "pop. stdev");
    BN_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    RSA_performance(mod_sizes[i], bn_ctx);
    ID_GQ_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    DAPS_H2_GQ_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    DAPS_ID2_GQ_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    DAPS_H2_MR_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    TDF_PS_performance(mod_sizes[i], bn_ctx);
    DAPS_PS_performance(mod_sizes[i], h_sizes[i], bn_ctx);
    printf("Ended at ");
    {
      char _bench_time_buff[20];
      time_t _bench_time_now = time(0);
      strftime(_bench_time_buff, 20, "%Y-%m-%d %H:%M:%S",
               localtime(&_bench_time_now));
      printf("%s", _bench_time_buff);
    }
    printf("\n");
  }
  BN_CTX_free(bn_ctx);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10d0 <BN_CTX_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    123e <main+0x4e>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
lea    0xdd8(%rip),%rsi
call   10b0 <fprintf@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14ea <main+0x2fa>
lea    0xf5f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x1008(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0x1003(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    14d5 <main+0x2e5>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%esi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%edx
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x34(%rbp),%rdi
call   1040 <localtime@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xf01(%rip),%rdx
call   1100 <strftime@plt>
lea    -0x30(%rbp),%rsi
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0xf08(%rip),%rsi
lea    0xf0b(%rip),%rdx
lea    0xf0f(%rip),%rcx
lea    0xf17(%rip),%r8
lea    0xf1f(%rip),%rax
lea    0xf23(%rip),%r10
mov    %rax,%r9
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   1070 <BN_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
mov    -0x10(%rbp),%rsi
call   1110 <RSA_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ID_GQ_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   10c0 <DAPS_H2_GQ_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   10a0 <DAPS_ID2_GQ_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   1050 <DAPS_H2_MR_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
mov    -0x10(%rbp),%rsi
call   1080 <TDF_PS_performance@plt>
movslq -0x1c(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edi
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    -0x10(%rbp),%rdx
call   10f0 <DAPS_PS_performance@plt>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,-0x54(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x54(%rbp),%rdi
call   1040 <localtime@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xda5(%rip),%rdx
call   1100 <strftime@plt>
lea    -0x50(%rbp),%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12e3 <main+0xf3>
mov    -0x10(%rbp),%rdi
call   1090 <BN_CTX_free@plt>
mov    0x2aeb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %eax,%eax
call   10f0 <BN_CTX_new@plt>
test   %rax,%rax
je     1440 <main+0x230>
mov    %rax,%rbx
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe91(%rip),%rdi
call   1070 <puts@plt>
lea    0xea0(%rip),%rdi
call   1070 <puts@plt>
lea    0xf7e(%rip),%r14
mov    %r14,%rdi
call   1070 <puts@plt>
lea    0xebe(%rip),%rdi
call   1070 <puts@plt>
lea    0xf4d(%rip),%rdi
call   1070 <puts@plt>
mov    %r14,%rdi
call   1070 <puts@plt>
lea    0xf8c(%rip),%rdi
call   1070 <puts@plt>
lea    0xfcb(%rip),%rdi
call   1070 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd6b(%rip),%rdi
mov    $0x800,%esi
mov    $0x100,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd75(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   1100 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <localtime@plt>
lea    0xd5e(%rip),%r14
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    $0x14,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1120 <strftime@plt>
lea    0xd52(%rip),%r15
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd8f(%rip),%r9
lea    0xd93(%rip),%r10
lea    0xd29(%rip),%rdi
lea    0xd47(%rip),%rsi
lea    0xd4a(%rip),%rdx
lea    0xd4e(%rip),%rcx
lea    0xd56(%rip),%r8
xor    %eax,%eax
push   %r9
push   %r10
call   1080 <printf@plt>
add    $0x10,%rsp
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1090 <BN_performance@plt>
mov    $0x800,%edi
mov    %rbx,%rsi
call   1130 <RSA_performance@plt>
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <ID_GQ_performance@plt>
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   10e0 <DAPS_H2_GQ_performance@plt>
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   10c0 <DAPS_ID2_GQ_performance@plt>
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1060 <DAPS_H2_MR_performance@plt>
mov    $0x800,%edi
mov    %rbx,%rsi
call   10a0 <TDF_PS_performance@plt>
mov    $0x800,%edi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1110 <DAPS_PS_performance@plt>
lea    0xce1(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   1100 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <localtime@plt>
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    $0x14,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1120 <strftime@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
call   10b0 <BN_CTX_free@plt>
mov    0x2b92(%rip),%rax
jmp    145c <main+0x24c>
mov    0x2b99(%rip),%rax
mov    (%rax),%edi
lea    0xbb0(%rip),%rsi
call   10d0 <fprintf@plt>
mov    0x2b7c(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"BN_CTX_new failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [28 x i8] c"For most accurate results:\0A\00"
@.str.3 = [58 x i8] c" - disable hyperthreading a.k.a. hardware multithreading\0A\00"
@.str.4 = [62 x i8] c" (Linux instructions: http://bench.cr.yp.to/supercop.html)\0A\00"
@.str.5 = [156 x i8] c" (Mac OS X instructions: Instruments -> Preferences -> CPUs -> uncheck \22Hardware Multi-Threading\22 http://forums.macrumors.com/showthread.php?t=1484684)\0A\00"
@.str.6 = [23 x i8] c" - disable TurboBoost\0A\00"
@.str.7 = [76 x i8] c" (Max OS X: use http://www.rugarciap.com/turbo-boost-switcher-for-os-x/)\0A\00"
@.str.8 = [115 x i8] c" - run when the computer is idle (e.g., shut down all other applications, disable network access if possible, ...\0A\00"
@__const.main.mod_sizes = [1 x i32] [i32 2048]
@__const.main.h_sizes = [1 x i32] [i32 256]
@.str.9 = [34 x i8] c"\0A=== MODULUS = %d, HASH = %d ===\0A\00"
@.str.10 = [12 x i8] c"Started at \00"
@.str.11 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [37 x i8] c"%-30s %15s %15s %15s %15s %15s %15s\0A\00"
@.str.14 = [10 x i8] c"Operation\00"
@.str.15 = [11 x i8] c"Iterations\00"
@.str.16 = [15 x i8] c"Total time (s)\00"
@.str.17 = [15 x i8] c"Time(us): mean\00"
@.str.18 = [11 x i8] c"pop. stdev\00"
@.str.19 = [13 x i8] c"Cycles: mean\00"
@.str.20 = [10 x i8] c"Ended at \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [1 x i32]
%4 = alloca [1 x i32]
%5 = alloca i32
%6 = alloca [20 x i8]
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32* (...) @BN_CTX_new()
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %1
br label %139
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.8, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = bitcast [1 x i32]* %3 to i8*
%29 = bitcast [1 x i32]* %4 to i8*
store i32 0, i32* %5
br label %30
30: ; preds = %132, %17
%31 = load i32, i32* %5
%32 = icmp slt i32 %31, 1
br i1 %32, label %33, label %135
33: ; preds = %30
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 %37, i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%44 = call i32 @time(i32 0)
store i32 %44, i32* %7
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%46 = call i32 @localtime(i32* %7)
%47 = call i32 @strftime(i8* %45, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %5
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = load i32*, i32** %2
%61 = call i32 @BN_performance(i32 %55, i32 %59, i32* %60)
%62 = load i32, i32* %5
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = load i32*, i32** %2
%67 = call i32 @RSA_performance(i32 %65, i32* %66)
%68 = load i32, i32* %5
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = load i32, i32* %5
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = load i32*, i32** %2
%77 = call i32 @ID_GQ_performance(i32 %71, i32 %75, i32* %76)
%78 = load i32, i32* %5
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = load i32, i32* %5
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = load i32*, i32** %2
%87 = call i32 @DAPS_H2_GQ_performance(i32 %81, i32 %85, i32* %86)
%88 = load i32, i32* %5
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = load i32, i32* %5
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %93
%95 = load i32, i32* %94
%96 = load i32*, i32** %2
%97 = call i32 @DAPS_ID2_GQ_performance(i32 %91, i32 %95, i32* %96)
%98 = load i32, i32* %5
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = load i32, i32* %5
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = load i32*, i32** %2
%107 = call i32 @DAPS_H2_MR_performance(i32 %101, i32 %105, i32* %106)
%108 = load i32, i32* %5
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = load i32*, i32** %2
%113 = call i32 @TDF_PS_performance(i32 %111, i32* %112)
%114 = load i32, i32* %5
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %115
%117 = load i32, i32* %116
%118 = load i32, i32* %5
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 %119
%121 = load i32, i32* %120
%122 = load i32*, i32** %2
%123 = call i32 @DAPS_PS_performance(i32 %117, i32 %121, i32* %122)
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%125 = call i32 @time(i32 0)
store i32 %125, i32* %9
%126 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%127 = call i32 @localtime(i32* %9)
%128 = call i32 @strftime(i8* %126, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %127)
%129 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %129)
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %132
132: ; preds = %33
%133 = load i32, i32* %5
%134 = add nsw i32 %133, 1
store i32 %134, i32* %5
br label %30
135: ; preds = %30
%136 = load i32*, i32** %2
%137 = call i32 @BN_CTX_free(i32* %136)
%138 = load i32, i32* @EXIT_SUCCESS
store i32 %138, i32* %1
br label %139
139: ; preds = %135, %13
%140 = load i32, i32* %1
ret i32 %140
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"BN_CTX_new failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.9 = [34 x i8] c"\0A=== MODULUS = %d, HASH = %d ===\0A\00"
@.str.10 = [12 x i8] c"Started at \00"
@.str.11 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [37 x i8] c"%-30s %15s %15s %15s %15s %15s %15s\0A\00"
@.str.14 = [10 x i8] c"Operation\00"
@.str.15 = [11 x i8] c"Iterations\00"
@.str.16 = [15 x i8] c"Total time (s)\00"
@.str.17 = [15 x i8] c"Time(us): mean\00"
@.str.18 = [11 x i8] c"pop. stdev\00"
@.str.19 = [13 x i8] c"Cycles: mean\00"
@.str.20 = [10 x i8] c"Ended at \00"
@EXIT_SUCCESS = global i32 0
@str = [27 x i8] c"For most accurate results:\00"
@str.21 = [57 x i8] c" - disable hyperthreading a.k.a. hardware multithreading\00"
@str.23 = [155 x i8] c" (Mac OS X instructions: Instruments -> Preferences -> CPUs -> uncheck \22Hardware Multi-Threading\22 http://forums.macrumors.com/showthread.php?t=1484684)\00"
@str.24 = [22 x i8] c" - disable TurboBoost\00"
@str.25 = [61 x i8] c" (Linux instructions: http://bench.cr.yp.to/supercop.html)\00"
@str.26 = [75 x i8] c" (Max OS X: use http://www.rugarciap.com/turbo-boost-switcher-for-os-x/)\00"
@str.27 = [114 x i8] c" - run when the computer is idle (e.g., shut down all other applications, disable network access if possible, ...\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = tail call i32* (...) @BN_CTX_new()
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %48
10: ; preds = %0
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.21, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([155 x i8], [155 x i8]* @str.23, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.24, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.25, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.26, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str.27, i64 0, i64 0))
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 2048, i32 256)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%24 = bitcast i32* %2 to i8*
%25 = tail call i32 @time(i32 0)
store i32 %25, i32* %2
%26 = call i32 @localtime(i32* %2)
%27 = call i32 @strftime(i8* %23, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %23)
%29 = call i32 @putchar(i32 10)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%31 = call i32 @BN_performance(i32 2048, i32 256, i32* %5)
%32 = call i32 @RSA_performance(i32 2048, i32* %5)
%33 = call i32 @ID_GQ_performance(i32 2048, i32 256, i32* %5)
%34 = call i32 @DAPS_H2_GQ_performance(i32 2048, i32 256, i32* %5)
%35 = call i32 @DAPS_ID2_GQ_performance(i32 2048, i32 256, i32* %5)
%36 = call i32 @DAPS_H2_MR_performance(i32 2048, i32 256, i32* %5)
%37 = call i32 @TDF_PS_performance(i32 2048, i32* %5)
%38 = call i32 @DAPS_PS_performance(i32 2048, i32 256, i32* %5)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%41 = bitcast i32* %4 to i8*
%42 = call i32 @time(i32 0)
store i32 %42, i32* %4
%43 = call i32 @localtime(i32* %4)
%44 = call i32 @strftime(i8* %40, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %43)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %40)
%46 = call i32 @putchar(i32 10)
%47 = call i32 @BN_CTX_free(i32* %5)
br label %48
48: ; preds = %10, %7
%49 = phi i32* [ @EXIT_FAILURE, %7 ], [ @EXIT_SUCCESS, %10 ]
%50 = load i32, i32* %49
ret i32 %50
}