double gpoledf(double x, double *c, int m, const double g, double *d) {
  double y = 0.0;
  for (m--; m > 0; m--) {
    y -= c[m + 1] * d[m];
    d[m] = d[m - 1];
  }
  y -= c[1] * d[0];
  y *= g;
  d[0] = (x += y);
  return (x);
}


x86 assembly (clang, -O0):
<gpoledf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11a9 <gpoledf+0xa9>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <gpoledf+0x2a>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpoledf>:
xorpd  %xmm2,%xmm2
cmp    $0x2,%esi
jl     1155 <gpoledf+0x55>
mov    %esi,%eax
mov    $0xfffffffe,%ecx
add    %rax,%rcx
add    $0xffffffffffffffff,%rax
xorpd  %xmm2,%xmm2
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rdi,%rax,8),%xmm3
mov    %eax,%r8d
mulsd  (%rdx,%r8,8),%xmm3
subsd  %xmm3,%xmm2
mov    %ecx,%esi
movsd  (%rdx,%rsi,8),%xmm3
movsd  %xmm3,(%rdx,%r8,8)
add    $0xffffffffffffffff,%rcx
lea    -0x1(%rax),%rsi
add    $0x1,%rax
cmp    $0x2,%rax
mov    %rsi,%rax
ja     1120 <gpoledf+0x20>
movsd  0x8(%rdi),%xmm3
mulsd  (%rdx),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @gpoledf(double %0, double* nocapture %1, i32 %2, double %3, double* nocapture %4) {
%6 = icmp sgt i32 %2, 1
br i1 %6, label %7, label %25
7: ; preds = %5
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %12, %9 ]
%11 = phi double [ 0.000000e+00, %7 ], [ %19, %9 ]
%12 = add nsw i64 %10, -1
%13 = getelementptr inbounds double, double* %1, i64 %10
%14 = load double, double* %13
%15 = and i64 %12, 4294967295
%16 = getelementptr inbounds double, double* %4, i64 %15
%17 = load double, double* %16
%18 = fneg double %14
%19 = tail call double @llvm.fmuladd.f64(double %18, double %17, double %11)
%20 = add nuw i64 %10, 4294967294
%21 = and i64 %20, 4294967295
%22 = getelementptr inbounds double, double* %4, i64 %21
%23 = load double, double* %22
store double %23, double* %16
%24 = icmp ugt i64 %10, 2
br i1 %24, label %9, label %25
25: ; preds = %9, %5
%26 = phi double [ 0.000000e+00, %5 ], [ %19, %9 ]
%27 = getelementptr inbounds double, double* %1, i64 1
%28 = load double, double* %27
%29 = load double, double* %4
%30 = fneg double %28
%31 = tail call double @llvm.fmuladd.f64(double %30, double %29, double %26)
%32 = fmul double %31, %3
%33 = fadd double %32, %0
store double %33, double* %4
ret double %33
}