double evalc(double cw, double *fonc) {
  double b[7];
  double x, res;
  int k;
  x = cw;
  b[5] = 1;
  b[6] = 0;
  for (k = 4; k > 0; k--) {
    b[k] = 2 * x * b[k + 1] - b[k + 2] + fonc[5 - k];
  };
  res = x * b[1] - b[2] + fonc[5] / 2;
  return (res);
}


x86 assembly (clang, -O0):
<evalc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x4,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jle    11b1 <evalc+0xb1>
movsd  0xec3(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x64(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm2
mov    -0x64(%rbp),%eax
add    $0x2,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    $0x5,%ecx
sub    -0x64(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movslq -0x64(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    1133 <evalc+0x33>
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm1
movsd  0xe18(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalc>:
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0x8(%rdi),%xmm2
addsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xedf(%rip),%xmm3
addsd  0x10(%rdi),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm2,%xmm4
addsd  0x18(%rdi),%xmm4
mulsd  %xmm4,%xmm1
subsd  %xmm3,%xmm1
addsd  0x20(%rdi),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm4,%xmm0
movsd  0x28(%rdi),%xmm1
mulsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @evalc(double %0, double* nocapture %1) {
%3 = fmul double %0, 2.000000e+00
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fadd double %3, %5
%7 = tail call double @llvm.fmuladd.f64(double %3, double %6, double -1.000000e+00)
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = fadd double %7, %9
%11 = fneg double %6
%12 = tail call double @llvm.fmuladd.f64(double %3, double %10, double %11)
%13 = getelementptr inbounds double, double* %1, i64 3
%14 = load double, double* %13
%15 = fadd double %12, %14
%16 = fneg double %10
%17 = tail call double @llvm.fmuladd.f64(double %3, double %15, double %16)
%18 = getelementptr inbounds double, double* %1, i64 4
%19 = load double, double* %18
%20 = fadd double %17, %19
%21 = fneg double %15
%22 = tail call double @llvm.fmuladd.f64(double %0, double %20, double %21)
%23 = getelementptr inbounds double, double* %1, i64 5
%24 = load double, double* %23
%25 = fmul double %24, 5.000000e-01
%26 = fadd double %22, %25
ret double %26
}