#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*/ p5glove_cross(double *, double *, double *);
int /*<<< orphan*/ p5glove_normal(double *, double *);
void p5glove_plane(const double p1[3], const double p2[3], const double p3[3],
                   double xyz[3]) {
  double v1[3], v2[3];
  v1[0] = p1[0] - p2[0];
  v1[1] = p1[1] - p2[1];
  v1[2] = p1[2] - p2[2];
  v2[0] = p3[0] - p2[0];
  v2[1] = p3[1] - p2[1];
  v2[2] = p3[2] - p2[2];
  p5glove_cross(v1, v2, xyz);
  if (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0)
    xyz[1] = 1.0;
  p5glove_normal(xyz, xyz);
}


x86 assembly (clang, -O0):
<p5glove_plane>:
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    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <p5glove_cross@plt>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1233 <p5glove_plane+0x113>
jp     1233 <p5glove_plane+0x113>
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1233 <p5glove_plane+0x113>
jp     1233 <p5glove_plane+0x113>
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1233 <p5glove_plane+0x113>
jp     1233 <p5glove_plane+0x113>
mov    -0x20(%rbp),%rax
movsd  0xdd2(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <p5glove_normal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p5glove_plane>:
push   %rbx
sub    $0x40,%rsp
mov    %rcx,%rbx
movupd (%rdi),%xmm0
movupd (%rsi),%xmm1
subpd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  0x10(%rsi),%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
movupd (%rdx),%xmm0
subpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rdx),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    %rcx,%rdx
call   1040 <p5glove_cross@plt>
movsd  (%rbx),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    11b6 <p5glove_plane+0x96>
jp     11b6 <p5glove_plane+0x96>
movsd  0x8(%rbx),%xmm1
ucomisd %xmm0,%xmm1
jne    11b6 <p5glove_plane+0x96>
jp     11b6 <p5glove_plane+0x96>
movsd  0x10(%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b6 <p5glove_plane+0x96>
jp     11b6 <p5glove_plane+0x96>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rbx)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <p5glove_normal@plt>
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @p5glove_plane(double* nocapture %0, double* nocapture %1, double* nocapture %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 = bitcast double* %0 to <2 x double>*
%11 = load <2 x double>, <2 x double>* %10
%12 = bitcast double* %1 to <2 x double>*
%13 = load <2 x double>, <2 x double>* %12
%14 = fsub <2 x double> %11, %13
%15 = bitcast [3 x double]* %5 to <2 x double>*
store <2 x double> %14, <2 x double>* %15
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %1, i64 2
%19 = load double, double* %18
%20 = fsub double %17, %19
%21 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double %20, double* %21
%22 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%23 = bitcast double* %2 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = fsub <2 x double> %24, %13
%26 = bitcast [3 x double]* %6 to <2 x double>*
store <2 x double> %25, <2 x double>* %26
%27 = getelementptr inbounds double, double* %2, i64 2
%28 = load double, double* %27
%29 = fsub double %28, %19
%30 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %29, double* %30
%31 = call i32 @p5glove_cross(double* %9, double* %22, double* %3)
%32 = load double, double* %3
%33 = fcmp oeq double %32, 0.000000e+00
br i1 %33, label %34, label %43
34: ; preds = %4
%35 = getelementptr inbounds double, double* %3, i64 1
%36 = load double, double* %35
%37 = fcmp oeq double %36, 0.000000e+00
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = getelementptr inbounds double, double* %3, i64 2
%40 = load double, double* %39
%41 = fcmp oeq double %40, 0.000000e+00
br i1 %41, label %42, label %43
42: ; preds = %38
store double 1.000000e+00, double* %35
br label %43
43: ; preds = %42, %38, %34, %4
%44 = call i32 @p5glove_normal(double* %3, double* %3)
ret void
}