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

/* Variables and functions */
int /*<<< orphan*/ A_REVERSE;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int, int, char *, int, int, int, int, float);
int /*<<< orphan*/ refresh();
void print_time(time_t start_t, time_t end_t, int mistakes) {
  long int diff;
  int h, m, s;
  float wpm;
  diff = end_t - start_t;
  wpm = ((60 / 5) / (double)diff) * 60;
  h = (int)(diff / 3600);
  diff -= h * 3600;
  m = (int)(diff / 60);
  diff -= m * 60;
  s = (int)diff;
  attron(A_REVERSE);
  mvprintw(25, 1,
           "Mistakes made : %d time taken: %d:%d:%d WPM : %.2f    Press any "
           "Key to continue",
           mistakes, h, m, s, wpm);
  attroff(A_REVERSE);
  refresh();
  getch();
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2sdq -0x20(%rbp),%xmm1
movsd  0xe8b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,-0x24(%rbp)
imul   $0xe10,-0x24(%rbp),%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %eax,-0x28(%rbp)
imul   $0x3c,-0x28(%rbp),%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
mov    -0x14(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%eax
movss  -0x30(%rbp),%xmm0
mov    $0x19,%edi
mov    $0x1,%esi
lea    0xdf8(%rip),%rdx
mov    %eax,(%rsp)
call   1070 <mvprintw@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
sub    %rdi,%rbx
cvtsi2sd %rbx,%xmm0
movsd  0xe91(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xe8d(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %edx,%r14d
movabs $0x48d159e26af37c05,%rcx
59 d1 48
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%r15
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xa,%r15
add    %rax,%r15
movabs $0xe1000000000,%rax
imul   %r15,%rax
sar    $0x20,%rax
sub    %rax,%rbx
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rbp
add    %rbx,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x5,%rbp
add    %rax,%rbp
movabs $0x3c00000000,%rax
imul   %rbp,%rax
shr    $0x20,%rax
sub    %eax,%ebx
mov    0x2de0(%rip),%r12
mov    (%r12),%edi
call   1040 <attron@plt>
mov    %ebx,(%rsp)
lea    0xdfd(%rip),%rdx
mov    $0x19,%edi
mov    $0x1,%esi
mov    %r14d,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
movss  0xc(%rsp),%xmm0
call   1070 <mvprintw@plt>
mov    (%r12),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <getch@plt>

LLVM IR (-O0):
@A_REVERSE = global i32 0
@.str = [80 x i8] c"Mistakes made : %d time taken: %d:%d:%d WPM : %.2f Press any Key to continue\00"
define void @print_time(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = sub nsw i64 %12, %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = sitofp i64 %15 to double
%17 = fdiv double 1.200000e+01, %16
%18 = fmul double %17, 6.000000e+01
%19 = fptrunc double %18 to float
store float %19, float* %11
%20 = load i64, i64* %7
%21 = sdiv i64 %20, 3600
%22 = trunc i64 %21 to i32
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = mul nsw i32 %23, 3600
%25 = sext i32 %24 to i64
%26 = load i64, i64* %7
%27 = sub nsw i64 %26, %25
store i64 %27, i64* %7
%28 = load i64, i64* %7
%29 = sdiv i64 %28, 60
%30 = trunc i64 %29 to i32
store i32 %30, i32* %9
%31 = load i32, i32* %9
%32 = mul nsw i32 %31, 60
%33 = sext i32 %32 to i64
%34 = load i64, i64* %7
%35 = sub nsw i64 %34, %33
store i64 %35, i64* %7
%36 = load i64, i64* %7
%37 = trunc i64 %36 to i32
store i32 %37, i32* %10
%38 = load i32, i32* @A_REVERSE
%39 = call i32 @attron(i32 %38)
%40 = load i32, i32* %6
%41 = load i32, i32* %8
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = load float, float* %11
%45 = call i32 @mvprintw(i32 25, i32 1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %41, i32 %42, i32 %43, float %44)
%46 = load i32, i32* @A_REVERSE
%47 = call i32 @attroff(i32 %46)
%48 = call i32 (...) @refresh()
%49 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@A_REVERSE = global i32 0
@.str = [80 x i8] c"Mistakes made : %d time taken: %d:%d:%d WPM : %.2f Press any Key to continue\00"
define void @print_time(i64 %0, i64 %1, i32 %2) {
%4 = sub nsw i64 %1, %0
%5 = sitofp i64 %4 to double
%6 = fdiv double 1.200000e+01, %5
%7 = fmul double %6, 6.000000e+01
%8 = fptrunc double %7 to float
%9 = sdiv i64 %4, 3600
%10 = trunc i64 %9 to i32
%11 = mul i64 %9, 15461882265600
%12 = ashr exact i64 %11, 32
%13 = sub nsw i64 %4, %12
%14 = sdiv i64 %13, 60
%15 = trunc i64 %14 to i32
%16 = mul i64 %14, 257698037760
%17 = lshr exact i64 %16, 32
%18 = sub i64 %13, %17
%19 = trunc i64 %18 to i32
%20 = load i32, i32* @A_REVERSE
%21 = tail call i32 @attron(i32 %20)
%22 = tail call i32 @mvprintw(i32 25, i32 1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %10, i32 %15, i32 %19, float %8)
%23 = load i32, i32* @A_REVERSE
%24 = tail call i32 @attroff(i32 %23)
%25 = tail call i32 (...) @refresh()
%26 = tail call i32 (...) @getch()
ret void
}