double mat_get_determinant_d3(double a[3][3]) {
  return a[0][0] * (a[1][1] * a[2][2] - a[1][2] * a[2][1]) +
         a[0][1] * (a[1][2] * a[2][0] - a[1][0] * a[2][2]) +
         a[0][2] * (a[1][0] * a[2][1] - a[1][1] * a[2][0]);
}


x86 assembly (clang, -O0):
<mat_get_determinant_d3>:
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  0x28(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm5
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm4
mov    -0x8(%rbp),%rax
mulsd  0x40(%rax),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%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):
<mat_get_determinant_d3>:
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  %xmm2,%xmm3
mulsd  0x8(%rdi),%xmm3
mulsd  (%rdi),%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm1,%xmm4
subsd  %xmm4,%xmm0
mulsd  0x10(%rdi),%xmm0
addsd  %xmm5,%xmm0
ret

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

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