double matrix_determinant_3x3d(const double m[9]) {
  return m[0] * (m[4] * m[8] - m[5] * m[7]) -
         m[1] * (m[3] * m[8] - m[5] * m[6]) +
         m[2] * (m[3] * m[7] - m[4] * m[6]);
}


x86 assembly (clang, -O0):
<matrix_determinant_3x3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x38(%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    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm5
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm4
mov    -0x8(%rbp),%rax
mulsd  0x30(%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    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm4
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm3
mov    -0x8(%rbp),%rax
mulsd  0x30(%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):
<matrix_determinant_3x3d>:
movsd  0x18(%rdi),%xmm0
movsd  0x20(%rdi),%xmm1
movsd  0x40(%rdi),%xmm2
movsd  0x28(%rdi),%xmm3
movsd  0x38(%rdi),%xmm4
movapd %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm0
mulsd  %xmm3,%xmm4
subsd  %xmm4,%xmm5
movsd  0x30(%rdi),%xmm4
mulsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
mulsd  0x8(%rdi),%xmm2
mulsd  (%rdi),%xmm5
subsd  %xmm2,%xmm5
mulsd  %xmm1,%xmm4
subsd  %xmm4,%xmm0
mulsd  0x10(%rdi),%xmm0
addsd  %xmm5,%xmm0
ret

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

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