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

```asm
<send_directory_listing>:
  endbr64
  push   %r15
  mov    %rdx,%rax
  mov    $0xffffffff,%r9d
  push   %r14
  shr    $0x20,%rax
  push   %r13
  mov    %r8,%r13
  lea    D9(%rip),%r8
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x60,%rsp
  mov    %rsi,0x18(%rsp)
  mov    $0xc8,%esi
  mov    %rcx,0x10(%rsp)
  xor    %ecx,%ecx
  mov    %rdx,0x20(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x50(%rsp)
  xor    %edx,%edx
  push   %rax
  lea    D118(%rip),%rdx
  call   <send_header@plt>
  mov    %r12,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D164(%rip),%rdi
  call   <fwrite@plt>
  xor    %ecx,%ecx
  mov    %rbx,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <set_simple_head@plt>
  mov    %r12,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D185(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rdx
  mov    %r12,%rdi
  xor    %eax,%eax
  lea    D18(%rip),%rsi
  call   <fprintf@plt>
  lea    D207(%rip),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r12,%rcx
  mov    $0x60,%edx
  mov    $0x1,%esi
  lea    D100(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x8,%edx
  mov    %r12,%rcx
  mov    $0x1,%esi
  lea    D221(%rip),%rdi
  call   <fwrite@plt>
  mov    %r13,%rdi
  call   <opendir@plt>
  mov    %rax,%r15
  pop    %rax
  pop    %rdx
  nopl   0x0(%rax,%rax,1)
L2:
  mov    %r15,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L31
L6:
  mov    %r13,%rdi
  lea    0x20(%rsp),%r14
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x80(%rax),%edi
  call   <calloc@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%rax,1)
  mov    (%rbx),%rsi
  call   <strcat@plt>
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  lea    0x1c(%rsp),%rdi
  call   <gmtime@plt>
  lea    D137(%rip),%rdx
  mov    $0x20,%esi
  mov    %r14,%rdi
  mov    %rax,%rcx
  call   <strftime@plt>
  mov    $0x1,%esi
  mov    %r12,%rcx
  lea    D63(%rip),%rdi
  mov    $0x4,%edx
  call   <fwrite@plt>
  mov    (%rbx),%rdi
  lea    D77(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L2
  mov    0x8(%rsp),%rdi
  lea    D245(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L53
  mov    (%rbx),%rdi
  lea    D194(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L2
L53:
  mov    0x18(%rsp),%edi
  call   <S_ISDIR@plt>
  lea    D2(%rip),%r8
  mov    (%rbx),%rdx
  lea    D245(%rip),%rcx
  test   %rax,%rax
  lea    D4(%rip),%rsi
  mov    %r12,%rdi
  cmove  %r8,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x18(%rsp),%edi
  call   <S_ISDIR@plt>
  lea    D2(%rip),%r8
  mov    (%rbx),%rdx
  mov    %r12,%rdi
  test   %rax,%rax
  lea    D245(%rip),%rcx
  lea    D40(%rip),%rsi
  cmove  %r8,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x18(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L0
  mov    %r14,%rdx
  lea    D174(%rip),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L34:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D238(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L6
L31:
  mov    %r15,%rdi
  call   <closedir@plt>
  lea    D38(%rip),%rdx
  lea    D183(%rip),%rsi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <fprintf@plt>
  mov    %r12,%rcx
  mov    $0xe,%edx
  mov    $0x1,%esi
  lea    D84(%rip),%rdi
  call   <fwrite@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L0:
  mov    0x10(%rsp),%rcx
  mov    %r14,%rdx
  mov    %r12,%rdi
  xor    %eax,%eax
  lea    D140(%rip),%rsi
  call   <fprintf@plt>
  jmp    L34
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D9
type_guessed: string
name: extract_symbolic_data
arguments: tag: D118
type_guessed: string
name: extract_symbolic_data
arguments: tag: D164
type_guessed: string
name: extract_symbolic_data
arguments: tag: D185
type_guessed: string
name: extract_symbolic_data
arguments: tag: D18
type_guessed: string
name: extract_symbolic_data
arguments: tag: D207
type_guessed: string
name: extract_symbolic_data
arguments: tag: D100
type_guessed: string
name: extract_symbolic_data
arguments: tag: D221
type_guessed: string
name: extract_symbolic_data
arguments: tag: D137
type_guessed: string
name: extract_symbolic_data
arguments: tag: D63
type_guessed: string
name: extract_symbolic_data
arguments: tag: D77
type_guessed: string
name: extract_symbolic_data
arguments: tag: D245
type_guessed: string
name: extract_symbolic_data
arguments: tag: D194
type_guessed: string
name: extract_symbolic_data
arguments: tag: D2
type_guessed: string
name: extract_symbolic_data
arguments: tag: D4
type_guessed: string
name: extract_symbolic_data
arguments: tag: D40
type_guessed: string
name: extract_symbolic_data
arguments: tag: D174
type_guessed: string
name: extract_symbolic_data
arguments: tag: D238
type_guessed: string
name: extract_symbolic_data
arguments: tag: D38
type_guessed: string
name: extract_symbolic_data
arguments: tag: D183
type_guessed: string
name: extract_symbolic_data
arguments: tag: D84
type_guessed: string
name: extract_symbolic_data
arguments: tag: D140
type_guessed: string

tool: D9: text/html

tool: D118: OK

tool: D164: <html>

tool: D185: <body>

tool: D18: <h1>Index of %s</h1>


tool: D207: <pre><table border="0" width="100%%">

tool: D100: <tr><th align="left">Name</th><th align="left">Last modified</th><th align="left">Size</th></tr>

tool: D221: <hr />


tool: D137: %Y-%b-%d %H:%M:%S

tool: D63: <tr>

tool: D77: .

tool: D245: /

tool: D194: ..

tool: 

tool: D4: <td><a href="%s%s">

tool: D40: %s%s</a></td>

tool: D174: <td>%s</td>

tool: D238: </tr>

tool: D38: http_server 0.1

tool: D183: </table></pre>
<hr /><address>%s</address>


tool: D84: </body></html>

tool: D140: <td>%s</td> <td>%10llu</td>

assistant: ```c
void send_directory_listing(FILE *f, struct stat statbuf, char *relative_path, char *path) {
  DIR *dir;
  struct dirent *de;
  send_header(f, 200, "OK", NULL, "text/html", -1, statbuf.st_mtime);
  fprintf(f, "<html>");
  set_simple_head(f, relative_path, relative_path, NULL);
  fprintf(f, "<body>");
  fprintf(f, "<h1>Index of %s</h1>\r\n", relative_path);
  fprintf(f, "<pre><table border=\"0\" width=\"100%%\">");
  fprintf(f, "<tr><th align=\"left\">Name</th><th align=\"left\">Last modified</th><th align=\"left\">Size</th></tr>");
  fprintf(f, "<hr />\r\n");
  dir = opendir(path);
  while ((de = readdir(dir)) != NULL) {
    char timebuf[32];
    struct tm *tm;
    char *pathbuf = calloc(strlen(path) + 128, sizeof(char));
    memcpy(pathbuf, path, strlen(path));
    pathbuf[strlen(pathbuf)] = '\0';
    strcat(pathbuf, de->d_name);
    stat(pathbuf, &statbuf);
    tm = gmtime(&statbuf.st_mtime);
    strftime(timebuf, sizeof(timebuf), "%Y-%b-%d %H:%M:%S", tm);
    fprintf(f, "<tr>");
    if (strcmp(de->d_name, ".") == 0)
      continue;
    if (strcmp(relative_path, "/") == 0 && strcmp(de->d_name, "..") == 0)
      continue;
    fprintf(f, "<td><a href=\"%s%s\">", de->d_name, S_ISDIR(statbuf.st_mode) ? "/" : "");
    fprintf(f, "%s%s</a></td>", de->d_name, S_ISDIR(statbuf.st_mode) ? "/" : "");
    if (S_ISDIR(statbuf.st_mode))
      fprintf(f, "<td>%s</td>", timebuf);
    else
      fprintf(f, "<td>%s</td> <td>%10llu</td>", timebuf, (unsigned long long)statbuf.st_size);
    fprintf(f, "</tr>");
    free(pathbuf);
  }
  closedir(dir);
  fprintf(f, "</table></pre>\r\n<hr /><address>%s</address>\r\n", "http_server 0.1");
  fprintf(f, "</body></html>");
}
```