double large_opchain(double a, double b, double c, double d) {
  double ab = a * b;
  double ac = a * c;
  double ad = a * d;
  double bc = b * c;
  double bd = b * d;
  double cd = c * d;
  double p01 = ab + ab;
  double p02 = ab + ac;
  double p03 = ac + ac;
  double p04 = ad + ac;
  double p05 = ad + ad;
  double p06 = ab + ad;
  double p07 = bc + bc;
  double p08 = bc + bd;
  double p09 = bd + bd;
  double p10 = bd + cd;
  double p11 = cd + cd;
  double p12 = bc + cd;
  double q01 = p01 * p02;
  double q02 = p03 * p04;
  double q03 = p05 * p06;
  double q04 = p07 * p08;
  double q05 = p09 * p10;
  double q06 = p11 * p12;
  double r01 = q01 + q02;
  double r02 = r01 + q03;
  double r03 = q04 + q05;
  double r04 = r03 + q06;
  return r02 + r04;
}


x86 assembly (clang, -O0):
<large_opchain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
addsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
addsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
addsd  -0x100(%rbp),%xmm0
ff
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<large_opchain>:
movapd %xmm0,%xmm4
unpcklpd %xmm1,%xmm0
unpcklpd %xmm1,%xmm1
unpcklpd %xmm2,%xmm4
mulpd  %xmm4,%xmm1
unpcklpd %xmm3,%xmm2
mulpd  %xmm2,%xmm0
unpcklpd %xmm3,%xmm3
mulpd  %xmm3,%xmm4
movapd %xmm1,%xmm2
addpd  %xmm1,%xmm2
movapd %xmm1,%xmm3
addpd  %xmm0,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm4,%xmm2
addpd  %xmm0,%xmm2
addpd  %xmm0,%xmm0
mulpd  %xmm2,%xmm0
addpd  %xmm3,%xmm0
addpd  %xmm4,%xmm1
addpd  %xmm4,%xmm4
mulpd  %xmm1,%xmm4
addpd  %xmm4,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @large_opchain(double %0, double %1, double %2, double %3) {
%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
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%37 = load double, double* %5
%38 = load double, double* %6
%39 = fmul double %37, %38
store double %39, double* %9
%40 = load double, double* %5
%41 = load double, double* %7
%42 = fmul double %40, %41
store double %42, double* %10
%43 = load double, double* %5
%44 = load double, double* %8
%45 = fmul double %43, %44
store double %45, double* %11
%46 = load double, double* %6
%47 = load double, double* %7
%48 = fmul double %46, %47
store double %48, double* %12
%49 = load double, double* %6
%50 = load double, double* %8
%51 = fmul double %49, %50
store double %51, double* %13
%52 = load double, double* %7
%53 = load double, double* %8
%54 = fmul double %52, %53
store double %54, double* %14
%55 = load double, double* %9
%56 = load double, double* %9
%57 = fadd double %55, %56
store double %57, double* %15
%58 = load double, double* %9
%59 = load double, double* %10
%60 = fadd double %58, %59
store double %60, double* %16
%61 = load double, double* %10
%62 = load double, double* %10
%63 = fadd double %61, %62
store double %63, double* %17
%64 = load double, double* %11
%65 = load double, double* %10
%66 = fadd double %64, %65
store double %66, double* %18
%67 = load double, double* %11
%68 = load double, double* %11
%69 = fadd double %67, %68
store double %69, double* %19
%70 = load double, double* %9
%71 = load double, double* %11
%72 = fadd double %70, %71
store double %72, double* %20
%73 = load double, double* %12
%74 = load double, double* %12
%75 = fadd double %73, %74
store double %75, double* %21
%76 = load double, double* %12
%77 = load double, double* %13
%78 = fadd double %76, %77
store double %78, double* %22
%79 = load double, double* %13
%80 = load double, double* %13
%81 = fadd double %79, %80
store double %81, double* %23
%82 = load double, double* %13
%83 = load double, double* %14
%84 = fadd double %82, %83
store double %84, double* %24
%85 = load double, double* %14
%86 = load double, double* %14
%87 = fadd double %85, %86
store double %87, double* %25
%88 = load double, double* %12
%89 = load double, double* %14
%90 = fadd double %88, %89
store double %90, double* %26
%91 = load double, double* %15
%92 = load double, double* %16
%93 = fmul double %91, %92
store double %93, double* %27
%94 = load double, double* %17
%95 = load double, double* %18
%96 = fmul double %94, %95
store double %96, double* %28
%97 = load double, double* %19
%98 = load double, double* %20
%99 = fmul double %97, %98
store double %99, double* %29
%100 = load double, double* %21
%101 = load double, double* %22
%102 = fmul double %100, %101
store double %102, double* %30
%103 = load double, double* %23
%104 = load double, double* %24
%105 = fmul double %103, %104
store double %105, double* %31
%106 = load double, double* %25
%107 = load double, double* %26
%108 = fmul double %106, %107
store double %108, double* %32
%109 = load double, double* %27
%110 = load double, double* %28
%111 = fadd double %109, %110
store double %111, double* %33
%112 = load double, double* %33
%113 = load double, double* %29
%114 = fadd double %112, %113
store double %114, double* %34
%115 = load double, double* %30
%116 = load double, double* %31
%117 = fadd double %115, %116
store double %117, double* %35
%118 = load double, double* %35
%119 = load double, double* %32
%120 = fadd double %118, %119
store double %120, double* %36
%121 = load double, double* %34
%122 = load double, double* %36
%123 = fadd double %121, %122
ret double %123
}

LLVM IR (-O2):
define double @large_opchain(double %0, double %1, double %2, double %3) {
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = insertelement <2 x double> poison, double %0, i64 0
%8 = insertelement <2 x double> %7, double %2, i64 1
%9 = fmul <2 x double> %6, %8
%10 = insertelement <2 x double> %7, double %1, i64 1
%11 = insertelement <2 x double> poison, double %2, i64 0
%12 = insertelement <2 x double> %11, double %3, i64 1
%13 = fmul <2 x double> %10, %12
%14 = insertelement <2 x double> poison, double %3, i64 0
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
%16 = fmul <2 x double> %8, %15
%17 = fadd <2 x double> %9, %9
%18 = fadd <2 x double> %9, %13
%19 = fadd <2 x double> %13, %13
%20 = fadd <2 x double> %16, %13
%21 = fadd <2 x double> %16, %16
%22 = fadd <2 x double> %9, %16
%23 = fmul <2 x double> %17, %18
%24 = fmul <2 x double> %19, %20
%25 = fmul <2 x double> %21, %22
%26 = fadd <2 x double> %23, %24
%27 = fadd <2 x double> %25, %26
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%29 = fadd <2 x double> %27, %28
%30 = extractelement <2 x double> %29, i64 0
ret double %30
}