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

```asm
<ksplit_core>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  movl   $0x0,-0x2c(%rbp)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L77
L58:
  cmpl   $0x0,-0x3c(%rbp)
  jne    L97
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L96
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L197
L96:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <isgraph@plt>
  test   %rax,%rax
  je     L62
  cmpq   $0x0,-0x50(%rbp)
  je     L290
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x2c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jne    L178
  cmpl   $0x0,-0x28(%rbp)
  je     L307
  mov    -0x28(%rbp),%eax
  add    %eax,%eax
  jmp    L265
L307:
  mov    $0x2,%eax
L265:
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L245
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L178
L245:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x50(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L68
L178:
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L62
L290:
  addl   $0x1,-0x2c(%rbp)
  jmp    L62
L197:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L166
  cmpl   $0x0,-0x24(%rbp)
  jne    L62
L166:
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L62
L97:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x3c(%rbp)
  je     L331
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L69
L331:
  cmpl   $0x0,-0x24(%rbp)
  je     L305
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L305
  cmpq   $0x0,-0x50(%rbp)
  je     L262
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x2c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jne    L127
  cmpl   $0x0,-0x28(%rbp)
  je     L113
  mov    -0x28(%rbp),%eax
  add    %eax,%eax
  jmp    L84
L113:
  mov    $0x2,%eax
L84:
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L235
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L127
L235:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x50(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L68
L127:
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L305
L262:
  addl   $0x1,-0x2c(%rbp)
  jmp    L305
L69:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L70
  cmpl   $0x0,-0x24(%rbp)
  jne    L62
L70:
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L62
L305:
  nop
L62:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x24(%rbp)
  addl   $0x1,-0x30(%rbp)
L77:
  mov    -0x30(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L58
  mov    -0x48(%rbp),%rax
  mov    -0x28(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x2c(%rbp),%eax
L68:
  leave
  ret
```

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;
}
```