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

```asm
<SendDirectory>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x98,%rsp
  mov    %edi,%r13d
  mov    %rsi,%rdi
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x3088(%rsp)
  xor    %eax,%eax
  call   <opendir@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L19
L21:
  lea    0x480(%rsp),%r12
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    $0xffffffff,%esi
  mov    %rbx,%rdi
  call   <substr@plt>
  lea    D35(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L16
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
L58:
  lea    0x80(%rsp),%r12
  mov    %rbx,%r8
  lea    D46(%rip),%rcx
  mov    %rbx,%rdx
  lea    D24(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    0x880(%rsp),%rdi
  mov    %r12,%rsi
  call   <strcat@plt>
  lea    D45(%rip),%r12
  lea    0x80(%rsp),%r14
  lea    D21(%rip),%r15
L33:
  mov    %rbp,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L55
  mov    %r12,%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L33
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    (%rbx),%rcx
  lea    0x480(%rsp),%rdx
  mov    %rcx,%r8
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    0x880(%rsp),%rdi
  mov    %r14,%rsi
  call   <strcat@plt>
  jmp    L33
L19:
  lea    0x880(%rsp),%rdi
  mov    $0x80,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %rsp,%r12
  mov    %rbx,%rdx
  lea    D129(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %r12,%r8
  lea    D48(%rip),%rcx
  lea    D40(%rip),%rdx
  mov    $0x1f4,%esi
  mov    %r13d,%edi
  call   <SendError@plt>
  jmp    L21
L16:
  lea    0x480(%rsp),%r12
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  lea    D35(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L58
L55:
  lea    0x80(%rsp),%rbx
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  lea    D46(%rip),%rdx
  lea    D64(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    0x880(%rsp),%rbp
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  sub    $0x8,%rsp
  push   $0x0
  mov    %rax,%r9
  lea    D116(%rip),%r8
  lea    D48(%rip),%rcx
  lea    D29(%rip),%rdx
  mov    $0xc8,%esi
  mov    %r13d,%edi
  call   <SendHeaders@plt>
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <write@plt>
  add    $0x10,%rsp
  mov    0x3088(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  mov    $0x0,%eax
  add    $0x3098,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D35
datatype: string
name: read_data
arguments: data_tag: D46
datatype: string
name: read_data
arguments: data_tag: D24
datatype: string
name: read_data
arguments: data_tag: D45
datatype: string
name: read_data
arguments: data_tag: D21
datatype: string
name: read_data
arguments: data_tag: D129
datatype: string
name: read_data
arguments: data_tag: D48
datatype: string
name: read_data
arguments: data_tag: D40
datatype: string
name: read_data
arguments: data_tag: D64
datatype: string
name: read_data
arguments: data_tag: D116
datatype: string
name: read_data
arguments: data_tag: D29
datatype: string

tool: D35: /

tool: D46: tmhttpd/1.0.0_alpha

tool: D24: <html>
<head>
<title>Browse directory %s - %s</title>
</head>
<body><h3>Directory %s</h3>
<hr />
<ul>


tool: D45: .

tool: D21: 	<li><a href="%s%s">%s</a></li>


tool: D129: Something unexpected went wrong browse directory %s.

tool: 

tool: D40: Internal Server Error

tool: D64: 
</ul>
<br /><hr />
<address>%s</address>
</body>
</html>


tool: D116: text/html

tool: D29: OK

assistant: ```c
int SendDirectory(int client_sock, char *path, char *pathinfo) {
  size_t file_size;
  char msg[128], buf[10240], tmp[1024], tmp_path[1024];
  DIR *dp;
  struct dirent *node;
  if ((dp = opendir(path)) == NULL) {
    memset(buf, 0, sizeof(msg));
    sprintf(msg, "Something unexpected went wrong browse directory %s.", pathinfo);
    SendError(client_sock, 500, "Internal Server Error", "", msg);
  }
  memset(tmp_path, 0, sizeof(tmp_path));
  substr(pathinfo, -1, 1, tmp_path);
  if (strcmp(tmp_path, "/") == 0) {
    memset(tmp_path, 0, sizeof(tmp_path));
    strcpy(tmp_path, pathinfo);
  } else {
    memset(tmp_path, 0, sizeof(tmp_path));
    strcpy(tmp_path, pathinfo);
    strcat(tmp_path, "/");
  }
  sprintf(tmp, "<html>\n<head>\n<title>Browse directory %s - %s</title>\n</head>\n<body><h3>Directory %s</h3>\n<hr />\n<ul>\n", pathinfo, "tmhttpd/1.0.0_alpha", pathinfo);
  strcat(buf, tmp);
  while ((node = readdir(dp)) != NULL) {
    if (strcmp(node->d_name, ".") != 0) {
      memset(tmp, 0, sizeof(tmp));
      sprintf(tmp, "\t<li><a href=\"%s%s\">%s</a></li>\n", tmp_path, node->d_name, node->d_name);
      strcat(buf, tmp);
    }
  }
  memset(tmp, 0, sizeof(tmp));
  sprintf(tmp, "\n</ul>\n<br /><hr />\n<address>%s</address>\n</body>\n</html>\n", "tmhttpd/1.0.0_alpha");
  strcat(buf, tmp);
  file_size = strlen(buf);
  SendHeaders(client_sock, 200, "OK", "", "text/html", file_size, 0);
  write(client_sock, buf, file_size);
  return 0;
}
```