void adjoint(double out[3][3], double in[3][3]) {
  double a1, a2, a3, b1, b2, b3, c1, c2, c3;
  a1 = in[0][0];
  b1 = in[0][1];
  c1 = in[0][2];
  a2 = in[1][0];
  b2 = in[1][1];
  c2 = in[1][2];
  a3 = in[2][0];
  b3 = in[2][1];
  c3 = in[2][2];
  out[0][0] = (b2 * c3 - b3 * c2);
  out[1][0] = -(a2 * c3 - a3 * c2);
  out[2][0] = (a2 * b3 - a3 * b2);
  out[0][1] = -(b1 * c3 - b3 * c1);
  out[1][1] = (a1 * c3 - a3 * c1);
  out[2][1] = -(a1 * b3 - a3 * b1);
  out[0][2] = (b1 * c2 - b2 * c1);
  out[1][2] = -(a1 * c2 - a2 * c1);
  out[2][2] = (a1 * b2 - a2 * b1);
}


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

x86 assembly (clang, -O2):
<adjoint>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm12
movsd  0x10(%rsi),%xmm14
movsd  0x18(%rsi),%xmm9
movsd  0x20(%rsi),%xmm8
movsd  0x28(%rsi),%xmm4
movsd  0x30(%rsi),%xmm15
movsd  0x38(%rsi),%xmm6
movsd  0x40(%rsi),%xmm7
movapd %xmm4,%xmm2
mulsd  %xmm6,%xmm2
movapd %xmm8,%xmm1
mulsd  %xmm7,%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rdi)
movapd %xmm4,%xmm10
mulsd  %xmm15,%xmm10
movapd %xmm14,%xmm11
movapd %xmm14,%xmm13
movapd %xmm14,%xmm1
mulsd  %xmm9,%xmm14
movapd %xmm9,%xmm2
mulsd  %xmm7,%xmm2
subsd  %xmm10,%xmm2
movapd 0xe81(%rip),%xmm10
xorpd  %xmm10,%xmm2
movlpd %xmm2,0x18(%rdi)
movapd %xmm8,%xmm2
mulsd  %xmm15,%xmm2
movapd %xmm12,%xmm3
mulsd  %xmm15,%xmm13
mulsd  %xmm12,%xmm15
movapd %xmm12,%xmm5
mulsd  %xmm9,%xmm12
mulsd  %xmm6,%xmm9
subsd  %xmm2,%xmm9
movsd  %xmm9,0x30(%rdi)
mulsd  %xmm6,%xmm11
mulsd  %xmm7,%xmm3
subsd  %xmm11,%xmm3
xorpd  %xmm10,%xmm3
movlpd %xmm3,0x8(%rdi)
mulsd  %xmm0,%xmm7
subsd  %xmm13,%xmm7
movsd  %xmm7,0x20(%rdi)
mulsd  %xmm0,%xmm6
subsd  %xmm15,%xmm6
xorpd  %xmm10,%xmm6
movlpd %xmm6,0x38(%rdi)
mulsd  %xmm8,%xmm1
mulsd  %xmm4,%xmm5
subsd  %xmm1,%xmm5
movsd  %xmm5,0x10(%rdi)
mulsd  %xmm0,%xmm4
subsd  %xmm14,%xmm4
xorpd  %xmm10,%xmm4
movlpd %xmm4,0x28(%rdi)
mulsd  %xmm8,%xmm0
subsd  %xmm12,%xmm0
movsd  %xmm0,0x40(%rdi)
ret

