#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*/);
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);
  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    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe2e(%rip),%rdi
call   10c0 <Com_DPrintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <SV_WipeSavegame@plt>
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    0xe0b(%rip),%rdx
mov    $0x0,%al
call   10b0 <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    0xdd6(%rip),%rdx
mov    $0x0,%al
call   10b0 <Com_sprintf@plt>
lea    -0x110(%rbp),%rdi
call   10a0 <FS_CreatePath@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10d0 <CopyFile@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    0xd98(%rip),%rdx
mov    $0x0,%al
call   10b0 <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    0xd63(%rip),%rdx
mov    $0x0,%al
call   10b0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10d0 <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    0xd2f(%rip),%rdx
mov    $0x0,%al
call   10b0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x118(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x128(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xcf4(%rip),%rdx
mov    $0x0,%al
call   10b0 <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     1495 <SV_CopySaveGame+0x2e5>
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,-0x158(%rbp)
mov    $0x0,%al
call   1090 <FS_Gamedir@plt>
mov    -0x158(%rbp),%rdi
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
mov    -0x120(%rbp),%r9
movslq -0x118(%rbp),%rax
add    %rax,%r9
mov    $0x80,%esi
lea    0xc73(%rip),%rdx
mov    $0x0,%al
call   10b0 <Com_sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10d0 <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    0xc39(%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    0xc06(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   10d0 <CopyFile@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <Sys_FindNext@plt>
mov    %rax,-0x120(%rbp)
jmp    1379 <SV_CopySaveGame+0x1c9>
mov    $0x0,%al
call   1070 <Sys_FindClose@plt>
add    $0x160,%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,%rbp
mov    %rdi,%r14
lea    0xe32(%rip),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   10c0 <Com_DPrintf@plt>
mov    %rbp,%rdi
call   1040 <SV_WipeSavegame@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xe2a(%rip),%r12
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
mov    %rbx,%rdi
call   10a0 <FS_CreatePath@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10d0 <CopyFile@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xddd(%rip),%r12
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %rbp,0x8(%rsp)
mov    %rbp,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10d0 <CopyFile@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xd9e(%rip),%rdx
mov    %r15,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
mov    %r15,%rdi
call   1080 <strlen@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
lea    0xd7e(%rip),%rdx
mov    %r15,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <Sys_FindFirst@plt>
test   %rax,%rax
je     13b7 <SV_CopySaveGame+0x207>
mov    %rax,%r14
movslq %ebx,%r12
lea    (%rsp,%r12,1),%r15
add    $0x10,%r15
lea    0x90(%rsp),%rbx
lea    0x10(%rsp),%r13
lea    0xd52(%rip),%rbp
nopl   0x0(%rax)
add    %r12,%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
xor    %eax,%eax
call   1090 <FS_Gamedir@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
lea    0xd1c(%rip),%rdx
mov    %eax,%ecx
mov    0x8(%rsp),%r8
mov    %r14,%r9
xor    %eax,%eax
call   10b0 <Com_sprintf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10d0 <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   10d0 <CopyFile@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <Sys_FindNext@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1320 <SV_CopySaveGame+0x170>
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 = [12 x i8] c"%s/save/%s/\00"
@.str.4 = [17 x i8] c"%s/save/%s/*.sav\00"
@.str.5 = [14 x i8] c"%s/save/%s/%s\00"
@.str.6 = [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 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%40 = call i32 (...) @FS_Gamedir()
%41 = load i8*, i8** %3
%42 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %39, i32 128, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %40, i8* %41)
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%44 = call i32 @strlen(i8* %43)
store i32 %44, i32* %8
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%46 = call i32 (...) @FS_Gamedir()
%47 = load i8*, i8** %3
%48 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %45, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %46, i8* %47)
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%50 = call i8* @Sys_FindFirst(i8* %49, i32 0, i32 0)
store i8* %50, i8** %9
br label %51
51: ; preds = %54, %2
%52 = load i8*, i8** %9
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %95
54: ; preds = %51
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8*, i8** %9
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %59, i64 %61
%63 = call i32 @strcpy(i8* %58, i8* %62)
%64 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%65 = call i32 (...) @FS_Gamedir()
%66 = load i8*, i8** %4
%67 = load i8*, i8** %9
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %67, i64 %69
%71 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %64, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %65, i8* %66, i8* %70)
%72 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%73 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%74 = call i32 @CopyFile(i8* %72, i8* %73)
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%76 = call i32 @strlen(i8* %75)
store i32 %76, i32* %7
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
%81 = getelementptr inbounds i8, i8* %80, i64 -3
%82 = call i32 @strcpy(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%84 = call i32 @strlen(i8* %83)
store i32 %84, i32* %7
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%86 = load i32, i32* %7
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = getelementptr inbounds i8, i8* %88, i64 -3
%90 = call i32 @strcpy(i8* %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%93 = call i32 @CopyFile(i8* %91, i8* %92)
%94 = call i8* @Sys_FindNext(i32 0, i32 0)
store i8* %94, i8** %9
br label %51
95: ; preds = %51
%96 = 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 = [12 x i8] c"%s/save/%s/\00"
@.str.4 = [17 x i8] c"%s/save/%s/*.sav\00"
@.str.5 = [14 x i8] c"%s/save/%s/%s\00"
@.str.6 = [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 i32 (...) @FS_Gamedir()
%21 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %20, i8* %0)
%22 = call i32 @strlen(i8* %5)
%23 = call i32 (...) @FS_Gamedir()
%24 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %5, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %23, i8* %0)
%25 = call i8* @Sys_FindFirst(i8* %5, i32 0, i32 0)
%26 = icmp eq i8* %25, null
br i1 %26, label %50, label %27
27: ; preds = %2
%28 = sext i32 %22 to i64
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %28
br label %30
30: ; preds = %27, %30
%31 = phi i8* [ %25, %27 ], [ %48, %30 ]
%32 = getelementptr inbounds i8, i8* %31, i64 %28
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = call i32 (...) @FS_Gamedir()
%35 = call i32 (i8*, i32, i8*, i32, i8*, ...) @Com_sprintf(i8* %6, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %34, i8* %1, i8* %32)
%36 = call i32 @CopyFile(i8* %5, i8* %6)
%37 = call i32 @strlen(i8* %5)
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %38
%40 = getelementptr inbounds i8, i8* %39, i64 -3
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 @strlen(i8* %6)
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %43
%45 = getelementptr inbounds i8, i8* %44, i64 -3
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%47 = call i32 @CopyFile(i8* %5, i8* %6)
%48 = call i8* @Sys_FindNext(i32 0, i32 0)
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %30
50: ; preds = %30, %2
%51 = call i32 (...) @Sys_FindClose()
ret void
}