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

```asm
<simultaneous_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jle    L145
  cmpl   $0x2,-0x34(%rbp)
  jne    L129
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  ja     L195
  jmp    L145
L195:
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
  jmp    L145
L129:
  cmpl   $0x3,-0x34(%rbp)
  jne    L18
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L140
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
L140:
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  ja     L82
  jmp    L145
L82:
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x2,%ecx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  ja     L149
  jmp    L145
L149:
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
  jmp    L145
L18:
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L172
  mov    -0x34(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
L172:
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L15
  mov    -0x34(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L15
  mov    -0x34(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <dual_swap@plt>
L15:
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L177
L56:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x8(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L51
  mov    -0x10(%rbp),%ecx
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <dual_swap@plt>
  addl   $0x1,-0x10(%rbp)
L51:
  addl   $0x1,-0x14(%rbp)
L177:
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L56
  mov    -0x34(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <dual_swap@plt>
  mov    -0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jle    L49
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <simultaneous_sort>
L49:
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0x34(%rbp)
  jle    L145
  mov    -0x34(%rbp),%eax
  sub    -0xc(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <simultaneous_sort>
L145:
  nop
  leave
  ret
```

assistant: ```c
void simultaneous_sort(double *dist, int *idx, int size) {
  int pivot_idx, i, store_idx;
  double pivot_val;
  if (size <= 1)
    ;
  else if (size == 2) {
    if (dist[0] > dist[1])
      dual_swap(dist, idx, 0, 1);
  } else if (size == 3) {
    if (dist[0] > dist[1])
      dual_swap(dist, idx, 0, 1);
    if (dist[1] > dist[2]) {
      dual_swap(dist, idx, 1, 2);
      if (dist[0] > dist[1])
        dual_swap(dist, idx, 0, 1);
    }
  } else {
    pivot_idx = size / 2;
    if (dist[0] > dist[size - 1])
      dual_swap(dist, idx, 0, size - 1);
    if (dist[size - 1] > dist[pivot_idx]) {
      dual_swap(dist, idx, size - 1, pivot_idx);
      if (dist[0] > dist[size - 1])
        dual_swap(dist, idx, 0, size - 1);
    }
    pivot_val = dist[size - 1];
    store_idx = 0;
    for (i = 0; i < size - 1; i++) {
      if (dist[i] < pivot_val) {
        dual_swap(dist, idx, i, store_idx);
        store_idx++;
      }
    }
    dual_swap(dist, idx, store_idx, size - 1);
    pivot_idx = store_idx;
    if (pivot_idx > 1)
      simultaneous_sort(dist, idx, pivot_idx);
    if (pivot_idx * 2 < size)
      simultaneous_sort(dist + pivot_idx + 1, idx + pivot_idx + 1, size - pivot_idx - 1);
  }
}
```