double det3x3(double (*m)[3]) {
  double result;
  result = m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) -
           m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +
           m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);
  return result;
}


x86 assembly (clang, -O0):
<det3x3>:
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
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O2):
define double @det3x3([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 1, i64 0
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%20 = load double, double* %19
%21 = fmul double %20, %12
%22 = tail call double @llvm.fmuladd.f64(double %18, double %7, double %21)
%23 = fneg double %16
%24 = fmul double %22, %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 %20, %28
%30 = tail call double @llvm.fmuladd.f64(double %18, double %11, double %29)
%31 = tail call double @llvm.fmuladd.f64(double %27, double %30, double %25)
ret double %31
}