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

/* Variables and functions */
char *Info_ValueForKey(char *, char *);
int /*<<< orphan*/ UI_EscapeEmoticons(char *, char *, int);
int /*<<< orphan*/ trap_Cvar_Set(char *, char *);
scalar_t__ trap_GetConfigString(int /*<<< orphan*/, char *, int);
void UI_ServerInfo(void) {
  char info[1024];
  char hostname[80];
  info[0] = '\0';
  if (trap_GetConfigString(0, info, sizeof(info))) {
    trap_Cvar_Set("ui_serverinfo_mapname", Info_ValueForKey(info, "mapname"));
    trap_Cvar_Set("ui_serverinfo_timelimit",
                  Info_ValueForKey(info, "timelimit"));
    trap_Cvar_Set("ui_serverinfo_sd",
                  Info_ValueForKey(info, "g_suddenDeathTime"));
    UI_EscapeEmoticons(hostname, Info_ValueForKey(info, "sv_hostname"),
                       sizeof(hostname));
    trap_Cvar_Set("ui_serverinfo_hostname", hostname);
    trap_Cvar_Set("ui_serverinfo_maxclients",
                  Info_ValueForKey(info, "sv_maxclients"));
    trap_Cvar_Set("ui_serverinfo_version", Info_ValueForKey(info, "version"));
    trap_Cvar_Set("ui_serverinfo_unlagged",
                  Info_ValueForKey(info, "g_unlagged"));
    trap_Cvar_Set("ui_serverinfo_friendlyFire",
                  Info_ValueForKey(info, "g_friendlyFire"));
    trap_Cvar_Set("ui_serverinfo_friendlyBuildableFire",
                  Info_ValueForKey(info, "g_friendlyBuildableFire"));
    trap_Cvar_Set("ui_serverinfo_allowdl",
                  Info_ValueForKey(info, "sv_allowdownload"));
  }
}


