#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 */

/* Variables and functions */
scalar_t__ GetTickCount();
int /*<<< orphan*/ printf(char *, float);
void uci_print_nps(int time_start, int nodes) {
  if (!nodes)
    return;
  float time_used_in_sec, nps;
  time_used_in_sec = (float)(((int)(GetTickCount())) - time_start) / 1000;
  if (!time_used_in_sec)
    return;
  nps = (float)nodes / time_used_in_sec;
  printf("info nps %.0f\n", nps);
}


x86 assembly (clang, -O0):
<uci_print_nps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <uci_print_nps+0x1d>
jmp    1198 <uci_print_nps+0x78>
mov    $0x0,%al
call   1040 <GetTickCount@plt>
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1178 <uci_print_nps+0x58>
jp     1178 <uci_print_nps+0x58>
jmp    1198 <uci_print_nps+0x78>
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uci_print_nps>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1167 <uci_print_nps+0x47>
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <GetTickCount@plt>
sub    %ebp,%eax
cvtsi2ss %eax,%xmm1
divss  0xec0(%rip),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    114a <uci_print_nps+0x2a>
jnp    1167 <uci_print_nps+0x47>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
divss  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"info nps %.0f\0A\00"
define void @uci_print_nps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
br label %27
10: ; preds = %2
%11 = call i64 (...) @GetTickCount()
%12 = trunc i64 %11 to i32
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = sitofp i32 %14 to float
%16 = fdiv float %15, 1.000000e+03
store float %16, float* %5
%17 = load float, float* %5
%18 = fcmp une float %17, 0.000000e+00
br i1 %18, label %20, label %19
19: ; preds = %10
br label %27
20: ; preds = %10
%21 = load i32, i32* %4
%22 = sitofp i32 %21 to float
%23 = load float, float* %5
%24 = fdiv float %22, %23
store float %24, float* %6
%25 = load float, float* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %25)
br label %27
27: ; preds = %20, %19, %9
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"info nps %.0f\0A\00"
define void @uci_print_nps(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = tail call i64 (...) @GetTickCount()
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %6, %0
%8 = sitofp i32 %7 to float
%9 = fdiv float %8, 1.000000e+03
%10 = fcmp une float %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = sitofp i32 %1 to float
%13 = fdiv float %12, %9
%14 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %13)
br label %15
15: ; preds = %11, %4, %2
ret void
}