#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 DBL_EPSILON;
int fabs(double);
int stp_test(double r1[3], double r2[3], double r3[3]) {
  double product;
  product = r1[0] * r2[1] * r3[2] + r2[0] * r3[1] * r1[2] +
            r3[0] * r1[1] * r2[2] - r3[0] * r2[1] * r1[2] -
            r1[0] * r3[1] * r2[2] - r2[0] * r1[1] * r3[2];
  if (fabs(product) < 10 * DBL_EPSILON)
    product = 0;
  return product > 0 ? 1 : product < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<stp_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2da5(%rip),%rcx
imul   $0xa,(%rcx),%ecx
cmp    %ecx,%eax
jge    1256 <stp_test+0x146>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1275 <stp_test+0x165>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    128e <stp_test+0x17e>
movsd  -0x20(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stp_test>:
push   %rax
movsd  (%rsi),%xmm8
movsd  0x8(%rsi),%xmm2
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm1
movsd  0x8(%rdx),%xmm3
movapd %xmm8,%xmm5
mulsd  %xmm3,%xmm5
mulsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm4
movsd  0x10(%rdx),%xmm6
movsd  (%rdx),%xmm0
movsd  0x10(%rdi),%xmm7
mulsd  %xmm7,%xmm5
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm0
movsd  0x10(%rsi),%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm7,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm8,%xmm1
mulsd  %xmm6,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
mov    0x2e51(%rip),%rcx
mov    (%rcx),%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
cmp    %ecx,%eax
jl     11af <stp_test+0x9f>
movsd  (%rsp),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomisd %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@DBL_EPSILON = global i32 0
define i32 @stp_test(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fmul double %10, %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %5
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = fmul double %20, %23
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = fmul double %24, %27
%29 = call double @llvm.fmuladd.f64(double %14, double %17, double %28)
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = load double*, double** %4
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = fmul double %32, %35
%37 = load double*, double** %5
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = call double @llvm.fmuladd.f64(double %36, double %39, double %29)
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = load double*, double** %5
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = fmul double %43, %46
%48 = load double*, double** %4
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = fneg double %47
%52 = call double @llvm.fmuladd.f64(double %51, double %50, double %40)
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
%56 = load double*, double** %6
%57 = getelementptr inbounds double, double* %56, i64 1
%58 = load double, double* %57
%59 = fmul double %55, %58
%60 = load double*, double** %5
%61 = getelementptr inbounds double, double* %60, i64 2
%62 = load double, double* %61
%63 = fneg double %59
%64 = call double @llvm.fmuladd.f64(double %63, double %62, double %52)
%65 = load double*, double** %5
%66 = getelementptr inbounds double, double* %65, i64 0
%67 = load double, double* %66
%68 = load double*, double** %4
%69 = getelementptr inbounds double, double* %68, i64 1
%70 = load double, double* %69
%71 = fmul double %67, %70
%72 = load double*, double** %6
%73 = getelementptr inbounds double, double* %72, i64 2
%74 = load double, double* %73
%75 = fneg double %71
%76 = call double @llvm.fmuladd.f64(double %75, double %74, double %64)
store double %76, double* %7
%77 = load double, double* %7
%78 = call i32 @fabs(double %77)
%79 = load i32, i32* @DBL_EPSILON
%80 = mul nsw i32 10, %79
%81 = icmp slt i32 %78, %80
br i1 %81, label %82, label %83
82: ; preds = %3
store double 0.000000e+00, double* %7
br label %83
83: ; preds = %82, %3
%84 = load double, double* %7
%85 = fcmp ogt double %84, 0.000000e+00
br i1 %85, label %86, label %87
86: ; preds = %83
br label %92
87: ; preds = %83
%88 = load double, double* %7
%89 = fcmp olt double %88, 0.000000e+00
%90 = zext i1 %89 to i64
%91 = select i1 %89, i32 -1, i32 0
br label %92
92: ; preds = %87, %86
%93 = phi i32 [ 1, %86 ], [ %91, %87 ]
ret i32 %93
}

LLVM IR (-O2):
@DBL_EPSILON = global i32 0
define i32 @stp_test(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fmul double %4, %6
%8 = getelementptr inbounds double, double* %2, i64 2
%9 = load double, double* %8
%10 = load double, double* %1
%11 = getelementptr inbounds double, double* %2, i64 1
%12 = load double, double* %11
%13 = fmul double %10, %12
%14 = getelementptr inbounds double, double* %0, i64 2
%15 = load double, double* %14
%16 = fmul double %13, %15
%17 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %16)
%18 = load double, double* %2
%19 = getelementptr inbounds double, double* %0, i64 1
%20 = load double, double* %19
%21 = fmul double %18, %20
%22 = getelementptr inbounds double, double* %1, i64 2
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %21, double %23, double %17)
%25 = fneg double %18
%26 = fmul double %6, %25
%27 = tail call double @llvm.fmuladd.f64(double %26, double %15, double %24)
%28 = fneg double %4
%29 = fmul double %12, %28
%30 = tail call double @llvm.fmuladd.f64(double %29, double %23, double %27)
%31 = fneg double %10
%32 = fmul double %20, %31
%33 = tail call double @llvm.fmuladd.f64(double %32, double %9, double %30)
%34 = tail call i32 @fabs(double %33)
%35 = load i32, i32* @DBL_EPSILON
%36 = mul nsw i32 %35, 10
%37 = icmp slt i32 %34, %36
%38 = select i1 %37, double 0.000000e+00, double %33
%39 = fcmp ogt double %38, 0.000000e+00
%40 = fcmp olt double %38, 0.000000e+00
%41 = sext i1 %40 to i32
%42 = select i1 %39, i32 1, i32 %41
ret i32 %42
}