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

```asm
<send_directory_listing>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,%rax
  mov    %rdx,%rsi
  mov    %rsi,%rdx
  mov    %rax,-0x70(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x64(%rbp),%edx
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  push   %rdx
  mov    $0xffffffff,%r9d
  lea    D78(%rip),%r8
  mov    $0x0,%ecx
  lea    D1(%rip),%rdx
  mov    $0xc8,%esi
  mov    %rax,%rdi
  call   <send_header@plt>
  add    $0x10,%rsp
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D208(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x60(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <set_simple_head@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D108(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x60(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    D21(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x58(%rbp),%rax
  lea    D157(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x60,%edx
  mov    $0x1,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x8,%edx
  mov    $0x1,%esi
  lea    D179(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x50(%rbp)
  jmp    L45
L99:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0xffffff80,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    -0x78(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x70(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  lea    -0x70(%rbp),%rax
  add    $0xc,%rax
  mov    %rax,%rdi
  call   <gmtime@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rcx
  lea    D71(%rip),%rdx
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    D42(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L22
  mov    -0x60(%rbp),%rax
  lea    D215(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L50
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    D233(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L74
L50:
  mov    -0x68(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L70
  lea    D215(%rip),%rax
  jmp    L80
L70:
  lea    D198(%rip),%rax
L80:
  mov    -0x48(%rbp),%rdx
  mov    (%rdx),%rdx
  mov    -0x58(%rbp),%rdi
  mov    %rax,%rcx
  lea    D111(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x68(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L103
  lea    D215(%rip),%rax
  jmp    L66
L103:
  lea    D198(%rip),%rax
L66:
  mov    -0x48(%rbp),%rdx
  mov    (%rdx),%rdx
  mov    -0x58(%rbp),%rdi
  mov    %rax,%rcx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x68(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L75
  lea    -0x30(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    D52(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L67
L75:
  mov    -0x70(%rbp),%rax
  mov    %rax,%rcx
  lea    -0x30(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    D93(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L67:
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L45
L22:
  nop
  jmp    L45
L74:
  nop
L45:
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x48(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L99
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  mov    -0x58(%rbp),%rax
  lea    D162(%rip),%rdx
  lea    D178(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xe,%edx
  mov    $0x1,%esi
  lea    D243(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L117
  call   <__stack_chk_fail@plt>
L117:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D78
datatype: string
name: unpack_data
arguments: data_label: D1
datatype: string
name: unpack_data
arguments: data_label: D208
datatype: string
name: unpack_data
arguments: data_label: D108
datatype: string
name: unpack_data
arguments: data_label: D21
datatype: string
name: unpack_data
arguments: data_label: D157
datatype: string
name: unpack_data
arguments: data_label: D70
datatype: string
name: unpack_data
arguments: data_label: D179
datatype: string
name: unpack_data
arguments: data_label: D71
datatype: string
name: unpack_data
arguments: data_label: D140
datatype: string
name: unpack_data
arguments: data_label: D42
datatype: string
name: unpack_data
arguments: data_label: D215
datatype: string
name: unpack_data
arguments: data_label: D233
datatype: string
name: unpack_data
arguments: data_label: D198
datatype: string
name: unpack_data
arguments: data_label: D111
datatype: string
name: unpack_data
arguments: data_label: D76
datatype: string
name: unpack_data
arguments: data_label: D52
datatype: string
name: unpack_data
arguments: data_label: D93
datatype: string
name: unpack_data
arguments: data_label: D12
datatype: string
name: unpack_data
arguments: data_label: D162
datatype: string
name: unpack_data
arguments: data_label: D178
datatype: string
name: unpack_data
arguments: data_label: D243
datatype: string

tool: D78: text/html

tool: D1: OK

tool: D208: <html>

tool: D108: <body>

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


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

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

tool: D179: <hr />


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

tool: D140: <tr>

tool: D42: .

tool: D215: /

tool: D233: ..

tool: 

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

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

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

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

tool: D12: </tr>

tool: D162: http_server 0.1

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


tool: D243: </body></html>

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