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

```asm
<strqetok>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L143
  mov    %rdi,D300(%rip)
  mov    %rdi,D8(%rip)
  movb   $0x0,D329(%rip)
  movb   $0x0,D53(%rip)
L28:
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L254
  xor    %r13d,%r13d
  jmp    L6
  nopl   (%rax)
L32:
  mov    D300(%rip),%rax
  test   %r13,%r13
  movb   $0x0,D329(%rip)
  mov    %dil,(%rax)
  lea    0x1(%rax),%rdx
  cmove  %rax,%r13
  mov    D8(%rip),%rax
  mov    %rdx,D303(%rip)
  movsbl 0x1(%rax),%edi
L33:
  add    $0x1,%rax
  mov    %rax,D303(%rip)
  test   %dil,%dil
  je     L156
L6:
  cmpb   $0x0,D329(%rip)
  jne    L32
  movzbl D53(%rip),%eax
  test   %al,%al
  je     L247
  cmp    %dil,%al
  jne    L161
  mov    D303(%rip),%rax
  movb   $0x0,D53(%rip)
  movsbl 0x1(%rax),%edi
  add    $0x1,%rax
  mov    %rax,D303(%rip)
  test   %dil,%dil
  jne    L6
  nopl   0x0(%rax)
L156:
  test   %r13,%r13
  je     L213
  mov    D303(%rip),%rax
  movb   $0x0,(%rax)
L213:
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L247:
  mov    %rbp,%rsi
  call   <_isinstr@plt>
  test   %rax,%rax
  je     L122
  test   %r13,%r13
  jne    L114
L239:
  mov    D303(%rip),%rax
  movsbl 0x1(%rax),%edi
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L161:
  mov    %rbx,%rsi
  call   <_isinstr@plt>
  test   %rax,%rax
  mov    D303(%rip),%rax
  je     L245
  movzbl 0x1(%rax),%edx
  test   %dl,%dl
  je     L245
  movsbl D53(%rip),%edi
  cmp    %dil,%dl
  jne    L51
  movb   $0x1,D329(%rip)
  jmp    L33
  nopl   0x0(%rax)
L51:
  movsbl %dl,%edi
  mov    %rbx,%rsi
  call   <_isinstr@plt>
  test   %rax,%rax
  mov    D303(%rip),%rax
  jne    L178
  nopl   0x0(%rax,%rax,1)
L245:
  mov    D303(%rip),%rdx
  test   %r13,%r13
  cmove  %rdx,%r13
L179:
  lea    0x1(%rdx),%rcx
  mov    %rcx,D303(%rip)
  movzbl (%rax),%ecx
  mov    %cl,(%rdx)
  movsbl 0x1(%rax),%edi
  jmp    L33
  nop
L122:
  mov    D303(%rip),%rax
  mov    %rbx,%rsi
  movsbl (%rax),%edi
  call   <_isinstr@plt>
  test   %rax,%rax
  je     L199
  movb   $0x1,D329(%rip)
  jmp    L239
  nopl   0x0(%rax,%rax,1)
L143:
  mov    D303(%rip),%rdi
  test   %rdi,%rdi
  jne    L28
L254:
  add    $0x8,%rsp
  xor    %r13d,%r13d
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L199:
  mov    D303(%rip),%rax
  mov    %r12,%rsi
  movsbl (%rax),%edi
  call   <_isinstr@plt>
  test   %rax,%rax
  je     L128
  mov    D303(%rip),%rax
  test   %r13,%r13
  cmove  D303(%rip),%r13
  movzbl (%rax),%edx
  mov    %dl,D303(%rip)
  movsbl 0x1(%rax),%edi
  jmp    L33
L178:
  movb   $0x1,D329(%rip)
  movsbl 0x1(%rax),%edi
  jmp    L33
L128:
  mov    D303(%rip),%rdx
  test   %r13,%r13
  mov    D303(%rip),%rax
  cmove  %rdx,%r13
  jmp    L179
L114:
  mov    D303(%rip),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,D303(%rip)
  movb   $0x0,(%rax)
  jmp    L213
```

assistant: ```c
char *strqetok(char *str, const char *quot, const char *esc, const char *delim) {
  static char *r, *w;
  static unsigned char e;
  static char q;
  char *t = 0;
  if (str) {
    r = w = str;
    e = 0;
    q = '\0';
  }
  if (!r)
    return 0;
  while (*r) {
    if (e) {
      if (!t)
        t = w;
      *w++ = *r;
      e = 0;
    } else if (q) {
      if (*r == q) {
        q = '\0';
      } else if (_isinstr(*r, esc) && r[1] && (r[1] == q || _isinstr(r[1], esc))) {
        e = 1;
      } else {
        if (!t)
          t = w;
        *w++ = *r;
      }
    } else {
      if (_isinstr(*r, delim)) {
        if (t) {
          *w++ = '\0';
          return t;
        }
      } else if (_isinstr(*r, esc)) {
        e = 1;
      } else if (_isinstr(*r, quot)) {
        if (!t)
          t = w;
        q = *r;
      } else {
        if (!t)
          t = w;
        *w++ = *r;
      }
    }
    ++r;
  }
  if (t)
    *w = '\0';
  return t;
}
```