#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 */
typedef int /*<<< orphan*/ r_mapname;

/* Variables and functions */
int /*<<< orphan*/ Client_PrepRefresh(char *);
int Cmd_Argc();
char *Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ com_strlcpy(char *, char *, int);
void SV_GameMap_f(void) {
  char *map;
  char r_mapname[32];
  if (Cmd_Argc() != 2) {
    Com_Printf("USAGE: gamemap <map>\n");
    return;
  }
  map = Cmd_Argv(1);
  com_strlcpy(r_mapname, Cmd_Argv(1), sizeof(r_mapname));
  Client_PrepRefresh(r_mapname);
}


x86 assembly (clang, -O0):
<SV_GameMap_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     1179 <SV_GameMap_f+0x29>
lea    0xe91(%rip),%rdi
call   1040 <Com_Printf@plt>
jmp    11b3 <SV_GameMap_f+0x63>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
mov    $0x20,%edx
call   1050 <com_strlcpy@plt>
lea    -0x30(%rbp),%rdi
call   1070 <Client_PrepRefresh@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_GameMap_f>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    1196 <SV_GameMap_f+0x46>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x20,%edx
call   1050 <com_strlcpy@plt>
mov    %rbx,%rdi
call   1070 <Client_PrepRefresh@plt>
add    $0x20,%rsp
pop    %rbx
ret
lea    0xe63(%rip),%rdi
add    $0x20,%rsp
pop    %rbx
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"USAGE: gamemap <map>\0A\00"
define void @SV_GameMap_f() {
%1 = alloca i8*
%2 = alloca [32 x i8]
%3 = call i32 (...) @Cmd_Argc()
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @Com_Printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %0
%8 = call i8* @Cmd_Argv(i32 1)
store i8* %8, i8** %1
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%10 = call i8* @Cmd_Argv(i32 1)
%11 = call i32 @com_strlcpy(i8* %9, i8* %10, i32 32)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%13 = call i32 @Client_PrepRefresh(i8* %12)
br label %14
14: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"USAGE: gamemap <map>\0A\00"
define void @SV_GameMap_f() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @Cmd_Argc()
%4 = icmp eq i32 %3, 2
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %0
%8 = tail call i8* @Cmd_Argv(i32 1)
%9 = tail call i8* @Cmd_Argv(i32 1)
%10 = call i32 @com_strlcpy(i8* %2, i8* %9, i32 32)
%11 = call i32 @Client_PrepRefresh(i8* %2)
br label %12
12: ; preds = %7, %5
ret void
}