#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 Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int Com_Milliseconds();
int /*<<< orphan*/ Com_Printf(char *);
float atof(int /*<<< orphan*/);
void Com_Freeze_f(void) {
  float s;
  int start, now;
  if (Cmd_Argc() != 2) {
    Com_Printf("freeze <seconds>\n");
    return;
  }
  s = atof(Cmd_Argv(1));
  start = Com_Milliseconds();
  while (1) {
    now = Com_Milliseconds();
    if ((now - start) * 0.001 > s) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<Com_Freeze_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     1179 <Com_Freeze_f+0x29>
lea    0xe99(%rip),%rdi
call   1060 <Com_Printf@plt>
jmp    11d6 <Com_Freeze_f+0x86>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <atof@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Com_Milliseconds@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <Com_Milliseconds@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d1 <Com_Freeze_f+0x81>
jmp    11d6 <Com_Freeze_f+0x86>
jmp    1199 <Com_Freeze_f+0x49>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Freeze_f>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    11c6 <Com_Freeze_f+0x76>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <atof@plt>
movss  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <Com_Milliseconds@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <Com_Milliseconds@plt>
sub    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe48(%rip),%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    11a0 <Com_Freeze_f+0x50>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe3b(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"freeze <seconds>\0A\00"
define void @Com_Freeze_f() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @Cmd_Argc()
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @Com_Printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %24
8: ; preds = %0
%9 = call i32 @Cmd_Argv(i32 1)
%10 = call float @atof(i32 %9)
store float %10, float* %1
%11 = call i32 (...) @Com_Milliseconds()
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %23
%13 = call i32 (...) @Com_Milliseconds()
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = sub nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 1.000000e-03
%19 = load float, float* %1
%20 = fpext float %19 to double
%21 = fcmp ogt double %18, %20
br i1 %21, label %22, label %23
22: ; preds = %12
br label %24
23: ; preds = %12
br label %12
24: ; preds = %6, %22
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"freeze <seconds>\0A\00"
define void @Com_Freeze_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %16
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call float @atof(i32 %6)
%8 = tail call i32 (...) @Com_Milliseconds()
%9 = fpext float %7 to double
br label %10
10: ; preds = %10, %5
%11 = tail call i32 (...) @Com_Milliseconds()
%12 = sub nsw i32 %11, %8
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 1.000000e-03
%15 = fcmp ogt double %14, %9
br i1 %15, label %16, label %10
16: ; preds = %10, %3
ret void
}