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


x86 assembly (clang, -O0):
<eval_pol20_dx>:
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
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe87(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe5b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe1e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdf7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%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    1296 <eval_pol20_dx+0x196>
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    123d <eval_pol20_dx+0x13d>
movsd  -0xc8(%rbp),%xmm0
ff
add    $0x50,%rsp
pop    %rbp
ret

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

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

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