#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 */
int /*<<< orphan*/ Com_DPrintf(char *, char const *, char const *);
char *FS_PakNameForFile(char const *);
int /*<<< orphan*/ SV_AddPurePak(char const *);
int /*<<< orphan*/ strlen(char const *);
void SV_AddPureFile(const char *filename) {
  const char *pakname;
  if (!filename || !strlen(filename))
    return;
  pakname = FS_PakNameForFile(filename);
  if (pakname) {
    Com_DPrintf("Pure file: %s (%s)\n", pakname, filename);
    SV_AddPurePak(pakname);
  }
}


x86 assembly (clang, -O0):
<SV_AddPureFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <SV_AddPureFile+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    116e <SV_AddPureFile+0x2e>
jmp    11a3 <SV_AddPureFile+0x63>
mov    -0x8(%rbp),%rdi
call   1060 <FS_PakNameForFile@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a3 <SV_AddPureFile+0x63>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe6b(%rip),%rdi
call   1050 <Com_DPrintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <SV_AddPurePak@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_AddPureFile>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1186 <SV_AddPureFile+0x46>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1186 <SV_AddPureFile+0x46>
mov    %rbx,%rdi
call   1060 <FS_PakNameForFile@plt>
test   %rax,%rax
je     1186 <SV_AddPureFile+0x46>
mov    %rax,%r14
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1050 <Com_DPrintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <SV_AddPurePak@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Pure file: %s (%s)\0A\00"
define void @SV_AddPureFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %1
br label %22
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = call i8* @FS_PakNameForFile(i8* %12)
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = call i32 @Com_DPrintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18)
%20 = load i8*, i8** %3
%21 = call i32 @SV_AddPurePak(i8* %20)
br label %22
22: ; preds = %10, %16, %11
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Pure file: %s (%s)\0A\00"
define void @SV_AddPureFile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i8* @FS_PakNameForFile(i8* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 @Com_DPrintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %0)
%11 = tail call i32 @SV_AddPurePak(i8* %7)
br label %12
12: ; preds = %6, %9, %1, %3
ret void
}