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

```asm
<mystrtok>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    (%rdi),%rbx
  movzbl (%rbx),%ebp
  test   %bpl,%bpl
  je     L105
L108:
  movsbl %bpl,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L101
  add    $0x1,%rbx
  mov    %rbx,(%r12)
  movzbl (%rbx),%ebp
  test   %bpl,%bpl
  jne    L108
  mov    $0x0,%ebx
L21:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L101:
  test   %bpl,%bpl
  je     L98
  mov    (%r12),%rbp
  movzbl 0x0(%rbp),%r14d
  test   %r14b,%r14b
  je     L21
L24:
  movsbl %r14b,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L81
  add    $0x1,%rbp
  mov    %rbp,(%r12)
  movzbl 0x0(%rbp),%r14d
  test   %r14b,%r14b
  jne    L24
  jmp    L21
L81:
  test   %r14b,%r14b
  je     L21
  lea    0x1(%rbp),%rax
  mov    %rax,(%r12)
  movb   $0x0,0x0(%rbp)
  jmp    L21
L105:
  mov    $0x0,%ebx
  jmp    L21
L98:
  mov    %rax,%rbx
  jmp    L21
```

assistant: ```c
char *mystrtok(char **ptr, char const *sep) {
  char *res;
  char *tmp;
  char *tmp___0;
  char *tmp___1;
  char *__cil_tmp7;
  char __cil_tmp8;
  int __cil_tmp9;
  void *__cil_tmp10;
  char *__cil_tmp11;
  char *__cil_tmp12;
  char __cil_tmp13;
  int __cil_tmp14;
  char *__cil_tmp15;
  char *__cil_tmp16;
  char __cil_tmp17;
  int __cil_tmp18;
  void *__cil_tmp19;
  char *__cil_tmp20;
  char *__cil_tmp21;
  char __cil_tmp22;
  int __cil_tmp23;
  void *__cil_tmp24;
  unsigned long __cil_tmp25;
  unsigned long __cil_tmp26;
  char *__cil_tmp27;
  char *__cil_tmp28;
  char __cil_tmp29;
  int __cil_tmp30;
  char *__cil_tmp31;
  {
    {
      __cil_tmp7 = *ptr;
      __cil_tmp8 = *__cil_tmp7;
      __cil_tmp9 = (int)__cil_tmp8;
      if (__cil_tmp9 == 0) {
        {
          __cil_tmp10 = (void *)0;
          return ((char *)__cil_tmp10);
        }
      } else {
      }
    }
    {
      while (1) {
      while_13_continue:;
        {
          __cil_tmp11 = *ptr;
          if (*__cil_tmp11) {
            {
              __cil_tmp12 = *ptr;
              __cil_tmp13 = *__cil_tmp12;
              __cil_tmp14 = (int)__cil_tmp13;
              tmp = strchr(sep, __cil_tmp14);
            }
            if (tmp) {
            } else {
              goto while_13_break;
            }
          } else {
            goto while_13_break;
          }
        }
        __cil_tmp15 = *ptr;
        *ptr = __cil_tmp15 + 1;
      }
    while_13_break:;
    }
    {
      __cil_tmp16 = *ptr;
      __cil_tmp17 = *__cil_tmp16;
      __cil_tmp18 = (int)__cil_tmp17;
      if (__cil_tmp18 == 0) {
        {
          __cil_tmp19 = (void *)0;
          return ((char *)__cil_tmp19);
        }
      } else {
      }
    }
    res = *ptr;
    {
      while (1) {
      while_14_continue:;
        {
          __cil_tmp20 = *ptr;
          if (*__cil_tmp20) {
            {
              __cil_tmp21 = *ptr;
              __cil_tmp22 = *__cil_tmp21;
              __cil_tmp23 = (int)__cil_tmp22;
              tmp___0 = strchr(sep, __cil_tmp23);
            }
            {
              __cil_tmp24 = (void *)0;
              __cil_tmp25 = (unsigned long)__cil_tmp24;
              __cil_tmp26 = (unsigned long)tmp___0;
              if (__cil_tmp26 == __cil_tmp25) {
              } else {
                goto while_14_break;
              }
            }
          } else {
            goto while_14_break;
          }
        }
        __cil_tmp27 = *ptr;
        *ptr = __cil_tmp27 + 1;
      }
    while_14_break:;
    }
    {
      __cil_tmp28 = *ptr;
      __cil_tmp29 = *__cil_tmp28;
      __cil_tmp30 = (int)__cil_tmp29;
      if (__cil_tmp30 != 0) {
        tmp___1 = *ptr;
        __cil_tmp31 = *ptr;
        *ptr = __cil_tmp31 + 1;
        *tmp___1 = (char)0;
      } else {
      }
    }
    return (res);
  }
}
```