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

```asm
<strtok_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L38
  lea    D102(%rip),%r8
  lea    D61(%rip),%rax
  mov    %rax,%rcx
  lea    D105(%rip),%rax
  mov    %rax,%rdx
  mov    $0xef,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
L38:
  cmpq   $0x0,-0x28(%rbp)
  jne    L109
  lea    D36(%rip),%r8
  lea    D61(%rip),%rax
  mov    %rax,%rcx
  lea    D105(%rip),%rax
  mov    %rax,%rdx
  mov    $0xf0,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
L109:
  cmpq   $0x0,-0x18(%rbp)
  jne    L59
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
L59:
  cmpq   $0x0,-0x18(%rbp)
  jne    L110
  lea    D68(%rip),%r8
  lea    D61(%rip),%rax
  mov    %rax,%rcx
  lea    D105(%rip),%rax
  mov    %rax,%rdx
  mov    $0xf6,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug_panic@plt>
  jmp    L110
L99:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L41
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L68
L41:
  addq   $0x1,-0x18(%rbp)
L110:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L99
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L20
L88:
  addq   $0x1,-0x18(%rbp)
L20:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L88
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L84
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L35
L84:
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L35:
  mov    -0x8(%rbp),%rax
L68:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D102
type_guessed: string
name: read_data
arguments: label: D61
type_guessed: string
name: read_data
arguments: label: D105
type_guessed: string
name: read_data
arguments: label: D28
type_guessed: string
name: read_data
arguments: label: D36
type_guessed: string
name: read_data
arguments: label: D68
type_guessed: string

tool: D102: delimiters != NULL

tool: D61: assertion `%s' failed.

tool: D105: strtok_r

tool: D28: /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: D36: save_ptr != NULL

tool: D68: s != 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;
}
```