x86 assembly (clang, -O0):
<UI_ServerInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movb   $0x0,-0x400(%rbp)
lea    -0x400(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1040 <trap_GetConfigString@plt>
cmp    $0x0,%rax
je     12e9 <UI_ServerInfo+0x1a9>
lea    -0x400(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe68(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe5e(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x450(%rbp),%rax
mov    %rax,-0x458(%rbp)
lea    -0x400(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    -0x458(%rbp),%rdi
mov    %rax,%rsi
mov    $0x50,%edx
call   1050 <UI_EscapeEmoticons@plt>
lea    -0x450(%rbp),%rsi
lea    0xe45(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe3a(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe3f(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe33(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe33(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe3b(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
lea    -0x400(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rsi
lea    0xe55(%rip),%rdi
call   1060 <trap_Cvar_Set@plt>
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_ServerInfo>:
push   %r14
push   %rbx
sub    $0x458,%rsp
movb   $0x0,0x50(%rsp)
lea    0x50(%rsp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1040 <trap_GetConfigString@plt>
test   %rax,%rax
je     12ad <UI_ServerInfo+0x16d>
lea    0xe9e(%rip),%rsi
lea    0x50(%rsp),%r14
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe7c(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe91(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe74(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe8e(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe6e(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe82(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x50,%edx
call   1050 <UI_EscapeEmoticons@plt>
lea    0xe6c(%rip),%rdi
mov    %rbx,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe8d(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe65(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe8b(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe6e(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe8c(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe66(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xe94(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe6a(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xea9(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe76(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
lea    0xeb9(%rip),%rsi
mov    %r14,%rdi
call   1030 <Info_ValueForKey@plt>
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
call   1060 <trap_Cvar_Set@plt>
add    $0x458,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"ui_serverinfo_mapname\00"
@.str.1 = [8 x i8] c"mapname\00"
@.str.2 = [24 x i8] c"ui_serverinfo_timelimit\00"
@.str.3 = [10 x i8] c"timelimit\00"
@.str.4 = [17 x i8] c"ui_serverinfo_sd\00"
@.str.5 = [18 x i8] c"g_suddenDeathTime\00"
@.str.6 = [12 x i8] c"sv_hostname\00"
@.str.7 = [23 x i8] c"ui_serverinfo_hostname\00"
@.str.8 = [25 x i8] c"ui_serverinfo_maxclients\00"
@.str.9 = [14 x i8] c"sv_maxclients\00"
@.str.10 = [22 x i8] c"ui_serverinfo_version\00"
@.str.11 = [8 x i8] c"version\00"
@.str.12 = [23 x i8] c"ui_serverinfo_unlagged\00"
@.str.13 = [11 x i8] c"g_unlagged\00"
@.str.14 = [27 x i8] c"ui_serverinfo_friendlyFire\00"
@.str.15 = [15 x i8] c"g_friendlyFire\00"
@.str.16 = [36 x i8] c"ui_serverinfo_friendlyBuildableFire\00"
@.str.17 = [24 x i8] c"g_friendlyBuildableFire\00"
@.str.18 = [22 x i8] c"ui_serverinfo_allowdl\00"
@.str.19 = [17 x i8] c"sv_allowdownload\00"
define void @UI_ServerInfo() {
%1 = alloca [1024 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i64 @trap_GetConfigString(i32 0, i8* %4, i32 1024)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %41
7: ; preds = %0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%9 = call i8* @Info_ValueForKey(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%12 = call i8* @Info_ValueForKey(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%15 = call i8* @Info_ValueForKey(i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%19 = call i8* @Info_ValueForKey(i8* %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 @UI_EscapeEmoticons(i8* %17, i8* %19, i32 80)
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%22 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%24 = call i8* @Info_ValueForKey(i8* %23, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%25 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%27 = call i8* @Info_ValueForKey(i8* %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%28 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%30 = call i8* @Info_ValueForKey(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%31 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%33 = call i8* @Info_ValueForKey(i8* %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
%34 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%36 = call i8* @Info_ValueForKey(i8* %35, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0))
%37 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%39 = call i8* @Info_ValueForKey(i8* %38, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
%40 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"ui_serverinfo_mapname\00"
@.str.1 = [8 x i8] c"mapname\00"
@.str.2 = [24 x i8] c"ui_serverinfo_timelimit\00"
@.str.3 = [10 x i8] c"timelimit\00"
@.str.4 = [17 x i8] c"ui_serverinfo_sd\00"
@.str.5 = [18 x i8] c"g_suddenDeathTime\00"
@.str.6 = [12 x i8] c"sv_hostname\00"
@.str.7 = [23 x i8] c"ui_serverinfo_hostname\00"
@.str.8 = [25 x i8] c"ui_serverinfo_maxclients\00"
@.str.9 = [14 x i8] c"sv_maxclients\00"
@.str.10 = [22 x i8] c"ui_serverinfo_version\00"
@.str.11 = [8 x i8] c"version\00"
@.str.12 = [23 x i8] c"ui_serverinfo_unlagged\00"
@.str.13 = [11 x i8] c"g_unlagged\00"
@.str.14 = [27 x i8] c"ui_serverinfo_friendlyFire\00"
@.str.15 = [15 x i8] c"g_friendlyFire\00"
@.str.16 = [36 x i8] c"ui_serverinfo_friendlyBuildableFire\00"
@.str.17 = [24 x i8] c"g_friendlyBuildableFire\00"
@.str.18 = [22 x i8] c"ui_serverinfo_allowdl\00"
@.str.19 = [17 x i8] c"sv_allowdownload\00"
define void @UI_ServerInfo() {
%1 = alloca [1024 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%5 = call i64 @trap_GetConfigString(i32 0, i8* %3, i32 1024)
%6 = icmp eq i64 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %0
%8 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%14 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 @UI_EscapeEmoticons(i8* %4, i8* %14, i32 80)
%16 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %4)
%17 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %17)
%19 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%20 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%21 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%22 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %21)
%23 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
%24 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %23)
%25 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0))
%26 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i8* %25)
%27 = call i8* @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
%28 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %7, %0
ret void
}