#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*/ name2;
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int /*<<< orphan*/ Com_DPrintf(char *, char *, char *);
int /*<<< orphan*/ Com_sprintf(char *, int, char *, int /*<<< orphan*/, char *,
                               ...);
int /*<<< orphan*/ CopyFile(char *, char *);
int /*<<< orphan*/ FS_CreatePath(char *);
int /*<<< orphan*/ FS_Gamedir();
int /*<<< orphan*/ SV_WipeSavegame(char *);
int /*<<< orphan*/ Sys_FindClose();
char *Sys_FindFirst(char *, int /*<<< orphan*/, int /*<<< orphan*/);
char *Sys_FindNext(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void SV_CopySaveGame(char *src, char *dst) {
  char name[128], name2[128];
  int l, len;
  char *found;
  Com_DPrintf("SV_CopySaveGame(%s, %s)\n", src, dst);
  SV_WipeSavegame(dst);
  Com_sprintf(name, sizeof(name), "%s/save/%s/server.ssv", FS_Gamedir(), src);
  Com_sprintf(name2, sizeof(name2), "%s/save/%s/server.ssv", FS_Gamedir(), dst);
  FS_CreatePath(name2);
  CopyFile(name, name2);
  Com_sprintf(name, sizeof(name), "%s/save/%s/game.ssv", FS_Gamedir(), src);
  Com_sprintf(name2, sizeof(name2), "%s/save/%s/game.ssv", FS_Gamedir(), dst);
  CopyFile(name, name2);
  if (strcmp(dst, "save0")) {
    Com_sprintf(name, sizeof(name), "%s/save/%s/shot.jpg", FS_Gamedir(), src);
    Com_sprintf(name2, sizeof(name2), "%s/save/%s/shot.jpg", FS_Gamedir(), dst);
    CopyFile(name, name2);
  }
  Com_sprintf(name, sizeof(name), "%s/save/%s/", FS_Gamedir(), src);
  len = strlen(name);
  Com_sprintf(name, sizeof(name), "%s/save/%s/*.sav", FS_Gamedir(), src);
  found = Sys_FindFirst(name, 0, 0);
  while (found) {
    strcpy(name + len, found + len);
    Com_sprintf(name2, sizeof(name2), "%s/save/%s/%s", FS_Gamedir(), dst,
                found + len);
    CopyFile(name, name2);
    l = strlen(name);
    strcpy(name + l - 3, "sv2");
    l = strlen(name2);
    strcpy(name2 + l - 3, "sv2");
    CopyFile(name, name2);
    found = Sys_FindNext(0, 0);
  }
  Sys_FindClose();
}


x86 assembly (clang, -O0):
<SV_CopySaveGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe1e(%rip),%rdi
call   10d0 <Com_DPrintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <SV_WipeSavegame@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x140(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xdfb(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x138(%rbp),%rdi
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
mov    $0x80,%esi
lea    0xdc6(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x110(%rbp),%rdi
call   10a0 <FS_CreatePath@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10e0 <CopyFile@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x130(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xd88(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x128(%rbp),%rdi
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
mov    $0x80,%esi
lea    0xd53(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10e0 <CopyFile@plt>
mov    -0x10(%rbp),%rdi
lea    0xd42(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     138d <SV_CopySaveGame+0x1cd>
lea    -0x90(%rbp),%rax
mov    %rax,-0x150(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x150(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xd0b(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x148(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x148(%rbp),%rdi
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
mov    $0x80,%esi
lea    0xcd6(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10e0 <CopyFile@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x160(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xca2(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x118(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x158(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x158(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xc67(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1060 <Sys_FindFirst@plt>
mov    %rax,-0x120(%rbp)
cmpq   $0x0,-0x120(%rbp)
je     153c <SV_CopySaveGame+0x37c>
lea    -0x90(%rbp),%rdi
movslq -0x118(%rbp),%rax
add    %rax,%rdi
mov    -0x120(%rbp),%rsi
movslq -0x118(%rbp),%rax
add    %rax,%rsi
call   1050 <strcpy@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x168(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x168(%rbp),%rdi
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
mov    -0x120(%rbp),%r9
movslq -0x118(%rbp),%rax
add    %rax,%r9
mov    $0x80,%esi
lea    0xbe6(%rip),%rdx
mov    $0x0,%al
call   10c0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10e0 <CopyFile@plt>
lea    -0x90(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x90(%rbp),%rdi
movslq -0x114(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xbac(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x110(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
movslq -0x114(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xb79(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10e0 <CopyFile@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <Sys_FindNext@plt>
mov    %rax,-0x120(%rbp)
jmp    1420 <SV_CopySaveGame+0x260>
mov    $0x0,%al
call   1070 <Sys_FindClose@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_CopySaveGame>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xe22(%rip),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10d0 <Com_DPrintf@plt>
mov    %r12,%rdi
call   1040 <SV_WipeSavegame@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xe1a(%rip),%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %rbp,%rdi
call   10a0 <FS_CreatePath@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10e0 <CopyFile@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xdcd(%rip),%rbx
mov    %r15,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10e0 <CopyFile@plt>
lea    0xd9a(%rip),%rsi
mov    %r12,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1311 <SV_CopySaveGame+0x151>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xd85(%rip),%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10e0 <CopyFile@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xd3e(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xd19(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <Sys_FindFirst@plt>
test   %rax,%rax
mov    %r12,0x8(%rsp)
je     1437 <SV_CopySaveGame+0x277>
mov    %rax,%r15
movslq %ebp,%r14
lea    (%rsp,%r14,1),%r12
add    $0x10,%r12
lea    0x90(%rsp),%rbx
lea    0x10(%rsp),%r13
lea    0xce8(%rip),%rbp
add    %r14,%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
lea    0xcb6(%rip),%rdx
mov    %eax,%ecx
mov    0x8(%rsp),%r8
mov    %r15,%r9
xor    %eax,%eax
call   10c0 <Com_sprintf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10e0 <CopyFile@plt>
mov    %r13,%rdi
call   1080 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0xd,%rdi
mov    %rbp,%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0x8d,%rdi
mov    %rbp,%rsi
call   1050 <strcpy@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10e0 <CopyFile@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <Sys_FindNext@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13a0 <SV_CopySaveGame+0x1e0>
xor    %eax,%eax
call   1070 <Sys_FindClose@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"SV_CopySaveGame(%s, %s)\0A\00"
@.str.1 = [22 x i8] c"%s/save/%s/server.ssv\00"
@.str.2 = [20 x i8] c"%s/save/%s/game.ssv\00"
@.str.3 = [6 x i8] c"save0\00"
@.str.4 = [20 x i8] c"%s/save/%s/shot.jpg\00"
@.str.5 = [12 x i8] c"%s/save/%s/\00"
@.str.6 = [17 x i8] c"%s/save/%s/*.sav\00"
@.str.7 = [14 x i8] c"%s/save/%s/%s\00"
@.str.8 = [4 x i8] c"sv2\00"
define void @SV_CopySaveGame(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @Com_DPrintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @SV_WipeSavegame(i8* %13)
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%16 = call i32 (...) @FS_Gamedir()
%17 = load i8*, i8** %3
%18 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %15, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %16, i8* %17)
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%20 = call i32 (...) @FS_Gamedir()
%21 = load i8*, i8** %4
%22 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %19, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %20, i8* %21)
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%24 = call i32 @FS_CreatePath(i8* %23)
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%27 = call i32 @CopyFile(i8* %25, i8* %26)
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%29 = call i32 (...) @FS_Gamedir()
%30 = load i8*, i8** %3
%31 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %28, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %29, i8* %30)
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%33 = call i32 (...) @FS_Gamedir()
%34 = load i8*, i8** %4
%35 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %32, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %33, i8* %34)
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%38 = call i32 @CopyFile(i8* %36, i8* %37)
%39 = load i8*, i8** %4
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %54
42: ; preds = %2
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%44 = call i32 (...) @FS_Gamedir()
%45 = load i8*, i8** %3
%46 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %43, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %44, i8* %45)
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%48 = call i32 (...) @FS_Gamedir()
%49 = load i8*, i8** %4
%50 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %47, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %48, i8* %49)
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%53 = call i32 @CopyFile(i8* %51, i8* %52)
br label %54
54: ; preds = %42, %2
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%56 = call i32 (...) @FS_Gamedir()
%57 = load i8*, i8** %3
%58 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %55, i32 128, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %56, i8* %57)
%59 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%60 = call i32 @strlen(i8* %59)
store i32 %60, i32* %8
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%62 = call i32 (...) @FS_Gamedir()
%63 = load i8*, i8** %3
%64 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %61, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %62, i8* %63)
%65 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%66 = call i8* @Sys_FindFirst(i8* %65, i32 0, i32 0)
store i8* %66, i8** %9
br label %67
67: ; preds = %70, %54
%68 = load i8*, i8** %9
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %111
70: ; preds = %67
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%72 = load i32, i32* %8
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i8*, i8** %9
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 %77
%79 = call i32 @strcpy(i8* %74, i8* %78)
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%81 = call i32 (...) @FS_Gamedir()
%82 = load i8*, i8** %4
%83 = load i8*, i8** %9
%84 = load i32, i32* %8
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8, i8* %83, i64 %85
%87 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %80, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %81, i8* %82, i8* %86)
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%90 = call i32 @CopyFile(i8* %88, i8* %89)
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%92 = call i32 @strlen(i8* %91)
store i32 %92, i32* %7
%93 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %93, i64 %95
%97 = getelementptr inbounds i8, i8* %96, i64 -3
%98 = call i32 @strcpy(i8* %97, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
store i32 %100, i32* %7
%101 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = getelementptr inbounds i8, i8* %104, i64 -3
%106 = call i32 @strcpy(i8* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%107 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%108 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%109 = call i32 @CopyFile(i8* %107, i8* %108)
%110 = call i8* @Sys_FindNext(i32 0, i32 0)
store i8* %110, i8** %9
br label %67
111: ; preds = %67
%112 = call i32 (...) @Sys_FindClose()
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"SV_CopySaveGame(%s, %s)\0A\00"
@.str.1 = [22 x i8] c"%s/save/%s/server.ssv\00"
@.str.2 = [20 x i8] c"%s/save/%s/game.ssv\00"
@.str.3 = [6 x i8] c"save0\00"
@.str.4 = [20 x i8] c"%s/save/%s/shot.jpg\00"
@.str.5 = [12 x i8] c"%s/save/%s/\00"
@.str.6 = [17 x i8] c"%s/save/%s/*.sav\00"
@.str.7 = [14 x i8] c"%s/save/%s/%s\00"
@.str.8 = [4 x i8] c"sv2\00"
define void @SV_CopySaveGame(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @Com_DPrintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = tail call i32 @SV_WipeSavegame(i8* %1)
%9 = tail call i32 (...) @FS_Gamedir()
%10 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9, i8* %0)
%11 = call i32 (...) @FS_Gamedir()
%12 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %6, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* %1)
%13 = call i32 @FS_CreatePath(i8* %6)
%14 = call i32 @CopyFile(i8* %5, i8* %6)
%15 = call i32 (...) @FS_Gamedir()
%16 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %15, i8* %0)
%17 = call i32 (...) @FS_Gamedir()
%18 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %6, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %17, i8* %1)
%19 = call i32 @CopyFile(i8* %5, i8* %6)
%20 = call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %2
%23 = call i32 (...) @FS_Gamedir()
%24 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %23, i8* %0)
%25 = call i32 (...) @FS_Gamedir()
%26 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %6, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %25, i8* %1)
%27 = call i32 @CopyFile(i8* %5, i8* %6)
br label %28
28: ; preds = %22, %2
%29 = call i32 (...) @FS_Gamedir()
%30 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %29, i8* %0)
%31 = call i32 @strlen(i8* %5)
%32 = call i32 (...) @FS_Gamedir()
%33 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %32, i8* %0)
%34 = call i8* @Sys_FindFirst(i8* %5, i32 0, i32 0)
%35 = icmp eq i8* %34, null
br i1 %35, label %59, label %36
36: ; preds = %28
%37 = sext i32 %31 to i64
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %37
br label %39
39: ; preds = %36, %39
%40 = phi i8* [ %34, %36 ], [ %57, %39 ]
%41 = getelementptr inbounds i8, i8* %40, i64 %37
%42 = call i32 @strcpy(i8* %38, i8* %41)
%43 = call i32 (...) @FS_Gamedir()
%44 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %6, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %43, i8* %1, i8* %41)
%45 = call i32 @CopyFile(i8* %5, i8* %6)
%46 = call i32 @strlen(i8* %5)
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %47
%49 = getelementptr inbounds i8, i8* %48, i64 -3
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%51 = call i32 @strlen(i8* %6)
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %52
%54 = getelementptr inbounds i8, i8* %53, i64 -3
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%56 = call i32 @CopyFile(i8* %5, i8* %6)
%57 = call i8* @Sys_FindNext(i32 0, i32 0)
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %39
59: ; preds = %39, %28
%60 = call i32 (...) @Sys_FindClose()
ret void
}