user: Converte this assembly snippet into its equivalent C code:

```asm
<qfits_getcomment>:
  endbr64
  test   %rdi,%rdi
  je     L230
  push   %rbp
  mov    $0x4,%edx
  lea    D11(%rip),%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strncmp@plt>
  test   %eax,%eax
  je     L55
  mov    $0x8,%edx
  lea    D38(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L55
  mov    $0x8,%edx
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L55
  mov    $0x8,%edx
  lea    D13(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L55
  lea    D16(%rip),%rbp
  xor    %esi,%esi
  mov    $0x51,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  cmpb   $0x3d,(%rbx)
  je     L113
  lea    0x1(%rbx),%rdx
  xor    %eax,%eax
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L30:
  add    $0x1,%rdx
  cmp    $0x50,%eax
  je     L55
L3:
  mov    %eax,%ecx
  add    $0x1,%eax
  cmpb   $0x3d,(%rdx)
  jne    L30
  cmp    $0x50,%eax
  je     L55
  lea    0x2(%rcx),%eax
  cmp    $0x4e,%ecx
  je     L55
L200:
  cltq
  xor    %esi,%esi
  jmp    L207
  cs nopw 0x0(%rax,%rax,1)
L48:
  test   $0x1,%sil
  jne    L37
  cmp    $0x2f,%cl
  je     L47
L37:
  add    $0x1,%rax
  cmp    $0x50,%eax
  je     L55
L207:
  movzbl (%rbx,%rax,1),%ecx
  cmp    $0x27,%cl
  jne    L48
  add    $0x1,%rax
  xor    $0x1,%esi
  cmp    $0x50,%eax
  jne    L207
L55:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L47:
  lea    0x1(%rax),%ecx
  lea    0x2(%rax),%eax
  movslq %ecx,%rsi
  cltq
  add    %rbx,%rsi
  cmpb   $0x20,(%rsi)
  jne    L52
  nopl   0x0(%rax,%rax,1)
L157:
  mov    %eax,%ecx
  lea    (%rbx,%rax,1),%rsi
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rbx,%rax,1)
  je     L157
L52:
  cmpb   $0x20,0x4f(%rbx)
  jne    L15
  mov    $0x4e,%eax
  nopl   0x0(%rax)
L228:
  mov    %eax,%edx
  sub    $0x1,%rax
  cmpb   $0x20,0x1(%rbx,%rax,1)
  je     L228
L176:
  cmp    %edx,%ecx
  jg     L55
  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    D16(%rip),%rax
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L230:
  xor    %eax,%eax
  ret
L113:
  mov    $0x1,%eax
  jmp    L200
L15:
  mov    $0x4f,%edx
  jmp    L176
```

tool_calls: name: disassemble_data
arguments: data_tag: D11
type_infered: string
name: disassemble_data
arguments: data_tag: D38
type_infered: string
name: disassemble_data
arguments: data_tag: D18
type_infered: string
name: disassemble_data
arguments: data_tag: D13
type_infered: string

tool: D11: END 

tool: D38: HISTORY 

tool: D18: COMMENT 

tool: D13:         

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