void solve2sym(double *X, double *A, double *RHS) {
  double dinv = 1.0 / (A[0] * A[1] - A[2] * A[2]);
  double Ainv[3];
  Ainv[0] = dinv * A[1];
  Ainv[1] = dinv * A[0];
  Ainv[2] = -dinv * A[2];
  X[0] = Ainv[0] * RHS[0] + Ainv[2] * RHS[1];
  X[1] = Ainv[2] * RHS[0] + Ainv[1] * RHS[1];
  X[2] = Ainv[0] * RHS[2] + Ainv[2] * RHS[3];
  X[3] = Ainv[2] * RHS[2] + Ainv[1] * RHS[3];
}


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

x86 assembly (clang, -O2):
<solve2sym>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm0,%xmm4
mulsd  %xmm1,%xmm4
subsd  %xmm2,%xmm4
movsd  0xed6(%rip),%xmm2
divsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
xorpd  0xed2(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  0x8(%rdx),%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rdx),%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,(%rdi)
movsd  0x8(%rdx),%xmm3
mulsd  %xmm0,%xmm3
movsd  (%rdx),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rdi)
movsd  0x18(%rdx),%xmm3
mulsd  %xmm2,%xmm3
mulsd  0x10(%rdx),%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x10(%rdi)
mulsd  0x18(%rdx),%xmm0
mulsd  0x10(%rdx),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @solve2sym(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = fneg double %8
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %10)
%12 = fdiv double 1.000000e+00, %11
%13 = fmul double %6, %12
%14 = fmul double %4, %12
%15 = fneg double %12
%16 = fmul double %8, %15
%17 = load double, double* %2
%18 = getelementptr inbounds double, double* %2, i64 1
%19 = load double, double* %18
%20 = fmul double %19, %16
%21 = tail call double @llvm.fmuladd.f64(double %13, double %17, double %20)
store double %21, double* %0
%22 = load double, double* %2
%23 = load double, double* %18
%24 = fmul double %14, %23
%25 = tail call double @llvm.fmuladd.f64(double %16, double %22, double %24)
%26 = getelementptr inbounds double, double* %0, i64 1
store double %25, double* %26
%27 = getelementptr inbounds double, double* %2, i64 2
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %2, i64 3
%30 = load double, double* %29
%31 = fmul double %16, %30
%32 = tail call double @llvm.fmuladd.f64(double %13, double %28, double %31)
%33 = getelementptr inbounds double, double* %0, i64 2
store double %32, double* %33
%34 = load double, double* %27
%35 = load double, double* %29
%36 = fmul double %14, %35
%37 = tail call double @llvm.fmuladd.f64(double %16, double %34, double %36)
%38 = getelementptr inbounds double, double* %0, i64 3
store double %37, double* %38
ret void
}