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

```asm
<split>:
  endbr64
  push   %rbp
  mov    %rsi,%r8
  mov    %edx,%r9d
  mov    %rdi,%rax
  push   %rbx
  movzbl (%rcx),%esi
  movzbl (%rdi),%edx
  test   %sil,%sil
  je     L36
  xor    %r11d,%r11d
  test   %dl,%dl
  je     L394
  movzbl 0x1(%rcx),%edi
  test   %dil,%dil
  jne    L276
  mov    %r9d,%ecx
  mov    %rax,(%r8)
  lea    0x8(%r8),%rdi
  sub    $0x1,%ecx
  jne    L307
  jmp    L301
  nop
L489:
  test   %dl,%dl
  je     L454
L307:
  movzbl (%rax),%edx
  add    $0x1,%rax
  cmp    %dl,%sil
  jne    L489
  add    $0x8,%rdi
  movb   $0x0,-0x1(%rax)
  mov    %rax,-0x8(%rdi)
  sub    $0x1,%ecx
  jne    L307
L301:
  mov    %r9d,%r11d
  nopl   0x0(%rax,%rax,1)
L370:
  movzbl (%rax),%edx
  add    $0x1,%rax
  cmp    %dl,%sil
  je     L118
  test   %dl,%dl
  jne    L370
L394:
  mov    %r11d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L157:
  mov    %rcx,%rax
L36:
  movzbl (%rax),%edx
  lea    0x1(%rax),%rcx
  cmp    $0x9,%dl
  je     L157
  cmp    $0x20,%dl
  je     L157
  xor    %r11d,%r11d
  test   %dl,%dl
  je     L394
  mov    $0x9,%edi
  mov    $0x1,%ebp
  mov    $0x20,%esi
L311:
  mov    %r9d,%ebx
L142:
  add    $0x8,%r8
  mov    %ebx,%r11d
  mov    %rax,%rdx
  sub    $0x1,%ebx
  mov    %rax,-0x8(%r8)
  jmp    L268
L12:
  cmp    %sil,%cl
  je     L214
  test   %cl,%cl
  je     L85
L268:
  mov    %rdx,%r10
  movzbl (%rdx),%ecx
  add    $0x1,%rdx
  cmp    %dil,%cl
  jne    L12
L214:
  test   %ebx,%ebx
  je     L212
  movb   $0x0,-0x1(%rdx)
  mov    %rdx,%rax
L205:
  movzbl (%rax),%edx
  lea    0x1(%rax),%rcx
  cmp    %sil,%dl
  je     L388
  cmp    %dil,%dl
  jne    L142
L388:
  mov    %rcx,%rax
  jmp    L205
  nopl   (%rax)
L454:
  sub    %ecx,%r9d
  pop    %rbx
  pop    %rbp
  mov    %r9d,%r11d
  mov    %r11d,%eax
  ret
  nopl   0x0(%rax)
L85:
  test   %ebp,%ebp
  je     L324
  cmpb   $0x0,(%rax)
  cmove  %r11d,%ebx
L324:
  sub    %ebx,%r9d
  pop    %rbx
  pop    %rbp
  mov    %r9d,%r11d
  mov    %r11d,%eax
  ret
L276:
  cmpb   $0x0,0x2(%rcx)
  je     L153
L78:
  cmp    %r9d,%r11d
  jge    L485
  mov    %rax,(%r8)
  movzbl (%rax),%edx
  add    $0x8,%r8
L485:
  add    $0x1,%r11d
  lea    0x1(%rax),%rdi
  test   %dl,%dl
  je     L394
L346:
  mov    %rcx,%rax
L8:
  movzbl (%rax),%esi
  add    $0x1,%rax
  test   %sil,%sil
  je     L340
  cmp    %dl,%sil
  jne    L8
  cmp    %r11d,%r9d
  jle    L264
  movb   $0x0,-0x1(%rdi)
  nopl   (%rax)
L264:
  mov    %rdi,%rax
  movzbl (%rdi),%edx
  add    $0x1,%rdi
  mov    %rcx,%rsi
L116:
  movzbl (%rsi),%r10d
  add    $0x1,%rsi
  test   %r10b,%r10b
  je     L78
  cmp    %r10b,%dl
  je     L264
  jmp    L116
  nopl   0x0(%rax)
L340:
  movzbl (%rdi),%edx
  add    $0x1,%rdi
  test   %dl,%dl
  jne    L346
  mov    %r11d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L118:
  add    $0x1,%r11d
  jmp    L370
L212:
  mov    %r9d,%r11d
  test   %cl,%cl
  je     L237
L176:
  movzbl (%rdx),%eax
  lea    0x1(%rdx),%rcx
  cmp    %dil,%al
  je     L98
  cmp    %sil,%al
  je     L98
  mov    %rdx,%r10
  add    $0x1,%r11d
  mov    %rcx,%rdx
  test   %al,%al
  je     L237
L260:
  cmp    %al,%sil
  je     L176
  cmp    %al,%dil
  je     L176
  movzbl (%rcx),%eax
  mov    %rcx,%r10
  add    $0x1,%rcx
  mov    %rcx,%rdx
  test   %al,%al
  jne    L260
L237:
  xor    %edx,%edx
  test   %ebp,%ebp
  je     L394
L133:
  movzbl -0x1(%r10),%eax
  lea    -0x1(%r10),%rcx
  cmp    %dil,%al
  je     L267
  cmp    %sil,%al
  je     L267
  test   %dl,%dl
  je     L394
  add    $0x1,%r9d
  cmp    %r11d,%r9d
  jne    L424
  movb   $0x0,(%r10)
L424:
  sub    $0x1,%r11d
  jmp    L394
  nopl   (%rax)
L98:
  mov    %rcx,%rdx
  jmp    L176
L267:
  mov    %eax,%edx
  mov    %rcx,%r10
  jmp    L133
L153:
  xor    %ebp,%ebp
  jmp    L311
```

