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

```asm
<consistency_test>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x458,%rsp
  mov    %rsi,(%rsp)
  lea    0x440(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x448(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rax
  mov    %rax,%rsi
  mov    %rax,0x10(%rsp)
  call   <clock_gettime@plt>
  mov    0x40(%rsp),%rbx
  xor    %edi,%edi
  mov    %rbx,0x18(%rsp)
  call   <time@plt>
  mov    %eax,0x3c(%rsp)
  lea    0x3c(%rsp),%rax
  mov    %rax,%rdi
  mov    %rax,0x28(%rsp)
  call   <ctime@plt>
  mov    %rax,0x20(%rsp)
  mov    %rbx,%rax
  nopw   0x0(%rax,%rax,1)
L84:
  mov    (%rsp),%rcx
  cmp    $0xffffffffffffffff,%rcx
  je     L156
  sub    0x18(%rsp),%rax
  cmp    %rcx,%rax
  jae    L71
L156:
  mov    0x10(%rsp),%rbx
  mov    %rbx,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L60:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  add    $0x10,%rbx
  call   <clock_gettime@plt>
  cmp    %rbx,%r12
  jne    L60
  mov    $0xffffffff,%r13d
  xor    %r14d,%r14d
  jmp    L167
  cs nopw 0x0(%rax,%rax,1)
L113:
  cmp    $0x3f,%r15d
  je     L58
L96:
  mov    %r15d,%r14d
L167:
  lea    0x1(%r14),%r15d
  movslq %r15d,%rbx
  mov    %rbx,%rax
  shl    $0x4,%rax
  mov    0x40(%rsp,%rax,1),%rdx
  mov    0x48(%rsp,%rax,1),%rcx
  movslq %r14d,%rax
  shl    $0x4,%rax
  mov    0x40(%rsp,%rax,1),%rdi
  mov    0x48(%rsp,%rax,1),%rsi
  call   <in_order@plt>
  test   %eax,%eax
  jne    L113
  cmp    $0x3f,%r15d
  je     L21
  mov    %r14d,%r13d
  jmp    L96
  cs nopw 0x0(%rax,%rax,1)
L58:
  cmp    $0xffffffff,%r13d
  jne    L142
  mov    0x40(%rsp),%rax
  jmp    L84
L21:
  mov    $0x3e,%r13d
L44:
  mov    0x20(%rsp),%rdi
  xor    %r12d,%r12d
  lea    D35(%rip),%rbp
  lea    D5(%rip),%r14
  call   <puts@plt>
  mov    %rbx,(%rsp)
  mov    0x8(%rsp),%rbx
  jmp    L97
L43:
  mov    0x8(%rbx),%rdx
  mov    (%rbx),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <printf@plt>
  cmp    %r12d,%r15d
  je     L17
  add    $0x1,%r12d
  add    $0x10,%rbx
  cmp    $0x40,%r12d
  je     L128
L97:
  cmp    %r12d,%r13d
  jne    L43
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L43
L17:
  mov    %r14,%rdi
  add    $0x1,%r12d
  add    $0x10,%rbx
  call   <puts@plt>
  cmp    $0x40,%r12d
  jne    L97
L128:
  mov    (%rsp),%rbx
  movslq %r13d,%rax
  lea    D45(%rip),%rdi
  shl    $0x4,%rax
  imul   $0x3b9aca00,0x40(%rsp,%rax,1),%rsi
  shl    $0x4,%rbx
  sub    0x48(%rsp,%rbx,1),%rsi
  add    0x48(%rsp,%rax,1),%rsi
  imul   $0x3b9aca00,0x40(%rsp,%rbx,1),%rax
  sub    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <fflush@plt>
  xor    %edi,%edi
  call   <time@plt>
  mov    0x28(%rsp),%rdi
  mov    %eax,0x3c(%rsp)
  call   <ctime@plt>
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D49(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
L47:
  mov    0x448(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x458,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L71:
  lea    D30(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L47
L16:
  call   <__stack_chk_fail@plt>
L142:
  lea    0x1(%r13),%r15d
  movslq %r15d,%rbx
  jmp    L44
```

tool_calls: name: read_data
arguments: label: D35
data_type: string
name: read_data
arguments: label: D5
data_type: string
name: read_data
arguments: label: D45
data_type: string
name: read_data
arguments: label: D49
data_type: string
name: read_data
arguments: label: D30
data_type: string

tool: D35: %lu:%lu


tool: D5: --------------------

tool: D45: Delta: %llu ns


tool: D49: [FAILED]

tool: D30: [OK]

assistant: ```c
int consistency_test(int clock_type, unsigned long seconds) {
  struct timespec list[64];
  int i, inconsistent;
  long now, then;
  time_t t;
  char *start_str;
  clock_gettime(clock_type, &list[0]);
  now = then = list[0].tv_sec;
  t = time(0);
  start_str = ctime(&t);
  while (seconds == -1 || now - then < seconds) {
    inconsistent = -1;
    for (i = 0; i < 64; i++)
      clock_gettime(clock_type, &list[i]);
    for (i = 0; i < 64 - 1; i++)
      if (!in_order(list[i], list[i + 1]))
        inconsistent = i;
    if (inconsistent >= 0) {
      unsigned long long delta;
      printf("\%s\n", start_str);
      for (i = 0; i < 64; i++) {
        if (i == inconsistent)
          printf("--------------------\n");
        printf("%lu:%lu\n", list[i].tv_sec, list[i].tv_nsec);
        if (i == inconsistent + 1)
          printf("--------------------\n");
      }
      delta = list[inconsistent].tv_sec * 1000000000ULL;
      delta += list[inconsistent].tv_nsec;
      delta -= list[inconsistent + 1].tv_sec * 1000000000ULL;
      delta -= list[inconsistent + 1].tv_nsec;
      printf("Delta: %llu ns\n", delta);
      fflush(0);
      t = time(0);
      printf("%s\n", ctime(&t));
      printf("[FAILED]\n");
      return -1;
    }
    now = list[0].tv_sec;
  }
  printf("[OK]\n");
  return 0;
}
```