double s_calc_Hr(double H[3], double r[2], const double d[5],
                 const double ref[2], const double x[2]) {
  const double r2 = x[0] * x[0] + x[1] * x[1];
  const double d123 = d[0] + (2.0 * d[1] + 3.0 * d[4] * r2) * r2;
  double dx[2], diff[2], f[2][2];
  dx[0] = x[0] * (((d[4] * r2 + d[1]) * r2 + d[0]) * r2 + 1.0) +
          2.0 * d[2] * x[0] * x[1] + d[3] * (r2 + 2.0 * x[0] * x[0]);
  dx[1] = x[1] * (((d[4] * r2 + d[1]) * r2 + d[0]) * r2 + 1.0) +
          d[2] * (r2 + 2.0 * x[1] * x[1]) + 2.0 * d[3] * x[0] * x[1];
  diff[0] = dx[0] - ref[0];
  diff[1] = dx[1] - ref[1];
  f[0][0] = (((d[4] * r2 + d[1]) * r2 + d[0]) * r2 + 1.0) +
            2.0 * x[0] * x[0] * d123 + 2.0 * d[2] * x[1] + 6.0 * d[3] * x[0];
  f[0][1] = 2.0 * (x[0] * x[1] * d123 + d[2] * x[0] + d[3] * x[1]);
  f[1][0] = f[0][1];
  f[1][1] = (((d[4] * r2 + d[1]) * r2 + d[0]) * r2 + 1.0) +
            2.0 * x[1] * x[1] * d123 + 6.0 * d[2] * x[1] + 2.0 * d[3] * x[0];
  H[0] = f[0][0] * f[0][0] + f[0][1] * f[0][1];
  H[1] = f[0][0] * f[1][0] + f[0][1] * f[1][1];
  H[2] = f[1][0] * f[1][0] + f[1][1] * f[1][1];
  r[0] = f[0][0] * diff[0] + f[0][1] * diff[1];
  r[1] = f[1][0] * diff[0] + f[1][1] * diff[1];
  return diff[0] * diff[0] + diff[1] * diff[1];
}


