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

```asm
<floquetsort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x3c8,%rsp
  mov    %rdi,0x40(%rsp)
  mov    %rsi,0x48(%rsp)
  mov    %rdx,%r14
  mov    %rcx,%r15
  mov    0x400(%rsp),%rax
  mov    %rax,0x28(%rsp)
  mov    0x408(%rsp),%rax
  mov    %rax,0x30(%rsp)
  mov    0x410(%rsp),%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x3b8(%rsp)
  xor    %eax,%eax
  test   %ebp,%ebp
  jle    L49
  mov    %ebp,%eax
  mov    %rax,0x38(%rsp)
  movq   $0x0,0x18(%rsp)
  lea    0x50(%rsp),%rsi
  lea    0x80(%rsp),%rax
  lea    0xb0(%rsp),%r13
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rsi,%r14
  mov    %rax,%r15
  jmp    L47
L52:
  lea    0x170(%rsp),%rdx
  mov    %ebp,%ecx
  mov    0x24(%rsp),%r12d
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <write_vec@plt>
  lea    0x290(%rsp),%rdx
  lea    0xe0(%rsp),%rdi
  mov    %ebp,%ecx
  mov    %r12d,%esi
  call   <write_vec@plt>
  movslq %ebx,%rbx
  mov    0x40(%rsp),%rax
  movsd  (%rax,%rbx,8),%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm0,0x110(%rsp,%rax,8)
  mov    0x48(%rsp),%rsi
  movsd  (%rsi,%rbx,8),%xmm0
  movsd  %xmm0,0x140(%rsp,%rax,8)
L22:
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    0x38(%rsp),%rax
  je     L17
L47:
  mov    0x18(%rsp),%eax
  mov    %eax,%ebx
  mov    %eax,0x24(%rsp)
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %eax,%esi
  mov    0x28(%rsp),%rdi
  call   <select_vec@plt>
  mov    %ebp,%ecx
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    0x30(%rsp),%rdi
  call   <select_vec@plt>
  mov    $0x0,%ebx
L9:
  mov    %ebp,%ecx
  mov    %r13,%rdx
  mov    %ebx,%esi
  mov    0x8(%rsp),%rdi
  call   <select_vec@plt>
  lea    0xe0(%rsp),%r12
  mov    %ebp,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    0x10(%rsp),%rdi
  call   <select_vec@plt>
  mov    %ebp,%r8d
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <direct_prod@plt>
  comisd D6(%rip),%xmm0
  jae    L52
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jne    L9
  jmp    L22
L17:
  mov    0x8(%rsp),%r14
  mov    0x10(%rsp),%r15
L49:
  lea    0x110(%rsp),%rdi
  mov    %ebp,%edx
  mov    0x40(%rsp),%rsi
  call   <arrcopy@plt>
  lea    0x140(%rsp),%rdi
  mov    %ebp,%edx
  mov    0x48(%rsp),%rsi
  call   <arrcopy@plt>
  imul   %ebp,%ebp
  lea    0x170(%rsp),%rdi
  mov    %ebp,%edx
  mov    %r14,%rsi
  call   <arrcopy@plt>
  lea    0x290(%rsp),%rdi
  mov    %ebp,%edx
  mov    %r15,%rsi
  call   <arrcopy@plt>
  mov    0x3b8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L19
  add    $0x3c8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D6
type_guessed: f64

tool: D6: 0.5

assistant: ```c
int floquetsort(double evals_real[], double evals_imag[], double evecs_real[], double evecs_imag[], double prev_real[], double prev_imag[], double vecs_prev_real[], double vecs_prev_imag[], int size) {
  int i, j, err;
  double dot;
  double vec_prev_real[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2], vec_prev_imag[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2];
  double vec_test_real[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2], vec_test_imag[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2];
  double evals_temp_real[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2], evals_temp_imag[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2];
  double evecs_temp_real[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2 * ((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2], evecs_temp_imag[((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2 * ((2 * 1 + 1) * ((2 * 1 + 1) + 1)) / 2];
  for (i = 0; i < size; i++) {
    err = select_vec(vecs_prev_real, i, vec_prev_real, size);
    err = select_vec(vecs_prev_imag, i, vec_prev_imag, size);
    for (j = 0; j < size; j++) {
      err = select_vec(evecs_real, j, vec_test_real, size);
      err = select_vec(evecs_imag, j, vec_test_imag, size);
      dot = direct_prod(vec_prev_real, vec_prev_imag, vec_test_real, vec_test_imag, size);
      if (dot >= 0.5) {
        err = write_vec(vec_test_real, i, evecs_temp_real, size);
        err = write_vec(vec_test_imag, i, evecs_temp_imag, size);
        evals_temp_real[i] = evals_real[j];
        evals_temp_imag[i] = evals_imag[j];
        break;
      }
    }
  }
  err = arrcopy(evals_temp_real, evals_real, size);
  err = arrcopy(evals_temp_imag, evals_imag, size);
  err = arrcopy(evecs_temp_real, evecs_real, size * size);
  err = arrcopy(evecs_temp_imag, evecs_imag, size * size);
  return (err);
}
```