void cinterp(double val, double x0, double x1, double f0, double f0p, double f1,
             double f1p, double *fv, double *fvp) {
  double inc, yval, f, fp, a0, b0, a1, b1, a2, a3;
  double c0, c1, cc0, cc1;
  inc = x1 - x0;
  yval = (val - x0) / inc;
  b0 = f0;
  b1 = f0p * inc;
  c0 = f1;
  c1 = f1p * inc;
  a0 = b0;
  a1 = b1;
  cc0 = c0 - (a0 + a1);
  cc1 = c1 - a1;
  a2 = 3 * cc0 - cc1;
  a3 = cc1 - 2 * cc0;
  f = a3;
  f *= yval;
  f += a2;
  f *= yval;
  f += a1;
  f *= yval;
  f += a0;
  *fv = f;
  fp = 3 * a3;
  fp *= yval;
  fp += 2 * a2;
  fp *= yval;
  fp += a1;
  *fv = f;
  *fvp = fp / inc;
}


x86 assembly (clang, -O0):
<cinterp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x38,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %rsi,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
addsd  -0x80(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xdf6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xd47(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x38,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cinterp>:
subsd  %xmm1,%xmm2
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm6
movapd %xmm4,%xmm1
addsd  %xmm3,%xmm1
subsd  %xmm1,%xmm5
subsd  %xmm4,%xmm6
movsd  0xed4(%rip),%xmm7
movapd %xmm5,%xmm1
mulsd  %xmm7,%xmm1
subsd  %xmm6,%xmm1
addsd  %xmm5,%xmm5
subsd  %xmm5,%xmm6
movapd %xmm0,%xmm5
mulsd  %xmm6,%xmm5
addsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm4,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm7,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm1,%xmm1
addsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm4,%xmm1
movsd  %xmm5,(%rdi)
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rsi)
ret

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

LLVM IR (-O2):
define void @cinterp(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = fsub double %2, %1
%11 = fsub double %0, %1
%12 = fdiv double %11, %10
%13 = fmul double %10, %4
%14 = fmul double %10, %6
%15 = fadd double %13, %3
%16 = fsub double %5, %15
%17 = fsub double %14, %13
%18 = fneg double %17
%19 = tail call double @llvm.fmuladd.f64(double %16, double 3.000000e+00, double %18)
%20 = tail call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double %17)
%21 = fmul double %12, %20
%22 = fadd double %19, %21
%23 = fmul double %12, %22
%24 = fadd double %13, %23
%25 = fmul double %12, %24
%26 = fadd double %25, %3
%27 = fmul double %20, 3.000000e+00
%28 = fmul double %12, %27
%29 = tail call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double %28)
%30 = fmul double %12, %29
%31 = fadd double %13, %30
store double %26, double* %7
%32 = fdiv double %31, %10
store double %32, double* %8
ret void
}