user: Translate the below assembly code into C programming language:

```asm
<sorts3d>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %edx,-0xa4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x8,-0x80(%rbp)
  movl   $0xd,-0x7c(%rbp)
  mov    -0xa4(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <smalloc@plt>
  mov    %rax,-0x78(%rbp)
  movl   $0x0,-0x88(%rbp)
  jmp    L2
L23:
  mov    -0xa4(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <smalloc@plt>
  mov    -0x88(%rbp),%edx
  movslq %edx,%rdx
  mov    %rax,-0x70(%rbp,%rdx,8)
  addl   $0x1,-0x88(%rbp)
L2:
  mov    -0x88(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L23
  mov    -0x70(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x68(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x60(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x20(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x58(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x50(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  add    $0x40,%rax
  mov    0x10(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x48(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x28(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  add    $0x40,%rax
  mov    0x20(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x38(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x30(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    0x20(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x28(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    0x38(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  add    $0x40,%rax
  mov    0x30(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    0x28(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  add    $0xc0,%rax
  mov    0x20(%rax),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0xa4(%rbp),%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mergesort@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <sfree@plt>
  mov    -0xa0(%rbp),%rax
  add    $0x180,%rax
  mov    -0x70(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    -0xa0(%rbp),%rdx
  add    $0x100,%rdx
  mov    0x38(%rax),%rax
  mov    %rax,0x28(%rdx)
  mov    -0xa0(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    0x28(%rdx),%rdx
  mov    %rdx,0x18(%rax)
  mov    0x18(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x8(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0x140,%rax
  mov    -0x68(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    -0xa0(%rbp),%rdx
  add    $0x100,%rdx
  mov    0x38(%rax),%rax
  mov    %rax,0x30(%rdx)
  mov    -0xa0(%rbp),%rax
  add    $0x40,%rax
  mov    0x30(%rdx),%rdx
  mov    %rdx,0x18(%rax)
  mov    0x18(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x10(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0xc0,%rax
  mov    -0x60(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    -0xa0(%rbp),%rdx
  sub    $0xffffffffffffff80,%rdx
  mov    0x38(%rax),%rax
  mov    %rax,0x30(%rdx)
  mov    -0xa0(%rbp),%rax
  add    $0x40,%rax
  mov    0x30(%rdx),%rdx
  mov    %rdx,0x28(%rax)
  mov    0x28(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x20(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0x100,%rax
  mov    -0x58(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    0x38(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x18(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0x140,%rax
  mov    -0x50(%rbp),%rdx
  mov    %rdx,0x30(%rax)
  mov    -0xa0(%rbp),%rdx
  add    $0x40,%rdx
  mov    0x30(%rax),%rax
  mov    %rax,0x10(%rdx)
  mov    -0xa0(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    -0x48(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    0x38(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x28(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0xc0,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,0x30(%rax)
  mov    -0xa0(%rbp),%rdx
  add    $0x40,%rdx
  mov    0x30(%rax),%rax
  mov    %rax,0x20(%rdx)
  mov    -0xa0(%rbp),%rax
  add    $0x40,%rax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,0x38(%rax)
  mov    0x38(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x30(%rax)
  mov    -0xa0(%rbp),%rax
  add    $0xc0,%rax
  mov    -0x30(%rbp),%rdx
  mov    %rdx,0x28(%rax)
  mov    -0xa0(%rbp),%rdx
  sub    $0xffffffffffffff80,%rdx
  mov    0x28(%rax),%rax
  mov    %rax,0x20(%rdx)
  mov    -0x28(%rbp),%rdx
  mov    -0xa0(%rbp),%rax
  mov    %rdx,0x38(%rax)
  mov    -0xa0(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rax,0x30(%rdx)
  mov    -0xa0(%rbp),%rax
  lea    0x80(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,0x28(%rdx)
  mov    -0xa0(%rbp),%rax
  lea    0xc0(%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,0x20(%rdx)
  movl   $0x0,-0x88(%rbp)
  jmp    L11
L42:
  mov    -0x88(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x84(%rbp)
  jmp    L54
L25:
  mov    -0x88(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0xa0(%rbp),%rax
  add    %rax,%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rcx
  mov    -0xa0(%rbp),%rax
  add    %rax,%rcx
  mov    -0x84(%rbp),%eax
  cltq
  mov    (%rdx,%rax,8),%rdx
  mov    -0x88(%rbp),%eax
  cltq
  mov    %rdx,(%rcx,%rax,8)
  addl   $0x1,-0x84(%rbp)
L54:
  mov    -0x84(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L25
  addl   $0x1,-0x88(%rbp)
L11:
  mov    -0x88(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L42
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

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];
    }
  }
}
```