user: 请从给定的汇编指令推导出C源代码：

```asm
<check_traverser>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  movl   $0x1,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <pavl_t_prev@plt>
  mov    %rax,-0x18(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jne    L144
  cmpq   $0x0,-0x18(%rbp)
  jne    L48
L144:
  cmpl   $0x0,-0x2c(%rbp)
  jle    L111
  cmpq   $0x0,-0x18(%rbp)
  je     L48
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x2c(%rbp),%edx
  sub    $0x1,%edx
  cmp    %edx,%eax
  je     L111
L48:
  cmpl   $0x0,-0x2c(%rbp)
  je     L20
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%edx
  jmp    L195
L20:
  mov    $0xffffffff,%edx
L195:
  cmpq   $0x0,-0x18(%rbp)
  je     L121
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  jmp    L64
L121:
  mov    $0xffffffff,%eax
L64:
  mov    -0x38(%rbp),%rsi
  mov    %edx,%ecx
  mov    %eax,%edx
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x1c(%rbp)
L111:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <pavl_t_next@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <pavl_t_cur@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L99
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  je     L207
L99:
  cmpq   $0x0,-0x10(%rbp)
  je     L88
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  jmp    L87
L88:
  mov    $0xffffffff,%eax
L87:
  mov    -0x2c(%rbp),%edx
  mov    -0x38(%rbp),%rsi
  mov    %edx,%ecx
  mov    %eax,%edx
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x1c(%rbp)
L207:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <pavl_t_next@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L10
  cmpq   $0x0,-0x8(%rbp)
  jne    L52
L10:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  je     L138
  cmpq   $0x0,-0x8(%rbp)
  je     L52
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x2c(%rbp),%edx
  add    $0x1,%edx
  cmp    %edx,%eax
  je     L138
L52:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  je     L189
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  jmp    L206
L189:
  mov    $0xffffffff,%edx
L206:
  cmpq   $0x0,-0x8(%rbp)
  je     L60
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  jmp    L5
L60:
  mov    $0xffffffff,%eax
L5:
  mov    -0x38(%rbp),%rsi
  mov    %edx,%ecx
  mov    %eax,%edx
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x1c(%rbp)
L138:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <pavl_t_prev@plt>
  mov    -0x1c(%rbp),%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D24
type_guessed: string
name: read_data
arguments: data_tag: D20
type_guessed: string
name: read_data
arguments: data_tag: D9
type_guessed: string

tool: D24:    %s traverser ahead of %d, but should be ahead of %d.


tool: D20:    %s traverser at %d, but should be at %d.


tool: D9:    %s traverser behind %d, but should be behind %d.


assistant: ```c
int check_traverser(struct pavl_traverser *trav, int i, int n, const char *label) {
  int okay = 1;
  int *cur, *prev, *next;
  prev = pavl_t_prev(trav);
  if ((i == 0 && prev != NULL) || (i > 0 && (prev == NULL || *prev != i - 1))) {
    printf("   %s traverser ahead of %d, but should be ahead of %d.\n", label, prev != NULL ? *prev : -1, i == 0 ? -1 : i - 1);
    okay = 0;
  }
  pavl_t_next(trav);
  cur = pavl_t_cur(trav);
  if (cur == NULL || *cur != i) {
    printf("   %s traverser at %d, but should be at %d.\n", label, cur != NULL ? *cur : -1, i);
    okay = 0;
  }
  next = pavl_t_next(trav);
  if ((i == n - 1 && next != NULL) || (i != n - 1 && (next == NULL || *next != i + 1))) {
    printf("   %s traverser behind %d, but should be behind %d.\n", label, next != NULL ? *next : -1, i == n - 1 ? -1 : i + 1);
    okay = 0;
  }
  pavl_t_prev(trav);
  return okay;
}
```