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

/* Variables and functions */
int /*<<< orphan*/ Q_snprintfz(char *, int, char *, int);
int /*<<< orphan*/ trap_Cvar_ForceSet(char *, char *);
void CG_SetChatCvars(int x, int y, char *fontName, int font_height, int width,
                     int height, int padding_x, int padding_y) {
  char tstr[32];
  trap_Cvar_ForceSet("con_chatCGame", "1");
  trap_Cvar_ForceSet("con_chatFont", fontName);
  Q_snprintfz(tstr, sizeof(tstr), "%i", x + padding_x);
  trap_Cvar_ForceSet("con_chatX", tstr);
  Q_snprintfz(tstr, sizeof(tstr), "%i", y + height - padding_y - font_height);
  trap_Cvar_ForceSet("con_chatY", tstr);
  Q_snprintfz(tstr, sizeof(tstr), "%i", width - padding_x);
  trap_Cvar_ForceSet("con_chatWidth", tstr);
}


x86 assembly (clang, -O0):
<CG_SetChatCvars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
lea    0xeb6(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <trap_Cvar_ForceSet@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <trap_Cvar_ForceSet@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%ecx
add    0x10(%rbp),%ecx
mov    $0x20,%esi
lea    0xea1(%rip),%rdx
call   1040 <Q_snprintfz@plt>
lea    -0x40(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <trap_Cvar_ForceSet@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%ecx
add    -0x1c(%rbp),%ecx
sub    0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
mov    $0x20,%esi
lea    0xe70(%rip),%rdx
call   1040 <Q_snprintfz@plt>
lea    -0x40(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1030 <trap_Cvar_ForceSet@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%ecx
sub    0x10(%rbp),%ecx
mov    $0x20,%esi
lea    0xe45(%rip),%rdx
call   1040 <Q_snprintfz@plt>
lea    -0x40(%rbp),%rsi
lea    0xe4c(%rip),%rdi
call   1030 <trap_Cvar_ForceSet@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_SetChatCvars>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%r12d
lea    0xeb9(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <trap_Cvar_ForceSet@plt>
lea    0xeb6(%rip),%rdi
mov    %r15,%rsi
call   1030 <trap_Cvar_ForceSet@plt>
add    0x70(%rsp),%r12d
lea    0xeaf(%rip),%r13
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x20,%esi
mov    %r13,%rdx
mov    %r12d,%ecx
call   1040 <Q_snprintfz@plt>
lea    0xe93(%rip),%rdi
mov    %r15,%rsi
call   1030 <trap_Cvar_ForceSet@plt>
add    0xc(%rsp),%ebp
add    0x78(%rsp),%ebx
sub    %ebx,%ebp
mov    %r15,%rdi
mov    $0x20,%esi
mov    %r13,%rdx
mov    %ebp,%ecx
call   1040 <Q_snprintfz@plt>
lea    0xe72(%rip),%rdi
mov    %r15,%rsi
call   1030 <trap_Cvar_ForceSet@plt>
sub    0x70(%rsp),%r14d
mov    %r15,%rdi
mov    $0x20,%esi
mov    %r13,%rdx
mov    %r14d,%ecx
call   1040 <Q_snprintfz@plt>
lea    0xe55(%rip),%rdi
mov    %r15,%rsi
call   1030 <trap_Cvar_ForceSet@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"con_chatCGame\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [13 x i8] c"con_chatFont\00"
@.str.3 = [3 x i8] c"%i\00"
@.str.4 = [10 x i8] c"con_chatX\00"
@.str.5 = [10 x i8] c"con_chatY\00"
@.str.6 = [14 x i8] c"con_chatWidth\00"
define void @CG_SetChatCvars(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [32 x i8]
store i32 %0, i32* %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%18 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = load i8*, i8** %11
%20 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%22 = load i32, i32* %9
%23 = load i32, i32* %15
%24 = add nsw i32 %22, %23
%25 = call i32 @Q_snprintfz(i8* %21, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%27 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%29 = load i32, i32* %10
%30 = load i32, i32* %14
%31 = add nsw i32 %29, %30
%32 = load i32, i32* %16
%33 = sub nsw i32 %31, %32
%34 = load i32, i32* %12
%35 = sub nsw i32 %33, %34
%36 = call i32 @Q_snprintfz(i8* %28, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%38 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %37)
%39 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%40 = load i32, i32* %13
%41 = load i32, i32* %15
%42 = sub nsw i32 %40, %41
%43 = call i32 @Q_snprintfz(i8* %39, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%45 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %44)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"con_chatCGame\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [13 x i8] c"con_chatFont\00"
@.str.3 = [3 x i8] c"%i\00"
@.str.4 = [10 x i8] c"con_chatX\00"
@.str.5 = [10 x i8] c"con_chatY\00"
@.str.6 = [14 x i8] c"con_chatWidth\00"
define void @CG_SetChatCvars(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca [32 x i8]
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = tail call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%13 = add nsw i32 %6, %0
%14 = call i32 @Q_snprintfz(i8* %10, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%16 = add i32 %1, %5
%17 = add i32 %3, %7
%18 = sub i32 %16, %17
%19 = call i32 @Q_snprintfz(i8* %10, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%21 = sub nsw i32 %4, %6
%22 = call i32 @Q_snprintfz(i8* %10, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %10)
ret void
}