user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parse_qrels_prefs_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    (%rdi),%rbx
  movzbl (%rbx),%edi
  cmp    $0xa,%dil
  je     L226
L303:
  movsbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L226
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  cmp    $0xa,%dil
  jne    L303
L226:
  mov    %rbx,0x0(%rbp)
L27:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L153
  add    $0x1,%rbx
  jmp    L27
L153:
  cmpb   $0xa,(%rbx)
  je     L23
  lea    0x1(%rbx),%rbp
  movb   $0x0,(%rbx)
  movzbl 0x1(%rbx),%edi
  cmp    $0xa,%dil
  je     L138
L65:
  movsbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L138
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%edi
  cmp    $0xa,%dil
  jne    L65
L138:
  mov    %rbp,(%r12)
  jmp    L252
L161:
  add    $0x1,%rbp
L252:
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L161
  cmpb   $0xa,0x0(%rbp)
  je     L330
  lea    0x1(%rbp),%r12
  movb   $0x0,0x0(%rbp)
  movzbl 0x1(%rbp),%edi
  cmp    $0xa,%dil
  je     L148
L243:
  movsbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L148
  add    $0x1,%r12
  movzbl (%r12),%edi
  cmp    $0xa,%dil
  jne    L243
L148:
  mov    %r12,(%r15)
  jmp    L123
L126:
  add    $0x1,%r12
L123:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L126
  cmpb   $0xa,(%r12)
  je     L301
  lea    0x1(%r12),%rbx
  movb   $0x0,(%r12)
  movzbl 0x1(%r12),%edi
  cmp    $0xa,%dil
  je     L119
L174:
  movsbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L114
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  cmp    $0xa,%dil
  jne    L174
L119:
  mov    $0xffffffff,%eax
  jmp    L203
L114:
  cmpb   $0xa,(%rbx)
  je     L357
  mov    %rbx,(%r14)
  jmp    L30
L271:
  add    $0x1,%rbx
L30:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L271
  cmpb   $0xa,(%rbx)
  je     L3
  lea    0x1(%rbx),%rbp
  movb   $0x0,(%rbx)
  movzbl 0x1(%rbx),%edi
  cmp    $0xa,%dil
  je     L327
L55:
  movsbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L251
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%edi
  cmp    $0xa,%dil
  jne    L55
L327:
  mov    %rbp,%rbx
L3:
  movb   $0x0,(%rbx)
  add    $0x1,%rbx
  mov    %rbx,0x0(%r13)
  mov    $0x0,%eax
L203:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L251:
  cmpb   $0xa,0x0(%rbp)
  jne    L199
  mov    %rbp,%rbx
  jmp    L3
L23:
  mov    $0xffffffff,%eax
  jmp    L203
L330:
  mov    $0xffffffff,%eax
  jmp    L203
L301:
  mov    $0xffffffff,%eax
  jmp    L203
L357:
  mov    $0xffffffff,%eax
  jmp    L203
L199:
  mov    $0xffffffff,%eax
  jmp    L203
```

assistant: ```c
int parse_qrels_prefs_line(char **start_ptr, char **qid_ptr, char **jg_ptr, char **docno_ptr, char **rel_ptr) {
  char *ptr = *start_ptr;
  while (*ptr != '\n' && isspace(*ptr))
    ptr++;
  *qid_ptr = ptr;
  while (!isspace(*ptr))
    ptr++;
  if (*ptr == '\n')
    return (-1);
  *ptr++ = '\0';
  while (*ptr != '\n' && isspace(*ptr))
    ptr++;
  *jg_ptr = ptr;
  while (!isspace(*ptr))
    ptr++;
  if (*ptr == '\n')
    return (-1);
  *ptr++ = '\0';
  while (*ptr != '\n' && isspace(*ptr))
    ptr++;
  *docno_ptr = ptr;
  while (!isspace(*ptr))
    ptr++;
  if (*ptr == '\n')
    return (-1);
  *ptr++ = '\0';
  while (*ptr != '\n' && isspace(*ptr))
    ptr++;
  if (*ptr == '\n')
    return (-1);
  *rel_ptr = ptr;
  while (!isspace(*ptr))
    ptr++;
  if (*ptr != '\n') {
    *ptr++ = '\0';
    while (*ptr != '\n' && isspace(*ptr))
      ptr++;
    if (*ptr != '\n')
      return (-1);
  }
  *ptr++ = '\0';
  *start_ptr = ptr;
  return (0);
}
```