#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*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ vcross(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ vnormalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ vsub(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *);
void findNormal(GLfloat pts[][3], GLfloat normal[3]) {
  GLfloat a[3], b[3];
  vsub(pts[1], pts[0], a);
  vsub(pts[2], pts[0], b);
  vcross(b, a, normal);
  vnormalize(normal);
}


x86 assembly (clang, -O0):
<findNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
mov    -0x8(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <vsub@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1030 <vsub@plt>
lea    -0x28(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <vcross@plt>
mov    -0x10(%rbp),%rdi
call   1040 <vnormalize@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNormal>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xc,%rdi
lea    0xc(%rsp),%r15
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <vsub@plt>
lea    0x18(%rbx),%rdi
mov    %rsp,%r12
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <vsub@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <vcross@plt>
mov    %r14,%rdi
call   1040 <vnormalize@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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