double determinant(matrix)
double matrix[3][3];
{
  double d1, d2;
  d1 = matrix[0][0] * matrix[1][1] * matrix[2][2] +
       matrix[0][1] * matrix[1][2] * matrix[2][0] +
       matrix[0][2] * matrix[1][0] * matrix[2][1];
  d2 = matrix[0][2] * matrix[1][1] * matrix[2][0] +
       matrix[0][0] * matrix[1][2] * matrix[2][1] +
       matrix[0][1] * matrix[1][0] * matrix[2][2];
  return (d1 - d2);
}


x86 assembly (clang, -O0):
<determinant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x30(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x38(%rax),%xmm0
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
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant>:
movupd 0x8(%rdi),%xmm0
movupd 0x38(%rdi),%xmm1
movsd  0x20(%rdi),%xmm2
unpcklpd %xmm2,%xmm2
movsd  (%rdi),%xmm3
movapd %xmm0,%xmm4
movsd  %xmm3,%xmm4
mulpd  %xmm2,%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm3,%xmm2
movsd  0x28(%rdi),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movsd  0x30(%rdi),%xmm2
movapd %xmm1,%xmm5
shufpd $0x1,%xmm2,%xmm5
unpcklpd %xmm1,%xmm2
mulpd  %xmm3,%xmm2
mulpd  %xmm4,%xmm5
addpd  %xmm2,%xmm5
movsd  0x18(%rdi),%xmm2
unpcklpd %xmm2,%xmm2
shufpd $0x1,%xmm0,%xmm0
mulpd  %xmm2,%xmm0
mulpd  %xmm1,%xmm0
addpd  %xmm5,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
ret

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

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 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%10 = load double, double* %9
%11 = bitcast double* %6 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%14 = load double, double* %13
%15 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%16 = bitcast double* %15 to <2 x double>*
%17 = load <2 x double>, <2 x double>* %16
%18 = insertelement <2 x double> poison, double %5, i64 0
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
%20 = insertelement <2 x double> %12, double %3, i64 0
%21 = fmul <2 x double> %19, %20
%22 = insertelement <2 x double> %12, double %3, i64 1
%23 = insertelement <2 x double> poison, double %8, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = fmul <2 x double> %22, %24
%26 = insertelement <2 x double> poison, double %10, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> %17, <2 x i32> <i32 0, i32 2>
%28 = fmul <2 x double> %25, %27
%29 = extractelement <2 x double> %17, i64 1
%30 = insertelement <2 x double> poison, double %29, i64 0
%31 = insertelement <2 x double> %30, double %10, i64 1
%32 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %21, <2 x double> %31, <2 x double> %28)
%33 = insertelement <2 x double> poison, double %14, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = fmul <2 x double> %12, %34
%36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %17, <2 x double> %32)
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%39 = fsub <2 x double> %37, %38
%40 = extractelement <2 x double> %39, i64 0
ret double %40
}