#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 */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ crossprod(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ diff3(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ normalize(int /*<<< orphan*/ *);
void perpnorm(GLdouble p1[3], GLdouble p2[3], GLdouble p3[3], GLdouble n[3]) {
  GLdouble d1[3], d2[3];
  diff3(p2, p1, d1);
  diff3(p2, p3, d2);
  crossprod(d1, d2, n);
  normalize(n);
}


x86 assembly (clang, -O0):
<perpnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1050 <diff3@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <diff3@plt>
lea    -0x2c(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <crossprod@plt>
mov    -0x20(%rbp),%rdi
call   1030 <normalize@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perpnorm>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x14(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rdx
call   1050 <diff3@plt>
lea    0x8(%rsp),%r13
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1050 <diff3@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1040 <crossprod@plt>
mov    %r15,%rdi
call   1030 <normalize@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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