#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*/ matrix_tran(double *, int, int, double *, int, int);
void dwt3d_tran(double *mat3DIn, int row1, int col1, int sli1, double *mat3DOut,
                int row2, int col2, int sli2) {
  int i;
  for (i = 0; i < sli1; i++) {
    matrix_tran(mat3DIn + i * row1 * col1, row1, col1,
                mat3DOut + i * row1 * col1, col1, row1);
  }
  return;
}


x86 assembly (clang, -O0):
<dwt3d_tran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1197 <dwt3d_tran+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
call   1030 <matrix_tran@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    113a <dwt3d_tran+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwt3d_tran>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
jle    1166 <dwt3d_tran+0x56>
mov    %r8,%r15
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%r12
mov    %edx,%eax
imul   %esi,%eax
mov    %eax,0x4(%rsp)
mov    %ecx,%ebp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
movslq %r14d,%r14
lea    (%r12,%r14,8),%rdi
lea    (%r15,%r14,8),%rcx
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r13d,%r8d
mov    %ebx,%r9d
call   1030 <matrix_tran@plt>
add    0x4(%rsp),%r14d
add    $0xffffffffffffffff,%rbp
jne    1140 <dwt3d_tran+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dwt3d_tran(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store double* %0, double** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store double* %4, double** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
store i32 0, i32* %17
br label %18
18: ; preds = %44, %8
%19 = load i32, i32* %17
%20 = load i32, i32* %12
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %47
22: ; preds = %18
%23 = load double*, double** %9
%24 = load i32, i32* %17
%25 = load i32, i32* %10
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %11
%28 = mul nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %23, i64 %29
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = load double*, double** %13
%34 = load i32, i32* %17
%35 = load i32, i32* %10
%36 = mul nsw i32 %34, %35
%37 = load i32, i32* %11
%38 = mul nsw i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %33, i64 %39
%41 = load i32, i32* %11
%42 = load i32, i32* %10
%43 = call i32 @matrix_tran(double* %30, i32 %31, i32 %32, double* %40, i32 %41, i32 %42)
br label %44
44: ; preds = %22
%45 = load i32, i32* %17
%46 = add nsw i32 %45, 1
store i32 %46, i32* %17
br label %18
47: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @dwt3d_tran(double* %0, i32 %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = icmp sgt i32 %3, 0
br i1 %9, label %10, label %23
10: ; preds = %8
%11 = mul i32 %2, %1
%12 = zext i32 %3 to i64
br label %13
13: ; preds = %10, %13
%14 = phi i64 [ 0, %10 ], [ %21, %13 ]
%15 = trunc i64 %14 to i32
%16 = mul i32 %11, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %0, i64 %17
%19 = getelementptr inbounds double, double* %4, i64 %17
%20 = tail call i32 @matrix_tran(double* %18, i32 %1, i32 %2, double* %19, i32 %2, i32 %1)
%21 = add nuw nsw i64 %14, 1
%22 = icmp eq i64 %21, %12
br i1 %22, label %23, label %13
23: ; preds = %13, %8
ret void
}