LLVM IR (-O0):
define void @adjoint([3 x double]* %0, [3 x double]* %1) {
%3 = alloca [3 x double]*
%4 = alloca [3 x double]*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store [3 x double]* %0, [3 x double]** %3
store [3 x double]* %1, [3 x double]** %4
%14 = load [3 x double]*, [3 x double]** %4
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%17 = load double, double* %16
store double %17, double* %5
%18 = load [3 x double]*, [3 x double]** %4
%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
store double %21, double* %8
%22 = load [3 x double]*, [3 x double]** %4
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 2
%25 = load double, double* %24
store double %25, double* %11
%26 = load [3 x double]*, [3 x double]** %4
%27 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 1
%28 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 0
%29 = load double, double* %28
store double %29, double* %6
%30 = load [3 x double]*, [3 x double]** %4
%31 = getelementptr inbounds [3 x double], [3 x double]* %30, i64 1
%32 = getelementptr inbounds [3 x double], [3 x double]* %31, i64 0, i64 1
%33 = load double, double* %32
store double %33, double* %9
%34 = load [3 x double]*, [3 x double]** %4
%35 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 1
%36 = getelementptr inbounds [3 x double], [3 x double]* %35, i64 0, i64 2
%37 = load double, double* %36
store double %37, double* %12
%38 = load [3 x double]*, [3 x double]** %4
%39 = getelementptr inbounds [3 x double], [3 x double]* %38, i64 2
%40 = getelementptr inbounds [3 x double], [3 x double]* %39, i64 0, i64 0
%41 = load double, double* %40
store double %41, double* %7
%42 = load [3 x double]*, [3 x double]** %4
%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
store double %45, double* %10
%46 = load [3 x double]*, [3 x double]** %4
%47 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 2
%48 = getelementptr inbounds [3 x double], [3 x double]* %47, i64 0, i64 2
%49 = load double, double* %48
store double %49, double* %13
%50 = load double, double* %9
%51 = load double, double* %13
%52 = load double, double* %10
%53 = load double, double* %12
%54 = fmul double %52, %53
%55 = fneg double %54
%56 = call double @llvm.fmuladd.f64(double %50, double %51, double %55)
%57 = load [3 x double]*, [3 x double]** %3
%58 = getelementptr inbounds [3 x double], [3 x double]* %57, i64 0
%59 = getelementptr inbounds [3 x double], [3 x double]* %58, i64 0, i64 0
store double %56, double* %59
%60 = load double, double* %6
%61 = load double, double* %13
%62 = load double, double* %7
%63 = load double, double* %12
%64 = fmul double %62, %63
%65 = fneg double %64
%66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
%67 = fneg double %66
%68 = load [3 x double]*, [3 x double]** %3
%69 = getelementptr inbounds [3 x double], [3 x double]* %68, i64 1
%70 = getelementptr inbounds [3 x double], [3 x double]* %69, i64 0, i64 0
store double %67, double* %70
%71 = load double, double* %6
%72 = load double, double* %10
%73 = load double, double* %7
%74 = load double, double* %9
%75 = fmul double %73, %74
%76 = fneg double %75
%77 = call double @llvm.fmuladd.f64(double %71, double %72, double %76)
%78 = load [3 x double]*, [3 x double]** %3
%79 = getelementptr inbounds [3 x double], [3 x double]* %78, i64 2
%80 = getelementptr inbounds [3 x double], [3 x double]* %79, i64 0, i64 0
store double %77, double* %80
%81 = load double, double* %8
%82 = load double, double* %13
%83 = load double, double* %10
%84 = load double, double* %11
%85 = fmul double %83, %84
%86 = fneg double %85
%87 = call double @llvm.fmuladd.f64(double %81, double %82, double %86)
%88 = fneg double %87
%89 = load [3 x double]*, [3 x double]** %3
%90 = getelementptr inbounds [3 x double], [3 x double]* %89, i64 0
%91 = getelementptr inbounds [3 x double], [3 x double]* %90, i64 0, i64 1
store double %88, double* %91
%92 = load double, double* %5
%93 = load double, double* %13
%94 = load double, double* %7
%95 = load double, double* %11
%96 = fmul double %94, %95
%97 = fneg double %96
%98 = call double @llvm.fmuladd.f64(double %92, double %93, double %97)
%99 = load [3 x double]*, [3 x double]** %3
%100 = getelementptr inbounds [3 x double], [3 x double]* %99, i64 1
%101 = getelementptr inbounds [3 x double], [3 x double]* %100, i64 0, i64 1
store double %98, double* %101
%102 = load double, double* %5
%103 = load double, double* %10
%104 = load double, double* %7
%105 = load double, double* %8
%106 = fmul double %104, %105
%107 = fneg double %106
%108 = call double @llvm.fmuladd.f64(double %102, double %103, double %107)
%109 = fneg double %108
%110 = load [3 x double]*, [3 x double]** %3
%111 = getelementptr inbounds [3 x double], [3 x double]* %110, i64 2
%112 = getelementptr inbounds [3 x double], [3 x double]* %111, i64 0, i64 1
store double %109, double* %112
%113 = load double, double* %8
%114 = load double, double* %12
%115 = load double, double* %9
%116 = load double, double* %11
%117 = fmul double %115, %116
%118 = fneg double %117
%119 = call double @llvm.fmuladd.f64(double %113, double %114, double %118)
%120 = load [3 x double]*, [3 x double]** %3
%121 = getelementptr inbounds [3 x double], [3 x double]* %120, i64 0
%122 = getelementptr inbounds [3 x double], [3 x double]* %121, i64 0, i64 2
store double %119, double* %122
%123 = load double, double* %5
%124 = load double, double* %12
%125 = load double, double* %6
%126 = load double, double* %11
%127 = fmul double %125, %126
%128 = fneg double %127
%129 = call double @llvm.fmuladd.f64(double %123, double %124, double %128)
%130 = fneg double %129
%131 = load [3 x double]*, [3 x double]** %3
%132 = getelementptr inbounds [3 x double], [3 x double]* %131, i64 1
%133 = getelementptr inbounds [3 x double], [3 x double]* %132, i64 0, i64 2
store double %130, double* %133
%134 = load double, double* %5
%135 = load double, double* %9
%136 = load double, double* %6
%137 = load double, double* %8
%138 = fmul double %136, %137
%139 = fneg double %138
%140 = call double @llvm.fmuladd.f64(double %134, double %135, double %139)
%141 = load [3 x double]*, [3 x double]** %3
%142 = getelementptr inbounds [3 x double], [3 x double]* %141, i64 2
%143 = getelementptr inbounds [3 x double], [3 x double]* %142, i64 0, i64 2
store double %140, double* %143
ret void
}

