user: Translate the below assembly code into C programming language:

```asm
<simultaneous_sort>:
  endbr64
  cmp    $0x1,%edx
  jle    L183
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x2,%edx
  je     L163
L121:
  cmp    $0x3,%r13d
  je     L84
  movslq %r13d,%rax
  movsd  0x0(%rbp),%xmm1
  mov    %r13d,%r12d
  lea    -0x1(%r13),%r14d
  lea    -0x8(%rbp,%rax,8),%rbx
  sar    %r12d
  movsd  (%rbx),%xmm0
  comisd %xmm0,%xmm1
  ja     L219
L214:
  movslq %r12d,%rax
  comisd 0x0(%rbp,%rax,8),%xmm0
  ja     L65
L157:
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  jmp    L193
  nopw   0x0(%rax,%rax,1)
L130:
  add    $0x1,%rbx
  cmp    %ebx,%r14d
  jle    L203
L193:
  comisd 0x0(%rbp,%rbx,8),%xmm0
  mov    %ebx,%edx
  jbe    L130
  mov    %r12d,%ecx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%r12d
  call   <dual_swap@plt>
  movsd  0x8(%rsp),%xmm0
  cmp    %ebx,%r14d
  jg     L193
L203:
  mov    %r14d,%ecx
  mov    %r12d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  cmp    $0x1,%r12d
  jg     L146
L129:
  lea    (%r12,%r12,1),%eax
  cmp    %r13d,%eax
  jge    L89
  sub    %r12d,%r13d
  movslq %r12d,%r12
  add    $0x1,%r12
  sub    $0x1,%r13d
  lea    (%r15,%r12,4),%r15
  lea    0x0(%rbp,%r12,8),%rbp
  cmp    $0x1,%r13d
  jle    L89
  cmp    $0x2,%r13d
  jne    L121
L163:
  movsd  0x0(%rbp),%xmm0
  comisd 0x8(%rbp),%xmm0
  ja     L67
L89:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L65:
  mov    %r12d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  movsd  (%rbx),%xmm0
  movsd  0x0(%rbp),%xmm1
  comisd %xmm0,%xmm1
  jbe    L157
  mov    %r14d,%ecx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  movsd  (%rbx),%xmm0
  jmp    L157
  nopl   (%rax)
L219:
  mov    %r14d,%ecx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  movsd  (%rbx),%xmm0
  jmp    L214
  nopl   0x0(%rax)
L146:
  mov    %r12d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <simultaneous_sort>
  jmp    L129
L84:
  movsd  0x8(%rbp),%xmm0
  movsd  0x0(%rbp),%xmm1
  comisd %xmm0,%xmm1
  ja     L172
L141:
  comisd 0x10(%rbp),%xmm0
  jbe    L89
  mov    $0x2,%ecx
  mov    $0x1,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  jmp    L163
L67:
  add    $0x18,%rsp
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%ecx
  pop    %rbx
  xor    %edx,%edx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <dual_swap@plt>
L172:
  mov    $0x1,%ecx
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <dual_swap@plt>
  movsd  0x8(%rbp),%xmm0
  jmp    L141
L183:
  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);
  }
}
```