user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<readhead>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x218,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  call   <readhead13@plt>
  test   %eax,%eax
  jne    L87
  lea    D23(%rip),%rbp
  lea    D43(%rip),%r15
  lea    D59(%rip),%r14
  lea    D6(%rip),%r13
L65:
  lea    0xf(%rsp),%rdi
  mov    %rbx,%rsi
  call   <readsecthead@plt>
  cmp    $0xffffffff,%eax
  je     L87
  movzbl 0xf(%rsp),%esi
  cmp    $0x64,%sil
  jbe    L113
  cmp    $0x65,%sil
  jne    L44
  mov    %rbx,%rdi
  call   <readlength@plt>
  mov    %eax,%r12d
L61:
  movzbl 0xf(%rsp),%eax
  sub    $0x61,%eax
  cmp    $0x4,%al
  ja     L65
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
L113:
  cmp    $0x60,%sil
  ja     L74
L44:
  movzbl %sil,%esi
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
L87:
  mov    0x208(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L88
  add    $0x218,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rdx
  mov    $0x1f4,%esi
  call   <readstring@plt>
  test   %eax,%eax
  je     L61
  mov    $0xffffffff,%eax
  jmp    L87
  lea    0x10(%rsp),%rsi
  lea    D67(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L65
  lea    0x10(%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L65
  lea    0x10(%rsp),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L65
  lea    0x10(%rsp),%rsi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L65
  mov    %r12d,%esi
  lea    D52(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12d,%eax
  jmp    L87
L88:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D43
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D59
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D6
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D21
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D67
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D52
type_guessed: string

tool: D43: Bitfile time:   %s


tool: D59: Bitfile date:   %s


tool: D6: Target device:  xc%s


tool: D21: Unknown header field '%c'.


tool: D67: Design name:    %s


tool: D52: Bitfile length: %08x


assistant: ```c
int readhead(FILE *f) {
  int t, len;
  unsigned char typ;
  unsigned char buffer[500];
  t = readhead13(f);
  if (t)
    return t;
  do {
    if (readsecthead(&typ, f) == -1)
      return -1;
    switch (typ) {
    case 0x61:
    case 0x62:
    case 0x63:
    case 0x64:
      t = readstring(buffer, 500, f);
      if (t)
        return -1;
      break;
    case 0x65:
      len = readlength(f);
      break;
    default:
      printf("Unknown header field '%c'.\n", typ);
      return -1;
    }
    switch (typ) {
    case 0x61:
      printf("Design name:    %s\n", buffer);
      break;
    case 0x62:
      printf("Target device:  xc%s\n", buffer);
      break;
    case 0x63:
      printf("Bitfile date:   %s\n", buffer);
      break;
    case 0x64:
      printf("Bitfile time:   %s\n", buffer);
      break;
    case 0x65:
      printf("Bitfile length: %08x\n", len);
      return len;
    }
  } while (1);
  return -1;
}
```