double matrixInverse3by3_double(double *A, double *inverse) {
  inverse[0] = (A[4] * A[8] - A[7] * A[5]);
  inverse[1] = -(A[1] * A[8] - A[7] * A[2]);
  inverse[2] = (A[1] * A[5] - A[4] * A[2]);
  inverse[3] = -(A[3] * A[8] - A[6] * A[5]);
  inverse[4] = (A[0] * A[8] - A[6] * A[2]);
  inverse[5] = -(A[0] * A[5] - A[3] * A[2]);
  inverse[6] = (A[3] * A[7] - A[6] * A[4]);
  inverse[7] = -(A[0] * A[7] - A[6] * A[1]);
  inverse[8] = (A[0] * A[4] - A[3] * A[1]);
  return (A[0] * inverse[0] + A[1] * inverse[3] + A[2] * inverse[6]);
}


x86 assembly (clang, -O0):
<matrixInverse3by3_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixInverse3by3_double>:
movsd  0x20(%rdi),%xmm1
movsd  0x28(%rdi),%xmm0
mulsd  0x38(%rdi),%xmm0
mulsd  0x40(%rdi),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  0x10(%rdi),%xmm2
mulsd  0x38(%rdi),%xmm2
mulsd  0x40(%rdi),%xmm0
subsd  %xmm2,%xmm0
movapd 0xec4(%rip),%xmm3
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x8(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  0x10(%rdi),%xmm2
mulsd  0x20(%rdi),%xmm2
mulsd  0x28(%rdi),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsi)
movsd  0x18(%rdi),%xmm2
movsd  0x28(%rdi),%xmm0
mulsd  0x30(%rdi),%xmm0
mulsd  0x40(%rdi),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x18(%rsi)
movsd  0x10(%rdi),%xmm0
mulsd  0x30(%rdi),%xmm0
movsd  (%rdi),%xmm4
mulsd  0x40(%rdi),%xmm4
subsd  %xmm0,%xmm4
movsd  %xmm4,0x20(%rsi)
movsd  0x10(%rdi),%xmm0
mulsd  0x18(%rdi),%xmm0
movsd  (%rdi),%xmm4
mulsd  0x28(%rdi),%xmm4
subsd  %xmm0,%xmm4
xorpd  %xmm3,%xmm4
movlpd %xmm4,0x28(%rsi)
movsd  0x18(%rdi),%xmm0
movsd  0x20(%rdi),%xmm4
mulsd  0x30(%rdi),%xmm4
mulsd  0x38(%rdi),%xmm0
subsd  %xmm4,%xmm0
movsd  %xmm0,0x30(%rsi)
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
mulsd  0x30(%rdi),%xmm5
mulsd  0x38(%rdi),%xmm4
subsd  %xmm5,%xmm4
xorpd  %xmm3,%xmm4
movlpd %xmm4,0x38(%rsi)
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm4
mulsd  0x18(%rdi),%xmm4
mulsd  0x20(%rdi),%xmm3
subsd  %xmm4,%xmm3
movsd  %xmm3,0x40(%rsi)
mulsd  0x8(%rdi),%xmm2
mulsd  (%rdi),%xmm1
subsd  %xmm2,%xmm1
mulsd  0x10(%rdi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @matrixInverse3by3_double(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 4
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 8
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 7
%13 = load double, double* %12
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 5
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %7, double %10, double %18)
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 0
store double %19, double* %21
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = load double*, double** %3
%26 = getelementptr inbounds double, double* %25, i64 8
%27 = load double, double* %26
%28 = load double*, double** %3
%29 = getelementptr inbounds double, double* %28, i64 7
%30 = load double, double* %29
%31 = load double*, double** %3
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = fmul double %30, %33
%35 = fneg double %34
%36 = call double @llvm.fmuladd.f64(double %24, double %27, double %35)
%37 = fneg double %36
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 1
store double %37, double* %39
%40 = load double*, double** %3
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = load double*, double** %3
%44 = getelementptr inbounds double, double* %43, i64 5
%45 = load double, double* %44
%46 = load double*, double** %3
%47 = getelementptr inbounds double, double* %46, i64 4
%48 = load double, double* %47
%49 = load double*, double** %3
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = fmul double %48, %51
%53 = fneg double %52
%54 = call double @llvm.fmuladd.f64(double %42, double %45, double %53)
%55 = load double*, double** %4
%56 = getelementptr inbounds double, double* %55, i64 2
store double %54, double* %56
%57 = load double*, double** %3
%58 = getelementptr inbounds double, double* %57, i64 3
%59 = load double, double* %58
%60 = load double*, double** %3
%61 = getelementptr inbounds double, double* %60, i64 8
%62 = load double, double* %61
%63 = load double*, double** %3
%64 = getelementptr inbounds double, double* %63, i64 6
%65 = load double, double* %64
%66 = load double*, double** %3
%67 = getelementptr inbounds double, double* %66, i64 5
%68 = load double, double* %67
%69 = fmul double %65, %68
%70 = fneg double %69
%71 = call double @llvm.fmuladd.f64(double %59, double %62, double %70)
%72 = fneg double %71
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 3
store double %72, double* %74
%75 = load double*, double** %3
%76 = getelementptr inbounds double, double* %75, i64 0
%77 = load double, double* %76
%78 = load double*, double** %3
%79 = getelementptr inbounds double, double* %78, i64 8
%80 = load double, double* %79
%81 = load double*, double** %3
%82 = getelementptr inbounds double, double* %81, i64 6
%83 = load double, double* %82
%84 = load double*, double** %3
%85 = getelementptr inbounds double, double* %84, i64 2
%86 = load double, double* %85
%87 = fmul double %83, %86
%88 = fneg double %87
%89 = call double @llvm.fmuladd.f64(double %77, double %80, double %88)
%90 = load double*, double** %4
%91 = getelementptr inbounds double, double* %90, i64 4
store double %89, double* %91
%92 = load double*, double** %3
%93 = getelementptr inbounds double, double* %92, i64 0
%94 = load double, double* %93
%95 = load double*, double** %3
%96 = getelementptr inbounds double, double* %95, i64 5
%97 = load double, double* %96
%98 = load double*, double** %3
%99 = getelementptr inbounds double, double* %98, i64 3
%100 = load double, double* %99
%101 = load double*, double** %3
%102 = getelementptr inbounds double, double* %101, i64 2
%103 = load double, double* %102
%104 = fmul double %100, %103
%105 = fneg double %104
%106 = call double @llvm.fmuladd.f64(double %94, double %97, double %105)
%107 = fneg double %106
%108 = load double*, double** %4
%109 = getelementptr inbounds double, double* %108, i64 5
store double %107, double* %109
%110 = load double*, double** %3
%111 = getelementptr inbounds double, double* %110, i64 3
%112 = load double, double* %111
%113 = load double*, double** %3
%114 = getelementptr inbounds double, double* %113, i64 7
%115 = load double, double* %114
%116 = load double*, double** %3
%117 = getelementptr inbounds double, double* %116, i64 6
%118 = load double, double* %117
%119 = load double*, double** %3
%120 = getelementptr inbounds double, double* %119, i64 4
%121 = load double, double* %120
%122 = fmul double %118, %121
%123 = fneg double %122
%124 = call double @llvm.fmuladd.f64(double %112, double %115, double %123)
%125 = load double*, double** %4
%126 = getelementptr inbounds double, double* %125, i64 6
store double %124, double* %126
%127 = load double*, double** %3
%128 = getelementptr inbounds double, double* %127, i64 0
%129 = load double, double* %128
%130 = load double*, double** %3
%131 = getelementptr inbounds double, double* %130, i64 7
%132 = load double, double* %131
%133 = load double*, double** %3
%134 = getelementptr inbounds double, double* %133, i64 6
%135 = load double, double* %134
%136 = load double*, double** %3
%137 = getelementptr inbounds double, double* %136, i64 1
%138 = load double, double* %137
%139 = fmul double %135, %138
%140 = fneg double %139
%141 = call double @llvm.fmuladd.f64(double %129, double %132, double %140)
%142 = fneg double %141
%143 = load double*, double** %4
%144 = getelementptr inbounds double, double* %143, i64 7
store double %142, double* %144
%145 = load double*, double** %3
%146 = getelementptr inbounds double, double* %145, i64 0
%147 = load double, double* %146
%148 = load double*, double** %3
%149 = getelementptr inbounds double, double* %148, i64 4
%150 = load double, double* %149
%151 = load double*, double** %3
%152 = getelementptr inbounds double, double* %151, i64 3
%153 = load double, double* %152
%154 = load double*, double** %3
%155 = getelementptr inbounds double, double* %154, i64 1
%156 = load double, double* %155
%157 = fmul double %153, %156
%158 = fneg double %157
%159 = call double @llvm.fmuladd.f64(double %147, double %150, double %158)
%160 = load double*, double** %4
%161 = getelementptr inbounds double, double* %160, i64 8
store double %159, double* %161
%162 = load double*, double** %3
%163 = getelementptr inbounds double, double* %162, i64 0
%164 = load double, double* %163
%165 = load double*, double** %4
%166 = getelementptr inbounds double, double* %165, i64 0
%167 = load double, double* %166
%168 = load double*, double** %3
%169 = getelementptr inbounds double, double* %168, i64 1
%170 = load double, double* %169
%171 = load double*, double** %4
%172 = getelementptr inbounds double, double* %171, i64 3
%173 = load double, double* %172
%174 = fmul double %170, %173
%175 = call double @llvm.fmuladd.f64(double %164, double %167, double %174)
%176 = load double*, double** %3
%177 = getelementptr inbounds double, double* %176, i64 2
%178 = load double, double* %177
%179 = load double*, double** %4
%180 = getelementptr inbounds double, double* %179, i64 6
%181 = load double, double* %180
%182 = call double @llvm.fmuladd.f64(double %178, double %181, double %175)
ret double %182
}

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