double gzerodf(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];
  d[0] = x;
  x += y * g;
  return (x);
}


x86 assembly (clang, -O0):
<gzerodf>:
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    1192 <gzerodf+0x92>
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
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 <gzerodf+0x2a>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @gzerodf(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 = %41, %5
%15 = load i32, i32* %8
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %44
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 = call double @llvm.fmuladd.f64(double %23, double %28, double %29)
store double %30, double* %11
%31 = load double*, double** %10
%32 = load i32, i32* %8
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %31, i64 %34
%36 = load double, double* %35
%37 = load double*, double** %10
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double %36, double* %40
br label %41
41: ; preds = %17
%42 = load i32, i32* %8
%43 = add nsw i32 %42, -1
store i32 %43, i32* %8
br label %14
44: ; preds = %14
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = load double*, double** %10
%49 = getelementptr inbounds double, double* %48, i64 0
%50 = load double, double* %49
%51 = load double, double* %11
%52 = call double @llvm.fmuladd.f64(double %47, double %50, double %51)
store double %52, double* %11
%53 = load double, double* %6
%54 = load double*, double** %10
%55 = getelementptr inbounds double, double* %54, i64 0
store double %53, double* %55
%56 = load double, double* %11
%57 = load double, double* %9
%58 = load double, double* %6
%59 = call double @llvm.fmuladd.f64(double %56, double %57, double %58)
store double %59, double* %6
%60 = load double, double* %6
ret double %60
}

LLVM IR (-O2):
define double @gzerodf(double %0, double* nocapture %1, i32 %2, double %3, double* nocapture %4) {
%6 = icmp sgt i32 %2, 1
br i1 %6, label %7, label %24
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 ], [ %18, %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 = tail call double @llvm.fmuladd.f64(double %14, double %17, double %11)
%19 = add nuw i64 %10, 4294967294
%20 = and i64 %19, 4294967295
%21 = getelementptr inbounds double, double* %4, i64 %20
%22 = load double, double* %21
store double %22, double* %16
%23 = icmp ugt i64 %10, 2
br i1 %23, label %9, label %24
24: ; preds = %9, %5
%25 = phi double [ 0.000000e+00, %5 ], [ %18, %9 ]
%26 = getelementptr inbounds double, double* %1, i64 1
%27 = load double, double* %26
%28 = load double, double* %4
%29 = tail call double @llvm.fmuladd.f64(double %27, double %28, double %25)
store double %0, double* %4
%30 = tail call double @llvm.fmuladd.f64(double %29, double %3, double %0)
ret double %30
}