#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*/ free(double *);
int /*<<< orphan*/ idwt_neo(double *, double *, int, double *, double *, int,
                            double *, int);
double *malloc(int);
int /*<<< orphan*/ matrix_tran(double *, int, int, double *, int, int);
void idwt2D_neo(double *matrixInApprox, double *matrixInColDetail,
                double *matrixInRowDetail, double *matrixInDetail,
                int matrixInRow, int matrixInCol, double *lowRe, double *hiRe,
                int filterLen, double *matrixOut, int matrixOutRow,
                int matrixOutCol) {
  int row, col;
  int filterOutLength;
  int matrixInRowM, matrixInColM;
  char c = 'b';
  double *matrixOutApproxPre, *matrixOutDetailPre;
  double *matrixOutApproxTemp, *matrixOutDetailTemp;
  double *matrixOutPre;
  matrixInRowM = matrixInRow;
  matrixInColM = matrixInCol;
  filterOutLength = 2 * matrixInRowM + filterLen - 1;
  matrixOutApproxPre = malloc(matrixOutRow * matrixInColM * sizeof(double));
  matrixOutApproxTemp = malloc(matrixOutRow * matrixInColM * sizeof(double));
  for (col = 0; col < matrixInColM; col++)
    idwt_neo((matrixInApprox + col * matrixInRowM),
             (matrixInColDetail + col * matrixInRowM), matrixInRowM, lowRe,
             hiRe, filterLen, (matrixOutApproxPre + col * matrixOutRow),
             matrixOutRow);
  matrix_tran(matrixOutApproxPre, matrixInColM, matrixOutRow,
              matrixOutApproxTemp, matrixInColM, matrixOutRow);
  free(matrixOutApproxPre);
  matrixOutDetailPre = malloc(matrixOutRow * matrixInColM * sizeof(double));
  for (col = 0; col < matrixInColM; col++)
    idwt_neo((matrixInRowDetail + col * matrixInRowM),
             (matrixInDetail + col * matrixInRowM), matrixInRowM, lowRe, hiRe,
             filterLen, (matrixOutDetailPre + col * matrixOutRow),
             matrixOutRow);
  matrixOutDetailTemp = malloc(matrixOutRow * matrixInColM * sizeof(double));
  matrix_tran(matrixOutDetailPre, matrixInColM, matrixOutRow,
              matrixOutDetailTemp, matrixInColM, matrixOutRow);
  free(matrixOutDetailPre);
  filterOutLength = 2 * matrixInColM + filterLen - 1;
  matrixOutPre = malloc(matrixOutRow * matrixOutCol * sizeof(double));
  for (row = 0; row < matrixOutRow; row++)
    idwt_neo((matrixOutApproxTemp + row * matrixInColM),
             (matrixOutDetailTemp + row * matrixInColM), matrixInColM, lowRe,
             hiRe, filterLen, (matrixOutPre + row * matrixOutCol),
             matrixOutCol);
  free(matrixOutApproxTemp);
  free(matrixOutDetailTemp);
  matrix_tran(matrixOutPre, matrixOutRow, matrixOutCol, matrixOut, matrixOutRow,
              matrixOutCol);
  free(matrixOutPre);
  return;
}


