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

/* Variables and functions */
char *Info_ValueForKey(char const *, char *);
int Q_stricmp(char const *, char const *);
char *UI_GetBotInfoByNumber(int);
int UI_BotSelectMenu_SortCompare(const void *arg1, const void *arg2) {
  int num1, num2;
  const char *info1, *info2;
  const char *name1, *name2;
  num1 = *(int *)arg1;
  num2 = *(int *)arg2;
  info1 = UI_GetBotInfoByNumber(num1);
  info2 = UI_GetBotInfoByNumber(num2);
  name1 = Info_ValueForKey(info1, "name");
  name2 = Info_ValueForKey(info2, "name");
  return Q_stricmp(name1, name2);
}


x86 assembly (clang, -O0):
<UI_BotSelectMenu_SortCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <UI_GetBotInfoByNumber@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <UI_GetBotInfoByNumber@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <Info_ValueForKey@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1040 <Info_ValueForKey@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1030 <Q_stricmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_BotSelectMenu_SortCompare>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%ebx
call   1050 <UI_GetBotInfoByNumber@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1050 <UI_GetBotInfoByNumber@plt>
mov    %rax,%r12
lea    0xeab(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <Info_ValueForKey@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <Info_ValueForKey@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Q_stricmp@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"name\00"
define i32 @UI_BotSelectMenu_SortCompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = call i8* @UI_GetBotInfoByNumber(i32 %17)
store i8* %18, i8** %7
%19 = load i32, i32* %6
%20 = call i8* @UI_GetBotInfoByNumber(i32 %19)
store i8* %20, i8** %8
%21 = load i8*, i8** %7
%22 = call i8* @Info_ValueForKey(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %22, i8** %9
%23 = load i8*, i8** %8
%24 = call i8* @Info_ValueForKey(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %24, i8** %10
%25 = load i8*, i8** %9
%26 = load i8*, i8** %10
%27 = call i32 @Q_stricmp(i8* %25, i8* %26)
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"name\00"
define i32 @UI_BotSelectMenu_SortCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i8* @UI_GetBotInfoByNumber(i32 %4)
%8 = tail call i8* @UI_GetBotInfoByNumber(i32 %6)
%9 = tail call i8* @Info_ValueForKey(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = tail call i8* @Info_ValueForKey(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @Q_stricmp(i8* %9, i8* %10)
ret i32 %11
}