#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();
char *Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *, ...);
int GetCvarInt(char *);
int /*<<< orphan*/ atoi(char *);
void Cmd_BotRemove() {
  int argc = Cmd_Argc();
  if (argc != 2) {
    Com_Printf("Usage: bot_remove <client number>\n");
    return;
  }
  if (GetCvarInt("sv_running") < 1) {
    Com_Printf("Server is not running.\n");
    return;
  }
  char *client = Cmd_Argv(1);
  Com_Printf("Would attempt to remove client %i here\n", atoi(client));
}


x86 assembly (clang, -O0):
<Cmd_BotRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     117f <Cmd_BotRemove+0x2f>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <Com_Printf@plt>
jmp    11ce <Cmd_BotRemove+0x7e>
lea    0xe9d(%rip),%rdi
call   1040 <GetCvarInt@plt>
cmp    $0x1,%eax
jge    11a7 <Cmd_BotRemove+0x57>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <Com_Printf@plt>
jmp    11ce <Cmd_BotRemove+0x7e>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_BotRemove>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    1190 <Cmd_BotRemove+0x40>
lea    0xebf(%rip),%rdi
call   1040 <GetCvarInt@plt>
test   %eax,%eax
jle    1199 <Cmd_BotRemove+0x49>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rax,%rdi
call   1070 <atoi@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <Com_Printf@plt>
lea    0xe69(%rip),%rdi
jmp    11a0 <Cmd_BotRemove+0x50>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1050 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: bot_remove <client number>\0A\00"
@.str.1 = [11 x i8] c"sv_running\00"
@.str.2 = [24 x i8] c"Server is not running.\0A\00"
@.str.3 = [40 x i8] c"Would attempt to remove client %i here\0A\00"
define void @Cmd_BotRemove() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @Cmd_Argc()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %0
%9 = call i32 @GetCvarInt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %18
13: ; preds = %8
%14 = call i8* @Cmd_Argv(i32 1)
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = call i32 @atoi(i8* %15)
%17 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %13, %11, %6
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: bot_remove <client number>\0A\00"
@.str.1 = [11 x i8] c"sv_running\00"
@.str.2 = [24 x i8] c"Server is not running.\0A\00"
@.str.3 = [40 x i8] c"Would attempt to remove client %i here\0A\00"
define void @Cmd_BotRemove() {
%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 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %14
5: ; preds = %0
%6 = tail call i32 @GetCvarInt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %14
10: ; preds = %5
%11 = tail call i8* @Cmd_Argv(i32 1)
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %8, %3
ret void
}