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

/* Variables and functions */
int /*<<< orphan*/ cipherRSA();
int /*<<< orphan*/ decipherRSA();
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keyGeneration();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t tbegin, tend;
  double texec = 0.;
  tbegin = time(NULL);
  printf("--------------------------------------------------------------\n");
  printf("|                     RSA IMPLEMENTATION                     |\n");
  printf("--------------------------------------------------------------\n");
  keyGeneration();
  cipherRSA();
  decipherRSA();
  tend = time(NULL);
  texec = difftime(tend, tbegin);
  printf("[Execution time] %d seconds\n", (int)texec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x14(%rbp)
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <keyGeneration@plt>
mov    $0x0,%al
call   1030 <cipherRSA@plt>
mov    $0x0,%al
call   1060 <decipherRSA@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <difftime@plt>
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%ebp
lea    0xed9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <keyGeneration@plt>
xor    %eax,%eax
call   1040 <cipherRSA@plt>
xor    %eax,%eax
call   1070 <decipherRSA@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <difftime@plt>
cvttsd2si %xmm0,%esi
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [64 x i8] c"--------------------------------------------------------------\0A\00"
@.str.1 = [64 x i8] c"| RSA IMPLEMENTATION |\0A\00"
@.str.2 = [29 x i8] c"[Execution time] %d seconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %8
%9 = call i32 @time(i32* null)
store i32 %9, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @keyGeneration()
%14 = call i32 (...) @cipherRSA()
%15 = call i32 (...) @decipherRSA()
%16 = call i32 @time(i32* null)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = call double @difftime(i32 %17, i32 %18)
store double %19, double* %8
%20 = load double, double* %8
%21 = fptosi double %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [29 x i8] c"[Execution time] %d seconds\0A\00"
@str.3 = [63 x i8] c"| RSA IMPLEMENTATION |\00"
@str.4 = [63 x i8] c"--------------------------------------------------------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 (...) @keyGeneration()
%8 = tail call i32 (...) @cipherRSA()
%9 = tail call i32 (...) @decipherRSA()
%10 = tail call i32 @time(i32* null)
%11 = tail call double @difftime(i32 %10, i32 %3)
%12 = fptosi double %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}