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

```asm
<dwt3d_combine>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    0x40(%rbp),%eax
  imul   0x48(%rbp),%eax
  mov    0x50(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    0x40(%rbp),%r9d
  mov    0x38(%rbp),%r8
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x20(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x30(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x38(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    -0x40(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    0x40(%rbp),%edi
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%eax
  mov    0x50(%rbp),%esi
  push   %rsi
  mov    0x48(%rbp),%esi
  push   %rsi
  mov    %edi,%r9d
  mov    %eax,%esi
  mov    0x10(%rbp),%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    0x40(%rbp),%r8d
  mov    0x30(%rbp),%ecx
  mov    0x28(%rbp),%edx
  mov    0x20(%rbp),%esi
  mov    0x18(%rbp),%rax
  mov    0x50(%rbp),%edi
  push   %rdi
  mov    0x48(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <dwt3d_tran_z_inv@plt>
  add    $0x10,%rsp
  nop
  leave
  ret
```

assistant: ```c
void dwt3d_combine(double *mat1, double *mat2, double *mat3, double *mat4, double *mat5, double *mat6, double *mat7, double *mat8, int rowIn, int colIn, int sliIn, double *matOut, int rowOut, int colOut, int sliOut) {
  int siz;
  siz = rowOut * colOut * sliOut;
  dwt3d_tran_z_inv(mat1, rowIn, colIn, sliIn, matOut, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat2, rowIn, colIn, sliIn, matOut + siz, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat3, rowIn, colIn, sliIn, matOut + siz * 2, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat4, rowIn, colIn, sliIn, matOut + siz * 3, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat5, rowIn, colIn, sliIn, matOut + siz * 4, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat6, rowIn, colIn, sliIn, matOut + siz * 5, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat7, rowIn, colIn, sliIn, matOut + siz * 6, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat8, rowIn, colIn, sliIn, matOut + siz * 7, rowOut, colOut, sliOut);
  return;
}
```