double difpol(diffn, k, t)
double *diffn;
int k;
double t;
{
  double f, fac, s, u;
  int i;
  f = *diffn++;
  u = 1.0;
  s = 1.0;
  fac = 1.0;
  for (i = 1; i < k; i++) {
    if (s == 0.0)
      break;
    u *= s / fac;
    f += u * (*diffn++);
    fac += 1.0;
    s += 1.0;
  }
  return (f);
}


x86 assembly (clang, -O0):
<difpol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ef <difpol+0xef>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117f <difpol+0x7f>
jp     117f <difpol+0x7f>
jmp    11ef <difpol+0xef>
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3b(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe29(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1156 <difpol+0x56>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difpol>:
movsd  (%rdi),%xmm0
cmp    $0x2,%esi
jl     116d <difpol+0x6d>
movapd 0xeef(%rip),%xmm1
movsd  0xef7(%rip),%xmm4
mov    $0x1,%eax
movapd 0xeda(%rip),%xmm2
xorpd  %xmm3,%xmm3
nopw   0x0(%rax,%rax,1)
movapd %xmm0,%xmm5
movapd %xmm4,%xmm0
movapd %xmm1,%xmm6
unpckhpd %xmm1,%xmm6
movapd %xmm1,%xmm4
divsd  %xmm6,%xmm4
mulsd  %xmm0,%xmm4
movsd  (%rdi,%rax,8),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addpd  %xmm2,%xmm1
add    $0x1,%rax
cmp    %esi,%eax
jge    116d <difpol+0x6d>
ucomisd %xmm3,%xmm1
jne    1130 <difpol+0x30>
jp     1130 <difpol+0x30>
ret

LLVM IR (-O0):
define double @difpol(double* %0, i32 %1, double %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store double %2, double* %6
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i32 1
store double* %13, double** %4
%14 = load double, double* %12
store double %14, double* %7
store double 1.000000e+00, double* %10
store double 1.000000e+00, double* %9
store double 1.000000e+00, double* %8
store i32 1, i32* %11
br label %15
15: ; preds = %39, %3
%16 = load i32, i32* %11
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %42
19: ; preds = %15
%20 = load double, double* %9
%21 = fcmp oeq double %20, 0.000000e+00
br i1 %21, label %22, label %23
22: ; preds = %19
br label %42
23: ; preds = %19
%24 = load double, double* %9
%25 = load double, double* %8
%26 = fdiv double %24, %25
%27 = load double, double* %10
%28 = fmul double %27, %26
store double %28, double* %10
%29 = load double, double* %10
%30 = load double*, double** %4
%31 = getelementptr inbounds double, double* %30, i32 1
store double* %31, double** %4
%32 = load double, double* %30
%33 = load double, double* %7
%34 = call double @llvm.fmuladd.f64(double %29, double %32, double %33)
store double %34, double* %7
%35 = load double, double* %8
%36 = fadd double %35, 1.000000e+00
store double %36, double* %8
%37 = load double, double* %9
%38 = fadd double %37, 1.000000e+00
store double %38, double* %9
br label %39
39: ; preds = %23
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %15
42: ; preds = %22, %15
%43 = load double, double* %7
ret double %43
}

LLVM IR (-O2):
define double @difpol(double* nocapture %0, i32 %1, double %2) {
%4 = load double, double* %0
%5 = icmp slt i32 %1, 2
br i1 %5, label %25, label %6
6: ; preds = %3, %6
%7 = phi double* [ %12, %6 ], [ %0, %3 ]
%8 = phi i32 [ %20, %6 ], [ 1, %3 ]
%9 = phi double [ %16, %6 ], [ 1.000000e+00, %3 ]
%10 = phi double [ %18, %6 ], [ %4, %3 ]
%11 = phi <2 x double> [ %19, %6 ], [ <double 1.000000e+00, double 1.000000e+00>, %3 ]
%12 = getelementptr inbounds double, double* %7, i64 1
%13 = extractelement <2 x double> %11, i64 0
%14 = extractelement <2 x double> %11, i64 1
%15 = fdiv double %13, %14
%16 = fmul double %9, %15
%17 = load double, double* %12
%18 = tail call double @llvm.fmuladd.f64(double %16, double %17, double %10)
%19 = fadd <2 x double> %11, <double 1.000000e+00, double 1.000000e+00>
%20 = add nuw nsw i32 %8, 1
%21 = icmp sge i32 %20, %1
%22 = extractelement <2 x double> %19, i64 0
%23 = fcmp oeq double %22, 0.000000e+00
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %6
25: ; preds = %6, %3
%26 = phi double [ %4, %3 ], [ %18, %6 ]
ret double %26
}