#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*/ idwt2D_neo(double *, double *, double *, double *, int, int,
                              double *, double *, int, double *, int, int);
double *malloc(int);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ verbatim_copy(double *, int, double *, int);
int /*<<< orphan*/ wkeep_2D_center(double *, int, int, double *, int, int);
void upcoef2(double *matrixIn, int matrixInRow, int matrixInCol, double *lowRe,
             double *hiRe, int filterLen, double *matrixOut, int matrixOutRow,
             int matrixOutCol, int matrixOutDefaultRow, int matrixOutDefaultCol,
             int step, char *type) {
  double *vo, *matrixOutTemp, *matrixOutPre;
  int matrixOutTempRow, matrixOutTempCol, rowLeng, colLeng, count, count1;
  matrixOutTempRow = 2 * matrixInRow + filterLen - 2;
  matrixOutTempCol = 2 * matrixInCol + filterLen - 2;
  vo = malloc(matrixInRow * matrixInCol * sizeof(double));
  for (count = 0; count < matrixInRow * matrixInCol; count++)
    vo[count] = 0;
  matrixOutTemp =
      malloc(matrixOutDefaultRow * matrixOutDefaultCol * sizeof(double));
  for (count = 0; count < matrixOutDefaultRow * matrixOutDefaultCol; count++)
    matrixOutTemp[count] = 0;
  if (!strcmp(type, "a")) {
    idwt2D_neo(matrixIn, vo, vo, vo, matrixInRow, matrixInCol, lowRe, hiRe,
               filterLen, matrixOutTemp, matrixOutTempRow, matrixOutTempCol);
  }
  if (!strcmp(type, "h")) {
    idwt2D_neo(vo, matrixIn, vo, vo, matrixInRow, matrixInCol, lowRe, hiRe,
               filterLen, matrixOutTemp, matrixOutTempRow, matrixOutTempCol);
  }
  if (!strcmp(type, "v")) {
    idwt2D_neo(vo, vo, matrixIn, vo, matrixInRow, matrixInCol, lowRe, hiRe,
               filterLen, matrixOutTemp, matrixOutTempRow, matrixOutTempCol);
  }
  if (!strcmp(type, "d")) {
    idwt2D_neo(vo, vo, vo, matrixIn, matrixInRow, matrixInCol, lowRe, hiRe,
               filterLen, matrixOutTemp, matrixOutTempRow, matrixOutTempCol);
  }
  free(vo);
  if (step > 1) {
    matrixOutPre =
        malloc(matrixOutDefaultRow * matrixOutDefaultCol * sizeof(double));
    for (count = 0; count < matrixOutDefaultRow * matrixOutDefaultCol; count++)
      matrixOutPre[count] = 0;
    rowLeng = matrixOutTempRow;
    colLeng = matrixOutTempCol;
    for (count = 0; count < step - 1; count++) {
      vo = malloc(rowLeng * colLeng * sizeof(double));
      for (count1 = 0; count1 < rowLeng * colLeng; count1++)
        vo[count1] = 0;
      idwt2D_neo(matrixOutTemp, vo, vo, vo, rowLeng, colLeng, lowRe, hiRe,
                 filterLen, matrixOutPre, rowLeng * 2 + filterLen - 2,
                 colLeng * 2 + filterLen - 2);
      rowLeng = rowLeng * 2 + filterLen - 2;
      colLeng = colLeng * 2 + filterLen - 2;
      verbatim_copy(matrixOutPre, rowLeng * colLeng, matrixOutTemp,
                    rowLeng * colLeng);
      free(vo);
    }
    matrixOutTempRow = rowLeng;
    matrixOutTempCol = colLeng;
    free(matrixOutPre);
  }
  wkeep_2D_center(matrixOutTemp, matrixOutDefaultRow, matrixOutDefaultCol,
                  matrixOut, matrixOutRow, matrixOutCol);
  free(matrixOutTemp);
  return;
}


