user: Translate the below assembly code into C programming language:

```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     L34
  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>
L34:
  xor    %r12d,%r12d
  lea    D32(%rip),%r15
  lea    D28(%rip),%r13
  nopl   (%rax)
L142:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <FS_NextPath@plt>
  movslq %eax,%r12
  test   %eax,%eax
  je     L144
  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     L53
  mov    %rbp,%rax
  nopl   0x0(%rax)
L77:
  cmp    $0x5c,%dl
  je     L106
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L77
L53:
  mov    %rbp,%rsi
  lea    D49(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  lea    D19(%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    L90
L15:
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  call   <Com_Printf@plt>
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L106:
  movb   $0x2f,(%rax)
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L77
  jmp    L53
  nopl   0x0(%rax)
L90:
  cltq
  cmpl   $0x1,0x1c(%rsp)
  mov    %rax,0x8(%rsp)
  jle    L71
  mov    %rax,%rbx
  xor    %ebp,%ebp
  jmp    L10
  nopl   (%rax)
L12:
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  add    $0x8,%rbx
  call   <Com_Printf@plt>
  mov    -0x8(%rbx),%rdi
  xor    %eax,%eax
  call   <Memory_free@plt>
  mov    0x1c(%rsp),%eax
  movq   $0x0,-0x8(%rbx)
  sub    $0x1,%eax
  cmp    %ebp,%eax
  jle    L71
L10:
  mov    (%rbx),%r14
  mov    $0x2f,%esi
  mov    %r14,%rdi
  call   <strrchr@plt>
  lea    0x1(%rax),%rsi
  test   %rax,%rax
  jne    L12
  mov    %r14,%rsi
  jmp    L12
  nopl   (%rax)
L71:
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  call   <Memory_free@plt>
  jmp    L15
  nopl   0x0(%rax)
L144:
  mov    0x828(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L98
  add    $0x838,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L98:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D32
type_guessed: string
name: disassemble_data
arguments: tag: D28
type_guessed: string
name: disassemble_data
arguments: tag: D49
type_guessed: string
name: disassemble_data
arguments: tag: D19
type_guessed: string
name: disassemble_data
arguments: tag: D35
type_guessed: string

tool: D32: %s%c%s

tool: D28: %s


tool: D49: Directory of %s


tool: D19: ----


tool: D35: 


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");
  };
}
```