user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<Matrix4Double>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %r12d,%r15d
  mov    %esi,%ebp
  mov    $0x8,%esi
  push   %rbx
  imul   %ebp,%r15d
  mov    %ecx,%ebx
  sub    $0x18,%rsp
  mov    %ecx,0xc(%rsp)
  call   <calloc@plt>
  mov    %r15d,%edi
  mov    $0x8,%esi
  mov    %rax,%r14
  imul   %r13d,%r15d
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %rax,(%r14)
  mov    %r15d,%edi
  call   <calloc@plt>
  mov    (%r14),%rdx
  mov    %r15d,%edi
  mov    $0x8,%esi
  imul   %ebx,%edi
  mov    %rax,(%rdx)
  call   <calloc@plt>
  mov    (%r14),%rdx
  mov    (%rdx),%rcx
  mov    %rax,(%rcx)
  cmp    $0x1,%r12d
  jle    L59
  mov    %ebp,%eax
  movslq %ebp,%r9
  lea    -0x1(%r12),%ecx
  imul   %r13d,%eax
  shl    $0x3,%r9
  lea    (%r14,%rcx,8),%r10
  movslq %eax,%r8
  imul   %ebx,%eax
  shl    $0x3,%r8
  movslq %eax,%rdi
  lea    0x8(%r14),%rax
  shl    $0x3,%rdi
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L119:
  add    $0x8,%rax
L24:
  mov    -0x8(%rax),%rsi
  add    %r9,%rdx
  mov    %rdx,(%rax)
  mov    (%rsi),%rcx
  add    %r8,%rcx
  mov    %rcx,(%rdx)
  mov    (%rsi),%rsi
  mov    (%rsi),%rbx
  add    %rdi,%rbx
  mov    %rbx,(%rcx)
  cmp    %r10,%rax
  jne    L119
L85:
  mov    0xc(%rsp),%ebx
  movslq %r13d,%r9
  lea    -0x2(%rbp),%eax
  mov    %r14,%r8
  shl    $0x3,%r9
  mov    %r14,%r11
  xor    %r10d,%r10d
  imul   %r13d,%ebx
  lea    0x8(,%rax,8),%r15
  movslq %ebx,%rdi
  shl    $0x3,%rdi
  nopw   0x0(%rax,%rax,1)
L112:
  cmp    $0x1,%ebp
  jle    L27
  mov    (%r11),%rax
  lea    (%r15,%rax,1),%rsi
  nopl   0x0(%rax)
L91:
  mov    (%rax),%rcx
  add    $0x8,%rax
  mov    (%rcx),%rbx
  lea    (%rcx,%r9,1),%rdx
  mov    %rdx,(%rax)
  add    %rdi,%rbx
  mov    %rbx,(%rdx)
  cmp    %rsi,%rax
  jne    L91
L27:
  add    $0x1,%r10d
  add    $0x8,%r11
  cmp    %r10d,%r12d
  jg     L112
  lea    -0x1(%rbp),%eax
  movslq 0xc(%rsp),%rsi
  xor    %r11d,%r11d
  lea    0x8(,%rax,8),%r9
  lea    -0x2(%r13),%eax
  shl    $0x3,%rsi
  lea    0x8(,%rax,8),%r10
  nopl   0x0(%rax)
L51:
  test   %ebp,%ebp
  jle    L72
  xor    %edi,%edi
  xchg   %ax,%ax
L1:
  cmp    $0x1,%r13d
  jle    L21
  mov    (%r8),%rax
  mov    (%rax,%rdi,1),%rax
  lea    (%r10,%rax,1),%rcx
  nopl   0x0(%rax)
L124:
  mov    (%rax),%rdx
  add    $0x8,%rax
  add    %rsi,%rdx
  mov    %rdx,(%rax)
  cmp    %rax,%rcx
  jne    L124
L21:
  add    $0x8,%rdi
  cmp    %rdi,%r9
  jne    L1
L72:
  add    $0x1,%r11d
  add    $0x8,%r8
  cmp    %r11d,%r12d
  jg     L51
L113:
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  jne    L113
  jmp    L85
```

assistant: ```c
double ****Matrix4Double(int M, int N, int P, int Q) {
  double ****out;
  int i, j, k;
  out = (double ****)calloc(M, sizeof(double ***));
  out[0] = (double ***)calloc(M * N, sizeof(double **));
  out[0][0] = (double **)calloc(M * N * P, sizeof(double *));
  out[0][0][0] = (double *)calloc(M * N * P * Q, sizeof(double));
  for (i = 1; i < M; i++) {
    out[i] = out[i - 1] + N;
    out[i][0] = out[i - 1][0] + N * P;
    out[i][0][0] = out[i - 1][0][0] + N * P * Q;
  }
  for (i = 0; i < M; i++)
    for (j = 1; j < N; j++) {
      out[i][j] = out[i][j - 1] + P;
      out[i][j][0] = out[i][j - 1][0] + P * Q;
    }
  for (i = 0; i < M; i++)
    for (j = 0; j < N; j++)
      for (k = 1; k < P; k++)
        out[i][j][k] = out[i][j][k - 1] + Q;
  return out;
}
```