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

```asm
<headsf>:
  endbr64
  push   %r15
  mov    %rsi,%rdx
  mov    $0x1,%ecx
  lea    D76(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <sendRequest@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jg     L143
L140:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L129
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L143:
  mov    %rsp,%r12
  mov    $0x3a,%edx
  mov    %ebp,%edi
  movq   $0x0,(%rsp)
  mov    %r12,%rsi
  call   <readField@plt>
  test   %eax,%eax
  jle    L155
  mov    (%rsp),%rsi
  lea    D44(%rip),%rdi
  call   <strcmpi@plt>
  test   %rax,%rax
  je     L30
L155:
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rsi
  mov    $0x3a,%edx
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jg     L25
L3:
  mov    (%rsp),%rdi
  call   <free@plt>
L100:
  test   %r12d,%r12d
  mov    $0xfffffffd,%eax
  cmovs  %eax,%r12d
  jmp    L140
  nopl   0x0(%rax)
L25:
  mov    (%rsp),%rsi
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L3
  nopl   0x0(%rax)
L30:
  movq   $0x0,0x8(%rsp)
  mov    (%rsp),%rdi
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  call   <free@plt>
  mov    %r12,%rsi
  mov    $0x3a,%edx
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jle    L100
  mov    (%rsp),%rdi
  mov    $0xa,%edx
  xor    %esi,%esi
  lea    D36(%rip),%r13
  call   <strtol@plt>
  mov    (%rsp),%rdi
  mov    %eax,%r14d
  call   <free@plt>
  lea    D62(%rip),%r8
  mov    %r13,%rdi
  lea    D1(%rip),%rcx
  lea    D15(%rip),%rdx
  lea    D68(%rip),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D3(%rip),%rdi
  lea    -0x1(%r14),%ebx
  call   <puts@plt>
  test   %r14d,%r14d
  je     L111
  lea    0x8(%rsp),%r14
  lea    0x10(%rsp),%r15
  nopl   0x0(%rax,%rax,1)
L120:
  mov    $0x3a,%edx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jg     L106
L111:
  lea    D39(%rip),%rdi
  call   <puts@plt>
  jmp    L100
  nopw   0x0(%rax,%rax,1)
L106:
  mov    $0x3a,%edx
  mov    %r15,%rsi
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jle    L111
  lea    0x20(%rsp),%rsi
  mov    $0x3a,%edx
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jle    L111
  lea    0x18(%rsp),%rsi
  mov    $0x3a,%edx
  mov    %ebp,%edi
  call   <readField@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jle    L111
  mov    0x18(%rsp),%r8
  mov    0x20(%rsp),%rcx
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  call   <printf@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  lea    -0x1(%rbx),%eax
  test   %ebx,%ebx
  je     L111
  mov    %eax,%ebx
  jmp    L120
L129:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D76
datatype: string
name: disassemble_data
arguments: label: D44
datatype: string
name: disassemble_data
arguments: label: D42
datatype: string
name: disassemble_data
arguments: label: D36
datatype: string
name: disassemble_data
arguments: label: D62
datatype: string
name: disassemble_data
arguments: label: D1
datatype: string
name: disassemble_data
arguments: label: D15
datatype: string
name: disassemble_data
arguments: label: D68
datatype: string
name: disassemble_data
arguments: label: D3
datatype: string
name: disassemble_data
arguments: label: D39
datatype: string

tool: D76: HEADS

tool: D44: OK

tool: D42: -%s


tool: D36: %-3s	%-15s	%-20s	%s	


tool: D62: SUBJECT

tool: D1: DATE

tool: D15: FROM

tool: D68: ID

tool: D3: --------------------------------------------------------------------------------

tool: 

assistant: ```c
int headsf(int sd, char argv[]) {
  int status = sendRequest(sd, "HEADS", argv, 1);
  if (status > 0) {
    char *buf = NULL;
    if ((status = readField(sd, &buf, ':')) > 0 && strcmpi("OK", buf) == 0) {
      char *id = NULL;
      char *from = NULL;
      char *subject = NULL;
      char *date = NULL;
      int n;
      free(buf);
      if ((status = readField(sd, &buf, ':')) > 0) {
        n = strtol(buf, NULL, 10);
        free(buf);
        printf("%-3s\t%-15s\t%-20s\t%s\t\n", "ID", "FROM", "DATE", "SUBJECT");
        puts("--------------------------------------------------------------------------------");
        while (n-- && status > 0) {
          if ((status = readField(sd, &id, ':')) > 0 && (status = readField(sd, &from, ':')) > 0 && (status = readField(sd, &date, ':')) > 0 && (status = readField(sd, &subject, ':')) > 0) {
            printf("%-3s\t%-15s\t%-20s\t%s\t\n", id, from, date, subject);
            free(id);
            free(from);
            free(date);
            free(subject);
          }
        }
        puts("");
      }
    } else {
      free(buf);
      if ((status = readField(sd, &buf, ':')) > 0) {
        printf("-%s\n", buf);
      }
      free(buf);
    }
    if (status < 0)
      status = -3;
  }
  return status;
}
```