#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*/ name;

/* Variables and functions */
char *Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ Cvar_Set(char *, char *);
int /*<<< orphan*/ Cvar_VariableStringBuffer(char *, char *, int);
int /*<<< orphan*/ Sys_Gettext(char *);
void CL_SetModel_f(void) {
  char *arg;
  char name[256];
  arg = Cmd_Argv(1);
  if (arg[0]) {
    Cvar_Set("model", arg);
    Cvar_Set("headmodel", arg);
  } else {
    Cvar_VariableStringBuffer("model", name, sizeof(name));
    Com_Printf(Sys_Gettext("model is set to %s\n"), name);
  }
}


x86 assembly (clang, -O0):
<CL_SetModel_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     119b <CL_SetModel_f+0x4b>
mov    -0x8(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <Cvar_Set@plt>
mov    -0x8(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <Cvar_Set@plt>
jmp    11cd <CL_SetModel_f+0x7d>
lea    -0x110(%rbp),%rsi
lea    0xe5b(%rip),%rdi
mov    $0x100,%edx
call   1070 <Cvar_VariableStringBuffer@plt>
lea    0xe50(%rip),%rdi
call   1060 <Sys_Gettext@plt>
mov    %eax,%edi
lea    -0x110(%rbp),%rsi
call   1040 <Com_Printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_SetModel_f>:
push   %rbx
sub    $0x100,%rsp
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
cmpb   $0x0,(%rax)
je     1190 <CL_SetModel_f+0x40>
mov    %rax,%rbx
lea    0xe93(%rip),%rdi
mov    %rax,%rsi
call   1030 <Cvar_Set@plt>
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
add    $0x100,%rsp
pop    %rbx
jmp    1030 <Cvar_Set@plt>
lea    0xe6d(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x100,%edx
call   1070 <Cvar_VariableStringBuffer@plt>
lea    0xe5c(%rip),%rdi
call   1060 <Sys_Gettext@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <Com_Printf@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"model\00"
@.str.1 = [10 x i8] c"headmodel\00"
@.str.2 = [20 x i8] c"model is set to %s\0A\00"
define void @CL_SetModel_f() {
%1 = alloca i8*
%2 = alloca [256 x i8]
%3 = call i8* @Cmd_Argv(i32 1)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @Cvar_Set(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %1
%12 = call i32 @Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %19
13: ; preds = %0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%15 = call i32 @Cvar_VariableStringBuffer(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14, i32 256)
%16 = call i32 @Sys_Gettext(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%18 = call i32 @Com_Printf(i32 %16, i8* %17)
br label %19
19: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"model\00"
@.str.1 = [10 x i8] c"headmodel\00"
@.str.2 = [20 x i8] c"model is set to %s\0A\00"
define void @CL_SetModel_f() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i8* @Cmd_Argv(i32 1)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @Cvar_Set(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = tail call i32 @Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %13
9: ; preds = %0
%10 = call i32 @Cvar_VariableStringBuffer(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 256)
%11 = call i32 @Sys_Gettext(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @Com_Printf(i32 %11, i8* %2)
br label %13
13: ; preds = %9, %6
ret void
}