#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_3dMat4Multi14(float *, float **, float *);
int /*<<< orphan*/ Calc_3dMat4TranAxis(float *, float *, float *, float *,
                                       float **);
void Calc_3dTransAxisPntn(float orig[3], float x_axis[3], float y_axis[3],
                          float z_axis[3], int n, float pntni[][3],
                          float pntno[][3]) {
  float change_mat[4][4];
  int loop_cnt;
  float src_point[4];
  float dsp_point[4];
  Calc_3dMat4TranAxis(orig, x_axis, y_axis, z_axis, change_mat);
  for (loop_cnt = 0; loop_cnt < n; loop_cnt++) {
    src_point[0] = pntni[loop_cnt][0];
    src_point[1] = pntni[loop_cnt][1];
    src_point[2] = pntni[loop_cnt][2];
    src_point[3] = 1.0;
    Calc_3dMat4Multi14(src_point, change_mat, dsp_point);
    pntno[loop_cnt][0] = dsp_point[0];
    pntno[loop_cnt][1] = dsp_point[1];
    pntno[loop_cnt][2] = dsp_point[2];
  }
}


x86 assembly (clang, -O0):
<Calc_3dTransAxisPntn>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x70(%rbp),%r8
call   1030 <Calc_3dMat4TranAxis@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    124e <Calc_3dTransAxisPntn+0x12e>
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  0xe32(%rip),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
lea    -0x90(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1040 <Calc_3dMat4Multi14@plt>
movss  -0xa0(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,(%rax)
movss  -0x9c(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,0x4(%rax)
movss  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,0x8(%rax)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1167 <Calc_3dTransAxisPntn+0x47>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_3dTransAxisPntn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%rbx
mov    %r8d,%r14d
lea    0x20(%rsp),%r8
call   1030 <Calc_3dMat4TranAxis@plt>
test   %r14d,%r14d
jle    11db <Calc_3dTransAxisPntn+0xbb>
mov    0xa0(%rsp),%rbp
mov    %r14d,%eax
shl    $0x2,%rax
lea    (%rax,%rax,2),%r13
xor    %r14d,%r14d
lea    0x20(%rsp),%r15
lea    0x10(%rsp),%r12
nopw   0x0(%rax,%rax,1)
movss  (%rbx,%r14,1),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rbx,%r14,1),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x8(%rbx,%r14,1),%xmm0
movss  %xmm0,0x8(%rsp)
movl   $0x3f800000,0xc(%rsp)
3f
mov    %rsp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <Calc_3dMat4Multi14@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x0(%rbp,%r14,1)
movss  0x14(%rsp),%xmm0
movss  %xmm0,0x4(%rbp,%r14,1)
movss  0x18(%rsp),%xmm0
movss  %xmm0,0x8(%rbp,%r14,1)
add    $0xc,%r14
cmp    %r14,%r13
jne    1170 <Calc_3dTransAxisPntn+0x50>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Calc_3dTransAxisPntn(float* %0, float* %1, float* %2, float* %3, i32 %4, [3 x float]* %5, [3 x float]* %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
%13 = alloca [3 x float]*
%14 = alloca [3 x float]*
%15 = alloca [4 x [4 x float]]
%16 = alloca i32
%17 = alloca [4 x float]
%18 = alloca [4 x float]
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store float* %3, float** %11
store i32 %4, i32* %12
store [3 x float]* %5, [3 x float]** %13
store [3 x float]* %6, [3 x float]** %14
%19 = load float*, float** %8
%20 = load float*, float** %9
%21 = load float*, float** %10
%22 = load float*, float** %11
%23 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %15, i64 0, i64 0
%24 = bitcast [4 x float]* %23 to float**
%25 = call i32 @Calc_3dMat4TranAxis(float* %19, float* %20, float* %21, float* %22, float** %24)
store i32 0, i32* %16
br label %26
26: ; preds = %79, %7
%27 = load i32, i32* %16
%28 = load i32, i32* %12
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %82
30: ; preds = %26
%31 = load [3 x float]*, [3 x float]** %13
%32 = load i32, i32* %16
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [3 x float], [3 x float]* %31, i64 %33
%35 = getelementptr inbounds [3 x float], [3 x float]* %34, i64 0, i64 0
%36 = load float, float* %35
%37 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 0
store float %36, float* %37
%38 = load [3 x float]*, [3 x float]** %13
%39 = load i32, i32* %16
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x float], [3 x float]* %38, i64 %40
%42 = getelementptr inbounds [3 x float], [3 x float]* %41, i64 0, i64 1
%43 = load float, float* %42
%44 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 1
store float %43, float* %44
%45 = load [3 x float]*, [3 x float]** %13
%46 = load i32, i32* %16
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [3 x float], [3 x float]* %45, i64 %47
%49 = getelementptr inbounds [3 x float], [3 x float]* %48, i64 0, i64 2
%50 = load float, float* %49
%51 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 2
store float %50, float* %51
%52 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 3
store float 1.000000e+00, float* %52
%53 = getelementptr inbounds [4 x float], [4 x float]* %17, i64 0, i64 0
%54 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %15, i64 0, i64 0
%55 = bitcast [4 x float]* %54 to float**
%56 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 0
%57 = call i32 @Calc_3dMat4Multi14(float* %53, float** %55, float* %56)
%58 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 0
%59 = load float, float* %58
%60 = load [3 x float]*, [3 x float]** %14
%61 = load i32, i32* %16
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [3 x float], [3 x float]* %60, i64 %62
%64 = getelementptr inbounds [3 x float], [3 x float]* %63, i64 0, i64 0
store float %59, float* %64
%65 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 1
%66 = load float, float* %65
%67 = load [3 x float]*, [3 x float]** %14
%68 = load i32, i32* %16
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [3 x float], [3 x float]* %67, i64 %69
%71 = getelementptr inbounds [3 x float], [3 x float]* %70, i64 0, i64 1
store float %66, float* %71
%72 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 2
%73 = load float, float* %72
%74 = load [3 x float]*, [3 x float]** %14
%75 = load i32, i32* %16
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [3 x float], [3 x float]* %74, i64 %76
%78 = getelementptr inbounds [3 x float], [3 x float]* %77, i64 0, i64 2
store float %73, float* %78
br label %79
79: ; preds = %30
%80 = load i32, i32* %16
%81 = add nsw i32 %80, 1
store i32 %81, i32* %16
br label %26
82: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @Calc_3dTransAxisPntn(float* %0, float* %1, float* %2, float* %3, i32 %4, [3 x float]* nocapture %5, [3 x float]* nocapture writeonly %6) {
%8 = alloca [4 x [4 x float]]
%9 = alloca [4 x float]
%10 = alloca [4 x float]
%11 = bitcast [4 x [4 x float]]* %8 to i8*
%12 = bitcast [4 x float]* %9 to i8*
%13 = bitcast [4 x float]* %10 to i8*
%14 = bitcast [4 x [4 x float]]* %8 to float**
%15 = call i32 @Calc_3dMat4TranAxis(float* %0, float* %1, float* %2, float* %3, float** %14)
%16 = icmp sgt i32 %4, 0
br i1 %16, label %17, label %43
17: ; preds = %7
%18 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
%19 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 1
%20 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 2
%21 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 3
%22 = getelementptr inbounds [4 x float], [4 x float]* %10, i64 0, i64 0
%23 = getelementptr inbounds [4 x float], [4 x float]* %10, i64 0, i64 1
%24 = getelementptr inbounds [4 x float], [4 x float]* %10, i64 0, i64 2
%25 = zext i32 %4 to i64
br label %26
26: ; preds = %17, %26
%27 = phi i64 [ 0, %17 ], [ %41, %26 ]
%28 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 %27, i64 0
%29 = load float, float* %28
store float %29, float* %18
%30 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 %27, i64 1
%31 = load float, float* %30
store float %31, float* %19
%32 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 %27, i64 2
%33 = load float, float* %32
store float %33, float* %20
store float 1.000000e+00, float* %21
%34 = call i32 @Calc_3dMat4Multi14(float* %18, float** %14, float* %22)
%35 = load float, float* %22
%36 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 %27, i64 0
store float %35, float* %36
%37 = load float, float* %23
%38 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 %27, i64 1
store float %37, float* %38
%39 = load float, float* %24
%40 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 %27, i64 2
store float %39, float* %40
%41 = add nuw nsw i64 %27, 1
%42 = icmp eq i64 %41, %25
br i1 %42, label %43, label %26
43: ; preds = %26, %7
ret void
}