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

```asm
<sortxyzwd>:
  endbr64
  cmp    $0x1,%r8d
  jle    L77
  push   %r14
  mov    %rsi,%r11
  lea    -0x1(%r8),%r9d
  push   %r13
  push   %r12
  mov    %r8d,%r12d
  sar    %r12d
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  test   %r12d,%r12d
  je     L80
  nopw   0x0(%rax,%rax,1)
L46:
  sub    $0x1,%r12d
  movslq %r12d,%rax
  lea    0x1(%r12,%r12,1),%esi
  shl    $0x3,%rax
  lea    (%rdi,%rax,1),%r14
  lea    (%r11,%rax,1),%r13
  lea    (%rbx,%rax,1),%r10
  add    %rbp,%rax
  movsd  (%r14),%xmm2
  movsd  0x0(%r13),%xmm5
  movsd  (%r10),%xmm4
  movsd  (%rax),%xmm3
  cmp    %esi,%r9d
  jl     L16
L45:
  movslq %r12d,%rax
  jmp    L114
  nopl   0x0(%rax)
L84:
  movsd  %xmm0,(%r14)
  lea    (%r11,%rdx,1),%r14
  lea    0x1(%rcx,%rcx,1),%esi
  movsd  (%r14),%xmm0
  movsd  %xmm0,0x0(%r13)
  lea    (%rbx,%rdx,1),%r13
  add    %rbp,%rdx
  movsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%r10)
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  cmp    %r9d,%esi
  jg     L51
  movslq %ecx,%rax
L114:
  movslq %esi,%rdx
  mov    %esi,%ecx
  shl    $0x3,%rdx
  lea    (%rdi,%rdx,1),%r8
  movsd  (%r8),%xmm0
  cmp    %r9d,%esi
  jge    L115
  lea    0x8(%rdx),%rsi
  lea    (%rdi,%rsi,1),%r10
  movsd  (%r10),%xmm1
  comisd %xmm0,%xmm1
  jbe    L115
  add    $0x1,%ecx
  movapd %xmm1,%xmm0
  mov    %r10,%r8
  mov    %rsi,%rdx
L115:
  shl    $0x3,%rax
  lea    (%rdi,%rax,1),%r14
  lea    (%r11,%rax,1),%r13
  lea    (%rbx,%rax,1),%r10
  add    %rbp,%rax
  comisd %xmm2,%xmm0
  ja     L84
L16:
  movsd  %xmm2,(%r14)
  movsd  %xmm5,0x0(%r13)
  movsd  %xmm4,(%r10)
  movsd  %xmm3,(%rax)
  test   %r12d,%r12d
  jne    L46
L80:
  movslq %r9d,%rax
  movsd  (%rdi),%xmm0
  shl    $0x3,%rax
  lea    (%rdi,%rax,1),%rsi
  lea    (%r11,%rax,1),%rcx
  lea    (%rbx,%rax,1),%rdx
  add    %rbp,%rax
  movsd  (%rsi),%xmm2
  movsd  (%rcx),%xmm5
  movsd  (%rdx),%xmm4
  movsd  (%rax),%xmm3
  movsd  %xmm0,(%rsi)
  movsd  (%r11),%xmm0
  movsd  %xmm0,(%rcx)
  movsd  (%rbx),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  sub    $0x1,%r9d
  je     L11
  mov    $0x1,%esi
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L51:
  mov    %r13,%r10
  mov    %rdx,%rax
  mov    %r14,%r13
  mov    %r8,%r14
  jmp    L16
L11:
  movsd  %xmm2,(%rdi)
  movsd  %xmm5,(%r11)
  movsd  %xmm4,(%rbx)
  movsd  %xmm3,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L77:
  ret
```

assistant: ```c
void sortxyzwd(double *x, double *y, double *z, double *w, int n) {
  int top, n1;
  double x0, y0, z0, w0;
  if (n < 2)
    return;
  top = n / 2;
  n1 = n - 1;
  while (1) {
    if (top > 0) {
      top--;
      x0 = x[top];
      y0 = y[top];
      z0 = z[top];
      w0 = w[top];
    } else {
      x0 = x[n1];
      y0 = y[n1];
      z0 = z[n1];
      w0 = w[n1];
      x[n1] = x[0];
      y[n1] = y[0];
      z[n1] = z[0];
      w[n1] = w[0];
      n1--;
      if (!n1) {
        x[0] = x0;
        y[0] = y0;
        z[0] = z0;
        w[0] = w0;
        return;
      }
    }
    {
      int parent, child;
      parent = top;
      child = top * 2 + 1;
      while (child <= n1) {
        if (child < n1 && x[child] < x[child + 1])
          child++;
        if (x0 < x[child]) {
          x[parent] = x[child];
          y[parent] = y[child];
          z[parent] = z[child];
          w[parent] = w[child];
          parent = child;
          child += (parent + 1);
        } else
          break;
      }
      x[parent] = x0;
      y[parent] = y0;
      z[parent] = z0;
      w[parent] = w0;
    }
  }
}
```