#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(double *, int, int, int, double *, int, int,
                                int);
void dwt3d_split(double *matIn, int rowIn, int colIn, int sliIn, double *mat1,
                 double *mat2, double *mat3, double *mat4, double *mat5,
                 double *mat6, double *mat7, double *mat8, int rowOut,
                 int colOut, int sliOut) {
  int siz;
  siz = rowIn * colIn * sliIn;
  dwt3d_tran_z(matIn, rowIn, colIn, sliIn, mat1, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz, rowIn, colIn, sliIn, mat2, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 2, rowIn, colIn, sliIn, mat3, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 3, rowIn, colIn, sliIn, mat4, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 4, rowIn, colIn, sliIn, mat5, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 5, rowIn, colIn, sliIn, mat6, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 6, rowIn, colIn, sliIn, mat7, rowIn, colIn, sliIn);
  dwt3d_tran_z(matIn + siz * 7, rowIn, colIn, sliIn, mat8, rowIn, colIn, sliIn);
  return;
}


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

x86 assembly (clang, -O2):
<dwt3d_split>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r12
mov    %edx,%ebx
imul   %esi,%ebx
imul   %ecx,%ebx
mov    %esi,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
movslq %ebx,%r13
lea    (%r12,%r13,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    (%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,1),%eax
movslq %eax,%rbx
lea    (%r12,%rbx,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x40(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,2),%eax
cltq
lea    (%r12,%rax,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x48(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    0x0(,%r13,4),%eax
cltq
lea    (%r12,%rax,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x50(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    0x0(%r13,%r13,4),%eax
cltq
lea    (%r12,%rax,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x58(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    (%rbx,%rbx,2),%eax
cltq
lea    (%r12,%rax,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x60(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x10,%rsp
lea    0x0(,%r13,8),%eax
sub    %r13d,%eax
cltq
lea    (%r12,%rax,8),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    0x68(%rsp),%r8
mov    %ebp,%r9d
push   %r15
push   %r14
call   1030 <dwt3d_tran_z@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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