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


x86 assembly (clang, -O0):
<determinant3x3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x38(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant3x3>:
movsd  0x20(%rdi),%xmm1
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm3
movsd  0x40(%rdi),%xmm4
movsd  0x28(%rdi),%xmm5
movsd  0x38(%rdi),%xmm6
movapd %xmm5,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm2
mulsd  %xmm6,%xmm0
mulsd  %xmm4,%xmm2
subsd  %xmm0,%xmm2
movsd  0x18(%rdi),%xmm0
movapd %xmm0,%xmm7
mulsd  %xmm3,%xmm7
mulsd  %xmm4,%xmm7
subsd  %xmm7,%xmm2
mulsd  %xmm3,%xmm5
movsd  0x30(%rdi),%xmm3
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
movsd  0x10(%rdi),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm0
ret

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

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