double determinant(double (*m)[3]) {
  double det = 0.;
  det += (m[0][0]) * (m[1][1]) * (m[2][2]);
  det += (m[0][1]) * (m[1][2]) * (m[2][0]);
  det += (m[0][2]) * (m[1][0]) * (m[2][1]);
  det -= (m[0][2]) * (m[1][1]) * (m[2][0]);
  det -= (m[0][0]) * (m[1][2]) * (m[2][1]);
  det -= (m[0][1]) * (m[1][0]) * (m[2][2]);
  return det;
}


x86 assembly (clang, -O0):
<determinant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
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):
<determinant>:
movsd  0x20(%rdi),%xmm2
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm8
movsd  0x28(%rdi),%xmm3
movapd %xmm8,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm0
movsd  0x40(%rdi),%xmm5
mulsd  %xmm5,%xmm0
xorpd  %xmm6,%xmm6
addsd  %xmm0,%xmm6
movsd  0x30(%rdi),%xmm7
mulsd  %xmm7,%xmm4
addsd  %xmm6,%xmm4
movsd  0x10(%rdi),%xmm0
movsd  0x18(%rdi),%xmm6
mulsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm0
movsd  0x38(%rdi),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm7,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm8,%xmm6
mulsd  %xmm5,%xmm6
subsd  %xmm6,%xmm0
ret

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

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