double grmhd_disp_df(double v, double C1, double C2, double C3, double C4,
                     double bei, double vi, double b0, double bi) {
  double a = v - vi;
  double B = b0 * v - bi;
  double n = v + bei;
  double df1 = 4 * C1 * a * a * a;
  double f2 = C2 - n * n;
  double df2 = -2 * n;
  double f3 = -C3 * a * a + C4 * B * B;
  double df3 = -2 * C3 * a + 2 * C4 * b0 * B;
  return df1 + df2 * f3 + f2 * df3;
}


x86 assembly (clang, -O0):
<grmhd_disp_df>:
push   %rbp
mov    %rsp,%rbp
movsd  0x10(%rbp),%xmm8
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)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe85(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe29(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xdd5(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0xdbb(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grmhd_disp_df>:
movapd %xmm0,%xmm8
subsd  %xmm6,%xmm8
movapd %xmm7,%xmm9
mulsd  %xmm0,%xmm9
subsd  0x8(%rsp),%xmm9
addsd  %xmm5,%xmm0
mulsd  0xed9(%rip),%xmm1
mulsd  %xmm8,%xmm1
mulsd  %xmm8,%xmm1
mulsd  %xmm8,%xmm1
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
subsd  %xmm5,%xmm2
movsd  0xebe(%rip),%xmm5
mulsd  %xmm5,%xmm0
movapd %xmm8,%xmm10
mulsd  %xmm3,%xmm10
movapd %xmm9,%xmm6
mulsd  %xmm4,%xmm6
mulsd  %xmm9,%xmm6
mulsd  %xmm8,%xmm10
subsd  %xmm10,%xmm6
mulsd  %xmm6,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm4
mulsd  %xmm7,%xmm4
mulsd  %xmm4,%xmm9
mulsd  %xmm8,%xmm5
addsd  %xmm9,%xmm5
mulsd  %xmm2,%xmm5
addsd  %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @grmhd_disp_df(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
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
%27 = load double, double* %10
%28 = load double, double* %16
%29 = fsub double %27, %28
store double %29, double* %19
%30 = load double, double* %17
%31 = load double, double* %10
%32 = load double, double* %18
%33 = fneg double %32
%34 = call double @llvm.fmuladd.f64(double %30, double %31, double %33)
store double %34, double* %20
%35 = load double, double* %10
%36 = load double, double* %15
%37 = fadd double %35, %36
store double %37, double* %21
%38 = load double, double* %11
%39 = fmul double 4.000000e+00, %38
%40 = load double, double* %19
%41 = fmul double %39, %40
%42 = load double, double* %19
%43 = fmul double %41, %42
%44 = load double, double* %19
%45 = fmul double %43, %44
store double %45, double* %22
%46 = load double, double* %12
%47 = load double, double* %21
%48 = load double, double* %21
%49 = fneg double %47
%50 = call double @llvm.fmuladd.f64(double %49, double %48, double %46)
store double %50, double* %23
%51 = load double, double* %21
%52 = fmul double -2.000000e+00, %51
store double %52, double* %24
%53 = load double, double* %13
%54 = fneg double %53
%55 = load double, double* %19
%56 = fmul double %54, %55
%57 = load double, double* %19
%58 = load double, double* %14
%59 = load double, double* %20
%60 = fmul double %58, %59
%61 = load double, double* %20
%62 = fmul double %60, %61
%63 = call double @llvm.fmuladd.f64(double %56, double %57, double %62)
store double %63, double* %25
%64 = load double, double* %13
%65 = fmul double -2.000000e+00, %64
%66 = load double, double* %19
%67 = load double, double* %14
%68 = fmul double 2.000000e+00, %67
%69 = load double, double* %17
%70 = fmul double %68, %69
%71 = load double, double* %20
%72 = fmul double %70, %71
%73 = call double @llvm.fmuladd.f64(double %65, double %66, double %72)
store double %73, double* %26
%74 = load double, double* %22
%75 = load double, double* %24
%76 = load double, double* %25
%77 = call double @llvm.fmuladd.f64(double %75, double %76, double %74)
%78 = load double, double* %23
%79 = load double, double* %26
%80 = call double @llvm.fmuladd.f64(double %78, double %79, double %77)
ret double %80
}

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