double eval_pol20_dy(double c[20], double x, double y, double z) {
  double m[20] = {0,     0,         y,     0,     x,         0,         z,
                  0,     2 * y,     0,     x * z, 0,         x * 2 * y, 0,
                  x * x, 3 * y * y, z * z, 0,     2 * y * z, 0};
  double r = 0;
  for (int i = 0; i < 20; i++)
    r += c[i] * m[i];
  return r;
}


x86 assembly (clang, -O0):
<eval_pol20_dy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe7f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe4e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe28(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdf2(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movl   $0x0,-0xcc(%rbp)
cmpl   $0x14,-0xcc(%rbp)
jge    1293 <eval_pol20_dy+0x193>
mov    -0x8(%rbp),%rax
movslq -0xcc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xcc(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0xc8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    123a <eval_pol20_dy+0x13a>
movsd  -0xc8(%rbp),%xmm0
ff
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_pol20_dy>:
movapd %xmm1,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm0,%xmm11
mulsd  %xmm2,%xmm11
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm0,%xmm10
mulsd  %xmm0,%xmm10
movsd  0xecf(%rip),%xmm12
mulsd  %xmm1,%xmm12
mulsd  %xmm1,%xmm12
movapd %xmm2,%xmm9
mulsd  %xmm2,%xmm9
movapd %xmm7,%xmm8
mulsd  %xmm2,%xmm8
xorpd  %xmm3,%xmm3
movsd  (%rdi),%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm3,%xmm6
movsd  0x8(%rdi),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm6,%xmm5
mulsd  0x10(%rdi),%xmm1
addsd  %xmm1,%xmm5
movsd  0x18(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm5,%xmm1
mulsd  0x20(%rdi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x28(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x30(%rdi),%xmm2
addsd  %xmm2,%xmm0
movsd  0x38(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x40(%rdi),%xmm7
addsd  %xmm7,%xmm0
movsd  0x48(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x50(%rdi),%xmm11
addsd  %xmm11,%xmm0
movsd  0x58(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x60(%rdi),%xmm4
addsd  %xmm4,%xmm0
movsd  0x68(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x70(%rdi),%xmm10
addsd  %xmm10,%xmm0
mulsd  0x78(%rdi),%xmm12
addsd  %xmm12,%xmm0
mulsd  0x80(%rdi),%xmm9
addsd  %xmm9,%xmm0
movsd  0x88(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x90(%rdi),%xmm8
addsd  %xmm8,%xmm0
mulsd  0x98(%rdi),%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @eval_pol20_dy(double* %0, double %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [20 x double]
%10 = alloca double
%11 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = getelementptr inbounds [20 x double], [20 x double]* %9, i64 0, i64 0
store double 0.000000e+00, double* %12
%13 = getelementptr inbounds double, double* %12, i64 1
store double 0.000000e+00, double* %13
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %7
store double %15, double* %14
%16 = getelementptr inbounds double, double* %14, i64 1
store double 0.000000e+00, double* %16
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %6
store double %18, double* %17
%19 = getelementptr inbounds double, double* %17, i64 1
store double 0.000000e+00, double* %19
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %8
store double %21, double* %20
%22 = getelementptr inbounds double, double* %20, i64 1
store double 0.000000e+00, double* %22
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %7
%25 = fmul double 2.000000e+00, %24
store double %25, double* %23
%26 = getelementptr inbounds double, double* %23, i64 1
store double 0.000000e+00, double* %26
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %6
%29 = load double, double* %8
%30 = fmul double %28, %29
store double %30, double* %27
%31 = getelementptr inbounds double, double* %27, i64 1
store double 0.000000e+00, double* %31
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %6
%34 = fmul double %33, 2.000000e+00
%35 = load double, double* %7
%36 = fmul double %34, %35
store double %36, double* %32
%37 = getelementptr inbounds double, double* %32, i64 1
store double 0.000000e+00, double* %37
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %6
%40 = load double, double* %6
%41 = fmul double %39, %40
store double %41, double* %38
%42 = getelementptr inbounds double, double* %38, i64 1
%43 = load double, double* %7
%44 = fmul double 3.000000e+00, %43
%45 = load double, double* %7
%46 = fmul double %44, %45
store double %46, double* %42
%47 = getelementptr inbounds double, double* %42, i64 1
%48 = load double, double* %8
%49 = load double, double* %8
%50 = fmul double %48, %49
store double %50, double* %47
%51 = getelementptr inbounds double, double* %47, i64 1
store double 0.000000e+00, double* %51
%52 = getelementptr inbounds double, double* %51, i64 1
%53 = load double, double* %7
%54 = fmul double 2.000000e+00, %53
%55 = load double, double* %8
%56 = fmul double %54, %55
store double %56, double* %52
%57 = getelementptr inbounds double, double* %52, i64 1
store double 0.000000e+00, double* %57
store double 0.000000e+00, double* %10
store i32 0, i32* %11
br label %58
58: ; preds = %73, %4
%59 = load i32, i32* %11
%60 = icmp slt i32 %59, 20
br i1 %60, label %61, label %76
61: ; preds = %58
%62 = load double*, double** %5
%63 = load i32, i32* %11
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
%67 = load i32, i32* %11
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [20 x double], [20 x double]* %9, i64 0, i64 %68
%70 = load double, double* %69
%71 = load double, double* %10
%72 = call double @llvm.fmuladd.f64(double %66, double %70, double %71)
store double %72, double* %10
br label %73
73: ; preds = %61
%74 = load i32, i32* %11
%75 = add nsw i32 %74, 1
store i32 %75, i32* %11
br label %58
76: ; preds = %58
%77 = load double, double* %10
ret double %77
}

LLVM IR (-O2):
define double @eval_pol20_dy(double* nocapture %0, double %1, double %2, double %3) {
%5 = fmul double %2, 2.000000e+00
%6 = fmul double %1, %3
%7 = fmul double %1, 2.000000e+00
%8 = fmul double %7, %2
%9 = fmul double %1, %1
%10 = fmul double %2, 3.000000e+00
%11 = fmul double %10, %2
%12 = fmul double %3, %3
%13 = fmul double %5, %3
%14 = load double, double* %0
%15 = tail call double @llvm.fmuladd.f64(double %14, double 0.000000e+00, double 0.000000e+00)
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double 0.000000e+00, double %15)
%19 = getelementptr inbounds double, double* %0, i64 2
%20 = load double, double* %19
%21 = tail call double @llvm.fmuladd.f64(double %20, double %2, double %18)
%22 = getelementptr inbounds double, double* %0, i64 3
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %23, double 0.000000e+00, double %21)
%25 = getelementptr inbounds double, double* %0, i64 4
%26 = load double, double* %25
%27 = tail call double @llvm.fmuladd.f64(double %26, double %1, double %24)
%28 = getelementptr inbounds double, double* %0, i64 5
%29 = load double, double* %28
%30 = tail call double @llvm.fmuladd.f64(double %29, double 0.000000e+00, double %27)
%31 = getelementptr inbounds double, double* %0, i64 6
%32 = load double, double* %31
%33 = tail call double @llvm.fmuladd.f64(double %32, double %3, double %30)
%34 = getelementptr inbounds double, double* %0, i64 7
%35 = load double, double* %34
%36 = tail call double @llvm.fmuladd.f64(double %35, double 0.000000e+00, double %33)
%37 = getelementptr inbounds double, double* %0, i64 8
%38 = load double, double* %37
%39 = tail call double @llvm.fmuladd.f64(double %38, double %5, double %36)
%40 = getelementptr inbounds double, double* %0, i64 9
%41 = load double, double* %40
%42 = tail call double @llvm.fmuladd.f64(double %41, double 0.000000e+00, double %39)
%43 = getelementptr inbounds double, double* %0, i64 10
%44 = load double, double* %43
%45 = tail call double @llvm.fmuladd.f64(double %44, double %6, double %42)
%46 = getelementptr inbounds double, double* %0, i64 11
%47 = load double, double* %46
%48 = tail call double @llvm.fmuladd.f64(double %47, double 0.000000e+00, double %45)
%49 = getelementptr inbounds double, double* %0, i64 12
%50 = load double, double* %49
%51 = tail call double @llvm.fmuladd.f64(double %50, double %8, double %48)
%52 = getelementptr inbounds double, double* %0, i64 13
%53 = load double, double* %52
%54 = tail call double @llvm.fmuladd.f64(double %53, double 0.000000e+00, double %51)
%55 = getelementptr inbounds double, double* %0, i64 14
%56 = load double, double* %55
%57 = tail call double @llvm.fmuladd.f64(double %56, double %9, double %54)
%58 = getelementptr inbounds double, double* %0, i64 15
%59 = load double, double* %58
%60 = tail call double @llvm.fmuladd.f64(double %59, double %11, double %57)
%61 = getelementptr inbounds double, double* %0, i64 16
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %62, double %12, double %60)
%64 = getelementptr inbounds double, double* %0, i64 17
%65 = load double, double* %64
%66 = tail call double @llvm.fmuladd.f64(double %65, double 0.000000e+00, double %63)
%67 = getelementptr inbounds double, double* %0, i64 18
%68 = load double, double* %67
%69 = tail call double @llvm.fmuladd.f64(double %68, double %13, double %66)
%70 = getelementptr inbounds double, double* %0, i64 19
%71 = load double, double* %70
%72 = tail call double @llvm.fmuladd.f64(double %71, double 0.000000e+00, double %69)
ret double %72
}