user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<build_headers>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %esi,-0x8c(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %rcx,-0xa0(%rbp)
  mov    %r8d,-0x90(%rbp)
  mov    %r9,-0xa8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0x98(%rbp),%rdx
  mov    -0x8c(%rbp),%eax
  mov    %rdx,%r8
  mov    %eax,%ecx
  lea    D40(%rip),%rax
  mov    %rax,%rdx
  lea    D82(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  lea    D4(%rip),%rdx
  lea    D33(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
  mov    $0x0,%edi
  call   <time@plt>
  mov    %rax,-0x78(%rbp)
  lea    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <gmtime@plt>
  mov    %eax,%edx
  lea    -0x70(%rbp),%rax
  mov    %edx,%ecx
  lea    D13(%rip),%rdx
  mov    $0x64,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdx
  lea    D116(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
  cmpq   $0x0,-0xa0(%rbp)
  je     L38
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xa0(%rbp),%rax
  mov    %rax,%rdx
  lea    D100(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
L38:
  cmpl   $0x0,-0x90(%rbp)
  js     L5
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x90(%rbp),%eax
  mov    %eax,%edx
  lea    D94(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
L5:
  mov    -0xa8(%rbp),%rax
  cmp    $0xffffffffffffffff,%rax
  je     L4
  lea    -0xa8(%rbp),%rax
  mov    %rax,%rdi
  call   <gmtime@plt>
  mov    %eax,%edx
  lea    -0x70(%rbp),%rax
  mov    %edx,%ecx
  lea    D13(%rip),%rdx
  mov    $0x64,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdx
  lea    D44(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
L4:
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  lea    D96(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  lea    D45(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D40
datatype: string
name: read_data
arguments: label: D82
datatype: string
name: read_data
arguments: label: D4
datatype: string
name: read_data
arguments: label: D33
datatype: string
name: read_data
arguments: label: D13
datatype: string
name: read_data
arguments: label: D116
datatype: string
name: read_data
arguments: label: D100
datatype: string
name: read_data
arguments: label: D94
datatype: string
name: read_data
arguments: label: D44
datatype: string
name: read_data
arguments: label: D96
datatype: string
name: read_data
arguments: label: D45
datatype: string

tool: D40: HTTP/1.0

tool: D82: %s %d %s


tool: D4: micro_proxy

tool: D33: Server: %s


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

tool: D116: Date: %s


tool: D100: Content-Type: %s


tool: D94: Content-Length: %d


tool: D44: Last-Modified: %s


tool: D96: Connection: close


tool: D45: 


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