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

```asm
<hpsort_double_doublematrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x0(,%rsi,8),%rax
  mov    %rsp,%rcx
  mov    %rsp,-0x78(%rbp)
  mov    %rax,-0x68(%rbp)
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L296
L11:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L11
L296:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L73
  mov    %rsp,%r14
  test   %r13,%r13
  je     L170
L165:
  mov    %r13,%r8
  mov    $0x8,%eax
  mov    %r14,%r9
  shr    %r8
  add    $0x1,%r8
  test   %r12,%r12
  cmovne -0x68(%rbp),%rax
  mov    %r8,%r14
  mov    %rax,-0x70(%rbp)
L188:
  cmp    $0x1,%r14
  jne    L116
  nopw   0x0(%rax,%rax,1)
L281:
  lea    0x0(,%r13,8),%rax
  movsd  (%rbx),%xmm0
  lea    -0x8(%rbx,%rax,1),%r10
  movsd  (%r10),%xmm1
  test   %r12,%r12
  je     L149
  mov    -0x8(%r15,%rax,1),%rcx
  mov    -0x68(%rbp),%rdx
  mov    %r9,%rdi
  mov    %r10,-0x60(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  mov    %rcx,%rsi
  mov    %rcx,-0x48(%rbp)
  movsd  %xmm1,-0x50(%rbp)
  call   <memcpy@plt>
  movsd  -0x58(%rbp),%xmm0
  mov    -0x60(%rbp),%r10
  mov    (%r15),%rdx
  mov    -0x48(%rbp),%rcx
  mov    %rax,%r9
  xor    %eax,%eax
  movsd  -0x50(%rbp),%xmm1
  movsd  %xmm0,(%r10)
  nopl   0x0(%rax)
L216:
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L216
L34:
  sub    $0x1,%r13
  cmp    $0x1,%r13
  je     L154
  test   %r13,%r13
  je     L117
  movsd  (%rbx),%xmm0
L7:
  mov    %r14,%rax
  mov    %r14,%r11
  jmp    L18
  xchg   %ax,%ax
L210:
  lea    0x1(%r13),%rax
  cmp    %r13,%rax
  ja     L118
L148:
  movsd  -0x8(%rbx,%rax,8),%xmm0
L18:
  lea    0x0(,%rax,8),%rdx
  lea    -0x8(%rdx),%rsi
  lea    (%rbx,%rsi,1),%r8
  cmp    %r13,%rax
  jae    L295
  lea    (%rbx,%rdx,1),%rcx
  movsd  (%rcx),%xmm2
  comisd %xmm0,%xmm2
  jbe    L295
  add    $0x1,%rax
  movapd %xmm2,%xmm0
  mov    %rcx,%r8
  mov    %rdx,%rsi
L295:
  comisd %xmm1,%xmm0
  lea    0x0(,%r11,8),%rdx
  lea    -0x8(%rdx),%rcx
  lea    (%rbx,%rcx,1),%rdi
  jbe    L210
  movsd  %xmm0,(%rdi)
  test   %r12,%r12
  je     L14
  mov    (%r15,%rsi,1),%rdi
  mov    -0x8(%r15,%rdx,1),%rcx
  xor    %edx,%edx
  xchg   %ax,%ax
L86:
  movsd  (%rdi,%rdx,8),%xmm0
  movsd  %xmm0,(%rcx,%rdx,8)
  add    $0x1,%rdx
  cmp    %rdx,%r12
  jne    L86
L14:
  mov    %rax,%r11
  add    %rax,%rax
  mov    %r8,%rdi
  mov    %rsi,%rcx
  cmp    %r13,%rax
  jbe    L148
L118:
  movsd  %xmm1,(%rdi)
  test   %r12,%r12
  je     L188
  mov    (%r15,%rcx,1),%r10
L223:
  mov    -0x70(%rbp),%rdx
  mov    %r9,%rsi
  mov    %r10,%rdi
  mov    %r9,-0x48(%rbp)
  call   <memcpy@plt>
  mov    -0x48(%rbp),%r9
  cmp    $0x1,%r14
  je     L281
L116:
  sub    $0x1,%r14
  lea    0x0(,%r14,8),%rax
  movsd  -0x8(%rbx,%rax,1),%xmm0
  test   %r12,%r12
  je     L212
  mov    -0x8(%r15,%rax,1),%r10
  mov    -0x68(%rbp),%rdx
  mov    %r9,%rdi
  movsd  %xmm0,-0x50(%rbp)
  mov    %r10,%rsi
  mov    %r10,-0x48(%rbp)
  call   <memcpy@plt>
  movsd  -0x50(%rbp),%xmm0
  cmp    %r14,%r13
  mov    -0x48(%rbp),%r10
  mov    %rax,%r9
  movapd %xmm0,%xmm1
  jae    L7
  jmp    L223
L154:
  movsd  %xmm1,(%rbx)
  test   %r12,%r12
  je     L170
  mov    (%r15),%rdi
  mov    -0x68(%rbp),%rdx
  mov    %r9,%rsi
  call   <memcpy@plt>
L170:
  mov    -0x78(%rbp),%rsp
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L149:
  movsd  %xmm0,(%r10)
  jmp    L34
L117:
  mov    %rbx,%rdi
  xor    %ecx,%ecx
  jmp    L118
L212:
  movapd %xmm0,%xmm1
  cmp    %r14,%r13
  jae    L7
  jmp    L188
L73:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  mov    %rsp,%r14
  test   %r13,%r13
  jne    L165
  jmp    L170
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void hpsort_double_doublematrix(unsigned long n, unsigned long nmat, double ra[], double **ra2) {
  unsigned long i, ir, j, l;
  unsigned long iaux;
  double rra;
  double rra2[nmat];
  if (n < 1)
    return;
  l = (n >> 1) + 1;
  ir = n;
  for (;;) {
    if (l > 1) {
      rra = ra[--l - 1];
      for (iaux = 0; iaux < nmat; iaux++) {
        rra2[iaux] = ra2[l - 1][iaux];
      }
    } else {
      rra = ra[ir - 1];
      for (iaux = 0; iaux < nmat; iaux++) {
        rra2[iaux] = ra2[ir - 1][iaux];
      }
      ra[ir - 1] = ra[0];
      for (iaux = 0; iaux < nmat; iaux++) {
        ra2[ir - 1][iaux] = ra2[0][iaux];
      }
      if (--ir == 1) {
        ra[0] = rra;
        for (iaux = 0; iaux < nmat; iaux++) {
          ra2[0][iaux] = rra2[iaux];
        }
        break;
      }
    }
    i = l;
    j = l;
    while (j <= ir) {
      if (j < ir && ra[j - 1] < ra[j])
        j++;
      if (rra < ra[j - 1]) {
        ra[i - 1] = ra[j - 1];
        for (iaux = 0; iaux < nmat; iaux++) {
          ra2[i - 1][iaux] = ra2[j - 1][iaux];
        }
        i = j;
        j <<= 1;
      } else
        j = ir + 1;
    }
    ra[i - 1] = rra;
    for (iaux = 0; iaux < nmat; iaux++) {
      ra2[i - 1][iaux] = rra2[iaux];
    }
  }
}
```