user: 请将以下的汇编代码转换成C语言代码：

```asm
<read_nul_sep>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D8(%rip),%rax
  mov    (%rax),%esi
  call   <open@plt>
  mov    %eax,%r15d
  mov    $0x1000,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    $0x0,%ebp
  mov    $0x1000,%r14d
  test   %rax,%rax
  je     L85
L60:
  movslq %ebp,%r13
  mov    %r14d,%edx
  sub    %ebp,%edx
  lea    (%r12,%r13,1),%rsi
  mov    %r15d,%edi
  call   <read@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L100
  je     L145
  add    %eax,%ebp
  cmp    %ebp,%r14d
  jne    L60
  add    %r14d,%r14d
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <realloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L60
  mov    %r15d,%edi
  call   <close@plt>
  movq   $0x0,0x8(%rsp)
  jmp    L30
L85:
  mov    %r15d,%edi
  call   <close@plt>
  movq   $0x0,0x8(%rsp)
  jmp    L30
L100:
  mov    %r15d,%edi
  call   <close@plt>
  mov    %r12,%rdi
  call   <free@plt>
  movq   $0x0,0x8(%rsp)
L30:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L145:
  mov    %r15d,%edi
  call   <close@plt>
  mov    %ebx,%eax
  mov    %ebx,%r15d
  test   %ebp,%ebp
  jle    L6
  mov    %r12,%rax
  lea    -0x1(%rbp),%edx
  lea    0x1(%r12,%rdx,1),%rdx
L80:
  cmpb   $0x1,(%rax)
  adc    $0x0,%r15d
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L80
  mov    %ebp,%eax
L6:
  cltq
  cmpb   $0x1,-0x1(%r12,%rax,1)
  sbb    $0xffffffff,%r15d
  lea    0x9(%rbp,%r15,8),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %rax,0x8(%rsp)
  movslq %r15d,%r15
  movq   $0x0,(%rax,%r15,8)
  lea    0x8(%rax,%r15,8),%r15
  mov    %ebp,%edx
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  movb   $0x0,(%r15,%r13,1)
  mov    %r12,%rdi
  call   <free@plt>
  test   %ebp,%ebp
  jg     L24
  jmp    L30
L37:
  add    $0x1,%ebx
  add    $0x8,%r14
  cmp    %ebx,%ebp
  jle    L30
L24:
  movslq %ebx,%rax
  add    %r15,%rax
  mov    %rax,(%r14)
  cmp    %ebx,%ebp
  jle    L37
L106:
  cmpb   $0x0,(%rax)
  je     L37
  add    $0x1,%ebx
  add    $0x1,%rax
  cmp    %ebx,%ebp
  jne    L106
  jmp    L37
```

assistant: ```c
const char **read_nul_sep(const char *filename) {
  char *buf = NULL;
  char *newbuf = NULL;
  int buflen = 0;
  int count = 0;
  int size = 0;
  int i = 0;
  char **results;
  int fd = open(filename, O_RDONLY);
  buf = (char *)malloc(4096);
  size = 4096;
  if (buf == NULL) {
    close(fd);
    return NULL;
  }
  while (1) {
    int r = 0;
    if (size - buflen == 0) {
      buf = (char *)realloc(buf, size * 2);
      size = size * 2;
      if (buf == NULL) {
        close(fd);
        return NULL;
      }
    }
    r = read(fd, &buf[buflen], size - buflen);
    if (r < 0) {
      close(fd);
      free(buf);
      return NULL;
    }
    if (r == 0) {
      close(fd);
      break;
    }
    buflen += r;
  }
  for (i = 0; i < buflen; i += 1) {
    if (buf[i] == '\0') {
      count += 1;
    }
  }
  if (buf[i - 1] != '\0') {
    count += 1;
  }
  results = (char **)malloc(sizeof(char *) * (count + 1) + (buflen + 1));
  for (i = count; i < count + 1; i += 1) {
    results[i] = NULL;
  }
  newbuf = ((char *)results) + sizeof(char *) * (count + 1);
  memcpy(newbuf, buf, buflen);
  newbuf[buflen] = '\0';
  free(buf);
  count = 0;
  for (i = 0; i < buflen;) {
    results[count++] = &newbuf[i];
    for (; i < buflen && newbuf[i] != '\0'; i += 1)
      ;
    i += 1;
  }
  return (const char **)results;
}
```