#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 /*<<< orphan*/ Com_Printf(char *, int /*<<< orphan*/);
unsigned int Sys_Milliseconds();
int atoi(int /*<<< orphan*/);
void Com_Freeze_f(void) {
  int seconds;
  unsigned int time;
  if (Cmd_Argc() < 2) {
    Com_Printf("Usage: %s <seconds>\n", Cmd_Argv(0));
    return;
  }
  seconds = atoi(Cmd_Argv(1));
  if (seconds < 1) {
    return;
  }
  time = Sys_Milliseconds() + seconds * 1000;
  while (Sys_Milliseconds() < time)
    ;
}


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
jge    1182 <Com_Freeze_f+0x32>
xor    %edi,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    11cd <Com_Freeze_f+0x7d>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    11a5 <Com_Freeze_f+0x55>
jmp    11cd <Com_Freeze_f+0x7d>
mov    $0x0,%al
call   1040 <Sys_Milliseconds@plt>
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <Sys_Milliseconds@plt>
cmp    -0x8(%rbp),%eax
jae    11cd <Com_Freeze_f+0x7d>
jmp    11b8 <Com_Freeze_f+0x68>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Freeze_f>:
push   %rbx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x1,%eax
jg     1173 <Com_Freeze_f+0x23>
xor    %edi,%edi
call   1060 <Cmd_Argv@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <Com_Printf@plt>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
test   %eax,%eax
jle    11ab <Com_Freeze_f+0x5b>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <Sys_Milliseconds@plt>
imul   $0x3e8,%ebx,%ebx
add    %eax,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <Sys_Milliseconds@plt>
cmp    %ebx,%eax
jb     11a0 <Com_Freeze_f+0x50>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s <seconds>\0A\00"
define void @Com_Freeze_f() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @Cmd_Argc()
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 0)
%7 = call i32 @Com_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %24
8: ; preds = %0
%9 = call i32 @Cmd_Argv(i32 1)
%10 = call i32 @atoi(i32 %9)
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %8
br label %24
14: ; preds = %8
%15 = call i32 (...) @Sys_Milliseconds()
%16 = load i32, i32* %1
%17 = mul nsw i32 %16, 1000
%18 = add i32 %15, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %23, %14
%20 = call i32 (...) @Sys_Milliseconds()
%21 = load i32, i32* %2
%22 = icmp ult i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %19
br label %19
24: ; preds = %5, %13, %19
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s <seconds>\0A\00"
define void @Com_Freeze_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @Cmd_Argv(i32 0)
%5 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %17
6: ; preds = %0
%7 = tail call i32 @Cmd_Argv(i32 1)
%8 = tail call i32 @atoi(i32 %7)
%9 = icmp slt i32 %8, 1
br i1 %9, label %17, label %10
10: ; preds = %6
%11 = tail call i32 (...) @Sys_Milliseconds()
%12 = mul nsw i32 %8, 1000
%13 = add i32 %11, %12
br label %14
14: ; preds = %14, %10
%15 = tail call i32 (...) @Sys_Milliseconds()
%16 = icmp ult i32 %15, %13
br i1 %16, label %14, label %17
17: ; preds = %14, %6, %3
ret void
}