x86 assembly (clang, -O0):
<idwt2D_neo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movb   $0x62,-0x3d(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
add    0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    0x30(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    0x30(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1243 <idwt2D_neo+0x103>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x38(%rbp),%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8
mov    0x20(%rbp),%r9d
mov    -0x48(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   0x30(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x30(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <idwt_neo@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ce <idwt2D_neo+0x8e>
mov    -0x48(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    0x30(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    0x30(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    0x30(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    12fb <idwt2D_neo+0x1bb>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x38(%rbp),%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8
mov    0x20(%rbp),%r9d
mov    -0x50(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   0x30(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x30(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <idwt_neo@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1286 <idwt2D_neo+0x146>
mov    0x30(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    0x30(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    0x30(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x3c(%rbp),%eax
shl    $0x1,%eax
add    0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    0x30(%rbp),%eax
imul   0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x30(%rbp),%eax
jge    13da <idwt2D_neo+0x29a>
mov    -0x58(%rbp),%rdi
mov    -0x2c(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x60(%rbp),%rsi
mov    -0x2c(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x3c(%rbp),%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8
mov    0x20(%rbp),%r9d
mov    -0x68(%rbp),%r10
mov    -0x2c(%rbp),%eax
imul   0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x38(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <idwt_neo@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1365 <idwt2D_neo+0x225>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
mov    0x30(%rbp),%esi
mov    0x38(%rbp),%edx
mov    0x28(%rbp),%rcx
mov    0x30(%rbp),%r8d
mov    0x38(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idwt2D_neo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9d,%r15d
mov    %r8d,%r12d
mov    %rcx,0x70(%rsp)
mov    %rdx,0x68(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbp
mov    0xe8(%rsp),%eax
mov    %rax,0x38(%rsp)
mov    0xe0(%rsp),%r13d
mov    0xd8(%rsp),%rax
mov    %rax,0x78(%rsp)
mov    0xd0(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0xc8(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0xc0(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    %r9d,%ebx
imul   %r13d,%ebx
shl    $0x3,%ebx
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %ebx,0x34(%rsp)
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %r13,%rbx
mov    %rax,0x40(%rsp)
mov    %r12d,0x28(%rsp)
movslq %r12d,%rax
mov    %rax,0x60(%rsp)
movslq %ebx,%rax
mov    %rax,0x18(%rsp)
mov    %r15d,%r13d
mov    %r15d,0xc(%rsp)
test   %r15d,%r15d
jle    126e <idwt2D_neo+0x12e>
mov    0x18(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x10(%rsp)
mov    0x60(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x80(%rsp)
mov    %r13,%r15
mov    0x58(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    0x28(%rsp),%edx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0x24(%rsp),%r9d
push   %rbx
push   %r12
call   1040 <idwt_neo@plt>
add    $0x10,%rsp
add    0x10(%rsp),%r12
mov    0x80(%rsp),%rax
add    %rax,%rbp
add    %rax,%r14
add    $0xffffffffffffffff,%r15
jne    1230 <idwt2D_neo+0xf0>
mov    0x58(%rsp),%r14
mov    %r14,%rdi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
mov    %ebx,%edx
mov    0x40(%rsp),%rcx
mov    %ebp,%r8d
mov    %ebx,%r9d
mov    %rbx,%r12
call   1060 <matrix_tran@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x34(%rsp),%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %ebp,%ebp
mov    0x70(%rsp),%r14
mov    0x60(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    0x68(%rsp),%rbx
jle    132b <idwt2D_neo+0x1eb>
shl    $0x3,%rcx
shl    $0x3,%rax
mov    0x10(%rsp),%rbp
mov    %rcx,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    0x28(%rsp),%edx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0x24(%rsp),%r9d
push   %r12
push   %rbp
mov    %r13,%r15
mov    %r12,%r13
mov    %rax,%r12
call   1040 <idwt_neo@plt>
mov    0x28(%rsp),%rcx
mov    %r12,%rax
mov    %r13,%r12
mov    %r15,%r13
add    $0x10,%rsp
add    %rcx,%rbp
add    %rax,%rbx
add    %rax,%r14
add    $0xffffffffffffffff,%r13
jne    12e0 <idwt2D_neo+0x1a0>
mov    0x34(%rsp),%edi
call   1050 <malloc@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
mov    %r12d,%edx
mov    %rax,0x18(%rsp)
mov    %rax,%rcx
mov    %esi,%r8d
mov    %r12d,%r9d
call   1060 <matrix_tran@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r12d,%edi
imul   0x38(%rsp),%edi
shl    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %r12,0x28(%rsp)
test   %r12d,%r12d
jle    13e7 <idwt2D_neo+0x2a7>
movslq 0xc(%rsp),%r15
movslq 0x38(%rsp),%r13
mov    0x28(%rsp),%r14d
shl    $0x3,%r13
shl    $0x3,%r15
mov    0x18(%rsp),%rbp
mov    0x40(%rsp),%rbx
mov    0x10(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0xc(%rsp),%edx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0x24(%rsp),%r9d
push   0x38(%rsp)
push   %r12
call   1040 <idwt_neo@plt>
add    $0x10,%rsp
add    %r13,%r12
add    %r15,%rbx
add    %r15,%rbp
add    $0xffffffffffffffff,%r14
jne    13b0 <idwt2D_neo+0x270>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    0x28(%rsp),%rsi
mov    0x38(%rsp),%rdx
mov    0x78(%rsp),%rcx
mov    %esi,%r8d
mov    %edx,%r9d
call   1060 <matrix_tran@plt>
mov    %rbx,%rdi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @idwt2D_neo(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, double* %6, double* %7, i32 %8, double* %9, i32 %10, i32 %11) {
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i8
%31 = alloca double*
%32 = alloca double*
%33 = alloca double*
%34 = alloca double*
%35 = alloca double*
store double* %0, double** %13
store double* %1, double** %14
store double* %2, double** %15
store double* %3, double** %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store double* %6, double** %19
store double* %7, double** %20
store i32 %8, i32* %21
store double* %9, double** %22
store i32 %10, i32* %23
store i32 %11, i32* %24
store i8 98, i8* %30
%36 = load i32, i32* %17
store i32 %36, i32* %28
%37 = load i32, i32* %18
store i32 %37, i32* %29
%38 = load i32, i32* %28
%39 = mul nsw i32 2, %38
%40 = load i32, i32* %21
%41 = add nsw i32 %39, %40
%42 = sub nsw i32 %41, 1
store i32 %42, i32* %27
%43 = load i32, i32* %23
%44 = load i32, i32* %29
%45 = mul nsw i32 %43, %44
%46 = sext i32 %45 to i64
%47 = mul i64 %46, 8
%48 = trunc i64 %47 to i32
%49 = call double* @malloc(i32 %48)
store double* %49, double** %31
%50 = load i32, i32* %23
%51 = load i32, i32* %29
%52 = mul nsw i32 %50, %51
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 8
%55 = trunc i64 %54 to i32
%56 = call double* @malloc(i32 %55)
store double* %56, double** %33
store i32 0, i32* %26
br label %57
57: ; preds = %86, %12
%58 = load i32, i32* %26
%59 = load i32, i32* %29
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %89
61: ; preds = %57
%62 = load double*, double** %13
%63 = load i32, i32* %26
%64 = load i32, i32* %28
%65 = mul nsw i32 %63, %64
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %62, i64 %66
%68 = load double*, double** %14
%69 = load i32, i32* %26
%70 = load i32, i32* %28
%71 = mul nsw i32 %69, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %68, i64 %72
%74 = load i32, i32* %28
%75 = load double*, double** %19
%76 = load double*, double** %20
%77 = load i32, i32* %21
%78 = load double*, double** %31
%79 = load i32, i32* %26
%80 = load i32, i32* %23
%81 = mul nsw i32 %79, %80
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %78, i64 %82
%84 = load i32, i32* %23
%85 = call i32 @idwt_neo(double* %67, double* %73, i32 %74, double* %75, double* %76, i32 %77, double* %83, i32 %84)
br label %86
86: ; preds = %61
%87 = load i32, i32* %26
%88 = add nsw i32 %87, 1
store i32 %88, i32* %26
br label %57
89: ; preds = %57
%90 = load double*, double** %31
%91 = load i32, i32* %29
%92 = load i32, i32* %23
%93 = load double*, double** %33
%94 = load i32, i32* %29
%95 = load i32, i32* %23
%96 = call i32 @matrix_tran(double* %90, i32 %91, i32 %92, double* %93, i32 %94, i32 %95)
%97 = load double*, double** %31
%98 = call i32 @free(double* %97)
%99 = load i32, i32* %23
%100 = load i32, i32* %29
%101 = mul nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = mul i64 %102, 8
%104 = trunc i64 %103 to i32
%105 = call double* @malloc(i32 %104)
store double* %105, double** %32
store i32 0, i32* %26
br label %106
106: ; preds = %135, %89
%107 = load i32, i32* %26
%108 = load i32, i32* %29
%109 = icmp slt i32 %107, %108
br i1 %109, label %110, label %138
110: ; preds = %106
%111 = load double*, double** %15
%112 = load i32, i32* %26
%113 = load i32, i32* %28
%114 = mul nsw i32 %112, %113
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %111, i64 %115
%117 = load double*, double** %16
%118 = load i32, i32* %26
%119 = load i32, i32* %28
%120 = mul nsw i32 %118, %119
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %117, i64 %121
%123 = load i32, i32* %28
%124 = load double*, double** %19
%125 = load double*, double** %20
%126 = load i32, i32* %21
%127 = load double*, double** %32
%128 = load i32, i32* %26
%129 = load i32, i32* %23
%130 = mul nsw i32 %128, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %127, i64 %131
%133 = load i32, i32* %23
%134 = call i32 @idwt_neo(double* %116, double* %122, i32 %123, double* %124, double* %125, i32 %126, double* %132, i32 %133)
br label %135
135: ; preds = %110
%136 = load i32, i32* %26
%137 = add nsw i32 %136, 1
store i32 %137, i32* %26
br label %106
138: ; preds = %106
%139 = load i32, i32* %23
%140 = load i32, i32* %29
%141 = mul nsw i32 %139, %140
%142 = sext i32 %141 to i64
%143 = mul i64 %142, 8
%144 = trunc i64 %143 to i32
%145 = call double* @malloc(i32 %144)
store double* %145, double** %34
%146 = load double*, double** %32
%147 = load i32, i32* %29
%148 = load i32, i32* %23
%149 = load double*, double** %34
%150 = load i32, i32* %29
%151 = load i32, i32* %23
%152 = call i32 @matrix_tran(double* %146, i32 %147, i32 %148, double* %149, i32 %150, i32 %151)
%153 = load double*, double** %32
%154 = call i32 @free(double* %153)
%155 = load i32, i32* %29
%156 = mul nsw i32 2, %155
%157 = load i32, i32* %21
%158 = add nsw i32 %156, %157
%159 = sub nsw i32 %158, 1
store i32 %159, i32* %27
%160 = load i32, i32* %23
%161 = load i32, i32* %24
%162 = mul nsw i32 %160, %161
%163 = sext i32 %162 to i64
%164 = mul i64 %163, 8
%165 = trunc i64 %164 to i32
%166 = call double* @malloc(i32 %165)
store double* %166, double** %35
store i32 0, i32* %25
br label %167
167: ; preds = %196, %138
%168 = load i32, i32* %25
%169 = load i32, i32* %23
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %199
171: ; preds = %167
%172 = load double*, double** %33
%173 = load i32, i32* %25
%174 = load i32, i32* %29
%175 = mul nsw i32 %173, %174
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double, double* %172, i64 %176
%178 = load double*, double** %34
%179 = load i32, i32* %25
%180 = load i32, i32* %29
%181 = mul nsw i32 %179, %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %178, i64 %182
%184 = load i32, i32* %29
%185 = load double*, double** %19
%186 = load double*, double** %20
%187 = load i32, i32* %21
%188 = load double*, double** %35
%189 = load i32, i32* %25
%190 = load i32, i32* %24
%191 = mul nsw i32 %189, %190
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %188, i64 %192
%194 = load i32, i32* %24
%195 = call i32 @idwt_neo(double* %177, double* %183, i32 %184, double* %185, double* %186, i32 %187, double* %193, i32 %194)
br label %196
196: ; preds = %171
%197 = load i32, i32* %25
%198 = add nsw i32 %197, 1
store i32 %198, i32* %25
br label %167
199: ; preds = %167
%200 = load double*, double** %33
%201 = call i32 @free(double* %200)
%202 = load double*, double** %34
%203 = call i32 @free(double* %202)
%204 = load double*, double** %35
%205 = load i32, i32* %23
%206 = load i32, i32* %24
%207 = load double*, double** %22
%208 = load i32, i32* %23
%209 = load i32, i32* %24
%210 = call i32 @matrix_tran(double* %204, i32 %205, i32 %206, double* %207, i32 %208, i32 %209)
%211 = load double*, double** %35
%212 = call i32 @free(double* %211)
ret void
}

LLVM IR (-O2):
define void @idwt2D_neo(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, double* %6, double* %7, i32 %8, double* %9, i32 %10, i32 %11) {
%13 = shl i32 %5, 3
%14 = mul i32 %13, %10
%15 = tail call double* @malloc(i32 %14)
%16 = tail call double* @malloc(i32 %14)
%17 = icmp sgt i32 %5, 0
br i1 %17, label %18, label %32
18: ; preds = %12
%19 = sext i32 %4 to i64
%20 = sext i32 %10 to i64
%21 = zext i32 %5 to i64
br label %22
22: ; preds = %18, %22
%23 = phi i64 [ 0, %18 ], [ %30, %22 ]
%24 = mul nsw i64 %23, %19
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = getelementptr inbounds double, double* %1, i64 %24
%27 = mul nsw i64 %23, %20
%28 = getelementptr inbounds double, double* %15, i64 %27
%29 = tail call i32 @idwt_neo(double* %25, double* %26, i32 %4, double* %6, double* %7, i32 %8, double* %28, i32 %10)
%30 = add nuw nsw i64 %23, 1
%31 = icmp eq i64 %30, %21
br i1 %31, label %32, label %22
32: ; preds = %22, %12
%33 = tail call i32 @matrix_tran(double* %15, i32 %5, i32 %10, double* %16, i32 %5, i32 %10)
%34 = tail call i32 @free(double* %15)
%35 = tail call double* @malloc(i32 %14)
br i1 %17, label %36, label %50
36: ; preds = %32
%37 = sext i32 %4 to i64
%38 = sext i32 %10 to i64
%39 = zext i32 %5 to i64
br label %40
40: ; preds = %36, %40
%41 = phi i64 [ 0, %36 ], [ %48, %40 ]
%42 = mul nsw i64 %41, %37
%43 = getelementptr inbounds double, double* %2, i64 %42
%44 = getelementptr inbounds double, double* %3, i64 %42
%45 = mul nsw i64 %41, %38
%46 = getelementptr inbounds double, double* %35, i64 %45
%47 = tail call i32 @idwt_neo(double* %43, double* %44, i32 %4, double* %6, double* %7, i32 %8, double* %46, i32 %10)
%48 = add nuw nsw i64 %41, 1
%49 = icmp eq i64 %48, %39
br i1 %49, label %50, label %40
50: ; preds = %40, %32
%51 = tail call double* @malloc(i32 %14)
%52 = tail call i32 @matrix_tran(double* %35, i32 %5, i32 %10, double* %51, i32 %5, i32 %10)
%53 = tail call i32 @free(double* %35)
%54 = shl i32 %10, 3
%55 = mul i32 %54, %11
%56 = tail call double* @malloc(i32 %55)
%57 = icmp sgt i32 %10, 0
br i1 %57, label %58, label %72
58: ; preds = %50
%59 = sext i32 %5 to i64
%60 = sext i32 %11 to i64
%61 = zext i32 %10 to i64
br label %62
62: ; preds = %58, %62
%63 = phi i64 [ 0, %58 ], [ %70, %62 ]
%64 = mul nsw i64 %63, %59
%65 = getelementptr inbounds double, double* %16, i64 %64
%66 = getelementptr inbounds double, double* %51, i64 %64
%67 = mul nsw i64 %63, %60
%68 = getelementptr inbounds double, double* %56, i64 %67
%69 = tail call i32 @idwt_neo(double* %65, double* %66, i32 %5, double* %6, double* %7, i32 %8, double* %68, i32 %11)
%70 = add nuw nsw i64 %63, 1
%71 = icmp eq i64 %70, %61
br i1 %71, label %72, label %62
72: ; preds = %62, %50
%73 = tail call i32 @free(double* %16)
%74 = tail call i32 @free(double* %51)
%75 = tail call i32 @matrix_tran(double* %56, i32 %10, i32 %11, double* %9, i32 %10, i32 %11)
%76 = tail call i32 @free(double* %56)
ret void
}