LLVM IR (-O2):
define void @adjoint([3 x double]* nocapture writeonly %0, [3 x double]* nocapture %1) {
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = load double, double* %3
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 0
%10 = load double, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 0
%16 = load double, double* %15
%17 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%20 = load double, double* %19
%21 = fneg double %18
%22 = fmul double %14, %21
%23 = tail call double @llvm.fmuladd.f64(double %12, double %20, double %22)
%24 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
store double %23, double* %24
%25 = fneg double %16
%26 = fmul double %14, %25
%27 = tail call double @llvm.fmuladd.f64(double %10, double %20, double %26)
%28 = fneg double %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
store double %28, double* %29
%30 = fmul double %12, %25
%31 = tail call double @llvm.fmuladd.f64(double %10, double %18, double %30)
%32 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
store double %31, double* %32
%33 = fmul double %8, %21
%34 = tail call double @llvm.fmuladd.f64(double %6, double %20, double %33)
%35 = fneg double %34
%36 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
store double %35, double* %36
%37 = fmul double %8, %25
%38 = tail call double @llvm.fmuladd.f64(double %4, double %20, double %37)
%39 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
store double %38, double* %39
%40 = fmul double %6, %25
%41 = tail call double @llvm.fmuladd.f64(double %4, double %18, double %40)
%42 = fneg double %41
%43 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
store double %42, double* %43
%44 = fneg double %12
%45 = fmul double %8, %44
%46 = tail call double @llvm.fmuladd.f64(double %6, double %14, double %45)
%47 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
store double %46, double* %47
%48 = fneg double %10
%49 = fmul double %8, %48
%50 = tail call double @llvm.fmuladd.f64(double %4, double %14, double %49)
%51 = fneg double %50
%52 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
store double %51, double* %52
%53 = fmul double %6, %48
%54 = tail call double @llvm.fmuladd.f64(double %4, double %12, double %53)
%55 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
store double %54, double* %55
ret void
}