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

```asm
<nv_strtok>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,%eax
  mov    %rdx,-0x58(%rbp)
  mov    %al,-0x4c(%rbp)
  movsbl -0x4c(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <count_number_of_chars@plt>
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L25
L26:
  addq   $0x1,-0x28(%rbp)
L0:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x4c(%rbp)
  jne    L26
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,(%rdx)
  addq   $0x1,-0x28(%rbp)
  addl   $0x1,-0x34(%rbp)
L25:
  mov    -0x34(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L0
  mov    -0x48(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  sub    -0x48(%rbp),%rax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <nv_strndup@plt>
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  movl   $0x1,-0x34(%rbp)
  jmp    L47
L37:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x34(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x3,%rdx
  lea    -0x8(%rdx),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  mov    -0x34(%rbp),%ecx
  movslq %ecx,%rcx
  lea    0x0(,%rcx,8),%rsi
  mov    -0x18(%rbp),%rcx
  lea    (%rsi,%rcx,1),%rbx
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <nv_strndup@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x34(%rbp)
L47:
  mov    -0x30(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L37
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x58(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char **nv_strtok(char *s, char c, int *n) {
  int count, i, len;
  char **delims, **tokens, *m;
  count = count_number_of_chars(s, c);
  delims = (char **)malloc((count + 1) * sizeof(char *));
  m = s;
  for (i = 0; i < count; i++) {
    while (*m != c)
      m++;
    delims[i] = m;
    m++;
  }
  delims[count] = (char *)strchr(s, '\0');
  tokens = (char **)malloc((count + 1) * sizeof(char *));
  len = delims[0] - s;
  tokens[0] = nv_strndup(s, len);
  for (i = 1; i < count + 1; i++) {
    len = delims[i] - delims[i - 1];
    tokens[i] = nv_strndup(delims[i - 1] + 1, len - 1);
  }
  free(delims);
  *n = count + 1;
  return (tokens);
}
```