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


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

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

LLVM IR (-O0):
define double @Det3([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 = fmul double %7, %11
%13 = load [3 x double]*, [3 x double]** %2
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 2
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 2
%16 = load double, double* %15
%17 = load [3 x double]*, [3 x double]** %2
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0
%19 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 1
%20 = load double, double* %19
%21 = load [3 x double]*, [3 x double]** %2
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 1
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 2
%24 = load double, double* %23
%25 = fmul double %20, %24
%26 = load [3 x double]*, [3 x double]** %2
%27 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 2
%28 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 0
%29 = load double, double* %28
%30 = fmul double %25, %29
%31 = call double @llvm.fmuladd.f64(double %12, double %16, double %30)
%32 = load [3 x double]*, [3 x double]** %2
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 0
%34 = getelementptr inbounds [3 x double], [3 x double]* %33, i64 0, i64 2
%35 = load double, double* %34
%36 = load [3 x double]*, [3 x double]** %2
%37 = getelementptr inbounds [3 x double], [3 x double]* %36, i64 1
%38 = getelementptr inbounds [3 x double], [3 x double]* %37, i64 0, i64 0
%39 = load double, double* %38
%40 = fmul double %35, %39
%41 = load [3 x double]*, [3 x double]** %2
%42 = getelementptr inbounds [3 x double], [3 x double]* %41, i64 2
%43 = getelementptr inbounds [3 x double], [3 x double]* %42, i64 0, i64 1
%44 = load double, double* %43
%45 = call double @llvm.fmuladd.f64(double %40, double %44, double %31)
%46 = load [3 x double]*, [3 x double]** %2
%47 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 0
%48 = getelementptr inbounds [3 x double], [3 x double]* %47, i64 0, i64 2
%49 = load double, double* %48
%50 = load [3 x double]*, [3 x double]** %2
%51 = getelementptr inbounds [3 x double], [3 x double]* %50, i64 1
%52 = getelementptr inbounds [3 x double], [3 x double]* %51, i64 0, i64 1
%53 = load double, double* %52
%54 = fmul double %49, %53
%55 = load [3 x double]*, [3 x double]** %2
%56 = getelementptr inbounds [3 x double], [3 x double]* %55, i64 2
%57 = getelementptr inbounds [3 x double], [3 x double]* %56, i64 0, i64 0
%58 = load double, double* %57
%59 = fneg double %54
%60 = call double @llvm.fmuladd.f64(double %59, double %58, double %45)
%61 = load [3 x double]*, [3 x double]** %2
%62 = getelementptr inbounds [3 x double], [3 x double]* %61, i64 0
%63 = getelementptr inbounds [3 x double], [3 x double]* %62, i64 0, i64 0
%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 2
%68 = load double, double* %67
%69 = fmul double %64, %68
%70 = load [3 x double]*, [3 x double]** %2
%71 = getelementptr inbounds [3 x double], [3 x double]* %70, i64 2
%72 = getelementptr inbounds [3 x double], [3 x double]* %71, i64 0, i64 1
%73 = load double, double* %72
%74 = fneg double %69
%75 = call double @llvm.fmuladd.f64(double %74, double %73, double %60)
%76 = load [3 x double]*, [3 x double]** %2
%77 = getelementptr inbounds [3 x double], [3 x double]* %76, i64 0
%78 = getelementptr inbounds [3 x double], [3 x double]* %77, i64 0, i64 1
%79 = load double, double* %78
%80 = load [3 x double]*, [3 x double]** %2
%81 = getelementptr inbounds [3 x double], [3 x double]* %80, i64 1
%82 = getelementptr inbounds [3 x double], [3 x double]* %81, i64 0, i64 0
%83 = load double, double* %82
%84 = fmul double %79, %83
%85 = load [3 x double]*, [3 x double]** %2
%86 = getelementptr inbounds [3 x double], [3 x double]* %85, i64 2
%87 = getelementptr inbounds [3 x double], [3 x double]* %86, i64 0, i64 2
%88 = load double, double* %87
%89 = fneg double %84
%90 = call double @llvm.fmuladd.f64(double %89, double %88, double %75)
store double %90, double* %3
%91 = load double, double* %3
ret double %91
}

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