int cross_dot_sign(a, b, c, d, e, f, A, B, C)
double a, b, c, d, e, f, A, B, C;
{
  double P, Q, R, cd;
  P = b * f - e * c;
  Q = d * c - a * f;
  R = a * e - d * b;
  cd = P * A + Q * B + R * C;
  if (cd < 0.0)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cross_dot_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    1227 <cross_dot_sign+0x127>
movl   $0xffffffff,-0x4(%rbp)
jmp    122e <cross_dot_sign+0x12e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross_dot_sign>:
movapd %xmm1,%xmm8
mulsd  %xmm5,%xmm8
mulsd  %xmm0,%xmm5
mulsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm4
subsd  %xmm4,%xmm8
mulsd  %xmm3,%xmm2
subsd  %xmm5,%xmm2
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm7,%xmm2
mulsd  %xmm6,%xmm8
addsd  %xmm2,%xmm8
mulsd  0x8(%rsp),%xmm0
addsd  %xmm8,%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @cross_dot_sign(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store double %0, double* %11
store double %1, double* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store double %7, double* %18
store double %8, double* %19
%24 = load double, double* %12
%25 = load double, double* %16
%26 = load double, double* %15
%27 = load double, double* %13
%28 = fmul double %26, %27
%29 = fneg double %28
%30 = call double @llvm.fmuladd.f64(double %24, double %25, double %29)
store double %30, double* %20
%31 = load double, double* %14
%32 = load double, double* %13
%33 = load double, double* %11
%34 = load double, double* %16
%35 = fmul double %33, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %31, double %32, double %36)
store double %37, double* %21
%38 = load double, double* %11
%39 = load double, double* %15
%40 = load double, double* %14
%41 = load double, double* %12
%42 = fmul double %40, %41
%43 = fneg double %42
%44 = call double @llvm.fmuladd.f64(double %38, double %39, double %43)
store double %44, double* %22
%45 = load double, double* %20
%46 = load double, double* %17
%47 = load double, double* %21
%48 = load double, double* %18
%49 = fmul double %47, %48
%50 = call double @llvm.fmuladd.f64(double %45, double %46, double %49)
%51 = load double, double* %22
%52 = load double, double* %19
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double %50)
store double %53, double* %23
%54 = load double, double* %23
%55 = fcmp olt double %54, 0.000000e+00
br i1 %55, label %56, label %57
56: ; preds = %9
store i32 -1, i32* %10
br label %58
57: ; preds = %9
store i32 1, i32* %10
br label %58
58: ; preds = %57, %56
%59 = load i32, i32* %10
ret i32 %59
}

LLVM IR (-O2):
define i32 @cross_dot_sign(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = fneg double %4
%11 = fmul double %10, %2
%12 = tail call double @llvm.fmuladd.f64(double %1, double %5, double %11)
%13 = fneg double %0
%14 = fmul double %13, %5
%15 = tail call double @llvm.fmuladd.f64(double %3, double %2, double %14)
%16 = fneg double %3
%17 = fmul double %16, %1
%18 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %17)
%19 = fmul double %15, %7
%20 = tail call double @llvm.fmuladd.f64(double %12, double %6, double %19)
%21 = tail call double @llvm.fmuladd.f64(double %18, double %8, double %20)
%22 = fcmp olt double %21, 0.000000e+00
%23 = select i1 %22, i32 -1, i32 1
ret i32 %23
}