#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*/ vec3Cross(double *, double *, double *);
int /*<<< orphan*/ vecSubtract(int, double *, double *, double *);
int /*<<< orphan*/ vecUnit(int, double *, double *);
void meshTrueNormal(double a[], double b[], double c[], double normal[3]) {
  double bMinusA[3], cMinusA[3];
  vecSubtract(3, b, a, bMinusA);
  vecSubtract(3, c, a, cMinusA);
  vec3Cross(bMinusA, cMinusA, normal);
  vecUnit(3, normal, normal);
}


x86 assembly (clang, -O0):
<meshTrueNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x3,%edi
call   1040 <vecSubtract@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x60(%rbp),%rcx
mov    $0x3,%edi
call   1040 <vecSubtract@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <vec3Cross@plt>
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x3,%edi
call   1050 <vecUnit@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meshTrueNormal>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0x20(%rsp),%r12
mov    $0x3,%edi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1040 <vecSubtract@plt>
mov    %rsp,%r13
mov    $0x3,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1040 <vecSubtract@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1030 <vec3Cross@plt>
mov    $0x3,%edi
mov    %r15,%rsi
mov    %r15,%rdx
call   1050 <vecUnit@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @meshTrueNormal(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [3 x double]
%10 = alloca [3 x double]
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %6
%12 = load double*, double** %5
%13 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%14 = call i32 @vecSubtract(i32 3, double* %11, double* %12, double* %13)
%15 = load double*, double** %7
%16 = load double*, double** %5
%17 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%18 = call i32 @vecSubtract(i32 3, double* %15, double* %16, double* %17)
%19 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%20 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%21 = load double*, double** %8
%22 = call i32 @vec3Cross(double* %19, double* %20, double* %21)
%23 = load double*, double** %8
%24 = load double*, double** %8
%25 = call i32 @vecUnit(i32 3, double* %23, double* %24)
ret void
}

LLVM IR (-O2):
define void @meshTrueNormal(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %5 to i8*
%8 = bitcast [3 x double]* %6 to i8*
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%10 = call i32 @vecSubtract(i32 3, double* %1, double* %0, double* %9)
%11 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%12 = call i32 @vecSubtract(i32 3, double* %2, double* %0, double* %11)
%13 = call i32 @vec3Cross(double* %9, double* %11, double* %3)
%14 = call i32 @vecUnit(i32 3, double* %3, double* %3)
ret void
}