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

```asm
<split_path>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L53
  movl   $0x0,(%rsi)
L53:
  test   %rbx,%rbx
  je     L180
  movzbl (%rbx),%edx
  cmp    $0x2f,%dl
  je     L67
  xor    %esi,%esi
  xor    %ebp,%ebp
  mov    $0x8,%r8d
  mov    $0x1,%r13d
  test   %dl,%dl
  je     L25
L186:
  mov    %rbx,%rax
  jmp    L238
  nopl   (%rax)
L95:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
L238:
  cmp    $0x2f,%dl
  je     L95
  mov    %rax,%rcx
  test   %dl,%dl
  je     L201
  nopl   0x0(%rax)
L98:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L279
  cmp    $0x2f,%dl
  jne    L98
L279:
  mov    %rax,%r8
  lea    0x1(%rbp),%edi
  sub    %rcx,%r8
  cmp    %ecx,%eax
  je     L85
  lea    0x1(%rsi,%r8,1),%esi
  test   %dl,%dl
  je     L208
  mov    %edi,%ebp
  jmp    L238
  nopl   0x0(%rax,%rax,1)
L201:
  lea    0x1(%rbp),%eax
  movslq %eax,%r13
  lea    (%rsi,%rax,8),%r8d
L25:
  mov    %r8d,%edi
  call   <malloc@plt>
  test   %rax,%rax
  je     L5
  movzbl (%rbx),%edx
  lea    (%rax,%r13,8),%r8
  mov    %rax,%r9
  cmp    $0x2f,%dl
  jne    L49
  mov    $0x2f,%edx
  mov    %r8,(%rax)
  lea    0x8(%rax),%r9
  add    $0x2,%r8
  mov    %dx,-0x2(%r8)
  movzbl (%rbx),%edx
L49:
  test   %dl,%dl
  je     L246
  cs nopw 0x0(%rax,%rax,1)
L237:
  cmp    $0x2f,%dl
  jne    L4
  nopl   (%rax)
L26:
  movzbl 0x1(%rbx),%edx
  add    $0x1,%rbx
  cmp    $0x2f,%dl
  je     L26
  test   %dl,%dl
  je     L246
L4:
  mov    %rbx,%rdi
  nopl   0x0(%rax)
L265:
  movzbl 0x1(%rbx),%edx
  add    $0x1,%rbx
  test   %dl,%dl
  je     L168
  cmp    $0x2f,%dl
  jne    L265
L168:
  cmp    %rdi,%rbx
  je     L246
  add    $0x8,%r9
  mov    %r8,-0x8(%r9)
  cmp    %rdi,%rbx
  jbe    L184
  mov    %rbx,%rsi
  xor    %edx,%edx
  sub    %rdi,%rsi
  nopl   0x0(%rax,%rax,1)
L244:
  movzbl (%rdi,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  jne    L244
  add    %r8,%rsi
L249:
  movb   $0x0,(%rsi)
  movzbl (%rbx),%edx
  lea    0x1(%rsi),%r8
  test   %dl,%dl
  jne    L237
L246:
  movq   $0x0,(%r9)
  test   %r12,%r12
  je     L266
  mov    %ebp,(%r12)
L266:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L184:
  mov    %r8,%rsi
  jmp    L249
L208:
  add    $0x2,%ebp
  movslq %ebp,%r13
  lea    (%rsi,%rbp,8),%r8d
  mov    %edi,%ebp
  jmp    L25
L67:
  mov    $0x2,%esi
  mov    $0x1,%ebp
  jmp    L186
L180:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  test   %r12,%r12
  je     L180
  movl   $0xffffffff,(%r12)
  jmp    L266
L85:
  movslq %edi,%r13
  lea    (%rsi,%rdi,8),%r8d
  jmp    L25
```

assistant: ```c
char **split_path(const char *path, int *count) {
  int n_components, component_len, total_component_len, alloc_len;
  const char *start, *end;
  char *mem_block, **array_ptr, *component_ptr;
  if (count)
    *count = 0;
  if (!path)
    return NULL;
  if (*path == '/') {
    n_components = 1;
    total_component_len = 2;
  } else {
    n_components = 0;
    total_component_len = 0;
  }
  for (start = end = path; *start; start = end) {
    for (start = end; *start && *start == '/'; start++)
      ;
    for (end = start; *end && *end != '/'; end++)
      ;
    if ((component_len = end - start) == 0)
      break;
    n_components++;
    total_component_len += component_len + 1;
  }
  alloc_len = ((n_components + 1) * sizeof(char *)) + total_component_len;
  if ((mem_block = malloc(alloc_len)) == NULL) {
    if (count)
      *count = -1;
    return NULL;
  }
  array_ptr = (char **)mem_block;
  component_ptr = mem_block + ((n_components + 1) * sizeof(char *));
  if (*path == '/') {
    *array_ptr++ = component_ptr;
    *component_ptr++ = '/';
    *component_ptr++ = 0;
  }
  for (start = end = path; *start; start = end) {
    for (start = end; *start && *start == '/'; start++)
      ;
    for (end = start; *end && *end != '/'; end++)
      ;
    if ((end - start) == 0)
      break;
    *array_ptr++ = component_ptr;
    while (start < end)
      *component_ptr++ = *start++;
    *component_ptr++ = 0;
  }
  *array_ptr = NULL;
  if (count)
    *count = n_components;
  return (char **)mem_block;
}
```