#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 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, 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);
  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, 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    $0x80,%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)
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    0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    0x40(%rbp),%eax
imul   -0x3c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    0x40(%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    124b <idwt2D_neo_a+0x10b>
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    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    11d6 <idwt2D_neo_a+0x96>
mov    -0x48(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    0x40(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    0x40(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    0x40(%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    1303 <idwt2D_neo_a+0x1c3>
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    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    0x30(%rbp),%r9d
mov    -0x50(%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    128e <idwt2D_neo_a+0x14e>
mov    0x40(%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    0x40(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    0x40(%rbp),%r9d
call   1060 <matrix_tran@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x3c(%rbp),%eax
shl    $0x1,%eax
add    0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    0x40(%rbp),%eax
imul   0x48(%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    0x40(%rbp),%eax
jge    13e2 <idwt2D_neo_a+0x2a2>
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    0x30(%rbp),%r9d
mov    -0x68(%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    136d <idwt2D_neo_a+0x22d>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%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    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%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 i32
%34 = alloca i8
%35 = alloca double*
%36 = alloca double*
%37 = alloca double*
%38 = alloca double*
%39 = 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
store i8 98, i8* %34
%40 = load i32, i32* %19
store i32 %40, i32* %32
%41 = load i32, i32* %20
store i32 %41, i32* %33
%42 = load i32, i32* %32
%43 = mul nsw i32 2, %42
%44 = load i32, i32* %25
%45 = add nsw i32 %43, %44
%46 = sub nsw i32 %45, 1
store i32 %46, i32* %31
%47 = load i32, i32* %27
%48 = load i32, i32* %33
%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
%54 = load i32, i32* %27
%55 = load i32, i32* %33
%56 = mul nsw i32 %54, %55
%57 = sext i32 %56 to i64
%58 = mul i64 %57, 8
%59 = trunc i64 %58 to i32
%60 = call double* @malloc(i32 %59)
store double* %60, double** %37
store i32 0, i32* %30
br label %61
61: ; preds = %90, %14
%62 = load i32, i32* %30
%63 = load i32, i32* %33
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %93
65: ; preds = %61
%66 = load double*, double** %15
%67 = load i32, i32* %30
%68 = load i32, i32* %32
%69 = mul nsw i32 %67, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %66, i64 %70
%72 = load double*, double** %16
%73 = load i32, i32* %30
%74 = load i32, i32* %32
%75 = mul nsw i32 %73, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %72, i64 %76
%78 = load i32, i32* %32
%79 = load double*, double** %23
%80 = load double*, double** %24
%81 = load i32, i32* %25
%82 = load double*, double** %35
%83 = load i32, i32* %30
%84 = load i32, i32* %27
%85 = mul nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %82, i64 %86
%88 = load i32, i32* %27
%89 = call i32 @idwt_neo(double* %71, double* %77, i32 %78, double* %79, double* %80, i32 %81, double* %87, i32 %88)
br label %90
90: ; preds = %65
%91 = load i32, i32* %30
%92 = add nsw i32 %91, 1
store i32 %92, i32* %30
br label %61
93: ; preds = %61
%94 = load double*, double** %35
%95 = load i32, i32* %33
%96 = load i32, i32* %27
%97 = load double*, double** %37
%98 = load i32, i32* %33
%99 = load i32, i32* %27
%100 = call i32 @matrix_tran(double* %94, i32 %95, i32 %96, double* %97, i32 %98, i32 %99)
%101 = load double*, double** %35
%102 = call i32 @free(double* %101)
%103 = load i32, i32* %27
%104 = load i32, i32* %33
%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** %36
store i32 0, i32* %30
br label %110
110: ; preds = %139, %93
%111 = load i32, i32* %30
%112 = load i32, i32* %33
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %142
114: ; preds = %110
%115 = load double*, double** %17
%116 = load i32, i32* %30
%117 = load i32, i32* %32
%118 = mul nsw i32 %116, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %115, i64 %119
%121 = load double*, double** %18
%122 = load i32, i32* %30
%123 = load i32, i32* %32
%124 = mul nsw i32 %122, %123
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %121, i64 %125
%127 = load i32, i32* %32
%128 = load double*, double** %23
%129 = load double*, double** %24
%130 = load i32, i32* %25
%131 = load double*, double** %36
%132 = load i32, i32* %30
%133 = load i32, i32* %27
%134 = mul nsw i32 %132, %133
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %131, i64 %135
%137 = load i32, i32* %27
%138 = call i32 @idwt_neo(double* %120, double* %126, i32 %127, double* %128, double* %129, i32 %130, double* %136, i32 %137)
br label %139
139: ; preds = %114
%140 = load i32, i32* %30
%141 = add nsw i32 %140, 1
store i32 %141, i32* %30
br label %110
142: ; preds = %110
%143 = load i32, i32* %27
%144 = load i32, i32* %33
%145 = mul nsw i32 %143, %144
%146 = sext i32 %145 to i64
%147 = mul i64 %146, 8
%148 = trunc i64 %147 to i32
%149 = call double* @malloc(i32 %148)
store double* %149, double** %38
%150 = load double*, double** %36
%151 = load i32, i32* %33
%152 = load i32, i32* %27
%153 = load double*, double** %38
%154 = load i32, i32* %33
%155 = load i32, i32* %27
%156 = call i32 @matrix_tran(double* %150, i32 %151, i32 %152, double* %153, i32 %154, i32 %155)
%157 = load double*, double** %36
%158 = call i32 @free(double* %157)
%159 = load i32, i32* %33
%160 = mul nsw i32 2, %159
%161 = load i32, i32* %25
%162 = add nsw i32 %160, %161
%163 = sub nsw i32 %162, 1
store i32 %163, i32* %31
%164 = load i32, i32* %27
%165 = load i32, i32* %28
%166 = mul nsw i32 %164, %165
%167 = sext i32 %166 to i64
%168 = mul i64 %167, 8
%169 = trunc i64 %168 to i32
%170 = call double* @malloc(i32 %169)
store double* %170, double** %39
store i32 0, i32* %29
br label %171
171: ; preds = %200, %142
%172 = load i32, i32* %29
%173 = load i32, i32* %27
%174 = icmp slt i32 %172, %173
br i1 %174, label %175, label %203
175: ; preds = %171
%176 = load double*, double** %37
%177 = load i32, i32* %29
%178 = load i32, i32* %33
%179 = mul nsw i32 %177, %178
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %176, i64 %180
%182 = load double*, double** %38
%183 = load i32, i32* %29
%184 = load i32, i32* %33
%185 = mul nsw i32 %183, %184
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %182, i64 %186
%188 = load i32, i32* %33
%189 = load double*, double** %21
%190 = load double*, double** %22
%191 = load i32, i32* %25
%192 = load double*, double** %39
%193 = load i32, i32* %29
%194 = load i32, i32* %28
%195 = mul nsw i32 %193, %194
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %192, i64 %196
%198 = load i32, i32* %28
%199 = call i32 @idwt_neo(double* %181, double* %187, i32 %188, double* %189, double* %190, i32 %191, double* %197, i32 %198)
br label %200
200: ; preds = %175
%201 = load i32, i32* %29
%202 = add nsw i32 %201, 1
store i32 %202, i32* %29
br label %171
203: ; preds = %171
%204 = load double*, double** %37
%205 = call i32 @free(double* %204)
%206 = load double*, double** %38
%207 = call i32 @free(double* %206)
%208 = load double*, double** %39
%209 = load i32, i32* %27
%210 = load i32, i32* %28
%211 = load double*, double** %26
%212 = load i32, i32* %27
%213 = load i32, i32* %28
%214 = call i32 @matrix_tran(double* %208, i32 %209, i32 %210, double* %211, i32 %212, i32 %213)
%215 = load double*, double** %39
%216 = call i32 @free(double* %215)
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
}