user: 请将以下的汇编代码转换成C语言代码:

```asm
<FS_Dir_f>:
  endbr64
  push   %r15
  mov    $0x7e,%ecx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x838,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x828(%rsp)
  xor    %eax,%eax
  lea    0x430(%rsp),%rdi
  movq   $0x2a2e2a,0x420(%rsp)
  movq   $0x0,0x428(%rsp)
  rep stos %rax,%es:(%rdi)
  call   <Cmd_Argc@plt>
  cmp    $0x1,%eax
  je     L70
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <Cmd_Argv@plt>
  lea    0x420(%rsp),%rdi
  mov    $0x400,%edx
  mov    %eax,%esi
  xor    %eax,%eax
  call   <com_strlcpy@plt>
L70:
  xor    %r12d,%r12d
  lea    D7(%rip),%r15
  lea    D16(%rip),%r13
  nopl   (%rax)
L116:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <FS_NextPath@plt>
  movslq %eax,%r12
  test   %eax,%eax
  je     L55
  lea    0x20(%rsp),%rbp
  mov    %r15,%rdx
  mov    $0x2f,%r8d
  xor    %eax,%eax
  lea    0x420(%rsp),%r9
  mov    %r12,%rcx
  mov    $0x400,%esi
  mov    %rbp,%rdi
  call   <com_snprintf@plt>
  movzbl 0x20(%rsp),%edx
  test   %dl,%dl
  je     L132
  mov    %rbp,%rax
  nopl   0x0(%rax)
L121:
  cmp    $0x5c,%dl
  jne    L22
  movb   $0x2f,(%rax)
L22:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L121
L132:
  mov    %rbp,%rsi
  lea    D25(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  mov    %rbp,%rdi
  call   <FS_ListFiles@plt>
  test   %eax,%eax
  jne    L125
L51:
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  jmp    L116
  nopl   (%rax)
L125:
  cltq
  cmpl   $0x1,0x1c(%rsp)
  mov    %rax,0x8(%rsp)
  jle    L19
  mov    %rax,%rbx
  xor    %ebp,%ebp
  jmp    L136
  nopl   (%rax)
L118:
  lea    0x1(%rax),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
L69:
  mov    (%rbx),%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  add    $0x8,%rbx
  call   <Memory_free@plt>
  mov    0x1c(%rsp),%eax
  movq   $0x0,-0x8(%rbx)
  sub    $0x1,%eax
  cmp    %ebp,%eax
  jle    L19
L136:
  mov    (%rbx),%r14
  mov    $0x2f,%esi
  mov    %r14,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  jne    L118
  mov    %r14,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  jmp    L69
  xchg   %ax,%ax
L19:
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  call   <Memory_free@plt>
  jmp    L51
  nopl   0x0(%rax)
L55:
  mov    0x828(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L129
  add    $0x838,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L129:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type: string
name: extract_symbolic_data
arguments: data_label: D16
type: string
name: extract_symbolic_data
arguments: data_label: D25
type: string
name: extract_symbolic_data
arguments: data_label: D43
type: string
name: extract_symbolic_data
arguments: data_label: D21
type: string

tool: D7: %s%c%s

tool: D16: %s


tool: D25: Directory of %s


tool: D43: ----


tool: D21: 


assistant: ```c
void FS_Dir_f(void) {
  char *path = ((void *)0);
  char findname[1024];
  char wildcard[1024] = "*.*";
  char **dirnames;
  int ndirs;
  if (Cmd_Argc() != 1) {
    com_strlcpy(wildcard, Cmd_Argv(1), sizeof(wildcard));
  }
  while ((path = FS_NextPath(path)) != ((void *)0)) {
    char *tmp = findname;
    com_snprintf(findname, sizeof(findname), "%s%c%s", path, '/', wildcard);
    while (*tmp != 0) {
      if (*tmp == '\\')
        *tmp = '/';
      tmp++;
    }
    Com_Printf("Directory of %s\n", findname);
    Com_Printf("----\n");
    if ((dirnames = FS_ListFiles(findname, &ndirs, 0, 0)) != 0) {
      int i;
      for (i = 0; i < ndirs - 1; i++) {
        if (strrchr(dirnames[i], '/'))
          Com_Printf("%s\n", strrchr(dirnames[i], '/') + 1);
        else
          Com_Printf("%s\n", dirnames[i]);
        {
          Memory_free((dirnames[i]));
          ((dirnames[i])) = ((void *)0);
        };
      }
      {
        Memory_free((dirnames));
        ((dirnames)) = ((void *)0);
      };
    }
    Com_Printf("\n");
  };
}
```