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

```asm
<qfits_getcomment>:
  endbr64
  test   %rdi,%rdi
  je     L51
  push   %rbp
  mov    $0x4,%edx
  lea    D30(%rip),%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strncmp@plt>
  test   %eax,%eax
  je     L234
  mov    $0x8,%edx
  lea    D59(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L234
  mov    $0x8,%edx
  lea    D29(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L234
  mov    $0x8,%edx
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L234
  lea    D12(%rip),%rbp
  xor    %esi,%esi
  mov    $0x51,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  cmpb   $0x3d,(%rbx)
  je     L12
  lea    0x1(%rbx),%rdx
  xor    %eax,%eax
  jmp    L112
  nopw   0x0(%rax,%rax,1)
L178:
  add    $0x1,%rdx
  cmp    $0x50,%eax
  je     L234
L112:
  mov    %eax,%ecx
  add    $0x1,%eax
  cmpb   $0x3d,(%rdx)
  jne    L178
  cmp    $0x50,%eax
  je     L234
  lea    0x2(%rcx),%eax
  cmp    $0x4e,%ecx
  je     L234
L61:
  cltq
  xor    %esi,%esi
  jmp    L189
  cs nopw 0x0(%rax,%rax,1)
L183:
  test   $0x1,%sil
  jne    L36
  cmp    $0x2f,%cl
  je     L146
L36:
  add    $0x1,%rax
  cmp    $0x50,%eax
  je     L234
L189:
  movzbl (%rbx,%rax,1),%ecx
  cmp    $0x27,%cl
  jne    L183
  add    $0x1,%rax
  xor    $0x1,%esi
  cmp    $0x50,%eax
  jne    L189
L234:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L146:
  lea    0x1(%rax),%ecx
  lea    0x2(%rax),%eax
  movslq %ecx,%rsi
  cltq
  add    %rbx,%rsi
  cmpb   $0x20,(%rsi)
  jne    L21
  nopl   0x0(%rax,%rax,1)
L50:
  mov    %eax,%ecx
  lea    (%rbx,%rax,1),%rsi
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rbx,%rax,1)
  je     L50
L21:
  cmpb   $0x20,0x4f(%rbx)
  jne    L220
  mov    $0x4e,%eax
  nopl   0x0(%rax)
L164:
  mov    %eax,%edx
  sub    $0x1,%rax
  cmpb   $0x20,0x1(%rbx,%rax,1)
  je     L164
L138:
  cmp    %edx,%ecx
  jg     L234
  sub    %ecx,%edx
  mov    %rbp,%rdi
  lea    0x1(%rdx),%ebx
  mov    %ebx,%edx
  movslq %ebx,%rbx
  call   <strncpy@plt>
  movb   $0x0,0x0(%rbp,%rbx,1)
  add    $0x8,%rsp
  lea    D12(%rip),%rax
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L51:
  xor    %eax,%eax
  ret
L12:
  mov    $0x1,%eax
  jmp    L61
L220:
  mov    $0x4f,%edx
  jmp    L138
```

tool_calls: name: unpack_data
arguments: tag: D30
type_guessed: string
name: unpack_data
arguments: tag: D59
type_guessed: string
name: unpack_data
arguments: tag: D29
type_guessed: string
name: unpack_data
arguments: tag: D8
type_guessed: string

tool: D30: END 

tool: D59: HISTORY 

tool: D29: COMMENT 

tool: D8:         

assistant: ```c
char *qfits_getcomment(const char *line) {
  static char comment[81];
  int i;
  int from, to;
  int inq;
  if (line == NULL) {
    return NULL;
  }
  if (!strncmp(line, "END ", 4))
    return NULL;
  if (!strncmp(line, "HISTORY ", 8))
    return NULL;
  if (!strncmp(line, "COMMENT ", 8))
    return NULL;
  if (!strncmp(line, "        ", 8))
    return NULL;
  memset(comment, 0, 81);
  i = 0;
  while (line[i] != '=' && i < 80)
    i++;
  if (i >= 80) {
    return NULL;
  }
  i++;
  inq = 0;
  while (i < 80) {
    if (line[i] == '\'')
      inq = !inq;
    if (line[i] == '/')
      if (!inq)
        break;
    i++;
  }
  if (i >= 80) {
    return NULL;
  }
  i++;
  while (line[i] == ' ')
    i++;
  from = i;
  to = 79;
  while (line[to] == ' ')
    to--;
  if (to < from) {
    return NULL;
  }
  strncpy(comment, line + from, to - from + 1);
  comment[to - from + 1] = (char)0;
  return comment;
}
```