#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 *G_AllocCreateNamesList(char *, char *, char);
int /*<<< orphan*/ trap_Cvar_ForceSet(char *, char *);
int /*<<< orphan*/ trap_MemFree(char *, char *, int);
void G_Gametype_GenerateGametypesList(void) {
  char *scriptsList;
  scriptsList = G_AllocCreateNamesList("progs/gametypes", ".gt", ';');
  if (!scriptsList) {
    trap_Cvar_ForceSet("g_gametypes_list", "dm;");
    return;
  }
  trap_Cvar_ForceSet("g_gametypes_list", scriptsList);
  trap_MemFree(scriptsList,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/"
               "heads/master/game/g_gametypes.c",
               1842);
}


x86 assembly (clang, -O0):
<G_Gametype_GenerateGametypesList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x3b,%edx
call   1050 <G_AllocCreateNamesList@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1177 <G_Gametype_GenerateGametypesList+0x47>
lea    0xeae(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <trap_Cvar_ForceSet@plt>
jmp    119c <G_Gametype_GenerateGametypesList+0x6c>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <trap_Cvar_ForceSet@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x732,%edx
call   1040 <trap_MemFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_Gametype_GenerateGametypesList>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x3b,%edx
call   1050 <G_AllocCreateNamesList@plt>
test   %rax,%rax
je     1175 <G_Gametype_GenerateGametypesList+0x45>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1030 <trap_Cvar_ForceSet@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x732,%edx
pop    %rbx
jmp    1040 <trap_MemFree@plt>
lea    0xe98(%rip),%rdi
lea    0xea2(%rip),%rsi
pop    %rbx
jmp    1030 <trap_Cvar_ForceSet@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"progs/gametypes\00"
@.str.1 = [4 x i8] c".gt\00"
@.str.2 = [17 x i8] c"g_gametypes_list\00"
@.str.3 = [4 x i8] c"dm;\00"
@.str.4 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_gametypes.c\00"
define void @G_Gametype_GenerateGametypesList() {
%1 = alloca i8*
%2 = call i8* @G_AllocCreateNamesList(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 59)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %12
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %1
%11 = call i32 @trap_MemFree(i8* %10, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.4, i64 0, i64 0), i32 1842)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"progs/gametypes\00"
@.str.1 = [4 x i8] c".gt\00"
@.str.2 = [17 x i8] c"g_gametypes_list\00"
@.str.3 = [4 x i8] c"dm;\00"
@.str.4 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_gametypes.c\00"
define void @G_Gametype_GenerateGametypesList() {
%1 = tail call i8* @G_AllocCreateNamesList(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 59)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 @trap_Cvar_ForceSet(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%7 = tail call i32 @trap_MemFree(i8* %1, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.4, i64 0, i64 0), i32 1842)
br label %8
8: ; preds = %5, %3
ret void
}