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

/* Variables and functions */
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int /*<<< orphan*/ trap_Cvar_Set(char *, char *);
int trap_Cvar_VariableValue(char *);
void CG_SetCharacter(void) {
  char buff[16];
  memset(&buff, 0, sizeof(buff));
  buff[0] = 'C';
  buff[1] = 48 + trap_Cvar_VariableValue("char_strength");
  buff[2] = 48 + trap_Cvar_VariableValue("char_technical");
  buff[3] = 48 + trap_Cvar_VariableValue("char_stamina");
  buff[4] = 48 + trap_Cvar_VariableValue("char_accuracy");
  buff[5] = 48 + trap_Cvar_VariableValue("char_speed");
  buff[6] = 48 + trap_Cvar_VariableValue("char_stealth");
  buff[7] = '\0';
  trap_Cvar_Set("ui_character", buff);
  trap_Cvar_Set("character", buff);
}


x86 assembly (clang, -O0):
<CG_SetCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movb   $0x43,-0x10(%rbp)
lea    0xead(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xf(%rbp)
lea    0xea9(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xe(%rbp)
lea    0xea6(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xd(%rbp)
lea    0xea1(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xc(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xb(%rbp)
lea    0xe96(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%eax
mov    %al,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1050 <trap_Cvar_Set@plt>
lea    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1050 <trap_Cvar_Set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_SetCharacter>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movb   $0x43,(%rsp)
lea    0xeae(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x1(%rsp)
lea    0xeaa(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x2(%rsp)
lea    0xea7(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x3(%rsp)
lea    0xea2(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x4(%rsp)
lea    0xe9e(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x5(%rsp)
lea    0xe97(%rip),%rdi
call   1040 <trap_Cvar_VariableValue@plt>
add    $0x30,%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
call   1050 <trap_Cvar_Set@plt>
lea    0xe81(%rip),%rdi
mov    %rbx,%rsi
call   1050 <trap_Cvar_Set@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"char_strength\00"
@.str.1 = [15 x i8] c"char_technical\00"
@.str.2 = [13 x i8] c"char_stamina\00"
@.str.3 = [14 x i8] c"char_accuracy\00"
@.str.4 = [11 x i8] c"char_speed\00"
@.str.5 = [13 x i8] c"char_stealth\00"
@.str.6 = [13 x i8] c"ui_character\00"
@.str.7 = [10 x i8] c"character\00"
define void @CG_SetCharacter() {
%1 = alloca [16 x i8]
%2 = bitcast [16 x i8]* %1 to i8**
%3 = call i32 @memset(i8** %2, i32 0, i32 16)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
store i8 67, i8* %4
%5 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i32 48, %5
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 2
store i8 %11, i8* %12
%13 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%14 = add nsw i32 48, %13
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 3
store i8 %15, i8* %16
%17 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%18 = add nsw i32 48, %17
%19 = trunc i32 %18 to i8
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 4
store i8 %19, i8* %20
%21 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%22 = add nsw i32 48, %21
%23 = trunc i32 %22 to i8
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
store i8 %23, i8* %24
%25 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%26 = add nsw i32 48, %25
%27 = trunc i32 %26 to i8
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 6
store i8 %27, i8* %28
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 7
store i8 0, i8* %29
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%31 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%33 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %32)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"char_strength\00"
@.str.1 = [15 x i8] c"char_technical\00"
@.str.2 = [13 x i8] c"char_stamina\00"
@.str.3 = [14 x i8] c"char_accuracy\00"
@.str.4 = [11 x i8] c"char_speed\00"
@.str.5 = [13 x i8] c"char_stealth\00"
@.str.6 = [13 x i8] c"ui_character\00"
@.str.7 = [10 x i8] c"character\00"
define void @CG_SetCharacter() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = bitcast [16 x i8]* %1 to i8**
%4 = call i32 @memset(i8** %3, i32 0, i32 16)
store i8 67, i8* %2
%5 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 48
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = trunc i32 %9 to i8
%11 = add i8 %10, 48
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 2
store i8 %11, i8* %12
%13 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%14 = trunc i32 %13 to i8
%15 = add i8 %14, 48
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 3
store i8 %15, i8* %16
%17 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%18 = trunc i32 %17 to i8
%19 = add i8 %18, 48
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 4
store i8 %19, i8* %20
%21 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%22 = trunc i32 %21 to i8
%23 = add i8 %22, 48
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
store i8 %23, i8* %24
%25 = call i32 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%26 = trunc i32 %25 to i8
%27 = add i8 %26, 48
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 6
store i8 %27, i8* %28
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 7
store i8 0, i8* %29
%30 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%31 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %2)
ret void
}