#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_a(double *matrixInApprox, double *matrixInColDetail,
                  double *matrixInRowDetail, double *matrixInDetail,
                  int matrixInRow, int matrixInCol, double *lowReR,
                  double *hiReR, double *lowReC, double *hiReC, int filterLen,
                  double *matrixOut, int matrixOutRow, int matrixOutCol) {
  int row, col;
  int matrixInRowM, matrixInColM;
  double *matrixOutApproxPre, *matrixOutDetailPre;
  double *matrixOutApproxTemp, *matrixOutDetailTemp;
  double *matrixOutPre;
  matrixInRowM = matrixInRow;
  matrixInColM = matrixInCol;
  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, lowReC,
             hiReC, 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, lowReC, hiReC,
             filterLen, (matrixOutDetailPre + col * matrixOutRow),
             matrixOutRow);
  matrixOutDetailTemp = malloc(matrixOutRow * matrixInColM * sizeof(double));
  matrix_tran(matrixOutDetailPre, matrixInColM, matrixOutRow,
              matrixOutDetailTemp, matrixInColM, matrixOutRow);
  free(matrixOutDetailPre);
  matrixOutPre = malloc(matrixOutRow * matrixOutCol * sizeof(double));
  for (row = 0; row < matrixOutRow; row++)
    idwt_neo((matrixOutApproxTemp + row * matrixInColM),
             (matrixOutDetailTemp + row * matrixInColM), matrixInColM, lowReR,
             hiReR, 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_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
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)
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    0x40(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    0x40(%rbp),%eax
imul   -0x38(%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    -0x38(%rbp),%eax
jge    1235 <idwt2D_neo_a+0xf5>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x34(%rbp),%edx
mov    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    0x30(%rbp),%r9d
mov    -0x40(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x40(%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    11c0 <idwt2D_neo_a+0x80>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    0x40(%rbp),%edx
mov    -0x50(%rbp),%rcx
mov    -0x38(%rbp),%r8d
mov    0x40(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    0x40(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12ed <idwt2D_neo_a+0x1ad>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x34(%rbp),%edx
mov    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    0x30(%rbp),%r9d
mov    -0x48(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x40(%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    1278 <idwt2D_neo_a+0x138>
mov    0x40(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    0x40(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    -0x38(%rbp),%r8d
mov    0x40(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    0x40(%rbp),%eax
imul   0x48(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x40(%rbp),%eax
jge    13bd <idwt2D_neo_a+0x27d>
mov    -0x50(%rbp),%rdi
mov    -0x2c(%rbp),%eax
imul   -0x38(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x58(%rbp),%rsi
mov    -0x2c(%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    0x30(%rbp),%r9d
mov    -0x60(%rbp),%r10
mov    -0x2c(%rbp),%eax
imul   0x48(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    0x48(%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    1348 <idwt2D_neo_a+0x208>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
mov    0x40(%rbp),%esi
mov    0x48(%rbp),%edx
mov    0x38(%rbp),%rcx
mov    0x40(%rbp),%r8d
mov    0x48(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idwt2D_neo_a>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9d,%r15d
mov    %r8d,%r12d
mov    %rcx,0x70(%rsp)
mov    %rdx,0x68(%rsp)
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0x108(%rsp),%eax
mov    %rax,0x38(%rsp)
mov    0x100(%rsp),%r14d
mov    0xf8(%rsp),%rax
mov    %rax,0x88(%rsp)
mov    0xf0(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0xe8(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0xe0(%rsp),%rax
mov    %rax,0x28(%rsp)
mov    0xd8(%rsp),%rax
mov    %rax,0x80(%rsp)
mov    0xd0(%rsp),%rax
mov    %rax,0x78(%rsp)
mov    %r9d,%ebx
imul   %r14d,%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    %rax,0x50(%rsp)
mov    %r12d,0x48(%rsp)
movslq %r12d,%rax
mov    %rax,0x60(%rsp)
movslq %r14d,%rax
mov    %rax,0x18(%rsp)
mov    %r15d,%r12d
mov    %r15d,0xc(%rsp)
test   %r15d,%r15d
jle    128f <idwt2D_neo_a+0x14f>
mov    0x18(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x10(%rsp)
mov    0x60(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x90(%rsp)
mov    %r12,%rbx
mov    0x58(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r13,%rsi
mov    0x48(%rsp),%edx
mov    0x28(%rsp),%rcx
mov    0x40(%rsp),%r8
mov    0x24(%rsp),%r9d
push   %r14
push   %r15
call   1040 <idwt_neo@plt>
add    $0x10,%rsp
add    0x10(%rsp),%r15
mov    0x90(%rsp),%rax
add    %rax,%rbp
add    %rax,%r13
add    $0xffffffffffffffff,%rbx
jne    1250 <idwt2D_neo_a+0x110>
mov    0x58(%rsp),%rbp
mov    %rbp,%rdi
mov    0xc(%rsp),%ebx
mov    %ebx,%esi
mov    %r14d,%edx
mov    0x50(%rsp),%rcx
mov    %ebx,%r8d
mov    %r14d,%r9d
mov    %r14,%r13
call   1060 <matrix_tran@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x34(%rsp),%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %ebx,%ebx
mov    0x70(%rsp),%r15
mov    0x60(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    0x68(%rsp),%rbp
jle    134b <idwt2D_neo_a+0x20b>
shl    $0x3,%rcx
shl    $0x3,%rax
mov    0x10(%rsp),%rbx
mov    %rcx,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %r15,%rsi
mov    0x48(%rsp),%edx
mov    0x28(%rsp),%rcx
mov    0x40(%rsp),%r8
mov    0x24(%rsp),%r9d
push   %r13
push   %rbx
mov    %r12,%r14
mov    %r13,%r12
mov    %rax,%r13
call   1040 <idwt_neo@plt>
mov    0x28(%rsp),%rcx
mov    %r13,%rax
mov    %r12,%r13
mov    %r14,%r12
add    $0x10,%rsp
add    %rcx,%rbx
add    %rax,%rbp
add    %rax,%r15
add    $0xffffffffffffffff,%r12
jne    1300 <idwt2D_neo_a+0x1c0>
mov    0x34(%rsp),%edi
call   1050 <malloc@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
mov    %r13d,%edx
mov    %rax,0x18(%rsp)
mov    %rax,%rcx
mov    %esi,%r8d
mov    %r13d,%r9d
call   1060 <matrix_tran@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13d,%edi
imul   0x38(%rsp),%edi
shl    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %r13,0x28(%rsp)
test   %r13d,%r13d
mov    0x80(%rsp),%r13
mov    0x78(%rsp),%r12
jle    141a <idwt2D_neo_a+0x2da>
movslq 0xc(%rsp),%rax
movslq 0x38(%rsp),%rcx
mov    0x28(%rsp),%r14d
shl    $0x3,%rcx
mov    %rcx,0x40(%rsp)
shl    $0x3,%rax
mov    %rax,0x48(%rsp)
mov    0x18(%rsp),%rbx
mov    0x50(%rsp),%rbp
mov    0x10(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    0xc(%rsp),%edx
mov    %r12,%rcx
mov    %r13,%r8
mov    0x24(%rsp),%r9d
push   0x38(%rsp)
push   %r15
call   1040 <idwt_neo@plt>
add    $0x10,%rsp
add    0x40(%rsp),%r15
mov    0x48(%rsp),%rax
add    %rax,%rbp
add    %rax,%rbx
add    $0xffffffffffffffff,%r14
jne    13e0 <idwt2D_neo_a+0x2a0>
mov    0x50(%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    0x88(%rsp),%rcx
mov    %esi,%r8d
mov    %edx,%r9d
call   1060 <matrix_tran@plt>
mov    %rbx,%rdi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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