user: What is the c source code of the assembly code below:

```asm
<cleanup_dir>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x40(%rbp)
  jle    L78
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L130
L122:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L108
  mov    D47(%rip),%rax
  mov    (%rax),%r12d
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rbx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <dirfd@plt>
  mov    %eax,%edi
  lea    -0x2c(%rbp),%rax
  mov    %r12d,%ecx
  mov    %rax,%rdx
  mov    %rbx,%rsi
  call   <fstatat@plt>
  test   %rax,%rax
  jne    L27
  mov    -0x2c(%rbp),%eax
  and    -0x3c(%rbp),%eax
  test   %eax,%eax
  jne    L38
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L24
  mov    D33(%rip),%rax
  mov    (%rax),%edx
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D37(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D59(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    %edx,%r12d
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rbx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <dirfd@plt>
  mov    %r12d,%edx
  mov    %rbx,%rsi
  mov    %eax,%edi
  call   <openat@plt>
  mov    %eax,%edi
  call   <fdopendir@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L51
  mov    -0x40(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x3c(%rbp),%ecx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cleanup_dir>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
L51:
  mov    D55(%rip),%rax
  mov    (%rax),%r12d
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rbx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <dirfd@plt>
  mov    %r12d,%edx
  mov    %rbx,%rsi
  mov    %eax,%edi
  call   <unlinkat@plt>
  jmp    L2
L24:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rbx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <dirfd@plt>
  mov    $0x0,%edx
  mov    %rbx,%rsi
  mov    %eax,%edi
  call   <unlinkat@plt>
  jmp    L2
L108:
  nop
  jmp    L2
L27:
  nop
  jmp    L2
L38:
  nop
L2:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x28(%rbp)
L130:
  cmpq   $0x0,-0x28(%rbp)
  jne    L122
  jmp    L86
L78:
  nop
L86:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L111
  call   <__stack_chk_fail@plt>
L111:
  add    $0x30,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
void cleanup_dir(DIR *dir, mode_t mask, int depth) {
  struct dirent *dent;
  if (depth <= 0)
    return;
  for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
    struct stat stats;
    if (dent->d_name[0] == '.')
      continue;
    if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) != 0)
      continue;
    if ((stats.st_mode & mask) != 0)
      continue;
    if (S_ISDIR(stats.st_mode)) {
      DIR *dir2;
      dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC));
      if (dir2 != NULL) {
        cleanup_dir(dir2, mask, depth - 1);
        closedir(dir2);
      }
      unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
    } else {
      unlinkat(dirfd(dir), dent->d_name, 0);
    }
  }
}
```