user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ksplit_core>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L55
L127:
  cmpl   $0x0,-0x2c(%rbp)
  jne    L26
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L25
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L262
L25:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <isgraph@plt>
  test   %rax,%rax
  je     L73
  cmpq   $0x0,-0x40(%rbp)
  je     L95
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L100
  cmpl   $0x0,-0x18(%rbp)
  je     L142
  mov    -0x18(%rbp),%eax
  add    %eax,%eax
  jmp    L87
L142:
  mov    $0x2,%eax
L87:
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x8(%rbp)
L100:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L73
L95:
  addl   $0x1,-0x1c(%rbp)
  jmp    L73
L262:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L225
  cmpl   $0x0,-0x14(%rbp)
  jne    L73
L225:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L73
L26:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x2c(%rbp)
  je     L183
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L251
L183:
  cmpl   $0x0,-0x14(%rbp)
  je     L153
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  je     L153
  cmpq   $0x0,-0x40(%rbp)
  je     L125
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L89
  cmpl   $0x0,-0x18(%rbp)
  je     L193
  mov    -0x18(%rbp),%eax
  add    %eax,%eax
  jmp    L130
L193:
  mov    $0x2,%eax
L130:
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x8(%rbp)
L89:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L153
L125:
  addl   $0x1,-0x1c(%rbp)
  jmp    L153
L251:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  je     L126
  cmpl   $0x0,-0x14(%rbp)
  jne    L73
L126:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L73
L153:
  nop
L73:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x20(%rbp)
L55:
  mov    -0x20(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L127
  mov    -0x38(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x1c(%rbp),%eax
  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) {
                max = max ? max << 1 : 2;
                offsets = (int *)realloc(offsets, sizeof(int) * max);
              }
              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) {
                max = max ? max << 1 : 2;
                offsets = (int *)realloc(offsets, sizeof(int) * max);
              }
              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;
}
```