#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 */
int /*<<< orphan*/ nxtDisplayCenteredTextLine(int, char *, ...);
int /*<<< orphan*/ wait1Msec(float);
void waitForTime(float durationSecs) {
  nxtDisplayCenteredTextLine(5, "Wait(Time=%.2f)", durationSecs);
  wait1Msec(durationSecs * 1000);
  nxtDisplayCenteredTextLine(2, "Wait(Time=%.2f)", durationSecs);
  nxtDisplayCenteredTextLine(3, "");
  nxtDisplayCenteredTextLine(5, "");
  nxtDisplayCenteredTextLine(7, "");
}


x86 assembly (clang, -O0):
<waitForTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x5,%edi
lea    0xec2(%rip),%rsi
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  0xeaf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <wait1Msec@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x2,%edi
lea    0xe94(%rip),%rsi
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x3,%edi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x5,%edi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x7,%edi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForTime>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xec8(%rip),%rbx
mov    $0x5,%edi
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  0x4(%rsp),%xmm0
mulss  0xea7(%rip),%xmm0
call   1040 <wait1Msec@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
lea    0xe99(%rip),%rbx
mov    $0x3,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <nxtDisplayCenteredTextLine@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Wait(Time=%.2f)\00"
@.str.1 = [1 x i8] zeroinitializer
define void @waitForTime(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %4)
%6 = load float, float* %2
%7 = fmul float %6, 1.000000e+03
%8 = call i32 @wait1Msec(float %7)
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10)
%12 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Wait(Time=%.2f)\00"
@.str.1 = [1 x i8] zeroinitializer
define void @waitForTime(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = fmul float %0, 1.000000e+03
%5 = tail call i32 @wait1Msec(float %4)
%6 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%7 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}