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

```asm
<readhead>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  call   <readhead13@plt>
  test   %eax,%eax
  jne    L38
  lea    0x1f(%rsp),%r12
  lea    D57(%rip),%rbp
  lea    D46(%rip),%r15
  lea    D27(%rip),%r14
  lea    D54(%rip),%r13
L95:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <readsecthead@plt>
  cmp    $0xffffffff,%eax
  je     L82
  movzbl 0x1f(%rsp),%esi
  cmp    $0x64,%sil
  ja     L129
  cmp    $0x60,%sil
  ja     L50
L130:
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L82:
  mov    $0xffffffff,%eax
L38:
  mov    0x218(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L94
  add    $0x228,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L129:
  cmp    $0x65,%sil
  jne    L130
  mov    %rbx,%rdi
  call   <readlength@plt>
  mov    %eax,0xc(%rsp)
L64:
  movzbl 0x1f(%rsp),%eax
  sub    $0x61,%eax
  cmp    $0x4,%al
  ja     L95
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L50:
  lea    0x20(%rsp),%rdi
  mov    %rbx,%rdx
  mov    $0x1f4,%esi
  call   <readstring@plt>
  test   %eax,%eax
  je     L64
  jmp    L82
  nopl   0x0(%rax,%rax,1)
  lea    0x20(%rsp),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L95
  nopl   0x0(%rax)
  mov    0xc(%rsp),%ebx
  lea    D59(%rip),%rdi
  xor    %eax,%eax
  mov    %ebx,%esi
  call   <printf@plt>
  mov    %ebx,%eax
  jmp    L38
  nopl   0x0(%rax,%rax,1)
  lea    0x20(%rsp),%rsi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L95
  lea    0x20(%rsp),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L95
  nopl   0x0(%rax)
  lea    0x20(%rsp),%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L95
L94:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D46
type_infered: string
name: read_data
arguments: data_tag: D27
type_infered: string
name: read_data
arguments: data_tag: D54
type_infered: string
name: read_data
arguments: data_tag: D0
type_infered: string
name: read_data
arguments: data_tag: D59
type_infered: string
name: read_data
arguments: data_tag: D11
type_infered: string

tool: D46: Bitfile time:   %s


tool: D27: Bitfile date:   %s


tool: D54: Target device:  xc%s


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


tool: D59: Bitfile length: %08x


tool: D11: Design name:    %s


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