user: 请从给定的汇编指令推导出C源代码:

```asm
<y_strsplit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,%rdi
  mov    %edx,0x4(%rsp)
  call   <strlen@plt>
  mov    %eax,%ebp
  test   %ebx,%ebx
  jle    L23
  lea    0x1(%rbx),%r15d
L42:
  lea    0x0(,%r15,8),%edi
  call   <malloc@plt>
  mov    0x18(%rsp),%r14
  mov    %r12,%rsi
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbx
  mov    %r14,%rdi
  call   <strstr@plt>
  mov    %rax,%r13
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L135
  test   %r13,%r13
  je     L135
  movslq %ebp,%rax
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  xchg   %ax,%ax
L82:
  mov    %r13,%rbp
  add    $0x1,%r15d
  add    $0x8,%rbx
  sub    %r14,%rbp
  lea    0x1(%rbp),%edi
  mov    %ebp,(%rsp)
  call   <malloc@plt>
  mov    (%rsp),%edx
  mov    %r14,%rsi
  mov    %rax,-0x8(%rbx)
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x8(%rbx),%rax
  movslq %ebp,%r8
  mov    %r12,%rsi
  movb   $0x0,(%rax,%r8,1)
  mov    0x8(%rsp),%rax
  lea    0x0(%r13,%rax,1),%r14
  mov    %r14,%rdi
  call   <strstr@plt>
  mov    %rax,%r13
  cmp    %r15d,0x4(%rsp)
  jle    L1
  test   %rax,%rax
  jne    L82
L1:
  mov    0x10(%rsp),%rcx
  movslq %r15d,%rax
  lea    (%rcx,%rax,8),%rbx
L143:
  cmp    %r15d,0x4(%rsp)
  jle    L4
  mov    0x18(%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L47
L4:
  movq   $0x0,(%rbx)
  mov    0x10(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L23:
  mov    0x18(%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L159
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbx
  jmp    L4
  xchg   %ax,%ax
L159:
  mov    %r12,%rsi
  mov    %rax,%rdi
  movslq %ebp,%rbx
  call   <strstr@plt>
  test   %rax,%rax
  je     L131
  movl   $0x0,0x4(%rsp)
  nop
L34:
  lea    (%rax,%rbx,1),%rdi
  mov    %r12,%rsi
  call   <strstr@plt>
  mov    0x4(%rsp),%ecx
  mov    %ecx,%r15d
  add    $0x1,%ecx
  mov    %ecx,0x4(%rsp)
  test   %rax,%rax
  jne    L34
  add    $0x2,%r15d
L104:
  mov    0x18(%rsp),%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  movslq %eax,%rdi
  sub    %rbx,%rdi
  add    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L42
  mov    %r15d,0x4(%rsp)
  add    $0x1,%r15d
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L47:
  mov    %r14,%rdi
  call   <strdup@plt>
  lea    0x1(%r15),%r9d
  mov    %rax,(%rbx)
  mov    0x10(%rsp),%rax
  movslq %r9d,%r9
  lea    (%rax,%r9,8),%rbx
  jmp    L4
L131:
  movl   $0x0,0x4(%rsp)
  mov    $0x1,%r15d
  jmp    L104
L135:
  mov    0x10(%rsp),%rbx
  mov    0x18(%rsp),%r14
  xor    %r15d,%r15d
  jmp    L143
```

assistant: ```c
char **y_strsplit(char *str, char *sep, int nelem) {
  char **vector;
  char *s, *p;
  int i = 0;
  int l = strlen(sep);
  if (nelem <= 0) {
    char *s;
    nelem = 0;
    if (*str) {
      for (s = strstr(str, sep); s; s = strstr(s + l, sep), nelem++)
        ;
      if (strcmp(str + strlen(str) - l, sep))
        nelem++;
    }
  }
  vector = (char **)malloc(sizeof(char *) * (nelem + 1));
  for (p = str, s = strstr(p, sep); i < nelem && s; p = s + l, s = strstr(p, sep), i++) {
    int len = s - p;
    vector[i] = (char *)malloc(sizeof(char) * (len + 1));
    strncpy(vector[i], p, len);
    vector[i][len] = '\0';
  }
  if ((i < nelem) && *str)
    vector[i++] = strdup(p);
  vector[i] = NULL;
  return vector;
}
```