user: Translate the below assembly code into C programming language:

```asm
<qfits_getkey>:
  endbr64
  test   %rdi,%rdi
  je     L60
  push   %r12
  lea    D50(%rip),%r12
  mov    $0x8,%edx
  push   %rbp
  mov    %r12,%rsi
  mov    %rdi,%rbp
  push   %rbx
  call   <strncmp@plt>
  test   %eax,%eax
  je     L34
  mov    $0x8,%edx
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L157
  mov    $0x8,%edx
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L86
  mov    $0x4,%edx
  lea    D117(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L131
  lea    D9(%rip),%r12
  mov    $0x51,%edx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  movzbl 0x0(%rbp),%eax
  cmp    $0x3d,%al
  je     L54
  lea    0x1(%rbp),%rcx
  xor    %edx,%edx
  jmp    L94
  xchg   %ax,%ax
L110:
  add    $0x1,%rcx
  cmp    $0x50,%edx
  je     L54
L94:
  mov    %eax,%esi
  movzbl (%rcx),%eax
  mov    %edx,%ebx
  add    $0x1,%edx
  cmp    $0x3d,%al
  jne    L110
  cmp    $0x50,%edx
  je     L54
  movslq %ebx,%rax
  lea    -0x1(%rbp,%rax,1),%rax
  cmp    $0x20,%sil
  je     L150
  jmp    L64
  nopl   0x0(%rax)
L158:
  sub    $0x1,%rax
  cmp    $0xffffffff,%ebx
  je     L54
L150:
  mov    %ebx,%edx
  sub    $0x1,%ebx
  cmpb   $0x20,(%rax)
  je     L158
L64:
  test   %ebx,%ebx
  jle    L54
  add    $0x2,%ebx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  movslq %ebx,%rbx
  lea    D9(%rip),%rax
  movb   $0x0,(%r12,%rbx,1)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L34:
  lea    D9(%rip),%rbx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
L7:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L157:
  lea    D9(%rip),%rbx
  lea    D12(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L131:
  lea    D9(%rip),%rbx
  lea    D120(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
  jmp    L7
  nopl   0x0(%rax,%rax,1)
L54:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L86:
  lea    D9(%rip),%rbx
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L60:
  xor    %eax,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D50
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D11
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D22
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D117
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D12
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D120
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D10
type_guessed: string

tool: D50:         

tool: D11: HISTORY 

tool: D22: COMMENT 

tool: D117: END 

tool: D12: HISTORY

tool: D120: END

tool: D10: COMMENT

assistant: ```c
char *qfits_getkey(const char *line) {
  static char key[81];
  int i;
  if (line == NULL) {
    return NULL;
  }
  if (!strncmp(line, "        ", 8)) {
    strcpy(key, "        ");
    return key;
  }
  if (!strncmp(line, "HISTORY ", 8)) {
    strcpy(key, "HISTORY");
    return key;
  }
  if (!strncmp(line, "COMMENT ", 8)) {
    strcpy(key, "COMMENT");
    return key;
  }
  if (!strncmp(line, "END ", 4)) {
    strcpy(key, "END");
    return key;
  }
  memset(key, 0, 81);
  i = 0;
  while (line[i] != '=' && i < 80)
    i++;
  if (i >= 80) {
    return NULL;
  }
  i--;
  while (line[i] == ' ' && i >= 0)
    i--;
  if (i <= 0) {
    return NULL;
  }
  i++;
  strncpy(key, line, i);
  key[i + 1] = (char)0;
  return key;
}
```