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

```asm
<strtok_r>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%r13
  test   %rsi,%rsi
  je     L123
L92:
  test   %r13,%r13
  je     L124
L113:
  test   %rbx,%rbx
  jne    L70
  mov    0x0(%r13),%rbx
  test   %rbx,%rbx
  jne    L70
  lea    D93(%rip),%r8
  lea    D70(%rip),%rcx
  lea    D37(%rip),%rdx
  mov    $0xf6,%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
  jmp    L70
L123:
  lea    D24(%rip),%r8
  lea    D70(%rip),%rcx
  lea    D37(%rip),%rdx
  mov    $0xef,%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
  jmp    L92
L124:
  lea    D67(%rip),%r8
  lea    D70(%rip),%rcx
  lea    D37(%rip),%rdx
  mov    $0xf0,%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
  jmp    L113
L125:
  add    $0x1,%rbx
L70:
  movzbl (%rbx),%ebp
  movsbl %bpl,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L2
  test   %bpl,%bpl
  jne    L125
  mov    $0x0,%eax
L78:
  mov    %rbx,0x0(%r13)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  mov    %rbx,%rbp
L87:
  mov    %rbp,%r15
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%r14d
  movsbl %r14b,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L87
  test   %r14b,%r14b
  je     L11
  movb   $0x0,0x0(%rbp)
  mov    %rbx,%rax
  lea    0x2(%r15),%rbx
  jmp    L78
L11:
  mov    %rbx,%rax
  mov    %rbp,%rbx
  jmp    L78
```

tool_calls: name: disassemble_data
arguments: data_tag: D93
type_guessed: string
name: disassemble_data
arguments: data_tag: D70
type_guessed: string
name: disassemble_data
arguments: data_tag: D37
type_guessed: string
name: disassemble_data
arguments: data_tag: D22
type_guessed: string
name: disassemble_data
arguments: data_tag: D24
type_guessed: string
name: disassemble_data
arguments: data_tag: D67
type_guessed: string

tool: D93: s != NULL

tool: D70: assertion `%s' failed.

tool: D37: strtok_r

tool: D22: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Coding-Headache/CNOS/refs/heads/master/OS_Dev/pintos/lib/string.c

tool: D24: delimiters != NULL

tool: D67: save_ptr != NULL

assistant: ```c
char *strtok_r(char *s, const char *delimiters, char **save_ptr) {
  char *token;
  if (delimiters != ((void *)0)) {
  } else {
    debug_panic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Coding-Headache/CNOS/refs/heads/master/OS_Dev/pintos/lib/string.c", 239, __func__, "assertion `%s' failed.", "delimiters != NULL");
  };
  if (save_ptr != ((void *)0)) {
  } else {
    debug_panic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Coding-Headache/CNOS/refs/heads/master/OS_Dev/pintos/lib/string.c", 240, __func__, "assertion `%s' failed.", "save_ptr != NULL");
  };
  if (s == ((void *)0))
    s = *save_ptr;
  if (s != ((void *)0)) {
  } else {
    debug_panic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Coding-Headache/CNOS/refs/heads/master/OS_Dev/pintos/lib/string.c", 246, __func__, "assertion `%s' failed.", "s != NULL");
  };
  while (strchr(delimiters, *s) != ((void *)0)) {
    if (*s == '\0') {
      *save_ptr = s;
      return ((void *)0);
    }
    s++;
  }
  token = s;
  while (strchr(delimiters, *s) == ((void *)0))
    s++;
  if (*s != '\0') {
    *s = '\0';
    *save_ptr = s + 1;
  } else
    *save_ptr = s;
  return token;
}
```