user: 请从给定的汇编指令推导出C源代码:

```asm
<G_AllocCreateNamesList>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x488,%rsp
  mov    %rsi,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x478(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L123
  mov    %rdi,%r12
  test   %rdi,%rdi
  je     L123
  cmpb   $0x2e,(%rsi)
  mov    %rsi,%r15
  jne    L123
  mov    %rsi,%rdi
  mov    %edx,%ebx
  call   <strlen@plt>
  cmp    $0x1,%rax
  jbe    L123
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <trap_FS_GetFileList@plt>
  mov    %eax,0x4(%rsp)
  test   %eax,%eax
  je     L123
  lea    0x70(%rsp),%rax
  mov    %bl,0x2e(%rsp)
  xor    %r13d,%r13d
  movb   $0x0,0x2f(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L70
  nopl   (%rax)
L69:
  add    $0x1,%ebx
  mov    %ebx,0x8(%rsp)
L37:
  mov    0x4(%rsp),%ecx
  cmp    %ecx,0x8(%rsp)
  jge    L151
L70:
  mov    0x8(%rsp),%ebx
  mov    0x4(%rsp),%r9d
  mov    $0x400,%ecx
  xor    %eax,%eax
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdi
  mov    %ebx,%r8d
  call   <trap_FS_GetFileList@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  je     L69
  add    %eax,0x8(%rsp)
  test   %eax,%eax
  jle    L37
  mov    0x10(%rsp),%r14
  jmp    L172
  nop
L135:
  lea    0x30(%rsp),%r15
  mov    $0x40,%edx
  mov    %r14,%rsi
  xor    %eax,%eax
  mov    %r15,%rdi
  call   <Q_strncpyz@plt>
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <COM_StripExtension@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  addl   $0x1,0xc(%rsp)
  lea    0x1(%r13,%rax,1),%r13d
L34:
  lea    0x1(%r14,%rbx,1),%r14
  sub    $0x1,%ebp
  je     L37
L172:
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  movslq %ebx,%rbx
  lea    0x1(%rbx,%rax,1),%rax
  cmp    $0x3f,%rax
  jbe    L135
  mov    %r14,%rsi
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  jmp    L34
  nopl   (%rax)
L123:
  xor    %r15d,%r15d
L73:
  mov    0x478(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  add    $0x488,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L151:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L123
  lea    0x1(%r13),%eax
  mov    $0x204,%edx
  lea    0x30(%rsp),%r14
  mov    %eax,0x8(%rsp)
  mov    %eax,%edi
  lea    D16(%rip),%rsi
  xor    %eax,%eax
  call   <trap_MemAlloc@plt>
  movl   $0x0,0xc(%rsp)
  movslq %eax,%r15
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L30:
  add    $0x1,%ebx
  mov    %ebx,0xc(%rsp)
L78:
  mov    0x4(%rsp),%ecx
  cmp    %ecx,0xc(%rsp)
  jge    L73
L25:
  mov    0xc(%rsp),%ebx
  mov    0x4(%rsp),%r9d
  mov    $0x400,%ecx
  xor    %eax,%eax
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdi
  mov    %ebx,%r8d
  call   <trap_FS_GetFileList@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  je     L30
  add    %eax,0xc(%rsp)
  test   %eax,%eax
  jle    L78
  mov    0x10(%rsp),%r13
  nopl   (%rax)
L179:
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  movslq %ebx,%rbx
  lea    0x1(%rbx,%rax,1),%rax
  cmp    $0x3f,%rax
  ja     L22
  mov    $0x40,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <Q_strncpyz@plt>
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <COM_StripExtension@plt>
  mov    0x8(%rsp),%edx
  mov    %r14,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <Q_strncatz@plt>
  mov    0x8(%rsp),%edx
  lea    0x2e(%rsp),%rsi
  xor    %eax,%eax
  mov    %r15,%rdi
  call   <Q_strncatz@plt>
L22:
  lea    0x1(%r13,%rbx,1),%r13
  sub    $0x1,%ebp
  jne    L179
  jmp    L78
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D19
type_infered: string
name: read_data
arguments: data_tag: D16
type_infered: string

tool: D19: Warning: G_AllocCreateNamesList :file name too long: %s


tool: D16: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_utils.c

assistant: ```c
char *G_AllocCreateNamesList(const char *path, const char *extension, const char separator) {
  char separators[2];
  char name[64];
  char buffer[1024], *s, *list;
  int numfiles, i, j, found, length, fulllength;
  if (!extension || !path)
    return ((void *)0);
  if (extension[0] != '.' || strlen(extension) < 2)
    return ((void *)0);
  if ((numfiles = trap_FS_GetFileList(path, extension, ((void *)0), 0, 0, 0)) == 0)
    return ((void *)0);
  separators[0] = separator;
  separators[1] = 0;
  i = 0;
  found = 0;
  length = 0;
  fulllength = 0;
  do {
    if ((j = trap_FS_GetFileList(path, extension, buffer, sizeof(buffer), i, numfiles)) == 0) {
      i++;
      continue;
    }
    i += j;
    for (s = buffer; j > 0; j--, s += length + 1) {
      length = strlen(s);
      if (strlen(path) + 1 + length >= 64) {
        Com_Printf("Warning: G_AllocCreateNamesList :file name too long: %s\n", s);
        continue;
      }
      Q_strncpyz(name, s, sizeof(name));
      COM_StripExtension(name);
      fulllength += strlen(name) + 1;
      found++;
    }
  } while (i < numfiles);
  if (!found)
    return ((void *)0);
  fulllength += 1;
  list = trap_MemAlloc(fulllength, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_utils.c", 516);
  i = 0;
  length = 0;
  do {
    if ((j = trap_FS_GetFileList(path, extension, buffer, sizeof(buffer), i, numfiles)) == 0) {
      i++;
      continue;
    }
    i += j;
    for (s = buffer; j > 0; j--, s += length + 1) {
      length = strlen(s);
      if (strlen(path) + 1 + length >= 64)
        continue;
      Q_strncpyz(name, s, sizeof(name));
      COM_StripExtension(name);
      Q_strncatz(list, name, fulllength);
      Q_strncatz(list, separators, fulllength);
    }
  } while (i < numfiles);
  return list;
}
```