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

```asm
<makeargv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L29
  cmpq   $0x0,-0x40(%rbp)
  je     L29
  cmpq   $0x0,-0x48(%rbp)
  jne    L71
L29:
  mov    D31(%rip),%rax
  mov    (%rax),%edx
  mov    D15(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L128
L71:
  mov    -0x48(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L18
  mov    $0xffffffff,%eax
  jmp    L128
L18:
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movl   $0x0,-0x28(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  test   %rax,%rax
  je     L118
  movl   $0x1,-0x28(%rbp)
  jmp    L49
L74:
  addl   $0x1,-0x28(%rbp)
L49:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  test   %rax,%rax
  jne    L74
L118:
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x48(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L44
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    D15(%rip),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L128
L44:
  cmpl   $0x0,-0x28(%rbp)
  jne    L35
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L134
L35:
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rbx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,(%rbx)
  movl   $0x1,-0x2c(%rbp)
  jmp    L59
L123:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x2c(%rbp)
L59:
  mov    -0x2c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L123
L134:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x28(%rbp),%eax
L128:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int makeargv(const char *s, const char *delim, char ***argvp) {
  int error, i, ntokens;
  const char *snew;
  char *t;
  if ((s == NULL) || (delim == NULL) || (argvp == NULL)) {
    errno = EINVAL;
    return -1;
  }
  *argvp = NULL;
  snew = s + strspn(s, delim);
  if ((t = malloc(strlen(snew) + 1)) == NULL)
    return -1;
  strcpy(t, snew);
  ntokens = 0;
  if (strtok(t, delim) != NULL)
    for (ntokens = 1; strtok(NULL, delim) != NULL; ntokens++)
      ;
  if ((*argvp = malloc(ntokens + 1)) == NULL) {
    error = errno;
    free(t);
    errno = error;
    return -1;
  }
  if (ntokens == 0)
    free(t);
  else {
    strcpy(t, snew);
    **argvp = strtok(t, delim);
    for (i = 1; i < ntokens; i++)
      *((*argvp) + i) = strtok(NULL, delim);
  }
  *((*argvp) + ntokens) = NULL;
  return ntokens;
}
```