double polytrans(double *coeff, double lon, double lat) {
  double ret = coeff[0] + coeff[1] * lon + coeff[2] * lat;
  ret += coeff[3] * lon * lon;
  ret += coeff[4] * lon * lat;
  ret += coeff[5] * lat * lat;
  ret += coeff[6] * lon * lon * lon;
  ret += coeff[7] * lon * lon * lat;
  ret += coeff[8] * lon * lat * lat;
  ret += coeff[9] * lat * lat * lat;
  ret += coeff[10] * lat * lat * lat * lat;
  ret += coeff[11] * lat * lat * lat * lat * lat;
  return ret;
}


x86 assembly (clang, -O0):
<polytrans>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<polytrans>:
movsd  0x8(%rdi),%xmm2
mulsd  %xmm0,%xmm2
addsd  (%rdi),%xmm2
movsd  0x10(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  0x18(%rdi),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  0x20(%rdi),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  0x28(%rdi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  0x30(%rdi),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  0x38(%rdi),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
mulsd  0x40(%rdi),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  0x48(%rdi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  0x50(%rdi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  0x58(%rdi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @polytrans(double* nocapture %0, double %1, double %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %4)
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %2, double %7)
%11 = getelementptr inbounds double, double* %0, i64 3
%12 = load double, double* %11
%13 = fmul double %12, %1
%14 = tail call double @llvm.fmuladd.f64(double %13, double %1, double %10)
%15 = getelementptr inbounds double, double* %0, i64 4
%16 = load double, double* %15
%17 = fmul double %16, %1
%18 = tail call double @llvm.fmuladd.f64(double %17, double %2, double %14)
%19 = getelementptr inbounds double, double* %0, i64 5
%20 = load double, double* %19
%21 = fmul double %20, %2
%22 = tail call double @llvm.fmuladd.f64(double %21, double %2, double %18)
%23 = getelementptr inbounds double, double* %0, i64 6
%24 = load double, double* %23
%25 = fmul double %24, %1
%26 = fmul double %25, %1
%27 = tail call double @llvm.fmuladd.f64(double %26, double %1, double %22)
%28 = getelementptr inbounds double, double* %0, i64 7
%29 = load double, double* %28
%30 = fmul double %29, %1
%31 = fmul double %30, %1
%32 = tail call double @llvm.fmuladd.f64(double %31, double %2, double %27)
%33 = getelementptr inbounds double, double* %0, i64 8
%34 = load double, double* %33
%35 = fmul double %34, %1
%36 = fmul double %35, %2
%37 = tail call double @llvm.fmuladd.f64(double %36, double %2, double %32)
%38 = getelementptr inbounds double, double* %0, i64 9
%39 = load double, double* %38
%40 = fmul double %39, %2
%41 = fmul double %40, %2
%42 = tail call double @llvm.fmuladd.f64(double %41, double %2, double %37)
%43 = getelementptr inbounds double, double* %0, i64 10
%44 = load double, double* %43
%45 = fmul double %44, %2
%46 = fmul double %45, %2
%47 = fmul double %46, %2
%48 = tail call double @llvm.fmuladd.f64(double %47, double %2, double %42)
%49 = getelementptr inbounds double, double* %0, i64 11
%50 = load double, double* %49
%51 = fmul double %50, %2
%52 = fmul double %51, %2
%53 = fmul double %52, %2
%54 = fmul double %53, %2
%55 = tail call double @llvm.fmuladd.f64(double %54, double %2, double %48)
ret double %55
}