#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*/ VecCrossProd3fv(float *, float *, float *);
float VecLength3fv(float *);
int /*<<< orphan*/ VecSelfScalarDiv3fv(float *, float);
int /*<<< orphan*/ VecSubtract3fv(float *, int const *, int const *);
float VecCcwNormNormalReturnLength3fv(float n[3], const int a[3],
                                      const int b[3], const int c[3]) {
  float ab[3], ac[3];
  VecSubtract3fv(ab, b, a);
  VecSubtract3fv(ac, c, a);
  VecCrossProd3fv(n, ab, ac);
  float l = VecLength3fv(n);
  VecSelfScalarDiv3fv(n, l);
  return l;
}


x86 assembly (clang, -O0):
<VecCcwNormNormalReturnLength3fv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x2c(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <VecSubtract3fv@plt>
lea    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <VecSubtract3fv@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1040 <VecCrossProd3fv@plt>
mov    -0x8(%rbp),%rdi
call   1030 <VecLength3fv@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0x3c(%rbp),%xmm0
call   1050 <VecSelfScalarDiv3fv@plt>
movss  -0x3c(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecCcwNormNormalReturnLength3fv>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x14(%rsp),%r12
mov    %r12,%rdi
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1060 <VecSubtract3fv@plt>
lea    0x8(%rsp),%r13
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <VecSubtract3fv@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <VecCrossProd3fv@plt>
mov    %r15,%rdi
call   1030 <VecLength3fv@plt>
movss  %xmm0,0x4(%rsp)
mov    %r15,%rdi
call   1050 <VecSelfScalarDiv3fv@plt>
movss  0x4(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @VecCcwNormNormalReturnLength3fv(float* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca float*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [3 x float]
%10 = alloca [3 x float]
%11 = alloca float
store float* %0, float** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%13 = load i32*, i32** %7
%14 = load i32*, i32** %6
%15 = call i32 @VecSubtract3fv(float* %12, i32* %13, i32* %14)
%16 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%17 = load i32*, i32** %8
%18 = load i32*, i32** %6
%19 = call i32 @VecSubtract3fv(float* %16, i32* %17, i32* %18)
%20 = load float*, float** %5
%21 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%22 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%23 = call i32 @VecCrossProd3fv(float* %20, float* %21, float* %22)
%24 = load float*, float** %5
%25 = call float @VecLength3fv(float* %24)
store float %25, float* %11
%26 = load float*, float** %5
%27 = load float, float* %11
%28 = call i32 @VecSelfScalarDiv3fv(float* %26, float %27)
%29 = load float, float* %11
ret float %29
}

LLVM IR (-O2):
define float @VecCcwNormNormalReturnLength3fv(float* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca [3 x float]
%6 = alloca [3 x float]
%7 = bitcast [3 x float]* %5 to i8*
%8 = bitcast [3 x float]* %6 to i8*
%9 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%10 = call i32 @VecSubtract3fv(float* %9, i32* %2, i32* %1)
%11 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%12 = call i32 @VecSubtract3fv(float* %11, i32* %3, i32* %1)
%13 = call i32 @VecCrossProd3fv(float* %0, float* %9, float* %11)
%14 = call float @VecLength3fv(float* %0)
%15 = call i32 @VecSelfScalarDiv3fv(float* %0, float %14)
ret float %14
}