#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ dwt3d_line_reverse(double *, double *, int, int, int,
                                      double *, int, int, int, double *,
                                      double *, int);
int /*<<< orphan*/ dwt3d_split(double *, int, int, int, double *, double *,
                               double *, double *, double *, double *, double *,
                               double *, int, int, int);
int /*<<< orphan*/ dwt3d_tran(double *, int, int, int, double *, int, int, int);
int /*<<< orphan*/ dwt3d_tran_z_inv(double *, int, int, int, double *, int, int,
                                    int);
int /*<<< orphan*/ free(double *);
double *malloc(int);
void idwt3(double *mat3DIn, int row, int col, int sli, double *mat3DOut, int r,
           int c, int s, double *Lo1, double *Hi1, double *Lo2, double *Hi2,
           double *Lo3, double *Hi3, int fLen1, int fLen2, int fLen3) {
  double *rowApp, *rowDet, *rowAppRot, *rowDetRot;
  double *rowAppColApp, *rowAppColDet, *rowDetColApp, *rowDetColDet;
  double *rowAppColAppRot, *rowAppColDetRot;
  double *rowDetColAppRot, *rowDetColDetRot;
  double *rowAppColAppSliApp, *rowAppColAppSliDet;
  double *rowAppColDetSliApp, *rowAppColDetSliDet;
  double *rowDetColAppSliApp, *rowDetColAppSliDet;
  double *rowDetColDetSliApp, *rowDetColDetSliDet;
  double *outTemp;
  rowAppColAppSliApp = malloc(row * col * sli * sizeof(double));
  rowAppColAppSliDet = malloc(row * col * sli * sizeof(double));
  rowAppColDetSliApp = malloc(row * col * sli * sizeof(double));
  rowAppColDetSliDet = malloc(row * col * sli * sizeof(double));
  rowDetColAppSliApp = malloc(row * col * sli * sizeof(double));
  rowDetColAppSliDet = malloc(row * col * sli * sizeof(double));
  rowDetColDetSliApp = malloc(row * col * sli * sizeof(double));
  rowDetColDetSliDet = malloc(row * col * sli * sizeof(double));
  dwt3d_split(mat3DIn, col, row, sli, rowAppColAppSliApp, rowAppColAppSliDet,
              rowAppColDetSliApp, rowAppColDetSliDet, rowDetColAppSliApp,
              rowDetColAppSliDet, rowDetColDetSliApp, rowDetColDetSliDet, row,
              sli, col);
  rowAppColAppRot = malloc(row * s * col * sizeof(double));
  dwt3d_line_reverse(rowAppColAppSliApp, rowAppColAppSliDet, row, sli, col,
                     rowAppColAppRot, row, s, col, Lo1, Hi1, fLen1);
  free(rowAppColAppSliApp);
  free(rowAppColAppSliDet);
  rowAppColDetRot = malloc(row * s * col * sizeof(double));
  dwt3d_line_reverse(rowAppColDetSliApp, rowAppColDetSliDet, row, sli, col,
                     rowAppColDetRot, row, s, col, Lo1, Hi1, fLen1);
  free(rowAppColDetSliApp);
  free(rowAppColDetSliDet);
  rowDetColAppRot = malloc(row * s * col * sizeof(double));
  dwt3d_line_reverse(rowDetColAppSliApp, rowDetColAppSliDet, row, sli, col,
                     rowDetColAppRot, row, s, col, Lo1, Hi1, fLen1);
  free(rowDetColAppSliApp);
  free(rowDetColAppSliDet);
  rowDetColDetRot = malloc(row * s * col * sizeof(double));
  dwt3d_line_reverse(rowDetColDetSliApp, rowDetColDetSliDet, row, sli, col,
                     rowDetColDetRot, row, s, col, Lo1, Hi1, fLen1);
  free(rowDetColDetSliApp);
  free(rowDetColDetSliDet);
  rowAppColApp = malloc(row * s * col * sizeof(double));
  dwt3d_tran_z_inv(rowAppColAppRot, row, s, col, rowAppColApp, col, row, s);
  free(rowAppColAppRot);
  rowAppColDet = malloc(row * s * col * sizeof(double));
  dwt3d_tran_z_inv(rowAppColDetRot, row, s, col, rowAppColDet, col, row, s);
  free(rowAppColDetRot);
  rowDetColApp = malloc(row * s * col * sizeof(double));
  dwt3d_tran_z_inv(rowDetColAppRot, row, s, col, rowDetColApp, col, row, s);
  free(rowDetColAppRot);
  rowDetColDet = malloc(row * s * col * sizeof(double));
  dwt3d_tran_z_inv(rowDetColDetRot, row, s, col, rowDetColDet, col, row, s);
  free(rowDetColDetRot);
  rowAppRot = malloc(r * s * col * sizeof(double));
  dwt3d_line_reverse(rowAppColApp, rowAppColDet, col, row, s, rowAppRot, col, r,
                     s, Lo2, Hi2, fLen2);
  free(rowAppColApp);
  free(rowAppColDet);
  rowDetRot = malloc(r * s * col * sizeof(double));
  dwt3d_line_reverse(rowDetColApp, rowDetColDet, col, row, s, rowDetRot, col, r,
                     s, Lo2, Hi2, fLen2);
  free(rowDetColApp);
  free(rowDetColDet);
  rowApp = malloc(r * s * col * sizeof(double));
  dwt3d_tran(rowAppRot, col, r, s, rowApp, r, col, s);
  free(rowAppRot);
  rowDet = malloc(r * s * col * sizeof(double));
  dwt3d_tran(rowDetRot, col, r, s, rowDet, r, col, s);
  free(rowDetRot);
  outTemp = malloc(r * s * c * sizeof(double));
  dwt3d_line_reverse(rowApp, rowDet, r, col, s, outTemp, r, c, s, Lo3, Hi3,
                     fLen3);
  free(rowApp);
  free(rowDet);
  dwt3d_tran(outTemp, r, c, s, mat3DOut, c, r, s);
  free(outTemp);
  return;
}


