user: Please show me the C implementation that matches the assembly code listed below:

```asm
<SV_CopySaveGame>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x238,%rsp
  mov    %rdi,-0x238(%rbp)
  mov    %rsi,-0x240(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x240(%rbp),%rdx
  mov    -0x238(%rbp),%rax
  mov    %rax,%rsi
  lea    D124(%rip),%rax
  mov    %rax,%rdi
  call   <Com_DPrintf@plt>
  mov    -0x240(%rbp),%rax
  mov    %rax,%rdi
  call   <SV_WipeSavegame@plt>
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x238(%rbp),%rcx
  lea    -0x220(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D83(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x240(%rbp),%rcx
  lea    -0x120(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D83(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x120(%rbp),%rax
  mov    %rax,%rdi
  call   <FS_CreatePath@plt>
  lea    -0x120(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CopyFile@plt>
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x238(%rbp),%rcx
  lea    -0x220(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D57(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x240(%rbp),%rcx
  lea    -0x120(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D57(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x120(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CopyFile@plt>
  mov    -0x240(%rbp),%rax
  lea    D70(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L8
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x238(%rbp),%rcx
  lea    -0x220(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D111(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x240(%rbp),%rcx
  lea    -0x120(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D111(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x120(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CopyFile@plt>
L8:
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x238(%rbp),%rcx
  lea    -0x220(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D3(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x220(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x230(%rbp)
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x238(%rbp),%rcx
  lea    -0x220(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D75(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x220(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <Sys_FindFirst@plt>
  mov    %rax,-0x228(%rbp)
  jmp    L20
L13:
  mov    -0x230(%rbp),%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    -0x230(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x228(%rbp),%rax
  add    %rax,%rcx
  mov    -0x230(%rbp),%eax
  cltq
  lea    -0x220(%rbp),%rsi
  add    %rsi,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Q_strncpyz@plt>
  mov    -0x230(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x228(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    $0x0,%eax
  call   <FS_Gamedir@plt>
  mov    %eax,%edx
  mov    -0x240(%rbp),%rcx
  lea    -0x120(%rbp),%rax
  mov    %rbx,%r9
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D119(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Com_sprintf@plt>
  lea    -0x120(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CopyFile@plt>
  lea    -0x220(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x22c(%rbp)
  mov    -0x22c(%rbp),%edx
  mov    $0x103,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    -0x22c(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rcx
  lea    -0x220(%rbp),%rax
  add    %rcx,%rax
  lea    D32(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Q_strncpyz@plt>
  lea    -0x120(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x22c(%rbp)
  mov    -0x22c(%rbp),%edx
  mov    $0x103,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    -0x22c(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rcx
  lea    -0x120(%rbp),%rax
  add    %rcx,%rax
  lea    D32(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Q_strncpyz@plt>
  lea    -0x120(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CopyFile@plt>
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <Sys_FindNext@plt>
  mov    %rax,-0x228(%rbp)
L20:
  cmpq   $0x0,-0x228(%rbp)
  jne    L13
  mov    $0x0,%eax
  call   <Sys_FindClose@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D124
type_guessed: string
name: read_data
arguments: data_label: D83
type_guessed: string
name: read_data
arguments: data_label: D57
type_guessed: string
name: read_data
arguments: data_label: D70
type_guessed: string
name: read_data
arguments: data_label: D111
type_guessed: string
name: read_data
arguments: data_label: D3
type_guessed: string
name: read_data
arguments: data_label: D75
type_guessed: string
name: read_data
arguments: data_label: D119
type_guessed: string
name: read_data
arguments: data_label: D32
type_guessed: string

tool: D124: SV_CopySaveGame(%s, %s)


tool: D83: %s/save/%s/server.ssv

tool: D57: %s/save/%s/game.ssv

tool: D70: kmq2save0

tool: D111: %s/save/%s/shot.jpg

tool: D3: %s/save/%s/

tool: D75: %s/save/%s/*.sav

tool: D119: %s/save/%s/%s

tool: D32: sv2

assistant: ```c
void SV_CopySaveGame(char *src, char *dst) {
  char name[256], name2[256];
  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, "kmq2save0")) {
    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) {
    Q_strncpyz(name + len, found + len, sizeof(name) - len);
    Com_sprintf(name2, sizeof(name2), "%s/save/%s/%s", FS_Gamedir(), dst, found + len);
    CopyFile(name, name2);
    l = strlen(name);
    Q_strncpyz(name + l - 3, "sv2", sizeof(name) - l + 3);
    l = strlen(name2);
    Q_strncpyz(name2 + l - 3, "sv2", sizeof(name2) - l + 3);
    CopyFile(name, name2);
    found = Sys_FindNext(0, 0);
  }
  Sys_FindClose();
}
```