user: 请将以下的汇编代码转换成C语言代码:

```asm
<sortxyzwd>:
  endbr64
  cmp    $0x1,%r8d
  jle    L101
  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     L56
  nopw   0x0(%rax,%rax,1)
L105:
  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     L5
L102:
  movslq %r12d,%rax
  jmp    L30
  nopl   0x0(%rax)
L53:
  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    %esi,%r9d
  jl     L3
  movslq %ecx,%rax
L30:
  movslq %esi,%rdx
  mov    %esi,%ecx
  shl    $0x3,%rdx
  lea    (%rdi,%rdx,1),%r8
  movsd  (%r8),%xmm0
  cmp    %esi,%r9d
  jle    L29
  lea    0x8(%rdx),%rsi
  lea    (%rdi,%rsi,1),%r10
  movsd  (%r10),%xmm1
  comisd %xmm0,%xmm1
  jbe    L29
  add    $0x1,%ecx
  movapd %xmm1,%xmm0
  mov    %r10,%r8
  mov    %rsi,%rdx
L29:
  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     L53
L5:
  movsd  %xmm2,(%r14)
  movsd  %xmm5,0x0(%r13)
  movsd  %xmm4,(%r10)
  movsd  %xmm3,(%rax)
  test   %r12d,%r12d
  jne    L105
L56:
  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     L49
  mov    $0x1,%esi
  jmp    L102
  nopw   0x0(%rax,%rax,1)
L3:
  mov    %r13,%r10
  mov    %rdx,%rax
  mov    %r14,%r13
  mov    %r8,%r14
  jmp    L5
L49:
  movsd  %xmm2,(%rdi)
  movsd  %xmm5,(%r11)
  movsd  %xmm4,(%rbx)
  movsd  %xmm3,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L101:
  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;
    }
  }
}
```