#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_sprintf(char *, int, char *, char *, char *);
char *FS_Gamedir();
scalar_t__ strncmp(char *, char *, int);
void CL_DownloadFileName(char *dest, int destlen, char *fn) {
  if (strncmp(fn, "players", 7) == 0)
    Com_sprintf(dest, destlen, "%s/%s", "baseq2", fn);
  else
    Com_sprintf(dest, destlen, "%s/%s", FS_Gamedir(), fn);
}


x86 assembly (clang, -O0):
<CL_DownloadFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1185 <CL_DownloadFileName+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r8
lea    0xe94(%rip),%rdx
lea    0xe93(%rip),%rcx
call   1050 <Com_sprintf@plt>
jmp    11b4 <CL_DownloadFileName+0x84>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <FS_Gamedir@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %rax,%rcx
mov    -0x18(%rbp),%r8
lea    0xe59(%rip),%rdx
call   1050 <Com_sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_DownloadFileName>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0xebc(%rip),%rsi
mov    %rdx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1162 <CL_DownloadFileName+0x32>
xor    %eax,%eax
call   1040 <FS_Gamedir@plt>
mov    %rax,%rcx
jmp    1169 <CL_DownloadFileName+0x39>
lea    0xea5(%rip),%rcx
lea    0xe98(%rip),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <Com_sprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"players\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [7 x i8] c"baseq2\00"
define void @CL_DownloadFileName(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @Com_sprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %13)
br label %21
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = call i8* (...) @FS_Gamedir()
%19 = load i8*, i8** %6
%20 = call i32 @Com_sprintf(i8* %16, i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
br label %21
21: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"players\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [7 x i8] c"baseq2\00"
define void @CL_DownloadFileName(i8* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* (...) @FS_Gamedir()
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ]
%10 = tail call i32 @Com_sprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %2)
ret void
}