user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<nextch>:
  endbr64
  mov    $0x0,%r9d
  cmp    $0x1,%esi
  ja     L4
  mov    %esi,%edx
  test   %rdi,%rdi
  je     L164
  movslq %esi,%rdx
  lea    D85(%rip),%rax
  mov    %rdi,(%rax,%rdx,8)
  lea    D60(%rip),%rax
  movl   $0x0,(%rax,%rdx,4)
  mov    $0x1,%r9d
L4:
  mov    %r9d,%eax
  ret
L164:
  movslq %esi,%rax
  lea    D85(%rip),%rcx
  mov    (%rcx,%rax,8),%rdi
  test   %rdi,%rdi
  je     L142
  lea    D60(%rip),%rcx
  mov    (%rcx,%rax,4),%eax
  test   %eax,%eax
  jne    L134
  mov    $0x0,%r9d
  cmpb   $0x2d,(%rdi)
  je     L4
  movslq %eax,%rcx
  movzbl (%rdi,%rcx,1),%r9d
L59:
  cmp    $0x5c,%r9b
  je     L119
  test   %r9b,%r9b
  je     L187
L44:
  lea    D60(%rip),%r8
  movslq %edx,%rsi
  mov    (%r8,%rsi,4),%eax
  lea    0x1(%rax),%ecx
  mov    %ecx,(%r8,%rsi,4)
  cltq
  movzbl (%rdi,%rax,1),%r9d
  lea    D55(%rip),%rax
  mov    %r9b,(%rax,%rsi,1)
  movslq %ecx,%rax
  cmpb   $0x2d,(%rdi,%rax,1)
  jne    L4
  push   %rbp
  push   %rbx
  movsbl %r9b,%ebp
  lea    D82(%rip),%rbx
  mov    %rsi,%r10
  mov    %r8,%r11
  jmp    L51
L134:
  movslq %eax,%rcx
  movzbl (%rdi,%rcx,1),%r9d
  cmp    $0x2d,%r9b
  jne    L59
  lea    D55(%rip),%r8
  movslq %esi,%rsi
  movzbl (%r8,%rsi,1),%r9d
  lea    D82(%rip),%r10
  add    (%r10,%rsi,4),%r9b
  mov    %r9b,(%r8,%rsi,1)
  cmp    0x1(%rdi,%rcx,1),%r9b
  jne    L4
  add    $0x2,%eax
  lea    D60(%rip),%rcx
  mov    %eax,(%rcx,%rsi,4)
  jmp    L4
L187:
  test   %edx,%edx
  movzbl D23(%rip),%eax
  cmovne %eax,%r9d
  jmp    L4
L119:
  movslq %edx,%rcx
  add    $0x1,%eax
  lea    D60(%rip),%rsi
  mov    %eax,(%rsi,%rcx,4)
  jmp    L44
L211:
  lea    0x1(%rcx,%r8,1),%eax
  mov    %eax,(%r11,%r10,4)
  jmp    L21
L180:
  add    $0x2,%ecx
  mov    %ecx,(%r11,%r10,4)
L21:
  mov    (%r11,%r10,4),%ecx
  movslq %ecx,%rax
  cmpb   $0x2d,(%rdi,%rax,1)
  jne    L91
L51:
  lea    0x1(%rcx),%eax
  cltq
  cmpb   $0x5c,(%rdi,%rax,1)
  sete   %r8b
  movzbl %r8b,%r8d
  add    $0x1,%r8d
  lea    (%r8,%rcx,1),%esi
  movslq %esi,%rsi
  movzbl (%rdi,%rsi,1),%eax
  test   %al,%al
  je     L90
  cmpb   $0x2d,0x1(%rdi,%rsi,1)
  je     L211
  movsbl %al,%eax
  sub    %ebp,%eax
  mov    %eax,(%rbx,%r10,4)
  test   %eax,%eax
  je     L180
  jg     L7
  jns    L21
  movslq %edx,%rdx
  lea    D82(%rip),%rax
  movl   $0xffffffff,(%rax,%rdx,4)
  jmp    L91
L7:
  movslq %edx,%rdx
  lea    D82(%rip),%rax
  movl   $0x1,(%rax,%rdx,4)
  jmp    L91
L142:
  mov    $0x0,%r9d
  jmp    L4
L90:
  mov    %eax,%r9d
L91:
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char nextch(str, who)
char *str;
int who;
{
  static char *what[2] = {0, 0};
  static char last[2] = {0, 0};
  static int increment[2];
  static int pos[2];
  if (who < 0 || who > 1) {
    return 0;
  }
  if (str) {
    what[who] = str;
    pos[who] = 0;
    return 1;
  } else if (!what[who]) {
    return 0;
  }
  if (!pos[who] && what[who][0] == '-') {
    return 0;
  }
  switch (what[who][pos[who]]) {
  case '-': {
    last[who] += increment[who];
    if (what[who][pos[who] + 1] == last[who]) {
      pos[who] += 2;
    }
    return last[who];
  }
  case '\0': {
    if (who) {
      return last[1];
    }
    return 0;
  }
  case '\\': {
    pos[who]++;
  }
  default: {
    last[who] = what[who][pos[who]++];
    while (what[who][pos[who]] == '-') {
      int inc = 1;
      if (what[who][pos[who] + inc] == '\\') {
        inc++;
      }
      if (!what[who][pos[who] + inc]) {
        return 0;
      }
      if (what[who][pos[who] + inc + 1] == '-') {
        pos[who] += inc + 1;
        continue;
      }
      increment[who] = what[who][pos[who] + inc] - last[who];
      if (!increment[who]) {
        pos[who] += 2;
        continue;
      }
      if (increment[who] > 0) {
        increment[who] = 1;
        break;
      } else if (increment[who] < 0) {
        increment[who] = -1;
        break;
      }
    }
    return last[who];
  }
  }
}
```