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

```asm
<sorts3d>:
  endbr64
  push   %r15
  push   %r14
  lea    0x0(,%rdx,4),%r14d
  push   %r13
  mov    %rdi,%r13
  mov    %r14d,%edi
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0xb0(%rsp),%r15
  call   <smalloc@plt>
  mov    %rbx,(%rsp)
  mov    %r15,%rbx
  mov    %rax,%rbp
  lea    0x118(%rsp),%rax
  mov    %rax,%r15
  xchg   %ax,%ax
L15:
  mov    %r14d,%edi
  add    $0x8,%rbx
  call   <smalloc@plt>
  mov    %rax,-0x8(%rbx)
  cmp    %r15,%rbx
  jne    L15
  mov    0xb0(%rsp),%r14
  mov    %rbp,%rcx
  mov    %r12d,%esi
  xor    %eax,%eax
  mov    0x8(%r13),%rdi
  mov    (%rsp),%rbx
  mov    %r14,%rdx
  call   <mergesort@plt>
  mov    0x10(%r13),%rdi
  movq   %r14,%xmm4
  xor    %eax,%eax
  mov    0xb8(%rsp),%r15
  mov    %rbp,%rcx
  mov    %r12d,%esi
  movq   %r15,%xmm0
  mov    %r15,%rdx
  punpcklqdq %xmm0,%xmm4
  movaps %xmm4,0xa0(%rsp)
  call   <mergesort@plt>
  mov    0x20(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0xc0(%rsp),%rax
  mov    %rax,%rdx
  mov    %rax,(%rsp)
  xor    %eax,%eax
  call   <mergesort@plt>
  mov    0x18(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0xc8(%rsp),%r9
  xor    %eax,%eax
  movq   %r9,%xmm9
  mov    %r9,%rdx
  mov    %r9,0x88(%rsp)
  movhps (%rsp),%xmm9
  movaps %xmm9,0x90(%rsp)
  call   <mergesort@plt>
  movq   %r15,%xmm0
  mov    0x50(%r13),%rdi
  xor    %eax,%eax
  mov    0xd0(%rsp),%rdx
  mov    %rbp,%rcx
  mov    %r12d,%esi
  movq   %rdx,%xmm3
  punpcklqdq %xmm0,%xmm3
  movaps %xmm3,0x70(%rsp)
  call   <mergesort@plt>
  mov    0x28(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0xd8(%rsp),%r15
  xor    %eax,%eax
  mov    %r15,%rdx
  call   <mergesort@plt>
  mov    0x60(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0xe0(%rsp),%rdx
  xor    %eax,%eax
  movq   %rdx,%xmm2
  movhps (%rsp),%xmm2
  movaps %xmm2,0x60(%rsp)
  call   <mergesort@plt>
  mov    0x30(%r13),%rdi
  movq   %r15,%xmm8
  xor    %eax,%eax
  movq   0xe8(%rsp),%xmm1
  mov    %rbp,%rcx
  mov    %r12d,%esi
  punpcklqdq %xmm1,%xmm8
  movq   %xmm1,%rdx
  movq   %xmm1,0x10(%rsp)
  movaps %xmm8,0x50(%rsp)
  call   <mergesort@plt>
  movq   %r14,%xmm6
  mov    %rbp,%rcx
  mov    %r12d,%esi
  movq   0xf0(%rsp),%xmm0
  mov    0xa0(%r13),%rdi
  xor    %eax,%eax
  punpcklqdq %xmm0,%xmm6
  movq   %xmm0,%rdx
  movq   %xmm0,0x80(%rsp)
  movaps %xmm6,0x40(%rsp)
  call   <mergesort@plt>
  mov    0x38(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0xf8(%rsp),%r8
  xor    %eax,%eax
  mov    %r8,%rdx
  mov    %r8,0x38(%rsp)
  call   <mergesort@plt>
  mov    0x70(%r13),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%esi
  mov    0x100(%rsp),%rdx
  movq   0x10(%rsp),%xmm1
  xor    %eax,%eax
  movq   %rdx,%xmm7
  punpcklqdq %xmm1,%xmm7
  movaps %xmm7,0x20(%rsp)
  call   <mergesort@plt>
  mov    %rbp,%rcx
  mov    %r12d,%esi
  xor    %eax,%eax
  mov    0x108(%rsp),%rdx
  mov    0xa8(%r13),%rdi
  movq   %rdx,%xmm5
  movhps (%rsp),%xmm5
  movaps %xmm5,0x10(%rsp)
  call   <mergesort@plt>
  mov    %rbp,%rcx
  mov    %r12d,%esi
  xor    %eax,%eax
  mov    0x110(%rsp),%rdx
  mov    0xe0(%r13),%rdi
  movq   0x80(%rsp),%xmm0
  movq   %rdx,%xmm1
  punpcklqdq %xmm0,%xmm1
  movaps %xmm1,(%rsp)
  call   <mergesort@plt>
  mov    %rbp,%rdi
  call   <sfree@plt>
  movdqa 0x70(%rsp),%xmm3
  xor    %esi,%esi
  movdqa 0xa0(%rsp),%xmm4
  movdqa 0x60(%rsp),%xmm2
  mov    0x88(%rsp),%r9
  mov    %r14,0x1b8(%rbx)
  mov    $0x1,%edi
  movdqa 0x50(%rsp),%xmm8
  mov    0x38(%rsp),%r8
  movups %xmm4,0x8(%rbx)
  mov    $0x1,%ecx
  movdqa 0x20(%rsp),%xmm7
  movdqa 0x40(%rsp),%xmm6
  mov    %r9,0x138(%rbx)
  mov    $0x1,%eax
  movdqa 0x10(%rsp),%xmm5
  movdqa (%rsp),%xmm1
  mov    %r15,0xb8(%rbx)
  movdqa 0x90(%rsp),%xmm9
  mov    %r8,0x38(%rbx)
  movups %xmm4,0x128(%rbx)
  movups %xmm3,0x170(%rbx)
  movups %xmm9,0x18(%rbx)
  movups %xmm8,0x28(%rbx)
  movups %xmm3,0x50(%rbx)
  movups %xmm2,0x60(%rbx)
  movups %xmm7,0x70(%rbx)
  movups %xmm6,0x98(%rbx)
  movups %xmm5,0xa8(%rbx)
  movups %xmm1,0xe0(%rbx)
  movups %xmm2,0xf0(%rbx)
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L40:
  movslq %ecx,%rax
  mov    (%rdx,%rax,8),%r14
L41:
  mov    %rsi,%rdx
  shl    $0x6,%rax
  add    $0x1,%ecx
  shl    $0x6,%rdx
  add    %rbx,%rax
  mov    %r14,(%rax,%rsi,8)
  add    %rbx,%rdx
  cmp    $0x8,%ecx
  jne    L40
  lea    0x1(%rdi),%ecx
  cmp    $0x7,%edi
  je     L37
  movslq %edi,%rdx
  movslq %edi,%rsi
  mov    %ecx,%edi
  shl    $0x6,%rdx
  add    %rbx,%rdx
  jmp    L40
  nopl   (%rax)
L37:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void sorts3d(double *vals[8][8], int *indices[8][8], int nvtxs) {
  int *space;
  int nsets = 8;
  int nlists = 13;
  int *temp[13];
  int i, j;
  void mergesort();
  space = smalloc(nvtxs * sizeof(int));
  for (i = 0; i < nlists; i++) {
    temp[i] = smalloc(nvtxs * sizeof(int));
  }
  mergesort(vals[0][1], nvtxs, temp[0], space);
  mergesort(vals[0][2], nvtxs, temp[1], space);
  mergesort(vals[0][4], nvtxs, temp[2], space);
  mergesort(vals[0][3], nvtxs, temp[3], space);
  mergesort(vals[1][2], nvtxs, temp[4], space);
  mergesort(vals[0][5], nvtxs, temp[5], space);
  mergesort(vals[1][4], nvtxs, temp[6], space);
  mergesort(vals[0][6], nvtxs, temp[7], space);
  mergesort(vals[2][4], nvtxs, temp[8], space);
  mergesort(vals[0][7], nvtxs, temp[9], space);
  mergesort(vals[1][6], nvtxs, temp[10], space);
  mergesort(vals[2][5], nvtxs, temp[11], space);
  mergesort(vals[3][4], nvtxs, temp[12], space);
  sfree(space);
  indices[0][1] = indices[2][3] = indices[4][5] = indices[6][7] = temp[0];
  indices[0][2] = indices[1][3] = indices[4][6] = indices[5][7] = temp[1];
  indices[0][4] = indices[1][5] = indices[2][6] = indices[3][7] = temp[2];
  indices[0][3] = indices[4][7] = temp[3];
  indices[1][2] = indices[5][6] = temp[4];
  indices[0][5] = indices[2][7] = temp[5];
  indices[1][4] = indices[3][6] = temp[6];
  indices[0][6] = indices[1][7] = temp[7];
  indices[2][4] = indices[3][5] = temp[8];
  indices[0][7] = temp[9];
  indices[1][6] = temp[10];
  indices[2][5] = temp[11];
  indices[3][4] = temp[12];
  for (i = 0; i < nsets; i++) {
    for (j = i + 1; j < nsets; j++) {
      indices[j][i] = indices[i][j];
    }
  }
}
```