user: 请从给定的汇编指令推导出C源代码：

```asm
<readhead>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x220,%rsp
  mov    %rdi,-0x218(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <readhead13@plt>
  mov    %eax,-0x204(%rbp)
  cmpl   $0x0,-0x204(%rbp)
  je     L91
  mov    -0x204(%rbp),%eax
  jmp    L132
L91:
  mov    -0x218(%rbp),%rdx
  lea    -0x209(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <readsecthead@plt>
  cmp    $0xffffffff,%eax
  jne    L42
  mov    $0xffffffff,%eax
  jmp    L132
L42:
  movzbl -0x209(%rbp),%eax
  movzbl %al,%eax
  cmp    $0x64,%eax
  jg     L130
  cmp    $0x61,%eax
  jge    L133
  jmp    L58
L130:
  cmp    $0x65,%eax
  je     L6
  jmp    L58
L133:
  mov    -0x218(%rbp),%rdx
  lea    -0x200(%rbp),%rax
  mov    $0x1f4,%esi
  mov    %rax,%rdi
  call   <readstring@plt>
  mov    %eax,-0x204(%rbp)
  cmpl   $0x0,-0x204(%rbp)
  je     L156
  mov    $0xffffffff,%eax
  jmp    L132
L6:
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <readlength@plt>
  mov    %eax,-0x208(%rbp)
  jmp    L165
L58:
  movzbl -0x209(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L132
L156:
  nop
L165:
  movzbl -0x209(%rbp),%eax
  movzbl %al,%eax
  sub    $0x61,%eax
  cmp    $0x4,%eax
  ja     L91
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D34(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D34(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  lea    -0x200(%rbp),%rax
  mov    %rax,%rsi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L110
  lea    -0x200(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L110
  lea    -0x200(%rbp),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L110
  lea    -0x200(%rbp),%rax
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L110
  mov    -0x208(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x208(%rbp),%eax
  jmp    L132
L110:
  jmp    L91
L132:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L34
  call   <__stack_chk_fail@plt>
L34:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D58
datatype: string
name: extract_symbolic_data
arguments: data_label: D4
datatype: string
name: extract_symbolic_data
arguments: data_label: D16
datatype: string
name: extract_symbolic_data
arguments: data_label: D20
datatype: string
name: extract_symbolic_data
arguments: data_label: D26
datatype: string
name: extract_symbolic_data
arguments: data_label: D15
datatype: string

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


tool: D4: Design name:    %s


tool: D16: Target device:  xc%s


tool: D20: Bitfile date:   %s


tool: D26: Bitfile time:   %s


tool: D15: 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;
}
```