user: Demonstrate the C code that generates the assembly output below:

```asm
<remove_directory>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x28(%rbp)
  movl   $0xffffffff,-0x38(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L43
  movl   $0x0,-0x38(%rbp)
  jmp    L48
L115:
  movl   $0xffffffff,-0x34(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  lea    D27(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L48
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  lea    D13(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L124
  jmp    L48
L124:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  add    $0x2,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L125
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D1(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x3c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L107
  mov    -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L128
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <remove_directory>
  mov    %eax,-0x34(%rbp)
  jmp    L107
L128:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  mov    %eax,-0x34(%rbp)
L107:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L125:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x38(%rbp)
L48:
  cmpl   $0x0,-0x38(%rbp)
  jne    L127
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L115
L127:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
L43:
  cmpl   $0x0,-0x38(%rbp)
  jne    L30
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <rmdir@plt>
  mov    %eax,-0x38(%rbp)
L30:
  mov    -0x38(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L123
  call   <__stack_chk_fail@plt>
L123:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D27
data_type: string
name: read_data
arguments: data_tag: D13
data_type: string
name: read_data
arguments: data_tag: D1
data_type: string

tool: D27: .

tool: D13: ..

tool: D1: %s/%s

assistant: ```c
int remove_directory(const char *path) {
  struct stat statbuf;
  struct dirent *p;
  DIR *d = opendir(path);
  size_t path_len = strlen(path);
  int r = -1;
  if (d) {
    r = 0;
    while (!r && (p = readdir(d))) {
      int r2 = -1;
      char *buf;
      size_t len;
      if (!strcmp(p->d_name, ".") || !strcmp(p->d_name, ".."))
        continue;
      len = path_len + strlen(p->d_name) + 2;
      buf = malloc(len);
      if (buf) {
        snprintf(buf, len, "%s/%s", path, p->d_name);
        if (!stat(buf, &statbuf)) {
          if (S_ISDIR(statbuf.st_mode))
            r2 = remove_directory(buf);
          else
            r2 = unlink(buf);
        }
        free(buf);
      }
      r = r2;
    }
    closedir(d);
  }
  if (!r)
    r = rmdir(path);
  return r;
}
```