x86 assembly (clang, -O0):
<upcoef2>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %edx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9d,-0x3c(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
add    -0x3c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
add    -0x3c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x60(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    120a <upcoef2+0xaa>
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    11da <upcoef2+0x7a>
mov    0x28(%rbp),%eax
imul   0x30(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    0x28(%rbp),%ecx
imul   0x30(%rbp),%ecx
cmp    %ecx,%eax
jge    1259 <upcoef2+0xf9>
mov    -0x50(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1229 <upcoef2+0xc9>
mov    0x40(%rbp),%rdi
lea    0xd9c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12c0 <upcoef2+0x160>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x50(%rbp),%r11
mov    -0x5c(%rbp),%r10d
mov    -0x60(%rbp),%eax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1050 <idwt2D_neo@plt>
mov    0x40(%rbp),%rdi
lea    0xd37(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1327 <upcoef2+0x1c7>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x50(%rbp),%r11
mov    -0x5c(%rbp),%r10d
mov    -0x60(%rbp),%eax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1050 <idwt2D_neo@plt>
mov    0x40(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    138e <upcoef2+0x22e>
mov    -0x48(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x50(%rbp),%r11
mov    -0x5c(%rbp),%r10d
mov    -0x60(%rbp),%eax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1050 <idwt2D_neo@plt>
mov    0x40(%rbp),%rdi
lea    0xc6d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13f5 <upcoef2+0x295>
mov    -0x48(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x50(%rbp),%r11
mov    -0x5c(%rbp),%r10d
mov    -0x60(%rbp),%eax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1050 <idwt2D_neo@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x1,0x38(%rbp)
jle    1592 <upcoef2+0x432>
mov    0x28(%rbp),%eax
imul   0x30(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    0x28(%rbp),%ecx
imul   0x30(%rbp),%ecx
cmp    %ecx,%eax
jge    1457 <upcoef2+0x2f7>
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1427 <upcoef2+0x2c7>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    157d <upcoef2+0x41d>
mov    -0x64(%rbp),%eax
imul   -0x68(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
mov    -0x64(%rbp),%ecx
imul   -0x68(%rbp),%ecx
cmp    %ecx,%eax
jge    14ca <upcoef2+0x36a>
mov    -0x48(%rbp),%rax
movslq -0x70(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    149a <upcoef2+0x33a>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x64(%rbp),%r8d
mov    -0x68(%rbp),%r9d
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x3c(%rbp),%ebx
mov    -0x58(%rbp),%r11
mov    -0x64(%rbp),%r10d
shl    $0x1,%r10d
add    -0x3c(%rbp),%r10d
sub    $0x2,%r10d
mov    -0x68(%rbp),%eax
shl    $0x1,%eax
add    -0x3c(%rbp),%eax
sub    $0x2,%eax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1050 <idwt2D_neo@plt>
mov    -0x64(%rbp),%eax
shl    $0x1,%eax
add    -0x3c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x64(%rbp)
mov    -0x68(%rbp),%eax
shl    $0x1,%eax
add    -0x3c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x64(%rbp),%esi
imul   -0x68(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x64(%rbp),%ecx
imul   -0x68(%rbp),%ecx
call   1070 <verbatim_copy@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    146a <upcoef2+0x30a>
mov    -0x64(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
mov    0x28(%rbp),%esi
mov    0x30(%rbp),%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8d
mov    0x20(%rbp),%r9d
call   1080 <wkeep_2D_center@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcoef2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x38(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rdi,0x28(%rsp)
mov    0xd0(%rsp),%r15
mov    0xc8(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0xc0(%rsp),%r14d
mov    0xb8(%rsp),%r12d
mov    0xb0(%rsp),%eax
mov    %eax,0x44(%rsp)
mov    0xa8(%rsp),%eax
mov    %eax,0x50(%rsp)
mov    0xa0(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    %rdx,0x10(%rsp)
mov    %edx,%ebp
mov    %rsi,0x8(%rsp)
imul   %esi,%ebp
lea    0x0(,%rbp,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r13
test   %ebp,%ebp
jle    120a <upcoef2+0x9a>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r14d,0x54(%rsp)
mov    %r14d,%ebx
mov    %r12d,0x4c(%rsp)
imul   %r12d,%ebx
lea    0x0(,%rbx,8),%edi
mov    %edi,0x48(%rsp)
call   1070 <malloc@plt>
mov    %rax,%r12
test   %ebx,%ebx
jle    1242 <upcoef2+0xd2>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,0x58(%rsp)
mov    0x18(%rsp),%rax
mov    0x8(%rsp),%rcx
lea    (%rax,%rcx,2),%r14d
add    $0xfffffffe,%r14d
mov    0x10(%rsp),%rcx
lea    (%rax,%rcx,2),%ebx
add    $0xfffffffe,%ebx
lea    0xd95(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
mov    0x24(%rsp),%ebp
jne    12ad <upcoef2+0x13d>
mov    0x28(%rsp),%rdi
mov    %r13,%rsi
mov    %r13,%rdx
mov    %r13,%rcx
mov    0x8(%rsp),%r8
mov    0x10(%rsp),%r9
push   %rbx
push   %r14
push   %r12
push   0x30(%rsp)
push   0x58(%rsp)
push   0x58(%rsp)
call   1060 <idwt2D_neo@plt>
add    $0x30,%rsp
lea    0xd4e(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12f2 <upcoef2+0x182>
mov    %r13,%rdi
mov    0x28(%rsp),%rsi
mov    %r13,%rdx
mov    %r13,%rcx
mov    0x8(%rsp),%r8
mov    0x10(%rsp),%r9
push   %rbx
push   %r14
push   %r12
push   0x30(%rsp)
push   0x58(%rsp)
push   0x58(%rsp)
call   1060 <idwt2D_neo@plt>
add    $0x30,%rsp
lea    0xd0b(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1337 <upcoef2+0x1c7>
mov    %r13,%rdi
mov    %r13,%rsi
mov    0x28(%rsp),%rdx
mov    %r13,%rcx
mov    0x8(%rsp),%r8
mov    0x10(%rsp),%r9
push   %rbx
push   %r14
push   %r12
push   0x30(%rsp)
push   0x58(%rsp)
push   0x58(%rsp)
call   1060 <idwt2D_neo@plt>
add    $0x30,%rsp
lea    0xcc8(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    137c <upcoef2+0x20c>
mov    %r13,%rdi
mov    %r13,%rsi
mov    %r13,%rdx
mov    0x28(%rsp),%rcx
mov    0x8(%rsp),%r8
mov    0x10(%rsp),%r9
push   %rbx
push   %r14
push   %r12
push   0x30(%rsp)
push   0x58(%rsp)
push   0x58(%rsp)
call   1060 <idwt2D_neo@plt>
add    $0x30,%rsp
mov    %r13,%rdi
call   1030 <free@plt>
cmp    $0x2,%ebp
mov    0x44(%rsp),%r9d
jl     1498 <upcoef2+0x328>
mov    %r12,0x10(%rsp)
mov    0x18(%rsp),%rax
add    $0xfffffffe,%eax
mov    %rax,0x28(%rsp)
mov    0x48(%rsp),%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    0x58(%rsp),%rax
test   %eax,%eax
jle    13c9 <upcoef2+0x259>
mov    %eax,%edx
shl    $0x3,%rdx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r15,0x8(%rsp)
add    $0xffffffff,%ebp
jmp    144e <upcoef2+0x2de>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x28(%rsp),%rax
lea    (%rax,%r14,2),%r13d
lea    (%rax,%rbx,2),%r12d
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r15,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
mov    %ebx,%r9d
push   %r12
push   %r13
mov    0x18(%rsp),%rbx
push   %rbx
push   0x30(%rsp)
push   0x58(%rsp)
push   0x58(%rsp)
call   1060 <idwt2D_neo@plt>
add    $0x30,%rsp
mov    %r12d,%ecx
imul   %r13d,%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %rbp,%rdx
call   1080 <verbatim_copy@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12d,%ebx
mov    %r13d,%r14d
mov    0x24(%rsp),%ebp
add    $0xffffffff,%ebp
je     1484 <upcoef2+0x314>
mov    %ebp,0x24(%rsp)
mov    %ebx,%ebp
imul   %r14d,%ebp
lea    0x0(,%rbp,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r15
test   %ebp,%ebp
jle    13e0 <upcoef2+0x270>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
jmp    13e0 <upcoef2+0x270>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x44(%rsp),%r9d
mov    0x10(%rsp),%r12
mov    %r12,%rdi
mov    0x4c(%rsp),%esi
mov    0x54(%rsp),%edx
mov    0x60(%rsp),%rcx
mov    0x50(%rsp),%r8d
call   1090 <wkeep_2D_center@plt>
mov    %r12,%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"h\00"
@.str.2 = [2 x i8] c"v\00"
@.str.3 = [2 x i8] c"d\00"
define void @upcoef2(double* %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i8* %12) {
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32
%20 = alloca double*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
store double* %0, double** %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store double* %3, double** %17
store double* %4, double** %18
store i32 %5, i32* %19
store double* %6, double** %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i8* %12, i8** %26
%36 = load i32, i32* %15
%37 = mul nsw i32 2, %36
%38 = load i32, i32* %19
%39 = add nsw i32 %37, %38
%40 = sub nsw i32 %39, 2
store i32 %40, i32* %30
%41 = load i32, i32* %16
%42 = mul nsw i32 2, %41
%43 = load i32, i32* %19
%44 = add nsw i32 %42, %43
%45 = sub nsw i32 %44, 2
store i32 %45, i32* %31
%46 = load i32, i32* %15
%47 = load i32, i32* %16
%48 = mul nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = mul i64 %49, 8
%51 = trunc i64 %50 to i32
%52 = call double* @malloc(i32 %51)
store double* %52, double** %27
store i32 0, i32* %34
br label %53
53: ; preds = %64, %13
%54 = load i32, i32* %34
%55 = load i32, i32* %15
%56 = load i32, i32* %16
%57 = mul nsw i32 %55, %56
%58 = icmp slt i32 %54, %57
br i1 %58, label %59, label %67
59: ; preds = %53
%60 = load double*, double** %27
%61 = load i32, i32* %34
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
store double 0.000000e+00, double* %63
br label %64
64: ; preds = %59
%65 = load i32, i32* %34
%66 = add nsw i32 %65, 1
store i32 %66, i32* %34
br label %53
67: ; preds = %53
%68 = load i32, i32* %23
%69 = load i32, i32* %24
%70 = mul nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 8
%73 = trunc i64 %72 to i32
%74 = call double* @malloc(i32 %73)
store double* %74, double** %28
store i32 0, i32* %34
br label %75
75: ; preds = %86, %67
%76 = load i32, i32* %34
%77 = load i32, i32* %23
%78 = load i32, i32* %24
%79 = mul nsw i32 %77, %78
%80 = icmp slt i32 %76, %79
br i1 %80, label %81, label %89
81: ; preds = %75
%82 = load double*, double** %28
%83 = load i32, i32* %34
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
store double 0.000000e+00, double* %85
br label %86
86: ; preds = %81
%87 = load i32, i32* %34
%88 = add nsw i32 %87, 1
store i32 %88, i32* %34
br label %75
89: ; preds = %75
%90 = load i8*, i8** %26
%91 = call i32 @strcmp(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%92 = icmp ne i32 %91, 0
br i1 %92, label %107, label %93
93: ; preds = %89
%94 = load double*, double** %14
%95 = load double*, double** %27
%96 = load double*, double** %27
%97 = load double*, double** %27
%98 = load i32, i32* %15
%99 = load i32, i32* %16
%100 = load double*, double** %17
%101 = load double*, double** %18
%102 = load i32, i32* %19
%103 = load double*, double** %28
%104 = load i32, i32* %30
%105 = load i32, i32* %31
%106 = call i32 @idwt2D_neo(double* %94, double* %95, double* %96, double* %97, i32 %98, i32 %99, double* %100, double* %101, i32 %102, double* %103, i32 %104, i32 %105)
br label %107
107: ; preds = %93, %89
%108 = load i8*, i8** %26
%109 = call i32 @strcmp(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%110 = icmp ne i32 %109, 0
br i1 %110, label %125, label %111
111: ; preds = %107
%112 = load double*, double** %27
%113 = load double*, double** %14
%114 = load double*, double** %27
%115 = load double*, double** %27
%116 = load i32, i32* %15
%117 = load i32, i32* %16
%118 = load double*, double** %17
%119 = load double*, double** %18
%120 = load i32, i32* %19
%121 = load double*, double** %28
%122 = load i32, i32* %30
%123 = load i32, i32* %31
%124 = call i32 @idwt2D_neo(double* %112, double* %113, double* %114, double* %115, i32 %116, i32 %117, double* %118, double* %119, i32 %120, double* %121, i32 %122, i32 %123)
br label %125
125: ; preds = %111, %107
%126 = load i8*, i8** %26
%127 = call i32 @strcmp(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%128 = icmp ne i32 %127, 0
br i1 %128, label %143, label %129
129: ; preds = %125
%130 = load double*, double** %27
%131 = load double*, double** %27
%132 = load double*, double** %14
%133 = load double*, double** %27
%134 = load i32, i32* %15
%135 = load i32, i32* %16
%136 = load double*, double** %17
%137 = load double*, double** %18
%138 = load i32, i32* %19
%139 = load double*, double** %28
%140 = load i32, i32* %30
%141 = load i32, i32* %31
%142 = call i32 @idwt2D_neo(double* %130, double* %131, double* %132, double* %133, i32 %134, i32 %135, double* %136, double* %137, i32 %138, double* %139, i32 %140, i32 %141)
br label %143
143: ; preds = %129, %125
%144 = load i8*, i8** %26
%145 = call i32 @strcmp(i8* %144, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%146 = icmp ne i32 %145, 0
br i1 %146, label %161, label %147
147: ; preds = %143
%148 = load double*, double** %27
%149 = load double*, double** %27
%150 = load double*, double** %27
%151 = load double*, double** %14
%152 = load i32, i32* %15
%153 = load i32, i32* %16
%154 = load double*, double** %17
%155 = load double*, double** %18
%156 = load i32, i32* %19
%157 = load double*, double** %28
%158 = load i32, i32* %30
%159 = load i32, i32* %31
%160 = call i32 @idwt2D_neo(double* %148, double* %149, double* %150, double* %151, i32 %152, i32 %153, double* %154, double* %155, i32 %156, double* %157, i32 %158, i32 %159)
br label %161
161: ; preds = %147, %143
%162 = load double*, double** %27
%163 = call i32 @free(double* %162)
%164 = load i32, i32* %25
%165 = icmp sgt i32 %164, 1
br i1 %165, label %166, label %269
166: ; preds = %161
%167 = load i32, i32* %23
%168 = load i32, i32* %24
%169 = mul nsw i32 %167, %168
%170 = sext i32 %169 to i64
%171 = mul i64 %170, 8
%172 = trunc i64 %171 to i32
%173 = call double* @malloc(i32 %172)
store double* %173, double** %29
store i32 0, i32* %34
br label %174
174: ; preds = %185, %166
%175 = load i32, i32* %34
%176 = load i32, i32* %23
%177 = load i32, i32* %24
%178 = mul nsw i32 %176, %177
%179 = icmp slt i32 %175, %178
br i1 %179, label %180, label %188
180: ; preds = %174
%181 = load double*, double** %29
%182 = load i32, i32* %34
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %181, i64 %183
store double 0.000000e+00, double* %184
br label %185
185: ; preds = %180
%186 = load i32, i32* %34
%187 = add nsw i32 %186, 1
store i32 %187, i32* %34
br label %174
188: ; preds = %174
%189 = load i32, i32* %30
store i32 %189, i32* %32
%190 = load i32, i32* %31
store i32 %190, i32* %33
store i32 0, i32* %34
br label %191
191: ; preds = %261, %188
%192 = load i32, i32* %34
%193 = load i32, i32* %25
%194 = sub nsw i32 %193, 1
%195 = icmp slt i32 %192, %194
br i1 %195, label %196, label %264
196: ; preds = %191
%197 = load i32, i32* %32
%198 = load i32, i32* %33
%199 = mul nsw i32 %197, %198
%200 = sext i32 %199 to i64
%201 = mul i64 %200, 8
%202 = trunc i64 %201 to i32
%203 = call double* @malloc(i32 %202)
store double* %203, double** %27
store i32 0, i32* %35
br label %204
204: ; preds = %215, %196
%205 = load i32, i32* %35
%206 = load i32, i32* %32
%207 = load i32, i32* %33
%208 = mul nsw i32 %206, %207
%209 = icmp slt i32 %205, %208
br i1 %209, label %210, label %218
210: ; preds = %204
%211 = load double*, double** %27
%212 = load i32, i32* %35
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds double, double* %211, i64 %213
store double 0.000000e+00, double* %214
br label %215
215: ; preds = %210
%216 = load i32, i32* %35
%217 = add nsw i32 %216, 1
store i32 %217, i32* %35
br label %204
218: ; preds = %204
%219 = load double*, double** %28
%220 = load double*, double** %27
%221 = load double*, double** %27
%222 = load double*, double** %27
%223 = load i32, i32* %32
%224 = load i32, i32* %33
%225 = load double*, double** %17
%226 = load double*, double** %18
%227 = load i32, i32* %19
%228 = load double*, double** %29
%229 = load i32, i32* %32
%230 = mul nsw i32 %229, 2
%231 = load i32, i32* %19
%232 = add nsw i32 %230, %231
%233 = sub nsw i32 %232, 2
%234 = load i32, i32* %33
%235 = mul nsw i32 %234, 2
%236 = load i32, i32* %19
%237 = add nsw i32 %235, %236
%238 = sub nsw i32 %237, 2
%239 = call i32 @idwt2D_neo(double* %219, double* %220, double* %221, double* %222, i32 %223, i32 %224, double* %225, double* %226, i32 %227, double* %228, i32 %233, i32 %238)
%240 = load i32, i32* %32
%241 = mul nsw i32 %240, 2
%242 = load i32, i32* %19
%243 = add nsw i32 %241, %242
%244 = sub nsw i32 %243, 2
store i32 %244, i32* %32
%245 = load i32, i32* %33
%246 = mul nsw i32 %245, 2
%247 = load i32, i32* %19
%248 = add nsw i32 %246, %247
%249 = sub nsw i32 %248, 2
store i32 %249, i32* %33
%250 = load double*, double** %29
%251 = load i32, i32* %32
%252 = load i32, i32* %33
%253 = mul nsw i32 %251, %252
%254 = load double*, double** %28
%255 = load i32, i32* %32
%256 = load i32, i32* %33
%257 = mul nsw i32 %255, %256
%258 = call i32 @verbatim_copy(double* %250, i32 %253, double* %254, i32 %257)
%259 = load double*, double** %27
%260 = call i32 @free(double* %259)
br label %261
261: ; preds = %218
%262 = load i32, i32* %34
%263 = add nsw i32 %262, 1
store i32 %263, i32* %34
br label %191
264: ; preds = %191
%265 = load i32, i32* %32
store i32 %265, i32* %30
%266 = load i32, i32* %33
store i32 %266, i32* %31
%267 = load double*, double** %29
%268 = call i32 @free(double* %267)
br label %269
269: ; preds = %264, %161
%270 = load double*, double** %28
%271 = load i32, i32* %23
%272 = load i32, i32* %24
%273 = load double*, double** %20
%274 = load i32, i32* %21
%275 = load i32, i32* %22
%276 = call i32 @wkeep_2D_center(double* %270, i32 %271, i32 %272, double* %273, i32 %274, i32 %275)
%277 = load double*, double** %28
%278 = call i32 @free(double* %277)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"h\00"
@.str.2 = [2 x i8] c"v\00"
@.str.3 = [2 x i8] c"d\00"
define void @upcoef2(double* %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i8* nocapture %12) {
%14 = shl nsw i32 %1, 1
%15 = add i32 %5, -2
%16 = add i32 %15, %14
%17 = shl nsw i32 %2, 1
%18 = add i32 %15, %17
%19 = mul nsw i32 %2, %1
%20 = shl i32 %19, 3
%21 = tail call double* @malloc(i32 %20)
%22 = icmp sgt i32 %19, 0
br i1 %22, label %23, label %27
23: ; preds = %13
%24 = bitcast double* %21 to i8*
%25 = zext i32 %19 to i64
%26 = shl nuw nsw i64 %25, 3
br label %27
27: ; preds = %23, %13
%28 = mul nsw i32 %10, %9
%29 = shl i32 %28, 3
%30 = tail call double* @malloc(i32 %29)
%31 = icmp sgt i32 %28, 0
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = bitcast double* %30 to i8*
%34 = zext i32 %28 to i64
%35 = shl nuw nsw i64 %34, 3
br label %36
36: ; preds = %32, %27
%37 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i32 @idwt2D_neo(double* %0, double* %21, double* %21, double* %21, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %30, i32 %16, i32 %18)
br label %41
41: ; preds = %39, %36
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @idwt2D_neo(double* %21, double* %0, double* %21, double* %21, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %30, i32 %16, i32 %18)
br label %46
46: ; preds = %44, %41
%47 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = tail call i32 @idwt2D_neo(double* %21, double* %21, double* %0, double* %21, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %30, i32 %16, i32 %18)
br label %51
51: ; preds = %49, %46
%52 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = tail call i32 @idwt2D_neo(double* %21, double* %21, double* %21, double* %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %30, i32 %16, i32 %18)
br label %56
56: ; preds = %54, %51
%57 = tail call i32 @free(double* %21)
%58 = icmp sgt i32 %11, 1
br i1 %58, label %59, label %92
59: ; preds = %56
%60 = tail call double* @malloc(i32 %29)
br i1 %31, label %61, label %65
61: ; preds = %59
%62 = bitcast double* %60 to i8*
%63 = zext i32 %28 to i64
%64 = shl nuw nsw i64 %63, 3
br label %65
65: ; preds = %59, %61
%66 = add nsw i32 %11, -1
br label %67
67: ; preds = %65, %79
%68 = phi i32 [ 0, %65 ], [ %88, %79 ]
%69 = phi i32 [ %18, %65 ], [ %83, %79 ]
%70 = phi i32 [ %16, %65 ], [ %81, %79 ]
%71 = mul nsw i32 %69, %70
%72 = shl i32 %71, 3
%73 = tail call double* @malloc(i32 %72)
%74 = icmp sgt i32 %71, 0
br i1 %74, label %75, label %79
75: ; preds = %67
%76 = bitcast double* %73 to i8*
%77 = zext i32 %71 to i64
%78 = shl nuw nsw i64 %77, 3
br label %79
79: ; preds = %75, %67
%80 = shl nsw i32 %70, 1
%81 = add i32 %15, %80
%82 = shl nsw i32 %69, 1
%83 = add i32 %15, %82
%84 = tail call i32 @idwt2D_neo(double* %30, double* %73, double* %73, double* %73, i32 %70, i32 %69, double* %3, double* %4, i32 %5, double* %60, i32 %81, i32 %83)
%85 = mul nsw i32 %83, %81
%86 = tail call i32 @verbatim_copy(double* %60, i32 %85, double* %30, i32 %85)
%87 = tail call i32 @free(double* %73)
%88 = add nuw nsw i32 %68, 1
%89 = icmp eq i32 %88, %66
br i1 %89, label %90, label %67
90: ; preds = %79
%91 = tail call i32 @free(double* %60)
br label %92
92: ; preds = %90, %56
%93 = tail call i32 @wkeep_2D_center(double* %30, i32 %9, i32 %10, double* %6, i32 %7, i32 %8)
%94 = tail call i32 @free(double* %30)
ret void
}