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

```asm
<readNames>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  call   <rewind@plt>
  mov    $0x0,%eax
  jmp    L71
L171:
  cmp    $0x2c,%eax
  sete   %al
  movzbl %al,%eax
  add    (%r12),%eax
L71:
  mov    %eax,(%r12)
  mov    %rbx,%rdi
  call   <fgetc@plt>
  mov    D19(%rip),%rdx
  cmp    %eax,(%rdx)
  jne    L171
  mov    %rbx,%rdi
  call   <ftell@plt>
  test   %eax,%eax
  setg   %dil
  movzbl %dil,%edi
  add    (%r12),%edi
  mov    %edi,(%r12)
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L3
  mov    %rbx,%rdi
  call   <rewind@plt>
  cmpl   $0x0,(%r12)
  jle    L3
  mov    $0xffffffff,%ebp
  mov    $0xffffffff,%r15d
  mov    $0x0,%r14d
  jmp    L85
L74:
  cmp    $0xffffffff,%r15d
  je     L121
  cmp    $0xffffffff,%ebp
  jne    L42
  mov    %rbx,%rdi
  call   <ftell@plt>
  lea    -0x1(%rax),%ebp
  jmp    L42
L121:
  mov    %rbx,%rdi
  call   <ftell@plt>
  mov    %eax,%r15d
  jmp    L42
L50:
  sub    %r15d,%ebp
  lea    0x1(%rbp),%edi
  mov    $0x1,%esi
  call   <calloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L96
  mov    D22(%rip),%rax
  mov    (%rax),%edx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <fseek@plt>
  test   %rax,%rax
  jne    L166
  mov    %rbx,%rcx
  mov    %ebp,%edx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fread@plt>
  cmp    %ebp,%eax
  jl     L166
  mov    D0(%rip),%rax
  mov    (%rax),%edx
  mov    $0x2,%esi
  mov    %rbx,%rdi
  call   <fseek@plt>
  test   %rax,%rax
  jne    L166
  movslq %r14d,%rax
  mov    0x8(%rsp),%rcx
  mov    %r13,(%rcx,%rax,8)
  lea    0x1(%r14),%r14d
  mov    $0xffffffff,%ebp
  mov    $0xffffffff,%r15d
L42:
  cmp    (%r12),%r14d
  jge    L3
L85:
  mov    %rbx,%rdi
  call   <fgetc@plt>
  cmp    $0x22,%eax
  je     L74
  cmp    $0x2c,%eax
  je     L50
  mov    %rbx,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L42
  jmp    L50
L96:
  mov    (%r12),%esi
  mov    0x8(%rsp),%rdi
  call   <freeNames@plt>
  mov    %r13,0x8(%rsp)
  jmp    L3
L166:
  mov    (%r12),%esi
  mov    0x8(%rsp),%rdi
  call   <freeNames@plt>
  mov    %r13,%rdi
  call   <free@plt>
  movq   $0x0,0x8(%rsp)
L3:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char **readNames(FILE *f, int *count) {
  rewind(f);
  *count = 0;
  int c;
  for (; (c = fgetc(f)) != EOF; (*count) += (c == ','))
    ;
  (*count) += (ftell(f) > 0);
  char **names = malloc(sizeof(*names) * (*count));
  if (names == NULL) {
    return NULL;
  }
  rewind(f);
  int i = 0, start = -1, end = -1;
  while (i < *count) {
    c = fgetc(f);
    if (c == '"') {
      if (start == -1) {
        start = ftell(f);
      } else if (end == -1) {
        end = ftell(f) - 1;
      }
    } else if (c == ',' || feof(f)) {
      int length = end - start;
      char *name = calloc(length + 1, 1);
      if (name == NULL) {
        freeNames(names, *count);
        return NULL;
      }
      if (fseek(f, start, SEEK_SET) != 0 || fread(name, 1, length, f) < length || fseek(f, 2, SEEK_CUR) != 0) {
        freeNames(names, *count);
        free(name);
        return NULL;
      }
      names[i++] = name;
      start = end = -1;
    }
  }
  return names;
}
```