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

```asm
<ksplit_core>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    (%rdx),%eax
  mov    %rdx,0x18(%rsp)
  mov    %eax,0x8(%rsp)
  mov    (%rcx),%rax
  mov    %rcx,0x10(%rsp)
  mov    %rax,(%rsp)
  call   <strlen@plt>
  test   %eax,%eax
  js     L45
  movl   $0x0,0xc(%rsp)
  mov    %eax,%ebx
  xor    %r14d,%r14d
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  jmp    L91
  nopl   0x0(%rax)
L163:
  test   %dil,%dil
  je     L128
  cmp    %edi,%r13d
  je     L128
  cmp    %r14d,%r13d
  je     L32
  test   %r14d,%r14d
  mov    %edi,%r14d
  je     L32
  nop
L24:
  add    $0x1,%r15d
  add    $0x1,%rbp
  cmp    %r15d,%ebx
  jl     L306
L91:
  movsbl 0x0(%rbp),%edi
  test   %r13d,%r13d
  jne    L163
  call   <isspace@plt>
  mov    %r14d,%edi
  test   %rax,%rax
  jne    L194
  cmpb   $0x0,0x0(%rbp)
  jne    L289
L194:
  call   <isgraph@plt>
  test   %rax,%rax
  jne    L11
  add    $0x1,%r15d
  movsbl 0x0(%rbp),%r14d
  add    $0x1,%rbp
  cmp    %r15d,%ebx
  jge    L91
  nopl   (%rax)
L306:
  mov    0x18(%rsp),%rax
  mov    0x8(%rsp),%ecx
  mov    %ecx,(%rax)
L234:
  mov    0x10(%rsp),%rax
  mov    (%rsp),%rsi
  mov    %rsi,(%rax)
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L128:
  test   %r14d,%r14d
  je     L198
  cmp    %r14d,%r13d
  je     L198
  movb   $0x0,0x0(%rbp)
  cmp    %r12d,0x8(%rsp)
  je     L282
L261:
  mov    (%rsp),%rdx
  mov    0xc(%rsp),%ecx
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %ecx,(%rdx,%rax,4)
  movsbl 0x0(%rbp),%r14d
  jmp    L24
  nopl   0x0(%rax)
L198:
  mov    %edi,%r14d
  jmp    L24
L11:
  movb   $0x0,0x0(%rbp)
  cmp    %r12d,0x8(%rsp)
  je     L84
L326:
  mov    (%rsp),%rsi
  mov    0xc(%rsp),%edx
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %edx,(%rsi,%rax,4)
  movsbl 0x0(%rbp),%r14d
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L32:
  mov    %edi,%r14d
L225:
  mov    %r15d,0xc(%rsp)
  jmp    L24
  nopl   (%rax)
L282:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  je     L254
  add    %eax,%eax
  mov    %eax,0x8(%rsp)
  lea    0x0(,%rax,4),%esi
L147:
  mov    (%rsp),%rdi
  call   <realloc@plt>
  test   %rax,%rax
  je     L19
  mov    %rax,(%rsp)
  jmp    L261
  nopl   0x0(%rax)
L289:
  call   <isspace@plt>
  test   %r14d,%r14d
  movsbl 0x0(%rbp),%r14d
  je     L225
  test   %rax,%rax
  jne    L225
  jmp    L24
  nopl   0x0(%rax)
L84:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  je     L167
  add    %eax,%eax
  mov    %eax,0x8(%rsp)
  lea    0x0(,%rax,4),%esi
L13:
  mov    (%rsp),%rdi
  call   <realloc@plt>
  test   %rax,%rax
  je     L251
  mov    %rax,(%rsp)
  jmp    L326
  nopl   0x0(%rax)
L254:
  movl   $0x2,0x8(%rsp)
  mov    $0x8,%esi
  jmp    L147
  nop
L167:
  movl   $0x2,0x8(%rsp)
  mov    $0x8,%esi
  jmp    L13
L19:
  mov    (%rsp),%rdi
  xor    %r12d,%r12d
  call   <free@plt>
  movq   $0x0,(%rsp)
  jmp    L234
L251:
  mov    (%rsp),%rdi
  xor    %r12d,%r12d
  call   <free@plt>
  movq   $0x0,(%rsp)
  jmp    L234
L45:
  xor    %r12d,%r12d
  jmp    L306
```

assistant: ```c
int ksplit_core(char *s, int delimiter, int *_max, int **_offsets) {
  int i, n, max, last_char, last_start, *offsets, l;
  n = 0;
  max = *_max;
  offsets = *_offsets;
  l = strlen(s);
  for (i = 0, last_char = last_start = 0; i <= l; ++i) {
    if (delimiter == 0) {
      if (isspace(s[i]) || s[i] == 0) {
        if (isgraph(last_char))
          do {
            if (_offsets) {
              s[i] = 0;
              if (n == max) {
                int *tmp;
                max = max ? max << 1 : 2;
                if ((tmp = (int *)realloc(offsets, sizeof(int) * max))) {
                  offsets = tmp;
                } else {
                  free(offsets);
                  *_offsets = NULL;
                  return 0;
                }
              }
              offsets[n++] = last_start;
            } else
              ++n;
          } while (0);
      } else {
        if (isspace(last_char) || last_char == 0)
          last_start = i;
      }
    } else {
      if (s[i] == delimiter || s[i] == 0) {
        if (last_char != 0 && last_char != delimiter)
          do {
            if (_offsets) {
              s[i] = 0;
              if (n == max) {
                int *tmp;
                max = max ? max << 1 : 2;
                if ((tmp = (int *)realloc(offsets, sizeof(int) * max))) {
                  offsets = tmp;
                } else {
                  free(offsets);
                  *_offsets = NULL;
                  return 0;
                }
              }
              offsets[n++] = last_start;
            } else
              ++n;
          } while (0);
      } else {
        if (last_char == delimiter || last_char == 0)
          last_start = i;
      }
    }
    last_char = s[i];
  }
  *_max = max;
  *_offsets = offsets;
  return n;
}
```