user: Please show me the C implementation that matches the assembly code listed below:

```asm
<build_headers>:
  endbr64
  push   %r15
  lea    D60(%rip),%r15
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  mov    %rdx,%r8
  lea    D107(%rip),%rdx
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %r9,0x8(%rsp)
  lea    0x20(%rsp),%r14
  mov    %rcx,(%rsp)
  mov    %esi,%ecx
  lea    D51(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  call   <sprintf@plt>
  lea    D41(%rip),%rdx
  lea    D15(%rip),%rsi
  movslq %eax,%rdi
  mov    %rax,%r12
  xor    %eax,%eax
  add    %rbp,%rdi
  call   <sprintf@plt>
  xor    %edi,%edi
  add    %eax,%r12d
  call   <time@plt>
  lea    0x18(%rsp),%rdi
  mov    %rax,0x18(%rsp)
  call   <gmtime@plt>
  mov    %r15,%rdx
  mov    $0x64,%esi
  mov    %r14,%rdi
  mov    %eax,%ecx
  call   <strftime@plt>
  movslq %r12d,%rdi
  mov    %r14,%rdx
  xor    %eax,%eax
  add    %rbp,%rdi
  lea    D35(%rip),%rsi
  call   <sprintf@plt>
  mov    (%rsp),%r10
  lea    (%r12,%rax,1),%ebx
  test   %r10,%r10
  je     L6
  movslq %ebx,%rdi
  mov    %r10,%rdx
  lea    D71(%rip),%rsi
  xor    %eax,%eax
  add    %rbp,%rdi
  call   <sprintf@plt>
  add    %eax,%ebx
L6:
  test   %r13d,%r13d
  js     L12
  movslq %ebx,%rdi
  mov    %r13d,%edx
  lea    D78(%rip),%rsi
  xor    %eax,%eax
  add    %rbp,%rdi
  call   <sprintf@plt>
  add    %eax,%ebx
L12:
  cmpq   $0xffffffffffffffff,0x8(%rsp)
  je     L3
  lea    0x8(%rsp),%rdi
  call   <gmtime@plt>
  mov    %r15,%rdx
  mov    $0x64,%esi
  mov    %r14,%rdi
  mov    %eax,%ecx
  call   <strftime@plt>
  movslq %ebx,%rdi
  mov    %r14,%rdx
  xor    %eax,%eax
  add    %rbp,%rdi
  lea    D6(%rip),%rsi
  call   <printf@plt>
  add    %eax,%ebx
L3:
  movslq %ebx,%rdi
  lea    D98(%rip),%rsi
  xor    %eax,%eax
  add    %rbp,%rdi
  call   <sprintf@plt>
  lea    D73(%rip),%rsi
  add    %eax,%ebx
  movslq %ebx,%rax
  lea    0x0(%rbp,%rax,1),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    %ebx,%eax
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D60
data_type: string
name: extract_symbolic_data
arguments: data_tag: D107
data_type: string
name: extract_symbolic_data
arguments: data_tag: D51
data_type: string
name: extract_symbolic_data
arguments: data_tag: D41
data_type: string
name: extract_symbolic_data
arguments: data_tag: D15
data_type: string
name: extract_symbolic_data
arguments: data_tag: D35
data_type: string
name: extract_symbolic_data
arguments: data_tag: D71
data_type: string
name: extract_symbolic_data
arguments: data_tag: D78
data_type: string
name: extract_symbolic_data
arguments: data_tag: D6
data_type: string
name: extract_symbolic_data
arguments: data_tag: D98
data_type: string
name: extract_symbolic_data
arguments: data_tag: D73
data_type: string

tool: D60: %a, %d %b %Y %H:%M:%S GMT

tool: D107: HTTP/1.0

tool: D51: %s %d %s


tool: D41: micro_proxy

tool: D15: Server: %s


tool: D35: Date: %s


tool: D71: Content-Type: %s


tool: D78: Content-Length: %d


tool: D6: Last-Modified: %s


tool: D98: Connection: close


tool: D73: 


assistant: ```c
int build_headers(char *buffer, int status, char *title, char *mime_type, int length, time_t mod) {
  time_t now;
  char timebuf[100];
  int index = 0;
  index += sprintf(buffer + index, "%s %d %s\r\n", "HTTP/1.0", status, title);
  index += sprintf(buffer + index, "Server: %s\r\n", "micro_proxy");
  now = time((time_t *)0);
  strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
  index += sprintf(buffer + index, "Date: %s\r\n", timebuf);
  if (mime_type != (char *)0)
    index += sprintf(buffer + index, "Content-Type: %s\r\n", mime_type);
  if (length >= 0)
    index += sprintf(buffer + index, "Content-Length: %d\r\n", length);
  if (mod != (time_t)-1) {
    strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&mod));
    index += printf(buffer + index, "Last-Modified: %s\r\n", timebuf);
  }
  index += sprintf(buffer + index, "Connection: close\r\n");
  index += printf(buffer + index, "\r\n");
  return index;
}
```