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

```asm
<DVIVqsortDown>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  cmp    $0xa,%edi
  jg     L150
  call   <DVIVisortDown@plt>
  jmp    L11
L150:
  call   <Dcentervalue@plt>
  lea    -0x1(%r12),%r10d
  mov    %r10d,%edi
  mov    %r10d,%edx
  mov    $0x1,%r9d
  mov    $0x0,%ecx
  mov    $0x0,%r11d
L127:
  mov    %ecx,%r8d
  movsd  (%rbx,%rcx,8),%xmm1
  movslq %edx,%rax
  comisd %xmm0,%xmm1
  jb     L86
  ucomisd %xmm0,%xmm1
  jp     L8
  jne    L8
  movslq %r11d,%rax
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsi),%r8d
  mov    0x0(%rbp,%rcx,4),%r13d
  mov    %r13d,(%rsi)
  mov    %r8d,0x0(%rbp,%rcx,4)
  lea    (%rbx,%rax,8),%rax
  movsd  (%rax),%xmm1
  movsd  (%rbx,%rcx,8),%xmm2
  movsd  %xmm2,(%rax)
  movsd  %xmm1,(%rbx,%rcx,8)
  add    $0x1,%r11d
L8:
  mov    %r9d,%r8d
  jmp    L105
L59:
  lea    -0x1(%rsi),%edx
  sub    $0x1,%rax
  cmp    %ecx,%eax
  jl     L128
L86:
  mov    %eax,%esi
  mov    %eax,%edx
  movsd  (%rbx,%rax,8),%xmm1
  comisd %xmm1,%xmm0
  jb     L6
  ucomisd %xmm0,%xmm1
  jp     L59
  jne    L59
  mov    0x0(%rbp,%rax,4),%r14d
  movslq %edi,%rdx
  lea    0x0(%rbp,%rdx,4),%r13
  mov    0x0(%r13),%r15d
  mov    %r15d,0x0(%rbp,%rax,4)
  mov    %r14d,0x0(%r13)
  movsd  (%rbx,%rax,8),%xmm1
  lea    (%rbx,%rdx,8),%rdx
  movsd  (%rdx),%xmm2
  movsd  %xmm2,(%rbx,%rax,8)
  movsd  %xmm1,(%rdx)
  sub    $0x1,%edi
  jmp    L59
L6:
  cmp    %ecx,%eax
  jl     L128
  mov    0x0(%rbp,%rcx,4),%r8d
  cltq
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsi),%r13d
  mov    %r13d,0x0(%rbp,%rcx,4)
  mov    %r8d,(%rsi)
  movsd  (%rbx,%rcx,8),%xmm1
  lea    (%rbx,%rax,8),%rax
  movsd  (%rax),%xmm2
  movsd  %xmm2,(%rbx,%rcx,8)
  movsd  %xmm1,(%rax)
  mov    %r9d,%r8d
  sub    $0x1,%edx
L105:
  add    $0x1,%rcx
  add    $0x1,%r9d
  cmp    %edx,%r8d
  jle    L127
L128:
  mov    %r8d,%ecx
  sub    %r11d,%ecx
  cmp    %r11d,%ecx
  mov    %r11d,%esi
  cmovle %ecx,%esi
  mov    %r8d,%eax
  sub    %esi,%eax
  test   %esi,%esi
  je     L77
  mov    %esi,%esi
  cltq
  lea    0x0(%rbp,%rax,4),%r11
  lea    (%rbx,%rax,8),%r9
  mov    $0x0,%eax
L29:
  mov    0x0(%rbp,%rax,4),%r13d
  mov    (%r11,%rax,4),%r14d
  mov    %r14d,0x0(%rbp,%rax,4)
  mov    %r13d,(%r11,%rax,4)
  movsd  (%rbx,%rax,8),%xmm0
  movsd  (%r9,%rax,8),%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  movsd  %xmm0,(%r9,%rax,8)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L29
L77:
  mov    %edi,%r13d
  sub    %edx,%r13d
  sub    %edi,%r10d
  cmp    %r13d,%r10d
  mov    %r10d,%esi
  cmovg  %r13d,%esi
  mov    %r12d,%edi
  sub    %esi,%edi
  test   %esi,%esi
  je     L144
  movslq %r8d,%r8
  lea    0x0(%rbp,%r8,4),%rax
  movslq %edi,%rdi
  lea    (%rbx,%rdi,8),%rdx
  lea    -0x1(%rsi),%esi
  add    %r8,%rsi
  lea    0x4(%rbp,%rsi,4),%r10
  mov    %rdi,%rsi
  sub    %r8,%rsi
  sub    %rdi,%r8
L148:
  mov    (%rax),%edi
  mov    (%rax,%rsi,4),%r9d
  mov    %r9d,(%rax)
  mov    %edi,(%rax,%rsi,4)
  movsd  (%rdx,%r8,8),%xmm0
  movsd  (%rdx),%xmm1
  movsd  %xmm1,(%rdx,%r8,8)
  movsd  %xmm0,(%rdx)
  add    $0x4,%rax
  add    $0x8,%rdx
  cmp    %r10,%rax
  jne    L148
L144:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %ecx,%edi
  call   <DVIVqsortDown>
  movslq %r12d,%r12
  movslq %r13d,%rax
  sub    %rax,%r12
  lea    0x0(%rbp,%r12,4),%rdx
  lea    (%rbx,%r12,8),%rsi
  mov    %r13d,%edi
  call   <DVIVqsortDown>
L11:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void DVIVqsortDown(int n, double dvec[], int ivec[]) {
  double dtemp, v;
  int a, b, c, d, itemp, l, h, s;
  if (n <= 10) {
    DVIVisortDown(n, dvec, ivec);
  } else {
    v = Dcentervalue(n, dvec);
    a = b = 0;
    c = d = n - 1;
    for (;;) {
      while (b <= c && dvec[b] >= v) {
        if (dvec[b] == v) {
          {
            itemp = ivec[(a)];
            ivec[(a)] = ivec[(b)];
            ivec[(b)] = itemp;
            dtemp = dvec[(a)];
            dvec[(a)] = dvec[(b)];
            dvec[(b)] = dtemp;
          }
          a++;
        }
        b++;
      }
      while (c >= b && dvec[c] <= v) {
        if (dvec[c] == v) {
          {
            itemp = ivec[(c)];
            ivec[(c)] = ivec[(d)];
            ivec[(d)] = itemp;
            dtemp = dvec[(c)];
            dvec[(c)] = dvec[(d)];
            dvec[(d)] = dtemp;
          }
          d--;
        }
        c--;
      }
      if (b > c) {
        break;
      }
      {
        itemp = ivec[(b)];
        ivec[(b)] = ivec[(c)];
        ivec[(c)] = itemp;
        dtemp = dvec[(b)];
        dvec[(b)] = dvec[(c)];
        dvec[(c)] = dtemp;
      }
      b++;
      c--;
    }
    s = (a <= b - a) ? a : b - a;
    for (l = 0, h = b - s; s != 0; s--) {
      {
        itemp = ivec[(l)];
        ivec[(l)] = ivec[(h)];
        ivec[(h)] = itemp;
        dtemp = dvec[(l)];
        dvec[(l)] = dvec[(h)];
        dvec[(h)] = dtemp;
      }
      l++;
      h++;
    }
    s = ((d - c) <= (n - 1 - d)) ? (d - c) : (n - 1 - d);
    for (l = b, h = n - s; s != 0; s--) {
      {
        itemp = ivec[(l)];
        ivec[(l)] = ivec[(h)];
        ivec[(h)] = itemp;
        dtemp = dvec[(l)];
        dvec[(l)] = dvec[(h)];
        dvec[(h)] = dtemp;
      }
      l++;
      h++;
    }
    DVIVqsortDown(b - a, dvec, ivec);
    DVIVqsortDown(d - c, dvec + n - (d - c), ivec + n - (d - c));
  }
  return;
}
```