double determinant(const double *p, const double *q, const double *r) {
  return p[0] * ((q[1] * r[2]) - (r[1] * q[2])) -
         p[1] * (q[0] * r[2] - r[0] * q[2]) +
         p[2] * (q[0] * r[1] - r[0] * q[1]);
}


x86 assembly (clang, -O0):
<determinant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm5
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm4
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm4
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rdx),%xmm2
movsd  (%rdx),%xmm3
movsd  0x8(%rdx),%xmm4
movsd  0x10(%rsi),%xmm5
movapd %xmm5,%xmm6
mulsd  %xmm4,%xmm6
movapd %xmm1,%xmm7
mulsd  %xmm2,%xmm7
subsd  %xmm6,%xmm7
mulsd  %xmm3,%xmm5
mulsd  %xmm0,%xmm2
subsd  %xmm5,%xmm2
mulsd  0x8(%rdi),%xmm2
mulsd  (%rdi),%xmm7
subsd  %xmm2,%xmm7
mulsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm0
mulsd  0x10(%rdi),%xmm0
addsd  %xmm7,%xmm0
ret

LLVM IR (-O0):
define double @determinant(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 2
%15 = load double, double* %14
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %12, double %15, double %23)
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = load double*, double** %6
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 0
%36 = load double, double* %35
%37 = load double*, double** %5
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = fmul double %36, %39
%41 = fneg double %40
%42 = call double @llvm.fmuladd.f64(double %30, double %33, double %41)
%43 = fmul double %27, %42
%44 = fneg double %43
%45 = call double @llvm.fmuladd.f64(double %9, double %24, double %44)
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 2
%48 = load double, double* %47
%49 = load double*, double** %5
%50 = getelementptr inbounds double, double* %49, i64 0
%51 = load double, double* %50
%52 = load double*, double** %6
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load double, double* %53
%55 = load double*, double** %6
%56 = getelementptr inbounds double, double* %55, i64 0
%57 = load double, double* %56
%58 = load double*, double** %5
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double, double* %59
%61 = fmul double %57, %60
%62 = fneg double %61
%63 = call double @llvm.fmuladd.f64(double %51, double %54, double %62)
%64 = call double @llvm.fmuladd.f64(double %48, double %63, double %45)
ret double %64
}

LLVM IR (-O2):
define double @determinant(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 = getelementptr inbounds double, double* %2, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = fneg double %10
%14 = fmul double %12, %13
%15 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %14)
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = load double, double* %1
%19 = load double, double* %2
%20 = fneg double %19
%21 = fmul double %12, %20
%22 = tail call double @llvm.fmuladd.f64(double %18, double %8, double %21)
%23 = fneg double %17
%24 = fmul double %22, %23
%25 = tail call double @llvm.fmuladd.f64(double %4, double %15, double %24)
%26 = getelementptr inbounds double, double* %0, i64 2
%27 = load double, double* %26
%28 = fmul double %6, %20
%29 = tail call double @llvm.fmuladd.f64(double %18, double %10, double %28)
%30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double %25)
ret double %30
}