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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ dwt3d_tran_z_inv(double *, int, int, int, double *, int, int,
                                    int);
void dwt3d_combine(double *mat1, double *mat2, double *mat3, double *mat4,
                   double *mat5, double *mat6, double *mat7, double *mat8,
                   int rowIn, int colIn, int sliIn, double *matOut, int rowOut,
                   int colOut, int sliOut) {
  int siz;
  siz = rowOut * colOut * sliOut;
  dwt3d_tran_z_inv(mat1, rowIn, colIn, sliIn, matOut, rowOut, colOut, sliOut);
  dwt3d_tran_z_inv(mat2, rowIn, colIn, sliIn, matOut + siz, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat3, rowIn, colIn, sliIn, matOut + siz * 2, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat4, rowIn, colIn, sliIn, matOut + siz * 3, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat5, rowIn, colIn, sliIn, matOut + siz * 4, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat6, rowIn, colIn, sliIn, matOut + siz * 5, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat7, rowIn, colIn, sliIn, matOut + siz * 6, rowOut, colOut,
                   sliOut);
  dwt3d_tran_z_inv(mat8, rowIn, colIn, sliIn, matOut + siz * 7, rowOut, colOut,
                   sliOut);
  return;
}


x86 assembly (clang, -O0):
<dwt3d_combine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
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    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x40(%rbp),%eax
imul   0x48(%rbp),%eax
imul   0x50(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    -0x10(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    -0x18(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    -0x20(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
imul   $0x3,-0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    -0x28(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
mov    -0x34(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    -0x30(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
imul   $0x5,-0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    0x10(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
imul   $0x6,-0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
mov    0x18(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8
imul   $0x7,-0x34(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x40(%rbp),%r9d
mov    0x48(%rbp),%r10d
mov    0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwt3d_combine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x10(%rsp)
mov    %rdx,(%rsp)
mov    %rsi,%r14
mov    0x70(%rsp),%esi
mov    0x78(%rsp),%edx
mov    0x80(%rsp),%ecx
mov    0xa0(%rsp),%ebx
mov    0x90(%rsp),%r9d
mov    0x98(%rsp),%eax
mov    %eax,%ebp
imul   %r9d,%ebp
imul   %ebx,%ebp
mov    0x88(%rsp),%r8
mov    %esi,%r12d
mov    %r8,%r15
push   %rbx
push   %rax
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
movslq %ebp,%r13
lea    (%r15,%r13,8),%r8
mov    %r14,%rdi
mov    %r12d,%r15d
mov    %r12d,%esi
mov    0x78(%rsp),%r12d
mov    %r12d,%edx
mov    0x80(%rsp),%ebx
mov    %ebx,%ecx
mov    0x90(%rsp),%r9d
mov    0xa0(%rsp),%ebp
push   %rbp
mov    0xa0(%rsp),%r14d
push   %r14
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,1),%eax
cltq
mov    %rax,0x8(%rsp)
mov    0x88(%rsp),%rcx
lea    (%rcx,%rax,8),%r8
mov    (%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    0x90(%rsp),%r9d
mov    %r9d,%ebx
push   %rbp
push   %r14
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,2),%eax
cltq
mov    0x88(%rsp),%r14
lea    (%r14,%rax,8),%r8
mov    0x10(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    0x80(%rsp),%ecx
mov    %ecx,%ebp
mov    %ebx,%r9d
mov    0xa0(%rsp),%ebx
push   %rbx
mov    0xa0(%rsp),%eax
push   %rax
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
lea    0x0(,%r13,4),%eax
cltq
lea    (%r14,%rax,8),%r8
mov    0x18(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    0x90(%rsp),%r9d
push   %rbx
mov    0xa0(%rsp),%eax
push   %rax
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,4),%eax
cltq
lea    (%r14,%rax,8),%r8
mov    0x20(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    0x90(%rsp),%r9d
mov    %r9d,%r14d
push   %rbx
mov    0xa0(%rsp),%ebx
push   %rbx
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%rax
lea    (%rax,%rax,2),%eax
cltq
mov    0x88(%rsp),%rcx
lea    (%rcx,%rax,8),%r8
mov    0x60(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14d,%r9d
mov    0xa0(%rsp),%eax
push   %rax
push   %rbx
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x10,%rsp
lea    0x0(,%r13,8),%eax
sub    %r13d,%eax
cltq
mov    0x88(%rsp),%rcx
lea    (%rcx,%rax,8),%r8
mov    0x68(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14d,%r9d
mov    0xa0(%rsp),%eax
push   %rax
push   %rbx
call   1030 <dwt3d_tran_z_inv@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dwt3d_combine(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, i32 %8, i32 %9, i32 %10, double* %11, i32 %12, i32 %13, i32 %14) {
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca double*
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
store double* %0, double** %16
store double* %1, double** %17
store double* %2, double** %18
store double* %3, double** %19
store double* %4, double** %20
store double* %5, double** %21
store double* %6, double** %22
store double* %7, double** %23
store i32 %8, i32* %24
store i32 %9, i32* %25
store i32 %10, i32* %26
store double* %11, double** %27
store i32 %12, i32* %28
store i32 %13, i32* %29
store i32 %14, i32* %30
%32 = load i32, i32* %28
%33 = load i32, i32* %29
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %30
%36 = mul nsw i32 %34, %35
store i32 %36, i32* %31
%37 = load double*, double** %16
%38 = load i32, i32* %24
%39 = load i32, i32* %25
%40 = load i32, i32* %26
%41 = load double*, double** %27
%42 = load i32, i32* %28
%43 = load i32, i32* %29
%44 = load i32, i32* %30
%45 = call i32 @dwt3d_tran_z_inv(double* %37, i32 %38, i32 %39, i32 %40, double* %41, i32 %42, i32 %43, i32 %44)
%46 = load double*, double** %17
%47 = load i32, i32* %24
%48 = load i32, i32* %25
%49 = load i32, i32* %26
%50 = load double*, double** %27
%51 = load i32, i32* %31
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = load i32, i32* %28
%55 = load i32, i32* %29
%56 = load i32, i32* %30
%57 = call i32 @dwt3d_tran_z_inv(double* %46, i32 %47, i32 %48, i32 %49, double* %53, i32 %54, i32 %55, i32 %56)
%58 = load double*, double** %18
%59 = load i32, i32* %24
%60 = load i32, i32* %25
%61 = load i32, i32* %26
%62 = load double*, double** %27
%63 = load i32, i32* %31
%64 = mul nsw i32 %63, 2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %62, i64 %65
%67 = load i32, i32* %28
%68 = load i32, i32* %29
%69 = load i32, i32* %30
%70 = call i32 @dwt3d_tran_z_inv(double* %58, i32 %59, i32 %60, i32 %61, double* %66, i32 %67, i32 %68, i32 %69)
%71 = load double*, double** %19
%72 = load i32, i32* %24
%73 = load i32, i32* %25
%74 = load i32, i32* %26
%75 = load double*, double** %27
%76 = load i32, i32* %31
%77 = mul nsw i32 %76, 3
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %75, i64 %78
%80 = load i32, i32* %28
%81 = load i32, i32* %29
%82 = load i32, i32* %30
%83 = call i32 @dwt3d_tran_z_inv(double* %71, i32 %72, i32 %73, i32 %74, double* %79, i32 %80, i32 %81, i32 %82)
%84 = load double*, double** %20
%85 = load i32, i32* %24
%86 = load i32, i32* %25
%87 = load i32, i32* %26
%88 = load double*, double** %27
%89 = load i32, i32* %31
%90 = mul nsw i32 %89, 4
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %88, i64 %91
%93 = load i32, i32* %28
%94 = load i32, i32* %29
%95 = load i32, i32* %30
%96 = call i32 @dwt3d_tran_z_inv(double* %84, i32 %85, i32 %86, i32 %87, double* %92, i32 %93, i32 %94, i32 %95)
%97 = load double*, double** %21
%98 = load i32, i32* %24
%99 = load i32, i32* %25
%100 = load i32, i32* %26
%101 = load double*, double** %27
%102 = load i32, i32* %31
%103 = mul nsw i32 %102, 5
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %101, i64 %104
%106 = load i32, i32* %28
%107 = load i32, i32* %29
%108 = load i32, i32* %30
%109 = call i32 @dwt3d_tran_z_inv(double* %97, i32 %98, i32 %99, i32 %100, double* %105, i32 %106, i32 %107, i32 %108)
%110 = load double*, double** %22
%111 = load i32, i32* %24
%112 = load i32, i32* %25
%113 = load i32, i32* %26
%114 = load double*, double** %27
%115 = load i32, i32* %31
%116 = mul nsw i32 %115, 6
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %114, i64 %117
%119 = load i32, i32* %28
%120 = load i32, i32* %29
%121 = load i32, i32* %30
%122 = call i32 @dwt3d_tran_z_inv(double* %110, i32 %111, i32 %112, i32 %113, double* %118, i32 %119, i32 %120, i32 %121)
%123 = load double*, double** %23
%124 = load i32, i32* %24
%125 = load i32, i32* %25
%126 = load i32, i32* %26
%127 = load double*, double** %27
%128 = load i32, i32* %31
%129 = mul nsw i32 %128, 7
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %127, i64 %130
%132 = load i32, i32* %28
%133 = load i32, i32* %29
%134 = load i32, i32* %30
%135 = call i32 @dwt3d_tran_z_inv(double* %123, i32 %124, i32 %125, i32 %126, double* %131, i32 %132, i32 %133, i32 %134)
ret void
}

LLVM IR (-O2):
define void @dwt3d_combine(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, i32 %8, i32 %9, i32 %10, double* %11, i32 %12, i32 %13, i32 %14) {
%16 = mul nsw i32 %13, %12
%17 = mul nsw i32 %16, %14
%18 = tail call i32 @dwt3d_tran_z_inv(double* %0, i32 %8, i32 %9, i32 %10, double* %11, i32 %12, i32 %13, i32 %14)
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds double, double* %11, i64 %19
%21 = tail call i32 @dwt3d_tran_z_inv(double* %1, i32 %8, i32 %9, i32 %10, double* %20, i32 %12, i32 %13, i32 %14)
%22 = shl nsw i32 %17, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %11, i64 %23
%25 = tail call i32 @dwt3d_tran_z_inv(double* %2, i32 %8, i32 %9, i32 %10, double* %24, i32 %12, i32 %13, i32 %14)
%26 = mul nsw i32 %17, 3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %11, i64 %27
%29 = tail call i32 @dwt3d_tran_z_inv(double* %3, i32 %8, i32 %9, i32 %10, double* %28, i32 %12, i32 %13, i32 %14)
%30 = shl nsw i32 %17, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %11, i64 %31
%33 = tail call i32 @dwt3d_tran_z_inv(double* %4, i32 %8, i32 %9, i32 %10, double* %32, i32 %12, i32 %13, i32 %14)
%34 = mul nsw i32 %17, 5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %11, i64 %35
%37 = tail call i32 @dwt3d_tran_z_inv(double* %5, i32 %8, i32 %9, i32 %10, double* %36, i32 %12, i32 %13, i32 %14)
%38 = mul nsw i32 %17, 6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %11, i64 %39
%41 = tail call i32 @dwt3d_tran_z_inv(double* %6, i32 %8, i32 %9, i32 %10, double* %40, i32 %12, i32 %13, i32 %14)
%42 = mul nsw i32 %17, 7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %11, i64 %43
%45 = tail call i32 @dwt3d_tran_z_inv(double* %7, i32 %8, i32 %9, i32 %10, double* %44, i32 %12, i32 %13, i32 %14)
ret void
}