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

```asm
<trav_dir>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x70(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x70(%rbp)
  je     L41
  jmp    L19
L47:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L188
  jmp    L19
L188:
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x68(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  add    $0x5,%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x50(%rbp)
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    %rax,%r14
  mov    $0x0,%r15d
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L166:
  cmp    %rdx,%rsp
  je     L146
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L166
L146:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L60
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L60:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x78(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x48(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x68(%rbp),%rdx
  lea    0x1(%rdx),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x58(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x68(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax,%rdx,1)
  mov    -0x48(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L128
  mov    D1(%rip),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L187
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L135
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L114
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L135
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L114
L135:
  mov    -0x7c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <trav_dir>
  jmp    L114
L187:
  mov    -0x48(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L1
L114:
  mov    %rbx,%rsp
  jmp    L19
L1:
  nop
L128:
  mov    %rbx,%rsp
L19:
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x60(%rbp)
  cmpq   $0x0,-0x60(%rbp)
  jne    L47
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  jmp    L159
L41:
  nop
L159:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L35
  call   <__stack_chk_fail@plt>
L35:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D23
type_guessed: string

tool: D23: zlib

assistant: ```c
void trav_dir(const char *dir_name, int level) {
  DIR *pdir = opendir(dir_name);
  struct dirent *entry;
  size_t d_len = strlen(dir_name);
  if (!pdir)
    return;
  while ((entry = readdir(pdir))) {
    static struct stat st_buf;
    size_t e_len = strlen(entry->d_name);
    if (!strcmp("zlib", entry->d_name))
      continue;
    else {
      char n_path[d_len + e_len + 5];
      memcpy(n_path, dir_name, d_len);
      n_path[d_len] = '/';
      memcpy(n_path + d_len + 1, entry->d_name, e_len);
      n_path[d_len + 1 + e_len] = '\0';
      if (stat(n_path, &st_buf))
        continue;
      if (S_ISDIR(st_buf.st_mode)) {
        if ('.' != entry->d_name[0] || ('\0' != entry->d_name[1] && ('.' != entry->d_name[1] || '\0' != entry->d_name[2])))
          trav_dir(n_path, level + 1);
      } else {
        char *c_ptr = strrchr(n_path, '.');
        if (!c_ptr)
          continue;
      }
    }
  }
  closedir(pdir);
}
```