x86 assembly (clang, -O0):
<s_calc_Hr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x28(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0xeb4(%rip),%xmm2
mulsd  0x20(%rax),%xmm2
mulsd  -0x30(%rbp),%xmm2
addsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm2
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm2
movsd  0xe3b(%rip),%xmm0
addsd  %xmm0,%xmm2
mov    -0x18(%rbp),%rax
movsd  0xe1b(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x30(%rbp),%xmm3
mov    -0x28(%rbp),%rax
movsd  0xde3(%rip),%xmm2
mulsd  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm2
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm2
movsd  0xd84(%rip),%xmm0
addsd  %xmm0,%xmm2
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x30(%rbp),%xmm4
mov    -0x28(%rbp),%rax
movsd  0xd56(%rip),%xmm3
mulsd  0x8(%rax),%xmm3
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0xd28(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xcab(%rip),%xmm0
addsd  %xmm0,%xmm1
mov    -0x28(%rbp),%rax
movsd  0xc8b(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  0xc66(%rip),%xmm1
mulsd  0x10(%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0xc4c(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xbd9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xb91(%rip),%xmm0
addsd  %xmm0,%xmm1
mov    -0x28(%rbp),%rax
movsd  0xb71(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  0xb52(%rip),%xmm1
mulsd  0x10(%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0xb28(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_calc_Hr>:
movsd  (%r8),%xmm10
movsd  0x8(%r8),%xmm8
movapd %xmm8,%xmm0
mulsd  %xmm8,%xmm0
movapd %xmm10,%xmm3
mulsd  %xmm10,%xmm3
addsd  %xmm0,%xmm3
movsd  (%rdx),%xmm0
movsd  0x8(%rdx),%xmm11
movsd  0x20(%rdx),%xmm4
movsd  0xec6(%rip),%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm4
addsd  %xmm11,%xmm4
addsd  %xmm11,%xmm11
addsd  %xmm1,%xmm11
mulsd  %xmm3,%xmm11
addsd  %xmm0,%xmm11
mulsd  %xmm3,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
addsd  0xe95(%rip),%xmm4
movsd  0x10(%rdx),%xmm5
movapd %xmm5,%xmm9
addsd  %xmm5,%xmm9
movapd %xmm10,%xmm0
mulsd  %xmm9,%xmm0
mulsd  %xmm8,%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  0x18(%rdx),%xmm7
movapd %xmm10,%xmm13
addsd  %xmm10,%xmm13
mulsd  %xmm10,%xmm13
movapd %xmm13,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm8,%xmm2
addsd  %xmm8,%xmm2
mulsd  %xmm8,%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm7,%xmm12
addsd  %xmm7,%xmm12
mulsd  %xmm10,%xmm12
movsd  0xe1e(%rip),%xmm14
movapd %xmm7,%xmm6
mulsd  %xmm14,%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm10,%xmm1
mulsd  %xmm5,%xmm10
mulsd  %xmm14,%xmm5
mulsd  %xmm11,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm8,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm12,%xmm5
mulsd  %xmm8,%xmm12
mulsd  %xmm8,%xmm9
mulsd  %xmm8,%xmm1
mulsd  %xmm8,%xmm7
mulsd  %xmm4,%xmm8
addsd  %xmm3,%xmm8
subsd  (%rcx),%xmm0
addsd  %xmm8,%xmm12
subsd  0x8(%rcx),%xmm12
mulsd  %xmm11,%xmm13
addsd  %xmm4,%xmm13
addsd  %xmm13,%xmm9
addsd  %xmm9,%xmm6
mulsd  %xmm11,%xmm1
addsd  %xmm10,%xmm1
addsd  %xmm1,%xmm7
addsd  %xmm7,%xmm7
movapd %xmm7,%xmm1
unpcklpd %xmm7,%xmm1
movapd %xmm7,%xmm2
unpcklpd %xmm5,%xmm2
mulpd  %xmm2,%xmm1
movapd %xmm6,%xmm3
unpcklpd %xmm6,%xmm3
unpcklpd %xmm7,%xmm6
mulpd  %xmm6,%xmm3
addpd  %xmm1,%xmm3
movupd %xmm3,(%rdi)
mulsd  %xmm5,%xmm5
mulsd  %xmm7,%xmm7
addsd  %xmm5,%xmm7
movsd  %xmm7,0x10(%rdi)
movapd %xmm12,%xmm1
unpcklpd %xmm12,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm6,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm2,(%rsi)
mulsd  %xmm12,%xmm12
mulsd  %xmm0,%xmm0
addsd  %xmm12,%xmm0
ret

LLVM IR (-O0):
define double @s_calc_Hr(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca [2 x double]
%14 = alloca [2 x double]
%15 = alloca [2 x [2 x double]]
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%16 = load double*, double** %10
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %10
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %10
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = load double*, double** %10
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = fmul double %24, %27
%29 = call double @llvm.fmuladd.f64(double %18, double %21, double %28)
store double %29, double* %11
%30 = load double*, double** %8
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = load double*, double** %8
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = load double*, double** %8
%37 = getelementptr inbounds double, double* %36, i64 4
%38 = load double, double* %37
%39 = fmul double 3.000000e+00, %38
%40 = load double, double* %11
%41 = fmul double %39, %40
%42 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %35, double %41)
%43 = load double, double* %11
%44 = call double @llvm.fmuladd.f64(double %42, double %43, double %32)
store double %44, double* %12
%45 = load double*, double** %10
%46 = getelementptr inbounds double, double* %45, i64 0
%47 = load double, double* %46
%48 = load double*, double** %8
%49 = getelementptr inbounds double, double* %48, i64 4
%50 = load double, double* %49
%51 = load double, double* %11
%52 = load double*, double** %8
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load double, double* %53
%55 = call double @llvm.fmuladd.f64(double %50, double %51, double %54)
%56 = load double, double* %11
%57 = load double*, double** %8
%58 = getelementptr inbounds double, double* %57, i64 0
%59 = load double, double* %58
%60 = call double @llvm.fmuladd.f64(double %55, double %56, double %59)
%61 = load double, double* %11
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double 1.000000e+00)
%63 = load double*, double** %8
%64 = getelementptr inbounds double, double* %63, i64 2
%65 = load double, double* %64
%66 = fmul double 2.000000e+00, %65
%67 = load double*, double** %10
%68 = getelementptr inbounds double, double* %67, i64 0
%69 = load double, double* %68
%70 = fmul double %66, %69
%71 = load double*, double** %10
%72 = getelementptr inbounds double, double* %71, i64 1
%73 = load double, double* %72
%74 = fmul double %70, %73
%75 = call double @llvm.fmuladd.f64(double %47, double %62, double %74)
%76 = load double*, double** %8
%77 = getelementptr inbounds double, double* %76, i64 3
%78 = load double, double* %77
%79 = load double, double* %11
%80 = load double*, double** %10
%81 = getelementptr inbounds double, double* %80, i64 0
%82 = load double, double* %81
%83 = fmul double 2.000000e+00, %82
%84 = load double*, double** %10
%85 = getelementptr inbounds double, double* %84, i64 0
%86 = load double, double* %85
%87 = call double @llvm.fmuladd.f64(double %83, double %86, double %79)
%88 = call double @llvm.fmuladd.f64(double %78, double %87, double %75)
%89 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
store double %88, double* %89
%90 = load double*, double** %10
%91 = getelementptr inbounds double, double* %90, i64 1
%92 = load double, double* %91
%93 = load double*, double** %8
%94 = getelementptr inbounds double, double* %93, i64 4
%95 = load double, double* %94
%96 = load double, double* %11
%97 = load double*, double** %8
%98 = getelementptr inbounds double, double* %97, i64 1
%99 = load double, double* %98
%100 = call double @llvm.fmuladd.f64(double %95, double %96, double %99)
%101 = load double, double* %11
%102 = load double*, double** %8
%103 = getelementptr inbounds double, double* %102, i64 0
%104 = load double, double* %103
%105 = call double @llvm.fmuladd.f64(double %100, double %101, double %104)
%106 = load double, double* %11
%107 = call double @llvm.fmuladd.f64(double %105, double %106, double 1.000000e+00)
%108 = load double*, double** %8
%109 = getelementptr inbounds double, double* %108, i64 2
%110 = load double, double* %109
%111 = load double, double* %11
%112 = load double*, double** %10
%113 = getelementptr inbounds double, double* %112, i64 1
%114 = load double, double* %113
%115 = fmul double 2.000000e+00, %114
%116 = load double*, double** %10
%117 = getelementptr inbounds double, double* %116, i64 1
%118 = load double, double* %117
%119 = call double @llvm.fmuladd.f64(double %115, double %118, double %111)
%120 = fmul double %110, %119
%121 = call double @llvm.fmuladd.f64(double %92, double %107, double %120)
%122 = load double*, double** %8
%123 = getelementptr inbounds double, double* %122, i64 3
%124 = load double, double* %123
%125 = fmul double 2.000000e+00, %124
%126 = load double*, double** %10
%127 = getelementptr inbounds double, double* %126, i64 0
%128 = load double, double* %127
%129 = fmul double %125, %128
%130 = load double*, double** %10
%131 = getelementptr inbounds double, double* %130, i64 1
%132 = load double, double* %131
%133 = call double @llvm.fmuladd.f64(double %129, double %132, double %121)
%134 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 1
store double %133, double* %134
%135 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%136 = load double, double* %135
%137 = load double*, double** %9
%138 = getelementptr inbounds double, double* %137, i64 0
%139 = load double, double* %138
%140 = fsub double %136, %139
%141 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
store double %140, double* %141
%142 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 1
%143 = load double, double* %142
%144 = load double*, double** %9
%145 = getelementptr inbounds double, double* %144, i64 1
%146 = load double, double* %145
%147 = fsub double %143, %146
%148 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 1
store double %147, double* %148
%149 = load double*, double** %8
%150 = getelementptr inbounds double, double* %149, i64 4
%151 = load double, double* %150
%152 = load double, double* %11
%153 = load double*, double** %8
%154 = getelementptr inbounds double, double* %153, i64 1
%155 = load double, double* %154
%156 = call double @llvm.fmuladd.f64(double %151, double %152, double %155)
%157 = load double, double* %11
%158 = load double*, double** %8
%159 = getelementptr inbounds double, double* %158, i64 0
%160 = load double, double* %159
%161 = call double @llvm.fmuladd.f64(double %156, double %157, double %160)
%162 = load double, double* %11
%163 = call double @llvm.fmuladd.f64(double %161, double %162, double 1.000000e+00)
%164 = load double*, double** %10
%165 = getelementptr inbounds double, double* %164, i64 0
%166 = load double, double* %165
%167 = fmul double 2.000000e+00, %166
%168 = load double*, double** %10
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = fmul double %167, %170
%172 = load double, double* %12
%173 = call double @llvm.fmuladd.f64(double %171, double %172, double %163)
%174 = load double*, double** %8
%175 = getelementptr inbounds double, double* %174, i64 2
%176 = load double, double* %175
%177 = fmul double 2.000000e+00, %176
%178 = load double*, double** %10
%179 = getelementptr inbounds double, double* %178, i64 1
%180 = load double, double* %179
%181 = call double @llvm.fmuladd.f64(double %177, double %180, double %173)
%182 = load double*, double** %8
%183 = getelementptr inbounds double, double* %182, i64 3
%184 = load double, double* %183
%185 = fmul double 6.000000e+00, %184
%186 = load double*, double** %10
%187 = getelementptr inbounds double, double* %186, i64 0
%188 = load double, double* %187
%189 = call double @llvm.fmuladd.f64(double %185, double %188, double %181)
%190 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%191 = getelementptr inbounds [2 x double], [2 x double]* %190, i64 0, i64 0
store double %189, double* %191
%192 = load double*, double** %10
%193 = getelementptr inbounds double, double* %192, i64 0
%194 = load double, double* %193
%195 = load double*, double** %10
%196 = getelementptr inbounds double, double* %195, i64 1
%197 = load double, double* %196
%198 = fmul double %194, %197
%199 = load double, double* %12
%200 = load double*, double** %8
%201 = getelementptr inbounds double, double* %200, i64 2
%202 = load double, double* %201
%203 = load double*, double** %10
%204 = getelementptr inbounds double, double* %203, i64 0
%205 = load double, double* %204
%206 = fmul double %202, %205
%207 = call double @llvm.fmuladd.f64(double %198, double %199, double %206)
%208 = load double*, double** %8
%209 = getelementptr inbounds double, double* %208, i64 3
%210 = load double, double* %209
%211 = load double*, double** %10
%212 = getelementptr inbounds double, double* %211, i64 1
%213 = load double, double* %212
%214 = call double @llvm.fmuladd.f64(double %210, double %213, double %207)
%215 = fmul double 2.000000e+00, %214
%216 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%217 = getelementptr inbounds [2 x double], [2 x double]* %216, i64 0, i64 1
store double %215, double* %217
%218 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%219 = getelementptr inbounds [2 x double], [2 x double]* %218, i64 0, i64 1
%220 = load double, double* %219
%221 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%222 = getelementptr inbounds [2 x double], [2 x double]* %221, i64 0, i64 0
store double %220, double* %222
%223 = load double*, double** %8
%224 = getelementptr inbounds double, double* %223, i64 4
%225 = load double, double* %224
%226 = load double, double* %11
%227 = load double*, double** %8
%228 = getelementptr inbounds double, double* %227, i64 1
%229 = load double, double* %228
%230 = call double @llvm.fmuladd.f64(double %225, double %226, double %229)
%231 = load double, double* %11
%232 = load double*, double** %8
%233 = getelementptr inbounds double, double* %232, i64 0
%234 = load double, double* %233
%235 = call double @llvm.fmuladd.f64(double %230, double %231, double %234)
%236 = load double, double* %11
%237 = call double @llvm.fmuladd.f64(double %235, double %236, double 1.000000e+00)
%238 = load double*, double** %10
%239 = getelementptr inbounds double, double* %238, i64 1
%240 = load double, double* %239
%241 = fmul double 2.000000e+00, %240
%242 = load double*, double** %10
%243 = getelementptr inbounds double, double* %242, i64 1
%244 = load double, double* %243
%245 = fmul double %241, %244
%246 = load double, double* %12
%247 = call double @llvm.fmuladd.f64(double %245, double %246, double %237)
%248 = load double*, double** %8
%249 = getelementptr inbounds double, double* %248, i64 2
%250 = load double, double* %249
%251 = fmul double 6.000000e+00, %250
%252 = load double*, double** %10
%253 = getelementptr inbounds double, double* %252, i64 1
%254 = load double, double* %253
%255 = call double @llvm.fmuladd.f64(double %251, double %254, double %247)
%256 = load double*, double** %8
%257 = getelementptr inbounds double, double* %256, i64 3
%258 = load double, double* %257
%259 = fmul double 2.000000e+00, %258
%260 = load double*, double** %10
%261 = getelementptr inbounds double, double* %260, i64 0
%262 = load double, double* %261
%263 = call double @llvm.fmuladd.f64(double %259, double %262, double %255)
%264 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%265 = getelementptr inbounds [2 x double], [2 x double]* %264, i64 0, i64 1
store double %263, double* %265
%266 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%267 = getelementptr inbounds [2 x double], [2 x double]* %266, i64 0, i64 0
%268 = load double, double* %267
%269 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%270 = getelementptr inbounds [2 x double], [2 x double]* %269, i64 0, i64 0
%271 = load double, double* %270
%272 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%273 = getelementptr inbounds [2 x double], [2 x double]* %272, i64 0, i64 1
%274 = load double, double* %273
%275 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%276 = getelementptr inbounds [2 x double], [2 x double]* %275, i64 0, i64 1
%277 = load double, double* %276
%278 = fmul double %274, %277
%279 = call double @llvm.fmuladd.f64(double %268, double %271, double %278)
%280 = load double*, double** %6
%281 = getelementptr inbounds double, double* %280, i64 0
store double %279, double* %281
%282 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%283 = getelementptr inbounds [2 x double], [2 x double]* %282, i64 0, i64 0
%284 = load double, double* %283
%285 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%286 = getelementptr inbounds [2 x double], [2 x double]* %285, i64 0, i64 0
%287 = load double, double* %286
%288 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%289 = getelementptr inbounds [2 x double], [2 x double]* %288, i64 0, i64 1
%290 = load double, double* %289
%291 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%292 = getelementptr inbounds [2 x double], [2 x double]* %291, i64 0, i64 1
%293 = load double, double* %292
%294 = fmul double %290, %293
%295 = call double @llvm.fmuladd.f64(double %284, double %287, double %294)
%296 = load double*, double** %6
%297 = getelementptr inbounds double, double* %296, i64 1
store double %295, double* %297
%298 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%299 = getelementptr inbounds [2 x double], [2 x double]* %298, i64 0, i64 0
%300 = load double, double* %299
%301 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%302 = getelementptr inbounds [2 x double], [2 x double]* %301, i64 0, i64 0
%303 = load double, double* %302
%304 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%305 = getelementptr inbounds [2 x double], [2 x double]* %304, i64 0, i64 1
%306 = load double, double* %305
%307 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%308 = getelementptr inbounds [2 x double], [2 x double]* %307, i64 0, i64 1
%309 = load double, double* %308
%310 = fmul double %306, %309
%311 = call double @llvm.fmuladd.f64(double %300, double %303, double %310)
%312 = load double*, double** %6
%313 = getelementptr inbounds double, double* %312, i64 2
store double %311, double* %313
%314 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%315 = getelementptr inbounds [2 x double], [2 x double]* %314, i64 0, i64 0
%316 = load double, double* %315
%317 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%318 = load double, double* %317
%319 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 0
%320 = getelementptr inbounds [2 x double], [2 x double]* %319, i64 0, i64 1
%321 = load double, double* %320
%322 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 1
%323 = load double, double* %322
%324 = fmul double %321, %323
%325 = call double @llvm.fmuladd.f64(double %316, double %318, double %324)
%326 = load double*, double** %7
%327 = getelementptr inbounds double, double* %326, i64 0
store double %325, double* %327
%328 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%329 = getelementptr inbounds [2 x double], [2 x double]* %328, i64 0, i64 0
%330 = load double, double* %329
%331 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%332 = load double, double* %331
%333 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %15, i64 0, i64 1
%334 = getelementptr inbounds [2 x double], [2 x double]* %333, i64 0, i64 1
%335 = load double, double* %334
%336 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 1
%337 = load double, double* %336
%338 = fmul double %335, %337
%339 = call double @llvm.fmuladd.f64(double %330, double %332, double %338)
%340 = load double*, double** %7
%341 = getelementptr inbounds double, double* %340, i64 1
store double %339, double* %341
%342 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%343 = load double, double* %342
%344 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%345 = load double, double* %344
%346 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 1
%347 = load double, double* %346
%348 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 1
%349 = load double, double* %348
%350 = fmul double %347, %349
%351 = call double @llvm.fmuladd.f64(double %343, double %345, double %350)
ret double %351
}

LLVM IR (-O2):
define double @s_calc_Hr(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = load double, double* %4
%7 = getelementptr inbounds double, double* %4, i64 1
%8 = load double, double* %7
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %9)
%11 = load double, double* %2
%12 = getelementptr inbounds double, double* %2, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %2, i64 4
%15 = load double, double* %14
%16 = fmul double %15, 3.000000e+00
%17 = fmul double %10, %16
%18 = tail call double @llvm.fmuladd.f64(double %13, double 2.000000e+00, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %18, double %10, double %11)
%20 = tail call double @llvm.fmuladd.f64(double %15, double %10, double %13)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %10, double %11)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %10, double 1.000000e+00)
%23 = getelementptr inbounds double, double* %2, i64 2
%24 = load double, double* %23
%25 = fmul double %24, 2.000000e+00
%26 = fmul double %6, %25
%27 = fmul double %8, %26
%28 = tail call double @llvm.fmuladd.f64(double %6, double %22, double %27)
%29 = getelementptr inbounds double, double* %2, i64 3
%30 = load double, double* %29
%31 = fmul double %6, 2.000000e+00
%32 = tail call double @llvm.fmuladd.f64(double %31, double %6, double %10)
%33 = tail call double @llvm.fmuladd.f64(double %30, double %32, double %28)
%34 = fmul double %8, 2.000000e+00
%35 = tail call double @llvm.fmuladd.f64(double %34, double %8, double %10)
%36 = fmul double %35, %24
%37 = tail call double @llvm.fmuladd.f64(double %8, double %22, double %36)
%38 = fmul double %30, 2.000000e+00
%39 = fmul double %6, %38
%40 = tail call double @llvm.fmuladd.f64(double %39, double %8, double %37)
%41 = load double, double* %3
%42 = fsub double %33, %41
%43 = getelementptr inbounds double, double* %3, i64 1
%44 = load double, double* %43
%45 = fsub double %40, %44
%46 = fmul double %6, %31
%47 = tail call double @llvm.fmuladd.f64(double %46, double %19, double %22)
%48 = tail call double @llvm.fmuladd.f64(double %25, double %8, double %47)
%49 = fmul double %30, 6.000000e+00
%50 = tail call double @llvm.fmuladd.f64(double %49, double %6, double %48)
%51 = fmul double %6, %8
%52 = fmul double %6, %24
%53 = tail call double @llvm.fmuladd.f64(double %51, double %19, double %52)
%54 = tail call double @llvm.fmuladd.f64(double %30, double %8, double %53)
%55 = fmul double %54, 2.000000e+00
%56 = fmul double %8, %34
%57 = tail call double @llvm.fmuladd.f64(double %56, double %19, double %22)
%58 = fmul double %24, 6.000000e+00
%59 = tail call double @llvm.fmuladd.f64(double %58, double %8, double %57)
%60 = tail call double @llvm.fmuladd.f64(double %38, double %6, double %59)
%61 = insertelement <2 x double> poison, double %55, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = insertelement <2 x double> %61, double %60, i64 1
%64 = fmul <2 x double> %62, %63
%65 = insertelement <2 x double> poison, double %50, i64 0
%66 = shufflevector <2 x double> %65, <2 x double> poison, <2 x i32> zeroinitializer
%67 = insertelement <2 x double> %65, double %55, i64 1
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %67, <2 x double> %64)
%69 = bitcast double* %0 to <2 x double>*
store <2 x double> %68, <2 x double>* %69
%70 = fmul double %60, %60
%71 = tail call double @llvm.fmuladd.f64(double %55, double %55, double %70)
%72 = getelementptr inbounds double, double* %0, i64 2
store double %71, double* %72
%73 = insertelement <2 x double> poison, double %45, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = fmul <2 x double> %74, %63
%76 = insertelement <2 x double> poison, double %42, i64 0
%77 = shufflevector <2 x double> %76, <2 x double> poison, <2 x i32> zeroinitializer
%78 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %67, <2 x double> %77, <2 x double> %75)
%79 = bitcast double* %1 to <2 x double>*
store <2 x double> %78, <2 x double>* %79
%80 = fmul double %45, %45
%81 = tail call double @llvm.fmuladd.f64(double %42, double %42, double %80)
ret double %81
}