#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*/ Calc_3dMat4Mov(float, float, float, float **);
int /*<<< orphan*/ Calc_3dMat4Multi44(float **, float **, float **);
int /*<<< orphan*/ Calc_3dMat4RotAxis(float *, float *, float *, float **);
void Calc_3dMat4TranAxisInv(float orig[3], float x_axis[3], float y_axis[3],
                            float z_axis[3], float matA[4][4]) {
  float axis_mat[4][4];
  float mov_mat[4][4];
  float ex_work;
  Calc_3dMat4RotAxis(x_axis, y_axis, z_axis, axis_mat);
  ex_work = axis_mat[0][1];
  axis_mat[0][1] = axis_mat[1][0];
  axis_mat[1][0] = ex_work;
  ex_work = axis_mat[0][2];
  axis_mat[0][2] = axis_mat[2][0];
  axis_mat[2][0] = ex_work;
  ex_work = axis_mat[1][2];
  axis_mat[1][2] = axis_mat[2][1];
  axis_mat[2][1] = ex_work;
  Calc_3dMat4Mov(orig[0], orig[1], orig[2], mov_mat);
  Calc_3dMat4Multi44(axis_mat, mov_mat, matA);
}


x86 assembly (clang, -O0):
<Calc_3dMat4TranAxisInv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x70(%rbp),%rcx
call   1030 <Calc_3dMat4RotAxis@plt>
movss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0xb4(%rbp),%xmm0
ff
movss  %xmm0,-0x60(%rbp)
movss  -0x68(%rbp),%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0xb4(%rbp),%xmm0
ff
movss  %xmm0,-0x50(%rbp)
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0xb4(%rbp),%xmm0
ff
movss  %xmm0,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
lea    -0xb0(%rbp),%rdi
call   1040 <Calc_3dMat4Mov@plt>
lea    -0x70(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1050 <Calc_3dMat4Multi44@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_3dMat4TranAxisInv>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %r8,%r15
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r14,%rcx
call   1030 <Calc_3dMat4RotAxis@plt>
movss  0x10(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
movss  %xmm0,0x4(%rsp)
movss  %xmm1,0x10(%rsp)
movss  0x20(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  %xmm2,0x20(%rsp)
movss  0x18(%rsp),%xmm0
movss  0x24(%rsp),%xmm1
movss  %xmm1,0x18(%rsp)
movss  %xmm0,0x24(%rsp)
movss  (%rbx),%xmm0
movss  0x4(%rbx),%xmm1
movss  0x8(%rbx),%xmm2
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <Calc_3dMat4Mov@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <Calc_3dMat4Multi44@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Calc_3dMat4TranAxisInv(float* %0, float* %1, float* %2, float* %3, [4 x float]* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca [4 x float]*
%11 = alloca [4 x [4 x float]]
%12 = alloca [4 x [4 x float]]
%13 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store [4 x float]* %4, [4 x float]** %10
%14 = load float*, float** %7
%15 = load float*, float** %8
%16 = load float*, float** %9
%17 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%18 = bitcast [4 x float]* %17 to float**
%19 = call i32 @Calc_3dMat4RotAxis(float* %14, float* %15, float* %16, float** %18)
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%21 = getelementptr inbounds [4 x float], [4 x float]* %20, i64 0, i64 1
%22 = load float, float* %21
store float %22, float* %13
%23 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 1
%24 = getelementptr inbounds [4 x float], [4 x float]* %23, i64 0, i64 0
%25 = load float, float* %24
%26 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%27 = getelementptr inbounds [4 x float], [4 x float]* %26, i64 0, i64 1
store float %25, float* %27
%28 = load float, float* %13
%29 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 1
%30 = getelementptr inbounds [4 x float], [4 x float]* %29, i64 0, i64 0
store float %28, float* %30
%31 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%32 = getelementptr inbounds [4 x float], [4 x float]* %31, i64 0, i64 2
%33 = load float, float* %32
store float %33, float* %13
%34 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 2
%35 = getelementptr inbounds [4 x float], [4 x float]* %34, i64 0, i64 0
%36 = load float, float* %35
%37 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%38 = getelementptr inbounds [4 x float], [4 x float]* %37, i64 0, i64 2
store float %36, float* %38
%39 = load float, float* %13
%40 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 2
%41 = getelementptr inbounds [4 x float], [4 x float]* %40, i64 0, i64 0
store float %39, float* %41
%42 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 1
%43 = getelementptr inbounds [4 x float], [4 x float]* %42, i64 0, i64 2
%44 = load float, float* %43
store float %44, float* %13
%45 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 2
%46 = getelementptr inbounds [4 x float], [4 x float]* %45, i64 0, i64 1
%47 = load float, float* %46
%48 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 1
%49 = getelementptr inbounds [4 x float], [4 x float]* %48, i64 0, i64 2
store float %47, float* %49
%50 = load float, float* %13
%51 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 2
%52 = getelementptr inbounds [4 x float], [4 x float]* %51, i64 0, i64 1
store float %50, float* %52
%53 = load float*, float** %6
%54 = getelementptr inbounds float, float* %53, i64 0
%55 = load float, float* %54
%56 = load float*, float** %6
%57 = getelementptr inbounds float, float* %56, i64 1
%58 = load float, float* %57
%59 = load float*, float** %6
%60 = getelementptr inbounds float, float* %59, i64 2
%61 = load float, float* %60
%62 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %12, i64 0, i64 0
%63 = bitcast [4 x float]* %62 to float**
%64 = call i32 @Calc_3dMat4Mov(float %55, float %58, float %61, float** %63)
%65 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %11, i64 0, i64 0
%66 = bitcast [4 x float]* %65 to float**
%67 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %12, i64 0, i64 0
%68 = bitcast [4 x float]* %67 to float**
%69 = load [4 x float]*, [4 x float]** %10
%70 = bitcast [4 x float]* %69 to float**
%71 = call i32 @Calc_3dMat4Multi44(float** %66, float** %68, float** %70)
ret void
}

LLVM IR (-O2):
define void @Calc_3dMat4TranAxisInv(float* nocapture %0, float* %1, float* %2, float* %3, [4 x float]* %4) {
%6 = alloca [4 x [4 x float]]
%7 = alloca [4 x [4 x float]]
%8 = bitcast [4 x [4 x float]]* %6 to i8*
%9 = bitcast [4 x [4 x float]]* %7 to i8*
%10 = bitcast [4 x [4 x float]]* %6 to float**
%11 = call i32 @Calc_3dMat4RotAxis(float* %1, float* %2, float* %3, float** %10)
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 0, i64 1
%13 = load float, float* %12
%14 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 1, i64 0
%15 = load float, float* %14
store float %15, float* %12
store float %13, float* %14
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 0, i64 2
%17 = load float, float* %16
%18 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 2, i64 0
%19 = load float, float* %18
store float %19, float* %16
store float %17, float* %18
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 1, i64 2
%21 = load float, float* %20
%22 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 2, i64 1
%23 = load float, float* %22
store float %23, float* %20
store float %21, float* %22
%24 = load float, float* %0
%25 = getelementptr inbounds float, float* %0, i64 1
%26 = load float, float* %25
%27 = getelementptr inbounds float, float* %0, i64 2
%28 = load float, float* %27
%29 = bitcast [4 x [4 x float]]* %7 to float**
%30 = call i32 @Calc_3dMat4Mov(float %24, float %26, float %28, float** %29)
%31 = bitcast [4 x float]* %4 to float**
%32 = call i32 @Calc_3dMat4Multi44(float** %10, float** %29, float** %31)
ret void
}