x86 assembly (clang, -O0):
<idwt3>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    0x60(%rbp),%eax
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9d,-0x4c(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xc8(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xd8(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xe0(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xe8(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xf0(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0xb8(%rbp),%r8
mov    -0xc0(%rbp),%r9
mov    -0xc8(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0xd0(%rbp),%r13
mov    -0xd8(%rbp),%r12
mov    -0xe0(%rbp),%r15
mov    -0xe8(%rbp),%r14
mov    -0xf0(%rbp),%rbx
mov    -0x34(%rbp),%r11d
mov    -0x3c(%rbp),%r10d
mov    -0x38(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x108(%rbp),%rax
mov    %rax,(%rsp)
mov    -0xfc(%rbp),%eax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %eax,0x40(%rsp)
call   1040 <dwt3d_split@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0xb8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x98(%rbp),%r9
mov    -0x34(%rbp),%r15d
mov    0x18(%rbp),%r14d
mov    -0x38(%rbp),%ebx
mov    0x20(%rbp),%r11
mov    0x28(%rbp),%r10
mov    0x50(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xc8(%rbp),%rdi
mov    -0xd0(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0xa0(%rbp),%r9
mov    -0x34(%rbp),%r15d
mov    0x18(%rbp),%r14d
mov    -0x38(%rbp),%ebx
mov    0x20(%rbp),%r11
mov    0x28(%rbp),%r10
mov    0x50(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xd8(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0xa8(%rbp),%r9
mov    -0x34(%rbp),%r15d
mov    0x18(%rbp),%r14d
mov    -0x38(%rbp),%ebx
mov    0x20(%rbp),%r11
mov    0x28(%rbp),%r10
mov    0x50(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0xd8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xe8(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0xb0(%rbp),%r9
mov    -0x34(%rbp),%r15d
mov    0x18(%rbp),%r14d
mov    -0x38(%rbp),%ebx
mov    0x20(%rbp),%r11
mov    0x28(%rbp),%r10
mov    0x50(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0xe8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xf0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x18(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x78(%rbp),%r8
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <dwt3d_tran_z_inv@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0xa0(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x18(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x80(%rbp),%r8
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <dwt3d_tran_z_inv@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0xa8(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x18(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x88(%rbp),%r8
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <dwt3d_tran_z_inv@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0xb0(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x18(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x90(%rbp),%r8
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <dwt3d_tran_z_inv@plt>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    -0x68(%rbp),%r9
mov    -0x38(%rbp),%r15d
mov    -0x4c(%rbp),%r14d
mov    0x18(%rbp),%ebx
mov    0x30(%rbp),%r11
mov    0x38(%rbp),%r10
mov    0x58(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    -0x70(%rbp),%r9
mov    -0x38(%rbp),%r15d
mov    -0x4c(%rbp),%r14d
mov    0x18(%rbp),%ebx
mov    0x30(%rbp),%r11
mov    0x38(%rbp),%r10
mov    0x58(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x68(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    -0x58(%rbp),%r8
mov    -0x4c(%rbp),%r9d
mov    -0x38(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1080 <dwt3d_tran@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
imul   0x18(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    -0x60(%rbp),%r8
mov    -0x4c(%rbp),%r9d
mov    -0x38(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1080 <dwt3d_tran@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
imul   0x18(%rbp),%eax
imul   0x10(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x4c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    -0xf8(%rbp),%r9
mov    -0x4c(%rbp),%r15d
mov    0x10(%rbp),%r14d
mov    0x18(%rbp),%ebx
mov    0x40(%rbp),%r11
mov    0x48(%rbp),%r10
mov    0x60(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <dwt3d_line_reverse@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0xf8(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    -0x48(%rbp),%r8
mov    0x10(%rbp),%r9d
mov    -0x4c(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1080 <dwt3d_tran@plt>
mov    -0xf8(%rbp),%rdi
call   1030 <free@plt>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<idwt3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9,0x60(%rsp)
mov    %r8,0xb8(%rsp)
mov    %ecx,%ebp
mov    %edx,%r13d
mov    %esi,%r12d
mov    %rdi,0x58(%rsp)
movaps 0x140(%rsp),%xmm0
movaps %xmm0,0xc0(%rsp)
mov    0x160(%rsp),%eax
mov    %eax,0x6c(%rsp)
mov    0x110(%rsp),%eax
mov    %eax,0x3c(%rsp)
mov    0x130(%rsp),%rax
mov    %rax,0x90(%rsp)
mov    0x138(%rsp),%rax
mov    %rax,0x88(%rsp)
mov    0x158(%rsp),%eax
mov    %rax,0x80(%rsp)
mov    0x120(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    0x128(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    %edx,%r14d
imul   %esi,%r14d
shl    $0x3,%r14d
mov    %r14d,0x20(%rsp)
imul   %ecx,%r14d
mov    0x150(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    0x118(%rsp),%eax
mov    %rax,0x50(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0x98(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0x78(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,0xa0(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %rax,0xa8(%rsp)
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,0xb0(%rsp)
sub    $0x8,%rsp
mov    0x60(%rsp),%rdi
mov    %r13d,%esi
mov    %r12,%rdx
mov    %r12,0x50(%rsp)
mov    %rbp,%r14
mov    %r14d,%ecx
mov    0x48(%rsp),%rbp
mov    %rbp,%r8
mov    0xa0(%rsp),%r12
mov    %r12,%r9
push   %r13
push   %r14
mov    %r14,0x88(%rsp)
push   %rdx
push   %rax
push   %r15
push   %rbx
push   0xb0(%rsp)
push   0x50(%rsp)
push   0x60(%rsp)
call   1040 <dwt3d_split@plt>
add    $0x50,%rsp
mov    0x20(%rsp),%edi
mov    0x50(%rsp),%rbx
imul   %ebx,%edi
mov    %edi,0x20(%rsp)
call   1050 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    0x48(%rsp),%rdx
mov    %r14d,%ecx
mov    %r13d,%r8d
mov    %rax,%r9
mov    0x28(%rsp),%rbp
push   %rbp
mov    0x38(%rsp),%r15
push   %r15
mov    0x18(%rsp),%r14
push   %r14
push   %r13
push   %rbx
push   %rdx
mov    %rdx,%rbx
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%edi
call   1050 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    0x18(%rsp),%r12
mov    %r12,%rdi
mov    0x10(%rsp),%rsi
mov    %rbx,%rdx
mov    0x70(%rsp),%rcx
mov    %r13d,%r8d
mov    %rax,%r9
push   %rbp
push   %r15
push   %r14
push   %r13
mov    0x70(%rsp),%rbx
push   %rbx
push   %rdx
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    0x78(%rsp),%r15
mov    %r15,%rdi
mov    0xa0(%rsp),%r14
mov    %r14,%rsi
mov    0x48(%rsp),%rdx
mov    0x70(%rsp),%r12
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %rax,%r9
push   0x28(%rsp)
push   0x38(%rsp)
push   0x18(%rsp)
push   %r13
push   %rbx
push   %rdx
mov    %rdx,%rbx
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    0xa8(%rsp),%r15
mov    %r15,%rdi
mov    0xb0(%rsp),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %rax,%r9
push   0x28(%rsp)
push   0x38(%rsp)
push   0x18(%rsp)
push   %r13
mov    0x70(%rsp),%r12
push   %r12
push   %rbx
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    0x58(%rsp),%rbx
mov    %rbx,%rdi
mov    0x48(%rsp),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %rax,%r8
mov    %r13d,%r9d
push   %r12
mov    %r12,%r14
push   %rsi
mov    %rsi,%r12
call   1070 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
mov    %ebp,%r15d
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    %r12,%rbx
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r13d,%ecx
mov    %rax,%r8
mov    %r13d,%r9d
push   %r14
push   %r12
call   1070 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15d,%edi
call   1050 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r13d,%ecx
mov    %rax,%r8
mov    %r13d,%r9d
push   %r14
push   %r12
call   1070 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15d,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r13d,%ecx
mov    %rax,%r8
mov    %r13d,%r9d
push   %r14
push   %r12
call   1070 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
mov    0x60(%rsp),%r15
imul   %r15d,%eax
mov    %eax,0x18(%rsp)
mov    %r13d,%ebp
imul   %eax,%ebp
shl    $0x3,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    0x30(%rsp),%r12
mov    %r12,%rdi
mov    0x8(%rsp),%rsi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    %rax,%r9
push   0x80(%rsp)
push   0x90(%rsp)
push   0xa0(%rsp)
push   %r14
push   %r15
mov    %r15,%r14
push   %r13
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    0x28(%rsp),%rbx
mov    %rbx,%rdi
mov    0x10(%rsp),%r15
mov    %r15,%rsi
mov    %r13d,%edx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r12
mov    %r12d,%r8d
mov    %rax,%r9
push   0x80(%rsp)
push   0x90(%rsp)
push   0xa0(%rsp)
push   %r12
push   %r14
push   %r13
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r14,%rdx
mov    %r12d,%ecx
mov    %rax,%r8
mov    %rax,%r14
mov    %edx,%r9d
push   %r12
push   %r13
call   1080 <dwt3d_tran@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    0x60(%rsp),%rdx
mov    %r12d,%ecx
mov    %rax,%r8
mov    %edx,%r9d
push   %r12
push   %r13
call   1080 <dwt3d_tran@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x3c(%rsp),%ebx
mov    0x18(%rsp),%edi
imul   %ebx,%edi
shl    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
sub    $0x30,%rsp
mov    0x9c(%rsp),%eax
mov    %eax,0x28(%rsp)
movaps 0xf0(%rsp),%xmm0
movups %xmm0,0x18(%rsp)
mov    %r12d,0x10(%rsp)
mov    %ebx,0x8(%rsp)
mov    0x90(%rsp),%rbx
mov    %ebx,(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %rbp,%r9
call   1060 <dwt3d_line_reverse@plt>
add    $0x30,%rsp
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    0x3c(%rsp),%edx
mov    %r12d,%ecx
mov    0xb8(%rsp),%r8
mov    %edx,%r9d
push   %r12
push   %rbx
call   1080 <dwt3d_tran@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @idwt3(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, i32 %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, i32 %14, i32 %15, i32 %16) {
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca double*
%36 = alloca double*
%37 = alloca double*
%38 = alloca double*
%39 = alloca double*
%40 = alloca double*
%41 = alloca double*
%42 = alloca double*
%43 = alloca double*
%44 = alloca double*
%45 = alloca double*
%46 = alloca double*
%47 = alloca double*
%48 = alloca double*
%49 = alloca double*
%50 = alloca double*
%51 = alloca double*
%52 = alloca double*
%53 = alloca double*
%54 = alloca double*
%55 = alloca double*
store double* %0, double** %18
store i32 %1, i32* %19
store i32 %2, i32* %20
store i32 %3, i32* %21
store double* %4, double** %22
store i32 %5, i32* %23
store i32 %6, i32* %24
store i32 %7, i32* %25
store double* %8, double** %26
store double* %9, double** %27
store double* %10, double** %28
store double* %11, double** %29
store double* %12, double** %30
store double* %13, double** %31
store i32 %14, i32* %32
store i32 %15, i32* %33
store i32 %16, i32* %34
%56 = load i32, i32* %19
%57 = load i32, i32* %20
%58 = mul nsw i32 %56, %57
%59 = load i32, i32* %21
%60 = mul nsw i32 %58, %59
%61 = sext i32 %60 to i64
%62 = mul i64 %61, 8
%63 = trunc i64 %62 to i32
%64 = call double* @malloc(i32 %63)
store double* %64, double** %47
%65 = load i32, i32* %19
%66 = load i32, i32* %20
%67 = mul nsw i32 %65, %66
%68 = load i32, i32* %21
%69 = mul nsw i32 %67, %68
%70 = sext i32 %69 to i64
%71 = mul i64 %70, 8
%72 = trunc i64 %71 to i32
%73 = call double* @malloc(i32 %72)
store double* %73, double** %48
%74 = load i32, i32* %19
%75 = load i32, i32* %20
%76 = mul nsw i32 %74, %75
%77 = load i32, i32* %21
%78 = mul nsw i32 %76, %77
%79 = sext i32 %78 to i64
%80 = mul i64 %79, 8
%81 = trunc i64 %80 to i32
%82 = call double* @malloc(i32 %81)
store double* %82, double** %49
%83 = load i32, i32* %19
%84 = load i32, i32* %20
%85 = mul nsw i32 %83, %84
%86 = load i32, i32* %21
%87 = mul nsw i32 %85, %86
%88 = sext i32 %87 to i64
%89 = mul i64 %88, 8
%90 = trunc i64 %89 to i32
%91 = call double* @malloc(i32 %90)
store double* %91, double** %50
%92 = load i32, i32* %19
%93 = load i32, i32* %20
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %21
%96 = mul nsw i32 %94, %95
%97 = sext i32 %96 to i64
%98 = mul i64 %97, 8
%99 = trunc i64 %98 to i32
%100 = call double* @malloc(i32 %99)
store double* %100, double** %51
%101 = load i32, i32* %19
%102 = load i32, i32* %20
%103 = mul nsw i32 %101, %102
%104 = load i32, i32* %21
%105 = mul nsw i32 %103, %104
%106 = sext i32 %105 to i64
%107 = mul i64 %106, 8
%108 = trunc i64 %107 to i32
%109 = call double* @malloc(i32 %108)
store double* %109, double** %52
%110 = load i32, i32* %19
%111 = load i32, i32* %20
%112 = mul nsw i32 %110, %111
%113 = load i32, i32* %21
%114 = mul nsw i32 %112, %113
%115 = sext i32 %114 to i64
%116 = mul i64 %115, 8
%117 = trunc i64 %116 to i32
%118 = call double* @malloc(i32 %117)
store double* %118, double** %53
%119 = load i32, i32* %19
%120 = load i32, i32* %20
%121 = mul nsw i32 %119, %120
%122 = load i32, i32* %21
%123 = mul nsw i32 %121, %122
%124 = sext i32 %123 to i64
%125 = mul i64 %124, 8
%126 = trunc i64 %125 to i32
%127 = call double* @malloc(i32 %126)
store double* %127, double** %54
%128 = load double*, double** %18
%129 = load i32, i32* %20
%130 = load i32, i32* %19
%131 = load i32, i32* %21
%132 = load double*, double** %47
%133 = load double*, double** %48
%134 = load double*, double** %49
%135 = load double*, double** %50
%136 = load double*, double** %51
%137 = load double*, double** %52
%138 = load double*, double** %53
%139 = load double*, double** %54
%140 = load i32, i32* %19
%141 = load i32, i32* %21
%142 = load i32, i32* %20
%143 = call i32 @dwt3d_split(double* %128, i32 %129, i32 %130, i32 %131, double* %132, double* %133, double* %134, double* %135, double* %136, double* %137, double* %138, double* %139, i32 %140, i32 %141, i32 %142)
%144 = load i32, i32* %19
%145 = load i32, i32* %25
%146 = mul nsw i32 %144, %145
%147 = load i32, i32* %20
%148 = mul nsw i32 %146, %147
%149 = sext i32 %148 to i64
%150 = mul i64 %149, 8
%151 = trunc i64 %150 to i32
%152 = call double* @malloc(i32 %151)
store double* %152, double** %43
%153 = load double*, double** %47
%154 = load double*, double** %48
%155 = load i32, i32* %19
%156 = load i32, i32* %21
%157 = load i32, i32* %20
%158 = load double*, double** %43
%159 = load i32, i32* %19
%160 = load i32, i32* %25
%161 = load i32, i32* %20
%162 = load double*, double** %26
%163 = load double*, double** %27
%164 = load i32, i32* %32
%165 = call i32 @dwt3d_line_reverse(double* %153, double* %154, i32 %155, i32 %156, i32 %157, double* %158, i32 %159, i32 %160, i32 %161, double* %162, double* %163, i32 %164)
%166 = load double*, double** %47
%167 = call i32 @free(double* %166)
%168 = load double*, double** %48
%169 = call i32 @free(double* %168)
%170 = load i32, i32* %19
%171 = load i32, i32* %25
%172 = mul nsw i32 %170, %171
%173 = load i32, i32* %20
%174 = mul nsw i32 %172, %173
%175 = sext i32 %174 to i64
%176 = mul i64 %175, 8
%177 = trunc i64 %176 to i32
%178 = call double* @malloc(i32 %177)
store double* %178, double** %44
%179 = load double*, double** %49
%180 = load double*, double** %50
%181 = load i32, i32* %19
%182 = load i32, i32* %21
%183 = load i32, i32* %20
%184 = load double*, double** %44
%185 = load i32, i32* %19
%186 = load i32, i32* %25
%187 = load i32, i32* %20
%188 = load double*, double** %26
%189 = load double*, double** %27
%190 = load i32, i32* %32
%191 = call i32 @dwt3d_line_reverse(double* %179, double* %180, i32 %181, i32 %182, i32 %183, double* %184, i32 %185, i32 %186, i32 %187, double* %188, double* %189, i32 %190)
%192 = load double*, double** %49
%193 = call i32 @free(double* %192)
%194 = load double*, double** %50
%195 = call i32 @free(double* %194)
%196 = load i32, i32* %19
%197 = load i32, i32* %25
%198 = mul nsw i32 %196, %197
%199 = load i32, i32* %20
%200 = mul nsw i32 %198, %199
%201 = sext i32 %200 to i64
%202 = mul i64 %201, 8
%203 = trunc i64 %202 to i32
%204 = call double* @malloc(i32 %203)
store double* %204, double** %45
%205 = load double*, double** %51
%206 = load double*, double** %52
%207 = load i32, i32* %19
%208 = load i32, i32* %21
%209 = load i32, i32* %20
%210 = load double*, double** %45
%211 = load i32, i32* %19
%212 = load i32, i32* %25
%213 = load i32, i32* %20
%214 = load double*, double** %26
%215 = load double*, double** %27
%216 = load i32, i32* %32
%217 = call i32 @dwt3d_line_reverse(double* %205, double* %206, i32 %207, i32 %208, i32 %209, double* %210, i32 %211, i32 %212, i32 %213, double* %214, double* %215, i32 %216)
%218 = load double*, double** %51
%219 = call i32 @free(double* %218)
%220 = load double*, double** %52
%221 = call i32 @free(double* %220)
%222 = load i32, i32* %19
%223 = load i32, i32* %25
%224 = mul nsw i32 %222, %223
%225 = load i32, i32* %20
%226 = mul nsw i32 %224, %225
%227 = sext i32 %226 to i64
%228 = mul i64 %227, 8
%229 = trunc i64 %228 to i32
%230 = call double* @malloc(i32 %229)
store double* %230, double** %46
%231 = load double*, double** %53
%232 = load double*, double** %54
%233 = load i32, i32* %19
%234 = load i32, i32* %21
%235 = load i32, i32* %20
%236 = load double*, double** %46
%237 = load i32, i32* %19
%238 = load i32, i32* %25
%239 = load i32, i32* %20
%240 = load double*, double** %26
%241 = load double*, double** %27
%242 = load i32, i32* %32
%243 = call i32 @dwt3d_line_reverse(double* %231, double* %232, i32 %233, i32 %234, i32 %235, double* %236, i32 %237, i32 %238, i32 %239, double* %240, double* %241, i32 %242)
%244 = load double*, double** %53
%245 = call i32 @free(double* %244)
%246 = load double*, double** %54
%247 = call i32 @free(double* %246)
%248 = load i32, i32* %19
%249 = load i32, i32* %25
%250 = mul nsw i32 %248, %249
%251 = load i32, i32* %20
%252 = mul nsw i32 %250, %251
%253 = sext i32 %252 to i64
%254 = mul i64 %253, 8
%255 = trunc i64 %254 to i32
%256 = call double* @malloc(i32 %255)
store double* %256, double** %39
%257 = load double*, double** %43
%258 = load i32, i32* %19
%259 = load i32, i32* %25
%260 = load i32, i32* %20
%261 = load double*, double** %39
%262 = load i32, i32* %20
%263 = load i32, i32* %19
%264 = load i32, i32* %25
%265 = call i32 @dwt3d_tran_z_inv(double* %257, i32 %258, i32 %259, i32 %260, double* %261, i32 %262, i32 %263, i32 %264)
%266 = load double*, double** %43
%267 = call i32 @free(double* %266)
%268 = load i32, i32* %19
%269 = load i32, i32* %25
%270 = mul nsw i32 %268, %269
%271 = load i32, i32* %20
%272 = mul nsw i32 %270, %271
%273 = sext i32 %272 to i64
%274 = mul i64 %273, 8
%275 = trunc i64 %274 to i32
%276 = call double* @malloc(i32 %275)
store double* %276, double** %40
%277 = load double*, double** %44
%278 = load i32, i32* %19
%279 = load i32, i32* %25
%280 = load i32, i32* %20
%281 = load double*, double** %40
%282 = load i32, i32* %20
%283 = load i32, i32* %19
%284 = load i32, i32* %25
%285 = call i32 @dwt3d_tran_z_inv(double* %277, i32 %278, i32 %279, i32 %280, double* %281, i32 %282, i32 %283, i32 %284)
%286 = load double*, double** %44
%287 = call i32 @free(double* %286)
%288 = load i32, i32* %19
%289 = load i32, i32* %25
%290 = mul nsw i32 %288, %289
%291 = load i32, i32* %20
%292 = mul nsw i32 %290, %291
%293 = sext i32 %292 to i64
%294 = mul i64 %293, 8
%295 = trunc i64 %294 to i32
%296 = call double* @malloc(i32 %295)
store double* %296, double** %41
%297 = load double*, double** %45
%298 = load i32, i32* %19
%299 = load i32, i32* %25
%300 = load i32, i32* %20
%301 = load double*, double** %41
%302 = load i32, i32* %20
%303 = load i32, i32* %19
%304 = load i32, i32* %25
%305 = call i32 @dwt3d_tran_z_inv(double* %297, i32 %298, i32 %299, i32 %300, double* %301, i32 %302, i32 %303, i32 %304)
%306 = load double*, double** %45
%307 = call i32 @free(double* %306)
%308 = load i32, i32* %19
%309 = load i32, i32* %25
%310 = mul nsw i32 %308, %309
%311 = load i32, i32* %20
%312 = mul nsw i32 %310, %311
%313 = sext i32 %312 to i64
%314 = mul i64 %313, 8
%315 = trunc i64 %314 to i32
%316 = call double* @malloc(i32 %315)
store double* %316, double** %42
%317 = load double*, double** %46
%318 = load i32, i32* %19
%319 = load i32, i32* %25
%320 = load i32, i32* %20
%321 = load double*, double** %42
%322 = load i32, i32* %20
%323 = load i32, i32* %19
%324 = load i32, i32* %25
%325 = call i32 @dwt3d_tran_z_inv(double* %317, i32 %318, i32 %319, i32 %320, double* %321, i32 %322, i32 %323, i32 %324)
%326 = load double*, double** %46
%327 = call i32 @free(double* %326)
%328 = load i32, i32* %23
%329 = load i32, i32* %25
%330 = mul nsw i32 %328, %329
%331 = load i32, i32* %20
%332 = mul nsw i32 %330, %331
%333 = sext i32 %332 to i64
%334 = mul i64 %333, 8
%335 = trunc i64 %334 to i32
%336 = call double* @malloc(i32 %335)
store double* %336, double** %37
%337 = load double*, double** %39
%338 = load double*, double** %40
%339 = load i32, i32* %20
%340 = load i32, i32* %19
%341 = load i32, i32* %25
%342 = load double*, double** %37
%343 = load i32, i32* %20
%344 = load i32, i32* %23
%345 = load i32, i32* %25
%346 = load double*, double** %28
%347 = load double*, double** %29
%348 = load i32, i32* %33
%349 = call i32 @dwt3d_line_reverse(double* %337, double* %338, i32 %339, i32 %340, i32 %341, double* %342, i32 %343, i32 %344, i32 %345, double* %346, double* %347, i32 %348)
%350 = load double*, double** %39
%351 = call i32 @free(double* %350)
%352 = load double*, double** %40
%353 = call i32 @free(double* %352)
%354 = load i32, i32* %23
%355 = load i32, i32* %25
%356 = mul nsw i32 %354, %355
%357 = load i32, i32* %20
%358 = mul nsw i32 %356, %357
%359 = sext i32 %358 to i64
%360 = mul i64 %359, 8
%361 = trunc i64 %360 to i32
%362 = call double* @malloc(i32 %361)
store double* %362, double** %38
%363 = load double*, double** %41
%364 = load double*, double** %42
%365 = load i32, i32* %20
%366 = load i32, i32* %19
%367 = load i32, i32* %25
%368 = load double*, double** %38
%369 = load i32, i32* %20
%370 = load i32, i32* %23
%371 = load i32, i32* %25
%372 = load double*, double** %28
%373 = load double*, double** %29
%374 = load i32, i32* %33
%375 = call i32 @dwt3d_line_reverse(double* %363, double* %364, i32 %365, i32 %366, i32 %367, double* %368, i32 %369, i32 %370, i32 %371, double* %372, double* %373, i32 %374)
%376 = load double*, double** %41
%377 = call i32 @free(double* %376)
%378 = load double*, double** %42
%379 = call i32 @free(double* %378)
%380 = load i32, i32* %23
%381 = load i32, i32* %25
%382 = mul nsw i32 %380, %381
%383 = load i32, i32* %20
%384 = mul nsw i32 %382, %383
%385 = sext i32 %384 to i64
%386 = mul i64 %385, 8
%387 = trunc i64 %386 to i32
%388 = call double* @malloc(i32 %387)
store double* %388, double** %35
%389 = load double*, double** %37
%390 = load i32, i32* %20
%391 = load i32, i32* %23
%392 = load i32, i32* %25
%393 = load double*, double** %35
%394 = load i32, i32* %23
%395 = load i32, i32* %20
%396 = load i32, i32* %25
%397 = call i32 @dwt3d_tran(double* %389, i32 %390, i32 %391, i32 %392, double* %393, i32 %394, i32 %395, i32 %396)
%398 = load double*, double** %37
%399 = call i32 @free(double* %398)
%400 = load i32, i32* %23
%401 = load i32, i32* %25
%402 = mul nsw i32 %400, %401
%403 = load i32, i32* %20
%404 = mul nsw i32 %402, %403
%405 = sext i32 %404 to i64
%406 = mul i64 %405, 8
%407 = trunc i64 %406 to i32
%408 = call double* @malloc(i32 %407)
store double* %408, double** %36
%409 = load double*, double** %38
%410 = load i32, i32* %20
%411 = load i32, i32* %23
%412 = load i32, i32* %25
%413 = load double*, double** %36
%414 = load i32, i32* %23
%415 = load i32, i32* %20
%416 = load i32, i32* %25
%417 = call i32 @dwt3d_tran(double* %409, i32 %410, i32 %411, i32 %412, double* %413, i32 %414, i32 %415, i32 %416)
%418 = load double*, double** %38
%419 = call i32 @free(double* %418)
%420 = load i32, i32* %23
%421 = load i32, i32* %25
%422 = mul nsw i32 %420, %421
%423 = load i32, i32* %24
%424 = mul nsw i32 %422, %423
%425 = sext i32 %424 to i64
%426 = mul i64 %425, 8
%427 = trunc i64 %426 to i32
%428 = call double* @malloc(i32 %427)
store double* %428, double** %55
%429 = load double*, double** %35
%430 = load double*, double** %36
%431 = load i32, i32* %23
%432 = load i32, i32* %20
%433 = load i32, i32* %25
%434 = load double*, double** %55
%435 = load i32, i32* %23
%436 = load i32, i32* %24
%437 = load i32, i32* %25
%438 = load double*, double** %30
%439 = load double*, double** %31
%440 = load i32, i32* %34
%441 = call i32 @dwt3d_line_reverse(double* %429, double* %430, i32 %431, i32 %432, i32 %433, double* %434, i32 %435, i32 %436, i32 %437, double* %438, double* %439, i32 %440)
%442 = load double*, double** %35
%443 = call i32 @free(double* %442)
%444 = load double*, double** %36
%445 = call i32 @free(double* %444)
%446 = load double*, double** %55
%447 = load i32, i32* %23
%448 = load i32, i32* %24
%449 = load i32, i32* %25
%450 = load double*, double** %22
%451 = load i32, i32* %24
%452 = load i32, i32* %23
%453 = load i32, i32* %25
%454 = call i32 @dwt3d_tran(double* %446, i32 %447, i32 %448, i32 %449, double* %450, i32 %451, i32 %452, i32 %453)
%455 = load double*, double** %55
%456 = call i32 @free(double* %455)
ret void
}

LLVM IR (-O2):
define void @idwt3(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, i32 %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, i32 %14, i32 %15, i32 %16) {
%18 = mul i32 %2, %1
%19 = shl i32 %18, 3
%20 = mul i32 %19, %3
%21 = tail call double* @malloc(i32 %20)
%22 = tail call double* @malloc(i32 %20)
%23 = tail call double* @malloc(i32 %20)
%24 = tail call double* @malloc(i32 %20)
%25 = tail call double* @malloc(i32 %20)
%26 = tail call double* @malloc(i32 %20)
%27 = tail call double* @malloc(i32 %20)
%28 = tail call double* @malloc(i32 %20)
%29 = tail call i32 @dwt3d_split(double* %0, i32 %2, i32 %1, i32 %3, double* %21, double* %22, double* %23, double* %24, double* %25, double* %26, double* %27, double* %28, i32 %1, i32 %3, i32 %2)
%30 = mul i32 %19, %7
%31 = tail call double* @malloc(i32 %30)
%32 = tail call i32 @dwt3d_line_reverse(double* %21, double* %22, i32 %1, i32 %3, i32 %2, double* %31, i32 %1, i32 %7, i32 %2, double* %8, double* %9, i32 %14)
%33 = tail call i32 @free(double* %21)
%34 = tail call i32 @free(double* %22)
%35 = tail call double* @malloc(i32 %30)
%36 = tail call i32 @dwt3d_line_reverse(double* %23, double* %24, i32 %1, i32 %3, i32 %2, double* %35, i32 %1, i32 %7, i32 %2, double* %8, double* %9, i32 %14)
%37 = tail call i32 @free(double* %23)
%38 = tail call i32 @free(double* %24)
%39 = tail call double* @malloc(i32 %30)
%40 = tail call i32 @dwt3d_line_reverse(double* %25, double* %26, i32 %1, i32 %3, i32 %2, double* %39, i32 %1, i32 %7, i32 %2, double* %8, double* %9, i32 %14)
%41 = tail call i32 @free(double* %25)
%42 = tail call i32 @free(double* %26)
%43 = tail call double* @malloc(i32 %30)
%44 = tail call i32 @dwt3d_line_reverse(double* %27, double* %28, i32 %1, i32 %3, i32 %2, double* %43, i32 %1, i32 %7, i32 %2, double* %8, double* %9, i32 %14)
%45 = tail call i32 @free(double* %27)
%46 = tail call i32 @free(double* %28)
%47 = tail call double* @malloc(i32 %30)
%48 = tail call i32 @dwt3d_tran_z_inv(double* %31, i32 %1, i32 %7, i32 %2, double* %47, i32 %2, i32 %1, i32 %7)
%49 = tail call i32 @free(double* %31)
%50 = tail call double* @malloc(i32 %30)
%51 = tail call i32 @dwt3d_tran_z_inv(double* %35, i32 %1, i32 %7, i32 %2, double* %50, i32 %2, i32 %1, i32 %7)
%52 = tail call i32 @free(double* %35)
%53 = tail call double* @malloc(i32 %30)
%54 = tail call i32 @dwt3d_tran_z_inv(double* %39, i32 %1, i32 %7, i32 %2, double* %53, i32 %2, i32 %1, i32 %7)
%55 = tail call i32 @free(double* %39)
%56 = tail call double* @malloc(i32 %30)
%57 = tail call i32 @dwt3d_tran_z_inv(double* %43, i32 %1, i32 %7, i32 %2, double* %56, i32 %2, i32 %1, i32 %7)
%58 = tail call i32 @free(double* %43)
%59 = mul nsw i32 %7, %5
%60 = shl i32 %2, 3
%61 = mul i32 %60, %59
%62 = tail call double* @malloc(i32 %61)
%63 = tail call i32 @dwt3d_line_reverse(double* %47, double* %50, i32 %2, i32 %1, i32 %7, double* %62, i32 %2, i32 %5, i32 %7, double* %10, double* %11, i32 %15)
%64 = tail call i32 @free(double* %47)
%65 = tail call i32 @free(double* %50)
%66 = tail call double* @malloc(i32 %61)
%67 = tail call i32 @dwt3d_line_reverse(double* %53, double* %56, i32 %2, i32 %1, i32 %7, double* %66, i32 %2, i32 %5, i32 %7, double* %10, double* %11, i32 %15)
%68 = tail call i32 @free(double* %53)
%69 = tail call i32 @free(double* %56)
%70 = tail call double* @malloc(i32 %61)
%71 = tail call i32 @dwt3d_tran(double* %62, i32 %2, i32 %5, i32 %7, double* %70, i32 %5, i32 %2, i32 %7)
%72 = tail call i32 @free(double* %62)
%73 = tail call double* @malloc(i32 %61)
%74 = tail call i32 @dwt3d_tran(double* %66, i32 %2, i32 %5, i32 %7, double* %73, i32 %5, i32 %2, i32 %7)
%75 = tail call i32 @free(double* %66)
%76 = shl i32 %6, 3
%77 = mul i32 %76, %59
%78 = tail call double* @malloc(i32 %77)
%79 = tail call i32 @dwt3d_line_reverse(double* %70, double* %73, i32 %5, i32 %2, i32 %7, double* %78, i32 %5, i32 %6, i32 %7, double* %12, double* %13, i32 %16)
%80 = tail call i32 @free(double* %70)
%81 = tail call i32 @free(double* %73)
%82 = tail call i32 @dwt3d_tran(double* %78, i32 %5, i32 %6, i32 %7, double* %4, i32 %6, i32 %5, i32 %7)
%83 = tail call i32 @free(double* %78)
ret void
}