assistant: ```c
int split(string, fields, nfields, sep)
char *string;
char *fields[];
int nfields;
char *sep;
{
  char *p = string;
  char c;
  char sepc = sep[0];
  char sepc2;
  int fn;
  char **fp = fields;
  char *sepp;
  int trimtrail;
  if (sepc == '\0') {
    while ((c = *p++) == ' ' || c == '\t')
      continue;
    p--;
    trimtrail = 1;
    sep = (char *)" \t";
    sepc = ' ';
  } else
    trimtrail = 0;
  sepc2 = sep[1];
  if (*p == '\0')
    return (0);
  if (sepc2 == '\0') {
    fn = nfields;
    for (;;) {
      *fp++ = p;
      fn--;
      if (fn == 0)
        break;
      while ((c = *p++) != sepc)
        if (c == '\0')
          return (nfields - fn);
      *(p - 1) = '\0';
    }
    fn = nfields;
    for (;;) {
      while ((c = *p++) != sepc)
        if (c == '\0')
          return (fn);
      fn++;
    }
  }
  if (sep[2] == '\0') {
    fn = nfields;
    for (;;) {
      *fp++ = p;
      fn--;
      while ((c = *p++) != sepc && c != sepc2)
        if (c == '\0') {
          if (trimtrail && **(fp - 1) == '\0')
            fn++;
          return (nfields - fn);
        }
      if (fn == 0)
        break;
      *(p - 1) = '\0';
      while ((c = *p++) == sepc || c == sepc2)
        continue;
      p--;
    }
    fn = nfields;
    while (c != '\0') {
      while ((c = *p++) == sepc || c == sepc2)
        continue;
      p--;
      fn++;
      while ((c = *p++) != '\0' && c != sepc && c != sepc2)
        continue;
    }
    if (trimtrail) {
      p--;
      while ((c = *--p) == sepc || c == sepc2)
        continue;
      p++;
      if (*p != '\0') {
        if (fn == nfields + 1)
          *p = '\0';
        fn--;
      }
    }
    return (fn);
  }
  fn = 0;
  for (;;) {
    if (fn < nfields)
      *fp++ = p;
    fn++;
    for (;;) {
      c = *p++;
      if (c == '\0')
        return (fn);
      sepp = sep;
      while ((sepc = *sepp++) != '\0' && sepc != c)
        continue;
      if (sepc != '\0')
        break;
    }
    if (fn < nfields)
      *(p - 1) = '\0';
    for (;;) {
      c = *p++;
      sepp = sep;
      while ((sepc = *sepp++) != '\0' && sepc != c)
        continue;
      if (sepc == '\0')
        break;
    }
    p--;
  }
}
```