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

```asm
<ad_utils_split_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  je     L27
  movq   $0x0,-0x28(%rbp)
  jmp    L2
L4:
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  addq   $0x1,-0x28(%rbp)
L2:
  mov    -0x50(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L4
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
L27:
  mov    -0x30(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char **ad_utils_split_str(const char *str, const char *delims) {
  const char *p, *s = str;
  char **tokens = NULL;
  size_t i, tkn_len;
  if (str != NULL) {
    for (i = 0; (p = strpbrk(s, delims)); i++) {
      tokens = realloc(tokens, sizeof(char *) * (i + 3));
      tkn_len = p - s;
      tokens[i] = malloc(sizeof(char) * (tkn_len + 1));
      strncpy(tokens[i], s, tkn_len);
      tokens[i][tkn_len] = '\0';
      s = p + 1;
    }
    tkn_len = strlen(str) - (s - str);
    tokens[i] = malloc(sizeof(char) * (tkn_len + 1));
    strncpy(tokens[i], s, tkn_len);
    tokens[i][tkn_len] = '\0';
    tokens[i + 1] = NULL;
  }
  return tokens;
}
```