user: 请将以下的汇编代码转换成C语言代码:

```asm
<SockAPI_SendHttpResp>:
  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    $0x28,%rsp
  mov    %r9,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x2018(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L36
  mov    %edi,%ebp
  mov    %esi,%r15d
  mov    %rcx,%r12
  mov    %r8,%r14
  cmpq   $0x0,0x2060(%rsp)
  je     L73
  cmpq   $0x0,0x8(%rsp)
  je     L36
L73:
  lea    -0x64(%r15),%eax
  cmp    $0x1f3,%eax
  ja     L36
  test   %rdx,%rdx
  je     L64
  cmpb   $0x0,(%rdx)
  je     L64
L50:
  lea    0x10(%rsp),%r13
  mov    %rdx,%rcx
  lea    D5(%rip),%rsi
  mov    %r15d,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    %rax,%rbx
  test   %r12,%r12
  je     L212
  cmpb   $0x0,(%r12)
  jne    L138
L212:
  test   %r14,%r14
  je     L95
  cmpb   $0x0,(%r14)
  jne    L132
L95:
  lea    0x2(%rbx),%rdx
  mov    %r13,%rsi
  mov    %ebp,%edi
  movb   $0xd,0x10(%rsp,%rbx,1)
  movb   $0xa,0x11(%rsp,%rbx,1)
  call   <SockAPI_SendN@plt>
  test   %rax,%rax
  jne    L36
  cmpq   $0x0,0x2060(%rsp)
  jne    L52
L180:
  mov    0x2018(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L211
  add    $0x2028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L64:
  mov    %r15d,%edi
  call   <respcode2str@plt>
  mov    %rax,%rdx
  jmp    L50
L52:
  mov    0x2060(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  mov    %ebp,%edi
  call   <SockAPI_SendN@plt>
  neg    %rax
  sbb    %eax,%eax
  jmp    L180
  nopl   0x0(%rax,%rax,1)
L138:
  cmpq   $0x0,0x2060(%rsp)
  je     L36
  mov    0x2060(%rsp),%rcx
  lea    0x0(%r13,%rax,1),%rdi
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D11(%rip),%rsi
  call   <sprintf@plt>
  add    %rax,%rbx
  jmp    L212
  nopl   (%rax)
L132:
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  cmp    $0x2,%eax
  jle    L36
  cmpb   $0xd,(%r14)
  je     L9
L133:
  movslq %edx,%rcx
  cmpb   $0xd,-0x2(%r14,%rcx,1)
  je     L114
  cmpb   $0xa,-0x1(%r14,%rcx,1)
  jne    L36
L114:
  lea    (%rcx,%rbx,1),%r14
  lea    0x3(%r14),%rax
  cmp    $0x2000,%rax
  ja     L36
  lea    0x0(%r13,%rbx,1),%rdi
  mov    %r13,%rsi
  mov    %r14,%rbx
  call   <memcpy@plt>
  jmp    L95
  nopl   (%rax)
L9:
  cmpb   $0xa,0x1(%r14)
  jne    L133
  nop
L36:
  mov    $0xffffffff,%eax
  jmp    L180
L211:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D5
data_type: string
name: unpack_data
arguments: data_tag: D11
data_type: string

tool: D5: HTTP/1.1 %d %s


tool: D11: Content-type: %s
Content-length: %d


assistant: ```c
int SockAPI_SendHttpResp(int sd, int status, const char *statusstr, const char *content_type, const char *otherhead, const char *content, size_t content_len) {
  char buf[8192];
  size_t offset = 0;
  if (sd < 0 || (content_len > 0 && !content) || status < 100 || status >= 600)
    return -1;
  if (!statusstr || !(*statusstr))
    statusstr = respcode2str(status);
  offset = sprintf(buf, "HTTP/1.1 %d %s\r\n", status, statusstr);
  if (content_type && *content_type) {
    if (content_len < 1)
      return -1;
    offset += sprintf(buf + offset, "Content-type: %s\r\nContent-length: %d\r\n", content_type, content_len);
  }
  if (otherhead && *otherhead) {
    int sz = strlen(otherhead);
    if (sz <= 2 || (otherhead[0] == '\r' && otherhead[1] == '\n') || (otherhead[sz - 2] != '\r' && otherhead[sz - 1] != '\n') || offset + sz + 3 > sizeof(buf))
      return -1;
    memcpy(buf + offset, buf, sz);
    offset += sz;
  }
  buf[offset++] = '\r';
  buf[offset++] = '\n';
  if (SockAPI_SendN(sd, buf, offset) == 0 && ((content_len == 0) || SockAPI_SendN(sd, content, content_len) == 0))
    return 0;
  return -1;
}
```