#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 *, double);
int /*<<< orphan*/ render(int, int, int, int, double, double, double);
int main(int argc, char *argv[]) {
  clock_t begin = clock();
  render(1250, 800, 120, 10, 2000.0, 1.4, 0.55);
  clock_t end = clock();
  double time_spent = (double)(end - begin) / CLOCKS_PER_SEC * 1000;
  printf("Elapsed: %f ms\n", time_spent);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    $0x4e2,%edi
mov    $0x320,%esi
mov    $0x78,%edx
mov    $0xa,%ecx
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
movsd  0xe9b(%rip),%xmm2
call   1050 <render@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e47(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe53(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
movsd  0xebd(%rip),%xmm0
movsd  0xebd(%rip),%xmm1
movsd  0xebd(%rip),%xmm2
mov    $0x4e2,%edi
mov    $0x320,%esi
mov    $0x78,%edx
mov    $0xa,%ecx
call   1050 <render@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e63(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xe87(%rip),%xmm0
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [16 x i8] c"Elapsed: %f ms\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 (...) @clock()
store i64 %9, i64* %6
%10 = call i32 @render(i32 1250, i32 800, i32 120, i32 10, double 2.000000e+03, double 1.400000e+00, double 5.500000e-01)
%11 = call i64 (...) @clock()
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = sub nsw i64 %12, %13
%15 = sitofp i64 %14 to double
%16 = load double, double* @CLOCKS_PER_SEC
%17 = fdiv double %15, %16
%18 = fmul double %17, 1.000000e+03
store double %18, double* %8
%19 = load double, double* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [16 x i8] c"Elapsed: %f ms\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @clock()
%4 = tail call i32 @render(i32 1250, i32 800, i32 120, i32 10, double 2.000000e+03, double 1.400000e+00, double 5.500000e-01)
%5 = tail call i64 (...) @clock()
%6 = sub nsw i64 %5, %3
%7 = sitofp i64 %6 to double
%8 = load double, double* @CLOCKS_PER_SEC
%9 = fdiv double %7, %8
%10 = fmul double %9, 1.000000e+03
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}